summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--COPYRIGHT2
-rwxr-xr-xbin/prado-cli.php22
-rw-r--r--build.xml4
-rw-r--r--buildscripts/apigen/pradosoft/@layout.latte2
-rw-r--r--buildscripts/classtree/DWExtension.php1
-rw-r--r--buildscripts/index/build.php2
-rw-r--r--buildscripts/index/quickstart_index.php1
-rw-r--r--buildscripts/index/search.php4
-rw-r--r--buildscripts/phing/tasks/PradoPearTask.php2
-rw-r--r--buildscripts/phpbuilder/build.php2
-rw-r--r--buildscripts/setup.php39
-rw-r--r--buildscripts/texbuilder/Page2Tex.php2
-rw-r--r--buildscripts/texbuilder/quickstart/build.php3
-rw-r--r--buildscripts/texbuilder/quickstart/pages.php2
-rw-r--r--buildscripts/texbuilder/quickstart/quickstart.tex4
-rw-r--r--buildscripts/texbuilder/sqlmap/build.php3
-rw-r--r--buildscripts/texbuilder/sqlmap/pages.php2
-rw-r--r--buildscripts/texbuilder/time-tracker/pages.php2
-rwxr-xr-xdemos/blog-tutorial/protected/pages/Day1/CreateContact.page31
-rwxr-xr-xdemos/blog-tutorial/protected/pages/Day1/Setup.page5
-rwxr-xr-xdemos/blog-tutorial/protected/pages/Day1/ShareLayout.page2
-rwxr-xr-xdemos/blog-tutorial/protected/pages/Day1/fr/CreateContact.page33
-rwxr-xr-xdemos/blog-tutorial/protected/pages/Day1/fr/Setup.page7
-rwxr-xr-xdemos/blog-tutorial/protected/pages/Day1/fr/ShareLayout.page4
-rwxr-xr-xdemos/blog-tutorial/protected/pages/Day1/id/CreateContact.page31
-rwxr-xr-xdemos/blog-tutorial/protected/pages/Day1/id/Setup.page5
-rwxr-xr-xdemos/blog-tutorial/protected/pages/Day1/id/ShareLayout.page2
-rw-r--r--[-rwxr-xr-x]demos/blog-tutorial/protected/pages/Day2/CreateAR.page123
-rw-r--r--demos/blog-tutorial/protected/pages/Day2/blog_wsat_generate_ar.pngbin0 -> 69184 bytes
-rw-r--r--demos/blog-tutorial/protected/pages/Day2/wsat_login.pngbin0 -> 47951 bytes
-rwxr-xr-xdemos/blog/protected/Common/BlogDataModule.php7
-rwxr-xr-xdemos/blog/protected/Common/BlogErrorHandler.php1
-rwxr-xr-xdemos/blog/protected/Common/BlogException.php1
-rwxr-xr-xdemos/blog/protected/Common/BlogPage.php1
-rwxr-xr-xdemos/blog/protected/Common/BlogUser.php1
-rwxr-xr-xdemos/blog/protected/Common/BlogUserManager.php1
-rwxr-xr-xdemos/blog/protected/Common/XListMenu.php1
-rwxr-xr-xdemos/blog/protected/Layouts/MainLayout.php1
-rwxr-xr-xdemos/blog/protected/Pages/Admin/AdminMenu.php1
-rwxr-xr-xdemos/blog/protected/Pages/Admin/ConfigMan.php1
-rwxr-xr-xdemos/blog/protected/Pages/Admin/PostMan.php1
-rwxr-xr-xdemos/blog/protected/Pages/Admin/UserMan.php1
-rwxr-xr-xdemos/blog/protected/Pages/ErrorReport.php1
-rwxr-xr-xdemos/blog/protected/Pages/Posts/EditCategory.php1
-rwxr-xr-xdemos/blog/protected/Pages/Posts/EditPost.php1
-rwxr-xr-xdemos/blog/protected/Pages/Posts/ListPost.php1
-rwxr-xr-xdemos/blog/protected/Pages/Posts/MyPost.php1
-rwxr-xr-xdemos/blog/protected/Pages/Posts/NewCategory.php1
-rwxr-xr-xdemos/blog/protected/Pages/Posts/NewPost.php1
-rwxr-xr-xdemos/blog/protected/Pages/Posts/ViewPost.php1
-rwxr-xr-xdemos/blog/protected/Pages/Users/EditUser.php1
-rwxr-xr-xdemos/blog/protected/Pages/Users/NewUser.php1
-rwxr-xr-xdemos/blog/protected/Pages/Users/ViewUser.php1
-rwxr-xr-xdemos/blog/protected/Portlets/AccountPortlet.php1
-rwxr-xr-xdemos/blog/protected/Portlets/ArchivePortlet.php1
-rwxr-xr-xdemos/blog/protected/Portlets/CategoryPortlet.php1
-rwxr-xr-xdemos/blog/protected/Portlets/CommentPortlet.php1
-rwxr-xr-xdemos/blog/protected/Portlets/LoginPortlet.php1
-rwxr-xr-xdemos/blog/protected/Portlets/Portlet.php1
-rwxr-xr-xdemos/blog/protected/Portlets/SearchPortlet.php1
-rwxr-xr-xdemos/chat/protected/pages/Home.page9
-rwxr-xr-xdemos/quickstart/protected/controls/Layout.tpl2
-rwxr-xr-xdemos/quickstart/protected/controls/SampleLayout.tpl2
-rw-r--r--[-rwxr-xr-x]demos/quickstart/protected/controls/TopicList.tpl12
-rwxr-xr-xdemos/quickstart/protected/controls/es/SampleLayout.tpl2
-rw-r--r--[-rwxr-xr-x]demos/quickstart/protected/controls/es/TopicList.tpl11
-rwxr-xr-xdemos/quickstart/protected/controls/fr/SampleLayout.tpl2
-rw-r--r--[-rwxr-xr-x]demos/quickstart/protected/controls/fr/TopicList.tpl7
-rw-r--r--[-rwxr-xr-x]demos/quickstart/protected/controls/id/TopicList.tpl9
-rw-r--r--[-rwxr-xr-x]demos/quickstart/protected/controls/ja/TopicList.tpl9
-rw-r--r--[-rwxr-xr-x]demos/quickstart/protected/controls/pl/TopicList.tpl9
-rw-r--r--[-rwxr-xr-x]demos/quickstart/protected/controls/zh/TopicList.tpl7
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/ActiveButton.page66
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/ActiveRatingList.page32
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Home.page117
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Introduction.page203
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/Home.php35
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.page1
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBox/Home.page1
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/TActiveCustomValidator/Home.page1
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/TActiveHyperLink/Home.page1
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/TActivePager/Home.page34
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/TActivePanel/Home.page1
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRatingList/Home.page71
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRatingList/Home.php9
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/TActiveTableRow/Home.page1
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.page4
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.php2
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/TCallback/Home.page2
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page42
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php68
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientSide/Home.page1
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/TCallbackOptions/Home.page1
-rwxr-xr-xdemos/quickstart/protected/pages/Advanced/Error.page2
-rwxr-xr-xdemos/quickstart/protected/pages/Advanced/Samples/I18N/LanguageList.php6
-rwxr-xr-xdemos/quickstart/protected/pages/Configurations/Templates1.page2
-rwxr-xr-xdemos/quickstart/protected/pages/Controls/Data.page6
-rwxr-xr-xdemos/quickstart/protected/pages/Controls/List.page2
-rw-r--r--demos/quickstart/protected/pages/Controls/Markdown.page40
-rwxr-xr-xdemos/quickstart/protected/pages/Controls/NewControl.page2
-rwxr-xr-xdemos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page7
-rwxr-xr-xdemos/quickstart/protected/pages/Controls/Samples/THtmlArea/Home.page8
-rwxr-xr-xdemos/quickstart/protected/pages/Controls/Samples/THtmlArea4/Home.page8
-rwxr-xr-xdemos/quickstart/protected/pages/Controls/Samples/TMarkdown/Home.page31
-rwxr-xr-xdemos/quickstart/protected/pages/Controls/Samples/TPanel/Home.page1
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TRatingList/Home.page71
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TRatingList/Home.php9
-rwxr-xr-xdemos/quickstart/protected/pages/Controls/Samples/TSlider/Home.page8
-rwxr-xr-xdemos/quickstart/protected/pages/Controls/Samples/TTextHighlighter/Home.page1
-rwxr-xr-xdemos/quickstart/protected/pages/Controls/Standard.page8
-rwxr-xr-xdemos/quickstart/protected/pages/Controls/TextHighlighter.page1
-rwxr-xr-xdemos/quickstart/protected/pages/Controls/id/NewControl.page2
-rwxr-xr-xdemos/quickstart/protected/pages/Controls/id/TextHighlighter.page1
-rwxr-xr-xdemos/quickstart/protected/pages/Database/ActiveRecord.page6
-rwxr-xr-xdemos/quickstart/protected/pages/Database/id/ActiveRecord.page140
-rwxr-xr-xdemos/quickstart/protected/pages/Database/pl/ActiveRecord.page66
-rwxr-xr-xdemos/quickstart/protected/pages/Fundamentals/Applications.page4
-rwxr-xr-xdemos/quickstart/protected/pages/Fundamentals/Architecture.page25
-rwxr-xr-xdemos/quickstart/protected/pages/Fundamentals/Components.page360
-rwxr-xr-xdemos/quickstart/protected/pages/Fundamentals/Components1.page157
-rw-r--r--demos/quickstart/protected/pages/Fundamentals/Components2.page207
-rwxr-xr-xdemos/quickstart/protected/pages/Fundamentals/Pages.page16
-rwxr-xr-xdemos/quickstart/protected/pages/Fundamentals/Services.page5
-rwxr-xr-xdemos/quickstart/protected/pages/GettingStarted/AboutPrado.page10
-rw-r--r--[-rwxr-xr-x]demos/quickstart/protected/pages/GettingStarted/CommandLine.page50
-rwxr-xr-xdemos/quickstart/protected/pages/GettingStarted/HelloWorld.page2
-rwxr-xr-xdemos/quickstart/protected/pages/GettingStarted/Installation.page41
-rw-r--r--demos/quickstart/protected/pages/GettingStarted/Upgrading32.page239
-rw-r--r--demos/quickstart/protected/pages/GettingStarted/Wsat.page64
-rw-r--r--demos/quickstart/protected/pages/GettingStarted/wsat_generate_ar.pngbin0 -> 75503 bytes
-rw-r--r--demos/quickstart/protected/pages/GettingStarted/wsat_login.pngbin0 -> 47951 bytes
-rw-r--r--demos/quickstart/protected/pages/JuiControls/Home.page85
-rw-r--r--demos/quickstart/protected/pages/JuiControls/Interactions.page83
-rw-r--r--demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.page29
-rw-r--r--demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.php16
-rw-r--r--demos/quickstart/protected/pages/JuiControls/Samples/TJuiDroppable/Home.page48
-rw-r--r--demos/quickstart/protected/pages/JuiControls/Samples/TJuiDroppable/Home.php30
-rw-r--r--demos/quickstart/protected/pages/JuiControls/Samples/TJuiProgressbar/Home.page55
-rw-r--r--demos/quickstart/protected/pages/JuiControls/Samples/TJuiProgressbar/Home.php14
-rw-r--r--demos/quickstart/protected/pages/JuiControls/Samples/TJuiResizable/Home.page29
-rw-r--r--demos/quickstart/protected/pages/JuiControls/Samples/TJuiResizable/Home.php16
-rw-r--r--demos/quickstart/protected/pages/JuiControls/Samples/TJuiSelectable/Home.page41
-rw-r--r--demos/quickstart/protected/pages/JuiControls/Samples/TJuiSelectable/Home.php32
-rw-r--r--demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.page35
-rw-r--r--demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.php31
-rw-r--r--demos/quickstart/protected/pages/JuiControls/Samples/config.xml8
-rw-r--r--demos/quickstart/protected/pages/JuiControls/Widgets.page28
-rwxr-xr-xdemos/quickstart/protected/pages/Tutorial/AddressBook.page9
-rwxr-xr-xdemos/quickstart/protected/pages/Tutorial/AjaxChat.page8
-rwxr-xr-xdemos/quickstart/protected/pages/Tutorial/CurrencyConverter.page63
-rwxr-xr-xdemos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page6
-rwxr-xr-xdemos/quickstart/protected/pages/Tutorial/fr/CurrencyConverter.page63
-rwxr-xr-xdemos/quickstart/protected/pages/Tutorial/id/AjaxChat.page1
-rwxr-xr-xdemos/quickstart/protected/pages/Tutorial/id/CurrencyConverter.page73
-rwxr-xr-xdemos/sqlmap/protected/pages/Manual/Tutorial/TestFirst.page7
-rwxr-xr-xdemos/sqlmap/protected/pages/Manual/Tutorial/TestSecond.page2
-rwxr-xr-xdemos/time-tracker/protected/App_Code/Dao/BaseDao.php2
-rwxr-xr-xdemos/time-tracker/protected/App_Code/Dao/ProjectDao.php2
-rwxr-xr-xdemos/time-tracker/protected/App_Code/Dao/ProjectRecord.php2
-rwxr-xr-xdemos/time-tracker/protected/App_Code/Dao/UserDao.php2
-rwxr-xr-xdemos/time-tracker/protected/App_Code/DaoManager.php2
-rwxr-xr-xdemos/time-tracker/protected/App_Code/TimeTrackerException.php4
-rwxr-xr-xdemos/time-tracker/protected/App_Code/TimeTrackerUser.php6
-rwxr-xr-xdemos/time-tracker/protected/App_Code/TrackerAuthManager.php19
-rwxr-xr-xdemos/time-tracker/protected/App_Code/UserManager.php2
-rwxr-xr-xdemos/time-tracker/protected/App_Data/TimeTrackerUserTypeHandler.php2
-rwxr-xr-xdemos/time-tracker/protected/pages/TimeTracker/Login.php10
-rwxr-xr-xdemos/time-tracker/protected/pages/TimeTracker/Logout.php4
-rwxr-xr-xdemos/time-tracker/protected/pages/TimeTracker/SiteMap.php6
-rwxr-xr-xdemos/time-tracker/protected/pages/TimeTracker/UserCreate.php20
-rwxr-xr-xdemos/time-tracker/protected/pages/TimeTracker/UserList.php4
-rw-r--r--editors/NotepadPlus/4.x/prado.api5
-rw-r--r--framework/3rdParty/Markdown/License.text34
-rw-r--r--framework/3rdParty/Markdown/MarkdownParser.php1256
-rw-r--r--framework/3rdParty/Parsedown/LICENSE.txt20
-rwxr-xr-xframework/3rdParty/Parsedown/Parsedown.php1135
-rw-r--r--framework/3rdParty/SafeHtml/HTMLSax3.php5
-rw-r--r--framework/3rdParty/SafeHtml/HTMLSax3/Decorators.php1
-rw-r--r--framework/3rdParty/SafeHtml/HTMLSax3/States.php11
-rw-r--r--framework/3rdParty/WsdlGen/Wsdl.php1
-rw-r--r--framework/3rdParty/WsdlGen/WsdlGenerator.php1
-rw-r--r--framework/3rdParty/WsdlGen/WsdlMessage.php1
-rw-r--r--framework/3rdParty/WsdlGen/WsdlOperation.php1
-rw-r--r--framework/3rdParty/readme.html50
-rw-r--r--framework/Caching/TAPCCache.php10
-rw-r--r--framework/Caching/TCache.php11
-rw-r--r--framework/Caching/TDbCache.php10
-rw-r--r--framework/Caching/TEACache.php2
-rw-r--r--framework/Caching/TMemCache.php28
-rw-r--r--framework/Caching/TSqliteCache.php10
-rw-r--r--framework/Caching/TXCache.php4
-rw-r--r--framework/Collections/TAttributeCollection.php4
-rw-r--r--framework/Collections/TDummyDataSource.php5
-rw-r--r--framework/Collections/TList.php21
-rw-r--r--framework/Collections/TListItemCollection.php4
-rw-r--r--framework/Collections/TMap.php7
-rw-r--r--framework/Collections/TPagedDataSource.php6
-rw-r--r--framework/Collections/TPagedList.php6
-rw-r--r--framework/Collections/TPriorityList.php140
-rw-r--r--framework/Collections/TPriorityMap.php72
-rw-r--r--framework/Collections/TQueue.php4
-rw-r--r--framework/Collections/TStack.php7
-rw-r--r--framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php5
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php2
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php2
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php2
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php2
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php2
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php2
-rw-r--r--framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php2
-rw-r--r--framework/Data/ActiveRecord/Scaffold/InputBuilder/TMssqlScaffoldInput.php2
-rw-r--r--framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php2
-rw-r--r--framework/Data/ActiveRecord/Scaffold/InputBuilder/TPgsqlScaffoldInput.php2
-rw-r--r--framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php2
-rw-r--r--framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php2
-rw-r--r--framework/Data/ActiveRecord/Scaffold/InputBuilder/TSqliteScaffoldInput.php2
-rw-r--r--framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php4
-rw-r--r--framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php5
-rw-r--r--framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php4
-rw-r--r--framework/Data/ActiveRecord/Scaffold/TScaffoldSearch.php2
-rw-r--r--framework/Data/ActiveRecord/Scaffold/TScaffoldView.php4
-rw-r--r--framework/Data/ActiveRecord/TActiveRecord.php29
-rw-r--r--framework/Data/ActiveRecord/TActiveRecordConfig.php4
-rw-r--r--framework/Data/ActiveRecord/TActiveRecordCriteria.php4
-rw-r--r--framework/Data/ActiveRecord/TActiveRecordGateway.php4
-rw-r--r--framework/Data/ActiveRecord/TActiveRecordManager.php4
-rw-r--r--framework/Data/Common/Mssql/TMssqlCommandBuilder.php4
-rw-r--r--framework/Data/Common/Mssql/TMssqlMetaData.php32
-rw-r--r--framework/Data/Common/Mssql/TMssqlTableColumn.php4
-rw-r--r--framework/Data/Common/Mssql/TMssqlTableInfo.php4
-rw-r--r--framework/Data/Common/Mysql/TMysqlCommandBuilder.php4
-rw-r--r--framework/Data/Common/Mysql/TMysqlMetaData.php25
-rw-r--r--framework/Data/Common/Mysql/TMysqlTableColumn.php4
-rw-r--r--framework/Data/Common/Mysql/TMysqlTableInfo.php4
-rw-r--r--framework/Data/Common/Oracle/TOracleCommandBuilder.php10
-rw-r--r--framework/Data/Common/Oracle/TOracleMetaData.php44
-rw-r--r--framework/Data/Common/Oracle/TOracleTableColumn.php6
-rw-r--r--framework/Data/Common/Oracle/TOracleTableInfo.php4
-rw-r--r--framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php4
-rw-r--r--framework/Data/Common/Pgsql/TPgsqlMetaData.php32
-rw-r--r--framework/Data/Common/Pgsql/TPgsqlTableColumn.php4
-rw-r--r--framework/Data/Common/Pgsql/TPgsqlTableInfo.php4
-rw-r--r--framework/Data/Common/Sqlite/TSqliteCommandBuilder.php4
-rw-r--r--framework/Data/Common/Sqlite/TSqliteMetaData.php32
-rw-r--r--framework/Data/Common/Sqlite/TSqliteTableColumn.php4
-rw-r--r--framework/Data/Common/Sqlite/TSqliteTableInfo.php4
-rw-r--r--framework/Data/Common/TDbCommandBuilder.php4
-rw-r--r--framework/Data/Common/TDbMetaData.php14
-rw-r--r--framework/Data/Common/TDbTableColumn.php4
-rw-r--r--framework/Data/Common/TDbTableInfo.php4
-rw-r--r--framework/Data/DataGateway/TDataGatewayCommand.php2
-rw-r--r--framework/Data/DataGateway/TSqlCriteria.php4
-rw-r--r--framework/Data/DataGateway/TTableGateway.php2
-rw-r--r--framework/Data/SqlMap/Configuration/TDiscriminator.php5
-rw-r--r--framework/Data/SqlMap/Configuration/TInlineParameterMapParser.php8
-rw-r--r--framework/Data/SqlMap/Configuration/TParameterMap.php10
-rw-r--r--framework/Data/SqlMap/Configuration/TParameterProperty.php6
-rw-r--r--framework/Data/SqlMap/Configuration/TResultMap.php4
-rw-r--r--framework/Data/SqlMap/Configuration/TResultProperty.php6
-rw-r--r--framework/Data/SqlMap/Configuration/TSimpleDynamicParser.php4
-rw-r--r--framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php6
-rw-r--r--framework/Data/SqlMap/Configuration/TSqlMapStatement.php11
-rw-r--r--framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php6
-rw-r--r--framework/Data/SqlMap/DataMapper/TFastSqlMapApplicationCache.php16
-rw-r--r--framework/Data/SqlMap/DataMapper/TLazyLoadList.php5
-rw-r--r--framework/Data/SqlMap/DataMapper/TPropertyAccess.php4
-rw-r--r--framework/Data/SqlMap/DataMapper/TSqlMapCache.php7
-rw-r--r--framework/Data/SqlMap/DataMapper/TSqlMapException.php5
-rw-r--r--framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php4
-rw-r--r--framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php5
-rw-r--r--framework/Data/SqlMap/Statements/IMappedStatement.php2
-rw-r--r--framework/Data/SqlMap/Statements/TCachingStatement.php4
-rw-r--r--framework/Data/SqlMap/Statements/TDeleteMappedStatement.php4
-rw-r--r--framework/Data/SqlMap/Statements/TInsertMappedStatement.php4
-rw-r--r--framework/Data/SqlMap/Statements/TMappedStatement.php14
-rw-r--r--framework/Data/SqlMap/Statements/TPreparedCommand.php4
-rw-r--r--framework/Data/SqlMap/Statements/TPreparedStatement.php16
-rw-r--r--framework/Data/SqlMap/Statements/TPreparedStatementFactory.php4
-rw-r--r--framework/Data/SqlMap/Statements/TSelectMappedStatement.php4
-rw-r--r--framework/Data/SqlMap/Statements/TSimpleDynamicSql.php4
-rw-r--r--framework/Data/SqlMap/Statements/TStaticSql.php4
-rw-r--r--framework/Data/SqlMap/Statements/TUpdateMappedStatement.php4
-rw-r--r--framework/Data/SqlMap/TSqlMapConfig.php4
-rw-r--r--framework/Data/SqlMap/TSqlMapGateway.php4
-rw-r--r--framework/Data/SqlMap/TSqlMapManager.php4
-rw-r--r--framework/Data/TDataSourceConfig.php4
-rw-r--r--framework/Data/TDbCommand.php8
-rw-r--r--framework/Data/TDbConnection.php8
-rw-r--r--framework/Data/TDbDataReader.php4
-rw-r--r--framework/Data/TDbTransaction.php4
-rw-r--r--framework/Exceptions/TErrorHandler.php4
-rw-r--r--framework/Exceptions/TException.php19
-rw-r--r--framework/Exceptions/messages/messages.txt7
-rw-r--r--framework/I18N/TChoiceFormat.php5
-rw-r--r--framework/I18N/TDateFormat.php9
-rw-r--r--framework/I18N/TGlobalization.php3
-rw-r--r--framework/I18N/TGlobalizationAutoDetect.php4
-rw-r--r--framework/I18N/TI18NControl.php3
-rw-r--r--framework/I18N/TNumberFormat.php5
-rw-r--r--framework/I18N/TTranslate.php5
-rw-r--r--framework/I18N/TTranslateParameter.php3
-rw-r--r--framework/I18N/Translation.php5
-rw-r--r--framework/I18N/core/CultureInfo.php2
-rw-r--r--framework/I18N/core/Gettext/TGettext.php66
-rw-r--r--framework/I18N/core/MessageCache.php48
-rw-r--r--framework/I18N/core/TCache_Lite.php1
-rw-r--r--framework/IO/TTarFileExtractor.php2
-rw-r--r--framework/IO/TTextWriter.php4
-rw-r--r--framework/PradoBase.php28
-rw-r--r--framework/Security/IUserManager.php4
-rw-r--r--framework/Security/TAuthManager.php12
-rw-r--r--framework/Security/TAuthorizationRule.php5
-rw-r--r--framework/Security/TDbUserManager.php5
-rw-r--r--framework/Security/TSecurityManager.php5
-rw-r--r--framework/Security/TUser.php4
-rw-r--r--framework/Security/TUserManager.php9
-rw-r--r--framework/TApplication.php41
-rw-r--r--framework/TApplicationComponent.php4
-rw-r--r--framework/TComponent.php394
-rw-r--r--framework/TModule.php4
-rw-r--r--framework/TService.php4
-rw-r--r--framework/TShellApplication.php4
-rw-r--r--framework/Util/TBehavior.php1
-rw-r--r--framework/Util/TCallChain.php35
-rw-r--r--framework/Util/TClassBehavior.php3
-rw-r--r--framework/Util/TDataFieldAccessor.php6
-rw-r--r--framework/Util/TDateTimeStamp.php8
-rw-r--r--framework/Util/TLogRouter.php23
-rw-r--r--framework/Util/TLogger.php12
-rw-r--r--framework/Util/TParameterModule.php4
-rw-r--r--framework/Util/TRpcClient.php9
-rw-r--r--framework/Util/TSimpleDateFormatter.php8
-rw-r--r--framework/Util/TVarDumper.php4
-rw-r--r--framework/Web/Javascripts/TJavaScript.php21
-rw-r--r--framework/Web/Javascripts/packages.php111
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/images/animated-overlay.gifbin0 -> 1738 bytes
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_flat_0_aaaaaa_40x100.pngbin0 -> 180 bytes
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_flat_75_ffffff_40x100.pngbin0 -> 178 bytes
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_55_fbf9ee_1x400.pngbin0 -> 120 bytes
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_65_ffffff_1x400.pngbin0 -> 105 bytes
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_75_dadada_1x400.pngbin0 -> 111 bytes
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_75_e6e6e6_1x400.pngbin0 -> 110 bytes
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_95_fef1ec_1x400.pngbin0 -> 119 bytes
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_highlight-soft_75_cccccc_1x100.pngbin0 -> 101 bytes
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_222222_256x240.pngbin0 -> 4369 bytes
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_2e83ff_256x240.pngbin0 -> 4369 bytes
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_454545_256x240.pngbin0 -> 4369 bytes
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_888888_256x240.pngbin0 -> 4369 bytes
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_cd0a0a_256x240.pngbin0 -> 4369 bytes
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/jquery-ui.css7
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/jquery.ui.accordion.css5
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/jquery.ui.autocomplete.css5
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/jquery.ui.button.css5
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/jquery.ui.core.css5
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/jquery.ui.datepicker.css5
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/jquery.ui.dialog.css5
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/jquery.ui.menu.css5
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/jquery.ui.progressbar.css5
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/jquery.ui.resizable.css5
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/jquery.ui.selectable.css5
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/jquery.ui.slider.css5
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/jquery.ui.spinner.css5
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/jquery.ui.tabs.css5
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/jquery.ui.theme.css5
-rw-r--r--framework/Web/Javascripts/source/jquery/css/base/jquery.ui.tooltip.css5
-rw-r--r--framework/Web/Javascripts/source/jquery/jquery-ui-i18n.min.js6
-rw-r--r--framework/Web/Javascripts/source/jquery/jquery-ui.js15040
-rw-r--r--framework/Web/Javascripts/source/jquery/jquery-ui.min.js12
-rw-r--r--framework/Web/Javascripts/source/jquery/jquery.js10337
-rw-r--r--framework/Web/Javascripts/source/jquery/jquery.min.js4
-rw-r--r--framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js164
-rwxr-xr-xframework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js38
-rw-r--r--framework/Web/Javascripts/source/prado/activecontrols/ajax3.js1661
-rw-r--r--framework/Web/Javascripts/source/prado/activecontrols/autocomplete.js83
-rwxr-xr-xframework/Web/Javascripts/source/prado/activecontrols/dragdrop.js10
-rw-r--r--framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js72
-rw-r--r--framework/Web/Javascripts/source/prado/activecontrols/json2.js479
-rwxr-xr-xframework/Web/Javascripts/source/prado/activefileupload/activefileupload.js74
-rw-r--r--framework/Web/Javascripts/source/prado/colorpicker/colorpicker.js425
-rw-r--r--framework/Web/Javascripts/source/prado/controls/accordion.js131
-rw-r--r--framework/Web/Javascripts/source/prado/controls/controls.js237
-rw-r--r--framework/Web/Javascripts/source/prado/controls/htmlarea.js46
-rw-r--r--framework/Web/Javascripts/source/prado/controls/htmlarea4.js12
-rw-r--r--framework/Web/Javascripts/source/prado/controls/keyboard.js2
-rw-r--r--framework/Web/Javascripts/source/prado/controls/slider.js201
-rw-r--r--framework/Web/Javascripts/source/prado/controls/tabpanel.js34
-rw-r--r--framework/Web/Javascripts/source/prado/datepicker/datepicker.js186
-rw-r--r--framework/Web/Javascripts/source/prado/logger/logger.js57
-rw-r--r--framework/Web/Javascripts/source/prado/prado.js1278
-rw-r--r--framework/Web/Javascripts/source/prado/ratings/ratings.js153
-rw-r--r--framework/Web/Javascripts/source/prado/validator/validation3.js338
-rw-r--r--framework/Web/Services/TFeedService.php4
-rw-r--r--framework/Web/Services/TJsonService.php7
-rw-r--r--framework/Web/Services/TPageService.php15
-rw-r--r--framework/Web/Services/TRpcService.php3
-rw-r--r--framework/Web/Services/TSoapService.php6
-rw-r--r--framework/Web/TAssetManager.php4
-rw-r--r--framework/Web/TCacheHttpSession.php4
-rw-r--r--framework/Web/THttpRequest.php10
-rw-r--r--framework/Web/THttpResponse.php4
-rw-r--r--framework/Web/THttpResponseAdapter.php2
-rw-r--r--framework/Web/THttpSession.php8
-rw-r--r--framework/Web/THttpUtility.php4
-rw-r--r--framework/Web/TUrlManager.php4
-rw-r--r--framework/Web/TUrlMapping.php8
-rw-r--r--framework/Web/UI/ActiveControls/TActiveButton.php6
-rw-r--r--framework/Web/UI/ActiveControls/TActiveCheckBox.php8
-rw-r--r--framework/Web/UI/ActiveControls/TActiveCheckBoxList.php30
-rwxr-xr-xframework/Web/UI/ActiveControls/TActiveClientScript.php10
-rw-r--r--framework/Web/UI/ActiveControls/TActiveControlAdapter.php29
-rw-r--r--framework/Web/UI/ActiveControls/TActiveCustomValidator.php5
-rw-r--r--framework/Web/UI/ActiveControls/TActiveDataGrid.php4
-rw-r--r--framework/Web/UI/ActiveControls/TActiveDataList.php21
-rwxr-xr-xframework/Web/UI/ActiveControls/TActiveDatePicker.php31
-rw-r--r--framework/Web/UI/ActiveControls/TActiveDropDownList.php4
-rwxr-xr-xframework/Web/UI/ActiveControls/TActiveFileUpload.php115
-rw-r--r--framework/Web/UI/ActiveControls/TActiveHiddenField.php2
-rw-r--r--framework/Web/UI/ActiveControls/TActiveHyperLink.php4
-rw-r--r--framework/Web/UI/ActiveControls/TActiveImage.php4
-rw-r--r--framework/Web/UI/ActiveControls/TActiveImageButton.php16
-rw-r--r--framework/Web/UI/ActiveControls/TActiveLabel.php4
-rw-r--r--framework/Web/UI/ActiveControls/TActiveLinkButton.php6
-rw-r--r--framework/Web/UI/ActiveControls/TActiveListBox.php10
-rw-r--r--framework/Web/UI/ActiveControls/TActiveListControlAdapter.php5
-rw-r--r--framework/Web/UI/ActiveControls/TActivePageAdapter.php29
-rw-r--r--framework/Web/UI/ActiveControls/TActivePager.php50
-rw-r--r--framework/Web/UI/ActiveControls/TActivePanel.php6
-rw-r--r--framework/Web/UI/ActiveControls/TActiveRadioButton.php6
-rw-r--r--framework/Web/UI/ActiveControls/TActiveRadioButtonList.php32
-rw-r--r--framework/Web/UI/ActiveControls/TActiveRatingList.php8
-rw-r--r--framework/Web/UI/ActiveControls/TActiveRepeater.php1
-rw-r--r--framework/Web/UI/ActiveControls/TActiveTextBox.php4
-rw-r--r--framework/Web/UI/ActiveControls/TAutoComplete.php11
-rw-r--r--framework/Web/UI/ActiveControls/TBaseActiveControl.php8
-rw-r--r--framework/Web/UI/ActiveControls/TCallback.php4
-rw-r--r--framework/Web/UI/ActiveControls/TCallbackClientScript.php455
-rw-r--r--framework/Web/UI/ActiveControls/TCallbackClientSide.php8
-rw-r--r--framework/Web/UI/ActiveControls/TCallbackEventParameter.php3
-rw-r--r--framework/Web/UI/ActiveControls/TCallbackOptions.php4
-rwxr-xr-xframework/Web/UI/ActiveControls/TCallbackResponseAdapter.php5
-rwxr-xr-xframework/Web/UI/ActiveControls/TDraggable.php37
-rwxr-xr-xframework/Web/UI/ActiveControls/TDropContainer.php58
-rw-r--r--framework/Web/UI/ActiveControls/TEventTriggeredCallback.php4
-rw-r--r--framework/Web/UI/ActiveControls/TInPlaceTextBox.php10
-rw-r--r--framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php4
-rw-r--r--framework/Web/UI/ActiveControls/TTriggeredCallback.php4
-rw-r--r--framework/Web/UI/ActiveControls/TValueTriggeredCallback.php4
-rw-r--r--framework/Web/UI/JuiControls/TJuiAutoComplete.php430
-rw-r--r--framework/Web/UI/JuiControls/TJuiControlAdapter.php292
-rw-r--r--framework/Web/UI/JuiControls/TJuiDraggable.php150
-rw-r--r--framework/Web/UI/JuiControls/TJuiDroppable.php201
-rw-r--r--framework/Web/UI/JuiControls/TJuiProgressbar.php137
-rw-r--r--framework/Web/UI/JuiControls/TJuiResizable.php153
-rw-r--r--framework/Web/UI/JuiControls/TJuiSelectable.php261
-rw-r--r--framework/Web/UI/JuiControls/TJuiSortable.php314
-rw-r--r--framework/Web/UI/TCachePageStatePersister.php4
-rw-r--r--framework/Web/UI/TClientScriptManager.php43
-rw-r--r--framework/Web/UI/TCompositeControl.php4
-rw-r--r--framework/Web/UI/TControl.php28
-rw-r--r--framework/Web/UI/TControlAdapter.php4
-rw-r--r--framework/Web/UI/TForm.php6
-rw-r--r--framework/Web/UI/THtmlWriter.php6
-rw-r--r--framework/Web/UI/TPage.php45
-rw-r--r--framework/Web/UI/TPageStatePersister.php4
-rw-r--r--framework/Web/UI/TSessionPageStatePersister.php4
-rw-r--r--framework/Web/UI/TTemplateControl.php4
-rw-r--r--framework/Web/UI/TTemplateManager.php5
-rw-r--r--framework/Web/UI/TThemeManager.php5
-rw-r--r--framework/Web/UI/WebControls/TAccordion.php22
-rw-r--r--framework/Web/UI/WebControls/TBaseDataList.php4
-rw-r--r--framework/Web/UI/WebControls/TBaseValidator.php9
-rw-r--r--framework/Web/UI/WebControls/TBoundColumn.php4
-rw-r--r--framework/Web/UI/WebControls/TBulletedList.php7
-rw-r--r--framework/Web/UI/WebControls/TButton.php5
-rw-r--r--framework/Web/UI/WebControls/TButtonColumn.php4
-rw-r--r--framework/Web/UI/WebControls/TCaptcha.php4
-rw-r--r--framework/Web/UI/WebControls/TCaptchaValidator.php4
-rw-r--r--framework/Web/UI/WebControls/TCheckBox.php9
-rw-r--r--framework/Web/UI/WebControls/TCheckBoxColumn.php4
-rw-r--r--framework/Web/UI/WebControls/TCheckBoxList.php30
-rw-r--r--framework/Web/UI/WebControls/TClientScript.php6
-rw-r--r--framework/Web/UI/WebControls/TColorPicker.php12
-rw-r--r--framework/Web/UI/WebControls/TCompareValidator.php5
-rw-r--r--framework/Web/UI/WebControls/TConditional.php4
-rw-r--r--framework/Web/UI/WebControls/TContent.php4
-rw-r--r--framework/Web/UI/WebControls/TContentPlaceHolder.php4
-rw-r--r--framework/Web/UI/WebControls/TCustomValidator.php5
-rw-r--r--framework/Web/UI/WebControls/TDataBoundControl.php6
-rw-r--r--framework/Web/UI/WebControls/TDataGrid.php18
-rw-r--r--framework/Web/UI/WebControls/TDataGridColumn.php5
-rw-r--r--framework/Web/UI/WebControls/TDataGridItemRenderer.php4
-rw-r--r--framework/Web/UI/WebControls/TDataGridPagerStyle.php4
-rw-r--r--framework/Web/UI/WebControls/TDataList.php8
-rw-r--r--framework/Web/UI/WebControls/TDataListItemRenderer.php4
-rw-r--r--framework/Web/UI/WebControls/TDataRenderer.php4
-rw-r--r--framework/Web/UI/WebControls/TDataSourceControl.php6
-rw-r--r--framework/Web/UI/WebControls/TDataSourceView.php6
-rw-r--r--framework/Web/UI/WebControls/TDataTypeValidator.php4
-rw-r--r--framework/Web/UI/WebControls/TDatePicker.php19
-rw-r--r--framework/Web/UI/WebControls/TDropDownList.php6
-rw-r--r--framework/Web/UI/WebControls/TDropDownListColumn.php4
-rw-r--r--framework/Web/UI/WebControls/TEditCommandColumn.php4
-rw-r--r--framework/Web/UI/WebControls/TEmailAddressValidator.php4
-rw-r--r--framework/Web/UI/WebControls/TExpression.php4
-rw-r--r--framework/Web/UI/WebControls/TFileUpload.php6
-rw-r--r--framework/Web/UI/WebControls/TFlushOutput.php10
-rw-r--r--framework/Web/UI/WebControls/TFont.php4
-rw-r--r--framework/Web/UI/WebControls/THead.php6
-rw-r--r--framework/Web/UI/WebControls/THeader1.php12
-rw-r--r--framework/Web/UI/WebControls/THeader2.php12
-rw-r--r--framework/Web/UI/WebControls/THeader3.php12
-rw-r--r--framework/Web/UI/WebControls/THeader4.php12
-rw-r--r--framework/Web/UI/WebControls/THeader5.php12
-rw-r--r--framework/Web/UI/WebControls/THeader6.php12
-rw-r--r--framework/Web/UI/WebControls/THiddenField.php6
-rw-r--r--framework/Web/UI/WebControls/THtmlArea.php8
-rw-r--r--framework/Web/UI/WebControls/THtmlArea4.php15
-rw-r--r--framework/Web/UI/WebControls/THtmlElement.php12
-rw-r--r--framework/Web/UI/WebControls/THyperLink.php12
-rw-r--r--framework/Web/UI/WebControls/THyperLinkColumn.php12
-rw-r--r--framework/Web/UI/WebControls/TImage.php4
-rw-r--r--framework/Web/UI/WebControls/TImageButton.php5
-rw-r--r--framework/Web/UI/WebControls/TImageMap.php11
-rw-r--r--framework/Web/UI/WebControls/TInlineFrame.php6
-rw-r--r--framework/Web/UI/WebControls/TItemDataRenderer.php4
-rw-r--r--framework/Web/UI/WebControls/TJavascriptLogger.php8
-rw-r--r--framework/Web/UI/WebControls/TKeyboard.php4
-rw-r--r--framework/Web/UI/WebControls/TLabel.php4
-rw-r--r--framework/Web/UI/WebControls/TLinkButton.php4
-rw-r--r--framework/Web/UI/WebControls/TListBox.php7
-rw-r--r--framework/Web/UI/WebControls/TListControl.php6
-rw-r--r--framework/Web/UI/WebControls/TListControlValidator.php4
-rw-r--r--framework/Web/UI/WebControls/TListItem.php4
-rw-r--r--framework/Web/UI/WebControls/TLiteral.php4
-rw-r--r--framework/Web/UI/WebControls/TLiteralColumn.php21
-rw-r--r--framework/Web/UI/WebControls/TMarkdown.php13
-rw-r--r--framework/Web/UI/WebControls/TMultiView.php6
-rw-r--r--framework/Web/UI/WebControls/TOutputCache.php11
-rw-r--r--framework/Web/UI/WebControls/TPager.php9
-rw-r--r--framework/Web/UI/WebControls/TPanel.php11
-rw-r--r--framework/Web/UI/WebControls/TPanelStyle.php6
-rw-r--r--framework/Web/UI/WebControls/TPlaceHolder.php4
-rw-r--r--framework/Web/UI/WebControls/TRadioButton.php20
-rw-r--r--framework/Web/UI/WebControls/TRadioButtonList.php14
-rw-r--r--framework/Web/UI/WebControls/TRangeValidator.php5
-rw-r--r--framework/Web/UI/WebControls/TRatingList.php12
-rw-r--r--framework/Web/UI/WebControls/TReCaptcha.php6
-rw-r--r--framework/Web/UI/WebControls/TReCaptchaValidator.php7
-rw-r--r--framework/Web/UI/WebControls/TRegularExpressionValidator.php4
-rw-r--r--framework/Web/UI/WebControls/TRepeatInfo.php7
-rw-r--r--framework/Web/UI/WebControls/TRepeater.php8
-rw-r--r--framework/Web/UI/WebControls/TRepeaterItemRenderer.php4
-rw-r--r--framework/Web/UI/WebControls/TRequiredFieldValidator.php10
-rw-r--r--framework/Web/UI/WebControls/TSafeHtml.php4
-rw-r--r--framework/Web/UI/WebControls/TSlider.php22
-rw-r--r--framework/Web/UI/WebControls/TStatements.php4
-rw-r--r--framework/Web/UI/WebControls/TStyle.php10
-rw-r--r--framework/Web/UI/WebControls/TStyleSheet.php3
-rw-r--r--framework/Web/UI/WebControls/TTabPanel.php12
-rw-r--r--framework/Web/UI/WebControls/TTable.php6
-rw-r--r--framework/Web/UI/WebControls/TTableCell.php4
-rw-r--r--framework/Web/UI/WebControls/TTableFooterRow.php4
-rw-r--r--framework/Web/UI/WebControls/TTableHeaderCell.php5
-rw-r--r--framework/Web/UI/WebControls/TTableHeaderRow.php4
-rw-r--r--framework/Web/UI/WebControls/TTableRow.php6
-rw-r--r--framework/Web/UI/WebControls/TTemplateColumn.php4
-rw-r--r--framework/Web/UI/WebControls/TTextBox.php6
-rw-r--r--framework/Web/UI/WebControls/TTextHighlighter.php5
-rw-r--r--framework/Web/UI/WebControls/TTextProcessor.php4
-rw-r--r--framework/Web/UI/WebControls/TValidationSummary.php7
-rw-r--r--framework/Web/UI/WebControls/TWebControl.php18
-rw-r--r--framework/Web/UI/WebControls/TWebControlAdapter.php4
-rw-r--r--framework/Web/UI/WebControls/TWebControlDecorator.php134
-rw-r--r--framework/Web/UI/WebControls/TWizard.php18
-rw-r--r--framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php3
-rw-r--r--framework/Web/UI/WebControls/TXmlTransform.php2
-rw-r--r--framework/Web/UI/WebControls/assets/captcha.php5
-rw-r--r--framework/Wsat/TWsatARGenerator.php283
-rw-r--r--framework/Wsat/TWsatService.php81
-rw-r--r--framework/Wsat/pages/TWsatGenerateAR.page56
-rw-r--r--framework/Wsat/pages/TWsatGenerateAR.php57
-rw-r--r--framework/Wsat/pages/TWsatHome.page17
-rw-r--r--framework/Wsat/pages/TWsatHome.php17
-rw-r--r--framework/Wsat/pages/TWsatLogin.page45
-rw-r--r--framework/Wsat/pages/TWsatLogin.php33
-rw-r--r--framework/Wsat/pages/TWsatScaffolding.page3
-rw-r--r--framework/Wsat/pages/TWsatScaffolding.php17
-rw-r--r--framework/Wsat/pages/config.xml9
-rw-r--r--framework/Wsat/pages/layout/TWsatLayout.php36
-rw-r--r--framework/Wsat/pages/layout/TWsatLayout.tpl53
-rw-r--r--framework/Wsat/themes/.htaccess1
-rw-r--r--framework/Wsat/themes/PradoSoft/imgs/arrowdown.gifbin0 -> 836 bytes
-rw-r--r--framework/Wsat/themes/PradoSoft/imgs/mantisbg.jpgbin0 -> 4043 bytes
-rw-r--r--framework/Wsat/themes/PradoSoft/imgs/pradologo.gifbin0 -> 3039 bytes
-rw-r--r--framework/Wsat/themes/PradoSoft/main.css152
-rw-r--r--framework/Xml/TXmlDocument.php8
-rw-r--r--framework/interfaces.php16
-rw-r--r--framework/prado.php4
-rw-r--r--framework/pradolite.php104
-rw-r--r--index.html4
-rw-r--r--jQuery-WIP.txt34
-rw-r--r--requirements/index.php3
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveBricksTest.page6
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page6
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveControlExpressionTag.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveControlWithTinyMce.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page11
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveDropDownList.page6
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page9
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveHyperLinkTest.page8
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page6
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.page6
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveListBoxMasterTest.page2
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.page6
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page21
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActivePanelVisibleTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.page6
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveRedirectionTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page9
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/Calculator.page18
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/Callback.page14
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page6
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/CallbackOptionsTest.page14
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ClientSideDispatch.page15
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page9
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.page7
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page21
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/DatePickerInCallback.page4
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/DisplayStyleTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/DynamicRepeaterDataTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/FeatureList.page6
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/GerTurno2.page7
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.page18
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/LargePageStateTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/LargePageStateTest2.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/Layout.php5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/Layout.tpl38
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/MessagesPanelTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page27
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/NullStateTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/PopulateActiveList.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page24
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/RadioButtonListTest.page13
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/RatingList.page6
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page8
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/TActiveCheckBoxListTest.page6
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.page12
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page9
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page5
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.page6
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/config.xml5
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveButtonTestCase.php13
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveCheckBoxListTestCase.php32
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveCheckBoxTestCase.php53
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveControlExpressTagTestCase.php17
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php179
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php41
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php21
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveHyperLinkTestCase.php13
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveImageButtonTestCase.php13
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveLinkButtonTestCase.php13
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php42
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveListBoxTestCase.php43
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActivePanelTestCase.php13
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveRadioButtonListTestCase.php28
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveRadioButtonTestCase.php63
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php45
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/CalculatorTestCase.php29
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php65
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/CallbackOptionsTestCase.php13
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/CustomTemplateTestCase.php19
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/DelayedCallbackTestCase.php17
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/EventTriggerTestCase.php17
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/NestedActiveControlsTestCase.php27
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/PopulateListTestCase.php21
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php17
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ReplaceContentTestCase.php88
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/TextBoxCallbackTestCase.php13
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/TextBoxGroupValidationTestCase.php21
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/TimeTriggeredCallbackTestCase.php13
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php17
-rwxr-xr-xtests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php310
-rwxr-xr-xtests/FunctionalTests/features/protected/controls/Layout.tpl1
-rwxr-xr-xtests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php18
-rwxr-xr-xtests/FunctionalTests/features/protected/pages/RatingList.page30
-rwxr-xr-xtests/FunctionalTests/features/protected/pages/RatingList.php9
-rwxr-xr-xtests/FunctionalTests/features/tests/MyTestCase.php6
-rw-r--r--tests/FunctionalTests/issues/protected/pages/Issue516.page50
-rw-r--r--tests/FunctionalTests/issues/protected/pages/Issue516.php115
-rw-r--r--tests/FunctionalTests/issues/tests/Issue516TestCase.php37
-rwxr-xr-xtests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php32
-rwxr-xr-xtests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php69
-rwxr-xr-xtests/FunctionalTests/quickstart/ActiveControls/ActiveCustomValidatorTestCase.php12
-rwxr-xr-xtests/FunctionalTests/quickstart/Advanced/I18N.php86
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/BulletedListTestCase.php38
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/ButtonTestCase.php30
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php40
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php56
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php36
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/DataGrid2TestCase.php56
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/DataGrid3TestCase.php65
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/DataGrid4TestCase.php34
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/DataGrid5TestCase.php166
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/DataGrid6TestCase.php68
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/DataList1TestCase.php26
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/DataList2TestCase.php73
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/DropDownListTestCase.php62
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/ExpressionTestCase.php8
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/HtmlAreaTestCase.php6
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/HyperLinkTestCase.php16
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php24
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/ImageTestCase.php16
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/LabelTestCase.php18
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php28
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php79
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/MultiViewTestCase.php34
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/PagerTestCase.php82
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/PanelTestCase.php18
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php40
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php64
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/Repeater1TestCase.php32
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/Repeater2TestCase.php48
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/Repeater3TestCase.php32
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/StatementsTestCase.php8
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/TabPanelTestCase.php52
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/TableTestCase.php18
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php72
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/Wizard1TestCase.php24
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/Wizard2TestCase.php24
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/Wizard3TestCase.php40
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/Wizard4TestCase.php36
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/Wizard5TestCase.php30
-rwxr-xr-xtests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php50
-rwxr-xr-xtests/FunctionalTests/tickets/protected/controls/ToggleImageButton.php1
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/ExtendedToggleImageButton.php7
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Layout.tpl9
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket220.page18
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket278.page12
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket290.page9
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket504.page18
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket585.page8
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket586.page1
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket653/Layout.tpl9
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket659.php5
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket691.page4
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket703/Ticket703.php10
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket719.page3
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket785.page16
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket897.php4
-rwxr-xr-x[-rw-r--r--]tests/FunctionalTests/tickets/protected/pages/ToggleTest.page0
-rwxr-xr-x[-rw-r--r--]tests/FunctionalTests/tickets/protected/pages/ToggleTest.php8
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Issue120TestCase.php12
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Issue216TestCase.php14
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket121TestCase.php16
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket163TestCase.php10
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket169TestCase.php6
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket191TestCase.php10
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket205TestCase.php28
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket207TestCase.php26
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket21TestCase.php14
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket220TestCase.php12
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket225TestCase.php14
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket227TestCase.php6
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket239TestCase.php72
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket246TestCase.php6
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket274TestCase.php10
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket278TestCase.php20
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket27TestCase.php16
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket284TestCase.php10
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket285TestCase.php8
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket28TestCase.php12
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket290TestCase.php21
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket433TestCase.php8
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket439TestCase.php11
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket463TestCase.php8
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket470TestCase.php18
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket477TestCase.php10
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket488TestCase.php39
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket504TestCase.php14
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket507TestCase.php8
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket521TestCase.php8
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket526TestCase.php8
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket528TestCase.php6
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket535TestCase.php30
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket538TestCase.php10
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket54TestCase.php6
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket573TestCase.php6
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket578TestCase.php21
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket585TestCase.php10
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket586TestCase.php8
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket587TestCase.php13
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket592TestCase.php46
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket595TestCase.php32
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket622TestCase.php17
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket653TestCase.php6
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket656TestCase.php19
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket659TestCase.php10
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket660TestCase.php14
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket669TestCase.php68
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket670TestCase.php14
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket671TestCase.php40
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket671_reopenedTestCase.php34
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket679TestCase.php30
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket691TestCase.php14
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket698TestCase.php12
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket700TestCase.php96
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket703TestCase.php17
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket708TestCase.php22
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket719TestCase.php45
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket722TestCase.php34
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket72TestCase.php10
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket745TestCase.php13
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket769TestCase.php33
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket785TestCase.php24
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket823TestCase.php8
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket828TestCase.php32
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket849TestCase.php10
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket876TestCase.php24
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket886TestCase.php10
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket897TestCase.php14
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket900TestCase.php14
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket922TestCase.php10
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket93TestCase.php8
-rwxr-xr-xtests/FunctionalTests/validators/protected/pages/ConditionalValidation.page2
-rwxr-xr-xtests/FunctionalTests/validators/protected/pages/CustomValidator.page4
-rwxr-xr-xtests/FunctionalTests/validators/protected/pages/Layout.tpl1
-rwxr-xr-xtests/FunctionalTests/validators/protected/pages/ListControl.page28
-rwxr-xr-xtests/FunctionalTests/validators/tests/ButtonTestCase.php72
-rwxr-xr-xtests/FunctionalTests/validators/tests/CheckBoxTestCase.php76
-rwxr-xr-xtests/FunctionalTests/validators/tests/CompareValidatorTestCase.php29
-rwxr-xr-xtests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php60
-rwxr-xr-xtests/FunctionalTests/validators/tests/CustomValidatorTestCase.php12
-rwxr-xr-xtests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php33
-rwxr-xr-xtests/FunctionalTests/validators/tests/DatePickerTestCase.php85
-rwxr-xr-xtests/FunctionalTests/validators/tests/ImageButtonTestCase.php72
-rwxr-xr-xtests/FunctionalTests/validators/tests/LinkButtonTestCase.php72
-rwxr-xr-xtests/FunctionalTests/validators/tests/ListControlTestCase.php33
-rwxr-xr-xtests/FunctionalTests/validators/tests/RangeValidatorTestCase.php198
-rwxr-xr-xtests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php34
-rwxr-xr-xtests/FunctionalTests/validators/tests/RequiredFieldTestCase.php54
-rwxr-xr-xtests/FunctionalTests/validators/tests/RequiredListTestCase.php32
-rwxr-xr-xtests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php46
-rw-r--r--tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php2
-rw-r--r--tests/simple_unit/ActiveRecord/ActiveRecordFinderTestCase.php2
-rw-r--r--tests/simple_unit/ActiveRecord/ActiveRecordMySql5TestCase.php3
-rw-r--r--tests/simple_unit/ActiveRecord/ActiveRecordRegistryTestCase.php2
-rw-r--r--tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php2
-rw-r--r--tests/simple_unit/ActiveRecord/CountRecordsTestCase.php2
-rw-r--r--tests/simple_unit/ActiveRecord/CriteriaTestCase.php2
-rw-r--r--tests/simple_unit/ActiveRecord/DeleteByPkTestCase.php3
-rw-r--r--tests/simple_unit/ActiveRecord/FindByPksTestCase.php2
-rw-r--r--tests/simple_unit/ActiveRecord/FindBySqlTestCase.php2
-rw-r--r--tests/simple_unit/ActiveRecord/ForeignKeyTestCase.php2
-rw-r--r--tests/simple_unit/ActiveRecord/ForeignObjectUpdateTest.php2
-rw-r--r--tests/simple_unit/ActiveRecord/MultipleForeignKeyTestCase.php2
-rw-r--r--tests/simple_unit/ActiveRecord/RecordEventTestCase.php2
-rw-r--r--tests/simple_unit/ActiveRecord/SqliteTestCase.php2
-rw-r--r--tests/simple_unit/ActiveRecord/UserRecordTestCase.php2
-rw-r--r--tests/simple_unit/ActiveRecord/ViewRecordTestCase.php3
-rw-r--r--tests/simple_unit/ActiveRecord/records/Blogs.php2
-rw-r--r--tests/simple_unit/ActiveRecord/records/DepSections.php2
-rw-r--r--tests/simple_unit/ActiveRecord/records/DepartmentRecord.php2
-rw-r--r--tests/simple_unit/ActiveRecord/records/ItemRecord.php2
-rw-r--r--tests/simple_unit/ActiveRecord/records/SimpleUser.php2
-rw-r--r--tests/simple_unit/ActiveRecord/records/SqliteUsers.php2
-rw-r--r--tests/simple_unit/ActiveRecord/records/UserRecord.php2
-rw-r--r--tests/simple_unit/DbCommon/CommandBuilderMssqlTest.php2
-rw-r--r--tests/simple_unit/DbCommon/CommandBuilderMysqlTest.php2
-rw-r--r--tests/simple_unit/DbCommon/CommandBuilderPgsqlTest.php2
-rw-r--r--tests/simple_unit/DbCommon/MssqlColumnTest.php2
-rw-r--r--tests/simple_unit/DbCommon/Mysql4ColumnTest.php2
-rw-r--r--tests/simple_unit/DbCommon/MysqlColumnTest.php2
-rw-r--r--tests/simple_unit/DbCommon/PgsqlColumnTest.php2
-rw-r--r--tests/simple_unit/DbCommon/SqliteColumnTest.php3
-rw-r--r--tests/simple_unit/I18N/MysqlMessageSourceTestCase.php2
-rw-r--r--tests/simple_unit/Soap/ContactManager.php34
-rw-r--r--tests/simple_unit/Soap/SoapTestCase.php3
-rw-r--r--tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php2
-rw-r--r--tests/simple_unit/SqlMap/BaseCase.php2
-rw-r--r--tests/simple_unit/SqlMap/CacheTest.php2
-rw-r--r--tests/simple_unit/SqlMap/DelegateTest.php2
-rw-r--r--tests/simple_unit/SqlMap/Dynamic/DynamicTest.php2
-rw-r--r--tests/simple_unit/SqlMap/GroupByTest.php2
-rw-r--r--tests/simple_unit/SqlMap/InheritanceTest.php3
-rw-r--r--tests/simple_unit/SqlMap/ParameterMapTest.php2
-rw-r--r--tests/simple_unit/SqlMap/PropertyAccessTest.php2
-rw-r--r--tests/simple_unit/SqlMap/ResultClassTest.php2
-rw-r--r--tests/simple_unit/SqlMap/ResultMapTest.php2
-rw-r--r--tests/simple_unit/SqlMap/SelectKeyTest.php2
-rw-r--r--tests/simple_unit/SqlMap/SqlMapCacheTest.php2
-rw-r--r--tests/simple_unit/SqlMap/StatementExtendsTest.php2
-rw-r--r--tests/simple_unit/SqlMap/StatementTest.php2
-rw-r--r--tests/simple_unit/SqlMap/TestQueryForMap.php2
-rw-r--r--tests/simple_unit/SqlMap/common.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/A.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/Account.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/AccountBis.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/AccountCollection.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/B.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/Book.php4
-rw-r--r--tests/simple_unit/SqlMap/domain/C.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/Category.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/Complex.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/D.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/Document.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/DocumentCollection.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/E.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/F.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/LineItem.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/LineItemCollection.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/Newspaper.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/Order.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/Other.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/Sample.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/Search.php2
-rw-r--r--tests/simple_unit/SqlMap/domain/User.php2
-rw-r--r--tests/simple_unit/SqlMap/gen.php2
-rw-r--r--tests/simple_unit/SqlMap/queryForListLimitTest.php2
-rw-r--r--tests/simple_unit/TableGateway/BaseGatewayTest.php3
-rw-r--r--tests/simple_unit/TableGateway/CountTest.php3
-rw-r--r--tests/simple_unit/TableGateway/DeleteByPkTest.php3
-rw-r--r--tests/simple_unit/TableGateway/MagicCallTest.php3
-rw-r--r--tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php3
-rw-r--r--tests/simple_unit/TableGateway/TableInfoGatewayTest.php3
-rw-r--r--tests/simple_unit/TableGateway/TestFindByPk.php3
-rw-r--r--tests/simple_unit/Tickets/Ticket589Test.php2
-rw-r--r--tests/simple_unit/unit.php2
-rw-r--r--tests/simple_unit/ws.php2
-rwxr-xr-xtests/test_tools/PradoGenericSelenium2Test.php230
-rw-r--r--tests/test_tools/PradoGenericSeleniumTest.php42
-rw-r--r--tests/test_tools/README.txt90
-rw-r--r--tests/test_tools/phpunit_bootstrap.php4
-rw-r--r--tests/test_tools/simpletest/HtmlReporterWithCoverage.php65
-rw-r--r--tests/test_tools/simpletest/authentication.php3
-rw-r--r--tests/test_tools/simpletest/browser.php9
-rw-r--r--tests/test_tools/simpletest/collector.php28
-rw-r--r--tests/test_tools/simpletest/compatibility.php1
-rw-r--r--tests/test_tools/simpletest/cookies.php51
-rw-r--r--tests/test_tools/simpletest/detached.php3
-rw-r--r--tests/test_tools/simpletest/dumper.php3
-rw-r--r--tests/test_tools/simpletest/encoding.php91
-rw-r--r--tests/test_tools/simpletest/errors.php3
-rw-r--r--tests/test_tools/simpletest/exceptions.php3
-rw-r--r--tests/test_tools/simpletest/expectation.php1
-rw-r--r--tests/test_tools/simpletest/form.php49
-rw-r--r--tests/test_tools/simpletest/frames.php3
-rw-r--r--tests/test_tools/simpletest/http.php89
-rw-r--r--tests/test_tools/simpletest/invoker.php1
-rw-r--r--tests/test_tools/simpletest/mock_objects.php3
-rw-r--r--tests/test_tools/simpletest/options.php1
-rw-r--r--tests/test_tools/simpletest/page.php5
-rw-r--r--tests/test_tools/simpletest/parser.php3
-rw-r--r--tests/test_tools/simpletest/reflection_php4.php3
-rw-r--r--tests/test_tools/simpletest/reflection_php5.php7
-rw-r--r--tests/test_tools/simpletest/remote.php13
-rw-r--r--tests/test_tools/simpletest/reporter.php3
-rw-r--r--tests/test_tools/simpletest/runner.php49
-rw-r--r--tests/test_tools/simpletest/scorer.php3
-rw-r--r--tests/test_tools/simpletest/selector.php3
-rw-r--r--tests/test_tools/simpletest/shell_tester.php7
-rw-r--r--tests/test_tools/simpletest/simple_test.php1
-rw-r--r--tests/test_tools/simpletest/simpletest.php3
-rw-r--r--tests/test_tools/simpletest/socket.php3
-rw-r--r--tests/test_tools/simpletest/tag.php235
-rw-r--r--tests/test_tools/simpletest/test_case.php1
-rw-r--r--tests/test_tools/simpletest/unit_tester.php1
-rw-r--r--tests/test_tools/simpletest/url.php3
-rw-r--r--tests/test_tools/simpletest/user_agent.php49
-rw-r--r--tests/test_tools/simpletest/web_tester.php213
-rw-r--r--tests/test_tools/simpletest/xml.php1
-rw-r--r--tests/unit/AllTests.php2
-rw-r--r--tests/unit/Caching/AllTests.php7
-rw-r--r--tests/unit/Caching/TAPCCacheTest.php15
-rw-r--r--tests/unit/Caching/TDirectoryCacheDependencyTest.php2
-rw-r--r--tests/unit/Caching/TFileCacheDependencyTest.php2
-rw-r--r--tests/unit/Caching/TMemCacheTest.php13
-rw-r--r--tests/unit/Caching/TSqliteCacheTest.php17
-rw-r--r--tests/unit/Collections/AllTests.php7
-rw-r--r--tests/unit/Collections/TAttributeCollectionTest.php19
-rw-r--r--tests/unit/Collections/TListTest.php68
-rw-r--r--tests/unit/Collections/TMapTest.php3
-rw-r--r--tests/unit/Collections/TPagedDataSourceTest.php25
-rw-r--r--tests/unit/Collections/TPagedListTest.php53
-rw-r--r--tests/unit/Collections/TPriorityMapTest.php161
-rw-r--r--tests/unit/Collections/TQueueTest.php13
-rw-r--r--tests/unit/Collections/TStackTest.php13
-rw-r--r--tests/unit/Data/DataGateway/AllTests.php7
-rw-r--r--tests/unit/Data/DataGateway/TSqlCriteriaTest.php25
-rw-r--r--tests/unit/Data/SqlMap/AllTests.php1
-rw-r--r--tests/unit/Data/SqlMap/DataMapper/AllTests.php3
-rw-r--r--tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php2
-rw-r--r--tests/unit/Data/SqlMap/DynamicParameterTest.php2
-rw-r--r--tests/unit/Data/TDbCommandTest.php2
-rw-r--r--tests/unit/Data/TDbConnectionTest.php2
-rw-r--r--tests/unit/Data/TDbDataReaderTest.php2
-rw-r--r--tests/unit/Data/TDbTransactionTest.php2
-rw-r--r--tests/unit/I18N/core/AllTests.php7
-rw-r--r--tests/unit/I18N/core/ChoiceFormatTest.php2
-rw-r--r--tests/unit/I18N/core/CultureInfoTest.php22
-rw-r--r--tests/unit/I18N/core/DateFormatTest.php56
-rw-r--r--tests/unit/I18N/core/DateTimeFormatInfoTest.php67
-rw-r--r--tests/unit/I18N/core/NumberFormatInfoTest.php36
-rw-r--r--tests/unit/I18N/core/NumberFormatTest.php52
-rw-r--r--tests/unit/IO/AllTests.php7
-rw-r--r--tests/unit/IO/TTarFileExtractorTest.php5
-rw-r--r--tests/unit/IO/TTextWriterTest.php3
-rw-r--r--tests/unit/Security/AllTests.php7
-rw-r--r--tests/unit/Security/TAuthManagerTest.php35
-rw-r--r--tests/unit/Security/TAuthorizationRuleTest.php15
-rw-r--r--tests/unit/Security/TSecurityManagerTest.php31
-rw-r--r--tests/unit/Security/TUserManagerTest.php31
-rw-r--r--tests/unit/Security/TUserTest.php21
-rw-r--r--tests/unit/TComponentTest.php970
-rw-r--r--tests/unit/Util/AllTests.php7
-rw-r--r--tests/unit/Util/TDateTimeStampTest.php3
-rw-r--r--tests/unit/Util/TLoggerTest.php3
-rw-r--r--tests/unit/Util/TSimpleDateFormatterTest.php21
-rw-r--r--tests/unit/Web/AllTests.php9
-rw-r--r--tests/unit/Web/TAssetManagerTest.php57
-rw-r--r--tests/unit/Web/TCacheHttpSessionTest.php31
-rw-r--r--tests/unit/Web/THttpCookieCollectionTest.php5
-rw-r--r--tests/unit/Web/THttpCookieTest.php3
-rw-r--r--tests/unit/Web/THttpRequestTest.php3
-rw-r--r--tests/unit/Web/THttpResponseTest.php21
-rw-r--r--tests/unit/Web/THttpSessionTest.php3
-rw-r--r--tests/unit/Web/THttpUtilityTest.php3
-rw-r--r--tests/unit/Web/TUriTest.php13
-rw-r--r--tests/unit/Web/UI/ActiveControls/AllTests.php7
-rw-r--r--tests/unit/Web/UI/ActiveControls/TActiveHiddenFieldTest.php2
-rw-r--r--tests/unit/Web/UI/AllTests.php7
-rw-r--r--tests/unit/Web/UI/TClientScriptManagerTest.php3
-rw-r--r--tests/unit/Web/UI/TControlAdapterTest.php23
-rw-r--r--tests/unit/Web/UI/TControlTest.php133
-rw-r--r--tests/unit/Web/UI/TFormTest.php11
-rw-r--r--tests/unit/Web/UI/THtmlWriterTest.php13
-rw-r--r--tests/unit/Web/UI/TPageStatePersisterTest.php9
-rw-r--r--tests/unit/Web/UI/TPageTest.php95
-rw-r--r--tests/unit/Web/UI/TSessionPageStatePersisterTest.php11
-rw-r--r--tests/unit/Web/UI/TTemplateControlTest.php17
-rw-r--r--tests/unit/Web/UI/TTemplateManagerTest.php11
-rw-r--r--tests/unit/Web/UI/TTemplateTest.php23
-rw-r--r--tests/unit/Web/UI/TThemeManagerTest.php13
-rw-r--r--tests/unit/Web/UI/TThemeTest.php17
-rw-r--r--tests/unit/Web/UI/WebControls/AllTests.php7
-rw-r--r--tests/unit/Web/UI/WebControls/TDropDownListTest.php1
-rw-r--r--tests/unit/Web/UI/WebControls/TLabelTest.php2
-rw-r--r--tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php2
-rw-r--r--tests/unit/Web/UI/WebControls/TXmlTransformTest.php5
-rw-r--r--tests/unit/Xml/AllTests.php7
-rw-r--r--tests/unit/Xml/TXmlDocumentTest.php7
-rw-r--r--tests/unit/Xml/TXmlElementListTest.php3
-rw-r--r--tests/unit/Xml/TXmlElementTest.php3
1070 files changed, 42295 insertions, 12669 deletions
diff --git a/.gitignore b/.gitignore
index 93cbf3f5..ff8c3b5b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,4 +33,5 @@ bin/coveralls
bin/dbunit.php
#OSX
-.DS_Store \ No newline at end of file
+.DS_Store
+/nbproject \ No newline at end of file
diff --git a/COPYRIGHT b/COPYRIGHT
index daa3d02c..4d7a65d8 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,7 +1,7 @@
The PRADO framework and the included demos are free software.
They are released under the terms of the following BSD License.
-Copyright 2004-2013, The PRADO Group (http://www.pradosoft.com)
+Copyright 2004-2014, The PRADO Group (http://www.pradosoft.com)
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/bin/prado-cli.php b/bin/prado-cli.php
index b4b43062..1906946b 100755
--- a/bin/prado-cli.php
+++ b/bin/prado-cli.php
@@ -5,9 +5,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: prado-cli.php 3316 2013-08-20 13:51:25Z ctrlaltca $
*/
if(!isset($_SERVER['argv']) || php_sapi_name()!=='cli')
@@ -58,7 +57,6 @@ PradoCommandLineInterpreter::getInstance()->run($_SERVER['argv']);
* Command line interface, configures the action classes and dispatches the command actions.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: prado-cli.php 3316 2013-08-20 13:51:25Z ctrlaltca $
* @since 3.0.5
*/
class PradoCommandLineInterpreter
@@ -136,7 +134,6 @@ class PradoCommandLineInterpreter
* Base class for command line actions.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: prado-cli.php 3316 2013-08-20 13:51:25Z ctrlaltca $
* @since 3.0.5
*/
abstract class PradoCommandLineAction
@@ -227,7 +224,6 @@ EOD;
* Create a Prado project skeleton, including directories and files.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: prado-cli.php 3316 2013-08-20 13:51:25Z ctrlaltca $
* @since 3.0.5
*/
class PradoCommandLineCreateProject extends PradoCommandLineAction
@@ -305,8 +301,7 @@ require_once($frameworkPath);
$application=new TApplication;
$application->run();
-
-?>';
+';
}
protected function renderConfigFile($appName)
@@ -379,7 +374,6 @@ EOD;
* Creates test fixtures for a Prado application.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: prado-cli.php 3316 2013-08-20 13:51:25Z ctrlaltca $
* @since 3.0.5
*/
class PradoCommandLineCreateTests extends PradoCommandLineAction
@@ -431,8 +425,7 @@ $test_cases = dirname(__FILE__)."/unit";
$tester = new PradoUnitTester($test_cases, $app_directory);
$tester->run(new HtmlReporter());
-
-?>';
+';
}
protected function renderFunctionalTestFixture()
@@ -446,8 +439,7 @@ $test_cases = dirname(__FILE__)."/functional";
$tester=new PradoFunctionalTester($test_cases);
$tester->run(new SimpleReporter());
-
-?>';
+';
}
}
@@ -456,7 +448,6 @@ $tester->run(new SimpleReporter());
* Creates and run a Prado application in a PHP Shell.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: prado-cli.php 3316 2013-08-20 13:51:25Z ctrlaltca $
* @since 3.0.5
*/
class PradoCommandLinePhpShell extends PradoCommandLineAction
@@ -478,7 +469,6 @@ class PradoCommandLinePhpShell extends PradoCommandLineAction
* Runs unit test cases.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: prado-cli.php 3316 2013-08-20 13:51:25Z ctrlaltca $
* @since 3.0.5
*/
class PradoCommandLineUnitTest extends PradoCommandLineAction
@@ -594,7 +584,6 @@ class PradoCommandLineUnitTest extends PradoCommandLineAction
* Create active record skeleton
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: prado-cli.php 3316 2013-08-20 13:51:25Z ctrlaltca $
* @since 3.1
*/
class PradoCommandLineActiveRecordGen extends PradoCommandLineAction
@@ -737,7 +726,7 @@ $props
return parent::finder(\$className);
}
}
-?>
+
EOD;
}
}
@@ -747,7 +736,6 @@ EOD;
*
* @author Matthias Endres <me[at]me23[dot]de>
* @author Daniel Sampedro Bello <darthdaniel85[at]gmail[dot]com>
- * @version $Id: prado-cli.php 3316 2013-08-20 13:51:25Z ctrlaltca $
* @since 3.2
*/
class PradoCommandLineActiveRecordGenAll extends PradoCommandLineAction {
diff --git a/build.xml b/build.xml
index 023debe2..e81c41db 100644
--- a/build.xml
+++ b/build.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- PRADO 3.2 build file - Copyright (C) 2013 PradoSoft
+ PRADO 3.2 build file - Copyright (C) 2014 PradoSoft
Requirements
============
@@ -274,7 +274,7 @@
<target name="functionaltest" description="Running functional tests">
<delete dir="${build.functionaltest.dir}"/>
<mkdir dir="${build.functionaltest.dir}"/>
- <phpunit codecoverage="false" haltonfailure="false" haltonerror="false" printsummary="false" bootstrap="./tests/test_tools/phpunit_bootstrap.php">
+ <phpunit codecoverage="false" haltonfailure="false" haltonerror="false" printsummary="false" bootstrap="./tests/test_tools/phpunit_bootstrap.php" processIsolation="false">
<batchtest>
<fileset dir="tests/FunctionalTests">
<include name="**/*TestCase.php"/>
diff --git a/buildscripts/apigen/pradosoft/@layout.latte b/buildscripts/apigen/pradosoft/@layout.latte
index 2790d92c..266f0e17 100644
--- a/buildscripts/apigen/pradosoft/@layout.latte
+++ b/buildscripts/apigen/pradosoft/@layout.latte
@@ -182,7 +182,7 @@ the file LICENSE.md that was distributed with this source code.
<a href="/support/">Contact Us</a>
<br/>
{$config->title} API documentation generated by <a href="http://apigen.org">{$generator} {$version}</a>
- <br/>Copyright &copy; 2006-2013 by the PRADO Group.<br/>
+ <br/>Copyright &copy; 2006-2014 by the PRADO Group.<br/>
<a title="Powered by PRADO" href="http://www.pradosoft.com/"><img src="http://www.pradosoft.com/images/powered2.gif" style="border-width:0px;" alt="Powered by PRADO" /></a>
</div>
diff --git a/buildscripts/classtree/DWExtension.php b/buildscripts/classtree/DWExtension.php
index 8849efea..a7a1ca30 100644
--- a/buildscripts/classtree/DWExtension.php
+++ b/buildscripts/classtree/DWExtension.php
@@ -252,4 +252,3 @@ class PradoTagChooser
return $this->_document->saveXML();
}
}
-?> \ No newline at end of file
diff --git a/buildscripts/index/build.php b/buildscripts/index/build.php
index bbe151e6..a2e57286 100644
--- a/buildscripts/index/build.php
+++ b/buildscripts/index/build.php
@@ -61,5 +61,3 @@ else
{
echo "Usage: 'php build.php quickstart' or 'php build.php api'\n";
}
-
-?>
diff --git a/buildscripts/index/quickstart_index.php b/buildscripts/index/quickstart_index.php
index 61e21514..5df0f549 100644
--- a/buildscripts/index/quickstart_index.php
+++ b/buildscripts/index/quickstart_index.php
@@ -104,4 +104,3 @@ class quickstart_index
echo "\nSaving search index ({$count}) to {$this->_dir}\n\n";
}
}
-?> \ No newline at end of file
diff --git a/buildscripts/index/search.php b/buildscripts/index/search.php
index 23948ca5..ff83e629 100644
--- a/buildscripts/index/search.php
+++ b/buildscripts/index/search.php
@@ -11,7 +11,7 @@ require_once('Zend/Search/Lucene.php');
if($keyword!=='')
{
- $search=new Zend_Search_Lucene(realpath(dirname(__FILE__)));
+ $search=new Zend_Search_Lucene(realpath(dirname(__FILE__)));
$results=$search->find(strtolower($keyword));
$content='';
foreach($results as $entry)
@@ -32,5 +32,3 @@ $page=preg_replace('/<!-- content begin -->.*<!-- content end -->/ms',$content,$
if($keyword!=='')
$page=preg_replace('/<input type="text" name="keyword"/','<input type="text" name="keyword" value="'.htmlentities($keyword).'"',$page);
echo $page;
-
-?> \ No newline at end of file
diff --git a/buildscripts/phing/tasks/PradoPearTask.php b/buildscripts/phing/tasks/PradoPearTask.php
index 5d615084..541c972e 100644
--- a/buildscripts/phing/tasks/PradoPearTask.php
+++ b/buildscripts/phing/tasks/PradoPearTask.php
@@ -129,5 +129,3 @@ class PradoPearTask extends Task
echo $e->getMessage();
}
}
-
-?> \ No newline at end of file
diff --git a/buildscripts/phpbuilder/build.php b/buildscripts/phpbuilder/build.php
index 17e02806..47b7bec4 100644
--- a/buildscripts/phpbuilder/build.php
+++ b/buildscripts/phpbuilder/build.php
@@ -144,5 +144,3 @@ function unfold_file($fileName)
}
return $content;
}
-
-?> \ No newline at end of file
diff --git a/buildscripts/setup.php b/buildscripts/setup.php
deleted file mode 100644
index 59d636b8..00000000
--- a/buildscripts/setup.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-/**
- * Setup script for build system. You could run this script to install or upgrade Phing
- * with dependencies. Please make sure to change the PEAR_CMD constant to how you want
- * to execute the PEAR installer.
- *
- * @author Knut Urdalen
- */
-
-// Where to find the PEAR installer
-define('PEAR_CMD', 'sudo pear');
-
-// Storing your preferred_state
-$preferred_state = exec(PEAR_CMD.' config-get preferred_state');
-
-// Setting preferred state temporary to development to automatically get all dependencies
-system(PEAR_CMD.' config-set preferred_state devel');
-
-// Ensure that the PEAR channel protocol is updated
-system(PEAR_CMD.' channel-update pear.php.net');
-
-// Ensure that the Phing PEAR channel is added
-system(PEAR_CMD.' channel-discover pear.phing.info');
-
-// and channel protocol is updated
-system(PEAR_CMD.' channel-update pear.phing.info');
-
-// Checking if Phing is already installed
-$result = exec(PEAR_CMD.' info phing/phing');
-if(strstr($result, 'No information found for')) { // Install
- system(PEAR_CMD.' install --alldeps phing/phing');
-} else { // Try to upgrade
- system(PEAR_CMD.' upgrade --alldeps phing/phing');
-}
-
-// Setting your preferred state back to what it was
-system(PEAR_CMD.' config-set preferred_state '.$preferred_state);
-
-?> \ No newline at end of file
diff --git a/buildscripts/texbuilder/Page2Tex.php b/buildscripts/texbuilder/Page2Tex.php
index b0d37149..ce2ece7f 100644
--- a/buildscripts/texbuilder/Page2Tex.php
+++ b/buildscripts/texbuilder/Page2Tex.php
@@ -343,5 +343,3 @@ class Page2Tex
return "<p id=\"".($page + (++self::$p_count))."\" class=\"block-content\">";
}
}
-
-?>
diff --git a/buildscripts/texbuilder/quickstart/build.php b/buildscripts/texbuilder/quickstart/build.php
index a42d6be3..6a824125 100644
--- a/buildscripts/texbuilder/quickstart/build.php
+++ b/buildscripts/texbuilder/quickstart/build.php
@@ -76,6 +76,3 @@ if($argv[1] == 'pdf')
echo " Unable to find pdfLatex executable $pdflatexExec";
}
}
-
-
-?>
diff --git a/buildscripts/texbuilder/quickstart/pages.php b/buildscripts/texbuilder/quickstart/pages.php
index cd11c4b1..1fb94431 100644
--- a/buildscripts/texbuilder/quickstart/pages.php
+++ b/buildscripts/texbuilder/quickstart/pages.php
@@ -177,5 +177,3 @@ $pages['Client-side Scripting'] = array(
return $pages;
//-------------- END CONFIG ----------------
-
-?> \ No newline at end of file
diff --git a/buildscripts/texbuilder/quickstart/quickstart.tex b/buildscripts/texbuilder/quickstart/quickstart.tex
index 41258800..29c76afc 100644
--- a/buildscripts/texbuilder/quickstart/quickstart.tex
+++ b/buildscripts/texbuilder/quickstart/quickstart.tex
@@ -53,7 +53,7 @@
%----------------- TITLE --------------
\title{\Huge \bfseries PRADO v3.2.3 Quickstart Tutorial
- \thanks{Copyright 2004-2013. All Rights Reserved.}
+ \thanks{Copyright 2004-2014. All Rights Reserved.}
}
\author{Qiang Xue and Wei Zhuo}
\date{\today}
@@ -78,7 +78,7 @@ Prado quick start doc
\chapter*{License}
\addcontentsline{toc}{chapter}{License}
PRADO is free software released under the terms of the following BSD license.\\
-Copyright 2004-2013, The PRADO Group (http://www.pradosoft.com)
+Copyright 2004-2014, The PRADO Group (http://www.pradosoft.com)
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/buildscripts/texbuilder/sqlmap/build.php b/buildscripts/texbuilder/sqlmap/build.php
index 4ea4d75e..066af486 100644
--- a/buildscripts/texbuilder/sqlmap/build.php
+++ b/buildscripts/texbuilder/sqlmap/build.php
@@ -76,6 +76,3 @@ if($argv[1] == 'pdf')
echo " Unable to find pdfLatex executable $pdflatexExec";
}
}
-
-
-?>
diff --git a/buildscripts/texbuilder/sqlmap/pages.php b/buildscripts/texbuilder/sqlmap/pages.php
index 57fff767..b0b7bca0 100644
--- a/buildscripts/texbuilder/sqlmap/pages.php
+++ b/buildscripts/texbuilder/sqlmap/pages.php
@@ -58,5 +58,3 @@ $pages['Advanced Topics'] = array(
);
return $pages;
-
-?> \ No newline at end of file
diff --git a/buildscripts/texbuilder/time-tracker/pages.php b/buildscripts/texbuilder/time-tracker/pages.php
index 732f675d..a9c32347 100644
--- a/buildscripts/texbuilder/time-tracker/pages.php
+++ b/buildscripts/texbuilder/time-tracker/pages.php
@@ -14,5 +14,3 @@ $pages['Testing Business Code'] = array(
'Docs/UserClassAndExceptions.page'
);
return $pages;
-
-?> \ No newline at end of file
diff --git a/demos/blog-tutorial/protected/pages/Day1/CreateContact.page b/demos/blog-tutorial/protected/pages/Day1/CreateContact.page
index 28ad4b21..0d9fc026 100755
--- a/demos/blog-tutorial/protected/pages/Day1/CreateContact.page
+++ b/demos/blog-tutorial/protected/pages/Day1/CreateContact.page
@@ -45,11 +45,11 @@ We use template to organize the presentational layout of the feedback form. In t
<h1>Contact</h1>
<p>Please fill out the following form to let me know your feedback on my blog. Thanks!</p>
-&lt;com:TForm>
+&lt;com:TForm>
<span>Your Name:</span>
&lt;com:TRequiredFieldValidator ControlToValidate="Name"
- ErrorMessage="Please provide your name."
+ ErrorMessage="Please provide your name."
Display="Dynamic" />
<br/>
&lt;com:TTextBox ID="Name" />
@@ -57,10 +57,10 @@ We use template to organize the presentational layout of the feedback form. In t
<br/>
<span>Your Email:</span>
&lt;com:TRequiredFieldValidator ControlToValidate="Email"
- ErrorMessage="Please provide your email address."
+ ErrorMessage="Please provide your email address."
Display="Dynamic" />
&lt;com:TEmailAddressValidator ControlToValidate="Email"
- ErrorMessage="You entered an invalid email address."
+ ErrorMessage="You entered an invalid email address."
Display="Dynamic" />
<br/>
&lt;com:TTextBox ID="Email" />
@@ -68,11 +68,11 @@ We use template to organize the presentational layout of the feedback form. In t
<br/>
<span>Feedback:</span>
&lt;com:TRequiredFieldValidator ControlToValidate="Feedback"
- ErrorMessage="Please provide your feedback."
+ ErrorMessage="Please provide your feedback."
Display="Dynamic" />
<br/>
-&lt;com:TTextBox ID="Feedback"
- TextMode="MultiLine"
+&lt;com:TTextBox ID="Feedback"
+ TextMode="MultiLine"
Rows="10"
Columns="40" />
@@ -99,13 +99,13 @@ Besides <tt>TTextBox</tt> controls, the template also uses many validator contro
<com:TTextHighlighter CssClass="source" Language="prado">
<span>Your Email:</span>
-&lt;com:TRequiredFieldValidator
+&lt;com:TRequiredFieldValidator
ControlToValidate="Email"
- ErrorMessage="Please provide your email address."
+ ErrorMessage="Please provide your email address."
Display="Dynamic" />
-&lt;com:TEmailAddressValidator
+&lt;com:TEmailAddressValidator
ControlToValidate="Email"
- ErrorMessage="You entered an invalid email address."
+ ErrorMessage="You entered an invalid email address."
Display="Dynamic" />
<br/>
&lt;com:TTextBox ID="Email" />
@@ -152,28 +152,27 @@ class Contact extends TPage
/**
* Event handler for the OnClick event of the submit button.
* @param TButton the button triggering the event
- * @param TEventParameter event parameter (null here)
+ * @param TEventParameter event parameter (null here)
*/
public function submitButtonClicked($sender, $param)
{
if ($this->IsValid) // check if input validation is successful
{
// obtain the user name, email, feedback from the textboxes
- $name = $this->Name->Text;
+ $name = $this->Name->Text;
$email = $this->Email->Text;
$feedback = $this->Feedback->Text;
-
+
// send an email to administrator with the above information
$this->mailFeedback($name, $email, $feedback);
}
}
-
+
protected function mailFeedback($name, $email, $feedback)
{
// implementation of sending the feedback email
}
}
-?>
</com:TTextHighlighter>
<p>
diff --git a/demos/blog-tutorial/protected/pages/Day1/Setup.page b/demos/blog-tutorial/protected/pages/Day1/Setup.page
index e8316253..582d0399 100755
--- a/demos/blog-tutorial/protected/pages/Day1/Setup.page
+++ b/demos/blog-tutorial/protected/pages/Day1/Setup.page
@@ -52,7 +52,6 @@ require_once('path/to/prado.php');
$application = new TApplication;
// run the application and handle user requests
$application->run();
-?>
</com:TTextHighlighter>
<com:InfoBox>
@@ -148,8 +147,8 @@ To change the location of the root page directory and change the name of homepag
<?xml version="1.0" encoding="utf-8"?>
<application id="blog" mode="Debug">
<services>
- <service id="page"
- class="TPageService"
+ <service id="page"
+ class="TPageService"
BasePath="path.to.pages"
DefaultPage="NewHome"
/>
diff --git a/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page b/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page
index 9cd0410b..6115ef22 100755
--- a/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page
+++ b/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page
@@ -66,7 +66,6 @@ The class file <tt>MainLayout.php</tt> is very simple:
class MainLayout extends TTemplateControl
{
}
-?>
</com:TTextHighlighter>
<com:InfoBox>
@@ -145,7 +144,6 @@ class Contact extends TPage
// ...
}
-?>
</com:TTextHighlighter>
<p>
diff --git a/demos/blog-tutorial/protected/pages/Day1/fr/CreateContact.page b/demos/blog-tutorial/protected/pages/Day1/fr/CreateContact.page
index e85d8bfe..0105f656 100755
--- a/demos/blog-tutorial/protected/pages/Day1/fr/CreateContact.page
+++ b/demos/blog-tutorial/protected/pages/Day1/fr/CreateContact.page
@@ -45,11 +45,11 @@ Nous utilisons un fichier gabarit pour organiser la présentation de notre formu
<h1>Contact</h1>
<p>Veuillez remplir le formulaire suivant pour me laisser vos impressions au sujet de mon blog. Merci !</p>
-&lt;com:TForm>
+&lt;com:TForm>
<span>Votre nom:</span>
&lt;com:TRequiredFieldValidator ControlToValidate="Name"
- ErrorMessage="Veuillez indiquer votre nom."
+ ErrorMessage="Veuillez indiquer votre nom."
Display="Dynamic" />
<br/>
&lt;com:TTextBox ID="Name" />
@@ -57,10 +57,10 @@ Nous utilisons un fichier gabarit pour organiser la présentation de notre formu
<br/>
<span>Votre email:</span>
&lt;com:TRequiredFieldValidator ControlToValidate="Email"
- ErrorMessage="Veuillez indiquer votre email."
+ ErrorMessage="Veuillez indiquer votre email."
Display="Dynamic" />
&lt;com:TEmailAddressValidator ControlToValidate="Email"
- ErrorMessage="Vous avez saisi un email invalide."
+ ErrorMessage="Vous avez saisi un email invalide."
Display="Dynamic" />
<br/>
&lt;com:TTextBox ID="Email" />
@@ -68,11 +68,11 @@ Nous utilisons un fichier gabarit pour organiser la présentation de notre formu
<br/>
<span>Commentaires:</span>
&lt;com:TRequiredFieldValidator ControlToValidate="Feedback"
- ErrorMessage="Veuillez saisir un commentaire."
+ ErrorMessage="Veuillez saisir un commentaire."
Display="Dynamic" />
<br/>
-&lt;com:TTextBox ID="Feedback"
- TextMode="MultiLine"
+&lt;com:TTextBox ID="Feedback"
+ TextMode="MultiLine"
Rows="10"
Columns="40" />
@@ -99,13 +99,13 @@ Avant le contrôle <tt>TTextBox</tt>, le gabarit utilise aussi plusieurs validat
<com:TTextHighlighter CssClass="source" Language="prado">
<span>Your Email:</span>
-&lt;com:TRequiredFieldValidator
+&lt;com:TRequiredFieldValidator
ControlToValidate="Email"
- ErrorMessage="Veuillez indiquer votre email."
+ ErrorMessage="Veuillez indiquer votre email."
Display="Dynamic" />
-&lt;com:TEmailAddressValidator
+&lt;com:TEmailAddressValidator
ControlToValidate="Email"
- ErrorMessage="Vous avez saisi un email invalide."
+ ErrorMessage="Vous avez saisi un email invalide."
Display="Dynamic" />
<br/>
&lt;com:TTextBox ID="Email" />
@@ -152,28 +152,27 @@ class Contact extends TPage
/**
* Gestionnaire d'évènement pour OnClick (bouton submit).
* @param TButton le bouton qui a générer l'évènement
- * @param TEventParameter les paramètres de l'évènement (null dans ce cas)
+ * @param TEventParameter les paramètres de l'évènement (null dans ce cas)
*/
public function submitButtonClicked($sender, $param)
{
if ($this->IsValid) // vérifie que les validations sont Ok
{
// récupère le nom de l'utilisateur, son email et son commentaire
- $name = $this->Name->Text;
+ $name = $this->Name->Text;
$email = $this->Email->Text;
$feedback = $this->Feedback->Text;
-
- // envoie un email à l'administrateur avec les informations
+
+ // envoie un email à l'administrateur avec les informations
$this->mailFeedback($name, $email, $feedback);
}
}
-
+
protected function mailFeedback($name, $email, $feedback)
{
// implémentation de l'envoi de l'email
}
}
-?>
</com:TTextHighlighter>
<p>
diff --git a/demos/blog-tutorial/protected/pages/Day1/fr/Setup.page b/demos/blog-tutorial/protected/pages/Day1/fr/Setup.page
index 22a7891c..0be1c1f0 100755
--- a/demos/blog-tutorial/protected/pages/Day1/fr/Setup.page
+++ b/demos/blog-tutorial/protected/pages/Day1/fr/Setup.page
@@ -49,11 +49,10 @@ require_once('path/to/prado.php');
$application = new TApplication;
// run the application and handle user requests
$application->run();
-?>
</com:TTextHighlighter>
<com:InfoBox>
-Le nom du script ne doit pas être obligatoirement <tt>index.php</tt>. Il peut porter n'importe quel nom à partir du moment ou le serveur peut l'interpréter comme étant un script PHP5. Par exemple, sur certains hébergements mutualisés, le script devra porter le nom <tt>index.php5</tt>, ce qui permettra au serveur Web de le traiter correctement.
+Le nom du script ne doit pas être obligatoirement <tt>index.php</tt>. Il peut porter n'importe quel nom à partir du moment ou le serveur peut l'interpréter comme étant un script PHP5. Par exemple, sur certains hébergements mutualisés, le script devra porter le nom <tt>index.php5</tt>, ce qui permettra au serveur Web de le traiter correctement.
</com:InfoBox>
<h3>Le fichier de configuration de l'application</h3>
@@ -145,8 +144,8 @@ Pour changer l'emplacement du dossier racine des pages et le nom de la page d'ac
<?xml version="1.0" encoding="utf-8"?>
<application id="blog" mode="Debug">
<services>
- <service id="page"
- class="TPageService"
+ <service id="page"
+ class="TPageService"
BasePath="path.to.pages"
DefaultPage="NewHome"
/>
diff --git a/demos/blog-tutorial/protected/pages/Day1/fr/ShareLayout.page b/demos/blog-tutorial/protected/pages/Day1/fr/ShareLayout.page
index cefff770..539b8376 100755
--- a/demos/blog-tutorial/protected/pages/Day1/fr/ShareLayout.page
+++ b/demos/blog-tutorial/protected/pages/Day1/fr/ShareLayout.page
@@ -68,7 +68,6 @@ Le fichier de classe <tt>MainLayout.php</tt> est très simple :
class MainLayout extends TTemplateControl
{
}
-?>
</com:TTextHighlighter>
<com:InfoBox>
@@ -147,13 +146,12 @@ class Contact extends TPage
// ...
}
-?>
</com:TTextHighlighter>
<p>
Ci-dessus, nous indiquons d'utiliser le gabarit principal <tt>MasterClass</tt> dans la méthode <tt>onPreInit()</tt> qui est héritée de <tt>TPage</tt>. Cette méthode est appelé par PRADO juste après que l'instance de la page soit créée. Nous pouvons ainsi déclarer au moment où la page est requise quel gabarit principal utiliser. Par exemple, quand la page est requise par un utilisateur enregistré, nous pouvons utiliser le gabarit A, et le gabarit B si l'utilisateur qui demande la page est un invité.
</p>
-
+
<p>
Nous pouvons aussi spécifier quel gabarit principal utiliser dans le fichier de <a href="http://www.pradosoft.com/demos/quickstart/?page=Configurations.AppConfig">configuration de l'application</a> ou encore dans le fichier de <a href="http://www.pradosoft.com/demos/quickstart/?page=Configurations.PageConfig">configuration de la page</a>. Ci-dessous, le fichier de configuration de l'application modifié pour notre blog.
</p>
diff --git a/demos/blog-tutorial/protected/pages/Day1/id/CreateContact.page b/demos/blog-tutorial/protected/pages/Day1/id/CreateContact.page
index 65be6417..caee30d0 100755
--- a/demos/blog-tutorial/protected/pages/Day1/id/CreateContact.page
+++ b/demos/blog-tutorial/protected/pages/Day1/id/CreateContact.page
@@ -45,11 +45,11 @@ Kita menggunakan template untuk menghatur tata letak penyajian terhadap formulir
<h1>Contact</h1>
<p>Please fill out the following form to let me know your feedback on my blog. Thanks!</p>
-&lt;com:TForm>
+&lt;com:TForm>
<span>Your Name:</span>
&lt;com:TRequiredFieldValidator ControlToValidate="Name"
- ErrorMessage="Please provide your name."
+ ErrorMessage="Please provide your name."
Display="Dynamic" />
<br/>
&lt;com:TTextBox ID="Name" />
@@ -57,10 +57,10 @@ Kita menggunakan template untuk menghatur tata letak penyajian terhadap formulir
<br/>
<span>Your Email:</span>
&lt;com:TRequiredFieldValidator ControlToValidate="Email"
- ErrorMessage="Please provide your email address."
+ ErrorMessage="Please provide your email address."
Display="Dynamic" />
&lt;com:TEmailAddressValidator ControlToValidate="Email"
- ErrorMessage="You entered an invalid email address."
+ ErrorMessage="You entered an invalid email address."
Display="Dynamic" />
<br/>
&lt;com:TTextBox ID="Email" />
@@ -68,11 +68,11 @@ Kita menggunakan template untuk menghatur tata letak penyajian terhadap formulir
<br/>
<span>Feedback:</span>
&lt;com:TRequiredFieldValidator ControlToValidate="Feedback"
- ErrorMessage="Please provide your feedback."
+ ErrorMessage="Please provide your feedback."
Display="Dynamic" />
<br/>
-&lt;com:TTextBox ID="Feedback"
- TextMode="MultiLine"
+&lt;com:TTextBox ID="Feedback"
+ TextMode="MultiLine"
Rows="10"
Columns="40" />
@@ -99,13 +99,13 @@ Selain kontrol <tt>TTextBox</tt>, template juga menggunakan banyak kontrol valid
<com:TTextHighlighter CssClass="source" Language="prado">
<span>Your Email:</span>
-&lt;com:TRequiredFieldValidator
+&lt;com:TRequiredFieldValidator
ControlToValidate="Email"
- ErrorMessage="Please provide your email address."
+ ErrorMessage="Please provide your email address."
Display="Dynamic" />
-&lt;com:TEmailAddressValidator
+&lt;com:TEmailAddressValidator
ControlToValidate="Email"
- ErrorMessage="You entered an invalid email address."
+ ErrorMessage="You entered an invalid email address."
Display="Dynamic" />
<br/>
&lt;com:TTextBox ID="Email" />
@@ -152,28 +152,27 @@ class Contact extends TPage
/**
* Pengendali event untuk event OnClick pada tombol submit.
* @param TButton tombol yang memicu event
- * @param TEventParameter parameter event (null di sini)
+ * @param TEventParameter parameter event (null di sini)
*/
public function submitButtonClicked($sender, $param)
{
if ($this->IsValid) // memeriksa apakan validasi input berhasil
{
// mendapatkan nama pengguna, email, umpan balik dari kotak teks
- $name = $this->Name->Text;
+ $name = $this->Name->Text;
$email = $this->Email->Text;
$feedback = $this->Feedback->Text;
-
+
// mengirimkan email ke administrator dengan informasi di atas
$this->mailFeedback($name, $email, $feedback);
}
}
-
+
protected function mailFeedback($name, $email, $feedback)
{
// implementasi pengiriman email umpan balik
}
}
-?>
</com:TTextHighlighter>
<p>
diff --git a/demos/blog-tutorial/protected/pages/Day1/id/Setup.page b/demos/blog-tutorial/protected/pages/Day1/id/Setup.page
index edc469d5..45ae8cf5 100755
--- a/demos/blog-tutorial/protected/pages/Day1/id/Setup.page
+++ b/demos/blog-tutorial/protected/pages/Day1/id/Setup.page
@@ -52,7 +52,6 @@ require_once('path/to/prado.php');
$application = new TApplication;
// jalankan aplikasi dan tangani permintaan pengguna
$application->run();
-?>
</com:TTextHighlighter>
<com:InfoBox>
@@ -148,8 +147,8 @@ Untuk membuat lokasi akar direktori halaman dan mengubah nama homepage, seseoran
<?xml version="1.0" encoding="utf-8"?>
<application id="blog" mode="Debug">
<services>
- <service id="page"
- class="TPageService"
+ <service id="page"
+ class="TPageService"
BasePath="path.to.pages"
DefaultPage="NewHome"
/>
diff --git a/demos/blog-tutorial/protected/pages/Day1/id/ShareLayout.page b/demos/blog-tutorial/protected/pages/Day1/id/ShareLayout.page
index d505beed..0c40181b 100755
--- a/demos/blog-tutorial/protected/pages/Day1/id/ShareLayout.page
+++ b/demos/blog-tutorial/protected/pages/Day1/id/ShareLayout.page
@@ -66,7 +66,6 @@ File kelas <tt>MainLayout.php</tt> sangat sederhana:
class MainLayout extends TTemplateControl
{
}
-?>
</com:TTextHighlighter>
<com:InfoBox>
@@ -145,7 +144,6 @@ class Contact extends TPage
// ...
}
-?>
</com:TTextHighlighter>
<p>
diff --git a/demos/blog-tutorial/protected/pages/Day2/CreateAR.page b/demos/blog-tutorial/protected/pages/Day2/CreateAR.page
index 1d7838a2..0cf28bdd 100755..100644
--- a/demos/blog-tutorial/protected/pages/Day2/CreateAR.page
+++ b/demos/blog-tutorial/protected/pages/Day2/CreateAR.page
@@ -17,60 +17,55 @@ To better organize our directories, we create a new directory <tt>protected/data
</com:TTextHighlighter>
<p>
-Instead of writing the classes manually, we will use the <a href="http://www.pradosoft.com/demos/quickstart/?page=GettingStarted.CommandLine">PRADO command line tool</a> again to generate the classes for us.
+Instead of writing the classes manually, we will use the <a href="?page=GettingStarted.Wsat">PRADO Web Site Administration Tool</a> to generate the classes for us.
+So we need to modify again our application configuration in the services section like follows:
</p>
-<p>
-Under the <tt>blog</tt> directory, run the following command to enter into the interactive mode of the command line tool:
-</p>
-
-<com:TTextHighlighter CssClass="source cli" Language="text">
-php path/to/prado-cli.php shell .
+ <p class="block-content">
+<com:TTextHighlighter CssClass="source" Language="xml">
+<services>
+ ...
+ <service id="wsat" class="System.Wsat.TWsatService" Password="my_secret_password" />
+</services>
</com:TTextHighlighter>
-
-<p>
-We should see
</p>
-<com:TTextHighlighter CssClass="source cli" Language="text">
-Command line tools for Prado 3.1.0.
-** Loaded PRADO appplication in directory "protected".
-PHP-Shell - Version 0.3.1
-(c) 2006, Jan Kneschke <jan@kneschke.de>
-
->> use '?' to open the inline help
-
->>
-</com:TTextHighlighter>
-
-<p>
-At the prompt, enter the following two commands to create <tt>UserRecord</tt> and <tt>PostRecord</tt> classes:
+<p class="block-content">
+ Then you are ready to go to: http://localhost/yoursite/index.php?wsat=TWsatLogin where you should see
+ the following page:
+</p>
+<img src="<%~wsat_login.png%>" style="width: 700px;" />
+<p class="block-content">
+ In the text field you need to type the password previosly specified in the service inclusion. This
+ is part of a basic security system to avoid undesirable persons to use this tool.
</p>
-<com:TTextHighlighter CssClass="source cli" Language="text">
->> generate users Application.database.UserRecord
-
->> generate posts Application.database.PostRecord
-</com:TTextHighlighter>
+ <p class="block-content">
+ In order to generate AR classes you need to go to: http://localhost/divermania/index.php?wsat=TWsatGenerateAR
+ by clicking the proper links in the welcome page. Then you should see the following page:
+</p>
+<img src="<%~blog_wsat_generate_ar.png%>" style="width: 700px;" />
<p>
-Here we used the <a href="http://www.pradosoft.com/demos/quickstart/?page=Fundamentals.Components">namespace format</a> again to specify the classes to be created. The path <tt>Application.database.UserRecord</tt> indicates that we want the <tt>UserRecord</tt> class file to be <tt>protected/database/UserRecord.php</tt>.
+ In the <tt>Output Folder</tt> field we used the <a href="http://www.pradosoft.com/demos/quickstart/?page=Fundamentals.Components">namespace format</a> again, the path <tt>Application.database</tt> indicates that we want to put our class's files in the <tt>protected/database/</tt> folder.
+ The <tt>*</tt> in the <tt>Table Name</tt> field means that we want to generate all AR classes, you can specify a table name instead if you want to generate just a specific AR class.
</p>
<p>
-We should see the following directory structure with two new files under <tt>protected/database</tt>:
+Afterward we should see the following directory structure with two new files under <tt>protected/database</tt>:
</p>
<img src="<%~ directories2.gif %>" class="output" />
<p>
-If we check the <tt>PostRecord</tt> class file, we should see the following content.
+If we check the <tt>PostRecord</tt> class file, we should see something similar to the following content:
</p>
<com:TTextHighlighter CssClass="source" Language="php">
class PostRecord extends TActiveRecord
{
const TABLE='posts';
+
public $post_id;
public $author_id;
public $create_time;
@@ -82,6 +77,15 @@ class PostRecord extends TActiveRecord
{
return parent::finder($className);
}
+
+ public static $RELATIONS = array (
+ 'author' => array(self::BELONGS_TO, 'UserRecord', 'author_id')
+ );
+
+ public function __toString()
+ {
+ return $this->title;
+ }
}
</com:TTextHighlighter>
@@ -89,29 +93,6 @@ class PostRecord extends TActiveRecord
As we see, for each field in the <tt>posts</tt> table, the class has a corresponding data member. The constant <tt>TABLE</tt> specifies the table name for the <tt>PostRecord</tt>. The static method <tt>finder()</tt> allows us to perform query and retrieve post data in terms of <tt>PostRecord</tt> objects.
</p>
-<p>
-We can use the command line tool to do some testing with our newly created Active Record classes. Still in the interactive mode of the command line tool, we enter a PHP statement and should see the following. Interested readers may try some other PHP statements, such as <tt>UserRecord::finder()->findAll()</tt>.
-</p>
-
-<com:TTextHighlighter CssClass="source cli" Language="text">
->> PostRecord::finder()->findAll()
-array
-(
- [0] => PostRecord#1
- (
- [post_id] => '1'
- [author_id] => 'admin'
- [create_time] => '1175708482'
- [title] => 'first post'
- [content] => 'this is my first post'
- [status] => '0'
- [TActiveRecord:_readOnly] => false
- [TActiveRecord:_connection] => null
- [TComponent:_e] => array()
- )
-)
-</com:TTextHighlighter>
-
<h1>Relationship Between Posts and Users</h1>
<p>
Recall that there was a foreign key relationship between the <tt>users</tt> and <tt>posts</tt> table. The entity-relationship diagram is shown below for convienence.
@@ -124,41 +105,9 @@ From the entity-relationship diagram above, we see that the <tt>posts</tt> table
</p>
<p>
-We can model the relationship between <tt>posts</tt> and <tt>users</tt> table in Active Record by modifying the <tt>PostRecord</tt> and <tt>UserRecord</tt> classes as follows.
+The static <tt>$RELATIONS</tt> property of <tt>PostRecord</tt> defines that the property <tt>$author</tt> belongs to an <tt>UserRecord</tt>. In <tt>array(self::BELONGS_TO, 'UserRecord')</tt>, the first element defines the relationship type, in this case <tt>self::BELONGS_TO</tt>. The second element is the name of related record, in this case an <tt>UserRecord</tt>.
</p>
-<com:TTextHighlighter CssClass="source" Language="php">
-class PostRecord extends TActiveRecord
-{
- //... properties and methods as before
-
- public $author; //holds an UserRecord
-
- public static $RELATIONS=array
- (
- 'author' => array(self::BELONGS_TO, 'UserRecord'),
- );
-}
-</com:TTextHighlighter>
-
-<p>
-The static <tt>$RELATIONS</tt> property of <tt>PostRecord</tt> defines that the property <tt>$author</tt> belongs to an <tt>UserRecord</tt>. In <tt>array(self::BELONGS_TO, 'UserRecord')</tt>, the first element defines the relationship type, in this case <tt>self::BELONGS_TO</tt>. The second element is the name of related record, in this case an <tt>UserRecord</tt>. The <tt>UserRecord</tt> is defined similarly below, the difference is that, the user record has many <tt>PostRecord</tt>s.
-</p>
-
-<com:TTextHighlighter CssClass="source" Language="php">
-class UserRecord extends TActiveRecord
-{
- //... properties and methods as before
-
- public $posts=array(); //holds an array of PostRecord
-
- public static $RELATIONS=array
- (
- 'posts' => array(self::HAS_MANY, 'PostRecord'),
- );
-}
-</com:TTextHighlighter>
-
<p>
An array of <tt>UserRecord</tt> with and its corresponding posts may be fetched as follows.
</p>
diff --git a/demos/blog-tutorial/protected/pages/Day2/blog_wsat_generate_ar.png b/demos/blog-tutorial/protected/pages/Day2/blog_wsat_generate_ar.png
new file mode 100644
index 00000000..433c1230
--- /dev/null
+++ b/demos/blog-tutorial/protected/pages/Day2/blog_wsat_generate_ar.png
Binary files differ
diff --git a/demos/blog-tutorial/protected/pages/Day2/wsat_login.png b/demos/blog-tutorial/protected/pages/Day2/wsat_login.png
new file mode 100644
index 00000000..dbe1ad8b
--- /dev/null
+++ b/demos/blog-tutorial/protected/pages/Day2/wsat_login.png
Binary files differ
diff --git a/demos/blog/protected/Common/BlogDataModule.php b/demos/blog/protected/Common/BlogDataModule.php
index a6312dcb..384ee83d 100755
--- a/demos/blog/protected/Common/BlogDataModule.php
+++ b/demos/blog/protected/Common/BlogDataModule.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: BlogDataModule.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
@@ -236,7 +235,7 @@ class BlogDataModule extends TModule
public function queryPosts($postFilter,$categoryFilter,$orderBy,$limit)
{
- //FIXME this is insecure by design since it misses proper escaping
+ //FIXME this is insecure by design since it misses proper escaping
$filter='';
if($postFilter!=='')
$filter.=" AND $postFilter";
@@ -301,7 +300,7 @@ class BlogDataModule extends TModule
public function queryPostCount($postFilter,$categoryFilter)
{
- //FIXME this is insecure by design since it misses proper escaping
+ //FIXME this is insecure by design since it misses proper escaping
$filter='';
if($postFilter!=='')
$filter.=" AND $postFilter";
@@ -424,7 +423,7 @@ class BlogDataModule extends TModule
public function queryComments($filter,$orderBy,$limit)
{
- //FIXME this is insecure by design since it misses proper escaping
+ //FIXME this is insecure by design since it misses proper escaping
if($filter!=='')
$filter='WHERE '.$filter;
$sql="SELECT * FROM tblComments $filter $orderBy $limit";
diff --git a/demos/blog/protected/Common/BlogErrorHandler.php b/demos/blog/protected/Common/BlogErrorHandler.php
index fd5a7044..5446a5ee 100755
--- a/demos/blog/protected/Common/BlogErrorHandler.php
+++ b/demos/blog/protected/Common/BlogErrorHandler.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: BlogErrorHandler.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
Prado::using('System.Exceptions.TErrorHandler');
diff --git a/demos/blog/protected/Common/BlogException.php b/demos/blog/protected/Common/BlogException.php
index 39825f4f..e857cc3d 100755
--- a/demos/blog/protected/Common/BlogException.php
+++ b/demos/blog/protected/Common/BlogException.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: BlogException.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Common/BlogPage.php b/demos/blog/protected/Common/BlogPage.php
index e6da9a8c..2c394e46 100755
--- a/demos/blog/protected/Common/BlogPage.php
+++ b/demos/blog/protected/Common/BlogPage.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: BlogPage.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Common/BlogUser.php b/demos/blog/protected/Common/BlogUser.php
index 93990f69..3ce8af1b 100755
--- a/demos/blog/protected/Common/BlogUser.php
+++ b/demos/blog/protected/Common/BlogUser.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: BlogUser.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
Prado::using('System.Security.TUser');
diff --git a/demos/blog/protected/Common/BlogUserManager.php b/demos/blog/protected/Common/BlogUserManager.php
index 898402fa..c9419d73 100755
--- a/demos/blog/protected/Common/BlogUserManager.php
+++ b/demos/blog/protected/Common/BlogUserManager.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: BlogUserManager.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
Prado::using('System.Security.IUserManager');
diff --git a/demos/blog/protected/Common/XListMenu.php b/demos/blog/protected/Common/XListMenu.php
index a3ad4308..5289167f 100755
--- a/demos/blog/protected/Common/XListMenu.php
+++ b/demos/blog/protected/Common/XListMenu.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: XListMenu.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
Prado::using('System.Web.UI.WebControls.TListControl');
diff --git a/demos/blog/protected/Layouts/MainLayout.php b/demos/blog/protected/Layouts/MainLayout.php
index c2fbe04c..618691a1 100755
--- a/demos/blog/protected/Layouts/MainLayout.php
+++ b/demos/blog/protected/Layouts/MainLayout.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: MainLayout.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Pages/Admin/AdminMenu.php b/demos/blog/protected/Pages/Admin/AdminMenu.php
index f4c89724..01ca60c0 100755
--- a/demos/blog/protected/Pages/Admin/AdminMenu.php
+++ b/demos/blog/protected/Pages/Admin/AdminMenu.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: AdminMenu.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Pages/Admin/ConfigMan.php b/demos/blog/protected/Pages/Admin/ConfigMan.php
index be5e3983..4a938c94 100755
--- a/demos/blog/protected/Pages/Admin/ConfigMan.php
+++ b/demos/blog/protected/Pages/Admin/ConfigMan.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: ConfigMan.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Pages/Admin/PostMan.php b/demos/blog/protected/Pages/Admin/PostMan.php
index 9fa6b7d4..c69788c1 100755
--- a/demos/blog/protected/Pages/Admin/PostMan.php
+++ b/demos/blog/protected/Pages/Admin/PostMan.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: PostMan.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Pages/Admin/UserMan.php b/demos/blog/protected/Pages/Admin/UserMan.php
index 44fd2fc7..de3f7065 100755
--- a/demos/blog/protected/Pages/Admin/UserMan.php
+++ b/demos/blog/protected/Pages/Admin/UserMan.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: UserMan.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Pages/ErrorReport.php b/demos/blog/protected/Pages/ErrorReport.php
index dc92c887..e8614943 100755
--- a/demos/blog/protected/Pages/ErrorReport.php
+++ b/demos/blog/protected/Pages/ErrorReport.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: ErrorReport.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Pages/Posts/EditCategory.php b/demos/blog/protected/Pages/Posts/EditCategory.php
index 67c03204..01beee7f 100755
--- a/demos/blog/protected/Pages/Posts/EditCategory.php
+++ b/demos/blog/protected/Pages/Posts/EditCategory.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: EditCategory.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Pages/Posts/EditPost.php b/demos/blog/protected/Pages/Posts/EditPost.php
index 7345a3cc..d2cc119b 100755
--- a/demos/blog/protected/Pages/Posts/EditPost.php
+++ b/demos/blog/protected/Pages/Posts/EditPost.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: EditPost.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Pages/Posts/ListPost.php b/demos/blog/protected/Pages/Posts/ListPost.php
index eba9f675..51e581d3 100755
--- a/demos/blog/protected/Pages/Posts/ListPost.php
+++ b/demos/blog/protected/Pages/Posts/ListPost.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: ListPost.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Pages/Posts/MyPost.php b/demos/blog/protected/Pages/Posts/MyPost.php
index e1851772..c0724f92 100755
--- a/demos/blog/protected/Pages/Posts/MyPost.php
+++ b/demos/blog/protected/Pages/Posts/MyPost.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: MyPost.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Pages/Posts/NewCategory.php b/demos/blog/protected/Pages/Posts/NewCategory.php
index 98eba96d..3043d657 100755
--- a/demos/blog/protected/Pages/Posts/NewCategory.php
+++ b/demos/blog/protected/Pages/Posts/NewCategory.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: NewCategory.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Pages/Posts/NewPost.php b/demos/blog/protected/Pages/Posts/NewPost.php
index c1127547..d4e2f855 100755
--- a/demos/blog/protected/Pages/Posts/NewPost.php
+++ b/demos/blog/protected/Pages/Posts/NewPost.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: NewPost.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Pages/Posts/ViewPost.php b/demos/blog/protected/Pages/Posts/ViewPost.php
index 05890794..3c549673 100755
--- a/demos/blog/protected/Pages/Posts/ViewPost.php
+++ b/demos/blog/protected/Pages/Posts/ViewPost.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: ViewPost.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Pages/Users/EditUser.php b/demos/blog/protected/Pages/Users/EditUser.php
index 862539f9..e3e2e1b0 100755
--- a/demos/blog/protected/Pages/Users/EditUser.php
+++ b/demos/blog/protected/Pages/Users/EditUser.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: EditUser.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Pages/Users/NewUser.php b/demos/blog/protected/Pages/Users/NewUser.php
index 24932f03..f407c44b 100755
--- a/demos/blog/protected/Pages/Users/NewUser.php
+++ b/demos/blog/protected/Pages/Users/NewUser.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: NewUser.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Pages/Users/ViewUser.php b/demos/blog/protected/Pages/Users/ViewUser.php
index 671e2c0a..61e4c689 100755
--- a/demos/blog/protected/Pages/Users/ViewUser.php
+++ b/demos/blog/protected/Pages/Users/ViewUser.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: ViewUser.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Portlets/AccountPortlet.php b/demos/blog/protected/Portlets/AccountPortlet.php
index 89a2294f..1ef0b820 100755
--- a/demos/blog/protected/Portlets/AccountPortlet.php
+++ b/demos/blog/protected/Portlets/AccountPortlet.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: AccountPortlet.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
Prado::using('Application.Portlets.Portlet');
diff --git a/demos/blog/protected/Portlets/ArchivePortlet.php b/demos/blog/protected/Portlets/ArchivePortlet.php
index 9deb36f1..858b6b3f 100755
--- a/demos/blog/protected/Portlets/ArchivePortlet.php
+++ b/demos/blog/protected/Portlets/ArchivePortlet.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: ArchivePortlet.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
Prado::using('Application.Portlets.Portlet');
diff --git a/demos/blog/protected/Portlets/CategoryPortlet.php b/demos/blog/protected/Portlets/CategoryPortlet.php
index df243df3..c5ed10d3 100755
--- a/demos/blog/protected/Portlets/CategoryPortlet.php
+++ b/demos/blog/protected/Portlets/CategoryPortlet.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: CategoryPortlet.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
Prado::using('Application.Portlets.Portlet');
diff --git a/demos/blog/protected/Portlets/CommentPortlet.php b/demos/blog/protected/Portlets/CommentPortlet.php
index df07fb1e..6225ff45 100755
--- a/demos/blog/protected/Portlets/CommentPortlet.php
+++ b/demos/blog/protected/Portlets/CommentPortlet.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: CommentPortlet.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
Prado::using('Application.Portlets.Portlet');
diff --git a/demos/blog/protected/Portlets/LoginPortlet.php b/demos/blog/protected/Portlets/LoginPortlet.php
index 8b118390..de48363e 100755
--- a/demos/blog/protected/Portlets/LoginPortlet.php
+++ b/demos/blog/protected/Portlets/LoginPortlet.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: LoginPortlet.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
Prado::using('Application.Portlets.Portlet');
diff --git a/demos/blog/protected/Portlets/Portlet.php b/demos/blog/protected/Portlets/Portlet.php
index 0df8ce2e..ae1b04c1 100755
--- a/demos/blog/protected/Portlets/Portlet.php
+++ b/demos/blog/protected/Portlets/Portlet.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: Portlet.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
/**
diff --git a/demos/blog/protected/Portlets/SearchPortlet.php b/demos/blog/protected/Portlets/SearchPortlet.php
index 018ad883..9c6646a8 100755
--- a/demos/blog/protected/Portlets/SearchPortlet.php
+++ b/demos/blog/protected/Portlets/SearchPortlet.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: SearchPortlet.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
Prado::using('Application.Portlets.Portlet');
diff --git a/demos/chat/protected/pages/Home.page b/demos/chat/protected/pages/Home.page
index b896cd28..7740c062 100755
--- a/demos/chat/protected/pages/Home.page
+++ b/demos/chat/protected/pages/Home.page
@@ -1,5 +1,5 @@
<!doctype html public "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Prado Chat Demo</title>
@@ -17,14 +17,14 @@
<com:TPlaceHolder ID="userList" />
</div>
<div class="message-input">
- <com:TActiveTextBox ID="userinput"
+ <com:TActiveTextBox ID="userinput"
Columns="40" Rows="2" TextMode="MultiLine" />
- <com:TActiveImageButton ID="sendButton" CssClass="send-button"
+ <com:TActiveImageButton ID="sendButton" CssClass="send-button"
ImageUrl=<%~ send.gif %> OnClick="processMessage"/>
</div>
-<com:TTimeTriggeredCallback OnCallback="refresh"
+<com:TTimeTriggeredCallback OnCallback="refresh"
Interval="2" StartTimerOnLoad="true" />
<com:TClientScript>
@@ -39,7 +39,6 @@
});
</com:TClientScript>
</com:TForm>
- <com:TJavascriptLogger Visible="false"/>
<div id="footer">
Copyright &copy; 2007 <a href="http://www.pradosoft.com">PradoSoft</a>.
diff --git a/demos/quickstart/protected/controls/Layout.tpl b/demos/quickstart/protected/controls/Layout.tpl
index b9e36e40..c3e67272 100755
--- a/demos/quickstart/protected/controls/Layout.tpl
+++ b/demos/quickstart/protected/controls/Layout.tpl
@@ -50,7 +50,7 @@
</table>
<div id="footer">
-Copyright &copy; 2005-2013 <a href="http://www.pradosoft.com">PradoSoft</a>.
+Copyright &copy; 2005-2014 <a href="http://www.pradosoft.com">PradoSoft</a>.
<br/><br/>
<%= Prado::poweredByPrado() %>
<a href="http://validator.w3.org/check?uri=referer"><img border="0" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>
diff --git a/demos/quickstart/protected/controls/SampleLayout.tpl b/demos/quickstart/protected/controls/SampleLayout.tpl
index 5a5ca898..ba286f0f 100755
--- a/demos/quickstart/protected/controls/SampleLayout.tpl
+++ b/demos/quickstart/protected/controls/SampleLayout.tpl
@@ -19,7 +19,7 @@
</div>
<div class="samplemenu">
<div class="copyright">
- Copyright &copy; 2005-2013 <a href="http://www.pradosoft.com">PradoSoft</a>
+ Copyright &copy; 2005-2014 <a href="http://www.pradosoft.com">PradoSoft</a>
</div>
</div>
diff --git a/demos/quickstart/protected/controls/TopicList.tpl b/demos/quickstart/protected/controls/TopicList.tpl
index adcdff4a..b8563c50 100755..100644
--- a/demos/quickstart/protected/controls/TopicList.tpl
+++ b/demos/quickstart/protected/controls/TopicList.tpl
@@ -8,6 +8,9 @@
<li><a href="?page=GettingStarted.Installation">Installation</a></li>
<li><a href="?page=GettingStarted.NewFeatures">New Features</a></li>
<li><a href="?page=GettingStarted.Upgrading">Upgrading from v2.x and v1.x</a></li>
+ <li><a href="?page=GettingStarted.Upgrading32">Upgrading from v3.2</a></li>
+ <li><a href="?page=GettingStarted.Wsat">Web Site Administration Tool</a></li>
+ <li><a href="?page=GettingStarted.CommandLine">Command Line Tool</a></li>
</ul>
</div>
@@ -17,9 +20,7 @@
<li><a href="?page=GettingStarted.HelloWorld">Creating First PRADO Application</a></li>
<li><a href="?page=Fundamentals.Hangman">Sample: Hangman Game</a></li>
<li><a href="?page=Tutorial.CurrencyConverter">Currency Converter</a></li>
- <li><a href="?page=Tutorial.AddressBook">Address Book</a></li>
- <li><a href="?page=Tutorial.AjaxChat">AJAX Chat Client</a></li>
- <li><a href="?page=GettingStarted.CommandLine">Command Line Tool</a></li>
+ <li><a href="?page=Tutorial.AjaxChat">AJAX Chat Client</a></li>
</ul>
</div>
@@ -27,7 +28,8 @@
<div>Fundamentals</div>
<ul>
<li><a href="?page=Fundamentals.Architecture">Architecture</a></li>
- <li><a href="?page=Fundamentals.Components">Components</a></li>
+ <li><a href="?page=Fundamentals.Components1">Components: Part I</a></li>
+ <li><a href="?page=Fundamentals.Components2">Components: Part II</a></li>
<li><a href="?page=Fundamentals.Controls">Controls</a></li>
<li><a href="?page=Fundamentals.Pages">Pages</a></li>
<li><a href="?page=Fundamentals.Modules">Modules</a></li>
@@ -56,7 +58,9 @@
<li><a href="?page=Controls.Validation">Validation Controls</a></li>
<li><a href="?page=Controls.List">List Controls</a></li>
<li><a href="?page=Controls.Data">Data Controls</a></li>
+ <li><a href="?page=ActiveControls.Introduction">AJAX: Introduction</a></li>
<li><a href="?page=ActiveControls.Home">Active Controls (AJAX)</a></li>
+ <li><a href="?page=JuiControls.Home">Jui Controls (jQuery UI)</a></li>
<li><a href="?page=Controls.NewControl">Writing New Controls</a></li>
</ul>
</div>
diff --git a/demos/quickstart/protected/controls/es/SampleLayout.tpl b/demos/quickstart/protected/controls/es/SampleLayout.tpl
index 24f0575a..d6d4d9b4 100755
--- a/demos/quickstart/protected/controls/es/SampleLayout.tpl
+++ b/demos/quickstart/protected/controls/es/SampleLayout.tpl
@@ -19,7 +19,7 @@
</div>
<div class="samplemenu">
<div class="copyright">
- Copyright &copy; 2005-2013 <a href="http://www.pradosoft.com">PradoSoft</a>
+ Copyright &copy; 2005-2014 <a href="http://www.pradosoft.com">PradoSoft</a>
</div>
</div>
diff --git a/demos/quickstart/protected/controls/es/TopicList.tpl b/demos/quickstart/protected/controls/es/TopicList.tpl
index be4be752..b0129826 100755..100644
--- a/demos/quickstart/protected/controls/es/TopicList.tpl
+++ b/demos/quickstart/protected/controls/es/TopicList.tpl
@@ -1,13 +1,15 @@
<div id="toc">
<div class="topic">
-<div>Comenzar</div>
+<div>Comenzar</div>
<ul>
<li><a href="?page=GettingStarted.Introduction">Introducción</a></li>
<li><a href="?page=GettingStarted.AboutPrado">¿Que es PRADO?</a></li>
<li><a href="?page=GettingStarted.Installation">Instalación</a></li>
<li><a href="?page=GettingStarted.NewFeatures">Nuevas Funcionalidades</a></li>
<li><a href="?page=GettingStarted.Upgrading">Actualizar desde la version v2.x y v1.x</a></li>
+ <li><a href="?page=GettingStarted.Wsat">Web Site Administration Tool</a></li>
+ <li><a href="?page=GettingStarted.CommandLine">Command Line Tool</a></li>
</ul>
</div>
@@ -17,9 +19,8 @@
<li><a href="?page=GettingStarted.HelloWorld">Crear la primera aplicacion en PRADO</a></li>
<li><a href="?page=Fundamentals.Hangman">Ejemplo: El ahorcado</a></li>
<li><a href="?page=Tutorial.CurrencyConverter">Convertidor de Monedas</a></li>
- <li><a href="?page=Tutorial.AddressBook">Libreta de direcciones</a></li>
- <li><a href="?page=Tutorial.AjaxChat">Cliente Chat en AJAX </a></li>
- <li><a href="?page=GettingStarted.CommandLine">Command Line Tool</a></li>
+ <li><a href="?page=Tutorial.AddressBook">Libreta de direcciones</a></li>
+ <li><a href="?page=Tutorial.AjaxChat">Cliente Chat en AJAX </a></li>
</ul>
</div>
@@ -27,7 +28,7 @@
<div>Básicos</div>
<ul>
<li><a href="?page=Fundamentals.Architecture">Arquitectura</a></li>
- <li><a href="?page=Fundamentals.Components">Componentes</a></li>
+ <li><a href="?page=Fundamentals.Components1">Componentes</a></li>
<li><a href="?page=Fundamentals.Controls">Controles</a></li>
<li><a href="?page=Fundamentals.Pages">Páginas</a></li>
<li><a href="?page=Fundamentals.Modules">Mádulos</a></li>
diff --git a/demos/quickstart/protected/controls/fr/SampleLayout.tpl b/demos/quickstart/protected/controls/fr/SampleLayout.tpl
index e421604c..e6fd2347 100755
--- a/demos/quickstart/protected/controls/fr/SampleLayout.tpl
+++ b/demos/quickstart/protected/controls/fr/SampleLayout.tpl
@@ -19,7 +19,7 @@
</div>
<div class="samplemenu">
<div class="copyright">
- Copyright &copy; 2005-2013 <a href="http://www.pradosoft.com">PradoSoft</a>
+ Copyright &copy; 2005-2014 <a href="http://www.pradosoft.com">PradoSoft</a>
</div>
</div>
diff --git a/demos/quickstart/protected/controls/fr/TopicList.tpl b/demos/quickstart/protected/controls/fr/TopicList.tpl
index 44bb0b16..f7bd5f5a 100755..100644
--- a/demos/quickstart/protected/controls/fr/TopicList.tpl
+++ b/demos/quickstart/protected/controls/fr/TopicList.tpl
@@ -8,6 +8,8 @@
<li><a href="?page=GettingStarted.Installation">Installation</a></li>
<li><a href="?page=GettingStarted.NewFeatures">Nouvelles fonctionnalités</a></li>
<li><a href="?page=GettingStarted.Upgrading">Mise à jour de v2.x et v1.x</a></li>
+ <li><a href="?page=GettingStarted.Wsat">Web Site Administration Tool</a></li>
+ <li><a href="?page=GettingStarted.CommandLine">Command Line Tool</a></li>
</ul>
</div>
@@ -17,8 +19,7 @@
<li><a href="?page=GettingStarted.HelloWorld">Créer sa première application PRADO</a></li>
<li><a href="?page=Fundamentals.Hangman">Exemple : Jeu du pendu</a></li>
<li><a href="?page=Tutorial.CurrencyConverter">Convertisseur monétaire</a></li>
- <li><a href="?page=Tutorial.AjaxChat">Chat AJAX</a></li>
- <li><a href="?page=GettingStarted.CommandLine">Outil en ligne de commande</a></li>
+ <li><a href="?page=Tutorial.AjaxChat">Chat AJAX</a></li>
</ul>
</div>
@@ -26,7 +27,7 @@
<div>Fundamentaux</div>
<ul>
<li><a href="?page=Fundamentals.Architecture">Architecture</a></li>
- <li><a href="?page=Fundamentals.Components">Composants</a></li>
+ <li><a href="?page=Fundamentals.Components1">Composants</a></li>
<li><a href="?page=Fundamentals.Controls">Contrôles</a></li>
<li><a href="?page=Fundamentals.Pages">Pages</a></li>
<li><a href="?page=Fundamentals.Modules">Modules</a></li>
diff --git a/demos/quickstart/protected/controls/id/TopicList.tpl b/demos/quickstart/protected/controls/id/TopicList.tpl
index bfc6ed64..bedf6c6f 100755..100644
--- a/demos/quickstart/protected/controls/id/TopicList.tpl
+++ b/demos/quickstart/protected/controls/id/TopicList.tpl
@@ -8,6 +8,8 @@
<li><a href="?page=GettingStarted.Installation">Instalasi</a></li>
<li><a href="?page=GettingStarted.NewFeatures">Fitur Baru</a></li>
<li><a href="?page=GettingStarted.Upgrading">Meningkatkan dari v2.x dan v1.x</a></li>
+ <li><a href="?page=GettingStarted.Wsat">Web Site Administration Tool</a></li>
+ <li><a href="?page=GettingStarted.CommandLine">Command Line Tool</a></li>
</ul>
</div>
@@ -17,9 +19,8 @@
<li><a href="?page=GettingStarted.HelloWorld">Membuat Aplikasi PRADO Pertama</a></li>
<li><a href="?page=Fundamentals.Hangman">Contoh: Permainan Hangman</a></li>
<li><a href="?page=Tutorial.CurrencyConverter">Pengubah Kurs</a></li>
- <li><a href="?page=Tutorial.AddressBook">Buku Alamat</a></li>
- <li><a href="?page=Tutorial.AjaxChat">Klient Obrolan AJAX</a></li>
- <li><a href="?page=GettingStarted.CommandLine">Piranti Baris Perintah</a></li>
+ <li><a href="?page=Tutorial.AddressBook">Buku Alamat</a></li>
+ <li><a href="?page=Tutorial.AjaxChat">Klient Obrolan AJAX</a></li>
</ul>
</div>
@@ -27,7 +28,7 @@
<div>Fundamental</div>
<ul>
<li><a href="?page=Fundamentals.Architecture">Arsitektur</a></li>
- <li><a href="?page=Fundamentals.Components">Komponen</a></li>
+ <li><a href="?page=Fundamentals.Components1">Komponen</a></li>
<li><a href="?page=Fundamentals.Controls">Kontrol</a></li>
<li><a href="?page=Fundamentals.Pages">Halaman</a></li>
<li><a href="?page=Fundamentals.Modules">Modul</a></li>
diff --git a/demos/quickstart/protected/controls/ja/TopicList.tpl b/demos/quickstart/protected/controls/ja/TopicList.tpl
index ccaf5c63..456e13c4 100755..100644
--- a/demos/quickstart/protected/controls/ja/TopicList.tpl
+++ b/demos/quickstart/protected/controls/ja/TopicList.tpl
@@ -8,6 +8,8 @@
<li><a href="?page=GettingStarted.Installation">インストール</a></li>
<li><a href="?page=GettingStarted.NewFeatures">新機能</a></li>
<li><a href="?page=GettingStarted.Upgrading">v2.x v1.x からのバージョンアップ</a></li>
+ <li><a href="?page=GettingStarted.Wsat">Web Site Administration Tool</a></li>
+ <li><a href="?page=GettingStarted.CommandLine">Command Line Tool</a></li>
</ul>
</div>
@@ -17,9 +19,8 @@
<li><a href="?page=GettingStarted.HelloWorld">初めての PRADO アプリケーション</a></li>
<li><a href="?page=Fundamentals.Hangman">Hangman ゲームサンプル</a></li>
<li><a href="?page=Tutorial.CurrencyConverter">通貨コンバーター</a></li>
- <li><a href="?page=Tutorial.AddressBook">アドレス帳</a></li>
- <li><a href="?page=Tutorial.AjaxChat">Ajax チャット</a></li>
- <li><a href="?page=GettingStarted.CommandLine">コマンドラインツール</a></li>
+ <li><a href="?page=Tutorial.AddressBook">アドレス帳</a></li>
+ <li><a href="?page=Tutorial.AjaxChat">Ajax チャット</a></li>
</ul>
</div>
@@ -27,7 +28,7 @@
<div>動作原理</div>
<ul>
<li><a href="?page=Fundamentals.Architecture">アーキテクチャ</a></li>
- <li><a href="?page=Fundamentals.Components">コンポーネント</a></li>
+ <li><a href="?page=Fundamentals.Components1">コンポーネント</a></li>
<li><a href="?page=Fundamentals.Controls">コントロール</a></li>
<li><a href="?page=Fundamentals.Pages">ページ</a></li>
<li><a href="?page=Fundamentals.Modules">モジュール</a></li>
diff --git a/demos/quickstart/protected/controls/pl/TopicList.tpl b/demos/quickstart/protected/controls/pl/TopicList.tpl
index 93052b36..c57cba76 100755..100644
--- a/demos/quickstart/protected/controls/pl/TopicList.tpl
+++ b/demos/quickstart/protected/controls/pl/TopicList.tpl
@@ -8,6 +8,8 @@
<li><a href="?page=GettingStarted.Installation">Instalacja</a></li>
<li><a href="?page=GettingStarted.NewFeatures">Nowe możliwości</a></li>
<li><a href="?page=GettingStarted.Upgrading">Aktualizacja z wersji 2.x oraz 1.x</a></li>
+ <li><a href="?page=GettingStarted.Wsat">Web Site Administration Tool</a></li>
+ <li><a href="?page=GettingStarted.CommandLine">Command Line Tool</a></li>
</ul>
</div>
@@ -17,9 +19,8 @@
<li><a href="?page=GettingStarted.HelloWorld">Tworzenie pierwszej aplikacji PRADO</a></li>
<li><a href="?page=Fundamentals.Hangman">Przykład: gra wisielec</a></li>
<li><a href="?page=Tutorial.CurrencyConverter">Konwenter walut</a></li>
- <li><a href="?page=Tutorial.AddressBook">Książka adresowa</a></li>
- <li><a href="?page=Tutorial.AjaxChat">AJAX-owy klient czat</a></li>
- <li><a href="?page=GettingStarted.CommandLine">Narzędzie linii poleceń</a></li>
+ <li><a href="?page=Tutorial.AddressBook">Książka adresowa</a></li>
+ <li><a href="?page=Tutorial.AjaxChat">AJAX-owy klient czat</a></li>
</ul>
</div>
@@ -27,7 +28,7 @@
<div>Postawy</div>
<ul>
<li><a href="?page=Fundamentals.Architecture">Architektura</a></li>
- <li><a href="?page=Fundamentals.Components">Komponenty</a></li>
+ <li><a href="?page=Fundamentals.Components1">Komponenty</a></li>
<li><a href="?page=Fundamentals.Controls">Kontrolki</a></li>
<li><a href="?page=Fundamentals.Pages">Strony</a></li>
<li><a href="?page=Fundamentals.Modules">Moduły</a></li>
diff --git a/demos/quickstart/protected/controls/zh/TopicList.tpl b/demos/quickstart/protected/controls/zh/TopicList.tpl
index 00fa2280..160455b4 100755..100644
--- a/demos/quickstart/protected/controls/zh/TopicList.tpl
+++ b/demos/quickstart/protected/controls/zh/TopicList.tpl
@@ -8,6 +8,8 @@
<li><a href="?page=GettingStarted.Installation">安装</a></li>
<li><a href="?page=GettingStarted.NewFeatures">版本新功能</a></li>
<li><a href="?page=GettingStarted.Upgrading">从v2.x和v1.x升级</a></li>
+ <li><a href="?page=GettingStarted.Wsat">Web Site Administration Tool</a></li>
+ <li><a href="?page=GettingStarted.CommandLine">Command Line Tool</a></li>
</ul>
</div>
@@ -17,8 +19,7 @@
<li><a href="?page=GettingStarted.HelloWorld">创建第一个PRADO应用</a></li>
<li><a href="?page=Fundamentals.Hangman">Hangman游戏</a></li>
<li><a href="?page=Tutorial.CurrencyConverter">货币转换程序</a></li>
- <li><a href="?page=Tutorial.AjaxChat">AJAX聊天程序</a></li>
- <li><a href="?page=GettingStarted.CommandLine">命令行工具</a></li>
+ <li><a href="?page=Tutorial.AjaxChat">AJAX聊天程序</a></li>
</ul>
</div>
@@ -26,7 +27,7 @@
<div>基础概念</div>
<ul>
<li><a href="?page=Fundamentals.Architecture">框架结构</a></li>
- <li><a href="?page=Fundamentals.Components">部件</a></li>
+ <li><a href="?page=Fundamentals.Components1">部件</a></li>
<li><a href="?page=Fundamentals.Controls">控件</a></li>
<li><a href="?page=Fundamentals.Pages">页面</a></li>
<li><a href="?page=Fundamentals.Modules">模块</a></li>
diff --git a/demos/quickstart/protected/pages/ActiveControls/ActiveButton.page b/demos/quickstart/protected/pages/ActiveControls/ActiveButton.page
index d4167f6e..6385b658 100755
--- a/demos/quickstart/protected/pages/ActiveControls/ActiveButton.page
+++ b/demos/quickstart/protected/pages/ActiveControls/ActiveButton.page
@@ -24,70 +24,4 @@ events of an <tt>TActiveButton</tt>.</p>
<com:RunBar PagePath="ActiveControls.Samples.TActiveButton.Home" />
-<h2 id="122027">TActiveButton Class Diagram</h2>
-<p id="610414" class="block-content">The class diagram for <tt>TActiveButton</tt> is illustrated in the figure below.
-Most active control that can perform callback request have a similar structure.
-</p>
-
-<img src=<%~ TActiveButtonClass.png %> class="figure"
- alt="TActiveButton class diagram" title="TActiveButton class diagram" />
-
-<p id="610415" class="block-content"><tt>TActiveButton</tt> is an extension of <a href="?page=Controls.Button">TButton</a>
-and implements two additional interfaces <tt>ICallbackEventHandler</tt> and
-<tt>IActiveControl</tt>. The <tt>TActiveButton</tt> contains an instance of
-<a href="?page=ActiveControls.BaseActiveControl">TBaseActiveCallbackControl</a>
-available through the <tt>ActiveControl</tt> property of <tt>TActiveButton</tt>.
-The following example set the callback parameter of the <tt>TActiveButton</tt> when
-a callback request is dispatched.
-</p>
-<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code1">
-&lt;com:TActiveButton
- Text="Click Me"
- OnCallback="button_callback"
- ActiveControl.CallbackParameter="value" /&gt;
-</com:TTextHighlighter>
-<p id="610416" class="block-content">In the <tt>OnCallback</tt> event handler method, the <tt>CallbackParameter</tt>
-is available in the <tt>$param</tt> object.</p>
-<com:TTextHighlighter Language="php" CssClass="source block-content" id="code2">
-public function button_callback($sender, $param)
-{
- echo $param->CallbackParameter; //outputs "value"
-}
-</com:TTextHighlighter>
-
-<h2 id="122028">Adding Client Side Behaviour</h2>
-
-<p id="610417" class="block-content">With in the <tt>ActiveControl</tt> property is an instance of
-<a href="?page=ActiveControls.CallbackClientSide">TCallbackClientSide</a> available
-as a property <tt>ClientSide</tt> of <tt>TActiveButton</tt>.
-The <tt>ClientSide</tt> property contains sub-properties, such as <tt>RequestTimeOut</tt>,
-and client-side javascript event handler, such as <tt>OnLoading</tt>,
-that are used by the client-side when making a callback request.
-The following example demonstrates the toggling of a "loading" indicator
-when the client-side is making a callback request.
-</p>
-
-<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code3">
-&lt;com:TClientScript PradoScripts="effects" /&gt;
-<span id="callback_status">Loading...</span>
-
-&lt;com:TActiveButton
- Text="Click Me"
- OnCallback="button_callback"
- ActiveControl.CallbackParameter="value" &gt;
- &lt;prop:ClientSide
- OnLoading="Element.show('callback_status')"
- OnComplete="Element.hide('callback_status')" /&gt;
-&lt;/com:TActiveButton&gt;
-</com:TTextHighlighter>
-
-<p id="610418" class="block-content">The example loads the "effects" javascript library using the
-<a href="?page=Controls.ClientScript">TClientScript</a> component.
-The <tt>ClientSide.OnLoading</tt> property value contains
-javascript statement that uses the "effects" library to show the "Loading..."
-span tag. Similarly, <tt>ClientSide.OnComplete</tt> property
-value contains the javascript statement that hides the "Loading..." span tag.
-See <a href="?page=ActiveControls.CallbackClientSide">TCallbackClientSide</a> for
-further details on client-side property details.
-</p>
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/ActiveRatingList.page b/demos/quickstart/protected/pages/ActiveControls/ActiveRatingList.page
new file mode 100644
index 00000000..7b6fb83d
--- /dev/null
+++ b/demos/quickstart/protected/pages/ActiveControls/ActiveRatingList.page
@@ -0,0 +1,32 @@
+<com:TContent ID="body" >
+
+<h1>TActiveRatingList</h1>
+<com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveRatingList" />
+
+<p class="block-content">
+<tt>TActiveRatingList</tt> is the active counterpart to the original <tt>TRatingList</tt> control.
+</p>
+
+<p class="block-content">
+The <tt>AutoPostBack</tt> property is set to true by default.
+Thus, when a radio button is clicked a <tt>OnCallback</tt> event is
+raised after <tt>OnSelectedIndexChanged</tt> event.
+</p>
+
+<p class="block-content">
+With <tt>ActiveControl.EnableUpdate</tt>
+set to true (default is true), changes to the selection will be updated
+on the client side.
+</p>
+
+<p class="block-content">
+List items can <b>not</b> be changed dynamically during a callback request.
+</p>
+
+<p class="block-content">
+Please refer to the original documentation of <a href="?page=Controls.List">TRatingList</a> for usage.
+</p>
+
+<com:RunBar PagePath="ActiveControls.Samples.TActiveRatingList.Home" />
+
+</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Home.page b/demos/quickstart/protected/pages/ActiveControls/Home.page
index 9586f421..25590089 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Home.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Home.page
@@ -1,15 +1,8 @@
<com:TContent ID="body" >
<h1 id="128031">Active Controls (AJAX enabled Controls)</h1>
-<p id="640423" class="block-content">See the <a href="?page=ActiveControls.Introduction">Introduction</a>
+<p id="640423" class="block-content">
+Active controls extends standard PRADO controls adding the ability to automatically update themselves on callbacks without the need of ad-hoc javascript calls. See the <a href="?page=ActiveControls.Introduction">Introduction</a>
for a quick overview of the concept behind active controls (AJAX enabled controls).
-Most active controls have a property of
-<a href="?page=ActiveControls.BaseActiveControl">ActiveControl</a> and
-a sub-property <a href="?page=ActiveControls.CallbackClientSide">ClientSide</a>
-that provides many properties to customize the controls. The
-<a href="?page=TCallbackClientScript">CallbackClient</a> property of the
-<tt>TPage</tt> class provides many methods to update and alter the client-side content
-during a callback request. Active controls is reliant on a collection
-of <a href="?page=ActiveControl.ClientSideJavascript">javascript classes</a>.
</p>
<p id="640424" class="block-content">For a quick demo of active controls, try the <a href="?page=ActiveControls.ActiveButton">
@@ -104,11 +97,6 @@ TActiveButton</a> control. See also the later part of the <a href="?page=Tutoria
</li>
<li>
- <a href="">TActiveRatingList</a>
- is an EXPERIMENTAL class that displays clickable images that represent a TRadioButtonList.
- </li>
-
- <li>
<a href="?page=ActiveControls.ActiveTextBox">TActiveTextBox</a>
represents a text input field on a Web page.
It can collect single-line, multi-line or password text input from users.
@@ -144,6 +132,11 @@ TActiveButton</a> control. See also the later part of the <a href="?page=Tutoria
TActiveRadioButtonList displays a group of radiobuttons. Each radio button
can perform a callback request.
</li>
+
+ <li>
+ <a href="?page=ActiveControls.ActiveRatingList">TActiveRatingList</a>
+ is an EXPERIMENTAL class that displays clickable images that represent a TRadioButtonList.
+ </li>
</ul>
<h2 id="134001">Active Data Controls</h2>
@@ -201,9 +194,9 @@ TActiveButton</a> control. See also the later part of the <a href="?page=Tutoria
monitors (using a timer) an attribute of an HTML element and triggers a callback request
when the attribute value changes.
</li>
-
+
<li>
- <a href="?page=ActiveControls.DragDrop">TDropContainer &amp; TDraggable</a> represents drag and drop containers.
+ <a href="?page=ActiveControls.DragDrop">TDropContainer &amp; TDraggable</a> represents drag and drop containers.
The former will make its child controls "draggable" while the latter will raise a callback when a draggable
control is dropped on it.
</li>
@@ -357,7 +350,7 @@ if Javascript was disabled on the client's browser.</p>
</td>
<td>Yes</td><td>No</td>
</tr>
-
+
<tr><td>
<a href="?page=ActiveControls.DragDrop">TDropContainer</a>
</td>
@@ -370,95 +363,7 @@ if Javascript was disabled on the client's browser.</p>
<td>No</td><td>No</td>
</tr>
-
-</table>
-
-<h2 id="128036">Active Control Basic Infrastructure Classes</h2>
-<p id="640427" class="block-content">The following classes provide the basic infrastructure classes required to
-realize the active controls. They can be useful to develop new active controls, but Prado users tipically don't need
-to use them.</p>
-<ul id="u4" class="block-content">
- <li>
- <h3 id="190038">TActiveControlAdapter</h3>
- <com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveControlAdapter" />
- <p class="block-content">
- <tt>TActiveControlAdapter</tt> customizes the parent TControl class for active control classes.
- It tracks changes in the viewstate values of the control and update
- differences of the client-side HTML element attributes.
- </p>
- </li>
-
- <li>
- <h3 id="190039">TActiveListControlAdapter</h3>
- <com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveListControlAdapter" />
- <p class="block-content">
- <tt>TActiveListControlAdapter</tt> allows the adapted list controls to change the selections
- on the client-side during a callback request.
- </p>
- </li>
-
- <li>
- <h3 id="190040">TActivePageAdapter</h3>
- <com:DocLink ClassPath="System.Web.UI.ActiveControls.TActivePageAdapter" />
- <p class="block-content">
- <tt>TActivePageAdapter</tt> process the page life-cycle for callback requests.
- </p>
- </li>
-
- <li>
- <h3 id="190041">TBaseActiveControl</h3>
- <com:DocLink ClassPath="System.Web.UI.ActiveControls.TBaseActiveControl" />
- <p class="block-content">
- <tt>TBaseActiveControl</tt> class provided additional basic properties common for every
- active control. An instance of <tt>TBaseActiveControl</tt> or its decendent
- <tt>TBaseActiveCallbackControl</tt> is created by <tt>TActiveControlAdapter::getBaseActiveControl()</tt>
- method.
- The <tt>EnableUpdate</tt> property determines wether the active
- control is allowed to update the contents of the client-side when the callback
- response returns.
- </p>
- </li>
-
- <li>
- <h3 id="190042">TCallbackResponseAdapter</h3>
- <com:DocLink ClassPath="System.Web.UI.ActiveControls.TCallbackResponseAdapter" />
- <p class="block-content">
- <tt>TCallbackResponseAdapter</tt> alters the <tt>THttpResponse</tt>'s outputs.
- A <tt>TCallbackResponseWriter</tt> is used instead of the <tt>TTextWrite</tt> when
- <tt>createHtmlWriter</tt> is called. Each call to createHtmlWriter will create
- a new <tt>TCallbackResponseWriter</tt>. When <tt>flushContent()</tt> is called each
- instance of <tt>TCallbackResponseWriter</tt>'s content is flushed.
- The callback response data can be set using the <tt>ResponseData</tt> property.
- </p>
- </li>
-
-</ul>
-
-<h2 id="190037">Active Control Infrastructure Advanced Classes</h2>
-<p class="block-content">The following classes provide advanced properties and events needed to realize the active controls.
-A Prado user can use them to customize active controls behaviour and interact directly with the client side during a callback.
-</p>
-<ul class="block-content">
- <li>
- <a href="?page=ActiveControls.CallbackClientScript">TCallbackClientScript</a>
- methods to manipulate the client-side HTML elements, also includes methods
- to invoke javascript Effects on HTML elements.
- </li>
- <li>
- <a href="?page=ActiveControls.CallbackClientSide">TCallbackClientSide</a>
- is used to specify client-side callback request options and client-side event handlers.
- </li>
-
- <li>
- <a href="?page=ActiveControls.CallbackEventParameter">TCallbackEventParameter</a>
- provides the parameter passed during the callback request.
- </li>
-
- <li>
- <a href="?page=ActiveControls.CallbackOptions">TCallbackOptions</a>
- allows a common set of callback client-side options to be attached to one or more active controls.
- </li>
-</ul>
+</table>
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Introduction.page b/demos/quickstart/protected/pages/ActiveControls/Introduction.page
index 70cb9cbf..edc0b5bc 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Introduction.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Introduction.page
@@ -1,7 +1,204 @@
<com:TContent ID="body">
-<h1 id="130037">Overview of Active Controls</h1>
-
-TODO:
+<h1 id="130037">AJAX: Introduction</h1>
+<p class="block-content">
+A classic webpage can only transfer data back to the server using an http postback request that requires a full page reload. This is a problem for web applications, since a synchronous page reload breaks the user interaction: the user must wait for the response to arrive and the page will lose its current status (the scrolling position, the currently focused control, etc..).
+</p>
<img src=<%~ postback-callback.png %> class="figure" />
+<p class="block-content">
+A common solution to this problem is the use of AJAX (Asynchronous JavaScript and XML) callbacks. After the first full page load, the web application can make subsequents requests using javascript. The callback requests are asynchronous, so the user can continue to interact with the page while the response is loading. The response contains a list of changes that will be applied to the page "on the fly", like replacing existing elements with new content or add some css style to an existing element.
+</p>
+
+<h2>Interacting with a page on callback</h2>
+
+<p class="block-content">
+PRADO has builtin support for AJAX callbacks in the form of <i>Active Controls</i>. These controls can trigger a callback request and have their properties (value, css style, attributes, ..) updated during a callback.
+Before digging inside the list of Active Controls, it's good to have a look to how a page can be aware if the current request is a callback and how to interact with the page rendered on the client browser.
+<br/>
+The <tt>IsCallBack</tt> property of the <tt>TPage</tt> class exposes whether the current request being handled is the consequence of a callback, and the <a href="?page=ActiveControls.CallbackClientScript">CallbackClient</a> property provides many methods to update and alter the client-side content during a callback request.
+</p>
+
+<com:TTextHighlighter CssClass="source block-content">
+public function onClick($sender, $param)
+{
+ if($this->IsCallback)
+ {
+ $this->getCallbackClient()->hide($this->TextBox1);
+ }
+}
+</com:TTextHighlighter>
+
+<h1>Active Controls (AJAX enabled Controls)</h1>
+<p class="block-content">
+Active controls extends standard PRADO controls adding the ability to automatically update themselves on callbacks without the need of ad-hoc javascript calls. Active controls are reliant on a collection of javascript classes that gets added to the page automatically when needed.
+</p>
+
+<p class="block-content">
+Most active controls have a <tt>ActiveControl.EnableUpdate</tt> property that determines whether the active control is allowed to update the contents of the client-side when the callback response returns. Depending on the control different properties can be updated.
+</p>
+
+<p class="block-content">
+Some active controls can trigger a callback as a consequence of a clientside event (a button click, a checkbox being checked, a DOM event). The callback will first raise the normal serverside event associated to the control (eg: OnClick for a <tt>TButton</tt> or OnSelectedIndexChanged for a <tt>TRadioButtonList</tt>) and then the <tt>OnCallBack</tt> event.
+The <tt>AutoPostBack</tt> property typically defaults to true for these controls.
+</p>
+</p>
+
+<p class="block-content">
+Active controls have a <a href="?page=ActiveControls.CallbackClientSide">ClientSide</a> property that provides many subproperties to customize the controls and to hook some javascript code to the callback lifecycle, like showing a "Loading" logo at the start of a callback and hide it at the end.
+</p>
+
+<h2 id="122027">TActiveButton Class Diagram</h2>
+<p id="610414" class="block-content">The class diagram for <tt>TActiveButton</tt> is illustrated in the figure below.
+Most active control that can perform callback request have a similar structure.
+</p>
+
+<img src=<%~ TActiveButtonClass.png %> class="figure"
+ alt="TActiveButton class diagram" title="TActiveButton class diagram" />
+
+<p id="610415" class="block-content"><tt>TActiveButton</tt> is an extension of <a href="?page=Controls.Button">TButton</a>
+and implements two additional interfaces <tt>ICallbackEventHandler</tt> and
+<tt>IActiveControl</tt>. The <tt>TActiveButton</tt> contains an instance of
+<a href="?page=ActiveControls.BaseActiveControl">TBaseActiveCallbackControl</a>
+available through the <tt>ActiveControl</tt> property of <tt>TActiveButton</tt>.
+The following example set the callback parameter of the <tt>TActiveButton</tt> when
+a callback request is dispatched.
+</p>
+<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code1">
+&lt;com:TActiveButton
+ Text="Click Me"
+ OnCallback="button_callback"
+ ActiveControl.CallbackParameter="value" /&gt;
+</com:TTextHighlighter>
+<p id="610416" class="block-content">In the <tt>OnCallback</tt> event handler method, the <tt>CallbackParameter</tt>
+is available in the <tt>$param</tt> object.</p>
+<com:TTextHighlighter Language="php" CssClass="source block-content" id="code2">
+public function button_callback($sender, $param)
+{
+ echo $param->CallbackParameter; //outputs "value"
+}
+</com:TTextHighlighter>
+
+<h2 id="122028">Adding Client Side Behaviour</h2>
+
+<p id="610417" class="block-content">With in the <tt>ActiveControl</tt> property is an instance of
+<a href="?page=ActiveControls.CallbackClientSide">TCallbackClientSide</a> available
+as a property <tt>ClientSide</tt> of <tt>TActiveButton</tt>.
+The <tt>ClientSide</tt> property contains sub-properties, such as <tt>RequestTimeOut</tt>,
+and client-side javascript event handler, such as <tt>OnLoading</tt>,
+that are used by the client-side when making a callback request.
+The following example demonstrates the toggling of a "loading" indicator
+when the client-side is making a callback request.
+</p>
+
+<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code3">
+&lt;com:TClientScript PradoScripts="effects" /&gt;
+<span id="callback_status">Loading...</span>
+
+&lt;com:TActiveButton
+ Text="Click Me"
+ OnCallback="button_callback"
+ ActiveControl.CallbackParameter="value" &gt;
+ &lt;prop:ClientSide
+ OnLoading="Element.show('callback_status')"
+ OnComplete="Element.hide('callback_status')" /&gt;
+&lt;/com:TActiveButton&gt;
+</com:TTextHighlighter>
+
+<p id="610418" class="block-content">The example loads the "effects" javascript library using the
+<a href="?page=Controls.ClientScript">TClientScript</a> component.
+The <tt>ClientSide.OnLoading</tt> property value contains
+javascript statement that uses the "effects" library to show the "Loading..."
+span tag. Similarly, <tt>ClientSide.OnComplete</tt> property
+value contains the javascript statement that hides the "Loading..." span tag.
+See <a href="?page=ActiveControls.CallbackClientSide">TCallbackClientSide</a> for
+further details on client-side property details.
+</p>
+
+<h2 id="128036">Active Control Basic Infrastructure Classes</h2>
+<p id="640427" class="block-content">The following classes provide the basic infrastructure classes required to
+realize the active controls. They can be useful to develop new active controls, but Prado users tipically don't need
+to use them.</p>
+<ul id="u4" class="block-content">
+ <li>
+ <h3 id="190038">TActiveControlAdapter</h3>
+ <com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveControlAdapter" />
+ <p class="block-content">
+ <tt>TActiveControlAdapter</tt> customizes the parent TControl class for active control classes.
+ It tracks changes in the viewstate values of the control and update
+ differences of the client-side HTML element attributes.
+ </p>
+ </li>
+
+ <li>
+ <h3 id="190039">TActiveListControlAdapter</h3>
+ <com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveListControlAdapter" />
+ <p class="block-content">
+ <tt>TActiveListControlAdapter</tt> allows the adapted list controls to change the selections
+ on the client-side during a callback request.
+ </p>
+ </li>
+
+ <li>
+ <h3 id="190040">TActivePageAdapter</h3>
+ <com:DocLink ClassPath="System.Web.UI.ActiveControls.TActivePageAdapter" />
+ <p class="block-content">
+ <tt>TActivePageAdapter</tt> process the page life-cycle for callback requests.
+ </p>
+ </li>
+
+ <li>
+ <h3 id="190041">TBaseActiveControl</h3>
+ <com:DocLink ClassPath="System.Web.UI.ActiveControls.TBaseActiveControl" />
+ <p class="block-content">
+ <tt>TBaseActiveControl</tt> class provided additional basic properties common for every
+ active control. An instance of <tt>TBaseActiveControl</tt> or its decendent
+ <tt>TBaseActiveCallbackControl</tt> is created by <tt>TActiveControlAdapter::getBaseActiveControl()</tt>
+ method.
+ The <tt>EnableUpdate</tt> property determines wether the active
+ control is allowed to update the contents of the client-side when the callback
+ response returns.
+ </p>
+ </li>
+
+ <li>
+ <h3 id="190042">TCallbackResponseAdapter</h3>
+ <com:DocLink ClassPath="System.Web.UI.ActiveControls.TCallbackResponseAdapter" />
+ <p class="block-content">
+ <tt>TCallbackResponseAdapter</tt> alters the <tt>THttpResponse</tt>'s outputs.
+ A <tt>TCallbackResponseWriter</tt> is used instead of the <tt>TTextWrite</tt> when
+ <tt>createHtmlWriter</tt> is called. Each call to createHtmlWriter will create
+ a new <tt>TCallbackResponseWriter</tt>. When <tt>flushContent()</tt> is called each
+ instance of <tt>TCallbackResponseWriter</tt>'s content is flushed.
+ The callback response data can be set using the <tt>ResponseData</tt> property.
+ </p>
+ </li>
+
+</ul>
+
+<h2 id="190037">Active Control Infrastructure Advanced Classes</h2>
+<p class="block-content">The following classes provide advanced properties and events needed to realize the active controls.
+A Prado user can use them to customize active controls behaviour and interact directly with the client side during a callback.
+</p>
+<ul class="block-content">
+ <li>
+ <a href="?page=ActiveControls.CallbackClientScript">TCallbackClientScript</a>
+ methods to manipulate the client-side HTML elements, also includes methods
+ to invoke javascript Effects on HTML elements.
+ </li>
+
+ <li>
+ <a href="?page=ActiveControls.CallbackClientSide">TCallbackClientSide</a>
+ is used to specify client-side callback request options and client-side event handlers.
+ </li>
+
+ <li>
+ <a href="?page=ActiveControls.CallbackEventParameter">TCallbackEventParameter</a>
+ provides the parameter passed during the callback request.
+ </li>
+
+ <li>
+ <a href="?page=ActiveControls.CallbackOptions">TCallbackOptions</a>
+ allows a common set of callback client-side options to be attached to one or more active controls.
+ </li>
+</ul>
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/Home.php
index 30ef750b..7d3163dc 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/Home.php
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/Home.php
@@ -9,12 +9,12 @@ class Home extends TPage
parent::onInit($param);
if (!$this->getIsPostBack() && !$this->getIsCallBack())
{
-
+
$this->populateProductList();
$this->populateShoppingList();
}
}
-
+
private function getProductData ()
{
return array (
@@ -30,38 +30,41 @@ class Home extends TPage
)
);
}
-
+
private function getProduct ($key)
{
foreach ($this->getProductData() as $product)
if ($product['ProductId']==$key) return $product;
- return null;
+ return null;
}
-
+
protected function populateProductList ()
{
$this->ProductList->DataSource=$this->getProductData();
$this->ProductList->Databind();
}
-
+
protected function populateShoppingList ()
{
$this->ShoppingList->DataSource=$this->getShoppingListData();
$this->ShoppingList->Databind();
-
+
}
-
-
+
+
public function getShoppingListData ()
{
+ $a=$this->getViewState('ShoppingList', array ());
+ var_export($a);
return $this->getViewState('ShoppingList', array ());
}
-
+
public function setShoppingListData ($value)
{
+ var_export($value);
$this->setViewState('ShoppingList', TPropertyValue::ensureArray($value), array ());
}
-
+
public function addItemToCart ($sender, $param)
{
$control=$param->getDroppedControl();
@@ -82,9 +85,9 @@ class Home extends TPage
$shoppingList[$key]['ProductCount']=1;
}
$this->setShoppingListData($shoppingList);
-
+
}
-
+
public function removeItemFromCart ($sender, $param)
{
$control=$param->getDroppedControl();
@@ -99,13 +102,13 @@ class Home extends TPage
unset($shoppingList[$key]);
}
$this->setShoppingListData($shoppingList);
-
+
}
-
+
public function redrawCart ($sender, $param)
{
$this->populateShoppingList();
$this->cart->render($param->NewWriter);
-
+
}
}
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.page
index 1e030102..8482ae14 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.page
@@ -43,5 +43,4 @@ A button causing validation with <tt>OnCallback</tt>:
</table>
-<com:TJavascriptLogger />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBox/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBox/Home.page
index 139306f6..89543ef0 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBox/Home.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBox/Home.page
@@ -71,6 +71,5 @@ A checkbox validated by a required field validator:
</table>
-<com:TJavascriptLogger />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCustomValidator/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCustomValidator/Home.page
index 8ef69a9a..1d16235e 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCustomValidator/Home.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCustomValidator/Home.page
@@ -16,6 +16,5 @@ Custom validator using callbacks:
</td></tr>
</table>
-<com:TJavascriptLogger />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveHyperLink/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveHyperLink/Home.page
index a3f10613..a7767e2d 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveHyperLink/Home.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveHyperLink/Home.page
@@ -66,5 +66,4 @@ Body contents
</tr>
</table>
-<com:TJavascriptLogger />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActivePager/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActivePager/Home.page
index e38486d1..866847d4 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActivePager/Home.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActivePager/Home.page
@@ -15,10 +15,10 @@ Go to page:
OnCallBack="RenderCallback"
>
<prop:ClientSide.OnLoading>
- Element.show('wait')
+ jQuery('#wait').show()
</prop:ClientSide.OnLoading>
<prop:ClientSide.OnComplete>
- Element.hide('wait')
+ jQuery('#wait').hide()
</prop:ClientSide.OnComplete>
</com:TActivePager>
<span id="wait" style="display: none;color: red">Please Wait...</span>
@@ -77,11 +77,11 @@ Total <%# $this->Parent->PageCount %> pages.
OnPageIndexChanged="pageChanged"
OnCallBack="RenderCallback"
>
-<prop:ClientSide.OnLoading>
- Element.show('wait')
+ <prop:ClientSide.OnLoading>
+ jQuery('#wait').show()
</prop:ClientSide.OnLoading>
<prop:ClientSide.OnComplete>
- Element.hide('wait')
+ jQuery('#wait').hide()
</prop:ClientSide.OnComplete>
</com:TActivePager>
<br/>
@@ -92,12 +92,28 @@ Choose page:
OnPageIndexChanged="pageChanged"
OnCallBack="RenderCallback"
>
-<prop:ClientSide.OnLoading>
- Element.show('wait')
+ <prop:ClientSide.OnLoading>
+ jQuery('#wait').show()
</prop:ClientSide.OnLoading>
<prop:ClientSide.OnComplete>
- Element.hide('wait')
+ jQuery('#wait').hide()
</prop:ClientSide.OnComplete>
</com:TActivePager>
-<com:TJavascriptLogger/>
+<br/>
+Use of a css class for buttons:
+<com:TStyleSheet>
+.greenbold_button {
+ background-color: #0f0;
+ font-weight: bold;
+}
+</com:TStyleSheet>
+<com:TActivePager ID="Pager4"
+ ControlToPaginate="DataList"
+ PageButtonCount="3"
+ Mode="Numeric"
+ ButtonType="PushButton"
+ OnPageIndexChanged="pageChanged"
+ OnCallBack="RenderCallback"
+ ButtonCssClass="greenbold_button"
+ />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActivePanel/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActivePanel/Home.page
index 360b6b0f..f3bfe843 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActivePanel/Home.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActivePanel/Home.page
@@ -20,5 +20,4 @@ anyway since they are placed inside the active panel.
</com:TActivePanel>
</td></tr>
</table>
-<com:TJavascriptLogger />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRatingList/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRatingList/Home.page
new file mode 100644
index 00000000..332ccb63
--- /dev/null
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRatingList/Home.page
@@ -0,0 +1,71 @@
+<com:TContent ID="body">
+<h1>TActiveRatingList Samples</h1>
+
+<table class="sampletable">
+
+<tr><td class="samplenote">
+A simple TActiveRatingList and its caption:
+</td><td class="sampleaction">
+
+<com:TLabel ID="label1" Text="Rate it:" />
+<com:TActiveRatingList CaptionID="label1">
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Excellent" />
+</com:TActiveRatingList>
+
+</td></tr>
+
+<tr><td class="samplenote">
+TActiveRatingList in vertical mode, SelectedIndex=2
+</td><td class="sampleaction">
+
+<com:TLabel ID="label2" Text="Rate it:" />
+<com:TActiveRatingList CaptionID="label2" SelectedIndex="2" RepeatDirection="Vertical" Style="caption-side: right;">
+ <com:TListItem Text="Poor" />
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Excellent" />
+ <com:TListItem Text="Super" />
+</com:TActiveRatingList>
+
+</td></tr>
+
+<tr><td class="samplenote">
+TActiveRatingList with RatingStyle=blocks, AutoPostback=true, SelectedValue=Good
+</td><td class="sampleaction">
+
+<com:TLabel ID="label3" Text="Rate it:" />
+<com:TActiveRatingList ID="Rating3" CaptionID="label3" RatingStyle="blocks" SelectedValue="Good" AutoPostBack="true" OnSelectedIndexChanged="rating3_selectionChanged">
+ <com:TListItem Text="Poor" />
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Excellent" />
+ <com:TListItem Text="Super" />
+</com:TActiveRatingList>
+<br/>
+A label to check callback results: <com:TActiveLabel ID="labelResult3" />
+
+</td></tr>
+
+<tr><td class="samplenote">
+TActiveRatingList with AllowInput=false, Rating=4.6
+</td><td class="sampleaction">
+
+<com:TLabel ID="label4" Text="Rate it:" />
+<com:TActiveRatingList CaptionID="label4" AllowInput="false" Rating="4.6">
+ <com:TListItem Text="Poor" />
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Excellent" />
+ <com:TListItem Text="Super" />
+</com:TActiveRatingList>
+
+</td></tr>
+
+</table>
+</com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRatingList/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRatingList/Home.php
new file mode 100644
index 00000000..5e8ed1bd
--- /dev/null
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRatingList/Home.php
@@ -0,0 +1,9 @@
+<?php
+
+class Home extends TPage
+{
+ protected function rating3_selectionChanged($sender, $param)
+ {
+ $this->labelResult3->Text=$this->Rating3->SelectedValue;
+ }
+} \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveTableRow/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveTableRow/Home.page
index 0b3f84fb..49b5bcb6 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveTableRow/Home.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveTableRow/Home.page
@@ -14,6 +14,5 @@
</com:TTable>
<com:TActiveLabel id="lblResult"/>
-<com:TJavascriptLogger />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.page
index 85c0e69f..3790d74b 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.page
@@ -51,6 +51,4 @@ Autocompleter with multiple selection:
</table>
-<com:TJavascriptLogger />
-
-</com:TContent>
+</com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.php
index 2f74bd37..a3b9529b 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.php
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.php
@@ -7,7 +7,7 @@ class Home extends TPage
$token=$param->getToken();
// Sender is the Suggestions repeater
$sender->DataSource=$this->getDummyData($token);
- $sender->dataBind();
+ $sender->dataBind();
}
public function suggestionSelected1($sender,$param) {
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallback/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallback/Home.page
index 04781438..6be81e96 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallback/Home.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallback/Home.page
@@ -39,7 +39,7 @@ The third parameter is taken from the textbox;
{
var request = <%= $this->callback2->ActiveControl->Javascript %>;
var param2 = 'value 2';
- var param3 = $('<%= $this->txt1->ClientID %>').value;
+ var param3 = $('#<%= $this->txt1->ClientID %>').val();
request.setCallbackParameter({'Param1':param1, 'Param2':param2, 'Param3':param3});
request.dispatch();
}
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page
index 539909a9..84521acb 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page
@@ -7,12 +7,37 @@
</p>
<h2>Actions</h2>
-<com:TRadioButtonList ID="radio1">
+<com:TClientScript PradoScripts="jqueryui" />
+<com:TStyleSheet>
+ .red_background {
+ background-color: red;
+ }
+</com:TStyleSheet>
+
+<com:TRadioButtonList ID="radio1" RepeatColumns="2">
<com:TListItem Value="1" Text="alert() me of something" />
<com:TListItem Value="2" Text="toggle Checkbox 1" />
<com:TListItem Value="3" Text="hide Label 1" />
<com:TListItem Value="4" Text="show Label 1" />
- <com:TListItem Value="5" Text="focus TextBox 1" />
+ <com:TListItem Value="5" Text="toggle Label 1 visibility" />
+ <com:TListItem Value="6" Text="toggle Label 1 (fade)" />
+ <com:TListItem Value="7" Text="toggle Label 1 (slide)" />
+ <com:TListItem Value="8" Text="highlight Label 1 (requires jQuery UI)" />
+ <com:TListItem Value="9" Text="focus TextBox 1" />
+ <com:TListItem Value="10" Text="scroll to CheckBox 1" />
+ <com:TListItem Value="11" Text="add red_background class to TextBox 1" />
+ <com:TListItem Value="12" Text="remove red_background class from TextBox 1" />
+ <com:TListItem Value="13" Text="animated resize TextBox 1" />
+ <com:TListItem Value="14" Text="set the 'disable' attribute on TextBox 1" />
+ <com:TListItem Value="15" Text="change the background color of Panel 1" />
+ <com:TListItem Value="16" Text="prepend and append some content inside Panel 1" />
+ <com:TListItem Value="17" Text="prepend and append some content outside Panel 1" />
+ <com:TListItem Value="18" Text="replace Panel 1 with some plain text" />
+ <com:TListItem Value="19" Text="remove TextBox 1" />
+ <com:TListItem Value="20" Text="fade out TextBox 1" />
+ <com:TListItem Value="21" Text="fade in TextBox 1" />
+ <com:TListItem Value="22" Text="trigger a click event on Panel 1" />
+ <com:TListItem Value="23" Text="call a specific effect on TextBox 1 (toggle)" />
</com:TRadioButtonList>
<br/><com:TActiveButton ID="button1" OnCallback="buttonCallback" Text="callback!" />
@@ -32,8 +57,17 @@
<td>TextBox 1:</td>
<td><com:TTextBox ID="txt1" Text="Sample text" /></td>
</tr>
+ <tr>
+ <td>Panel 1:</td>
+ <td>
+ <com:TPanel ID="pan1" Style="width:100px;height:100px;background:green" Attributes.OnClick="alert('clicked on Panel1')" >
+ Panel contents
+ </com:TPanel>
+ </td>
+ </tr>
</table>
-<com:TJavascriptLogger />
-
+<div style="height:900px">
+Thw following space is intentionally left blank for the scrolling test
+</div>
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php
index eeacb660..50a69911 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php
@@ -8,7 +8,7 @@ class Home extends TPage
switch($this->radio1->SelectedValue)
{
case 1:
- $this->getCallbackClient()->evaluateScript("<script> alert('something'); </script>");
+ $this->getCallbackClient()->evaluateScript("alert('something');");
break;
case 2:
$this->getCallbackClient()->check($this->check1, !$this->check1->Checked);
@@ -20,8 +20,74 @@ class Home extends TPage
$this->getCallbackClient()->show($this->label1);
break;
case 5:
+ $this->getCallbackClient()->toggle($this->label1);
+ break;
+ case 6:
+ $this->getCallbackClient()->toggle($this->label1, 'fade');
+ break;
+ case 7:
+ $this->getCallbackClient()->toggle($this->label1, 'slide');
+ break;
+ case 8:
+ $this->getCallbackClient()->highlight($this->label1);
+ break;
+ case 9:
$this->getCallbackClient()->focus($this->txt1);
break;
+ case 10:
+ $this->getCallbackClient()->scrollTo($this->check1, array('duration' => 1000, 'offset' => 10));
+ break;
+ case 11:
+ $this->getCallbackClient()->addCssClass($this->txt1, 'red_background');
+ break;
+ case 12:
+ $this->getCallbackClient()->removeCssClass($this->txt1, 'red_background');
+ break;
+ case 13:
+ $this->getCallbackClient()->jQuery($this->txt1, 'animate', array(
+ array( 'width' => '+=100',
+ 'height' => '+=50'
+ ),
+ array(
+ 'duration' => 1000,
+ )
+ ));
+ break;
+ case 14:
+ $this->getCallbackClient()->setAttribute($this->txt1, 'disabled', true);
+ break;
+ case 15:
+ $this->getCallbackClient()->setStyle($this->pan1, array('background-color' => 'blue'));
+ break;
+ case 16:
+ $this->getCallbackClient()->prependContent($this->pan1, 'prepend<br/>');
+ $this->getCallbackClient()->appendContent($this->pan1, '<br/>append');
+ break;
+ case 17:
+ $this->getCallbackClient()->insertContentBefore($this->pan1, 'before');
+ $this->getCallbackClient()->insertContentAfter($this->pan1, 'after');
+ break;
+ case 18:
+ $this->getCallbackClient()->replaceContent($this->pan1, 'No more Panel 1');
+ break;
+ case 19:
+ $this->getCallbackClient()->remove($this->txt1);
+ break;
+ case 20:
+ $this->getCallbackClient()->fadeOut($this->txt1);
+ break;
+ case 21:
+ $this->getCallbackClient()->fadeIn($this->txt1);
+ break;
+ case 22:
+ $this->getCallbackClient()->click($this->pan1);
+ // alternative
+ // $this->getCallbackClient()->raiseClientEvent($this->pan1, 'click');
+ break;
+ case 23:
+ $this->getCallbackClient()->jQuery($this->txt1, 'toggle');
+ break;
+
}
}
}
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientSide/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientSide/Home.page
index 0d13bb90..0f94fd79 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientSide/Home.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientSide/Home.page
@@ -68,6 +68,5 @@ connection error has occured.
</table>
-<com:TJavascriptLogger />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackOptions/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackOptions/Home.page
index cfb041ea..8c6ccd02 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackOptions/Home.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackOptions/Home.page
@@ -72,6 +72,5 @@ The same TCallbackOptions can be shared among different controls, even of differ
</td></tr>
</table>
-<com:TJavascriptLogger />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/Advanced/Error.page b/demos/quickstart/protected/pages/Advanced/Error.page
index 24c7ead0..391997fb 100755
--- a/demos/quickstart/protected/pages/Advanced/Error.page
+++ b/demos/quickstart/protected/pages/Advanced/Error.page
@@ -71,7 +71,7 @@ The naming convention for the template files used for all other exceptions is as
Again, if the preferred language is not found, PRADO will try to use <tt>exception.html</tt>, instead.
</p>
<div class="note">
-<b class="tip">CAUTION:</b> When saving a template file, please make sure the file is saved using UTF-8 encoding. On Windows, you may use <tt>Notepad.exe</tt> to accomplish such saving.
+<b class="tip">CAUTION:</b> When saving a template file, please make sure the file is saved using UTF-8 encoding. On Windows, you may use <tt>Notepad++</tt> to accomplish such saving.
</div>
</com:TContent>
diff --git a/demos/quickstart/protected/pages/Advanced/Samples/I18N/LanguageList.php b/demos/quickstart/protected/pages/Advanced/Samples/I18N/LanguageList.php
index 4eba37ee..0fea7ac2 100755
--- a/demos/quickstart/protected/pages/Advanced/Samples/I18N/LanguageList.php
+++ b/demos/quickstart/protected/pages/Advanced/Samples/I18N/LanguageList.php
@@ -2,17 +2,15 @@
/**
* Language List
* @author $Author: weizhuo $
- * @version $Id: LanguageList.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package prado.examples
*/
/**
*
* @author $Author: weizhuo $
- * @version $Id: LanguageList.php 3189 2012-07-12 12:16:21Z ctrlaltca $
*/
-class LanguageList extends TTemplateControl
+class LanguageList extends TTemplateControl
{
-
+
}
diff --git a/demos/quickstart/protected/pages/Configurations/Templates1.page b/demos/quickstart/protected/pages/Configurations/Templates1.page
index 22b693a6..6c2870f2 100755
--- a/demos/quickstart/protected/pages/Configurations/Templates1.page
+++ b/demos/quickstart/protected/pages/Configurations/Templates1.page
@@ -3,7 +3,7 @@
<p id="180166" class="block-content">
Templates are used to specify the presentational layout of controls. A template can contain static text, components, or controls that contribute to the ultimate presentation of the associated control. By default, an instance of <tt>TTemplateControl</tt> or its subclass may automatically load and instantiate a template from a file whose name is the same as the control class name. For page templates, the file name suffix must be <tt>.page</tt>; for other regular template controls, the suffix is <tt>.tpl</tt>.
</p>
-<p id="180167" class="block-content">The template format is like HTML, with a few PRADO-specifc tags, including <a href="#ct">component tags</a>, <a href="#tct">template control tags</a>, <a href="#cot">comment tags</a>, <a href="?page=Configurations.Templates2#dct">dynamic content tags</a>, and <a href="?page=Configurations.Templates3#dpt">dynamic property tags</a>. .
+<p id="180167" class="block-content">The template format is like HTML, with a few PRADO-specifc tags, including <a href="#ct">component tags</a>, <a href="#tct">template control tags</a>, <a href="#cot">comment tags</a>, <a href="?page=Configurations.Templates2#dct">dynamic content tags</a>, and <a href="?page=Configurations.Templates3#dpt">dynamic property tags</a>.
</p>
<a name="ct"></a>
diff --git a/demos/quickstart/protected/pages/Controls/Data.page b/demos/quickstart/protected/pages/Controls/Data.page
index 3843b332..829a4ef5 100755
--- a/demos/quickstart/protected/pages/Controls/Data.page
+++ b/demos/quickstart/protected/pages/Controls/Data.page
@@ -2,6 +2,12 @@
<h1 id="5001">Data Controls</h1>
+<p class="block-content">
+Data controls are used to display a repeated content like a list or a table. The content is generated from a collection of items containing the data, called the <tt>DataSource</tt>, and a template describing the appearance, called <tt>Renderer</tt>.
+<br/>
+The process of assigning a DataSource to a Data control and render the template for each item is called <tt>data binding</tt>.
+</p>
+
<ul id="u1" class="block-content">
<li>
<a href="?page=Controls.DataList">TDataList</a> is used to display or modify a list of data items.
diff --git a/demos/quickstart/protected/pages/Controls/List.page b/demos/quickstart/protected/pages/Controls/List.page
index ae8d86bf..5e78bb13 100755
--- a/demos/quickstart/protected/pages/Controls/List.page
+++ b/demos/quickstart/protected/pages/Controls/List.page
@@ -108,4 +108,6 @@ Since v3.1.1, <tt>TDropDownList</tt> starts to support prompt text (something li
This is an EXPERIMENTAL class that displays clickable images that represent a TRadioButtonList.
</p>
+<com:RunBar PagePath="Controls.Samples.TRatingList.Home" />
+
</com:TContent>
diff --git a/demos/quickstart/protected/pages/Controls/Markdown.page b/demos/quickstart/protected/pages/Controls/Markdown.page
new file mode 100644
index 00000000..d7cc00c6
--- /dev/null
+++ b/demos/quickstart/protected/pages/Controls/Markdown.page
@@ -0,0 +1,40 @@
+<com:TContent ID="body" >
+
+<h1>TMarkdown</h1>
+<com:DocLink ClassPath="System.Web.UI.WebControls.TMarkdown" />
+
+<p class="block-content">
+<tt>TMarkdown</tt> is a text formatter that produces html content from plain text. The formatter follows the <a href="http://www.wikipedia.org/wiki/Markdown">Markdown</a> syntax and the <a href="https://help.github.com/articles/github-flavored-markdown">GFM</a> (GitHub Flavored Markdown) extension.
+</p>
+<p class="block-content">
+Any content in the body of <tt>TMarkdown</tt>, including both static text and the rendering results of its child controls, is first converted using the Markdown syntax. Then, to any code block found in the html, syntax highlighting is applied. The code being highlighted follows the syntax of the specified <tt>Language</tt>, which can be 'php' (default), 'prado', 'css', 'html', etc. Here, 'prado' stands for the syntax of PRADO control templates. If the language is not specified in the <tt>Language</tt> property, it can be evinced from the Markdown syntax.
+</p>
+<p class="block-content">
+If line numbers are desired in front of each line, set <tt>ShowLineNumbers</tt> to true.
+</p>
+<p class="block-content">
+To use <tt>TMarkdown</tt>, simply enclose the contents to be formatted within the body of a <tt>TMarkdown</tt> control. The following example formats some text and piece of PHP code,
+</p>
+<com:TTextHighlighter Language="prado" CssClass="source block-content" >
+&lt;com:TMarkdown ShowLineNumbers="true" &gt;
+PRADO Markdown Test
+===================
+
+Some text and a list:
+* item 1
+* item 2
+
+Now, some code:
+
+```php
+public function test() {
+ // comment
+ echo "look me i'm colorful";
+}
+```
+&lt;/com:TMarkdown&gt;
+</com:TTextHighlighter>
+
+<com:RunBar PagePath="Controls.Samples.TMarkdown.Home" />
+
+</com:TContent>
diff --git a/demos/quickstart/protected/pages/Controls/NewControl.page b/demos/quickstart/protected/pages/Controls/NewControl.page
index 10c789db..9a680f43 100755
--- a/demos/quickstart/protected/pages/Controls/NewControl.page
+++ b/demos/quickstart/protected/pages/Controls/NewControl.page
@@ -10,7 +10,7 @@ In general, there are two ways of writing new controls: composition of existing
<h2 id="5402">Composition of Existing Controls</h2>
<p id="660430" class="block-content">
-Composition is the easiest way of creating new controls. It mainly involves instantiating existing controls, configuring them and making them the constituent components. The properties of the constituent components are exposed through <a href="?page=Fundamentals.Components">subproperties</a>.
+Composition is the easiest way of creating new controls. It mainly involves instantiating existing controls, configuring them and making them the constituent components. The properties of the constituent components are exposed through <a href="?page=Fundamentals.Components1">subproperties</a>.
</p>
<p id="660431" class="block-content">
One can compose a new control in two ways. One is to extend <tt>TCompositeControl</tt> and override the <tt>TControl::createChildControls()</tt> method. The other is to extend <tt>TTemplateControl</tt> (or its child classes) and write a control template. The latter is easier to use and can organize the layout constituent components more intuitively, while the former is more efficient because it does not require parsing of the template.
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page
index 06ed6295..f7d03ea2 100755
--- a/demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page
@@ -1,6 +1,11 @@
<com:TContent ID="body">
<h1>Conditional Validation (client-side + server side)</h1>
+<com:TStyleSheet>
+.required {
+ background-color: #E77471;
+}
+</com:TStyleSheet>
<table class="sampletable">
<tr>
<td class="samplenote">
@@ -22,7 +27,7 @@ Check "optional" to validate both textboxes
ErrorMessage="*"
ControlCssClass="required">
<prop:ClientSide.OnValidate>
- sender.enabled = $('<%= $this->check1->ClientID %>').checked;
+ sender.enabled = jQuery('#<%= $this->check1->ClientID %>').get(0).checked;
</prop:ClientSide.OnValidate>
</com:TRequiredFieldValidator>
diff --git a/demos/quickstart/protected/pages/Controls/Samples/THtmlArea/Home.page b/demos/quickstart/protected/pages/Controls/Samples/THtmlArea/Home.page
index 5150922f..5f01c07e 100755
--- a/demos/quickstart/protected/pages/Controls/Samples/THtmlArea/Home.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/THtmlArea/Home.page
@@ -29,7 +29,7 @@ THtmlArea with manually set options
</td></tr>
<tr><td class="samplenote">
-THtmlArea with visual editting disabled:
+THtmlArea with visual editing disabled:
</td><td class="sampleaction">
<com:THtmlArea ID="HtmlArea3" EnableVisualEdit="false" />
<br/>
@@ -38,6 +38,12 @@ THtmlArea with visual editting disabled:
<com:TLiteral Encode="true" ID="Result3" />
</td></tr>
+<tr><td class="samplenote">
+Read-only THtmlArea:
+</td><td class="sampleaction">
+<com:THtmlArea ID="HtmlArea4" ReadOnly="true" Text="Sample html text: <b>bold</b> <i>italic</i>" />
+</td></tr>
+
</table>
</com:TContent>
diff --git a/demos/quickstart/protected/pages/Controls/Samples/THtmlArea4/Home.page b/demos/quickstart/protected/pages/Controls/Samples/THtmlArea4/Home.page
index 6bb6449c..2b6c7a7a 100755
--- a/demos/quickstart/protected/pages/Controls/Samples/THtmlArea4/Home.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/THtmlArea4/Home.page
@@ -29,7 +29,7 @@ THtmlArea4 with manually set options
</td></tr>
<tr><td class="samplenote">
-THtmlArea4 with visual editting disabled:
+THtmlArea4 with visual editing disabled:
</td><td class="sampleaction">
<com:THtmlArea4 ID="HtmlArea3" EnableVisualEdit="false" />
<br/>
@@ -38,6 +38,12 @@ THtmlArea4 with visual editting disabled:
<com:TLiteral Encode="true" ID="Result3" />
</td></tr>
+<tr><td class="samplenote">
+Read-only THtmlArea:
+</td><td class="sampleaction">
+<com:THtmlArea4 ID="HtmlArea4" ReadOnly="true" Text="Sample html text: <b>bold</b> <i>italic</i>" />
+</td></tr>
+
</table>
</com:TContent>
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TMarkdown/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TMarkdown/Home.page
new file mode 100755
index 00000000..4cd0f86b
--- /dev/null
+++ b/demos/quickstart/protected/pages/Controls/Samples/TMarkdown/Home.page
@@ -0,0 +1,31 @@
+<com:TContent ID="body">
+
+<h1>TMarkdown Samples</h1>
+
+<table class="sampletable">
+
+<tr><td class="samplenote">
+Formatting text and code:
+</td><td class="sampleaction">
+<com:TMarkdown ShowLineNumbers="true">
+PRADO Markdown Test
+===================
+
+Some text and a list:
+* item 1
+* item 2
+
+Now, some code:
+
+```php
+public function test() {
+ // comment
+ echo "look me i'm colorful";
+}
+```
+</com:TMarkdown>
+</td></tr>
+
+</table>
+
+</com:TContent>
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TPanel/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TPanel/Home.page
index de419172..6e6cb54d 100755
--- a/demos/quickstart/protected/pages/Controls/Samples/TPanel/Home.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/TPanel/Home.page
@@ -67,6 +67,5 @@ will be clicked because it is set as the default button of the panel.
</com:TPanel>
</td></tr>
</table>
-<com:TJavascriptLogger />
</com:TContent>
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TRatingList/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TRatingList/Home.page
new file mode 100644
index 00000000..5790f840
--- /dev/null
+++ b/demos/quickstart/protected/pages/Controls/Samples/TRatingList/Home.page
@@ -0,0 +1,71 @@
+<com:TContent ID="body">
+<h1>TRatingList Samples</h1>
+
+<table class="sampletable">
+
+<tr><td class="samplenote">
+A simple TRatingList and its caption:
+</td><td class="sampleaction">
+
+<com:TLabel ID="label1" Text="Rate it:" />
+<com:TRatingList CaptionID="label1">
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Excellent" />
+</com:TRatingList>
+
+</td></tr>
+
+<tr><td class="samplenote">
+TRatingList in vertical mode, SelectedIndex=2
+</td><td class="sampleaction">
+
+<com:TLabel ID="label2" Text="Rate it:" />
+<com:TRatingList CaptionID="label2" SelectedIndex="2" RepeatDirection="Vertical" Style="caption-side: right;">
+ <com:TListItem Text="Poor" />
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Excellent" />
+ <com:TListItem Text="Super" />
+</com:TRatingList>
+
+</td></tr>
+
+<tr><td class="samplenote">
+TRatingList with RatingStyle=blocks, AutoPostback=true, SelectedValue=Good
+</td><td class="sampleaction">
+
+<com:TLabel ID="label3" Text="Rate it:" />
+<com:TRatingList ID="Rating3" CaptionID="label3" RatingStyle="blocks" SelectedValue="Good" AutoPostBack="true" OnSelectedIndexChanged="rating3_selectionChanged">
+ <com:TListItem Text="Poor" />
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Excellent" />
+ <com:TListItem Text="Super" />
+</com:TRatingList>
+<br/>
+A label to check postback results: <com:TLabel ID="labelResult3" />
+
+</td></tr>
+
+<tr><td class="samplenote">
+TRatingList with AllowInput=false, Rating=4.6
+</td><td class="sampleaction">
+
+<com:TLabel ID="label4" Text="Rate it:" />
+<com:TRatingList CaptionID="label4" AllowInput="false" Rating="4.6">
+ <com:TListItem Text="Poor" />
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Excellent" />
+ <com:TListItem Text="Super" />
+</com:TRatingList>
+
+</td></tr>
+
+</table>
+</com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TRatingList/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TRatingList/Home.php
new file mode 100644
index 00000000..5e8ed1bd
--- /dev/null
+++ b/demos/quickstart/protected/pages/Controls/Samples/TRatingList/Home.php
@@ -0,0 +1,9 @@
+<?php
+
+class Home extends TPage
+{
+ protected function rating3_selectionChanged($sender, $param)
+ {
+ $this->labelResult3->Text=$this->Rating3->SelectedValue;
+ }
+} \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TSlider/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TSlider/Home.page
index bfbbe8e3..6c79fae4 100755
--- a/demos/quickstart/protected/pages/Controls/Samples/TSlider/Home.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/TSlider/Home.page
@@ -16,7 +16,7 @@ Horizontal slider from -50 to 50, Javascript 'onSlide' handler, ServerSide 'onS
</td><td class="sampleaction">
<com:TSlider id="slider2" AutoPostBack="true" Direction="Horizontal" Value="0" Enabled="true" MinValue="-50" MaxValue="50" OnValueChanged="slider2Changed">
<prop:ClientSide.onSlide>
- $('slider2value').innerHTML = value;
+ $('#slider2value').get(0).innerHTML = value;
</prop:ClientSide.onSlide>
</com:TSlider>
Value : <span id="slider2value"><%=$this->slider2->value%></span>
@@ -28,14 +28,14 @@ Vertical slider from 0 to 1, Javascript 'onSlide' handler, ServerSide 'onSliderC
</td><td class="sampleaction">
<com:TSlider id="slider3" AutoPostBack="false" Direction="Vertical" Enabled="true" MinValue="0" MaxValue="1" StepSize="0.1" OnValueChanged="slider3Changed">
<prop:ClientSide.onSlide>
- $('slider3value').innerHTML = value;
+ $('#slider3value').get(0).innerHTML = value;
</prop:ClientSide.onSlide>
</com:TSlider>
Value : <span id="slider3value"><%=$this->slider3->value%></span>
</td><td class="sampleaction">
<com:TButton Text="Submit"/>
<com:TLabel id="slider3Result"/>
-</td></tr>
-</table>
+</td></tr>
+</table>
</com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TTextHighlighter/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TTextHighlighter/Home.page
index 9bd86078..c7506c67 100755
--- a/demos/quickstart/protected/pages/Controls/Samples/TTextHighlighter/Home.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/TTextHighlighter/Home.page
@@ -12,7 +12,6 @@ Highlighting PHP statements:
$str = 'one|two|three|four';
// will output an array
print_r(explode('|', $str, 2));
-?>
</com:TTextHighlighter>
</td></tr>
diff --git a/demos/quickstart/protected/pages/Controls/Standard.page b/demos/quickstart/protected/pages/Controls/Standard.page
index 463f90a5..43fecfb3 100755
--- a/demos/quickstart/protected/pages/Controls/Standard.page
+++ b/demos/quickstart/protected/pages/Controls/Standard.page
@@ -1,7 +1,9 @@
<com:TContent ID="body" >
<h1 id="52001">Standard Controls</h1>
-<p id="260001" class="block-content">* the tutorial for this control is not completed yet.</p>
+<p class="block-content">
+ Standard controls are the most basic controls in PRADO. They can represent a simple html tag like an &lt;input&gt; or even more comple controls like a date picker or a WYSIWYG text area. Standard controls are in the <tt>System.Web.UI.WebControls</tt> namespace.
+</p>
<ul id="u1" class="block-content">
<li>
<a href="?page=Controls.Accordion">TAccordion</a> displays an accordion consisting of multiple views. At any time, only one view is visible.
@@ -104,6 +106,10 @@
</li>
<li>
+ <a href="?page=Controls.Markdown">TMarkdown</a> formats its body content following the <a href="http://www.wikipedia.org/wiki/Markdown">Markdown</a> syntax.
+ </li>
+
+ <li>
<a href="?page=Controls.MultiView">TMultiView</a> represents a container for a group of <tt>TView</tt> controls, each of which is container for other controls. At any time, at most one <tt>TView</tt> is visible.
</li>
diff --git a/demos/quickstart/protected/pages/Controls/TextHighlighter.page b/demos/quickstart/protected/pages/Controls/TextHighlighter.page
index 1babbb33..5d3428f9 100755
--- a/demos/quickstart/protected/pages/Controls/TextHighlighter.page
+++ b/demos/quickstart/protected/pages/Controls/TextHighlighter.page
@@ -17,7 +17,6 @@ To use <tt>TTextHighlighter</tt>, simply enclose the contents to be syntax highl
<?php
$str = 'one|two|three|four';
print_r(explode('|', $str, 2)); // will output an array
-?>
&lt;/com:TTextHighlighter&gt;
</com:TTextHighlighter>
diff --git a/demos/quickstart/protected/pages/Controls/id/NewControl.page b/demos/quickstart/protected/pages/Controls/id/NewControl.page
index ea083f6c..85c6eff0 100755
--- a/demos/quickstart/protected/pages/Controls/id/NewControl.page
+++ b/demos/quickstart/protected/pages/Controls/id/NewControl.page
@@ -10,7 +10,7 @@ Secara umum, ada dua cara penulisan kontrol baru: komposisi kontrol yang sudah a
<h2 id="5402">Komposisi Kontrol yang Sudah Ada</h2>
<p id="660430" class="block-content">
-Komposisi adalah cara termudah membuat kontrol baru. Ia melibatkan terutama penurunan kontrol yang sudah ada, mengkonfigurasinya dan menjadikannya unsur komponen. Properti dari unsur komponen diperlihatkan melalui <a href="?page=Fundamentals.Components">subproperti</a>.
+Komposisi adalah cara termudah membuat kontrol baru. Ia melibatkan terutama penurunan kontrol yang sudah ada, mengkonfigurasinya dan menjadikannya unsur komponen. Properti dari unsur komponen diperlihatkan melalui <a href="?page=Fundamentals.Components1">subproperti</a>.
</p>
<p id="660431" class="block-content">
Seseorang dapat menciptakan sebuah kontrol baru dalam dua cara. Pertama adalah memperluas <tt>TCompositeControl</tt> dan mengganti metode <tt>TControl::createChildControls()</tt>. Kedua adalah memperluas <tt>TTemplateControl</tt> (atau kelas anaknya) dan menulis template kontrol. Yang terakhir lebih mudah digunakan dan bisa mengatur tata letak unsur komponen lebih intuitif, sementara pembentuk lebih efisien karena ia tidak perlu menguraikan template.
diff --git a/demos/quickstart/protected/pages/Controls/id/TextHighlighter.page b/demos/quickstart/protected/pages/Controls/id/TextHighlighter.page
index b2b500b0..b1bb4ce7 100755
--- a/demos/quickstart/protected/pages/Controls/id/TextHighlighter.page
+++ b/demos/quickstart/protected/pages/Controls/id/TextHighlighter.page
@@ -17,7 +17,6 @@ Untuk menggunakan <tt>TTextHighlighter</tt>, cukup kurung konten yang sintaksnya
<?php
$str = 'one|two|three|four';
print_r(explode('|', $str, 2)); // akan mengeluarkan array
-?>
&lt;/com:TTextHighlighter&gt;
</com:TTextHighlighter>
diff --git a/demos/quickstart/protected/pages/Database/ActiveRecord.page b/demos/quickstart/protected/pages/Database/ActiveRecord.page
index 537c65e0..cf1485bd 100755
--- a/demos/quickstart/protected/pages/Database/ActiveRecord.page
+++ b/demos/quickstart/protected/pages/Database/ActiveRecord.page
@@ -129,7 +129,7 @@ You may specify qualified table names. E.g. for MySQL, <tt>TABLE = "`database1`.
</div>
<div class="note"><b class="note">Note:</b>
-Since version <b>3.1.3</b> you can also use a method <tt>table()</tt> to define the table name.
+Since version <b>3.1.3</b> you can also use a method <tt>table()</tt> to define the table name.
This allows you to dynamically specify which table should be used by the ActiveRecord.
<com:TTextHighlighter Language="php" CssClass="source block-content">
class TeamRecord extends TActiveRecord
@@ -159,7 +159,7 @@ class UserRecord extends TActiveRecord {
}
}
</com:TTextHighlighter>
-<p id="710010" class="block-content">More details regarding TComponent can be found in the <a href="?page=Fundamentals.Components">Components documentation</a>.
+<p id="710010" class="block-content">More details regarding TComponent can be found in the <a href="?page=Fundamentals.Components1">Components documentation</a>.
Later we shall use the getter/setters to allow for lazy loading of relationship objects.
</p>
@@ -1128,7 +1128,7 @@ class PlayerRecord extends BaseFkRecord
<p id="710046" class="block-content">We first need to change the <tt>$skills=array()</tt> declaration to a private property
<tt>$_skills</tt> (notice the underscore) and set it to null instead. This allows us
to define the <tt>skills</tt> property using getter/setter methods
-(see <a href="?page=Fundamentals.Components">Components</a> for details). The <tt>getSkills()</tt>
+(see <a href="?page=Fundamentals.Components1">Components</a> for details). The <tt>getSkills()</tt>
getter method for the <tt>skills</tt> property will lazy load the corresponding skills foreign record
when it is used as follows. Notice that we only do a lazy load when its <tt>$player_id</tt> is
not null (that is, when the record is already fetched from the database or player id was already set).
diff --git a/demos/quickstart/protected/pages/Database/id/ActiveRecord.page b/demos/quickstart/protected/pages/Database/id/ActiveRecord.page
index 454aa3f9..8e81678e 100755
--- a/demos/quickstart/protected/pages/Database/id/ActiveRecord.page
+++ b/demos/quickstart/protected/pages/Database/id/ActiveRecord.page
@@ -3,7 +3,7 @@
<com:SinceVersion Version="3.1a" />
<p id="690478" class="block-content">Rekaman Aktif adalah obyek yang melapisi baris dalam tabel atau view database,
melindungi akses database dan menambahkan logika domain pada data tersebut.
- Dasar dari Rekaman Aktif adalah kelas bisnis, sebagai contoh, kelas
+ Dasar dari Rekaman Aktif adalah kelas bisnis, sebagai contoh, kelas
<tt>Products</tt>, yang hampir menyamai struktur rekaman dari tabel database
dibawahnya. Setiap Rekaman Aktif akan bertanggung jawab atas
penyimpanan dan pengambilan data ke dan dari database. </p>
@@ -14,22 +14,22 @@
</div>
<h2 id="138047">Kapan Menggunakannya</h2>
-<p id="690479" class="block-content">Rekaman Aktif adalah pilihan yang baik untuk logika domain yang tidak terlalu rumit,
+<p id="690479" class="block-content">Rekaman Aktif adalah pilihan yang baik untuk logika domain yang tidak terlalu rumit,
seperti membuat, membaca, memutakhirkan, dan menghapus. Derivasi dan validasi
didasarkan pada satu rekaman yang bekerja denga baik dalam struktur ini. Rekaman Aktif mempunyai kuntungan utama dalam hal kesederhanaan. Mudah untuk membangun Rekaman Aktif, dan mudah untuk dimengerti.</p>
<p id="690480" class="block-content">Akan tetapi, seiring dengan perkembangan logika bisnis Anda dalm hal kompleksitas, Anda akan segera ingin menggunakan hubungan langsung obyek Anda, koleksi, turunan, dan seterusnya. Ini tidak mudah diterapkan ke dalam Rekaman Aktif, dan menambahkannya sedikit demi sedikit menjadi sangat kacau.
Argumen lain terhadap Rekaman Aktif adalah kenyataan bahwa ia menyandingkan desin obyek ke desain database. Ini menjadikannya lebih sulit untuk merefraktorisasi karena proyek terus berjalan.</p>
-
- <p id="690481" class="block-content">Alternatifnya adalah menggunakan Pemeta Data yang yang memisahkan aturan dari obyek bisnis dan bagaimana obyek ini disimpan.
+
+ <p id="690481" class="block-content">Alternatifnya adalah menggunakan Pemeta Data yang yang memisahkan aturan dari obyek bisnis dan bagaimana obyek ini disimpan.
Prado menyediakan pilihan tambahan antara Rekaman Aktif dan
- <a href="?page=Database.SqlMap">Pemeta Data SqlMap</a>.
- Pemeta Data SqlMap bisa dipakai untuk mengambil obyek Rekaman Aktif, hasilnya; obyek Rekaman Aktif ini bisa dipakai untuk memutakhirkan database.
+ <a href="?page=Database.SqlMap">Pemeta Data SqlMap</a>.
+ Pemeta Data SqlMap bisa dipakai untuk mengambil obyek Rekaman Aktif, hasilnya; obyek Rekaman Aktif ini bisa dipakai untuk memutakhirkan database.
"Hubungan" antara Rekaman Aktif dan <a href="?page=Database.SqlMap">SqlMap</a> digambarkan dalam diagram berikut. Lebih rinci mengenai Pemeta Data SqlMap dapat ditemukan dalam
<a href="http://www.pradosoft.com/demos/sqlmap/">Manual SqlMap</a>.
<img src=<%~ sqlmap_active_record.png %> alt="Rekaman Aktif dan SqlMap DataMapper" id="fig:diagram.png" class="figure"/>
</p>
-
+
<p id="690482" class="block-content">
Kelas Rekaman Aktif berfungsi untuk melakukan tugas-tugas berikut.
</p>
@@ -41,22 +41,22 @@
</ul>
<h2>Implikasi Desain</h2>
<p>
-Implementasi Prado terhadap Rekaman Aktif tidak memelihara identitas referensial. Setiap obyek diperoleh menggunakan Rekaman Aktif pada data dalam database. Sebagai contoh, jika Anda meminta kustomer tertentu dan mendapatkan kembali obyek <tt>Customer</tt>, kali berikutnya Anda meminta kustomer itu, Anda akan kembali mendapatkan turunan lain dari obyek <tt>Customer</tt>. Ini berarti bahwa perbandingan tepat (misalnya menggunakan <tt>===</tt>) akan mengembalikan false, sementara perbandingan bebas (misalnya menggunakan <tt>==</tt>) akan mengembalikan true jika nilai obyek sama menurut perbandingan bebas.
+Implementasi Prado terhadap Rekaman Aktif tidak memelihara identitas referensial. Setiap obyek diperoleh menggunakan Rekaman Aktif pada data dalam database. Sebagai contoh, jika Anda meminta kustomer tertentu dan mendapatkan kembali obyek <tt>Customer</tt>, kali berikutnya Anda meminta kustomer itu, Anda akan kembali mendapatkan turunan lain dari obyek <tt>Customer</tt>. Ini berarti bahwa perbandingan tepat (misalnya menggunakan <tt>===</tt>) akan mengembalikan false, sementara perbandingan bebas (misalnya menggunakan <tt>==</tt>) akan mengembalikan true jika nilai obyek sama menurut perbandingan bebas.
<p>
<p>
Implikasi desain ini terkait dengan pertanyaan berikut.
-<i>"Anda pikir kustomer sebagai obyek, di mana hanya satu,
+<i>"Anda pikir kustomer sebagai obyek, di mana hanya satu,
atau Anda pikir obyek yang Anda operasikan sebagai <b>duplikat</b> dari database?"</i>
-Pemetaan O/R lain akan mengartikan bahwa hanya ada satu obyek Kustomer dengan custID 100, dan secara literal ia adalah kustomer.
-Jika Anda mendapatkan kustomer dan mengubah field-nya, maka Anda sekarang telah mengubah kustomer itu.
-<i>"Itu berbatasan dengan: Anda telah mengubah duplikat kustomer ini, tapi bukan pada duplikat itu.
+Pemetaan O/R lain akan mengartikan bahwa hanya ada satu obyek Kustomer dengan custID 100, dan secara literal ia adalah kustomer.
+Jika Anda mendapatkan kustomer dan mengubah field-nya, maka Anda sekarang telah mengubah kustomer itu.
+<i>"Itu berbatasan dengan: Anda telah mengubah duplikat kustomer ini, tapi bukan pada duplikat itu.
Dan jika dua orang memutakhirkan kustomer pada dua duplikat obyek, siapapun yang memutakhirkan pertama kali, atau mungkin yang terakhir yang menang."</i> [A. Hejlsberg 2003]
</p>
<h2 id="142010">Database yang Didukung</h2>
<p id="p1" class="block-content">
-Implementasi Rekaman Aktif memanfaatkan kelas <a href="?page=Database.DAO">Prado DAO</a> untuk akses data.
-Implementasi Rekaman Aktif saat ini mendukung database sebagai berikut.
+Implementasi Rekaman Aktif memanfaatkan kelas <a href="?page=Database.DAO">Prado DAO</a> untuk akses data.
+Implementasi Rekaman Aktif saat ini mendukung database sebagai berikut.
</p>
<ul>
<li><a href="http://www.mysql.com">MySQL 4.1 atau lebih tinggi</a></li>
@@ -69,8 +69,8 @@ Implementasi Rekaman Aktif saat ini mendukung database sebagai berikut.
<h1 id="138048">Mendefinisikan Rekaman Aktif</h1>
<p id="690483" class="block-content">Mari kita anggap tabel
- "<tt>users</tt>" berikut yang berisi dua kolom bernama "<tt>username</tt>" dan "<tt>email</tt>",
- di mana "<tt>username</tt>" juga merupakan kunci primer.
+ "<tt>users</tt>" berikut yang berisi dua kolom bernama "<tt>username</tt>" dan "<tt>email</tt>",
+ di mana "<tt>username</tt>" juga merupakan kunci primer.
<com:TTextHighlighter Language="sql" CssClass="source block-content" id="code_690147">
CREATE TABLE users
(
@@ -88,7 +88,7 @@ class UserRecord extends TActiveRecord
public $username; //kolom bernama "username" dalam tabel "users"
public $email;
-
+
/**
* @return TActiveRecord active record finder instance
*/
@@ -116,7 +116,7 @@ Anda dapat menetapkan nama-nama tabel yang memenuhi syarat. Contohnya untuk MySQ
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code_690149">
class UserRecord extends TActiveRecord {
... //definisi yang sudah ada seprti di atas
-
+
private $_level;
public function setLevel($value) {
$this->_level=TPropertyValue::ensureInteger($value,0);
@@ -126,18 +126,18 @@ class UserRecord extends TActiveRecord {
}
}
</com:TTextHighlighter>
-<p id="710010" class="block-content">Lebih jelas mengenai TComponent dapat ditemukan dalam <a href="?page=Fundamentals.Components">Dokumentasi komponen</a>.
+<p id="710010" class="block-content">Lebih jelas mengenai TComponent dapat ditemukan dalam <a href="?page=Fundamentals.Components1">Dokumentasi komponen</a>.
Nantinya kita harus dapat menggunakan pengambil/penyetel guna membolehkan pengambilan malas atas obyek yang berhubungan.
</p>
<div class="info"><b class="note">Info:</b>
<tt>TActiveRecord</tt> juga dapat bekerja dengan view database dengan menetapkan konstan <tt>TABLE</tt> terkait ke nama view. Akan tetapi,
obyek yang dikembalikan dari view hanya-baca, memanggil metode
-<tt>save()</tt> atau <tt>delete()</tt> akan memunculkan eksepsi.
+<tt>save()</tt> atau <tt>delete()</tt> akan memunculkan eksepsi.
</div>
<p id="690486" class="block-content">
- Metode statis <tt>finder()</tt> mengembalilkan turunan <tt>UserRecord</tt>
+ Metode statis <tt>finder()</tt> mengembalilkan turunan <tt>UserRecord</tt>
yang dapat dipakai untuk mengambil rekaman dari database. Pengambilan rekaman menggunakan metode finder akan didiskusikan nanti. Metode statis <tt>TActiveRecord::finder()</tt> mengambil nama kelas Rekaman Aktif sebagai parameter.
</p>
@@ -152,7 +152,7 @@ obyek yang dikembalikan dari view hanya-baca, memanggil metode
$dsn = 'pgsql:host=localhost;dbname=test'; //Postgres SQL
$conn = new TDbConnection($dsn, 'dbuser','dbpass');
TActiveRecordManager::getInstance()->setDbConnection($conn);
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="710011" class="block-content">Alternatifnya, Anda dapat membuat basis kelas dan mengganti metode <tt>getDbConnection()</tt> untuk mengembalikan
koneksi database. Ini adalah cara sederhana untuk mengijinkan koneksi database multipel. Kode berikut mendemonstrasikan penetapan koneksi database dalam sebuah basis kelas (tidak perlu menyetel koneksi DB di manapun juga).
@@ -178,13 +178,13 @@ class MyDb2Record extends TActiveRecord
return $conn;
}
}
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<h3 class="prado-specific">Menggunakan <tt>application.xml</tt> di dalam Kerangka Kerja Prado</h3>
<div class="prado-specific">
<p id="690488" class="block-content">
- Koneksi database standar dapat juga dikonfigurasi menggunakan tag <tt>&lt;module&gt;</tt> dalam <a href="?page=Configurations.AppConfig">application.xml</a>
+ Koneksi database standar dapat juga dikonfigurasi menggunakan tag <tt>&lt;module&gt;</tt> dalam <a href="?page=Configurations.AppConfig">application.xml</a>
atau <a href="?page=Configurations.PageConfig">config.xml</a> seperti berikut.
<com:TTextHighlighter Language="xml" CssClass="source block-content" id="code_690151">
<modules>
@@ -192,8 +192,8 @@ class MyDb2Record extends TActiveRecord
<database ConnectionString="pgsql:host=localhost;dbname=test"
Username="dbuser" Password="dbpass" />
</module>
-</modules>
-</com:TTextHighlighter>
+</modules>
+</com:TTextHighlighter>
<div class="tip"><b class="note">Tip:</b>
Atribut <tt>EnableCache</tt> ketika disetel ke "true" akan melakukan cache meta data tabel, yakni nama kolom tabel, indeks dan batasan yang disimpan dalam cache dan dipakai ulang. Anda harus membersihkan atau mematikan cache jika Anda ingin melihat perubahan terhadap definisi tabel Anda. <a href="?page=Advanced.Performance#6402">Modul cache</a> juga harus didefinisikan agar cache berfungsi.
</div>
@@ -207,13 +207,13 @@ class MyDb2Record extends TActiveRecord
Username="dbuser" Password="dbpass" />
</module>
- <module class="System.Data.ActiveRecord.TActiveRecordConfig"
+ <module class="System.Data.ActiveRecord.TActiveRecordConfig"
ConnectionID="db1" EnableCache="true" />
<module class="System.Data.SqlMap.TSqlMapConfig"
ConnectionID="db1" ... />
-</modules>
-</com:TTextHighlighter>
+</modules>
+</com:TTextHighlighter>
</p>
</div>
@@ -299,10 +299,10 @@ $criteria->Offset = 20;
<div class="note"><b class="note">Catatan:</b>
Untuk MSSQL dan saat <tt>Limit</tt> serta <tt>Offset</tt> berisi nilai integer positif. Query aktual yang dijalankan diubah oleh kelas
-<com:DocLink ClassPath="System.Data.ActiveRecord.Common.Mssql.TMssqlCommandBuilder"
+<com:DocLink ClassPath="System.Data.ActiveRecord.Common.Mssql.TMssqlCommandBuilder"
Text="TMssqlCommandBuilder"
/>
-berdasarkan pada
+berdasarkan pada
<a href="http://troels.arvin.dk/db/rdbms/#select-limit-offset">http://troels.arvin.dk/db/rdbms/</a>
untuk mengemulasikan kondisi <tt>Limit</tt> dan <tt>Offset</tt>.
</div>
@@ -332,11 +332,11 @@ $finder->find('Username = ? AND Password = ?', $name, $pass);
$finder->findAllByAge($age);
$finder->findAll('Age = ?', $age);
</com:TTextHighlighter>
-
+
<div class="tip"><b class="note">Tip:</b>
Anda juga dapat menggunakan kombinasi <tt>AND</tt> dan <tt>OR</tt> sebagai kondisi dalam metode dinamis.
</div>
-
+
<h3 id="138060"><tt>findBySql()</tt> dan <tt>findAllBySql()</tt></h3>
<p id="690497" class="block-content">Mencari rekaman menggunakan SQL penuh di mana <tt>findBySql()</tt> mengembalikan Rekaman Aktif dan <tt>findAllBySql()</tt>mengembalikan array obyek rekaman.
Untuk setiap kolom yang dikembalikan, kelas Rekaman Aktif terkait harus mendefinisikan variabel atau properti untuk setiap nama kolom terkait.
@@ -371,7 +371,7 @@ Obyek dimutakhirkan dengan kunci primer dari tabel itu yang berisi definisi yang
Sebagai contoh, jika Anda menyisipkan sebuah rekaman baru ke dalam tabel MySQL yang kolomnya didefinisikan dengan "autoincrement", obyek Rekaman Aktif akan dimutakhirkan dengan nilai yang ditambahkan.</div>
<p id="690500" class="block-content">
-Untuk memutakhirkan rekaman dalam database, cukup ubah satu atau lebih properti obyek Rekaman Aktif yang sudah diambil dari database dan kemudian panggil metode <tt>save()</tt>.
+Untuk memutakhirkan rekaman dalam database, cukup ubah satu atau lebih properti obyek Rekaman Aktif yang sudah diambil dari database dan kemudian panggil metode <tt>save()</tt>.
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code_690162">
$user = UserRecord::finder()->findByName('admin');
@@ -392,7 +392,7 @@ Kapan saja Anda memanggil metode <tt>save()</tt> pada obyek TActiveRecord, obyek
<h2 id="138052">Menghapus rekaman yang sudah ada</h2>
<p id="690502" class="block-content">
Untuk menghapus rekaman yang sudah ada dan diambil, cukup panggil metode <tt>delete()</tt>.
- Anda juga dapat menghapus rekaman dalam database dengan kunci primer tanpa mengambil rekaman apapun menggunakan metode <tt>deleteByPk()</tt> (dan metode yang sama <tt>deleteAllByPks()</tt>).
+ Anda juga dapat menghapus rekaman dalam database dengan kunci primer tanpa mengambil rekaman apapun menggunakan metode <tt>deleteByPk()</tt> (dan metode yang sama <tt>deleteAllByPks()</tt>).
Sebagai contoh, untuk menghapus satu atau beberapa rekaman dengan menggunakan satu atau lebih kunci primer.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code_690163">
@@ -457,8 +457,8 @@ TActiveRecord menawarkan dua event, <tt>OnCreateCommand</tt> dan <tt>OnExecuteCo
</p>
<p id="710015" class="block-content">
-Event <tt>OnExecuteCommand</tt> dimunculkan ketika perintah dijalankan dan hasil dari database dikembalikan. Obyek parameter <tt>TDataGatewayResultEventParameter</tt>
-dari properti <tt>Result</tt> berisi data yang dikembalikan dari database.
+Event <tt>OnExecuteCommand</tt> dimunculkan ketika perintah dijalankan dan hasil dari database dikembalikan. Obyek parameter <tt>TDataGatewayResultEventParameter</tt>
+dari properti <tt>Result</tt> berisi data yang dikembalikan dari database.
Data yang dikembalikan dapat diubah dengan setelan properti <tt>Result</tt>.
</p>
@@ -491,7 +491,7 @@ function logger($sender,$param)
}
TActiveRecord::finder('MyRecord')->OnExecuteCommand[] = 'logger';
$obj->OnExecuteCommand[] = array($logger, 'log'); //setiap PHP callback yg benar.
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<h1 id="ar_relations">Hubungan Rekaman Aktif</h1>
<com:SinceVersion Version="3.1rc1" />
@@ -507,7 +507,7 @@ Dalam bagian berikut kita akan menganggap hubungan tabel antara
<img src=<%~ ar_relations.png %> class="figure" />
-<p id="710018" class="block-content">Tujuannya adalah untuk mendapatkan model obyek yang mewakili ke beberapa derajat hubungan entitas dalam gambar di atas.
+<p id="710018" class="block-content">Tujuannya adalah untuk mendapatkan model obyek yang mewakili ke beberapa derajat hubungan entitas dalam gambar di atas.
</p>
<img src=<%~ ar_objects.png %> class="figure" />
@@ -534,7 +534,7 @@ CREATE TABLE bar
</div>
<h2 id="142012">Pemetaan Kunci Asing</h2>
-<p class="block-content">Hubungan entitas antara tabel <tt>Teams</tt> dan <tt>Players</tt> adalah apa yang dikenal sebagai hubungan 1-M. Yaitu, satu Tim dapat berisi 0 atau lebih Pemain. Dalam batasan hubungan obyek, kita katakan bahwa obyek <tt>TeamRecord</tt> <b>memiliki banyak</b> obyek <tt>PlayerRecord</tt>.
+<p class="block-content">Hubungan entitas antara tabel <tt>Teams</tt> dan <tt>Players</tt> adalah apa yang dikenal sebagai hubungan 1-M. Yaitu, satu Tim dapat berisi 0 atau lebih Pemain. Dalam batasan hubungan obyek, kita katakan bahwa obyek <tt>TeamRecord</tt> <b>memiliki banyak</b> obyek <tt>PlayerRecord</tt>.
(Perhatikan kebalikan dari arah hubungan antara tabel dan obyek.)
<p id="710019" class="block-content">
@@ -548,7 +548,7 @@ class TeamRecord extends TActiveRecord
const TABLE='Teams';
public $name;
public $location;
-
+
public $players=array(); // deklarasi ini tidak diperlukan lagi sejak v3.1.2
//mendefinisikan anggota $player yang memiliki hubungan banyak dengan PlayerRecord
@@ -616,7 +616,7 @@ Metode <tt>with_xxx()</tt> (di mana <tt>xxx</tt> adalah nama properti hubungan,
<div class="note"><b class="note">Catatan:</b>
Penting untuk dimengerti bahwa obyek terkait diambil menggunakan query tambahan. Query pertama mengambil obyek sumber, misalnya <tt>TeamRecord</tt> dalam contoh kode di atas.
-Query kedua dipakai untuk mengambil obyek <tt>PlayerRecord</tt> terkait.
+Query kedua dipakai untuk mengambil obyek <tt>PlayerRecord</tt> terkait.
Penggunaan dua query mirip dengan query tunggal menggunakan Left-Outer join dengan eksepsi bahwa hasil null pada tabel kanan tidak dikembalikan. Konsekuensi pemakaian dua tau lebih query adalah kondisi agregat dan join tidak layak menggunakan Rekaman Aktif. Untuk query di luar lingkup Rekaman Aktif, <a href="?page=Database.SqlMap">Pemeta Data SqlMap</a> diapat dupertimbangkan.
</div>
@@ -634,9 +634,9 @@ Kode berikut mendefinisikan kelas <tt>PlayerRecord</tt> lengkap dengan 3 hubunga
class PlayerRecord extends TActiveRecord
{
const TABLE='Players';
- public $player_id;
- public $age;
- public $team_name;
+ public $player_id;
+ public $age;
+ public $team_name;
public $team; // deklarasi ini tidak diperlukan lagi sejak v3.1.2
public $skills=array(); // deklarasi ini tidak diperlukan lagi sejak v3.1.2
@@ -656,9 +656,9 @@ class PlayerRecord extends TActiveRecord
}
</com:TTextHighlighter>
<p id="710026" class="block-content">
-Properti <tt>$RELATIONS</tt> dari <tt>PlayerRecord</tt> mendefinisikan properti <tt>$team</tt> <b>milik</b> <tt>TeamRecord</tt>.
-Array <tt>$RELATIONS</tt> juga mendefinisikan dua hubungan lainnya yang nanti akan kita uji dalam seksi di bawah ini.
-Dalam <tt>array(self::BELONGS_TO, 'TeamRecord')</tt>, elemen pertama mendefinisikan tipe hubungan, dalam hal ini <strong><tt>self::BELONGS_TO</tt></strong> dan
+Properti <tt>$RELATIONS</tt> dari <tt>PlayerRecord</tt> mendefinisikan properti <tt>$team</tt> <b>milik</b> <tt>TeamRecord</tt>.
+Array <tt>$RELATIONS</tt> juga mendefinisikan dua hubungan lainnya yang nanti akan kita uji dalam seksi di bawah ini.
+Dalam <tt>array(self::BELONGS_TO, 'TeamRecord')</tt>, elemen pertama mendefinisikan tipe hubungan, dalam hal ini <strong><tt>self::BELONGS_TO</tt></strong> dan
elemen kedua adalah string <tt>'TeamRecord'</tt> yang terkait ke nama kelas dari kelas <tt>TeamRecord</tt>.
Obyek pemain dengan obyek tim terkait dapat diambil serperti berikut.
</p>
@@ -703,7 +703,7 @@ class ProfileRecord extends TActiveRecord
<p id="710029" class="block-content">Intinya, ada hubungan "<b>belongs to</b>" untuk obyek yang mengaitkan entitas yang memmpunyai kolom yakni kunci asing. Dalam keadaan tertentu, kita melihat bahwa tabel <tt>Profiles</tt> mempunyai batasan kunci asing pada kolom <tt>player_id</tt> yang terkait ke tabel
<tt>Players</tt> kolom <tt>player_id</tt>. Selanjutnya, obyek <tt>ProfileRecord</tt>
memiliki properti (<tt>$player</tt>) yang adalah <b>milik</b> obyek <tt>PlayerRecord</tt>.
-Demikian juga, tabel <tt>Players</tt> mempunyai batasan kunci asing pada kolom <tt>team_name</tt> yang terkait ke tabel <tt>Teams</tt> kolom <tt>name</tt>.
+Demikian juga, tabel <tt>Players</tt> mempunyai batasan kunci asing pada kolom <tt>team_name</tt> yang terkait ke tabel <tt>Teams</tt> kolom <tt>name</tt>.
Kemudian, obyek <tt>PlayerRecord</tt> mempunyai properti (<tt>$team</tt>) yang adalah <b>milik</b> obyek <tt>TeamRecord</tt>.
</p>
@@ -756,13 +756,13 @@ dua elemen tambahan ini mirip seperti parameter yang dikirimkan ke metode <tt>fi
Obyek dapat dengan mudah menangani field multi nilai dengan menggunakan koleksi sebagai nilai field. Database relasional tidak memiliki fitur ini dan dibatasi hanya ke field nilai-tunggal. Ketika Anda memetakan asosiasi satu-ke-banyak, Anda bisa menangani ini menggunakan hubungan <b>has many</b>, intinya menggunakan kunci asing untuk nilai-tunggal akhir dari asosiasi. Tapi asosiasi banyak-ke-banyak tidak bisa melakukan ini karena tidak ada nilai-tunggal akhir ke kunci asing yang dipegangnya.
</p>
<p id="710033" class="block-content">
-Jawabannya adalah resolusi klasik yang telah dipakai oleh orang selama dekade ini yakni: buat tabel ekstra (tabel asosiasi) untuk merekam asosiasi.
+Jawabannya adalah resolusi klasik yang telah dipakai oleh orang selama dekade ini yakni: buat tabel ekstra (tabel asosiasi) untuk merekam asosiasi.
Ide dasarnya adalah menggunakan tabel asosiasi untuk menyimpan asosiasi. Tabel ini memiliki ID kunci asing untuk dua tabel yang dikaitkan bersama, masing-masing memiliki pasangan dari obyek yang diasosiasikan.
</p>
<p id="710034" class="block-content">
Tabel asosiasi tidak mempunyai kaitan obyek dalam-memori dan kunci primernya adalah gabungan dari dua kunci primer dari tabel yang diasosiasikan.
-Dalam batasan yang sederhana, tuntuk mengambil data dari tabel asosiasi, Anda melakukan dua query (secara umum, ini juga bisa dicapai menggunakan satu query yang terdiri dari join).
-Anggap pengambilan koleksi <tt>SkillRecord</tt> untuk daftar obyek <tt>PlayerRecord</tt>.
+Dalam batasan yang sederhana, tuntuk mengambil data dari tabel asosiasi, Anda melakukan dua query (secara umum, ini juga bisa dicapai menggunakan satu query yang terdiri dari join).
+Anggap pengambilan koleksi <tt>SkillRecord</tt> untuk daftar obyek <tt>PlayerRecord</tt>.
Dalam hal ini, Anda melakukan query dalam dua tahap. Tahap pertama meng-query tabel <tt>Players</tt> untuk mencari seluruh baris dari pemain yang Anda inginkan. Tahap kedua mencari obyek <tt>SkillRecord</tt> ID pemain terkait untuk setiap barisnya dalam tabel asosiasi <tt>Player_Skills</tt> menggunakan sebuah inner join.
</p>
@@ -794,7 +794,7 @@ class SkillRecord extends TActiveRecord
<p id="710036" class="block-content">
Properti statis <tt>$RELATIONS</tt> dari SkillRecord mendefinisikan bahwa properti <tt>$players</tt> memiliki banyak <tt>PlayerRecord</tt>s melalui tabel asosiasi '<tt>Player_Skills</tt>'.
Dalam <tt>array(self::MANY_TO_MANY, 'PlayerRecord', 'Player_Skills')</tt>, elemen pertama mendefinisikan tipe hubungan, dalam hal ini <strong><tt>self::HAS_MANY</tt></strong>,
-elemen kedua adalah string <tt>'PlayerRecord'</tt> yang terkait ke nama kelas dari kelas <tt>PlayerRecord</tt>, dan elemen ketiga adalah nama dari nama tabel asosiasi.
+elemen kedua adalah string <tt>'PlayerRecord'</tt> yang terkait ke nama kelas dari kelas <tt>PlayerRecord</tt>, dan elemen ketiga adalah nama dari nama tabel asosiasi.
</p>
<div class="note"><b class="note">Catatan:</b>
@@ -815,22 +815,22 @@ Metode <tt>with_xxx()</tt> (di mana <tt>xxx</tt> adalah nama properti hubungan,
<p id="710039" class="block-content">
Untuk tabel asosiasi yang mererefensi dirinya sendiri, yaitu titik asosiasi ke tabel yang sama. Sebagai contoh, anggap tabel <tt>items</tt> dengan item terkait M-N melalui tabel asosiasi <tt>related_items</tt>. Sintaks dalam contoh berikut adalah benar untuk database PostgreSQL. Untuk database lain, lihat dokumentasinya masing-masing untuk mendefinisikan batasan kunci asing.
<com:TTextHighlighter Language="sql" CssClass="source block-content">
-CREATE TABLE items
+CREATE TABLE items
(
- "item_id" SERIAL,
+ "item_id" SERIAL,
"name" VARCHAR(128) NOT NULL,
PRIMARY KEY("item_id")
);
-CREATE TABLE "related_items"
+CREATE TABLE "related_items"
(
- "item_id" INTEGER NOT NULL,
- "related_item_id" INTEGER NOT NULL,
- CONSTRAINT "related_items_pkey" PRIMARY KEY("item_id", "related_item_id"),
+ "item_id" INTEGER NOT NULL,
+ "related_item_id" INTEGER NOT NULL,
+ CONSTRAINT "related_items_pkey" PRIMARY KEY("item_id", "related_item_id"),
CONSTRAINT "related_items_item_id_fkey" FOREIGN KEY ("item_id")
REFERENCES "items"("item_id")
ON DELETE CASCADE
ON UPDATE NO ACTION
- NOT DEFERRABLE,
+ NOT DEFERRABLE,
CONSTRAINT "related_items_related_item_id_fkey" FOREIGN KEY ("related_item_id")
REFERENCES "items"("item_id")
ON DELETE CASCADE
@@ -839,7 +839,7 @@ CREATE TABLE "related_items"
);
</com:TTextHighlighter>
-<p id="710040" class="block-content">Nama tabel asosiasi dalam elemen ketiga dari array hubungan dapat berisi nama kolom tabel asing. Kolom yang didefinisikan dalam tabel asosiasi harus juga didefinisikan dalam kelas rekaman (contohnya properti <tt>$related_item_id</tt> terkait ke kolom <tt>related_item_id</tt> dalam tabel <tt>related_items</tt>).
+<p id="710040" class="block-content">Nama tabel asosiasi dalam elemen ketiga dari array hubungan dapat berisi nama kolom tabel asing. Kolom yang didefinisikan dalam tabel asosiasi harus juga didefinisikan dalam kelas rekaman (contohnya properti <tt>$related_item_id</tt> terkait ke kolom <tt>related_item_id</tt> dalam tabel <tt>related_items</tt>).
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content">
class Item extends TActiveRecord
@@ -849,18 +849,18 @@ class Item extends TActiveRecord
public $details;
//id item asing tambahan didefinisikan dalam tabel asosiasi
- public $related_item_id;
+ public $related_item_id;
public $related_items=array(); // deklarasi ini tidak diperlukan lagi sejak v3.1.2
public static $RELATIONS=array
(
- 'related_items' => array(self::MANY_TO_MANY,
+ 'related_items' => array(self::MANY_TO_MANY,
'Item', 'related_items.related_item_id'),
);
}
</com:TTextHighlighter>
<div class="tip"><b class="note">Tip:</b>
-Kunci gabungan dalam tabel asing dapat ditetapkan sebagai nilai dipisahkan koma diantara kurung buka/tutup. Contohnya <tt>'related_items.(id1,id2)'</tt>.
+Kunci gabungan dalam tabel asing dapat ditetapkan sebagai nilai dipisahkan koma diantara kurung buka/tutup. Contohnya <tt>'related_items.(id1,id2)'</tt>.
</div>
<!---
@@ -882,7 +882,7 @@ Karena kelas <tt>TeamRecord</tt> berisi hubungan <b>has many</b> dengan <tt>Play
</p>
<p id="710043" class="block-content">Untuk menghapus obyek asing tertentu (atau setiap obyek Rekaman Aktif), cukup panggil metode obyek <tt>delete()</tt>. Anda dapat menyiapkan batas kunci asing tabel database seperti saat menghapus data tertentu dalam database ia akan menghapus data yang direferensi juga (ia juga dapat dicapai dengan menggunakan pemicu database). Contohnya seperti mempunyai batasan "<tt>ON DELETE CASCADE</tt>".
-Menghapus kunci obyek asing dengan menyetel nilai properti ke null atau menghapus obyek dari array <b>TIDAK</b> akan menghapus data terkait dalam database.
+Menghapus kunci obyek asing dengan menyetel nilai properti ke null atau menghapus obyek dari array <b>TIDAK</b> akan menghapus data terkait dalam database.
</p>
<p id="710044" class="block-content">Untuk menghapus asosiasi hubungan banyak-ke-banyak melalui tabel asosiasi, Rekaman Aktif yang terkait tabel asosiasi yang bisas dipakai. Kemudian asosiasi dapat dihapus dengan memanggil metode <tt>deleteByPk()</tt>, sebagai contoh:
@@ -908,7 +908,7 @@ class PlayerRecord extends BaseFkRecord
//... properti dan metode lainnya seperti sebelumnya
private $_skills; //ubah ke private dan standar sebagai null
-
+
public function getSkills()
{
if($this->_skills===null && $this->player_id !==null)
@@ -932,7 +932,7 @@ class PlayerRecord extends BaseFkRecord
}
</com:TTextHighlighter>
<p id="710046" class="block-content">Pertama kita perlu mengubah deklarasi <tt>$skills=array()</tt> ke properti private <tt>$_skills</tt> (perhatikan garis bawah) dan sebaliknya setel ke null. Ini membolehkan kita untuk mendefinisikan properti <tt>skills</tt> menggunakan metode pengambil/penyetel
-(lihat <a href="?page=Fundamentals.Components">Komponen</a> untuk lebih jelasnya). Metode pengambil <tt>getSkills()</tt> untuk properti <tt>skills</tt> akan mengambil malas rekaman skill terkait saat ia dipakai sebagai berikut. Catatan bahwa kita hanya melakukan pengambilan malas ketika <tt>$player_id</tt> tidak null (yakni, ketika rekaman sudah diambil dari database ataau id player sudah disetel).
+(lihat <a href="?page=Fundamentals.Components1">Komponen</a> untuk lebih jelasnya). Metode pengambil <tt>getSkills()</tt> untuk properti <tt>skills</tt> akan mengambil malas rekaman skill terkait saat ia dipakai sebagai berikut. Catatan bahwa kita hanya melakukan pengambilan malas ketika <tt>$player_id</tt> tidak null (yakni, ketika rekaman sudah diambil dari database ataau id player sudah disetel).
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content">
$player = PlayerRecord::finder()->findByPk(1);
@@ -943,13 +943,13 @@ $player->skills[] = new SkillRecord(); //menambah skill
<p id="710047" class="block-content">The <tt>setSkills()</tt> memastikan bahwa properti <tt>skills</tt> akan selalu berupa TList.
Menggunakan TList yang membolehkan kita untuk menyetel elemen properti <tt>skills</tt> seolah-olah mereka
-sebuah array. Contohnya <tt>$player->skills[] = new SkillRecord()</tt>. Jika <tt>array</tt> dipakai, kesalahan PHP
-akan dikeluarkan.
+sebuah array. Contohnya <tt>$player->skills[] = new SkillRecord()</tt>. Jika <tt>array</tt> dipakai, kesalahan PHP
+akan dikeluarkan.
</p>
<h2>Pemetaan Kolom</h2>
<p>
-Sejak v3.1.1, Rekaman Aktif mulai mendukung pemetaan kolom. Pemetaan kolom membolehkan para
+Sejak v3.1.1, Rekaman Aktif mulai mendukung pemetaan kolom. Pemetaan kolom membolehkan para
pengembang untuk mengalamatkan kolom dalam Rekaman Aktif menggunakan konvensi penamaan lebih
konsisten. Dalam keadaan tertentu, menggunakan pemetaan kolom, seseorang dapat mengakses kolom
menggunakan apapun namanya yang disukainya, daripada nama terbatas yang didefinisikan dalam
diff --git a/demos/quickstart/protected/pages/Database/pl/ActiveRecord.page b/demos/quickstart/protected/pages/Database/pl/ActiveRecord.page
index 97a054fe..3a073e57 100755
--- a/demos/quickstart/protected/pages/Database/pl/ActiveRecord.page
+++ b/demos/quickstart/protected/pages/Database/pl/ActiveRecord.page
@@ -2,7 +2,7 @@
<h1 id="138046">Rekord Aktywny (ang. Active Record)</h1>
<com:SinceVersion Version="3.1a" />
<p id="690478" class="block-content">Rekordy Aktywne są obiektami, które opakowują wiersz w bazie danych lub widoku,
- obudowują (ang. encapsulate) dostęp do bazy danych oraz dziedziny logiki dla tych danych.
+ obudowują (ang. encapsulate) dostęp do bazy danych oraz dziedziny logiki dla tych danych.
Podstawą Rekordu Aktywnego są klasy biznesowe np. klasa
<tt>Produkty</tt>, które są bardzo podobne do struktury rekordu należącego do bazy danych. Każdy Rekord Aktywny jest odpowiedzialny
za zapisywanie i łądowanie danych do i z bazy danych.</p>
@@ -13,18 +13,18 @@
<h2 id="138047">Kiedy używać?</h2>
<p id="690479" class="block-content">Rekord Aktywne jest dobrym wyborem dla dziedziny logiki, która nie jest zbyt złożona, tak jak tworzenie, odczyty, aktualizacje oraz usuwanie.
- Pochocne (ang. derivations) oraz sprawdzenia bazujące na pojedyńczym rekordzie sprawdzają się dobrze w tej konstrukcji.
+ Pochocne (ang. derivations) oraz sprawdzenia bazujące na pojedyńczym rekordzie sprawdzają się dobrze w tej konstrukcji.
Rekord Aktywne ma podstawową zaletę, którą jest prostota. Łatwo jest stworzyć Rekord Aktywny, łatwo go również zrozuieć.
</p>
- <p id="690480" class="block-content">Jednakże, jeśli twoja logika biznesowa staje się coraz bardziej złożona, wkrótce będziesz chciał
+ <p id="690480" class="block-content">Jednakże, jeśli twoja logika biznesowa staje się coraz bardziej złożona, wkrótce będziesz chciał
używać bezpośrednich relacji, zbiorów, dziedziczenia twojego obiektu i tak dalej. Nie da się tego łatwo odwzorować za pomocą Rekordu Aktywnego,
a dodawanie ich po kawałku staje się bardzo kłopotliwe. Innym argumentem przeciw Rekordowi Aktywnemu jest fakt, że łączy model obiektowy z modelem baz danych.
To czyni trudniejszym refaktoring, gdy projekt idzie naprzód.
</p>
<p id="690481" class="block-content">Alternatywą jest używanie wzorca Data Mapper (mapa danych), który odseparowuje role obiektu biznesowego od tego jak te obiekty są przechowywane.
- Prado dostarcza
+ Prado dostarcza
Prado provides a darmowy wybór pomiędzy rekordem aktywnym a <a href="?page=Database.SqlMap">SqlMap Data Mapper</a>.
SqlMap Data Mapper może być uzywany do wczytania obiektów Rekordu Aktywnego, i na odwrót, te Rekordy Aktywne mogą zostać użyte do aktualizacji bazy danych.
Związek pomiędzy Rekordem Aktywnym a <a href="?page=Database.SqlMap">SqlMap</a> przedstawiony jest na kolejnym diagramie. Więcej informacji związanych z SqlMap Data Mapper można znaleźć w
@@ -33,7 +33,7 @@
</p>
<p id="690482" class="block-content">
- Klasa Rekordu aktywnego posiada funkcjonalność do przeprowadzenia następujących zadań:
+ Klasa Rekordu aktywnego posiada funkcjonalność do przeprowadzenia następujących zadań:
</p>
<ul id="u1" class="block-content">
<li>Tworzenie, zwracanie, aktualizowani i usuwanie recordów (CRUD)</li>
@@ -51,16 +51,16 @@ zwróci fałsz, natomiast luźne porównianie (np. używając <tt>==</tt>) zwró
<p>
Jest to implikacja modelu wynikająca z następującego pytania:
<i>"Czy myślisz o kliencie jako o obiekcie, którego któy jest tylko jeden, czy też myślisz o obiekcie na którym działasz jako o <b>kopii</b> bazy danych.</i>
-Inne mapowania O/R implikują, że istnieje tylko jeden obiekt Klienta z KlientID 100
+Inne mapowania O/R implikują, że istnieje tylko jeden obiekt Klienta z KlientID 100
Other O/R mappings will imply that there is only one Customer object with custID 100 i to dosłownie jest ten klient.
-Jeśli pobierzesz klienta i zmienisz pole w nim, wtedy masz zmienionego tego klienta.
+Jeśli pobierzesz klienta i zmienisz pole w nim, wtedy masz zmienionego tego klienta.
<i>"To kontroastuje z: zmieniłeś tą kopię klienta ale nie tamtą kopię.
Jeśli dwóch ludzi zaktualizuje kleinta z dwóch kopii obiektu, kto zaktualizuje pierwszy lub być może ostanie wygrywa."</i> [A. Hejlsberg 2003]
</p>
<h2 id="142010">Wspierane bazy danych</h2>
<p id="p1" class="block-content">
-Implementacja Aktywnego Rekordu wykorzystuje kalsy <a href="?page=Database.DAO">Prado DAO</a> by uzyskać dostęp do danych. Aktualna implementacja Aktywnego Rekordu wspiera następujace bazy danych
+Implementacja Aktywnego Rekordu wykorzystuje kalsy <a href="?page=Database.DAO">Prado DAO</a> by uzyskać dostęp do danych. Aktualna implementacja Aktywnego Rekordu wspiera następujace bazy danych
</p>
<ul>
<li><a href="http://www.mysql.com">MySQL 4.1 i wyższe</a></li>
@@ -104,7 +104,7 @@ class UserRecord extends TActiveRecord
</p>
<p id="690485" class="block-content">Każda kolumna tablicy "<tt>users</tt>" musi posiadać odpowiadającą jej właściwość o tej samej nazwie co kolumna w tablicy w klasie <tt>UserRecord</tt>.
Oczywiście, możesz zdefiniować dodatkowe zmienne lub właściwości, które nie istnieją w strukturze tablicy.
- Stała <tt>TABLE</tt> jest opcjonalna w klasie , kiedy nazwa klasy jest taka sama jak nazwa tablicy w bazie danych, w przeciwnym przypadku <tt>TABLE</tt>
+ Stała <tt>TABLE</tt> jest opcjonalna w klasie , kiedy nazwa klasy jest taka sama jak nazwa tablicy w bazie danych, w przeciwnym przypadku <tt>TABLE</tt>
musi określać nazwę tablicy, która odpowiada klasie Rekordu Aktywnego.
</p>
@@ -114,7 +114,7 @@ Możesz określić kwalifikowane (ang. qualified) nazwy tablic np dla MySQL, <tt
<p class="block-content" id="ar_as_component">
Odkąd <tt>TActiveRecord</tt> rozszerza <tt>TComponent</tt>, metody setter i getter mogą zostać zdefiniowane
- by umożliwić kontrolę nad tym jak zmienne są ustawiane i zwracane. Na przykłąd dodanie właściwości <tt>$level</tt>
+ by umożliwić kontrolę nad tym jak zmienne są ustawiane i zwracane. Na przykłąd dodanie właściwości <tt>$level</tt>
do klasy UserRecord:
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code_690149">
@@ -130,13 +130,13 @@ class UserRecord extends TActiveRecord {
}
}
</com:TTextHighlighter>
-<p id="710010" class="block-content">Więcej szczegółów dotyczących TComponent można znaleźć <a href="?page=Fundamentals.Components">dokumentacji komponentów</a>.
+<p id="710010" class="block-content">Więcej szczegółów dotyczących TComponent można znaleźć <a href="?page=Fundamentals.Components1">dokumentacji komponentów</a>.
Później użyjemy metod getter/setters by umożliwić opóźnione ładowanie (ang. lazy loading) obiektów relacji.
</p>
<div class="info"><b class="note">Info:</b>
<tt>TActiveRecord</tt> może również działać z widokami poprzez przypisanie do stałej <tt>TABLE</tt>
- odpowiedniej nazwy widoku. Jednakże obiektu zwracane przez widoki są tylko do odczytu, wywołanie metod <tt>save()</tt> lub <tt>delete()</tt>
+ odpowiedniej nazwy widoku. Jednakże obiektu zwracane przez widoki są tylko do odczytu, wywołanie metod <tt>save()</tt> lub <tt>delete()</tt>
spowoduje wywołanie wyjątku.
</div>
@@ -149,7 +149,7 @@ spowoduje wywołanie wyjątku.
<h2 id="138049">Ustanawianie połączenia z bazą danych</h2>
<p id="690487" class="block-content">
Domyślne połączenie z bazą dla Rekordu Aktywnego może zostać ustawione następujaco.
- Zobacz <a href="?page=Database.DAO">Ustanawianie połączenia z bazą</a>
+ Zobacz <a href="?page=Database.DAO">Ustanawianie połączenia z bazą</a>
by uzyskać ogólnie dalsze szczegóły odnośnie tworzenia połączenia z bazą danych.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code_690150">
@@ -160,7 +160,7 @@ TActiveRecordManager::getInstance()->setDbConnection($conn);
</com:TTextHighlighter>
<p id="710011" class="block-content">Alternatywnie, możesz stworzyć klasę bazową i nadpisać metodę <tt>getDbConnection()</tt>
-do zwracania połączenia z bazą. To jest prosty spodób, by umożliwić wielkokrotne połączenia do wielu baz danych.
+do zwracania połączenia z bazą. To jest prosty spodób, by umożliwić wielkokrotne połączenia do wielu baz danych.
Następujący kod demonstruje definiowanie połączenia z bazą danych w klasie bazowej (nie ma potrzeby by ustawiać połączenie DB gdziekolwiek indziej).
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content">
@@ -203,7 +203,7 @@ class MyDb2Record extends TActiveRecord
</com:TTextHighlighter>
<div class="tip"><b class="note">Wskazówka:</b>
Atrybut <tt>EnableCache</tt> gdy ustawiony na "true" będzie keszował metadane tablicy, to oznacza, że nazwy kolumn, indeksy i ograniczenia (ang. constraints)
- są zapisywane w keszu i używane ponownie. Musisz wyczyścić lub wyłączyć kesz jeśli chcesz zobaczyć wprowadzone zmiany do definicji twoich tablic.
+ są zapisywane w keszu i używane ponownie. Musisz wyczyścić lub wyłączyć kesz jeśli chcesz zobaczyć wprowadzone zmiany do definicji twoich tablic.
<a href="?page=Advanced.Performance#6402">Moduł keszowania</a> musi być również zdefiniowany dla keszu by zadziałał.
</div>
</p>
@@ -229,14 +229,14 @@ class MyDb2Record extends TActiveRecord
<h2 id="138050">Ładowanie danych z tablicy</h2>
<p id="690490" class="block-content">
- Klasa <tt>TActiveRecord</tt> dostarcza wielu wygodnych metod do wyszukiwania rekordów z bazy danych.
+ Klasa <tt>TActiveRecord</tt> dostarcza wielu wygodnych metod do wyszukiwania rekordów z bazy danych.
Najprostszym jest znajdowanie jednego rekordu poprzez dopasowanie klucza głównego lub klucza złożonego (ang. composite key)
(klucz główny skłądający się z wielu kolumn).
Zobacz <com:DocLink ClassPath="System.Data.ActiveRecord.TActiveRecord" /> by dowiedzieć się więcej.
</p>
<div class="info"><b class="note">Info:</b>
-Wszystkie metody wyszukujące, które mogą zwrócić tylko 1 rekord zwrócą <tt>null</tt> jeśli nie znajdą pasujących danych.
+Wszystkie metody wyszukujące, które mogą zwrócić tylko 1 rekord zwrócą <tt>null</tt> jeśli nie znajdą pasujących danych.
Wszystkie metody wyszukujące, które zwracają tablicę rekordów zwrócą pustą tablicęm jeśli nie znajdą pasujących danych.
</div>
@@ -352,8 +352,8 @@ Możesz również użyć połączenia <tt>AND</tt> oraz <tt>OR</tt> jako warunek
</div>
<h3 id="138060"><tt>findBySql()</tt> oraz <tt>findAllBySql()</tt></h3>
-<p id="690497" class="block-content">Znajdują rekordy używając pełnego zapytania SQL z tym, że <tt>findBySql()</tt>
-zwraca Rekord Aktywny a <tt>findAllBySql()</tt>zwraca tablicę obiektów rekordów.
+<p id="690497" class="block-content">Znajdują rekordy używając pełnego zapytania SQL z tym, że <tt>findBySql()</tt>
+zwraca Rekord Aktywny a <tt>findAllBySql()</tt>zwraca tablicę obiektów rekordów.
Dla każdej zwróconej kolumny, odpowiadająca klasa Rekordu Aktywnego musi posiadać zdefiniowaną zmienną lub właściwość odpowiadającą nazwie kolumny.
<com:TTextHighlighter Language="php" CssClass="source block-content">
class UserRecord2 extends UserRecord
@@ -382,7 +382,7 @@ $user2 = new UserRecord($data); //stwórz przekazując istniejące dane
$user2->save(); //wstaw nowy rekord
</com:TTextHighlighter>
<div class="tip"><b class="note">Wskazówka:</b>
-Obiekty są aktualizowe automatycznie o wartość klucza głównego dla tych tablic, które zawierają definicję
+Obiekty są aktualizowe automatycznie o wartość klucza głównego dla tych tablic, które zawierają definicję
określającą automatyczne tworzenie klucza głównego dla nowo tworzonych rekordów (przyp. tłum. autoincrement).
Na przykład jeśli wstawiasz nowy rekord do tablicy MySQL która posiada kolumnę zdefiniowaną jako to obiekt Rekordu Aktywnego
zostanie zaktualizowant o nową zwiększoną wartość.</div>
@@ -403,10 +403,10 @@ Obiekt Rekordu Aktywnego posiada prosty cykl życia zilustrowany następujący d
<img src=<%~ object_states.png %> alt="Active Records Life Cycle" id="fig:cycle.png" class="figure"/>
<p id="690501" class="block-content">
Widzimy, że nowe obiekty Rekordu Aktywnego są tworzone zarówno przez jedną z metod <tt>find*()</tt>
-lub poprzez stworzenie nowej instancji poprzez użycie polecenia PHP <tt>new</tt>. Obiekty stworzone przez metodę <tt>find*()</tt>
+lub poprzez stworzenie nowej instancji poprzez użycie polecenia PHP <tt>new</tt>. Obiekty stworzone przez metodę <tt>find*()</tt>
zaczynają ze stanem <tt>czysty (ang. clean)</tt>. Nowa instancja TActiveRecord stworzona inaczej niż za pomocą metod <tt>find*()</tt> zaczyna ze stanem <tt>nowy (ang. new)</tt>.
-Kiedykolwiek wywołasz metodę <tt>save()</tt> na obiekcie TActiveRecord, obiekt przyjmuje stan <tt>czysty</tt>.
-Obiekty będące <tt>czystymi</tt> stają się <tt>brudne (ang. dirty)</tt> kiedy jeden lub więcej ze stwoich wewnętrznych stanów ulegnie zmianie.
+Kiedykolwiek wywołasz metodę <tt>save()</tt> na obiekcie TActiveRecord, obiekt przyjmuje stan <tt>czysty</tt>.
+Obiekty będące <tt>czystymi</tt> stają się <tt>brudne (ang. dirty)</tt> kiedy jeden lub więcej ze stwoich wewnętrznych stanów ulegnie zmianie.
Wywoałanie metody <tt>delete()</tt> obiektu kończy cykl życia, żadne inne akcje nie mogą być wywołane na obiekcie.
</p>
@@ -451,7 +451,7 @@ $finder->deleteBy_Username_And_Password($name,$pass);
</com:TTextHighlighter>
<h2 id="138053">Tranzakcje</h2>
-<p id="690504" class="block-content">Wszystkie obiekkty Rekordu Aktywnego zawierają właściwość <tt>DbConnection</tt>,
+<p id="690504" class="block-content">Wszystkie obiekkty Rekordu Aktywnego zawierają właściwość <tt>DbConnection</tt>,
która może być używana by uzyskać obiekt tranzakcyjny.
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code_690165">
$finder = UserRecord::finder();
@@ -486,8 +486,8 @@ Zdarzenie <tt>OnExecuteCommand</tt> jest wywoływane kiedy polecenie jest wykona
</p>
<h3 id="142016">Przykład z logowaniem</h3>
-<p id="710016" class="block-content">Używając <tt>OnExecuteCommand</tt> możemy przypiąć uchwyt zdarzenia by logować całe
-zapytanie SQL wwywoływane dla danej instancji lub klasy TActiveRecord. Na przykład definiujemy klasę bazową i nadpisujemy
+<p id="710016" class="block-content">Używając <tt>OnExecuteCommand</tt> możemy przypiąć uchwyt zdarzenia by logować całe
+zapytanie SQL wwywoływane dla danej instancji lub klasy TActiveRecord. Na przykład definiujemy klasę bazową i nadpisujemy
metodę <tt>getDbConnection()</tt> lub konstruktor.
</p>
@@ -537,12 +537,12 @@ W następnych sekcjach będziemy rozważać nastepujące relacje pomiędzy tabel
<img src=<%~ ar_objects.png %> class="figure" />
<p class="block-content">
-Istnieje rozbieżność pomiędzy relacjami w obiektach i relacjami w tablicach.
+Istnieje rozbieżność pomiędzy relacjami w obiektach i relacjami w tablicach.
Po pierwsze jest różnica w reprezentacji. Obiekty trzymają powiązanie poprzez przechowywanie referencji,
które są trzymane poprzez zarządzające pamięcią środowiko uruchomieniowe. Bazy relacyjne trzymają powiązanie poprzez utworzenie klucza do innej tablicy.
- Po drugie, obiekty mogą łatwo uzywać kolekcji by trzymać wielokrotnie referencje z jednego pola,
-to handle multiple references from a single field, gdyż normalizacja zmusza wszystkie powiązania relacji encji by były pojedyńczymi wartościami.
-To prowadzi do odwrócenia struktury danych pomiędzy obiektami i tablicami.
+ Po drugie, obiekty mogą łatwo uzywać kolekcji by trzymać wielokrotnie referencje z jednego pola,
+to handle multiple references from a single field, gdyż normalizacja zmusza wszystkie powiązania relacji encji by były pojedyńczymi wartościami.
+To prowadzi do odwrócenia struktury danych pomiędzy obiektami i tablicami.
Podejście zastosowane w modelu Rekordu Aktywnego Prado uzywa ograniczeń kluczów obcych tablicy do wyprowadzenia relacji obiektów.
To implikuje fakt wspierania ograniczeń kluczów obcych dla bazy danych.
</p>
@@ -564,8 +564,8 @@ CREATE TABLE bar
</com:TTextHighlighter>
</div>
-<h2 id="142012">Mapowanie kluczów obcych</h2>
-<p class="block-content">Relacja pól pomiędzy tablicami <tt>Teams</tt> and <tt>Players</tt> jest znana jako relacja jeden-do-wielu (ang. 1-M). Oznacza to, że jeden Team moze zawierać zero lub więcej Players. Z punktu widzenia relacji obiektów
+<h2 id="142012">Mapowanie kluczów obcych</h2>
+<p class="block-content">Relacja pól pomiędzy tablicami <tt>Teams</tt> and <tt>Players</tt> jest znana jako relacja jeden-do-wielu (ang. 1-M). Oznacza to, że jeden Team moze zawierać zero lub więcej Players. Z punktu widzenia relacji obiektów
powiemy, że obiekt <tt>TeamRecord</tt> <b>posiada wiele</b> (ang. has many) obiektów <tt>PlayerRecord</tt>.
(Zauważ odwrócenie kierunku relacji pomiędzy tablicami a obiektami)
</p>
@@ -1074,7 +1074,7 @@ class PlayerRecord extends BaseFkRecord
<p id="710046" class="block-content">We first need to change the <tt>$skills=array()</tt> declaration to a private property
<tt>$_skills</tt> (notice the underscore) and set it to null instead. This allows us
to define the <tt>skills</tt> property using getter/setter methods
-(see <a href="?page=Fundamentals.Components">Components</a> for details). The <tt>getSkills()</tt>
+(see <a href="?page=Fundamentals.Components1">Components</a> for details). The <tt>getSkills()</tt>
getter method for the <tt>skills</tt> property will lazy load the corresponding skills foreign record
when it is used as follows. Notice that we only do a lazy load when its <tt>$player_id</tt> is
not null (that is, when the record is already fetched from the database or player id was already set).
diff --git a/demos/quickstart/protected/pages/Fundamentals/Applications.page b/demos/quickstart/protected/pages/Fundamentals/Applications.page
index 8e0b9e9a..71901170 100755
--- a/demos/quickstart/protected/pages/Fundamentals/Applications.page
+++ b/demos/quickstart/protected/pages/Fundamentals/Applications.page
@@ -7,7 +7,11 @@ An application is an instance of <tt>TApplication</tt> or its derived class. It
<p id="160158" class="block-content">
Applications are configured via <a href="?page=Configurations.AppConfig">application configurations</a>. They are usually created in entry scripts like the following,
<com:TTextHighlighter CssClass="source block-content" id="code_160071">
+// load the prado entry script
require_once('/path/to/prado.php');
+// or, if using composer:
+require_once('vendor/autoload.php');
+
$application = new TApplication;
$application->run();
</com:TTextHighlighter>
diff --git a/demos/quickstart/protected/pages/Fundamentals/Architecture.page b/demos/quickstart/protected/pages/Fundamentals/Architecture.page
index 10f16c3f..c6bee7de 100755
--- a/demos/quickstart/protected/pages/Fundamentals/Architecture.page
+++ b/demos/quickstart/protected/pages/Fundamentals/Architecture.page
@@ -2,12 +2,31 @@
<h1 id="601">Architecture</h1>
<p id="100111" class="block-content">
-PRADO is primarily a presentational framework, although it is not limited to be so. The framework focuses on making Web programming, which deals most of the time with user interactions, to be component-based and event-driven so that developers can be more productive. The following class tree depicts some of the major classes provided by PRADO,
+PRADO is primarily a presentational framework, although it is not limited to be so. The framework focuses on making Web programming, which deals most of the time with user interactions, to be component-based and event-driven so that developers can be more productive. The following class tree depicts some of the major classes provided by PRADO:
</p>
<img src="<%~classtree.gif%>" />
<p id="100112" class="block-content">
-When a PRADO application is processing a page request, its static object diagram can be shown as follows,
+When a PRADO application is processing a page request, its static object diagram can be shown as follows:
</p>
<img src="<%~objectdiagram.gif%>" />
-</com:TContent>
+
+<p class="block-content">
+Once the main <tt>Application</tt> object gets created, it load the <a href="?page=Configurations.AppConfig">application configuration</a>.
+The minimal configuration defines a set of basic <a href="?page=Fundamentals.Modules">modules</a> to parse the <tt>Request</tt>, create a proper <tt>Response</tt>, mantain the user <tt>Session</tt>, handle any <tt>Error</tt> and publish the needed <tt>Assets</tt> (images, css, javascript, etc). These helpers module will be available from anywhere inside the application code.
+<br/>
+Additionally, any 3rd-party or <tt>custom module</tt> can be loaded, and external <tt>Parameters</tt> can be loaded from external configurations.
+</p>
+
+<p class="block-content">
+Once the basic infrastructure has been set up, the <tt>Request</tt> module parses the request trying to identify the requested route. Different routes can be handled by different services, but the default route for http requests is the <tt>Page Service</tt>.
+<br/>
+The <a href="?page=Configurations.AppConfig">Page Service</a>'s role is to instanciate the requested <tt>Page</tt>, run it, apply any defined <tt>Theme</tt> and grab the result in order to build the <tt>Response</tt>.
+</p>
+
+<p class="block-content">
+A <a href="?page=Fundamentals.Pages">Page</a> can be a simple script (.php), a <tt>Template</tt> (.page), or both. PRADO uses a very powerful <a href="?page=Configurations.Templates1">template engine</a> where <tt>Controls</tt> can be instanciated directly.
+<br/>
+A <a href="?page=Fundamentals.Controls">Control</a> is an self-contained widget that fullfills a specific task; they can be a simple script (.php), a <tt>Template</tt> (.page), or both.
+</p>
+</com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Fundamentals/Components.page b/demos/quickstart/protected/pages/Fundamentals/Components.page
deleted file mode 100755
index 11235b56..00000000
--- a/demos/quickstart/protected/pages/Fundamentals/Components.page
+++ /dev/null
@@ -1,360 +0,0 @@
-<com:TContent ID="body" >
-<h1 id="701">Components</h1>
-<p id="110113" class="block-content">
-A component is an instance of <tt>TComponent</tt> or its child class. The base class <tt>TComponent</tt> implements the mechanism of component properties and events.
-</p>
-
-<h2 id="702">Component Properties</h2>
-<p id="110114" class="block-content">
-A component property can be viewed as a public variable describing a specific aspect of the component, such as the background color, the font size, etc. A property is defined by the existence of a getter and/or a setter method in the component class. For example, in <tt>TControl</tt>, we define its <tt>ID</tt> property using the following getter and setter methods,
-<com:TTextHighlighter CssClass="source block-content" id="code_110056">
-class TControl extends TComponent {
- public function getID() {
- ...
- }
- public function setID($value) {
- ...
- }
-}
-</com:TTextHighlighter>
-</p>
-<p id="110115" class="block-content">
-To get or set the <tt>ID</tt> property, do as follows, just like working with a variable,
-<com:TTextHighlighter CssClass="source block-content" id="code_110057">
-$id = $component->ID;
-$component->ID = $id;
-</com:TTextHighlighter>
-This is equivalent to the following,
-<com:TTextHighlighter CssClass="source block-content" id="code_110058">
-$id = $component->getID();
-$component->setID( $id );
-</com:TTextHighlighter>
-</p>
-<p id="110116" class="block-content">
-A property is read-only if it has a getter method but no setter method. Since PHP method names are case-insensitive, property names are also case-insensitive. A component class inherits all its ancestor classes' properties.
-</p>
-
-<h3 id="706">Subproperties</h3>
-<p id="110117" class="block-content">
-A subproperty is a property of some object-typed property. For example, <tt>TWebControl</tt> has a <tt>Font</tt> property which is of <tt>TFont</tt> type. Then the <tt>Name</tt> property of <tt>Font</tt> is referred to as a subproperty (with respect to <tt>TWebControl</tt>).
-</p>
-<p id="110118" class="block-content">
-To get or set the <tt>Name</tt> subproperty, use the following method,
-<com:TTextHighlighter CssClass="source block-content" id="code_110059">
-$name = $component-&gt;getSubProperty('Font.Name');
-$component->setSubProperty('Font.Name', $name);
-</com:TTextHighlighter>
-This is equivalent to the following,
-<com:TTextHighlighter CssClass="source block-content" id="code_110060">
-$name = $component->getFont()->getName();
-$component-&gt;getFont()-&gt;setName( $name );
-</com:TTextHighlighter>
-</p>
-
-<h3 id="26001">Js-friendly properties</h3>
-<p class="block-content">
-A JavaScript-friendly property is a property that can accept both simple strings and raw javascript.
-Prado automatically encodes all properties sent clientside inside javascript blocks to avoid security problems (like injections or cross site scripting).
-If a property is known to always contain only safe javascript code and its value needs to bypass this encoding, that property can be defined in a special way that will make Prado mark its value as "safe".
-Js-friendly properties are identified by their name starting with 'js' (case insensitive):
-<com:TTextHighlighter CssClass="source block-content">
-// getter, defines a readable property 'Text'
-function getJsText() { … }
-// setter, defines a writable property 'Text', with $value being the value to be set to the property
-function setJsText(TJavaScriptLiteral $value) { … }
-</com:TTextHighlighter>
-Js-friendly properties can be accessed using both their Js-less name and their Js-enabled name:
-<com:TTextHighlighter CssClass="source block-content">
-// set some simple text as property value
-$component-&gt;Text = 'text';
-// set some javascript code as property value
-$component-&gt;JsText = 'raw javascript';
-</com:TTextHighlighter>
-In the first case, the property value will automatically gets encoded when sent clientside inside a javascript block.
-In the second case, the property will be 'marked' as being a safe javascript statement and will not be encoded when rendered inside a javascript block.
-This special handling makes use of the <tt>TJavaScriptLiteral</tt> class.
-</p>
-
-
-<h2 id="703">Component Events</h2>
-<p id="110119" class="block-content">
-Component events are special properties that take method names as their values. Attaching (setting) a method to an event will hook up the method to the places at which the event is raised. Therefore, the behavior of a component can be modified in a way that may not be foreseen during the development of the component.
-</p>
-<p id="110120" class="block-content">
-A component event is defined by the existence of a method whose name starts with the word <tt>on</tt>. The event name is the method name and is thus case-insensitve. For example, in <tt>TButton</tt>, we have
-<com:TTextHighlighter CssClass="source block-content" id="code_110061">
-class TButton extends TWebControl {
- public function onClick( $param ) {
- ...
- }
-}
-</com:TTextHighlighter>
-This defines an event named <tt>OnClick</tt>, and a handler can be attached to the event using one of the following ways,
-<com:TTextHighlighter CssClass="source block-content" id="code_110062">
-$button->OnClick = $callback;
-$button->OnClick->add( $callback );
-$button->OnClick[] = $callback;
-$button->attachEventHandler( 'OnClick' , $callback );
-</com:TTextHighlighter>
-</p>
- The variable <tt>$callback</tt> contains the definition of the event handler that can be either a string referring to a global function name, or an array whose first element refers to an object and second element a method name/path that is reachable by the object, e.g.
- </p>
-<ul>
-<li>'buttonClicked' : buttonClicked($sender,$param);</li>
-<li>array($object,'buttonClicked') : $object->buttonClicked($sender,$param);</li>
-<li>array($object,'MainContent.SubmitButton.buttonClicked') : $object->MainContent->SubmitButton->buttonClicked($sender,$param);</li>
-</ul>
-<com:SinceVersion Version="3.2.3" />
-<h2 id="26001">Global events</h2>
-<p id="130001" class="block-content">
-With the addition of behaviors, a more expansive event model is needed. There
-are two new event types (global and dynamic events) as well as a more comprehensive
-behavior model that includes class wide behaviors.
-</p>
-<p id="130002" class="block-content">
-A global event is defined by all events whose name starts with 'fx'.
-The event name is potentially a method name and is thus case-insensitive. All 'fx' events
-are valid as the whole 'fx' event/method space is global in nature. Any object may patch into
-any global event by defining that event as a method. Global events have priorities
-just like 'on' events; so as to be able to order the event execution. Due to the
-nature of all events which start with 'fx' being valid, in effect, every object
-has every 'fx' global event. It is simply an issue of tapping into the desired
-global event.
-</p>
-<p id="130003" class="block-content">
-A global event that starts with 'fx' can be called even if the object does not
-implement the method of the global event. A call to a non-existing 'fx' method
-will, at minimal, function and return null. If a method argument list has a first
-parameter, it will be returned instead of null. This allows filtering and chaining.
-'fx' methods do not automatically install and uninstall. To install and uninstall an
-object's global event listeners, call the object's <tt>listen</tt> and
-<tt>unlisten</tt> methods, respectively. An object may auto-install its global event
-during <tt>__construct</tt> by overriding <tt>getAutoGlobalListen</tt> and returning true.
-</p>
-<p id="130004" class="block-content">
-As of PHP version 5.3, nulled objects without code references will still continue to persist
-in the global event queue because <tt>__destruct</tt> is not automatically called. In the common
-__destruct method, if an object is listening to global events, then <tt>unlisten</tt> is called.
-<tt>unlisten</tt> is required to be manually called before an object is
-left without references if it is currently listening to any global events. This includes
-class wide behaviors.
-</p>
-<p id="130005" class="block-content">
-An object that contains a method that starts with 'fx' will have those functions
-automatically receive those events of the same name after <tt>listen</tt> is called on the object.
-</p>
-<p id="130006" class="block-content">
-An object may listen to a global event without defining an 'fx' method of the same name by
-adding an object method to the global event list. For example
-</p>
-<com:TTextHighlighter CssClass="source block-content">
-$component->fxGlobalCheck=$callback; // or $component->OnClick->add($callback);
-$component->attachEventHandler('fxGlobalCheck',array($object, 'someMethod'));
-</com:TTextHighlighter>
-<h2 id="26002">Events between Objects and their behaviors, Dynamic Events</h2>
-<p id="130007" class="block-content">
-An intra-object/behavior event is defined by methods that start with 'dy'. Just as with
-'fx' global events, every object has every dynamic event. Any call to a method that
-starts with 'dy' will be handled, regardless of whether it is implemented. These
-events are for communicating with attached behaviors.
-</p>
-<p id="130008" class="block-content">
-Dynamic events can be used in a variety of ways. They can be used to tell behaviors
-when a non-behavior method is called. Dynamic events could be used as data filters.
-They could also be used to specify when a piece of code is to be run, eg. should the
-loop process be performed on a particular piece of data. In this way, some control
-is handed to the behaviors over the process and/or data.
-</p>
-<p id="130009" class="block-content">
-If there are no handlers for an 'fx' or 'dy' event, it will return the first
-parameter of the argument list. If there are no arguments, these events
-will return null. If there are handlers an 'fx' method will be called directly
-within the object. Global 'fx' events are triggered by calling <tt>raiseEvent</tt>.
-For dynamic events where there are behaviors that respond to the dynamic events, a
-<tt>TCallChain</tt> is developed. A call chain allows the behavior dynamic event
-implementations to call further implementing behaviors within a chain.
-</p>
-<p id="130010" class="block-content">
-If an object implements <tt>IDynamicMethods</tt>, all global and object dynamic
-events will be sent to <tt>__dycall</tt>. In the case of global events, all
-global events will trigger this method. In the case of behaviors, all undefined
-dynamic events which are called will be passed through to this method.
-</p>
-<p id="130011" class="block-content">
-<h2 id="26003">Behaviors</h2>
-<p id="130012" class="block-content">
-There are two types of behaviors. There are individual object behaviors and
-there are class wide behaviors. Class behaviors depend upon object behaviors.
-</p>
-<p id="130013" class="block-content">
-When a new class implements <tt>IBehavior</tt> or <tt>IClassBehavior</tt> or
-extends <tt>TBehavior</tt> or <tt>TClassBehavior</tt>, it may be added to an
-object by calling the object's <tt>attachBehavior</tt>. The behaviors associated
-name can then be used to <tt>enableBehavior</tt> or <tt>disableBehavior</tt>
-the specific behavior.
-</p>
-<p id="130014" class="block-content">
-All behaviors may be turned on and off via <tt>enableBehaviors</tt> and
-<tt>disableBehaviors</tt>, respectively. To check if behaviors are on or off
-a call to <tt>getBehaviorsEnabled</tt> will provide the variable.
-</p>
-<p id="130015" class="block-content">
-Attaching and detaching whole sets of behaviors is done using
-<tt>attachBehaviors</tt> and <tt>detachBehaviors</tt>. <tt>clearBehaviors</tt>
-removes all of an object's behaviors.
-</p>
-<p id="130016" class="block-content">
-<tt>asa</tt> returns a behavior of a specific name. <tt>isa</tt> is the
-behavior inclusive function that acts as the PHP operator <tt>instanceof</tt>.
-A behavior could provide the functionality of a specific class thus causing
-the host object to act similarly to a completely different class. A behavior
-would then implement <tt>IInstanceCheck</tt> to provide the identity of the
-different class.
-</p>
-<p id="130017" class="block-content">
-Class behaviors are similar to object behaviors except that the class behavior
-is the implementation for all instances of the class. A class behavior
-will have the object upon which is being called be prepended to the parameter
-list. This way the object is known across the class behavior implementation.
-</p>
-<p id="130018" class="block-content">
-Class behaviors are attached using <tt>attachClassBehavior</tt> and detached
-using <tt>detachClassBehavior</tt>. Class behaviors are important in that
-they will be applied to all new instances of a particular class. In this way
-class behaviors become default behaviors to a new instances of a class in
-<tt>__construct</tt>. Detaching a class behavior will remove the behavior
-from the default set of behaviors created for an object when the object
-is instanced.
-</p>
-<p id="130019" class="block-content">
-Class behaviors are also added to all existing instances via the global 'fx'
-event mechanism. When a new class behavior is added, the event
-<tt>fxAttachClassBehavior</tt> is raised and all existing instances that are
-listening to this global event (primarily after <tt>listen</tt> is called)
-will have this new behavior attached. A similar process is used when
-detaching class behaviors. Any objects listening to the global 'fx' event
-<tt>fxDetachClassBehavior</tt> will have a class behavior removed.
-</p>
-<h2 id="26004">Dynamic Intra-Object Events</h2>
-<p id="130020" class="block-content">
-Dynamic events start with 'dy'. This mechanism is used to allow objects
-to communicate with their behaviors directly. The entire 'dy' event space
-is valid. All attached, enabled behaviors that implement a dynamic event
-are called when the host object calls the dynamic event. If there is no
-implementation or behaviors, this returns null when no parameters are
-supplied and will return the first parameter when there is at least one
-parameter in the dynamic event.
-</p>
-<com:TTextHighlighter CssClass="source block-content">
- null == $this->dyBehaviorEvent();
- 5 == $this->dyBehaviorEvent(5); //when no behaviors implement this dynamic event
-</com:TTextHighlighter>
-<p id="130021" class="block-content">
-Dynamic events can be chained together within behaviors to allow for data
-filtering. Dynamic events are implemented within behaviors by defining the
-event as a method.
-</p>
-<com:TTextHighlighter CssClass="source block-content">
-class TObjectBehavior extends TBehavior {
- public function dyBehaviorEvent($param1, $callchain) {
- //Do something, eg: $param1 += 13;
- return $callchain->dyBehaviorEvent($param1);
- }
-}
-</com:TTextHighlighter>
-<p id="130022" class="block-content">
-This implementation of a behavior and dynamic event will flow through to the
-next behavior implementing the dynamic event. The first parameter is always
-return when it is supplied. Otherwise a dynamic event returns null.
-</p>
-<p id="130023" class="block-content">
-In the case of a class behavior, the object is also prepended to the dynamic
-event.
-</p>
-<com:TTextHighlighter CssClass="source block-content">
-class TObjectClassBehavior extends TClassBehavior {
- public function dyBehaviorEvent($hostobject, $param1, $callchain) {
- //Do something, eg: $param1 += $hostobject->getNumber();
- return $callchain->dyBehaviorEvent($param1);
- }
-}
-</com:TTextHighlighter>
-</p>
-<p id="130024" class="block-content">
-When calling a dynamic event, only the parameters are passed. The host object
-and the call chain are built into the framework.
-</p>
-
-<h2 id="26005">Global Event and Dynamic event catching</h2>
-
-<p id="130025" class="block-content">
-Given that all global 'fx' events and dynamic 'dy' events are valid and
-operational, there is a mechanism for catching events called that are not
-implemented (similar to the built-in PHP method <tt>__call</tt>). When
-a dynamic or global event is called but a behavior does not implement it,
-yet desires to know when an undefined dynamic event is run, the behavior
-implements the interface <tt>IDynamicMethods</tt> and method <tt>__dycall</tt>.
-</p>
-<p id="130026" class="block-content">
-In the case of dynamic events, <tt>__dycall</tt> is supplied with the method
-name and its parameters. When a global event is raised, via <tt>raiseEvent</tt>,
-the method is the event name and the parameters are supplied.
-</p>
-<p id="130027" class="block-content">
-When implemented, this catch-all mechanism is called for event global event event
-when implemented outside of a behavior. Within a behavior, it will also be called
-when the object to which the behavior is attached calls any unimplemented dynamic
-event. This is the fall-back mechanism for informing a class and/or behavior
-of when an global and/or undefined dynamic event is executed.
-</p>
-
-<h2 id="704">Namespaces</h2>
-<p id="110121" class="block-content">
-A namespace refers to a logical grouping of some class names so that they can be differentiated from other class names even if their names are the same. Since PHP does not support namespace intrinsically, you cannot create instances of two classes who have the same name but with different definitions. To differentiate from user defined classes, all PRADO classes are prefixed with a letter 'T' (meaning 'Type'). Users are advised not to name their classes like this. Instead, they may prefix their class names with any other letter(s).
-</p>
-<p id="110122" class="block-content">
-A namespace in PRADO is considered as a directory containing one or several class files. A class may be specified without ambiguity using such a namespace followed by the class name. Each namespace in PRADO is specified in the following format,
-<div class="source">
-PathAlias.Dir1.Dir2
-</div>
-where <tt>PathAlias</tt> is an alias of some directory, while <tt>Dir1</tt> and <tt>Dir2</tt> are subdirectories under that directory. A class named <tt>MyClass</tt> defined under <tt>Dir2</tt> may now be fully qualified as <tt>PathAlias.Dir1.Dir2.MyClass</tt>.
-</p>
-<p id="110123" class="block-content">
-To use a namespace in code, do as follows,
-<com:TTextHighlighter CssClass="source block-content" id="code_110063">
-Prado::using('PathAlias.Dir1.Dir2.*');
-</com:TTextHighlighter>
-which appends the directory referred to by <tt>PathAlias.Dir1.Dir2</tt> into PHP include path so that classes defined under that directory may be instantiated without the namespace prefix. You may also include an individual class definition by
-<com:TTextHighlighter CssClass="source block-content" id="code_110064">
-Prado::using('PathAlias.Dir1.Dir2.MyClass');
-</com:TTextHighlighter>
-which will include the class file if <tt>MyClass</tt> is not defined.
-</p>
-<p id="110124" class="block-content">
-For more details about defining path aliases, see <a href="?page=Configurations.AppConfig">application configuration</a> section.
-</p>
-
-<h2 id="705">Component Instantiation</h2>
-<p id="110125" class="block-content">
-Component instantiation means creating instances of component classes. There are two types of component instantation: static instantiation and dynamic instantiation. The created components are called static components and dynamic components, respectively.
-</p>
-
-<h3 id="707">Dynamic Component Instantiation</h3>
-<p id="110126" class="block-content">
-Dynamic component instantiation means creating component instances in PHP code. It is the same as the commonly referred object creation in PHP. A component can be dynamically created using one of the following two methods in PHP,
-<com:TTextHighlighter CssClass="source block-content" id="code_110065">
-$component = new ComponentClassName;
-$component = Prado::createComponent('ComponentType');
-</com:TTextHighlighter>
-where <tt>ComponentType</tt> refers to a class name or a type name in namespace format (e.g. <tt>System.Web.UI.TControl</tt>). The second approach is introduced to compensate for the lack of namespace support in PHP.
-</p>
-
-<h3 id="708">Static Component Instantiation</h3>
-<p id="110127" class="block-content">
-Static component instantiation is about creating components via <a href="?page=Configurations.Overview">configurations</a>. The actual creation work is done by the PRADO framework. For example, in an <a href="?page=Configurations.AppConfig">application configuration</a>, one can configure a module to be loaded when the application runs. The module is thus a static component created by the framework. Static component instantiation is more commonly used in <a href="?page=Configurations.Templates1">templates</a>. Every component tag in a template specifies a component that will be automatically created by the framework when the template is loaded. For example, in a page template, the following tag will lead to the creation of a <tt>TButton</tt> component on the page,
-<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code_110066">
-&lt;com:TButton Text="Register" /&gt;
-</com:TTextHighlighter>
-</p>
-
-</com:TContent>
diff --git a/demos/quickstart/protected/pages/Fundamentals/Components1.page b/demos/quickstart/protected/pages/Fundamentals/Components1.page
new file mode 100755
index 00000000..a610045d
--- /dev/null
+++ b/demos/quickstart/protected/pages/Fundamentals/Components1.page
@@ -0,0 +1,157 @@
+<com:TContent ID="body" >
+<h1 id="701">Components: Part I</h1>
+<p id="110113" class="block-content">
+A component is an instance of <tt>TComponent</tt> or its child class. The base class <tt>TComponent</tt> implements the mechanism of component properties and events.
+</p>
+
+<h2 id="702">Component Properties</h2>
+<p id="110114" class="block-content">
+A component property can be viewed as a public variable describing a specific aspect of the component, such as the background color, the font size, etc. A property is defined by the existence of a getter and/or a setter method in the component class. For example, in <tt>TControl</tt>, we define its <tt>ID</tt> property using the following getter and setter methods,
+<com:TTextHighlighter CssClass="source block-content" id="code_110056">
+class TControl extends TComponent {
+ public function getID() {
+ ...
+ }
+ public function setID($value) {
+ ...
+ }
+}
+</com:TTextHighlighter>
+</p>
+<p id="110115" class="block-content">
+To get or set the <tt>ID</tt> property, do as follows, just like working with a variable,
+<com:TTextHighlighter CssClass="source block-content" id="code_110057">
+$id = $component->ID;
+$component->ID = $id;
+</com:TTextHighlighter>
+This is equivalent to the following,
+<com:TTextHighlighter CssClass="source block-content" id="code_110058">
+$id = $component->getID();
+$component->setID( $id );
+</com:TTextHighlighter>
+</p>
+<p id="110116" class="block-content">
+A property is read-only if it has a getter method but no setter method. Since PHP method names are case-insensitive, property names are also case-insensitive. A component class inherits all its ancestor classes' properties.
+</p>
+
+<h3 id="706">Subproperties</h3>
+<p id="110117" class="block-content">
+A subproperty is a property of some object-typed property. For example, <tt>TWebControl</tt> has a <tt>Font</tt> property which is of <tt>TFont</tt> type. Then the <tt>Name</tt> property of <tt>Font</tt> is referred to as a subproperty (with respect to <tt>TWebControl</tt>).
+</p>
+<p id="110118" class="block-content">
+To get or set the <tt>Name</tt> subproperty, use the following method,
+<com:TTextHighlighter CssClass="source block-content" id="code_110059">
+$name = $component-&gt;getSubProperty('Font.Name');
+$component->setSubProperty('Font.Name', $name);
+</com:TTextHighlighter>
+This is equivalent to the following,
+<com:TTextHighlighter CssClass="source block-content" id="code_110060">
+$name = $component->getFont()->getName();
+$component-&gt;getFont()-&gt;setName( $name );
+</com:TTextHighlighter>
+</p>
+
+<h3 id="26001">Js-friendly properties</h3>
+<p class="block-content">
+A JavaScript-friendly property is a property that can accept both simple strings and raw javascript.
+Prado automatically encodes all properties sent clientside inside javascript blocks to avoid security problems (like injections or cross site scripting).
+If a property is known to always contain only safe javascript code and its value needs to bypass this encoding, that property can be defined in a special way that will make Prado mark its value as "safe".
+Js-friendly properties are identified by their name starting with 'js' (case insensitive):
+<com:TTextHighlighter CssClass="source block-content">
+// getter, defines a readable property 'Text'
+function getJsText() { … }
+// setter, defines a writable property 'Text', with $value being the value to be set to the property
+function setJsText(TJavaScriptLiteral $value) { … }
+</com:TTextHighlighter>
+Js-friendly properties can be accessed using both their Js-less name and their Js-enabled name:
+<com:TTextHighlighter CssClass="source block-content">
+// set some simple text as property value
+$component-&gt;Text = 'text';
+// set some javascript code as property value
+$component-&gt;JsText = 'raw javascript';
+</com:TTextHighlighter>
+In the first case, the property value will automatically gets encoded when sent clientside inside a javascript block.
+In the second case, the property will be 'marked' as being a safe javascript statement and will not be encoded when rendered inside a javascript block.
+This special handling makes use of the <tt>TJavaScriptLiteral</tt> class.
+</p>
+
+
+<h2 id="703">Component Events</h2>
+<p id="110119" class="block-content">
+Component events are special properties that take method names as their values. Attaching (setting) a method to an event will hook up the method to the places at which the event is raised. Therefore, the behavior of a component can be modified in a way that may not be foreseen during the development of the component.
+</p>
+<p id="110120" class="block-content">
+A component event is defined by the existence of a method whose name starts with the word <tt>on</tt>. The event name is the method name and is thus case-insensitve. For example, in <tt>TButton</tt>, we have
+<com:TTextHighlighter CssClass="source block-content" id="code_110061">
+class TButton extends TWebControl {
+ public function onClick( $param ) {
+ ...
+ }
+}
+</com:TTextHighlighter>
+This defines an event named <tt>OnClick</tt>, and a handler can be attached to the event using one of the following ways,
+<com:TTextHighlighter CssClass="source block-content" id="code_110062">
+$button->OnClick = $callback;
+$button->OnClick->add( $callback );
+$button->OnClick[] = $callback;
+$button->attachEventHandler( 'OnClick' , $callback );
+</com:TTextHighlighter>
+</p>
+ The variable <tt>$callback</tt> contains the definition of the event handler that can be either a string referring to a global function name, or an array whose first element refers to an object and second element a method name/path that is reachable by the object, e.g.
+ </p>
+<ul>
+<li>'buttonClicked' : buttonClicked($sender,$param);</li>
+<li>array($object,'buttonClicked') : $object->buttonClicked($sender,$param);</li>
+<li>array($object,'MainContent.SubmitButton.buttonClicked') : $object->MainContent->SubmitButton->buttonClicked($sender,$param);</li>
+</ul>
+
+<h2 id="704">Namespaces</h2>
+<p id="110121" class="block-content">
+A namespace refers to a logical grouping of some class names so that they can be differentiated from other class names even if their names are the same. Since PHP does not support namespace intrinsically, you cannot create instances of two classes who have the same name but with different definitions. To differentiate from user defined classes, all PRADO classes are prefixed with a letter 'T' (meaning 'Type'). Users are advised not to name their classes like this. Instead, they may prefix their class names with any other letter(s).
+</p>
+<p id="110122" class="block-content">
+A namespace in PRADO is considered as a directory containing one or several class files. A class may be specified without ambiguity using such a namespace followed by the class name. Each namespace in PRADO is specified in the following format,
+<div class="source">
+PathAlias.Dir1.Dir2
+</div>
+where <tt>PathAlias</tt> is an alias of some directory, while <tt>Dir1</tt> and <tt>Dir2</tt> are subdirectories under that directory. A class named <tt>MyClass</tt> defined under <tt>Dir2</tt> may now be fully qualified as <tt>PathAlias.Dir1.Dir2.MyClass</tt>.
+</p>
+<p id="110123" class="block-content">
+To use a namespace in code, do as follows,
+<com:TTextHighlighter CssClass="source block-content" id="code_110063">
+Prado::using('PathAlias.Dir1.Dir2.*');
+</com:TTextHighlighter>
+which appends the directory referred to by <tt>PathAlias.Dir1.Dir2</tt> into PHP include path so that classes defined under that directory may be instantiated without the namespace prefix. You may also include an individual class definition by
+<com:TTextHighlighter CssClass="source block-content" id="code_110064">
+Prado::using('PathAlias.Dir1.Dir2.MyClass');
+</com:TTextHighlighter>
+which will include the class file if <tt>MyClass</tt> is not defined.
+</p>
+<p id="110124" class="block-content">
+For more details about defining path aliases, see <a href="?page=Configurations.AppConfig">application configuration</a> section.
+</p>
+
+<h2 id="705">Component Instantiation</h2>
+<p id="110125" class="block-content">
+Component instantiation means creating instances of component classes. There are two types of component instantation: static instantiation and dynamic instantiation. The created components are called static components and dynamic components, respectively.
+</p>
+
+<h3 id="707">Dynamic Component Instantiation</h3>
+<p id="110126" class="block-content">
+Dynamic component instantiation means creating component instances in PHP code. It is the same as the commonly referred object creation in PHP. A component can be dynamically created using one of the following two methods in PHP,
+<com:TTextHighlighter CssClass="source block-content" id="code_110065">
+$component = new ComponentClassName;
+$component = Prado::createComponent('ComponentType');
+</com:TTextHighlighter>
+where <tt>ComponentType</tt> refers to a class name or a type name in namespace format (e.g. <tt>System.Web.UI.TControl</tt>). The second approach is introduced to compensate for the lack of namespace support in PHP.
+</p>
+
+<h3 id="708">Static Component Instantiation</h3>
+<p id="110127" class="block-content">
+Static component instantiation is about creating components via <a href="?page=Configurations.Overview">configurations</a>. The actual creation work is done by the PRADO framework. For example, in an <a href="?page=Configurations.AppConfig">application configuration</a>, one can configure a module to be loaded when the application runs. The module is thus a static component created by the framework. Static component instantiation is more commonly used in <a href="?page=Configurations.Templates1">templates</a>. Every component tag in a template specifies a component that will be automatically created by the framework when the template is loaded. For example, in a page template, the following tag will lead to the creation of a <tt>TButton</tt> component on the page,
+<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code_110066">
+&lt;com:TButton Text="Register" /&gt;
+</com:TTextHighlighter>
+</p>
+
+</com:TContent>
diff --git a/demos/quickstart/protected/pages/Fundamentals/Components2.page b/demos/quickstart/protected/pages/Fundamentals/Components2.page
new file mode 100644
index 00000000..7fc3e010
--- /dev/null
+++ b/demos/quickstart/protected/pages/Fundamentals/Components2.page
@@ -0,0 +1,207 @@
+<com:TContent ID="body" >
+<h1 id="701">Components: Part II</h1>
+<com:SinceVersion Version="3.2.3" />
+<h2 id="26001">Global events</h2>
+<p id="130001" class="block-content">
+With the addition of behaviors, a more expansive event model is needed. There
+are two new event types (global and dynamic events) as well as a more comprehensive
+behavior model that includes class wide behaviors.
+</p>
+<p id="130002" class="block-content">
+A global event is defined by all events whose name starts with 'fx'.
+The event name is potentially a method name and is thus case-insensitive. All 'fx' events
+are valid as the whole 'fx' event/method space is global in nature. Any object may patch into
+any global event by defining that event as a method. Global events have priorities
+just like 'on' events; so as to be able to order the event execution. Due to the
+nature of all events which start with 'fx' being valid, in effect, every object
+has every 'fx' global event. It is simply an issue of tapping into the desired
+global event.
+</p>
+<p id="130003" class="block-content">
+A global event that starts with 'fx' can be called even if the object does not
+implement the method of the global event. A call to a non-existing 'fx' method
+will, at minimal, function and return null. If a method argument list has a first
+parameter, it will be returned instead of null. This allows filtering and chaining.
+'fx' methods do not automatically install and uninstall. To install and uninstall an
+object's global event listeners, call the object's <tt>listen</tt> and
+<tt>unlisten</tt> methods, respectively. An object may auto-install its global event
+during <tt>__construct</tt> by overriding <tt>getAutoGlobalListen</tt> and returning true.
+</p>
+<p id="130004" class="block-content">
+As of PHP version 5.3, nulled objects without code references will still continue to persist
+in the global event queue because <tt>__destruct</tt> is not automatically called. In the common
+__destruct method, if an object is listening to global events, then <tt>unlisten</tt> is called.
+<tt>unlisten</tt> is required to be manually called before an object is
+left without references if it is currently listening to any global events. This includes
+class wide behaviors.
+</p>
+<p id="130005" class="block-content">
+An object that contains a method that starts with 'fx' will have those functions
+automatically receive those events of the same name after <tt>listen</tt> is called on the object.
+</p>
+<p id="130006" class="block-content">
+An object may listen to a global event without defining an 'fx' method of the same name by
+adding an object method to the global event list. For example
+</p>
+<com:TTextHighlighter CssClass="source block-content">
+$component->fxGlobalCheck=$callback; // or $component->OnClick->add($callback);
+$component->attachEventHandler('fxGlobalCheck',array($object, 'someMethod'));
+</com:TTextHighlighter>
+<h2 id="26002">Events between Objects and their behaviors, Dynamic Events</h2>
+<p id="130007" class="block-content">
+An intra-object/behavior event is defined by methods that start with 'dy'. Just as with
+'fx' global events, every object has every dynamic event. Any call to a method that
+starts with 'dy' will be handled, regardless of whether it is implemented. These
+events are for communicating with attached behaviors.
+</p>
+<p id="130008" class="block-content">
+Dynamic events can be used in a variety of ways. They can be used to tell behaviors
+when a non-behavior method is called. Dynamic events could be used as data filters.
+They could also be used to specify when a piece of code is to be run, eg. should the
+loop process be performed on a particular piece of data. In this way, some control
+is handed to the behaviors over the process and/or data.
+</p>
+<p id="130009" class="block-content">
+If there are no handlers for an 'fx' or 'dy' event, it will return the first
+parameter of the argument list. If there are no arguments, these events
+will return null. If there are handlers an 'fx' method will be called directly
+within the object. Global 'fx' events are triggered by calling <tt>raiseEvent</tt>.
+For dynamic events where there are behaviors that respond to the dynamic events, a
+<tt>TCallChain</tt> is developed. A call chain allows the behavior dynamic event
+implementations to call further implementing behaviors within a chain.
+</p>
+<p id="130010" class="block-content">
+If an object implements <tt>IDynamicMethods</tt>, all global and object dynamic
+events will be sent to <tt>__dycall</tt>. In the case of global events, all
+global events will trigger this method. In the case of behaviors, all undefined
+dynamic events which are called will be passed through to this method.
+</p>
+<p id="130011" class="block-content">
+<h2 id="26003">Behaviors</h2>
+<p id="130012" class="block-content">
+There are two types of behaviors. There are individual object behaviors and
+there are class wide behaviors. Class behaviors depend upon object behaviors.
+</p>
+<p id="130013" class="block-content">
+When a new class implements <tt>IBehavior</tt> or <tt>IClassBehavior</tt> or
+extends <tt>TBehavior</tt> or <tt>TClassBehavior</tt>, it may be added to an
+object by calling the object's <tt>attachBehavior</tt>. The behaviors associated
+name can then be used to <tt>enableBehavior</tt> or <tt>disableBehavior</tt>
+the specific behavior.
+</p>
+<p id="130014" class="block-content">
+All behaviors may be turned on and off via <tt>enableBehaviors</tt> and
+<tt>disableBehaviors</tt>, respectively. To check if behaviors are on or off
+a call to <tt>getBehaviorsEnabled</tt> will provide the variable.
+</p>
+<p id="130015" class="block-content">
+Attaching and detaching whole sets of behaviors is done using
+<tt>attachBehaviors</tt> and <tt>detachBehaviors</tt>. <tt>clearBehaviors</tt>
+removes all of an object's behaviors.
+</p>
+<p id="130016" class="block-content">
+<tt>asa</tt> returns a behavior of a specific name. <tt>isa</tt> is the
+behavior inclusive function that acts as the PHP operator <tt>instanceof</tt>.
+A behavior could provide the functionality of a specific class thus causing
+the host object to act similarly to a completely different class. A behavior
+would then implement <tt>IInstanceCheck</tt> to provide the identity of the
+different class.
+</p>
+<p id="130017" class="block-content">
+Class behaviors are similar to object behaviors except that the class behavior
+is the implementation for all instances of the class. A class behavior
+will have the object upon which is being called be prepended to the parameter
+list. This way the object is known across the class behavior implementation.
+</p>
+<p id="130018" class="block-content">
+Class behaviors are attached using <tt>attachClassBehavior</tt> and detached
+using <tt>detachClassBehavior</tt>. Class behaviors are important in that
+they will be applied to all new instances of a particular class. In this way
+class behaviors become default behaviors to a new instances of a class in
+<tt>__construct</tt>. Detaching a class behavior will remove the behavior
+from the default set of behaviors created for an object when the object
+is instanced.
+</p>
+<p id="130019" class="block-content">
+Class behaviors are also added to all existing instances via the global 'fx'
+event mechanism. When a new class behavior is added, the event
+<tt>fxAttachClassBehavior</tt> is raised and all existing instances that are
+listening to this global event (primarily after <tt>listen</tt> is called)
+will have this new behavior attached. A similar process is used when
+detaching class behaviors. Any objects listening to the global 'fx' event
+<tt>fxDetachClassBehavior</tt> will have a class behavior removed.
+</p>
+<h2 id="26004">Dynamic Intra-Object Events</h2>
+<p id="130020" class="block-content">
+Dynamic events start with 'dy'. This mechanism is used to allow objects
+to communicate with their behaviors directly. The entire 'dy' event space
+is valid. All attached, enabled behaviors that implement a dynamic event
+are called when the host object calls the dynamic event. If there is no
+implementation or behaviors, this returns null when no parameters are
+supplied and will return the first parameter when there is at least one
+parameter in the dynamic event.
+</p>
+<com:TTextHighlighter CssClass="source block-content">
+ null == $this->dyBehaviorEvent();
+ 5 == $this->dyBehaviorEvent(5); //when no behaviors implement this dynamic event
+</com:TTextHighlighter>
+<p id="130021" class="block-content">
+Dynamic events can be chained together within behaviors to allow for data
+filtering. Dynamic events are implemented within behaviors by defining the
+event as a method.
+</p>
+<com:TTextHighlighter CssClass="source block-content">
+class TObjectBehavior extends TBehavior {
+ public function dyBehaviorEvent($param1, $callchain) {
+ //Do something, eg: $param1 += 13;
+ return $callchain->dyBehaviorEvent($param1);
+ }
+}
+</com:TTextHighlighter>
+<p id="130022" class="block-content">
+This implementation of a behavior and dynamic event will flow through to the
+next behavior implementing the dynamic event. The first parameter is always
+return when it is supplied. Otherwise a dynamic event returns null.
+</p>
+<p id="130023" class="block-content">
+In the case of a class behavior, the object is also prepended to the dynamic
+event.
+</p>
+<com:TTextHighlighter CssClass="source block-content">
+class TObjectClassBehavior extends TClassBehavior {
+ public function dyBehaviorEvent($hostobject, $param1, $callchain) {
+ //Do something, eg: $param1 += $hostobject->getNumber();
+ return $callchain->dyBehaviorEvent($param1);
+ }
+}
+</com:TTextHighlighter>
+</p>
+<p id="130024" class="block-content">
+When calling a dynamic event, only the parameters are passed. The host object
+and the call chain are built into the framework.
+</p>
+
+<h2 id="26005">Global Event and Dynamic event catching</h2>
+
+<p id="130025" class="block-content">
+Given that all global 'fx' events and dynamic 'dy' events are valid and
+operational, there is a mechanism for catching events called that are not
+implemented (similar to the built-in PHP method <tt>__call</tt>). When
+a dynamic or global event is called but a behavior does not implement it,
+yet desires to know when an undefined dynamic event is run, the behavior
+implements the interface <tt>IDynamicMethods</tt> and method <tt>__dycall</tt>.
+</p>
+<p id="130026" class="block-content">
+In the case of dynamic events, <tt>__dycall</tt> is supplied with the method
+name and its parameters. When a global event is raised, via <tt>raiseEvent</tt>,
+the method is the event name and the parameters are supplied.
+</p>
+<p id="130027" class="block-content">
+When implemented, this catch-all mechanism is called for event global event event
+when implemented outside of a behavior. Within a behavior, it will also be called
+when the object to which the behavior is attached calls any unimplemented dynamic
+event. This is the fall-back mechanism for informing a class and/or behavior
+of when an global and/or undefined dynamic event is executed.
+</p>
+
+</com:TContent>
diff --git a/demos/quickstart/protected/pages/Fundamentals/Pages.page b/demos/quickstart/protected/pages/Fundamentals/Pages.page
index 19900937..58f4f06d 100755
--- a/demos/quickstart/protected/pages/Fundamentals/Pages.page
+++ b/demos/quickstart/protected/pages/Fundamentals/Pages.page
@@ -5,13 +5,27 @@
Pages are top-most controls that have no parent. The presentation of pages are directly displayed to end-users. Users access pages by sending page service requests.
</p>
<p id="130138" class="block-content">
-Each page must have a <a href="?page=Configurations.Templates1">template</a> file. The file name suffix must be <tt>.page</tt>. The file name (without suffix) is the page name. PRADO will try to locate a page class file under the directory containing the page template file. Such a page class file must have the same file name (suffixed with <tt>.php</tt>) as the template file. If the class file is not found, the page will take class <tt>TPage</tt>.
+Each page can have a <a href="?page=Configurations.Templates1">template</a> file. The file name suffix must be <tt>.page</tt>. The file name (without suffix) is the page name. PRADO will try to locate a page class file under the directory containing the page template file. Such a page class file must have the same file name (suffixed with <tt>.php</tt>) as the template file. If the class file is not found, the page will take class <tt>TPage</tt>.
</p>
<h2 id="902">PostBack</h2>
<p id="130139" class="block-content">
A form submission is called <i>postback</i> if the submission is made to the page containing the form. Postback can be considered an event happened on the client side, raised by the user. PRADO will try to identify which control on the server side is responsible for a postback event. If one is determined, for example, a <tt>TButton</tt>, we call it the postback event sender which will translate the postback event into some specific server-side event (e.g. <tt>OnClick</tt> and <tt>OnCommand</tt> events for <tt>TButton</tt>).
+<br/>
+<tt>TPage</tt> has a <tt>IsPostBack</tt> property exposing whether the current request being handled is the first request for this page or the consequence of a postback.
+</p>
+<h2>CallBack</h2>
+<p class="block-content">
+A <i>callback</i> is a special form submission that, instead of requiring a full page reload on the browser, gets executed in the background through an ajax call. So, a callback is considered a postback too, but not vice versa.
+<br/>
+A callback is handled as a normal postback but, instead of re-rendering the entire page, only the specific changes occured on the page gets sent back to the client and merged with the current browser page. A typical callback response consists of:
+<ol>
+ <li>one or more pieces of html code that will replace existing content on the page;</li>
+ <li>the javascript instructions needed to update the page;</li>
+ <li>some specific fields used by prado to mantain the pagestate and add the needed external resources (stylesheets, javascript files, etc..).</li>
+</ol>
+<tt>TPage</tt> has a <tt>IsCallBack</tt> property exposing whether the current request being handled is the consequence of a callback. Since a callback is also a postback, both <tt>IsPostBack</tt> and <tt>IsCallBack</tt> are true during callback requests.
</p>
<h2 id="903">Page Lifecycles</h2>
diff --git a/demos/quickstart/protected/pages/Fundamentals/Services.page b/demos/quickstart/protected/pages/Fundamentals/Services.page
index 5e5889df..ee19a159 100755
--- a/demos/quickstart/protected/pages/Fundamentals/Services.page
+++ b/demos/quickstart/protected/pages/Fundamentals/Services.page
@@ -16,7 +16,7 @@ Developers may implement additional services for their applications. To make a s
<h2 id="1102">Page Service</h2>
<p id="150154" class="block-content">
-PRADO implements <tt>TPageService</tt> to process users' page requests. Pages are stored under a directory specified by the <tt>BasePath</tt> property of the page service. The property defaults to <tt>pages</tt> directory under the application base path. You may change this default by configuring the service in the application configuration.
+PRADO implements <tt>TPageService</tt> to process users' page requests. Pages are stored under a directory specified by the <tt>BasePath</tt> property of the page service. The property defaults to <tt>Pages</tt> directory under the application base path. You may change this default by configuring the service in the application configuration.
</p>
<p id="150155" class="block-content">
Pages may be organized into subdirectories under the <tt>BasePath</tt>. In each directory, there may be a page configuration file named <tt>config.xml</tt>, which contains configurations effective only when a page under that directory or a sub-directory is requested. For more details, see the <a href="?page=Configurations.PageConfig">page configuration</a> section.
@@ -30,5 +30,8 @@ http://hostname/index.php?page=Users.Register
</com:TTextHighlighter>
where the first example takes advantage of the fact that the page service is the default service and <tt>Home</tt> is the default page.
</p>
+<p class="block-content">
+More advanced url routes, like masking real page names and permitting the use of dynamic parameters can be created using the <a href="?page=Configurations.UrlMapping">Url mapping</a> module.
+</p>
</com:TContent>
diff --git a/demos/quickstart/protected/pages/GettingStarted/AboutPrado.page b/demos/quickstart/protected/pages/GettingStarted/AboutPrado.page
index 22437158..1a416a32 100755
--- a/demos/quickstart/protected/pages/GettingStarted/AboutPrado.page
+++ b/demos/quickstart/protected/pages/GettingStarted/AboutPrado.page
@@ -51,12 +51,12 @@ Most PHP frameworks mainly focuses on separating presentation and logic and prom
<h2 id="4004">Is PRADO Stable Enough?</h2>
<p id="20004" class="block-content">
-Yes. PRADO was initially released in August 2004. Many test suites have been written and conducted frequently to ensure its quality. It has been used by thousands of developers and many Web applications have been developed based on it. Bugs and feature requests are managed through TRAC system and we have a great user community and development team to ensure all questions are answered in a timely fashion.
+Yes. PRADO was initially released in August 2004. Many test suites have been written and conducted frequently to ensure its quality. It has been used by thousands of developers and many Web applications have been developed based on it. Bugs and feature requests are managed through GitHub and we have a great user community and development team to ensure all questions are answered in a timely fashion.
</p>
<h2 id="205">History of PRADO</h2>
<p id="20014" class="block-content">
-The very original inspiration of PRADO came from Apache Tapestry. During the design and implementation, I borrowed many ideas from Borland Delphi and Microsoft ASP.NET. The first version of PRADO came out in June 2004 and was written in PHP 4. Driven by the Zend PHP 5 coding contest, I rewrote PRADO in PHP 5, which proved to be a wise move, thanks to the new object model provided by PHP 5. PRADO won the grand prize in the Zend contest, earning the highest votes from both the public and the judges' panel.
+The very original inspiration of PRADO came from Apache Tapestry. During the design and implementation, Qiang Xue borrowed many ideas from Borland Delphi and Microsoft ASP.NET. The first version of PRADO came out in June 2004 and was written in PHP 4. Driven by the Zend PHP 5 coding contest, Qiang rewrote PRADO in PHP 5, which proved to be a wise move, thanks to the new object model provided by PHP 5. PRADO won the grand prize in the Zend contest, earning the highest votes from both the public and the judges' panel.
</p>
<p id="20015" class="block-content">
In August 2004, PRADO started to be hosted on SourceForge as an open source project. Soon after, the project site <a href="http://www.xisc.com/">xisc.com</a> was announced to public. With the fantastic support of PRADO developer team and PRADO users, PRADO evolved to version 2.0 in mid 2005. In this version, Wei Zhuo contributed to PRADO with the excellent I18N and L10N support.
@@ -64,6 +64,12 @@ In August 2004, PRADO started to be hosted on SourceForge as an open source proj
<p id="20016" class="block-content">
In May 2005, we decided to completely rewrite the PRADO framework to resolve a few fundamental issues found in version 2.0 and to catch up with some cool features available in Microsoft ASP.NET 2.0. After nearly a year's hard work with over 50,000 lines of new code, version 3.0 was finally made available in April 2006.
</p>
+<p class="block-content">
+In October 2008, the original development team released a new framework called <a href="http://www.yiiframework.com/">Yii</a>. Inheriting most of the PRADO code, Yii left the pages/events concept, focusing on a pure MVC design pattern. Since 2009 a lot of people contributed to PRADO fixing issues, developing new features or backporting them from Yii.
+</p>
+<p class="block-content">
+To promote a model of community-driven development, the project repositories were moved first on <a href="http://code.google.com/p/prado3/">Google Code</a> and then, in September 2013, on <a href="http://github.com/pradosoft/prado">GitHub</a>.
+</p>
<p id="20017" class="block-content">
Starting from version 3.0, significant efforts are allocated to ensure the quality and stability of PRADO. If we say PRADO v2.x and v1.x are proof-of-concept work, we can say PRADO 3.x has grown up to a project that is suitable for serious business application development.
</p>
diff --git a/demos/quickstart/protected/pages/GettingStarted/CommandLine.page b/demos/quickstart/protected/pages/GettingStarted/CommandLine.page
index 5f5dacb9..3619d3d9 100755..100644
--- a/demos/quickstart/protected/pages/GettingStarted/CommandLine.page
+++ b/demos/quickstart/protected/pages/GettingStarted/CommandLine.page
@@ -1,6 +1,12 @@
<com:TContent ID="body" >
<h1 id="501">Command Line Tool</h1>
-<p id="70046" class="block-content">The optional <tt>prado-cli.php</tt> PHP script file in the <tt>framework</tt>
+
+<div class="Note">
+<b class="tip">Note:</b> With Prado version 3.2.3 prado-cli.php location changed from framework
+to bin directory. If you're using Prado 3.2.2 or earlier, replace bin with framework in examples below.
+</div>
+
+<p id="70046" class="block-content">The optional <tt>prado-cli.php</tt> PHP script file in the <tt>bin</tt>
directory provides command line tools to perform various tedious takes in Prado.
The <tt>prado-cli.php</tt> can be used to create Prado project skeletons, create
initial test fixtures, and access to an interactive PHP shell.
@@ -14,8 +20,8 @@ the command line.
<h2 id="503">Usage</h2>
<p id="70048" class="block-content">
-If you type <tt>php path/to/framework/prado-cli.php</tt>, you should see
-the following information. Alternatively, if you are not on Windows,
+If you type <tt>php path/to/bin/prado-cli.php</tt>, you should see
+the following information. Alternatively, if you are not on Windows,
you may try to change the <tt>prado-cli.php</tt> into an executable
and execute it as a script</p>
<com:TTextHighlighter Language="cli" CssClass="source block-content cli" id="code_70006">
@@ -43,9 +49,9 @@ are optional parameters. </p>
<p id="70050" class="block-content">To create a Prado project skeleton, do the following:</p>
<ol>
<li>Change to the directory where you want to create the project skeleton.</li>
- <li>Type, <tt>php ../prado/framework/prado-cli.php -c helloworld</tt>, where
+ <li>Type, <tt>php ../prado/bin/prado-cli.php -c helloworld</tt>, where
<tt>helloworld</tt> is the directory name that you want to create the project skeleton files.</li>
- <li>Type, <tt>php ../prado/framework/prado-cli.php <b>-t</b> helloworld</tt> to create
+ <li>Type, <tt>php ../prado/bin/prado-cli.php <b>-t</b> helloworld</tt> to create
the test fixtures for the <tt>helloworld</tt> project.</li>
</ol>
@@ -58,7 +64,7 @@ command line is in the <tt>prado</tt> distribution directory and you type.
</p>
<p id="70052" class="block-content">
<com:TTextHighlighter Language="cli" CssClass="source block-content cli" id="code_70007">
-$: php framework/prado-cli.php shell demos/blog
+$: php bin/prado-cli.php shell demos/blog
</com:TTextHighlighter>
The output should be
<com:TTextHighlighter Language="cli" CssClass="source block-content cli" id="code_70008">
@@ -85,7 +91,7 @@ we <b>leave out the semicolon</b> to show the results.
<com:TTextHighlighter Language="cli" CssClass="source block-content cli" id="code_70010">
>> $db->queryPostByID(1)
</com:TTextHighlighter>
-There should not be any errors and you should see the following.
+There should not be any errors and you should see the following.
<com:TTextHighlighter Language="cli" CssClass="source block-content cli" id="code_70011">
PostRecord#1
(
@@ -103,4 +109,34 @@ PostRecord#1
)
</com:TTextHighlighter>
</p>
+
+<h2>Creating Active Record Classes</h2>
+<p>
+In the blog demo project, we need to create two <a href="?page=Database.ActiveRecord">Active Record</a> classes, <tt>UserRecord</tt> and <tt>PostRecord</tt>, to represent data records in the <tt>users</tt> and <tt>posts</tt> tables, respectively. Active Record classes must extend from the base class <tt>ActiveRecord</tt>, and must define property names that matches with the field names of the corresponding table.
+</p>
+
+<p>
+To better organize our directories, we create a new directory <tt>protected/database</tt> to hold the class files. We also modify our application configuration by inserting the following lines. It is equivalent to adding the directory <tt>protected/database</tt> to PHP include_path, which allows us to use the classes without explicitly including them.
+</p>
+
+<com:TTextHighlighter CssClass="source" Language="xml">
+<paths>
+ <using namespace="Application.database.*" />
+</paths>
+</com:TTextHighlighter>
+
+<p>
+At the prompt, enter the following two commands to create <tt>UserRecord</tt> and <tt>PostRecord</tt> classes:
+</p>
+
+<com:TTextHighlighter CssClass="source cli" Language="text">
+>> generate users Application.database.UserRecord
+
+>> generate posts Application.database.PostRecord
+</com:TTextHighlighter>
+
+<p>
+Here we used the <a href="?page=Fundamentals.Components1">namespace format</a> again to specify the classes to be created. The path <tt>Application.database.UserRecord</tt> indicates that we want the <tt>UserRecord</tt> class file to be <tt>protected/database/UserRecord.php</tt>.
+</p>
+
</com:TContent>
diff --git a/demos/quickstart/protected/pages/GettingStarted/HelloWorld.page b/demos/quickstart/protected/pages/GettingStarted/HelloWorld.page
index 557aa46d..d65cf7f8 100755
--- a/demos/quickstart/protected/pages/GettingStarted/HelloWorld.page
+++ b/demos/quickstart/protected/pages/GettingStarted/HelloWorld.page
@@ -29,7 +29,7 @@ where each directory is explained as follows. Note, the above directory structur
</ul>
<div class="tip">
-<b class="tip">Tip:</b>You may also use the <tt>framework/prado-cli.php</tt>
+<b class="tip">Tip:</b>You may also use the <tt>bin/prado-cli.php (framework/prado-cli.php for Prado < 3.2.3)</tt>
<a href="?page=GettingStarted.CommandLine">command line script</a>
to create the Prado project directory structure. For example, type the command
<tt>php path/to/prado-cli.php -c helloworld</tt> in the directory
diff --git a/demos/quickstart/protected/pages/GettingStarted/Installation.page b/demos/quickstart/protected/pages/GettingStarted/Installation.page
index 7919e733..956f53c2 100755
--- a/demos/quickstart/protected/pages/GettingStarted/Installation.page
+++ b/demos/quickstart/protected/pages/GettingStarted/Installation.page
@@ -5,16 +5,17 @@
If you are viewing this page from your own Web server, you are already done with the installation.
</p>
<p id="30019">
-The minimum requirement by PRADO is that the Web server support PHP 5.2. PRADO has been tested with Apache Web server on Windows and Linux. Highly possibly it may also run on other platforms with other Web servers, as long as PHP 5.2 is supported.
+The minimum requirement by PRADO is that the Web server support PHP 5.3.3. PRADO has been tested with Apache Web server on Windows, MacOSX and various Linux distro. Highly possibly it may also run on other platforms with other Web servers, as long as PHP 5.3.3 is supported.
</p>
</div>
-<div id="install-steps" class="block-content">
<p id="30020">
-Installation of PRADO mainly involves downloading and unpacking.
+PRADO can be installed as a standalone package or using <a href="http://getcomposer.org/">composer</a>
</p>
+<div id="install-steps" class="block-content">
+<h3>Standalone package</h3>
<ol>
-<li>Go to <a href="http://www.pradosoft.com/">pradosoft.com</a> to grab the latest version of PRADO.</li>
+<li>Go to <a href="http://www.pradosoft.com/download/">pradosoft.com</a> to grab the latest version of PRADO.</li>
<li>Unpack the PRADO release file to a Web-accessible directory.
</ol>
</div>
@@ -25,5 +26,37 @@ Your installation of PRADO is done and you can start to play with the demo appli
<p id="30022">
If you encounter any problems with the demo applications, please use the PRADO requirement checker script, accessible via <tt>http://web-server-address/prado/requirements/index.php</tt>, to check first if your server configuration fulfills the conditions required by PRADO.
</p>
+
+<div id="install-steps" class="block-content">
+<h3>Composer install</h3>
+<ol>
+<li>If you don't have installed composer already, install it globally:
+<com:TTextHighlighter CssClass="source block-content">
+$ curl -s http://getcomposer.org/installer | php
+$ php composer.phar install
+</com:TTextHighlighter>
+</li>
+<li>Create a composer.json file for your project:
+<com:TTextHighlighter CssClass="source block-content">
+{
+ "require": {
+ "pradosoft/prado": "~3.2"
+ }
+}
+</com:TTextHighlighter>
+</li>
+<li>Now run the actual installation:
+<com:TTextHighlighter CssClass="source block-content">
+$ composer install
+</com:TTextHighlighter>
+</li>
+<li>In your project include the autoloader, and you will have access to the library classes:
+<com:TTextHighlighter CssClass="source block-content">
+<?php
+require_once('vendor/autoload.php');
+</com:TTextHighlighter>
+</li>
+</ol>
</div>
+
</com:TContent>
diff --git a/demos/quickstart/protected/pages/GettingStarted/Upgrading32.page b/demos/quickstart/protected/pages/GettingStarted/Upgrading32.page
new file mode 100644
index 00000000..e2378ed5
--- /dev/null
+++ b/demos/quickstart/protected/pages/GettingStarted/Upgrading32.page
@@ -0,0 +1,239 @@
+<com:TContent ID="body" >
+
+<h1>Upgrading from v3.2</h1>
+
+<div class="block-content">
+<p class="block-content">
+Since version 3.3, PRADO uses <a href="http://jquery.com/">jQuery</a> as its default javascript framework.
+Previously, up to version 3.2, PRADO used <a href="http://prototypejs.org/">Prototype</a> and <a href="http://script.aculo.us/">Scriptaculous</a> as its default javascript framework.
+</p>
+<p class="block-content">
+PRADO relies a lot on clientside javascript code to implement its <a href="?page=Controls.Standard">standard controls</a>, to handle clientside <a href="?page=Controls.Validation">validators</a>, and to create a seamless <a href="?page=ActiveControls.Introduction">ajax</a> experience using <a href="?page=ActiveControls.Home">active controls</a>.
+All this javascript code, originally developed on Prototype, has been rewritten in order to use jQuery instead. The choice was mainly driven by the lack of development and decline of the Prototype community, while jQuery has become the de-facto standard library for javascript.
+</p>
+<p class="block-content">
+While the PRADO javascript code is ready to work with jQuery, legacy javascript code in existing applications can require some porting to make it work properly.
+We summarize in the following the most significant changes in v3.3 to help developers upgrade their v3.2 PRADO applications more easily, if needed.
+</p>
+</div>
+
+<h2>Basic Prototype to jQuery javascript porting</h2>
+<p class="block-content">
+The number one rule on writing jQuery javascript code is to read the <a href="http://api.jquery.com/">jQuery documentation</a>. Porting code from Prototype to jQuery needs some effort: here's a basic lookup table to port existing code:
+</p>
+<table class="tabular">
+ <tr>
+ <th></th>
+ <th>Prototype (OLD)</th>
+ <th>jQuery (NEW)</th>
+ </tr>
+ <tr>
+ <td>Get element by id</td>
+ <td>$('element_id')</td>
+ <td>// get the base DOM element
+ <br/>$('#element_id').get(0)
+ <br/>// get the the extended element
+ <br/>$('#element_id').eq(0)
+ </td>
+ </tr>
+ <tr>
+ <td>Get element by css selector</td>
+ <td>$$('.class')</td>
+ <td>$('.class')</td>
+ </tr>
+ <tr>
+ <td>Apply a function to multiple elements</td>
+ <td>$$('.class').each(Element.remove)</td>
+ <td>$('.class').remove()</td>
+ </tr>
+ <tr>
+ <td>Create or extend a class</td>
+ <td>Class.create(Prado.WebUI.Control, { ... })
+ <br/>Class.extend(Prado.WebUI.Control, { ... })
+ </td>
+ <td>jQuery.klass(Prado.WebUI.Control, { ... })</td>
+ </tr>
+ <tr>
+ <td>Extend an object</td>
+ <td>Object.extend(...)</td>
+ <td>jQuery.extend(...)</td>
+ </tr>
+ <tr>
+ <td>Bind an event to a callback event handler</td>
+ <td>Event.observe(element, 'click', callback)</td>
+ <td>$(element).on('click', callback)</td>
+ </tr>
+ <tr>
+ <td>Unbind an event from a callback event handler</td>
+ <td>Event.stopObserving(element, 'click', callback)</td>
+ <td>$(element).off('click', callback)</td>
+ </tr>
+ <tr>
+ <td>Stop event propagation</td>
+ <td>Event.stop(event)</td>
+ <td>// stop event bubbling chain
+ <br/>event.stopPropagation()
+ <br/>// prevent form submit
+ <br/>event.preventDefault()
+ </td>
+ </tr>
+ <tr>
+ <td>Detect keypress event</td>
+ <td>if(kc == Event.KEY_RETURN ||
+ <br/>kc == Event.KEY_SPACEBAR ||
+ <br/>kc == Event.KEY_TAB)</td>
+ <td>// use the numeric codes
+ <br/>if(kc == 13 ||
+ <br/>kc == 32 ||
+ <br/>kc == 9)
+ </td>
+ </tr>
+ <tr>
+ <td>Execute a function when the page has finished loading</td>
+ <td>document.observe("dom:loaded", function(event) { ... })</td>
+ <td>$( document ).ready(function() { ... })</td>
+ </tr>
+ <tr>
+ <td>Create an animation effect with a "finish" callback</td>
+ <td>new Effect.Fade(element, {
+ <br/>duration: 400,
+ <br/>afterFinish: function() {
+ <br/>// Animation complete.
+ <br/>});</td>
+ <td>$(element).fadeOut( 400, function() {
+ <br/>// Animation complete.
+ <br/>});</td>
+ </tr>
+ <tr>
+ <td>Declare a function to be used as event handler binding its "this" property</td>
+ <td>this.functionName.bindAsEventListener(this)</td>
+ <td>this.functionName.bind(this)</td>
+ </tr>
+ <tr>
+ <td>Css class functions (add, remove, test for css class)</td>
+ <td>addClassName()
+ <br/>removeClassName()
+ <br/>hasClassName()
+ </td>
+ <td>addClass()
+ <br/>removeClass()
+ <br/>hasClass()
+ </td>
+ </tr>
+ <tr>
+ <td>Get event target inside an event handler</td>
+ <td>Event.element(event)</td>
+ <td>event.target</td>
+ </tr>
+ <tr>
+ <td>Get event mouse position</td>
+ <td>Event.pointerX(event)
+ <br/>Event.pointerY(event)
+ </td>
+ <td>event.pageX
+ <br/>event.pageY
+ </td>
+ </tr>
+ <tr>
+ <td>Fire events</td>
+ <td>Event.fireEvent(this.control, "change")</td>
+ <td>$(element).trigger("change")</td>
+ </tr>
+ <tr>
+ <td>Get element size</td>
+ <td>element.getWidth()
+ <br/>element.getHeight()
+ </td>
+ <td>element.width
+ <br/>element.height
+ </td>
+ </tr>
+ <tr>
+ <td>Change element contents</td>
+ <td>$('div1').innerHTML='new content'</td>
+ <td>$('#div1').html('new content')</td>
+ </tr>
+ <tr>
+ <td>Hook on ajax events</td>
+ <td>Ajax.Responders.register({
+ <br/>"onLoading" : my_function
+ <br/>});
+ <br/>Ajax.Responders.register({
+ <br/>"onSuccess" : my_function
+ <br/>});
+ </td>
+ <td>$( document ).ajaxSend(my_function);
+ <br/>$( document ).ajaxSuccess(my_function);
+ </td>
+ </tr>
+</table>
+
+<h2>PRADO specific code changes</h2>
+<p class="block-content">
+PRADO
+Porting prado to jQuery some method signatures has changed, or have been adapted:
+</p>
+<table class="tabular">
+ <tr>
+ <th></th>
+ <th>Prototype (OLD)</th>
+ <th>jQuery (NEW)</th>
+ </tr>
+ <tr>
+ <td>Implementing the postback handler for a PostBackControl;
+ <br/>the function signature has changed (parameters are inverted):</td>
+ <td>onPostBack : function(event, options)</td>
+ <td>onPostBack : function(options, event)</td>
+ </tr>
+ <tr>
+ <td>Execute a postback</td>
+ <td>Prado.PostBack(options, event);</td>
+ <td>// Create a new object
+ <br/>new Prado.PostBack(options, event);
+ </td>
+ </tr>
+ <tr>
+ <td>Test browser software method has been removed</td>
+ <td>Prado.Browser().ie</td>
+ <td>// Test for browser support for specific capabilities instead
+ <br/>jQuery.support
+ <br/>// or, better, use <a href="http://modernizr.com/">Modernizr</a>
+ </td>
+ </tr>
+ <tr>
+ <td>Get a PRADO object from an object ID</td>
+ <td>Prado.Registry.get('id')</td>
+ <td>Prado.Registry.['id']</td>
+ </tr>
+</table>
+
+<h2>Specific controls changes</h2>
+<p class="block-content">
+Some Prado controls were based on specific extensions of the Prototype + Scriptaculous javascript framework, and they have been deprecated now that jQuery has become the primary js framework in PRADO.
+PRADO 3.3 introduces jQuery-based counterpart for these controls and encourage everyone to port their code to the new controls, but the old controls are still supposed to work with some minor annoyance:
+<ul>
+ <li>Prototype and Scriptaculous will be loaded along jQuery</li>
+ <li>jQuery will execute in "no conflict" mode, so the $() helper won't call anymore jQuery but Prototype.</li>
+</ul>
+Following is the list of deprecated controls:
+</p>
+
+<h4>TAutoComplete</h4>
+<p class="block-content">
+<tt>TAutoComplete</tt> is deprecated, use <tt>TJuiAutoComplete</tt> instead. Main changes in porting existing code using TAutoComplete to TJuiAutoComplete:
+<ul>
+ <li>the <tt>Frequency</tt> property doesn't exists anymore</li>
+ <li>the <tt>minChars</tt> property is called <tt>minLength</tt></li>
+ <li>only the <tt>ItemTemplate</tt> is supported for the <tt>Suggestions</tt> repeater (no HeaderTemplate, FooterTemplate, etc..)</li>
+ <li><tt>ItemTemplate</tt> doesn't need to render the &lt;li&gt; tag anymore, but only the content itself</li>
+ <li>multiple selections are not supported</li>
+</ul>
+</p>
+
+<h4>TDraggable and TDropContainer</h4>
+<p class="block-content">
+<tt>TDraggable</tt> and <tt>TDropContainer</tt> have been deprecated and replaced respectively by <tt>TJuiDraggable</tt> and <tt>TJuiDroppable</tt>.
+The options for the new controls are available at <a href="http://api.jqueryui.com/">jQueryUI's API documentation</a>.
+</p>
+
+</com:TContent>
diff --git a/demos/quickstart/protected/pages/GettingStarted/Wsat.page b/demos/quickstart/protected/pages/GettingStarted/Wsat.page
new file mode 100644
index 00000000..3d07e6f2
--- /dev/null
+++ b/demos/quickstart/protected/pages/GettingStarted/Wsat.page
@@ -0,0 +1,64 @@
+<com:TContent ID="body">
+ <h1>Web Site Administration Tool</h1>
+ <p class="block-content">
+ Web Site Administration Tool (WSAT) is a development tool which allows you to perform several
+ tedious tasks of a PRADO project in a GUI fashion. Its inspired in both Asp.Net - Web Site Administration Tool and Yii's Gii.
+ WSAT will continue gaining new features along the time, at the moment it bring you the followings:
+
+ <ul>
+ <li>Generate one or all <a href="?page=Database.ActiveRecord">Active Record Classes.</a></li>
+ <li>Optionally generate all relationships in Active Record Classes.</li>
+ <li>Generate the magic __toString() method in all AR Classes.</li>
+ </ul>
+ </p>
+
+ <h2>Requirements</h2>
+ <p class="block-content">
+ To use WSAT, you need to add in your project configuration file: <tt>application.xml</tt>,
+ in the services section the wsat service like follows:
+
+<com:TTextHighlighter CssClass="source" Language="xml">
+<services>
+ ...
+ <service id="wsat" class="System.Wsat.TWsatService" Password="my_secret_password" />
+</services>
+</com:TTextHighlighter>
+ </p>
+
+ <h2>Usage</h2>
+ <p class="block-content">
+ Then you are ready to go to: http://localhost/yoursite/index.php?wsat=TWsatLogin and doing so you should see
+ the following page:
+ </p>
+ <img src="<%~wsat_login.png%>" style="width: 700px;" />
+ <p class="block-content">
+ Where in the text field you need to type the password previosly specified in the service inclusion. This
+ is part of a basic security system to avoid undesirable persons to use this tool.
+ </p>
+
+ <h2>Active Record classes generation</h2>
+ <p class="block-content">
+ In order to generate AR classes you need to go to: http://localhost/divermania/index.php?wsat=TWsatGenerateAR
+ by clicking the proper links in the welcome page. Then you should see the following page:
+ </p>
+ <img src="<%~wsat_generate_ar.png%>" style="width: 700px;" />
+ <p class="block-content">
+ In which you can find a basic usage documentation in a light green panel
+ and then some proper fields in order to generate active record classes. These fields are:
+ </p>
+
+ <ul>
+ <li><b>Table Name: </b> refers to the table name in your database for which you want to generate an AR class.
+ Let it as come by default with an * to generate them all.</li>
+ <li><b>Output Folder: </b> refers to the folder where you want to save your generated classes.
+ It only accepts namespace format which means that you need to specify your path separated with points in between.
+ It default value is: "Application.App_Data.AR_Classes" which references the protected/App_Data/AR_Classes
+ file of your project, if you haven't created them yet and you want to, don't bother, WSAT will do it for you.</li>
+ <li><b>Class Prefix: </b> refers to the prefix that you whish to specify in front of every class name.
+ Clear the field to specify no prefix.</li>
+ <li><b>Class Suffix: </b> refers to the suffix that you whish to specify at the end of every class name.
+ Clear the field to specify no suffix.</li>
+ <li><b>Build Relations: </b> whether or not you want to add relationships to AR classes generation.</li>
+ </ul>
+
+</com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/GettingStarted/wsat_generate_ar.png b/demos/quickstart/protected/pages/GettingStarted/wsat_generate_ar.png
new file mode 100644
index 00000000..8f0f59e7
--- /dev/null
+++ b/demos/quickstart/protected/pages/GettingStarted/wsat_generate_ar.png
Binary files differ
diff --git a/demos/quickstart/protected/pages/GettingStarted/wsat_login.png b/demos/quickstart/protected/pages/GettingStarted/wsat_login.png
new file mode 100644
index 00000000..dbe1ad8b
--- /dev/null
+++ b/demos/quickstart/protected/pages/GettingStarted/wsat_login.png
Binary files differ
diff --git a/demos/quickstart/protected/pages/JuiControls/Home.page b/demos/quickstart/protected/pages/JuiControls/Home.page
new file mode 100644
index 00000000..2573b162
--- /dev/null
+++ b/demos/quickstart/protected/pages/JuiControls/Home.page
@@ -0,0 +1,85 @@
+<com:TContent ID="body" >
+<h1>Jui Controls (jQuery UI)</h1>
+<p class="block-content">
+Jui controls are the PRADO port of the standard <a href="http://jqueryui.com/">jQuery UI</a> widgets. They can be used as standard <a href="?page=ActiveControls.Introduction">Active Controls</a>, but will automatically load the needed jQuery-UI javascript libraries.
+</p>
+<h3>Options</h3>
+<p class="block-content">
+The <tt>Options</tt> property of PRADO Jui controls is used to pass options to the underlying javascript object. Each subproperty set on <tt>Options</tt> will be translated to a javascript property added to the object. The complete list of options available for each widget is availble at jQuery-UI's API Documentation.
+</p>
+
+<h4>Example</h4>
+<p class="block-content">
+jQuery-UI's <a href="http://jqueryui.com/resizable/">Resizable</a> adds an handle to a target element making it resizable. Its PRADO counterpart is <a href="?page=JuiControls.Interactions#TJuiResizable">TJuiResizable</a>. Resizable offers an <a href="http://api.jqueryui.com/resizable/#option-aspectRatio">aspectRatio</a> property to constrain the aspect ratio of the target element. The same property can be applied to TJuiResizable as a subproperty of the <tt>Options</tt> property:
+</p>
+<com:TTextHighlighter Language="php" CssClass="source block-content">
+ &lt;com:TJuiResizable
+ ID="resize1"
+ Options.aspectRatio="true"
+ // Additional options being set
+ Options.maxHeight="250"
+ Options.maxWidth="350"
+ Options.minHeight="150"
+ Options.minWidth="200"
+ /&gt;
+</com:TTextHighlighter>
+
+<h3>Events</h3>
+<p class="block-content">
+jQuery-UI widgets offers a lot of events that PRADO can hook up and trasmit to the serverside using a <a href="?page=ActiveControls.Introduction">callback request</a>. Event available for PRADO Jui controls inherits their names from their jQuery-UI counterparts, prefixed with "On".
+Jui controls doesn't make use of the AutoPostback property anymore, but only triggers a callback when an event handler is associated to the corresponding event.
+</p>
+
+<h4>Example</h4>
+<p class="block-content">
+jQuery's <a href="http://jqueryui.com/draggable/">Draggable</a> allows a target element to the moved using the mouse. Its PRADO counterpart is <a href="?page=JuiControls.Interactions#TJuiDraggable">TJuiDraggable</a>. Draggable exposes two useful events: <a href="http://api.jqueryui.com/draggable/#event-start">start</a> and <a href="http://api.jqueryui.com/draggable/#event-stop">stop</a>, that gets triggered respectively when the element starts to move and when the movement stops. TJuiDraggable exposes these same events:
+</p>
+<com:TTextHighlighter Language="php" CssClass="source block-content">
+ &lt;com:TJuiDraggable
+ ID="drag1"
+ OnStart="drag1_start"
+ OnStop="drag1_stop"
+ /&gt;
+</com:TTextHighlighter>
+
+<h2>PRADO Jui interactions controls</h2>
+<p class="block-content">
+Jui interactions adds basic mouse-based interactions to elements like moving, resizing or sorting. PRADO Jui interactions controls applies there interactions to a <a href="?page=ActiveControls.ActivePanel">TActivePanel</a>
+For informations of the specific options of each interaction, follow jQuery-UI Interaction <a href="http://api.jqueryui.com/category/interactions/">API Documentation</a> for the specific interaction.
+</p>
+<ul id="u1" class="block-content">
+ <li>
+ <a href="?page=JuiControls.Interactions#TJuiDraggable">TJuiDraggable</a>
+ is an element that can be moved using the mouse.
+ </li>
+
+ <li>
+ <a href="?page=JuiControls.Interactions#TJuiDroppable">TJuiDroppable</a>
+ is an area where TJuiDraggable elements can be released.
+ </li>
+
+ <li>
+ <a href="?page=JuiControls.Interactions#TJuiResizable">TJuiResizable</a>
+ is an element that cna be resized using the mouse.
+ </li>
+
+ <li>
+ <a href="?page=JuiControls.Interactions#TJuiSelectable">TJuiSelectable</a>
+ displays a list of elements that can be selected individually.
+ </li>
+
+ <li>
+ <a href="?page=JuiControls.Interactions#TJuiSortable">TJuiSortable</a>
+ displays a list of elements that can be selected individually.
+ </li>
+</ul>
+
+<h2>PRADO Jui widgets controls</h2>
+<ul id="u2" class="block-content">
+ <li>
+ <a href="?page=JuiControls.Widgets#TJuiProgressbar">TJuiProgressbar</a>
+ displays a progress bar.
+ </li>
+</ul>
+
+</com:TContent>
diff --git a/demos/quickstart/protected/pages/JuiControls/Interactions.page b/demos/quickstart/protected/pages/JuiControls/Interactions.page
new file mode 100644
index 00000000..2b48da68
--- /dev/null
+++ b/demos/quickstart/protected/pages/JuiControls/Interactions.page
@@ -0,0 +1,83 @@
+<com:TContent ID="body">
+<h1>Jui interactions controls</h1>
+<p class="block-content">
+Jui interactions adds basic mouse-based interactions to elements like moving, resizing or sorting. PRADO Jui interactions controls applies these interactions to a <a href="?page=ActiveControls.ActivePanel">TActivePanel</a>
+For informations of the specific options of each interaction, follow jQuery-UI Interaction <a href="http://api.jqueryui.com/category/interactions/">API Documentation</a> for the specific interaction.
+</p>
+
+<a name="TJuiDraggable"></a>
+<h2>TJuiDraggable</h2>
+<com:DocLink ClassPath="System.Web.UI.JuiControls.TJuiDraggable" /> - <a href="http://api.jqueryui.com/draggable/">jQuery UI API</a>
+
+<p class="block-content">
+<tt>TJuiDraggable</tt> is an extension to <a href="?page=ActiveControls.ActivePanel">TActivePanel</a> based on jQuery-UI's <a href="http://jqueryui.com/draggable/">Draggable</a> interaction.
+</p>
+
+<p class="block-content">
+The panel can be moved using the mouse, and eventually dropped over a <a href="?page=JuiControls.Interactions#TJuiDroppable">TJuiDroppable</a>.
+</p>
+
+<com:RunBar PagePath="JuiControls.Samples.TJuiDraggable.Home" />
+<br/>
+
+
+<a name="TJuiDroppable"></a>
+<h2>TJuiDroppable</h2>
+<com:DocLink ClassPath="System.Web.UI.JuiControls.TJuiDroppable" /> - <a href="http://api.jqueryui.com/droppable/">jQuery UI API</a>
+
+<p class="block-content">
+<tt>TJuiDroppable</tt> is an extension to <a href="?page=ActiveControls.ActivePanel">TActivePanel</a> based on jQuery-UI's <a href="http://jqueryui.com/draggable/">Draggable</a> interaction.
+</p>
+
+<p class="block-content">
+When a <a href="?page=JuiControls.Interactions#TJuiDroppable">TJuiDraggable</a> is dropped over a <tt>TJuiDroppable panel</tt>, the <tt>OnDrop</tt> event will be triggered. The event hanler will receive a <tt>TJuiEventParameter</tt> object containing a reference to the dropped control in the <tt>DraggableControl</tt> property.
+</p>
+
+<com:RunBar PagePath="JuiControls.Samples.TJuiDroppable.Home" />
+<br/>
+
+<a name="TJuiResizable"></a>
+<h2>TJuiResizable</h2>
+<com:DocLink ClassPath="System.Web.UI.JuiControls.TJuiResizable" /> - <a href="http://api.jqueryui.com/resizable/">jQuery UI API</a>
+<p class="block-content">
+<tt>TJuiResizable</tt> is an extension to <a href="?page=ActiveControls.ActivePanel">TActivePanel</a> based on jQuery-UI's <a href="http://jqueryui.com/resizable/">Resizable</a> interaction.
+</p>
+
+<p class="block-content">
+A small handle is shown on the bottom right corner of the panel, that permits the panel to be resized using the mouse.
+</p>
+
+<com:RunBar PagePath="JuiControls.Samples.TJuiResizable.Home" />
+<br/>
+
+
+<a name="TJuiSelectable"></a>
+<h2>TJuiSelectable</h2>
+<com:DocLink ClassPath="System.Web.UI.JuiControls.TJuiSelectable" /> - <a href="http://api.jqueryui.com/selectable/">jQuery UI API</a>
+<p class="block-content">
+<tt>TJuiSelectable</tt> is an extension to <a href="?page=ActiveControls.ActivePanel">TActivePanel</a> based on jQuery-UI's <a href="http://jqueryui.com/selectable/">Selectable</a> interaction.
+</p>
+
+<p class="block-content">
+<tt>TJuiSelectable</tt> can be feed a <tt>DataSource</tt> and will interally render a <a href="?page=Controls.Repeater">TRepeater</a> that displays items in an unordered list. Items can be selected by clicking on them, individually or in a group.
+</p>
+
+<com:RunBar PagePath="JuiControls.Samples.TJuiSelectable.Home" />
+<br/>
+
+
+<a name="TJuiSortable"></a>
+<h2>TJuiSortable</h2>
+<com:DocLink ClassPath="System.Web.UI.JuiControls.TJuiSortable" /> - <a href="http://api.jqueryui.com/sortable/">jQuery UI API</a>
+<p class="block-content">
+<tt>TJuiSortable</tt> is an extension to <a href="?page=ActiveControls.ActivePanel">TActivePanel</a> based on jQuery-UI's <a href="http://jqueryui.com/sortable/">Sortable</a> interaction.
+</p>
+
+<p class="block-content">
+<tt>TJuiSortable</tt> can be feed a <tt>DataSource</tt> and will interally render a <a href="?page=Controls.Repeater">TRepeater</a> that displays items in an unordered list. Items can be sortered dragging and dropping them.
+</p>
+
+<com:RunBar PagePath="JuiControls.Samples.TJuiSortable.Home" />
+<br/>
+
+</com:TContent>
diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.page b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.page
new file mode 100644
index 00000000..349922cb
--- /dev/null
+++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.page
@@ -0,0 +1,29 @@
+<com:TContent ID="body">
+<h1>TJuiDraggable Samples</h1>
+
+<com:TStyleSheet>
+ .ui-draggable {
+ width: 100px;
+ height:100px;
+ background-color: lime;
+ border: 1px solid black;
+ padding: 1em;
+ }
+</com:TStyleSheet>
+<table class="sampletable">
+
+<tr><td class="samplenote">
+Default options with a little css applied:
+</td><td class="sampleaction" style="height:600px">
+ <com:TJuiDraggable
+ OnStart="drag1_start"
+ OnStop="drag1_stop"
+ >
+ Drag me around
+ </com:TJuiDraggable>
+ <com:TActiveLabel ID="label1" Text="Waiting.." />
+</td></tr>
+
+</table>
+
+</com:TContent>
diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.php b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.php
new file mode 100644
index 00000000..348eea55
--- /dev/null
+++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.php
@@ -0,0 +1,16 @@
+<?php
+
+class Home extends TPage
+{
+ protected function drag1_start($sender, $param)
+ {
+ $offset=$param->getCallbackParameter()->offset;
+ $this->label1->Text.="<br/>Start drag at (".$offset->left.",".$offset->top.")";
+ }
+
+ protected function drag1_stop($sender, $param)
+ {
+ $offset=$param->getCallbackParameter()->offset;
+ $this->label1->Text.="<br/>Stop drop at (".$offset->left.",".$offset->top.")";
+ }
+} \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDroppable/Home.page b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDroppable/Home.page
new file mode 100644
index 00000000..6059fe60
--- /dev/null
+++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDroppable/Home.page
@@ -0,0 +1,48 @@
+<com:TContent ID="body">
+<h1>TJuiDroppable Samples</h1>
+
+<com:TStyleSheet>
+ .ui-draggable {
+ width: 100px;
+ height:100px;
+ background-color: lime;
+ border: 1px solid black;
+ padding: 1em;
+ }
+ .ui-droppable {
+ width: 150px;
+ height:150px;
+ border: 1px solid black;
+ padding: 1em;
+ margin: 1em;
+ }
+ .drop-yellow {
+ background-color: yellow;
+ }
+ .drop-red {
+ background-color: red;
+ }
+</com:TStyleSheet>
+<table class="sampletable">
+
+<tr><td class="samplenote">
+Default options with a little css applied:
+</td><td class="sampleaction" style="height:600px">
+ <com:TJuiDraggable ID="drag1">
+ Drag me around
+ </com:TJuiDraggable>
+
+ <com:TJuiDroppable OnDrop="drop1_ondrop" CssClass="drop-yellow">
+ Drop it here!
+ <br/><com:TActiveLabel ID="label1" />
+ </com:TJuiDroppable>
+
+ <com:TJuiDroppable OnDrop="drop2_ondrop" CssClass="drop-red">
+ Drop it here!
+ <br/><com:TActiveLabel ID="label2" />
+ </com:TJuiDroppable>
+</td></tr>
+
+</table>
+
+</com:TContent>
diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDroppable/Home.php b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDroppable/Home.php
new file mode 100644
index 00000000..c59d035c
--- /dev/null
+++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDroppable/Home.php
@@ -0,0 +1,30 @@
+<?php
+
+class Home extends TPage
+{
+ public function drop1_ondrop($sender, $param)
+ {
+ $draggable=$param->DraggableControl;
+ /* Equals to:
+ * $draggable=$param->getControl($param->getCallbackParameter()->draggable);
+ */
+ $offset=$param->getCallbackParameter()->offset;
+ $target=$param->getCallbackParameter()->target->offset;
+ $top=$offset->top - $target->top;
+ $left=$offset->left - $target->left;
+ $this->label1->Text="Dropped ".$draggable->ID." at: <br/>Top=".$top." Left=".$left;
+ }
+
+ public function drop2_ondrop($sender, $param)
+ {
+ $draggable=$param->DraggableControl;
+ /* Equals to:
+ * $draggable=$param->getControl($param->getCallbackParameter()->draggable);
+ */
+ $offset=$param->getCallbackParameter()->offset;
+ $target=$param->getCallbackParameter()->target->offset;
+ $top=$offset->top - $target->top;
+ $left=$offset->left - $target->left;
+ $this->label2->Text="Dropped ".$draggable->ID." at: <br/>Top=".$top." Left=".$left;
+ }
+}
diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiProgressbar/Home.page b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiProgressbar/Home.page
new file mode 100644
index 00000000..63436516
--- /dev/null
+++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiProgressbar/Home.page
@@ -0,0 +1,55 @@
+<com:TContent ID="body">
+<h1>TJuiProgressbar Samples</h1>
+
+<table class="sampletable">
+
+<tr><td class="samplenote">
+Default options, Max=100, Value=50:
+</td><td class="sampleaction">
+ <com:TJuiProgressbar
+ Options.Max="100"
+ Options.Value="50"
+ />
+</td></tr>
+
+<tr><td class="samplenote">
+Undefined progressbar, Value=false:
+</td><td class="sampleaction">
+ <com:TJuiProgressbar
+ Options.Value="false"
+ />
+</td></tr>
+
+<tr><td class="samplenote">
+Undefined progresbar, value changed from javascript:
+</td><td class="sampleaction">
+ <com:TJuiProgressbar
+ ID="pbar1"
+ Options.Max="100"
+ Options.Value="false"
+ OnChange="pbar1_changed"
+ OnComplete="pbar1_complete"
+ />
+ <com:TActiveLabel ID="label1" Text="Waiting.." />
+ <com:TButton ID="button1" Text="Start example" Attributes.OnClick="startExample1(); return false" />
+ <com:TClientScript>
+ function progress() {
+ var pbar = $('#<%= $this->pbar1->ClientID %>');
+ var val = pbar.progressbar('value') || 0;
+ pbar.progressbar('value', val + 10);
+ if (val < 99) {
+ setTimeout(progress, 500);
+ }
+ }
+
+ function startExample1()
+ {
+ $('#<%= $this->pbar1->ClientID %>').progressbar('value', false)
+ progress();
+ }
+ </com:TClientScript/>
+</td></tr>
+
+</table>
+
+</com:TContent>
diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiProgressbar/Home.php b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiProgressbar/Home.php
new file mode 100644
index 00000000..8f6d9ec6
--- /dev/null
+++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiProgressbar/Home.php
@@ -0,0 +1,14 @@
+<?php
+
+class Home extends TPage
+{
+ public function pbar1_complete($sender,$param)
+ {
+ $this->label1->Text="Progressbar complete!";
+ }
+
+ public function pbar1_changed($sender,$param)
+ {
+ $this->label1->Text="Progressbar changed.";
+ }
+} \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiResizable/Home.page b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiResizable/Home.page
new file mode 100644
index 00000000..6c61f7df
--- /dev/null
+++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiResizable/Home.page
@@ -0,0 +1,29 @@
+<com:TContent ID="body">
+<h1>TJuiResizable Samples</h1>
+
+<com:TStyleSheet>
+ .resizable {
+ width: 150px;
+ height: 150px;
+ padding: 0.5em;
+ background: #fff;
+ border: 1px solid #000;
+ }
+ </com:TStyleSheet>
+<table class="sampletable">
+
+<tr><td class="samplenote">
+Default options with a little css applied:
+</td><td class="sampleaction">
+ <com:TJuiResizable
+ CssClass="resizable"
+ OnStart="resize1_start"
+ OnStop="resize1_stop"
+ >
+ <com:TActiveLabel ID="label1" Text="Resize me!" />
+ </com:TJuiResizable>
+</td></tr>
+
+</table>
+
+</com:TContent>
diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiResizable/Home.php b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiResizable/Home.php
new file mode 100644
index 00000000..435b8a9b
--- /dev/null
+++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiResizable/Home.php
@@ -0,0 +1,16 @@
+<?php
+
+class Home extends TPage
+{
+ protected function resize1_start($sender, $param)
+ {
+ $size=$param->getCallbackParameter()->size;
+ $this->label1->Text.="<br/>Start: ".intval($size->width)." x ".intval($size->height);
+ }
+
+ protected function resize1_stop($sender, $param)
+ {
+ $size=$param->getCallbackParameter()->size;
+ $this->label1->Text.="<br/>Stop: ".intval($size->width)." x ".intval($size->height);
+ }
+} \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSelectable/Home.page b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSelectable/Home.page
new file mode 100644
index 00000000..cd778625
--- /dev/null
+++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSelectable/Home.page
@@ -0,0 +1,41 @@
+<com:TContent ID="body">
+<h1>TJuiSelectable Samples</h1>
+
+<com:TStyleSheet>
+ .ui-selectable {
+ list-style: none;
+ cursor: pointer;
+ }
+ .ui-selectable li {
+ border: 1px solid transparent;
+ padding: 3px;
+ border-radius:3px;
+ }
+
+ .ui-selectable li:hover {
+ background: #FECA40;
+ border: 1px solid black;
+ }
+
+ .ui-selecting {
+ background: #FECA40;
+ }
+ .ui-selected {
+ background: #F39814; color: white;
+ }
+</com:TStyleSheet>
+<table class="sampletable">
+
+<tr><td class="samplenote">
+Default options with a little css applied:
+</td><td class="sampleaction">
+ <com:TJuiSelectable
+ ID="repeater1"
+ OnStop="repeater1_onStop"
+ />
+ <com:TActiveLabel ID="label1" />
+</td></tr>
+
+</table>
+
+</com:TContent>
diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSelectable/Home.php b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSelectable/Home.php
new file mode 100644
index 00000000..ada38408
--- /dev/null
+++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSelectable/Home.php
@@ -0,0 +1,32 @@
+<?php
+
+class Home extends TPage
+{
+ protected $data = array(
+ 'PRADO',
+ 'quickstart',
+ 'tutorial',
+ 'sample',
+ 'for the',
+ 'TJuiSortable',
+ 'control',
+ );
+
+ public function onLoad($param)
+ {
+ if(!$this->IsPostback)
+ {
+ $this->repeater1->DataSource=$this->data;
+ $this->repeater1->dataBind();
+ }
+ }
+
+ public function repeater1_onStop($sender, $param)
+ {
+ $this->label1->Text="Selected items:";
+ $items = $param->getCallbackParameter()->index;
+
+ foreach($items as $index)
+ $this->label1->Text.=' '.$this->data[$index];
+ }
+}
diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.page b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.page
new file mode 100644
index 00000000..cbb1465b
--- /dev/null
+++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.page
@@ -0,0 +1,35 @@
+<com:TContent ID="body">
+<h1>TJuiSortable Samples</h1>
+
+<com:TStyleSheet>
+ .ui-sortable {
+ list-style: none;
+ cursor: pointer;
+ }
+
+ .ui-sortable li {
+ border: 1px solid transparent;
+ padding: 3px;
+ border-radius:3px;
+ }
+
+ .ui-sortable li:hover {
+ background: lime;
+ border: 1px solid black;
+ }
+</com:TStyleSheet>
+<table class="sampletable">
+
+<tr><td class="samplenote">
+Default options with a little css applied:
+</td><td class="sampleaction">
+ <com:TJuiSortable
+ ID="repeater1"
+ onStop="repeater1_onStop"
+ />
+ <com:TActiveLabel ID="label1" />
+</td></tr>
+
+</table>
+
+</com:TContent>
diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.php b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.php
new file mode 100644
index 00000000..d96df302
--- /dev/null
+++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.php
@@ -0,0 +1,31 @@
+<?php
+
+class Home extends TPage
+{
+ protected $data = array(
+ 'PRADO',
+ 'quickstart',
+ 'tutorial',
+ 'sample',
+ 'for the',
+ 'TJuiSortable',
+ 'control',
+ );
+
+ public function onLoad($param)
+ {
+ if(!$this->IsPostback)
+ {
+ $this->repeater1->DataSource=$this->data;
+ $this->repeater1->dataBind();
+ }
+ }
+
+ public function repeater1_onStop($sender, $param)
+ {
+ $this->label1->Text="Items order:";
+ $order = $param->getCallbackParameter()->index;
+ foreach($order as $index)
+ $this->label1->Text.=' '.$this->data[$index];
+ }
+}
diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/config.xml b/demos/quickstart/protected/pages/JuiControls/Samples/config.xml
new file mode 100644
index 00000000..315e42af
--- /dev/null
+++ b/demos/quickstart/protected/pages/JuiControls/Samples/config.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Id: config.xml 1405 2006-09-10 01:03:56Z wei $ -->
+<configuration>
+ <paths>
+ <using namespace="System.Web.UI.JuiControls.*" />
+ </paths>
+ <pages MasterClass="SampleLayout" />
+</configuration> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/JuiControls/Widgets.page b/demos/quickstart/protected/pages/JuiControls/Widgets.page
new file mode 100644
index 00000000..cf72d41d
--- /dev/null
+++ b/demos/quickstart/protected/pages/JuiControls/Widgets.page
@@ -0,0 +1,28 @@
+<com:TContent ID="body">
+<h1>Jui widgets controls</h1>
+<p class="block-content">
+Jui widgets are complex controls built on the foundations of jQuery effects and jQueryUI interactions.
+PRADO Jui widgets controls can be divided in two groups:
+<ol>
+ <li>Standard Widgets, extend a control affecting its aspect and functionality: eg. <tt>TJuiProgressbar</tt> transforms an <a href="?page=ActiveControls.ActivePanel">TActivePanel</a> into a Progressbar</li>
+ <li>List Widgets, take a repeated list of items and relayout their presentation: eg. ...
+</ol>
+For informations of the specific options of each widget, follow jQuery-UI Widget <a href="http://api.jqueryui.com/category/widgets/">API Documentation</a> for the specific interaction.
+</p>
+
+<a name="TJuiProgressbar"></a>
+<h2>TJuiProgressbar</h2>
+<com:DocLink ClassPath="System.Web.UI.JuiControls.TJuiProgressbar" /> - <a href="http://api.jqueryui.com/progressbar/">jQuery UI API</a>
+
+<p class="block-content">
+<tt>TJuiProgressbar</tt> is an extension to <a href="?page=ActiveControls.ActivePanel">TActivePanel</a> based on jQuery-UI's <a href="http://jqueryui.com/progressbar/">Progressbar</a> widget.
+</p>
+
+<p class="block-content">
+The panel takes the aspect of a progressbar ranging from a value of 0 to the value of the <tt>Max</tt> property. The current value can be set using the <tt>Value</tt> property; setting it to <tt>false</tt> will create an undefined progressbar.
+</p>
+
+<com:RunBar PagePath="JuiControls.Samples.TJuiProgressbar.Home" />
+<br/>
+
+</com:TContent>
diff --git a/demos/quickstart/protected/pages/Tutorial/AddressBook.page b/demos/quickstart/protected/pages/Tutorial/AddressBook.page
deleted file mode 100755
index f028a636..00000000
--- a/demos/quickstart/protected/pages/Tutorial/AddressBook.page
+++ /dev/null
@@ -1,9 +0,0 @@
-<com:TContent ID="body">
- <h1 id="22007">A Simple Address Book</h1>
- <p id="110006" class="block-content">This tutorial introduces the basics of connecting to a database
- using <a href="?page=Database.ActiveRecord">ActiveRecord</a>
- and using <a href="?page=Database.Scaffold">Active Record scaffolds </a>to quickly
- build a simple address book.
- </p>
-
-</com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Tutorial/AjaxChat.page b/demos/quickstart/protected/pages/Tutorial/AjaxChat.page
index d94dfa89..92118720 100755
--- a/demos/quickstart/protected/pages/Tutorial/AjaxChat.page
+++ b/demos/quickstart/protected/pages/Tutorial/AjaxChat.page
@@ -59,7 +59,6 @@ php prado/framework/prado-cli.php -c chat
class Login extends TPage
{
}
-?&gt;
</com:TTextHighlighter>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code_90029">
<!doctype html public "-//W3C//DTD XHTML 1.0 Strict//EN"
@@ -170,7 +169,7 @@ as <tt>App_Code/chat.db</tt>.
class ChatUserRecord extends TActiveRecord
{
const TABLE='chat_users';
-
+
public $username;
public $last_activity;
@@ -431,7 +430,6 @@ and a button to send the message.
Text="Send" /&gt;
</div>
&lt;/com:TForm&gt;
-&lt;com:TJavascriptLogger /&gt;
</body>
</html>
</com:TTextHighlighter>
@@ -572,7 +570,7 @@ public function getUserMessages($user)
$content = '';
foreach($this->findAll('for_user = ?', $user) as $message)
$content .= $this->formatMessage($message);
- $this->deleteAll('for_user = ? OR created_on < ?',
+ $this->deleteAll('for_user = ? OR created_on < ?',
$user, time() - 300); //5 min inactivity
return $content;
}
@@ -581,7 +579,7 @@ protected function formatMessage($message)
{
$user = htmlspecialchars($message->from_user);
$content = htmlspecialchars($message->message);
- return "<div class=\"message\"><strong>{$user}:</strong>"
+ return "<div class=\"message\"><strong>{$user}:</strong>"
." <span>{$content}</span></div>";
}
</com:TTextHighlighter>
diff --git a/demos/quickstart/protected/pages/Tutorial/CurrencyConverter.page b/demos/quickstart/protected/pages/Tutorial/CurrencyConverter.page
index 4bec2a28..1abd68b9 100755
--- a/demos/quickstart/protected/pages/Tutorial/CurrencyConverter.page
+++ b/demos/quickstart/protected/pages/Tutorial/CurrencyConverter.page
@@ -34,9 +34,9 @@
<tt>currency-converter</tt> in your current working directory.
You may need to change to the appropriate directory
first.
- See the <a href="?page=GettingStarted.CommandLine">Command Line Tool</a>
- for more details.
- </p>
+ See the <a href="?page=GettingStarted.CommandLine">Command Line Tool</a>
+ for more details.
+ </p>
<com:TTextHighlighter Language="text" CssClass="source block-content" id="code111">
php prado/framework/prado-cli.php -c currency-converter
</com:TTextHighlighter>
@@ -52,7 +52,7 @@ php prado/framework/prado-cli.php -c currency-converter
<p id="80058" class="block-content">We start by editing the <tt>Home.page</tt> file found in the
<tt>currency-converter/protected/pages/</tt> directory. Files ending
with ".page" are page templates that contains HTML and Prado controls.
- We simply add two textboxes, three labels and one button as follows.
+ We simply add two textboxes, three labels and one button as follows.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="form1">
&lt;com:TForm&gt;
@@ -75,7 +75,7 @@ php prado/framework/prado-cli.php -c currency-converter
</div>
</fieldset>
&lt;/com:TForm&gt;
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="refresh" class="block-content">
If you refresh the page, you should see something similar to the following figure.
It may not look very pretty or orderly, but we shall change that later using CSS.
@@ -125,7 +125,7 @@ php prado/framework/prado-cli.php -c currency-converter
to add a "Home.php" to where "Home.page" is. The <tt>Home</tt> class
should extends the
<com:DocLink ClassPath="System.Web.UI.TPage" Text="TPage" />, the default base
- class for all Prado pages.
+ class for all Prado pages.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code3">
&lt;?php
@@ -133,8 +133,7 @@ class Home extends TPage
{
}
-?&gt;
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="1111" class="block-content">
Prado uses PHP's <tt>__autoload</tt> method to load classes. The convention
is to use the class name with ".php" extension as filename.
@@ -151,15 +150,15 @@ class Home extends TPage
the converted total. To handle the user clicking of the "Convert" button
we simply add an <tt>OnClick</tt> property to the "Convert" button in
the "Home.page" template and add a corresponding event handler method
- in the "Home.php".
+ in the "Home.php".
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code4">
&lt;com:TButton Text="Convert" OnClick="convert_clicked" /&gt;
</com:TTextHighlighter>
- <p id="222" class="block-content">
+ <p id="222" class="block-content">
The value of the <tt>OnClick</tt>, "<tt>convert_clicked</tt>", will be the method
name in the "Home.php" that will called when the user clicks on the
- "Convert" button.
+ "Convert" button.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code5">
class Home extends TPage
@@ -171,8 +170,8 @@ class Home extends TPage
$this->total->Text = $rate * $dollars;
}
}
-</com:TTextHighlighter>
-<div id="3332" class="block-content">
+</com:TTextHighlighter>
+<div id="3332" class="block-content">
<p id="333">
If you run the application in your web browser, enter some values and click
the "Convert" button then you should see that calculated value displayed next
@@ -186,24 +185,24 @@ class Home extends TPage
</p>
<p id="80067">We shall now examine, the three lines that implements the simply currency
- conversion in the "<tt>convert_clicked</tt>" method.
- </p>
+ conversion in the "<tt>convert_clicked</tt>" method.
+ </p>
</div>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code6" >
$rate = floatval($this->currencyRate->Text);
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="444" class="block-content">
The statement <tt>$this->currencyRate</tt> corresponds to the
<tt>TTextBox</tt> component with <tt>ID</tt> value "currencyRate" in the
"Home.page" template. The <tt>Text</tt> property of the <tt>TTextBox</tt>
contains the value that the user entered. So, we obtain this
value by <tt>$this->currencyRate->Text</tt> which we convert the
- value to a float value.
+ value to a float value.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code7">
$dollars = floatval($this->dollars->Text);
-</com:TTextHighlighter>
-<div id="5551" class="block-content">
+</com:TTextHighlighter>
+<div id="5551" class="block-content">
<p id="555">
The next line does a similar things, it takes the user value from
the <tt>TTextBox</tt> with <tt>ID</tt> value "dollars and converts it to
@@ -212,9 +211,9 @@ $dollars = floatval($this->dollars->Text);
<p id="80068">The third line calculates the new amount and set this value in the
<tt>Text</tt> property of the <tt>TLabel</tt> with <tt>ID="total"</tt>.
- Thus, we display the new amount to the user in the label.
+ Thus, we display the new amount to the user in the label.
</p>
-</div>
+</div>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code8">
$this->total->Text = $rate * $dollars;
</com:TTextHighlighter>
@@ -233,14 +232,14 @@ $this->total->Text = $rate * $dollars;
<li>the user enters a value,</li>
<li>the currency rate is a valid number,</li>
<li>the currency rate is positive.</li>
- </ol>
+ </ol>
<p id="666" class="block-content">
To ensure 1 we add one
<com:DocLink ClassPath="System.Web.UI.WebControls.TRequiredFieldValidator" Text="TRequiredFieldValidator" />. To ensure 2 and 3, we add one
<com:DocLink ClassPath="System.Web.UI.WebControls.TCompareValidator" Text="TCompareValidator" />. We may add these validators any where within
the "Home.page" template. Further details regarding these validator and other
validators can be found in the
- <a href="?page=Controls.Validation">Validation Controls</a> page.
+ <a href="?page=Controls.Validation">Validation Controls</a> page.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code9">
&lt;com:TRequiredFieldValidator
@@ -258,12 +257,12 @@ $this->total->Text = $rate * $dollars;
<ol id="o222" class="block-content">
<li>the user enters a value,</li>
<li>the value is a valid number (not including any currency or dollar signs).</li>
- </ol>
+ </ol>
<p id="777" class="block-content">
To ensure 1 we just add another <tt>TRequiredFieldValidator</tt>, for 2
we could use a
<com:DocLink ClassPath="System.Web.UI.WebControls.TDataTypeValidator" Text="TDataTypeValidator" />. For simplicity we only allow the user to enter
- a number for the amount they wish to convert.
+ a number for the amount they wish to convert.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code9a">
&lt;com:TRequiredFieldValidator
@@ -283,7 +282,7 @@ $this->total->Text = $rate * $dollars;
using both javascript and server side. The server side validation
is <b>always performed</b>. For the server side, we
should skip the calculation if the validators are not satisfied. This can
- done as follows.
+ done as follows.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code10" >
public function convert_clicked($sender, $param)
@@ -313,7 +312,7 @@ public function convert_clicked($sender, $param)
In addition, we can change the "totals" <tt>TLabel</tt> with the
Active Control counter part,
<com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveLabel" Text="TActiveLabel" />, such that the server side can update the browser without
- reloading the page.
+ reloading the page.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code11">
<div class="total-field">
@@ -323,11 +322,11 @@ public function convert_clicked($sender, $param)
<div class="convert-button">
&lt;com:TActiveButton Text="Convert" OnClick="convert_clicked" /&gt;
</div>
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="1232" class="block-content">
The server side logic remains the same, we just need to import the
Active Controls name space as they are not included by default. We
- add the following line to the begin of "Home.php".
+ add the following line to the begin of "Home.php".
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code12">
Prado::using('System.Web.UI.ActiveControls.*');
@@ -345,7 +344,7 @@ Prado::using('System.Web.UI.ActiveControls.*');
<p id="80076" class="block-content">To indicate that the calculation is in progress, we can change the text
of the "total" label as follows. We add a <tt>ClientSide.OnLoading</tt> property
to the "Convert" button (since this button is responsible for requesting
- the calculation).
+ the calculation).
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code13">
&lt;com:TActiveButton Text="Convert" OnClick="convert_clicked" &gt;
@@ -383,7 +382,7 @@ Prado::using('System.Web.UI.ActiveControls.*');
<p id="80080" class="block-content">We simply create a CSS file named "common.css" and save it in the
<tt>themes/Basic</tt> directory. Then we add the following code
- to the beginning of "Home.page" (we add a little more HTML as well).
+ to the beginning of "Home.page" (we add a little more HTML as well).
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code14">
&lt;%@ Theme="Basic" %&gt;
@@ -392,7 +391,7 @@ Prado::using('System.Web.UI.ActiveControls.*');
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
&lt;com:THead Title="Currency Converter" /&gt;
<body>
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="4334" class="block-content">
The first line <tt>&lt;%@ Theme="Basic" %&gt;</tt> defines the
theme to be used for this page. The
diff --git a/demos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page b/demos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page
index 66bb0e43..568e920f 100755
--- a/demos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page
+++ b/demos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page
@@ -58,7 +58,6 @@ php prado/framework/prado-cli.php -c chat
class Login extends TPage
{
}
-?&gt;
</com:TTextHighlighter>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code_90029">
<!doctype html public "-//W3C//DTD XHTML 1.0 Strict//EN"
@@ -430,7 +429,6 @@ and a button to send the message.
Text="Send" /&gt;
</div>
&lt;/com:TForm&gt;
-&lt;com:TJavascriptLogger /&gt;
</body>
</html>
</com:TTextHighlighter>
@@ -571,7 +569,7 @@ public function getUserMessages($user)
$content = '';
foreach($this->findAll('for_user = ?', $user) as $message)
$content .= $this->formatMessage($message);
- $this->deleteAll('for_user = ? OR created_on < ?',
+ $this->deleteAll('for_user = ? OR created_on < ?',
$user, time() - 300); //5 min inactivity
return $content;
}
@@ -580,7 +578,7 @@ protected function formatMessage($message)
{
$user = htmlspecialchars($message->from_user);
$content = htmlspecialchars($message->message);
- return "<div class=\"message\"><strong>{$user}:</strong>"
+ return "<div class=\"message\"><strong>{$user}:</strong>"
." <span>{$content}</span></div>";
}
</com:TTextHighlighter>
diff --git a/demos/quickstart/protected/pages/Tutorial/fr/CurrencyConverter.page b/demos/quickstart/protected/pages/Tutorial/fr/CurrencyConverter.page
index 2cce2336..6b8c7bc3 100755
--- a/demos/quickstart/protected/pages/Tutorial/fr/CurrencyConverter.page
+++ b/demos/quickstart/protected/pages/Tutorial/fr/CurrencyConverter.page
@@ -34,9 +34,9 @@
<tt>currency-converter</tt> in your current working directory.
You may need to change to the appropriate directory
first.
- See the <a href="?page=GettingStarted.CommandLine">Command Line Tool</a>
- for more details.
- </p>
+ See the <a href="?page=GettingStarted.CommandLine">Command Line Tool</a>
+ for more details.
+ </p>
<com:TTextHighlighter Language="text" CssClass="source block-content" id="code111">
php prado/framework/prado-cli.php -c currency-converter
</com:TTextHighlighter>
@@ -52,7 +52,7 @@ php prado/framework/prado-cli.php -c currency-converter
<p id="80058" class="block-content">We start by editing the <tt>Home.page</tt> file found in the
<tt>currency-converter/protected/pages/</tt> directory. Files ending
with ".page" are page templates that contains HTML and Prado controls.
- We simply add two textboxes, three labels and one button as follows.
+ We simply add two textboxes, three labels and one button as follows.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="form1">
&lt;com:TForm&gt;
@@ -75,7 +75,7 @@ php prado/framework/prado-cli.php -c currency-converter
</div>
</fieldset>
&lt;/com:TForm&gt;
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="refresh" class="block-content">
If you refresh the page, you should see something similar to the following figure.
It may not look very pretty or orderly, but we shall change that later using CSS.
@@ -125,7 +125,7 @@ php prado/framework/prado-cli.php -c currency-converter
to add a "Home.php" to where "Home.page" is. The <tt>Home</tt> class
should extends the
<com:DocLink ClassPath="System.Web.UI.TPage" Text="TPage" />, the default base
- class for all Prado pages.
+ class for all Prado pages.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code3">
&lt;?php
@@ -133,8 +133,7 @@ class Home extends TPage
{
}
-?&gt;
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="1111" class="block-content">
Prado uses PHP's <tt>__autoload</tt> method to load classes. The convention
is to use the class name with ".php" extension as filename.
@@ -151,15 +150,15 @@ class Home extends TPage
the converted total. To handle the user clicking of the "Convert" button
we simply add an <tt>OnClick</tt> property to the "Convert" button in
the "Home.page" template and add a corresponding event handler method
- in the "Home.php".
+ in the "Home.php".
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code4">
&lt;com:TButton Text="Convert" OnClick="convert_clicked" /&gt;
</com:TTextHighlighter>
- <p id="222" class="block-content">
+ <p id="222" class="block-content">
The value of the <tt>OnClick</tt>, "<tt>convert_clicked</tt>", will be the method
name in the "Home.php" that will called when the user clicks on the
- "Convert" button.
+ "Convert" button.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code5">
class Home extends TPage
@@ -171,8 +170,8 @@ class Home extends TPage
$this->total->Text = $rate * $dollars;
}
}
-</com:TTextHighlighter>
-<div id="3332" class="block-content">
+</com:TTextHighlighter>
+<div id="3332" class="block-content">
<p id="333">
If you run the application in your web browser, enter some values and click
the "Convert" button then you should see that calculated value displayed next
@@ -186,24 +185,24 @@ class Home extends TPage
</p>
<p id="80067">We shall now examine, the three lines that implements the simply currency
- conversion in the "<tt>convert_clicked</tt>" method.
- </p>
+ conversion in the "<tt>convert_clicked</tt>" method.
+ </p>
</div>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code6" >
$rate = floatval($this->currencyRate->Text);
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="444" class="block-content">
The statement <tt>$this->currencyRate</tt> corresponds to the
<tt>TTextBox</tt> component with <tt>ID</tt> value "currencyRate" in the
"Home.page" template. The <tt>Text</tt> property of the <tt>TTextBox</tt>
contains the value that the user entered. So, we obtain this
value by <tt>$this->currencyRate->Text</tt> which we convert the
- value to a float value.
+ value to a float value.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code7">
$dollars = floatval($this->dollars->Text);
-</com:TTextHighlighter>
-<div id="5551" class="block-content">
+</com:TTextHighlighter>
+<div id="5551" class="block-content">
<p id="555">
The next line does a similar things, it takes the user value from
the <tt>TTextBox</tt> with <tt>ID</tt> value "dollars and converts it to
@@ -212,9 +211,9 @@ $dollars = floatval($this->dollars->Text);
<p id="80068">The third line calculates the new amount and set this value in the
<tt>Text</tt> property of the <tt>TLabel</tt> with <tt>ID="total"</tt>.
- Thus, we display the new amount to the user in the label.
+ Thus, we display the new amount to the user in the label.
</p>
-</div>
+</div>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code8">
$this->total->Text = $rate * $dollars;
</com:TTextHighlighter>
@@ -233,14 +232,14 @@ $this->total->Text = $rate * $dollars;
<li>the user enters a value,</li>
<li>the currency rate is a valid number,</li>
<li>the currency rate is positive.</li>
- </ol>
+ </ol>
<p id="666" class="block-content">
To ensure 1 we add one
<com:DocLink ClassPath="System.Web.UI.WebControls.TRequiredFieldValidator" Text="TRequiredFieldValidator" />. To ensure 2 and 3, we add one
<com:DocLink ClassPath="System.Web.UI.WebControls.TCompareValidator" Text="TCompareValidator" />. We may add these validators any where within
the "Home.page" template. Further details regarding these validator and other
validators can be found in the
- <a href="?page=Controls.Validation">Validation Controls</a> page.
+ <a href="?page=Controls.Validation">Validation Controls</a> page.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code9">
&lt;com:TRequiredFieldValidator
@@ -258,12 +257,12 @@ $this->total->Text = $rate * $dollars;
<ol id="o222" class="block-content">
<li>the user enters a value,</li>
<li>the value is a valid number (not including any currency or dollar signs).</li>
- </ol>
+ </ol>
<p id="777" class="block-content">
To ensure 1 we just add another <tt>TRequiredFieldValidator</tt>, for 2
we could use a
<com:DocLink ClassPath="System.Web.UI.WebControls.TDataTypeValidator" Text="TDataTypeValidator" />. For simplicity we only allow the user to enter
- a number for the amount they wish to convert.
+ a number for the amount they wish to convert.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code9a">
&lt;com:TRequiredFieldValidator
@@ -283,7 +282,7 @@ $this->total->Text = $rate * $dollars;
using both javascript and server side. The server side validation
is <b>always performed</b>. For the server side, we
should skip the calculation if the validators are not satisfied. This can
- done as follows.
+ done as follows.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code10" >
public function convert_clicked($sender, $param)
@@ -310,7 +309,7 @@ public function convert_clicked($sender, $param)
In addition, we can change the "totals" <tt>TLabel</tt> with the
Active Control counter part,
<com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveLabel" Text="TActiveLabel" />, such that the server side can update the browser without
- reloading the page.
+ reloading the page.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code11">
<div class="total-field">
@@ -320,11 +319,11 @@ public function convert_clicked($sender, $param)
<div class="convert-button">
&lt;com:TActiveButton Text="Convert" OnClick="convert_clicked" /&gt;
</div>
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="1232" class="block-content">
The server side logic remains the same, we just need to import the
Active Controls name space as they are not included by default. We
- add the following line to the begin of "Home.php".
+ add the following line to the begin of "Home.php".
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code12">
Prado::using('System.Web.UI.ActiveControls.*');
@@ -342,7 +341,7 @@ Prado::using('System.Web.UI.ActiveControls.*');
<p id="80076" class="block-content">To indicate that the calculation is in progress, we can change the text
of the "total" label as follows. We add a <tt>ClientSide.OnLoading</tt> property
to the "Convert" button (since this button is responsible for requesting
- the calculation).
+ the calculation).
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code13">
&lt;com:TActiveButton Text="Convert" OnClick="convert_clicked" &gt;
@@ -380,7 +379,7 @@ Prado::using('System.Web.UI.ActiveControls.*');
<p id="80080" class="block-content">We simply create a CSS file named "common.css" and save it in the
<tt>themes/Basic</tt> directory. Then we add the following code
- to the beginning of "Home.page" (we add a little more HTML as well).
+ to the beginning of "Home.page" (we add a little more HTML as well).
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code14">
&lt;%@ Theme="Basic" %&gt;
@@ -389,7 +388,7 @@ Prado::using('System.Web.UI.ActiveControls.*');
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
&lt;com:THead Title="Currency Converter" /&gt;
<body>
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="4334" class="block-content">
The first line <tt>&lt;%@ Theme="Basic" %&gt;</tt> defines the
theme to be used for this page. The
diff --git a/demos/quickstart/protected/pages/Tutorial/id/AjaxChat.page b/demos/quickstart/protected/pages/Tutorial/id/AjaxChat.page
index 00222bca..50759868 100755
--- a/demos/quickstart/protected/pages/Tutorial/id/AjaxChat.page
+++ b/demos/quickstart/protected/pages/Tutorial/id/AjaxChat.page
@@ -55,7 +55,6 @@ php prado/framework/prado-cli.php -c chat
class Login extends TPage
{
}
-?&gt;
</com:TTextHighlighter>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code_90029">
<!doctype html public "-//W3C//DTD XHTML 1.0 Strict//EN"
diff --git a/demos/quickstart/protected/pages/Tutorial/id/CurrencyConverter.page b/demos/quickstart/protected/pages/Tutorial/id/CurrencyConverter.page
index d8f8e2b4..c1eae035 100755
--- a/demos/quickstart/protected/pages/Tutorial/id/CurrencyConverter.page
+++ b/demos/quickstart/protected/pages/Tutorial/id/CurrencyConverter.page
@@ -1,8 +1,8 @@
<com:TContent ID="body">
<h1 id="16001">Membangun Pengubah Kurs Sederhana</h1>
<p id="80053" class="block-content">Tutorial ini memperkenalkan kerangka kerja aplikasi web Prado dan mengajarkan Anda bagaimana untuk
- membangun aplikasi web sederhana dalam beberapa langkah sederhana. Tutorial
- ini menganggap bahwa Anda terbiasa dengan PHP dan Anda telah mengakses
+ membangun aplikasi web sederhana dalam beberapa langkah sederhana. Tutorial
+ ini menganggap bahwa Anda terbiasa dengan PHP dan Anda telah mengakses
server web yang dapat melayani naskah PHP5.
</p>
@@ -25,9 +25,9 @@
<p id="80056" class="block-content">Cara tercepat dan termudah untuk membuat aplikasi web Prado baru adalah menggunakan piranti perintah <tt>prado-cli.php</tt> yang ditemukan dalam direktori <tt>framework</tt>
pada distribusi Prado. Kita membuat aplikasi baru dengan menjalankan perintah berikut dalam prompt perintah atau konsol Anda. Perintah membuat direktori baru bernama <tt>currency-converter</tt> dalam direktori kerja Anda saat ini.
Anda perlu mengubahnya ke direktori yang benar terlebih dahulu.
- Lihat <a href="?page=GettingStarted.CommandLine">Piranti Baris Perintah</a>
- untuk lebih jelasnya.
- </p>
+ Lihat <a href="?page=GettingStarted.CommandLine">Piranti Baris Perintah</a>
+ untuk lebih jelasnya.
+ </p>
<com:TTextHighlighter Language="text" CssClass="source block-content" id="code111">
php prado/framework/prado-cli.php -c currency-converter
</com:TTextHighlighter>
@@ -39,7 +39,7 @@ php prado/framework/prado-cli.php -c currency-converter
<h1 id="16003">Membuat Antarmuka Pengguna Pengubah Kurs</h1>
<p id="80058" class="block-content">Kita mulai dengan mengedit file <tt>Home.page</tt> yang ditemukan dalam direktori <tt>currency-converter/protected/pages/</tt>. File yang berakhiran dengan ".page" adalah template halaman yang berisi HTML dan kontrol Prado.
- Kita cukup menambah dua kotak teks, tiga label dan satu tombol seperti berikut.
+ Kita cukup menambah dua kotak teks, tiga label dan satu tombol seperti berikut.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="form1">
&lt;com:TForm&gt;
@@ -62,7 +62,7 @@ php prado/framework/prado-cli.php -c currency-converter
</div>
</fieldset>
&lt;/com:TForm&gt;
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="refresh" class="block-content">
Jika Anda menyegarkan halaman, Anda akan melihat sesuatu mirip dengan gambar berikut.
Ia mungkin terlihat tidak cukup bagus atau berurut, tapi kita akan mengubahnya nanti dengan menggunakan CSS.
@@ -82,7 +82,7 @@ php prado/framework/prado-cli.php -c currency-converter
<com:DocLink ClassPath="System.Web.UI.WebControls.TTextBox" Text="TTextBox" />
yang pada dasarnya mendefinisikan sebuah label dan kotak teks bagi pengguna aplikasi
untuk memasukan nilai pertukaran kurs.
- Nilai properti <tt>ForControl</tt> property menentukan komponen mana label
+ Nilai properti <tt>ForControl</tt> property menentukan komponen mana label
diperuntukan. Ini membolehkan pengguna aplikasi mengklik pada label
untuk memfokuskan pada field (hal yang baik). Anda mungkin telah menggunakan elemen
biasa HTML <tt>&lt;label&gt;</tt> untuk melakukan hal yang sama, tapi
@@ -109,7 +109,7 @@ php prado/framework/prado-cli.php -c currency-converter
<p id="80063" class="block-content">Jika Anda mencoba mengklik pada tombol "Convert" kemudian halaman akan menyegarkan
dan tidak melakukan apapun. Agar tombol melakukan beberapa pekerjaan, kita perlu
menambahkan "Home.php" ke di mana "Home.page" berada. Kelas <tt>Home</tt> harus
- memperluas <com:DocLink ClassPath="System.Web.UI.TPage" Text="TPage" />, basis kelas standar untuk semua halaman Prado.
+ memperluas <com:DocLink ClassPath="System.Web.UI.TPage" Text="TPage" />, basis kelas standar untuk semua halaman Prado.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code3">
&lt;?php
@@ -117,8 +117,7 @@ class Home extends TPage
{
}
-?&gt;
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="1111" class="block-content">
Prado menggunakan metode PHP <tt>__autoload</tt> untuk mengambil kelas. Konvensi
adalah untuk menggunakan nama kelas dengan ekstensi ".php" sebagai nama file.
@@ -134,14 +133,14 @@ class Home extends TPage
nilai dalam kotak teks, melakukan beberapa perhitungan dan menyajikan kepada pengguna dengan
total nilai yang dikonversi. Untuk menangani pengguna mengklik pada tombo "Convert",
kita cukup menambahkan sebuah properti <tt>OnClick</tt> ke tombol "Convert" dalam
- template "Home.page" dan menambahkan metode pengendali event terkait dalam "Home.php".
+ template "Home.page" dan menambahkan metode pengendali event terkait dalam "Home.php".
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code4">
&lt;com:TButton Text="Convert" OnClick="convert_clicked" /&gt;
</com:TTextHighlighter>
- <p id="222" class="block-content">
+ <p id="222" class="block-content">
Nilai dari <tt>OnClick</tt>, "<tt>convert_clicked</tt>", akan menjadi nama metode
- dalam "Home.php" yang akan dipanggil saat pengguna mengklik tombol "Convert".
+ dalam "Home.php" yang akan dipanggil saat pengguna mengklik tombol "Convert".
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code5">
class Home extends TPage
@@ -153,8 +152,8 @@ class Home extends TPage
$this->total->Text = $rate * $dollars;
}
}
-</com:TTextHighlighter>
-<div id="3332" class="block-content">
+</com:TTextHighlighter>
+<div id="3332" class="block-content">
<p id="333">
Jika Anda menjalankan aplikasi dalam web browser Anda, masukkan beberapa nilai
dan klik tombol "Convert" kemudian Anda akan melihat nilai yang dihitung ditampilkan
@@ -168,24 +167,24 @@ class Home extends TPage
</p>
<p id="80067">Sekarang kita akan memeriksa, tiga baris yang mengimplementasikan konversi
- kurs sederhana dalam metode "<tt>convert_clicked</tt>".
- </p>
+ kurs sederhana dalam metode "<tt>convert_clicked</tt>".
+ </p>
</div>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code6" >
$rate = floatval($this->currencyRate->Text);
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="444" class="block-content">
Pernyataan <tt>$this->currencyRate</tt> berhubungan dengan komponen
<tt>TTextBox</tt> dengan nilai <tt>ID</tt> "currencyRate" dalam template
"Home.page". Properti <tt>Text</tt> dari <tt>TTextBox</tt> berisi
nilai yang dimasukan oleh pengguna. Maka kita memperoleh nilai ini dengan
<tt>$this->currencyRate->Text</tt> yang kita konversi nilainya ke nilai
- pecahan.
+ pecahan.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code7">
$dollars = floatval($this->dollars->Text);
-</com:TTextHighlighter>
-<div id="5551" class="block-content">
+</com:TTextHighlighter>
+<div id="5551" class="block-content">
<p id="555">
Baris berikutnya melakukan hal yang mirip, ia mengambil nilai pengguna
dari <tt>TTextBox</tt> dengan nilai <tt>ID</tt> "dollars dang mengubahnya
@@ -194,9 +193,9 @@ $dollars = floatval($this->dollars->Text);
<p id="80068">Baris ketiga menghitung jumlah baru dan menyetel nilai ini dalam properti
<tt>Text</tt> dari <tt>TLabel</tt> dengan <tt>ID="total"</tt>.
- Selanjutnya, kita tampilkan jumlah baru ke pengguna dalam label.
+ Selanjutnya, kita tampilkan jumlah baru ke pengguna dalam label.
</p>
-</div>
+</div>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code8">
$this->total->Text = $rate * $dollars;
</com:TTextHighlighter>
@@ -210,11 +209,11 @@ $this->total->Text = $rate * $dollars;
<li>pengguna memasukan sebuah nilai,</li>
<li>kurs mata uang adalah angka yang benar,</li>
<li>kurs mata uang adalah positif.</li>
- </ol>
+ </ol>
<p id="666" class="block-content">
Untuk memastikan poin 1 kita menambahkan satu
<com:DocLink ClassPath="System.Web.UI.WebControls.TRequiredFieldValidator" Text="TRequiredFieldValidator" />. Untuk memastikan poin 2 dan 3, kita menambahkan satu <com:DocLink ClassPath="System.Web.UI.WebControls.TCompareValidator" Text="TCompareValidator" />. Kita dapat menambahkan validator ini di mana saja di dalam template "Home.page". Perincian selanjutnya mengenai validator ini dan validator lainnya dapat ditemukan dalam halaman
- <a href="?page=Controls.Validation">Validation Controls</a>.
+ <a href="?page=Controls.Validation">Validation Controls</a>.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code9">
&lt;com:TRequiredFieldValidator
@@ -232,11 +231,11 @@ $this->total->Text = $rate * $dollars;
<ol id="o222" class="block-content">
<li>pengguna memasukan sebuah nilai,</li>
<li>nilai adalah angka yang benar (tidak menyertakan tanda kurs atau dolar).</li>
- </ol>
+ </ol>
<p id="777" class="block-content">
Untuk memastikan 1 kita cukup menambahkan <tt>TRequiredFieldValidator</tt> lainnya, untuk 2
kita dapat menggunakan
- <com:DocLink ClassPath="System.Web.UI.WebControls.TDataTypeValidator" Text="TDataTypeValidator" />. Untuk memudahkan kita hanya membolehkan pengguna untuk memasukan sebuah angka untuk jumlah yang ingin mereka ubah.
+ <com:DocLink ClassPath="System.Web.UI.WebControls.TDataTypeValidator" Text="TDataTypeValidator" />. Untuk memudahkan kita hanya membolehkan pengguna untuk memasukan sebuah angka untuk jumlah yang ingin mereka ubah.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code9a">
&lt;com:TRequiredFieldValidator
@@ -249,8 +248,8 @@ $this->total->Text = $rate * $dollars;
</com:TTextHighlighter>
</p>
- <p id="80072" class="block-content">Sekarang jika Anda mencoba memasukan beberapa data tidak benar dalam aplikasi atau membiarkan field kosong
- validators akan diaktifkan dan menyajikan pesan kesalahan kepada pengguna. Catatan bahwa pesan kesalahan disajikan tanpa mengambil ulang halaman. Validator Prado standarnya memvalidasi javascript dan di dalam server. Validasi di dalam server <b>selalu dilakukan</b>. Untuk sisi server, kita harus melewati perhitungan jika validator tidak memuaskan. Ini dapat dilakukan seperti berikut.
+ <p id="80072" class="block-content">Sekarang jika Anda mencoba memasukan beberapa data tidak benar dalam aplikasi atau membiarkan field kosong
+ validators akan diaktifkan dan menyajikan pesan kesalahan kepada pengguna. Catatan bahwa pesan kesalahan disajikan tanpa mengambil ulang halaman. Validator Prado standarnya memvalidasi javascript dan di dalam server. Validasi di dalam server <b>selalu dilakukan</b>. Untuk sisi server, kita harus melewati perhitungan jika validator tidak memuaskan. Ini dapat dilakukan seperti berikut.
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code10" >
public function convert_clicked($sender, $param)
@@ -276,7 +275,7 @@ memperbaiki pengalaman pengguna dengan meningkatkan tanggapan aplikasi. Satu car
<com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveButton" Text="TActiveButton" />,
yang dapat memicu event klik di dalam server tanpa mengambil ulang halaman.
Sebagai tambahan, kita dapat mengubah "total" <tt>TLabel</tt> dengan pasangan Kontrol Aktif,
- <com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveLabel" Text="TActiveLabel" />, dengan demikian di dalam server dapat memutakhirkan browser tanpa mengambil ulang halaman.
+ <com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveLabel" Text="TActiveLabel" />, dengan demikian di dalam server dapat memutakhirkan browser tanpa mengambil ulang halaman.
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code11">
<div class="total-field">
@@ -286,10 +285,10 @@ memperbaiki pengalaman pengguna dengan meningkatkan tanggapan aplikasi. Satu car
<div class="convert-button">
&lt;com:TActiveButton Text="Convert" OnClick="convert_clicked" /&gt;
</div>
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="1232" class="block-content">
Logika di dalam server tetap sama, kita hanya perlu mengimpor
- ruang nama Kontrol Aktif karena secara standar tidak disertakan. Kita menambahkan baris berikut ke awal "Home.php".
+ ruang nama Kontrol Aktif karena secara standar tidak disertakan. Kita menambahkan baris berikut ke awal "Home.php".
</p>
<com:TTextHighlighter Language="php" CssClass="source block-content" id="code12">
Prado::using('System.Web.UI.ActiveControls.*');
@@ -300,7 +299,7 @@ Prado::using('System.Web.UI.ActiveControls.*');
Selanjutnya kita bisa memperbaiki pengalaman pengguna dengan mengunah label teks "total" menjadi "calculating..." saat pengguna mengklik tombol "Convert". Label teks "total" masih dimutakhirkan dengan jumlah perhitungan baru seperti sebelumnya.
</p>
- <p id="80076" class="block-content">Untuk mengindikasikan bahwa perhitungan sedang berlangsung, kita dapat mengubah label teks "total" sebagai berikut. Kita menambahkan properti <tt>ClientSide.OnLoading</tt> ke tombol "Convert" (karena tombol ini bertanggung jawab terhadap permintaan perhitungan).
+ <p id="80076" class="block-content">Untuk mengindikasikan bahwa perhitungan sedang berlangsung, kita dapat mengubah label teks "total" sebagai berikut. Kita menambahkan properti <tt>ClientSide.OnLoading</tt> ke tombol "Convert" (karena tombol ini bertanggung jawab terhadap permintaan perhitungan).
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code13">
&lt;com:TActiveButton Text="Convert" OnClick="convert_clicked" &gt;
@@ -325,7 +324,7 @@ Prado::using('System.Web.UI.ActiveControls.*');
</p>
<p id="80080" class="block-content">Kita cukup dengan membuat file CSS bernama "common.css" dan menyimpannya dalam direktori
- <tt>themes/Basic</tt>. Kemudian kita menambahkan kode berikut ke awal "Home.page" (kita menambahkan sedikit kode HTML juga).
+ <tt>themes/Basic</tt>. Kemudian kita menambahkan kode berikut ke awal "Home.page" (kita menambahkan sedikit kode HTML juga).
</p>
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code14">
&lt;%@ Theme="Basic" %&gt;
@@ -334,10 +333,10 @@ Prado::using('System.Web.UI.ActiveControls.*');
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
&lt;com:THead Title="Currency Converter" /&gt;
<body>
-</com:TTextHighlighter>
+</com:TTextHighlighter>
<p id="4334" class="block-content">
Baris pertama <tt>&lt;%@ Theme="Basic" %&gt;</tt> mendefinisikan tema
- yang dipakai untuk halaman ini.
+ yang dipakai untuk halaman ini.
<com:DocLink ClassPath="System.Web.UI.WebControls.THead" Text="THead" />
merujuk ke elemen HTML <tt>&lt;head&gt;</tt>. Sebagai tambahan terhadap
tampilan properti <tt>Title</tt> pada <tt>THead</tt>, semua file CSS
diff --git a/demos/sqlmap/protected/pages/Manual/Tutorial/TestFirst.page b/demos/sqlmap/protected/pages/Manual/Tutorial/TestFirst.page
index 80a155cb..55d55c31 100755
--- a/demos/sqlmap/protected/pages/Manual/Tutorial/TestFirst.page
+++ b/demos/sqlmap/protected/pages/Manual/Tutorial/TestFirst.page
@@ -46,7 +46,6 @@ class PersonTest extends UnitTestCase
$this->assertNotNull($person, "Person not returned");
}
}
-?&gt;
</com:TTextHighlighter>
<p>Well, the example sure looks easy enough! We ask a method to "select all", and
@@ -54,7 +53,7 @@ it returns a list of person objects. But, what code do we need to write to
pass this test?</p>
<div class="note"><b class="tip">Note:</b>
- Save the <tt>PersonTest.php</tt> into a <tt>tests</tt> directory.
+ Save the <tt>PersonTest.php</tt> into a <tt>tests</tt> directory.
The unit tests are written for the <a href="http://simpletest.sf.net">SimpleTest Unit Testing framework</a>.
</div>
@@ -74,7 +73,6 @@ error_reporting(E_ALL);
$test = new GroupTest('All tests');
$test->addTestFile('Tests/PersonTest.php'); $test->run(new HtmlReporter());
-?&gt;
</com:TTextHighlighter>
<p>To run the tests, point your browser to the "<tt>run_test.php</tt>" script file
@@ -108,7 +106,6 @@ class Person
$this->_birthDate = $value;
}
}
-?&gt;
</com:TTextHighlighter>
<p>OK, that was fun! The <tt>$this->assertXXX(...)</tt> methods are built into
@@ -125,7 +122,7 @@ method executes our SQL statement (or stored procedure) and returns the result
as a list. Each row in the result becomes an entry in the list. Along with
<tt>queryForList()</tt>, there are also <tt>delete()</tt>, <tt>insert()</tt>,
<tt>queryForObject()</tt>, <tt>queryForPagedList()</tt> and a few other methods in the
-<a href="?page=Manual.DataMapperAPI">SQLMap API</a>.
+<a href="?page=Manual.DataMapperAPI">SQLMap API</a>.
<p>Looking at unit test example, we see that the <tt>queryForList()</tt> method
takes the name of the statement we want to run. OK. Easy enough. But where
diff --git a/demos/sqlmap/protected/pages/Manual/Tutorial/TestSecond.page b/demos/sqlmap/protected/pages/Manual/Tutorial/TestSecond.page
index 706b5220..b128c413 100755
--- a/demos/sqlmap/protected/pages/Manual/Tutorial/TestSecond.page
+++ b/demos/sqlmap/protected/pages/Manual/Tutorial/TestSecond.page
@@ -58,7 +58,6 @@ error_reporting(E_ALL);
require_once('/path/to/prado/framework/prado.php');
$application=new TApplication;
$application->run();
-?>
</com:TTextHighlighter>
<p>Now we are ready to setup a page to display our list of people.
@@ -106,7 +105,6 @@ class Home extends TPage
$this->loadData();
}
}
-?&gt;
</com:TTextHighlighter>
<p>If we run this now, we'll get a list like the one shown the figure below.</p>
diff --git a/demos/time-tracker/protected/App_Code/Dao/BaseDao.php b/demos/time-tracker/protected/App_Code/Dao/BaseDao.php
index b37fb5df..571a9d1a 100755
--- a/demos/time-tracker/protected/App_Code/Dao/BaseDao.php
+++ b/demos/time-tracker/protected/App_Code/Dao/BaseDao.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: BaseDao.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -14,7 +13,6 @@
* Base DAO class.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: BaseDao.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
diff --git a/demos/time-tracker/protected/App_Code/Dao/ProjectDao.php b/demos/time-tracker/protected/App_Code/Dao/ProjectDao.php
index dbaf0e80..0110ae5e 100755
--- a/demos/time-tracker/protected/App_Code/Dao/ProjectDao.php
+++ b/demos/time-tracker/protected/App_Code/Dao/ProjectDao.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: ProjectDao.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -14,7 +13,6 @@
* Project DAO class.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: ProjectDao.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
diff --git a/demos/time-tracker/protected/App_Code/Dao/ProjectRecord.php b/demos/time-tracker/protected/App_Code/Dao/ProjectRecord.php
index 631b1f8c..c02a78a5 100755
--- a/demos/time-tracker/protected/App_Code/Dao/ProjectRecord.php
+++ b/demos/time-tracker/protected/App_Code/Dao/ProjectRecord.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: ProjectRecord.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -14,7 +13,6 @@
* Time Tracker Project class.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: ProjectRecord.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
diff --git a/demos/time-tracker/protected/App_Code/Dao/UserDao.php b/demos/time-tracker/protected/App_Code/Dao/UserDao.php
index 495da072..51d04c58 100755
--- a/demos/time-tracker/protected/App_Code/Dao/UserDao.php
+++ b/demos/time-tracker/protected/App_Code/Dao/UserDao.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: UserDao.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -17,7 +16,6 @@
* this token can be used to perform persistent cookie login.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: UserDao.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
diff --git a/demos/time-tracker/protected/App_Code/DaoManager.php b/demos/time-tracker/protected/App_Code/DaoManager.php
index 9602ced0..90655ac8 100755
--- a/demos/time-tracker/protected/App_Code/DaoManager.php
+++ b/demos/time-tracker/protected/App_Code/DaoManager.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: DaoManager.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -18,7 +17,6 @@ Prado::using('System.Data.SqlMap.TSqlMapConfig');
* A Registry for Dao and an implementation of that type.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: DaoManager.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
diff --git a/demos/time-tracker/protected/App_Code/TimeTrackerException.php b/demos/time-tracker/protected/App_Code/TimeTrackerException.php
index 424c7d30..87398952 100755
--- a/demos/time-tracker/protected/App_Code/TimeTrackerException.php
+++ b/demos/time-tracker/protected/App_Code/TimeTrackerException.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TimeTrackerException.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -15,7 +14,6 @@
* "exceptions.txt"
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TimeTrackerException.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
@@ -27,6 +25,6 @@ class TimeTrackerException extends TException
protected function getErrorMessageFile()
{
return dirname(__FILE__).'/exceptions.txt';
- }
+ }
}
diff --git a/demos/time-tracker/protected/App_Code/TimeTrackerUser.php b/demos/time-tracker/protected/App_Code/TimeTrackerUser.php
index da98e786..5215b31c 100755
--- a/demos/time-tracker/protected/App_Code/TimeTrackerUser.php
+++ b/demos/time-tracker/protected/App_Code/TimeTrackerUser.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TimeTrackerUser.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -20,14 +19,13 @@ Prado::using('System.Security.TUserManager');
* User class for Time Tracker application.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TimeTrackerUser.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
class TimeTrackerUser extends TUser
{
private $_emailAddress;
-
+
/**
* @param string user email address
*/
@@ -35,7 +33,7 @@ class TimeTrackerUser extends TUser
{
$this->_emailAddress = $value;
}
-
+
/**
* @return string user email address
*/
diff --git a/demos/time-tracker/protected/App_Code/TrackerAuthManager.php b/demos/time-tracker/protected/App_Code/TrackerAuthManager.php
index 48962167..08daae3f 100755
--- a/demos/time-tracker/protected/App_Code/TrackerAuthManager.php
+++ b/demos/time-tracker/protected/App_Code/TrackerAuthManager.php
@@ -4,7 +4,6 @@
* a string token saved in the cookie.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TrackerAuthManager.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
@@ -14,24 +13,24 @@ class TrackerAuthManager extends TAuthManager
* @const string signon token cookie name.
*/
const SignonCookieName = 'time-tracker-signon';
-
+
/**
* Performs the real authentication work. Overrides and calls parent
- * implementation. Trys to authenticate using token saved in cookie.
+ * implementation. Trys to authenticate using token saved in cookie.
* @param mixed parameter to be passed to OnAuthenticate event
*/
public function onAuthenticate($param)
{
parent::onAuthenticate($param);
- $currentUser = $this->Application->User;
+ $currentUser = $this->Application->User;
if(!$currentUser || $currentUser->IsGuest)
$this->authenticateFromCookie($param);
}
-
+
/**
* If the user is not set or is still a guest, try to authenticate the user
* using a string token saved in the cookie if any.
- * @param mixed parameter to be passed to OnAuthenticate event
+ * @param mixed parameter to be passed to OnAuthenticate event
*/
protected function authenticateFromCookie($param)
{
@@ -45,7 +44,7 @@ class TrackerAuthManager extends TAuthManager
$this->updateCredential($user);
}
}
-
+
/**
* Changes the user credentials.
* @param TUser new user details.
@@ -54,9 +53,9 @@ class TrackerAuthManager extends TAuthManager
{
$user->IsGuest = false;
$this->updateSessionUser($user);
- $this->Application->User = $user;
+ $this->Application->User = $user;
}
-
+
/**
* Generate a token to be saved in the cookie for later authentication.
* @param TimeTrackerUser user details.
@@ -70,7 +69,7 @@ class TrackerAuthManager extends TAuthManager
$cookie->Expire = strtotime('+1 month');
$this->Response->Cookies[] = $cookie;
}
-
+
/**
* Logs out the user and delete the token from cookie.
*/
diff --git a/demos/time-tracker/protected/App_Code/UserManager.php b/demos/time-tracker/protected/App_Code/UserManager.php
index 20b34d47..eabbe315 100755
--- a/demos/time-tracker/protected/App_Code/UserManager.php
+++ b/demos/time-tracker/protected/App_Code/UserManager.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: UserManager.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -14,7 +13,6 @@
* User manager module class for time tracker application.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: UserManager.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
diff --git a/demos/time-tracker/protected/App_Data/TimeTrackerUserTypeHandler.php b/demos/time-tracker/protected/App_Data/TimeTrackerUserTypeHandler.php
index 3a67afb0..12a8a23e 100755
--- a/demos/time-tracker/protected/App_Data/TimeTrackerUserTypeHandler.php
+++ b/demos/time-tracker/protected/App_Data/TimeTrackerUserTypeHandler.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TimeTrackerUserTypeHandler.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -15,7 +14,6 @@
* The TimeTrackerUser requires an instance of IUserManager in constructor.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TimeTrackerUserTypeHandler.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
diff --git a/demos/time-tracker/protected/pages/TimeTracker/Login.php b/demos/time-tracker/protected/pages/TimeTracker/Login.php
index 941cb4b7..8de63ad8 100755
--- a/demos/time-tracker/protected/pages/TimeTracker/Login.php
+++ b/demos/time-tracker/protected/pages/TimeTracker/Login.php
@@ -6,18 +6,16 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: Login.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
/**
* Login page class.
- *
- * Validate the user credentials and redirect to requested page
+ *
+ * Validate the user credentials and redirect to requested page
* if successful.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: Login.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
@@ -26,7 +24,7 @@ class Login extends TPage
/**
* Validates the username and password.
* @param TControl custom validator that created the event.
- * @param TServerValidateEventParameter validation parameters.
+ * @param TServerValidateEventParameter validation parameters.
*/
public function validateUser($sender, $param)
{
@@ -34,7 +32,7 @@ class Login extends TPage
if(!$authManager->login($this->username->Text,$this->password->Text))
$param->IsValid=false;;
}
-
+
/**
* Redirect to the requested page if login is successful.
* @param TControl button control that created the event.
diff --git a/demos/time-tracker/protected/pages/TimeTracker/Logout.php b/demos/time-tracker/protected/pages/TimeTracker/Logout.php
index 9f4de556..bab924f2 100755
--- a/demos/time-tracker/protected/pages/TimeTracker/Logout.php
+++ b/demos/time-tracker/protected/pages/TimeTracker/Logout.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: Logout.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -14,7 +13,6 @@
* Logout page class.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: Logout.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
@@ -27,7 +25,7 @@ class Logout extends TPage
{
$this->Application->getModule('auth')->logout();
$url = $this->Service->constructUrl($this->Service->DefaultPage);
- $this->Response->redirect($url);
+ $this->Response->redirect($url);
}
}
diff --git a/demos/time-tracker/protected/pages/TimeTracker/SiteMap.php b/demos/time-tracker/protected/pages/TimeTracker/SiteMap.php
index 51df0583..ab612baf 100755
--- a/demos/time-tracker/protected/pages/TimeTracker/SiteMap.php
+++ b/demos/time-tracker/protected/pages/TimeTracker/SiteMap.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: SiteMap.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -14,7 +13,6 @@
* SiteMap menu is rendered depending on user roles.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: SiteMap.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
@@ -26,7 +24,7 @@ class SiteMap extends TTemplateControl
public function onPreRender($param)
{
parent::onPreRender($param);
-
+
$page = explode('.',$this->Request->ServiceParameter);
$active = null;
switch($page[count($page)-1])
@@ -47,7 +45,7 @@ class SiteMap extends TTemplateControl
$active = $this->LogMenu;
break;
}
-
+
//add 'active' string to place holder body.
if(!is_null($active))
$active->Controls[] = 'active';
diff --git a/demos/time-tracker/protected/pages/TimeTracker/UserCreate.php b/demos/time-tracker/protected/pages/TimeTracker/UserCreate.php
index 2c73752a..34e69713 100755
--- a/demos/time-tracker/protected/pages/TimeTracker/UserCreate.php
+++ b/demos/time-tracker/protected/pages/TimeTracker/UserCreate.php
@@ -6,18 +6,16 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: UserCreate.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
/**
* Create new user wizard page class. Validate that the usernames are unique and
* set the new user credentials as the current application credentials.
- *
+ *
* If logged in as admin, the user role can be change during creation.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: UserCreate.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
@@ -30,11 +28,11 @@ class UserCreate extends TPage
{
if(!$this->IsPostBack)
{
- $this->role->SelectedValue =
+ $this->role->SelectedValue =
$this->Application->Parameters['NewUserRoles'];
}
}
-
+
/**
* Verify that the username is not taken.
* @param TControl custom validator that created the event.
@@ -46,11 +44,11 @@ class UserCreate extends TPage
if($userDao->usernameExists($this->username->Text))
{
$param->IsValid = false;
- $sender->ErrorMessage =
+ $sender->ErrorMessage =
"The user name is already taken, try '{$this->username->Text}01'";
}
}
-
+
/**
* Skip the role assignment step if not admin.
*/
@@ -66,7 +64,7 @@ class UserCreate extends TPage
}
}
}
-
+
/**
* Create a new user if all data entered are valid.
* The default user roles are obtained from "config.xml". The new user
@@ -84,11 +82,11 @@ class UserCreate extends TPage
$newUser->Name = $this->username->Text;
$newUser->IsGuest = false;
$newUser->Roles = $this->role->SelectedValue;
-
+
//save the user
$userDao = $this->Application->Modules['daos']->getDao('UserDao');
$userDao->addNewUser($newUser, $this->password->Text);
-
+
//update the user credentials if not admin
if(!$this->User->isInRole('admin'))
{
@@ -97,7 +95,7 @@ class UserCreate extends TPage
}
}
}
-
+
/**
* Continue with requested page.
*/
diff --git a/demos/time-tracker/protected/pages/TimeTracker/UserList.php b/demos/time-tracker/protected/pages/TimeTracker/UserList.php
index 9dc3ab5f..71b41add 100755
--- a/demos/time-tracker/protected/pages/TimeTracker/UserList.php
+++ b/demos/time-tracker/protected/pages/TimeTracker/UserList.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: UserList.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -14,7 +13,6 @@
* List all users in a repeater.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: UserList.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
@@ -27,7 +25,7 @@ class UserList extends TPage
{
$userDao = $this->Application->Modules['daos']->getDao('UserDao');
$this->list->DataSource = $userDao->getAllUsers();
- $this->list->dataBind();
+ $this->list->dataBind();
}
}
diff --git a/editors/NotepadPlus/4.x/prado.api b/editors/NotepadPlus/4.x/prado.api
index 6a990ba4..b73c9a92 100644
--- a/editors/NotepadPlus/4.x/prado.api
+++ b/editors/NotepadPlus/4.x/prado.api
@@ -719,7 +719,6 @@ PostBackOptions
PostBackParameter
PostBackTarget
PostBackValue
-PostDataLoaders
PostState
Prado::autoload
Prado::createComponent
@@ -1326,7 +1325,6 @@ addMappedStatement
addNode
addParameterMap
addParsedObject
-addPostDataLoader
addProperty
addResultMap
addResultMapGroupBy
@@ -1336,7 +1334,6 @@ addStatesToTrack
addStyleAttribute
addStyleAttributes
addSubMap
-addToPostDataLoader
addValue
addedControl
addedWizardStep
@@ -2186,7 +2183,6 @@ registerHiddenField
registerJavascriptPackages
registerObject
registerPostBackControl
-registerPostDataLoader
registerPradoScript
registerRequiresPostData
registerScriptFile
@@ -2216,7 +2212,6 @@ renderCalendarMonthOptions
renderCalendarSelections
renderCalendarYearOptions
renderCallback
-renderCallbackClientScripts
renderCallbackResponse
renderChildren
renderClientControlScript
diff --git a/framework/3rdParty/Markdown/License.text b/framework/3rdParty/Markdown/License.text
deleted file mode 100644
index ea6a6a1a..00000000
--- a/framework/3rdParty/Markdown/License.text
+++ /dev/null
@@ -1,34 +0,0 @@
-Copyright (c) 2004-2005, John Gruber
-<http://daringfireball.net/>
-All rights reserved.
-
-Copyright (c) 2004-2005, Michel Fortin
-<http://www.michelf.com/>
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-* Neither the name "Markdown" nor the names of its contributors may
- be used to endorse or promote products derived from this software
- without specific prior written permission.
-
-This software is provided by the copyright holders and contributors "as
-is" and any express or implied warranties, including, but not limited
-to, the implied warranties of merchantability and fitness for a
-particular purpose are disclaimed. In no event shall the copyright owner
-or contributors be liable for any direct, indirect, incidental, special,
-exemplary, or consequential damages (including, but not limited to,
-procurement of substitute goods or services; loss of use, data, or
-profits; or business interruption) however caused and on any theory of
-liability, whether in contract, strict liability, or tort (including
-negligence or otherwise) arising in any way out of the use of this
-software, even if advised of the possibility of such damage.
diff --git a/framework/3rdParty/Markdown/MarkdownParser.php b/framework/3rdParty/Markdown/MarkdownParser.php
deleted file mode 100644
index b581dcb5..00000000
--- a/framework/3rdParty/Markdown/MarkdownParser.php
+++ /dev/null
@@ -1,1256 +0,0 @@
-<?php
-
-#
-# Markdown - A text-to-HTML conversion tool for web writers
-#
-# Copyright (c) 2004-2005 John Gruber
-# <http://daringfireball.net/projects/markdown/>
-#
-# Copyright (c) 2004-2005 Michel Fortin - PHP Port
-# <http://www.michelf.com/projects/php-markdown/>
-#
-
-/**
- * PHP5 version of the markdown parser.
- * Usage:
- * <code>
- * $markdown = new MarkdownParser;
- * echo $markdown->parse($text);
- * </code>
- */
-class MarkdownParser
-{
- private static $md_nested_brackets;
- private static $md_escape_table = array();
- private static $md_backslash_escape_table = array();
- private static $md_nested_brackets_depth = 6;
-
- protected $md_empty_element_suffix = " />"; # Change to ">" for HTML output
- protected $md_tab_width = 4;
-
- private $md_list_level = 0;
- private $md_urls = array();
- private $md_titles = array();
- private $md_html_blocks = array();
-
- public function __construct()
- {
- if(is_null(self::$md_nested_brackets))
- $this->initialize();
- }
-
- private function initialize()
- {
- self::$md_nested_brackets =
- str_repeat('(?>[^\[\]]+|\[', self::$md_nested_brackets_depth).
- str_repeat('\])*', self::$md_nested_brackets_depth);
-
- self::$md_escape_table = array(
- "\\" => md5("\\"),
- "`" => md5("`"),
- "*" => md5("*"),
- "_" => md5("_"),
- "{" => md5("{"),
- "}" => md5("}"),
- "[" => md5("["),
- "]" => md5("]"),
- "(" => md5("("),
- ")" => md5(")"),
- ">" => md5(">"),
- "#" => md5("#"),
- "+" => md5("+"),
- "-" => md5("-"),
- "." => md5("."),
- "!" => md5("!")
- );
-
- # Table of hash values for escaped characters:
- # Create an identical table but for escaped characters.
- foreach (self::$md_escape_table as $key => $char)
- self::$md_backslash_escape_table["\\$key"] = $char;
- }
-
- public function parse($text)
- {
- #
- # Main function. The order in which other subs are called here is
- # essential. Link and image substitutions need to happen before
- # _EscapeSpecialCharsWithinTagAttributes(), so that any *'s or _'s in the <a>
- # and <img> tags get encoded.
- #
- # Clear the hashes. If we don't clear these, you get conflicts
- # from other articles when generating a page which contains more than
- # one article (e.g. an index page that shows the N most recent
- # articles):
- $this->md_urls = array();
- $this->md_titles = array();
- $this->md_html_blocks = array();
-
- # Standardize line endings:
- # DOS to Unix and Mac to Unix
- $text = str_replace(array("\r\n", "\r"), "\n", $text);
-
- # Make sure $text ends with a couple of newlines:
- $text .= "\n\n";
-
- # Convert all tabs to spaces.
- $text = $this->_Detab($text);
-
- # Strip any lines consisting only of spaces and tabs.
- # This makes subsequent regexen easier to write, because we can
- # match consecutive blank lines with /\n+/ instead of something
- # contorted like /[ \t]*\n+/ .
- $text = preg_replace('/^[ \t]+$/m', '', $text);
-
- # Turn block-level HTML blocks into hash entries
- $text = $this->_HashHTMLBlocks($text);
-
- # Strip link definitions, store in hashes.
- $text = $this->_StripLinkDefinitions($text);
-
- $text = $this->_RunBlockGamut($text);
-
- $text = $this->_UnescapeSpecialChars($text);
-
- return $text . "\n";
- }
-
-
- private function _StripLinkDefinitions($text) {
- #
- # Strips link definitions from text, stores the URLs and titles in
- # hash references.
- #
- $less_than_tab = $this->md_tab_width - 1;
-
- # Link defs are in the form: ^[id]: url "optional title"
- $text = preg_replace_callback('{
- ^[ ]{0,'.$less_than_tab.'}\[(.+)\]: # id = $1
- [ \t]*
- \n? # maybe *one* newline
- [ \t]*
- <?(\S+?)>? # url = $2
- [ \t]*
- \n? # maybe one newline
- [ \t]*
- (?:
- (?<=\s) # lookbehind for whitespace
- ["(]
- (.+?) # title = $3
- [")]
- [ \t]*
- )? # title is optional
- (?:\n+|\Z)
- }xm',
- array($this,'_StripLinkDefinitions_callback'),
- $text);
- return $text;
- }
-
- private function _StripLinkDefinitions_callback($matches) {
- $link_id = strtolower($matches[1]);
- $this->md_urls[$link_id] = $this->_EncodeAmpsAndAngles($matches[2]);
- if (isset($matches[3]))
- $this->md_titles[$link_id] = str_replace('"', '&quot;', $matches[3]);
- return ''; # String that will replace the block
- }
-
-
- private function _HashHTMLBlocks($text) {
- $less_than_tab = $this->md_tab_width - 1;
-
- # Hashify HTML blocks:
- # We only want to do this for block-level HTML tags, such as headers,
- # lists, and tables. That's because we still want to wrap <p>s around
- # "paragraphs" that are wrapped in non-block-level tags, such as anchors,
- # phrase emphasis, and spans. The list of tags we're looking for is
- # hard-coded:
- $block_tags_a = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|'.
- 'script|noscript|form|fieldset|iframe|math|ins|del';
- $block_tags_b = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|'.
- 'script|noscript|form|fieldset|iframe|math';
-
- # First, look for nested blocks, e.g.:
- # <div>
- # <div>
- # tags for inner block must be indented.
- # </div>
- # </div>
- #
- # The outermost tags must start at the left margin for this to match, and
- # the inner nested divs must be indented.
- # We need to do this before the next, more liberal match, because the next
- # match will start at the first `<div>` and stop at the first `</div>`.
- $text = preg_replace_callback("{
- ( # save in $1
- ^ # start of line (with /m)
- <($block_tags_a) # start tag = $2
- \\b # word break
- (.*\\n)*? # any number of lines, minimally matching
- </\\2> # the matching end tag
- [ \\t]* # trailing spaces/tabs
- (?=\\n+|\\Z) # followed by a newline or end of document
- )
- }xm",
- array($this,'_HashHTMLBlocks_callback'),
- $text);
-
- #
- # Now match more liberally, simply from `\n<tag>` to `</tag>\n`
- #
- $text = preg_replace_callback("{
- ( # save in $1
- ^ # start of line (with /m)
- <($block_tags_b) # start tag = $2
- \\b # word break
- (.*\\n)*? # any number of lines, minimally matching
- .*</\\2> # the matching end tag
- [ \\t]* # trailing spaces/tabs
- (?=\\n+|\\Z) # followed by a newline or end of document
- )
- }xm",
- array($this,'_HashHTMLBlocks_callback'),
- $text);
-
- # Special case just for <hr />. It was easier to make a special case than
- # to make the other regex more complicated.
- $text = preg_replace_callback('{
- (?:
- (?<=\n\n) # Starting after a blank line
- | # or
- \A\n? # the beginning of the doc
- )
- ( # save in $1
- [ ]{0,'.$less_than_tab.'}
- <(hr) # start tag = $2
- \b # word break
- ([^<>])*? #
- /?> # the matching end tag
- [ \t]*
- (?=\n{2,}|\Z) # followed by a blank line or end of document
- )
- }x',
- array($this,'_HashHTMLBlocks_callback'),
- $text);
-
- # Special case for standalone HTML comments:
- $text = preg_replace_callback('{
- (?:
- (?<=\n\n) # Starting after a blank line
- | # or
- \A\n? # the beginning of the doc
- )
- ( # save in $1
- [ ]{0,'.$less_than_tab.'}
- (?s:
- <!
- (--.*?--\s*)+
- >
- )
- [ \t]*
- (?=\n{2,}|\Z) # followed by a blank line or end of document
- )
- }x',
- array($this,'_HashHTMLBlocks_callback'),
- $text);
-
- return $text;
- }
- private function _HashHTMLBlocks_callback($matches) {
- $text = $matches[1];
- $key = md5($text);
- $this->md_html_blocks[$key] = $text;
- return "\n\n$key\n\n"; # String that will replace the block
- }
-
-
- private function _RunBlockGamut($text) {
- #
- # These are all the transformations that form block-level
- # tags like paragraphs, headers, and list items.
- #
- $text = $this->_DoHeaders($text);
-
- # Do Horizontal Rules:
- $text = preg_replace(
- array('{^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$}mx',
- '{^[ ]{0,2}([ ]? -[ ]?){3,}[ \t]*$}mx',
- '{^[ ]{0,2}([ ]? _[ ]?){3,}[ \t]*$}mx'),
- "\n<hr{$this->md_empty_element_suffix}\n",
- $text);
-
- $text = $this->_DoLists($text);
- $text = $this->_DoCodeBlocks($text);
- $text = $this->_DoBlockQuotes($text);
-
- # We already ran _HashHTMLBlocks() before, in Markdown(), but that
- # was to escape raw HTML in the original Markdown source. This time,
- # we're escaping the markup we've just created, so that we don't wrap
- # <p> tags around block-level tags.
- $text = $this->_HashHTMLBlocks($text);
- $text = $this->_FormParagraphs($text);
-
- return $text;
- }
-
-
- private function _RunSpanGamut($text) {
- #
- # These are all the transformations that occur *within* block-level
- # tags like paragraphs, headers, and list items.
- #
-
- $text = $this->_DoCodeSpans($text);
-
- $text = $this->_EscapeSpecialChars($text);
-
- # Process anchor and image tags. Images must come first,
- # because ![foo][f] looks like an anchor.
- $text = $this->_DoImages($text);
- $text = $this->_DoAnchors($text);
-
- # Make links out of things like `<http://example.com/>`
- # Must come after _DoAnchors(), because you can use < and >
- # delimiters in inline links like [this](<url>).
- $text = $this->_DoAutoLinks($text);
- $text = $this->_EncodeAmpsAndAngles($text);
- $text = $this->_DoItalicsAndBold($text);
-
- # Do hard breaks:
- $text = preg_replace('/ {2,}\n/', "<br{$this->md_empty_element_suffix}\n", $text);
-
- return $text;
- }
-
-
- private function _EscapeSpecialChars($text) {
- $tokens = $this->_TokenizeHTML($text);
-
- $text = ''; # rebuild $text from the tokens
- # $in_pre = 0; # Keep track of when we're inside <pre> or <code> tags.
- # $tags_to_skip = "!<(/?)(?:pre|code|kbd|script|math)[\s>]!";
-
- foreach ($tokens as $cur_token) {
- if ($cur_token[0] == 'tag') {
- # Within tags, encode * and _ so they don't conflict
- # with their use in Markdown for italics and strong.
- # We're replacing each such character with its
- # corresponding MD5 checksum value; this is likely
- # overkill, but it should prevent us from colliding
- # with the escape values by accident.
- $cur_token[1] = str_replace(array('*', '_'),
- array(self::$md_escape_table['*'], self::$md_escape_table['_']),
- $cur_token[1]);
- $text .= $cur_token[1];
- } else {
- $t = $cur_token[1];
- $t = $this->_EncodeBackslashEscapes($t);
- $text .= $t;
- }
- }
- return $text;
- }
-
-
- private function _DoAnchors($text) {
- #
- # Turn Markdown link shortcuts into XHTML <a> tags.
- #
- #
- # First, handle reference-style links: [link text] [id]
- #
- $bracket = self::$md_nested_brackets;
- $text = preg_replace_callback("{
- ( # wrap whole match in $1
- \\[
- ({$bracket}) # link text = $2
- \\]
-
- [ ]? # one optional space
- (?:\\n[ ]*)? # one optional newline followed by spaces
-
- \\[
- (.*?) # id = $3
- \\]
- )
- }xs",
- array($this,'_DoAnchors_reference_callback'), $text);
-
- #
- # Next, inline-style links: [link text](url "optional title")
- #
- $text = preg_replace_callback("{
- ( # wrap whole match in $1
- \\[
- ({$bracket}) # link text = $2
- \\]
- \\( # literal paren
- [ \\t]*
- <?(.*?)>? # href = $3
- [ \\t]*
- ( # $4
- (['\"]) # quote char = $5
- (.*?) # Title = $6
- \\5 # matching quote
- )? # title is optional
- \\)
- )
- }xs",
- array($this,'_DoAnchors_inline_callback'), $text);
-
- return $text;
- }
- private function _DoAnchors_reference_callback($matches) {
- $whole_match = $matches[1];
- $link_text = $matches[2];
- $link_id = strtolower($matches[3]);
-
- if ($link_id == "") {
- $link_id = strtolower($link_text); # for shortcut links like [this][].
- }
-
- if (isset($this->md_urls[$link_id])) {
- $url = $this->md_urls[$link_id];
- # We've got to encode these to avoid conflicting with italics/bold.
- $url = str_replace(array('*', '_'),
- array(self::$md_escape_table['*'], self::$md_escape_table['_']),
- $url);
- $result = "<a href=\"$url\"";
- if ( isset( $this->md_titles[$link_id] ) ) {
- $title = $this->md_titles[$link_id];
- $title = str_replace(array('*', '_'),
- array(self::$md_escape_table['*'],
- self::$md_escape_table['_']), $title);
- $result .= " title=\"$title\"";
- }
- $result .= ">$link_text</a>";
- }
- else {
- $result = $whole_match;
- }
- return $result;
- }
- private function _DoAnchors_inline_callback($matches) {
- $whole_match = $matches[1];
- $link_text = $matches[2];
- $url = $matches[3];
- $title =& $matches[6];
-
- # We've got to encode these to avoid conflicting with italics/bold.
- $url = str_replace(array('*', '_'),
- array(self::$md_escape_table['*'], self::$md_escape_table['_']),
- $url);
- $result = "<a href=\"$url\"";
- if (isset($title)) {
- $title = str_replace('"', '&quot;', $title);
- $title = str_replace(array('*', '_'),
- array(self::$md_escape_table['*'], self::$md_escape_table['_']),
- $title);
- $result .= " title=\"$title\"";
- }
-
- $result .= ">$link_text</a>";
-
- return $result;
- }
-
-
- private function _DoImages($text) {
- #
- # Turn Markdown image shortcuts into <img> tags.
- #
- #
- # First, handle reference-style labeled images: ![alt text][id]
- #
- $text = preg_replace_callback('{
- ( # wrap whole match in $1
- !\[
- ('.self::$md_nested_brackets.') # alt text = $2
- \]
-
- [ ]? # one optional space
- (?:\n[ ]*)? # one optional newline followed by spaces
-
- \[
- (.*?) # id = $3
- \]
-
- )
- }xs',
- array($this,'_DoImages_reference_callback'), $text);
-
- #
- # Next, handle inline images: ![alt text](url "optional title")
- # Don't forget: encode * and _
-
- $text = preg_replace_callback('{
- ( # wrap whole match in $1
- !\[
- ('.self::$md_nested_brackets.') # alt text = $2
- \]
- \( # literal paren
- [ \t]*
- <?(\S+?)>? # src url = $3
- [ \t]*
- ( # $4
- ([\'"]) # quote char = $5
- (.*?) # title = $6
- \5 # matching quote
- [ \t]*
- )? # title is optional
- \)
- )
- }xs',
- array($this,'_DoImages_inline_callback'), $text);
-
- return $text;
- }
- private function _DoImages_reference_callback($matches) {
- $whole_match = $matches[1];
- $alt_text = $matches[2];
- $link_id = strtolower($matches[3]);
-
- if ($link_id == "") {
- $link_id = strtolower($alt_text); # for shortcut links like ![this][].
- }
-
- $alt_text = str_replace('"', '&quot;', $alt_text);
- if (isset($this->md_urls[$link_id])) {
- $url = $this->md_urls[$link_id];
- # We've got to encode these to avoid conflicting with italics/bold.
- $url = str_replace(array('*', '_'),
- array(self::$md_escape_table['*'], self::$md_escape_table['_']),
- $url);
- $result = "<img src=\"$url\" alt=\"$alt_text\"";
- if (isset($this->md_titles[$link_id])) {
- $title = $this->md_titles[$link_id];
- $title = str_replace(array('*', '_'),
- array(self::$md_escape_table['*'],
- self::$md_escape_table['_']), $title);
- $result .= " title=\"$title\"";
- }
- $result .= $this->md_empty_element_suffix;
- }
- else {
- # If there's no such link ID, leave intact:
- $result = $whole_match;
- }
-
- return $result;
- }
- private function _DoImages_inline_callback($matches) {
- $whole_match = $matches[1];
- $alt_text = $matches[2];
- $url = $matches[3];
- $title = '';
- if (isset($matches[6])) {
- $title = $matches[6];
- }
-
- $alt_text = str_replace('"', '&quot;', $alt_text);
- $title = str_replace('"', '&quot;', $title);
- # We've got to encode these to avoid conflicting with italics/bold.
- $url = str_replace(array('*', '_'),
- array(self::$md_escape_table['*'], self::$md_escape_table['_']),
- $url);
- $result = "<img src=\"$url\" alt=\"$alt_text\"";
- if (isset($title)) {
- $title = str_replace(array('*', '_'),
- array(self::$md_escape_table['*'], self::$md_escape_table['_']),
- $title);
- $result .= " title=\"$title\""; # $title already quoted
- }
- $result .= $this->md_empty_element_suffix;
-
- return $result;
- }
-
-
- private function _DoHeaders($text) {
- # Setext-style headers:
- # Header 1
- # ========
- #
- # Header 2
- # --------
- #
- $text = preg_replace(
- array('{ ^(.+)[ \t]*\n=+[ \t]*\n+ }emx',
- '{ ^(.+)[ \t]*\n-+[ \t]*\n+ }emx'),
- array("'<h1>'.\$this->_RunSpanGamut(\$this->_UnslashQuotes('\\1')).'</h1>\n\n'",
- "'<h2>'.\$this->_RunSpanGamut(\$this->_UnslashQuotes('\\1')).'</h2>\n\n'"),
- $text);
-
- # atx-style headers:
- # # Header 1
- # ## Header 2
- # ## Header 2 with closing hashes ##
- # ...
- # ###### Header 6
- #
- $text = preg_replace("{
- ^(\\#{1,6}) # $1 = string of #'s
- [ \\t]*
- (.+?) # $2 = Header text
- [ \\t]*
- \\#* # optional closing #'s (not counted)
- \\n+
- }xme",
- "'<h'.strlen('\\1').'>'.\$this->_RunSpanGamut(\$this->_UnslashQuotes('\\2')).'</h'.strlen('\\1').'>\n\n'",
- $text);
-
- return $text;
- }
-
-
- private function _DoLists($text) {
- #
- # Form HTML ordered (numbered) and unordered (bulleted) lists.
- #
- $less_than_tab = $this->md_tab_width - 1;
-
- # Re-usable patterns to match list item bullets and number markers:
- $marker_ul = '[*+-]';
- $marker_ol = '\d+[.]';
- $marker_any = "(?:$marker_ul|$marker_ol)";
-
- $markers = array($marker_ul, $marker_ol);
-
- foreach ($markers as $marker) {
- # Re-usable pattern to match any entirel ul or ol list:
- $whole_list = '
- ( # $1 = whole list
- ( # $2
- [ ]{0,'.$less_than_tab.'}
- ('.$marker.') # $3 = first list item marker
- [ \t]+
- )
- (?s:.+?)
- ( # $4
- \z
- |
- \n{2,}
- (?=\S)
- (?! # Negative lookahead for another list item marker
- [ \t]*
- '.$marker.'[ \t]+
- )
- )
- )
- '; // mx
-
- # We use a different prefix before nested lists than top-level lists.
- # See extended comment in _ProcessListItems().
-
- if ($this->md_list_level) {
- $text = preg_replace_callback('{
- ^
- '.$whole_list.'
- }mx',
- array($this,'_DoLists_callback_top'), $text);
- }
- else {
- $text = preg_replace_callback('{
- (?:(?<=\n\n)|\A\n?)
- '.$whole_list.'
- }mx',
- array($this,'_DoLists_callback_nested'), $text);
- }
- }
-
- return $text;
- }
- private function _DoLists_callback_top($matches) {
- # Re-usable patterns to match list item bullets and number markers:
- $marker_ul = '[*+-]';
- $marker_ol = '\d+[.]';
- $marker_any = "(?:$marker_ul|$marker_ol)";
-
- $list = $matches[1];
- $list_type = preg_match("/$marker_ul/", $matches[3]) ? "ul" : "ol";
-
- $marker_any = ( $list_type == "ul" ? $marker_ul : $marker_ol );
-
- # Turn double returns into triple returns, so that we can make a
- # paragraph for the last item in a list, if necessary:
- $list = preg_replace("/\n{2,}/", "\n\n\n", $list);
- $result = $this->_ProcessListItems($list, $marker_any);
-
- # Trim any trailing whitespace, to put the closing `</$list_type>`
- # up on the preceding line, to get it past the current stupid
- # HTML block parser. This is a hack to work around the terrible
- # hack that is the HTML block parser.
- $result = rtrim($result);
- $result = "<$list_type>" . $result . "</$list_type>\n";
- return $result;
- }
- private function _DoLists_callback_nested($matches) {
- # Re-usable patterns to match list item bullets and number markers:
- $marker_ul = '[*+-]';
- $marker_ol = '\d+[.]';
- $marker_any = "(?:$marker_ul|$marker_ol)";
-
- $list = $matches[1];
- $list_type = preg_match("/$marker_ul/", $matches[3]) ? "ul" : "ol";
-
- $marker_any = ( $list_type == "ul" ? $marker_ul : $marker_ol );
-
- # Turn double returns into triple returns, so that we can make a
- # paragraph for the last item in a list, if necessary:
- $list = preg_replace("/\n{2,}/", "\n\n\n", $list);
- $result = $this->_ProcessListItems($list, $marker_any);
- $result = "<$list_type>\n" . $result . "</$list_type>\n";
- return $result;
- }
-
-
- private function _ProcessListItems($list_str, $marker_any) {
- #
- # Process the contents of a single ordered or unordered list, splitting it
- # into individual list items.
- #
-
- # The $md_list_level keeps track of when we're inside a list.
- # Each time we enter a list, we increment it; when we leave a list,
- # we decrement. If it's zero, we're not in a list anymore.
- #
- # We do this because when we're not inside a list, we want to treat
- # something like this:
- #
- # I recommend upgrading to version
- # 8. Oops, now this line is treated
- # as a sub-list.
- #
- # As a single paragraph, despite the fact that the second line starts
- # with a digit-period-space sequence.
- #
- # Whereas when we're inside a list (or sub-list), that line will be
- # treated as the start of a sub-list. What a kludge, huh? This is
- # an aspect of Markdown's syntax that's hard to parse perfectly
- # without resorting to mind-reading. Perhaps the solution is to
- # change the syntax rules such that sub-lists must start with a
- # starting cardinal number; e.g. "1." or "a.".
-
- $this->md_list_level++;
-
- # trim trailing blank lines:
- $list_str = preg_replace("/\n{2,}\\z/", "\n", $list_str);
-
- $list_str = preg_replace_callback('{
- (\n)? # leading line = $1
- (^[ \t]*) # leading whitespace = $2
- ('.$marker_any.') [ \t]+ # list marker = $3
- ((?s:.+?) # list item text = $4
- (\n{1,2}))
- (?= \n* (\z | \2 ('.$marker_any.') [ \t]+))
- }xm',
- array($this,'_ProcessListItems_callback'), $list_str);
-
- $this->md_list_level--;
- return $list_str;
- }
- private function _ProcessListItems_callback($matches) {
- $item = $matches[4];
- $leading_line =& $matches[1];
- $leading_space =& $matches[2];
-
- if ($leading_line || preg_match('/\n{2,}/', $item)) {
- $item = $this->_RunBlockGamut($this->_Outdent($item));
- }
- else {
- # Recursion for sub-lists:
- $item = $this->_DoLists($this->_Outdent($item));
- $item = preg_replace('/\n+$/', '', $item);
- $item = $this->_RunSpanGamut($item);
- }
-
- return "<li>" . $item . "</li>\n";
- }
-
-
- private function _DoCodeBlocks($text) {
- #
- # Process Markdown `<pre><code>` blocks.
- #
- $text = preg_replace_callback('{
- (?:\n\n|\A)
- ( # $1 = the code block -- one or more lines, starting with a space/tab
- (?:
- (?:[ ]{'.$this->md_tab_width.'} | \t) # Lines must start with a tab or a tab-width of spaces
- .*\n+
- )+
- )
- ((?=^[ ]{0,'.$this->md_tab_width.'}\S)|\Z) # Lookahead for non-space at line-start, or end of doc
- }xm',
- array($this,'_DoCodeBlocks_callback'), $text);
-
- return $text;
- }
- private function _DoCodeBlocks_callback($matches) {
- $codeblock = $matches[1];
-
- $codeblock = $this->_EncodeCode($this->_Outdent($codeblock));
- // $codeblock = _Detab($codeblock);
- # trim leading newlines and trailing whitespace
- $codeblock = preg_replace(array('/\A\n+/', '/\s+\z/'), '', $codeblock);
-
- $result = "\n\n<pre><code>" . $codeblock . "\n</code></pre>\n\n";
-
- return $result;
- }
-
-
- private function _DoCodeSpans($text) {
- #
- # * Backtick quotes are used for <code></code> spans.
- #
- # * You can use multiple backticks as the delimiters if you want to
- # include literal backticks in the code span. So, this input:
- #
- # Just type ``foo `bar` baz`` at the prompt.
- #
- # Will translate to:
- #
- # <p>Just type <code>foo `bar` baz</code> at the prompt.</p>
- #
- # There's no arbitrary limit to the number of backticks you
- # can use as delimters. If you need three consecutive backticks
- # in your code, use four for delimiters, etc.
- #
- # * You can use spaces to get literal backticks at the edges:
- #
- # ... type `` `bar` `` ...
- #
- # Turns to:
- #
- # ... type <code>`bar`</code> ...
- #
- $text = preg_replace_callback('@
- (?<!\\\) # Character before opening ` can\'t be a backslash
- (`+) # $1 = Opening run of `
- (.+?) # $2 = The code block
- (?<!`)
- \1 # Matching closer
- (?!`)
- @xs',
- array($this,'_DoCodeSpans_callback'), $text);
-
- return $text;
- }
- private function _DoCodeSpans_callback($matches) {
- $c = $matches[2];
- $c = preg_replace('/^[ \t]*/', '', $c); # leading whitespace
- $c = preg_replace('/[ \t]*$/', '', $c); # trailing whitespace
- $c = $this->_EncodeCode($c);
- return "<code>$c</code>";
- }
-
-
- private function _EncodeCode($_) {
- #
- # Encode/escape certain characters inside Markdown code runs.
- # The point is that in code, these characters are literals,
- # and lose their special Markdown meanings.
- #
- # Encode all ampersands; HTML entities are not
- # entities within a Markdown code span.
- $_ = str_replace('&', '&amp;', $_);
-
- # Do the angle bracket song and dance:
- $_ = str_replace(array('<', '>'),
- array('&lt;', '&gt;'), $_);
-
- # Now, escape characters that are magic in Markdown:
- $_ = str_replace(array_keys(self::$md_escape_table),
- array_values(self::$md_escape_table), $_);
-
- return $_;
- }
-
-
- private function _DoItalicsAndBold($text) {
- # <strong> must go first:
- $text = preg_replace('{
- ( # $1: Marker
- (?<!\*\*) \*\* | # (not preceded by two chars of
- (?<!__) __ # the same marker)
- )
- (?=\S) # Not followed by whitespace
- (?!\1) # or two others marker chars.
- ( # $2: Content
- (?:
- [^*_]+? # Anthing not em markers.
- |
- # Balence any regular emphasis inside.
- ([*_]) (?=\S) .+? (?<=\S) \3 # $3: em char (* or _)
- |
- (?! \1 ) . # Allow unbalenced * and _.
- )+?
- )
- (?<=\S) \1 # End mark not preceded by whitespace.
- }sx',
- '<strong>\2</strong>', $text);
- # Then <em>:
- $text = preg_replace(
- '{ ( (?<!\*)\* | (?<!_)_ ) (?=\S) (?! \1) (.+?) (?<=\S) \1 }sx',
- '<em>\2</em>', $text);
-
- return $text;
- }
-
-
- private function _DoBlockQuotes($text) {
- $text = preg_replace_callback('/
- ( # Wrap whole match in $1
- (
- ^[ \t]*>[ \t]? # ">" at the start of a line
- .+\n # rest of the first line
- (.+\n)* # subsequent consecutive lines
- \n* # blanks
- )+
- )
- /xm',
- array($this,'_DoBlockQuotes_callback'), $text);
-
- return $text;
- }
- private function _DoBlockQuotes_callback($matches) {
- $bq = $matches[1];
- # trim one level of quoting - trim whitespace-only lines
- $bq = preg_replace(array('/^[ \t]*>[ \t]?/m', '/^[ \t]+$/m'), '', $bq);
- $bq = $this->_RunBlockGamut($bq); # recurse
-
- $bq = preg_replace('/^/m', " ", $bq);
- # These leading spaces screw with <pre> content, so we need to fix that:
- $bq = preg_replace_callback('{(\s*<pre>.+?</pre>)}sx',
- array($this,'_DoBlockQuotes_callback2'), $bq);
-
- return "<blockquote>\n$bq\n</blockquote>\n\n";
- }
- private function _DoBlockQuotes_callback2($matches) {
- $pre = $matches[1];
- $pre = preg_replace('/^ /m', '', $pre);
- return $pre;
- }
-
-
- private function _FormParagraphs($text) {
- #
- # Params:
- # $text - string to process with html <p> tags
- #
- # Strip leading and trailing lines:
- $text = preg_replace(array('/\A\n+/', '/\n+\z/'), '', $text);
-
- $grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY);
-
- #
- # Wrap <p> tags.
- #
- foreach ($grafs as $key => $value) {
- if (!isset( $this->md_html_blocks[$value] )) {
- $value = $this->_RunSpanGamut($value);
- $value = preg_replace('/^([ \t]*)/', '<p>', $value);
- $value .= "</p>";
- $grafs[$key] = $value;
- }
- }
-
- #
- # Unhashify HTML blocks
- #
- foreach ($grafs as $key => $value) {
- if (isset( $this->md_html_blocks[$value] )) {
- $grafs[$key] = $this->md_html_blocks[$value];
- }
- }
-
- return implode("\n\n", $grafs);
- }
-
-
- private function _EncodeAmpsAndAngles($text) {
- # Smart processing for ampersands and angle brackets that need to be encoded.
-
- # Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin:
- # http://bumppo.net/projects/amputator/
- $text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/',
- '&amp;', $text);;
-
- # Encode naked <'s
- $text = preg_replace('{<(?![a-z/?\$!])}i', '&lt;', $text);
-
- return $text;
- }
-
-
- private function _EncodeBackslashEscapes($text) {
- #
- # Parameter: String.
- # Returns: The string, with after processing the following backslash
- # escape sequences.
- #
- # Must process escaped backslashes first.
- return str_replace(array_keys(self::$md_backslash_escape_table),
- array_values(self::$md_backslash_escape_table), $text);
- }
-
-
- private function _DoAutoLinks($text) {
- $text = preg_replace("!<((https?|ftp):[^'\">\\s]+)>!",
- '<a href="\1">\1</a>', $text);
-
- # Email addresses: <address@domain.foo>
- $text = preg_replace('{
- <
- (?:mailto:)?
- (
- [-.\w]+
- \@
- [-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+
- )
- >
- }exi',
- "\$this->_EncodeEmailAddress(\$this->_UnescapeSpecialChars(\$this->_UnslashQuotes('\\1')))",
- $text);
-
- return $text;
- }
-
-
- private function _EncodeEmailAddress($addr) {
- #
- # Input: an email address, e.g. "foo@example.com"
- #
- # Output: the email address as a mailto link, with each character
- # of the address encoded as either a decimal or hex entity, in
- # the hopes of foiling most address harvesting spam bots. E.g.:
- #
- # <a href="&#x6D;&#97;&#105;&#108;&#x74;&#111;:&#102;&#111;&#111;&#64;&#101;
- # x&#x61;&#109;&#x70;&#108;&#x65;&#x2E;&#99;&#111;&#109;">&#102;&#111;&#111;
- # &#64;&#101;x&#x61;&#109;&#x70;&#108;&#x65;&#x2E;&#99;&#111;&#109;</a>
- #
- # Based by a filter by Matthew Wickline, posted to the BBEdit-Talk
- # mailing list: <http://tinyurl.com/yu7ue>
- #
- $addr = "mailto:" . $addr;
- $length = strlen($addr);
-
- # leave ':' alone (to spot mailto: later)
- $addr = preg_replace_callback('/([^\:])/',
- array($this,'_EncodeEmailAddress_callback'), $addr);
-
- $addr = "<a href=\"$addr\">$addr</a>";
- # strip the mailto: from the visible part
- $addr = preg_replace('/">.+?:/', '">', $addr);
-
- return $addr;
- }
- private function _EncodeEmailAddress_callback($matches) {
- $char = $matches[1];
- $r = rand(0, 100);
- # roughly 10% raw, 45% hex, 45% dec
- # '@' *must* be encoded. I insist.
- if ($r > 90 && $char != '@') return $char;
- if ($r < 45) return '&#x'.dechex(ord($char)).';';
- return '&#'.ord($char).';';
- }
-
-
- private function _UnescapeSpecialChars($text) {
- #
- # Swap back in all the special characters we've hidden.
- #
- return str_replace(array_values(self::$md_escape_table),
- array_keys(self::$md_escape_table), $text);
- }
-
-
- # _TokenizeHTML is shared between PHP Markdown and PHP SmartyPants.
- # We only define it if it is not already defined.
-
- private function _TokenizeHTML($str) {
- #
- # Parameter: String containing HTML markup.
- # Returns: An array of the tokens comprising the input
- # string. Each token is either a tag (possibly with nested,
- # tags contained therein, such as <a href="<MTFoo>">, or a
- # run of text between tags. Each element of the array is a
- # two-element array; the first is either 'tag' or 'text';
- # the second is the actual value.
- #
- #
- # Regular expression derived from the _tokenize() subroutine in
- # Brad Choate's MTRegex plugin.
- # <http://www.bradchoate.com/past/mtregex.php>
- #
- $index = 0;
- $tokens = array();
-
- $match = '(?s:<!(?:--.*?--\s*)+>)|'. # comment
- '(?s:<\?.*?\?>)|'. # processing instruction
- # regular tags
- '(?:<[/!$]?[-a-zA-Z0-9:]+\b(?>[^"\'>]+|"[^"]*"|\'[^\']*\')*>)';
-
- $parts = preg_split("{($match)}", $str, -1, PREG_SPLIT_DELIM_CAPTURE);
-
- foreach ($parts as $part) {
- if (++$index % 2 && $part != '')
- $tokens[] = array('text', $part);
- else
- $tokens[] = array('tag', $part);
- }
-
- return $tokens;
- }
-
- private function _Outdent($text) {
- #
- # Remove one level of line-leading tabs or spaces
- #
- return preg_replace("/^(\\t|[ ]{1,".$this->md_tab_width."})/m", "", $text);
- }
-
-
- private function _Detab($text) {
- #
- # Replace tabs with the appropriate amount of space.
- #
- # For each line we separate the line in blocks delemited by
- # tab characters. Then we reconstruct every line by adding the
- # appropriate number of space between each blocks.
-
- $lines = explode("\n", $text);
- $text = "";
-
- foreach ($lines as $line) {
- # Split in blocks.
- $blocks = explode("\t", $line);
- # Add each blocks to the line.
- $line = $blocks[0];
- unset($blocks[0]); # Do not add first block twice.
- foreach ($blocks as $block) {
- # Calculate amount of space, insert spaces, insert block.
- $amount = $this->md_tab_width - strlen($line) % $this->md_tab_width;
- $line .= str_repeat(" ", $amount) . $block;
- }
- $text .= "$line\n";
- }
- return $text;
- }
-
-
- private function _UnslashQuotes($text) {
- #
- # This function is useful to remove automaticaly slashed double quotes
- # when using preg_replace and evaluating an expression.
- # Parameter: String.
- # Returns: The string with any slash-double-quote (\") sequence replaced
- # by a single double quote.
- #
- return str_replace('\"', '"', $text);
- }
-}
-
-/*
-
-PHP Markdown
-============
-
-Description
------------
-
-This is a PHP translation of the original Markdown formatter written in
-Perl by John Gruber.
-
-Markdown is a text-to-HTML filter; it translates an easy-to-read /
-easy-to-write structured text format into HTML. Markdown's text format
-is most similar to that of plain text email, and supports features such
-as headers, *emphasis*, code blocks, blockquotes, and links.
-
-Markdown's syntax is designed not as a generic markup language, but
-specifically to serve as a front-end to (X)HTML. You can use span-level
-HTML tags anywhere in a Markdown document, and you can use block level
-HTML tags (like <div> and <table> as well).
-
-For more information about Markdown's syntax, see:
-
-<http://daringfireball.net/projects/markdown/>
-
-
-Bugs
-----
-
-To file bug reports please send email to:
-
-<michel.fortin@michelf.com>
-
-Please include with your report: (1) the example input; (2) the output you
-expected; (3) the output Markdown actually produced.
-
-
-Version History
----------------
-
-See the readme file for detailed release notes for this version.
-
-1.0.1c - 9 Dec 2005
-
-1.0.1b - 6 Jun 2005
-
-1.0.1a - 15 Apr 2005
-
-1.0.1 - 16 Dec 2004
-
-1.0 - 21 Aug 2004
-
-
-Author & Contributors
----------------------
-
-Original Perl version by John Gruber
-<http://daringfireball.net/>
-
-PHP port and other contributions by Michel Fortin
-<http://www.michelf.com/>
-
-
-Copyright and License
----------------------
-
-Copyright (c) 2004-2005 Michel Fortin
-<http://www.michelf.com/>
-All rights reserved.
-
-Copyright (c) 2003-2004 John Gruber
-<http://daringfireball.net/>
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-* Neither the name "Markdown" nor the names of its contributors may
- be used to endorse or promote products derived from this software
- without specific prior written permission.
-
-This software is provided by the copyright holders and contributors "as
-is" and any express or implied warranties, including, but not limited
-to, the implied warranties of merchantability and fitness for a
-particular purpose are disclaimed. In no event shall the copyright owner
-or contributors be liable for any direct, indirect, incidental, special,
-exemplary, or consequential damages (including, but not limited to,
-procurement of substitute goods or services; loss of use, data, or
-profits; or business interruption) however caused and on any theory of
-liability, whether in contract, strict liability, or tort (including
-negligence or otherwise) arising in any way out of the use of this
-software, even if advised of the possibility of such damage.
-
-*/
diff --git a/framework/3rdParty/Parsedown/LICENSE.txt b/framework/3rdParty/Parsedown/LICENSE.txt
new file mode 100644
index 00000000..baca86f5
--- /dev/null
+++ b/framework/3rdParty/Parsedown/LICENSE.txt
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 Emanuil Rusev, erusev.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file
diff --git a/framework/3rdParty/Parsedown/Parsedown.php b/framework/3rdParty/Parsedown/Parsedown.php
new file mode 100755
index 00000000..ebc80974
--- /dev/null
+++ b/framework/3rdParty/Parsedown/Parsedown.php
@@ -0,0 +1,1135 @@
+<?php
+
+#
+#
+# Parsedown
+# http://parsedown.org
+#
+# (c) Emanuil Rusev
+# http://erusev.com
+#
+# For the full license information, view the LICENSE file that was distributed
+# with this source code.
+#
+#
+
+class Parsedown
+{
+ # Multiton
+
+ static function instance($name = 'default')
+ {
+ if (isset(self::$instances[$name]))
+ {
+ return self::$instances[$name];
+ }
+
+ $instance = new Parsedown();
+
+ self::$instances[$name] = $instance;
+
+ return $instance;
+ }
+
+ private static $instances = array();
+
+ #
+ # Setters
+ #
+
+ # Enables GFM line breaks.
+
+ function set_breaks_enabled($breaks_enabled)
+ {
+ $this->breaks_enabled = $breaks_enabled;
+
+ return $this;
+ }
+
+ private $breaks_enabled = false;
+
+ #
+ # Synopsis
+ #
+
+ # Markdown is intended to be easy-to-read by humans - those of us who read
+ # line by line, left to right, top to bottom. In order to take advantage of
+ # this, Parsedown tries to read in a similar way. It breaks texts into
+ # lines, it iterates through them and it looks at how they start and relate
+ # to each other.
+
+ #
+ # Methods
+ #
+
+ function parse($text)
+ {
+ # standardize line breaks
+ $text = str_replace("\r\n", "\n", $text);
+ $text = str_replace("\r", "\n", $text);
+
+ # replace tabs with spaces
+ $text = str_replace("\t", ' ', $text);
+
+ # remove surrounding line breaks
+ $text = trim($text, "\n");
+
+ # split text into lines
+ $lines = explode("\n", $text);
+
+ # convert lines into html
+ $text = $this->parse_block_elements($lines);
+
+ # remove trailing line breaks
+ $text = chop($text, "\n");
+
+ return $text;
+ }
+
+ #
+ # Private
+
+ private function parse_block_elements(array $lines, $context = '')
+ {
+ $blocks = array();
+
+ $block = array(
+ 'type' => '',
+ );
+
+ foreach ($lines as $line)
+ {
+ # context
+
+ switch ($block['type'])
+ {
+ case 'fenced':
+
+ if ( ! isset($block['closed']))
+ {
+ if (preg_match('/^[ ]*'.$block['fence'][0].'{3,}[ ]*$/', $line))
+ {
+ $block['closed'] = true;
+ }
+ else
+ {
+ if ($block['text'] !== '')
+ {
+ $block['text'] .= "\n";
+ }
+
+ $block['text'] .= $line;
+ }
+
+ continue 2;
+ }
+
+ break;
+
+ case 'markup':
+
+ if ( ! isset($block['closed']))
+ {
+ if (strpos($line, $block['start']) !== false) # opening tag
+ {
+ $block['depth']++;
+ }
+
+ if (strpos($line, $block['end']) !== false) # closing tag
+ {
+ if ($block['depth'] > 0)
+ {
+ $block['depth']--;
+ }
+ else
+ {
+ $block['closed'] = true;
+ }
+ }
+
+ $block['text'] .= "\n".$line;
+
+ continue 2;
+ }
+
+ break;
+ }
+
+ # ~
+
+ $indentation = 0;
+
+ while(isset($line[$indentation]) and $line[$indentation] === ' ')
+ {
+ $indentation++;
+ }
+
+ $outdented_line = $indentation > 0 ? ltrim($line) : $line;
+
+ # blank
+
+ if ($outdented_line === '')
+ {
+ $block['interrupted'] = true;
+
+ continue;
+ }
+
+ # context
+
+ switch ($block['type'])
+ {
+ case 'quote':
+
+ if ( ! isset($block['interrupted']))
+ {
+ $line = preg_replace('/^[ ]*>[ ]?/', '', $line);
+
+ $block['lines'] []= $line;
+
+ continue 2;
+ }
+
+ break;
+
+ case 'li':
+
+ if ($block['indentation'] === $indentation and preg_match('/^'.$block['marker'].'[ ]+(.*)/', $outdented_line, $matches))
+ {
+ unset($block['last']);
+
+ $blocks []= $block;
+
+ $block['last'] = true;
+ $block['lines'] = array($matches[1]);
+
+ unset($block['first']);
+ unset($block['interrupted']);
+
+ continue 2;
+ }
+
+ if ( ! isset($block['interrupted']))
+ {
+ $line = preg_replace('/^[ ]{0,'.$block['baseline'].'}/', '', $line);
+
+ $block['lines'] []= $line;
+
+ continue 2;
+ }
+ elseif ($line[0] === ' ')
+ {
+ $block['lines'] []= '';
+
+ $line = preg_replace('/^[ ]{0,'.$block['baseline'].'}/', '', $line);
+
+ $block['lines'] []= $line;
+
+ unset($block['interrupted']);
+
+ continue 2;
+ }
+
+ break;
+ }
+
+ # indentation sensitive types
+
+ switch ($line[0])
+ {
+ case ' ':
+
+ # code
+
+ if ($indentation >= 4)
+ {
+ $code_line = substr($line, 4);
+
+ if ($block['type'] === 'code')
+ {
+ if (isset($block['interrupted']))
+ {
+ $block['text'] .= "\n";
+
+ unset($block['interrupted']);
+ }
+
+ $block['text'] .= "\n".$code_line;
+ }
+ else
+ {
+ $blocks []= $block;
+
+ $block = array(
+ 'type' => 'code',
+ 'text' => $code_line,
+ );
+ }
+
+ continue 2;
+ }
+
+ break;
+
+ case '#':
+
+ # atx heading (#)
+
+ if (isset($line[1]))
+ {
+ $blocks []= $block;
+
+ $level = 1;
+
+ while (isset($line[$level]) and $line[$level] === '#')
+ {
+ $level++;
+ }
+
+ $block = array(
+ 'type' => 'heading',
+ 'text' => trim($line, '# '),
+ 'level' => $level,
+ );
+
+ continue 2;
+ }
+
+ break;
+
+ case '-':
+ case '=':
+
+ # setext heading (===)
+
+ if ($block['type'] === 'paragraph' and isset($block['interrupted']) === false)
+ {
+ $chopped_line = chop($line);
+
+ $i = 1;
+
+ while (isset($chopped_line[$i]))
+ {
+ if ($chopped_line[$i] !== $line[0])
+ {
+ break 2;
+ }
+
+ $i++;
+ }
+
+ $block['type'] = 'heading';
+
+ $block['level'] = $line[0] === '-' ? 2 : 1;
+
+ continue 2;
+ }
+
+ break;
+ }
+
+ # indentation insensitive types
+
+ switch ($outdented_line[0])
+ {
+ case '<':
+
+ $position = strpos($outdented_line, '>');
+
+ if ($position > 1)
+ {
+ $substring = substr($outdented_line, 1, $position - 1);
+
+ $substring = chop($substring);
+
+ if (substr($substring, -1) === '/')
+ {
+ $is_self_closing = true;
+
+ $substring = substr($substring, 0, -1);
+ }
+
+ $position = strpos($substring, ' ');
+
+ if ($position)
+ {
+ $name = substr($substring, 0, $position);
+ }
+ else
+ {
+ $name = $substring;
+ }
+
+ if ( ! ctype_alpha($name))
+ {
+ break;
+ }
+
+ if (in_array($name, self::$text_level_elements))
+ {
+ break;
+ }
+
+ $blocks []= $block;
+
+ if (isset($is_self_closing))
+ {
+ $block = array(
+ 'type' => 'self-closing tag',
+ 'text' => $outdented_line,
+ );
+
+ unset($is_self_closing);
+
+ continue 2;
+ }
+
+ $block = array(
+ 'type' => 'markup',
+ 'text' => $outdented_line,
+ 'start' => '<'.$name.'>',
+ 'end' => '</'.$name.'>',
+ 'depth' => 0,
+ );
+
+ if (strpos($outdented_line, $block['end']))
+ {
+ $block['closed'] = true;
+ }
+
+ continue 2;
+ }
+
+ break;
+
+ case '>':
+
+ # quote
+
+ if (preg_match('/^>[ ]?(.*)/', $outdented_line, $matches))
+ {
+ $blocks []= $block;
+
+ $block = array(
+ 'type' => 'quote',
+ 'lines' => array(
+ $matches[1],
+ ),
+ );
+
+ continue 2;
+ }
+
+ break;
+
+ case '[':
+
+ # reference
+
+ $position = strpos($outdented_line, ']:');
+
+ if ($position)
+ {
+ $reference = array();
+
+ $label = substr($outdented_line, 1, $position - 1);
+ $label = strtolower($label);
+
+ $substring = substr($outdented_line, $position + 2);
+ $substring = trim($substring);
+
+ if ($substring === '')
+ {
+ break;
+ }
+
+ if ($substring[0] === '<')
+ {
+ $position = strpos($substring, '>');
+
+ if ($position === false)
+ {
+ break;
+ }
+
+ $reference['»'] = substr($substring, 1, $position - 1);
+
+ $substring = substr($substring, $position + 1);
+ }
+ else
+ {
+ $position = strpos($substring, ' ');
+
+ if ($position === false)
+ {
+ $reference['»'] = $substring;
+
+ $substring = false;
+ }
+ else
+ {
+ $reference['»'] = substr($substring, 0, $position);
+
+ $substring = substr($substring, $position + 1);
+ }
+ }
+
+ if ($substring !== false)
+ {
+ if ($substring[0] !== '"' and $substring[0] !== "'" and $substring[0] !== '(')
+ {
+ break;
+ }
+
+ $last_char = substr($substring, -1);
+
+ if ($last_char !== '"' and $last_char !== "'" and $last_char !== ')')
+ {
+ break;
+ }
+
+ $reference['#'] = substr($substring, 1, -1);
+ }
+
+ $this->reference_map[$label] = $reference;
+
+ continue 2;
+ }
+
+ break;
+
+ case '`':
+ case '~':
+
+ # fenced code block
+
+ if (preg_match('/^([`]{3,}|[~]{3,})[ ]*(\S+)?[ ]*$/', $outdented_line, $matches))
+ {
+ $blocks []= $block;
+
+ $block = array(
+ 'type' => 'fenced',
+ 'text' => '',
+ 'fence' => $matches[1],
+ );
+
+ if (isset($matches[2]))
+ {
+ $block['language'] = $matches[2];
+ }
+
+ continue 2;
+ }
+
+ break;
+
+ case '*':
+ case '+':
+ case '-':
+ case '_':
+
+ # hr
+
+ if (preg_match('/^([-*_])([ ]{0,2}\1){2,}[ ]*$/', $outdented_line))
+ {
+ $blocks []= $block;
+
+ $block = array(
+ 'type' => 'rule',
+ );
+
+ continue 2;
+ }
+
+ # li
+
+ if (preg_match('/^([*+-][ ]+)(.*)/', $outdented_line, $matches))
+ {
+ $blocks []= $block;
+
+ $baseline = $indentation + strlen($matches[1]);
+
+ $block = array(
+ 'type' => 'li',
+ 'indentation' => $indentation,
+ 'baseline' => $baseline,
+ 'marker' => '[*+-]',
+ 'first' => true,
+ 'last' => true,
+ 'lines' => array(),
+ );
+
+ $block['lines'] []= preg_replace('/^[ ]{0,4}/', '', $matches[2]);
+
+ continue 2;
+ }
+ }
+
+ # li
+
+ if ($outdented_line[0] <= '9' and preg_match('/^(\d+[.][ ]+)(.*)/', $outdented_line, $matches))
+ {
+ $blocks []= $block;
+
+ $baseline = $indentation + strlen($matches[1]);
+
+ $block = array(
+ 'type' => 'li',
+ 'indentation' => $indentation,
+ 'baseline' => $baseline,
+ 'marker' => '\d+[.]',
+ 'first' => true,
+ 'last' => true,
+ 'ordered' => true,
+ 'lines' => array(),
+ );
+
+ $block['lines'] []= preg_replace('/^[ ]{0,4}/', '', $matches[2]);
+
+ continue;
+ }
+
+ # paragraph
+
+ if ($block['type'] === 'paragraph')
+ {
+ if (isset($block['interrupted']))
+ {
+ $blocks []= $block;
+
+ $block['text'] = $line;
+
+ unset($block['interrupted']);
+ }
+ else
+ {
+ if ($this->breaks_enabled)
+ {
+ $block['text'] .= ' ';
+ }
+
+ $block['text'] .= "\n".$line;
+ }
+ }
+ else
+ {
+ $blocks []= $block;
+
+ $block = array(
+ 'type' => 'paragraph',
+ 'text' => $line,
+ );
+ }
+ }
+
+ $blocks []= $block;
+
+ unset($blocks[0]);
+
+ # $blocks » HTML
+
+ $markup = '';
+
+ foreach ($blocks as $block)
+ {
+ switch ($block['type'])
+ {
+ case 'paragraph':
+
+ $text = $this->parse_span_elements($block['text']);
+
+ if ($context === 'li' and $markup === '')
+ {
+ if (isset($block['interrupted']))
+ {
+ $markup .= "\n".'<p>'.$text.'</p>'."\n";
+ }
+ else
+ {
+ $markup .= $text;
+
+ if (isset($blocks[2]))
+ {
+ $markup .= "\n";
+ }
+ }
+ }
+ else
+ {
+ $markup .= '<p>'.$text.'</p>'."\n";
+ }
+
+ break;
+
+ case 'quote':
+
+ $text = $this->parse_block_elements($block['lines']);
+
+ $markup .= '<blockquote>'."\n".$text.'</blockquote>'."\n";
+
+ break;
+
+ case 'code':
+
+ $text = htmlspecialchars($block['text'], ENT_NOQUOTES, 'UTF-8');
+
+ $markup .= '<pre><code>'.$text.'</code></pre>'."\n";
+
+ break;
+
+ case 'fenced':
+
+ $text = htmlspecialchars($block['text'], ENT_NOQUOTES, 'UTF-8');
+
+ $markup .= '<pre><code';
+
+ if (isset($block['language']))
+ {
+ $markup .= ' class="language-'.$block['language'].'"';
+ }
+
+ $markup .= '>'.$text.'</code></pre>'."\n";
+
+ break;
+
+ case 'heading':
+
+ $text = $this->parse_span_elements($block['text']);
+
+ $markup .= '<h'.$block['level'].'>'.$text.'</h'.$block['level'].'>'."\n";
+
+ break;
+
+ case 'rule':
+
+ $markup .= '<hr />'."\n";
+
+ break;
+
+ case 'li':
+
+ if (isset($block['first']))
+ {
+ $type = isset($block['ordered']) ? 'ol' : 'ul';
+
+ $markup .= '<'.$type.'>'."\n";
+ }
+
+ if (isset($block['interrupted']) and ! isset($block['last']))
+ {
+ $block['lines'] []= '';
+ }
+
+ $text = $this->parse_block_elements($block['lines'], 'li');
+
+ $markup .= '<li>'.$text.'</li>'."\n";
+
+ if (isset($block['last']))
+ {
+ $type = isset($block['ordered']) ? 'ol' : 'ul';
+
+ $markup .= '</'.$type.'>'."\n";
+ }
+
+ break;
+
+ case 'markup':
+
+ $markup .= $block['text']."\n";
+
+ break;
+
+ default:
+
+ $markup .= $block['text']."\n";
+ }
+ }
+
+ return $markup;
+ }
+
+ private function parse_span_elements($text, $markers = array(" \n", '![', '&', '*', '<', '[', '\\', '_', '`', 'http', '~~'))
+ {
+ if (isset($text[1]) === false or $markers === array())
+ {
+ return $text;
+ }
+
+ # ~
+
+ $markup = '';
+
+ while ($markers)
+ {
+ $closest_marker = null;
+ $closest_marker_index = 0;
+ $closest_marker_position = null;
+
+ foreach ($markers as $index => $marker)
+ {
+ $marker_position = strpos($text, $marker);
+
+ if ($marker_position === false)
+ {
+ unset($markers[$index]);
+
+ continue;
+ }
+
+ if ($closest_marker === null or $marker_position < $closest_marker_position)
+ {
+ $closest_marker = $marker;
+ $closest_marker_index = $index;
+ $closest_marker_position = $marker_position;
+ }
+ }
+
+ # ~
+
+ if ($closest_marker === null or isset($text[$closest_marker_position + 1]) === false)
+ {
+ $markup .= $text;
+
+ break;
+ }
+ else
+ {
+ $markup .= substr($text, 0, $closest_marker_position);
+ }
+
+ $text = substr($text, $closest_marker_position);
+
+ # ~
+
+ unset($markers[$closest_marker_index]);
+
+ # ~
+
+ switch ($closest_marker)
+ {
+ case " \n":
+
+ $markup .= '<br />'."\n";
+
+ $offset = 3;
+
+ break;
+
+ case '![':
+ case '[':
+
+ if (strpos($text, ']') and preg_match('/\[((?:[^][]|(?R))*)\]/', $text, $matches))
+ {
+ $element = array(
+ '!' => $text[0] === '!',
+ 'a' => $matches[1],
+ );
+
+ $offset = strlen($matches[0]);
+
+ if ($element['!'])
+ {
+ $offset++;
+ }
+
+ $remaining_text = substr($text, $offset);
+
+ if ($remaining_text[0] === '(' and preg_match('/\([ ]*(.*?)(?:[ ]+[\'"](.+?)[\'"])?[ ]*\)/', $remaining_text, $matches))
+ {
+ $element['»'] = $matches[1];
+
+ if (isset($matches[2]))
+ {
+ $element['#'] = $matches[2];
+ }
+
+ $offset += strlen($matches[0]);
+ }
+ elseif ($this->reference_map)
+ {
+ $reference = $element['a'];
+
+ if (preg_match('/^\s*\[(.*?)\]/', $remaining_text, $matches))
+ {
+ $reference = $matches[1] ? $matches[1] : $element['a'];
+
+ $offset += strlen($matches[0]);
+ }
+
+ $reference = strtolower($reference);
+
+ if (isset($this->reference_map[$reference]))
+ {
+ $element['»'] = $this->reference_map[$reference]['»'];
+
+ if (isset($this->reference_map[$reference]['#']))
+ {
+ $element['#'] = $this->reference_map[$reference]['#'];
+ }
+ }
+ else
+ {
+ unset($element);
+ }
+ }
+ else
+ {
+ unset($element);
+ }
+ }
+
+ if (isset($element))
+ {
+ $element['»'] = str_replace('&', '&amp;', $element['»']);
+ $element['»'] = str_replace('<', '&lt;', $element['»']);
+
+ if ($element['!'])
+ {
+ $markup .= '<img alt="'.$element['a'].'" src="'.$element['»'].'"';
+
+ if (isset($element['#']))
+ {
+ $markup .= ' title="'.$element['#'].'"';
+ }
+
+ $markup .= ' />';
+ }
+ else
+ {
+ $element['a'] = $this->parse_span_elements($element['a'], $markers);
+
+ $markup .= '<a href="'.$element['»'].'"';
+
+ if (isset($element['#']))
+ {
+ $markup .= ' title="'.$element['#'].'"';
+ }
+
+ $markup .= '>'.$element['a'].'</a>';
+ }
+
+ unset($element);
+ }
+ else
+ {
+ $markup .= $closest_marker;
+
+ $offset = $closest_marker === '![' ? 2 : 1;
+ }
+
+ break;
+
+ case '&':
+
+ if (preg_match('/^&#?\w+;/', $text, $matches))
+ {
+ $markup .= $matches[0];
+
+ $offset = strlen($matches[0]);
+ }
+ else
+ {
+ $markup .= '&amp;';
+
+ $offset = 1;
+ }
+
+ break;
+
+ case '*':
+ case '_':
+
+ if ($text[1] === $closest_marker and preg_match(self::$strong_regex[$closest_marker], $text, $matches))
+ {
+ $markers[] = $closest_marker;
+ $matches[1] = $this->parse_span_elements($matches[1], $markers);
+
+ $markup .= '<strong>'.$matches[1].'</strong>';
+ }
+ elseif (preg_match(self::$em_regex[$closest_marker], $text, $matches))
+ {
+ $markers[] = $closest_marker;
+ $matches[1] = $this->parse_span_elements($matches[1], $markers);
+
+ $markup .= '<em>'.$matches[1].'</em>';
+ }
+
+ if (isset($matches) and $matches)
+ {
+ $offset = strlen($matches[0]);
+ }
+ else
+ {
+ $markup .= $closest_marker;
+
+ $offset = 1;
+ }
+
+ break;
+
+ case '<':
+
+ if (strpos($text, '>') !== false)
+ {
+ if ($text[1] === 'h' and preg_match('/^<(https?:[\/]{2}[^\s]+?)>/i', $text, $matches))
+ {
+ $element_url = $matches[1];
+ $element_url = str_replace('&', '&amp;', $element_url);
+ $element_url = str_replace('<', '&lt;', $element_url);
+
+ $markup .= '<a href="'.$element_url.'">'.$element_url.'</a>';
+
+ $offset = strlen($matches[0]);
+ }
+ elseif (strpos($text, '@') > 1 and preg_match('/<(\S+?@\S+?)>/', $text, $matches))
+ {
+ $markup .= '<a href="mailto:'.$matches[1].'">'.$matches[1].'</a>';
+
+ $offset = strlen($matches[0]);
+ }
+ elseif (preg_match('/^<\/?\w.*?>/', $text, $matches))
+ {
+ $markup .= $matches[0];
+
+ $offset = strlen($matches[0]);
+ }
+ else
+ {
+ $markup .= '&lt;';
+
+ $offset = 1;
+ }
+ }
+ else
+ {
+ $markup .= '&lt;';
+
+ $offset = 1;
+ }
+
+ break;
+
+ case '\\':
+
+ if (in_array($text[1], self::$special_characters))
+ {
+ $markup .= $text[1];
+
+ $offset = 2;
+ }
+ else
+ {
+ $markup .= '\\';
+
+ $offset = 1;
+ }
+
+ break;
+
+ case '`':
+
+ if (preg_match('/^(`+)[ ]*(.+?)[ ]*(?<!`)\1(?!`)/', $text, $matches))
+ {
+ $element_text = $matches[2];
+ $element_text = htmlspecialchars($element_text, ENT_NOQUOTES, 'UTF-8');
+
+ $markup .= '<code>'.$element_text.'</code>';
+
+ $offset = strlen($matches[0]);
+ }
+ else
+ {
+ $markup .= '`';
+
+ $offset = 1;
+ }
+
+ break;
+
+ case 'http':
+
+ if (preg_match('/^https?:[\/]{2}[^\s]+\b\/*/ui', $text, $matches))
+ {
+ $element_url = $matches[0];
+ $element_url = str_replace('&', '&amp;', $element_url);
+ $element_url = str_replace('<', '&lt;', $element_url);
+
+ $markup .= '<a href="'.$element_url.'">'.$element_url.'</a>';
+
+ $offset = strlen($matches[0]);
+ }
+ else
+ {
+ $markup .= 'http';
+
+ $offset = 4;
+ }
+
+ break;
+
+ case '~~':
+
+ if (preg_match('/^~~(?=\S)(.+?)(?<=\S)~~/', $text, $matches))
+ {
+ $matches[1] = $this->parse_span_elements($matches[1], $markers);
+
+ $markup .= '<del>'.$matches[1].'</del>';
+
+ $offset = strlen($matches[0]);
+ }
+ else
+ {
+ $markup .= '~~';
+
+ $offset = 2;
+ }
+
+ break;
+ }
+
+ if (isset($offset))
+ {
+ $text = substr($text, $offset);
+ }
+
+ $markers[$closest_marker_index] = $closest_marker;
+ }
+
+ return $markup;
+ }
+
+ #
+ # Fields
+ #
+
+ private $reference_map = array();
+
+ #
+ # Read-only
+
+ private static $strong_regex = array(
+ '*' => '/^[*]{2}((?:[^*]|[*][^*]*[*])+?)[*]{2}(?![*])/s',
+ '_' => '/^__((?:[^_]|_[^_]*_)+?)__(?!_)/us',
+ );
+
+ private static $em_regex = array(
+ '*' => '/^[*]((?:[^*]|[*][*][^*]+?[*][*])+?)[*](?![*])/s',
+ '_' => '/^_((?:[^_]|__[^_]*__)+?)_(?!_)\b/us',
+ );
+
+ private static $special_characters = array(
+ '\\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '>', '#', '+', '-', '.', '!',
+ );
+
+ private static $text_level_elements = array(
+ 'a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont',
+ 'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing',
+ 'i', 'rp', 'sub', 'code', 'strike', 'marquee',
+ 'q', 'rt', 'sup', 'font', 'strong',
+ 's', 'tt', 'var', 'mark',
+ 'u', 'xm', 'wbr', 'nobr',
+ 'ruby',
+ 'span',
+ 'time',
+ );
+}
diff --git a/framework/3rdParty/SafeHtml/HTMLSax3.php b/framework/3rdParty/SafeHtml/HTMLSax3.php
index ff0bad63..262cf2ac 100644
--- a/framework/3rdParty/SafeHtml/HTMLSax3.php
+++ b/framework/3rdParty/SafeHtml/HTMLSax3.php
@@ -24,7 +24,6 @@
/**
* Main parser components
* @package System.Security.SafeHtml
-* @version $Id: HTMLSax3.php 3188 2012-07-12 12:13:23Z ctrlaltca $
*/
/**
* Required classes
@@ -367,7 +366,7 @@ class TSax3_StateParser_Lt430 extends TSax3_StateParser {
* @return void
*/
function ignoreWhitespace() {
- while ($this->position < $this->length &&
+ while ($this->position < $this->length &&
strpos(" \n\r\t", $this->rawtext{$this->position}) !== FALSE) {
$this->position++;
}
@@ -536,7 +535,7 @@ class TSax3 {
* <li>XML_OPTION_ENTITIES_UNPARSED: XML entities are returned as
* seperate data handler calls in unparsed form</li>
* <li>XML_OPTION_ENTITIES_PARSED: (PHP 4.3.0+ only) XML entities are
- * returned as seperate data handler calls and are parsed with
+ * returned as seperate data handler calls and are parsed with
* PHP's html_entity_decode() function</li>
* <li>XML_OPTION_STRIP_ESCAPES: strips out the -- -- comment markers
* or CDATA markup inside an XML escape, if found.</li>
diff --git a/framework/3rdParty/SafeHtml/HTMLSax3/Decorators.php b/framework/3rdParty/SafeHtml/HTMLSax3/Decorators.php
index 8a33c983..d300ae65 100644
--- a/framework/3rdParty/SafeHtml/HTMLSax3/Decorators.php
+++ b/framework/3rdParty/SafeHtml/HTMLSax3/Decorators.php
@@ -24,7 +24,6 @@
/**
* Decorators for dealing with parser options
* @package System.Security.SafeHtml
-* @version $Id: Decorators.php 3188 2012-07-12 12:13:23Z ctrlaltca $
* @see TSax3::set_option
*/
/**
diff --git a/framework/3rdParty/SafeHtml/HTMLSax3/States.php b/framework/3rdParty/SafeHtml/HTMLSax3/States.php
index 8afc5fb5..5001bb76 100644
--- a/framework/3rdParty/SafeHtml/HTMLSax3/States.php
+++ b/framework/3rdParty/SafeHtml/HTMLSax3/States.php
@@ -24,7 +24,6 @@
/**
* Parsing states.
* @package System.Security.SafeHtml
-* @version $Id: States.php 3188 2012-07-12 12:13:23Z ctrlaltca $
*/
/**
* Define parser states
@@ -133,7 +132,7 @@ class TSax3_OpeningTagState {
*/
function parseAttributes(&$context) {
$Attributes = array();
-
+
$context->ignoreWhitespace();
$attributename = $context->scanUntilCharacters("=/> \n\r\t");
while ($attributename != '') {
@@ -159,7 +158,7 @@ class TSax3_OpeningTagState {
$context->unscanCharacter();
}
$Attributes[$attributename] = $attributevalue;
-
+
$context->ignoreWhitespace();
$attributename = $context->scanUntilCharacters("=/> \n\r\t");
}
@@ -183,14 +182,14 @@ class TSax3_OpeningTagState {
$context->unscanCharacter();
}
$context->handler_object_element->
- {$context->handler_method_opening}($context->htmlsax, $tag,
+ {$context->handler_method_opening}($context->htmlsax, $tag,
$Attributes, TRUE);
$context->handler_object_element->
- {$context->handler_method_closing}($context->htmlsax, $tag,
+ {$context->handler_method_closing}($context->htmlsax, $tag,
TRUE);
} else {
$context->handler_object_element->
- {$context->handler_method_opening}($context->htmlsax, $tag,
+ {$context->handler_method_opening}($context->htmlsax, $tag,
$Attributes, FALSE);
}
}
diff --git a/framework/3rdParty/WsdlGen/Wsdl.php b/framework/3rdParty/WsdlGen/Wsdl.php
index 8cfee9cc..7344812b 100644
--- a/framework/3rdParty/WsdlGen/Wsdl.php
+++ b/framework/3rdParty/WsdlGen/Wsdl.php
@@ -12,7 +12,6 @@
*
* @author Marcus Nyeholt <tanus@users.sourceforge.net>
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: Wsdl.php 3314 2013-08-20 10:00:47Z ctrlaltca $
* @package System.Web.Services.SOAP
*/
diff --git a/framework/3rdParty/WsdlGen/WsdlGenerator.php b/framework/3rdParty/WsdlGen/WsdlGenerator.php
index 0bc2e6d4..e4624ef4 100644
--- a/framework/3rdParty/WsdlGen/WsdlGenerator.php
+++ b/framework/3rdParty/WsdlGen/WsdlGenerator.php
@@ -11,7 +11,6 @@
* This file is part of the PRADO framework from {@link http://www.xisc.com}
*
* @author Marcus Nyeholt <tanus@users.sourceforge.net>
- * @version $Id: WsdlGenerator.php 3314 2013-08-20 10:00:47Z ctrlaltca $
* @package System.Web.Services.SOAP
*/
diff --git a/framework/3rdParty/WsdlGen/WsdlMessage.php b/framework/3rdParty/WsdlGen/WsdlMessage.php
index 5e0391ef..3597c977 100644
--- a/framework/3rdParty/WsdlGen/WsdlMessage.php
+++ b/framework/3rdParty/WsdlGen/WsdlMessage.php
@@ -12,7 +12,6 @@
*
* @author Marcus Nyeholt <tanus@users.sourceforge.net>
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: WsdlMessage.php 3188 2012-07-12 12:13:23Z ctrlaltca $
* @package System.Web.Services.SOAP
*/
diff --git a/framework/3rdParty/WsdlGen/WsdlOperation.php b/framework/3rdParty/WsdlGen/WsdlOperation.php
index 5c9b4be5..91adbda4 100644
--- a/framework/3rdParty/WsdlGen/WsdlOperation.php
+++ b/framework/3rdParty/WsdlGen/WsdlOperation.php
@@ -12,7 +12,6 @@
*
* @author Marcus Nyeholt <tanus@users.sourceforge.net>
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: WsdlOperation.php 3188 2012-07-12 12:13:23Z ctrlaltca $
* @package System.Web.Services.SOAP
*/
diff --git a/framework/3rdParty/readme.html b/framework/3rdParty/readme.html
index 2855ba74..8e57dd4e 100644
--- a/framework/3rdParty/readme.html
+++ b/framework/3rdParty/readme.html
@@ -19,6 +19,30 @@ projects.
</tr>
<tr>
+ <td><a href="jQuery">jQuery</a></td>
+ <td><a href="http://jquery.com/">jQuery - Write less, do more</a></td>
+ <td><a href="http://jquery.org/license/">MIT License</a></td>
+ <td></td>
+ <td>Core of Prado javascript library.</td>
+</tr>
+
+<tr>
+ <td><a href="jQueryUI">jQuery UI</a></td>
+ <td><a href="http://jqueryui.com/">jQuery user interface</a></td>
+ <td><a href="http://jquery.org/license/">MIT License</a></td>
+ <td>System.Web.UI.JuiControls</td>
+ <td>jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.</td>
+</tr>
+
+<tr>
+ <td><a href="Low Pro JQ">Low Pro JQ</a></td>
+ <td><a href="http://github.com/danwrong/low-pro-for-jquery">jQuery - Write less, do more</a></td>
+ <td><a href="http://github.com/danwrong/low-pro-for-jquery/blob/master/MIT-LICENCE">MIT License</a></td>
+ <td></td>
+ <td> A jQuery port of the Low Pro behavior framework that was originally written for Prototype. Prado actually uses it as a base to emulate OOP subclassing, inheritance and contructor events.</td>
+</tr>
+
+<tr>
<td><a href="ReCaptcha">ReCaptcha</a></td>
<td><a href="http://www.google.com/recaptcha">ReCaptcha - Stop spam, read books</a></td>
<td><a href="ReCaptcha/LICENSE">BSD-like</a></td>
@@ -41,10 +65,10 @@ projects.
</tr>
<tr>
<td><a href="TinyMCE">TinyMCE</a></td>
- <td><a href="http://tinymce.moxiecode.com/">TinyMCE Javascript Content Editor</a> (v3.5.6)</td>
+ <td><a href="http://tinymce.moxiecode.com/">TinyMCE Javascript WYSIWYG Editor</a></td>
<td><a href="TinyMCE/license.txt">GNU LESSER GENERAL PUBLIC LICENSE</a></td>
- <td>System.Web.UI.WebControls.THtmlArea</td>
- <td>TinyMCE is a powerful WYSIWYG editor control for web browsers such as MSIE or Mozilla that enables the user to edit HTML contents in a more user friendly way.</td>
+ <td>System.Web.UI.WebControls.THtmlArea, System.Web.UI.WebControls.THtmlArea4</td>
+ <td>TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL. TinyMCE has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.</td>
</tr>
<tr>
<td>N.A.</td>
@@ -92,8 +116,8 @@ projects.
<td><a href="../Web/Javascripts/prototype/">../Web/Javascripts/prototype</a></td>
<td><a href="http://dev.rubyonrails.org/browser/spinoffs/prototype">Prototype javascript library</a></td>
<td><a href="../Web/Javascripts/prototype/LICENSE">The Prototype License (MIT based)</a></td>
- <td>N.A.</td>
- <td>Core of Prado javascript library.</td>
+ <td>System.Web.UI.TAutoComplete, TDraggable, TDropContainer</td>
+ <td>Prototype used to be the core of Prado javascript library. Now it's still supported for backwards compatibility</td>
</tr>
<tr>
<td><a href="../Web/Javascripts/prado/logger/logger.js">../Web/Javascripts/prado/logger/logger.js</a></td>
@@ -113,19 +137,11 @@ projects.
</tr>
<tr>
- <td><a href="adodb">adodb</a></td>
- <td><a href="http://adodb.sourceforge.net/">ADOdb Database Abstraction Library for PHP</a></td>
- <td><a href="adodb/license.txt">Dual licensed using BSD and LGPL.</a></td>
- <td>Provides one database access abstraction layer.</td>
- <td>Slightly modified to work nicely with E_STRICT in php 5.</td>
-</tr>
-
-<tr>
- <td><a href="Markdown">Markdown</a></td>
- <td><a href="http://www.michelf.com/projects/php-markdown/">PHP Markdown</a></td>
- <td><a href="Markdown/License.text">BSD</a></td>
+ <td><a href="Parsedown">Parsedown</a></td>
+ <td><a href="https://github.com/erusev/parsedown">Markdown Parser for PHP</a></td>
+ <td><a href="Parsedown/LICENSE.txt">MIT</a></td>
<td>System.Web.UI.WebControls.TMarkdown</td>
- <td>PHP5 class implementation of the PHP Markdown.</td>
+ <td>PHP implementation of Markdown, GitHub Flavored.</td>
</tr>
<tr>
diff --git a/framework/Caching/TAPCCache.php b/framework/Caching/TAPCCache.php
index 8826fac6..ec0aa35c 100644
--- a/framework/Caching/TAPCCache.php
+++ b/framework/Caching/TAPCCache.php
@@ -4,9 +4,8 @@
*
* @author Alban Hanry <compte_messagerie@hotmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TAPCCache.php 3281 2013-03-13 21:01:40Z ctrlaltca $
* @package System.Caching
*/
@@ -41,7 +40,6 @@
*
* @author Alban Hanry <compte_messagerie@hotmail.com>
* @author Knut Urdalen <knut.urdalen@gmail.com>
- * @version $Id: TAPCCache.php 3281 2013-03-13 21:01:40Z ctrlaltca $
* @package System.Caching
* @since 3.0b
*/
@@ -57,10 +55,10 @@ class TAPCCache extends TCache
{
if(!extension_loaded('apc'))
throw new TConfigurationException('apccache_extension_required');
-
+
if(ini_get('apc.enabled') == false)
- throw new TConfigurationException('apccache_extension_not_enabled');
-
+ throw new TConfigurationException('apccache_extension_not_enabled');
+
if(substr(php_sapi_name(), 0, 3) === 'cli' and ini_get('apc.enable_cli') == false)
throw new TConfigurationException('apccache_extension_not_enabled_cli');
diff --git a/framework/Caching/TCache.php b/framework/Caching/TCache.php
index 0a0ca2db..99b3f24c 100644
--- a/framework/Caching/TCache.php
+++ b/framework/Caching/TCache.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
*/
@@ -42,7 +41,6 @@ Prado::using('System.Collections.TList');
* the cache acts as an array.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.0
*/
@@ -313,7 +311,6 @@ abstract class TCache extends TModule implements ICache, ArrayAccess
* - {@link TChainedCacheDependency}: checks whether any of a list of dependencies is changed or not
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.1.0
*/
@@ -331,7 +328,6 @@ abstract class TCacheDependency extends TComponent implements ICacheDependency
* last modification time remains unchanged.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.1.0
*/
@@ -400,7 +396,6 @@ class TFileCacheDependency extends TCacheDependency
* to a certain depth of the subdirectories.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.1.0
*/
@@ -556,7 +551,6 @@ class TDirectoryCacheDependency extends TCacheDependency
* set {@link setStateName StateName} to the name of the global state.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.1.0
*/
@@ -617,7 +611,6 @@ class TGlobalStateCacheDependency extends TCacheDependency
* (see {@link TList} for more details}).
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.1.0
*/
@@ -667,7 +660,6 @@ class TChainedCacheDependency extends TCacheDependency
* will be checked.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.1.0
*/
@@ -694,7 +686,6 @@ class TApplicationStateCacheDependency extends TCacheDependency
* for more details.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.1.0
*/
diff --git a/framework/Caching/TDbCache.php b/framework/Caching/TDbCache.php
index 01962a55..c26066a2 100644
--- a/framework/Caching/TDbCache.php
+++ b/framework/Caching/TDbCache.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
*/
@@ -82,7 +81,6 @@ Prado::using('System.Data.TDbConnection');
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDbCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.1.0
*/
@@ -463,12 +461,12 @@ class TDbCache extends TCache
try {
$sql='SELECT value FROM '.$this->_cacheTable.' WHERE itemkey=\''.$key.'\' AND (expire=0 OR expire>'.time().') ORDER BY expire DESC';
$command=$this->getDbConnection()->createCommand($sql);
- return Prado::unserialize($command->queryScalar());
+ return unserialize($command->queryScalar());
}
catch(Exception $e)
{
$this->initializeCache(true);
- return Prado::unserialize($command->queryScalar());
+ return unserialize($command->queryScalar());
}
}
@@ -505,7 +503,7 @@ class TDbCache extends TCache
{
$command=$this->getDbConnection()->createCommand($sql);
$command->bindValue(':key',$key,PDO::PARAM_STR);
- $command->bindValue(':value',Prado::serialize($value),PDO::PARAM_LOB);
+ $command->bindValue(':value',serialize($value),PDO::PARAM_LOB);
$command->execute();
return true;
}
diff --git a/framework/Caching/TEACache.php b/framework/Caching/TEACache.php
index 6a20f63b..f57011a6 100644
--- a/framework/Caching/TEACache.php
+++ b/framework/Caching/TEACache.php
@@ -1 +1 @@
-<?php /** * TEACache class file * * @author Dario rigolin <drigolin@e-portaltech.it> * @link http://www.pradosoft.com/ * @copyright Copyright &copy; 2005-2013 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id: TEACache.php 3281 2013-03-13 19:31:03Z xue $ * @package System.Caching */ /** * TEACache class * * TEACache implements a cache application module based on {@link http://eaccelerator.net/ eAccelerator}. * * By definition, cache does not ensure the existence of a value * even if it never expires. Cache is not meant to be an persistent storage. * * To use this module, the eAccelerator PHP extension must be loaded and enabled * * Please note that as of v0.9.6, eAccelerator no longer supports data caching. * This means if you still want to use this component, your eAccelerator should be of 0.9.5.x or lower version. * * Some usage examples of TEACache are as follows, * <code> * $cache=new TEACache; // TEACache may also be loaded as a Prado application module * $cache->init(null); * $cache->add('object',$object); * $object2=$cache->get('object'); * </code> * * If loaded, TEACache will register itself with {@link TApplication} as the * cache module. It can be accessed via {@link TApplication::getCache()}. * * TEACache may be configured in application configuration file as follows * <code> * <module id="cache" class="System.Caching.TEACache" /> * </code> * * @author Dario Rigolin <drigolin@e-portaltech.it> * @version $Id: TEACache.php 3281 2013-03-13 19:31:03Z xue $ * @package System.Caching * @since 3.2.2 */ class TEACache extends TCache { /** * Initializes this module. * This method is required by the IModule interface. * @param TXmlElement configuration for this module, can be null * @throws TConfigurationException if eaccelerator extension is not installed or not started, check your php.ini */ public function init($config) { if(!function_exists('eaccelerator_get')) throw new TConfigurationException('eacceleratorcache_extension_required'); parent::init($config); } /** * Retrieves a value from cache with a specified key. * This is the implementation of the method declared in the parent class. * @param string a unique key identifying the cached value * @return string the value stored in cache, false if the value is not in the cache or expired. */ protected function getValue($key) { $value = eaccelerator_get($key); return ($value === null) ? false : $value; } /** * Stores a value identified by a key in cache. * This is the implementation of the method declared in the parent class. * * @param string the key identifying the value to be cached * @param string the value to be cached * @param integer the number of seconds in which the cached value will expire. 0 means never expire. * @return boolean true if the value is successfully stored into cache, false otherwise */ protected function setValue($key,$value,$expire) { return eaccelerator_put($key,$value,$expire); } /** * Stores a value identified by a key into cache if the cache does not contain this key. * This is the implementation of the method declared in the parent class. * * @param string the key identifying the value to be cached * @param string the value to be cached * @param integer the number of seconds in which the cached value will expire. 0 means never expire. * @return boolean true if the value is successfully stored into cache, false otherwise */ protected function addValue($key,$value,$expire) { return (null === eaccelerator_get($key)) ? $this->setValue($key,$value,$expire) : false; } /** * Deletes a value with the specified key from cache * This is the implementation of the method declared in the parent class. * @param string the key of the value to be deleted * @return boolean if no error happens during deletion */ protected function deleteValue($key) { return eaccelerator_rm($key); } /** * Deletes all values from cache. * Be careful of performing this operation if the cache is shared by multiple applications. */ public function flush() { // first, remove expired content from cache eaccelerator_gc(); // now, remove leftover cache-keys $keys = eaccelerator_list_keys(); foreach($keys as $key) $this->deleteValue(substr($key['name'], 1)); return true; } } \ No newline at end of file
+<?php /** * TEACache class file * * @author Dario rigolin <drigolin@e-portaltech.it> * @link http://www.pradosoft.com/ * @copyright Copyright &copy; 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @package System.Caching */ /** * TEACache class * * TEACache implements a cache application module based on {@link http://eaccelerator.net/ eAccelerator}. * * By definition, cache does not ensure the existence of a value * even if it never expires. Cache is not meant to be an persistent storage. * * To use this module, the eAccelerator PHP extension must be loaded and enabled * * Please note that as of v0.9.6, eAccelerator no longer supports data caching. * This means if you still want to use this component, your eAccelerator should be of 0.9.5.x or lower version. * * Some usage examples of TEACache are as follows, * <code> * $cache=new TEACache; // TEACache may also be loaded as a Prado application module * $cache->init(null); * $cache->add('object',$object); * $object2=$cache->get('object'); * </code> * * If loaded, TEACache will register itself with {@link TApplication} as the * cache module. It can be accessed via {@link TApplication::getCache()}. * * TEACache may be configured in application configuration file as follows * <code> * <module id="cache" class="System.Caching.TEACache" /> * </code> * * @author Dario Rigolin <drigolin@e-portaltech.it> * @package System.Caching * @since 3.2.2 */ class TEACache extends TCache { /** * Initializes this module. * This method is required by the IModule interface. * @param TXmlElement configuration for this module, can be null * @throws TConfigurationException if eaccelerator extension is not installed or not started, check your php.ini */ public function init($config) { if(!function_exists('eaccelerator_get')) throw new TConfigurationException('eacceleratorcache_extension_required'); parent::init($config); } /** * Retrieves a value from cache with a specified key. * This is the implementation of the method declared in the parent class. * @param string a unique key identifying the cached value * @return string the value stored in cache, false if the value is not in the cache or expired. */ protected function getValue($key) { $value = eaccelerator_get($key); return ($value === null) ? false : $value; } /** * Stores a value identified by a key in cache. * This is the implementation of the method declared in the parent class. * * @param string the key identifying the value to be cached * @param string the value to be cached * @param integer the number of seconds in which the cached value will expire. 0 means never expire. * @return boolean true if the value is successfully stored into cache, false otherwise */ protected function setValue($key,$value,$expire) { return eaccelerator_put($key,$value,$expire); } /** * Stores a value identified by a key into cache if the cache does not contain this key. * This is the implementation of the method declared in the parent class. * * @param string the key identifying the value to be cached * @param string the value to be cached * @param integer the number of seconds in which the cached value will expire. 0 means never expire. * @return boolean true if the value is successfully stored into cache, false otherwise */ protected function addValue($key,$value,$expire) { return (null === eaccelerator_get($key)) ? $this->setValue($key,$value,$expire) : false; } /** * Deletes a value with the specified key from cache * This is the implementation of the method declared in the parent class. * @param string the key of the value to be deleted * @return boolean if no error happens during deletion */ protected function deleteValue($key) { return eaccelerator_rm($key); } /** * Deletes all values from cache. * Be careful of performing this operation if the cache is shared by multiple applications. */ public function flush() { // first, remove expired content from cache eaccelerator_gc(); // now, remove leftover cache-keys $keys = eaccelerator_list_keys(); foreach($keys as $key) $this->deleteValue(substr($key['name'], 1)); return true; } } \ No newline at end of file
diff --git a/framework/Caching/TMemCache.php b/framework/Caching/TMemCache.php
index 8d2e6a4b..c2d4901b 100644
--- a/framework/Caching/TMemCache.php
+++ b/framework/Caching/TMemCache.php
@@ -5,9 +5,8 @@
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMemCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
*/
@@ -77,7 +76,6 @@
* NB : MemCache server(s) must be restarted to apply settings. Require (PECL memcache >= 2.0.0).
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TMemCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.0
*/
@@ -109,11 +107,11 @@ class TMemCache extends TCache
private $_persistence = true;
/**
* @var integer number of buckets to create for this server which in turn control its
- * probability of it being selected. The probability is relative to the total weight
+ * probability of it being selected. The probability is relative to the total weight
* of all servers.
*/
private $_weight = 1;
-
+
private $_timeout = 360;
private $_retryInterval = 15;
@@ -126,9 +124,9 @@ class TMemCache extends TCache
* @var float Specifies the minimum amount of savings to actually store the value compressed. The supplied value must be between 0 and 1. Default value is 0.2 giving a minimum 20% compression savings.
*/
private $_minSavings=0.0;
-
+
private $_status = true;
-
+
private $_failureCallback = null;
/**
@@ -176,13 +174,13 @@ class TMemCache extends TCache
Prado::trace('Adding server '.$this->_host, 'System.Caching.TMemCache');
if($this->_cache->addServer($this->_host,$this->_port)===false)
throw new TConfigurationException('memcache_connection_failed',$this->_host,$this->_port);
- }
+ }
if($this->_threshold!==0)
- $this->_cache->setCompressThreshold($this->_threshold,$this->_minSavings);
+ $this->_cache->setCompressThreshold($this->_threshold,$this->_minSavings);
$this->_initialized=true;
parent::init($config);
}
-
+
/**
* Loads configuration from an XML element
* @param TXmlElement configuration node
@@ -209,7 +207,7 @@ class TMemCache extends TCache
);
foreach($checks as $property=>$exception)
{
- $value=$properties->remove($property);
+ $value=$properties->remove($property);
if($value!==null && is_numeric($value))
$server[$property]=$value;
else if($value!==null)
@@ -268,7 +266,7 @@ class TMemCache extends TCache
{
return $this->_threshold;
}
-
+
/**
* @param integer minimum value length before attempting to compress
* @throws TInvalidOperationException if the module is already initialized
@@ -280,7 +278,7 @@ class TMemCache extends TCache
else
$this->_threshold=TPropertyValue::ensureInteger($value);
}
-
+
/**
* @return float minimum amount of savings to actually store the value compressed
*/
@@ -288,7 +286,7 @@ class TMemCache extends TCache
{
return $this->_minSavings;
}
-
+
/**
* @param float minimum amount of savings to actually store the value compressed
* @throws TInvalidOperationException if the module is already initialized
@@ -300,7 +298,7 @@ class TMemCache extends TCache
else
$this->_minSavings=TPropertyValue::ensureFloat($value);
}
-
+
/**
* Retrieves a value from cache with a specified key.
* This is the implementation of the method declared in the parent class.
diff --git a/framework/Caching/TSqliteCache.php b/framework/Caching/TSqliteCache.php
index a00a8472..3c11d45f 100644
--- a/framework/Caching/TSqliteCache.php
+++ b/framework/Caching/TSqliteCache.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqliteCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
*/
@@ -67,7 +66,6 @@
* SQLite DB file (in the namespace format).
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TSqliteCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.0
*/
@@ -163,7 +161,7 @@ class TSqliteCache extends TCache
{
$sql='SELECT value FROM '.self::CACHE_TABLE.' WHERE key=\''.$key.'\' AND (expire=0 OR expire>'.time().') LIMIT 1';
if(($ret=$this->_db->query($sql))!=false && ($row=$ret->fetch(SQLITE_ASSOC))!==false)
- return Prado::unserialize($row['value']);
+ return unserialize($row['value']);
else
return false;
}
@@ -180,7 +178,7 @@ class TSqliteCache extends TCache
protected function setValue($key,$value,$expire)
{
$expire=($expire<=0)?0:time()+$expire;
- $sql='REPLACE INTO '.self::CACHE_TABLE.' VALUES(\''.$key.'\',\''.sqlite_escape_string(Prado::serialize($value)).'\','.$expire.')';
+ $sql='REPLACE INTO '.self::CACHE_TABLE.' VALUES(\''.$key.'\',\''.sqlite_escape_string(serialize($value)).'\','.$expire.')';
return $this->_db->query($sql)!==false;
}
@@ -196,7 +194,7 @@ class TSqliteCache extends TCache
protected function addValue($key,$value,$expire)
{
$expire=($expire<=0)?0:time()+$expire;
- $sql='INSERT INTO '.self::CACHE_TABLE.' VALUES(\''.$key.'\',\''.sqlite_escape_string(Prado::serialize($value)).'\','.$expire.')';
+ $sql='INSERT INTO '.self::CACHE_TABLE.' VALUES(\''.$key.'\',\''.sqlite_escape_string(serialize($value)).'\','.$expire.')';
return @$this->_db->query($sql)!==false;
}
diff --git a/framework/Caching/TXCache.php b/framework/Caching/TXCache.php
index e86c8fa9..b29fd38c 100644
--- a/framework/Caching/TXCache.php
+++ b/framework/Caching/TXCache.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TXCache.php 1994 2007-06-11 16:02:28Z knut $
* @package System.Caching
*/
@@ -37,7 +36,6 @@
* </code>
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TXCache.php 1994 2007-06-11 16:02:28Z knut $
* @package System.Caching
* @since 3.1.1
*/
diff --git a/framework/Collections/TAttributeCollection.php b/framework/Collections/TAttributeCollection.php
index d72640f2..775ad054 100644
--- a/framework/Collections/TAttributeCollection.php
+++ b/framework/Collections/TAttributeCollection.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TAttributeCollection.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
*/
@@ -38,7 +37,6 @@ Prado::using('System.Collections.TMap');
* in the collection storage.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TAttributeCollection.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
diff --git a/framework/Collections/TDummyDataSource.php b/framework/Collections/TDummyDataSource.php
index bf74dbec..7345982a 100644
--- a/framework/Collections/TDummyDataSource.php
+++ b/framework/Collections/TDummyDataSource.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDummyDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
*/
@@ -22,7 +21,6 @@
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDummyDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
@@ -76,7 +74,6 @@ class TDummyDataSource extends TComponent implements IteratorAggregate, Countabl
* for traversing its dummy items.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDummyDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
diff --git a/framework/Collections/TList.php b/framework/Collections/TList.php
index b82f676e..765fa2ce 100644
--- a/framework/Collections/TList.php
+++ b/framework/Collections/TList.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
*/
@@ -32,7 +31,6 @@
* operation, override {@link insertAt()}, and {@link removeAt()}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
@@ -252,7 +250,7 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl
}
/**
- * Finds the base item. If found, the item is inserted before it.
+ * Finds the base item. If found, the item is inserted before it.
* @param mixed the base item which will be pushed back by the second parameter
* @param mixed the item
* @return int the index where the item is inserted
@@ -266,9 +264,9 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl
{
if(($index = $this->indexOf($baseitem)) == -1)
throw new TInvalidDataValueException('list_item_inexistent');
-
+
$this->insertAt($index, $item);
-
+
return $index;
}
else
@@ -276,7 +274,7 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl
}
/**
- * Finds the base item. If found, the item is inserted after it.
+ * Finds the base item. If found, the item is inserted after it.
* @param mixed the base item which comes before the second parameter when added to the list
* @param mixed the item
* @return int the index where the item is inserted
@@ -290,9 +288,9 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl
{
if(($index = $this->indexOf($baseitem)) == -1)
throw new TInvalidDataValueException('list_item_inexistent');
-
+
$this->insertAt($index + 1, $item);
-
+
return $index + 1;
}
else
@@ -402,10 +400,9 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl
*
* TListIterator is used by TList. It allows TList to return a new iterator
* for traversing the items in the list.
- *
- * @deprecated Issue 264 : ArrayIterator should be used instead
+ *
+ * @deprecated Issue 264 : ArrayIterator should be used instead
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
diff --git a/framework/Collections/TListItemCollection.php b/framework/Collections/TListItemCollection.php
index 23d5ade8..90a1fbf1 100644
--- a/framework/Collections/TListItemCollection.php
+++ b/framework/Collections/TListItemCollection.php
@@ -6,9 +6,8 @@
* @author Robin J. Rogge <rojaro@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TListControl.php 2624 2009-03-19 21:20:47Z godzilla80@gmx.net $
* @package System.Collections
*/
@@ -24,7 +23,6 @@ Prado::using('System.Web.UI.WebControls.TListItem');
* TListItemCollection maintains a list of {@link TListItem} for {@link TListControl}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TListControl.php 2624 2009-03-19 21:20:47Z godzilla80@gmx.net $
* @package System.Collections
* @since 3.0
*/
diff --git a/framework/Collections/TMap.php b/framework/Collections/TMap.php
index d5f2ffce..a0ae8d5b 100644
--- a/framework/Collections/TMap.php
+++ b/framework/Collections/TMap.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
*/
@@ -28,7 +27,6 @@
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
@@ -272,9 +270,8 @@ class TMap extends TComponent implements IteratorAggregate,ArrayAccess,Countable
* TMapIterator is used by TMap. It allows TMap to return a new iterator
* for traversing the items in the map.
*
- * @deprecated Issue 264 : ArrayIterator should be used instead
+ * @deprecated Issue 264 : ArrayIterator should be used instead
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
diff --git a/framework/Collections/TPagedDataSource.php b/framework/Collections/TPagedDataSource.php
index 60d2736b..745fc052 100644
--- a/framework/Collections/TPagedDataSource.php
+++ b/framework/Collections/TPagedDataSource.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPagedDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
*/
@@ -24,7 +23,6 @@
* within the specified page will be returned and traversed.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPagedDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
@@ -277,7 +275,6 @@ class TPagedDataSource extends TComponent implements IteratorAggregate,Countable
* to return a new iterator for traversing the items in a {@link TList} object.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPagedDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
@@ -363,7 +360,6 @@ class TPagedListIterator implements Iterator
* to return a new iterator for traversing the items in a {@link TMap} object.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPagedDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
diff --git a/framework/Collections/TPagedList.php b/framework/Collections/TPagedList.php
index ff03606f..57e567e0 100644
--- a/framework/Collections/TPagedList.php
+++ b/framework/Collections/TPagedList.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPagedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
*/
@@ -51,7 +50,6 @@
*
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPagedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
@@ -372,7 +370,6 @@ class TPagedList extends TList
* To obtain the page index before it was changed, use {@link getOldPageIndex OldPageIndex}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPagedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
@@ -410,7 +407,6 @@ class TPagedListPageChangedEventParameter extends TEventParameter
* Newly fetched data should be saved in {@link setData Data} property.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPagedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
diff --git a/framework/Collections/TPriorityList.php b/framework/Collections/TPriorityList.php
index 1ccbd9ce..6a66b5be 100644
--- a/framework/Collections/TPriorityList.php
+++ b/framework/Collections/TPriorityList.php
@@ -4,21 +4,20 @@
*
* @author Brad Anderson <javalizard@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPriorityList.php 2541 2008-10-21 15:05:13Z javalizard $
* @package System.Collections
*/
/**
* TPriorityList class
*
- * TPriorityList implements a priority ordered list collection class. It allows you to specify
- * any numeric for priorities down to a specific precision. The lower the numeric, the high the priority of the item in the
- * list. Thus -10 has a higher priority than -5, 0, 10 (the default), 18, 10005, etc. Per {@link round}, precision may be negative and
- * thus rounding can go by 10, 100, 1000, etc, instead of just .1, .01, .001, etc. The default precision allows for 8 decimal
- * places. There is also a default priority of 10, if no different default priority is specified or no item specific priority is indicated.
- * If you replace TList with this class it will work exactly the same with items inserted set to the default priority, until you start
+ * TPriorityList implements a priority ordered list collection class. It allows you to specify
+ * any numeric for priorities down to a specific precision. The lower the numeric, the high the priority of the item in the
+ * list. Thus -10 has a higher priority than -5, 0, 10 (the default), 18, 10005, etc. Per {@link round}, precision may be negative and
+ * thus rounding can go by 10, 100, 1000, etc, instead of just .1, .01, .001, etc. The default precision allows for 8 decimal
+ * places. There is also a default priority of 10, if no different default priority is specified or no item specific priority is indicated.
+ * If you replace TList with this class it will work exactly the same with items inserted set to the default priority, until you start
* using different priorities than the default priority.
*
* As you access the PHP array features of this class, it flattens and caches the results. If at all possible, this
@@ -39,15 +38,14 @@
* $n=count($list); // returns the number of items in the list
* </code>
*
- * To extend TPriorityList for doing your own operations with each addition or removal,
+ * To extend TPriorityList for doing your own operations with each addition or removal,
* override {@link insertAtIndexInPriority()} and {@link removeAtIndexInPriority()} and then call the parent.
*
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: TPriorityList.php 2541 2008-10-21 15:05:13Z javalizard $
* @package System.Collections
* @since 3.2a
*/
-class TPriorityList extends TList
+class TPriorityList extends TList
{
/**
* @var array internal data storage
@@ -73,7 +71,7 @@ class TPriorityList extends TList
* @var integer the precision of the numeric priorities within this priority list.
*/
private $_p=8;
-
+
/**
* Constructor.
* Initializes the list with an array or an iterable object.
@@ -92,7 +90,7 @@ class TPriorityList extends TList
$this->setPrecision($precision);
$this->setDefaultPriority($defaultPriority);
}
-
+
/**
* Returns the number of items in the list.
* This method is required by Countable interface.
@@ -102,7 +100,7 @@ class TPriorityList extends TList
{
return $this->getCount();
}
-
+
/**
* Returns the total number of items in the list
* @return integer the number of items in the list
@@ -111,7 +109,7 @@ class TPriorityList extends TList
{
return $this->_c;
}
-
+
/**
* Gets the number of items at a priority within the list
* @param numeric optional priority at which to count items. if no parameter, it will be set to the default {@link getDefaultPriority}
@@ -122,12 +120,12 @@ class TPriorityList extends TList
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p);
-
+
if(!isset($this->_d[$priority]) || !is_array($this->_d[$priority]))
return false;
return count($this->_d[$priority]);
}
-
+
/**
* @return numeric gets the default priority of inserted items without a specified priority
*/
@@ -135,7 +133,7 @@ class TPriorityList extends TList
{
return $this->_dp;
}
-
+
/**
* This must be called internally or when instantiated.
* @param numeric sets the default priority of inserted items without a specified priority
@@ -144,7 +142,7 @@ class TPriorityList extends TList
{
$this->_dp=(string)round(TPropertyValue::ensureFloat($value),$this->_p);
}
-
+
/**
* @return integer The precision of numeric priorities, defaults to 8
*/
@@ -152,7 +150,7 @@ class TPriorityList extends TList
{
return $this->_p;
}
-
+
/**
* This must be called internally or when instantiated.
* @param integer The precision of numeric priorities.
@@ -161,7 +159,7 @@ class TPriorityList extends TList
{
$this->_p=TPropertyValue::ensureInteger($value);
}
-
+
/**
* Returns an iterator for traversing the items in the list.
* This method is required by the interface IteratorAggregate.
@@ -171,7 +169,7 @@ class TPriorityList extends TList
{
return new ArrayIterator($this->flattenPriorities());
}
-
+
/**
* This returns a list of the priorities within this list, ordered lowest to highest.
* @return array the array of priority numerics in decreasing priority order
@@ -181,8 +179,8 @@ class TPriorityList extends TList
$this->sortPriorities();
return array_keys($this->_d);
}
-
-
+
+
/**
* This orders the priority list internally.
*/
@@ -194,20 +192,20 @@ class TPriorityList extends TList
}
/**
- * This flattens the priority list into a flat array [0,...,n-1]
+ * This flattens the priority list into a flat array [0,...,n-1]
* @return array array of items in the list in priority and index order
*/
protected function flattenPriorities() {
if(is_array($this->_fd))
return $this->_fd;
-
+
$this->sortPriorities();
$this->_fd=array();
foreach($this->_d as $priority => $itemsatpriority)
$this->_fd=array_merge($this->_fd,$itemsatpriority);
return $this->_fd;
}
-
+
/**
* Returns the item at the index of a flattened priority list.
@@ -235,7 +233,7 @@ class TPriorityList extends TList
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p);
-
+
return isset($this->_d[$priority])?$this->_d[$priority]:null;
}
@@ -250,14 +248,14 @@ class TPriorityList extends TList
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority), $this->_p);
-
+
return !isset($this->_d[$priority])?false:(
isset($this->_d[$priority][$index])?$this->_d[$priority][$index]:false
);
}
/**
- * Appends an item into the list at the end of the specified priority. The position of the added item may
+ * Appends an item into the list at the end of the specified priority. The position of the added item may
* not be at the end of the list.
* @param mixed item to add into the list at priority
* @param numeric priority blank or null for the default priority
@@ -268,7 +266,7 @@ class TPriorityList extends TList
{
if($this->getReadOnly())
throw new TInvalidOperationException('list_readonly',get_class($this));
-
+
return $this->insertAtIndexInPriority($item,false,$priority,true);
}
@@ -284,7 +282,7 @@ class TPriorityList extends TList
{
if($this->getReadOnly())
throw new TInvalidOperationException('list_readonly',get_class($this));
-
+
if(($priority=$this->priorityAt($index,true))!==false)
$this->insertAtIndexInPriority($item,$priority[1],$priority[0]);
else
@@ -292,7 +290,7 @@ class TPriorityList extends TList
}
/**
- * Inserts an item at the specified index within a priority. Override and call this method to
+ * Inserts an item at the specified index within a priority. Override and call this method to
* insert your own functionality.
* @param mixed item to add within the list.
* @param integer index within the priority to add the item, defaults to false which appends the item at the priority
@@ -305,11 +303,11 @@ class TPriorityList extends TList
{
if($this->getReadOnly())
throw new TInvalidOperationException('list_readonly',get_class($this));
-
+
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority), $this->_p);
-
+
if($preserveCache) {
$this->sortPriorities();
$cc=0;
@@ -318,7 +316,7 @@ class TPriorityList extends TList
break;
else
$cc+=count($items);
-
+
if($index===false&&isset($this->_d[$priority])) {
$c=count($this->_d[$priority]);
$c+=$cc;
@@ -331,7 +329,7 @@ class TPriorityList extends TList
$this->_o = false;
$this->_d[$priority]=array($item);
}
-
+
if($this->_fd&&is_array($this->_fd)) // if there is a flattened array cache
array_splice($this->_fd,$c,0,array($item));
} else {
@@ -352,13 +350,13 @@ class TPriorityList extends TList
else
$this->_fd=null;
}
-
+
$this->_c++;
-
+
return $c;
-
+
}
-
+
/**
* Removes an item from the priority list.
@@ -373,14 +371,14 @@ class TPriorityList extends TList
{
if($this->getReadOnly())
throw new TInvalidOperationException('list_readonly',get_class($this));
-
+
if(($p=$this->priorityOf($item,true))!==false)
{
if($priority!==false) {
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p);
-
+
if($p[0]!=$priority)
throw new TInvalidDataValueException('list_item_inexistent');
}
@@ -402,14 +400,14 @@ class TPriorityList extends TList
{
if($this->getReadOnly())
throw new TInvalidOperationException('list_readonly',get_class($this));
-
+
if(($priority=$this->priorityAt($index, true))!==false)
return $this->removeAtIndexInPriority($priority[1],$priority[0]);
throw new TInvalidDataValueException('list_index_invalid',$index);
}
/**
- * Removes the item at a specific index within a priority. Override
+ * Removes the item at a specific index within a priority. Override
* and call this method to insert your own functionality.
* @param integer index of item to remove within the priority.
* @param numeric priority of the item to remove, defaults to null, or left blank, it is then set to the default priority
@@ -420,21 +418,21 @@ class TPriorityList extends TList
{
if($this->getReadOnly())
throw new TInvalidOperationException('list_readonly',get_class($this));
-
+
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p);
-
+
if(!isset($this->_d[$priority])||$index<0||$index>=count($this->_d[$priority]))
throw new TInvalidDataValueException('list_item_inexistent');
-
+
// $value is an array of elements removed, only one
$value=array_splice($this->_d[$priority],$index,1);
$value=$value[0];
-
+
if(!count($this->_d[$priority]))
unset($this->_d[$priority]);
-
+
$this->_c--;
$this->_fd=null;
return $value;
@@ -447,7 +445,7 @@ class TPriorityList extends TList
{
if($this->getReadOnly())
throw new TInvalidOperationException('list_readonly',get_class($this));
-
+
$d=array_reverse($this->_d,true);
foreach($this->_d as $priority=>$items) {
for($index=count($items)-1;$index>=0;$index--)
@@ -489,17 +487,17 @@ class TPriorityList extends TList
public function priorityOf($item,$withindex = false)
{
$this->sortPriorities();
-
+
$absindex = 0;
foreach($this->_d as $priority=>$items) {
if(($index=array_search($item,$items,true))!==false) {
$absindex+=$index;
- return $withindex?array($priority,$index,$absindex,
+ return $withindex?array($priority,$index,$absindex,
'priority'=>$priority,'index'=>$index,'absindex'=>$absindex):$priority;
} else
$absindex+=count($items);
}
-
+
return false;
}
@@ -516,21 +514,21 @@ class TPriorityList extends TList
{
if($index<0||$index>=$this->getCount())
throw new TInvalidDataValueException('list_index_invalid',$index);
-
+
$absindex=$index;
$this->sortPriorities();
foreach($this->_d as $priority=>$items) {
if($index>=($c=count($items)))
$index-=$c;
else
- return $withindex?array($priority,$index,$absindex,
+ return $withindex?array($priority,$index,$absindex,
'priority'=>$priority,'index'=>$index,'absindex'=>$absindex):$priority;
}
return false;
}
/**
- * This inserts an item before another item within the list. It uses the same priority as the
+ * This inserts an item before another item within the list. It uses the same priority as the
* found index item and places the new item before it.
* @param mixed indexitem the item to index
* @param mixed the item to add before indexitem
@@ -541,17 +539,17 @@ class TPriorityList extends TList
{
if($this->getReadOnly())
throw new TInvalidOperationException('list_readonly',get_class($this));
-
+
if(($priority=$this->priorityOf($indexitem,true))===false)
throw new TInvalidDataValueException('list_item_inexistent');
-
+
$this->insertAtIndexInPriority($item,$priority[1],$priority[0]);
-
+
return $priority[2];
}
/**
- * This inserts an item after another item within the list. It uses the same priority as the
+ * This inserts an item after another item within the list. It uses the same priority as the
* found index item and places the new item after it.
* @param mixed indexitem the item to index
* @param mixed the item to add after indexitem
@@ -562,12 +560,12 @@ class TPriorityList extends TList
{
if($this->getReadOnly())
throw new TInvalidOperationException('list_readonly',get_class($this));
-
+
if(($priority=$this->priorityOf($indexitem,true))===false)
throw new TInvalidDataValueException('list_item_inexistent');
-
+
$this->insertAtIndexInPriority($item,$priority[1]+1,$priority[0]);
-
+
return $priority[2]+1;
}
@@ -592,7 +590,7 @@ class TPriorityList extends TList
* Combines the map elements which have a priority below the parameter value
* @param numeric the cut-off priority. All items of priority less than this are returned.
* @param boolean whether or not the input cut-off priority is inclusive. Default: false, not inclusive.
- * @return array the array of priorities keys with values of arrays of items that are below a specified priority.
+ * @return array the array of priorities keys with values of arrays of items that are below a specified priority.
* The priorities are sorted so important priorities, lower numerics, are first.
*/
public function toArrayBelowPriority($priority,$inclusive=false)
@@ -612,7 +610,7 @@ class TPriorityList extends TList
* Combines the map elements which have a priority above the parameter value
* @param numeric the cut-off priority. All items of priority greater than this are returned.
* @param boolean whether or not the input cut-off priority is inclusive. Default: true, inclusive.
- * @return array the array of priorities keys with values of arrays of items that are above a specified priority.
+ * @return array the array of priorities keys with values of arrays of items that are above a specified priority.
* The priorities are sorted so important priorities, lower numerics, are first.
*/
public function toArrayAbovePriority($priority,$inclusive=true)
@@ -627,7 +625,7 @@ class TPriorityList extends TList
}
return $items;
}
-
+
/**
* Copies iterable data into the priority list.
@@ -658,7 +656,7 @@ class TPriorityList extends TList
/**
* Merges iterable data into the priority list.
* New data will be appended to the end of the existing data. If another TPriorityList is merged,
- * the incoming parameter items will be appended at the priorities they are present. These items will be added
+ * the incoming parameter items will be appended at the priorities they are present. These items will be added
* to the end of the existing items with equal priorities, if there are any.
* @param mixed the data to be merged with, must be an array or object implementing Traversable
* @throws TInvalidDataTypeException If data is neither an array nor an iterator.
@@ -677,7 +675,7 @@ class TPriorityList extends TList
{
foreach($data as $priority=>$item)
$this->add($item);
-
+
}
else if($data!==null)
throw new TInvalidDataTypeException('map_data_not_iterable');
@@ -707,12 +705,12 @@ class TPriorityList extends TList
/**
* Sets the element at the specified offset. This method is required by the interface ArrayAccess.
- * Setting elements in a priority list is not straight forword when appending and setting at the
+ * Setting elements in a priority list is not straight forword when appending and setting at the
* end boundary. When appending without an offset (a null offset), the item will be added at
* the default priority. The item may not be the last item in the list. When appending with an
* offset equal to the count of the list, the item will get be appended with the last items priority.
*
- * All together, when setting the location of an item, the item stays in that location, but appending
+ * All together, when setting the location of an item, the item stays in that location, but appending
* an item into a priority list doesn't mean the item is at the end of the list.
* @param integer the offset to set element
* @param mixed the element value
diff --git a/framework/Collections/TPriorityMap.php b/framework/Collections/TPriorityMap.php
index 46f05e9e..352e56ff 100644
--- a/framework/Collections/TPriorityMap.php
+++ b/framework/Collections/TPriorityMap.php
@@ -4,27 +4,26 @@
*
* @author Brad Anderson <javalizard@mac.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPriorityMap.php 2817 2010-04-18 04:25:03Z javalizard $
* @package System.Collections
*/
/**
* TPriorityMap class
*
- * TPriorityMap implements a collection that takes key-value pairs with
- * a priority to allow key-value pairs to be ordered. This ordering is
+ * TPriorityMap implements a collection that takes key-value pairs with
+ * a priority to allow key-value pairs to be ordered. This ordering is
* important when flattening the map. When flattening the map, if some
- * key-value pairs are required to be before or after others, use this
+ * key-value pairs are required to be before or after others, use this
* class to keep order to your map.
*
* You can access, add or remove an item with a key by using
- * {@link itemAt}, {@link add}, and {@link remove}. These functions
- * can optionally take a priority parameter to allow access to specific
- * priorities. TPriorityMap is functionally backward compatible
+ * {@link itemAt}, {@link add}, and {@link remove}. These functions
+ * can optionally take a priority parameter to allow access to specific
+ * priorities. TPriorityMap is functionally backward compatible
* with {@link TMap}.
- *
+ *
* To get the number of the items in the map, use {@link getCount}.
* TPriorityMap can also be used like a regular array as follows,
* <code>
@@ -39,19 +38,18 @@
*
* An item that doesn't specify a priority will receive the default
* priority. The default priority is set during the instantiation
- * of a new TPriorityMap. If no custom default priority is specified,
+ * of a new TPriorityMap. If no custom default priority is specified,
* the standard default priority of 10 is used.
*
* Priorities with significant digits below precision will be rounded.
*
- * A priority may also be a numeric with decimals. This is set
- * during the instantiation of a new TPriorityMap.
+ * A priority may also be a numeric with decimals. This is set
+ * during the instantiation of a new TPriorityMap.
* The default is 8 decimal places for a priority. If a negative number
* is used, rounding occurs into the integer space rather than in
* the decimal space. See {@link round}.
*
* @author Brad Anderson <javalizard@mac.com>
- * @version $Id: TPriorityMap.php 2817 2010-04-18 04:25:03Z javalizard $
* @package System.Collections
* @since 3.2a
*/
@@ -121,7 +119,7 @@ class TPriorityMap extends TMap
{
$this->_r=TPropertyValue::ensureBoolean($value);
}
-
+
/**
* @return numeric gets the default priority of inserted items without a specified priority
*/
@@ -129,7 +127,7 @@ class TPriorityMap extends TMap
{
return $this->_dp;
}
-
+
/**
* This must be called internally or when instantiated.
* @param numeric sets the default priority of inserted items without a specified priority
@@ -138,7 +136,7 @@ class TPriorityMap extends TMap
{
$this->_dp = (string)round(TPropertyValue::ensureFloat($value), $this->_p);
}
-
+
/**
* @return integer The precision of numeric priorities, defaults to 8
*/
@@ -146,7 +144,7 @@ class TPriorityMap extends TMap
{
return $this->_p;
}
-
+
/**
* This must be called internally or when instantiated.
* @param integer The precision of numeric priorities.
@@ -165,8 +163,8 @@ class TPriorityMap extends TMap
{
return new ArrayIterator($this->flattenPriorities());
}
-
-
+
+
/**
* Orders the priority list internally.
*/
@@ -184,7 +182,7 @@ class TPriorityMap extends TMap
protected function flattenPriorities() {
if(is_array($this->_fd))
return $this->_fd;
-
+
$this->sortPriorities();
$this->_fd = array();
foreach($this->_d as $priority => $itemsatpriority)
@@ -209,10 +207,10 @@ class TPriorityMap extends TMap
{
return $this->_c;
}
-
+
/**
* Gets the number of items at a priority within the map.
- * @param numeric optional priority at which to count items. if no parameter,
+ * @param numeric optional priority at which to count items. if no parameter,
* it will be set to the default {@link getDefaultPriority}
* @return integer the number of items in the map at the specified priority
*/
@@ -221,12 +219,12 @@ class TPriorityMap extends TMap
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p);
-
+
if(!isset($this->_d[$priority])||!is_array($this->_d[$priority]))
return false;
return count($this->_d[$priority]);
}
-
+
/**
* This returns a list of the priorities within this map, ordered lowest to highest.
* @return array the array of priority numerics in decreasing priority order
@@ -250,7 +248,7 @@ class TPriorityMap extends TMap
* Returns the item with the specified key. If a priority is specified, only items
* within that specific priority will be selected
* @param mixed the key
- * @param mixed the priority. null is the default priority, false is any priority,
+ * @param mixed the priority. null is the default priority, false is any priority,
* and numeric is a specific priority. default: false, any priority.
* @return mixed the element at the offset, null if no element is found at the offset
*/
@@ -279,7 +277,7 @@ class TPriorityMap extends TMap
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p);
-
+
$oldpriority=$this->priorityAt($key);
if($oldpriority!==false&&$oldpriority!=$priority) {
$value=$this->remove($key,$oldpriority);
@@ -298,7 +296,7 @@ class TPriorityMap extends TMap
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p);
-
+
return isset($this->_d[$priority])?$this->_d[$priority]:null;
}
@@ -348,7 +346,7 @@ class TPriorityMap extends TMap
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p);
-
+
if(!$this->_r)
{
foreach($this->_d as $innerpriority=>$items)
@@ -376,11 +374,11 @@ class TPriorityMap extends TMap
/**
* Removes an item from the map by its key. If no priority, or false, is specified
* then priority is irrelevant. If null is used as a parameter for priority, then
- * the priority will be the default priority. If a priority is specified, or
+ * the priority will be the default priority. If a priority is specified, or
* the default priority is specified, only key-value pairs in that priority
* will be affected.
* @param mixed the key of the item to be removed
- * @param numeric|false|null priority. False is any priority, null is the
+ * @param numeric|false|null priority. False is any priority, null is the
* default priority, and numeric is a specific priority
* @return mixed the removed value, null if no such key exists.
* @throws TInvalidOperationException if the map is read-only
@@ -391,7 +389,7 @@ class TPriorityMap extends TMap
{
if($priority===null)
$priority=$this->getDefaultPriority();
-
+
if($priority===false)
{
$this->sortPriorities();
@@ -455,8 +453,8 @@ class TPriorityMap extends TMap
}
/**
- * When the map is flattened into an array, the priorities are taken into
- * account and elements of the map are ordered in the array according to
+ * When the map is flattened into an array, the priorities are taken into
+ * account and elements of the map are ordered in the array according to
* their priority.
* @return array the list of items in array
*/
@@ -469,7 +467,7 @@ class TPriorityMap extends TMap
* Combines the map elements which have a priority below the parameter value
* @param numeric the cut-off priority. All items of priority less than this are returned.
* @param boolean whether or not the input cut-off priority is inclusive. Default: false, not inclusive.
- * @return array the array of priorities keys with values of arrays of items that are below a specified priority.
+ * @return array the array of priorities keys with values of arrays of items that are below a specified priority.
* The priorities are sorted so important priorities, lower numerics, are first.
*/
public function toArrayBelowPriority($priority,$inclusive=false)
@@ -489,7 +487,7 @@ class TPriorityMap extends TMap
* Combines the map elements which have a priority above the parameter value
* @param numeric the cut-off priority. All items of priority greater than this are returned.
* @param boolean whether or not the input cut-off priority is inclusive. Default: true, inclusive.
- * @return array the array of priorities keys with values of arrays of items that are above a specified priority.
+ * @return array the array of priorities keys with values of arrays of items that are above a specified priority.
* The priorities are sorted so important priorities, lower numerics, are first.
*/
public function toArrayAbovePriority($priority,$inclusive=true)
@@ -508,7 +506,7 @@ class TPriorityMap extends TMap
/**
* Copies iterable data into the map.
* Note, existing data in the map will be cleared first.
- * @param mixed the data to be copied from, must be an array, object implementing
+ * @param mixed the data to be copied from, must be an array, object implementing
* Traversable, or a TPriorityMap
* @throws TInvalidDataTypeException If data is neither an array nor an iterator.
*/
@@ -538,7 +536,7 @@ class TPriorityMap extends TMap
/**
* Merges iterable data into the map.
* Existing data in the map will be kept and overwritten if the keys are the same.
- * @param mixed the data to be merged with, must be an array, object implementing
+ * @param mixed the data to be merged with, must be an array, object implementing
* Traversable, or a TPriorityMap
* @throws TInvalidDataTypeException If data is neither an array nor an iterator.
*/
diff --git a/framework/Collections/TQueue.php b/framework/Collections/TQueue.php
index 077b9b2f..ffa81b95 100644
--- a/framework/Collections/TQueue.php
+++ b/framework/Collections/TQueue.php
@@ -4,7 +4,7 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Collections
@@ -161,7 +161,7 @@ class TQueue extends TComponent implements IteratorAggregate,Countable
{
return $this->_c;
}
-
+
/**
* Returns the number of items in the queue.
* This method is required by Countable interface.
diff --git a/framework/Collections/TStack.php b/framework/Collections/TStack.php
index 06c97046..91996aaa 100644
--- a/framework/Collections/TStack.php
+++ b/framework/Collections/TStack.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TStack.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
*/
@@ -27,7 +26,6 @@
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TStack.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
@@ -180,9 +178,8 @@ class TStack extends TComponent implements IteratorAggregate,Countable
* TStackIterator is used by TStack. It allows TStack to return a new iterator
* for traversing the items in the list.
*
- * @deprecated Issue 264 : ArrayIterator should be used instead
+ * @deprecated Issue 264 : ArrayIterator should be used instead
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TStack.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
diff --git a/framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php b/framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php
index 7dd69641..11fb796b 100644
--- a/framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php
+++ b/framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveRecordException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
*/
@@ -14,7 +13,6 @@
* Base exception class for Active Records.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TActiveRecordException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
* @since 3.1
*/
@@ -38,7 +36,6 @@ class TActiveRecordException extends TDbException
* TActiveRecordConfigurationException class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TActiveRecordException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
* @since 3.1
*/
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php b/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php
index 32e27742..2197b48c 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.ActiveRecord.Relations
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php b/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php
index e41dc806..92fe495a 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.ActiveRecord.Relations
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php b/framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php
index d845d372..1b58f112 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.ActiveRecord.Relations
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php b/framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php
index 4f20f12f..46c4d9fb 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.ActiveRecord.Relations
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php b/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php
index 2fe6dcb1..7fe2d468 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.ActiveRecord.Relations
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php b/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php
index 6c1dcd4f..961dcd91 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.ActiveRecord.Relations
diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php
index 71f015b8..0a2c0cd3 100644
--- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php
+++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php
@@ -4,7 +4,7 @@
*
* @author Cesar Ramos <cramos[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package System.Data.ActiveRecord.Scaffold.InputBuilder
*/
diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMssqlScaffoldInput.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMssqlScaffoldInput.php
index b9d133a2..1cb73438 100644
--- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMssqlScaffoldInput.php
+++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMssqlScaffoldInput.php
@@ -3,7 +3,7 @@
* TMssqlScaffoldInput class file.
*
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package System.Data.ActiveRecord.Scaffold.InputBuilder
*/
diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php
index 74eddbd8..e2e75318 100644
--- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php
+++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php
@@ -3,7 +3,7 @@
* TMysqlScaffoldInput class file.
*
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package System.Data.ActiveRecord.Scaffold.InputBuilder
*/
diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TPgsqlScaffoldInput.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TPgsqlScaffoldInput.php
index 088bbd42..6d10874a 100644
--- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TPgsqlScaffoldInput.php
+++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TPgsqlScaffoldInput.php
@@ -3,7 +3,7 @@
* TPgsqlScaffoldInput class file.
*
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package System.Data.ActiveRecord.Scaffold.InputBuilder
*/
diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php
index 611cfdfb..14244b4c 100644
--- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php
+++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php
@@ -3,7 +3,7 @@
* TScaffoldInputBase class file.
*
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package System.Data.ActiveRecord.Scaffold.InputBuilder
*/
diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php
index 68404adb..3394680e 100644
--- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php
+++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php
@@ -3,7 +3,7 @@
* TScaffoldInputCommon class file.
*
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package System.Data.ActiveRecord.Scaffold.InputBuilder
*/
diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TSqliteScaffoldInput.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TSqliteScaffoldInput.php
index 302f320b..441d2770 100644
--- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TSqliteScaffoldInput.php
+++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TSqliteScaffoldInput.php
@@ -3,7 +3,7 @@
* TSqliteScaffoldInput class file.
*
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package System.Data.ActiveRecord.Scaffold.InputBuilder
*/
diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php
index 41dbb240..122dfbd2 100644
--- a/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php
+++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TScaffoldBase.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord.Scaffold
*/
@@ -26,7 +25,6 @@ Prado::using('System.Data.ActiveRecord.TActiveRecord');
* file explicitly.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TScaffoldBase.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord.Scaffold
* @since 3.1
*/
diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php
index ff1c65c7..74e79eaa 100644
--- a/framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php
+++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TScaffoldEditView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord.Scaffold
*/
@@ -43,7 +42,6 @@ Prado::using('System.Data.ActiveRecord.Scaffold.TScaffoldBase');
* xxx is the property name).
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TScaffoldEditView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord.Scaffold
* @since 3.1
*/
@@ -294,7 +292,6 @@ class TScaffoldEditView extends TScaffoldBase
* that is called before the save() method is called on the TActiveRecord.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TScaffoldEditView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord.Scaffold
* @since 3.1
*/
diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php
index 2cd2def5..afdb126c 100644
--- a/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php
+++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TScaffoldListView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord.Scaffold
*/
@@ -44,7 +43,6 @@ Prado::using('System.Data.ActiveRecord.Scaffold.TScaffoldBase');
* Parameters property of TActiveRecordCriteria.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TScaffoldListView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord.Scaffold
* @since 3.1
*/
diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldSearch.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldSearch.php
index 5505977f..ea2d2c94 100644
--- a/framework/Data/ActiveRecord/Scaffold/TScaffoldSearch.php
+++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldSearch.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.ActiveRecord.Scaffold
diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldView.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldView.php
index 63dea8dd..acc78fd2 100644
--- a/framework/Data/ActiveRecord/Scaffold/TScaffoldView.php
+++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldView.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TScaffoldView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord.Scaffold
*/
@@ -35,7 +34,6 @@ Prado::using('System.Data.ActiveRecord.Scaffold.TScaffoldSearch');
* the Active Record class to be displayed/edited/added.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TScaffoldView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord.Scaffold
* @since 3.0
*/
diff --git a/framework/Data/ActiveRecord/TActiveRecord.php b/framework/Data/ActiveRecord/TActiveRecord.php
index 24fa41ce..735579cd 100644
--- a/framework/Data/ActiveRecord/TActiveRecord.php
+++ b/framework/Data/ActiveRecord/TActiveRecord.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveRecord.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
*/
@@ -142,7 +141,6 @@ Prado::using('System.Data.ActiveRecord.Relations.TActiveRecordRelationContext');
* </code>
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TActiveRecord.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
* @since 3.1
*/
@@ -1025,6 +1023,29 @@ abstract class TActiveRecord extends TComponent
{
return isset(self::$_relations[get_class($this)][strtolower($property)]);
}
+
+ /**
+ * Return record data as array
+ * @return array of column name and column values
+ * @since 3.2.4
+ */
+ public function toArray(){
+ $result=array();
+ foreach($this->getRecordTableInfo()->getLowerCaseColumnNames() as $columnName){
+ $result[$columnName]=$this->getColumnValue($columnName);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Return record data as JSON
+ * @return JSON
+ * @since 3.2.4
+ */
+ public function toJSON(){
+ return json_encode($this->toArray());
+ }
}
/**
@@ -1037,7 +1058,6 @@ abstract class TActiveRecord extends TComponent
* be set to false to prevent the requested change event to be performed.
*
* @author Wei Zhuo<weizhuo@gmail.com>
- * @version $Id: TActiveRecord.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
* @since 3.1.2
*/
@@ -1072,7 +1092,6 @@ class TActiveRecordChangeEventParameter extends TEventParameter
* - Exception: throws a TActiveRecordException
*
* @author Yves Berkholz <godzilla80@gmx.net>
- * @version $Id: TActiveRecord.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
* @see TActiveRecordManager::setInvalidFinderResult
* @see TActiveRecordConfig::setInvalidFinderResult
diff --git a/framework/Data/ActiveRecord/TActiveRecordConfig.php b/framework/Data/ActiveRecord/TActiveRecordConfig.php
index 7421d08b..6e726df0 100644
--- a/framework/Data/ActiveRecord/TActiveRecordConfig.php
+++ b/framework/Data/ActiveRecord/TActiveRecordConfig.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveRecordConfig.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
*/
@@ -66,7 +65,6 @@ Prado::using('System.Data.ActiveRecord.TActiveRecordManager');
* </code>
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TActiveRecordConfig.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
* @since 3.1
*/
diff --git a/framework/Data/ActiveRecord/TActiveRecordCriteria.php b/framework/Data/ActiveRecord/TActiveRecordCriteria.php
index afa76c51..aec3ce53 100644
--- a/framework/Data/ActiveRecord/TActiveRecordCriteria.php
+++ b/framework/Data/ActiveRecord/TActiveRecordCriteria.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveRecordCriteria.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
*/
@@ -28,7 +27,6 @@ Prado::using('System.Data.DataGateway.TSqlCriteria');
* </code>
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TActiveRecordCriteria.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
* @since 3.1
*/
diff --git a/framework/Data/ActiveRecord/TActiveRecordGateway.php b/framework/Data/ActiveRecord/TActiveRecordGateway.php
index c61cdd18..4d4fdac1 100644
--- a/framework/Data/ActiveRecord/TActiveRecordGateway.php
+++ b/framework/Data/ActiveRecord/TActiveRecordGateway.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveRecordGateway.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
*/
@@ -15,7 +14,6 @@
* record as arrays (for most finder methods).
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TActiveRecordGateway.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
* @since 3.1
*/
diff --git a/framework/Data/ActiveRecord/TActiveRecordManager.php b/framework/Data/ActiveRecord/TActiveRecordManager.php
index 26c04e87..4aa2cde9 100644
--- a/framework/Data/ActiveRecord/TActiveRecordManager.php
+++ b/framework/Data/ActiveRecord/TActiveRecordManager.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveRecordManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
*/
@@ -31,7 +30,6 @@ Prado::using('System.Data.ActiveRecord.TActiveRecordGateway');
* the active record gateway to cache the table meta data information.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TActiveRecordManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
* @since 3.1
*/
diff --git a/framework/Data/Common/Mssql/TMssqlCommandBuilder.php b/framework/Data/Common/Mssql/TMssqlCommandBuilder.php
index efee34f9..ac718bcb 100644
--- a/framework/Data/Common/Mssql/TMssqlCommandBuilder.php
+++ b/framework/Data/Common/Mssql/TMssqlCommandBuilder.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common
*/
@@ -17,7 +16,6 @@ Prado::using('System.Data.Common.TDbCommandBuilder');
* for MSSQL servers.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common
* @since 3.1
*/
diff --git a/framework/Data/Common/Mssql/TMssqlMetaData.php b/framework/Data/Common/Mssql/TMssqlMetaData.php
index 3ff7ac7f..990639af 100644
--- a/framework/Data/Common/Mssql/TMssqlMetaData.php
+++ b/framework/Data/Common/Mssql/TMssqlMetaData.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPgsqlMetaData.php 1866 2007-04-14 05:02:29Z wei $
* @package System.Data.Common.Mssql
*/
@@ -20,7 +19,6 @@ Prado::using('System.Data.Common.Mssql.TMssqlTableInfo');
* TMssqlMetaData loads MSSQL database table and column information.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TPgsqlMetaData.php 1866 2007-04-14 05:02:29Z wei $
* @package System.Data.Common.Mssql
* @since 3.1
*/
@@ -260,5 +258,33 @@ EOD;
}
return false;
}
+
+ /**
+ * Returns all table names in the database.
+ * @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema.
+ * If not empty, the returned table names will be prefixed with the schema name.
+ * @return array all table names in the database.
+ */
+ public function findTableNames($schema='dbo')
+ {
+ $condition="TABLE_TYPE='BASE TABLE'";
+ $sql=<<<EOD
+SELECT TABLE_NAME, TABLE_SCHEMA FROM [INFORMATION_SCHEMA].[TABLES]
+WHERE TABLE_SCHEMA=:schema AND $condition
+EOD;
+ $command=$this->getDbConnection()->createCommand($sql);
+ $command->bindParam(":schema", $schema);
+ $rows=$command->queryAll();
+ $names=array();
+ foreach ($rows as $row)
+ {
+ if ($schema == self::DEFAULT_SCHEMA)
+ $names[]=$row['TABLE_NAME'];
+ else
+ $names[]=$schema.'.'.$row['TABLE_SCHEMA'].'.'.$row['TABLE_NAME'];
+ }
+
+ return $names;
+ }
}
diff --git a/framework/Data/Common/Mssql/TMssqlTableColumn.php b/framework/Data/Common/Mssql/TMssqlTableColumn.php
index 7976c28a..e3bd431e 100644
--- a/framework/Data/Common/Mssql/TMssqlTableColumn.php
+++ b/framework/Data/Common/Mssql/TMssqlTableColumn.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMssqlTableColumn.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common.Mssql
*/
@@ -19,7 +18,6 @@ Prado::using('System.Data.Common.TDbTableColumn');
* Describes the column metadata of the schema for a Mssql database table.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TMssqlTableColumn.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common.Mssql
* @since 3.1
*/
diff --git a/framework/Data/Common/Mssql/TMssqlTableInfo.php b/framework/Data/Common/Mssql/TMssqlTableInfo.php
index 0db446b1..d003b336 100644
--- a/framework/Data/Common/Mssql/TMssqlTableInfo.php
+++ b/framework/Data/Common/Mssql/TMssqlTableInfo.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMssqlTableInfo.php 1861 2007-04-12 08:05:03Z wei $
* @package System.Data.Common.Mssql
*/
@@ -20,7 +19,6 @@ Prado::using('System.Data.Common.Mssql.TMssqlTableColumn');
* TMssqlTableInfo class provides additional table information for Mssql database.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TMssqlTableInfo.php 1861 2007-04-12 08:05:03Z wei $
* @package System.Data.Common.Mssql
* @since 3.1
*/
diff --git a/framework/Data/Common/Mysql/TMysqlCommandBuilder.php b/framework/Data/Common/Mysql/TMysqlCommandBuilder.php
index 8492c537..38e98b4f 100644
--- a/framework/Data/Common/Mysql/TMysqlCommandBuilder.php
+++ b/framework/Data/Common/Mysql/TMysqlCommandBuilder.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common
*/
@@ -16,7 +15,6 @@ Prado::using('System.Data.Common.TDbCommandBuilder');
* TMysqlCommandBuilder implements default TDbCommandBuilder
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common
* @since 3.1
*/
diff --git a/framework/Data/Common/Mysql/TMysqlMetaData.php b/framework/Data/Common/Mysql/TMysqlMetaData.php
index 9dc995fc..94826e03 100644
--- a/framework/Data/Common/Mysql/TMysqlMetaData.php
+++ b/framework/Data/Common/Mysql/TMysqlMetaData.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMysqlMetaData.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Mysql
*/
@@ -23,7 +22,6 @@ Prado::using('System.Data.Common.Mysql.TMysqlTableInfo');
* See http://netevil.org/node.php?nid=795&SC=1
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TMysqlMetaData.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Mysql
* @since 3.1
*/
@@ -78,6 +76,9 @@ class TMysqlMetaData extends TDbMetaData
{
list($schemaName,$tableName) = $this->getSchemaTableName($table);
$find = $schemaName===null ? "`{$tableName}`" : "`{$schemaName}`.`{$tableName}`";
+ $colCase = $this->getDbConnection()->getColumnCase();
+ if($colCase != TDbColumnCaseMode::Preserved)
+ $this->getDbConnection()->setColumnCase('Preserved');
$this->getDbConnection()->setActive(true);
$sql = "SHOW FULL FIELDS FROM {$find}";
$command = $this->getDbConnection()->createCommand($sql);
@@ -90,6 +91,8 @@ class TMysqlMetaData extends TDbMetaData
}
if($index===0)
throw new TDbException('dbmetadata_invalid_table_view', $table);
+ if($colCase != TDbColumnCaseMode::Preserved)
+ $this->getDbConnection()->setColumnCase($colCase);
return $tableInfo;
}
@@ -382,5 +385,21 @@ EOD;
}
return false;
}
+
+ /**
+ * Returns all table names in the database.
+ * @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema.
+ * If not empty, the returned table names will be prefixed with the schema name.
+ * @return array all table names in the database.
+ */
+ public function findTableNames($schema='')
+ {
+ if($schema==='')
+ return $this->getDbConnection()->createCommand('SHOW TABLES')->queryColumn();
+ $names=$this->getDbConnection()->createCommand('SHOW TABLES FROM '.$this->quoteTableName($schema))->queryColumn();
+ foreach($names as &$name)
+ $name=$schema.'.'.$name;
+ return $names;
+ }
}
diff --git a/framework/Data/Common/Mysql/TMysqlTableColumn.php b/framework/Data/Common/Mysql/TMysqlTableColumn.php
index 6f482537..dd62f0f6 100644
--- a/framework/Data/Common/Mysql/TMysqlTableColumn.php
+++ b/framework/Data/Common/Mysql/TMysqlTableColumn.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMysqlTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Mysql
*/
@@ -19,7 +18,6 @@ Prado::using('System.Data.Common.TDbTableColumn');
* Describes the column metadata of the schema for a Mysql database table.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TMysqlTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Mysql
* @since 3.1
*/
diff --git a/framework/Data/Common/Mysql/TMysqlTableInfo.php b/framework/Data/Common/Mysql/TMysqlTableInfo.php
index b190e961..17b32aa9 100644
--- a/framework/Data/Common/Mysql/TMysqlTableInfo.php
+++ b/framework/Data/Common/Mysql/TMysqlTableInfo.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMysqlTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Mysql
*/
@@ -20,7 +19,6 @@ Prado::using('System.Data.Common.Mysql.TMysqlTableColumn');
* TMysqlTableInfo class provides additional table information for MySQL database.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TMysqlTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Mysql
* @since 3.1
*/
diff --git a/framework/Data/Common/Oracle/TOracleCommandBuilder.php b/framework/Data/Common/Oracle/TOracleCommandBuilder.php
index 26490d54..56173c3a 100644
--- a/framework/Data/Common/Oracle/TOracleCommandBuilder.php
+++ b/framework/Data/Common/Oracle/TOracleCommandBuilder.php
@@ -5,9 +5,8 @@
*
* @author Marcos Nobre <marconobre[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TOracleCommandBuilder.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
*/
@@ -18,7 +17,6 @@ Prado :: using('System.Data.Common.TDbCommandBuilder');
* for Oracle database.
*
* @author Marcos Nobre <marconobre[at]gmail[dot]com>
- * @version $Id: TOracleCommandBuilder.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
* @since 3.1
*/
@@ -134,14 +132,14 @@ class TOracleCommandBuilder extends TDbCommandBuilder {
" SELECT rownum as {$pradoNUMLIN} {$aliasedFields} FROM ".
" ($sql) {$fieldsALIAS} WHERE rownum <= {$limit} ".
") WHERE {$pradoNUMLIN} >= {$offset} ";
-
+
************************* */
$offset=(int)$offset;
$toReg = $offset + $limit ;
$fullTableName = $this->getTableInfo()->getTableFullName();
- if (empty ($sORDERBY))
+ if (empty ($sORDERBY))
$sORDERBY="ROWNUM";
-
+
$newSql = " SELECT $fields FROM " .
"( " .
" SELECT ROW_NUMBER() OVER ( ORDER BY {$sORDERBY} ) -1 as {$pradoNUMLIN} {$aliasedFields} " .
diff --git a/framework/Data/Common/Oracle/TOracleMetaData.php b/framework/Data/Common/Oracle/TOracleMetaData.php
index 793070ed..fc1800c5 100644
--- a/framework/Data/Common/Oracle/TOracleMetaData.php
+++ b/framework/Data/Common/Oracle/TOracleMetaData.php
@@ -4,9 +4,8 @@
*
* @author Marcos Nobre <marconobre[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TOracleMetaData.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Oracle
*/
@@ -21,7 +20,6 @@ Prado::using('System.Data.Common.Oracle.TOracleTableColumn');
* TOracleMetaData loads Oracle database table and column information.
*
* @author Marcos Nobre <marconobre[at]gmail[dot]com>
- * @version $Id: TOracleMetaData.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Oracle
* @since 3.1
*/
@@ -29,7 +27,7 @@ class TOracleMetaData extends TDbMetaData
{
private $_defaultSchema = 'system';
-
+
/**
* @return string TDbTableInfo class name.
*/
@@ -336,5 +334,41 @@ EOD;
}
return false;
}
-}
+ /**
+ * Returns all table names in the database.
+ * @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema.
+ * If not empty, the returned table names will be prefixed with the schema name.
+ * @return array all table names in the database.
+ */
+ public function findTableNames($schema='')
+ {
+ if($schema==='')
+ {
+ $sql=<<<EOD
+SELECT table_name, '{$schema}' as table_schema FROM user_tables
+EOD;
+ $command=$this->getDbConnection()->createCommand($sql);
+ }
+ else
+ {
+ $sql=<<<EOD
+SELECT object_name as table_name, owner as table_schema FROM all_objects
+WHERE object_type = 'TABLE' AND owner=:schema
+EOD;
+ $command=$this->getDbConnection()->createCommand($sql);
+ $command->bindParam(':schema',$schema);
+ }
+
+ $rows=$command->queryAll();
+ $names=array();
+ foreach($rows as $row)
+ {
+ if($schema===$this->getDefaultSchema() || $schema==='')
+ $names[]=$row['TABLE_NAME'];
+ else
+ $names[]=$row['TABLE_SCHEMA'].'.'.$row['TABLE_NAME'];
+ }
+ return $names;
+ }
+} \ No newline at end of file
diff --git a/framework/Data/Common/Oracle/TOracleTableColumn.php b/framework/Data/Common/Oracle/TOracleTableColumn.php
index bbd7212c..bc89d8c5 100644
--- a/framework/Data/Common/Oracle/TOracleTableColumn.php
+++ b/framework/Data/Common/Oracle/TOracleTableColumn.php
@@ -4,9 +4,8 @@
*
* @author Marcos Nobre <marconobre[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TOracleTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Oracle
*/
@@ -19,14 +18,13 @@ Prado::using('System.Data.Common.TDbTableColumn');
* Describes the column metadata of the schema for a PostgreSQL database table.
*
* @author Marcos Nobre <marconobre[at]gmail[dot]com>
- * @version $Id: TOracleTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Oracle
* @since 3.1
*/
class TOracleTableColumn extends TDbTableColumn
{
private static $types=array(
- 'numeric' => array( 'numeric' )
+ 'numeric' => array( 'numeric' )
// 'integer' => array('bit', 'bit varying', 'real', 'serial', 'int', 'integer'),
// 'boolean' => array('boolean'),
// 'float' => array('bigint', 'bigserial', 'double precision', 'money', 'numeric')
diff --git a/framework/Data/Common/Oracle/TOracleTableInfo.php b/framework/Data/Common/Oracle/TOracleTableInfo.php
index 6aa31fd8..4a2e31fd 100644
--- a/framework/Data/Common/Oracle/TOracleTableInfo.php
+++ b/framework/Data/Common/Oracle/TOracleTableInfo.php
@@ -5,9 +5,8 @@
*
* @author Marcos Nobre <marconobre[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TOracleTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
*/
@@ -15,7 +14,6 @@
* TDbTableInfo class describes the meta data of a database table.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TOracleTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
* @since 3.1
*/
diff --git a/framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php b/framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php
index eb975a1a..851dabb5 100644
--- a/framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php
+++ b/framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common
*/
@@ -17,7 +16,6 @@ Prado::using('System.Data.Common.TDbCommandBuilder');
* for Pgsql database.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common
* @since 3.1
*/
diff --git a/framework/Data/Common/Pgsql/TPgsqlMetaData.php b/framework/Data/Common/Pgsql/TPgsqlMetaData.php
index dd91dfdc..e5d30ed7 100644
--- a/framework/Data/Common/Pgsql/TPgsqlMetaData.php
+++ b/framework/Data/Common/Pgsql/TPgsqlMetaData.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPgsqlMetaData.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Pgsql
*/
@@ -20,7 +19,6 @@ Prado::using('System.Data.Common.Pgsql.TPgsqlTableInfo');
* TPgsqlMetaData loads PostgreSQL database table and column information.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TPgsqlMetaData.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Pgsql
* @since 3.1
*/
@@ -418,5 +416,33 @@ EOD;
}
return false;
}
+
+ /**
+ * Returns all table names in the database.
+ * @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema.
+ * If not empty, the returned table names will be prefixed with the schema name.
+ * @return array all table names in the database.
+ */
+ public function findTableNames($schema='public')
+ {
+ if($schema==='')
+ $schema=self::DEFAULT_SCHEMA;
+ $sql=<<<EOD
+SELECT table_name, table_schema FROM information_schema.tables
+WHERE table_schema=:schema AND table_type='BASE TABLE'
+EOD;
+ $command=$this->getDbConnection()->createCommand($sql);
+ $command->bindParam(':schema',$schema);
+ $rows=$command->queryAll();
+ $names=array();
+ foreach($rows as $row)
+ {
+ if($schema===self::DEFAULT_SCHEMA)
+ $names[]=$row['table_name'];
+ else
+ $names[]=$row['table_schema'].'.'.$row['table_name'];
+ }
+ return $names;
+ }
}
diff --git a/framework/Data/Common/Pgsql/TPgsqlTableColumn.php b/framework/Data/Common/Pgsql/TPgsqlTableColumn.php
index da17a7d3..fd0fd23c 100644
--- a/framework/Data/Common/Pgsql/TPgsqlTableColumn.php
+++ b/framework/Data/Common/Pgsql/TPgsqlTableColumn.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPgsqlTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Pgsql
*/
@@ -19,7 +18,6 @@ Prado::using('System.Data.Common.TDbTableColumn');
* Describes the column metadata of the schema for a PostgreSQL database table.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TPgsqlTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Pgsql
* @since 3.1
*/
diff --git a/framework/Data/Common/Pgsql/TPgsqlTableInfo.php b/framework/Data/Common/Pgsql/TPgsqlTableInfo.php
index ef2b4575..43298ffa 100644
--- a/framework/Data/Common/Pgsql/TPgsqlTableInfo.php
+++ b/framework/Data/Common/Pgsql/TPgsqlTableInfo.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPgsqlTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Pgsql
*/
@@ -20,7 +19,6 @@ Prado::using('System.Data.Common.Pgsql.TPgsqlTableColumn');
* TPgsqlTableInfo class provides additional table information for PostgreSQL database.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TPgsqlTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Pgsql
* @since 3.1
*/
diff --git a/framework/Data/Common/Sqlite/TSqliteCommandBuilder.php b/framework/Data/Common/Sqlite/TSqliteCommandBuilder.php
index 396ec7c5..b442f7b4 100644
--- a/framework/Data/Common/Sqlite/TSqliteCommandBuilder.php
+++ b/framework/Data/Common/Sqlite/TSqliteCommandBuilder.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common
*/
@@ -17,7 +16,6 @@ Prado::using('System.Data.Common.TDbCommandBuilder');
* for Sqlite database.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common
* @since 3.1
*/
diff --git a/framework/Data/Common/Sqlite/TSqliteMetaData.php b/framework/Data/Common/Sqlite/TSqliteMetaData.php
index 3d789500..b6dd24b7 100644
--- a/framework/Data/Common/Sqlite/TSqliteMetaData.php
+++ b/framework/Data/Common/Sqlite/TSqliteMetaData.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqliteMetaData.php 1861 2007-04-12 08:05:03Z wei $
* @package System.Data.Common.Sqlite
*/
@@ -20,7 +19,6 @@ Prado::using('System.Data.Common.Sqlite.TSqliteTableInfo');
* TSqliteMetaData loads SQLite database table and column information.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqliteMetaData.php 1861 2007-04-12 08:05:03Z wei $
* @package System.Data.Commom.Sqlite
* @since 3.1
*/
@@ -190,21 +188,15 @@ class TSqliteMetaData extends TDbMetaData
}
return false;
}
-}
-
-/**
-
-CREATE TABLE foo
-(
- id INTEGER NOT NULL PRIMARY KEY,
- id2 CHAR(2)
-);
-
-CREATE TABLE bar
-(
- id INTEGER NOT NULL PRIMARY KEY,
- foo_id INTEGER
- CONSTRAINT fk_foo_id REFERENCES foo(id) ON DELETE CASCADE
-);
-*/
+ /**
+ * Returns all table names in the database.
+ * @param string $schema the schema of the tables. This is not used for sqlite database.
+ * @return array all table names in the database.
+ */
+ public function findTableNames($schema='')
+ {
+ $sql="SELECT DISTINCT tbl_name FROM sqlite_master WHERE tbl_name<>'sqlite_sequence'";
+ return $this->getDbConnection()->createCommand($sql)->queryColumn();
+ }
+} \ No newline at end of file
diff --git a/framework/Data/Common/Sqlite/TSqliteTableColumn.php b/framework/Data/Common/Sqlite/TSqliteTableColumn.php
index d8fd1966..f54b6f59 100644
--- a/framework/Data/Common/Sqlite/TSqliteTableColumn.php
+++ b/framework/Data/Common/Sqlite/TSqliteTableColumn.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqliteTableColumn.php 1861 2007-04-12 08:05:03Z wei $
* @package System.Data.Common.Sqlite
*/
@@ -19,7 +18,6 @@ Prado::using('System.Data.Common.TDbTableColumn');
* Describes the column metadata of the schema for a PostgreSQL database table.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqliteTableColumn.php 1861 2007-04-12 08:05:03Z wei $
* @package System.Data.Common.Sqlite
* @since 3.1
*/
diff --git a/framework/Data/Common/Sqlite/TSqliteTableInfo.php b/framework/Data/Common/Sqlite/TSqliteTableInfo.php
index 52fb3530..e15f050a 100644
--- a/framework/Data/Common/Sqlite/TSqliteTableInfo.php
+++ b/framework/Data/Common/Sqlite/TSqliteTableInfo.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqliteTableInfo.php 1861 2007-04-12 08:05:03Z wei $
* @package System.Data.Common.Sqlite
*/
@@ -20,7 +19,6 @@ Prado::using('System.Data.Common.Sqlite.TSqliteTableColumn');
* TSqliteTableInfo class provides additional table information for PostgreSQL database.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqliteTableInfo.php 1861 2007-04-12 08:05:03Z wei $
* @package System.Data.Common.Sqlite
* @since 3.1
*/
diff --git a/framework/Data/Common/TDbCommandBuilder.php b/framework/Data/Common/TDbCommandBuilder.php
index fdaa3bfe..7a7b75d4 100644
--- a/framework/Data/Common/TDbCommandBuilder.php
+++ b/framework/Data/Common/TDbCommandBuilder.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbCommandBuilder.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
*/
@@ -15,7 +14,6 @@
* giving by {@link setTableInfo TableInfo} the property.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDbCommandBuilder.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
* @since 3.1
*/
diff --git a/framework/Data/Common/TDbMetaData.php b/framework/Data/Common/TDbMetaData.php
index 2ad5c592..1d07c750 100644
--- a/framework/Data/Common/TDbMetaData.php
+++ b/framework/Data/Common/TDbMetaData.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbMetaData.php 3284 2013-04-11 07:14:59Z ctrlaltca $
* @package System.Data.Common
*/
@@ -17,7 +16,6 @@
* Use the {@link getTableInfo} method to retrieve a table information.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDbMetaData.php 3284 2013-04-11 07:14:59Z ctrlaltca $
* @package System.Data.Common
* @since 3.1
*/
@@ -180,5 +178,15 @@ abstract class TDbMetaData extends TComponent
return $lft . str_replace(self::$delimiterIdentifier, '', $name) . $rgt;
}
+
+ /**
+ * Returns all table names in the database.
+ * This method should be overridden by child classes in order to support this feature
+ * because the default implementation simply throws an exception.
+ * @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema.
+ * If not empty, the returned table names will be prefixed with the schema name.
+ * @return array all table names in the database.
+ */
+ abstract public function findTableNames($schema='');
}
diff --git a/framework/Data/Common/TDbTableColumn.php b/framework/Data/Common/TDbTableColumn.php
index 27cfb7c5..fe96e12a 100644
--- a/framework/Data/Common/TDbTableColumn.php
+++ b/framework/Data/Common/TDbTableColumn.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
*/
@@ -14,7 +13,6 @@
* TDbTableColumn class describes the column meta data of the schema for a database table.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDbTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
* @since 3.1
*/
diff --git a/framework/Data/Common/TDbTableInfo.php b/framework/Data/Common/TDbTableInfo.php
index fbfcf46d..5060845b 100644
--- a/framework/Data/Common/TDbTableInfo.php
+++ b/framework/Data/Common/TDbTableInfo.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
*/
@@ -14,7 +13,6 @@
* TDbTableInfo class describes the meta data of a database table.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDbTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
* @since 3.1
*/
diff --git a/framework/Data/DataGateway/TDataGatewayCommand.php b/framework/Data/DataGateway/TDataGatewayCommand.php
index f51097c7..fb0f5df0 100644
--- a/framework/Data/DataGateway/TDataGatewayCommand.php
+++ b/framework/Data/DataGateway/TDataGatewayCommand.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.DataGateway
diff --git a/framework/Data/DataGateway/TSqlCriteria.php b/framework/Data/DataGateway/TSqlCriteria.php
index fb8a3a98..bc1bbbbb 100644
--- a/framework/Data/DataGateway/TSqlCriteria.php
+++ b/framework/Data/DataGateway/TSqlCriteria.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbSqlCriteria.php 1835 2007-04-03 01:38:15Z wei $
* @package System.Data.DataGateway
*/
@@ -25,7 +24,6 @@
* </code>
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDbSqlCriteria.php 1835 2007-04-03 01:38:15Z wei $
* @package System.Data.DataGateway
* @since 3.1
*/
diff --git a/framework/Data/DataGateway/TTableGateway.php b/framework/Data/DataGateway/TTableGateway.php
index 1d6385cf..b527fbb4 100644
--- a/framework/Data/DataGateway/TTableGateway.php
+++ b/framework/Data/DataGateway/TTableGateway.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.DataGateway
diff --git a/framework/Data/SqlMap/Configuration/TDiscriminator.php b/framework/Data/SqlMap/Configuration/TDiscriminator.php
index 278ef2d3..1f7347ae 100644
--- a/framework/Data/SqlMap/Configuration/TDiscriminator.php
+++ b/framework/Data/SqlMap/Configuration/TDiscriminator.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDiscriminator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
@@ -21,7 +20,6 @@
* the object data.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDiscriminator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
@@ -187,7 +185,6 @@ class TDiscriminator extends TComponent
* is used inplace of the current result map.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDiscriminator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/Configuration/TInlineParameterMapParser.php b/framework/Data/SqlMap/Configuration/TInlineParameterMapParser.php
index a2abab3a..e8977b0d 100644
--- a/framework/Data/SqlMap/Configuration/TInlineParameterMapParser.php
+++ b/framework/Data/SqlMap/Configuration/TInlineParameterMapParser.php
@@ -4,21 +4,19 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TInlineParameterMapParser.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
/**
* TInlineParameterMapParser class.
*
- * The inline parameter map syntax lets you embed the property name,
- * the property type, the column type, and a null value replacement into a
+ * The inline parameter map syntax lets you embed the property name,
+ * the property type, the column type, and a null value replacement into a
* parametrized SQL statement.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TInlineParameterMapParser.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/Configuration/TParameterMap.php b/framework/Data/SqlMap/Configuration/TParameterMap.php
index e24648d2..2eaad9a3 100644
--- a/framework/Data/SqlMap/Configuration/TParameterMap.php
+++ b/framework/Data/SqlMap/Configuration/TParameterMap.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TParameterMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
@@ -26,7 +25,6 @@
* The <parameterMap> element accepts two attributes: id (required) and extends (optional).
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TParameterMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
@@ -150,8 +148,8 @@ class TParameterMap extends TComponent
return $value;
}
-
-
+
+
/**
* Create type handler from {@link Type setType()} or {@link TypeHandler setTypeHandler}.
* @param TParameterProperty parameter property
@@ -166,7 +164,7 @@ class TParameterMap extends TComponent
$handler = Prado::createComponent($type);
return $handler;
}
-
+
/**
* @param mixed object to obtain the property from.
diff --git a/framework/Data/SqlMap/Configuration/TParameterProperty.php b/framework/Data/SqlMap/Configuration/TParameterProperty.php
index 255ec690..84007a28 100644
--- a/framework/Data/SqlMap/Configuration/TParameterProperty.php
+++ b/framework/Data/SqlMap/Configuration/TParameterProperty.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TParameterProperty.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
@@ -25,7 +24,6 @@
* will be written to the database instead of the value.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TParameterProperty.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
@@ -137,7 +135,7 @@ class TParameterProperty extends TComponent
public function __sleep()
{
- $exprops = array(); $cn = 'TParameterProperty';
+ $exprops = array(); $cn = 'TParameterProperty';
if ($this->_typeHandler===null) $exprops[] = "\0$cn\0_typeHandler";
if ($this->_type===null) $exprops[] = "\0$cn\0_type";
if ($this->_column===null) $exprops[] = "\0$cn\0_column";
diff --git a/framework/Data/SqlMap/Configuration/TResultMap.php b/framework/Data/SqlMap/Configuration/TResultMap.php
index 65f149df..e35faf28 100644
--- a/framework/Data/SqlMap/Configuration/TResultMap.php
+++ b/framework/Data/SqlMap/Configuration/TResultMap.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TResultMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
@@ -32,7 +31,6 @@
* from the "parent" <resultMap> are set before any values specified by this <resultMap>.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TResultMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/Configuration/TResultProperty.php b/framework/Data/SqlMap/Configuration/TResultProperty.php
index 54ba832d..796060ae 100644
--- a/framework/Data/SqlMap/Configuration/TResultProperty.php
+++ b/framework/Data/SqlMap/Configuration/TResultProperty.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TResultProperty.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
@@ -29,7 +28,6 @@
* with the {@link Select setSelect()} .
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TResultProperty.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
@@ -327,7 +325,7 @@ class TResultProperty extends TComponent
public function __sleep()
{
- $exprops = array(); $cn = 'TResultProperty';
+ $exprops = array(); $cn = 'TResultProperty';
if ($this->_nullValue===null) $exprops[] = "\0$cn\0_nullValue";
if ($this->_propertyName===null) $exprops[] = "\0$cn\0_propertyNama";
if ($this->_columnName===null) $exprops[] = "\0$cn\0_columnName";
diff --git a/framework/Data/SqlMap/Configuration/TSimpleDynamicParser.php b/framework/Data/SqlMap/Configuration/TSimpleDynamicParser.php
index ac7eb059..29260036 100644
--- a/framework/Data/SqlMap/Configuration/TSimpleDynamicParser.php
+++ b/framework/Data/SqlMap/Configuration/TSimpleDynamicParser.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSimpleDynamicParser.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
@@ -15,7 +14,6 @@
* it with a TSimpleDynamicParser::DYNAMIC_TOKEN.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSimpleDynamicParser.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php b/framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php
index b560fe41..271db675 100644
--- a/framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php
+++ b/framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqlMapCacheModel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
@@ -28,7 +27,6 @@
* the current request.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapCacheModel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
@@ -193,7 +191,6 @@ class TSqlMapCacheModel extends TComponent
* Implemented cache are 'Basic', 'FIFO' and 'LRU'.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapCacheModel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
@@ -210,7 +207,6 @@ class TSqlMapCacheTypes extends TEnumerable
* Provides a hash of the object to be cached.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapCacheModel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/Configuration/TSqlMapStatement.php b/framework/Data/SqlMap/Configuration/TSqlMapStatement.php
index efa16484..0efcc5b6 100644
--- a/framework/Data/SqlMap/Configuration/TSqlMapStatement.php
+++ b/framework/Data/SqlMap/Configuration/TSqlMapStatement.php
@@ -5,9 +5,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
@@ -24,7 +23,6 @@
* statement can return a database-generated key.)
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
@@ -295,7 +293,7 @@ class TSqlMapStatement extends TComponent
public function __sleep()
{
- $cn = __CLASS__;
+ $cn = __CLASS__;
$exprops = array("\0$cn\0_resultMap");
if (!$this->_parameterMapName) $exprops[] = "\0$cn\0_parameterMapName";
if (!$this->_parameterMap) $exprops[] = "\0$cn\0_parameterMap";
@@ -319,7 +317,6 @@ class TSqlMapStatement extends TComponent
* TSqlMapSelect class file.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
@@ -338,7 +335,6 @@ class TSqlMapSelect extends TSqlMapStatement
* to generate a key to be used for the insert command.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
@@ -367,7 +363,6 @@ class TSqlMapInsert extends TSqlMapStatement
* TSqlMapUpdate class corresponds to <update> element.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
@@ -379,7 +374,6 @@ class TSqlMapUpdate extends TSqlMapStatement
* TSqlMapDelete class corresponds to the <delete> element.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
@@ -391,7 +385,6 @@ class TSqlMapDelete extends TSqlMapUpdate
* TSqlMapSelect corresponds to the <selectKey> element.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php b/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php
index abe9b588..db178f70 100644
--- a/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php
+++ b/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqlMapXmlConfiguration.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
@@ -16,7 +15,6 @@ Prado::using('System.Data.SqlMap.Configuration.TSqlMapStatement');
* TSqlMapXmlConfig class file.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TSqlMapXmlConfiguration.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
abstract class TSqlMapXmlConfigBuilder
@@ -128,7 +126,6 @@ abstract class TSqlMapXmlConfigBuilder
* Configures the TSqlMapManager using xml configuration file.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapXmlConfiguration.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
@@ -301,7 +298,6 @@ class TSqlMapXmlConfiguration extends TSqlMapXmlConfigBuilder
* description
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapXmlConfiguration.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/DataMapper/TFastSqlMapApplicationCache.php b/framework/Data/SqlMap/DataMapper/TFastSqlMapApplicationCache.php
index ae6aa200..d2e3d014 100644
--- a/framework/Data/SqlMap/DataMapper/TFastSqlMapApplicationCache.php
+++ b/framework/Data/SqlMap/DataMapper/TFastSqlMapApplicationCache.php
@@ -4,19 +4,17 @@
*
* @author Berczi Gabor <gabor.berczi@devworx.hu>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TFastSqlMapApplicationCache.php 2996 2011-06-20 15:24:57Z ctrlaltca@gmail.com $
* @package System.Data.SqlMap
*/
/**
* TFastSqlMapApplicationCache class file
- *
+ *
* Fast SqlMap result cache class with minimal-concurrency get/set and atomic flush operations
- *
+ *
* @author Berczi Gabor <gabor.berczi@devworx.hu>
- * @version $Id: TFastSqlMapApplicationCache.php 2996 2011-06-20 15:24:57Z ctrlaltca@gmail.com $
* @package System.Data.SqlMap
* @since 3.2
*/
@@ -30,12 +28,12 @@ class TFastSqlMapApplicationCache implements ICache
{
$this->_cacheModel = $cacheModel;
}
-
+
protected function getBaseKeyKeyName()
{
return 'SqlMapCacheBaseKey::'.$this->_cacheModel->getId();
}
-
+
protected function getBaseKey()
{
$cache = $this->getCache();
@@ -48,7 +46,7 @@ class TFastSqlMapApplicationCache implements ICache
}
return $basekey;
}
-
+
protected function getCacheKey($key)
{
return $this->getBaseKey().'###'.$key;
@@ -63,7 +61,7 @@ class TFastSqlMapApplicationCache implements ICache
{
$this->getCache()->delete($this->getBaseKeyKeyName());
}
-
+
public function get($key)
{
$result = $this->getCache()->get($this->getCacheKey($key));
diff --git a/framework/Data/SqlMap/DataMapper/TLazyLoadList.php b/framework/Data/SqlMap/DataMapper/TLazyLoadList.php
index c512ef92..d50c1b84 100644
--- a/framework/Data/SqlMap/DataMapper/TLazyLoadList.php
+++ b/framework/Data/SqlMap/DataMapper/TLazyLoadList.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TLazyLoadList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
*/
@@ -14,7 +13,6 @@
* TLazyLoadList executes mapped statements when the proxy collection is first accessed.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TLazyLoadList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
@@ -107,7 +105,6 @@ class TLazyLoadList
* particular object and relays the call to handler object.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TLazyLoadList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/DataMapper/TPropertyAccess.php b/framework/Data/SqlMap/DataMapper/TPropertyAccess.php
index 20a853c4..c19b77ab 100644
--- a/framework/Data/SqlMap/DataMapper/TPropertyAccess.php
+++ b/framework/Data/SqlMap/DataMapper/TPropertyAccess.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPropertyAccess.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
*/
@@ -37,7 +36,6 @@
* </code>
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TPropertyAccess.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/DataMapper/TSqlMapCache.php b/framework/Data/SqlMap/DataMapper/TSqlMapCache.php
index 15e148fe..aa853b6c 100644
--- a/framework/Data/SqlMap/DataMapper/TSqlMapCache.php
+++ b/framework/Data/SqlMap/DataMapper/TSqlMapCache.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqlMapCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
*/
@@ -16,7 +15,6 @@
* a least-recently-used cache implementation.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TSqlMapCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
@@ -89,7 +87,6 @@ abstract class TSqlMapCache implements ICache
* object that was first added when the cache is full.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TSqlMapCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
@@ -126,7 +123,6 @@ class TSqlMapFifoCache extends TSqlMapCache
* object that was accessed last when the cache is full.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TSqlMapCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
@@ -168,7 +164,6 @@ class TSqlMapLruCache extends TSqlMapCache
* caching SqlMap results.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/DataMapper/TSqlMapException.php b/framework/Data/SqlMap/DataMapper/TSqlMapException.php
index d308768f..bce03a5c 100644
--- a/framework/Data/SqlMap/DataMapper/TSqlMapException.php
+++ b/framework/Data/SqlMap/DataMapper/TSqlMapException.php
@@ -4,7 +4,6 @@
* TSqlMapException is the base exception class for all SqlMap exceptions.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapException.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
@@ -63,7 +62,6 @@ class TSqlMapException extends TException
* TSqlMapConfigurationException, raised during configuration file parsing.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapException.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
@@ -76,7 +74,6 @@ class TSqlMapConfigurationException extends TSqlMapException
* TSqlMapUndefinedException, raised when mapped statemented are undefined.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapException.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
@@ -89,7 +86,6 @@ class TSqlMapUndefinedException extends TSqlMapException
* TSqlMapDuplicateException, raised when a duplicate mapped statement is found.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapException.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
@@ -101,7 +97,6 @@ class TSqlMapDuplicateException extends TSqlMapException
* TInvalidPropertyException, raised when setting or getting an invalid property.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapException.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php b/framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php
index f3d67d47..d789471d 100644
--- a/framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php
+++ b/framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqlMapPagedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
*/
@@ -23,7 +22,6 @@ Prado::using('System.Collections.TPagedList');
* The paged list does not need to know about the total number of records.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TSqlMapPagedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php b/framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php
index 9d743b82..18b8ef99 100644
--- a/framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php
+++ b/framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqlMapTypeHandlerRegistry.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
*/
@@ -15,7 +14,6 @@
* to PHP types and vice versa.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapTypeHandlerRegistry.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
@@ -121,7 +119,6 @@ class TSqlMapTypeHandlerRegistry
* booleans using "Y" and "N" instead of the more typical 0/1.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapTypeHandlerRegistry.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/Statements/IMappedStatement.php b/framework/Data/SqlMap/Statements/IMappedStatement.php
index 175b6f39..859d2ee3 100644
--- a/framework/Data/SqlMap/Statements/IMappedStatement.php
+++ b/framework/Data/SqlMap/Statements/IMappedStatement.php
@@ -3,7 +3,6 @@
* IMappedStatement interface file.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: IMappedStatement.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
@@ -11,7 +10,6 @@
* Interface for all mapping statements.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: IMappedStatement.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/Statements/TCachingStatement.php b/framework/Data/SqlMap/Statements/TCachingStatement.php
index b01280de..ad22b84f 100644
--- a/framework/Data/SqlMap/Statements/TCachingStatement.php
+++ b/framework/Data/SqlMap/Statements/TCachingStatement.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCachingStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
@@ -14,7 +13,6 @@
* TCacheingStatement class.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TCachingStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/Statements/TDeleteMappedStatement.php b/framework/Data/SqlMap/Statements/TDeleteMappedStatement.php
index 4b023dc7..119beb39 100644
--- a/framework/Data/SqlMap/Statements/TDeleteMappedStatement.php
+++ b/framework/Data/SqlMap/Statements/TDeleteMappedStatement.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDeleteMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
@@ -14,7 +13,6 @@
* TDeleteMappedStatement class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDeleteMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/Statements/TInsertMappedStatement.php b/framework/Data/SqlMap/Statements/TInsertMappedStatement.php
index 02bd4a68..de785b94 100644
--- a/framework/Data/SqlMap/Statements/TInsertMappedStatement.php
+++ b/framework/Data/SqlMap/Statements/TInsertMappedStatement.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TInsertMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
@@ -14,7 +13,6 @@
* TInsertMappedStatement class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TInsertMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/Statements/TMappedStatement.php b/framework/Data/SqlMap/Statements/TMappedStatement.php
index 40caf4f7..4d3b6355 100644
--- a/framework/Data/SqlMap/Statements/TMappedStatement.php
+++ b/framework/Data/SqlMap/Statements/TMappedStatement.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
@@ -17,7 +16,6 @@
* This class is usualy instantiated during SQLMap configuration by TSqlDomBuilder.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.0
*/
@@ -924,10 +922,10 @@ class TMappedStatement extends TComponent implements IMappedStatement
parent::__wakeup();
if (is_null($this->_selectQueue)) $this->_selectQueue = array();
}
-
+
public function __sleep()
{
- $exprops = array(); $cn = __CLASS__;
+ $exprops = array(); $cn = __CLASS__;
if (!count($this->_selectQueue)) $exprops[] = "\0$cn\0_selectQueue";
if (is_null($this->_groupBy)) $exprops[] = "\0$cn\0_groupBy";
if (!$this->_IsRowDataFound) $exprops[] = "\0$cn\0_IsRowDataFound";
@@ -939,7 +937,6 @@ class TMappedStatement extends TComponent implements IMappedStatement
* TPostSelectBinding class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
@@ -975,7 +972,6 @@ class TPostSelectBinding
* build using the {@link collect} method.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
@@ -1151,7 +1147,7 @@ class TSqlMapObjectCollectionTree extends TComponent
public function __sleep()
{
- $exprops = array(); $cn = __CLASS__;
+ $exprops = array(); $cn = __CLASS__;
if (!count($this->_tree)) $exprops[] = "\0$cn\0_tree";
if (!count($this->_entries)) $exprops[] = "\0$cn\0_entries";
if (!count($this->_list)) $exprops[] = "\0$cn\0_list";
@@ -1163,7 +1159,6 @@ class TSqlMapObjectCollectionTree extends TComponent
* TResultSetListItemParameter class
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
@@ -1200,7 +1195,6 @@ class TResultSetListItemParameter extends TComponent
* TResultSetMapItemParameter class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/Statements/TPreparedCommand.php b/framework/Data/SqlMap/Statements/TPreparedCommand.php
index 1e6906a1..8b4bdbcc 100644
--- a/framework/Data/SqlMap/Statements/TPreparedCommand.php
+++ b/framework/Data/SqlMap/Statements/TPreparedCommand.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPreparedCommand.php 3261 2013-01-22 22:36:51Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
@@ -17,7 +16,6 @@ Prado::using('System.Data.Common.TDbCommandBuilder');
* TPreparedCommand class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TPreparedCommand.php 3261 2013-01-22 22:36:51Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/Statements/TPreparedStatement.php b/framework/Data/SqlMap/Statements/TPreparedStatement.php
index 4127eae0..79f39aea 100644
--- a/framework/Data/SqlMap/Statements/TPreparedStatement.php
+++ b/framework/Data/SqlMap/Statements/TPreparedStatement.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPreparedStatement.php 3261 2013-01-22 22:36:51Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
@@ -14,7 +13,6 @@
* TpreparedStatement class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TPreparedStatement.php 3261 2013-01-22 22:36:51Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
@@ -28,26 +26,26 @@ class TPreparedStatement extends TComponent
public function setPreparedSql($value){ $this->_sqlString = $value; }
public function getParameterNames($needed = true)
- {
+ {
if (!$this->_parameterNames and $needed)
$this->_parameterNames = new TList;
- return $this->_parameterNames;
+ return $this->_parameterNames;
}
public function setParameterNames($value){ $this->_parameterNames = $value; }
public function getParameterValues($needed = true)
- {
+ {
if (!$this->_parameterValues and $needed)
$this->_parameterValues=new TMap;
- return $this->_parameterValues;
+ return $this->_parameterValues;
}
public function setParameterValues($value){ $this->_parameterValues = $value; }
-
+
public function __sleep()
{
- $exprops = array(); $cn = __CLASS__;
+ $exprops = array(); $cn = __CLASS__;
if (!$this->_parameterNames or !$this->_parameterNames->getCount()) $exprops[] = "\0$cn\0_parameterNames";
if (!$this->_parameterValues or !$this->_parameterValues->getCount()) $exprops[] = "\0$cn\0_parameterValues";
return array_diff(parent::__sleep(),$exprops);
diff --git a/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php b/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php
index 5fdd16b5..6eef27c3 100644
--- a/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php
+++ b/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPreparedStatementFactory.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
@@ -14,7 +13,6 @@
* TPreparedStatementFactory class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TPreparedStatementFactory.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/Statements/TSelectMappedStatement.php b/framework/Data/SqlMap/Statements/TSelectMappedStatement.php
index b0926c41..8e6ea75e 100644
--- a/framework/Data/SqlMap/Statements/TSelectMappedStatement.php
+++ b/framework/Data/SqlMap/Statements/TSelectMappedStatement.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSelectMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
@@ -14,7 +13,6 @@
* TSelectMappedStatment class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSelectMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/Statements/TSimpleDynamicSql.php b/framework/Data/SqlMap/Statements/TSimpleDynamicSql.php
index 3fce2e3a..b2e0356d 100644
--- a/framework/Data/SqlMap/Statements/TSimpleDynamicSql.php
+++ b/framework/Data/SqlMap/Statements/TSimpleDynamicSql.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSimpleDynamicSql.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
@@ -14,7 +13,6 @@
* TSimpleDynamicSql class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSimpleDynamicSql.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/Statements/TStaticSql.php b/framework/Data/SqlMap/Statements/TStaticSql.php
index 1da6330e..f0110332 100644
--- a/framework/Data/SqlMap/Statements/TStaticSql.php
+++ b/framework/Data/SqlMap/Statements/TStaticSql.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TStaticSql.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
@@ -14,7 +13,6 @@
* TStaticSql class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TStaticSql.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/Statements/TUpdateMappedStatement.php b/framework/Data/SqlMap/Statements/TUpdateMappedStatement.php
index d3c3acc4..9ba2458d 100644
--- a/framework/Data/SqlMap/Statements/TUpdateMappedStatement.php
+++ b/framework/Data/SqlMap/Statements/TUpdateMappedStatement.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TUpdateMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
@@ -14,7 +13,6 @@
* TUpdateMappedStatement class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TUpdateMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/TSqlMapConfig.php b/framework/Data/SqlMap/TSqlMapConfig.php
index c6bd4754..d99b99d5 100644
--- a/framework/Data/SqlMap/TSqlMapConfig.php
+++ b/framework/Data/SqlMap/TSqlMapConfig.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqlMapConfig.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
*/
@@ -18,7 +17,6 @@ Prado::using('System.Data.TDataSourceConfig');
* Database connection and TSqlMapManager configuration.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapConfig.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/TSqlMapGateway.php b/framework/Data/SqlMap/TSqlMapGateway.php
index a0cebd9c..8ce09ee4 100644
--- a/framework/Data/SqlMap/TSqlMapGateway.php
+++ b/framework/Data/SqlMap/TSqlMapGateway.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqlMapGateway.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
*/
@@ -23,7 +22,6 @@ Prado::using('System.Data.SqlMap.TSqlMapManager');
* This class should be instantiated from a TSqlMapManager instance.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TSqlMapGateway.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
diff --git a/framework/Data/SqlMap/TSqlMapManager.php b/framework/Data/SqlMap/TSqlMapManager.php
index 29234920..0fa6fd57 100644
--- a/framework/Data/SqlMap/TSqlMapManager.php
+++ b/framework/Data/SqlMap/TSqlMapManager.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqlMapManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
*/
@@ -37,7 +36,6 @@ Prado::using('System.Caching.TCache');
* </code>
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TSqlMapManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
diff --git a/framework/Data/TDataSourceConfig.php b/framework/Data/TDataSourceConfig.php
index aff5f1af..ecece8c4 100644
--- a/framework/Data/TDataSourceConfig.php
+++ b/framework/Data/TDataSourceConfig.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataSourceConfig.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
*/
@@ -42,7 +41,6 @@ Prado::using('System.Data.TDbConnection');
* that extends the TDbConnection class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDataSourceConfig.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
* @since 3.1
*/
diff --git a/framework/Data/TDbCommand.php b/framework/Data/TDbCommand.php
index e80d7704..43472ea4 100644
--- a/framework/Data/TDbCommand.php
+++ b/framework/Data/TDbCommand.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbCommand.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
*/
@@ -32,7 +31,6 @@
* You may also call {@link prepare} to explicitly prepare an SQL statement.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDbCommand.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
* @since 3.0
*/
@@ -58,7 +56,7 @@ class TDbCommand extends TComponent
*/
public function __sleep()
{
- return array_diff(parent::__sleep(),array("\0TDbCommand\0_statement"));
+ return array_diff(parent::__sleep(),array("\0TDbCommand\0_statement"));
}
/**
@@ -134,7 +132,7 @@ class TDbCommand extends TComponent
* the form :name. For a prepared statement using question mark
* placeholders, this will be the 1-indexed position of the parameter.
* Unlike {@link bindValue}, the variable is bound as a reference and will
- * only be evaluated at the time that {@link execute} or {@link query} is called.
+ * only be evaluated at the time that {@link execute} or {@link query} is called.
* @param mixed Name of the PHP variable to bind to the SQL statement parameter
* @param int SQL data type of the parameter
* @param int length of the data type
diff --git a/framework/Data/TDbConnection.php b/framework/Data/TDbConnection.php
index fe04188c..b475c059 100644
--- a/framework/Data/TDbConnection.php
+++ b/framework/Data/TDbConnection.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbConnection.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
*/
@@ -77,7 +76,6 @@ Prado::using('System.Data.TDbCommand');
* of certain DBMS attributes, such as {@link getNullConversion NullConversion}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDbConnection.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
* @since 3.0
*/
@@ -136,7 +134,7 @@ class TDbConnection extends TComponent
public function __sleep()
{
// $this->close(); - DO NOT CLOSE the current connection as serializing doesn't neccessarily mean we don't this connection anymore in the current session
- return array_diff(parent::__sleep(),array("\0TDbConnection\0_pdo","\0TDbConnection\0_active"));
+ return array_diff(parent::__sleep(),array("\0TDbConnection\0_pdo","\0TDbConnection\0_active"));
}
/**
@@ -638,7 +636,6 @@ class TDbConnection extends TComponent
* TDbColumnCaseMode
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDbConnection.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
* @since 3.0
*/
@@ -662,7 +659,6 @@ class TDbColumnCaseMode extends TEnumerable
* TDbNullConversionMode
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDbConnection.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
* @since 3.0
*/
diff --git a/framework/Data/TDbDataReader.php b/framework/Data/TDbDataReader.php
index 718d355a..b28cd490 100644
--- a/framework/Data/TDbDataReader.php
+++ b/framework/Data/TDbDataReader.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbDataReader.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
*/
@@ -30,7 +29,6 @@
* for more details.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDbDataReader.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
* @since 3.0
*/
diff --git a/framework/Data/TDbTransaction.php b/framework/Data/TDbTransaction.php
index f1be4e0b..8a2a0821 100644
--- a/framework/Data/TDbTransaction.php
+++ b/framework/Data/TDbTransaction.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbTransaction.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
*/
@@ -35,7 +34,6 @@ Prado::using('System.Data.TDbDataReader');
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDbTransaction.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
* @since 3.0
*/
diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php
index 3c9d8514..ad5fe662 100644
--- a/framework/Exceptions/TErrorHandler.php
+++ b/framework/Exceptions/TErrorHandler.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TErrorHandler.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
*/
@@ -45,7 +44,6 @@
* <module id="error" class="TErrorHandler" ErrorTemplatePath="System.Exceptions" />
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TErrorHandler.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
diff --git a/framework/Exceptions/TException.php b/framework/Exceptions/TException.php
index c4fe62b4..24dbdb0f 100644
--- a/framework/Exceptions/TException.php
+++ b/framework/Exceptions/TException.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
*/
@@ -28,7 +27,6 @@
* "message.txt" will be used instead.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
@@ -67,7 +65,7 @@ class TException extends Exception
$msgFile=$this->getErrorMessageFile();
// Cache messages
- if (!isset(self::$_messageCache[$msgFile]))
+ if (!isset(self::$_messageCache[$msgFile]))
{
if(($entries=@file($msgFile))!==false)
{
@@ -132,7 +130,6 @@ class TException extends Exception
* TSystemException is the base class for all framework-level exceptions.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
@@ -146,7 +143,6 @@ class TSystemException extends TException
* TApplicationException is the base class for all user application-level exceptions.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
@@ -160,7 +156,6 @@ class TApplicationException extends TException
* TInvalidOperationException represents an exception caused by invalid operations.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
@@ -174,7 +169,6 @@ class TInvalidOperationException extends TSystemException
* TInvalidDataTypeException represents an exception caused by invalid data type.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
@@ -188,7 +182,6 @@ class TInvalidDataTypeException extends TSystemException
* TInvalidDataValueException represents an exception caused by invalid data value.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
@@ -203,7 +196,6 @@ class TInvalidDataValueException extends TSystemException
* such as error in an application configuration file or control template file.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
@@ -217,7 +209,6 @@ class TConfigurationException extends TSystemException
* TTemplateException represents an exception caused by invalid template syntax.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.1
*/
@@ -282,7 +273,6 @@ class TTemplateException extends TConfigurationException
* TIOException represents an exception related with improper IO operations.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
@@ -296,7 +286,6 @@ class TIOException extends TSystemException
* TDbException represents an exception related with DB operations.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
@@ -310,7 +299,6 @@ class TDbException extends TSystemException
* TDbConnectionException represents an exception caused by DB connection failure.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
@@ -324,7 +312,6 @@ class TDbConnectionException extends TDbException
* TNotSupportedException represents an exception caused by using an unsupported PRADO feature.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
@@ -339,7 +326,6 @@ class TNotSupportedException extends TSystemException
* This exception is mainly thrown within a PHP error handler.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
@@ -382,7 +368,6 @@ class TPhpErrorException extends TSystemException
* It is used by {@link TErrorHandler} to provide different error output to users.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
diff --git a/framework/Exceptions/messages/messages.txt b/framework/Exceptions/messages/messages.txt
index bcfc7f97..8ea41292 100644
--- a/framework/Exceptions/messages/messages.txt
+++ b/framework/Exceptions/messages/messages.txt
@@ -500,4 +500,9 @@ tactivetablecell_control_outoftable = {0} '{1}' must be enclosed within a TTabl
tactivetablecell_control_notincollection = {0} '{1}' no member of the TTableCellCollection of the parent TTableRow control.
tactivetablerow_control_outoftable = {0} '{1}' must be enclosed within a TTable control.
-tactivetablerow_control_notincollection = {0} '{1}' no member of the TTableRowCollection of the parent TTable control. \ No newline at end of file
+tactivetablerow_control_notincollection = {0} '{1}' no member of the TTableRowCollection of the parent TTable control.
+
+juioptions_control_invalid = Control '{0}' must implement IJuiOptions.
+juioptions_option_invalid = '{1}' is not a valid option for control '{0}'.
+
+ratinglist_invalid_caption_id = '{0}' is not a valid caption control for TRatingList '{0}'. \ No newline at end of file
diff --git a/framework/I18N/TChoiceFormat.php b/framework/I18N/TChoiceFormat.php
index ad9a4500..4525aaad 100644
--- a/framework/I18N/TChoiceFormat.php
+++ b/framework/I18N/TChoiceFormat.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TChoiceFormat.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
@@ -65,7 +64,7 @@ Prado::using('System.I18N.TTranslate');
* # <tt>&amp;</tt> -- conditional AND.
* # <tt>&amp;&amp;</tt> -- condition AND with short circuit.
* # <tt>|</tt> -- conditional OR.
- * # <tt>||</tt> -- conditional OR with short circuit.
+ * # <tt>||</tt> -- conditional OR with short circuit.
* # <tt>!</tt> -- negation.
*
* Additional round brackets can also be used to perform grouping.
diff --git a/framework/I18N/TDateFormat.php b/framework/I18N/TDateFormat.php
index 544e4973..e7846be7 100644
--- a/framework/I18N/TDateFormat.php
+++ b/framework/I18N/TDateFormat.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDateFormat.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
@@ -165,7 +164,7 @@ class TDateFormat extends TI18NControl implements IDataRenderer
{
$this->setViewState('Value',$value,'');
}
-
+
/**
* Get the default text value for this control.
* @return string default text value
@@ -174,7 +173,7 @@ class TDateFormat extends TI18NControl implements IDataRenderer
{
return $this->getViewState('DefaultText','');
}
-
+
/**
* Set the default text value for this control.
* @param string default text value
@@ -222,7 +221,7 @@ class TDateFormat extends TI18NControl implements IDataRenderer
$defaultText = $this->getDefaultText();
if(empty($value) && !empty($defaultText))
return $this->getDefaultText();
-
+
$app = $this->getApplication()->getGlobalization();
//initialized the default class wide formatter
diff --git a/framework/I18N/TGlobalization.php b/framework/I18N/TGlobalization.php
index 6638af22..3fbaa2b4 100644
--- a/framework/I18N/TGlobalization.php
+++ b/framework/I18N/TGlobalization.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TGlobalization.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
diff --git a/framework/I18N/TGlobalizationAutoDetect.php b/framework/I18N/TGlobalizationAutoDetect.php
index ad786401..a79a128d 100644
--- a/framework/I18N/TGlobalizationAutoDetect.php
+++ b/framework/I18N/TGlobalizationAutoDetect.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Revision: 1.66 $ $Date: ${DATE} ${TIME} $
* @package System.I18N
@@ -32,7 +32,7 @@ class TGlobalizationAutoDetect extends TGlobalization
parent::init($xml);
//set the culture according to browser language settings
- $http = new HTTPNegotiator();
+ $http = new HTTPNegotiator();
$languages = $http->getLanguages();
if(count($languages) > 0)
{
diff --git a/framework/I18N/TI18NControl.php b/framework/I18N/TI18NControl.php
index 97a7268a..96fc8b62 100644
--- a/framework/I18N/TI18NControl.php
+++ b/framework/I18N/TI18NControl.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TI18NControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
diff --git a/framework/I18N/TNumberFormat.php b/framework/I18N/TNumberFormat.php
index 27c124f7..89eab245 100644
--- a/framework/I18N/TNumberFormat.php
+++ b/framework/I18N/TNumberFormat.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TNumberFormat.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
@@ -116,7 +115,7 @@ class TNumberFormat extends TI18NControl implements IDataRenderer
{
return $this->getViewState('DefaultText','');
}
-
+
/**
* Set the default text value for this control.
* @param string default text value
diff --git a/framework/I18N/TTranslate.php b/framework/I18N/TTranslate.php
index 3382f925..1365b937 100644
--- a/framework/I18N/TTranslate.php
+++ b/framework/I18N/TTranslate.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTranslate.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
@@ -243,7 +242,7 @@ class TTranslate extends TI18NControl
$catalogue = $config['catalogue'];
if (empty($catalogue)) $catalogue='messages';
Translation::init($catalogue);
-
+
$key = $this->getKey();
if(!empty($key)) $text = $key;
diff --git a/framework/I18N/TTranslateParameter.php b/framework/I18N/TTranslateParameter.php
index b461a36a..d5c41230 100644
--- a/framework/I18N/TTranslateParameter.php
+++ b/framework/I18N/TTranslateParameter.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTranslateParameter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
diff --git a/framework/I18N/Translation.php b/framework/I18N/Translation.php
index 5219e132..9592ef53 100644
--- a/framework/I18N/Translation.php
+++ b/framework/I18N/Translation.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: Translation.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
@@ -40,7 +39,7 @@ class Translation extends TComponent
public static function init($catalogue='messages')
{
static $saveEventHandlerAttached=false;
-
+
//initialized the default class wide formatter
if(!isset(self::$formatters[$catalogue]))
{
diff --git a/framework/I18N/core/CultureInfo.php b/framework/I18N/core/CultureInfo.php
index c22ed5c4..fc20b833 100644
--- a/framework/I18N/core/CultureInfo.php
+++ b/framework/I18N/core/CultureInfo.php
@@ -13,7 +13,6 @@
* {@link http://prado.sourceforge.net/}
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: CultureInfo.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.I18N.core
*/
@@ -44,7 +43,6 @@
* For example, Australian English is "en_AU".
*
* @author Xiang Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: CultureInfo.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.I18N.core
*/
class CultureInfo
diff --git a/framework/I18N/core/Gettext/TGettext.php b/framework/I18N/core/Gettext/TGettext.php
index abf32392..2c5f91c7 100644
--- a/framework/I18N/core/Gettext/TGettext.php
+++ b/framework/I18N/core/Gettext/TGettext.php
@@ -32,7 +32,7 @@
/**
* File::Gettext
- *
+ *
* @author Michael Wallner <mike@php.net>
* @license PHP License
*/
@@ -42,11 +42,11 @@
*/
//ini_set('track_errors', true);
-/**
+/**
* File_Gettext
- *
+ *
* GNU gettext file reader and writer.
- *
+ *
* #################################################################
* # All protected members of this class are public in its childs. #
* #################################################################
@@ -54,15 +54,15 @@
* @author Michael Wallner <mike@php.net>
* @version $Revision: 1.4 $
* @access public
- * @package System.I18N.core
+ * @package System.I18N.core
*/
class TGettext
{
/**
* strings
- *
+ *
* associative array with all [msgid => msgstr] entries
- *
+ *
* @access protected
* @var array
*/
@@ -70,40 +70,40 @@ class TGettext
/**
* meta
- *
- * associative array containing meta
+ *
+ * associative array containing meta
* information like project name or content type
- *
+ *
* @access protected
* @var array
*/
protected $meta = array();
-
+
/**
* file path
- *
+ *
* @access protected
* @var string
*/
protected $file = '';
-
+
/**
* Factory
*
* @static
* @access public
- * @return object Returns File_Gettext_PO or File_Gettext_MO on success
+ * @return object Returns File_Gettext_PO or File_Gettext_MO on success
* or PEAR_Error on failure.
* @param string $format MO or PO
* @param string $file path to GNU gettext file
*/
- function factory($format, $file = '')
+ static function factory($format, $file = '')
{
$format = strToUpper($format);
$filename = dirname(__FILE__).'/'.$format.'.php';
if(is_file($filename) == false)
throw new Exception ("Class file $file not found");
-
+
include_once $filename;
$class = 'TGettext_' . $format;
@@ -115,35 +115,35 @@ class TGettext
*
* That's a simple fake of the 'msgfmt' console command. It reads the
* contents of a GNU PO file and saves them to a GNU MO file.
- *
+ *
* @static
* @access public
* @return mixed Returns true on success or PEAR_Error on failure.
* @param string $pofile path to GNU PO file
* @param string $mofile path to GNU MO file
*/
- function poFile2moFile($pofile, $mofile)
+ static function poFile2moFile($pofile, $mofile)
{
if (!is_file($pofile)) {
throw new Exception("File $pofile doesn't exist.");
}
-
+
include_once dirname(__FILE__).'/PO.php';
-
+
$PO = new TGettext_PO($pofile);
if (true !== ($e = $PO->load())) {
return $e;
}
-
+
$MO = $PO->toMO();
if (true !== ($e = $MO->save($mofile))) {
return $e;
}
unset($PO, $MO);
-
+
return true;
}
-
+
/**
* prepare
*
@@ -153,7 +153,7 @@ class TGettext
* @param string $string
* @param bool $reverse
*/
- function prepare($string, $reverse = false)
+ static function prepare($string, $reverse = false)
{
if ($reverse) {
$smap = array('"', "\n", "\t", "\r");
@@ -166,7 +166,7 @@ class TGettext
return (string) str_replace($smap, $rmap, $string);
}
}
-
+
/**
* meta2array
*
@@ -175,7 +175,7 @@ class TGettext
* @return array
* @param string $meta
*/
- function meta2array($meta)
+ static function meta2array($meta)
{
$array = array();
foreach (explode("\n", $meta) as $info) {
@@ -189,7 +189,7 @@ class TGettext
/**
* toArray
- *
+ *
* Returns meta info and strings as an array of a structure like that:
* <code>
* array(
@@ -206,7 +206,7 @@ class TGettext
* )
* )
* </code>
- *
+ *
* @see fromArray()
* @access protected
* @return array
@@ -215,10 +215,10 @@ class TGettext
{
return array('meta' => $this->meta, 'strings' => $this->strings);
}
-
+
/**
* fromArray
- *
+ *
* Assigns meta info and strings from an array of a structure like that:
* <code>
* array(
@@ -235,7 +235,7 @@ class TGettext
* )
* )
* </code>
- *
+ *
* @see toArray()
* @access protected
* @return bool
@@ -255,7 +255,7 @@ class TGettext
}
return true;
}
-
+
/**
* toMO
*
@@ -269,7 +269,7 @@ class TGettext
$MO->fromArray($this->toArray());
return $MO;
}
-
+
/**
* toPO
*
diff --git a/framework/I18N/core/MessageCache.php b/framework/I18N/core/MessageCache.php
index 3bd21704..ad310258 100644
--- a/framework/I18N/core/MessageCache.php
+++ b/framework/I18N/core/MessageCache.php
@@ -2,7 +2,6 @@
/**
* Translation table cache.
* @author $Author: weizhuo $
- * @version $Id: MessageCache.php 3188 2012-07-12 12:13:23Z ctrlaltca $
* @package System.I18N.core
*/
@@ -16,9 +15,8 @@ require_once(dirname(__FILE__).'/TCache_Lite.php');
* It can cache each cataloug+variant or just the whole section.
* @package System.I18N.core
* @author $Author: weizhuo $
- * @version $Id: MessageCache.php 3188 2012-07-12 12:13:23Z ctrlaltca $
*/
-class MessageCache
+class MessageCache
{
/**
@@ -31,16 +29,16 @@ class MessageCache
* Caceh life time, default is 1 year.
*/
protected $lifetime = 3153600;
-
+
/**
* Create a new Translation cache.
* @param string $cacheDir Directory to store the cache files.
*/
public function __construct($cacheDir)
- {
+ {
$cacheDir = $cacheDir.'/';
-
+
if(!is_dir($cacheDir))
throw new Exception(
'The cache directory '.$cacheDir.' does not exists.'.
@@ -49,7 +47,7 @@ class MessageCache
throw new Exception(
'The cache directory '.$cacheDir.' must be writable '.
'by the server.');
-
+
$options = array(
'cacheDir' => $cacheDir,
'lifeTime' => $this->getLifeTime(),
@@ -102,31 +100,31 @@ class MessageCache
* @param string $catalogue The translation section.
* @param string $culture The translation locale, e.g. "en_AU".
* @param string $filename If the source is a file, this file's modified
- * time is newer than the cache's modified time, no cache hit.
+ * time is newer than the cache's modified time, no cache hit.
* @return mixed Boolean FALSE if no cache hit. Otherwise, translation
* table data for the specified section and locale.
*/
- public function get($catalogue, $culture, $lastmodified=0)
+ public function get($catalogue, $culture, $lastmodified=0)
{
$ID = $this->getID($catalogue, $culture);
- $group = $this->getGroup($catalogue, $culture);
+ $group = $this->getGroup($catalogue, $culture);
$this->cache->_setFileName($ID, $group);
$cache = $this->cache->getCacheFile();
-
- if(is_file($cache) == false)
+
+ if(is_file($cache) == false)
return false;
$lastmodified = (int)$lastmodified;
-
+
if($lastmodified <= 0 || $lastmodified > filemtime($cache))
- return false;
-
+ return false;
+
//echo '@@ Cache hit: "'.$ID.'" : "'.$group.'"';
//echo "<br>\n";
-
+
return $this->cache->get($ID, $group);
}
@@ -136,28 +134,28 @@ class MessageCache
* @param string $catalogue The translation section.
* @param string $culture The translation locale, e.g. "en_AU".
*/
- public function save($data, $catalogue, $culture)
- {
+ public function save($data, $catalogue, $culture)
+ {
$ID = $this->getID($catalogue, $culture);
- $group = $this->getGroup($catalogue, $culture);
-
+ $group = $this->getGroup($catalogue, $culture);
+
//echo '## Cache save: "'.$ID.'" : "'.$group.'"';
//echo "<br>\n";
-
+
return $this->cache->save($data, $ID, $group);
}
-
+
/**
* Clean up the cache for the specified section and locale.
* @param string $catalogue The translation section.
* @param string $culture The translation locale, e.g. "en_AU".
*/
- public function clean($catalogue, $culture)
+ public function clean($catalogue, $culture)
{
- $group = $this->getGroup($catalogue, $culture);
+ $group = $this->getGroup($catalogue, $culture);
$this->cache->clean($group);
}
-
+
/**
* Flush the cache. Deletes all the cache files.
*/
diff --git a/framework/I18N/core/TCache_Lite.php b/framework/I18N/core/TCache_Lite.php
index a0629bd1..69e1c308 100644
--- a/framework/I18N/core/TCache_Lite.php
+++ b/framework/I18N/core/TCache_Lite.php
@@ -38,7 +38,6 @@
* Mike BENOIT <ipso@snappymail.ca>
*
* @package System.I18N.core
-* @version $Id: TCache_Lite.php 3188 2012-07-12 12:13:23Z ctrlaltca $
* @author Fabien MARTY <fab@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.gnu.org/copyleft/lesser.html GNU LGPL
diff --git a/framework/IO/TTarFileExtractor.php b/framework/IO/TTarFileExtractor.php
index ca67320d..cb613fff 100644
--- a/framework/IO/TTarFileExtractor.php
+++ b/framework/IO/TTarFileExtractor.php
@@ -4,7 +4,6 @@
*
* @author Vincent Blavet <vincent@phpconcept.net>
* @copyright Copyright &copy; 1997-2003 The PHP Group
- * @version $Id: TTarFileExtractor.php 3188 2012-07-12 12:13:23Z ctrlaltca $
* @package System.IO
*/
@@ -31,7 +30,6 @@
* TTarFileExtractor class
*
* @author Vincent Blavet <vincent@phpconcept.net>
- * @version $Id: TTarFileExtractor.php 3188 2012-07-12 12:13:23Z ctrlaltca $
* @package System.IO
* @since 3.0
*/
diff --git a/framework/IO/TTextWriter.php b/framework/IO/TTextWriter.php
index f5930a73..f888083d 100644
--- a/framework/IO/TTextWriter.php
+++ b/framework/IO/TTextWriter.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTextWriter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.IO
*/
@@ -18,7 +17,6 @@
* and can be obtained by calling {@link flush()}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTextWriter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.IO
* @since 3.0
*/
diff --git a/framework/PradoBase.php b/framework/PradoBase.php
index 6e884cec..3eb4d0d6 100644
--- a/framework/PradoBase.php
+++ b/framework/PradoBase.php
@@ -7,9 +7,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: PradoBase.php 3325 2013-09-13 08:19:04Z ctrlaltca $
* @package System
*/
@@ -34,7 +33,6 @@ if(!defined('PRADO_CHMOD'))
* rewritten for customization.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: PradoBase.php 3325 2013-09-13 08:19:04Z ctrlaltca $
* @package System
* @since 3.0
*/
@@ -191,30 +189,6 @@ class PradoBase
}
/**
- * Serializes a data.
- * The original PHP serialize function has a bug that may not serialize
- * properly an object.
- * @param mixed data to be serialized
- * @return string the serialized data
- */
- public static function serialize($data)
- {
- return serialize($data);
- }
-
- /**
- * Unserializes a data.
- * The original PHP unserialize function has a bug that may not unserialize
- * properly an object.
- * @param string data to be unserialized
- * @return mixed unserialized data, null if unserialize failed
- */
- public static function unserialize($str)
- {
- return unserialize($str);
- }
-
- /**
* Creates a component with the specified type.
* A component type can be either the component class name
* or a namespace referring to the path of the component class file.
diff --git a/framework/Security/IUserManager.php b/framework/Security/IUserManager.php
index 390189cb..0ca65929 100644
--- a/framework/Security/IUserManager.php
+++ b/framework/Security/IUserManager.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: IUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
*/
@@ -18,7 +17,6 @@
* and {@link TUser}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: IUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.0
*/
diff --git a/framework/Security/TAuthManager.php b/framework/Security/TAuthManager.php
index e30b0bcb..2bf6a5b1 100644
--- a/framework/Security/TAuthManager.php
+++ b/framework/Security/TAuthManager.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TAuthManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
*/
@@ -26,7 +25,7 @@ Prado::using('System.Security.IUserManager');
* To login or logout a user, call {@link login} or {@link logout}, respectively.
*
* The {@link setAuthExpire AuthExpire} property can be used to define the time
- * in seconds after which the authentication should expire.
+ * in seconds after which the authentication should expire.
* {@link setAllowAutoLogin AllowAutoLogin} specifies if the login information
* should be stored in a cookie to perform automatic login. Enabling this
* feature will cause that {@link setAuthExpire AuthExpire} has no effect
@@ -37,7 +36,6 @@ Prado::using('System.Security.IUserManager');
* <module id="users" class="System.Security.TUserManager" />
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TAuthManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.0
*/
@@ -290,7 +288,7 @@ class TAuthManager extends TModule
$user=$this->_userManager->getUser(null)->loadFromString($sessionInfo);
// check for authentication expiration
- $isAuthExpired = $this->_authExpire>0 && !$user->getIsGuest() &&
+ $isAuthExpired = $this->_authExpire>0 && !$user->getIsGuest() &&
($expiretime=$session->itemAt('AuthExpireTime')) && $expiretime<time();
// try authenticating through cookie if possible
@@ -321,7 +319,7 @@ class TAuthManager extends TModule
if($this->hasEventHandler('OnAuthenticate'))
$this->raiseEvent('OnAuthenticate',$this,$application);
}
-
+
/**
* Performs user logout on authentication expiration.
* An 'OnAuthExpire' event will be raised if there is any handler attached to it.
@@ -333,7 +331,7 @@ class TAuthManager extends TModule
if($this->hasEventHandler('OnAuthExpire'))
$this->raiseEvent('OnAuthExpire',$this,$param);
}
-
+
/**
* Performs the real authorization work.
* Authorization rules obtained from the application will be used to check
diff --git a/framework/Security/TAuthorizationRule.php b/framework/Security/TAuthorizationRule.php
index cae28bfb..aa9bed90 100644
--- a/framework/Security/TAuthorizationRule.php
+++ b/framework/Security/TAuthorizationRule.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TAuthorizationRule.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
*/
/**
@@ -25,7 +24,6 @@
* IP rules are separated by comma ',' and can contain wild card in the rules (e.g. '192.132.23.33, 192.122.*.*')
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TAuthorizationRule.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.0
*/
@@ -249,7 +247,6 @@ class TAuthorizationRule extends TComponent
* To check if a user is allowed, call {@link isUserAllowed}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TAuthorizationRule.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.0
*/
diff --git a/framework/Security/TDbUserManager.php b/framework/Security/TDbUserManager.php
index aabd6e5c..0832dfe5 100644
--- a/framework/Security/TDbUserManager.php
+++ b/framework/Security/TDbUserManager.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
*/
@@ -44,7 +43,6 @@ Prado::using('System.Security.TUser');
* which specifies how to establish database connection to retrieve user information.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDbUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.1.0
*/
@@ -216,7 +214,6 @@ class TDbUserManager extends TModule implements IUserManager
* - {@link createUser()}: creates a new user instance given the username
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDbUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.1.0
*/
diff --git a/framework/Security/TSecurityManager.php b/framework/Security/TSecurityManager.php
index b5267db1..bdb85564 100644
--- a/framework/Security/TSecurityManager.php
+++ b/framework/Security/TSecurityManager.php
@@ -5,9 +5,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSecurityManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
*/
@@ -36,7 +35,6 @@
* Note, to use encryption, the PHP Mcrypt extension must be loaded.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TSecurityManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.0
*/
@@ -354,7 +352,6 @@ class TSecurityManager extends TModule
* - SHA1: an SHA1 hash is generated from the data and used for validation.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TSecurityManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.0.4
*/
diff --git a/framework/Security/TUser.php b/framework/Security/TUser.php
index 3a7a3fa0..8a229b1a 100644
--- a/framework/Security/TUser.php
+++ b/framework/Security/TUser.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TUser.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
*/
@@ -27,7 +26,6 @@ Prado::using('System.Security.IUserManager');
* TUser is meant to be used together with {@link IUserManager}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TUser.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.0
*/
diff --git a/framework/Security/TUserManager.php b/framework/Security/TUserManager.php
index 5cb716dd..4ad67a15 100644
--- a/framework/Security/TUserManager.php
+++ b/framework/Security/TUserManager.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
*/
@@ -64,7 +63,6 @@ Prado::using('System.Security.TUser');
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Carl Mathisen <carl@kamikazemedia.no>
- * @version $Id: TUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.0
*/
@@ -108,7 +106,7 @@ class TUserManager extends TModule implements IUserManager
*/
public function init($config)
{
- $this->loadUserData($config);
+ $this->loadUserData($config);
if($this->_userFile!==null)
{
if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP)
@@ -125,7 +123,7 @@ class TUserManager extends TModule implements IUserManager
}
$this->_initialized=true;
}
-
+
/*
* Loads user/role information
* @param mixed the variable containing the user information
@@ -389,7 +387,6 @@ class TUserManager extends TModule implements IUserManager
* - SHA1: the password is recorded as the SHA1 hash value of the original password
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.0.4
*/
diff --git a/framework/TApplication.php b/framework/TApplication.php
index 7769a9e0..e015ead8 100644
--- a/framework/TApplication.php
+++ b/framework/TApplication.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TApplication.php 3317 2013-09-03 10:19:09Z ctrlaltca $
* @package System
*/
@@ -105,7 +104,6 @@ Prado::using('System.I18N.TGlobalization');
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TApplication.php 3317 2013-09-03 10:19:09Z ctrlaltca $
* @package System
* @since 3.0
*/
@@ -131,7 +129,7 @@ class TApplication extends TComponent
/**
* File extension for external config files
*/
- const CONFIG_FILE_EXT_XML='.xml';
+ const CONFIG_FILE_EXT_XML='.xml';
/**
* Configuration file type, application.xml and config.xml
*/
@@ -296,7 +294,7 @@ class TApplication extends TComponent
* @var TApplicationMode application mode
*/
private $_mode=TApplicationMode::Debug;
-
+
/**
* @var string Customizable page service ID
*/
@@ -334,7 +332,7 @@ class TApplication extends TComponent
$this->_uniqueID=md5($this->_runtimePath);
$this->_parameters=new TMap;
$this->_services=array($this->getPageServiceID()=>array('TPageService',array(),null));
-
+
Prado::setPathOfAlias('Application',$this->_basePath);
}
@@ -521,7 +519,7 @@ class TApplication extends TComponent
{
$this->_id=$value;
}
-
+
/**
* @return string page service ID
*/
@@ -609,7 +607,7 @@ class TApplication extends TComponent
{
$this->_configType = $value;
}
-
+
/**
* @return string the application configuration type. default is 'xml'
*/
@@ -628,7 +626,7 @@ class TApplication extends TComponent
}
return $this->_configFileExt;
}
-
+
/**
* @return string the default configuration file name
*/
@@ -999,7 +997,7 @@ class TApplication extends TComponent
foreach($config->getProperties() as $name=>$value)
$this->setSubProperty($name,$value);
}
-
+
if(empty($this->_services))
$this->_services=array($this->getPageServiceID()=>array('TPageService',array(),null));
@@ -1071,17 +1069,17 @@ class TApplication extends TComponent
$config=new TApplicationConfiguration;
$config->loadFromFile($this->_configFile);
if($this->_cacheFile!==null)
- file_put_contents($this->_cacheFile,Prado::serialize($config),LOCK_EX);
+ file_put_contents($this->_cacheFile,serialize($config),LOCK_EX);
}
else
- $config=Prado::unserialize(file_get_contents($this->_cacheFile));
+ $config=unserialize(file_get_contents($this->_cacheFile));
$this->applyConfiguration($config,false);
}
if(($serviceID=$this->getRequest()->resolveRequest(array_keys($this->_services)))===null)
$serviceID=$this->getPageServiceID();
-
+
$this->startService($serviceID);
}
@@ -1280,7 +1278,6 @@ class TApplication extends TComponent
* - Normal: the application is running in normal production mode.
* - Performance: the application is running in performance mode.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TApplication.php 3317 2013-09-03 10:19:09Z ctrlaltca $
* @package System
* @since 3.0.4
*/
@@ -1300,7 +1297,6 @@ class TApplicationMode extends TEnumerable
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
- * @version $Id: TApplication.php 3317 2013-09-03 10:19:09Z ctrlaltca $
* @package System
* @since 3.0
*/
@@ -1382,7 +1378,7 @@ class TApplicationConfiguration extends TComponent
$this->_properties[$name]=$value;
}
$this->_empty = false;
- }
+ }
if(isset($config['paths']) && is_array($config['paths']))
$this->loadPathsPhp($config['paths'],$configPath);
@@ -1395,7 +1391,7 @@ class TApplicationConfiguration extends TComponent
if(isset($config['parameters']) && is_array($config['parameters']))
$this->loadParametersPhp($config['parameters'], $configPath);
-
+
if(isset($config['includes']) && is_array($config['includes']))
$this->loadExternalXml($config['includes'],$configPath);
}
@@ -1541,7 +1537,7 @@ class TApplicationConfiguration extends TComponent
$properties['id'] = $id;
$this->_modules[$id]=array($type,$properties,$module);
$this->_empty=false;
- }
+ }
}
/**
@@ -1589,7 +1585,7 @@ class TApplicationConfiguration extends TComponent
$properties['id'] = $id;
$this->_services[$id] = array($type,$properties,$service);
$this->_empty = false;
- }
+ }
}
/**
@@ -1809,7 +1805,6 @@ class TApplicationConfiguration extends TComponent
* Cache will be exploited if it is enabled.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TApplication.php 3317 2013-09-03 10:19:09Z ctrlaltca $
* @package System
* @since 3.0
*/
@@ -1844,11 +1839,11 @@ class TApplicationStatePersister extends TModule implements IStatePersister
public function load()
{
if(($cache=$this->getApplication()->getCache())!==null && ($value=$cache->get(self::CACHE_NAME))!==false)
- return Prado::unserialize($value);
+ return unserialize($value);
else
{
if(($content=@file_get_contents($this->getStateFilePath()))!==false)
- return Prado::unserialize($content);
+ return unserialize($content);
else
return null;
}
@@ -1860,7 +1855,7 @@ class TApplicationStatePersister extends TModule implements IStatePersister
*/
public function save($state)
{
- $content=Prado::serialize($state);
+ $content=serialize($state);
$saveFile=true;
if(($cache=$this->getApplication()->getCache())!==null)
{
diff --git a/framework/TApplicationComponent.php b/framework/TApplicationComponent.php
index a307d54b..a906a232 100644
--- a/framework/TApplicationComponent.php
+++ b/framework/TApplicationComponent.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TApplicationComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
*/
@@ -28,7 +27,6 @@
* publishing private files: {@link publishAsset} and {@link publishFilePath}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TApplicationComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
diff --git a/framework/TComponent.php b/framework/TComponent.php
index e9fa5a65..484a3186 100644
--- a/framework/TComponent.php
+++ b/framework/TComponent.php
@@ -3,14 +3,13 @@
* TComponent, TPropertyValue classes
*
* @author Qiang Xue <qiang.xue@gmail.com>
- *
+ *
* Global Events, intra-object events, Class behaviors, expanded behaviors
* @author Brad Anderson <javalizard@mac.com>
- *
+ *
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
*/
@@ -56,7 +55,7 @@
* </code>
* Js-friendly properties can be accessed using both their Js-less name and their Js-enabled name:
* <code>
- * // set some simple text as property value
+ * // set some simple text as property value
* $component->Text = 'text';
* // set some javascript code as property value
* $component->JsText = 'raw javascript';
@@ -65,7 +64,7 @@
* clientside inside a javascript block.
* In the second case, the property will be 'marked' as being a safe javascript
* statement and will not be encoded when rendered inside a javascript block.
- * This special handling makes use of the {@link TJavaScriptLiteral} class.
+ * This special handling makes use of the {@link TJavaScriptLiteral} class.
*
* Events
*
@@ -100,40 +99,40 @@
* - array($object,'buttonClicked') : $object->buttonClicked($sender,$param);
* - array($object,'MainContent.SubmitButton.buttonClicked') :
* $object->MainContent->SubmitButton->buttonClicked($sender,$param);
- *
- * With the addition of behaviors, a more expansive event model is needed. There
- * are two new event types (global and dynamic events) as well as a more comprehensive
+ *
+ * With the addition of behaviors, a more expansive event model is needed. There
+ * are two new event types (global and dynamic events) as well as a more comprehensive
* behavior model that includes class wide behaviors.
*
* A global event is defined by all events whose name starts with 'fx'.
- * The event name is potentially a method name and is thus case-insensitive. All 'fx' events
+ * The event name is potentially a method name and is thus case-insensitive. All 'fx' events
* are valid as the whole 'fx' event/method space is global in nature. Any object may patch into
- * any global event by defining that event as a method. Global events have priorities
- * just like 'on' events; so as to be able to order the event execution. Due to the
- * nature of all events which start with 'fx' being valid, in effect, every object
- * has every 'fx' global event. It is simply an issue of tapping into the desired
+ * any global event by defining that event as a method. Global events have priorities
+ * just like 'on' events; so as to be able to order the event execution. Due to the
+ * nature of all events which start with 'fx' being valid, in effect, every object
+ * has every 'fx' global event. It is simply an issue of tapping into the desired
* global event.
*
* A global event that starts with 'fx' can be called even if the object does not
* implement the method of the global event. A call to a non-existing 'fx' method
- * will, at minimal, function and return null. If a method argument list has a first
+ * will, at minimal, function and return null. If a method argument list has a first
* parameter, it will be returned instead of null. This allows filtering and chaining.
* 'fx' methods do not automatically install and uninstall. To install and uninstall an
- * object's global event listeners, call the object's {@link listen} and
+ * object's global event listeners, call the object's {@link listen} and
* {@link unlisten} methods, respectively. An object may auto-install its global event
* during {@link __construct} by overriding {@link getAutoGlobalListen} and returning true.
- *
+ *
* As of PHP version 5.3, nulled objects without code references will still continue to persist
* in the global event queue because {@link __destruct} is not automatically called. In the common
* __destruct method, if an object is listening to global events, then {@link unlisten} is called.
* {@link unlisten} is required to be manually called before an object is
- * left without references if it is currently listening to any global events. This includes
+ * left without references if it is currently listening to any global events. This includes
* class wide behaviors.
*
- * An object that contains a method that starts with 'fx' will have those functions
+ * An object that contains a method that starts with 'fx' will have those functions
* automatically receive those events of the same name after {@link listen} is called on the object.
*
- * An object may listen to a global event without defining an 'fx' method of the same name by
+ * An object may listen to a global event without defining an 'fx' method of the same name by
* adding an object method to the global event list. For example
* <code>
* $component->fxGlobalCheck=$callback; // or $component->OnClick->add($callback);
@@ -142,27 +141,27 @@
*
* Events between Objects and their behaviors, Dynamic Events
*
- * An intra-object/behavior event is defined by methods that start with 'dy'. Just as with
+ * An intra-object/behavior event is defined by methods that start with 'dy'. Just as with
* 'fx' global events, every object has every dynamic event. Any call to a method that
- * starts with 'dy' will be handled, regardless of whether it is implemented. These
+ * starts with 'dy' will be handled, regardless of whether it is implemented. These
* events are for communicating with attached behaviors.
- *
+ *
* Dynamic events can be used in a variety of ways. They can be used to tell behaviors
* when a non-behavior method is called. Dynamic events could be used as data filters.
- * They could also be used to specify when a piece of code is to be run, eg. should the
+ * They could also be used to specify when a piece of code is to be run, eg. should the
* loop process be performed on a particular piece of data. In this way, some control
* is handed to the behaviors over the process and/or data.
- *
+ *
* If there are no handlers for an 'fx' or 'dy' event, it will return the first
* parameter of the argument list. If there are no arguments, these events
* will return null. If there are handlers an 'fx' method will be called directly
* within the object. Global 'fx' events are triggered by calling {@link raiseEvent}.
- * For dynamic events where there are behaviors that respond to the dynamic events, a
+ * For dynamic events where there are behaviors that respond to the dynamic events, a
* {@link TCallChain} is developed. A call chain allows the behavior dynamic event
* implementations to call further implementing behaviors within a chain.
- *
- * If an object implements {@link IDynamicMethods}, all global and object dynamic
- * events will be sent to {@link __dycall}. In the case of global events, all
+ *
+ * If an object implements {@link IDynamicMethods}, all global and object dynamic
+ * events will be sent to {@link __dycall}. In the case of global events, all
* global events will trigger this method. In the case of behaviors, all undefined
* dynamic events which are called will be passed through to this method.
*
@@ -171,29 +170,29 @@
*
* There are two types of behaviors. There are individual object behaviors and
* there are class wide behaviors. Class behaviors depend upon object behaviors.
- *
+ *
* When a new class implements {@link IBehavior} or {@link IClassBehavior} or
- * extends {@link TBehavior} or {@link TClassBehavior}, it may be added to an
+ * extends {@link TBehavior} or {@link TClassBehavior}, it may be added to an
* object by calling the object's {@link attachBehavior}. The behaviors associated
- * name can then be used to {@link enableBehavior} or {@link disableBehavior}
+ * name can then be used to {@link enableBehavior} or {@link disableBehavior}
* the specific behavior.
*
- * All behaviors may be turned on and off via {@link enableBehaviors} and
+ * All behaviors may be turned on and off via {@link enableBehaviors} and
* {@link disableBehaviors}, respectively. To check if behaviors are on or off
* a call to {@link getBehaviorsEnabled} will provide the variable.
- *
- * Attaching and detaching whole sets of behaviors is done using
+ *
+ * Attaching and detaching whole sets of behaviors is done using
* {@link attachBehaviors} and {@link detachBehaviors}. {@link clearBehaviors}
* removes all of an object's behaviors.
*
* {@link asa} returns a behavior of a specific name. {@link isa} is the
* behavior inclusive function that acts as the PHP operator {@link instanceof}.
* A behavior could provide the functionality of a specific class thus causing
- * the host object to act similarly to a completely different class. A behavior
- * would then implement {@link IInstanceCheck} to provide the identity of the
+ * the host object to act similarly to a completely different class. A behavior
+ * would then implement {@link IInstanceCheck} to provide the identity of the
* different class.
*
- * Class behaviors are similar to object behaviors except that the class behavior
+ * Class behaviors are similar to object behaviors except that the class behavior
* is the implementation for all instances of the class. A class behavior
* will have the object upon which is being called be prepended to the parameter
* list. This way the object is known across the class behavior implementation.
@@ -202,12 +201,12 @@
* using {@link detachClassBehavior}. Class behaviors are important in that
* they will be applied to all new instances of a particular class. In this way
* class behaviors become default behaviors to a new instances of a class in
- * {@link __construct}. Detaching a class behavior will remove the behavior
+ * {@link __construct}. Detaching a class behavior will remove the behavior
* from the default set of behaviors created for an object when the object
* is instanced.
*
- * Class behaviors are also added to all existing instances via the global 'fx'
- * event mechanism. When a new class behavior is added, the event
+ * Class behaviors are also added to all existing instances via the global 'fx'
+ * event mechanism. When a new class behavior is added, the event
* {@link fxAttachClassBehavior} is raised and all existing instances that are
* listening to this global event (primarily after {@link listen} is called)
* will have this new behavior attached. A similar process is used when
@@ -218,8 +217,8 @@
*
* Dynamic events start with 'dy'. This mechanism is used to allow objects
* to communicate with their behaviors directly. The entire 'dy' event space
- * is valid. All attached, enabled behaviors that implement a dynamic event
- * are called when the host object calls the dynamic event. If there is no
+ * is valid. All attached, enabled behaviors that implement a dynamic event
+ * are called when the host object calls the dynamic event. If there is no
* implementation or behaviors, this returns null when no parameters are
* supplied and will return the first parameter when there is at least one
* parameter in the dynamic event.
@@ -228,7 +227,7 @@
* 5 == $this->dyBehaviorEvent(5); //when no behaviors implement this dynamic event
* </code>
*
- * Dynamic events can be chained together within behaviors to allow for data
+ * Dynamic events can be chained together within behaviors to allow for data
* filtering. Dynamic events are implemented within behaviors by defining the
* event as a method.
* <code>
@@ -239,8 +238,8 @@
* }
* }
* </code>
- * This implementation of a behavior and dynamic event will flow through to the
- * next behavior implementing the dynamic event. The first parameter is always
+ * This implementation of a behavior and dynamic event will flow through to the
+ * next behavior implementing the dynamic event. The first parameter is always
* return when it is supplied. Otherwise a dynamic event returns null.
*
* In the case of a class behavior, the object is also prepended to the dynamic
@@ -258,26 +257,25 @@
*
* Global Event and Dynamic event catching
*
- * Given that all global 'fx' events and dynamic 'dy' events are valid and
+ * Given that all global 'fx' events and dynamic 'dy' events are valid and
* operational, there is a mechanism for catching events called that are not
* implemented (similar to the built-in PHP method {@link __call}). When
- * a dynamic or global event is called but a behavior does not implement it,
- * yet desires to know when an undefined dynamic event is run, the behavior
+ * a dynamic or global event is called but a behavior does not implement it,
+ * yet desires to know when an undefined dynamic event is run, the behavior
* implements the interface {@link IDynamicMethods} and method {@link __dycall}.
*
- * In the case of dynamic events, {@link __dycall} is supplied with the method
+ * In the case of dynamic events, {@link __dycall} is supplied with the method
* name and its parameters. When a global event is raised, via {@link raiseEvent},
* the method is the event name and the parameters are supplied.
*
* When implemented, this catch-all mechanism is called for event global event event
* when implemented outside of a behavior. Within a behavior, it will also be called
- * when the object to which the behavior is attached calls any unimplemented dynamic
- * event. This is the fall-back mechanism for informing a class and/or behavior
+ * when the object to which the behavior is attached calls any unimplemented dynamic
+ * event. This is the fall-back mechanism for informing a class and/or behavior
* of when an global and/or undefined dynamic event is executed.
- *
+ *
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Brad Anderson <javalizard@mac.com>
- * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
@@ -287,18 +285,18 @@ class TComponent
* @var array event handler lists
*/
private $_e=array();
-
+
/**
- * @var boolean if listening is enabled. Automatically turned on or off in
+ * @var boolean if listening is enabled. Automatically turned on or off in
* constructor according to {@link getAutoGlobalListen}. Default false, off
*/
private $_listeningenabled=false;
-
+
/**
* @var array static registered global event handler lists
*/
private static $_ue=array();
-
+
/**
* @var boolean if object behaviors are on or off. default true, on
*/
@@ -308,13 +306,13 @@ class TComponent
* @var TPriorityMap list of object behaviors
*/
private $_m=null;
-
+
/**
* @var array static global class behaviors, these behaviors are added upon instantiation of a class
*/
private static $_um=array();
-
-
+
+
/**
* @const string the name of the global {@link raiseEvent} listener
*/
@@ -323,7 +321,7 @@ class TComponent
/**
* The common __construct
- * If desired by the new object, this will auto install and listen to global event functions
+ * If desired by the new object, this will auto install and listen to global event functions
* as defined by the object via 'fx' methods. This also attaches any predefined behaviors.
* This function installs all class behaviors in a class hierarchy from the deepest subclass
* through each parent to the top most class, TComponent.
@@ -331,22 +329,22 @@ class TComponent
public function __construct() {
if($this->getAutoGlobalListen())
$this->listen();
-
+
$classes=array_reverse($this->getClassHierarchy(true));
foreach($classes as $class) {
if(isset(self::$_um[$class]))
$this->attachBehaviors(self::$_um[$class]);
}
}
-
-
+
+
/**
* Tells TComponent whether or not to automatically listen to global events.
* Defaults to false because PHP variable cleanup is affected if this is true.
* When unsetting a variable that is listening to global events, {@link unlisten}
* must explicitly be called when cleaning variables allocation or else the global
* event registry will contain references to the old object. This is true for PHP 5.4
- *
+ *
* Override this method by a subclass to change the setting. When set to true, this
* will enable {@link __construct} to call {@link listen}.
*
@@ -368,19 +366,19 @@ class TComponent
if($this->_listeningenabled)
$this->unlisten();
}
-
-
+
+
/**
- * This utility function is a private array filter method. The array values
+ * This utility function is a private array filter method. The array values
* that start with 'fx' are filtered in.
*/
private function filter_prado_fx($name) {
return strncasecmp($name,'fx',2)===0;
}
-
-
+
+
/**
- * This returns an array of the class name and the names of all its parents. The base object first,
+ * This returns an array of the class name and the names of all its parents. The base object first,
* {@link TComponent}, and the deepest subclass is last.
* @param boolean optional should the names be all lowercase true/false
* @return array array of strings being the class hierarchy of $this.
@@ -394,10 +392,10 @@ class TComponent
return array_map('strtolower',$classes);
return $classes;
}
-
-
+
+
/**
- * This adds an object's fx event handlers into the global broadcaster to listen into any
+ * This adds an object's fx event handlers into the global broadcaster to listen into any
* broadcast global events called through {@link raiseEvent}
*
* Behaviors may implement the function:
@@ -413,24 +411,24 @@ class TComponent
public function listen() {
if($this->_listeningenabled)
return;
-
+
$fx=array_filter(get_class_methods($this),array($this,'filter_prado_fx'));
-
+
foreach($fx as $func)
$this->attachEventHandler($func,array($this,$func));
-
+
if(is_a($this,'IDynamicMethods')) {
$this->attachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER,array($this,'__dycall'));
array_push($fx,TComponent::GLOBAL_RAISE_EVENT_LISTENER);
}
-
+
$this->_listeningenabled=true;
-
+
$this->dyListen($fx);
-
+
return count($fx);
}
-
+
/**
* this removes an object's fx events from the global broadcaster
*
@@ -447,24 +445,24 @@ class TComponent
public function unlisten() {
if(!$this->_listeningenabled)
return;
-
+
$fx=array_filter(get_class_methods($this),array($this,'filter_prado_fx'));
-
+
foreach($fx as $func)
$this->detachEventHandler($func,array($this,$func));
-
+
if(is_a($this,'IDynamicMethods')) {
$this->detachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER,array($this,'__dycall'));
array_push($fx,TComponent::GLOBAL_RAISE_EVENT_LISTENER);
}
-
+
$this->_listeningenabled=false;
-
+
$this->dyUnlisten($fx);
-
+
return count($fx);
}
-
+
/**
* Gets the state of listening to global events
* @return boolean is Listening to global broadcast enabled
@@ -473,12 +471,12 @@ class TComponent
{
return $this->_listeningenabled;
}
-
+
/**
* Calls a method.
* Do not call this method directly. This is a PHP magic method that we override
- * to allow behaviors, dynamic events (intra-object/behavior events),
+ * to allow behaviors, dynamic events (intra-object/behavior events),
* undefined dynamic and global events, and
* to allow using the following syntax to call a property setter or getter.
* <code>
@@ -495,7 +493,7 @@ class TComponent
* @param mixed method parameters
* @throws TInvalidOperationException If the property is not defined or read-only or
* method is undefined
- * @return mixed result of the method call, or false if 'fx' or 'dy' function but
+ * @return mixed result of the method call, or false if 'fx' or 'dy' function but
* is not found in the class, otherwise it runs
*/
public function __call($method, $args)
@@ -516,7 +514,7 @@ class TComponent
if (($getset=='set')&&method_exists($this,'getjs'.$propname))
throw new TInvalidOperationException('component_property_readonly',get_class($this),$method);
}
-
+
if($this->_m!==null&&$this->_behaviorsenabled)
{
if(strncasecmp($method,'dy',2)===0)
@@ -531,7 +529,7 @@ class TComponent
array_unshift($behavior_args,$this);
$callchain->addCall(array($behavior,$method),$behavior_args);
}
-
+
}
if($callchain->getCount()>0)
return call_user_func_array(array($callchain,'call'),$args);
@@ -549,14 +547,14 @@ class TComponent
}
}
}
-
+
if(strncasecmp($method,'dy',2)===0||strncasecmp($method,'fx',2)===0)
{
if($this instanceof IDynamicMethods)
return $this->__dycall($method,$args);
return isset($args[0])?$args[0]:null;
}
-
+
throw new TApplicationException('component_method_undefined',get_class($this),$method);
}
@@ -675,9 +673,9 @@ class TComponent
}
}
if($sets)return $value;
-
+
}
-
+
if(method_exists($this,'get'.$name)||method_exists($this,'getjs'.$name))
{
throw new TInvalidOperationException('component_property_readonly',get_class($this),$name);
@@ -690,12 +688,12 @@ class TComponent
/**
* Checks if a property value is null, there are no events in the object
- * event list or global event list registered under the name, and, if
- * behaviors are enabled,
+ * event list or global event list registered under the name, and, if
+ * behaviors are enabled,
* Do not call this method. This is a PHP magic method that we override
* to allow using isset() to detect if a component property is set or not.
- * This also works for global events. When behaviors are enabled, it
- * will check for a behavior of the specified name, and also check
+ * This also works for global events. When behaviors are enabled, it
+ * will check for a behavior of the specified name, and also check
* the behavior for events and properties.
* @param string the property name or the event name
* @since 3.2.3
@@ -725,7 +723,7 @@ class TComponent
if((!($behavior instanceof IBehavior)||$behavior->getEnabled()))
return isset($behavior->$name);
}
-
+
}
else
return false;
@@ -733,7 +731,7 @@ class TComponent
/**
* Sets a component property to be null. Clears the object or global
- * events. When enabled, loops through all behaviors and unsets the
+ * events. When enabled, loops through all behaviors and unsets the
* property or event.
* Do not call this method. This is a PHP magic method that we override
* to allow using unset() to set a component property to be null.
@@ -874,9 +872,9 @@ class TComponent
/**
* Determines whether an event is defined.
- * An event is defined if the class has a method whose name is the event name
+ * An event is defined if the class has a method whose name is the event name
* prefixed with 'on', 'fx', or 'dy'.
- * Every object responds to every 'fx' and 'dy' event as they are in a universally
+ * Every object responds to every 'fx' and 'dy' event as they are in a universally
* accepted event space. 'on' event must be declared by the object.
* When enabled, this will loop through all active behaviors for 'on' events
* defined by the behavior.
@@ -888,7 +886,7 @@ class TComponent
{
if((strncasecmp($name,'on',2)===0&&method_exists($this,$name))||strncasecmp($name,'fx',2)===0||strncasecmp($name,'dy',2)===0)
return true;
-
+
else if($this->_m!==null&&$this->_behaviorsenabled)
{
foreach($this->_m->toArray() as $behavior)
@@ -901,9 +899,9 @@ class TComponent
}
/**
- * Checks if an event has any handlers. This function also checks through all
+ * Checks if an event has any handlers. This function also checks through all
* the behaviors for 'on' events when behaviors are enabled.
- * 'dy' dynamic events are not handled by this function.
+ * 'dy' dynamic events are not handled by this function.
* @param string the event name
* @return boolean whether an event has been attached one or several handlers
*/
@@ -928,7 +926,7 @@ class TComponent
}
/**
- * Returns the list of attached event handlers for an 'on' or 'fx' event. This function also
+ * Returns the list of attached event handlers for an 'on' or 'fx' event. This function also
* checks through all the behaviors for 'on' event lists when behaviors are enabled.
* @return TPriorityList list of attached event handlers for an event
* @throws TInvalidOperationException if the event is not defined
@@ -976,7 +974,7 @@ class TComponent
* function handlerName($sender, $param, $name) {}
* </code>
* where $sender represents the object that raises the event,
- * and $param is the event parameter. $name refers to the event name
+ * and $param is the event parameter. $name refers to the event name
* being handled.
*
* This is a convenient method to add an event handler.
@@ -1001,7 +999,7 @@ class TComponent
*
* @param string the event name
* @param callback the event handler
- * @param numeric|null the priority of the handler, defaults to null which translates into the
+ * @param numeric|null the priority of the handler, defaults to null which translates into the
* default priority of 10.0 within {@link TPriorityList}
* @throws TInvalidOperationException if the event does not exist
*/
@@ -1012,11 +1010,11 @@ class TComponent
/**
* Detaches an existing event handler.
- * This method is the opposite of {@link attachEventHandler}. It will detach
+ * This method is the opposite of {@link attachEventHandler}. It will detach
* any 'on' events definedb by an objects active behaviors as well.
* @param string event name
* @param callback the event handler to be removed
- * @param numeric|false|null the priority of the handler, defaults to false which translates
+ * @param numeric|false|null the priority of the handler, defaults to false which translates
* to an item of any priority within {@link TPriorityList}; null means the default priority
* @return boolean if the removal is successful
*/
@@ -1041,10 +1039,10 @@ class TComponent
* This method represents the happening of an event and will
* invoke all attached event handlers for the event in {@link TPriorityList} order.
* This method does not handle intra-object/behavior dynamic 'dy' events.
- *
- * There are ways to handle event responses. By defailt {@link EVENT_RESULT_FILTER},
- * all event responses are stored in an array, filtered for null responses, and returned.
- * If {@link EVENT_RESULT_ALL} is specified, all returned results will be stored along
+ *
+ * There are ways to handle event responses. By defailt {@link EVENT_RESULT_FILTER},
+ * all event responses are stored in an array, filtered for null responses, and returned.
+ * If {@link EVENT_RESULT_ALL} is specified, all returned results will be stored along
* with the sender and param in an array
* <code>
* $result[] = array('sender'=>$sender,'param'=>$param,'response'=>$response);
@@ -1054,14 +1052,14 @@ class TComponent
* fed forward as the parameters for the next event. This allows for events to filter data
* directly by affecting the event parameters
*
- * If a callable function is set in the response type or the post function filter is specified then the
+ * If a callable function is set in the response type or the post function filter is specified then the
* result of each called event handler is post processed by the callable function. Used in
* combination with {@link EVENT_RESULT_FEED_FORWARD}, any event (and its result) can be chained.
*
- * When raising a global 'fx' event, registered handlers in the global event list for
+ * When raising a global 'fx' event, registered handlers in the global event list for
* {@link GLOBAL_RAISE_EVENT_LISTENER} are always added into the set of event handlers. In this way,
- * these global events are always raised for every global 'fx' event. The registered handlers for global
- * raiseEvent events have priorities. Any registered global raiseEvent event handlers with a priority less than zero
+ * these global events are always raised for every global 'fx' event. The registered handlers for global
+ * raiseEvent events have priorities. Any registered global raiseEvent event handlers with a priority less than zero
* are added before the main event handlers being raised and any registered global raiseEvent event handlers
* with a priority equal or greater than zero are added after the main event handlers being raised. In this way
* all {@link GLOBAL_RAISE_EVENT_LISTENER} handlers are always called for every raised 'fx' event.
@@ -1087,22 +1085,22 @@ class TComponent
* dyPreRaiseEvent has the effect of being able to change the event being raised. This intra
* object/behavior event returns the name of the desired event to be raised. It will pass through
* if no dynamic event is specified, or if the original event name is returned.
- * dyIntraRaiseEventTestHandler returns true or false as to whether a specific handler should be
+ * dyIntraRaiseEventTestHandler returns true or false as to whether a specific handler should be
* called for a specific raised event (and associated event arguments)
* dyIntraRaiseEventPostHandler does not return anything. This allows behaviors to access the results
* of an event handler in the per handler loop.
* dyPostRaiseEvent returns the responses. This allows for any post processing of the event
* results from the sum of all event handlers
*
- * When handling a catch-all {@link __dycall}, the method name is the name of the event
+ * When handling a catch-all {@link __dycall}, the method name is the name of the event
* and the parameters are the sender, the param, and then the name of the event.
- *
+ *
* @param string the event name
* @param mixed the event sender object
* @param TEventParameter the event parameter
* @param numeric how the results of the event are tabulated. default: {@link EVENT_RESULT_FILTER} The default filters out
* null responses. optional
- * @param function any per handler filtering of the response result needed is passed through
+ * @param function any per handler filtering of the response result needed is passed through
* this if not null. default: null. optional
* @return mixed the results of the event
* @throws TInvalidOperationException if the event is undefined
@@ -1116,15 +1114,15 @@ class TComponent
$postfunction=$responsetype;
$responsetype=null;
}
-
+
if($responsetype===null)
$responsetype=TEventResults::EVENT_RESULT_FILTER;
-
+
$name=strtolower($name);
$responses=array();
-
+
$name=$this->dyPreRaiseEvent($name,$sender,$param,$responsetype,$postfunction);
-
+
if($this->hasEventHandler($name)||$this->hasEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER))
{
$handlers=$this->getEventHandlers($name);
@@ -1139,7 +1137,7 @@ class TComponent
{
if($this->dyIntraRaiseEventTestHandler($handler,$sender,$param,$name)===false)
continue;
-
+
if(is_string($handler))
{
if(($pos=strrpos($handler,'.'))!==false)
@@ -1184,30 +1182,30 @@ class TComponent
}
else
throw new TInvalidDataValueException('component_eventhandler_invalid',get_class($this),$name,gettype($handler));
-
+
$this->dyIntraRaiseEventPostHandler($name,$sender,$param,$handler,$response);
-
+
if($postfunction)
$response=call_user_func_array($postfunction,array($sender,$param,$this,$response));
-
+
if($responsetype&TEventResults::EVENT_RESULT_ALL)
$responses[]=array('sender'=>$sender,'param'=>$param,'response'=>$response);
else
$responses[]=$response;
-
+
if($response!==null&&($responsetype&TEventResults::EVENT_RESULT_FEED_FORWARD))
$param=$response;
-
+
}
}
else if(strncasecmp($name,'on',2)===0&&!$this->hasEvent($name))
throw new TInvalidOperationException('component_event_undefined',get_class($this),$name);
-
+
if($responsetype&TEventResults::EVENT_RESULT_FILTER)
$responses=array_filter($responses);
-
+
$responses=$this->dyPostRaiseEvent($responses,$name,$sender,$param,$responsetype,$postfunction);
-
+
return $responses;
}
@@ -1220,7 +1218,7 @@ class TComponent
* return $chain->dyEvaluateExpressionFilter(str_replace('foo', 'bar', $expression)); //example
* }
* </code>
- * to be executed when evaluateExpression is called. All attached behaviors are notified through
+ * to be executed when evaluateExpression is called. All attached behaviors are notified through
* dyEvaluateExpressionFilter. The chaining is important in this function due to the filtering
* pass-through effect.
*
@@ -1252,7 +1250,7 @@ class TComponent
* return $chain->dyEvaluateStatementsFilter(str_replace('foo', 'bar', $statements)); //example
* }
* </code>
- * to be executed when evaluateStatements is called. All attached behaviors are notified through
+ * to be executed when evaluateStatements is called. All attached behaviors are notified through
* dyEvaluateStatementsFilter. The chaining is important in this function due to the filtering
* pass-through effect.
*
@@ -1291,7 +1289,7 @@ class TComponent
* return $chain->dyCreatedOnTemplate($parent); //example
* }
* </code>
- * to be executed when createdOnTemplate is called. All attached behaviors are notified through
+ * to be executed when createdOnTemplate is called. All attached behaviors are notified through
* dyCreatedOnTemplate.
*
* @param TComponent potential parent of this control
@@ -1314,7 +1312,7 @@ class TComponent
* public function dyAddParsedObject($object[, $chain]) {
* }
* </code>
- * to be executed when addParsedObject is called. All attached behaviors are notified through
+ * to be executed when addParsedObject is called. All attached behaviors are notified through
* dyAddParsedObject.
*
* @param string|TComponent text string or component parsed and instantiated in template
@@ -1324,10 +1322,10 @@ class TComponent
{
$this->dyAddParsedObject($object);
}
-
-
+
+
/**
- * This is the method registered for all instanced objects should a class behavior be added after
+ * This is the method registered for all instanced objects should a class behavior be added after
* the class is instanced. Only when the class to which the behavior is being added is in this
* object's class hierarchy, via {@link getClassHierarchy}, is the behavior added to this instance.
* @param $sender the application
@@ -1338,10 +1336,10 @@ class TComponent
if(in_array($param->getClass(),$this->getClassHierarchy(true)))
return $this->attachBehavior($param->getName(),$param->getBehavior(),$param->getPriority());
}
-
-
+
+
/**
- * This is the method registered for all instanced objects should a class behavior be removed after
+ * This is the method registered for all instanced objects should a class behavior be removed after
* the class is instanced. Only when the class to which the behavior is being added is in this
* object's class hierarchy, via {@link getClassHierarchy}, is the behavior removed from this instance.
* @param $sender the application
@@ -1352,17 +1350,17 @@ class TComponent
if(in_array($param->getClass(),$this->getClassHierarchy(true)))
return $this->detachBehavior($param->getName(),$param->getPriority());
}
-
-
+
+
/**
- * This will add a class behavior to all classes instanced (that are listening) and future newly instanced objects.
- * This registers the behavior for future instances and pushes the changes to all the instances that are listening as well.
+ * This will add a class behavior to all classes instanced (that are listening) and future newly instanced objects.
+ * This registers the behavior for future instances and pushes the changes to all the instances that are listening as well.
* The universal class behaviors are stored in an inverted stack with the latest class behavior being at the first position in the array.
* This is done so class behaviors are added last first.
* @param string name the key of the class behavior
* @param object|string class behavior or name of the object behavior per instance
* @param string|class string of class or class on which to attach this behavior. Defaults to null which will error
- * but more important, if this is on PHP 5.3 it will use Late Static Binding to derive the class
+ * but more important, if this is on PHP 5.3 it will use Late Static Binding to derive the class
* it should extend.
* <code>
* TPanel::attachClassBehavior('javascripts', (new TJsPanelBehavior())->init($this));
@@ -1377,7 +1375,7 @@ class TComponent
$class=get_called_class();
if(!$class)
throw new TInvalidOperationException('component_no_class_provided_nor_late_binding');
-
+
if(!is_string($name))
$name=get_class($name);
$class=strtolower($class);
@@ -1392,16 +1390,16 @@ class TComponent
$behaviorObject=is_string($behavior)?new $behavior:$behavior;
return $behaviorObject->raiseEvent('fxAttachClassBehavior',null,$param);
}
-
-
+
+
/**
* This will remove a behavior from a class. It unregisters it from future instances and
* pulls the changes from all the instances that are listening as well.
* PHP 5.3 uses Late Static Binding to derive the static class upon which this method is called.
* @param $name the key of the class behavior
- * @param $class string class on which to attach this behavior. Defaults to null.
- * @param $priority numeric|null|false priority. false is any priority, null is default
- * {@link TPriorityList} priority, and numeric is a specific priority.
+ * @param $class string class on which to attach this behavior. Defaults to null.
+ * @param $priority numeric|null|false priority. false is any priority, null is default
+ * {@link TPriorityList} priority, and numeric is a specific priority.
* @throws Exception if the the class cannot be derived from Late Static Binding and is not
* not supplied as a parameter.
* @since 3.2.3
@@ -1411,7 +1409,7 @@ class TComponent
$class=get_called_class();
if(!$class)
throw new TInvalidOperationException('component_no_class_provided_nor_late_binding');
-
+
$class=strtolower($class);
if(!is_string($name))
$name=get_class($name);
@@ -1443,8 +1441,8 @@ class TComponent
* then the behavior can determine what it is an instanceof. If this behavior function returns true,
* then this method returns true. If the behavior instance checking function returns false,
* then no further checking is performed as it is assumed to be correct.
- *
- * If the behavior instance check function returns nothing or null or the behavior
+ *
+ * If the behavior instance check function returns nothing or null or the behavior
* doesn't implement the {@link IInstanceCheck} interface, then the default instanceof occurs.
* The default isa behavior is to check if the behavior is an instanceof the class.
*
@@ -1463,7 +1461,7 @@ class TComponent
foreach($this->_m->toArray() as $behavior){
if(($behavior instanceof IBehavior)&&!$behavior->getEnabled())
continue;
-
+
$check = null;
if(($behavior->isa('IInstanceCheck'))&&$check=$behavior->isinstanceof($class,$this))
return true;
@@ -1535,7 +1533,7 @@ class TComponent
* public function dyAttachBehavior($name,$behavior[, $chain]) {
* }
* </code>
- * to be executed when attachBehavior is called. All attached behaviors are notified through
+ * to be executed when attachBehavior is called. All attached behaviors are notified through
* dyAttachBehavior.
*
* @param string the behavior's name. It should uniquely identify this behavior.
@@ -1569,7 +1567,7 @@ class TComponent
* public function dyDetachBehavior($name,$behavior[, $chain]) {
* }
* </code>
- * to be executed when detachBehavior is called. All attached behaviors are notified through
+ * to be executed when detachBehavior is called. All attached behaviors are notified through
* dyDetachBehavior.
*
* @param string the behavior's name. It uniquely identifies the behavior.
@@ -1597,7 +1595,7 @@ class TComponent
* public function dyEnableBehaviors($name,$behavior[, $chain]) {
* }
* </code>
- * to be executed when enableBehaviors is called. All attached behaviors are notified through
+ * to be executed when enableBehaviors is called. All attached behaviors are notified through
* dyEnableBehaviors.
* @since 3.2.3
*/
@@ -1618,7 +1616,7 @@ class TComponent
* public function dyDisableBehaviors($name,$behavior[, $chain]) {
* }
* </code>
- * to be executed when disableBehaviors is called. All attached behaviors are notified through
+ * to be executed when disableBehaviors is called. All attached behaviors are notified through
* dyDisableBehaviors.
* @since 3.2.3
*/
@@ -1630,7 +1628,7 @@ class TComponent
$this->_behaviorsenabled=false;
}
}
-
+
/**
* Returns if all the behaviors are turned on or off for the object.
@@ -1652,7 +1650,7 @@ class TComponent
* public function dyEnableBehavior($name,$behavior[, $chain]) {
* }
* </code>
- * to be executed when enableBehavior is called. All attached behaviors are notified through
+ * to be executed when enableBehavior is called. All attached behaviors are notified through
* dyEnableBehavior.
*
* @param string the behavior's name. It uniquely identifies the behavior.
@@ -1680,7 +1678,7 @@ class TComponent
* public function dyDisableBehavior($name,$behavior[, $chain]) {
* }
* </code>
- * to be executed when disableBehavior is called. All attached behaviors are notified through
+ * to be executed when disableBehavior is called. All attached behaviors are notified through
* dyDisableBehavior.
*
* @param string the behavior's name. It uniquely identifies the behavior.
@@ -1718,11 +1716,11 @@ class TComponent
{
$a = (array)$this;
$a = array_keys($a);
- $exprops = array();
+ $exprops = array();
if($this->_listeningenabled===false)
- $exprops[] = "\0TComponent\0_listeningenabled";
+ $exprops[] = "\0TComponent\0_listeningenabled";
if($this->_behaviorsenabled===true)
- $exprops[] = "\0TComponent\0_behaviorsenabled";
+ $exprops[] = "\0TComponent\0_behaviorsenabled";
if ($this->_e===array())
$exprops[] = "\0TComponent\0_e";
if ($this->_m===null)
@@ -1763,7 +1761,7 @@ class TClassBehaviorEventParameter extends TEventParameter
private $_name;
private $_behavior;
private $_priority;
-
+
/**
* Holds the parameters for the Class Behavior Events
* @param string $class this is the class to get the behavior
@@ -1777,7 +1775,7 @@ class TClassBehaviorEventParameter extends TEventParameter
$this->_behavior=$behavior;
$this->_priority=$priority;
}
-
+
/**
* This is the class to get the behavior
* @return string the class to get the behavior
@@ -1786,7 +1784,7 @@ class TClassBehaviorEventParameter extends TEventParameter
{
return $this->_class;
}
-
+
/**
* name of the behavior
* @return string the name to get the behavior
@@ -1795,19 +1793,19 @@ class TClassBehaviorEventParameter extends TEventParameter
{
return $this->_name;
}
-
+
/**
* This is the behavior which the class is to get
- * @return object the behavior to implement
+ * @return object the behavior to implement
*/
public function getBehavior()
{
return $this->_behavior;
}
-
+
/**
* This is the priority which the behavior is to get
- * @return numeric the priority of the behavior
+ * @return numeric the priority of the behavior
*/
public function getPriority()
{
@@ -1834,7 +1832,6 @@ class TClassBehaviorEventParameter extends TEventParameter
* TTextAlign::Right.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
@@ -1897,7 +1894,6 @@ class TEnumerable implements Iterator
* - enum: enumerable type, represented by an array of strings.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
@@ -2050,7 +2046,6 @@ class TPropertyValue
* TEventParameter is the base class for all event parameter classes.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
@@ -2078,7 +2073,6 @@ class TEventResults extends TEnumerable {
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
@@ -2247,9 +2241,9 @@ class TComponentReflection extends TComponent
}
/**
- * IBaseBehavior interface is the base behavior class from which all other
+ * IBaseBehavior interface is the base behavior class from which all other
* behaviors types are derived
- *
+ *
* @author Brad Anderson <javalizard@mac.com>
* @version $Id$
* @package System
@@ -2272,7 +2266,7 @@ interface IBaseBehavior {
* IBehavior interfaces is implemented by instance behavior classes.
*
* A behavior is a way to enhance a component with additional methods and
- * events that are defined in the behavior class and not available in the
+ * events that are defined in the behavior class and not available in the
* class. Objects may signal behaviors through dynamic events.
*
* @author Brad Anderson <javalizard@mac.com>
@@ -2294,11 +2288,11 @@ interface IBehavior extends IBaseBehavior
/**
- * IClassBehavior interface is implements behaviors across all instances of
+ * IClassBehavior interface is implements behaviors across all instances of
* a particular class
*
- * Any calls to functions not present in the original object but to behaviors
- * derived from this class, will have inserted as the first argument parameter
+ * Any calls to functions not present in the original object but to behaviors
+ * derived from this class, will have inserted as the first argument parameter
* the object containing the behavior.
*
* For example:
@@ -2329,9 +2323,9 @@ interface IClassBehavior extends IBaseBehavior {
/**
- * IInstanceCheck This interface allows objects to determine their own
- * 'instanceof' results when {@link TComponent::isa} is called. This is
- * important with behaviors because behaviors may want to look like
+ * IInstanceCheck This interface allows objects to determine their own
+ * 'instanceof' results when {@link TComponent::isa} is called. This is
+ * important with behaviors because behaviors may want to look like
* particular objects other than themselves.
*
* @author Brad Anderson <javalizard@mac.com>
@@ -2341,20 +2335,20 @@ interface IClassBehavior extends IBaseBehavior {
*/
interface IInstanceCheck {
/**
- * The method checks $this or, if needed, the parameter $instance is of type
- * class. In the case of a Class Behavior, the instance to which the behavior
+ * The method checks $this or, if needed, the parameter $instance is of type
+ * class. In the case of a Class Behavior, the instance to which the behavior
* is attached may be important to determine if $this is an instance
* of a particular class.
* @param class|string the component that this behavior is checking if it is an instanceof.
* @param object the object which the behavior is attached to. default: null
- * @return boolean|null if the this or the instance is of type class. When null, no information could be derived and
+ * @return boolean|null if the this or the instance is of type class. When null, no information could be derived and
* the default mechanisms take over.
*/
public function isinstanceof($class,$instance=null);
}
/**
- * TJavaScriptLiteral class that encloses string literals that are not
+ * TJavaScriptLiteral class that encloses string literals that are not
* supposed to be escaped by {@link TJavaScript::encode() }
*
* Since Prado 3.2 all the data that gets sent clientside inside a javascript statement
@@ -2371,7 +2365,6 @@ interface IInstanceCheck {
* $raw=_js($js);
* </code>
*
- * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.2.0
*/
@@ -2397,9 +2390,8 @@ class TJavaScriptLiteral
/**
* TJavaScriptString class is an internal class that marks strings that will be
- * forcibly encoded when rendered inside a javascript block
+ * forcibly encoded when rendered inside a javascript block
*
- * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.2.0
*/
diff --git a/framework/TModule.php b/framework/TModule.php
index fee51016..7c149962 100644
--- a/framework/TModule.php
+++ b/framework/TModule.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TModule.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
*/
@@ -17,7 +16,6 @@
* used as the basic class for application modules.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TModule.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
diff --git a/framework/TService.php b/framework/TService.php
index 1ec20017..9c51eb5a 100644
--- a/framework/TService.php
+++ b/framework/TService.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
*/
@@ -17,7 +16,6 @@
* used as the basic class for application services.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
diff --git a/framework/TShellApplication.php b/framework/TShellApplication.php
index 3552d8a7..e989ed9f 100644
--- a/framework/TShellApplication.php
+++ b/framework/TShellApplication.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TShellApplication.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
*/
@@ -29,7 +28,6 @@
* accessibility to resources as the PRADO Web applications.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TShellApplication.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.1.0
*/
diff --git a/framework/Util/TBehavior.php b/framework/Util/TBehavior.php
index 951a758f..56a81a87 100644
--- a/framework/Util/TBehavior.php
+++ b/framework/Util/TBehavior.php
@@ -11,7 +11,6 @@
/**
* TBehavior is a convenient base class for behavior classes.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBehaviour.php 3211 2012-10-31 02:35:01Z javalizard@gmail.com $
* @package System.Util
* @since 3.2.3
*/
diff --git a/framework/Util/TCallChain.php b/framework/Util/TCallChain.php
index 9d6144b3..a6d99a61 100644
--- a/framework/Util/TCallChain.php
+++ b/framework/Util/TCallChain.php
@@ -4,16 +4,15 @@
*
* @author Brad Anderson <javalizard@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2008-2013 Pradosoft
+ * @copyright Copyright &copy; 2008-2014 Pradosoft
* @license http://www.pradosoft.com/license/
*/
/**
* TCallChain is a recursive event calling mechanism. This class implements
* the {@link IDynamicMethods} class so that any 'dy' event calls can be caught
- * and patched through to the intended recipient
+ * and patched through to the intended recipient
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: TCallChain.php 564 2009-01-21 22:07:10Z javalizard $
* @package System.Util
* @since 3.2.3
*/
@@ -23,12 +22,12 @@ class TCallChain extends TList implements IDynamicMethods
* @var {@link TListIterator} for moving through the chained method calls
*/
private $_iterator=null;
-
+
/**
* @var string the method name of the call chain
*/
private $_method=null;
-
+
/**
* This initializes the list and the name of the method to be called
* @param string the name of the function call
@@ -37,11 +36,11 @@ class TCallChain extends TList implements IDynamicMethods
$this->_method=$method;
parent::__construct();
}
-
-
+
+
/**
* This initializes the list and the name of the method to be called
- * @param string|array this is a callable function as a string or array with
+ * @param string|array this is a callable function as a string or array with
* the object and method name as string
* @param array The array of arguments to the function call chain
*/
@@ -49,12 +48,12 @@ class TCallChain extends TList implements IDynamicMethods
{
$this->add(array($method,$args));
}
-
+
/**
* This method calls the next Callable in the list. All of the method arguments
- * coming into this method are substituted into the original method argument of
+ * coming into this method are substituted into the original method argument of
* call in the chain.
- *
+ *
* If the original method call has these parameters
* <code>
* $originalobject->dyExampleMethod('param1', 'param2', 'param3')
@@ -71,7 +70,7 @@ class TCallChain extends TList implements IDynamicMethods
* list in 'dy' event calls is always the object containing the behavior. This modifies
* the parameter replacement mechanism slightly to leave the object containing the behavior
* alone and only replacing the other parameters in the argument list. As per {@link __call},
- * any calls to a 'dy' event do not need the object containing the behavior as the addition of
+ * any calls to a 'dy' event do not need the object containing the behavior as the addition of
* the object to the argument list as the first element is automatic for IClassBehaviors.
*
* The last parameter of the method parameter list for any callable in the call chain
@@ -87,14 +86,14 @@ class TCallChain extends TList implements IDynamicMethods
*
* When there are no handlers or no handlers left, it returns the first parameter of the
* argument list.
- *
+ *
*/
public function call()
{
$args=func_get_args();
if($this->getCount()===0)
return isset($args[0])?$args[0]:null;
-
+
if(!$this->_iterator)
{
$chain_array=array_reverse($this->toArray());
@@ -115,12 +114,12 @@ class TCallChain extends TList implements IDynamicMethods
$result = $args[0];
return $result;
}
-
-
+
+
/**
* This catches all the unpatched dynamic events. When the method call matches the
- * call chain method, it passes the arguments to the original __call (of the dynamic
- * event being unspecified in TCallChain) and funnels into the method {@link call},
+ * call chain method, it passes the arguments to the original __call (of the dynamic
+ * event being unspecified in TCallChain) and funnels into the method {@link call},
* so the next dynamic event handler can be called.
* If the original method call has these parameters
* <code>
diff --git a/framework/Util/TClassBehavior.php b/framework/Util/TClassBehavior.php
index 9d29dbf4..03ea0c57 100644
--- a/framework/Util/TClassBehavior.php
+++ b/framework/Util/TClassBehavior.php
@@ -11,7 +11,6 @@
/**
* TClassBehavior is a convenient base class for whole class behaviors.
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: TClassBehavior.php 564 2009-01-21 22:07:10Z javalizard $
* @package System.Util
* @since 3.2.3
*/
@@ -25,7 +24,7 @@ class TClassBehavior extends TComponent implements IClassBehavior
public function attach($component)
{
}
-
+
/**
* Detaches the behavior object from the component.
* @param TComponent the component that this behavior is to be detached from.
diff --git a/framework/Util/TDataFieldAccessor.php b/framework/Util/TDataFieldAccessor.php
index ae9df57b..1bead02e 100644
--- a/framework/Util/TDataFieldAccessor.php
+++ b/framework/Util/TDataFieldAccessor.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataFieldAccessor.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
*/
@@ -26,7 +25,6 @@
* then field 'MyValue.MySubValue' will return that method call result.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataFieldAccessor.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
@@ -36,7 +34,7 @@ class TDataFieldAccessor
* Evaluates the data value at the specified field.
* - If the data is an array, then the field is treated as an array index
* and the corresponding element value is returned; the field name can also include
- * dots to access subarrays. For example a field named 'MyField.MySubField' will
+ * dots to access subarrays. For example a field named 'MyField.MySubField' will
* first try to access $data['MyField.MySubField'], then try $data['MyField']['MySubField'].
* - If the data is a TMap or TList object, then the field is treated as a key
* into the map or list, and the corresponding value is returned.
diff --git a/framework/Util/TDateTimeStamp.php b/framework/Util/TDateTimeStamp.php
index 7a995b00..fcbd573f 100644
--- a/framework/Util/TDateTimeStamp.php
+++ b/framework/Util/TDateTimeStamp.php
@@ -4,9 +4,8 @@
* @author Fabio Bas ctrlaltca[AT]gmail[DOT]com
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDateTimeStamp.php 3246 2013-01-07 21:07:38Z ctrlaltca $
* @package System.Util
*/
@@ -20,7 +19,6 @@
* julian dates anymore.
*
* @author Fabio Bas ctrlaltca[AT]gmail[DOT]com
- * @version $Id: TDateTimeStamp.php 3246 2013-01-07 21:07:38Z ctrlaltca $
* @package System.Util
* @since 3.0.4
* @deprecated since 3.2.1
@@ -194,8 +192,8 @@ class TDateTimeStamp
$dt = new DateTime();
if($is_gmt)
$dt->setTimeZone(new DateTimeZone('UTC'));
- $dt->setDate($year!==false ? $year : date('Y'),
- $mon!==false ? $mon : date('m'),
+ $dt->setDate($year!==false ? $year : date('Y'),
+ $mon!==false ? $mon : date('m'),
$day!==false ? $day : date('d'));
$dt->setTime($hr, $min, $sec);
return (int) $dt->format('U');
diff --git a/framework/Util/TLogRouter.php b/framework/Util/TLogRouter.php
index 32273c0c..4682e9ef 100644
--- a/framework/Util/TLogRouter.php
+++ b/framework/Util/TLogRouter.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
*/
@@ -29,14 +28,13 @@ Prado::using('System.Data.TDbConnection');
* </code>
* PHP configuration style:
* <code>
- *
+ *
* </code>
* You can specify multiple routes with different filtering conditions and different
* targets, even if the routes are of the same type.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
- * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
@@ -128,8 +126,8 @@ class TLogRouter extends TModule
/**
* Adds a TLogRoute instance to the log router.
- *
- * @param TLogRoute $route
+ *
+ * @param TLogRoute $route
* @throws TInvalidDataTypeException if the route object is invalid
*/
public function addRoute($route)
@@ -190,7 +188,6 @@ class TLogRouter extends TModule
* satisfying both filter conditions will they be returned.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
@@ -322,7 +319,7 @@ abstract class TLogRoute extends TApplicationComponent
*/
protected function formatLogMessage($message,$level,$category,$time)
{
- return @gmdate('M d H:i:s',$time).' ['.$this->getLevelName($level).'] ['.$category.'] '.$message."\n";
+ return @date('M d H:i:s',$time).' ['.$this->getLevelName($level).'] ['.$category.'] '.$message."\n";
}
/**
@@ -363,7 +360,6 @@ abstract class TLogRoute extends TApplicationComponent
* specifies how many files to be kept.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
@@ -503,7 +499,6 @@ class TFileLogRoute extends TLogRoute
* {@link setSentFrom SentFrom} address.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
@@ -629,7 +624,6 @@ class TEmailLogRoute extends TLogRoute
* TBrowserLogRoute prints selected log messages in the response.
*
* @author Xiang Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
@@ -639,7 +633,7 @@ class TBrowserLogRoute extends TLogRoute
* @var string css class for indentifying the table structure in the dom tree
*/
private $_cssClass=null;
-
+
public function processLogs($logs)
{
if(empty($logs) || $this->getApplication()->getMode()==='Performance') return;
@@ -664,7 +658,7 @@ class TBrowserLogRoute extends TLogRoute
}
$response->write($this->renderFooter());
}
-
+
/**
* @param string the css class of the control
*/
@@ -816,7 +810,6 @@ EOD;
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.1.2
*/
@@ -1022,7 +1015,6 @@ class TDbLogRoute extends TLogRoute
* {@link http://www.getfirebug.com/ FireBug Website}
*
* @author Enrico Stahn <mail@enricostahn.com>, Christophe Boulain <Christophe.Boulain@gmail.com>
- * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.1.2
*/
@@ -1099,7 +1091,6 @@ EOD;
* {@link http://www.firephp.org/ FirePHP Website}
*
* @author Yves Berkholz <godzilla80[at]gmx[dot]net>
- * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.1.5
*/
diff --git a/framework/Util/TLogger.php b/framework/Util/TLogger.php
index 74fa22bf..6fd12ccf 100644
--- a/framework/Util/TLogger.php
+++ b/framework/Util/TLogger.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TLogger.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
*/
@@ -18,7 +17,6 @@
* log categories, and by control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TLogger.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
@@ -82,14 +80,14 @@ class TLogger extends TComponent
* Messages may be filtered by log levels and/or categories and/or control client ids and/or timestamp.
* A level filter is specified by an integer, whose bits indicate the levels interested.
* For example, (TLogger::INFO | TLogger::WARNING) specifies INFO and WARNING levels.
- * A category filter is specified by an array of categories to filter.
+ * A category filter is specified by an array of categories to filter.
* A message whose category name starts with any filtering category
* will be returned. For example, a category filter array('System.Web','System.IO')
* will return messages under categories such as 'System.Web', 'System.IO',
* 'System.Web.UI', 'System.Web.UI.WebControls', etc.
* A control client id filter is specified by an array of control client id
* A message whose control client id starts with any filtering naming panels
- * will be returned. For example, a category filter array('ctl0_body_header',
+ * will be returned. For example, a category filter array('ctl0_body_header',
* 'ctl0_body_content_sidebar')
* will return messages under categories such as 'ctl0_body_header', 'ctl0_body_content_sidebar',
* 'ctl0_body_header_title', 'ctl0_body_content_sidebar_savebutton', etc.
@@ -135,14 +133,14 @@ class TLogger extends TComponent
* Messages may be filtered by log levels and/or categories and/or control client ids and/or timestamp.
* A level filter is specified by an integer, whose bits indicate the levels interested.
* For example, (TLogger::INFO | TLogger::WARNING) specifies INFO and WARNING levels.
- * A category filter is specified by an array of categories to filter.
+ * A category filter is specified by an array of categories to filter.
* A message whose category name starts with any filtering category
* will be deleted. For example, a category filter array('System.Web','System.IO')
* will delete messages under categories such as 'System.Web', 'System.IO',
* 'System.Web.UI', 'System.Web.UI.WebControls', etc.
* A control client id filter is specified by an array of control client id
* A message whose control client id starts with any filtering naming panels
- * will be deleted. For example, a category filter array('ctl0_body_header',
+ * will be deleted. For example, a category filter array('ctl0_body_header',
* 'ctl0_body_content_sidebar')
* will delete messages under categories such as 'ctl0_body_header', 'ctl0_body_content_sidebar',
* 'ctl0_body_header_title', 'ctl0_body_content_sidebar_savebutton', etc.
diff --git a/framework/Util/TParameterModule.php b/framework/Util/TParameterModule.php
index 5b345b4e..84616c63 100644
--- a/framework/Util/TParameterModule.php
+++ b/framework/Util/TParameterModule.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TParameterModule.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
*/
@@ -41,7 +40,6 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
- * @version $Id: TParameterModule.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
diff --git a/framework/Util/TRpcClient.php b/framework/Util/TRpcClient.php
index fbfb528a..91b27b52 100644
--- a/framework/Util/TRpcClient.php
+++ b/framework/Util/TRpcClient.php
@@ -5,7 +5,6 @@
* @link http://www.pradosoft.com/
* @copyright 2010 Bigpoint GmbH
* @license http://www.pradosoft.com/license/
- * @version $Id: TRpcClient.php 137 2010-03-27 22:13:36Z rrogge $
* @since 3.2
* @package System.Util
*/
@@ -158,7 +157,7 @@ class TRpcClient extends TApplicationComponent
* @package System.Util
* @since 3.2
*/
-
+
class TRpcClientTypesEnumerable extends TEnumerable
{
const JSON = 'TJsonRpcClient';
@@ -176,7 +175,7 @@ class TRpcClientTypesEnumerable extends TEnumerable
* @package System.Util
* @since 3.2
*/
-
+
class TRpcClientRequestException extends TApplicationException
{
}
@@ -184,7 +183,7 @@ class TRpcClientRequestException extends TApplicationException
/**
* TRpcClientResponseException class
*
- * This Exception is fired when the
+ * This Exception is fired when the
*
* @author Robin J. Rogge <rrogge@bigpoint.net>
* @version $Id$
@@ -323,7 +322,7 @@ class TXmlRpcClient extends TRpcClient
// skip response handling if the request was just a notification request
if($this->isNotification)
return true;
-
+
// decode response
if(($_response = xmlrpc_decode($_response)) === null)
throw new TRpcClientResponseException('Empty response received');
diff --git a/framework/Util/TSimpleDateFormatter.php b/framework/Util/TSimpleDateFormatter.php
index 295a2d60..18e71529 100644
--- a/framework/Util/TSimpleDateFormatter.php
+++ b/framework/Util/TSimpleDateFormatter.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSimpleDateFormatter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
*/
@@ -40,7 +39,6 @@
* </code>
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TSimpleDateFormatter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
@@ -177,7 +175,7 @@ class TSimpleDateFormatter
if(is_numeric($value))
return $s->getDate($value);
else
- return $s->parseDate($value);
+ return $s->parseDate($value);
}
/**
@@ -302,7 +300,7 @@ class TSimpleDateFormatter
if(!$defaultToCurrentTime && ($month === null || $day === null || $year === null))
return null;
else
- {
+ {
if(empty($year)) {
$year = date('Y');
}
diff --git a/framework/Util/TVarDumper.php b/framework/Util/TVarDumper.php
index f49a1274..c89b205a 100644
--- a/framework/Util/TVarDumper.php
+++ b/framework/Util/TVarDumper.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TVarDumper.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
*/
@@ -24,7 +23,6 @@
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TVarDumper.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
diff --git a/framework/Web/Javascripts/TJavaScript.php b/framework/Web/Javascripts/TJavaScript.php
index c50a3742..3684132b 100644
--- a/framework/Web/Javascripts/TJavaScript.php
+++ b/framework/Web/Javascripts/TJavaScript.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TJavaScript.php 3291 2013-05-09 17:44:58Z ctrlaltca $
* @package System.Web.Javascripts
*/
@@ -17,7 +16,6 @@
* functions.
*
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
- * @version $Id: TJavaScript.php 3291 2013-05-09 17:44:58Z ctrlaltca $
* @package System.Web.Javascripts
* @since 3.0
*/
@@ -60,6 +58,19 @@ class TJavaScript
}
/**
+ * Renders a list of javascript code
+ * @param array javascript blocks
+ * @return string rendering result
+ */
+ public static function renderScriptBlocksCallback($scripts)
+ {
+ if(count($scripts))
+ return implode("\n",$scripts)."\n";
+ else
+ return '';
+ }
+
+ /**
* Renders javascript block
* @param string javascript block
* @return string rendering result
@@ -253,7 +264,7 @@ class TJavaScript
self::checkJsonError();
return $s;
}
-
+
private static function checkJsonError()
{
switch ($err = json_last_error())
@@ -286,7 +297,7 @@ class TJavaScript
/**
* Minimize the size of a javascript script.
* This method is based on Douglas Crockford's JSMin.
- * @param string code that you want to minimzie
+ * @param string code that you want to minimzie
* @return minimized version of the code
*/
public static function JSMin($code)
diff --git a/framework/Web/Javascripts/packages.php b/framework/Web/Javascripts/packages.php
index 1d98f60f..19cda98b 100644
--- a/framework/Web/Javascripts/packages.php
+++ b/framework/Web/Javascripts/packages.php
@@ -4,23 +4,15 @@
// To make future upgrades easier
if (!defined('PROTOTYPE_DIR')) define ('PROTOTYPE_DIR', 'prototype-1.7');
+if (!defined('JQUERY_DIR')) define ('JQUERY_DIR', 'jquery');
if (!defined('SCRIPTACULOUS_DIR')) define ('SCRIPTACULOUS_DIR', 'scriptaculous-1.9.0');
//package names and its contents (files relative to the current directory)
$packages = array(
- 'prototype' => array(
- PROTOTYPE_DIR.'/prototype.js',
- SCRIPTACULOUS_DIR.'/builder.js',
- ),
+ // base prado scripts
'prado' => array(
'prado/prado.js',
- 'prado/scriptaculous-adapter.js',
- 'prado/controls/controls.js',
- SCRIPTACULOUS_DIR.'/effects.js'
- ),
-
- 'effects' => array(
- SCRIPTACULOUS_DIR.'/effects.js'
+ 'prado/controls/controls.js'
),
'logger' => array(
@@ -40,21 +32,10 @@ $packages = array(
),
'ajax' => array(
- SCRIPTACULOUS_DIR.'/controls.js',
- 'prado/activecontrols/json2.js',
'prado/activecontrols/ajax3.js',
'prado/activecontrols/activecontrols3.js',
),
- 'dragdrop'=>array(
- SCRIPTACULOUS_DIR.'/dragdrop.js',
- 'prado/activecontrols/dragdrop.js'
- ),
-
- 'dragdropextra'=>array(
- 'prado/activecontrols/dragdropextra.js',
- ),
-
'slider'=>array(
'prado/controls/slider.js'
),
@@ -66,19 +47,15 @@ $packages = array(
'tabpanel'=>array(
'prado/controls/tabpanel.js'
),
-
+
'activedatepicker' => array(
'prado/activecontrols/activedatepicker.js'
),
-
+
'activefileupload' => array(
'prado/activefileupload/activefileupload.js'
),
- 'accordion'=>array(
- 'prado/controls/accordion.js'
- ),
-
'htmlarea'=>array(
'prado/controls/htmlarea.js'
),
@@ -87,39 +64,75 @@ $packages = array(
'prado/controls/htmlarea4.js'
),
- 'ratings' => array(
- 'prado/ratings/ratings.js',
+ 'accordion'=>array(
+ 'prado/controls/accordion.js'
),
'inlineeditor' => array(
'prado/activecontrols/inlineeditor.js'
),
+ 'ratings' => array(
+ 'prado/ratings/ratings.js',
+ ),
+
+ // jquery
+ 'jquery' => array(
+ JQUERY_DIR.'/jquery.js',
+ ),
+ 'jqueryui' => array(
+ JQUERY_DIR.'/jquery-ui.js',
+ JQUERY_DIR.'/jquery-ui-i18n.min.js',
+ ),
+
+ // prototype + scriptaculous
+ 'prototype' => array(
+ PROTOTYPE_DIR.'/prototype.js',
+ SCRIPTACULOUS_DIR.'/builder.js',
+ SCRIPTACULOUS_DIR.'/effects.js'
+ ),
+
+ 'dragdrop'=>array(
+ SCRIPTACULOUS_DIR.'/dragdrop.js',
+ 'prado/activecontrols/dragdrop.js'
+ ),
+
+ 'dragdropextra'=>array(
+ 'prado/activecontrols/dragdropextra.js',
+ ),
+
+ 'autocomplete' => array(
+ SCRIPTACULOUS_DIR.'/controls.js',
+ 'prado/activecontrols/autocomplete.js'
+ ),
);
//package names and their dependencies
$dependencies = array(
+ 'jquery' => array('jquery'),
+ 'prado' => array('jquery', 'prado'),
+ 'validator' => array('jquery', 'prado', 'validator'),
+ 'tabpanel' => array('jquery', 'prado', 'tabpanel'),
+ 'ajax' => array('jquery', 'prado', 'ajax'),
+ 'logger' => array('jquery', 'prado', 'logger'),
+ 'activefileupload' => array('jquery', 'prado', 'ajax', 'activefileupload'),
+ 'effects' => array('jquery', 'jqueryui'),
+ 'datepicker' => array('jquery', 'prado', 'datepicker'),
+ 'activedatepicker' => array('jquery', 'prado', 'datepicker', 'ajax', 'activedatepicker'),
+ 'colorpicker' => array('jquery', 'prado', 'colorpicker'),
+ 'htmlarea' => array('jquery', 'prado', 'htmlarea'),
+ 'htmlarea4' => array('jquery', 'prado', 'htmlarea4'),
+ 'keyboard' => array('jquery', 'prado', 'keyboard'),
+ 'slider' => array('jquery', 'prado', 'slider'),
+ 'inlineeditor' => array('jquery', 'prado', 'ajax', 'inlineeditor'),
+ 'accordion' => array('jquery', 'prado', 'accordion'),
+ 'ratings' => array('jquery', 'prado', 'ajax', 'ratings'),
+ 'jqueryui' => array('jquery', 'jqueryui'),
'prototype' => array('prototype'),
- 'prado' => array('prototype', 'prado'),
- 'effects' => array('prototype', 'prado', 'effects'),
- 'validator' => array('prototype', 'prado', 'validator'),
- 'logger' => array('prototype', 'prado', 'logger'),
- 'datepicker' => array('prototype', 'prado', 'datepicker'),
- 'colorpicker' => array('prototype', 'prado', 'colorpicker'),
- 'ajax' => array('prototype', 'prado', 'effects', 'ajax'),
- 'dragdrop' => array('prototype', 'prado', 'effects', 'ajax', 'dragdrop'),
- 'slider' => array('prototype', 'prado', 'slider'),
- 'keyboard' => array('prototype', 'prado', 'keyboard'),
- 'tabpanel' => array('prototype', 'prado', 'tabpanel'),
- 'activedatepicker' => array('prototype', 'prado', 'datepicker', 'ajax', 'activedatepicker'),
- 'activefileupload' => array('prototype', 'prado', 'effects', 'ajax', 'activefileupload'),
- 'dragdropextra' => array('prototype', 'prado', 'effects', 'ajax', 'dragdrop','dragdropextra'),
- 'accordion' => array('prototype', 'prado', 'effects', 'accordion'),
- 'htmlarea' => array('prototype', 'prado', 'htmlarea'),
- 'htmlarea4' => array('prototype', 'prado', 'htmlarea4'),
- 'ratings' => array('prototype', 'prado', 'effects', 'ajax', 'ratings'),
- 'inlineeditor' => array('prototype', 'prado', 'effects', 'ajax', 'inlineeditor'),
+ 'dragdrop' => array('prototype', 'jquery', 'prado', 'ajax', 'dragdrop'),
+ 'dragdropextra' => array('prototype', 'jquery', 'prado', 'ajax', 'dragdrop','dragdropextra'),
+ 'autocomplete' => array('prototype', 'jquery', 'prado', 'ajax', 'autocomplete'),
);
return array($packages, $dependencies);
diff --git a/framework/Web/Javascripts/source/jquery/css/base/images/animated-overlay.gif b/framework/Web/Javascripts/source/jquery/css/base/images/animated-overlay.gif
new file mode 100644
index 00000000..d441f75e
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/images/animated-overlay.gif
Binary files differ
diff --git a/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_flat_0_aaaaaa_40x100.png b/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_flat_0_aaaaaa_40x100.png
new file mode 100644
index 00000000..5b5dab2a
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_flat_0_aaaaaa_40x100.png
Binary files differ
diff --git a/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_flat_75_ffffff_40x100.png b/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_flat_75_ffffff_40x100.png
new file mode 100644
index 00000000..ac8b229a
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_flat_75_ffffff_40x100.png
Binary files differ
diff --git a/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_55_fbf9ee_1x400.png b/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_55_fbf9ee_1x400.png
new file mode 100644
index 00000000..ad3d6346
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_55_fbf9ee_1x400.png
Binary files differ
diff --git a/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_65_ffffff_1x400.png b/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_65_ffffff_1x400.png
new file mode 100644
index 00000000..42ccba26
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_65_ffffff_1x400.png
Binary files differ
diff --git a/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_75_dadada_1x400.png b/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_75_dadada_1x400.png
new file mode 100644
index 00000000..5a46b47c
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_75_dadada_1x400.png
Binary files differ
diff --git a/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_75_e6e6e6_1x400.png b/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_75_e6e6e6_1x400.png
new file mode 100644
index 00000000..86c2baa6
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_75_e6e6e6_1x400.png
Binary files differ
diff --git a/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_95_fef1ec_1x400.png b/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_95_fef1ec_1x400.png
new file mode 100644
index 00000000..4443fdc1
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_glass_95_fef1ec_1x400.png
Binary files differ
diff --git a/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png
new file mode 100644
index 00000000..7c9fa6c6
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png
Binary files differ
diff --git a/framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_222222_256x240.png b/framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_222222_256x240.png
new file mode 100644
index 00000000..ee039dc0
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_222222_256x240.png
Binary files differ
diff --git a/framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_2e83ff_256x240.png b/framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_2e83ff_256x240.png
new file mode 100644
index 00000000..45e8928e
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_2e83ff_256x240.png
Binary files differ
diff --git a/framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_454545_256x240.png b/framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_454545_256x240.png
new file mode 100644
index 00000000..7ec70d11
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_454545_256x240.png
Binary files differ
diff --git a/framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_888888_256x240.png b/framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_888888_256x240.png
new file mode 100644
index 00000000..5ba708c3
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_888888_256x240.png
Binary files differ
diff --git a/framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_cd0a0a_256x240.png b/framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_cd0a0a_256x240.png
new file mode 100644
index 00000000..7930a558
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/images/ui-icons_cd0a0a_256x240.png
Binary files differ
diff --git a/framework/Web/Javascripts/source/jquery/css/base/jquery-ui.css b/framework/Web/Javascripts/source/jquery/css/base/jquery-ui.css
new file mode 100644
index 00000000..da013d66
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/jquery-ui.css
@@ -0,0 +1,7 @@
+/*! jQuery UI - v1.10.4 - 2014-02-02
+* http://jqueryui.com
+* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;min-height:0}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{overflow:hidden;position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:none}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:normal;margin:-1px}.ui-menu .ui-state-disabled{font-weight:normal;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("images/animated-overlay.gif");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:none;border-bottom:none;border-right:none}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}
+.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px} \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.accordion.css b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.accordion.css
new file mode 100644
index 00000000..bb6198b5
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.accordion.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.10.4 - 2014-01-29
+* http://jqueryui.com
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;min-height:0}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto} \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.autocomplete.css b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.autocomplete.css
new file mode 100644
index 00000000..92b453d0
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.autocomplete.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.10.4 - 2014-01-29
+* http://jqueryui.com
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-autocomplete{position:absolute;top:0;left:0;cursor:default} \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.button.css b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.button.css
new file mode 100644
index 00000000..ceb823d2
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.button.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.10.4 - 2014-01-29
+* http://jqueryui.com
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0} \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.core.css b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.core.css
new file mode 100644
index 00000000..62435c78
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.core.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.10.4 - 2014-01-29
+* http://jqueryui.com
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%} \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.datepicker.css b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.datepicker.css
new file mode 100644
index 00000000..60fc1015
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.datepicker.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.10.4 - 2014-01-29
+* http://jqueryui.com
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px} \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.dialog.css b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.dialog.css
new file mode 100644
index 00000000..86a52b3b
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.dialog.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.10.4 - 2014-01-29
+* http://jqueryui.com
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-dialog{overflow:hidden;position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move} \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.menu.css b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.menu.css
new file mode 100644
index 00000000..143ae613
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.menu.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.10.4 - 2014-01-29
+* http://jqueryui.com
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:none}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:normal;margin:-1px}.ui-menu .ui-state-disabled{font-weight:normal;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right} \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.progressbar.css b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.progressbar.css
new file mode 100644
index 00000000..36f5c83b
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.progressbar.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.10.4 - 2014-01-29
+* http://jqueryui.com
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("images/animated-overlay.gif");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none} \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.resizable.css b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.resizable.css
new file mode 100644
index 00000000..79bfa6e9
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.resizable.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.10.4 - 2014-01-29
+* http://jqueryui.com
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px} \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.selectable.css b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.selectable.css
new file mode 100644
index 00000000..080d9a6e
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.selectable.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.10.4 - 2014-01-29
+* http://jqueryui.com
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black} \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.slider.css b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.slider.css
new file mode 100644
index 00000000..2952fb0a
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.slider.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.10.4 - 2014-01-29
+* http://jqueryui.com
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0} \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.spinner.css b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.spinner.css
new file mode 100644
index 00000000..4a87beb7
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.spinner.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.10.4 - 2014-01-29
+* http://jqueryui.com
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:none;border-bottom:none;border-right:none}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px} \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.tabs.css b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.tabs.css
new file mode 100644
index 00000000..aa252184
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.tabs.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.10.4 - 2014-01-29
+* http://jqueryui.com
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none} \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.theme.css b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.theme.css
new file mode 100644
index 00000000..d0fd110c
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.theme.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.10.4 - 2014-01-29
+* http://jqueryui.com
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;min-height:0}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{overflow:hidden;position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:none}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:normal;margin:-1px}.ui-menu .ui-state-disabled{font-weight:normal;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("images/animated-overlay.gif");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:none;border-bottom:none;border-right:none}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px} \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.tooltip.css b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.tooltip.css
new file mode 100644
index 00000000..9a36db8a
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/css/base/jquery.ui.tooltip.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.10.4 - 2014-01-29
+* http://jqueryui.com
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px} \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/jquery/jquery-ui-i18n.min.js b/framework/Web/Javascripts/source/jquery/jquery-ui-i18n.min.js
new file mode 100644
index 00000000..853a18b1
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/jquery-ui-i18n.min.js
@@ -0,0 +1,6 @@
+/*! jQuery UI - v1.10.4 - 2014-01-17
+* http://jqueryui.com
+* Includes: jquery.ui.datepicker-af.js, jquery.ui.datepicker-ar-DZ.js, jquery.ui.datepicker-ar.js, jquery.ui.datepicker-az.js, jquery.ui.datepicker-be.js, jquery.ui.datepicker-bg.js, jquery.ui.datepicker-bs.js, jquery.ui.datepicker-ca.js, jquery.ui.datepicker-cs.js, jquery.ui.datepicker-cy-GB.js, jquery.ui.datepicker-da.js, jquery.ui.datepicker-de.js, jquery.ui.datepicker-el.js, jquery.ui.datepicker-en-AU.js, jquery.ui.datepicker-en-GB.js, jquery.ui.datepicker-en-NZ.js, jquery.ui.datepicker-eo.js, jquery.ui.datepicker-es.js, jquery.ui.datepicker-et.js, jquery.ui.datepicker-eu.js, jquery.ui.datepicker-fa.js, jquery.ui.datepicker-fi.js, jquery.ui.datepicker-fo.js, jquery.ui.datepicker-fr-CA.js, jquery.ui.datepicker-fr-CH.js, jquery.ui.datepicker-fr.js, jquery.ui.datepicker-gl.js, jquery.ui.datepicker-he.js, jquery.ui.datepicker-hi.js, jquery.ui.datepicker-hr.js, jquery.ui.datepicker-hu.js, jquery.ui.datepicker-hy.js, jquery.ui.datepicker-id.js, jquery.ui.datepicker-is.js, jquery.ui.datepicker-it.js, jquery.ui.datepicker-ja.js, jquery.ui.datepicker-ka.js, jquery.ui.datepicker-kk.js, jquery.ui.datepicker-km.js, jquery.ui.datepicker-ko.js, jquery.ui.datepicker-ky.js, jquery.ui.datepicker-lb.js, jquery.ui.datepicker-lt.js, jquery.ui.datepicker-lv.js, jquery.ui.datepicker-mk.js, jquery.ui.datepicker-ml.js, jquery.ui.datepicker-ms.js, jquery.ui.datepicker-nb.js, jquery.ui.datepicker-nl-BE.js, jquery.ui.datepicker-nl.js, jquery.ui.datepicker-nn.js, jquery.ui.datepicker-no.js, jquery.ui.datepicker-pl.js, jquery.ui.datepicker-pt-BR.js, jquery.ui.datepicker-pt.js, jquery.ui.datepicker-rm.js, jquery.ui.datepicker-ro.js, jquery.ui.datepicker-ru.js, jquery.ui.datepicker-sk.js, jquery.ui.datepicker-sl.js, jquery.ui.datepicker-sq.js, jquery.ui.datepicker-sr-SR.js, jquery.ui.datepicker-sr.js, jquery.ui.datepicker-sv.js, jquery.ui.datepicker-ta.js, jquery.ui.datepicker-th.js, jquery.ui.datepicker-tj.js, jquery.ui.datepicker-tr.js, jquery.ui.datepicker-uk.js, jquery.ui.datepicker-vi.js, jquery.ui.datepicker-zh-CN.js, jquery.ui.datepicker-zh-HK.js, jquery.ui.datepicker-zh-TW.js
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+jQuery(function(e){e.datepicker.regional.af={closeText:"Selekteer",prevText:"Vorige",nextText:"Volgende",currentText:"Vandag",monthNames:["Januarie","Februarie","Maart","April","Mei","Junie","Julie","Augustus","September","Oktober","November","Desember"],monthNamesShort:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Des"],dayNames:["Sondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrydag","Saterdag"],dayNamesShort:["Son","Maa","Din","Woe","Don","Vry","Sat"],dayNamesMin:["So","Ma","Di","Wo","Do","Vr","Sa"],weekHeader:"Wk",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.af)}),jQuery(function(e){e.datepicker.regional["ar-DZ"]={closeText:"إغلاق",prevText:"&#x3C;السابق",nextText:"التالي&#x3E;",currentText:"اليوم",monthNames:["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],monthNamesShort:["1","2","3","4","5","6","7","8","9","10","11","12"],dayNames:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],dayNamesShort:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],dayNamesMin:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],weekHeader:"أسبوع",dateFormat:"dd/mm/yy",firstDay:6,isRTL:!0,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional["ar-DZ"])}),jQuery(function(e){e.datepicker.regional.ar={closeText:"إغلاق",prevText:"&#x3C;السابق",nextText:"التالي&#x3E;",currentText:"اليوم",monthNames:["كانون الثاني","شباط","آذار","نيسان","مايو","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"],monthNamesShort:["1","2","3","4","5","6","7","8","9","10","11","12"],dayNames:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],dayNamesShort:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],dayNamesMin:["ح","ن","ث","ر","خ","ج","س"],weekHeader:"أسبوع",dateFormat:"dd/mm/yy",firstDay:6,isRTL:!0,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.ar)}),jQuery(function(e){e.datepicker.regional.az={closeText:"Bağla",prevText:"&#x3C;Geri",nextText:"İrəli&#x3E;",currentText:"Bugün",monthNames:["Yanvar","Fevral","Mart","Aprel","May","İyun","İyul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr"],monthNamesShort:["Yan","Fev","Mar","Apr","May","İyun","İyul","Avq","Sen","Okt","Noy","Dek"],dayNames:["Bazar","Bazar ertəsi","Çərşənbə axşamı","Çərşənbə","Cümə axşamı","Cümə","Şənbə"],dayNamesShort:["B","Be","Ça","Ç","Ca","C","Ş"],dayNamesMin:["B","B","Ç","С","Ç","C","Ş"],weekHeader:"Hf",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.az)}),jQuery(function(e){e.datepicker.regional.be={closeText:"Зачыніць",prevText:"&larr;Папяр.",nextText:"Наст.&rarr;",currentText:"Сёньня",monthNames:["Студзень","Люты","Сакавік","Красавік","Травень","Чэрвень","Ліпень","Жнівень","Верасень","Кастрычнік","Лістапад","Сьнежань"],monthNamesShort:["Сту","Лют","Сак","Кра","Тра","Чэр","Ліп","Жні","Вер","Кас","Ліс","Сьн"],dayNames:["нядзеля","панядзелак","аўторак","серада","чацьвер","пятніца","субота"],dayNamesShort:["ндз","пнд","аўт","срд","чцв","птн","сбт"],dayNamesMin:["Нд","Пн","Аў","Ср","Чц","Пт","Сб"],weekHeader:"Тд",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.be)}),jQuery(function(e){e.datepicker.regional.bg={closeText:"затвори",prevText:"&#x3C;назад",nextText:"напред&#x3E;",nextBigText:"&#x3E;&#x3E;",currentText:"днес",monthNames:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],monthNamesShort:["Яну","Фев","Мар","Апр","Май","Юни","Юли","Авг","Сеп","Окт","Нов","Дек"],dayNames:["Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота"],dayNamesShort:["Нед","Пон","Вто","Сря","Чет","Пет","Съб"],dayNamesMin:["Не","По","Вт","Ср","Че","Пе","Съ"],weekHeader:"Wk",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.bg)}),jQuery(function(e){e.datepicker.regional.bs={closeText:"Zatvori",prevText:"&#x3C;",nextText:"&#x3E;",currentText:"Danas",monthNames:["Januar","Februar","Mart","April","Maj","Juni","Juli","August","Septembar","Oktobar","Novembar","Decembar"],monthNamesShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],dayNames:["Nedelja","Ponedeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"],dayNamesShort:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],dayNamesMin:["Ne","Po","Ut","Sr","Če","Pe","Su"],weekHeader:"Wk",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.bs)}),jQuery(function(e){e.datepicker.regional.ca={closeText:"Tanca",prevText:"Anterior",nextText:"Següent",currentText:"Avui",monthNames:["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre"],monthNamesShort:["gen","feb","març","abr","maig","juny","jul","ag","set","oct","nov","des"],dayNames:["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],dayNamesShort:["dg","dl","dt","dc","dj","dv","ds"],dayNamesMin:["dg","dl","dt","dc","dj","dv","ds"],weekHeader:"Set",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.ca)}),jQuery(function(e){e.datepicker.regional.cs={closeText:"Zavřít",prevText:"&#x3C;Dříve",nextText:"Později&#x3E;",currentText:"Nyní",monthNames:["leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec"],monthNamesShort:["led","úno","bře","dub","kvě","čer","čvc","srp","zář","říj","lis","pro"],dayNames:["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],dayNamesShort:["ne","po","út","st","čt","pá","so"],dayNamesMin:["ne","po","út","st","čt","pá","so"],weekHeader:"Týd",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.cs)}),jQuery(function(e){e.datepicker.regional["cy-GB"]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["Ionawr","Chwefror","Mawrth","Ebrill","Mai","Mehefin","Gorffennaf","Awst","Medi","Hydref","Tachwedd","Rhagfyr"],monthNamesShort:["Ion","Chw","Maw","Ebr","Mai","Meh","Gor","Aws","Med","Hyd","Tac","Rha"],dayNames:["Dydd Sul","Dydd Llun","Dydd Mawrth","Dydd Mercher","Dydd Iau","Dydd Gwener","Dydd Sadwrn"],dayNamesShort:["Sul","Llu","Maw","Mer","Iau","Gwe","Sad"],dayNamesMin:["Su","Ll","Ma","Me","Ia","Gw","Sa"],weekHeader:"Wy",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional["cy-GB"])}),jQuery(function(e){e.datepicker.regional.da={closeText:"Luk",prevText:"&#x3C;Forrige",nextText:"Næste&#x3E;",currentText:"Idag",monthNames:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],dayNames:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],dayNamesShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],dayNamesMin:["Sø","Ma","Ti","On","To","Fr","Lø"],weekHeader:"Uge",dateFormat:"dd-mm-yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.da)}),jQuery(function(e){e.datepicker.regional.de={closeText:"Schließen",prevText:"&#x3C;Zurück",nextText:"Vor&#x3E;",currentText:"Heute",monthNames:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthNamesShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],dayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayNamesShort:["So","Mo","Di","Mi","Do","Fr","Sa"],dayNamesMin:["So","Mo","Di","Mi","Do","Fr","Sa"],weekHeader:"KW",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.de)}),jQuery(function(e){e.datepicker.regional.el={closeText:"Κλείσιμο",prevText:"Προηγούμενος",nextText:"Επόμενος",currentText:"Τρέχων Μήνας",monthNames:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],monthNamesShort:["Ιαν","Φεβ","Μαρ","Απρ","Μαι","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],dayNames:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],dayNamesShort:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"],dayNamesMin:["Κυ","Δε","Τρ","Τε","Πε","Πα","Σα"],weekHeader:"Εβδ",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.el)}),jQuery(function(e){e.datepicker.regional["en-AU"]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional["en-AU"])}),jQuery(function(e){e.datepicker.regional["en-GB"]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional["en-GB"])}),jQuery(function(e){e.datepicker.regional["en-NZ"]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional["en-NZ"])}),jQuery(function(e){e.datepicker.regional.eo={closeText:"Fermi",prevText:"&#x3C;Anta",nextText:"Sekv&#x3E;",currentText:"Nuna",monthNames:["Januaro","Februaro","Marto","Aprilo","Majo","Junio","Julio","Aŭgusto","Septembro","Oktobro","Novembro","Decembro"],monthNamesShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aŭg","Sep","Okt","Nov","Dec"],dayNames:["Dimanĉo","Lundo","Mardo","Merkredo","Ĵaŭdo","Vendredo","Sabato"],dayNamesShort:["Dim","Lun","Mar","Mer","Ĵaŭ","Ven","Sab"],dayNamesMin:["Di","Lu","Ma","Me","Ĵa","Ve","Sa"],weekHeader:"Sb",dateFormat:"dd/mm/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.eo)}),jQuery(function(e){e.datepicker.regional.es={closeText:"Cerrar",prevText:"&#x3C;Ant",nextText:"Sig&#x3E;",currentText:"Hoy",monthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],monthNamesShort:["ene","feb","mar","abr","may","jun","jul","ogo","sep","oct","nov","dic"],dayNames:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],dayNamesShort:["dom","lun","mar","mié","juv","vie","sáb"],dayNamesMin:["D","L","M","X","J","V","S"],weekHeader:"Sm",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.es)}),jQuery(function(e){e.datepicker.regional.et={closeText:"Sulge",prevText:"Eelnev",nextText:"Järgnev",currentText:"Täna",monthNames:["Jaanuar","Veebruar","Märts","Aprill","Mai","Juuni","Juuli","August","September","Oktoober","November","Detsember"],monthNamesShort:["Jaan","Veebr","Märts","Apr","Mai","Juuni","Juuli","Aug","Sept","Okt","Nov","Dets"],dayNames:["Pühapäev","Esmaspäev","Teisipäev","Kolmapäev","Neljapäev","Reede","Laupäev"],dayNamesShort:["Pühap","Esmasp","Teisip","Kolmap","Neljap","Reede","Laup"],dayNamesMin:["P","E","T","K","N","R","L"],weekHeader:"näd",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.et)}),jQuery(function(e){e.datepicker.regional.eu={closeText:"Egina",prevText:"&#x3C;Aur",nextText:"Hur&#x3E;",currentText:"Gaur",monthNames:["urtarrila","otsaila","martxoa","apirila","maiatza","ekaina","uztaila","abuztua","iraila","urria","azaroa","abendua"],monthNamesShort:["urt.","ots.","mar.","api.","mai.","eka.","uzt.","abu.","ira.","urr.","aza.","abe."],dayNames:["igandea","astelehena","asteartea","asteazkena","osteguna","ostirala","larunbata"],dayNamesShort:["ig.","al.","ar.","az.","og.","ol.","lr."],dayNamesMin:["ig","al","ar","az","og","ol","lr"],weekHeader:"As",dateFormat:"yy-mm-dd",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.eu)}),jQuery(function(e){e.datepicker.regional.fa={closeText:"بستن",prevText:"&#x3C;قبلی",nextText:"بعدی&#x3E;",currentText:"امروز",monthNames:["فروردين","ارديبهشت","خرداد","تير","مرداد","شهريور","مهر","آبان","آذر","دی","بهمن","اسفند"],monthNamesShort:["1","2","3","4","5","6","7","8","9","10","11","12"],dayNames:["يکشنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],dayNamesShort:["ی","د","س","چ","پ","ج","ش"],dayNamesMin:["ی","د","س","چ","پ","ج","ش"],weekHeader:"هف",dateFormat:"yy/mm/dd",firstDay:6,isRTL:!0,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.fa)}),jQuery(function(e){e.datepicker.regional.fi={closeText:"Sulje",prevText:"&#xAB;Edellinen",nextText:"Seuraava&#xBB;",currentText:"Tänään",monthNames:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],monthNamesShort:["Tammi","Helmi","Maalis","Huhti","Touko","Kesä","Heinä","Elo","Syys","Loka","Marras","Joulu"],dayNamesShort:["Su","Ma","Ti","Ke","To","Pe","La"],dayNames:["Sunnuntai","Maanantai","Tiistai","Keskiviikko","Torstai","Perjantai","Lauantai"],dayNamesMin:["Su","Ma","Ti","Ke","To","Pe","La"],weekHeader:"Vk",dateFormat:"d.m.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.fi)}),jQuery(function(e){e.datepicker.regional.fo={closeText:"Lat aftur",prevText:"&#x3C;Fyrra",nextText:"Næsta&#x3E;",currentText:"Í dag",monthNames:["Januar","Februar","Mars","Apríl","Mei","Juni","Juli","August","September","Oktober","November","Desember"],monthNamesShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Des"],dayNames:["Sunnudagur","Mánadagur","Týsdagur","Mikudagur","Hósdagur","Fríggjadagur","Leyardagur"],dayNamesShort:["Sun","Mán","Týs","Mik","Hós","Frí","Ley"],dayNamesMin:["Su","Má","Tý","Mi","Hó","Fr","Le"],weekHeader:"Vk",dateFormat:"dd-mm-yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.fo)}),jQuery(function(e){e.datepicker.regional["fr-CA"]={closeText:"Fermer",prevText:"Précédent",nextText:"Suivant",currentText:"Aujourd'hui",monthNames:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],monthNamesShort:["janv.","févr.","mars","avril","mai","juin","juil.","août","sept.","oct.","nov.","déc."],dayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],dayNamesShort:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],dayNamesMin:["D","L","M","M","J","V","S"],weekHeader:"Sem.",dateFormat:"yy-mm-dd",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional["fr-CA"])}),jQuery(function(e){e.datepicker.regional["fr-CH"]={closeText:"Fermer",prevText:"&#x3C;Préc",nextText:"Suiv&#x3E;",currentText:"Courant",monthNames:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],monthNamesShort:["janv.","févr.","mars","avril","mai","juin","juil.","août","sept.","oct.","nov.","déc."],dayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],dayNamesShort:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],dayNamesMin:["D","L","M","M","J","V","S"],weekHeader:"Sm",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional["fr-CH"])}),jQuery(function(e){e.datepicker.regional.fr={closeText:"Fermer",prevText:"Précédent",nextText:"Suivant",currentText:"Aujourd'hui",monthNames:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],monthNamesShort:["janv.","févr.","mars","avril","mai","juin","juil.","août","sept.","oct.","nov.","déc."],dayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],dayNamesShort:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],dayNamesMin:["D","L","M","M","J","V","S"],weekHeader:"Sem.",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.fr)}),jQuery(function(e){e.datepicker.regional.gl={closeText:"Pechar",prevText:"&#x3C;Ant",nextText:"Seg&#x3E;",currentText:"Hoxe",monthNames:["Xaneiro","Febreiro","Marzo","Abril","Maio","Xuño","Xullo","Agosto","Setembro","Outubro","Novembro","Decembro"],monthNamesShort:["Xan","Feb","Mar","Abr","Mai","Xuñ","Xul","Ago","Set","Out","Nov","Dec"],dayNames:["Domingo","Luns","Martes","Mércores","Xoves","Venres","Sábado"],dayNamesShort:["Dom","Lun","Mar","Mér","Xov","Ven","Sáb"],dayNamesMin:["Do","Lu","Ma","Mé","Xo","Ve","Sá"],weekHeader:"Sm",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.gl)}),jQuery(function(e){e.datepicker.regional.he={closeText:"סגור",prevText:"&#x3C;הקודם",nextText:"הבא&#x3E;",currentText:"היום",monthNames:["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר"],monthNamesShort:["ינו","פבר","מרץ","אפר","מאי","יוני","יולי","אוג","ספט","אוק","נוב","דצמ"],dayNames:["ראשון","שני","שלישי","רביעי","חמישי","שישי","שבת"],dayNamesShort:["א'","ב'","ג'","ד'","ה'","ו'","שבת"],dayNamesMin:["א'","ב'","ג'","ד'","ה'","ו'","שבת"],weekHeader:"Wk",dateFormat:"dd/mm/yy",firstDay:0,isRTL:!0,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.he)}),jQuery(function(e){e.datepicker.regional.hi={closeText:"बंद",prevText:"पिछला",nextText:"अगला",currentText:"आज",monthNames:["जनवरी ","फरवरी","मार्च","अप्रेल","मई","जून","जूलाई","अगस्त ","सितम्बर","अक्टूबर","नवम्बर","दिसम्बर"],monthNamesShort:["जन","फर","मार्च","अप्रेल","मई","जून","जूलाई","अग","सित","अक्ट","नव","दि"],dayNames:["रविवार","सोमवार","मंगलवार","बुधवार","गुरुवार","शुक्रवार","शनिवार"],dayNamesShort:["रवि","सोम","मंगल","बुध","गुरु","शुक्र","शनि"],dayNamesMin:["रवि","सोम","मंगल","बुध","गुरु","शुक्र","शनि"],weekHeader:"हफ्ता",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.hi)}),jQuery(function(e){e.datepicker.regional.hr={closeText:"Zatvori",prevText:"&#x3C;",nextText:"&#x3E;",currentText:"Danas",monthNames:["Siječanj","Veljača","Ožujak","Travanj","Svibanj","Lipanj","Srpanj","Kolovoz","Rujan","Listopad","Studeni","Prosinac"],monthNamesShort:["Sij","Velj","Ožu","Tra","Svi","Lip","Srp","Kol","Ruj","Lis","Stu","Pro"],dayNames:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"],dayNamesShort:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],dayNamesMin:["Ne","Po","Ut","Sr","Če","Pe","Su"],weekHeader:"Tje",dateFormat:"dd.mm.yy.",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.hr)}),jQuery(function(e){e.datepicker.regional.hu={closeText:"bezár",prevText:"vissza",nextText:"előre",currentText:"ma",monthNames:["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December"],monthNamesShort:["Jan","Feb","Már","Ápr","Máj","Jún","Júl","Aug","Szep","Okt","Nov","Dec"],dayNames:["Vasárnap","Hétfő","Kedd","Szerda","Csütörtök","Péntek","Szombat"],dayNamesShort:["Vas","Hét","Ked","Sze","Csü","Pén","Szo"],dayNamesMin:["V","H","K","Sze","Cs","P","Szo"],weekHeader:"Hét",dateFormat:"yy.mm.dd.",firstDay:1,isRTL:!1,showMonthAfterYear:!0,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.hu)}),jQuery(function(e){e.datepicker.regional.hy={closeText:"Փակել",prevText:"&#x3C;Նախ.",nextText:"Հաջ.&#x3E;",currentText:"Այսօր",monthNames:["Հունվար","Փետրվար","Մարտ","Ապրիլ","Մայիս","Հունիս","Հուլիս","Օգոստոս","Սեպտեմբեր","Հոկտեմբեր","Նոյեմբեր","Դեկտեմբեր"],monthNamesShort:["Հունվ","Փետր","Մարտ","Ապր","Մայիս","Հունիս","Հուլ","Օգս","Սեպ","Հոկ","Նոյ","Դեկ"],dayNames:["կիրակի","եկուշաբթի","երեքշաբթի","չորեքշաբթի","հինգշաբթի","ուրբաթ","շաբաթ"],dayNamesShort:["կիր","երկ","երք","չրք","հնգ","ուրբ","շբթ"],dayNamesMin:["կիր","երկ","երք","չրք","հնգ","ուրբ","շբթ"],weekHeader:"ՇԲՏ",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.hy)}),jQuery(function(e){e.datepicker.regional.id={closeText:"Tutup",prevText:"&#x3C;mundur",nextText:"maju&#x3E;",currentText:"hari ini",monthNames:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","Nopember","Desember"],monthNamesShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agus","Sep","Okt","Nop","Des"],dayNames:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],dayNamesShort:["Min","Sen","Sel","Rab","kam","Jum","Sab"],dayNamesMin:["Mg","Sn","Sl","Rb","Km","jm","Sb"],weekHeader:"Mg",dateFormat:"dd/mm/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.id)}),jQuery(function(e){e.datepicker.regional.is={closeText:"Loka",prevText:"&#x3C; Fyrri",nextText:"Næsti &#x3E;",currentText:"Í dag",monthNames:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],monthNamesShort:["Jan","Feb","Mar","Apr","Maí","Jún","Júl","Ágú","Sep","Okt","Nóv","Des"],dayNames:["Sunnudagur","Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur"],dayNamesShort:["Sun","Mán","Þri","Mið","Fim","Fös","Lau"],dayNamesMin:["Su","Má","Þr","Mi","Fi","Fö","La"],weekHeader:"Vika",dateFormat:"dd.mm.yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.is)}),jQuery(function(e){e.datepicker.regional.it={closeText:"Chiudi",prevText:"&#x3C;Prec",nextText:"Succ&#x3E;",currentText:"Oggi",monthNames:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthNamesShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],dayNames:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"],dayNamesShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],dayNamesMin:["Do","Lu","Ma","Me","Gi","Ve","Sa"],weekHeader:"Sm",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.it)}),jQuery(function(e){e.datepicker.regional.ja={closeText:"閉じる",prevText:"&#x3C;前",nextText:"次&#x3E;",currentText:"今日",monthNames:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthNamesShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayNames:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],dayNamesShort:["日","月","火","水","木","金","土"],dayNamesMin:["日","月","火","水","木","金","土"],weekHeader:"週",dateFormat:"yy/mm/dd",firstDay:0,isRTL:!1,showMonthAfterYear:!0,yearSuffix:"年"},e.datepicker.setDefaults(e.datepicker.regional.ja)}),jQuery(function(e){e.datepicker.regional.ka={closeText:"დახურვა",prevText:"&#x3c; წინა",nextText:"შემდეგი &#x3e;",currentText:"დღეს",monthNames:["იანვარი","თებერვალი","მარტი","აპრილი","მაისი","ივნისი","ივლისი","აგვისტო","სექტემბერი","ოქტომბერი","ნოემბერი","დეკემბერი"],monthNamesShort:["იან","თებ","მარ","აპრ","მაი","ივნ","ივლ","აგვ","სექ","ოქტ","ნოე","დეკ"],dayNames:["კვირა","ორშაბათი","სამშაბათი","ოთხშაბათი","ხუთშაბათი","პარასკევი","შაბათი"],dayNamesShort:["კვ","ორშ","სამ","ოთხ","ხუთ","პარ","შაბ"],dayNamesMin:["კვ","ორშ","სამ","ოთხ","ხუთ","პარ","შაბ"],weekHeader:"კვირა",dateFormat:"dd-mm-yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.ka)}),jQuery(function(e){e.datepicker.regional.kk={closeText:"Жабу",prevText:"&#x3C;Алдыңғы",nextText:"Келесі&#x3E;",currentText:"Бүгін",monthNames:["Қаңтар","Ақпан","Наурыз","Сәуір","Мамыр","Маусым","Шілде","Тамыз","Қыркүйек","Қазан","Қараша","Желтоқсан"],monthNamesShort:["Қаң","Ақп","Нау","Сәу","Мам","Мау","Шіл","Там","Қыр","Қаз","Қар","Жел"],dayNames:["Жексенбі","Дүйсенбі","Сейсенбі","Сәрсенбі","Бейсенбі","Жұма","Сенбі"],dayNamesShort:["жкс","дсн","ссн","срс","бсн","жма","снб"],dayNamesMin:["Жк","Дс","Сс","Ср","Бс","Жм","Сн"],weekHeader:"Не",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.kk)}),jQuery(function(e){e.datepicker.regional.km={closeText:"ធ្វើ​រួច",prevText:"មុន",nextText:"បន្ទាប់",currentText:"ថ្ងៃ​នេះ",monthNames:["មករា","កុម្ភៈ","មីនា","មេសា","ឧសភា","មិថុនា","កក្កដា","សីហា","កញ្ញា","តុលា","វិច្ឆិកា","ធ្នូ"],monthNamesShort:["មករា","កុម្ភៈ","មីនា","មេសា","ឧសភា","មិថុនា","កក្កដា","សីហា","កញ្ញា","តុលា","វិច្ឆិកា","ធ្នូ"],dayNames:["អាទិត្យ","ចន្ទ","អង្គារ","ពុធ","ព្រហស្បតិ៍","សុក្រ","សៅរ៍"],dayNamesShort:["អា","ច","អ","ពុ","ព្រហ","សុ","សៅ"],dayNamesMin:["អា","ច","អ","ពុ","ព្រហ","សុ","សៅ"],weekHeader:"សប្ដាហ៍",dateFormat:"dd-mm-yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.km)}),jQuery(function(e){e.datepicker.regional.ko={closeText:"닫기",prevText:"이전달",nextText:"다음달",currentText:"오늘",monthNames:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],monthNamesShort:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dayNames:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],dayNamesShort:["일","월","화","수","목","금","토"],dayNamesMin:["일","월","화","수","목","금","토"],weekHeader:"Wk",dateFormat:"yy-mm-dd",firstDay:0,isRTL:!1,showMonthAfterYear:!0,yearSuffix:"년"},e.datepicker.setDefaults(e.datepicker.regional.ko)}),jQuery(function(e){e.datepicker.regional.ky={closeText:"Жабуу",prevText:"&#x3c;Мур",nextText:"Кий&#x3e;",currentText:"Бүгүн",monthNames:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthNamesShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],dayNames:["жекшемби","дүйшөмбү","шейшемби","шаршемби","бейшемби","жума","ишемби"],dayNamesShort:["жек","дүй","шей","шар","бей","жум","ише"],dayNamesMin:["Жк","Дш","Шш","Шр","Бш","Жм","Иш"],weekHeader:"Жум",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.ky)}),jQuery(function(e){e.datepicker.regional.lb={closeText:"Fäerdeg",prevText:"Zréck",nextText:"Weider",currentText:"Haut",monthNames:["Januar","Februar","Mäerz","Abrëll","Mee","Juni","Juli","August","September","Oktober","November","Dezember"],monthNamesShort:["Jan","Feb","Mäe","Abr","Mee","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],dayNames:["Sonndeg","Méindeg","Dënschdeg","Mëttwoch","Donneschdeg","Freideg","Samschdeg"],dayNamesShort:["Son","Méi","Dën","Mët","Don","Fre","Sam"],dayNamesMin:["So","Mé","Dë","Më","Do","Fr","Sa"],weekHeader:"W",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.lb)}),jQuery(function(e){e.datepicker.regional.lt={closeText:"Uždaryti",prevText:"&#x3C;Atgal",nextText:"Pirmyn&#x3E;",currentText:"Šiandien",monthNames:["Sausis","Vasaris","Kovas","Balandis","Gegužė","Birželis","Liepa","Rugpjūtis","Rugsėjis","Spalis","Lapkritis","Gruodis"],monthNamesShort:["Sau","Vas","Kov","Bal","Geg","Bir","Lie","Rugp","Rugs","Spa","Lap","Gru"],dayNames:["sekmadienis","pirmadienis","antradienis","trečiadienis","ketvirtadienis","penktadienis","šeštadienis"],dayNamesShort:["sek","pir","ant","tre","ket","pen","šeš"],dayNamesMin:["Se","Pr","An","Tr","Ke","Pe","Še"],weekHeader:"SAV",dateFormat:"yy-mm-dd",firstDay:1,isRTL:!1,showMonthAfterYear:!0,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.lt)}),jQuery(function(e){e.datepicker.regional.lv={closeText:"Aizvērt",prevText:"Iepr.",nextText:"Nāk.",currentText:"Šodien",monthNames:["Janvāris","Februāris","Marts","Aprīlis","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],monthNamesShort:["Jan","Feb","Mar","Apr","Mai","Jūn","Jūl","Aug","Sep","Okt","Nov","Dec"],dayNames:["svētdiena","pirmdiena","otrdiena","trešdiena","ceturtdiena","piektdiena","sestdiena"],dayNamesShort:["svt","prm","otr","tre","ctr","pkt","sst"],dayNamesMin:["Sv","Pr","Ot","Tr","Ct","Pk","Ss"],weekHeader:"Ned.",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.lv)}),jQuery(function(e){e.datepicker.regional.mk={closeText:"Затвори",prevText:"&#x3C;",nextText:"&#x3E;",currentText:"Денес",monthNames:["Јануари","Февруари","Март","Април","Мај","Јуни","Јули","Август","Септември","Октомври","Ноември","Декември"],monthNamesShort:["Јан","Фев","Мар","Апр","Мај","Јун","Јул","Авг","Сеп","Окт","Ное","Дек"],dayNames:["Недела","Понеделник","Вторник","Среда","Четврток","Петок","Сабота"],dayNamesShort:["Нед","Пон","Вто","Сре","Чет","Пет","Саб"],dayNamesMin:["Не","По","Вт","Ср","Че","Пе","Са"],weekHeader:"Сед",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.mk)}),jQuery(function(e){e.datepicker.regional.ml={closeText:"ശരി",prevText:"മുന്നത്തെ",nextText:"അടുത്തത് ",currentText:"ഇന്ന്",monthNames:["ജനുവരി","ഫെബ്രുവരി","മാര്‍ച്ച്","ഏപ്രില്‍","മേയ്","ജൂണ്‍","ജൂലൈ","ആഗസ്റ്റ്","സെപ്റ്റംബര്‍","ഒക്ടോബര്‍","നവംബര്‍","ഡിസംബര്‍"],monthNamesShort:["ജനു","ഫെബ്","മാര്‍","ഏപ്രി","മേയ്","ജൂണ്‍","ജൂലാ","ആഗ","സെപ്","ഒക്ടോ","നവം","ഡിസ"],dayNames:["ഞായര്‍","തിങ്കള്‍","ചൊവ്വ","ബുധന്‍","വ്യാഴം","വെള്ളി","ശനി"],dayNamesShort:["ഞായ","തിങ്ക","ചൊവ്വ","ബുധ","വ്യാഴം","വെള്ളി","ശനി"],dayNamesMin:["ഞാ","തി","ചൊ","ബു","വ്യാ","വെ","ശ"],weekHeader:"ആ",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.ml)}),jQuery(function(e){e.datepicker.regional.ms={closeText:"Tutup",prevText:"&#x3C;Sebelum",nextText:"Selepas&#x3E;",currentText:"hari ini",monthNames:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],monthNamesShort:["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],dayNames:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"],dayNamesShort:["Aha","Isn","Sel","Rab","kha","Jum","Sab"],dayNamesMin:["Ah","Is","Se","Ra","Kh","Ju","Sa"],weekHeader:"Mg",dateFormat:"dd/mm/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.ms)}),jQuery(function(e){e.datepicker.regional.nb={closeText:"Lukk",prevText:"&#xAB;Forrige",nextText:"Neste&#xBB;",currentText:"I dag",monthNames:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],monthNamesShort:["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des"],dayNamesShort:["søn","man","tir","ons","tor","fre","lør"],dayNames:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],dayNamesMin:["sø","ma","ti","on","to","fr","lø"],weekHeader:"Uke",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.nb)
+}),jQuery(function(e){e.datepicker.regional["nl-BE"]={closeText:"Sluiten",prevText:"←",nextText:"→",currentText:"Vandaag",monthNames:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],monthNamesShort:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"],dayNames:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],dayNamesShort:["zon","maa","din","woe","don","vri","zat"],dayNamesMin:["zo","ma","di","wo","do","vr","za"],weekHeader:"Wk",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional["nl-BE"])}),jQuery(function(e){e.datepicker.regional.nl={closeText:"Sluiten",prevText:"←",nextText:"→",currentText:"Vandaag",monthNames:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],monthNamesShort:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"],dayNames:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],dayNamesShort:["zon","maa","din","woe","don","vri","zat"],dayNamesMin:["zo","ma","di","wo","do","vr","za"],weekHeader:"Wk",dateFormat:"dd-mm-yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.nl)}),jQuery(function(e){e.datepicker.regional.nn={closeText:"Lukk",prevText:"&#xAB;Førre",nextText:"Neste&#xBB;",currentText:"I dag",monthNames:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],monthNamesShort:["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des"],dayNamesShort:["sun","mån","tys","ons","tor","fre","lau"],dayNames:["sundag","måndag","tysdag","onsdag","torsdag","fredag","laurdag"],dayNamesMin:["su","må","ty","on","to","fr","la"],weekHeader:"Veke",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.nn)}),jQuery(function(e){e.datepicker.regional.no={closeText:"Lukk",prevText:"&#xAB;Forrige",nextText:"Neste&#xBB;",currentText:"I dag",monthNames:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],monthNamesShort:["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des"],dayNamesShort:["søn","man","tir","ons","tor","fre","lør"],dayNames:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],dayNamesMin:["sø","ma","ti","on","to","fr","lø"],weekHeader:"Uke",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.no)}),jQuery(function(e){e.datepicker.regional.pl={closeText:"Zamknij",prevText:"&#x3C;Poprzedni",nextText:"Następny&#x3E;",currentText:"Dziś",monthNames:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthNamesShort:["Sty","Lu","Mar","Kw","Maj","Cze","Lip","Sie","Wrz","Pa","Lis","Gru"],dayNames:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"],dayNamesShort:["Nie","Pn","Wt","Śr","Czw","Pt","So"],dayNamesMin:["N","Pn","Wt","Śr","Cz","Pt","So"],weekHeader:"Tydz",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.pl)}),jQuery(function(e){e.datepicker.regional["pt-BR"]={closeText:"Fechar",prevText:"&#x3C;Anterior",nextText:"Próximo&#x3E;",currentText:"Hoje",monthNames:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dayNames:["Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],dayNamesMin:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],weekHeader:"Sm",dateFormat:"dd/mm/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional["pt-BR"])}),jQuery(function(e){e.datepicker.regional.pt={closeText:"Fechar",prevText:"Anterior",nextText:"Seguinte",currentText:"Hoje",monthNames:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dayNames:["Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],dayNamesMin:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],weekHeader:"Sem",dateFormat:"dd/mm/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.pt)}),jQuery(function(e){e.datepicker.regional.rm={closeText:"Serrar",prevText:"&#x3C;Suandant",nextText:"Precedent&#x3E;",currentText:"Actual",monthNames:["Schaner","Favrer","Mars","Avrigl","Matg","Zercladur","Fanadur","Avust","Settember","October","November","December"],monthNamesShort:["Scha","Fev","Mar","Avr","Matg","Zer","Fan","Avu","Sett","Oct","Nov","Dec"],dayNames:["Dumengia","Glindesdi","Mardi","Mesemna","Gievgia","Venderdi","Sonda"],dayNamesShort:["Dum","Gli","Mar","Mes","Gie","Ven","Som"],dayNamesMin:["Du","Gl","Ma","Me","Gi","Ve","So"],weekHeader:"emna",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.rm)}),jQuery(function(e){e.datepicker.regional.ro={closeText:"Închide",prevText:"&#xAB; Luna precedentă",nextText:"Luna următoare &#xBB;",currentText:"Azi",monthNames:["Ianuarie","Februarie","Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","Noiembrie","Decembrie"],monthNamesShort:["Ian","Feb","Mar","Apr","Mai","Iun","Iul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Duminică","Luni","Marţi","Miercuri","Joi","Vineri","Sâmbătă"],dayNamesShort:["Dum","Lun","Mar","Mie","Joi","Vin","Sâm"],dayNamesMin:["Du","Lu","Ma","Mi","Jo","Vi","Sâ"],weekHeader:"Săpt",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.ro)}),jQuery(function(e){e.datepicker.regional.ru={closeText:"Закрыть",prevText:"&#x3C;Пред",nextText:"След&#x3E;",currentText:"Сегодня",monthNames:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthNamesShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],dayNames:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],dayNamesShort:["вск","пнд","втр","срд","чтв","птн","сбт"],dayNamesMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],weekHeader:"Нед",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.ru)}),jQuery(function(e){e.datepicker.regional.sk={closeText:"Zavrieť",prevText:"&#x3C;Predchádzajúci",nextText:"Nasledujúci&#x3E;",currentText:"Dnes",monthNames:["január","február","marec","apríl","máj","jún","júl","august","september","október","november","december"],monthNamesShort:["Jan","Feb","Mar","Apr","Máj","Jún","Júl","Aug","Sep","Okt","Nov","Dec"],dayNames:["nedeľa","pondelok","utorok","streda","štvrtok","piatok","sobota"],dayNamesShort:["Ned","Pon","Uto","Str","Štv","Pia","Sob"],dayNamesMin:["Ne","Po","Ut","St","Št","Pia","So"],weekHeader:"Ty",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.sk)}),jQuery(function(e){e.datepicker.regional.sl={closeText:"Zapri",prevText:"&#x3C;Prejšnji",nextText:"Naslednji&#x3E;",currentText:"Trenutni",monthNames:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],dayNames:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota"],dayNamesShort:["Ned","Pon","Tor","Sre","Čet","Pet","Sob"],dayNamesMin:["Ne","Po","To","Sr","Če","Pe","So"],weekHeader:"Teden",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.sl)}),jQuery(function(e){e.datepicker.regional.sq={closeText:"mbylle",prevText:"&#x3C;mbrapa",nextText:"Përpara&#x3E;",currentText:"sot",monthNames:["Janar","Shkurt","Mars","Prill","Maj","Qershor","Korrik","Gusht","Shtator","Tetor","Nëntor","Dhjetor"],monthNamesShort:["Jan","Shk","Mar","Pri","Maj","Qer","Kor","Gus","Sht","Tet","Nën","Dhj"],dayNames:["E Diel","E Hënë","E Martë","E Mërkurë","E Enjte","E Premte","E Shtune"],dayNamesShort:["Di","Hë","Ma","Më","En","Pr","Sh"],dayNamesMin:["Di","Hë","Ma","Më","En","Pr","Sh"],weekHeader:"Ja",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.sq)}),jQuery(function(e){e.datepicker.regional["sr-SR"]={closeText:"Zatvori",prevText:"&#x3C;",nextText:"&#x3E;",currentText:"Danas",monthNames:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],monthNamesShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],dayNames:["Nedelja","Ponedeljak","Utorak","Sreda","Četvrtak","Petak","Subota"],dayNamesShort:["Ned","Pon","Uto","Sre","Čet","Pet","Sub"],dayNamesMin:["Ne","Po","Ut","Sr","Če","Pe","Su"],weekHeader:"Sed",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional["sr-SR"])}),jQuery(function(e){e.datepicker.regional.sr={closeText:"Затвори",prevText:"&#x3C;",nextText:"&#x3E;",currentText:"Данас",monthNames:["Јануар","Фебруар","Март","Април","Мај","Јун","Јул","Август","Септембар","Октобар","Новембар","Децембар"],monthNamesShort:["Јан","Феб","Мар","Апр","Мај","Јун","Јул","Авг","Сеп","Окт","Нов","Дец"],dayNames:["Недеља","Понедељак","Уторак","Среда","Четвртак","Петак","Субота"],dayNamesShort:["Нед","Пон","Уто","Сре","Чет","Пет","Суб"],dayNamesMin:["Не","По","Ут","Ср","Че","Пе","Су"],weekHeader:"Сед",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.sr)}),jQuery(function(e){e.datepicker.regional.sv={closeText:"Stäng",prevText:"&#xAB;Förra",nextText:"Nästa&#xBB;",currentText:"Idag",monthNames:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],dayNamesShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör"],dayNames:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag"],dayNamesMin:["Sö","Må","Ti","On","To","Fr","Lö"],weekHeader:"Ve",dateFormat:"yy-mm-dd",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.sv)}),jQuery(function(e){e.datepicker.regional.ta={closeText:"மூடு",prevText:"முன்னையது",nextText:"அடுத்தது",currentText:"இன்று",monthNames:["தை","மாசி","பங்குனி","சித்திரை","வைகாசி","ஆனி","ஆடி","ஆவணி","புரட்டாசி","ஐப்பசி","கார்த்திகை","மார்கழி"],monthNamesShort:["தை","மாசி","பங்","சித்","வைகா","ஆனி","ஆடி","ஆவ","புர","ஐப்","கார்","மார்"],dayNames:["ஞாயிற்றுக்கிழமை","திங்கட்கிழமை","செவ்வாய்க்கிழமை","புதன்கிழமை","வியாழக்கிழமை","வெள்ளிக்கிழமை","சனிக்கிழமை"],dayNamesShort:["ஞாயிறு","திங்கள்","செவ்வாய்","புதன்","வியாழன்","வெள்ளி","சனி"],dayNamesMin:["ஞா","தி","செ","பு","வி","வெ","ச"],weekHeader:"Не",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.ta)}),jQuery(function(e){e.datepicker.regional.th={closeText:"ปิด",prevText:"&#xAB;&#xA0;ย้อน",nextText:"ถัดไป&#xA0;&#xBB;",currentText:"วันนี้",monthNames:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],monthNamesShort:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],dayNames:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัสบดี","ศุกร์","เสาร์"],dayNamesShort:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."],dayNamesMin:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."],weekHeader:"Wk",dateFormat:"dd/mm/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.th)}),jQuery(function(e){e.datepicker.regional.tj={closeText:"Идома",prevText:"&#x3c;Қафо",nextText:"Пеш&#x3e;",currentText:"Имрӯз",monthNames:["Январ","Феврал","Март","Апрел","Май","Июн","Июл","Август","Сентябр","Октябр","Ноябр","Декабр"],monthNamesShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],dayNames:["якшанбе","душанбе","сешанбе","чоршанбе","панҷшанбе","ҷумъа","шанбе"],dayNamesShort:["якш","душ","сеш","чор","пан","ҷум","шан"],dayNamesMin:["Як","Дш","Сш","Чш","Пш","Ҷм","Шн"],weekHeader:"Хф",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.tj)}),jQuery(function(e){e.datepicker.regional.tr={closeText:"kapat",prevText:"&#x3C;geri",nextText:"ileri&#x3e",currentText:"bugün",monthNames:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],monthNamesShort:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],dayNames:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],dayNamesShort:["Pz","Pt","Sa","Ça","Pe","Cu","Ct"],dayNamesMin:["Pz","Pt","Sa","Ça","Pe","Cu","Ct"],weekHeader:"Hf",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.tr)}),jQuery(function(e){e.datepicker.regional.uk={closeText:"Закрити",prevText:"&#x3C;",nextText:"&#x3E;",currentText:"Сьогодні",monthNames:["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"],monthNamesShort:["Січ","Лют","Бер","Кві","Тра","Чер","Лип","Сер","Вер","Жов","Лис","Гру"],dayNames:["неділя","понеділок","вівторок","середа","четвер","п’ятниця","субота"],dayNamesShort:["нед","пнд","вів","срд","чтв","птн","сбт"],dayNamesMin:["Нд","Пн","Вт","Ср","Чт","Пт","Сб"],weekHeader:"Тиж",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.uk)}),jQuery(function(e){e.datepicker.regional.vi={closeText:"Đóng",prevText:"&#x3C;Trước",nextText:"Tiếp&#x3E;",currentText:"Hôm nay",monthNames:["Tháng Một","Tháng Hai","Tháng Ba","Tháng Tư","Tháng Năm","Tháng Sáu","Tháng Bảy","Tháng Tám","Tháng Chín","Tháng Mười","Tháng Mười Một","Tháng Mười Hai"],monthNamesShort:["Tháng 1","Tháng 2","Tháng 3","Tháng 4","Tháng 5","Tháng 6","Tháng 7","Tháng 8","Tháng 9","Tháng 10","Tháng 11","Tháng 12"],dayNames:["Chủ Nhật","Thứ Hai","Thứ Ba","Thứ Tư","Thứ Năm","Thứ Sáu","Thứ Bảy"],dayNamesShort:["CN","T2","T3","T4","T5","T6","T7"],dayNamesMin:["CN","T2","T3","T4","T5","T6","T7"],weekHeader:"Tu",dateFormat:"dd/mm/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.vi)}),jQuery(function(e){e.datepicker.regional["zh-CN"]={closeText:"关闭",prevText:"&#x3C;上月",nextText:"下月&#x3E;",currentText:"今天",monthNames:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthNamesShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayNames:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayNamesShort:["周日","周一","周二","周三","周四","周五","周六"],dayNamesMin:["日","一","二","三","四","五","六"],weekHeader:"周",dateFormat:"yy-mm-dd",firstDay:1,isRTL:!1,showMonthAfterYear:!0,yearSuffix:"年"},e.datepicker.setDefaults(e.datepicker.regional["zh-CN"])}),jQuery(function(e){e.datepicker.regional["zh-HK"]={closeText:"關閉",prevText:"&#x3C;上月",nextText:"下月&#x3E;",currentText:"今天",monthNames:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthNamesShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayNames:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayNamesShort:["周日","周一","周二","周三","周四","周五","周六"],dayNamesMin:["日","一","二","三","四","五","六"],weekHeader:"周",dateFormat:"dd-mm-yy",firstDay:0,isRTL:!1,showMonthAfterYear:!0,yearSuffix:"年"},e.datepicker.setDefaults(e.datepicker.regional["zh-HK"])}),jQuery(function(e){e.datepicker.regional["zh-TW"]={closeText:"關閉",prevText:"&#x3C;上月",nextText:"下月&#x3E;",currentText:"今天",monthNames:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthNamesShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayNames:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayNamesShort:["周日","周一","周二","周三","周四","周五","周六"],dayNamesMin:["日","一","二","三","四","五","六"],weekHeader:"周",dateFormat:"yy/mm/dd",firstDay:1,isRTL:!1,showMonthAfterYear:!0,yearSuffix:"年"},e.datepicker.setDefaults(e.datepicker.regional["zh-TW"])}); \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/jquery/jquery-ui.js b/framework/Web/Javascripts/source/jquery/jquery-ui.js
new file mode 100644
index 00000000..a5ae96f1
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/jquery-ui.js
@@ -0,0 +1,15040 @@
+/*! jQuery UI - v1.10.4 - 2014-01-17
+* http://jqueryui.com
+* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.effect.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.position.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+(function( $, undefined ) {
+
+var uuid = 0,
+ runiqueId = /^ui-id-\d+$/;
+
+// $.ui might exist from components with no dependencies, e.g., $.ui.position
+$.ui = $.ui || {};
+
+$.extend( $.ui, {
+ version: "1.10.4",
+
+ keyCode: {
+ BACKSPACE: 8,
+ COMMA: 188,
+ DELETE: 46,
+ DOWN: 40,
+ END: 35,
+ ENTER: 13,
+ ESCAPE: 27,
+ HOME: 36,
+ LEFT: 37,
+ NUMPAD_ADD: 107,
+ NUMPAD_DECIMAL: 110,
+ NUMPAD_DIVIDE: 111,
+ NUMPAD_ENTER: 108,
+ NUMPAD_MULTIPLY: 106,
+ NUMPAD_SUBTRACT: 109,
+ PAGE_DOWN: 34,
+ PAGE_UP: 33,
+ PERIOD: 190,
+ RIGHT: 39,
+ SPACE: 32,
+ TAB: 9,
+ UP: 38
+ }
+});
+
+// plugins
+$.fn.extend({
+ focus: (function( orig ) {
+ return function( delay, fn ) {
+ return typeof delay === "number" ?
+ this.each(function() {
+ var elem = this;
+ setTimeout(function() {
+ $( elem ).focus();
+ if ( fn ) {
+ fn.call( elem );
+ }
+ }, delay );
+ }) :
+ orig.apply( this, arguments );
+ };
+ })( $.fn.focus ),
+
+ scrollParent: function() {
+ var scrollParent;
+ if (($.ui.ie && (/(static|relative)/).test(this.css("position"))) || (/absolute/).test(this.css("position"))) {
+ scrollParent = this.parents().filter(function() {
+ return (/(relative|absolute|fixed)/).test($.css(this,"position")) && (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"));
+ }).eq(0);
+ } else {
+ scrollParent = this.parents().filter(function() {
+ return (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"));
+ }).eq(0);
+ }
+
+ return (/fixed/).test(this.css("position")) || !scrollParent.length ? $(document) : scrollParent;
+ },
+
+ zIndex: function( zIndex ) {
+ if ( zIndex !== undefined ) {
+ return this.css( "zIndex", zIndex );
+ }
+
+ if ( this.length ) {
+ var elem = $( this[ 0 ] ), position, value;
+ while ( elem.length && elem[ 0 ] !== document ) {
+ // Ignore z-index if position is set to a value where z-index is ignored by the browser
+ // This makes behavior of this function consistent across browsers
+ // WebKit always returns auto if the element is positioned
+ position = elem.css( "position" );
+ if ( position === "absolute" || position === "relative" || position === "fixed" ) {
+ // IE returns 0 when zIndex is not specified
+ // other browsers return a string
+ // we ignore the case of nested elements with an explicit value of 0
+ // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
+ value = parseInt( elem.css( "zIndex" ), 10 );
+ if ( !isNaN( value ) && value !== 0 ) {
+ return value;
+ }
+ }
+ elem = elem.parent();
+ }
+ }
+
+ return 0;
+ },
+
+ uniqueId: function() {
+ return this.each(function() {
+ if ( !this.id ) {
+ this.id = "ui-id-" + (++uuid);
+ }
+ });
+ },
+
+ removeUniqueId: function() {
+ return this.each(function() {
+ if ( runiqueId.test( this.id ) ) {
+ $( this ).removeAttr( "id" );
+ }
+ });
+ }
+});
+
+// selectors
+function focusable( element, isTabIndexNotNaN ) {
+ var map, mapName, img,
+ nodeName = element.nodeName.toLowerCase();
+ if ( "area" === nodeName ) {
+ map = element.parentNode;
+ mapName = map.name;
+ if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
+ return false;
+ }
+ img = $( "img[usemap=#" + mapName + "]" )[0];
+ return !!img && visible( img );
+ }
+ return ( /input|select|textarea|button|object/.test( nodeName ) ?
+ !element.disabled :
+ "a" === nodeName ?
+ element.href || isTabIndexNotNaN :
+ isTabIndexNotNaN) &&
+ // the element and all of its ancestors must be visible
+ visible( element );
+}
+
+function visible( element ) {
+ return $.expr.filters.visible( element ) &&
+ !$( element ).parents().addBack().filter(function() {
+ return $.css( this, "visibility" ) === "hidden";
+ }).length;
+}
+
+$.extend( $.expr[ ":" ], {
+ data: $.expr.createPseudo ?
+ $.expr.createPseudo(function( dataName ) {
+ return function( elem ) {
+ return !!$.data( elem, dataName );
+ };
+ }) :
+ // support: jQuery <1.8
+ function( elem, i, match ) {
+ return !!$.data( elem, match[ 3 ] );
+ },
+
+ focusable: function( element ) {
+ return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
+ },
+
+ tabbable: function( element ) {
+ var tabIndex = $.attr( element, "tabindex" ),
+ isTabIndexNaN = isNaN( tabIndex );
+ return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
+ }
+});
+
+// support: jQuery <1.8
+if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
+ $.each( [ "Width", "Height" ], function( i, name ) {
+ var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
+ type = name.toLowerCase(),
+ orig = {
+ innerWidth: $.fn.innerWidth,
+ innerHeight: $.fn.innerHeight,
+ outerWidth: $.fn.outerWidth,
+ outerHeight: $.fn.outerHeight
+ };
+
+ function reduce( elem, size, border, margin ) {
+ $.each( side, function() {
+ size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
+ if ( border ) {
+ size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
+ }
+ if ( margin ) {
+ size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
+ }
+ });
+ return size;
+ }
+
+ $.fn[ "inner" + name ] = function( size ) {
+ if ( size === undefined ) {
+ return orig[ "inner" + name ].call( this );
+ }
+
+ return this.each(function() {
+ $( this ).css( type, reduce( this, size ) + "px" );
+ });
+ };
+
+ $.fn[ "outer" + name] = function( size, margin ) {
+ if ( typeof size !== "number" ) {
+ return orig[ "outer" + name ].call( this, size );
+ }
+
+ return this.each(function() {
+ $( this).css( type, reduce( this, size, true, margin ) + "px" );
+ });
+ };
+ });
+}
+
+// support: jQuery <1.8
+if ( !$.fn.addBack ) {
+ $.fn.addBack = function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter( selector )
+ );
+ };
+}
+
+// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
+if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
+ $.fn.removeData = (function( removeData ) {
+ return function( key ) {
+ if ( arguments.length ) {
+ return removeData.call( this, $.camelCase( key ) );
+ } else {
+ return removeData.call( this );
+ }
+ };
+ })( $.fn.removeData );
+}
+
+
+
+
+
+// deprecated
+$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
+
+$.support.selectstart = "onselectstart" in document.createElement( "div" );
+$.fn.extend({
+ disableSelection: function() {
+ return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
+ ".ui-disableSelection", function( event ) {
+ event.preventDefault();
+ });
+ },
+
+ enableSelection: function() {
+ return this.unbind( ".ui-disableSelection" );
+ }
+});
+
+$.extend( $.ui, {
+ // $.ui.plugin is deprecated. Use $.widget() extensions instead.
+ plugin: {
+ add: function( module, option, set ) {
+ var i,
+ proto = $.ui[ module ].prototype;
+ for ( i in set ) {
+ proto.plugins[ i ] = proto.plugins[ i ] || [];
+ proto.plugins[ i ].push( [ option, set[ i ] ] );
+ }
+ },
+ call: function( instance, name, args ) {
+ var i,
+ set = instance.plugins[ name ];
+ if ( !set || !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) {
+ return;
+ }
+
+ for ( i = 0; i < set.length; i++ ) {
+ if ( instance.options[ set[ i ][ 0 ] ] ) {
+ set[ i ][ 1 ].apply( instance.element, args );
+ }
+ }
+ }
+ },
+
+ // only used by resizable
+ hasScroll: function( el, a ) {
+
+ //If overflow is hidden, the element might have extra content, but the user wants to hide it
+ if ( $( el ).css( "overflow" ) === "hidden") {
+ return false;
+ }
+
+ var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
+ has = false;
+
+ if ( el[ scroll ] > 0 ) {
+ return true;
+ }
+
+ // TODO: determine which cases actually cause this to happen
+ // if the element doesn't have the scroll set, see if it's possible to
+ // set the scroll
+ el[ scroll ] = 1;
+ has = ( el[ scroll ] > 0 );
+ el[ scroll ] = 0;
+ return has;
+ }
+});
+
+})( jQuery );
+
+(function( $, undefined ) {
+
+var uuid = 0,
+ slice = Array.prototype.slice,
+ _cleanData = $.cleanData;
+$.cleanData = function( elems ) {
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ try {
+ $( elem ).triggerHandler( "remove" );
+ // http://bugs.jquery.com/ticket/8235
+ } catch( e ) {}
+ }
+ _cleanData( elems );
+};
+
+$.widget = function( name, base, prototype ) {
+ var fullName, existingConstructor, constructor, basePrototype,
+ // proxiedPrototype allows the provided prototype to remain unmodified
+ // so that it can be used as a mixin for multiple widgets (#8876)
+ proxiedPrototype = {},
+ namespace = name.split( "." )[ 0 ];
+
+ name = name.split( "." )[ 1 ];
+ fullName = namespace + "-" + name;
+
+ if ( !prototype ) {
+ prototype = base;
+ base = $.Widget;
+ }
+
+ // create selector for plugin
+ $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
+ return !!$.data( elem, fullName );
+ };
+
+ $[ namespace ] = $[ namespace ] || {};
+ existingConstructor = $[ namespace ][ name ];
+ constructor = $[ namespace ][ name ] = function( options, element ) {
+ // allow instantiation without "new" keyword
+ if ( !this._createWidget ) {
+ return new constructor( options, element );
+ }
+
+ // allow instantiation without initializing for simple inheritance
+ // must use "new" keyword (the code above always passes args)
+ if ( arguments.length ) {
+ this._createWidget( options, element );
+ }
+ };
+ // extend with the existing constructor to carry over any static properties
+ $.extend( constructor, existingConstructor, {
+ version: prototype.version,
+ // copy the object used to create the prototype in case we need to
+ // redefine the widget later
+ _proto: $.extend( {}, prototype ),
+ // track widgets that inherit from this widget in case this widget is
+ // redefined after a widget inherits from it
+ _childConstructors: []
+ });
+
+ basePrototype = new base();
+ // we need to make the options hash a property directly on the new instance
+ // otherwise we'll modify the options hash on the prototype that we're
+ // inheriting from
+ basePrototype.options = $.widget.extend( {}, basePrototype.options );
+ $.each( prototype, function( prop, value ) {
+ if ( !$.isFunction( value ) ) {
+ proxiedPrototype[ prop ] = value;
+ return;
+ }
+ proxiedPrototype[ prop ] = (function() {
+ var _super = function() {
+ return base.prototype[ prop ].apply( this, arguments );
+ },
+ _superApply = function( args ) {
+ return base.prototype[ prop ].apply( this, args );
+ };
+ return function() {
+ var __super = this._super,
+ __superApply = this._superApply,
+ returnValue;
+
+ this._super = _super;
+ this._superApply = _superApply;
+
+ returnValue = value.apply( this, arguments );
+
+ this._super = __super;
+ this._superApply = __superApply;
+
+ return returnValue;
+ };
+ })();
+ });
+ constructor.prototype = $.widget.extend( basePrototype, {
+ // TODO: remove support for widgetEventPrefix
+ // always use the name + a colon as the prefix, e.g., draggable:start
+ // don't prefix for widgets that aren't DOM-based
+ widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
+ }, proxiedPrototype, {
+ constructor: constructor,
+ namespace: namespace,
+ widgetName: name,
+ widgetFullName: fullName
+ });
+
+ // If this widget is being redefined then we need to find all widgets that
+ // are inheriting from it and redefine all of them so that they inherit from
+ // the new version of this widget. We're essentially trying to replace one
+ // level in the prototype chain.
+ if ( existingConstructor ) {
+ $.each( existingConstructor._childConstructors, function( i, child ) {
+ var childPrototype = child.prototype;
+
+ // redefine the child widget using the same prototype that was
+ // originally used, but inherit from the new version of the base
+ $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
+ });
+ // remove the list of existing child constructors from the old constructor
+ // so the old child constructors can be garbage collected
+ delete existingConstructor._childConstructors;
+ } else {
+ base._childConstructors.push( constructor );
+ }
+
+ $.widget.bridge( name, constructor );
+};
+
+$.widget.extend = function( target ) {
+ var input = slice.call( arguments, 1 ),
+ inputIndex = 0,
+ inputLength = input.length,
+ key,
+ value;
+ for ( ; inputIndex < inputLength; inputIndex++ ) {
+ for ( key in input[ inputIndex ] ) {
+ value = input[ inputIndex ][ key ];
+ if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
+ // Clone objects
+ if ( $.isPlainObject( value ) ) {
+ target[ key ] = $.isPlainObject( target[ key ] ) ?
+ $.widget.extend( {}, target[ key ], value ) :
+ // Don't extend strings, arrays, etc. with objects
+ $.widget.extend( {}, value );
+ // Copy everything else by reference
+ } else {
+ target[ key ] = value;
+ }
+ }
+ }
+ }
+ return target;
+};
+
+$.widget.bridge = function( name, object ) {
+ var fullName = object.prototype.widgetFullName || name;
+ $.fn[ name ] = function( options ) {
+ var isMethodCall = typeof options === "string",
+ args = slice.call( arguments, 1 ),
+ returnValue = this;
+
+ // allow multiple hashes to be passed on init
+ options = !isMethodCall && args.length ?
+ $.widget.extend.apply( null, [ options ].concat(args) ) :
+ options;
+
+ if ( isMethodCall ) {
+ this.each(function() {
+ var methodValue,
+ instance = $.data( this, fullName );
+ if ( !instance ) {
+ return $.error( "cannot call methods on " + name + " prior to initialization; " +
+ "attempted to call method '" + options + "'" );
+ }
+ if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
+ return $.error( "no such method '" + options + "' for " + name + " widget instance" );
+ }
+ methodValue = instance[ options ].apply( instance, args );
+ if ( methodValue !== instance && methodValue !== undefined ) {
+ returnValue = methodValue && methodValue.jquery ?
+ returnValue.pushStack( methodValue.get() ) :
+ methodValue;
+ return false;
+ }
+ });
+ } else {
+ this.each(function() {
+ var instance = $.data( this, fullName );
+ if ( instance ) {
+ instance.option( options || {} )._init();
+ } else {
+ $.data( this, fullName, new object( options, this ) );
+ }
+ });
+ }
+
+ return returnValue;
+ };
+};
+
+$.Widget = function( /* options, element */ ) {};
+$.Widget._childConstructors = [];
+
+$.Widget.prototype = {
+ widgetName: "widget",
+ widgetEventPrefix: "",
+ defaultElement: "<div>",
+ options: {
+ disabled: false,
+
+ // callbacks
+ create: null
+ },
+ _createWidget: function( options, element ) {
+ element = $( element || this.defaultElement || this )[ 0 ];
+ this.element = $( element );
+ this.uuid = uuid++;
+ this.eventNamespace = "." + this.widgetName + this.uuid;
+ this.options = $.widget.extend( {},
+ this.options,
+ this._getCreateOptions(),
+ options );
+
+ this.bindings = $();
+ this.hoverable = $();
+ this.focusable = $();
+
+ if ( element !== this ) {
+ $.data( element, this.widgetFullName, this );
+ this._on( true, this.element, {
+ remove: function( event ) {
+ if ( event.target === element ) {
+ this.destroy();
+ }
+ }
+ });
+ this.document = $( element.style ?
+ // element within the document
+ element.ownerDocument :
+ // element is window or document
+ element.document || element );
+ this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
+ }
+
+ this._create();
+ this._trigger( "create", null, this._getCreateEventData() );
+ this._init();
+ },
+ _getCreateOptions: $.noop,
+ _getCreateEventData: $.noop,
+ _create: $.noop,
+ _init: $.noop,
+
+ destroy: function() {
+ this._destroy();
+ // we can probably remove the unbind calls in 2.0
+ // all event bindings should go through this._on()
+ this.element
+ .unbind( this.eventNamespace )
+ // 1.9 BC for #7810
+ // TODO remove dual storage
+ .removeData( this.widgetName )
+ .removeData( this.widgetFullName )
+ // support: jquery <1.6.3
+ // http://bugs.jquery.com/ticket/9413
+ .removeData( $.camelCase( this.widgetFullName ) );
+ this.widget()
+ .unbind( this.eventNamespace )
+ .removeAttr( "aria-disabled" )
+ .removeClass(
+ this.widgetFullName + "-disabled " +
+ "ui-state-disabled" );
+
+ // clean up events and states
+ this.bindings.unbind( this.eventNamespace );
+ this.hoverable.removeClass( "ui-state-hover" );
+ this.focusable.removeClass( "ui-state-focus" );
+ },
+ _destroy: $.noop,
+
+ widget: function() {
+ return this.element;
+ },
+
+ option: function( key, value ) {
+ var options = key,
+ parts,
+ curOption,
+ i;
+
+ if ( arguments.length === 0 ) {
+ // don't return a reference to the internal hash
+ return $.widget.extend( {}, this.options );
+ }
+
+ if ( typeof key === "string" ) {
+ // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
+ options = {};
+ parts = key.split( "." );
+ key = parts.shift();
+ if ( parts.length ) {
+ curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
+ for ( i = 0; i < parts.length - 1; i++ ) {
+ curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
+ curOption = curOption[ parts[ i ] ];
+ }
+ key = parts.pop();
+ if ( arguments.length === 1 ) {
+ return curOption[ key ] === undefined ? null : curOption[ key ];
+ }
+ curOption[ key ] = value;
+ } else {
+ if ( arguments.length === 1 ) {
+ return this.options[ key ] === undefined ? null : this.options[ key ];
+ }
+ options[ key ] = value;
+ }
+ }
+
+ this._setOptions( options );
+
+ return this;
+ },
+ _setOptions: function( options ) {
+ var key;
+
+ for ( key in options ) {
+ this._setOption( key, options[ key ] );
+ }
+
+ return this;
+ },
+ _setOption: function( key, value ) {
+ this.options[ key ] = value;
+
+ if ( key === "disabled" ) {
+ this.widget()
+ .toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value )
+ .attr( "aria-disabled", value );
+ this.hoverable.removeClass( "ui-state-hover" );
+ this.focusable.removeClass( "ui-state-focus" );
+ }
+
+ return this;
+ },
+
+ enable: function() {
+ return this._setOption( "disabled", false );
+ },
+ disable: function() {
+ return this._setOption( "disabled", true );
+ },
+
+ _on: function( suppressDisabledCheck, element, handlers ) {
+ var delegateElement,
+ instance = this;
+
+ // no suppressDisabledCheck flag, shuffle arguments
+ if ( typeof suppressDisabledCheck !== "boolean" ) {
+ handlers = element;
+ element = suppressDisabledCheck;
+ suppressDisabledCheck = false;
+ }
+
+ // no element argument, shuffle and use this.element
+ if ( !handlers ) {
+ handlers = element;
+ element = this.element;
+ delegateElement = this.widget();
+ } else {
+ // accept selectors, DOM elements
+ element = delegateElement = $( element );
+ this.bindings = this.bindings.add( element );
+ }
+
+ $.each( handlers, function( event, handler ) {
+ function handlerProxy() {
+ // allow widgets to customize the disabled handling
+ // - disabled as an array instead of boolean
+ // - disabled class as method for disabling individual parts
+ if ( !suppressDisabledCheck &&
+ ( instance.options.disabled === true ||
+ $( this ).hasClass( "ui-state-disabled" ) ) ) {
+ return;
+ }
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
+ .apply( instance, arguments );
+ }
+
+ // copy the guid so direct unbinding works
+ if ( typeof handler !== "string" ) {
+ handlerProxy.guid = handler.guid =
+ handler.guid || handlerProxy.guid || $.guid++;
+ }
+
+ var match = event.match( /^(\w+)\s*(.*)$/ ),
+ eventName = match[1] + instance.eventNamespace,
+ selector = match[2];
+ if ( selector ) {
+ delegateElement.delegate( selector, eventName, handlerProxy );
+ } else {
+ element.bind( eventName, handlerProxy );
+ }
+ });
+ },
+
+ _off: function( element, eventName ) {
+ eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;
+ element.unbind( eventName ).undelegate( eventName );
+ },
+
+ _delay: function( handler, delay ) {
+ function handlerProxy() {
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
+ .apply( instance, arguments );
+ }
+ var instance = this;
+ return setTimeout( handlerProxy, delay || 0 );
+ },
+
+ _hoverable: function( element ) {
+ this.hoverable = this.hoverable.add( element );
+ this._on( element, {
+ mouseenter: function( event ) {
+ $( event.currentTarget ).addClass( "ui-state-hover" );
+ },
+ mouseleave: function( event ) {
+ $( event.currentTarget ).removeClass( "ui-state-hover" );
+ }
+ });
+ },
+
+ _focusable: function( element ) {
+ this.focusable = this.focusable.add( element );
+ this._on( element, {
+ focusin: function( event ) {
+ $( event.currentTarget ).addClass( "ui-state-focus" );
+ },
+ focusout: function( event ) {
+ $( event.currentTarget ).removeClass( "ui-state-focus" );
+ }
+ });
+ },
+
+ _trigger: function( type, event, data ) {
+ var prop, orig,
+ callback = this.options[ type ];
+
+ data = data || {};
+ event = $.Event( event );
+ event.type = ( type === this.widgetEventPrefix ?
+ type :
+ this.widgetEventPrefix + type ).toLowerCase();
+ // the original event may come from any element
+ // so we need to reset the target on the new event
+ event.target = this.element[ 0 ];
+
+ // copy original event properties over to the new event
+ orig = event.originalEvent;
+ if ( orig ) {
+ for ( prop in orig ) {
+ if ( !( prop in event ) ) {
+ event[ prop ] = orig[ prop ];
+ }
+ }
+ }
+
+ this.element.trigger( event, data );
+ return !( $.isFunction( callback ) &&
+ callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
+ event.isDefaultPrevented() );
+ }
+};
+
+$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
+ $.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
+ if ( typeof options === "string" ) {
+ options = { effect: options };
+ }
+ var hasOptions,
+ effectName = !options ?
+ method :
+ options === true || typeof options === "number" ?
+ defaultEffect :
+ options.effect || defaultEffect;
+ options = options || {};
+ if ( typeof options === "number" ) {
+ options = { duration: options };
+ }
+ hasOptions = !$.isEmptyObject( options );
+ options.complete = callback;
+ if ( options.delay ) {
+ element.delay( options.delay );
+ }
+ if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
+ element[ method ]( options );
+ } else if ( effectName !== method && element[ effectName ] ) {
+ element[ effectName ]( options.duration, options.easing, callback );
+ } else {
+ element.queue(function( next ) {
+ $( this )[ method ]();
+ if ( callback ) {
+ callback.call( element[ 0 ] );
+ }
+ next();
+ });
+ }
+ };
+});
+
+})( jQuery );
+
+(function( $, undefined ) {
+
+var mouseHandled = false;
+$( document ).mouseup( function() {
+ mouseHandled = false;
+});
+
+$.widget("ui.mouse", {
+ version: "1.10.4",
+ options: {
+ cancel: "input,textarea,button,select,option",
+ distance: 1,
+ delay: 0
+ },
+ _mouseInit: function() {
+ var that = this;
+
+ this.element
+ .bind("mousedown."+this.widgetName, function(event) {
+ return that._mouseDown(event);
+ })
+ .bind("click."+this.widgetName, function(event) {
+ if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) {
+ $.removeData(event.target, that.widgetName + ".preventClickEvent");
+ event.stopImmediatePropagation();
+ return false;
+ }
+ });
+
+ this.started = false;
+ },
+
+ // TODO: make sure destroying one instance of mouse doesn't mess with
+ // other instances of mouse
+ _mouseDestroy: function() {
+ this.element.unbind("."+this.widgetName);
+ if ( this._mouseMoveDelegate ) {
+ $(document)
+ .unbind("mousemove."+this.widgetName, this._mouseMoveDelegate)
+ .unbind("mouseup."+this.widgetName, this._mouseUpDelegate);
+ }
+ },
+
+ _mouseDown: function(event) {
+ // don't let more than one widget handle mouseStart
+ if( mouseHandled ) { return; }
+
+ // we may have missed mouseup (out of window)
+ (this._mouseStarted && this._mouseUp(event));
+
+ this._mouseDownEvent = event;
+
+ var that = this,
+ btnIsLeft = (event.which === 1),
+ // event.target.nodeName works around a bug in IE 8 with
+ // disabled inputs (#7620)
+ elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
+ if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
+ return true;
+ }
+
+ this.mouseDelayMet = !this.options.delay;
+ if (!this.mouseDelayMet) {
+ this._mouseDelayTimer = setTimeout(function() {
+ that.mouseDelayMet = true;
+ }, this.options.delay);
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted = (this._mouseStart(event) !== false);
+ if (!this._mouseStarted) {
+ event.preventDefault();
+ return true;
+ }
+ }
+
+ // Click event may never have fired (Gecko & Opera)
+ if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) {
+ $.removeData(event.target, this.widgetName + ".preventClickEvent");
+ }
+
+ // these delegates are required to keep context
+ this._mouseMoveDelegate = function(event) {
+ return that._mouseMove(event);
+ };
+ this._mouseUpDelegate = function(event) {
+ return that._mouseUp(event);
+ };
+ $(document)
+ .bind("mousemove."+this.widgetName, this._mouseMoveDelegate)
+ .bind("mouseup."+this.widgetName, this._mouseUpDelegate);
+
+ event.preventDefault();
+
+ mouseHandled = true;
+ return true;
+ },
+
+ _mouseMove: function(event) {
+ // IE mouseup check - mouseup happened when mouse was out of window
+ if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) {
+ return this._mouseUp(event);
+ }
+
+ if (this._mouseStarted) {
+ this._mouseDrag(event);
+ return event.preventDefault();
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted =
+ (this._mouseStart(this._mouseDownEvent, event) !== false);
+ (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
+ }
+
+ return !this._mouseStarted;
+ },
+
+ _mouseUp: function(event) {
+ $(document)
+ .unbind("mousemove."+this.widgetName, this._mouseMoveDelegate)
+ .unbind("mouseup."+this.widgetName, this._mouseUpDelegate);
+
+ if (this._mouseStarted) {
+ this._mouseStarted = false;
+
+ if (event.target === this._mouseDownEvent.target) {
+ $.data(event.target, this.widgetName + ".preventClickEvent", true);
+ }
+
+ this._mouseStop(event);
+ }
+
+ return false;
+ },
+
+ _mouseDistanceMet: function(event) {
+ return (Math.max(
+ Math.abs(this._mouseDownEvent.pageX - event.pageX),
+ Math.abs(this._mouseDownEvent.pageY - event.pageY)
+ ) >= this.options.distance
+ );
+ },
+
+ _mouseDelayMet: function(/* event */) {
+ return this.mouseDelayMet;
+ },
+
+ // These are placeholder methods, to be overriden by extending plugin
+ _mouseStart: function(/* event */) {},
+ _mouseDrag: function(/* event */) {},
+ _mouseStop: function(/* event */) {},
+ _mouseCapture: function(/* event */) { return true; }
+});
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+$.widget("ui.draggable", $.ui.mouse, {
+ version: "1.10.4",
+ widgetEventPrefix: "drag",
+ options: {
+ addClasses: true,
+ appendTo: "parent",
+ axis: false,
+ connectToSortable: false,
+ containment: false,
+ cursor: "auto",
+ cursorAt: false,
+ grid: false,
+ handle: false,
+ helper: "original",
+ iframeFix: false,
+ opacity: false,
+ refreshPositions: false,
+ revert: false,
+ revertDuration: 500,
+ scope: "default",
+ scroll: true,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ snap: false,
+ snapMode: "both",
+ snapTolerance: 20,
+ stack: false,
+ zIndex: false,
+
+ // callbacks
+ drag: null,
+ start: null,
+ stop: null
+ },
+ _create: function() {
+
+ if (this.options.helper === "original" && !(/^(?:r|a|f)/).test(this.element.css("position"))) {
+ this.element[0].style.position = "relative";
+ }
+ if (this.options.addClasses){
+ this.element.addClass("ui-draggable");
+ }
+ if (this.options.disabled){
+ this.element.addClass("ui-draggable-disabled");
+ }
+
+ this._mouseInit();
+
+ },
+
+ _destroy: function() {
+ this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" );
+ this._mouseDestroy();
+ },
+
+ _mouseCapture: function(event) {
+
+ var o = this.options;
+
+ // among others, prevent a drag on a resizable-handle
+ if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
+ return false;
+ }
+
+ //Quit if we're not on a valid handle
+ this.handle = this._getHandle(event);
+ if (!this.handle) {
+ return false;
+ }
+
+ $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
+ $("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>")
+ .css({
+ width: this.offsetWidth+"px", height: this.offsetHeight+"px",
+ position: "absolute", opacity: "0.001", zIndex: 1000
+ })
+ .css($(this).offset())
+ .appendTo("body");
+ });
+
+ return true;
+
+ },
+
+ _mouseStart: function(event) {
+
+ var o = this.options;
+
+ //Create and append the visible helper
+ this.helper = this._createHelper(event);
+
+ this.helper.addClass("ui-draggable-dragging");
+
+ //Cache the helper size
+ this._cacheHelperProportions();
+
+ //If ddmanager is used for droppables, set the global draggable
+ if($.ui.ddmanager) {
+ $.ui.ddmanager.current = this;
+ }
+
+ /*
+ * - Position generation -
+ * This block generates everything position related - it's the core of draggables.
+ */
+
+ //Cache the margins of the original element
+ this._cacheMargins();
+
+ //Store the helper's css position
+ this.cssPosition = this.helper.css( "position" );
+ this.scrollParent = this.helper.scrollParent();
+ this.offsetParent = this.helper.offsetParent();
+ this.offsetParentCssPosition = this.offsetParent.css( "position" );
+
+ //The element's absolute position on the page minus margins
+ this.offset = this.positionAbs = this.element.offset();
+ this.offset = {
+ top: this.offset.top - this.margins.top,
+ left: this.offset.left - this.margins.left
+ };
+
+ //Reset scroll cache
+ this.offset.scroll = false;
+
+ $.extend(this.offset, {
+ click: { //Where the click happened, relative to the element
+ left: event.pageX - this.offset.left,
+ top: event.pageY - this.offset.top
+ },
+ parent: this._getParentOffset(),
+ relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
+ });
+
+ //Generate the original position
+ this.originalPosition = this.position = this._generatePosition(event);
+ this.originalPageX = event.pageX;
+ this.originalPageY = event.pageY;
+
+ //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
+ (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
+
+ //Set a containment if given in the options
+ this._setContainment();
+
+ //Trigger event + callbacks
+ if(this._trigger("start", event) === false) {
+ this._clear();
+ return false;
+ }
+
+ //Recache the helper size
+ this._cacheHelperProportions();
+
+ //Prepare the droppable offsets
+ if ($.ui.ddmanager && !o.dropBehaviour) {
+ $.ui.ddmanager.prepareOffsets(this, event);
+ }
+
+
+ this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
+
+ //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
+ if ( $.ui.ddmanager ) {
+ $.ui.ddmanager.dragStart(this, event);
+ }
+
+ return true;
+ },
+
+ _mouseDrag: function(event, noPropagation) {
+ // reset any necessary cached properties (see #5009)
+ if ( this.offsetParentCssPosition === "fixed" ) {
+ this.offset.parent = this._getParentOffset();
+ }
+
+ //Compute the helpers position
+ this.position = this._generatePosition(event);
+ this.positionAbs = this._convertPositionTo("absolute");
+
+ //Call plugins and callbacks and use the resulting position if something is returned
+ if (!noPropagation) {
+ var ui = this._uiHash();
+ if(this._trigger("drag", event, ui) === false) {
+ this._mouseUp({});
+ return false;
+ }
+ this.position = ui.position;
+ }
+
+ if(!this.options.axis || this.options.axis !== "y") {
+ this.helper[0].style.left = this.position.left+"px";
+ }
+ if(!this.options.axis || this.options.axis !== "x") {
+ this.helper[0].style.top = this.position.top+"px";
+ }
+ if($.ui.ddmanager) {
+ $.ui.ddmanager.drag(this, event);
+ }
+
+ return false;
+ },
+
+ _mouseStop: function(event) {
+
+ //If we are using droppables, inform the manager about the drop
+ var that = this,
+ dropped = false;
+ if ($.ui.ddmanager && !this.options.dropBehaviour) {
+ dropped = $.ui.ddmanager.drop(this, event);
+ }
+
+ //if a drop comes from outside (a sortable)
+ if(this.dropped) {
+ dropped = this.dropped;
+ this.dropped = false;
+ }
+
+ //if the original element is no longer in the DOM don't bother to continue (see #8269)
+ if ( this.options.helper === "original" && !$.contains( this.element[ 0 ].ownerDocument, this.element[ 0 ] ) ) {
+ return false;
+ }
+
+ if((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
+ $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
+ if(that._trigger("stop", event) !== false) {
+ that._clear();
+ }
+ });
+ } else {
+ if(this._trigger("stop", event) !== false) {
+ this._clear();
+ }
+ }
+
+ return false;
+ },
+
+ _mouseUp: function(event) {
+ //Remove frame helpers
+ $("div.ui-draggable-iframeFix").each(function() {
+ this.parentNode.removeChild(this);
+ });
+
+ //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
+ if( $.ui.ddmanager ) {
+ $.ui.ddmanager.dragStop(this, event);
+ }
+
+ return $.ui.mouse.prototype._mouseUp.call(this, event);
+ },
+
+ cancel: function() {
+
+ if(this.helper.is(".ui-draggable-dragging")) {
+ this._mouseUp({});
+ } else {
+ this._clear();
+ }
+
+ return this;
+
+ },
+
+ _getHandle: function(event) {
+ return this.options.handle ?
+ !!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
+ true;
+ },
+
+ _createHelper: function(event) {
+
+ var o = this.options,
+ helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper === "clone" ? this.element.clone().removeAttr("id") : this.element);
+
+ if(!helper.parents("body").length) {
+ helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));
+ }
+
+ if(helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) {
+ helper.css("position", "absolute");
+ }
+
+ return helper;
+
+ },
+
+ _adjustOffsetFromHelper: function(obj) {
+ if (typeof obj === "string") {
+ obj = obj.split(" ");
+ }
+ if ($.isArray(obj)) {
+ obj = {left: +obj[0], top: +obj[1] || 0};
+ }
+ if ("left" in obj) {
+ this.offset.click.left = obj.left + this.margins.left;
+ }
+ if ("right" in obj) {
+ this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
+ }
+ if ("top" in obj) {
+ this.offset.click.top = obj.top + this.margins.top;
+ }
+ if ("bottom" in obj) {
+ this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
+ }
+ },
+
+ _getParentOffset: function() {
+
+ //Get the offsetParent and cache its position
+ var po = this.offsetParent.offset();
+
+ // This is a special case where we need to modify a offset calculated on start, since the following happened:
+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
+ if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
+ po.left += this.scrollParent.scrollLeft();
+ po.top += this.scrollParent.scrollTop();
+ }
+
+ //This needs to be actually done for all browsers, since pageX/pageY includes this information
+ //Ugly IE fix
+ if((this.offsetParent[0] === document.body) ||
+ (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
+ po = { top: 0, left: 0 };
+ }
+
+ return {
+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
+ };
+
+ },
+
+ _getRelativeOffset: function() {
+
+ if(this.cssPosition === "relative") {
+ var p = this.element.position();
+ return {
+ top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
+ left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
+ };
+ } else {
+ return { top: 0, left: 0 };
+ }
+
+ },
+
+ _cacheMargins: function() {
+ this.margins = {
+ left: (parseInt(this.element.css("marginLeft"),10) || 0),
+ top: (parseInt(this.element.css("marginTop"),10) || 0),
+ right: (parseInt(this.element.css("marginRight"),10) || 0),
+ bottom: (parseInt(this.element.css("marginBottom"),10) || 0)
+ };
+ },
+
+ _cacheHelperProportions: function() {
+ this.helperProportions = {
+ width: this.helper.outerWidth(),
+ height: this.helper.outerHeight()
+ };
+ },
+
+ _setContainment: function() {
+
+ var over, c, ce,
+ o = this.options;
+
+ if ( !o.containment ) {
+ this.containment = null;
+ return;
+ }
+
+ if ( o.containment === "window" ) {
+ this.containment = [
+ $( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
+ $( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
+ $( window ).scrollLeft() + $( window ).width() - this.helperProportions.width - this.margins.left,
+ $( window ).scrollTop() + ( $( window ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
+ ];
+ return;
+ }
+
+ if ( o.containment === "document") {
+ this.containment = [
+ 0,
+ 0,
+ $( document ).width() - this.helperProportions.width - this.margins.left,
+ ( $( document ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
+ ];
+ return;
+ }
+
+ if ( o.containment.constructor === Array ) {
+ this.containment = o.containment;
+ return;
+ }
+
+ if ( o.containment === "parent" ) {
+ o.containment = this.helper[ 0 ].parentNode;
+ }
+
+ c = $( o.containment );
+ ce = c[ 0 ];
+
+ if( !ce ) {
+ return;
+ }
+
+ over = c.css( "overflow" ) !== "hidden";
+
+ this.containment = [
+ ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
+ ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ) ,
+ ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) - ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) - this.helperProportions.width - this.margins.left - this.margins.right,
+ ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) - ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) - this.helperProportions.height - this.margins.top - this.margins.bottom
+ ];
+ this.relative_container = c;
+ },
+
+ _convertPositionTo: function(d, pos) {
+
+ if(!pos) {
+ pos = this.position;
+ }
+
+ var mod = d === "absolute" ? 1 : -1,
+ scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent;
+
+ //Cache the scroll
+ if (!this.offset.scroll) {
+ this.offset.scroll = {top : scroll.scrollTop(), left : scroll.scrollLeft()};
+ }
+
+ return {
+ top: (
+ pos.top + // The absolute mouse position
+ this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border)
+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : this.offset.scroll.top ) * mod )
+ ),
+ left: (
+ pos.left + // The absolute mouse position
+ this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border)
+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : this.offset.scroll.left ) * mod )
+ )
+ };
+
+ },
+
+ _generatePosition: function(event) {
+
+ var containment, co, top, left,
+ o = this.options,
+ scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent,
+ pageX = event.pageX,
+ pageY = event.pageY;
+
+ //Cache the scroll
+ if (!this.offset.scroll) {
+ this.offset.scroll = {top : scroll.scrollTop(), left : scroll.scrollLeft()};
+ }
+
+ /*
+ * - Position constraining -
+ * Constrain the position to a mix of grid, containment.
+ */
+
+ // If we are not dragging yet, we won't check for options
+ if ( this.originalPosition ) {
+ if ( this.containment ) {
+ if ( this.relative_container ){
+ co = this.relative_container.offset();
+ containment = [
+ this.containment[ 0 ] + co.left,
+ this.containment[ 1 ] + co.top,
+ this.containment[ 2 ] + co.left,
+ this.containment[ 3 ] + co.top
+ ];
+ }
+ else {
+ containment = this.containment;
+ }
+
+ if(event.pageX - this.offset.click.left < containment[0]) {
+ pageX = containment[0] + this.offset.click.left;
+ }
+ if(event.pageY - this.offset.click.top < containment[1]) {
+ pageY = containment[1] + this.offset.click.top;
+ }
+ if(event.pageX - this.offset.click.left > containment[2]) {
+ pageX = containment[2] + this.offset.click.left;
+ }
+ if(event.pageY - this.offset.click.top > containment[3]) {
+ pageY = containment[3] + this.offset.click.top;
+ }
+ }
+
+ if(o.grid) {
+ //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
+ top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
+ pageY = containment ? ((top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3]) ? top : ((top - this.offset.click.top >= containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
+
+ left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
+ pageX = containment ? ((left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2]) ? left : ((left - this.offset.click.left >= containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
+ }
+
+ }
+
+ return {
+ top: (
+ pageY - // The absolute mouse position
+ this.offset.click.top - // Click offset (relative to the element)
+ this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.top + // The offsetParent's offset without borders (offset + border)
+ ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : this.offset.scroll.top )
+ ),
+ left: (
+ pageX - // The absolute mouse position
+ this.offset.click.left - // Click offset (relative to the element)
+ this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.left + // The offsetParent's offset without borders (offset + border)
+ ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : this.offset.scroll.left )
+ )
+ };
+
+ },
+
+ _clear: function() {
+ this.helper.removeClass("ui-draggable-dragging");
+ if(this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
+ this.helper.remove();
+ }
+ this.helper = null;
+ this.cancelHelperRemoval = false;
+ },
+
+ // From now on bulk stuff - mainly helpers
+
+ _trigger: function(type, event, ui) {
+ ui = ui || this._uiHash();
+ $.ui.plugin.call(this, type, [event, ui]);
+ //The absolute position has to be recalculated after plugins
+ if(type === "drag") {
+ this.positionAbs = this._convertPositionTo("absolute");
+ }
+ return $.Widget.prototype._trigger.call(this, type, event, ui);
+ },
+
+ plugins: {},
+
+ _uiHash: function() {
+ return {
+ helper: this.helper,
+ position: this.position,
+ originalPosition: this.originalPosition,
+ offset: this.positionAbs
+ };
+ }
+
+});
+
+$.ui.plugin.add("draggable", "connectToSortable", {
+ start: function(event, ui) {
+
+ var inst = $(this).data("ui-draggable"), o = inst.options,
+ uiSortable = $.extend({}, ui, { item: inst.element });
+ inst.sortables = [];
+ $(o.connectToSortable).each(function() {
+ var sortable = $.data(this, "ui-sortable");
+ if (sortable && !sortable.options.disabled) {
+ inst.sortables.push({
+ instance: sortable,
+ shouldRevert: sortable.options.revert
+ });
+ sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page).
+ sortable._trigger("activate", event, uiSortable);
+ }
+ });
+
+ },
+ stop: function(event, ui) {
+
+ //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
+ var inst = $(this).data("ui-draggable"),
+ uiSortable = $.extend({}, ui, { item: inst.element });
+
+ $.each(inst.sortables, function() {
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+
+ inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
+ this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
+
+ //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: "valid/invalid"
+ if(this.shouldRevert) {
+ this.instance.options.revert = this.shouldRevert;
+ }
+
+ //Trigger the stop of the sortable
+ this.instance._mouseStop(event);
+
+ this.instance.options.helper = this.instance.options._helper;
+
+ //If the helper has been the original item, restore properties in the sortable
+ if(inst.options.helper === "original") {
+ this.instance.currentItem.css({ top: "auto", left: "auto" });
+ }
+
+ } else {
+ this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
+ this.instance._trigger("deactivate", event, uiSortable);
+ }
+
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("ui-draggable"), that = this;
+
+ $.each(inst.sortables, function() {
+
+ var innermostIntersecting = false,
+ thisSortable = this;
+
+ //Copy over some variables to allow calling the sortable's native _intersectsWith
+ this.instance.positionAbs = inst.positionAbs;
+ this.instance.helperProportions = inst.helperProportions;
+ this.instance.offset.click = inst.offset.click;
+
+ if(this.instance._intersectsWith(this.instance.containerCache)) {
+ innermostIntersecting = true;
+ $.each(inst.sortables, function () {
+ this.instance.positionAbs = inst.positionAbs;
+ this.instance.helperProportions = inst.helperProportions;
+ this.instance.offset.click = inst.offset.click;
+ if (this !== thisSortable &&
+ this.instance._intersectsWith(this.instance.containerCache) &&
+ $.contains(thisSortable.instance.element[0], this.instance.element[0])
+ ) {
+ innermostIntersecting = false;
+ }
+ return innermostIntersecting;
+ });
+ }
+
+
+ if(innermostIntersecting) {
+ //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
+ if(!this.instance.isOver) {
+
+ this.instance.isOver = 1;
+ //Now we fake the start of dragging for the sortable instance,
+ //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
+ //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
+ this.instance.currentItem = $(that).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item", true);
+ this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
+ this.instance.options.helper = function() { return ui.helper[0]; };
+
+ event.target = this.instance.currentItem[0];
+ this.instance._mouseCapture(event, true);
+ this.instance._mouseStart(event, true, true);
+
+ //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
+ this.instance.offset.click.top = inst.offset.click.top;
+ this.instance.offset.click.left = inst.offset.click.left;
+ this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
+ this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
+
+ inst._trigger("toSortable", event);
+ inst.dropped = this.instance.element; //draggable revert needs that
+ //hack so receive/update callbacks work (mostly)
+ inst.currentItem = inst.element;
+ this.instance.fromOutside = inst;
+
+ }
+
+ //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
+ if(this.instance.currentItem) {
+ this.instance._mouseDrag(event);
+ }
+
+ } else {
+
+ //If it doesn't intersect with the sortable, and it intersected before,
+ //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+ this.instance.cancelHelperRemoval = true;
+
+ //Prevent reverting on this forced stop
+ this.instance.options.revert = false;
+
+ // The out event needs to be triggered independently
+ this.instance._trigger("out", event, this.instance._uiHash(this.instance));
+
+ this.instance._mouseStop(event, true);
+ this.instance.options.helper = this.instance.options._helper;
+
+ //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
+ this.instance.currentItem.remove();
+ if(this.instance.placeholder) {
+ this.instance.placeholder.remove();
+ }
+
+ inst._trigger("fromSortable", event);
+ inst.dropped = false; //draggable revert needs that
+ }
+
+ }
+
+ });
+
+ }
+});
+
+$.ui.plugin.add("draggable", "cursor", {
+ start: function() {
+ var t = $("body"), o = $(this).data("ui-draggable").options;
+ if (t.css("cursor")) {
+ o._cursor = t.css("cursor");
+ }
+ t.css("cursor", o.cursor);
+ },
+ stop: function() {
+ var o = $(this).data("ui-draggable").options;
+ if (o._cursor) {
+ $("body").css("cursor", o._cursor);
+ }
+ }
+});
+
+$.ui.plugin.add("draggable", "opacity", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data("ui-draggable").options;
+ if(t.css("opacity")) {
+ o._opacity = t.css("opacity");
+ }
+ t.css("opacity", o.opacity);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data("ui-draggable").options;
+ if(o._opacity) {
+ $(ui.helper).css("opacity", o._opacity);
+ }
+ }
+});
+
+$.ui.plugin.add("draggable", "scroll", {
+ start: function() {
+ var i = $(this).data("ui-draggable");
+ if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") {
+ i.overflowOffset = i.scrollParent.offset();
+ }
+ },
+ drag: function( event ) {
+
+ var i = $(this).data("ui-draggable"), o = i.options, scrolled = false;
+
+ if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") {
+
+ if(!o.axis || o.axis !== "x") {
+ if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
+ } else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) {
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
+ }
+ }
+
+ if(!o.axis || o.axis !== "y") {
+ if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
+ } else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) {
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
+ }
+ }
+
+ } else {
+
+ if(!o.axis || o.axis !== "x") {
+ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
+ } else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
+ }
+ }
+
+ if(!o.axis || o.axis !== "y") {
+ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
+ } else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
+ }
+ }
+
+ }
+
+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
+ $.ui.ddmanager.prepareOffsets(i, event);
+ }
+
+ }
+});
+
+$.ui.plugin.add("draggable", "snap", {
+ start: function() {
+
+ var i = $(this).data("ui-draggable"),
+ o = i.options;
+
+ i.snapElements = [];
+
+ $(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() {
+ var $t = $(this),
+ $o = $t.offset();
+ if(this !== i.element[0]) {
+ i.snapElements.push({
+ item: this,
+ width: $t.outerWidth(), height: $t.outerHeight(),
+ top: $o.top, left: $o.left
+ });
+ }
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var ts, bs, ls, rs, l, r, t, b, i, first,
+ inst = $(this).data("ui-draggable"),
+ o = inst.options,
+ d = o.snapTolerance,
+ x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
+ y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
+
+ for (i = inst.snapElements.length - 1; i >= 0; i--){
+
+ l = inst.snapElements[i].left;
+ r = l + inst.snapElements[i].width;
+ t = inst.snapElements[i].top;
+ b = t + inst.snapElements[i].height;
+
+ if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) {
+ if(inst.snapElements[i].snapping) {
+ (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ }
+ inst.snapElements[i].snapping = false;
+ continue;
+ }
+
+ if(o.snapMode !== "inner") {
+ ts = Math.abs(t - y2) <= d;
+ bs = Math.abs(b - y1) <= d;
+ ls = Math.abs(l - x2) <= d;
+ rs = Math.abs(r - x1) <= d;
+ if(ts) {
+ ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+ }
+ if(bs) {
+ ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
+ }
+ if(ls) {
+ ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
+ }
+ if(rs) {
+ ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
+ }
+ }
+
+ first = (ts || bs || ls || rs);
+
+ if(o.snapMode !== "outer") {
+ ts = Math.abs(t - y1) <= d;
+ bs = Math.abs(b - y2) <= d;
+ ls = Math.abs(l - x1) <= d;
+ rs = Math.abs(r - x2) <= d;
+ if(ts) {
+ ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
+ }
+ if(bs) {
+ ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+ }
+ if(ls) {
+ ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
+ }
+ if(rs) {
+ ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
+ }
+ }
+
+ if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
+ (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ }
+ inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
+
+ }
+
+ }
+});
+
+$.ui.plugin.add("draggable", "stack", {
+ start: function() {
+ var min,
+ o = this.data("ui-draggable").options,
+ group = $.makeArray($(o.stack)).sort(function(a,b) {
+ return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0);
+ });
+
+ if (!group.length) { return; }
+
+ min = parseInt($(group[0]).css("zIndex"), 10) || 0;
+ $(group).each(function(i) {
+ $(this).css("zIndex", min + i);
+ });
+ this.css("zIndex", (min + group.length));
+ }
+});
+
+$.ui.plugin.add("draggable", "zIndex", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data("ui-draggable").options;
+ if(t.css("zIndex")) {
+ o._zIndex = t.css("zIndex");
+ }
+ t.css("zIndex", o.zIndex);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data("ui-draggable").options;
+ if(o._zIndex) {
+ $(ui.helper).css("zIndex", o._zIndex);
+ }
+ }
+});
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+function isOverAxis( x, reference, size ) {
+ return ( x > reference ) && ( x < ( reference + size ) );
+}
+
+$.widget("ui.droppable", {
+ version: "1.10.4",
+ widgetEventPrefix: "drop",
+ options: {
+ accept: "*",
+ activeClass: false,
+ addClasses: true,
+ greedy: false,
+ hoverClass: false,
+ scope: "default",
+ tolerance: "intersect",
+
+ // callbacks
+ activate: null,
+ deactivate: null,
+ drop: null,
+ out: null,
+ over: null
+ },
+ _create: function() {
+
+ var proportions,
+ o = this.options,
+ accept = o.accept;
+
+ this.isover = false;
+ this.isout = true;
+
+ this.accept = $.isFunction(accept) ? accept : function(d) {
+ return d.is(accept);
+ };
+
+ this.proportions = function( /* valueToWrite */ ) {
+ if ( arguments.length ) {
+ // Store the droppable's proportions
+ proportions = arguments[ 0 ];
+ } else {
+ // Retrieve or derive the droppable's proportions
+ return proportions ?
+ proportions :
+ proportions = {
+ width: this.element[ 0 ].offsetWidth,
+ height: this.element[ 0 ].offsetHeight
+ };
+ }
+ };
+
+ // Add the reference and positions to the manager
+ $.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || [];
+ $.ui.ddmanager.droppables[o.scope].push(this);
+
+ (o.addClasses && this.element.addClass("ui-droppable"));
+
+ },
+
+ _destroy: function() {
+ var i = 0,
+ drop = $.ui.ddmanager.droppables[this.options.scope];
+
+ for ( ; i < drop.length; i++ ) {
+ if ( drop[i] === this ) {
+ drop.splice(i, 1);
+ }
+ }
+
+ this.element.removeClass("ui-droppable ui-droppable-disabled");
+ },
+
+ _setOption: function(key, value) {
+
+ if(key === "accept") {
+ this.accept = $.isFunction(value) ? value : function(d) {
+ return d.is(value);
+ };
+ }
+ $.Widget.prototype._setOption.apply(this, arguments);
+ },
+
+ _activate: function(event) {
+ var draggable = $.ui.ddmanager.current;
+ if(this.options.activeClass) {
+ this.element.addClass(this.options.activeClass);
+ }
+ if(draggable){
+ this._trigger("activate", event, this.ui(draggable));
+ }
+ },
+
+ _deactivate: function(event) {
+ var draggable = $.ui.ddmanager.current;
+ if(this.options.activeClass) {
+ this.element.removeClass(this.options.activeClass);
+ }
+ if(draggable){
+ this._trigger("deactivate", event, this.ui(draggable));
+ }
+ },
+
+ _over: function(event) {
+
+ var draggable = $.ui.ddmanager.current;
+
+ // Bail if draggable and droppable are same element
+ if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {
+ return;
+ }
+
+ if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.hoverClass) {
+ this.element.addClass(this.options.hoverClass);
+ }
+ this._trigger("over", event, this.ui(draggable));
+ }
+
+ },
+
+ _out: function(event) {
+
+ var draggable = $.ui.ddmanager.current;
+
+ // Bail if draggable and droppable are same element
+ if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {
+ return;
+ }
+
+ if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.hoverClass) {
+ this.element.removeClass(this.options.hoverClass);
+ }
+ this._trigger("out", event, this.ui(draggable));
+ }
+
+ },
+
+ _drop: function(event,custom) {
+
+ var draggable = custom || $.ui.ddmanager.current,
+ childrenIntersection = false;
+
+ // Bail if draggable and droppable are same element
+ if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {
+ return false;
+ }
+
+ this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function() {
+ var inst = $.data(this, "ui-droppable");
+ if(
+ inst.options.greedy &&
+ !inst.options.disabled &&
+ inst.options.scope === draggable.options.scope &&
+ inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) &&
+ $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)
+ ) { childrenIntersection = true; return false; }
+ });
+ if(childrenIntersection) {
+ return false;
+ }
+
+ if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.activeClass) {
+ this.element.removeClass(this.options.activeClass);
+ }
+ if(this.options.hoverClass) {
+ this.element.removeClass(this.options.hoverClass);
+ }
+ this._trigger("drop", event, this.ui(draggable));
+ return this.element;
+ }
+
+ return false;
+
+ },
+
+ ui: function(c) {
+ return {
+ draggable: (c.currentItem || c.element),
+ helper: c.helper,
+ position: c.position,
+ offset: c.positionAbs
+ };
+ }
+
+});
+
+$.ui.intersect = function(draggable, droppable, toleranceMode) {
+
+ if (!droppable.offset) {
+ return false;
+ }
+
+ var draggableLeft, draggableTop,
+ x1 = (draggable.positionAbs || draggable.position.absolute).left,
+ y1 = (draggable.positionAbs || draggable.position.absolute).top,
+ x2 = x1 + draggable.helperProportions.width,
+ y2 = y1 + draggable.helperProportions.height,
+ l = droppable.offset.left,
+ t = droppable.offset.top,
+ r = l + droppable.proportions().width,
+ b = t + droppable.proportions().height;
+
+ switch (toleranceMode) {
+ case "fit":
+ return (l <= x1 && x2 <= r && t <= y1 && y2 <= b);
+ case "intersect":
+ return (l < x1 + (draggable.helperProportions.width / 2) && // Right Half
+ x2 - (draggable.helperProportions.width / 2) < r && // Left Half
+ t < y1 + (draggable.helperProportions.height / 2) && // Bottom Half
+ y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
+ case "pointer":
+ draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left);
+ draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top);
+ return isOverAxis( draggableTop, t, droppable.proportions().height ) && isOverAxis( draggableLeft, l, droppable.proportions().width );
+ case "touch":
+ return (
+ (y1 >= t && y1 <= b) || // Top edge touching
+ (y2 >= t && y2 <= b) || // Bottom edge touching
+ (y1 < t && y2 > b) // Surrounded vertically
+ ) && (
+ (x1 >= l && x1 <= r) || // Left edge touching
+ (x2 >= l && x2 <= r) || // Right edge touching
+ (x1 < l && x2 > r) // Surrounded horizontally
+ );
+ default:
+ return false;
+ }
+
+};
+
+/*
+ This manager tracks offsets of draggables and droppables
+*/
+$.ui.ddmanager = {
+ current: null,
+ droppables: { "default": [] },
+ prepareOffsets: function(t, event) {
+
+ var i, j,
+ m = $.ui.ddmanager.droppables[t.options.scope] || [],
+ type = event ? event.type : null, // workaround for #2317
+ list = (t.currentItem || t.element).find(":data(ui-droppable)").addBack();
+
+ droppablesLoop: for (i = 0; i < m.length; i++) {
+
+ //No disabled and non-accepted
+ if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) {
+ continue;
+ }
+
+ // Filter out elements in the current dragged item
+ for (j=0; j < list.length; j++) {
+ if(list[j] === m[i].element[0]) {
+ m[i].proportions().height = 0;
+ continue droppablesLoop;
+ }
+ }
+
+ m[i].visible = m[i].element.css("display") !== "none";
+ if(!m[i].visible) {
+ continue;
+ }
+
+ //Activate the droppable if used directly from draggables
+ if(type === "mousedown") {
+ m[i]._activate.call(m[i], event);
+ }
+
+ m[ i ].offset = m[ i ].element.offset();
+ m[ i ].proportions({ width: m[ i ].element[ 0 ].offsetWidth, height: m[ i ].element[ 0 ].offsetHeight });
+
+ }
+
+ },
+ drop: function(draggable, event) {
+
+ var dropped = false;
+ // Create a copy of the droppables in case the list changes during the drop (#9116)
+ $.each(($.ui.ddmanager.droppables[draggable.options.scope] || []).slice(), function() {
+
+ if(!this.options) {
+ return;
+ }
+ if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance)) {
+ dropped = this._drop.call(this, event) || dropped;
+ }
+
+ if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ this.isout = true;
+ this.isover = false;
+ this._deactivate.call(this, event);
+ }
+
+ });
+ return dropped;
+
+ },
+ dragStart: function( draggable, event ) {
+ //Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)
+ draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() {
+ if( !draggable.options.refreshPositions ) {
+ $.ui.ddmanager.prepareOffsets( draggable, event );
+ }
+ });
+ },
+ drag: function(draggable, event) {
+
+ //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
+ if(draggable.options.refreshPositions) {
+ $.ui.ddmanager.prepareOffsets(draggable, event);
+ }
+
+ //Run through all droppables and check their positions based on specific tolerance options
+ $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() {
+
+ if(this.options.disabled || this.greedyChild || !this.visible) {
+ return;
+ }
+
+ var parentInstance, scope, parent,
+ intersects = $.ui.intersect(draggable, this, this.options.tolerance),
+ c = !intersects && this.isover ? "isout" : (intersects && !this.isover ? "isover" : null);
+ if(!c) {
+ return;
+ }
+
+ if (this.options.greedy) {
+ // find droppable parents with same scope
+ scope = this.options.scope;
+ parent = this.element.parents(":data(ui-droppable)").filter(function () {
+ return $.data(this, "ui-droppable").options.scope === scope;
+ });
+
+ if (parent.length) {
+ parentInstance = $.data(parent[0], "ui-droppable");
+ parentInstance.greedyChild = (c === "isover");
+ }
+ }
+
+ // we just moved into a greedy child
+ if (parentInstance && c === "isover") {
+ parentInstance.isover = false;
+ parentInstance.isout = true;
+ parentInstance._out.call(parentInstance, event);
+ }
+
+ this[c] = true;
+ this[c === "isout" ? "isover" : "isout"] = false;
+ this[c === "isover" ? "_over" : "_out"].call(this, event);
+
+ // we just moved out of a greedy child
+ if (parentInstance && c === "isout") {
+ parentInstance.isout = false;
+ parentInstance.isover = true;
+ parentInstance._over.call(parentInstance, event);
+ }
+ });
+
+ },
+ dragStop: function( draggable, event ) {
+ draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" );
+ //Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)
+ if( !draggable.options.refreshPositions ) {
+ $.ui.ddmanager.prepareOffsets( draggable, event );
+ }
+ }
+};
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+function num(v) {
+ return parseInt(v, 10) || 0;
+}
+
+function isNumber(value) {
+ return !isNaN(parseInt(value, 10));
+}
+
+$.widget("ui.resizable", $.ui.mouse, {
+ version: "1.10.4",
+ widgetEventPrefix: "resize",
+ options: {
+ alsoResize: false,
+ animate: false,
+ animateDuration: "slow",
+ animateEasing: "swing",
+ aspectRatio: false,
+ autoHide: false,
+ containment: false,
+ ghost: false,
+ grid: false,
+ handles: "e,s,se",
+ helper: false,
+ maxHeight: null,
+ maxWidth: null,
+ minHeight: 10,
+ minWidth: 10,
+ // See #7960
+ zIndex: 90,
+
+ // callbacks
+ resize: null,
+ start: null,
+ stop: null
+ },
+ _create: function() {
+
+ var n, i, handle, axis, hname,
+ that = this,
+ o = this.options;
+ this.element.addClass("ui-resizable");
+
+ $.extend(this, {
+ _aspectRatio: !!(o.aspectRatio),
+ aspectRatio: o.aspectRatio,
+ originalElement: this.element,
+ _proportionallyResizeElements: [],
+ _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
+ });
+
+ //Wrap the element if it cannot hold child nodes
+ if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
+
+ //Create a wrapper element and set the wrapper to the new current internal element
+ this.element.wrap(
+ $("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
+ position: this.element.css("position"),
+ width: this.element.outerWidth(),
+ height: this.element.outerHeight(),
+ top: this.element.css("top"),
+ left: this.element.css("left")
+ })
+ );
+
+ //Overwrite the original this.element
+ this.element = this.element.parent().data(
+ "ui-resizable", this.element.data("ui-resizable")
+ );
+
+ this.elementIsWrapper = true;
+
+ //Move margins to the wrapper
+ this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") });
+ this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
+
+ //Prevent Safari textarea resize
+ this.originalResizeStyle = this.originalElement.css("resize");
+ this.originalElement.css("resize", "none");
+
+ //Push the actual element to our proportionallyResize internal array
+ this._proportionallyResizeElements.push(this.originalElement.css({ position: "static", zoom: 1, display: "block" }));
+
+ // avoid IE jump (hard set the margin)
+ this.originalElement.css({ margin: this.originalElement.css("margin") });
+
+ // fix handlers offset
+ this._proportionallyResize();
+
+ }
+
+ this.handles = o.handles || (!$(".ui-resizable-handle", this.element).length ? "e,s,se" : { n: ".ui-resizable-n", e: ".ui-resizable-e", s: ".ui-resizable-s", w: ".ui-resizable-w", se: ".ui-resizable-se", sw: ".ui-resizable-sw", ne: ".ui-resizable-ne", nw: ".ui-resizable-nw" });
+ if(this.handles.constructor === String) {
+
+ if ( this.handles === "all") {
+ this.handles = "n,e,s,w,se,sw,ne,nw";
+ }
+
+ n = this.handles.split(",");
+ this.handles = {};
+
+ for(i = 0; i < n.length; i++) {
+
+ handle = $.trim(n[i]);
+ hname = "ui-resizable-"+handle;
+ axis = $("<div class='ui-resizable-handle " + hname + "'></div>");
+
+ // Apply zIndex to all handles - see #7960
+ axis.css({ zIndex: o.zIndex });
+
+ //TODO : What's going on here?
+ if ("se" === handle) {
+ axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se");
+ }
+
+ //Insert into internal handles object and append to element
+ this.handles[handle] = ".ui-resizable-"+handle;
+ this.element.append(axis);
+ }
+
+ }
+
+ this._renderAxis = function(target) {
+
+ var i, axis, padPos, padWrapper;
+
+ target = target || this.element;
+
+ for(i in this.handles) {
+
+ if(this.handles[i].constructor === String) {
+ this.handles[i] = $(this.handles[i], this.element).show();
+ }
+
+ //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
+ if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
+
+ axis = $(this.handles[i], this.element);
+
+ //Checking the correct pad and border
+ padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
+
+ //The padding type i have to apply...
+ padPos = [ "padding",
+ /ne|nw|n/.test(i) ? "Top" :
+ /se|sw|s/.test(i) ? "Bottom" :
+ /^e$/.test(i) ? "Right" : "Left" ].join("");
+
+ target.css(padPos, padWrapper);
+
+ this._proportionallyResize();
+
+ }
+
+ //TODO: What's that good for? There's not anything to be executed left
+ if(!$(this.handles[i]).length) {
+ continue;
+ }
+ }
+ };
+
+ //TODO: make renderAxis a prototype function
+ this._renderAxis(this.element);
+
+ this._handles = $(".ui-resizable-handle", this.element)
+ .disableSelection();
+
+ //Matching axis name
+ this._handles.mouseover(function() {
+ if (!that.resizing) {
+ if (this.className) {
+ axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
+ }
+ //Axis, default = se
+ that.axis = axis && axis[1] ? axis[1] : "se";
+ }
+ });
+
+ //If we want to auto hide the elements
+ if (o.autoHide) {
+ this._handles.hide();
+ $(this.element)
+ .addClass("ui-resizable-autohide")
+ .mouseenter(function() {
+ if (o.disabled) {
+ return;
+ }
+ $(this).removeClass("ui-resizable-autohide");
+ that._handles.show();
+ })
+ .mouseleave(function(){
+ if (o.disabled) {
+ return;
+ }
+ if (!that.resizing) {
+ $(this).addClass("ui-resizable-autohide");
+ that._handles.hide();
+ }
+ });
+ }
+
+ //Initialize the mouse interaction
+ this._mouseInit();
+
+ },
+
+ _destroy: function() {
+
+ this._mouseDestroy();
+
+ var wrapper,
+ _destroy = function(exp) {
+ $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
+ .removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove();
+ };
+
+ //TODO: Unwrap at same DOM position
+ if (this.elementIsWrapper) {
+ _destroy(this.element);
+ wrapper = this.element;
+ this.originalElement.css({
+ position: wrapper.css("position"),
+ width: wrapper.outerWidth(),
+ height: wrapper.outerHeight(),
+ top: wrapper.css("top"),
+ left: wrapper.css("left")
+ }).insertAfter( wrapper );
+ wrapper.remove();
+ }
+
+ this.originalElement.css("resize", this.originalResizeStyle);
+ _destroy(this.originalElement);
+
+ return this;
+ },
+
+ _mouseCapture: function(event) {
+ var i, handle,
+ capture = false;
+
+ for (i in this.handles) {
+ handle = $(this.handles[i])[0];
+ if (handle === event.target || $.contains(handle, event.target)) {
+ capture = true;
+ }
+ }
+
+ return !this.options.disabled && capture;
+ },
+
+ _mouseStart: function(event) {
+
+ var curleft, curtop, cursor,
+ o = this.options,
+ iniPos = this.element.position(),
+ el = this.element;
+
+ this.resizing = true;
+
+ // bugfix for http://dev.jquery.com/ticket/1749
+ if ( (/absolute/).test( el.css("position") ) ) {
+ el.css({ position: "absolute", top: el.css("top"), left: el.css("left") });
+ } else if (el.is(".ui-draggable")) {
+ el.css({ position: "absolute", top: iniPos.top, left: iniPos.left });
+ }
+
+ this._renderProxy();
+
+ curleft = num(this.helper.css("left"));
+ curtop = num(this.helper.css("top"));
+
+ if (o.containment) {
+ curleft += $(o.containment).scrollLeft() || 0;
+ curtop += $(o.containment).scrollTop() || 0;
+ }
+
+ //Store needed variables
+ this.offset = this.helper.offset();
+ this.position = { left: curleft, top: curtop };
+ this.size = this._helper ? { width: this.helper.width(), height: this.helper.height() } : { width: el.width(), height: el.height() };
+ this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
+ this.originalPosition = { left: curleft, top: curtop };
+ this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
+ this.originalMousePosition = { left: event.pageX, top: event.pageY };
+
+ //Aspect Ratio
+ this.aspectRatio = (typeof o.aspectRatio === "number") ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);
+
+ cursor = $(".ui-resizable-" + this.axis).css("cursor");
+ $("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);
+
+ el.addClass("ui-resizable-resizing");
+ this._propagate("start", event);
+ return true;
+ },
+
+ _mouseDrag: function(event) {
+
+ //Increase performance, avoid regex
+ var data,
+ el = this.helper, props = {},
+ smp = this.originalMousePosition,
+ a = this.axis,
+ prevTop = this.position.top,
+ prevLeft = this.position.left,
+ prevWidth = this.size.width,
+ prevHeight = this.size.height,
+ dx = (event.pageX-smp.left)||0,
+ dy = (event.pageY-smp.top)||0,
+ trigger = this._change[a];
+
+ if (!trigger) {
+ return false;
+ }
+
+ // Calculate the attrs that will be change
+ data = trigger.apply(this, [event, dx, dy]);
+
+ // Put this in the mouseDrag handler since the user can start pressing shift while resizing
+ this._updateVirtualBoundaries(event.shiftKey);
+ if (this._aspectRatio || event.shiftKey) {
+ data = this._updateRatio(data, event);
+ }
+
+ data = this._respectSize(data, event);
+
+ this._updateCache(data);
+
+ // plugins callbacks need to be called first
+ this._propagate("resize", event);
+
+ if (this.position.top !== prevTop) {
+ props.top = this.position.top + "px";
+ }
+ if (this.position.left !== prevLeft) {
+ props.left = this.position.left + "px";
+ }
+ if (this.size.width !== prevWidth) {
+ props.width = this.size.width + "px";
+ }
+ if (this.size.height !== prevHeight) {
+ props.height = this.size.height + "px";
+ }
+ el.css(props);
+
+ if (!this._helper && this._proportionallyResizeElements.length) {
+ this._proportionallyResize();
+ }
+
+ // Call the user callback if the element was resized
+ if ( ! $.isEmptyObject(props) ) {
+ this._trigger("resize", event, this.ui());
+ }
+
+ return false;
+ },
+
+ _mouseStop: function(event) {
+
+ this.resizing = false;
+ var pr, ista, soffseth, soffsetw, s, left, top,
+ o = this.options, that = this;
+
+ if(this._helper) {
+
+ pr = this._proportionallyResizeElements;
+ ista = pr.length && (/textarea/i).test(pr[0].nodeName);
+ soffseth = ista && $.ui.hasScroll(pr[0], "left") /* TODO - jump height */ ? 0 : that.sizeDiff.height;
+ soffsetw = ista ? 0 : that.sizeDiff.width;
+
+ s = { width: (that.helper.width() - soffsetw), height: (that.helper.height() - soffseth) };
+ left = (parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left)) || null;
+ top = (parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top)) || null;
+
+ if (!o.animate) {
+ this.element.css($.extend(s, { top: top, left: left }));
+ }
+
+ that.helper.height(that.size.height);
+ that.helper.width(that.size.width);
+
+ if (this._helper && !o.animate) {
+ this._proportionallyResize();
+ }
+ }
+
+ $("body").css("cursor", "auto");
+
+ this.element.removeClass("ui-resizable-resizing");
+
+ this._propagate("stop", event);
+
+ if (this._helper) {
+ this.helper.remove();
+ }
+
+ return false;
+
+ },
+
+ _updateVirtualBoundaries: function(forceAspectRatio) {
+ var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
+ o = this.options;
+
+ b = {
+ minWidth: isNumber(o.minWidth) ? o.minWidth : 0,
+ maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity,
+ minHeight: isNumber(o.minHeight) ? o.minHeight : 0,
+ maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity
+ };
+
+ if(this._aspectRatio || forceAspectRatio) {
+ // We want to create an enclosing box whose aspect ration is the requested one
+ // First, compute the "projected" size for each dimension based on the aspect ratio and other dimension
+ pMinWidth = b.minHeight * this.aspectRatio;
+ pMinHeight = b.minWidth / this.aspectRatio;
+ pMaxWidth = b.maxHeight * this.aspectRatio;
+ pMaxHeight = b.maxWidth / this.aspectRatio;
+
+ if(pMinWidth > b.minWidth) {
+ b.minWidth = pMinWidth;
+ }
+ if(pMinHeight > b.minHeight) {
+ b.minHeight = pMinHeight;
+ }
+ if(pMaxWidth < b.maxWidth) {
+ b.maxWidth = pMaxWidth;
+ }
+ if(pMaxHeight < b.maxHeight) {
+ b.maxHeight = pMaxHeight;
+ }
+ }
+ this._vBoundaries = b;
+ },
+
+ _updateCache: function(data) {
+ this.offset = this.helper.offset();
+ if (isNumber(data.left)) {
+ this.position.left = data.left;
+ }
+ if (isNumber(data.top)) {
+ this.position.top = data.top;
+ }
+ if (isNumber(data.height)) {
+ this.size.height = data.height;
+ }
+ if (isNumber(data.width)) {
+ this.size.width = data.width;
+ }
+ },
+
+ _updateRatio: function( data ) {
+
+ var cpos = this.position,
+ csize = this.size,
+ a = this.axis;
+
+ if (isNumber(data.height)) {
+ data.width = (data.height * this.aspectRatio);
+ } else if (isNumber(data.width)) {
+ data.height = (data.width / this.aspectRatio);
+ }
+
+ if (a === "sw") {
+ data.left = cpos.left + (csize.width - data.width);
+ data.top = null;
+ }
+ if (a === "nw") {
+ data.top = cpos.top + (csize.height - data.height);
+ data.left = cpos.left + (csize.width - data.width);
+ }
+
+ return data;
+ },
+
+ _respectSize: function( data ) {
+
+ var o = this._vBoundaries,
+ a = this.axis,
+ ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
+ isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height),
+ dw = this.originalPosition.left + this.originalSize.width,
+ dh = this.position.top + this.size.height,
+ cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
+ if (isminw) {
+ data.width = o.minWidth;
+ }
+ if (isminh) {
+ data.height = o.minHeight;
+ }
+ if (ismaxw) {
+ data.width = o.maxWidth;
+ }
+ if (ismaxh) {
+ data.height = o.maxHeight;
+ }
+
+ if (isminw && cw) {
+ data.left = dw - o.minWidth;
+ }
+ if (ismaxw && cw) {
+ data.left = dw - o.maxWidth;
+ }
+ if (isminh && ch) {
+ data.top = dh - o.minHeight;
+ }
+ if (ismaxh && ch) {
+ data.top = dh - o.maxHeight;
+ }
+
+ // fixing jump error on top/left - bug #2330
+ if (!data.width && !data.height && !data.left && data.top) {
+ data.top = null;
+ } else if (!data.width && !data.height && !data.top && data.left) {
+ data.left = null;
+ }
+
+ return data;
+ },
+
+ _proportionallyResize: function() {
+
+ if (!this._proportionallyResizeElements.length) {
+ return;
+ }
+
+ var i, j, borders, paddings, prel,
+ element = this.helper || this.element;
+
+ for ( i=0; i < this._proportionallyResizeElements.length; i++) {
+
+ prel = this._proportionallyResizeElements[i];
+
+ if (!this.borderDif) {
+ this.borderDif = [];
+ borders = [prel.css("borderTopWidth"), prel.css("borderRightWidth"), prel.css("borderBottomWidth"), prel.css("borderLeftWidth")];
+ paddings = [prel.css("paddingTop"), prel.css("paddingRight"), prel.css("paddingBottom"), prel.css("paddingLeft")];
+
+ for ( j = 0; j < borders.length; j++ ) {
+ this.borderDif[ j ] = ( parseInt( borders[ j ], 10 ) || 0 ) + ( parseInt( paddings[ j ], 10 ) || 0 );
+ }
+ }
+
+ prel.css({
+ height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
+ width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
+ });
+
+ }
+
+ },
+
+ _renderProxy: function() {
+
+ var el = this.element, o = this.options;
+ this.elementOffset = el.offset();
+
+ if(this._helper) {
+
+ this.helper = this.helper || $("<div style='overflow:hidden;'></div>");
+
+ this.helper.addClass(this._helper).css({
+ width: this.element.outerWidth() - 1,
+ height: this.element.outerHeight() - 1,
+ position: "absolute",
+ left: this.elementOffset.left +"px",
+ top: this.elementOffset.top +"px",
+ zIndex: ++o.zIndex //TODO: Don't modify option
+ });
+
+ this.helper
+ .appendTo("body")
+ .disableSelection();
+
+ } else {
+ this.helper = this.element;
+ }
+
+ },
+
+ _change: {
+ e: function(event, dx) {
+ return { width: this.originalSize.width + dx };
+ },
+ w: function(event, dx) {
+ var cs = this.originalSize, sp = this.originalPosition;
+ return { left: sp.left + dx, width: cs.width - dx };
+ },
+ n: function(event, dx, dy) {
+ var cs = this.originalSize, sp = this.originalPosition;
+ return { top: sp.top + dy, height: cs.height - dy };
+ },
+ s: function(event, dx, dy) {
+ return { height: this.originalSize.height + dy };
+ },
+ se: function(event, dx, dy) {
+ return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
+ },
+ sw: function(event, dx, dy) {
+ return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
+ },
+ ne: function(event, dx, dy) {
+ return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
+ },
+ nw: function(event, dx, dy) {
+ return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
+ }
+ },
+
+ _propagate: function(n, event) {
+ $.ui.plugin.call(this, n, [event, this.ui()]);
+ (n !== "resize" && this._trigger(n, event, this.ui()));
+ },
+
+ plugins: {},
+
+ ui: function() {
+ return {
+ originalElement: this.originalElement,
+ element: this.element,
+ helper: this.helper,
+ position: this.position,
+ size: this.size,
+ originalSize: this.originalSize,
+ originalPosition: this.originalPosition
+ };
+ }
+
+});
+
+/*
+ * Resizable Extensions
+ */
+
+$.ui.plugin.add("resizable", "animate", {
+
+ stop: function( event ) {
+ var that = $(this).data("ui-resizable"),
+ o = that.options,
+ pr = that._proportionallyResizeElements,
+ ista = pr.length && (/textarea/i).test(pr[0].nodeName),
+ soffseth = ista && $.ui.hasScroll(pr[0], "left") /* TODO - jump height */ ? 0 : that.sizeDiff.height,
+ soffsetw = ista ? 0 : that.sizeDiff.width,
+ style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) },
+ left = (parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left)) || null,
+ top = (parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top)) || null;
+
+ that.element.animate(
+ $.extend(style, top && left ? { top: top, left: left } : {}), {
+ duration: o.animateDuration,
+ easing: o.animateEasing,
+ step: function() {
+
+ var data = {
+ width: parseInt(that.element.css("width"), 10),
+ height: parseInt(that.element.css("height"), 10),
+ top: parseInt(that.element.css("top"), 10),
+ left: parseInt(that.element.css("left"), 10)
+ };
+
+ if (pr && pr.length) {
+ $(pr[0]).css({ width: data.width, height: data.height });
+ }
+
+ // propagating resize, and updating values for each animation step
+ that._updateCache(data);
+ that._propagate("resize", event);
+
+ }
+ }
+ );
+ }
+
+});
+
+$.ui.plugin.add("resizable", "containment", {
+
+ start: function() {
+ var element, p, co, ch, cw, width, height,
+ that = $(this).data("ui-resizable"),
+ o = that.options,
+ el = that.element,
+ oc = o.containment,
+ ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
+
+ if (!ce) {
+ return;
+ }
+
+ that.containerElement = $(ce);
+
+ if (/document/.test(oc) || oc === document) {
+ that.containerOffset = { left: 0, top: 0 };
+ that.containerPosition = { left: 0, top: 0 };
+
+ that.parentData = {
+ element: $(document), left: 0, top: 0,
+ width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
+ };
+ }
+
+ // i'm a node, so compute top, left, right, bottom
+ else {
+ element = $(ce);
+ p = [];
+ $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); });
+
+ that.containerOffset = element.offset();
+ that.containerPosition = element.position();
+ that.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };
+
+ co = that.containerOffset;
+ ch = that.containerSize.height;
+ cw = that.containerSize.width;
+ width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw );
+ height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
+
+ that.parentData = {
+ element: ce, left: co.left, top: co.top, width: width, height: height
+ };
+ }
+ },
+
+ resize: function( event ) {
+ var woset, hoset, isParent, isOffsetRelative,
+ that = $(this).data("ui-resizable"),
+ o = that.options,
+ co = that.containerOffset, cp = that.position,
+ pRatio = that._aspectRatio || event.shiftKey,
+ cop = { top:0, left:0 }, ce = that.containerElement;
+
+ if (ce[0] !== document && (/static/).test(ce.css("position"))) {
+ cop = co;
+ }
+
+ if (cp.left < (that._helper ? co.left : 0)) {
+ that.size.width = that.size.width + (that._helper ? (that.position.left - co.left) : (that.position.left - cop.left));
+ if (pRatio) {
+ that.size.height = that.size.width / that.aspectRatio;
+ }
+ that.position.left = o.helper ? co.left : 0;
+ }
+
+ if (cp.top < (that._helper ? co.top : 0)) {
+ that.size.height = that.size.height + (that._helper ? (that.position.top - co.top) : that.position.top);
+ if (pRatio) {
+ that.size.width = that.size.height * that.aspectRatio;
+ }
+ that.position.top = that._helper ? co.top : 0;
+ }
+
+ that.offset.left = that.parentData.left+that.position.left;
+ that.offset.top = that.parentData.top+that.position.top;
+
+ woset = Math.abs( (that._helper ? that.offset.left - cop.left : (that.offset.left - cop.left)) + that.sizeDiff.width );
+ hoset = Math.abs( (that._helper ? that.offset.top - cop.top : (that.offset.top - co.top)) + that.sizeDiff.height );
+
+ isParent = that.containerElement.get(0) === that.element.parent().get(0);
+ isOffsetRelative = /relative|absolute/.test(that.containerElement.css("position"));
+
+ if ( isParent && isOffsetRelative ) {
+ woset -= Math.abs( that.parentData.left );
+ }
+
+ if (woset + that.size.width >= that.parentData.width) {
+ that.size.width = that.parentData.width - woset;
+ if (pRatio) {
+ that.size.height = that.size.width / that.aspectRatio;
+ }
+ }
+
+ if (hoset + that.size.height >= that.parentData.height) {
+ that.size.height = that.parentData.height - hoset;
+ if (pRatio) {
+ that.size.width = that.size.height * that.aspectRatio;
+ }
+ }
+ },
+
+ stop: function(){
+ var that = $(this).data("ui-resizable"),
+ o = that.options,
+ co = that.containerOffset,
+ cop = that.containerPosition,
+ ce = that.containerElement,
+ helper = $(that.helper),
+ ho = helper.offset(),
+ w = helper.outerWidth() - that.sizeDiff.width,
+ h = helper.outerHeight() - that.sizeDiff.height;
+
+ if (that._helper && !o.animate && (/relative/).test(ce.css("position"))) {
+ $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
+ }
+
+ if (that._helper && !o.animate && (/static/).test(ce.css("position"))) {
+ $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
+ }
+
+ }
+});
+
+$.ui.plugin.add("resizable", "alsoResize", {
+
+ start: function () {
+ var that = $(this).data("ui-resizable"),
+ o = that.options,
+ _store = function (exp) {
+ $(exp).each(function() {
+ var el = $(this);
+ el.data("ui-resizable-alsoresize", {
+ width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
+ left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10)
+ });
+ });
+ };
+
+ if (typeof(o.alsoResize) === "object" && !o.alsoResize.parentNode) {
+ if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }
+ else { $.each(o.alsoResize, function (exp) { _store(exp); }); }
+ }else{
+ _store(o.alsoResize);
+ }
+ },
+
+ resize: function (event, ui) {
+ var that = $(this).data("ui-resizable"),
+ o = that.options,
+ os = that.originalSize,
+ op = that.originalPosition,
+ delta = {
+ height: (that.size.height - os.height) || 0, width: (that.size.width - os.width) || 0,
+ top: (that.position.top - op.top) || 0, left: (that.position.left - op.left) || 0
+ },
+
+ _alsoResize = function (exp, c) {
+ $(exp).each(function() {
+ var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {},
+ css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"];
+
+ $.each(css, function (i, prop) {
+ var sum = (start[prop]||0) + (delta[prop]||0);
+ if (sum && sum >= 0) {
+ style[prop] = sum || null;
+ }
+ });
+
+ el.css(style);
+ });
+ };
+
+ if (typeof(o.alsoResize) === "object" && !o.alsoResize.nodeType) {
+ $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); });
+ }else{
+ _alsoResize(o.alsoResize);
+ }
+ },
+
+ stop: function () {
+ $(this).removeData("resizable-alsoresize");
+ }
+});
+
+$.ui.plugin.add("resizable", "ghost", {
+
+ start: function() {
+
+ var that = $(this).data("ui-resizable"), o = that.options, cs = that.size;
+
+ that.ghost = that.originalElement.clone();
+ that.ghost
+ .css({ opacity: 0.25, display: "block", position: "relative", height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })
+ .addClass("ui-resizable-ghost")
+ .addClass(typeof o.ghost === "string" ? o.ghost : "");
+
+ that.ghost.appendTo(that.helper);
+
+ },
+
+ resize: function(){
+ var that = $(this).data("ui-resizable");
+ if (that.ghost) {
+ that.ghost.css({ position: "relative", height: that.size.height, width: that.size.width });
+ }
+ },
+
+ stop: function() {
+ var that = $(this).data("ui-resizable");
+ if (that.ghost && that.helper) {
+ that.helper.get(0).removeChild(that.ghost.get(0));
+ }
+ }
+
+});
+
+$.ui.plugin.add("resizable", "grid", {
+
+ resize: function() {
+ var that = $(this).data("ui-resizable"),
+ o = that.options,
+ cs = that.size,
+ os = that.originalSize,
+ op = that.originalPosition,
+ a = that.axis,
+ grid = typeof o.grid === "number" ? [o.grid, o.grid] : o.grid,
+ gridX = (grid[0]||1),
+ gridY = (grid[1]||1),
+ ox = Math.round((cs.width - os.width) / gridX) * gridX,
+ oy = Math.round((cs.height - os.height) / gridY) * gridY,
+ newWidth = os.width + ox,
+ newHeight = os.height + oy,
+ isMaxWidth = o.maxWidth && (o.maxWidth < newWidth),
+ isMaxHeight = o.maxHeight && (o.maxHeight < newHeight),
+ isMinWidth = o.minWidth && (o.minWidth > newWidth),
+ isMinHeight = o.minHeight && (o.minHeight > newHeight);
+
+ o.grid = grid;
+
+ if (isMinWidth) {
+ newWidth = newWidth + gridX;
+ }
+ if (isMinHeight) {
+ newHeight = newHeight + gridY;
+ }
+ if (isMaxWidth) {
+ newWidth = newWidth - gridX;
+ }
+ if (isMaxHeight) {
+ newHeight = newHeight - gridY;
+ }
+
+ if (/^(se|s|e)$/.test(a)) {
+ that.size.width = newWidth;
+ that.size.height = newHeight;
+ } else if (/^(ne)$/.test(a)) {
+ that.size.width = newWidth;
+ that.size.height = newHeight;
+ that.position.top = op.top - oy;
+ } else if (/^(sw)$/.test(a)) {
+ that.size.width = newWidth;
+ that.size.height = newHeight;
+ that.position.left = op.left - ox;
+ } else {
+ if ( newHeight - gridY > 0 ) {
+ that.size.height = newHeight;
+ that.position.top = op.top - oy;
+ } else {
+ that.size.height = gridY;
+ that.position.top = op.top + os.height - gridY;
+ }
+ if ( newWidth - gridX > 0 ) {
+ that.size.width = newWidth;
+ that.position.left = op.left - ox;
+ } else {
+ that.size.width = gridX;
+ that.position.left = op.left + os.width - gridX;
+ }
+ }
+ }
+
+});
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+$.widget("ui.selectable", $.ui.mouse, {
+ version: "1.10.4",
+ options: {
+ appendTo: "body",
+ autoRefresh: true,
+ distance: 0,
+ filter: "*",
+ tolerance: "touch",
+
+ // callbacks
+ selected: null,
+ selecting: null,
+ start: null,
+ stop: null,
+ unselected: null,
+ unselecting: null
+ },
+ _create: function() {
+ var selectees,
+ that = this;
+
+ this.element.addClass("ui-selectable");
+
+ this.dragged = false;
+
+ // cache selectee children based on filter
+ this.refresh = function() {
+ selectees = $(that.options.filter, that.element[0]);
+ selectees.addClass("ui-selectee");
+ selectees.each(function() {
+ var $this = $(this),
+ pos = $this.offset();
+ $.data(this, "selectable-item", {
+ element: this,
+ $element: $this,
+ left: pos.left,
+ top: pos.top,
+ right: pos.left + $this.outerWidth(),
+ bottom: pos.top + $this.outerHeight(),
+ startselected: false,
+ selected: $this.hasClass("ui-selected"),
+ selecting: $this.hasClass("ui-selecting"),
+ unselecting: $this.hasClass("ui-unselecting")
+ });
+ });
+ };
+ this.refresh();
+
+ this.selectees = selectees.addClass("ui-selectee");
+
+ this._mouseInit();
+
+ this.helper = $("<div class='ui-selectable-helper'></div>");
+ },
+
+ _destroy: function() {
+ this.selectees
+ .removeClass("ui-selectee")
+ .removeData("selectable-item");
+ this.element
+ .removeClass("ui-selectable ui-selectable-disabled");
+ this._mouseDestroy();
+ },
+
+ _mouseStart: function(event) {
+ var that = this,
+ options = this.options;
+
+ this.opos = [event.pageX, event.pageY];
+
+ if (this.options.disabled) {
+ return;
+ }
+
+ this.selectees = $(options.filter, this.element[0]);
+
+ this._trigger("start", event);
+
+ $(options.appendTo).append(this.helper);
+ // position helper (lasso)
+ this.helper.css({
+ "left": event.pageX,
+ "top": event.pageY,
+ "width": 0,
+ "height": 0
+ });
+
+ if (options.autoRefresh) {
+ this.refresh();
+ }
+
+ this.selectees.filter(".ui-selected").each(function() {
+ var selectee = $.data(this, "selectable-item");
+ selectee.startselected = true;
+ if (!event.metaKey && !event.ctrlKey) {
+ selectee.$element.removeClass("ui-selected");
+ selectee.selected = false;
+ selectee.$element.addClass("ui-unselecting");
+ selectee.unselecting = true;
+ // selectable UNSELECTING callback
+ that._trigger("unselecting", event, {
+ unselecting: selectee.element
+ });
+ }
+ });
+
+ $(event.target).parents().addBack().each(function() {
+ var doSelect,
+ selectee = $.data(this, "selectable-item");
+ if (selectee) {
+ doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass("ui-selected");
+ selectee.$element
+ .removeClass(doSelect ? "ui-unselecting" : "ui-selected")
+ .addClass(doSelect ? "ui-selecting" : "ui-unselecting");
+ selectee.unselecting = !doSelect;
+ selectee.selecting = doSelect;
+ selectee.selected = doSelect;
+ // selectable (UN)SELECTING callback
+ if (doSelect) {
+ that._trigger("selecting", event, {
+ selecting: selectee.element
+ });
+ } else {
+ that._trigger("unselecting", event, {
+ unselecting: selectee.element
+ });
+ }
+ return false;
+ }
+ });
+
+ },
+
+ _mouseDrag: function(event) {
+
+ this.dragged = true;
+
+ if (this.options.disabled) {
+ return;
+ }
+
+ var tmp,
+ that = this,
+ options = this.options,
+ x1 = this.opos[0],
+ y1 = this.opos[1],
+ x2 = event.pageX,
+ y2 = event.pageY;
+
+ if (x1 > x2) { tmp = x2; x2 = x1; x1 = tmp; }
+ if (y1 > y2) { tmp = y2; y2 = y1; y1 = tmp; }
+ this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});
+
+ this.selectees.each(function() {
+ var selectee = $.data(this, "selectable-item"),
+ hit = false;
+
+ //prevent helper from being selected if appendTo: selectable
+ if (!selectee || selectee.element === that.element[0]) {
+ return;
+ }
+
+ if (options.tolerance === "touch") {
+ hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
+ } else if (options.tolerance === "fit") {
+ hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
+ }
+
+ if (hit) {
+ // SELECT
+ if (selectee.selected) {
+ selectee.$element.removeClass("ui-selected");
+ selectee.selected = false;
+ }
+ if (selectee.unselecting) {
+ selectee.$element.removeClass("ui-unselecting");
+ selectee.unselecting = false;
+ }
+ if (!selectee.selecting) {
+ selectee.$element.addClass("ui-selecting");
+ selectee.selecting = true;
+ // selectable SELECTING callback
+ that._trigger("selecting", event, {
+ selecting: selectee.element
+ });
+ }
+ } else {
+ // UNSELECT
+ if (selectee.selecting) {
+ if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
+ selectee.$element.removeClass("ui-selecting");
+ selectee.selecting = false;
+ selectee.$element.addClass("ui-selected");
+ selectee.selected = true;
+ } else {
+ selectee.$element.removeClass("ui-selecting");
+ selectee.selecting = false;
+ if (selectee.startselected) {
+ selectee.$element.addClass("ui-unselecting");
+ selectee.unselecting = true;
+ }
+ // selectable UNSELECTING callback
+ that._trigger("unselecting", event, {
+ unselecting: selectee.element
+ });
+ }
+ }
+ if (selectee.selected) {
+ if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
+ selectee.$element.removeClass("ui-selected");
+ selectee.selected = false;
+
+ selectee.$element.addClass("ui-unselecting");
+ selectee.unselecting = true;
+ // selectable UNSELECTING callback
+ that._trigger("unselecting", event, {
+ unselecting: selectee.element
+ });
+ }
+ }
+ }
+ });
+
+ return false;
+ },
+
+ _mouseStop: function(event) {
+ var that = this;
+
+ this.dragged = false;
+
+ $(".ui-unselecting", this.element[0]).each(function() {
+ var selectee = $.data(this, "selectable-item");
+ selectee.$element.removeClass("ui-unselecting");
+ selectee.unselecting = false;
+ selectee.startselected = false;
+ that._trigger("unselected", event, {
+ unselected: selectee.element
+ });
+ });
+ $(".ui-selecting", this.element[0]).each(function() {
+ var selectee = $.data(this, "selectable-item");
+ selectee.$element.removeClass("ui-selecting").addClass("ui-selected");
+ selectee.selecting = false;
+ selectee.selected = true;
+ selectee.startselected = true;
+ that._trigger("selected", event, {
+ selected: selectee.element
+ });
+ });
+ this._trigger("stop", event);
+
+ this.helper.remove();
+
+ return false;
+ }
+
+});
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+function isOverAxis( x, reference, size ) {
+ return ( x > reference ) && ( x < ( reference + size ) );
+}
+
+function isFloating(item) {
+ return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));
+}
+
+$.widget("ui.sortable", $.ui.mouse, {
+ version: "1.10.4",
+ widgetEventPrefix: "sort",
+ ready: false,
+ options: {
+ appendTo: "parent",
+ axis: false,
+ connectWith: false,
+ containment: false,
+ cursor: "auto",
+ cursorAt: false,
+ dropOnEmpty: true,
+ forcePlaceholderSize: false,
+ forceHelperSize: false,
+ grid: false,
+ handle: false,
+ helper: "original",
+ items: "> *",
+ opacity: false,
+ placeholder: false,
+ revert: false,
+ scroll: true,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ scope: "default",
+ tolerance: "intersect",
+ zIndex: 1000,
+
+ // callbacks
+ activate: null,
+ beforeStop: null,
+ change: null,
+ deactivate: null,
+ out: null,
+ over: null,
+ receive: null,
+ remove: null,
+ sort: null,
+ start: null,
+ stop: null,
+ update: null
+ },
+ _create: function() {
+
+ var o = this.options;
+ this.containerCache = {};
+ this.element.addClass("ui-sortable");
+
+ //Get the items
+ this.refresh();
+
+ //Let's determine if the items are being displayed horizontally
+ this.floating = this.items.length ? o.axis === "x" || isFloating(this.items[0].item) : false;
+
+ //Let's determine the parent's offset
+ this.offset = this.element.offset();
+
+ //Initialize mouse events for interaction
+ this._mouseInit();
+
+ //We're ready to go
+ this.ready = true;
+
+ },
+
+ _destroy: function() {
+ this.element
+ .removeClass("ui-sortable ui-sortable-disabled");
+ this._mouseDestroy();
+
+ for ( var i = this.items.length - 1; i >= 0; i-- ) {
+ this.items[i].item.removeData(this.widgetName + "-item");
+ }
+
+ return this;
+ },
+
+ _setOption: function(key, value){
+ if ( key === "disabled" ) {
+ this.options[ key ] = value;
+
+ this.widget().toggleClass( "ui-sortable-disabled", !!value );
+ } else {
+ // Don't call widget base _setOption for disable as it adds ui-state-disabled class
+ $.Widget.prototype._setOption.apply(this, arguments);
+ }
+ },
+
+ _mouseCapture: function(event, overrideHandle) {
+ var currentItem = null,
+ validHandle = false,
+ that = this;
+
+ if (this.reverting) {
+ return false;
+ }
+
+ if(this.options.disabled || this.options.type === "static") {
+ return false;
+ }
+
+ //We have to refresh the items data once first
+ this._refreshItems(event);
+
+ //Find out if the clicked node (or one of its parents) is a actual item in this.items
+ $(event.target).parents().each(function() {
+ if($.data(this, that.widgetName + "-item") === that) {
+ currentItem = $(this);
+ return false;
+ }
+ });
+ if($.data(event.target, that.widgetName + "-item") === that) {
+ currentItem = $(event.target);
+ }
+
+ if(!currentItem) {
+ return false;
+ }
+ if(this.options.handle && !overrideHandle) {
+ $(this.options.handle, currentItem).find("*").addBack().each(function() {
+ if(this === event.target) {
+ validHandle = true;
+ }
+ });
+ if(!validHandle) {
+ return false;
+ }
+ }
+
+ this.currentItem = currentItem;
+ this._removeCurrentsFromItems();
+ return true;
+
+ },
+
+ _mouseStart: function(event, overrideHandle, noActivation) {
+
+ var i, body,
+ o = this.options;
+
+ this.currentContainer = this;
+
+ //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
+ this.refreshPositions();
+
+ //Create and append the visible helper
+ this.helper = this._createHelper(event);
+
+ //Cache the helper size
+ this._cacheHelperProportions();
+
+ /*
+ * - Position generation -
+ * This block generates everything position related - it's the core of draggables.
+ */
+
+ //Cache the margins of the original element
+ this._cacheMargins();
+
+ //Get the next scrolling parent
+ this.scrollParent = this.helper.scrollParent();
+
+ //The element's absolute position on the page minus margins
+ this.offset = this.currentItem.offset();
+ this.offset = {
+ top: this.offset.top - this.margins.top,
+ left: this.offset.left - this.margins.left
+ };
+
+ $.extend(this.offset, {
+ click: { //Where the click happened, relative to the element
+ left: event.pageX - this.offset.left,
+ top: event.pageY - this.offset.top
+ },
+ parent: this._getParentOffset(),
+ relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
+ });
+
+ // Only after we got the offset, we can change the helper's position to absolute
+ // TODO: Still need to figure out a way to make relative sorting possible
+ this.helper.css("position", "absolute");
+ this.cssPosition = this.helper.css("position");
+
+ //Generate the original position
+ this.originalPosition = this._generatePosition(event);
+ this.originalPageX = event.pageX;
+ this.originalPageY = event.pageY;
+
+ //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
+ (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
+
+ //Cache the former DOM position
+ this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
+
+ //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
+ if(this.helper[0] !== this.currentItem[0]) {
+ this.currentItem.hide();
+ }
+
+ //Create the placeholder
+ this._createPlaceholder();
+
+ //Set a containment if given in the options
+ if(o.containment) {
+ this._setContainment();
+ }
+
+ if( o.cursor && o.cursor !== "auto" ) { // cursor option
+ body = this.document.find( "body" );
+
+ // support: IE
+ this.storedCursor = body.css( "cursor" );
+ body.css( "cursor", o.cursor );
+
+ this.storedStylesheet = $( "<style>*{ cursor: "+o.cursor+" !important; }</style>" ).appendTo( body );
+ }
+
+ if(o.opacity) { // opacity option
+ if (this.helper.css("opacity")) {
+ this._storedOpacity = this.helper.css("opacity");
+ }
+ this.helper.css("opacity", o.opacity);
+ }
+
+ if(o.zIndex) { // zIndex option
+ if (this.helper.css("zIndex")) {
+ this._storedZIndex = this.helper.css("zIndex");
+ }
+ this.helper.css("zIndex", o.zIndex);
+ }
+
+ //Prepare scrolling
+ if(this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") {
+ this.overflowOffset = this.scrollParent.offset();
+ }
+
+ //Call callbacks
+ this._trigger("start", event, this._uiHash());
+
+ //Recache the helper size
+ if(!this._preserveHelperProportions) {
+ this._cacheHelperProportions();
+ }
+
+
+ //Post "activate" events to possible containers
+ if( !noActivation ) {
+ for ( i = this.containers.length - 1; i >= 0; i-- ) {
+ this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
+ }
+ }
+
+ //Prepare possible droppables
+ if($.ui.ddmanager) {
+ $.ui.ddmanager.current = this;
+ }
+
+ if ($.ui.ddmanager && !o.dropBehaviour) {
+ $.ui.ddmanager.prepareOffsets(this, event);
+ }
+
+ this.dragging = true;
+
+ this.helper.addClass("ui-sortable-helper");
+ this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
+ return true;
+
+ },
+
+ _mouseDrag: function(event) {
+ var i, item, itemElement, intersection,
+ o = this.options,
+ scrolled = false;
+
+ //Compute the helpers position
+ this.position = this._generatePosition(event);
+ this.positionAbs = this._convertPositionTo("absolute");
+
+ if (!this.lastPositionAbs) {
+ this.lastPositionAbs = this.positionAbs;
+ }
+
+ //Do scrolling
+ if(this.options.scroll) {
+ if(this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") {
+
+ if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
+ this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
+ } else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) {
+ this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
+ }
+
+ if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
+ this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
+ } else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) {
+ this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
+ }
+
+ } else {
+
+ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
+ } else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
+ }
+
+ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
+ } else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
+ }
+
+ }
+
+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
+ $.ui.ddmanager.prepareOffsets(this, event);
+ }
+ }
+
+ //Regenerate the absolute position used for position checks
+ this.positionAbs = this._convertPositionTo("absolute");
+
+ //Set the helper position
+ if(!this.options.axis || this.options.axis !== "y") {
+ this.helper[0].style.left = this.position.left+"px";
+ }
+ if(!this.options.axis || this.options.axis !== "x") {
+ this.helper[0].style.top = this.position.top+"px";
+ }
+
+ //Rearrange
+ for (i = this.items.length - 1; i >= 0; i--) {
+
+ //Cache variables and intersection, continue if no intersection
+ item = this.items[i];
+ itemElement = item.item[0];
+ intersection = this._intersectsWithPointer(item);
+ if (!intersection) {
+ continue;
+ }
+
+ // Only put the placeholder inside the current Container, skip all
+ // items from other containers. This works because when moving
+ // an item from one container to another the
+ // currentContainer is switched before the placeholder is moved.
+ //
+ // Without this, moving items in "sub-sortables" can cause
+ // the placeholder to jitter beetween the outer and inner container.
+ if (item.instance !== this.currentContainer) {
+ continue;
+ }
+
+ // cannot intersect with itself
+ // no useless actions that have been done before
+ // no action if the item moved is the parent of the item checked
+ if (itemElement !== this.currentItem[0] &&
+ this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement &&
+ !$.contains(this.placeholder[0], itemElement) &&
+ (this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)
+ ) {
+
+ this.direction = intersection === 1 ? "down" : "up";
+
+ if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {
+ this._rearrange(event, item);
+ } else {
+ break;
+ }
+
+ this._trigger("change", event, this._uiHash());
+ break;
+ }
+ }
+
+ //Post events to containers
+ this._contactContainers(event);
+
+ //Interconnect with droppables
+ if($.ui.ddmanager) {
+ $.ui.ddmanager.drag(this, event);
+ }
+
+ //Call callbacks
+ this._trigger("sort", event, this._uiHash());
+
+ this.lastPositionAbs = this.positionAbs;
+ return false;
+
+ },
+
+ _mouseStop: function(event, noPropagation) {
+
+ if(!event) {
+ return;
+ }
+
+ //If we are using droppables, inform the manager about the drop
+ if ($.ui.ddmanager && !this.options.dropBehaviour) {
+ $.ui.ddmanager.drop(this, event);
+ }
+
+ if(this.options.revert) {
+ var that = this,
+ cur = this.placeholder.offset(),
+ axis = this.options.axis,
+ animation = {};
+
+ if ( !axis || axis === "x" ) {
+ animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft);
+ }
+ if ( !axis || axis === "y" ) {
+ animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop);
+ }
+ this.reverting = true;
+ $(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() {
+ that._clear(event);
+ });
+ } else {
+ this._clear(event, noPropagation);
+ }
+
+ return false;
+
+ },
+
+ cancel: function() {
+
+ if(this.dragging) {
+
+ this._mouseUp({ target: null });
+
+ if(this.options.helper === "original") {
+ this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
+ } else {
+ this.currentItem.show();
+ }
+
+ //Post deactivating events to containers
+ for (var i = this.containers.length - 1; i >= 0; i--){
+ this.containers[i]._trigger("deactivate", null, this._uiHash(this));
+ if(this.containers[i].containerCache.over) {
+ this.containers[i]._trigger("out", null, this._uiHash(this));
+ this.containers[i].containerCache.over = 0;
+ }
+ }
+
+ }
+
+ if (this.placeholder) {
+ //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
+ if(this.placeholder[0].parentNode) {
+ this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
+ }
+ if(this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {
+ this.helper.remove();
+ }
+
+ $.extend(this, {
+ helper: null,
+ dragging: false,
+ reverting: false,
+ _noFinalSort: null
+ });
+
+ if(this.domPosition.prev) {
+ $(this.domPosition.prev).after(this.currentItem);
+ } else {
+ $(this.domPosition.parent).prepend(this.currentItem);
+ }
+ }
+
+ return this;
+
+ },
+
+ serialize: function(o) {
+
+ var items = this._getItemsAsjQuery(o && o.connected),
+ str = [];
+ o = o || {};
+
+ $(items).each(function() {
+ var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/));
+ if (res) {
+ str.push((o.key || res[1]+"[]")+"="+(o.key && o.expression ? res[1] : res[2]));
+ }
+ });
+
+ if(!str.length && o.key) {
+ str.push(o.key + "=");
+ }
+
+ return str.join("&");
+
+ },
+
+ toArray: function(o) {
+
+ var items = this._getItemsAsjQuery(o && o.connected),
+ ret = [];
+
+ o = o || {};
+
+ items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); });
+ return ret;
+
+ },
+
+ /* Be careful with the following core functions */
+ _intersectsWith: function(item) {
+
+ var x1 = this.positionAbs.left,
+ x2 = x1 + this.helperProportions.width,
+ y1 = this.positionAbs.top,
+ y2 = y1 + this.helperProportions.height,
+ l = item.left,
+ r = l + item.width,
+ t = item.top,
+ b = t + item.height,
+ dyClick = this.offset.click.top,
+ dxClick = this.offset.click.left,
+ isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ),
+ isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ),
+ isOverElement = isOverElementHeight && isOverElementWidth;
+
+ if ( this.options.tolerance === "pointer" ||
+ this.options.forcePointerForContainers ||
+ (this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])
+ ) {
+ return isOverElement;
+ } else {
+
+ return (l < x1 + (this.helperProportions.width / 2) && // Right Half
+ x2 - (this.helperProportions.width / 2) < r && // Left Half
+ t < y1 + (this.helperProportions.height / 2) && // Bottom Half
+ y2 - (this.helperProportions.height / 2) < b ); // Top Half
+
+ }
+ },
+
+ _intersectsWithPointer: function(item) {
+
+ var isOverElementHeight = (this.options.axis === "x") || isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
+ isOverElementWidth = (this.options.axis === "y") || isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
+ isOverElement = isOverElementHeight && isOverElementWidth,
+ verticalDirection = this._getDragVerticalDirection(),
+ horizontalDirection = this._getDragHorizontalDirection();
+
+ if (!isOverElement) {
+ return false;
+ }
+
+ return this.floating ?
+ ( ((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1 )
+ : ( verticalDirection && (verticalDirection === "down" ? 2 : 1) );
+
+ },
+
+ _intersectsWithSides: function(item) {
+
+ var isOverBottomHalf = isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
+ isOverRightHalf = isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
+ verticalDirection = this._getDragVerticalDirection(),
+ horizontalDirection = this._getDragHorizontalDirection();
+
+ if (this.floating && horizontalDirection) {
+ return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf));
+ } else {
+ return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf));
+ }
+
+ },
+
+ _getDragVerticalDirection: function() {
+ var delta = this.positionAbs.top - this.lastPositionAbs.top;
+ return delta !== 0 && (delta > 0 ? "down" : "up");
+ },
+
+ _getDragHorizontalDirection: function() {
+ var delta = this.positionAbs.left - this.lastPositionAbs.left;
+ return delta !== 0 && (delta > 0 ? "right" : "left");
+ },
+
+ refresh: function(event) {
+ this._refreshItems(event);
+ this.refreshPositions();
+ return this;
+ },
+
+ _connectWith: function() {
+ var options = this.options;
+ return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;
+ },
+
+ _getItemsAsjQuery: function(connected) {
+
+ var i, j, cur, inst,
+ items = [],
+ queries = [],
+ connectWith = this._connectWith();
+
+ if(connectWith && connected) {
+ for (i = connectWith.length - 1; i >= 0; i--){
+ cur = $(connectWith[i]);
+ for ( j = cur.length - 1; j >= 0; j--){
+ inst = $.data(cur[j], this.widgetFullName);
+ if(inst && inst !== this && !inst.options.disabled) {
+ queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]);
+ }
+ }
+ }
+ }
+
+ queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
+
+ function addItems() {
+ items.push( this );
+ }
+ for (i = queries.length - 1; i >= 0; i--){
+ queries[i][0].each( addItems );
+ }
+
+ return $(items);
+
+ },
+
+ _removeCurrentsFromItems: function() {
+
+ var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
+
+ this.items = $.grep(this.items, function (item) {
+ for (var j=0; j < list.length; j++) {
+ if(list[j] === item.item[0]) {
+ return false;
+ }
+ }
+ return true;
+ });
+
+ },
+
+ _refreshItems: function(event) {
+
+ this.items = [];
+ this.containers = [this];
+
+ var i, j, cur, inst, targetData, _queries, item, queriesLength,
+ items = this.items,
+ queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]],
+ connectWith = this._connectWith();
+
+ if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
+ for (i = connectWith.length - 1; i >= 0; i--){
+ cur = $(connectWith[i]);
+ for (j = cur.length - 1; j >= 0; j--){
+ inst = $.data(cur[j], this.widgetFullName);
+ if(inst && inst !== this && !inst.options.disabled) {
+ queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
+ this.containers.push(inst);
+ }
+ }
+ }
+ }
+
+ for (i = queries.length - 1; i >= 0; i--) {
+ targetData = queries[i][1];
+ _queries = queries[i][0];
+
+ for (j=0, queriesLength = _queries.length; j < queriesLength; j++) {
+ item = $(_queries[j]);
+
+ item.data(this.widgetName + "-item", targetData); // Data for target checking (mouse manager)
+
+ items.push({
+ item: item,
+ instance: targetData,
+ width: 0, height: 0,
+ left: 0, top: 0
+ });
+ }
+ }
+
+ },
+
+ refreshPositions: function(fast) {
+
+ //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
+ if(this.offsetParent && this.helper) {
+ this.offset.parent = this._getParentOffset();
+ }
+
+ var i, item, t, p;
+
+ for (i = this.items.length - 1; i >= 0; i--){
+ item = this.items[i];
+
+ //We ignore calculating positions of all connected containers when we're not over them
+ if(item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {
+ continue;
+ }
+
+ t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
+
+ if (!fast) {
+ item.width = t.outerWidth();
+ item.height = t.outerHeight();
+ }
+
+ p = t.offset();
+ item.left = p.left;
+ item.top = p.top;
+ }
+
+ if(this.options.custom && this.options.custom.refreshContainers) {
+ this.options.custom.refreshContainers.call(this);
+ } else {
+ for (i = this.containers.length - 1; i >= 0; i--){
+ p = this.containers[i].element.offset();
+ this.containers[i].containerCache.left = p.left;
+ this.containers[i].containerCache.top = p.top;
+ this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
+ this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
+ }
+ }
+
+ return this;
+ },
+
+ _createPlaceholder: function(that) {
+ that = that || this;
+ var className,
+ o = that.options;
+
+ if(!o.placeholder || o.placeholder.constructor === String) {
+ className = o.placeholder;
+ o.placeholder = {
+ element: function() {
+
+ var nodeName = that.currentItem[0].nodeName.toLowerCase(),
+ element = $( "<" + nodeName + ">", that.document[0] )
+ .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
+ .removeClass("ui-sortable-helper");
+
+ if ( nodeName === "tr" ) {
+ that.currentItem.children().each(function() {
+ $( "<td>&#160;</td>", that.document[0] )
+ .attr( "colspan", $( this ).attr( "colspan" ) || 1 )
+ .appendTo( element );
+ });
+ } else if ( nodeName === "img" ) {
+ element.attr( "src", that.currentItem.attr( "src" ) );
+ }
+
+ if ( !className ) {
+ element.css( "visibility", "hidden" );
+ }
+
+ return element;
+ },
+ update: function(container, p) {
+
+ // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
+ // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
+ if(className && !o.forcePlaceholderSize) {
+ return;
+ }
+
+ //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
+ if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); }
+ if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); }
+ }
+ };
+ }
+
+ //Create the placeholder
+ that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));
+
+ //Append it after the actual current item
+ that.currentItem.after(that.placeholder);
+
+ //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
+ o.placeholder.update(that, that.placeholder);
+
+ },
+
+ _contactContainers: function(event) {
+ var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, base, cur, nearBottom, floating,
+ innermostContainer = null,
+ innermostIndex = null;
+
+ // get innermost container that intersects with item
+ for (i = this.containers.length - 1; i >= 0; i--) {
+
+ // never consider a container that's located within the item itself
+ if($.contains(this.currentItem[0], this.containers[i].element[0])) {
+ continue;
+ }
+
+ if(this._intersectsWith(this.containers[i].containerCache)) {
+
+ // if we've already found a container and it's more "inner" than this, then continue
+ if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {
+ continue;
+ }
+
+ innermostContainer = this.containers[i];
+ innermostIndex = i;
+
+ } else {
+ // container doesn't intersect. trigger "out" event if necessary
+ if(this.containers[i].containerCache.over) {
+ this.containers[i]._trigger("out", event, this._uiHash(this));
+ this.containers[i].containerCache.over = 0;
+ }
+ }
+
+ }
+
+ // if no intersecting containers found, return
+ if(!innermostContainer) {
+ return;
+ }
+
+ // move the item into the container if it's not there already
+ if(this.containers.length === 1) {
+ if (!this.containers[innermostIndex].containerCache.over) {
+ this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
+ this.containers[innermostIndex].containerCache.over = 1;
+ }
+ } else {
+
+ //When entering a new container, we will find the item with the least distance and append our item near it
+ dist = 10000;
+ itemWithLeastDistance = null;
+ floating = innermostContainer.floating || isFloating(this.currentItem);
+ posProperty = floating ? "left" : "top";
+ sizeProperty = floating ? "width" : "height";
+ base = this.positionAbs[posProperty] + this.offset.click[posProperty];
+ for (j = this.items.length - 1; j >= 0; j--) {
+ if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {
+ continue;
+ }
+ if(this.items[j].item[0] === this.currentItem[0]) {
+ continue;
+ }
+ if (floating && !isOverAxis(this.positionAbs.top + this.offset.click.top, this.items[j].top, this.items[j].height)) {
+ continue;
+ }
+ cur = this.items[j].item.offset()[posProperty];
+ nearBottom = false;
+ if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){
+ nearBottom = true;
+ cur += this.items[j][sizeProperty];
+ }
+
+ if(Math.abs(cur - base) < dist) {
+ dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];
+ this.direction = nearBottom ? "up": "down";
+ }
+ }
+
+ //Check if dropOnEmpty is enabled
+ if(!itemWithLeastDistance && !this.options.dropOnEmpty) {
+ return;
+ }
+
+ if(this.currentContainer === this.containers[innermostIndex]) {
+ return;
+ }
+
+ itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
+ this._trigger("change", event, this._uiHash());
+ this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
+ this.currentContainer = this.containers[innermostIndex];
+
+ //Update the placeholder
+ this.options.placeholder.update(this.currentContainer, this.placeholder);
+
+ this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
+ this.containers[innermostIndex].containerCache.over = 1;
+ }
+
+
+ },
+
+ _createHelper: function(event) {
+
+ var o = this.options,
+ helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem);
+
+ //Add the helper to the DOM if that didn't happen already
+ if(!helper.parents("body").length) {
+ $(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
+ }
+
+ if(helper[0] === this.currentItem[0]) {
+ this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };
+ }
+
+ if(!helper[0].style.width || o.forceHelperSize) {
+ helper.width(this.currentItem.width());
+ }
+ if(!helper[0].style.height || o.forceHelperSize) {
+ helper.height(this.currentItem.height());
+ }
+
+ return helper;
+
+ },
+
+ _adjustOffsetFromHelper: function(obj) {
+ if (typeof obj === "string") {
+ obj = obj.split(" ");
+ }
+ if ($.isArray(obj)) {
+ obj = {left: +obj[0], top: +obj[1] || 0};
+ }
+ if ("left" in obj) {
+ this.offset.click.left = obj.left + this.margins.left;
+ }
+ if ("right" in obj) {
+ this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
+ }
+ if ("top" in obj) {
+ this.offset.click.top = obj.top + this.margins.top;
+ }
+ if ("bottom" in obj) {
+ this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
+ }
+ },
+
+ _getParentOffset: function() {
+
+
+ //Get the offsetParent and cache its position
+ this.offsetParent = this.helper.offsetParent();
+ var po = this.offsetParent.offset();
+
+ // This is a special case where we need to modify a offset calculated on start, since the following happened:
+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
+ if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
+ po.left += this.scrollParent.scrollLeft();
+ po.top += this.scrollParent.scrollTop();
+ }
+
+ // This needs to be actually done for all browsers, since pageX/pageY includes this information
+ // with an ugly IE fix
+ if( this.offsetParent[0] === document.body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
+ po = { top: 0, left: 0 };
+ }
+
+ return {
+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
+ };
+
+ },
+
+ _getRelativeOffset: function() {
+
+ if(this.cssPosition === "relative") {
+ var p = this.currentItem.position();
+ return {
+ top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
+ left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
+ };
+ } else {
+ return { top: 0, left: 0 };
+ }
+
+ },
+
+ _cacheMargins: function() {
+ this.margins = {
+ left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
+ top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
+ };
+ },
+
+ _cacheHelperProportions: function() {
+ this.helperProportions = {
+ width: this.helper.outerWidth(),
+ height: this.helper.outerHeight()
+ };
+ },
+
+ _setContainment: function() {
+
+ var ce, co, over,
+ o = this.options;
+ if(o.containment === "parent") {
+ o.containment = this.helper[0].parentNode;
+ }
+ if(o.containment === "document" || o.containment === "window") {
+ this.containment = [
+ 0 - this.offset.relative.left - this.offset.parent.left,
+ 0 - this.offset.relative.top - this.offset.parent.top,
+ $(o.containment === "document" ? document : window).width() - this.helperProportions.width - this.margins.left,
+ ($(o.containment === "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
+ ];
+ }
+
+ if(!(/^(document|window|parent)$/).test(o.containment)) {
+ ce = $(o.containment)[0];
+ co = $(o.containment).offset();
+ over = ($(ce).css("overflow") !== "hidden");
+
+ this.containment = [
+ co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
+ co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
+ co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
+ co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
+ ];
+ }
+
+ },
+
+ _convertPositionTo: function(d, pos) {
+
+ if(!pos) {
+ pos = this.position;
+ }
+ var mod = d === "absolute" ? 1 : -1,
+ scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
+ scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ return {
+ top: (
+ pos.top + // The absolute mouse position
+ this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border)
+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
+ ),
+ left: (
+ pos.left + // The absolute mouse position
+ this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border)
+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
+ )
+ };
+
+ },
+
+ _generatePosition: function(event) {
+
+ var top, left,
+ o = this.options,
+ pageX = event.pageX,
+ pageY = event.pageY,
+ scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ // This is another very weird special case that only happens for relative elements:
+ // 1. If the css position is relative
+ // 2. and the scroll parent is the document or similar to the offset parent
+ // we have to refresh the relative offset during the scroll so there are no jumps
+ if(this.cssPosition === "relative" && !(this.scrollParent[0] !== document && this.scrollParent[0] !== this.offsetParent[0])) {
+ this.offset.relative = this._getRelativeOffset();
+ }
+
+ /*
+ * - Position constraining -
+ * Constrain the position to a mix of grid, containment.
+ */
+
+ if(this.originalPosition) { //If we are not dragging yet, we won't check for options
+
+ if(this.containment) {
+ if(event.pageX - this.offset.click.left < this.containment[0]) {
+ pageX = this.containment[0] + this.offset.click.left;
+ }
+ if(event.pageY - this.offset.click.top < this.containment[1]) {
+ pageY = this.containment[1] + this.offset.click.top;
+ }
+ if(event.pageX - this.offset.click.left > this.containment[2]) {
+ pageX = this.containment[2] + this.offset.click.left;
+ }
+ if(event.pageY - this.offset.click.top > this.containment[3]) {
+ pageY = this.containment[3] + this.offset.click.top;
+ }
+ }
+
+ if(o.grid) {
+ top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
+ pageY = this.containment ? ( (top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
+
+ left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
+ pageX = this.containment ? ( (left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
+ }
+
+ }
+
+ return {
+ top: (
+ pageY - // The absolute mouse position
+ this.offset.click.top - // Click offset (relative to the element)
+ this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.top + // The offsetParent's offset without borders (offset + border)
+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
+ ),
+ left: (
+ pageX - // The absolute mouse position
+ this.offset.click.left - // Click offset (relative to the element)
+ this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.left + // The offsetParent's offset without borders (offset + border)
+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
+ )
+ };
+
+ },
+
+ _rearrange: function(event, i, a, hardRefresh) {
+
+ a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction === "down" ? i.item[0] : i.item[0].nextSibling));
+
+ //Various things done here to improve the performance:
+ // 1. we create a setTimeout, that calls refreshPositions
+ // 2. on the instance, we have a counter variable, that get's higher after every append
+ // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
+ // 4. this lets only the last addition to the timeout stack through
+ this.counter = this.counter ? ++this.counter : 1;
+ var counter = this.counter;
+
+ this._delay(function() {
+ if(counter === this.counter) {
+ this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
+ }
+ });
+
+ },
+
+ _clear: function(event, noPropagation) {
+
+ this.reverting = false;
+ // We delay all events that have to be triggered to after the point where the placeholder has been removed and
+ // everything else normalized again
+ var i,
+ delayedTriggers = [];
+
+ // We first have to update the dom position of the actual currentItem
+ // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
+ if(!this._noFinalSort && this.currentItem.parent().length) {
+ this.placeholder.before(this.currentItem);
+ }
+ this._noFinalSort = null;
+
+ if(this.helper[0] === this.currentItem[0]) {
+ for(i in this._storedCSS) {
+ if(this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") {
+ this._storedCSS[i] = "";
+ }
+ }
+ this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
+ } else {
+ this.currentItem.show();
+ }
+
+ if(this.fromOutside && !noPropagation) {
+ delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
+ }
+ if((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {
+ delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
+ }
+
+ // Check if the items Container has Changed and trigger appropriate
+ // events.
+ if (this !== this.currentContainer) {
+ if(!noPropagation) {
+ delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
+ delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer));
+ delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer));
+ }
+ }
+
+
+ //Post events to containers
+ function delayEvent( type, instance, container ) {
+ return function( event ) {
+ container._trigger( type, event, instance._uiHash( instance ) );
+ };
+ }
+ for (i = this.containers.length - 1; i >= 0; i--){
+ if (!noPropagation) {
+ delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
+ }
+ if(this.containers[i].containerCache.over) {
+ delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
+ this.containers[i].containerCache.over = 0;
+ }
+ }
+
+ //Do what was originally in plugins
+ if ( this.storedCursor ) {
+ this.document.find( "body" ).css( "cursor", this.storedCursor );
+ this.storedStylesheet.remove();
+ }
+ if(this._storedOpacity) {
+ this.helper.css("opacity", this._storedOpacity);
+ }
+ if(this._storedZIndex) {
+ this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex);
+ }
+
+ this.dragging = false;
+ if(this.cancelHelperRemoval) {
+ if(!noPropagation) {
+ this._trigger("beforeStop", event, this._uiHash());
+ for (i=0; i < delayedTriggers.length; i++) {
+ delayedTriggers[i].call(this, event);
+ } //Trigger all delayed events
+ this._trigger("stop", event, this._uiHash());
+ }
+
+ this.fromOutside = false;
+ return false;
+ }
+
+ if(!noPropagation) {
+ this._trigger("beforeStop", event, this._uiHash());
+ }
+
+ //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
+ this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
+
+ if(this.helper[0] !== this.currentItem[0]) {
+ this.helper.remove();
+ }
+ this.helper = null;
+
+ if(!noPropagation) {
+ for (i=0; i < delayedTriggers.length; i++) {
+ delayedTriggers[i].call(this, event);
+ } //Trigger all delayed events
+ this._trigger("stop", event, this._uiHash());
+ }
+
+ this.fromOutside = false;
+ return true;
+
+ },
+
+ _trigger: function() {
+ if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
+ this.cancel();
+ }
+ },
+
+ _uiHash: function(_inst) {
+ var inst = _inst || this;
+ return {
+ helper: inst.helper,
+ placeholder: inst.placeholder || $([]),
+ position: inst.position,
+ originalPosition: inst.originalPosition,
+ offset: inst.positionAbs,
+ item: inst.currentItem,
+ sender: _inst ? _inst.element : null
+ };
+ }
+
+});
+
+})(jQuery);
+
+(function($, undefined) {
+
+var dataSpace = "ui-effects-";
+
+$.effects = {
+ effect: {}
+};
+
+/*!
+ * jQuery Color Animations v2.1.2
+ * https://github.com/jquery/jquery-color
+ *
+ * Copyright 2013 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * Date: Wed Jan 16 08:47:09 2013 -0600
+ */
+(function( jQuery, undefined ) {
+
+ var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
+
+ // plusequals test for += 100 -= 100
+ rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
+ // a set of RE's that can match strings and generate color tuples.
+ stringParsers = [{
+ re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
+ parse: function( execResult ) {
+ return [
+ execResult[ 1 ],
+ execResult[ 2 ],
+ execResult[ 3 ],
+ execResult[ 4 ]
+ ];
+ }
+ }, {
+ re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
+ parse: function( execResult ) {
+ return [
+ execResult[ 1 ] * 2.55,
+ execResult[ 2 ] * 2.55,
+ execResult[ 3 ] * 2.55,
+ execResult[ 4 ]
+ ];
+ }
+ }, {
+ // this regex ignores A-F because it's compared against an already lowercased string
+ re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
+ parse: function( execResult ) {
+ return [
+ parseInt( execResult[ 1 ], 16 ),
+ parseInt( execResult[ 2 ], 16 ),
+ parseInt( execResult[ 3 ], 16 )
+ ];
+ }
+ }, {
+ // this regex ignores A-F because it's compared against an already lowercased string
+ re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
+ parse: function( execResult ) {
+ return [
+ parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
+ parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
+ parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
+ ];
+ }
+ }, {
+ re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
+ space: "hsla",
+ parse: function( execResult ) {
+ return [
+ execResult[ 1 ],
+ execResult[ 2 ] / 100,
+ execResult[ 3 ] / 100,
+ execResult[ 4 ]
+ ];
+ }
+ }],
+
+ // jQuery.Color( )
+ color = jQuery.Color = function( color, green, blue, alpha ) {
+ return new jQuery.Color.fn.parse( color, green, blue, alpha );
+ },
+ spaces = {
+ rgba: {
+ props: {
+ red: {
+ idx: 0,
+ type: "byte"
+ },
+ green: {
+ idx: 1,
+ type: "byte"
+ },
+ blue: {
+ idx: 2,
+ type: "byte"
+ }
+ }
+ },
+
+ hsla: {
+ props: {
+ hue: {
+ idx: 0,
+ type: "degrees"
+ },
+ saturation: {
+ idx: 1,
+ type: "percent"
+ },
+ lightness: {
+ idx: 2,
+ type: "percent"
+ }
+ }
+ }
+ },
+ propTypes = {
+ "byte": {
+ floor: true,
+ max: 255
+ },
+ "percent": {
+ max: 1
+ },
+ "degrees": {
+ mod: 360,
+ floor: true
+ }
+ },
+ support = color.support = {},
+
+ // element for support tests
+ supportElem = jQuery( "<p>" )[ 0 ],
+
+ // colors = jQuery.Color.names
+ colors,
+
+ // local aliases of functions called often
+ each = jQuery.each;
+
+// determine rgba support immediately
+supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
+support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
+
+// define cache name and alpha properties
+// for rgba and hsla spaces
+each( spaces, function( spaceName, space ) {
+ space.cache = "_" + spaceName;
+ space.props.alpha = {
+ idx: 3,
+ type: "percent",
+ def: 1
+ };
+});
+
+function clamp( value, prop, allowEmpty ) {
+ var type = propTypes[ prop.type ] || {};
+
+ if ( value == null ) {
+ return (allowEmpty || !prop.def) ? null : prop.def;
+ }
+
+ // ~~ is an short way of doing floor for positive numbers
+ value = type.floor ? ~~value : parseFloat( value );
+
+ // IE will pass in empty strings as value for alpha,
+ // which will hit this case
+ if ( isNaN( value ) ) {
+ return prop.def;
+ }
+
+ if ( type.mod ) {
+ // we add mod before modding to make sure that negatives values
+ // get converted properly: -10 -> 350
+ return (value + type.mod) % type.mod;
+ }
+
+ // for now all property types without mod have min and max
+ return 0 > value ? 0 : type.max < value ? type.max : value;
+}
+
+function stringParse( string ) {
+ var inst = color(),
+ rgba = inst._rgba = [];
+
+ string = string.toLowerCase();
+
+ each( stringParsers, function( i, parser ) {
+ var parsed,
+ match = parser.re.exec( string ),
+ values = match && parser.parse( match ),
+ spaceName = parser.space || "rgba";
+
+ if ( values ) {
+ parsed = inst[ spaceName ]( values );
+
+ // if this was an rgba parse the assignment might happen twice
+ // oh well....
+ inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
+ rgba = inst._rgba = parsed._rgba;
+
+ // exit each( stringParsers ) here because we matched
+ return false;
+ }
+ });
+
+ // Found a stringParser that handled it
+ if ( rgba.length ) {
+
+ // if this came from a parsed string, force "transparent" when alpha is 0
+ // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
+ if ( rgba.join() === "0,0,0,0" ) {
+ jQuery.extend( rgba, colors.transparent );
+ }
+ return inst;
+ }
+
+ // named colors
+ return colors[ string ];
+}
+
+color.fn = jQuery.extend( color.prototype, {
+ parse: function( red, green, blue, alpha ) {
+ if ( red === undefined ) {
+ this._rgba = [ null, null, null, null ];
+ return this;
+ }
+ if ( red.jquery || red.nodeType ) {
+ red = jQuery( red ).css( green );
+ green = undefined;
+ }
+
+ var inst = this,
+ type = jQuery.type( red ),
+ rgba = this._rgba = [];
+
+ // more than 1 argument specified - assume ( red, green, blue, alpha )
+ if ( green !== undefined ) {
+ red = [ red, green, blue, alpha ];
+ type = "array";
+ }
+
+ if ( type === "string" ) {
+ return this.parse( stringParse( red ) || colors._default );
+ }
+
+ if ( type === "array" ) {
+ each( spaces.rgba.props, function( key, prop ) {
+ rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
+ });
+ return this;
+ }
+
+ if ( type === "object" ) {
+ if ( red instanceof color ) {
+ each( spaces, function( spaceName, space ) {
+ if ( red[ space.cache ] ) {
+ inst[ space.cache ] = red[ space.cache ].slice();
+ }
+ });
+ } else {
+ each( spaces, function( spaceName, space ) {
+ var cache = space.cache;
+ each( space.props, function( key, prop ) {
+
+ // if the cache doesn't exist, and we know how to convert
+ if ( !inst[ cache ] && space.to ) {
+
+ // if the value was null, we don't need to copy it
+ // if the key was alpha, we don't need to copy it either
+ if ( key === "alpha" || red[ key ] == null ) {
+ return;
+ }
+ inst[ cache ] = space.to( inst._rgba );
+ }
+
+ // this is the only case where we allow nulls for ALL properties.
+ // call clamp with alwaysAllowEmpty
+ inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
+ });
+
+ // everything defined but alpha?
+ if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
+ // use the default of 1
+ inst[ cache ][ 3 ] = 1;
+ if ( space.from ) {
+ inst._rgba = space.from( inst[ cache ] );
+ }
+ }
+ });
+ }
+ return this;
+ }
+ },
+ is: function( compare ) {
+ var is = color( compare ),
+ same = true,
+ inst = this;
+
+ each( spaces, function( _, space ) {
+ var localCache,
+ isCache = is[ space.cache ];
+ if (isCache) {
+ localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
+ each( space.props, function( _, prop ) {
+ if ( isCache[ prop.idx ] != null ) {
+ same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
+ return same;
+ }
+ });
+ }
+ return same;
+ });
+ return same;
+ },
+ _space: function() {
+ var used = [],
+ inst = this;
+ each( spaces, function( spaceName, space ) {
+ if ( inst[ space.cache ] ) {
+ used.push( spaceName );
+ }
+ });
+ return used.pop();
+ },
+ transition: function( other, distance ) {
+ var end = color( other ),
+ spaceName = end._space(),
+ space = spaces[ spaceName ],
+ startColor = this.alpha() === 0 ? color( "transparent" ) : this,
+ start = startColor[ space.cache ] || space.to( startColor._rgba ),
+ result = start.slice();
+
+ end = end[ space.cache ];
+ each( space.props, function( key, prop ) {
+ var index = prop.idx,
+ startValue = start[ index ],
+ endValue = end[ index ],
+ type = propTypes[ prop.type ] || {};
+
+ // if null, don't override start value
+ if ( endValue === null ) {
+ return;
+ }
+ // if null - use end
+ if ( startValue === null ) {
+ result[ index ] = endValue;
+ } else {
+ if ( type.mod ) {
+ if ( endValue - startValue > type.mod / 2 ) {
+ startValue += type.mod;
+ } else if ( startValue - endValue > type.mod / 2 ) {
+ startValue -= type.mod;
+ }
+ }
+ result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
+ }
+ });
+ return this[ spaceName ]( result );
+ },
+ blend: function( opaque ) {
+ // if we are already opaque - return ourself
+ if ( this._rgba[ 3 ] === 1 ) {
+ return this;
+ }
+
+ var rgb = this._rgba.slice(),
+ a = rgb.pop(),
+ blend = color( opaque )._rgba;
+
+ return color( jQuery.map( rgb, function( v, i ) {
+ return ( 1 - a ) * blend[ i ] + a * v;
+ }));
+ },
+ toRgbaString: function() {
+ var prefix = "rgba(",
+ rgba = jQuery.map( this._rgba, function( v, i ) {
+ return v == null ? ( i > 2 ? 1 : 0 ) : v;
+ });
+
+ if ( rgba[ 3 ] === 1 ) {
+ rgba.pop();
+ prefix = "rgb(";
+ }
+
+ return prefix + rgba.join() + ")";
+ },
+ toHslaString: function() {
+ var prefix = "hsla(",
+ hsla = jQuery.map( this.hsla(), function( v, i ) {
+ if ( v == null ) {
+ v = i > 2 ? 1 : 0;
+ }
+
+ // catch 1 and 2
+ if ( i && i < 3 ) {
+ v = Math.round( v * 100 ) + "%";
+ }
+ return v;
+ });
+
+ if ( hsla[ 3 ] === 1 ) {
+ hsla.pop();
+ prefix = "hsl(";
+ }
+ return prefix + hsla.join() + ")";
+ },
+ toHexString: function( includeAlpha ) {
+ var rgba = this._rgba.slice(),
+ alpha = rgba.pop();
+
+ if ( includeAlpha ) {
+ rgba.push( ~~( alpha * 255 ) );
+ }
+
+ return "#" + jQuery.map( rgba, function( v ) {
+
+ // default to 0 when nulls exist
+ v = ( v || 0 ).toString( 16 );
+ return v.length === 1 ? "0" + v : v;
+ }).join("");
+ },
+ toString: function() {
+ return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
+ }
+});
+color.fn.parse.prototype = color.fn;
+
+// hsla conversions adapted from:
+// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
+
+function hue2rgb( p, q, h ) {
+ h = ( h + 1 ) % 1;
+ if ( h * 6 < 1 ) {
+ return p + (q - p) * h * 6;
+ }
+ if ( h * 2 < 1) {
+ return q;
+ }
+ if ( h * 3 < 2 ) {
+ return p + (q - p) * ((2/3) - h) * 6;
+ }
+ return p;
+}
+
+spaces.hsla.to = function ( rgba ) {
+ if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
+ return [ null, null, null, rgba[ 3 ] ];
+ }
+ var r = rgba[ 0 ] / 255,
+ g = rgba[ 1 ] / 255,
+ b = rgba[ 2 ] / 255,
+ a = rgba[ 3 ],
+ max = Math.max( r, g, b ),
+ min = Math.min( r, g, b ),
+ diff = max - min,
+ add = max + min,
+ l = add * 0.5,
+ h, s;
+
+ if ( min === max ) {
+ h = 0;
+ } else if ( r === max ) {
+ h = ( 60 * ( g - b ) / diff ) + 360;
+ } else if ( g === max ) {
+ h = ( 60 * ( b - r ) / diff ) + 120;
+ } else {
+ h = ( 60 * ( r - g ) / diff ) + 240;
+ }
+
+ // chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
+ // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
+ if ( diff === 0 ) {
+ s = 0;
+ } else if ( l <= 0.5 ) {
+ s = diff / add;
+ } else {
+ s = diff / ( 2 - add );
+ }
+ return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
+};
+
+spaces.hsla.from = function ( hsla ) {
+ if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
+ return [ null, null, null, hsla[ 3 ] ];
+ }
+ var h = hsla[ 0 ] / 360,
+ s = hsla[ 1 ],
+ l = hsla[ 2 ],
+ a = hsla[ 3 ],
+ q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
+ p = 2 * l - q;
+
+ return [
+ Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
+ Math.round( hue2rgb( p, q, h ) * 255 ),
+ Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
+ a
+ ];
+};
+
+
+each( spaces, function( spaceName, space ) {
+ var props = space.props,
+ cache = space.cache,
+ to = space.to,
+ from = space.from;
+
+ // makes rgba() and hsla()
+ color.fn[ spaceName ] = function( value ) {
+
+ // generate a cache for this space if it doesn't exist
+ if ( to && !this[ cache ] ) {
+ this[ cache ] = to( this._rgba );
+ }
+ if ( value === undefined ) {
+ return this[ cache ].slice();
+ }
+
+ var ret,
+ type = jQuery.type( value ),
+ arr = ( type === "array" || type === "object" ) ? value : arguments,
+ local = this[ cache ].slice();
+
+ each( props, function( key, prop ) {
+ var val = arr[ type === "object" ? key : prop.idx ];
+ if ( val == null ) {
+ val = local[ prop.idx ];
+ }
+ local[ prop.idx ] = clamp( val, prop );
+ });
+
+ if ( from ) {
+ ret = color( from( local ) );
+ ret[ cache ] = local;
+ return ret;
+ } else {
+ return color( local );
+ }
+ };
+
+ // makes red() green() blue() alpha() hue() saturation() lightness()
+ each( props, function( key, prop ) {
+ // alpha is included in more than one space
+ if ( color.fn[ key ] ) {
+ return;
+ }
+ color.fn[ key ] = function( value ) {
+ var vtype = jQuery.type( value ),
+ fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),
+ local = this[ fn ](),
+ cur = local[ prop.idx ],
+ match;
+
+ if ( vtype === "undefined" ) {
+ return cur;
+ }
+
+ if ( vtype === "function" ) {
+ value = value.call( this, cur );
+ vtype = jQuery.type( value );
+ }
+ if ( value == null && prop.empty ) {
+ return this;
+ }
+ if ( vtype === "string" ) {
+ match = rplusequals.exec( value );
+ if ( match ) {
+ value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
+ }
+ }
+ local[ prop.idx ] = value;
+ return this[ fn ]( local );
+ };
+ });
+});
+
+// add cssHook and .fx.step function for each named hook.
+// accept a space separated string of properties
+color.hook = function( hook ) {
+ var hooks = hook.split( " " );
+ each( hooks, function( i, hook ) {
+ jQuery.cssHooks[ hook ] = {
+ set: function( elem, value ) {
+ var parsed, curElem,
+ backgroundColor = "";
+
+ if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) {
+ value = color( parsed || value );
+ if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
+ curElem = hook === "backgroundColor" ? elem.parentNode : elem;
+ while (
+ (backgroundColor === "" || backgroundColor === "transparent") &&
+ curElem && curElem.style
+ ) {
+ try {
+ backgroundColor = jQuery.css( curElem, "backgroundColor" );
+ curElem = curElem.parentNode;
+ } catch ( e ) {
+ }
+ }
+
+ value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
+ backgroundColor :
+ "_default" );
+ }
+
+ value = value.toRgbaString();
+ }
+ try {
+ elem.style[ hook ] = value;
+ } catch( e ) {
+ // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
+ }
+ }
+ };
+ jQuery.fx.step[ hook ] = function( fx ) {
+ if ( !fx.colorInit ) {
+ fx.start = color( fx.elem, hook );
+ fx.end = color( fx.end );
+ fx.colorInit = true;
+ }
+ jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
+ };
+ });
+
+};
+
+color.hook( stepHooks );
+
+jQuery.cssHooks.borderColor = {
+ expand: function( value ) {
+ var expanded = {};
+
+ each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
+ expanded[ "border" + part + "Color" ] = value;
+ });
+ return expanded;
+ }
+};
+
+// Basic color names only.
+// Usage of any of the other color names requires adding yourself or including
+// jquery.color.svg-names.js.
+colors = jQuery.Color.names = {
+ // 4.1. Basic color keywords
+ 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",
+
+ // 4.2.3. "transparent" color keyword
+ transparent: [ null, null, null, 0 ],
+
+ _default: "#ffffff"
+};
+
+})( jQuery );
+
+
+/******************************************************************************/
+/****************************** CLASS ANIMATIONS ******************************/
+/******************************************************************************/
+(function() {
+
+var classAnimationActions = [ "add", "remove", "toggle" ],
+ shorthandStyles = {
+ border: 1,
+ borderBottom: 1,
+ borderColor: 1,
+ borderLeft: 1,
+ borderRight: 1,
+ borderTop: 1,
+ borderWidth: 1,
+ margin: 1,
+ padding: 1
+ };
+
+$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
+ $.fx.step[ prop ] = function( fx ) {
+ if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
+ jQuery.style( fx.elem, prop, fx.end );
+ fx.setAttr = true;
+ }
+ };
+});
+
+function getElementStyles( elem ) {
+ var key, len,
+ style = elem.ownerDocument.defaultView ?
+ elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
+ elem.currentStyle,
+ styles = {};
+
+ if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
+ len = style.length;
+ while ( len-- ) {
+ key = style[ len ];
+ if ( typeof style[ key ] === "string" ) {
+ styles[ $.camelCase( key ) ] = style[ key ];
+ }
+ }
+ // support: Opera, IE <9
+ } else {
+ for ( key in style ) {
+ if ( typeof style[ key ] === "string" ) {
+ styles[ key ] = style[ key ];
+ }
+ }
+ }
+
+ return styles;
+}
+
+
+function styleDifference( oldStyle, newStyle ) {
+ var diff = {},
+ name, value;
+
+ for ( name in newStyle ) {
+ value = newStyle[ name ];
+ if ( oldStyle[ name ] !== value ) {
+ if ( !shorthandStyles[ name ] ) {
+ if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
+ diff[ name ] = value;
+ }
+ }
+ }
+ }
+
+ return diff;
+}
+
+// support: jQuery <1.8
+if ( !$.fn.addBack ) {
+ $.fn.addBack = function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter( selector )
+ );
+ };
+}
+
+$.effects.animateClass = function( value, duration, easing, callback ) {
+ var o = $.speed( duration, easing, callback );
+
+ return this.queue( function() {
+ var animated = $( this ),
+ baseClass = animated.attr( "class" ) || "",
+ applyClassChange,
+ allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
+
+ // map the animated objects to store the original styles.
+ allAnimations = allAnimations.map(function() {
+ var el = $( this );
+ return {
+ el: el,
+ start: getElementStyles( this )
+ };
+ });
+
+ // apply class change
+ applyClassChange = function() {
+ $.each( classAnimationActions, function(i, action) {
+ if ( value[ action ] ) {
+ animated[ action + "Class" ]( value[ action ] );
+ }
+ });
+ };
+ applyClassChange();
+
+ // map all animated objects again - calculate new styles and diff
+ allAnimations = allAnimations.map(function() {
+ this.end = getElementStyles( this.el[ 0 ] );
+ this.diff = styleDifference( this.start, this.end );
+ return this;
+ });
+
+ // apply original class
+ animated.attr( "class", baseClass );
+
+ // map all animated objects again - this time collecting a promise
+ allAnimations = allAnimations.map(function() {
+ var styleInfo = this,
+ dfd = $.Deferred(),
+ opts = $.extend({}, o, {
+ queue: false,
+ complete: function() {
+ dfd.resolve( styleInfo );
+ }
+ });
+
+ this.el.animate( this.diff, opts );
+ return dfd.promise();
+ });
+
+ // once all animations have completed:
+ $.when.apply( $, allAnimations.get() ).done(function() {
+
+ // set the final class
+ applyClassChange();
+
+ // for each animated element,
+ // clear all css properties that were animated
+ $.each( arguments, function() {
+ var el = this.el;
+ $.each( this.diff, function(key) {
+ el.css( key, "" );
+ });
+ });
+
+ // this is guarnteed to be there if you use jQuery.speed()
+ // it also handles dequeuing the next anim...
+ o.complete.call( animated[ 0 ] );
+ });
+ });
+};
+
+$.fn.extend({
+ addClass: (function( orig ) {
+ return function( classNames, speed, easing, callback ) {
+ return speed ?
+ $.effects.animateClass.call( this,
+ { add: classNames }, speed, easing, callback ) :
+ orig.apply( this, arguments );
+ };
+ })( $.fn.addClass ),
+
+ removeClass: (function( orig ) {
+ return function( classNames, speed, easing, callback ) {
+ return arguments.length > 1 ?
+ $.effects.animateClass.call( this,
+ { remove: classNames }, speed, easing, callback ) :
+ orig.apply( this, arguments );
+ };
+ })( $.fn.removeClass ),
+
+ toggleClass: (function( orig ) {
+ return function( classNames, force, speed, easing, callback ) {
+ if ( typeof force === "boolean" || force === undefined ) {
+ if ( !speed ) {
+ // without speed parameter
+ return orig.apply( this, arguments );
+ } else {
+ return $.effects.animateClass.call( this,
+ (force ? { add: classNames } : { remove: classNames }),
+ speed, easing, callback );
+ }
+ } else {
+ // without force parameter
+ return $.effects.animateClass.call( this,
+ { toggle: classNames }, force, speed, easing );
+ }
+ };
+ })( $.fn.toggleClass ),
+
+ switchClass: function( remove, add, speed, easing, callback) {
+ return $.effects.animateClass.call( this, {
+ add: add,
+ remove: remove
+ }, speed, easing, callback );
+ }
+});
+
+})();
+
+/******************************************************************************/
+/*********************************** EFFECTS **********************************/
+/******************************************************************************/
+
+(function() {
+
+$.extend( $.effects, {
+ version: "1.10.4",
+
+ // Saves a set of properties in a data storage
+ save: function( element, set ) {
+ for( var i=0; i < set.length; i++ ) {
+ if ( set[ i ] !== null ) {
+ element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
+ }
+ }
+ },
+
+ // Restores a set of previously saved properties from a data storage
+ restore: function( element, set ) {
+ var val, i;
+ for( i=0; i < set.length; i++ ) {
+ if ( set[ i ] !== null ) {
+ val = element.data( dataSpace + set[ i ] );
+ // support: jQuery 1.6.2
+ // http://bugs.jquery.com/ticket/9917
+ // jQuery 1.6.2 incorrectly returns undefined for any falsy value.
+ // We can't differentiate between "" and 0 here, so we just assume
+ // empty string since it's likely to be a more common value...
+ if ( val === undefined ) {
+ val = "";
+ }
+ element.css( set[ i ], val );
+ }
+ }
+ },
+
+ setMode: function( el, mode ) {
+ if (mode === "toggle") {
+ mode = el.is( ":hidden" ) ? "show" : "hide";
+ }
+ return mode;
+ },
+
+ // Translates a [top,left] array into a baseline value
+ // this should be a little more flexible in the future to handle a string & hash
+ getBaseline: function( origin, original ) {
+ var y, x;
+ switch ( origin[ 0 ] ) {
+ case "top": y = 0; break;
+ case "middle": y = 0.5; break;
+ case "bottom": y = 1; break;
+ default: y = origin[ 0 ] / original.height;
+ }
+ switch ( origin[ 1 ] ) {
+ case "left": x = 0; break;
+ case "center": x = 0.5; break;
+ case "right": x = 1; break;
+ default: x = origin[ 1 ] / original.width;
+ }
+ return {
+ x: x,
+ y: y
+ };
+ },
+
+ // Wraps the element around a wrapper that copies position properties
+ createWrapper: function( element ) {
+
+ // if the element is already wrapped, return it
+ if ( element.parent().is( ".ui-effects-wrapper" )) {
+ return element.parent();
+ }
+
+ // wrap the element
+ var props = {
+ width: element.outerWidth(true),
+ height: element.outerHeight(true),
+ "float": element.css( "float" )
+ },
+ wrapper = $( "<div></div>" )
+ .addClass( "ui-effects-wrapper" )
+ .css({
+ fontSize: "100%",
+ background: "transparent",
+ border: "none",
+ margin: 0,
+ padding: 0
+ }),
+ // Store the size in case width/height are defined in % - Fixes #5245
+ size = {
+ width: element.width(),
+ height: element.height()
+ },
+ active = document.activeElement;
+
+ // support: Firefox
+ // Firefox incorrectly exposes anonymous content
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=561664
+ try {
+ active.id;
+ } catch( e ) {
+ active = document.body;
+ }
+
+ element.wrap( wrapper );
+
+ // Fixes #7595 - Elements lose focus when wrapped.
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
+ $( active ).focus();
+ }
+
+ wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
+
+ // transfer positioning properties to the wrapper
+ if ( element.css( "position" ) === "static" ) {
+ wrapper.css({ position: "relative" });
+ element.css({ position: "relative" });
+ } else {
+ $.extend( props, {
+ position: element.css( "position" ),
+ zIndex: element.css( "z-index" )
+ });
+ $.each([ "top", "left", "bottom", "right" ], function(i, pos) {
+ props[ pos ] = element.css( pos );
+ if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
+ props[ pos ] = "auto";
+ }
+ });
+ element.css({
+ position: "relative",
+ top: 0,
+ left: 0,
+ right: "auto",
+ bottom: "auto"
+ });
+ }
+ element.css(size);
+
+ return wrapper.css( props ).show();
+ },
+
+ removeWrapper: function( element ) {
+ var active = document.activeElement;
+
+ if ( element.parent().is( ".ui-effects-wrapper" ) ) {
+ element.parent().replaceWith( element );
+
+ // Fixes #7595 - Elements lose focus when wrapped.
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
+ $( active ).focus();
+ }
+ }
+
+
+ return element;
+ },
+
+ setTransition: function( element, list, factor, value ) {
+ value = value || {};
+ $.each( list, function( i, x ) {
+ var unit = element.cssUnit( x );
+ if ( unit[ 0 ] > 0 ) {
+ value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
+ }
+ });
+ return value;
+ }
+});
+
+// return an effect options object for the given parameters:
+function _normalizeArguments( effect, options, speed, callback ) {
+
+ // allow passing all options as the first parameter
+ if ( $.isPlainObject( effect ) ) {
+ options = effect;
+ effect = effect.effect;
+ }
+
+ // convert to an object
+ effect = { effect: effect };
+
+ // catch (effect, null, ...)
+ if ( options == null ) {
+ options = {};
+ }
+
+ // catch (effect, callback)
+ if ( $.isFunction( options ) ) {
+ callback = options;
+ speed = null;
+ options = {};
+ }
+
+ // catch (effect, speed, ?)
+ if ( typeof options === "number" || $.fx.speeds[ options ] ) {
+ callback = speed;
+ speed = options;
+ options = {};
+ }
+
+ // catch (effect, options, callback)
+ if ( $.isFunction( speed ) ) {
+ callback = speed;
+ speed = null;
+ }
+
+ // add options to effect
+ if ( options ) {
+ $.extend( effect, options );
+ }
+
+ speed = speed || options.duration;
+ effect.duration = $.fx.off ? 0 :
+ typeof speed === "number" ? speed :
+ speed in $.fx.speeds ? $.fx.speeds[ speed ] :
+ $.fx.speeds._default;
+
+ effect.complete = callback || options.complete;
+
+ return effect;
+}
+
+function standardAnimationOption( option ) {
+ // Valid standard speeds (nothing, number, named speed)
+ if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
+ return true;
+ }
+
+ // Invalid strings - treat as "normal" speed
+ if ( typeof option === "string" && !$.effects.effect[ option ] ) {
+ return true;
+ }
+
+ // Complete callback
+ if ( $.isFunction( option ) ) {
+ return true;
+ }
+
+ // Options hash (but not naming an effect)
+ if ( typeof option === "object" && !option.effect ) {
+ return true;
+ }
+
+ // Didn't match any standard API
+ return false;
+}
+
+$.fn.extend({
+ effect: function( /* effect, options, speed, callback */ ) {
+ var args = _normalizeArguments.apply( this, arguments ),
+ mode = args.mode,
+ queue = args.queue,
+ effectMethod = $.effects.effect[ args.effect ];
+
+ if ( $.fx.off || !effectMethod ) {
+ // delegate to the original method (e.g., .show()) if possible
+ if ( mode ) {
+ return this[ mode ]( args.duration, args.complete );
+ } else {
+ return this.each( function() {
+ if ( args.complete ) {
+ args.complete.call( this );
+ }
+ });
+ }
+ }
+
+ function run( next ) {
+ var elem = $( this ),
+ complete = args.complete,
+ mode = args.mode;
+
+ function done() {
+ if ( $.isFunction( complete ) ) {
+ complete.call( elem[0] );
+ }
+ if ( $.isFunction( next ) ) {
+ next();
+ }
+ }
+
+ // If the element already has the correct final state, delegate to
+ // the core methods so the internal tracking of "olddisplay" works.
+ if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
+ elem[ mode ]();
+ done();
+ } else {
+ effectMethod.call( elem[0], args, done );
+ }
+ }
+
+ return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
+ },
+
+ show: (function( orig ) {
+ return function( option ) {
+ if ( standardAnimationOption( option ) ) {
+ return orig.apply( this, arguments );
+ } else {
+ var args = _normalizeArguments.apply( this, arguments );
+ args.mode = "show";
+ return this.effect.call( this, args );
+ }
+ };
+ })( $.fn.show ),
+
+ hide: (function( orig ) {
+ return function( option ) {
+ if ( standardAnimationOption( option ) ) {
+ return orig.apply( this, arguments );
+ } else {
+ var args = _normalizeArguments.apply( this, arguments );
+ args.mode = "hide";
+ return this.effect.call( this, args );
+ }
+ };
+ })( $.fn.hide ),
+
+ toggle: (function( orig ) {
+ return function( option ) {
+ if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
+ return orig.apply( this, arguments );
+ } else {
+ var args = _normalizeArguments.apply( this, arguments );
+ args.mode = "toggle";
+ return this.effect.call( this, args );
+ }
+ };
+ })( $.fn.toggle ),
+
+ // helper functions
+ cssUnit: function(key) {
+ var style = this.css( key ),
+ val = [];
+
+ $.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
+ if ( style.indexOf( unit ) > 0 ) {
+ val = [ parseFloat( style ), unit ];
+ }
+ });
+ return val;
+ }
+});
+
+})();
+
+/******************************************************************************/
+/*********************************** EASING ***********************************/
+/******************************************************************************/
+
+(function() {
+
+// based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
+
+var baseEasings = {};
+
+$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
+ baseEasings[ name ] = function( p ) {
+ return Math.pow( p, i + 2 );
+ };
+});
+
+$.extend( baseEasings, {
+ Sine: function ( p ) {
+ return 1 - Math.cos( p * Math.PI / 2 );
+ },
+ Circ: function ( p ) {
+ return 1 - Math.sqrt( 1 - p * p );
+ },
+ Elastic: function( p ) {
+ return p === 0 || p === 1 ? p :
+ -Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
+ },
+ Back: function( p ) {
+ return p * p * ( 3 * p - 2 );
+ },
+ Bounce: function ( p ) {
+ var pow2,
+ bounce = 4;
+
+ while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
+ return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
+ }
+});
+
+$.each( baseEasings, function( name, easeIn ) {
+ $.easing[ "easeIn" + name ] = easeIn;
+ $.easing[ "easeOut" + name ] = function( p ) {
+ return 1 - easeIn( 1 - p );
+ };
+ $.easing[ "easeInOut" + name ] = function( p ) {
+ return p < 0.5 ?
+ easeIn( p * 2 ) / 2 :
+ 1 - easeIn( p * -2 + 2 ) / 2;
+ };
+});
+
+})();
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+var uid = 0,
+ hideProps = {},
+ showProps = {};
+
+hideProps.height = hideProps.paddingTop = hideProps.paddingBottom =
+ hideProps.borderTopWidth = hideProps.borderBottomWidth = "hide";
+showProps.height = showProps.paddingTop = showProps.paddingBottom =
+ showProps.borderTopWidth = showProps.borderBottomWidth = "show";
+
+$.widget( "ui.accordion", {
+ version: "1.10.4",
+ options: {
+ active: 0,
+ animate: {},
+ collapsible: false,
+ event: "click",
+ header: "> li > :first-child,> :not(li):even",
+ heightStyle: "auto",
+ icons: {
+ activeHeader: "ui-icon-triangle-1-s",
+ header: "ui-icon-triangle-1-e"
+ },
+
+ // callbacks
+ activate: null,
+ beforeActivate: null
+ },
+
+ _create: function() {
+ var options = this.options;
+ this.prevShow = this.prevHide = $();
+ this.element.addClass( "ui-accordion ui-widget ui-helper-reset" )
+ // ARIA
+ .attr( "role", "tablist" );
+
+ // don't allow collapsible: false and active: false / null
+ if ( !options.collapsible && (options.active === false || options.active == null) ) {
+ options.active = 0;
+ }
+
+ this._processPanels();
+ // handle negative values
+ if ( options.active < 0 ) {
+ options.active += this.headers.length;
+ }
+ this._refresh();
+ },
+
+ _getCreateEventData: function() {
+ return {
+ header: this.active,
+ panel: !this.active.length ? $() : this.active.next(),
+ content: !this.active.length ? $() : this.active.next()
+ };
+ },
+
+ _createIcons: function() {
+ var icons = this.options.icons;
+ if ( icons ) {
+ $( "<span>" )
+ .addClass( "ui-accordion-header-icon ui-icon " + icons.header )
+ .prependTo( this.headers );
+ this.active.children( ".ui-accordion-header-icon" )
+ .removeClass( icons.header )
+ .addClass( icons.activeHeader );
+ this.headers.addClass( "ui-accordion-icons" );
+ }
+ },
+
+ _destroyIcons: function() {
+ this.headers
+ .removeClass( "ui-accordion-icons" )
+ .children( ".ui-accordion-header-icon" )
+ .remove();
+ },
+
+ _destroy: function() {
+ var contents;
+
+ // clean up main element
+ this.element
+ .removeClass( "ui-accordion ui-widget ui-helper-reset" )
+ .removeAttr( "role" );
+
+ // clean up headers
+ this.headers
+ .removeClass( "ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-expanded" )
+ .removeAttr( "aria-selected" )
+ .removeAttr( "aria-controls" )
+ .removeAttr( "tabIndex" )
+ .each(function() {
+ if ( /^ui-accordion/.test( this.id ) ) {
+ this.removeAttribute( "id" );
+ }
+ });
+ this._destroyIcons();
+
+ // clean up content panels
+ contents = this.headers.next()
+ .css( "display", "" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-hidden" )
+ .removeAttr( "aria-labelledby" )
+ .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled" )
+ .each(function() {
+ if ( /^ui-accordion/.test( this.id ) ) {
+ this.removeAttribute( "id" );
+ }
+ });
+ if ( this.options.heightStyle !== "content" ) {
+ contents.css( "height", "" );
+ }
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "active" ) {
+ // _activate() will handle invalid values and update this.options
+ this._activate( value );
+ return;
+ }
+
+ if ( key === "event" ) {
+ if ( this.options.event ) {
+ this._off( this.headers, this.options.event );
+ }
+ this._setupEvents( value );
+ }
+
+ this._super( key, value );
+
+ // setting collapsible: false while collapsed; open first panel
+ if ( key === "collapsible" && !value && this.options.active === false ) {
+ this._activate( 0 );
+ }
+
+ if ( key === "icons" ) {
+ this._destroyIcons();
+ if ( value ) {
+ this._createIcons();
+ }
+ }
+
+ // #5332 - opacity doesn't cascade to positioned elements in IE
+ // so we need to add the disabled class to the headers and panels
+ if ( key === "disabled" ) {
+ this.headers.add( this.headers.next() )
+ .toggleClass( "ui-state-disabled", !!value );
+ }
+ },
+
+ _keydown: function( event ) {
+ if ( event.altKey || event.ctrlKey ) {
+ return;
+ }
+
+ var keyCode = $.ui.keyCode,
+ length = this.headers.length,
+ currentIndex = this.headers.index( event.target ),
+ toFocus = false;
+
+ switch ( event.keyCode ) {
+ case keyCode.RIGHT:
+ case keyCode.DOWN:
+ toFocus = this.headers[ ( currentIndex + 1 ) % length ];
+ break;
+ case keyCode.LEFT:
+ case keyCode.UP:
+ toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
+ break;
+ case keyCode.SPACE:
+ case keyCode.ENTER:
+ this._eventHandler( event );
+ break;
+ case keyCode.HOME:
+ toFocus = this.headers[ 0 ];
+ break;
+ case keyCode.END:
+ toFocus = this.headers[ length - 1 ];
+ break;
+ }
+
+ if ( toFocus ) {
+ $( event.target ).attr( "tabIndex", -1 );
+ $( toFocus ).attr( "tabIndex", 0 );
+ toFocus.focus();
+ event.preventDefault();
+ }
+ },
+
+ _panelKeyDown : function( event ) {
+ if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
+ $( event.currentTarget ).prev().focus();
+ }
+ },
+
+ refresh: function() {
+ var options = this.options;
+ this._processPanels();
+
+ // was collapsed or no panel
+ if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) {
+ options.active = false;
+ this.active = $();
+ // active false only when collapsible is true
+ } else if ( options.active === false ) {
+ this._activate( 0 );
+ // was active, but active panel is gone
+ } else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
+ // all remaining panel are disabled
+ if ( this.headers.length === this.headers.find(".ui-state-disabled").length ) {
+ options.active = false;
+ this.active = $();
+ // activate previous panel
+ } else {
+ this._activate( Math.max( 0, options.active - 1 ) );
+ }
+ // was active, active panel still exists
+ } else {
+ // make sure active index is correct
+ options.active = this.headers.index( this.active );
+ }
+
+ this._destroyIcons();
+
+ this._refresh();
+ },
+
+ _processPanels: function() {
+ this.headers = this.element.find( this.options.header )
+ .addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" );
+
+ this.headers.next()
+ .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
+ .filter(":not(.ui-accordion-content-active)")
+ .hide();
+ },
+
+ _refresh: function() {
+ var maxHeight,
+ options = this.options,
+ heightStyle = options.heightStyle,
+ parent = this.element.parent(),
+ accordionId = this.accordionId = "ui-accordion-" +
+ (this.element.attr( "id" ) || ++uid);
+
+ this.active = this._findActive( options.active )
+ .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
+ .removeClass( "ui-corner-all" );
+ this.active.next()
+ .addClass( "ui-accordion-content-active" )
+ .show();
+
+ this.headers
+ .attr( "role", "tab" )
+ .each(function( i ) {
+ var header = $( this ),
+ headerId = header.attr( "id" ),
+ panel = header.next(),
+ panelId = panel.attr( "id" );
+ if ( !headerId ) {
+ headerId = accordionId + "-header-" + i;
+ header.attr( "id", headerId );
+ }
+ if ( !panelId ) {
+ panelId = accordionId + "-panel-" + i;
+ panel.attr( "id", panelId );
+ }
+ header.attr( "aria-controls", panelId );
+ panel.attr( "aria-labelledby", headerId );
+ })
+ .next()
+ .attr( "role", "tabpanel" );
+
+ this.headers
+ .not( this.active )
+ .attr({
+ "aria-selected": "false",
+ "aria-expanded": "false",
+ tabIndex: -1
+ })
+ .next()
+ .attr({
+ "aria-hidden": "true"
+ })
+ .hide();
+
+ // make sure at least one header is in the tab order
+ if ( !this.active.length ) {
+ this.headers.eq( 0 ).attr( "tabIndex", 0 );
+ } else {
+ this.active.attr({
+ "aria-selected": "true",
+ "aria-expanded": "true",
+ tabIndex: 0
+ })
+ .next()
+ .attr({
+ "aria-hidden": "false"
+ });
+ }
+
+ this._createIcons();
+
+ this._setupEvents( options.event );
+
+ if ( heightStyle === "fill" ) {
+ maxHeight = parent.height();
+ this.element.siblings( ":visible" ).each(function() {
+ var elem = $( this ),
+ position = elem.css( "position" );
+
+ if ( position === "absolute" || position === "fixed" ) {
+ return;
+ }
+ maxHeight -= elem.outerHeight( true );
+ });
+
+ this.headers.each(function() {
+ maxHeight -= $( this ).outerHeight( true );
+ });
+
+ this.headers.next()
+ .each(function() {
+ $( this ).height( Math.max( 0, maxHeight -
+ $( this ).innerHeight() + $( this ).height() ) );
+ })
+ .css( "overflow", "auto" );
+ } else if ( heightStyle === "auto" ) {
+ maxHeight = 0;
+ this.headers.next()
+ .each(function() {
+ maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
+ })
+ .height( maxHeight );
+ }
+ },
+
+ _activate: function( index ) {
+ var active = this._findActive( index )[ 0 ];
+
+ // trying to activate the already active panel
+ if ( active === this.active[ 0 ] ) {
+ return;
+ }
+
+ // trying to collapse, simulate a click on the currently active header
+ active = active || this.active[ 0 ];
+
+ this._eventHandler({
+ target: active,
+ currentTarget: active,
+ preventDefault: $.noop
+ });
+ },
+
+ _findActive: function( selector ) {
+ return typeof selector === "number" ? this.headers.eq( selector ) : $();
+ },
+
+ _setupEvents: function( event ) {
+ var events = {
+ keydown: "_keydown"
+ };
+ if ( event ) {
+ $.each( event.split(" "), function( index, eventName ) {
+ events[ eventName ] = "_eventHandler";
+ });
+ }
+
+ this._off( this.headers.add( this.headers.next() ) );
+ this._on( this.headers, events );
+ this._on( this.headers.next(), { keydown: "_panelKeyDown" });
+ this._hoverable( this.headers );
+ this._focusable( this.headers );
+ },
+
+ _eventHandler: function( event ) {
+ var options = this.options,
+ active = this.active,
+ clicked = $( event.currentTarget ),
+ clickedIsActive = clicked[ 0 ] === active[ 0 ],
+ collapsing = clickedIsActive && options.collapsible,
+ toShow = collapsing ? $() : clicked.next(),
+ toHide = active.next(),
+ eventData = {
+ oldHeader: active,
+ oldPanel: toHide,
+ newHeader: collapsing ? $() : clicked,
+ newPanel: toShow
+ };
+
+ event.preventDefault();
+
+ if (
+ // click on active header, but not collapsible
+ ( clickedIsActive && !options.collapsible ) ||
+ // allow canceling activation
+ ( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
+ return;
+ }
+
+ options.active = collapsing ? false : this.headers.index( clicked );
+
+ // when the call to ._toggle() comes after the class changes
+ // it causes a very odd bug in IE 8 (see #6720)
+ this.active = clickedIsActive ? $() : clicked;
+ this._toggle( eventData );
+
+ // switch classes
+ // corner classes on the previously active header stay after the animation
+ active.removeClass( "ui-accordion-header-active ui-state-active" );
+ if ( options.icons ) {
+ active.children( ".ui-accordion-header-icon" )
+ .removeClass( options.icons.activeHeader )
+ .addClass( options.icons.header );
+ }
+
+ if ( !clickedIsActive ) {
+ clicked
+ .removeClass( "ui-corner-all" )
+ .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" );
+ if ( options.icons ) {
+ clicked.children( ".ui-accordion-header-icon" )
+ .removeClass( options.icons.header )
+ .addClass( options.icons.activeHeader );
+ }
+
+ clicked
+ .next()
+ .addClass( "ui-accordion-content-active" );
+ }
+ },
+
+ _toggle: function( data ) {
+ var toShow = data.newPanel,
+ toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
+
+ // handle activating a panel during the animation for another activation
+ this.prevShow.add( this.prevHide ).stop( true, true );
+ this.prevShow = toShow;
+ this.prevHide = toHide;
+
+ if ( this.options.animate ) {
+ this._animate( toShow, toHide, data );
+ } else {
+ toHide.hide();
+ toShow.show();
+ this._toggleComplete( data );
+ }
+
+ toHide.attr({
+ "aria-hidden": "true"
+ });
+ toHide.prev().attr( "aria-selected", "false" );
+ // if we're switching panels, remove the old header from the tab order
+ // if we're opening from collapsed state, remove the previous header from the tab order
+ // if we're collapsing, then keep the collapsing header in the tab order
+ if ( toShow.length && toHide.length ) {
+ toHide.prev().attr({
+ "tabIndex": -1,
+ "aria-expanded": "false"
+ });
+ } else if ( toShow.length ) {
+ this.headers.filter(function() {
+ return $( this ).attr( "tabIndex" ) === 0;
+ })
+ .attr( "tabIndex", -1 );
+ }
+
+ toShow
+ .attr( "aria-hidden", "false" )
+ .prev()
+ .attr({
+ "aria-selected": "true",
+ tabIndex: 0,
+ "aria-expanded": "true"
+ });
+ },
+
+ _animate: function( toShow, toHide, data ) {
+ var total, easing, duration,
+ that = this,
+ adjust = 0,
+ down = toShow.length &&
+ ( !toHide.length || ( toShow.index() < toHide.index() ) ),
+ animate = this.options.animate || {},
+ options = down && animate.down || animate,
+ complete = function() {
+ that._toggleComplete( data );
+ };
+
+ if ( typeof options === "number" ) {
+ duration = options;
+ }
+ if ( typeof options === "string" ) {
+ easing = options;
+ }
+ // fall back from options to animation in case of partial down settings
+ easing = easing || options.easing || animate.easing;
+ duration = duration || options.duration || animate.duration;
+
+ if ( !toHide.length ) {
+ return toShow.animate( showProps, duration, easing, complete );
+ }
+ if ( !toShow.length ) {
+ return toHide.animate( hideProps, duration, easing, complete );
+ }
+
+ total = toShow.show().outerHeight();
+ toHide.animate( hideProps, {
+ duration: duration,
+ easing: easing,
+ step: function( now, fx ) {
+ fx.now = Math.round( now );
+ }
+ });
+ toShow
+ .hide()
+ .animate( showProps, {
+ duration: duration,
+ easing: easing,
+ complete: complete,
+ step: function( now, fx ) {
+ fx.now = Math.round( now );
+ if ( fx.prop !== "height" ) {
+ adjust += fx.now;
+ } else if ( that.options.heightStyle !== "content" ) {
+ fx.now = Math.round( total - toHide.outerHeight() - adjust );
+ adjust = 0;
+ }
+ }
+ });
+ },
+
+ _toggleComplete: function( data ) {
+ var toHide = data.oldPanel;
+
+ toHide
+ .removeClass( "ui-accordion-content-active" )
+ .prev()
+ .removeClass( "ui-corner-top" )
+ .addClass( "ui-corner-all" );
+
+ // Work around for rendering bug in IE (#5421)
+ if ( toHide.length ) {
+ toHide.parent()[0].className = toHide.parent()[0].className;
+ }
+ this._trigger( "activate", null, data );
+ }
+});
+
+})( jQuery );
+
+(function( $, undefined ) {
+
+$.widget( "ui.autocomplete", {
+ version: "1.10.4",
+ defaultElement: "<input>",
+ options: {
+ appendTo: null,
+ autoFocus: false,
+ delay: 300,
+ minLength: 1,
+ position: {
+ my: "left top",
+ at: "left bottom",
+ collision: "none"
+ },
+ source: null,
+
+ // callbacks
+ change: null,
+ close: null,
+ focus: null,
+ open: null,
+ response: null,
+ search: null,
+ select: null
+ },
+
+ requestIndex: 0,
+ pending: 0,
+
+ _create: function() {
+ // Some browsers only repeat keydown events, not keypress events,
+ // so we use the suppressKeyPress flag to determine if we've already
+ // handled the keydown event. #7269
+ // Unfortunately the code for & in keypress is the same as the up arrow,
+ // so we use the suppressKeyPressRepeat flag to avoid handling keypress
+ // events when we know the keydown event was used to modify the
+ // search term. #7799
+ var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
+ nodeName = this.element[0].nodeName.toLowerCase(),
+ isTextarea = nodeName === "textarea",
+ isInput = nodeName === "input";
+
+ this.isMultiLine =
+ // Textareas are always multi-line
+ isTextarea ? true :
+ // Inputs are always single-line, even if inside a contentEditable element
+ // IE also treats inputs as contentEditable
+ isInput ? false :
+ // All other element types are determined by whether or not they're contentEditable
+ this.element.prop( "isContentEditable" );
+
+ this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
+ this.isNewMenu = true;
+
+ this.element
+ .addClass( "ui-autocomplete-input" )
+ .attr( "autocomplete", "off" );
+
+ this._on( this.element, {
+ keydown: function( event ) {
+ if ( this.element.prop( "readOnly" ) ) {
+ suppressKeyPress = true;
+ suppressInput = true;
+ suppressKeyPressRepeat = true;
+ return;
+ }
+
+ suppressKeyPress = false;
+ suppressInput = false;
+ suppressKeyPressRepeat = false;
+ var keyCode = $.ui.keyCode;
+ switch( event.keyCode ) {
+ case keyCode.PAGE_UP:
+ suppressKeyPress = true;
+ this._move( "previousPage", event );
+ break;
+ case keyCode.PAGE_DOWN:
+ suppressKeyPress = true;
+ this._move( "nextPage", event );
+ break;
+ case keyCode.UP:
+ suppressKeyPress = true;
+ this._keyEvent( "previous", event );
+ break;
+ case keyCode.DOWN:
+ suppressKeyPress = true;
+ this._keyEvent( "next", event );
+ break;
+ case keyCode.ENTER:
+ case keyCode.NUMPAD_ENTER:
+ // when menu is open and has focus
+ if ( this.menu.active ) {
+ // #6055 - Opera still allows the keypress to occur
+ // which causes forms to submit
+ suppressKeyPress = true;
+ event.preventDefault();
+ this.menu.select( event );
+ }
+ break;
+ case keyCode.TAB:
+ if ( this.menu.active ) {
+ this.menu.select( event );
+ }
+ break;
+ case keyCode.ESCAPE:
+ if ( this.menu.element.is( ":visible" ) ) {
+ this._value( this.term );
+ this.close( event );
+ // Different browsers have different default behavior for escape
+ // Single press can mean undo or clear
+ // Double press in IE means clear the whole form
+ event.preventDefault();
+ }
+ break;
+ default:
+ suppressKeyPressRepeat = true;
+ // search timeout should be triggered before the input value is changed
+ this._searchTimeout( event );
+ break;
+ }
+ },
+ keypress: function( event ) {
+ if ( suppressKeyPress ) {
+ suppressKeyPress = false;
+ if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
+ event.preventDefault();
+ }
+ return;
+ }
+ if ( suppressKeyPressRepeat ) {
+ return;
+ }
+
+ // replicate some key handlers to allow them to repeat in Firefox and Opera
+ var keyCode = $.ui.keyCode;
+ switch( event.keyCode ) {
+ case keyCode.PAGE_UP:
+ this._move( "previousPage", event );
+ break;
+ case keyCode.PAGE_DOWN:
+ this._move( "nextPage", event );
+ break;
+ case keyCode.UP:
+ this._keyEvent( "previous", event );
+ break;
+ case keyCode.DOWN:
+ this._keyEvent( "next", event );
+ break;
+ }
+ },
+ input: function( event ) {
+ if ( suppressInput ) {
+ suppressInput = false;
+ event.preventDefault();
+ return;
+ }
+ this._searchTimeout( event );
+ },
+ focus: function() {
+ this.selectedItem = null;
+ this.previous = this._value();
+ },
+ blur: function( event ) {
+ if ( this.cancelBlur ) {
+ delete this.cancelBlur;
+ return;
+ }
+
+ clearTimeout( this.searching );
+ this.close( event );
+ this._change( event );
+ }
+ });
+
+ this._initSource();
+ this.menu = $( "<ul>" )
+ .addClass( "ui-autocomplete ui-front" )
+ .appendTo( this._appendTo() )
+ .menu({
+ // disable ARIA support, the live region takes care of that
+ role: null
+ })
+ .hide()
+ .data( "ui-menu" );
+
+ this._on( this.menu.element, {
+ mousedown: function( event ) {
+ // prevent moving focus out of the text field
+ event.preventDefault();
+
+ // IE doesn't prevent moving focus even with event.preventDefault()
+ // so we set a flag to know when we should ignore the blur event
+ this.cancelBlur = true;
+ this._delay(function() {
+ delete this.cancelBlur;
+ });
+
+ // clicking on the scrollbar causes focus to shift to the body
+ // but we can't detect a mouseup or a click immediately afterward
+ // so we have to track the next mousedown and close the menu if
+ // the user clicks somewhere outside of the autocomplete
+ var menuElement = this.menu.element[ 0 ];
+ if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
+ this._delay(function() {
+ var that = this;
+ this.document.one( "mousedown", function( event ) {
+ if ( event.target !== that.element[ 0 ] &&
+ event.target !== menuElement &&
+ !$.contains( menuElement, event.target ) ) {
+ that.close();
+ }
+ });
+ });
+ }
+ },
+ menufocus: function( event, ui ) {
+ // support: Firefox
+ // Prevent accidental activation of menu items in Firefox (#7024 #9118)
+ if ( this.isNewMenu ) {
+ this.isNewMenu = false;
+ if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
+ this.menu.blur();
+
+ this.document.one( "mousemove", function() {
+ $( event.target ).trigger( event.originalEvent );
+ });
+
+ return;
+ }
+ }
+
+ var item = ui.item.data( "ui-autocomplete-item" );
+ if ( false !== this._trigger( "focus", event, { item: item } ) ) {
+ // use value to match what will end up in the input, if it was a key event
+ if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
+ this._value( item.value );
+ }
+ } else {
+ // Normally the input is populated with the item's value as the
+ // menu is navigated, causing screen readers to notice a change and
+ // announce the item. Since the focus event was canceled, this doesn't
+ // happen, so we update the live region so that screen readers can
+ // still notice the change and announce it.
+ this.liveRegion.text( item.value );
+ }
+ },
+ menuselect: function( event, ui ) {
+ var item = ui.item.data( "ui-autocomplete-item" ),
+ previous = this.previous;
+
+ // only trigger when focus was lost (click on menu)
+ if ( this.element[0] !== this.document[0].activeElement ) {
+ this.element.focus();
+ this.previous = previous;
+ // #6109 - IE triggers two focus events and the second
+ // is asynchronous, so we need to reset the previous
+ // term synchronously and asynchronously :-(
+ this._delay(function() {
+ this.previous = previous;
+ this.selectedItem = item;
+ });
+ }
+
+ if ( false !== this._trigger( "select", event, { item: item } ) ) {
+ this._value( item.value );
+ }
+ // reset the term after the select event
+ // this allows custom select handling to work properly
+ this.term = this._value();
+
+ this.close( event );
+ this.selectedItem = item;
+ }
+ });
+
+ this.liveRegion = $( "<span>", {
+ role: "status",
+ "aria-live": "polite"
+ })
+ .addClass( "ui-helper-hidden-accessible" )
+ .insertBefore( this.element );
+
+ // turning off autocomplete prevents the browser from remembering the
+ // value when navigating through history, so we re-enable autocomplete
+ // if the page is unloaded before the widget is destroyed. #7790
+ this._on( this.window, {
+ beforeunload: function() {
+ this.element.removeAttr( "autocomplete" );
+ }
+ });
+ },
+
+ _destroy: function() {
+ clearTimeout( this.searching );
+ this.element
+ .removeClass( "ui-autocomplete-input" )
+ .removeAttr( "autocomplete" );
+ this.menu.element.remove();
+ this.liveRegion.remove();
+ },
+
+ _setOption: function( key, value ) {
+ this._super( key, value );
+ if ( key === "source" ) {
+ this._initSource();
+ }
+ if ( key === "appendTo" ) {
+ this.menu.element.appendTo( this._appendTo() );
+ }
+ if ( key === "disabled" && value && this.xhr ) {
+ this.xhr.abort();
+ }
+ },
+
+ _appendTo: function() {
+ var element = this.options.appendTo;
+
+ if ( element ) {
+ element = element.jquery || element.nodeType ?
+ $( element ) :
+ this.document.find( element ).eq( 0 );
+ }
+
+ if ( !element ) {
+ element = this.element.closest( ".ui-front" );
+ }
+
+ if ( !element.length ) {
+ element = this.document[0].body;
+ }
+
+ return element;
+ },
+
+ _initSource: function() {
+ var array, url,
+ that = this;
+ if ( $.isArray(this.options.source) ) {
+ array = this.options.source;
+ this.source = function( request, response ) {
+ response( $.ui.autocomplete.filter( array, request.term ) );
+ };
+ } else if ( typeof this.options.source === "string" ) {
+ url = this.options.source;
+ this.source = function( request, response ) {
+ if ( that.xhr ) {
+ that.xhr.abort();
+ }
+ that.xhr = $.ajax({
+ url: url,
+ data: request,
+ dataType: "json",
+ success: function( data ) {
+ response( data );
+ },
+ error: function() {
+ response( [] );
+ }
+ });
+ };
+ } else {
+ this.source = this.options.source;
+ }
+ },
+
+ _searchTimeout: function( event ) {
+ clearTimeout( this.searching );
+ this.searching = this._delay(function() {
+ // only search if the value has changed
+ if ( this.term !== this._value() ) {
+ this.selectedItem = null;
+ this.search( null, event );
+ }
+ }, this.options.delay );
+ },
+
+ search: function( value, event ) {
+ value = value != null ? value : this._value();
+
+ // always save the actual value, not the one passed as an argument
+ this.term = this._value();
+
+ if ( value.length < this.options.minLength ) {
+ return this.close( event );
+ }
+
+ if ( this._trigger( "search", event ) === false ) {
+ return;
+ }
+
+ return this._search( value );
+ },
+
+ _search: function( value ) {
+ this.pending++;
+ this.element.addClass( "ui-autocomplete-loading" );
+ this.cancelSearch = false;
+
+ this.source( { term: value }, this._response() );
+ },
+
+ _response: function() {
+ var index = ++this.requestIndex;
+
+ return $.proxy(function( content ) {
+ if ( index === this.requestIndex ) {
+ this.__response( content );
+ }
+
+ this.pending--;
+ if ( !this.pending ) {
+ this.element.removeClass( "ui-autocomplete-loading" );
+ }
+ }, this );
+ },
+
+ __response: function( content ) {
+ if ( content ) {
+ content = this._normalize( content );
+ }
+ this._trigger( "response", null, { content: content } );
+ if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
+ this._suggest( content );
+ this._trigger( "open" );
+ } else {
+ // use ._close() instead of .close() so we don't cancel future searches
+ this._close();
+ }
+ },
+
+ close: function( event ) {
+ this.cancelSearch = true;
+ this._close( event );
+ },
+
+ _close: function( event ) {
+ if ( this.menu.element.is( ":visible" ) ) {
+ this.menu.element.hide();
+ this.menu.blur();
+ this.isNewMenu = true;
+ this._trigger( "close", event );
+ }
+ },
+
+ _change: function( event ) {
+ if ( this.previous !== this._value() ) {
+ this._trigger( "change", event, { item: this.selectedItem } );
+ }
+ },
+
+ _normalize: function( items ) {
+ // assume all items have the right format when the first item is complete
+ if ( items.length && items[0].label && items[0].value ) {
+ return items;
+ }
+ return $.map( items, function( item ) {
+ if ( typeof item === "string" ) {
+ return {
+ label: item,
+ value: item
+ };
+ }
+ return $.extend({
+ label: item.label || item.value,
+ value: item.value || item.label
+ }, item );
+ });
+ },
+
+ _suggest: function( items ) {
+ var ul = this.menu.element.empty();
+ this._renderMenu( ul, items );
+ this.isNewMenu = true;
+ this.menu.refresh();
+
+ // size and position menu
+ ul.show();
+ this._resizeMenu();
+ ul.position( $.extend({
+ of: this.element
+ }, this.options.position ));
+
+ if ( this.options.autoFocus ) {
+ this.menu.next();
+ }
+ },
+
+ _resizeMenu: function() {
+ var ul = this.menu.element;
+ ul.outerWidth( Math.max(
+ // Firefox wraps long text (possibly a rounding bug)
+ // so we add 1px to avoid the wrapping (#7513)
+ ul.width( "" ).outerWidth() + 1,
+ this.element.outerWidth()
+ ) );
+ },
+
+ _renderMenu: function( ul, items ) {
+ var that = this;
+ $.each( items, function( index, item ) {
+ that._renderItemData( ul, item );
+ });
+ },
+
+ _renderItemData: function( ul, item ) {
+ return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
+ },
+
+ _renderItem: function( ul, item ) {
+ return $( "<li>" )
+ .append( $( "<a>" ).text( item.label ) )
+ .appendTo( ul );
+ },
+
+ _move: function( direction, event ) {
+ if ( !this.menu.element.is( ":visible" ) ) {
+ this.search( null, event );
+ return;
+ }
+ if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
+ this.menu.isLastItem() && /^next/.test( direction ) ) {
+ this._value( this.term );
+ this.menu.blur();
+ return;
+ }
+ this.menu[ direction ]( event );
+ },
+
+ widget: function() {
+ return this.menu.element;
+ },
+
+ _value: function() {
+ return this.valueMethod.apply( this.element, arguments );
+ },
+
+ _keyEvent: function( keyEvent, event ) {
+ if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
+ this._move( keyEvent, event );
+
+ // prevents moving cursor to beginning/end of the text field in some browsers
+ event.preventDefault();
+ }
+ }
+});
+
+$.extend( $.ui.autocomplete, {
+ escapeRegex: function( value ) {
+ return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
+ },
+ filter: function(array, term) {
+ var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );
+ return $.grep( array, function(value) {
+ return matcher.test( value.label || value.value || value );
+ });
+ }
+});
+
+
+// live region extension, adding a `messages` option
+// NOTE: This is an experimental API. We are still investigating
+// a full solution for string manipulation and internationalization.
+$.widget( "ui.autocomplete", $.ui.autocomplete, {
+ options: {
+ messages: {
+ noResults: "No search results.",
+ results: function( amount ) {
+ return amount + ( amount > 1 ? " results are" : " result is" ) +
+ " available, use up and down arrow keys to navigate.";
+ }
+ }
+ },
+
+ __response: function( content ) {
+ var message;
+ this._superApply( arguments );
+ if ( this.options.disabled || this.cancelSearch ) {
+ return;
+ }
+ if ( content && content.length ) {
+ message = this.options.messages.results( content.length );
+ } else {
+ message = this.options.messages.noResults;
+ }
+ this.liveRegion.text( message );
+ }
+});
+
+}( jQuery ));
+
+(function( $, undefined ) {
+
+var lastActive,
+ baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
+ typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
+ formResetHandler = function() {
+ var form = $( this );
+ setTimeout(function() {
+ form.find( ":ui-button" ).button( "refresh" );
+ }, 1 );
+ },
+ radioGroup = function( radio ) {
+ var name = radio.name,
+ form = radio.form,
+ radios = $( [] );
+ if ( name ) {
+ name = name.replace( /'/g, "\\'" );
+ if ( form ) {
+ radios = $( form ).find( "[name='" + name + "']" );
+ } else {
+ radios = $( "[name='" + name + "']", radio.ownerDocument )
+ .filter(function() {
+ return !this.form;
+ });
+ }
+ }
+ return radios;
+ };
+
+$.widget( "ui.button", {
+ version: "1.10.4",
+ defaultElement: "<button>",
+ options: {
+ disabled: null,
+ text: true,
+ label: null,
+ icons: {
+ primary: null,
+ secondary: null
+ }
+ },
+ _create: function() {
+ this.element.closest( "form" )
+ .unbind( "reset" + this.eventNamespace )
+ .bind( "reset" + this.eventNamespace, formResetHandler );
+
+ if ( typeof this.options.disabled !== "boolean" ) {
+ this.options.disabled = !!this.element.prop( "disabled" );
+ } else {
+ this.element.prop( "disabled", this.options.disabled );
+ }
+
+ this._determineButtonType();
+ this.hasTitle = !!this.buttonElement.attr( "title" );
+
+ var that = this,
+ options = this.options,
+ toggleButton = this.type === "checkbox" || this.type === "radio",
+ activeClass = !toggleButton ? "ui-state-active" : "";
+
+ if ( options.label === null ) {
+ options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());
+ }
+
+ this._hoverable( this.buttonElement );
+
+ this.buttonElement
+ .addClass( baseClasses )
+ .attr( "role", "button" )
+ .bind( "mouseenter" + this.eventNamespace, function() {
+ if ( options.disabled ) {
+ return;
+ }
+ if ( this === lastActive ) {
+ $( this ).addClass( "ui-state-active" );
+ }
+ })
+ .bind( "mouseleave" + this.eventNamespace, function() {
+ if ( options.disabled ) {
+ return;
+ }
+ $( this ).removeClass( activeClass );
+ })
+ .bind( "click" + this.eventNamespace, function( event ) {
+ if ( options.disabled ) {
+ event.preventDefault();
+ event.stopImmediatePropagation();
+ }
+ });
+
+ // Can't use _focusable() because the element that receives focus
+ // and the element that gets the ui-state-focus class are different
+ this._on({
+ focus: function() {
+ this.buttonElement.addClass( "ui-state-focus" );
+ },
+ blur: function() {
+ this.buttonElement.removeClass( "ui-state-focus" );
+ }
+ });
+
+ if ( toggleButton ) {
+ this.element.bind( "change" + this.eventNamespace, function() {
+ that.refresh();
+ });
+ }
+
+ if ( this.type === "checkbox" ) {
+ this.buttonElement.bind( "click" + this.eventNamespace, function() {
+ if ( options.disabled ) {
+ return false;
+ }
+ });
+ } else if ( this.type === "radio" ) {
+ this.buttonElement.bind( "click" + this.eventNamespace, function() {
+ if ( options.disabled ) {
+ return false;
+ }
+ $( this ).addClass( "ui-state-active" );
+ that.buttonElement.attr( "aria-pressed", "true" );
+
+ var radio = that.element[ 0 ];
+ radioGroup( radio )
+ .not( radio )
+ .map(function() {
+ return $( this ).button( "widget" )[ 0 ];
+ })
+ .removeClass( "ui-state-active" )
+ .attr( "aria-pressed", "false" );
+ });
+ } else {
+ this.buttonElement
+ .bind( "mousedown" + this.eventNamespace, function() {
+ if ( options.disabled ) {
+ return false;
+ }
+ $( this ).addClass( "ui-state-active" );
+ lastActive = this;
+ that.document.one( "mouseup", function() {
+ lastActive = null;
+ });
+ })
+ .bind( "mouseup" + this.eventNamespace, function() {
+ if ( options.disabled ) {
+ return false;
+ }
+ $( this ).removeClass( "ui-state-active" );
+ })
+ .bind( "keydown" + this.eventNamespace, function(event) {
+ if ( options.disabled ) {
+ return false;
+ }
+ if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) {
+ $( this ).addClass( "ui-state-active" );
+ }
+ })
+ // see #8559, we bind to blur here in case the button element loses
+ // focus between keydown and keyup, it would be left in an "active" state
+ .bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
+ $( this ).removeClass( "ui-state-active" );
+ });
+
+ if ( this.buttonElement.is("a") ) {
+ this.buttonElement.keyup(function(event) {
+ if ( event.keyCode === $.ui.keyCode.SPACE ) {
+ // TODO pass through original event correctly (just as 2nd argument doesn't work)
+ $( this ).click();
+ }
+ });
+ }
+ }
+
+ // TODO: pull out $.Widget's handling for the disabled option into
+ // $.Widget.prototype._setOptionDisabled so it's easy to proxy and can
+ // be overridden by individual plugins
+ this._setOption( "disabled", options.disabled );
+ this._resetButton();
+ },
+
+ _determineButtonType: function() {
+ var ancestor, labelSelector, checked;
+
+ if ( this.element.is("[type=checkbox]") ) {
+ this.type = "checkbox";
+ } else if ( this.element.is("[type=radio]") ) {
+ this.type = "radio";
+ } else if ( this.element.is("input") ) {
+ this.type = "input";
+ } else {
+ this.type = "button";
+ }
+
+ if ( this.type === "checkbox" || this.type === "radio" ) {
+ // we don't search against the document in case the element
+ // is disconnected from the DOM
+ ancestor = this.element.parents().last();
+ labelSelector = "label[for='" + this.element.attr("id") + "']";
+ this.buttonElement = ancestor.find( labelSelector );
+ if ( !this.buttonElement.length ) {
+ ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
+ this.buttonElement = ancestor.filter( labelSelector );
+ if ( !this.buttonElement.length ) {
+ this.buttonElement = ancestor.find( labelSelector );
+ }
+ }
+ this.element.addClass( "ui-helper-hidden-accessible" );
+
+ checked = this.element.is( ":checked" );
+ if ( checked ) {
+ this.buttonElement.addClass( "ui-state-active" );
+ }
+ this.buttonElement.prop( "aria-pressed", checked );
+ } else {
+ this.buttonElement = this.element;
+ }
+ },
+
+ widget: function() {
+ return this.buttonElement;
+ },
+
+ _destroy: function() {
+ this.element
+ .removeClass( "ui-helper-hidden-accessible" );
+ this.buttonElement
+ .removeClass( baseClasses + " ui-state-active " + typeClasses )
+ .removeAttr( "role" )
+ .removeAttr( "aria-pressed" )
+ .html( this.buttonElement.find(".ui-button-text").html() );
+
+ if ( !this.hasTitle ) {
+ this.buttonElement.removeAttr( "title" );
+ }
+ },
+
+ _setOption: function( key, value ) {
+ this._super( key, value );
+ if ( key === "disabled" ) {
+ this.element.prop( "disabled", !!value );
+ if ( value ) {
+ this.buttonElement.removeClass( "ui-state-focus" );
+ }
+ return;
+ }
+ this._resetButton();
+ },
+
+ refresh: function() {
+ //See #8237 & #8828
+ var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
+
+ if ( isDisabled !== this.options.disabled ) {
+ this._setOption( "disabled", isDisabled );
+ }
+ if ( this.type === "radio" ) {
+ radioGroup( this.element[0] ).each(function() {
+ if ( $( this ).is( ":checked" ) ) {
+ $( this ).button( "widget" )
+ .addClass( "ui-state-active" )
+ .attr( "aria-pressed", "true" );
+ } else {
+ $( this ).button( "widget" )
+ .removeClass( "ui-state-active" )
+ .attr( "aria-pressed", "false" );
+ }
+ });
+ } else if ( this.type === "checkbox" ) {
+ if ( this.element.is( ":checked" ) ) {
+ this.buttonElement
+ .addClass( "ui-state-active" )
+ .attr( "aria-pressed", "true" );
+ } else {
+ this.buttonElement
+ .removeClass( "ui-state-active" )
+ .attr( "aria-pressed", "false" );
+ }
+ }
+ },
+
+ _resetButton: function() {
+ if ( this.type === "input" ) {
+ if ( this.options.label ) {
+ this.element.val( this.options.label );
+ }
+ return;
+ }
+ var buttonElement = this.buttonElement.removeClass( typeClasses ),
+ buttonText = $( "<span></span>", this.document[0] )
+ .addClass( "ui-button-text" )
+ .html( this.options.label )
+ .appendTo( buttonElement.empty() )
+ .text(),
+ icons = this.options.icons,
+ multipleIcons = icons.primary && icons.secondary,
+ buttonClasses = [];
+
+ if ( icons.primary || icons.secondary ) {
+ if ( this.options.text ) {
+ buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
+ }
+
+ if ( icons.primary ) {
+ buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
+ }
+
+ if ( icons.secondary ) {
+ buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
+ }
+
+ if ( !this.options.text ) {
+ buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
+
+ if ( !this.hasTitle ) {
+ buttonElement.attr( "title", $.trim( buttonText ) );
+ }
+ }
+ } else {
+ buttonClasses.push( "ui-button-text-only" );
+ }
+ buttonElement.addClass( buttonClasses.join( " " ) );
+ }
+});
+
+$.widget( "ui.buttonset", {
+ version: "1.10.4",
+ options: {
+ items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
+ },
+
+ _create: function() {
+ this.element.addClass( "ui-buttonset" );
+ },
+
+ _init: function() {
+ this.refresh();
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "disabled" ) {
+ this.buttons.button( "option", key, value );
+ }
+
+ this._super( key, value );
+ },
+
+ refresh: function() {
+ var rtl = this.element.css( "direction" ) === "rtl";
+
+ this.buttons = this.element.find( this.options.items )
+ .filter( ":ui-button" )
+ .button( "refresh" )
+ .end()
+ .not( ":ui-button" )
+ .button()
+ .end()
+ .map(function() {
+ return $( this ).button( "widget" )[ 0 ];
+ })
+ .removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
+ .filter( ":first" )
+ .addClass( rtl ? "ui-corner-right" : "ui-corner-left" )
+ .end()
+ .filter( ":last" )
+ .addClass( rtl ? "ui-corner-left" : "ui-corner-right" )
+ .end()
+ .end();
+ },
+
+ _destroy: function() {
+ this.element.removeClass( "ui-buttonset" );
+ this.buttons
+ .map(function() {
+ return $( this ).button( "widget" )[ 0 ];
+ })
+ .removeClass( "ui-corner-left ui-corner-right" )
+ .end()
+ .button( "destroy" );
+ }
+});
+
+}( jQuery ) );
+
+(function( $, undefined ) {
+
+$.extend($.ui, { datepicker: { version: "1.10.4" } });
+
+var PROP_NAME = "datepicker",
+ instActive;
+
+/* Date picker manager.
+ Use the singleton instance of this class, $.datepicker, to interact with the date picker.
+ Settings for (groups of) date pickers are maintained in an instance object,
+ allowing multiple different settings on the same page. */
+
+function Datepicker() {
+ this._curInst = null; // The current instance in use
+ this._keyEvent = false; // If the last event was a key event
+ this._disabledInputs = []; // List of date picker inputs that have been disabled
+ this._datepickerShowing = false; // True if the popup picker is showing , false if not
+ this._inDialog = false; // True if showing within a "dialog", false if not
+ this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
+ this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
+ this._appendClass = "ui-datepicker-append"; // The name of the append marker class
+ this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
+ this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
+ this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
+ this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
+ this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
+ this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
+ this.regional = []; // Available regional settings, indexed by language code
+ this.regional[""] = { // Default regional settings
+ closeText: "Done", // Display text for close link
+ prevText: "Prev", // Display text for previous month link
+ nextText: "Next", // Display text for next month link
+ currentText: "Today", // Display text for current month link
+ monthNames: ["January","February","March","April","May","June",
+ "July","August","September","October","November","December"], // Names of months for drop-down and formatting
+ monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], // For formatting
+ dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // For formatting
+ dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting
+ dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], // Column headings for days starting at Sunday
+ weekHeader: "Wk", // Column header for week of the year
+ dateFormat: "mm/dd/yy", // See format options on parseDate
+ firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
+ isRTL: false, // True if right-to-left language, false if left-to-right
+ showMonthAfterYear: false, // True if the year select precedes month, false for month then year
+ yearSuffix: "" // Additional text to append to the year in the month headers
+ };
+ this._defaults = { // Global defaults for all the date picker instances
+ showOn: "focus", // "focus" for popup on focus,
+ // "button" for trigger button, or "both" for either
+ showAnim: "fadeIn", // Name of jQuery animation for popup
+ showOptions: {}, // Options for enhanced animations
+ defaultDate: null, // Used when field is blank: actual date,
+ // +/-number for offset from today, null for today
+ appendText: "", // Display text following the input box, e.g. showing the format
+ buttonText: "...", // Text for trigger button
+ buttonImage: "", // URL for trigger button image
+ buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
+ hideIfNoPrevNext: false, // True to hide next/previous month links
+ // if not applicable, false to just disable them
+ navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
+ gotoCurrent: false, // True if today link goes back to current selection instead
+ changeMonth: false, // True if month can be selected directly, false if only prev/next
+ changeYear: false, // True if year can be selected directly, false if only prev/next
+ yearRange: "c-10:c+10", // Range of years to display in drop-down,
+ // either relative to today's year (-nn:+nn), relative to currently displayed year
+ // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
+ showOtherMonths: false, // True to show dates in other months, false to leave blank
+ selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
+ showWeek: false, // True to show week of the year, false to not show it
+ calculateWeek: this.iso8601Week, // How to calculate the week of the year,
+ // takes a Date and returns the number of the week for it
+ shortYearCutoff: "+10", // Short year values < this are in the current century,
+ // > this are in the previous century,
+ // string value starting with "+" for current year + value
+ minDate: null, // The earliest selectable date, or null for no limit
+ maxDate: null, // The latest selectable date, or null for no limit
+ duration: "fast", // Duration of display/closure
+ beforeShowDay: null, // Function that takes a date and returns an array with
+ // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
+ // [2] = cell title (optional), e.g. $.datepicker.noWeekends
+ beforeShow: null, // Function that takes an input field and
+ // returns a set of custom settings for the date picker
+ onSelect: null, // Define a callback function when a date is selected
+ onChangeMonthYear: null, // Define a callback function when the month or year is changed
+ onClose: null, // Define a callback function when the datepicker is closed
+ numberOfMonths: 1, // Number of months to show at a time
+ showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
+ stepMonths: 1, // Number of months to step back/forward
+ stepBigMonths: 12, // Number of months to step back/forward for the big links
+ altField: "", // Selector for an alternate field to store selected dates into
+ altFormat: "", // The date format to use for the alternate field
+ constrainInput: true, // The input is constrained by the current date format
+ showButtonPanel: false, // True to show button panel, false to not show it
+ autoSize: false, // True to size the input for the date format, false to leave as is
+ disabled: false // The initial disabled state
+ };
+ $.extend(this._defaults, this.regional[""]);
+ this.dpDiv = bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));
+}
+
+$.extend(Datepicker.prototype, {
+ /* Class name added to elements to indicate already configured with a date picker. */
+ markerClassName: "hasDatepicker",
+
+ //Keep track of the maximum number of rows displayed (see #7043)
+ maxRows: 4,
+
+ // TODO rename to "widget" when switching to widget factory
+ _widgetDatepicker: function() {
+ return this.dpDiv;
+ },
+
+ /* Override the default settings for all instances of the date picker.
+ * @param settings object - the new settings to use as defaults (anonymous object)
+ * @return the manager object
+ */
+ setDefaults: function(settings) {
+ extendRemove(this._defaults, settings || {});
+ return this;
+ },
+
+ /* Attach the date picker to a jQuery selection.
+ * @param target element - the target input field or division or span
+ * @param settings object - the new settings to use for this date picker instance (anonymous)
+ */
+ _attachDatepicker: function(target, settings) {
+ var nodeName, inline, inst;
+ nodeName = target.nodeName.toLowerCase();
+ inline = (nodeName === "div" || nodeName === "span");
+ if (!target.id) {
+ this.uuid += 1;
+ target.id = "dp" + this.uuid;
+ }
+ inst = this._newInst($(target), inline);
+ inst.settings = $.extend({}, settings || {});
+ if (nodeName === "input") {
+ this._connectDatepicker(target, inst);
+ } else if (inline) {
+ this._inlineDatepicker(target, inst);
+ }
+ },
+
+ /* Create a new instance object. */
+ _newInst: function(target, inline) {
+ var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars
+ return {id: id, input: target, // associated target
+ selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
+ drawMonth: 0, drawYear: 0, // month being drawn
+ inline: inline, // is datepicker inline or not
+ dpDiv: (!inline ? this.dpDiv : // presentation div
+ bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};
+ },
+
+ /* Attach the date picker to an input field. */
+ _connectDatepicker: function(target, inst) {
+ var input = $(target);
+ inst.append = $([]);
+ inst.trigger = $([]);
+ if (input.hasClass(this.markerClassName)) {
+ return;
+ }
+ this._attachments(input, inst);
+ input.addClass(this.markerClassName).keydown(this._doKeyDown).
+ keypress(this._doKeyPress).keyup(this._doKeyUp);
+ this._autoSize(inst);
+ $.data(target, PROP_NAME, inst);
+ //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
+ if( inst.settings.disabled ) {
+ this._disableDatepicker( target );
+ }
+ },
+
+ /* Make attachments based on settings. */
+ _attachments: function(input, inst) {
+ var showOn, buttonText, buttonImage,
+ appendText = this._get(inst, "appendText"),
+ isRTL = this._get(inst, "isRTL");
+
+ if (inst.append) {
+ inst.append.remove();
+ }
+ if (appendText) {
+ inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
+ input[isRTL ? "before" : "after"](inst.append);
+ }
+
+ input.unbind("focus", this._showDatepicker);
+
+ if (inst.trigger) {
+ inst.trigger.remove();
+ }
+
+ showOn = this._get(inst, "showOn");
+ if (showOn === "focus" || showOn === "both") { // pop-up date picker when in the marked field
+ input.focus(this._showDatepicker);
+ }
+ if (showOn === "button" || showOn === "both") { // pop-up date picker when button clicked
+ buttonText = this._get(inst, "buttonText");
+ buttonImage = this._get(inst, "buttonImage");
+ inst.trigger = $(this._get(inst, "buttonImageOnly") ?
+ $("<img/>").addClass(this._triggerClass).
+ attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
+ $("<button type='button'></button>").addClass(this._triggerClass).
+ html(!buttonImage ? buttonText : $("<img/>").attr(
+ { src:buttonImage, alt:buttonText, title:buttonText })));
+ input[isRTL ? "before" : "after"](inst.trigger);
+ inst.trigger.click(function() {
+ if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) {
+ $.datepicker._hideDatepicker();
+ } else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) {
+ $.datepicker._hideDatepicker();
+ $.datepicker._showDatepicker(input[0]);
+ } else {
+ $.datepicker._showDatepicker(input[0]);
+ }
+ return false;
+ });
+ }
+ },
+
+ /* Apply the maximum length for the date format. */
+ _autoSize: function(inst) {
+ if (this._get(inst, "autoSize") && !inst.inline) {
+ var findMax, max, maxI, i,
+ date = new Date(2009, 12 - 1, 20), // Ensure double digits
+ dateFormat = this._get(inst, "dateFormat");
+
+ if (dateFormat.match(/[DM]/)) {
+ findMax = function(names) {
+ max = 0;
+ maxI = 0;
+ for (i = 0; i < names.length; i++) {
+ if (names[i].length > max) {
+ max = names[i].length;
+ maxI = i;
+ }
+ }
+ return maxI;
+ };
+ date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
+ "monthNames" : "monthNamesShort"))));
+ date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
+ "dayNames" : "dayNamesShort"))) + 20 - date.getDay());
+ }
+ inst.input.attr("size", this._formatDate(inst, date).length);
+ }
+ },
+
+ /* Attach an inline date picker to a div. */
+ _inlineDatepicker: function(target, inst) {
+ var divSpan = $(target);
+ if (divSpan.hasClass(this.markerClassName)) {
+ return;
+ }
+ divSpan.addClass(this.markerClassName).append(inst.dpDiv);
+ $.data(target, PROP_NAME, inst);
+ this._setDate(inst, this._getDefaultDate(inst), true);
+ this._updateDatepicker(inst);
+ this._updateAlternate(inst);
+ //If disabled option is true, disable the datepicker before showing it (see ticket #5665)
+ if( inst.settings.disabled ) {
+ this._disableDatepicker( target );
+ }
+ // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
+ // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
+ inst.dpDiv.css( "display", "block" );
+ },
+
+ /* Pop-up the date picker in a "dialog" box.
+ * @param input element - ignored
+ * @param date string or Date - the initial date to display
+ * @param onSelect function - the function to call when a date is selected
+ * @param settings object - update the dialog date picker instance's settings (anonymous object)
+ * @param pos int[2] - coordinates for the dialog's position within the screen or
+ * event - with x/y coordinates or
+ * leave empty for default (screen centre)
+ * @return the manager object
+ */
+ _dialogDatepicker: function(input, date, onSelect, settings, pos) {
+ var id, browserWidth, browserHeight, scrollX, scrollY,
+ inst = this._dialogInst; // internal instance
+
+ if (!inst) {
+ this.uuid += 1;
+ id = "dp" + this.uuid;
+ this._dialogInput = $("<input type='text' id='" + id +
+ "' style='position: absolute; top: -100px; width: 0px;'/>");
+ this._dialogInput.keydown(this._doKeyDown);
+ $("body").append(this._dialogInput);
+ inst = this._dialogInst = this._newInst(this._dialogInput, false);
+ inst.settings = {};
+ $.data(this._dialogInput[0], PROP_NAME, inst);
+ }
+ extendRemove(inst.settings, settings || {});
+ date = (date && date.constructor === Date ? this._formatDate(inst, date) : date);
+ this._dialogInput.val(date);
+
+ this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
+ if (!this._pos) {
+ browserWidth = document.documentElement.clientWidth;
+ browserHeight = document.documentElement.clientHeight;
+ scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
+ scrollY = document.documentElement.scrollTop || document.body.scrollTop;
+ this._pos = // should use actual width/height below
+ [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
+ }
+
+ // move input on screen for focus, but hidden behind dialog
+ this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px");
+ inst.settings.onSelect = onSelect;
+ this._inDialog = true;
+ this.dpDiv.addClass(this._dialogClass);
+ this._showDatepicker(this._dialogInput[0]);
+ if ($.blockUI) {
+ $.blockUI(this.dpDiv);
+ }
+ $.data(this._dialogInput[0], PROP_NAME, inst);
+ return this;
+ },
+
+ /* Detach a datepicker from its control.
+ * @param target element - the target input field or division or span
+ */
+ _destroyDatepicker: function(target) {
+ var nodeName,
+ $target = $(target),
+ inst = $.data(target, PROP_NAME);
+
+ if (!$target.hasClass(this.markerClassName)) {
+ return;
+ }
+
+ nodeName = target.nodeName.toLowerCase();
+ $.removeData(target, PROP_NAME);
+ if (nodeName === "input") {
+ inst.append.remove();
+ inst.trigger.remove();
+ $target.removeClass(this.markerClassName).
+ unbind("focus", this._showDatepicker).
+ unbind("keydown", this._doKeyDown).
+ unbind("keypress", this._doKeyPress).
+ unbind("keyup", this._doKeyUp);
+ } else if (nodeName === "div" || nodeName === "span") {
+ $target.removeClass(this.markerClassName).empty();
+ }
+ },
+
+ /* Enable the date picker to a jQuery selection.
+ * @param target element - the target input field or division or span
+ */
+ _enableDatepicker: function(target) {
+ var nodeName, inline,
+ $target = $(target),
+ inst = $.data(target, PROP_NAME);
+
+ if (!$target.hasClass(this.markerClassName)) {
+ return;
+ }
+
+ nodeName = target.nodeName.toLowerCase();
+ if (nodeName === "input") {
+ target.disabled = false;
+ inst.trigger.filter("button").
+ each(function() { this.disabled = false; }).end().
+ filter("img").css({opacity: "1.0", cursor: ""});
+ } else if (nodeName === "div" || nodeName === "span") {
+ inline = $target.children("." + this._inlineClass);
+ inline.children().removeClass("ui-state-disabled");
+ inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
+ prop("disabled", false);
+ }
+ this._disabledInputs = $.map(this._disabledInputs,
+ function(value) { return (value === target ? null : value); }); // delete entry
+ },
+
+ /* Disable the date picker to a jQuery selection.
+ * @param target element - the target input field or division or span
+ */
+ _disableDatepicker: function(target) {
+ var nodeName, inline,
+ $target = $(target),
+ inst = $.data(target, PROP_NAME);
+
+ if (!$target.hasClass(this.markerClassName)) {
+ return;
+ }
+
+ nodeName = target.nodeName.toLowerCase();
+ if (nodeName === "input") {
+ target.disabled = true;
+ inst.trigger.filter("button").
+ each(function() { this.disabled = true; }).end().
+ filter("img").css({opacity: "0.5", cursor: "default"});
+ } else if (nodeName === "div" || nodeName === "span") {
+ inline = $target.children("." + this._inlineClass);
+ inline.children().addClass("ui-state-disabled");
+ inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
+ prop("disabled", true);
+ }
+ this._disabledInputs = $.map(this._disabledInputs,
+ function(value) { return (value === target ? null : value); }); // delete entry
+ this._disabledInputs[this._disabledInputs.length] = target;
+ },
+
+ /* Is the first field in a jQuery collection disabled as a datepicker?
+ * @param target element - the target input field or division or span
+ * @return boolean - true if disabled, false if enabled
+ */
+ _isDisabledDatepicker: function(target) {
+ if (!target) {
+ return false;
+ }
+ for (var i = 0; i < this._disabledInputs.length; i++) {
+ if (this._disabledInputs[i] === target) {
+ return true;
+ }
+ }
+ return false;
+ },
+
+ /* Retrieve the instance data for the target control.
+ * @param target element - the target input field or division or span
+ * @return object - the associated instance data
+ * @throws error if a jQuery problem getting data
+ */
+ _getInst: function(target) {
+ try {
+ return $.data(target, PROP_NAME);
+ }
+ catch (err) {
+ throw "Missing instance data for this datepicker";
+ }
+ },
+
+ /* Update or retrieve the settings for a date picker attached to an input field or division.
+ * @param target element - the target input field or division or span
+ * @param name object - the new settings to update or
+ * string - the name of the setting to change or retrieve,
+ * when retrieving also "all" for all instance settings or
+ * "defaults" for all global defaults
+ * @param value any - the new value for the setting
+ * (omit if above is an object or to retrieve a value)
+ */
+ _optionDatepicker: function(target, name, value) {
+ var settings, date, minDate, maxDate,
+ inst = this._getInst(target);
+
+ if (arguments.length === 2 && typeof name === "string") {
+ return (name === "defaults" ? $.extend({}, $.datepicker._defaults) :
+ (inst ? (name === "all" ? $.extend({}, inst.settings) :
+ this._get(inst, name)) : null));
+ }
+
+ settings = name || {};
+ if (typeof name === "string") {
+ settings = {};
+ settings[name] = value;
+ }
+
+ if (inst) {
+ if (this._curInst === inst) {
+ this._hideDatepicker();
+ }
+
+ date = this._getDateDatepicker(target, true);
+ minDate = this._getMinMaxDate(inst, "min");
+ maxDate = this._getMinMaxDate(inst, "max");
+ extendRemove(inst.settings, settings);
+ // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
+ if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) {
+ inst.settings.minDate = this._formatDate(inst, minDate);
+ }
+ if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) {
+ inst.settings.maxDate = this._formatDate(inst, maxDate);
+ }
+ if ( "disabled" in settings ) {
+ if ( settings.disabled ) {
+ this._disableDatepicker(target);
+ } else {
+ this._enableDatepicker(target);
+ }
+ }
+ this._attachments($(target), inst);
+ this._autoSize(inst);
+ this._setDate(inst, date);
+ this._updateAlternate(inst);
+ this._updateDatepicker(inst);
+ }
+ },
+
+ // change method deprecated
+ _changeDatepicker: function(target, name, value) {
+ this._optionDatepicker(target, name, value);
+ },
+
+ /* Redraw the date picker attached to an input field or division.
+ * @param target element - the target input field or division or span
+ */
+ _refreshDatepicker: function(target) {
+ var inst = this._getInst(target);
+ if (inst) {
+ this._updateDatepicker(inst);
+ }
+ },
+
+ /* Set the dates for a jQuery selection.
+ * @param target element - the target input field or division or span
+ * @param date Date - the new date
+ */
+ _setDateDatepicker: function(target, date) {
+ var inst = this._getInst(target);
+ if (inst) {
+ this._setDate(inst, date);
+ this._updateDatepicker(inst);
+ this._updateAlternate(inst);
+ }
+ },
+
+ /* Get the date(s) for the first entry in a jQuery selection.
+ * @param target element - the target input field or division or span
+ * @param noDefault boolean - true if no default date is to be used
+ * @return Date - the current date
+ */
+ _getDateDatepicker: function(target, noDefault) {
+ var inst = this._getInst(target);
+ if (inst && !inst.inline) {
+ this._setDateFromField(inst, noDefault);
+ }
+ return (inst ? this._getDate(inst) : null);
+ },
+
+ /* Handle keystrokes. */
+ _doKeyDown: function(event) {
+ var onSelect, dateStr, sel,
+ inst = $.datepicker._getInst(event.target),
+ handled = true,
+ isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
+
+ inst._keyEvent = true;
+ if ($.datepicker._datepickerShowing) {
+ switch (event.keyCode) {
+ case 9: $.datepicker._hideDatepicker();
+ handled = false;
+ break; // hide on tab out
+ case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." +
+ $.datepicker._currentClass + ")", inst.dpDiv);
+ if (sel[0]) {
+ $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
+ }
+
+ onSelect = $.datepicker._get(inst, "onSelect");
+ if (onSelect) {
+ dateStr = $.datepicker._formatDate(inst);
+
+ // trigger custom callback
+ onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
+ } else {
+ $.datepicker._hideDatepicker();
+ }
+
+ return false; // don't submit the form
+ case 27: $.datepicker._hideDatepicker();
+ break; // hide on escape
+ case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
+ -$.datepicker._get(inst, "stepBigMonths") :
+ -$.datepicker._get(inst, "stepMonths")), "M");
+ break; // previous month/year on page up/+ ctrl
+ case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
+ +$.datepicker._get(inst, "stepBigMonths") :
+ +$.datepicker._get(inst, "stepMonths")), "M");
+ break; // next month/year on page down/+ ctrl
+ case 35: if (event.ctrlKey || event.metaKey) {
+ $.datepicker._clearDate(event.target);
+ }
+ handled = event.ctrlKey || event.metaKey;
+ break; // clear on ctrl or command +end
+ case 36: if (event.ctrlKey || event.metaKey) {
+ $.datepicker._gotoToday(event.target);
+ }
+ handled = event.ctrlKey || event.metaKey;
+ break; // current on ctrl or command +home
+ case 37: if (event.ctrlKey || event.metaKey) {
+ $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D");
+ }
+ handled = event.ctrlKey || event.metaKey;
+ // -1 day on ctrl or command +left
+ if (event.originalEvent.altKey) {
+ $.datepicker._adjustDate(event.target, (event.ctrlKey ?
+ -$.datepicker._get(inst, "stepBigMonths") :
+ -$.datepicker._get(inst, "stepMonths")), "M");
+ }
+ // next month/year on alt +left on Mac
+ break;
+ case 38: if (event.ctrlKey || event.metaKey) {
+ $.datepicker._adjustDate(event.target, -7, "D");
+ }
+ handled = event.ctrlKey || event.metaKey;
+ break; // -1 week on ctrl or command +up
+ case 39: if (event.ctrlKey || event.metaKey) {
+ $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D");
+ }
+ handled = event.ctrlKey || event.metaKey;
+ // +1 day on ctrl or command +right
+ if (event.originalEvent.altKey) {
+ $.datepicker._adjustDate(event.target, (event.ctrlKey ?
+ +$.datepicker._get(inst, "stepBigMonths") :
+ +$.datepicker._get(inst, "stepMonths")), "M");
+ }
+ // next month/year on alt +right
+ break;
+ case 40: if (event.ctrlKey || event.metaKey) {
+ $.datepicker._adjustDate(event.target, +7, "D");
+ }
+ handled = event.ctrlKey || event.metaKey;
+ break; // +1 week on ctrl or command +down
+ default: handled = false;
+ }
+ } else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home
+ $.datepicker._showDatepicker(this);
+ } else {
+ handled = false;
+ }
+
+ if (handled) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ },
+
+ /* Filter entered characters - based on date format. */
+ _doKeyPress: function(event) {
+ var chars, chr,
+ inst = $.datepicker._getInst(event.target);
+
+ if ($.datepicker._get(inst, "constrainInput")) {
+ chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));
+ chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode);
+ return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1);
+ }
+ },
+
+ /* Synchronise manual entry and field/alternate field. */
+ _doKeyUp: function(event) {
+ var date,
+ inst = $.datepicker._getInst(event.target);
+
+ if (inst.input.val() !== inst.lastVal) {
+ try {
+ date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
+ (inst.input ? inst.input.val() : null),
+ $.datepicker._getFormatConfig(inst));
+
+ if (date) { // only if valid
+ $.datepicker._setDateFromField(inst);
+ $.datepicker._updateAlternate(inst);
+ $.datepicker._updateDatepicker(inst);
+ }
+ }
+ catch (err) {
+ }
+ }
+ return true;
+ },
+
+ /* Pop-up the date picker for a given input field.
+ * If false returned from beforeShow event handler do not show.
+ * @param input element - the input field attached to the date picker or
+ * event - if triggered by focus
+ */
+ _showDatepicker: function(input) {
+ input = input.target || input;
+ if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
+ input = $("input", input.parentNode)[0];
+ }
+
+ if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here
+ return;
+ }
+
+ var inst, beforeShow, beforeShowSettings, isFixed,
+ offset, showAnim, duration;
+
+ inst = $.datepicker._getInst(input);
+ if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
+ $.datepicker._curInst.dpDiv.stop(true, true);
+ if ( inst && $.datepicker._datepickerShowing ) {
+ $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );
+ }
+ }
+
+ beforeShow = $.datepicker._get(inst, "beforeShow");
+ beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
+ if(beforeShowSettings === false){
+ return;
+ }
+ extendRemove(inst.settings, beforeShowSettings);
+
+ inst.lastVal = null;
+ $.datepicker._lastInput = input;
+ $.datepicker._setDateFromField(inst);
+
+ if ($.datepicker._inDialog) { // hide cursor
+ input.value = "";
+ }
+ if (!$.datepicker._pos) { // position below input
+ $.datepicker._pos = $.datepicker._findPos(input);
+ $.datepicker._pos[1] += input.offsetHeight; // add the height
+ }
+
+ isFixed = false;
+ $(input).parents().each(function() {
+ isFixed |= $(this).css("position") === "fixed";
+ return !isFixed;
+ });
+
+ offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
+ $.datepicker._pos = null;
+ //to avoid flashes on Firefox
+ inst.dpDiv.empty();
+ // determine sizing offscreen
+ inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"});
+ $.datepicker._updateDatepicker(inst);
+ // fix width for dynamic number of date pickers
+ // and adjust position before showing
+ offset = $.datepicker._checkOffset(inst, offset, isFixed);
+ inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
+ "static" : (isFixed ? "fixed" : "absolute")), display: "none",
+ left: offset.left + "px", top: offset.top + "px"});
+
+ if (!inst.inline) {
+ showAnim = $.datepicker._get(inst, "showAnim");
+ duration = $.datepicker._get(inst, "duration");
+ inst.dpDiv.zIndex($(input).zIndex()+1);
+ $.datepicker._datepickerShowing = true;
+
+ if ( $.effects && $.effects.effect[ showAnim ] ) {
+ inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);
+ } else {
+ inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
+ }
+
+ if ( $.datepicker._shouldFocusInput( inst ) ) {
+ inst.input.focus();
+ }
+
+ $.datepicker._curInst = inst;
+ }
+ },
+
+ /* Generate the date picker content. */
+ _updateDatepicker: function(inst) {
+ this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
+ instActive = inst; // for delegate hover events
+ inst.dpDiv.empty().append(this._generateHTML(inst));
+ this._attachHandlers(inst);
+ inst.dpDiv.find("." + this._dayOverClass + " a").mouseover();
+
+ var origyearshtml,
+ numMonths = this._getNumberOfMonths(inst),
+ cols = numMonths[1],
+ width = 17;
+
+ inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
+ if (cols > 1) {
+ inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em");
+ }
+ inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") +
+ "Class"]("ui-datepicker-multi");
+ inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") +
+ "Class"]("ui-datepicker-rtl");
+
+ if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
+ inst.input.focus();
+ }
+
+ // deffered render of the years select (to avoid flashes on Firefox)
+ if( inst.yearshtml ){
+ origyearshtml = inst.yearshtml;
+ setTimeout(function(){
+ //assure that inst.yearshtml didn't change.
+ if( origyearshtml === inst.yearshtml && inst.yearshtml ){
+ inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);
+ }
+ origyearshtml = inst.yearshtml = null;
+ }, 0);
+ }
+ },
+
+ // #6694 - don't focus the input if it's already focused
+ // this breaks the change event in IE
+ // Support: IE and jQuery <1.9
+ _shouldFocusInput: function( inst ) {
+ return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
+ },
+
+ /* Check positioning to remain on screen. */
+ _checkOffset: function(inst, offset, isFixed) {
+ var dpWidth = inst.dpDiv.outerWidth(),
+ dpHeight = inst.dpDiv.outerHeight(),
+ inputWidth = inst.input ? inst.input.outerWidth() : 0,
+ inputHeight = inst.input ? inst.input.outerHeight() : 0,
+ viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()),
+ viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
+
+ offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0);
+ offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0;
+ offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
+
+ // now check if datepicker is showing outside window viewport - move to a better place if so.
+ offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
+ Math.abs(offset.left + dpWidth - viewWidth) : 0);
+ offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
+ Math.abs(dpHeight + inputHeight) : 0);
+
+ return offset;
+ },
+
+ /* Find an object's position on the screen. */
+ _findPos: function(obj) {
+ var position,
+ inst = this._getInst(obj),
+ isRTL = this._get(inst, "isRTL");
+
+ while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {
+ obj = obj[isRTL ? "previousSibling" : "nextSibling"];
+ }
+
+ position = $(obj).offset();
+ return [position.left, position.top];
+ },
+
+ /* Hide the date picker from view.
+ * @param input element - the input field attached to the date picker
+ */
+ _hideDatepicker: function(input) {
+ var showAnim, duration, postProcess, onClose,
+ inst = this._curInst;
+
+ if (!inst || (input && inst !== $.data(input, PROP_NAME))) {
+ return;
+ }
+
+ if (this._datepickerShowing) {
+ showAnim = this._get(inst, "showAnim");
+ duration = this._get(inst, "duration");
+ postProcess = function() {
+ $.datepicker._tidyDialog(inst);
+ };
+
+ // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
+ if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
+ inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess);
+ } else {
+ inst.dpDiv[(showAnim === "slideDown" ? "slideUp" :
+ (showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess);
+ }
+
+ if (!showAnim) {
+ postProcess();
+ }
+ this._datepickerShowing = false;
+
+ onClose = this._get(inst, "onClose");
+ if (onClose) {
+ onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]);
+ }
+
+ this._lastInput = null;
+ if (this._inDialog) {
+ this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" });
+ if ($.blockUI) {
+ $.unblockUI();
+ $("body").append(this.dpDiv);
+ }
+ }
+ this._inDialog = false;
+ }
+ },
+
+ /* Tidy up after a dialog display. */
+ _tidyDialog: function(inst) {
+ inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");
+ },
+
+ /* Close date picker if clicked elsewhere. */
+ _checkExternalClick: function(event) {
+ if (!$.datepicker._curInst) {
+ return;
+ }
+
+ var $target = $(event.target),
+ inst = $.datepicker._getInst($target[0]);
+
+ if ( ( ( $target[0].id !== $.datepicker._mainDivId &&
+ $target.parents("#" + $.datepicker._mainDivId).length === 0 &&
+ !$target.hasClass($.datepicker.markerClassName) &&
+ !$target.closest("." + $.datepicker._triggerClass).length &&
+ $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
+ ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) {
+ $.datepicker._hideDatepicker();
+ }
+ },
+
+ /* Adjust one of the date sub-fields. */
+ _adjustDate: function(id, offset, period) {
+ var target = $(id),
+ inst = this._getInst(target[0]);
+
+ if (this._isDisabledDatepicker(target[0])) {
+ return;
+ }
+ this._adjustInstDate(inst, offset +
+ (period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning
+ period);
+ this._updateDatepicker(inst);
+ },
+
+ /* Action for current link. */
+ _gotoToday: function(id) {
+ var date,
+ target = $(id),
+ inst = this._getInst(target[0]);
+
+ if (this._get(inst, "gotoCurrent") && inst.currentDay) {
+ inst.selectedDay = inst.currentDay;
+ inst.drawMonth = inst.selectedMonth = inst.currentMonth;
+ inst.drawYear = inst.selectedYear = inst.currentYear;
+ } else {
+ date = new Date();
+ inst.selectedDay = date.getDate();
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
+ inst.drawYear = inst.selectedYear = date.getFullYear();
+ }
+ this._notifyChange(inst);
+ this._adjustDate(target);
+ },
+
+ /* Action for selecting a new month/year. */
+ _selectMonthYear: function(id, select, period) {
+ var target = $(id),
+ inst = this._getInst(target[0]);
+
+ inst["selected" + (period === "M" ? "Month" : "Year")] =
+ inst["draw" + (period === "M" ? "Month" : "Year")] =
+ parseInt(select.options[select.selectedIndex].value,10);
+
+ this._notifyChange(inst);
+ this._adjustDate(target);
+ },
+
+ /* Action for selecting a day. */
+ _selectDay: function(id, month, year, td) {
+ var inst,
+ target = $(id);
+
+ if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
+ return;
+ }
+
+ inst = this._getInst(target[0]);
+ inst.selectedDay = inst.currentDay = $("a", td).html();
+ inst.selectedMonth = inst.currentMonth = month;
+ inst.selectedYear = inst.currentYear = year;
+ this._selectDate(id, this._formatDate(inst,
+ inst.currentDay, inst.currentMonth, inst.currentYear));
+ },
+
+ /* Erase the input field and hide the date picker. */
+ _clearDate: function(id) {
+ var target = $(id);
+ this._selectDate(target, "");
+ },
+
+ /* Update the input field with the selected date. */
+ _selectDate: function(id, dateStr) {
+ var onSelect,
+ target = $(id),
+ inst = this._getInst(target[0]);
+
+ dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
+ if (inst.input) {
+ inst.input.val(dateStr);
+ }
+ this._updateAlternate(inst);
+
+ onSelect = this._get(inst, "onSelect");
+ if (onSelect) {
+ onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback
+ } else if (inst.input) {
+ inst.input.trigger("change"); // fire the change event
+ }
+
+ if (inst.inline){
+ this._updateDatepicker(inst);
+ } else {
+ this._hideDatepicker();
+ this._lastInput = inst.input[0];
+ if (typeof(inst.input[0]) !== "object") {
+ inst.input.focus(); // restore focus
+ }
+ this._lastInput = null;
+ }
+ },
+
+ /* Update any alternate field to synchronise with the main field. */
+ _updateAlternate: function(inst) {
+ var altFormat, date, dateStr,
+ altField = this._get(inst, "altField");
+
+ if (altField) { // update alternate field too
+ altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
+ date = this._getDate(inst);
+ dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
+ $(altField).each(function() { $(this).val(dateStr); });
+ }
+ },
+
+ /* Set as beforeShowDay function to prevent selection of weekends.
+ * @param date Date - the date to customise
+ * @return [boolean, string] - is this date selectable?, what is its CSS class?
+ */
+ noWeekends: function(date) {
+ var day = date.getDay();
+ return [(day > 0 && day < 6), ""];
+ },
+
+ /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
+ * @param date Date - the date to get the week for
+ * @return number - the number of the week within the year that contains this date
+ */
+ iso8601Week: function(date) {
+ var time,
+ checkDate = new Date(date.getTime());
+
+ // Find Thursday of this week starting on Monday
+ checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
+
+ time = checkDate.getTime();
+ checkDate.setMonth(0); // Compare with Jan 1
+ checkDate.setDate(1);
+ return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
+ },
+
+ /* Parse a string value into a date object.
+ * See formatDate below for the possible formats.
+ *
+ * @param format string - the expected format of the date
+ * @param value string - the date in the above format
+ * @param settings Object - attributes include:
+ * shortYearCutoff number - the cutoff year for determining the century (optional)
+ * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
+ * dayNames string[7] - names of the days from Sunday (optional)
+ * monthNamesShort string[12] - abbreviated names of the months (optional)
+ * monthNames string[12] - names of the months (optional)
+ * @return Date - the extracted date value or null if value is blank
+ */
+ parseDate: function (format, value, settings) {
+ if (format == null || value == null) {
+ throw "Invalid arguments";
+ }
+
+ value = (typeof value === "object" ? value.toString() : value + "");
+ if (value === "") {
+ return null;
+ }
+
+ var iFormat, dim, extra,
+ iValue = 0,
+ shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff,
+ shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
+ new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)),
+ dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
+ dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
+ monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
+ monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
+ year = -1,
+ month = -1,
+ day = -1,
+ doy = -1,
+ literal = false,
+ date,
+ // Check whether a format character is doubled
+ lookAhead = function(match) {
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
+ if (matches) {
+ iFormat++;
+ }
+ return matches;
+ },
+ // Extract a number from the string value
+ getNumber = function(match) {
+ var isDoubled = lookAhead(match),
+ size = (match === "@" ? 14 : (match === "!" ? 20 :
+ (match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
+ digits = new RegExp("^\\d{1," + size + "}"),
+ num = value.substring(iValue).match(digits);
+ if (!num) {
+ throw "Missing number at position " + iValue;
+ }
+ iValue += num[0].length;
+ return parseInt(num[0], 10);
+ },
+ // Extract a name from the string value and convert to an index
+ getName = function(match, shortNames, longNames) {
+ var index = -1,
+ names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
+ return [ [k, v] ];
+ }).sort(function (a, b) {
+ return -(a[1].length - b[1].length);
+ });
+
+ $.each(names, function (i, pair) {
+ var name = pair[1];
+ if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
+ index = pair[0];
+ iValue += name.length;
+ return false;
+ }
+ });
+ if (index !== -1) {
+ return index + 1;
+ } else {
+ throw "Unknown name at position " + iValue;
+ }
+ },
+ // Confirm that a literal character matches the string value
+ checkLiteral = function() {
+ if (value.charAt(iValue) !== format.charAt(iFormat)) {
+ throw "Unexpected literal at position " + iValue;
+ }
+ iValue++;
+ };
+
+ for (iFormat = 0; iFormat < format.length; iFormat++) {
+ if (literal) {
+ if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
+ literal = false;
+ } else {
+ checkLiteral();
+ }
+ } else {
+ switch (format.charAt(iFormat)) {
+ case "d":
+ day = getNumber("d");
+ break;
+ case "D":
+ getName("D", dayNamesShort, dayNames);
+ break;
+ case "o":
+ doy = getNumber("o");
+ break;
+ case "m":
+ month = getNumber("m");
+ break;
+ case "M":
+ month = getName("M", monthNamesShort, monthNames);
+ break;
+ case "y":
+ year = getNumber("y");
+ break;
+ case "@":
+ date = new Date(getNumber("@"));
+ year = date.getFullYear();
+ month = date.getMonth() + 1;
+ day = date.getDate();
+ break;
+ case "!":
+ date = new Date((getNumber("!") - this._ticksTo1970) / 10000);
+ year = date.getFullYear();
+ month = date.getMonth() + 1;
+ day = date.getDate();
+ break;
+ case "'":
+ if (lookAhead("'")){
+ checkLiteral();
+ } else {
+ literal = true;
+ }
+ break;
+ default:
+ checkLiteral();
+ }
+ }
+ }
+
+ if (iValue < value.length){
+ extra = value.substr(iValue);
+ if (!/^\s+/.test(extra)) {
+ throw "Extra/unparsed characters found in date: " + extra;
+ }
+ }
+
+ if (year === -1) {
+ year = new Date().getFullYear();
+ } else if (year < 100) {
+ year += new Date().getFullYear() - new Date().getFullYear() % 100 +
+ (year <= shortYearCutoff ? 0 : -100);
+ }
+
+ if (doy > -1) {
+ month = 1;
+ day = doy;
+ do {
+ dim = this._getDaysInMonth(year, month - 1);
+ if (day <= dim) {
+ break;
+ }
+ month++;
+ day -= dim;
+ } while (true);
+ }
+
+ date = this._daylightSavingAdjust(new Date(year, month - 1, day));
+ if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
+ throw "Invalid date"; // E.g. 31/02/00
+ }
+ return date;
+ },
+
+ /* Standard date formats. */
+ ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
+ COOKIE: "D, dd M yy",
+ ISO_8601: "yy-mm-dd",
+ RFC_822: "D, d M y",
+ RFC_850: "DD, dd-M-y",
+ RFC_1036: "D, d M y",
+ RFC_1123: "D, d M yy",
+ RFC_2822: "D, d M yy",
+ RSS: "D, d M y", // RFC 822
+ TICKS: "!",
+ TIMESTAMP: "@",
+ W3C: "yy-mm-dd", // ISO 8601
+
+ _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
+ Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
+
+ /* Format a date object into a string value.
+ * The format can be combinations of the following:
+ * d - day of month (no leading zero)
+ * dd - day of month (two digit)
+ * o - day of year (no leading zeros)
+ * oo - day of year (three digit)
+ * D - day name short
+ * DD - day name long
+ * m - month of year (no leading zero)
+ * mm - month of year (two digit)
+ * M - month name short
+ * MM - month name long
+ * y - year (two digit)
+ * yy - year (four digit)
+ * @ - Unix timestamp (ms since 01/01/1970)
+ * ! - Windows ticks (100ns since 01/01/0001)
+ * "..." - literal text
+ * '' - single quote
+ *
+ * @param format string - the desired format of the date
+ * @param date Date - the date value to format
+ * @param settings Object - attributes include:
+ * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
+ * dayNames string[7] - names of the days from Sunday (optional)
+ * monthNamesShort string[12] - abbreviated names of the months (optional)
+ * monthNames string[12] - names of the months (optional)
+ * @return string - the date in the above format
+ */
+ formatDate: function (format, date, settings) {
+ if (!date) {
+ return "";
+ }
+
+ var iFormat,
+ dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
+ dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
+ monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
+ monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
+ // Check whether a format character is doubled
+ lookAhead = function(match) {
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
+ if (matches) {
+ iFormat++;
+ }
+ return matches;
+ },
+ // Format a number, with leading zero if necessary
+ formatNumber = function(match, value, len) {
+ var num = "" + value;
+ if (lookAhead(match)) {
+ while (num.length < len) {
+ num = "0" + num;
+ }
+ }
+ return num;
+ },
+ // Format a name, short or long as requested
+ formatName = function(match, value, shortNames, longNames) {
+ return (lookAhead(match) ? longNames[value] : shortNames[value]);
+ },
+ output = "",
+ literal = false;
+
+ if (date) {
+ for (iFormat = 0; iFormat < format.length; iFormat++) {
+ if (literal) {
+ if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
+ literal = false;
+ } else {
+ output += format.charAt(iFormat);
+ }
+ } else {
+ switch (format.charAt(iFormat)) {
+ case "d":
+ output += formatNumber("d", date.getDate(), 2);
+ break;
+ case "D":
+ output += formatName("D", date.getDay(), dayNamesShort, dayNames);
+ break;
+ case "o":
+ output += formatNumber("o",
+ Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
+ break;
+ case "m":
+ output += formatNumber("m", date.getMonth() + 1, 2);
+ break;
+ case "M":
+ output += formatName("M", date.getMonth(), monthNamesShort, monthNames);
+ break;
+ case "y":
+ output += (lookAhead("y") ? date.getFullYear() :
+ (date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100);
+ break;
+ case "@":
+ output += date.getTime();
+ break;
+ case "!":
+ output += date.getTime() * 10000 + this._ticksTo1970;
+ break;
+ case "'":
+ if (lookAhead("'")) {
+ output += "'";
+ } else {
+ literal = true;
+ }
+ break;
+ default:
+ output += format.charAt(iFormat);
+ }
+ }
+ }
+ }
+ return output;
+ },
+
+ /* Extract all possible characters from the date format. */
+ _possibleChars: function (format) {
+ var iFormat,
+ chars = "",
+ literal = false,
+ // Check whether a format character is doubled
+ lookAhead = function(match) {
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
+ if (matches) {
+ iFormat++;
+ }
+ return matches;
+ };
+
+ for (iFormat = 0; iFormat < format.length; iFormat++) {
+ if (literal) {
+ if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
+ literal = false;
+ } else {
+ chars += format.charAt(iFormat);
+ }
+ } else {
+ switch (format.charAt(iFormat)) {
+ case "d": case "m": case "y": case "@":
+ chars += "0123456789";
+ break;
+ case "D": case "M":
+ return null; // Accept anything
+ case "'":
+ if (lookAhead("'")) {
+ chars += "'";
+ } else {
+ literal = true;
+ }
+ break;
+ default:
+ chars += format.charAt(iFormat);
+ }
+ }
+ }
+ return chars;
+ },
+
+ /* Get a setting value, defaulting if necessary. */
+ _get: function(inst, name) {
+ return inst.settings[name] !== undefined ?
+ inst.settings[name] : this._defaults[name];
+ },
+
+ /* Parse existing date and initialise date picker. */
+ _setDateFromField: function(inst, noDefault) {
+ if (inst.input.val() === inst.lastVal) {
+ return;
+ }
+
+ var dateFormat = this._get(inst, "dateFormat"),
+ dates = inst.lastVal = inst.input ? inst.input.val() : null,
+ defaultDate = this._getDefaultDate(inst),
+ date = defaultDate,
+ settings = this._getFormatConfig(inst);
+
+ try {
+ date = this.parseDate(dateFormat, dates, settings) || defaultDate;
+ } catch (event) {
+ dates = (noDefault ? "" : dates);
+ }
+ inst.selectedDay = date.getDate();
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
+ inst.drawYear = inst.selectedYear = date.getFullYear();
+ inst.currentDay = (dates ? date.getDate() : 0);
+ inst.currentMonth = (dates ? date.getMonth() : 0);
+ inst.currentYear = (dates ? date.getFullYear() : 0);
+ this._adjustInstDate(inst);
+ },
+
+ /* Retrieve the default date shown on opening. */
+ _getDefaultDate: function(inst) {
+ return this._restrictMinMax(inst,
+ this._determineDate(inst, this._get(inst, "defaultDate"), new Date()));
+ },
+
+ /* A date may be specified as an exact value or a relative one. */
+ _determineDate: function(inst, date, defaultDate) {
+ var offsetNumeric = function(offset) {
+ var date = new Date();
+ date.setDate(date.getDate() + offset);
+ return date;
+ },
+ offsetString = function(offset) {
+ try {
+ return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
+ offset, $.datepicker._getFormatConfig(inst));
+ }
+ catch (e) {
+ // Ignore
+ }
+
+ var date = (offset.toLowerCase().match(/^c/) ?
+ $.datepicker._getDate(inst) : null) || new Date(),
+ year = date.getFullYear(),
+ month = date.getMonth(),
+ day = date.getDate(),
+ pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
+ matches = pattern.exec(offset);
+
+ while (matches) {
+ switch (matches[2] || "d") {
+ case "d" : case "D" :
+ day += parseInt(matches[1],10); break;
+ case "w" : case "W" :
+ day += parseInt(matches[1],10) * 7; break;
+ case "m" : case "M" :
+ month += parseInt(matches[1],10);
+ day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
+ break;
+ case "y": case "Y" :
+ year += parseInt(matches[1],10);
+ day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
+ break;
+ }
+ matches = pattern.exec(offset);
+ }
+ return new Date(year, month, day);
+ },
+ newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) :
+ (typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
+
+ newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate);
+ if (newDate) {
+ newDate.setHours(0);
+ newDate.setMinutes(0);
+ newDate.setSeconds(0);
+ newDate.setMilliseconds(0);
+ }
+ return this._daylightSavingAdjust(newDate);
+ },
+
+ /* Handle switch to/from daylight saving.
+ * Hours may be non-zero on daylight saving cut-over:
+ * > 12 when midnight changeover, but then cannot generate
+ * midnight datetime, so jump to 1AM, otherwise reset.
+ * @param date (Date) the date to check
+ * @return (Date) the corrected date
+ */
+ _daylightSavingAdjust: function(date) {
+ if (!date) {
+ return null;
+ }
+ date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
+ return date;
+ },
+
+ /* Set the date(s) directly. */
+ _setDate: function(inst, date, noChange) {
+ var clear = !date,
+ origMonth = inst.selectedMonth,
+ origYear = inst.selectedYear,
+ newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
+
+ inst.selectedDay = inst.currentDay = newDate.getDate();
+ inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
+ inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
+ if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) {
+ this._notifyChange(inst);
+ }
+ this._adjustInstDate(inst);
+ if (inst.input) {
+ inst.input.val(clear ? "" : this._formatDate(inst));
+ }
+ },
+
+ /* Retrieve the date(s) directly. */
+ _getDate: function(inst) {
+ var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null :
+ this._daylightSavingAdjust(new Date(
+ inst.currentYear, inst.currentMonth, inst.currentDay)));
+ return startDate;
+ },
+
+ /* Attach the onxxx handlers. These are declared statically so
+ * they work with static code transformers like Caja.
+ */
+ _attachHandlers: function(inst) {
+ var stepMonths = this._get(inst, "stepMonths"),
+ id = "#" + inst.id.replace( /\\\\/g, "\\" );
+ inst.dpDiv.find("[data-handler]").map(function () {
+ var handler = {
+ prev: function () {
+ $.datepicker._adjustDate(id, -stepMonths, "M");
+ },
+ next: function () {
+ $.datepicker._adjustDate(id, +stepMonths, "M");
+ },
+ hide: function () {
+ $.datepicker._hideDatepicker();
+ },
+ today: function () {
+ $.datepicker._gotoToday(id);
+ },
+ selectDay: function () {
+ $.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
+ return false;
+ },
+ selectMonth: function () {
+ $.datepicker._selectMonthYear(id, this, "M");
+ return false;
+ },
+ selectYear: function () {
+ $.datepicker._selectMonthYear(id, this, "Y");
+ return false;
+ }
+ };
+ $(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]);
+ });
+ },
+
+ /* Generate the HTML for the current state of the date picker. */
+ _generateHTML: function(inst) {
+ var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
+ controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
+ monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
+ selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
+ cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
+ printDate, dRow, tbody, daySettings, otherMonth, unselectable,
+ tempDate = new Date(),
+ today = this._daylightSavingAdjust(
+ new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time
+ isRTL = this._get(inst, "isRTL"),
+ showButtonPanel = this._get(inst, "showButtonPanel"),
+ hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
+ navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
+ numMonths = this._getNumberOfMonths(inst),
+ showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
+ stepMonths = this._get(inst, "stepMonths"),
+ isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1),
+ currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
+ new Date(inst.currentYear, inst.currentMonth, inst.currentDay))),
+ minDate = this._getMinMaxDate(inst, "min"),
+ maxDate = this._getMinMaxDate(inst, "max"),
+ drawMonth = inst.drawMonth - showCurrentAtPos,
+ drawYear = inst.drawYear;
+
+ if (drawMonth < 0) {
+ drawMonth += 12;
+ drawYear--;
+ }
+ if (maxDate) {
+ maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
+ maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
+ maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
+ while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
+ drawMonth--;
+ if (drawMonth < 0) {
+ drawMonth = 11;
+ drawYear--;
+ }
+ }
+ }
+ inst.drawMonth = drawMonth;
+ inst.drawYear = drawYear;
+
+ prevText = this._get(inst, "prevText");
+ prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
+ this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
+ this._getFormatConfig(inst)));
+
+ prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
+ "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
+ " title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" :
+ (hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+ prevText +"'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>"));
+
+ nextText = this._get(inst, "nextText");
+ nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
+ this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
+ this._getFormatConfig(inst)));
+
+ next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
+ "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
+ " title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" :
+ (hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+ nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>"));
+
+ currentText = this._get(inst, "currentText");
+ gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today);
+ currentText = (!navigationAsDateFormat ? currentText :
+ this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
+
+ controls = (!inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" +
+ this._get(inst, "closeText") + "</button>" : "");
+
+ buttonPanel = (showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") +
+ (this._isInRange(inst, gotoDate) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" +
+ ">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : "";
+
+ firstDay = parseInt(this._get(inst, "firstDay"),10);
+ firstDay = (isNaN(firstDay) ? 0 : firstDay);
+
+ showWeek = this._get(inst, "showWeek");
+ dayNames = this._get(inst, "dayNames");
+ dayNamesMin = this._get(inst, "dayNamesMin");
+ monthNames = this._get(inst, "monthNames");
+ monthNamesShort = this._get(inst, "monthNamesShort");
+ beforeShowDay = this._get(inst, "beforeShowDay");
+ showOtherMonths = this._get(inst, "showOtherMonths");
+ selectOtherMonths = this._get(inst, "selectOtherMonths");
+ defaultDate = this._getDefaultDate(inst);
+ html = "";
+ dow;
+ for (row = 0; row < numMonths[0]; row++) {
+ group = "";
+ this.maxRows = 4;
+ for (col = 0; col < numMonths[1]; col++) {
+ selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
+ cornerClass = " ui-corner-all";
+ calender = "";
+ if (isMultiMonth) {
+ calender += "<div class='ui-datepicker-group";
+ if (numMonths[1] > 1) {
+ switch (col) {
+ case 0: calender += " ui-datepicker-group-first";
+ cornerClass = " ui-corner-" + (isRTL ? "right" : "left"); break;
+ case numMonths[1]-1: calender += " ui-datepicker-group-last";
+ cornerClass = " ui-corner-" + (isRTL ? "left" : "right"); break;
+ default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
+ }
+ }
+ calender += "'>";
+ }
+ calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
+ (/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") +
+ (/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") +
+ this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
+ row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
+ "</div><table class='ui-datepicker-calendar'><thead>" +
+ "<tr>";
+ thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "");
+ for (dow = 0; dow < 7; dow++) { // days of the week
+ day = (dow + firstDay) % 7;
+ thead += "<th" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" +
+ "<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>";
+ }
+ calender += thead + "</tr></thead><tbody>";
+ daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
+ if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {
+ inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
+ }
+ leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
+ curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
+ numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
+ this.maxRows = numRows;
+ printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
+ for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows
+ calender += "<tr>";
+ tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
+ this._get(inst, "calculateWeek")(printDate) + "</td>");
+ for (dow = 0; dow < 7; dow++) { // create date picker days
+ daySettings = (beforeShowDay ?
+ beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]);
+ otherMonth = (printDate.getMonth() !== drawMonth);
+ unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
+ (minDate && printDate < minDate) || (maxDate && printDate > maxDate);
+ tbody += "<td class='" +
+ ((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + // highlight weekends
+ (otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months
+ ((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || // user pressed key
+ (defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ?
+ // or defaultDate is current printedDate and defaultDate is selectedDate
+ " " + this._dayOverClass : "") + // highlight selected day
+ (unselectable ? " " + this._unselectableClass + " ui-state-disabled": "") + // highlight unselectable days
+ (otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + // highlight custom dates
+ (printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + // highlight selected day
+ (printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + // highlight today (if different)
+ ((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "&#39;") + "'" : "") + // cell title
+ (unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + // actions
+ (otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
+ (unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
+ (printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") +
+ (printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + // highlight selected day
+ (otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months
+ "' href='#'>" + printDate.getDate() + "</a>")) + "</td>"; // display selectable date
+ printDate.setDate(printDate.getDate() + 1);
+ printDate = this._daylightSavingAdjust(printDate);
+ }
+ calender += tbody + "</tr>";
+ }
+ drawMonth++;
+ if (drawMonth > 11) {
+ drawMonth = 0;
+ drawYear++;
+ }
+ calender += "</tbody></table>" + (isMultiMonth ? "</div>" +
+ ((numMonths[0] > 0 && col === numMonths[1]-1) ? "<div class='ui-datepicker-row-break'></div>" : "") : "");
+ group += calender;
+ }
+ html += group;
+ }
+ html += buttonPanel;
+ inst._keyEvent = false;
+ return html;
+ },
+
+ /* Generate the month and year header. */
+ _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
+ secondary, monthNames, monthNamesShort) {
+
+ var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
+ changeMonth = this._get(inst, "changeMonth"),
+ changeYear = this._get(inst, "changeYear"),
+ showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
+ html = "<div class='ui-datepicker-title'>",
+ monthHtml = "";
+
+ // month selection
+ if (secondary || !changeMonth) {
+ monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
+ } else {
+ inMinYear = (minDate && minDate.getFullYear() === drawYear);
+ inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
+ monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
+ for ( month = 0; month < 12; month++) {
+ if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
+ monthHtml += "<option value='" + month + "'" +
+ (month === drawMonth ? " selected='selected'" : "") +
+ ">" + monthNamesShort[month] + "</option>";
+ }
+ }
+ monthHtml += "</select>";
+ }
+
+ if (!showMonthAfterYear) {
+ html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "");
+ }
+
+ // year selection
+ if ( !inst.yearshtml ) {
+ inst.yearshtml = "";
+ if (secondary || !changeYear) {
+ html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
+ } else {
+ // determine range of years to display
+ years = this._get(inst, "yearRange").split(":");
+ thisYear = new Date().getFullYear();
+ determineYear = function(value) {
+ var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) :
+ (value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) :
+ parseInt(value, 10)));
+ return (isNaN(year) ? thisYear : year);
+ };
+ year = determineYear(years[0]);
+ endYear = Math.max(year, determineYear(years[1] || ""));
+ year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
+ endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
+ inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
+ for (; year <= endYear; year++) {
+ inst.yearshtml += "<option value='" + year + "'" +
+ (year === drawYear ? " selected='selected'" : "") +
+ ">" + year + "</option>";
+ }
+ inst.yearshtml += "</select>";
+
+ html += inst.yearshtml;
+ inst.yearshtml = null;
+ }
+ }
+
+ html += this._get(inst, "yearSuffix");
+ if (showMonthAfterYear) {
+ html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml;
+ }
+ html += "</div>"; // Close datepicker_header
+ return html;
+ },
+
+ /* Adjust one of the date sub-fields. */
+ _adjustInstDate: function(inst, offset, period) {
+ var year = inst.drawYear + (period === "Y" ? offset : 0),
+ month = inst.drawMonth + (period === "M" ? offset : 0),
+ day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
+ date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));
+
+ inst.selectedDay = date.getDate();
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
+ inst.drawYear = inst.selectedYear = date.getFullYear();
+ if (period === "M" || period === "Y") {
+ this._notifyChange(inst);
+ }
+ },
+
+ /* Ensure a date is within any min/max bounds. */
+ _restrictMinMax: function(inst, date) {
+ var minDate = this._getMinMaxDate(inst, "min"),
+ maxDate = this._getMinMaxDate(inst, "max"),
+ newDate = (minDate && date < minDate ? minDate : date);
+ return (maxDate && newDate > maxDate ? maxDate : newDate);
+ },
+
+ /* Notify change of month/year. */
+ _notifyChange: function(inst) {
+ var onChange = this._get(inst, "onChangeMonthYear");
+ if (onChange) {
+ onChange.apply((inst.input ? inst.input[0] : null),
+ [inst.selectedYear, inst.selectedMonth + 1, inst]);
+ }
+ },
+
+ /* Determine the number of months to show. */
+ _getNumberOfMonths: function(inst) {
+ var numMonths = this._get(inst, "numberOfMonths");
+ return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths));
+ },
+
+ /* Determine the current maximum date - ensure no time components are set. */
+ _getMinMaxDate: function(inst, minMax) {
+ return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
+ },
+
+ /* Find the number of days in a given month. */
+ _getDaysInMonth: function(year, month) {
+ return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
+ },
+
+ /* Find the day of the week of the first of a month. */
+ _getFirstDayOfMonth: function(year, month) {
+ return new Date(year, month, 1).getDay();
+ },
+
+ /* Determines if we should allow a "next/prev" month display change. */
+ _canAdjustMonth: function(inst, offset, curYear, curMonth) {
+ var numMonths = this._getNumberOfMonths(inst),
+ date = this._daylightSavingAdjust(new Date(curYear,
+ curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
+
+ if (offset < 0) {
+ date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
+ }
+ return this._isInRange(inst, date);
+ },
+
+ /* Is the given date in the accepted range? */
+ _isInRange: function(inst, date) {
+ var yearSplit, currentYear,
+ minDate = this._getMinMaxDate(inst, "min"),
+ maxDate = this._getMinMaxDate(inst, "max"),
+ minYear = null,
+ maxYear = null,
+ years = this._get(inst, "yearRange");
+ if (years){
+ yearSplit = years.split(":");
+ currentYear = new Date().getFullYear();
+ minYear = parseInt(yearSplit[0], 10);
+ maxYear = parseInt(yearSplit[1], 10);
+ if ( yearSplit[0].match(/[+\-].*/) ) {
+ minYear += currentYear;
+ }
+ if ( yearSplit[1].match(/[+\-].*/) ) {
+ maxYear += currentYear;
+ }
+ }
+
+ return ((!minDate || date.getTime() >= minDate.getTime()) &&
+ (!maxDate || date.getTime() <= maxDate.getTime()) &&
+ (!minYear || date.getFullYear() >= minYear) &&
+ (!maxYear || date.getFullYear() <= maxYear));
+ },
+
+ /* Provide the configuration settings for formatting/parsing. */
+ _getFormatConfig: function(inst) {
+ var shortYearCutoff = this._get(inst, "shortYearCutoff");
+ shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff :
+ new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
+ return {shortYearCutoff: shortYearCutoff,
+ dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),
+ monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")};
+ },
+
+ /* Format the given date for display. */
+ _formatDate: function(inst, day, month, year) {
+ if (!day) {
+ inst.currentDay = inst.selectedDay;
+ inst.currentMonth = inst.selectedMonth;
+ inst.currentYear = inst.selectedYear;
+ }
+ var date = (day ? (typeof day === "object" ? day :
+ this._daylightSavingAdjust(new Date(year, month, day))) :
+ this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
+ return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));
+ }
+});
+
+/*
+ * Bind hover events for datepicker elements.
+ * Done via delegate so the binding only occurs once in the lifetime of the parent div.
+ * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
+ */
+function bindHover(dpDiv) {
+ var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
+ return dpDiv.delegate(selector, "mouseout", function() {
+ $(this).removeClass("ui-state-hover");
+ if (this.className.indexOf("ui-datepicker-prev") !== -1) {
+ $(this).removeClass("ui-datepicker-prev-hover");
+ }
+ if (this.className.indexOf("ui-datepicker-next") !== -1) {
+ $(this).removeClass("ui-datepicker-next-hover");
+ }
+ })
+ .delegate(selector, "mouseover", function(){
+ if (!$.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0])) {
+ $(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
+ $(this).addClass("ui-state-hover");
+ if (this.className.indexOf("ui-datepicker-prev") !== -1) {
+ $(this).addClass("ui-datepicker-prev-hover");
+ }
+ if (this.className.indexOf("ui-datepicker-next") !== -1) {
+ $(this).addClass("ui-datepicker-next-hover");
+ }
+ }
+ });
+}
+
+/* jQuery extend now ignores nulls! */
+function extendRemove(target, props) {
+ $.extend(target, props);
+ for (var name in props) {
+ if (props[name] == null) {
+ target[name] = props[name];
+ }
+ }
+ return target;
+}
+
+/* Invoke the datepicker functionality.
+ @param options string - a command, optionally followed by additional parameters or
+ Object - settings for attaching new datepicker functionality
+ @return jQuery object */
+$.fn.datepicker = function(options){
+
+ /* Verify an empty collection wasn't passed - Fixes #6976 */
+ if ( !this.length ) {
+ return this;
+ }
+
+ /* Initialise the date picker. */
+ if (!$.datepicker.initialized) {
+ $(document).mousedown($.datepicker._checkExternalClick);
+ $.datepicker.initialized = true;
+ }
+
+ /* Append datepicker main container to body if not exist. */
+ if ($("#"+$.datepicker._mainDivId).length === 0) {
+ $("body").append($.datepicker.dpDiv);
+ }
+
+ var otherArgs = Array.prototype.slice.call(arguments, 1);
+ if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
+ return $.datepicker["_" + options + "Datepicker"].
+ apply($.datepicker, [this[0]].concat(otherArgs));
+ }
+ if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
+ return $.datepicker["_" + options + "Datepicker"].
+ apply($.datepicker, [this[0]].concat(otherArgs));
+ }
+ return this.each(function() {
+ typeof options === "string" ?
+ $.datepicker["_" + options + "Datepicker"].
+ apply($.datepicker, [this].concat(otherArgs)) :
+ $.datepicker._attachDatepicker(this, options);
+ });
+};
+
+$.datepicker = new Datepicker(); // singleton instance
+$.datepicker.initialized = false;
+$.datepicker.uuid = new Date().getTime();
+$.datepicker.version = "1.10.4";
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+var sizeRelatedOptions = {
+ buttons: true,
+ height: true,
+ maxHeight: true,
+ maxWidth: true,
+ minHeight: true,
+ minWidth: true,
+ width: true
+ },
+ resizableRelatedOptions = {
+ maxHeight: true,
+ maxWidth: true,
+ minHeight: true,
+ minWidth: true
+ };
+
+$.widget( "ui.dialog", {
+ version: "1.10.4",
+ options: {
+ appendTo: "body",
+ autoOpen: true,
+ buttons: [],
+ closeOnEscape: true,
+ closeText: "close",
+ dialogClass: "",
+ draggable: true,
+ hide: null,
+ height: "auto",
+ maxHeight: null,
+ maxWidth: null,
+ minHeight: 150,
+ minWidth: 150,
+ modal: false,
+ position: {
+ my: "center",
+ at: "center",
+ of: window,
+ collision: "fit",
+ // Ensure the titlebar is always visible
+ using: function( pos ) {
+ var topOffset = $( this ).css( pos ).offset().top;
+ if ( topOffset < 0 ) {
+ $( this ).css( "top", pos.top - topOffset );
+ }
+ }
+ },
+ resizable: true,
+ show: null,
+ title: null,
+ width: 300,
+
+ // callbacks
+ beforeClose: null,
+ close: null,
+ drag: null,
+ dragStart: null,
+ dragStop: null,
+ focus: null,
+ open: null,
+ resize: null,
+ resizeStart: null,
+ resizeStop: null
+ },
+
+ _create: function() {
+ this.originalCss = {
+ display: this.element[0].style.display,
+ width: this.element[0].style.width,
+ minHeight: this.element[0].style.minHeight,
+ maxHeight: this.element[0].style.maxHeight,
+ height: this.element[0].style.height
+ };
+ this.originalPosition = {
+ parent: this.element.parent(),
+ index: this.element.parent().children().index( this.element )
+ };
+ this.originalTitle = this.element.attr("title");
+ this.options.title = this.options.title || this.originalTitle;
+
+ this._createWrapper();
+
+ this.element
+ .show()
+ .removeAttr("title")
+ .addClass("ui-dialog-content ui-widget-content")
+ .appendTo( this.uiDialog );
+
+ this._createTitlebar();
+ this._createButtonPane();
+
+ if ( this.options.draggable && $.fn.draggable ) {
+ this._makeDraggable();
+ }
+ if ( this.options.resizable && $.fn.resizable ) {
+ this._makeResizable();
+ }
+
+ this._isOpen = false;
+ },
+
+ _init: function() {
+ if ( this.options.autoOpen ) {
+ this.open();
+ }
+ },
+
+ _appendTo: function() {
+ var element = this.options.appendTo;
+ if ( element && (element.jquery || element.nodeType) ) {
+ return $( element );
+ }
+ return this.document.find( element || "body" ).eq( 0 );
+ },
+
+ _destroy: function() {
+ var next,
+ originalPosition = this.originalPosition;
+
+ this._destroyOverlay();
+
+ this.element
+ .removeUniqueId()
+ .removeClass("ui-dialog-content ui-widget-content")
+ .css( this.originalCss )
+ // Without detaching first, the following becomes really slow
+ .detach();
+
+ this.uiDialog.stop( true, true ).remove();
+
+ if ( this.originalTitle ) {
+ this.element.attr( "title", this.originalTitle );
+ }
+
+ next = originalPosition.parent.children().eq( originalPosition.index );
+ // Don't try to place the dialog next to itself (#8613)
+ if ( next.length && next[0] !== this.element[0] ) {
+ next.before( this.element );
+ } else {
+ originalPosition.parent.append( this.element );
+ }
+ },
+
+ widget: function() {
+ return this.uiDialog;
+ },
+
+ disable: $.noop,
+ enable: $.noop,
+
+ close: function( event ) {
+ var activeElement,
+ that = this;
+
+ if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
+ return;
+ }
+
+ this._isOpen = false;
+ this._destroyOverlay();
+
+ if ( !this.opener.filter(":focusable").focus().length ) {
+
+ // support: IE9
+ // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
+ try {
+ activeElement = this.document[ 0 ].activeElement;
+
+ // Support: IE9, IE10
+ // If the <body> is blurred, IE will switch windows, see #4520
+ if ( activeElement && activeElement.nodeName.toLowerCase() !== "body" ) {
+
+ // Hiding a focused element doesn't trigger blur in WebKit
+ // so in case we have nothing to focus on, explicitly blur the active element
+ // https://bugs.webkit.org/show_bug.cgi?id=47182
+ $( activeElement ).blur();
+ }
+ } catch ( error ) {}
+ }
+
+ this._hide( this.uiDialog, this.options.hide, function() {
+ that._trigger( "close", event );
+ });
+ },
+
+ isOpen: function() {
+ return this._isOpen;
+ },
+
+ moveToTop: function() {
+ this._moveToTop();
+ },
+
+ _moveToTop: function( event, silent ) {
+ var moved = !!this.uiDialog.nextAll(":visible").insertBefore( this.uiDialog ).length;
+ if ( moved && !silent ) {
+ this._trigger( "focus", event );
+ }
+ return moved;
+ },
+
+ open: function() {
+ var that = this;
+ if ( this._isOpen ) {
+ if ( this._moveToTop() ) {
+ this._focusTabbable();
+ }
+ return;
+ }
+
+ this._isOpen = true;
+ this.opener = $( this.document[0].activeElement );
+
+ this._size();
+ this._position();
+ this._createOverlay();
+ this._moveToTop( null, true );
+ this._show( this.uiDialog, this.options.show, function() {
+ that._focusTabbable();
+ that._trigger("focus");
+ });
+
+ this._trigger("open");
+ },
+
+ _focusTabbable: function() {
+ // Set focus to the first match:
+ // 1. First element inside the dialog matching [autofocus]
+ // 2. Tabbable element inside the content element
+ // 3. Tabbable element inside the buttonpane
+ // 4. The close button
+ // 5. The dialog itself
+ var hasFocus = this.element.find("[autofocus]");
+ if ( !hasFocus.length ) {
+ hasFocus = this.element.find(":tabbable");
+ }
+ if ( !hasFocus.length ) {
+ hasFocus = this.uiDialogButtonPane.find(":tabbable");
+ }
+ if ( !hasFocus.length ) {
+ hasFocus = this.uiDialogTitlebarClose.filter(":tabbable");
+ }
+ if ( !hasFocus.length ) {
+ hasFocus = this.uiDialog;
+ }
+ hasFocus.eq( 0 ).focus();
+ },
+
+ _keepFocus: function( event ) {
+ function checkFocus() {
+ var activeElement = this.document[0].activeElement,
+ isActive = this.uiDialog[0] === activeElement ||
+ $.contains( this.uiDialog[0], activeElement );
+ if ( !isActive ) {
+ this._focusTabbable();
+ }
+ }
+ event.preventDefault();
+ checkFocus.call( this );
+ // support: IE
+ // IE <= 8 doesn't prevent moving focus even with event.preventDefault()
+ // so we check again later
+ this._delay( checkFocus );
+ },
+
+ _createWrapper: function() {
+ this.uiDialog = $("<div>")
+ .addClass( "ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " +
+ this.options.dialogClass )
+ .hide()
+ .attr({
+ // Setting tabIndex makes the div focusable
+ tabIndex: -1,
+ role: "dialog"
+ })
+ .appendTo( this._appendTo() );
+
+ this._on( this.uiDialog, {
+ keydown: function( event ) {
+ if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
+ event.keyCode === $.ui.keyCode.ESCAPE ) {
+ event.preventDefault();
+ this.close( event );
+ return;
+ }
+
+ // prevent tabbing out of dialogs
+ if ( event.keyCode !== $.ui.keyCode.TAB ) {
+ return;
+ }
+ var tabbables = this.uiDialog.find(":tabbable"),
+ first = tabbables.filter(":first"),
+ last = tabbables.filter(":last");
+
+ if ( ( event.target === last[0] || event.target === this.uiDialog[0] ) && !event.shiftKey ) {
+ first.focus( 1 );
+ event.preventDefault();
+ } else if ( ( event.target === first[0] || event.target === this.uiDialog[0] ) && event.shiftKey ) {
+ last.focus( 1 );
+ event.preventDefault();
+ }
+ },
+ mousedown: function( event ) {
+ if ( this._moveToTop( event ) ) {
+ this._focusTabbable();
+ }
+ }
+ });
+
+ // We assume that any existing aria-describedby attribute means
+ // that the dialog content is marked up properly
+ // otherwise we brute force the content as the description
+ if ( !this.element.find("[aria-describedby]").length ) {
+ this.uiDialog.attr({
+ "aria-describedby": this.element.uniqueId().attr("id")
+ });
+ }
+ },
+
+ _createTitlebar: function() {
+ var uiDialogTitle;
+
+ this.uiDialogTitlebar = $("<div>")
+ .addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix")
+ .prependTo( this.uiDialog );
+ this._on( this.uiDialogTitlebar, {
+ mousedown: function( event ) {
+ // Don't prevent click on close button (#8838)
+ // Focusing a dialog that is partially scrolled out of view
+ // causes the browser to scroll it into view, preventing the click event
+ if ( !$( event.target ).closest(".ui-dialog-titlebar-close") ) {
+ // Dialog isn't getting focus when dragging (#8063)
+ this.uiDialog.focus();
+ }
+ }
+ });
+
+ // support: IE
+ // Use type="button" to prevent enter keypresses in textboxes from closing the
+ // dialog in IE (#9312)
+ this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
+ .button({
+ label: this.options.closeText,
+ icons: {
+ primary: "ui-icon-closethick"
+ },
+ text: false
+ })
+ .addClass("ui-dialog-titlebar-close")
+ .appendTo( this.uiDialogTitlebar );
+ this._on( this.uiDialogTitlebarClose, {
+ click: function( event ) {
+ event.preventDefault();
+ this.close( event );
+ }
+ });
+
+ uiDialogTitle = $("<span>")
+ .uniqueId()
+ .addClass("ui-dialog-title")
+ .prependTo( this.uiDialogTitlebar );
+ this._title( uiDialogTitle );
+
+ this.uiDialog.attr({
+ "aria-labelledby": uiDialogTitle.attr("id")
+ });
+ },
+
+ _title: function( title ) {
+ if ( !this.options.title ) {
+ title.html("&#160;");
+ }
+ title.text( this.options.title );
+ },
+
+ _createButtonPane: function() {
+ this.uiDialogButtonPane = $("<div>")
+ .addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");
+
+ this.uiButtonSet = $("<div>")
+ .addClass("ui-dialog-buttonset")
+ .appendTo( this.uiDialogButtonPane );
+
+ this._createButtons();
+ },
+
+ _createButtons: function() {
+ var that = this,
+ buttons = this.options.buttons;
+
+ // if we already have a button pane, remove it
+ this.uiDialogButtonPane.remove();
+ this.uiButtonSet.empty();
+
+ if ( $.isEmptyObject( buttons ) || ($.isArray( buttons ) && !buttons.length) ) {
+ this.uiDialog.removeClass("ui-dialog-buttons");
+ return;
+ }
+
+ $.each( buttons, function( name, props ) {
+ var click, buttonOptions;
+ props = $.isFunction( props ) ?
+ { click: props, text: name } :
+ props;
+ // Default to a non-submitting button
+ props = $.extend( { type: "button" }, props );
+ // Change the context for the click callback to be the main element
+ click = props.click;
+ props.click = function() {
+ click.apply( that.element[0], arguments );
+ };
+ buttonOptions = {
+ icons: props.icons,
+ text: props.showText
+ };
+ delete props.icons;
+ delete props.showText;
+ $( "<button></button>", props )
+ .button( buttonOptions )
+ .appendTo( that.uiButtonSet );
+ });
+ this.uiDialog.addClass("ui-dialog-buttons");
+ this.uiDialogButtonPane.appendTo( this.uiDialog );
+ },
+
+ _makeDraggable: function() {
+ var that = this,
+ options = this.options;
+
+ function filteredUi( ui ) {
+ return {
+ position: ui.position,
+ offset: ui.offset
+ };
+ }
+
+ this.uiDialog.draggable({
+ cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
+ handle: ".ui-dialog-titlebar",
+ containment: "document",
+ start: function( event, ui ) {
+ $( this ).addClass("ui-dialog-dragging");
+ that._blockFrames();
+ that._trigger( "dragStart", event, filteredUi( ui ) );
+ },
+ drag: function( event, ui ) {
+ that._trigger( "drag", event, filteredUi( ui ) );
+ },
+ stop: function( event, ui ) {
+ options.position = [
+ ui.position.left - that.document.scrollLeft(),
+ ui.position.top - that.document.scrollTop()
+ ];
+ $( this ).removeClass("ui-dialog-dragging");
+ that._unblockFrames();
+ that._trigger( "dragStop", event, filteredUi( ui ) );
+ }
+ });
+ },
+
+ _makeResizable: function() {
+ var that = this,
+ options = this.options,
+ handles = options.resizable,
+ // .ui-resizable has position: relative defined in the stylesheet
+ // but dialogs have to use absolute or fixed positioning
+ position = this.uiDialog.css("position"),
+ resizeHandles = typeof handles === "string" ?
+ handles :
+ "n,e,s,w,se,sw,ne,nw";
+
+ function filteredUi( ui ) {
+ return {
+ originalPosition: ui.originalPosition,
+ originalSize: ui.originalSize,
+ position: ui.position,
+ size: ui.size
+ };
+ }
+
+ this.uiDialog.resizable({
+ cancel: ".ui-dialog-content",
+ containment: "document",
+ alsoResize: this.element,
+ maxWidth: options.maxWidth,
+ maxHeight: options.maxHeight,
+ minWidth: options.minWidth,
+ minHeight: this._minHeight(),
+ handles: resizeHandles,
+ start: function( event, ui ) {
+ $( this ).addClass("ui-dialog-resizing");
+ that._blockFrames();
+ that._trigger( "resizeStart", event, filteredUi( ui ) );
+ },
+ resize: function( event, ui ) {
+ that._trigger( "resize", event, filteredUi( ui ) );
+ },
+ stop: function( event, ui ) {
+ options.height = $( this ).height();
+ options.width = $( this ).width();
+ $( this ).removeClass("ui-dialog-resizing");
+ that._unblockFrames();
+ that._trigger( "resizeStop", event, filteredUi( ui ) );
+ }
+ })
+ .css( "position", position );
+ },
+
+ _minHeight: function() {
+ var options = this.options;
+
+ return options.height === "auto" ?
+ options.minHeight :
+ Math.min( options.minHeight, options.height );
+ },
+
+ _position: function() {
+ // Need to show the dialog to get the actual offset in the position plugin
+ var isVisible = this.uiDialog.is(":visible");
+ if ( !isVisible ) {
+ this.uiDialog.show();
+ }
+ this.uiDialog.position( this.options.position );
+ if ( !isVisible ) {
+ this.uiDialog.hide();
+ }
+ },
+
+ _setOptions: function( options ) {
+ var that = this,
+ resize = false,
+ resizableOptions = {};
+
+ $.each( options, function( key, value ) {
+ that._setOption( key, value );
+
+ if ( key in sizeRelatedOptions ) {
+ resize = true;
+ }
+ if ( key in resizableRelatedOptions ) {
+ resizableOptions[ key ] = value;
+ }
+ });
+
+ if ( resize ) {
+ this._size();
+ this._position();
+ }
+ if ( this.uiDialog.is(":data(ui-resizable)") ) {
+ this.uiDialog.resizable( "option", resizableOptions );
+ }
+ },
+
+ _setOption: function( key, value ) {
+ var isDraggable, isResizable,
+ uiDialog = this.uiDialog;
+
+ if ( key === "dialogClass" ) {
+ uiDialog
+ .removeClass( this.options.dialogClass )
+ .addClass( value );
+ }
+
+ if ( key === "disabled" ) {
+ return;
+ }
+
+ this._super( key, value );
+
+ if ( key === "appendTo" ) {
+ this.uiDialog.appendTo( this._appendTo() );
+ }
+
+ if ( key === "buttons" ) {
+ this._createButtons();
+ }
+
+ if ( key === "closeText" ) {
+ this.uiDialogTitlebarClose.button({
+ // Ensure that we always pass a string
+ label: "" + value
+ });
+ }
+
+ if ( key === "draggable" ) {
+ isDraggable = uiDialog.is(":data(ui-draggable)");
+ if ( isDraggable && !value ) {
+ uiDialog.draggable("destroy");
+ }
+
+ if ( !isDraggable && value ) {
+ this._makeDraggable();
+ }
+ }
+
+ if ( key === "position" ) {
+ this._position();
+ }
+
+ if ( key === "resizable" ) {
+ // currently resizable, becoming non-resizable
+ isResizable = uiDialog.is(":data(ui-resizable)");
+ if ( isResizable && !value ) {
+ uiDialog.resizable("destroy");
+ }
+
+ // currently resizable, changing handles
+ if ( isResizable && typeof value === "string" ) {
+ uiDialog.resizable( "option", "handles", value );
+ }
+
+ // currently non-resizable, becoming resizable
+ if ( !isResizable && value !== false ) {
+ this._makeResizable();
+ }
+ }
+
+ if ( key === "title" ) {
+ this._title( this.uiDialogTitlebar.find(".ui-dialog-title") );
+ }
+ },
+
+ _size: function() {
+ // If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
+ // divs will both have width and height set, so we need to reset them
+ var nonContentHeight, minContentHeight, maxContentHeight,
+ options = this.options;
+
+ // Reset content sizing
+ this.element.show().css({
+ width: "auto",
+ minHeight: 0,
+ maxHeight: "none",
+ height: 0
+ });
+
+ if ( options.minWidth > options.width ) {
+ options.width = options.minWidth;
+ }
+
+ // reset wrapper sizing
+ // determine the height of all the non-content elements
+ nonContentHeight = this.uiDialog.css({
+ height: "auto",
+ width: options.width
+ })
+ .outerHeight();
+ minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
+ maxContentHeight = typeof options.maxHeight === "number" ?
+ Math.max( 0, options.maxHeight - nonContentHeight ) :
+ "none";
+
+ if ( options.height === "auto" ) {
+ this.element.css({
+ minHeight: minContentHeight,
+ maxHeight: maxContentHeight,
+ height: "auto"
+ });
+ } else {
+ this.element.height( Math.max( 0, options.height - nonContentHeight ) );
+ }
+
+ if (this.uiDialog.is(":data(ui-resizable)") ) {
+ this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
+ }
+ },
+
+ _blockFrames: function() {
+ this.iframeBlocks = this.document.find( "iframe" ).map(function() {
+ var iframe = $( this );
+
+ return $( "<div>" )
+ .css({
+ position: "absolute",
+ width: iframe.outerWidth(),
+ height: iframe.outerHeight()
+ })
+ .appendTo( iframe.parent() )
+ .offset( iframe.offset() )[0];
+ });
+ },
+
+ _unblockFrames: function() {
+ if ( this.iframeBlocks ) {
+ this.iframeBlocks.remove();
+ delete this.iframeBlocks;
+ }
+ },
+
+ _allowInteraction: function( event ) {
+ if ( $( event.target ).closest(".ui-dialog").length ) {
+ return true;
+ }
+
+ // TODO: Remove hack when datepicker implements
+ // the .ui-front logic (#8989)
+ return !!$( event.target ).closest(".ui-datepicker").length;
+ },
+
+ _createOverlay: function() {
+ if ( !this.options.modal ) {
+ return;
+ }
+
+ var that = this,
+ widgetFullName = this.widgetFullName;
+ if ( !$.ui.dialog.overlayInstances ) {
+ // Prevent use of anchors and inputs.
+ // We use a delay in case the overlay is created from an
+ // event that we're going to be cancelling. (#2804)
+ this._delay(function() {
+ // Handle .dialog().dialog("close") (#4065)
+ if ( $.ui.dialog.overlayInstances ) {
+ this.document.bind( "focusin.dialog", function( event ) {
+ if ( !that._allowInteraction( event ) ) {
+ event.preventDefault();
+ $(".ui-dialog:visible:last .ui-dialog-content")
+ .data( widgetFullName )._focusTabbable();
+ }
+ });
+ }
+ });
+ }
+
+ this.overlay = $("<div>")
+ .addClass("ui-widget-overlay ui-front")
+ .appendTo( this._appendTo() );
+ this._on( this.overlay, {
+ mousedown: "_keepFocus"
+ });
+ $.ui.dialog.overlayInstances++;
+ },
+
+ _destroyOverlay: function() {
+ if ( !this.options.modal ) {
+ return;
+ }
+
+ if ( this.overlay ) {
+ $.ui.dialog.overlayInstances--;
+
+ if ( !$.ui.dialog.overlayInstances ) {
+ this.document.unbind( "focusin.dialog" );
+ }
+ this.overlay.remove();
+ this.overlay = null;
+ }
+ }
+});
+
+$.ui.dialog.overlayInstances = 0;
+
+// DEPRECATED
+if ( $.uiBackCompat !== false ) {
+ // position option with array notation
+ // just override with old implementation
+ $.widget( "ui.dialog", $.ui.dialog, {
+ _position: function() {
+ var position = this.options.position,
+ myAt = [],
+ offset = [ 0, 0 ],
+ isVisible;
+
+ if ( position ) {
+ if ( typeof position === "string" || (typeof position === "object" && "0" in position ) ) {
+ myAt = position.split ? position.split(" ") : [ position[0], position[1] ];
+ if ( myAt.length === 1 ) {
+ myAt[1] = myAt[0];
+ }
+
+ $.each( [ "left", "top" ], function( i, offsetPosition ) {
+ if ( +myAt[ i ] === myAt[ i ] ) {
+ offset[ i ] = myAt[ i ];
+ myAt[ i ] = offsetPosition;
+ }
+ });
+
+ position = {
+ my: myAt[0] + (offset[0] < 0 ? offset[0] : "+" + offset[0]) + " " +
+ myAt[1] + (offset[1] < 0 ? offset[1] : "+" + offset[1]),
+ at: myAt.join(" ")
+ };
+ }
+
+ position = $.extend( {}, $.ui.dialog.prototype.options.position, position );
+ } else {
+ position = $.ui.dialog.prototype.options.position;
+ }
+
+ // need to show the dialog to get the actual offset in the position plugin
+ isVisible = this.uiDialog.is(":visible");
+ if ( !isVisible ) {
+ this.uiDialog.show();
+ }
+ this.uiDialog.position( position );
+ if ( !isVisible ) {
+ this.uiDialog.hide();
+ }
+ }
+ });
+}
+
+}( jQuery ) );
+
+(function( $, undefined ) {
+
+var rvertical = /up|down|vertical/,
+ rpositivemotion = /up|left|vertical|horizontal/;
+
+$.effects.effect.blind = function( o, done ) {
+ // Create element
+ var el = $( this ),
+ props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
+ mode = $.effects.setMode( el, o.mode || "hide" ),
+ direction = o.direction || "up",
+ vertical = rvertical.test( direction ),
+ ref = vertical ? "height" : "width",
+ ref2 = vertical ? "top" : "left",
+ motion = rpositivemotion.test( direction ),
+ animation = {},
+ show = mode === "show",
+ wrapper, distance, margin;
+
+ // if already wrapped, the wrapper's properties are my property. #6245
+ if ( el.parent().is( ".ui-effects-wrapper" ) ) {
+ $.effects.save( el.parent(), props );
+ } else {
+ $.effects.save( el, props );
+ }
+ el.show();
+ wrapper = $.effects.createWrapper( el ).css({
+ overflow: "hidden"
+ });
+
+ distance = wrapper[ ref ]();
+ margin = parseFloat( wrapper.css( ref2 ) ) || 0;
+
+ animation[ ref ] = show ? distance : 0;
+ if ( !motion ) {
+ el
+ .css( vertical ? "bottom" : "right", 0 )
+ .css( vertical ? "top" : "left", "auto" )
+ .css({ position: "absolute" });
+
+ animation[ ref2 ] = show ? margin : distance + margin;
+ }
+
+ // start at 0 if we are showing
+ if ( show ) {
+ wrapper.css( ref, 0 );
+ if ( ! motion ) {
+ wrapper.css( ref2, margin + distance );
+ }
+ }
+
+ // Animate
+ wrapper.animate( animation, {
+ duration: o.duration,
+ easing: o.easing,
+ queue: false,
+ complete: function() {
+ if ( mode === "hide" ) {
+ el.hide();
+ }
+ $.effects.restore( el, props );
+ $.effects.removeWrapper( el );
+ done();
+ }
+ });
+
+};
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+$.effects.effect.bounce = function( o, done ) {
+ var el = $( this ),
+ props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
+
+ // defaults:
+ mode = $.effects.setMode( el, o.mode || "effect" ),
+ hide = mode === "hide",
+ show = mode === "show",
+ direction = o.direction || "up",
+ distance = o.distance,
+ times = o.times || 5,
+
+ // number of internal animations
+ anims = times * 2 + ( show || hide ? 1 : 0 ),
+ speed = o.duration / anims,
+ easing = o.easing,
+
+ // utility:
+ ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
+ motion = ( direction === "up" || direction === "left" ),
+ i,
+ upAnim,
+ downAnim,
+
+ // we will need to re-assemble the queue to stack our animations in place
+ queue = el.queue(),
+ queuelen = queue.length;
+
+ // Avoid touching opacity to prevent clearType and PNG issues in IE
+ if ( show || hide ) {
+ props.push( "opacity" );
+ }
+
+ $.effects.save( el, props );
+ el.show();
+ $.effects.createWrapper( el ); // Create Wrapper
+
+ // default distance for the BIGGEST bounce is the outer Distance / 3
+ if ( !distance ) {
+ distance = el[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;
+ }
+
+ if ( show ) {
+ downAnim = { opacity: 1 };
+ downAnim[ ref ] = 0;
+
+ // if we are showing, force opacity 0 and set the initial position
+ // then do the "first" animation
+ el.css( "opacity", 0 )
+ .css( ref, motion ? -distance * 2 : distance * 2 )
+ .animate( downAnim, speed, easing );
+ }
+
+ // start at the smallest distance if we are hiding
+ if ( hide ) {
+ distance = distance / Math.pow( 2, times - 1 );
+ }
+
+ downAnim = {};
+ downAnim[ ref ] = 0;
+ // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
+ for ( i = 0; i < times; i++ ) {
+ upAnim = {};
+ upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
+
+ el.animate( upAnim, speed, easing )
+ .animate( downAnim, speed, easing );
+
+ distance = hide ? distance * 2 : distance / 2;
+ }
+
+ // Last Bounce when Hiding
+ if ( hide ) {
+ upAnim = { opacity: 0 };
+ upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
+
+ el.animate( upAnim, speed, easing );
+ }
+
+ el.queue(function() {
+ if ( hide ) {
+ el.hide();
+ }
+ $.effects.restore( el, props );
+ $.effects.removeWrapper( el );
+ done();
+ });
+
+ // inject all the animations we just queued to be first in line (after "inprogress")
+ if ( queuelen > 1) {
+ queue.splice.apply( queue,
+ [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
+ }
+ el.dequeue();
+
+};
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+$.effects.effect.clip = function( o, done ) {
+ // Create element
+ var el = $( this ),
+ props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
+ mode = $.effects.setMode( el, o.mode || "hide" ),
+ show = mode === "show",
+ direction = o.direction || "vertical",
+ vert = direction === "vertical",
+ size = vert ? "height" : "width",
+ position = vert ? "top" : "left",
+ animation = {},
+ wrapper, animate, distance;
+
+ // Save & Show
+ $.effects.save( el, props );
+ el.show();
+
+ // Create Wrapper
+ wrapper = $.effects.createWrapper( el ).css({
+ overflow: "hidden"
+ });
+ animate = ( el[0].tagName === "IMG" ) ? wrapper : el;
+ distance = animate[ size ]();
+
+ // Shift
+ if ( show ) {
+ animate.css( size, 0 );
+ animate.css( position, distance / 2 );
+ }
+
+ // Create Animation Object:
+ animation[ size ] = show ? distance : 0;
+ animation[ position ] = show ? 0 : distance / 2;
+
+ // Animate
+ animate.animate( animation, {
+ queue: false,
+ duration: o.duration,
+ easing: o.easing,
+ complete: function() {
+ if ( !show ) {
+ el.hide();
+ }
+ $.effects.restore( el, props );
+ $.effects.removeWrapper( el );
+ done();
+ }
+ });
+
+};
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+$.effects.effect.drop = function( o, done ) {
+
+ var el = $( this ),
+ props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],
+ mode = $.effects.setMode( el, o.mode || "hide" ),
+ show = mode === "show",
+ direction = o.direction || "left",
+ ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
+ motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg",
+ animation = {
+ opacity: show ? 1 : 0
+ },
+ distance;
+
+ // Adjust
+ $.effects.save( el, props );
+ el.show();
+ $.effects.createWrapper( el );
+
+ distance = o.distance || el[ ref === "top" ? "outerHeight": "outerWidth" ]( true ) / 2;
+
+ if ( show ) {
+ el
+ .css( "opacity", 0 )
+ .css( ref, motion === "pos" ? -distance : distance );
+ }
+
+ // Animation
+ animation[ ref ] = ( show ?
+ ( motion === "pos" ? "+=" : "-=" ) :
+ ( motion === "pos" ? "-=" : "+=" ) ) +
+ distance;
+
+ // Animate
+ el.animate( animation, {
+ queue: false,
+ duration: o.duration,
+ easing: o.easing,
+ complete: function() {
+ if ( mode === "hide" ) {
+ el.hide();
+ }
+ $.effects.restore( el, props );
+ $.effects.removeWrapper( el );
+ done();
+ }
+ });
+};
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+$.effects.effect.explode = function( o, done ) {
+
+ var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3,
+ cells = rows,
+ el = $( this ),
+ mode = $.effects.setMode( el, o.mode || "hide" ),
+ show = mode === "show",
+
+ // show and then visibility:hidden the element before calculating offset
+ offset = el.show().css( "visibility", "hidden" ).offset(),
+
+ // width and height of a piece
+ width = Math.ceil( el.outerWidth() / cells ),
+ height = Math.ceil( el.outerHeight() / rows ),
+ pieces = [],
+
+ // loop
+ i, j, left, top, mx, my;
+
+ // children animate complete:
+ function childComplete() {
+ pieces.push( this );
+ if ( pieces.length === rows * cells ) {
+ animComplete();
+ }
+ }
+
+ // clone the element for each row and cell.
+ for( i = 0; i < rows ; i++ ) { // ===>
+ top = offset.top + i * height;
+ my = i - ( rows - 1 ) / 2 ;
+
+ for( j = 0; j < cells ; j++ ) { // |||
+ left = offset.left + j * width;
+ mx = j - ( cells - 1 ) / 2 ;
+
+ // Create a clone of the now hidden main element that will be absolute positioned
+ // within a wrapper div off the -left and -top equal to size of our pieces
+ el
+ .clone()
+ .appendTo( "body" )
+ .wrap( "<div></div>" )
+ .css({
+ position: "absolute",
+ visibility: "visible",
+ left: -j * width,
+ top: -i * height
+ })
+
+ // select the wrapper - make it overflow: hidden and absolute positioned based on
+ // where the original was located +left and +top equal to the size of pieces
+ .parent()
+ .addClass( "ui-effects-explode" )
+ .css({
+ position: "absolute",
+ overflow: "hidden",
+ width: width,
+ height: height,
+ left: left + ( show ? mx * width : 0 ),
+ top: top + ( show ? my * height : 0 ),
+ opacity: show ? 0 : 1
+ }).animate({
+ left: left + ( show ? 0 : mx * width ),
+ top: top + ( show ? 0 : my * height ),
+ opacity: show ? 1 : 0
+ }, o.duration || 500, o.easing, childComplete );
+ }
+ }
+
+ function animComplete() {
+ el.css({
+ visibility: "visible"
+ });
+ $( pieces ).remove();
+ if ( !show ) {
+ el.hide();
+ }
+ done();
+ }
+};
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+$.effects.effect.fade = function( o, done ) {
+ var el = $( this ),
+ mode = $.effects.setMode( el, o.mode || "toggle" );
+
+ el.animate({
+ opacity: mode
+ }, {
+ queue: false,
+ duration: o.duration,
+ easing: o.easing,
+ complete: done
+ });
+};
+
+})( jQuery );
+
+(function( $, undefined ) {
+
+$.effects.effect.fold = function( o, done ) {
+
+ // Create element
+ var el = $( this ),
+ props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
+ mode = $.effects.setMode( el, o.mode || "hide" ),
+ show = mode === "show",
+ hide = mode === "hide",
+ size = o.size || 15,
+ percent = /([0-9]+)%/.exec( size ),
+ horizFirst = !!o.horizFirst,
+ widthFirst = show !== horizFirst,
+ ref = widthFirst ? [ "width", "height" ] : [ "height", "width" ],
+ duration = o.duration / 2,
+ wrapper, distance,
+ animation1 = {},
+ animation2 = {};
+
+ $.effects.save( el, props );
+ el.show();
+
+ // Create Wrapper
+ wrapper = $.effects.createWrapper( el ).css({
+ overflow: "hidden"
+ });
+ distance = widthFirst ?
+ [ wrapper.width(), wrapper.height() ] :
+ [ wrapper.height(), wrapper.width() ];
+
+ if ( percent ) {
+ size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];
+ }
+ if ( show ) {
+ wrapper.css( horizFirst ? {
+ height: 0,
+ width: size
+ } : {
+ height: size,
+ width: 0
+ });
+ }
+
+ // Animation
+ animation1[ ref[ 0 ] ] = show ? distance[ 0 ] : size;
+ animation2[ ref[ 1 ] ] = show ? distance[ 1 ] : 0;
+
+ // Animate
+ wrapper
+ .animate( animation1, duration, o.easing )
+ .animate( animation2, duration, o.easing, function() {
+ if ( hide ) {
+ el.hide();
+ }
+ $.effects.restore( el, props );
+ $.effects.removeWrapper( el );
+ done();
+ });
+
+};
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+$.effects.effect.highlight = function( o, done ) {
+ var elem = $( this ),
+ props = [ "backgroundImage", "backgroundColor", "opacity" ],
+ mode = $.effects.setMode( elem, o.mode || "show" ),
+ animation = {
+ backgroundColor: elem.css( "backgroundColor" )
+ };
+
+ if (mode === "hide") {
+ animation.opacity = 0;
+ }
+
+ $.effects.save( elem, props );
+
+ elem
+ .show()
+ .css({
+ backgroundImage: "none",
+ backgroundColor: o.color || "#ffff99"
+ })
+ .animate( animation, {
+ queue: false,
+ duration: o.duration,
+ easing: o.easing,
+ complete: function() {
+ if ( mode === "hide" ) {
+ elem.hide();
+ }
+ $.effects.restore( elem, props );
+ done();
+ }
+ });
+};
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+$.effects.effect.pulsate = function( o, done ) {
+ var elem = $( this ),
+ mode = $.effects.setMode( elem, o.mode || "show" ),
+ show = mode === "show",
+ hide = mode === "hide",
+ showhide = ( show || mode === "hide" ),
+
+ // showing or hiding leaves of the "last" animation
+ anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
+ duration = o.duration / anims,
+ animateTo = 0,
+ queue = elem.queue(),
+ queuelen = queue.length,
+ i;
+
+ if ( show || !elem.is(":visible")) {
+ elem.css( "opacity", 0 ).show();
+ animateTo = 1;
+ }
+
+ // anims - 1 opacity "toggles"
+ for ( i = 1; i < anims; i++ ) {
+ elem.animate({
+ opacity: animateTo
+ }, duration, o.easing );
+ animateTo = 1 - animateTo;
+ }
+
+ elem.animate({
+ opacity: animateTo
+ }, duration, o.easing);
+
+ elem.queue(function() {
+ if ( hide ) {
+ elem.hide();
+ }
+ done();
+ });
+
+ // We just queued up "anims" animations, we need to put them next in the queue
+ if ( queuelen > 1 ) {
+ queue.splice.apply( queue,
+ [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
+ }
+ elem.dequeue();
+};
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+$.effects.effect.puff = function( o, done ) {
+ var elem = $( this ),
+ mode = $.effects.setMode( elem, o.mode || "hide" ),
+ hide = mode === "hide",
+ percent = parseInt( o.percent, 10 ) || 150,
+ factor = percent / 100,
+ original = {
+ height: elem.height(),
+ width: elem.width(),
+ outerHeight: elem.outerHeight(),
+ outerWidth: elem.outerWidth()
+ };
+
+ $.extend( o, {
+ effect: "scale",
+ queue: false,
+ fade: true,
+ mode: mode,
+ complete: done,
+ percent: hide ? percent : 100,
+ from: hide ?
+ original :
+ {
+ height: original.height * factor,
+ width: original.width * factor,
+ outerHeight: original.outerHeight * factor,
+ outerWidth: original.outerWidth * factor
+ }
+ });
+
+ elem.effect( o );
+};
+
+$.effects.effect.scale = function( o, done ) {
+
+ // Create element
+ var el = $( this ),
+ options = $.extend( true, {}, o ),
+ mode = $.effects.setMode( el, o.mode || "effect" ),
+ percent = parseInt( o.percent, 10 ) ||
+ ( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ),
+ direction = o.direction || "both",
+ origin = o.origin,
+ original = {
+ height: el.height(),
+ width: el.width(),
+ outerHeight: el.outerHeight(),
+ outerWidth: el.outerWidth()
+ },
+ factor = {
+ y: direction !== "horizontal" ? (percent / 100) : 1,
+ x: direction !== "vertical" ? (percent / 100) : 1
+ };
+
+ // We are going to pass this effect to the size effect:
+ options.effect = "size";
+ options.queue = false;
+ options.complete = done;
+
+ // Set default origin and restore for show/hide
+ if ( mode !== "effect" ) {
+ options.origin = origin || ["middle","center"];
+ options.restore = true;
+ }
+
+ options.from = o.from || ( mode === "show" ? {
+ height: 0,
+ width: 0,
+ outerHeight: 0,
+ outerWidth: 0
+ } : original );
+ options.to = {
+ height: original.height * factor.y,
+ width: original.width * factor.x,
+ outerHeight: original.outerHeight * factor.y,
+ outerWidth: original.outerWidth * factor.x
+ };
+
+ // Fade option to support puff
+ if ( options.fade ) {
+ if ( mode === "show" ) {
+ options.from.opacity = 0;
+ options.to.opacity = 1;
+ }
+ if ( mode === "hide" ) {
+ options.from.opacity = 1;
+ options.to.opacity = 0;
+ }
+ }
+
+ // Animate
+ el.effect( options );
+
+};
+
+$.effects.effect.size = function( o, done ) {
+
+ // Create element
+ var original, baseline, factor,
+ el = $( this ),
+ props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ],
+
+ // Always restore
+ props1 = [ "position", "top", "bottom", "left", "right", "overflow", "opacity" ],
+
+ // Copy for children
+ props2 = [ "width", "height", "overflow" ],
+ cProps = [ "fontSize" ],
+ vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ],
+ hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ],
+
+ // Set options
+ mode = $.effects.setMode( el, o.mode || "effect" ),
+ restore = o.restore || mode !== "effect",
+ scale = o.scale || "both",
+ origin = o.origin || [ "middle", "center" ],
+ position = el.css( "position" ),
+ props = restore ? props0 : props1,
+ zero = {
+ height: 0,
+ width: 0,
+ outerHeight: 0,
+ outerWidth: 0
+ };
+
+ if ( mode === "show" ) {
+ el.show();
+ }
+ original = {
+ height: el.height(),
+ width: el.width(),
+ outerHeight: el.outerHeight(),
+ outerWidth: el.outerWidth()
+ };
+
+ if ( o.mode === "toggle" && mode === "show" ) {
+ el.from = o.to || zero;
+ el.to = o.from || original;
+ } else {
+ el.from = o.from || ( mode === "show" ? zero : original );
+ el.to = o.to || ( mode === "hide" ? zero : original );
+ }
+
+ // Set scaling factor
+ factor = {
+ from: {
+ y: el.from.height / original.height,
+ x: el.from.width / original.width
+ },
+ to: {
+ y: el.to.height / original.height,
+ x: el.to.width / original.width
+ }
+ };
+
+ // Scale the css box
+ if ( scale === "box" || scale === "both" ) {
+
+ // Vertical props scaling
+ if ( factor.from.y !== factor.to.y ) {
+ props = props.concat( vProps );
+ el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from );
+ el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to );
+ }
+
+ // Horizontal props scaling
+ if ( factor.from.x !== factor.to.x ) {
+ props = props.concat( hProps );
+ el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from );
+ el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to );
+ }
+ }
+
+ // Scale the content
+ if ( scale === "content" || scale === "both" ) {
+
+ // Vertical props scaling
+ if ( factor.from.y !== factor.to.y ) {
+ props = props.concat( cProps ).concat( props2 );
+ el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from );
+ el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to );
+ }
+ }
+
+ $.effects.save( el, props );
+ el.show();
+ $.effects.createWrapper( el );
+ el.css( "overflow", "hidden" ).css( el.from );
+
+ // Adjust
+ if (origin) { // Calculate baseline shifts
+ baseline = $.effects.getBaseline( origin, original );
+ el.from.top = ( original.outerHeight - el.outerHeight() ) * baseline.y;
+ el.from.left = ( original.outerWidth - el.outerWidth() ) * baseline.x;
+ el.to.top = ( original.outerHeight - el.to.outerHeight ) * baseline.y;
+ el.to.left = ( original.outerWidth - el.to.outerWidth ) * baseline.x;
+ }
+ el.css( el.from ); // set top & left
+
+ // Animate
+ if ( scale === "content" || scale === "both" ) { // Scale the children
+
+ // Add margins/font-size
+ vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps);
+ hProps = hProps.concat([ "marginLeft", "marginRight" ]);
+ props2 = props0.concat(vProps).concat(hProps);
+
+ el.find( "*[width]" ).each( function(){
+ var child = $( this ),
+ c_original = {
+ height: child.height(),
+ width: child.width(),
+ outerHeight: child.outerHeight(),
+ outerWidth: child.outerWidth()
+ };
+ if (restore) {
+ $.effects.save(child, props2);
+ }
+
+ child.from = {
+ height: c_original.height * factor.from.y,
+ width: c_original.width * factor.from.x,
+ outerHeight: c_original.outerHeight * factor.from.y,
+ outerWidth: c_original.outerWidth * factor.from.x
+ };
+ child.to = {
+ height: c_original.height * factor.to.y,
+ width: c_original.width * factor.to.x,
+ outerHeight: c_original.height * factor.to.y,
+ outerWidth: c_original.width * factor.to.x
+ };
+
+ // Vertical props scaling
+ if ( factor.from.y !== factor.to.y ) {
+ child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from );
+ child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to );
+ }
+
+ // Horizontal props scaling
+ if ( factor.from.x !== factor.to.x ) {
+ child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from );
+ child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to );
+ }
+
+ // Animate children
+ child.css( child.from );
+ child.animate( child.to, o.duration, o.easing, function() {
+
+ // Restore children
+ if ( restore ) {
+ $.effects.restore( child, props2 );
+ }
+ });
+ });
+ }
+
+ // Animate
+ el.animate( el.to, {
+ queue: false,
+ duration: o.duration,
+ easing: o.easing,
+ complete: function() {
+ if ( el.to.opacity === 0 ) {
+ el.css( "opacity", el.from.opacity );
+ }
+ if( mode === "hide" ) {
+ el.hide();
+ }
+ $.effects.restore( el, props );
+ if ( !restore ) {
+
+ // we need to calculate our new positioning based on the scaling
+ if ( position === "static" ) {
+ el.css({
+ position: "relative",
+ top: el.to.top,
+ left: el.to.left
+ });
+ } else {
+ $.each([ "top", "left" ], function( idx, pos ) {
+ el.css( pos, function( _, str ) {
+ var val = parseInt( str, 10 ),
+ toRef = idx ? el.to.left : el.to.top;
+
+ // if original was "auto", recalculate the new value from wrapper
+ if ( str === "auto" ) {
+ return toRef + "px";
+ }
+
+ return val + toRef + "px";
+ });
+ });
+ }
+ }
+
+ $.effects.removeWrapper( el );
+ done();
+ }
+ });
+
+};
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+$.effects.effect.shake = function( o, done ) {
+
+ var el = $( this ),
+ props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
+ mode = $.effects.setMode( el, o.mode || "effect" ),
+ direction = o.direction || "left",
+ distance = o.distance || 20,
+ times = o.times || 3,
+ anims = times * 2 + 1,
+ speed = Math.round(o.duration/anims),
+ ref = (direction === "up" || direction === "down") ? "top" : "left",
+ positiveMotion = (direction === "up" || direction === "left"),
+ animation = {},
+ animation1 = {},
+ animation2 = {},
+ i,
+
+ // we will need to re-assemble the queue to stack our animations in place
+ queue = el.queue(),
+ queuelen = queue.length;
+
+ $.effects.save( el, props );
+ el.show();
+ $.effects.createWrapper( el );
+
+ // Animation
+ animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;
+ animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;
+ animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;
+
+ // Animate
+ el.animate( animation, speed, o.easing );
+
+ // Shakes
+ for ( i = 1; i < times; i++ ) {
+ el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing );
+ }
+ el
+ .animate( animation1, speed, o.easing )
+ .animate( animation, speed / 2, o.easing )
+ .queue(function() {
+ if ( mode === "hide" ) {
+ el.hide();
+ }
+ $.effects.restore( el, props );
+ $.effects.removeWrapper( el );
+ done();
+ });
+
+ // inject all the animations we just queued to be first in line (after "inprogress")
+ if ( queuelen > 1) {
+ queue.splice.apply( queue,
+ [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
+ }
+ el.dequeue();
+
+};
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+$.effects.effect.slide = function( o, done ) {
+
+ // Create element
+ var el = $( this ),
+ props = [ "position", "top", "bottom", "left", "right", "width", "height" ],
+ mode = $.effects.setMode( el, o.mode || "show" ),
+ show = mode === "show",
+ direction = o.direction || "left",
+ ref = (direction === "up" || direction === "down") ? "top" : "left",
+ positiveMotion = (direction === "up" || direction === "left"),
+ distance,
+ animation = {};
+
+ // Adjust
+ $.effects.save( el, props );
+ el.show();
+ distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true );
+
+ $.effects.createWrapper( el ).css({
+ overflow: "hidden"
+ });
+
+ if ( show ) {
+ el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance );
+ }
+
+ // Animation
+ animation[ ref ] = ( show ?
+ ( positiveMotion ? "+=" : "-=") :
+ ( positiveMotion ? "-=" : "+=")) +
+ distance;
+
+ // Animate
+ el.animate( animation, {
+ queue: false,
+ duration: o.duration,
+ easing: o.easing,
+ complete: function() {
+ if ( mode === "hide" ) {
+ el.hide();
+ }
+ $.effects.restore( el, props );
+ $.effects.removeWrapper( el );
+ done();
+ }
+ });
+};
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+$.effects.effect.transfer = function( o, done ) {
+ var elem = $( this ),
+ target = $( o.to ),
+ targetFixed = target.css( "position" ) === "fixed",
+ body = $("body"),
+ fixTop = targetFixed ? body.scrollTop() : 0,
+ fixLeft = targetFixed ? body.scrollLeft() : 0,
+ endPosition = target.offset(),
+ animation = {
+ top: endPosition.top - fixTop ,
+ left: endPosition.left - fixLeft ,
+ height: target.innerHeight(),
+ width: target.innerWidth()
+ },
+ startPosition = elem.offset(),
+ transfer = $( "<div class='ui-effects-transfer'></div>" )
+ .appendTo( document.body )
+ .addClass( o.className )
+ .css({
+ top: startPosition.top - fixTop ,
+ left: startPosition.left - fixLeft ,
+ height: elem.innerHeight(),
+ width: elem.innerWidth(),
+ position: targetFixed ? "fixed" : "absolute"
+ })
+ .animate( animation, o.duration, o.easing, function() {
+ transfer.remove();
+ done();
+ });
+};
+
+})(jQuery);
+
+(function( $, undefined ) {
+
+$.widget( "ui.menu", {
+ version: "1.10.4",
+ defaultElement: "<ul>",
+ delay: 300,
+ options: {
+ icons: {
+ submenu: "ui-icon-carat-1-e"
+ },
+ menus: "ul",
+ position: {
+ my: "left top",
+ at: "right top"
+ },
+ role: "menu",
+
+ // callbacks
+ blur: null,
+ focus: null,
+ select: null
+ },
+
+ _create: function() {
+ this.activeMenu = this.element;
+ // flag used to prevent firing of the click handler
+ // as the event bubbles up through nested menus
+ this.mouseHandled = false;
+ 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
+ })
+ // need to catch all clicks on disabled menu
+ // not possible through _on
+ .bind( "click" + this.eventNamespace, $.proxy(function( event ) {
+ if ( this.options.disabled ) {
+ event.preventDefault();
+ }
+ }, this ));
+
+ if ( this.options.disabled ) {
+ this.element
+ .addClass( "ui-state-disabled" )
+ .attr( "aria-disabled", "true" );
+ }
+
+ this._on({
+ // Prevent focus from sticking to links inside menu after clicking
+ // them (focus should always stay on UL during navigation).
+ "mousedown .ui-menu-item > a": function( event ) {
+ event.preventDefault();
+ },
+ "click .ui-state-disabled > a": function( event ) {
+ event.preventDefault();
+ },
+ "click .ui-menu-item:has(a)": function( event ) {
+ var target = $( event.target ).closest( ".ui-menu-item" );
+ if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
+ this.select( event );
+
+ // Only set the mouseHandled flag if the event will bubble, see #9469.
+ if ( !event.isPropagationStopped() ) {
+ this.mouseHandled = true;
+ }
+
+ // Open submenu on click
+ if ( target.has( ".ui-menu" ).length ) {
+ this.expand( event );
+ } else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) {
+
+ // Redirect focus to the menu
+ this.element.trigger( "focus", [ true ] );
+
+ // If the active item is on the top level, let it stay active.
+ // Otherwise, blur the active item since it is no longer visible.
+ if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
+ clearTimeout( this.timer );
+ }
+ }
+ }
+ },
+ "mouseenter .ui-menu-item": function( event ) {
+ var target = $( event.currentTarget );
+ // Remove ui-state-active class from siblings of the newly focused menu item
+ // to avoid a jump caused by adjacent elements both having a class with a border
+ target.siblings().children( ".ui-state-active" ).removeClass( "ui-state-active" );
+ this.focus( event, target );
+ },
+ mouseleave: "collapseAll",
+ "mouseleave .ui-menu": "collapseAll",
+ focus: function( event, keepActiveItem ) {
+ // If there's already an active item, keep it active
+ // If not, activate the first item
+ var item = this.active || this.element.children( ".ui-menu-item" ).eq( 0 );
+
+ if ( !keepActiveItem ) {
+ this.focus( event, item );
+ }
+ },
+ blur: function( event ) {
+ this._delay(function() {
+ if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {
+ this.collapseAll( event );
+ }
+ });
+ },
+ keydown: "_keydown"
+ });
+
+ this.refresh();
+
+ // Clicks outside of a menu collapse any open menus
+ this._on( this.document, {
+ click: function( event ) {
+ if ( !$( event.target ).closest( ".ui-menu" ).length ) {
+ this.collapseAll( event );
+ }
+
+ // Reset the mouseHandled flag
+ this.mouseHandled = false;
+ }
+ });
+ },
+
+ _destroy: function() {
+ // Destroy (sub)menus
+ this.element
+ .removeAttr( "aria-activedescendant" )
+ .find( ".ui-menu" ).addBack()
+ .removeClass( "ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons" )
+ .removeAttr( "role" )
+ .removeAttr( "tabIndex" )
+ .removeAttr( "aria-labelledby" )
+ .removeAttr( "aria-expanded" )
+ .removeAttr( "aria-hidden" )
+ .removeAttr( "aria-disabled" )
+ .removeUniqueId()
+ .show();
+
+ // Destroy menu items
+ this.element.find( ".ui-menu-item" )
+ .removeClass( "ui-menu-item" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-disabled" )
+ .children( "a" )
+ .removeUniqueId()
+ .removeClass( "ui-corner-all ui-state-hover" )
+ .removeAttr( "tabIndex" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-haspopup" )
+ .children().each( function() {
+ var elem = $( this );
+ if ( elem.data( "ui-menu-submenu-carat" ) ) {
+ elem.remove();
+ }
+ });
+
+ // Destroy menu dividers
+ this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
+ },
+
+ _keydown: function( event ) {
+ var match, prev, character, skip, regex,
+ preventDefault = true;
+
+ function escape( value ) {
+ return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
+ }
+
+ switch ( event.keyCode ) {
+ case $.ui.keyCode.PAGE_UP:
+ this.previousPage( event );
+ break;
+ case $.ui.keyCode.PAGE_DOWN:
+ this.nextPage( event );
+ break;
+ case $.ui.keyCode.HOME:
+ this._move( "first", "first", event );
+ break;
+ case $.ui.keyCode.END:
+ this._move( "last", "last", event );
+ break;
+ case $.ui.keyCode.UP:
+ this.previous( event );
+ break;
+ case $.ui.keyCode.DOWN:
+ this.next( event );
+ break;
+ case $.ui.keyCode.LEFT:
+ this.collapse( event );
+ break;
+ case $.ui.keyCode.RIGHT:
+ if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
+ this.expand( event );
+ }
+ break;
+ case $.ui.keyCode.ENTER:
+ case $.ui.keyCode.SPACE:
+ this._activate( event );
+ break;
+ case $.ui.keyCode.ESCAPE:
+ this.collapse( event );
+ break;
+ default:
+ preventDefault = false;
+ prev = this.previousFilter || "";
+ character = String.fromCharCode( event.keyCode );
+ skip = false;
+
+ clearTimeout( this.filterTimer );
+
+ if ( character === prev ) {
+ skip = true;
+ } else {
+ character = prev + character;
+ }
+
+ regex = new RegExp( "^" + escape( character ), "i" );
+ match = this.activeMenu.children( ".ui-menu-item" ).filter(function() {
+ return regex.test( $( this ).children( "a" ).text() );
+ });
+ match = skip && match.index( this.active.next() ) !== -1 ?
+ this.active.nextAll( ".ui-menu-item" ) :
+ match;
+
+ // If no matches on the current filter, reset to the last character pressed
+ // to move down the menu to the first item that starts with that character
+ if ( !match.length ) {
+ character = String.fromCharCode( event.keyCode );
+ regex = new RegExp( "^" + escape( character ), "i" );
+ match = this.activeMenu.children( ".ui-menu-item" ).filter(function() {
+ return regex.test( $( this ).children( "a" ).text() );
+ });
+ }
+
+ if ( match.length ) {
+ this.focus( event, match );
+ if ( match.length > 1 ) {
+ this.previousFilter = character;
+ this.filterTimer = this._delay(function() {
+ delete this.previousFilter;
+ }, 1000 );
+ } else {
+ delete this.previousFilter;
+ }
+ } else {
+ delete this.previousFilter;
+ }
+ }
+
+ if ( preventDefault ) {
+ event.preventDefault();
+ }
+ },
+
+ _activate: function( event ) {
+ if ( !this.active.is( ".ui-state-disabled" ) ) {
+ if ( this.active.children( "a[aria-haspopup='true']" ).length ) {
+ this.expand( event );
+ } else {
+ this.select( event );
+ }
+ }
+ },
+
+ refresh: function() {
+ var menus,
+ icon = this.options.icons.submenu,
+ submenus = this.element.find( this.options.menus );
+
+ this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
+
+ // Initialize nested menus
+ submenus.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 menu = $( this ),
+ item = menu.prev( "a" ),
+ submenuCarat = $( "<span>" )
+ .addClass( "ui-menu-icon ui-icon " + icon )
+ .data( "ui-menu-submenu-carat", true );
+
+ item
+ .attr( "aria-haspopup", "true" )
+ .prepend( submenuCarat );
+ menu.attr( "aria-labelledby", item.attr( "id" ) );
+ });
+
+ menus = submenus.add( this.element );
+
+ // Don't refresh list items that are already adapted
+ menus.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()
+ });
+
+ // Initialize unlinked menu-items containing spaces and/or dashes only as dividers
+ menus.children( ":not(.ui-menu-item)" ).each(function() {
+ var item = $( this );
+ // hyphen, em dash, en dash
+ if ( !/[^\-\u2014\u2013\s]/.test( item.text() ) ) {
+ item.addClass( "ui-widget-content ui-menu-divider" );
+ }
+ });
+
+ // Add aria-disabled attribute to any disabled menu item
+ menus.children( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
+
+ // If the active item has been removed, blur the menu
+ if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
+ this.blur();
+ }
+ },
+
+ _itemRole: function() {
+ return {
+ menu: "menuitem",
+ listbox: "option"
+ }[ this.options.role ];
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "icons" ) {
+ this.element.find( ".ui-menu-icon" )
+ .removeClass( this.options.icons.submenu )
+ .addClass( value.submenu );
+ }
+ this._super( key, value );
+ },
+
+ focus: function( event, item ) {
+ var nested, focused;
+ this.blur( event, event && event.type === "focus" );
+
+ this._scrollIntoView( item );
+
+ this.active = item.first();
+ focused = this.active.children( "a" ).addClass( "ui-state-focus" );
+ // Only update aria-activedescendant if there's a role
+ // otherwise we assume focus is managed elsewhere
+ if ( this.options.role ) {
+ this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
+ }
+
+ // Highlight active parent menu item, if any
+ this.active
+ .parent()
+ .closest( ".ui-menu-item" )
+ .children( "a:first" )
+ .addClass( "ui-state-active" );
+
+ if ( event && event.type === "keydown" ) {
+ this._close();
+ } else {
+ this.timer = this._delay(function() {
+ this._close();
+ }, this.delay );
+ }
+
+ nested = item.children( ".ui-menu" );
+ if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
+ this._startOpening(nested);
+ }
+ this.activeMenu = item.parent();
+
+ this._trigger( "focus", event, { item: item } );
+ },
+
+ _scrollIntoView: function( item ) {
+ var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
+ if ( this._hasScroll() ) {
+ borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
+ paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
+ offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
+ scroll = this.activeMenu.scrollTop();
+ elementHeight = this.activeMenu.height();
+ itemHeight = item.height();
+
+ if ( offset < 0 ) {
+ this.activeMenu.scrollTop( scroll + offset );
+ } else if ( offset + itemHeight > elementHeight ) {
+ this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
+ }
+ }
+ },
+
+ blur: function( event, fromFocus ) {
+ if ( !fromFocus ) {
+ clearTimeout( this.timer );
+ }
+
+ if ( !this.active ) {
+ return;
+ }
+
+ this.active.children( "a" ).removeClass( "ui-state-focus" );
+ this.active = null;
+
+ this._trigger( "blur", event, { item: this.active } );
+ },
+
+ _startOpening: function( submenu ) {
+ clearTimeout( this.timer );
+
+ // Don't open if already open fixes a Firefox bug that caused a .5 pixel
+ // shift in the submenu position when mousing over the carat icon
+ if ( submenu.attr( "aria-hidden" ) !== "true" ) {
+ return;
+ }
+
+ this.timer = this._delay(function() {
+ this._close();
+ this._open( submenu );
+ }, this.delay );
+ },
+
+ _open: function( submenu ) {
+ var position = $.extend({
+ of: this.active
+ }, this.options.position );
+
+ clearTimeout( this.timer );
+ this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
+ .hide()
+ .attr( "aria-hidden", "true" );
+
+ submenu
+ .show()
+ .removeAttr( "aria-hidden" )
+ .attr( "aria-expanded", "true" )
+ .position( position );
+ },
+
+ collapseAll: function( event, all ) {
+ clearTimeout( this.timer );
+ this.timer = this._delay(function() {
+ // If we were passed an event, look for the submenu that contains the event
+ var currentMenu = all ? this.element :
+ $( event && event.target ).closest( this.element.find( ".ui-menu" ) );
+
+ // If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
+ if ( !currentMenu.length ) {
+ currentMenu = this.element;
+ }
+
+ this._close( currentMenu );
+
+ this.blur( event );
+ this.activeMenu = currentMenu;
+ }, this.delay );
+ },
+
+ // With no arguments, closes the currently active menu - if nothing is active
+ // it closes all menus. If passed an argument, it will search for menus BELOW
+ _close: function( startMenu ) {
+ if ( !startMenu ) {
+ startMenu = this.active ? this.active.parent() : this.element;
+ }
+
+ startMenu
+ .find( ".ui-menu" )
+ .hide()
+ .attr( "aria-hidden", "true" )
+ .attr( "aria-expanded", "false" )
+ .end()
+ .find( "a.ui-state-active" )
+ .removeClass( "ui-state-active" );
+ },
+
+ collapse: function( event ) {
+ var newItem = this.active &&
+ this.active.parent().closest( ".ui-menu-item", this.element );
+ if ( newItem && newItem.length ) {
+ this._close();
+ this.focus( event, newItem );
+ }
+ },
+
+ expand: function( event ) {
+ var newItem = this.active &&
+ this.active
+ .children( ".ui-menu " )
+ .children( ".ui-menu-item" )
+ .first();
+
+ if ( newItem && newItem.length ) {
+ this._open( newItem.parent() );
+
+ // Delay so Firefox will not hide activedescendant change in expanding submenu from AT
+ this._delay(function() {
+ this.focus( event, newItem );
+ });
+ }
+ },
+
+ next: function( event ) {
+ this._move( "next", "first", event );
+ },
+
+ previous: function( event ) {
+ this._move( "prev", "last", event );
+ },
+
+ 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( direction, filter, event ) {
+ var next;
+ if ( this.active ) {
+ if ( direction === "first" || direction === "last" ) {
+ next = this.active
+ [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
+ .eq( -1 );
+ } else {
+ next = this.active
+ [ direction + "All" ]( ".ui-menu-item" )
+ .eq( 0 );
+ }
+ }
+ if ( !next || !next.length || !this.active ) {
+ next = this.activeMenu.children( ".ui-menu-item" )[ filter ]();
+ }
+
+ this.focus( event, next );
+ },
+
+ nextPage: function( event ) {
+ var item, base, height;
+
+ if ( !this.active ) {
+ this.next( event );
+ return;
+ }
+ if ( this.isLastItem() ) {
+ return;
+ }
+ if ( this._hasScroll() ) {
+ base = this.active.offset().top;
+ height = this.element.height();
+ this.active.nextAll( ".ui-menu-item" ).each(function() {
+ item = $( this );
+ return item.offset().top - base - height < 0;
+ });
+
+ this.focus( event, item );
+ } else {
+ this.focus( event, this.activeMenu.children( ".ui-menu-item" )
+ [ !this.active ? "first" : "last" ]() );
+ }
+ },
+
+ previousPage: function( event ) {
+ var item, base, height;
+ if ( !this.active ) {
+ this.next( event );
+ return;
+ }
+ if ( this.isFirstItem() ) {
+ return;
+ }
+ if ( this._hasScroll() ) {
+ base = this.active.offset().top;
+ height = this.element.height();
+ this.active.prevAll( ".ui-menu-item" ).each(function() {
+ item = $( this );
+ return item.offset().top - base + height > 0;
+ });
+
+ this.focus( event, item );
+ } else {
+ this.focus( event, this.activeMenu.children( ".ui-menu-item" ).first() );
+ }
+ },
+
+ _hasScroll: function() {
+ return this.element.outerHeight() < this.element.prop( "scrollHeight" );
+ },
+
+ select: function( event ) {
+ // TODO: It should never be possible to not have an active item at this
+ // point, but the tests don't trigger mouseenter before click.
+ this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
+ var ui = { item: this.active };
+ if ( !this.active.has( ".ui-menu" ).length ) {
+ this.collapseAll( event, true );
+ }
+ this._trigger( "select", event, ui );
+ }
+});
+
+}( jQuery ));
+
+(function( $, undefined ) {
+
+$.ui = $.ui || {};
+
+var cachedScrollbarWidth,
+ max = Math.max,
+ abs = Math.abs,
+ round = Math.round,
+ rhorizontal = /left|center|right/,
+ rvertical = /top|center|bottom/,
+ roffset = /[\+\-]\d+(\.[\d]+)?%?/,
+ rposition = /^\w+/,
+ rpercent = /%$/,
+ _position = $.fn.position;
+
+function getOffsets( offsets, width, height ) {
+ return [
+ parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
+ parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
+ ];
+}
+
+function parseCss( element, property ) {
+ return parseInt( $.css( element, property ), 10 ) || 0;
+}
+
+function getDimensions( elem ) {
+ var raw = elem[0];
+ if ( raw.nodeType === 9 ) {
+ return {
+ width: elem.width(),
+ height: elem.height(),
+ offset: { top: 0, left: 0 }
+ };
+ }
+ if ( $.isWindow( raw ) ) {
+ return {
+ width: elem.width(),
+ height: elem.height(),
+ offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
+ };
+ }
+ if ( raw.preventDefault ) {
+ return {
+ width: 0,
+ height: 0,
+ offset: { top: raw.pageY, left: raw.pageX }
+ };
+ }
+ return {
+ width: elem.outerWidth(),
+ height: elem.outerHeight(),
+ offset: elem.offset()
+ };
+}
+
+$.position = {
+ scrollbarWidth: function() {
+ if ( cachedScrollbarWidth !== undefined ) {
+ return cachedScrollbarWidth;
+ }
+ var w1, w2,
+ div = $( "<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
+ innerDiv = div.children()[0];
+
+ $( "body" ).append( div );
+ w1 = innerDiv.offsetWidth;
+ div.css( "overflow", "scroll" );
+
+ w2 = innerDiv.offsetWidth;
+
+ if ( w1 === w2 ) {
+ w2 = div[0].clientWidth;
+ }
+
+ div.remove();
+
+ return (cachedScrollbarWidth = w1 - w2);
+ },
+ getScrollInfo: function( within ) {
+ var overflowX = within.isWindow || within.isDocument ? "" :
+ within.element.css( "overflow-x" ),
+ overflowY = within.isWindow || within.isDocument ? "" :
+ within.element.css( "overflow-y" ),
+ hasOverflowX = overflowX === "scroll" ||
+ ( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
+ hasOverflowY = overflowY === "scroll" ||
+ ( overflowY === "auto" && within.height < within.element[0].scrollHeight );
+ return {
+ width: hasOverflowY ? $.position.scrollbarWidth() : 0,
+ height: hasOverflowX ? $.position.scrollbarWidth() : 0
+ };
+ },
+ getWithinInfo: function( element ) {
+ var withinElement = $( element || window ),
+ isWindow = $.isWindow( withinElement[0] ),
+ isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9;
+ return {
+ element: withinElement,
+ isWindow: isWindow,
+ isDocument: isDocument,
+ offset: withinElement.offset() || { left: 0, top: 0 },
+ scrollLeft: withinElement.scrollLeft(),
+ scrollTop: withinElement.scrollTop(),
+ width: isWindow ? withinElement.width() : withinElement.outerWidth(),
+ height: isWindow ? withinElement.height() : withinElement.outerHeight()
+ };
+ }
+};
+
+$.fn.position = function( options ) {
+ if ( !options || !options.of ) {
+ return _position.apply( this, arguments );
+ }
+
+ // make a copy, we don't want to modify arguments
+ options = $.extend( {}, options );
+
+ var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
+ target = $( options.of ),
+ within = $.position.getWithinInfo( options.within ),
+ scrollInfo = $.position.getScrollInfo( within ),
+ collision = ( options.collision || "flip" ).split( " " ),
+ offsets = {};
+
+ dimensions = getDimensions( target );
+ if ( target[0].preventDefault ) {
+ // force left top to allow flipping
+ options.at = "left top";
+ }
+ targetWidth = dimensions.width;
+ targetHeight = dimensions.height;
+ targetOffset = dimensions.offset;
+ // clone to reuse original targetOffset later
+ basePosition = $.extend( {}, targetOffset );
+
+ // force my and at to have valid horizontal and vertical positions
+ // if a value is missing or invalid, it will be converted to center
+ $.each( [ "my", "at" ], function() {
+ var pos = ( options[ this ] || "" ).split( " " ),
+ horizontalOffset,
+ verticalOffset;
+
+ if ( pos.length === 1) {
+ pos = rhorizontal.test( pos[ 0 ] ) ?
+ pos.concat( [ "center" ] ) :
+ rvertical.test( pos[ 0 ] ) ?
+ [ "center" ].concat( pos ) :
+ [ "center", "center" ];
+ }
+ pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
+ pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
+
+ // calculate offsets
+ horizontalOffset = roffset.exec( pos[ 0 ] );
+ verticalOffset = roffset.exec( pos[ 1 ] );
+ offsets[ this ] = [
+ horizontalOffset ? horizontalOffset[ 0 ] : 0,
+ verticalOffset ? verticalOffset[ 0 ] : 0
+ ];
+
+ // reduce to just the positions without the offsets
+ options[ this ] = [
+ rposition.exec( pos[ 0 ] )[ 0 ],
+ rposition.exec( pos[ 1 ] )[ 0 ]
+ ];
+ });
+
+ // normalize collision option
+ if ( collision.length === 1 ) {
+ collision[ 1 ] = collision[ 0 ];
+ }
+
+ if ( options.at[ 0 ] === "right" ) {
+ basePosition.left += targetWidth;
+ } else if ( options.at[ 0 ] === "center" ) {
+ basePosition.left += targetWidth / 2;
+ }
+
+ if ( options.at[ 1 ] === "bottom" ) {
+ basePosition.top += targetHeight;
+ } else if ( options.at[ 1 ] === "center" ) {
+ basePosition.top += targetHeight / 2;
+ }
+
+ atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
+ basePosition.left += atOffset[ 0 ];
+ basePosition.top += atOffset[ 1 ];
+
+ return this.each(function() {
+ var collisionPosition, using,
+ elem = $( this ),
+ elemWidth = elem.outerWidth(),
+ elemHeight = elem.outerHeight(),
+ marginLeft = parseCss( this, "marginLeft" ),
+ marginTop = parseCss( this, "marginTop" ),
+ collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
+ collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
+ position = $.extend( {}, basePosition ),
+ myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
+
+ if ( options.my[ 0 ] === "right" ) {
+ position.left -= elemWidth;
+ } else if ( options.my[ 0 ] === "center" ) {
+ position.left -= elemWidth / 2;
+ }
+
+ if ( options.my[ 1 ] === "bottom" ) {
+ position.top -= elemHeight;
+ } else if ( options.my[ 1 ] === "center" ) {
+ position.top -= elemHeight / 2;
+ }
+
+ position.left += myOffset[ 0 ];
+ position.top += myOffset[ 1 ];
+
+ // if the browser doesn't support fractions, then round for consistent results
+ if ( !$.support.offsetFractions ) {
+ position.left = round( position.left );
+ position.top = round( position.top );
+ }
+
+ collisionPosition = {
+ marginLeft: marginLeft,
+ marginTop: marginTop
+ };
+
+ $.each( [ "left", "top" ], function( i, dir ) {
+ if ( $.ui.position[ collision[ i ] ] ) {
+ $.ui.position[ collision[ i ] ][ dir ]( position, {
+ targetWidth: targetWidth,
+ targetHeight: targetHeight,
+ elemWidth: elemWidth,
+ elemHeight: elemHeight,
+ collisionPosition: collisionPosition,
+ collisionWidth: collisionWidth,
+ collisionHeight: collisionHeight,
+ offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
+ my: options.my,
+ at: options.at,
+ within: within,
+ elem : elem
+ });
+ }
+ });
+
+ if ( options.using ) {
+ // adds feedback as second argument to using callback, if present
+ using = function( props ) {
+ var left = targetOffset.left - position.left,
+ right = left + targetWidth - elemWidth,
+ top = targetOffset.top - position.top,
+ bottom = top + targetHeight - elemHeight,
+ feedback = {
+ target: {
+ element: target,
+ left: targetOffset.left,
+ top: targetOffset.top,
+ width: targetWidth,
+ height: targetHeight
+ },
+ element: {
+ element: elem,
+ left: position.left,
+ top: position.top,
+ width: elemWidth,
+ height: elemHeight
+ },
+ horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
+ vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
+ };
+ if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
+ feedback.horizontal = "center";
+ }
+ if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
+ feedback.vertical = "middle";
+ }
+ if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
+ feedback.important = "horizontal";
+ } else {
+ feedback.important = "vertical";
+ }
+ options.using.call( this, props, feedback );
+ };
+ }
+
+ elem.offset( $.extend( position, { using: using } ) );
+ });
+};
+
+$.ui.position = {
+ fit: {
+ left: function( position, data ) {
+ var within = data.within,
+ withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
+ outerWidth = within.width,
+ collisionPosLeft = position.left - data.collisionPosition.marginLeft,
+ overLeft = withinOffset - collisionPosLeft,
+ overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
+ newOverRight;
+
+ // element is wider than within
+ if ( data.collisionWidth > outerWidth ) {
+ // element is initially over the left side of within
+ if ( overLeft > 0 && overRight <= 0 ) {
+ newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
+ position.left += overLeft - newOverRight;
+ // element is initially over right side of within
+ } else if ( overRight > 0 && overLeft <= 0 ) {
+ position.left = withinOffset;
+ // element is initially over both left and right sides of within
+ } else {
+ if ( overLeft > overRight ) {
+ position.left = withinOffset + outerWidth - data.collisionWidth;
+ } else {
+ position.left = withinOffset;
+ }
+ }
+ // too far left -> align with left edge
+ } else if ( overLeft > 0 ) {
+ position.left += overLeft;
+ // too far right -> align with right edge
+ } else if ( overRight > 0 ) {
+ position.left -= overRight;
+ // adjust based on position and margin
+ } else {
+ position.left = max( position.left - collisionPosLeft, position.left );
+ }
+ },
+ top: function( position, data ) {
+ var within = data.within,
+ withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
+ outerHeight = data.within.height,
+ collisionPosTop = position.top - data.collisionPosition.marginTop,
+ overTop = withinOffset - collisionPosTop,
+ overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
+ newOverBottom;
+
+ // element is taller than within
+ if ( data.collisionHeight > outerHeight ) {
+ // element is initially over the top of within
+ if ( overTop > 0 && overBottom <= 0 ) {
+ newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
+ position.top += overTop - newOverBottom;
+ // element is initially over bottom of within
+ } else if ( overBottom > 0 && overTop <= 0 ) {
+ position.top = withinOffset;
+ // element is initially over both top and bottom of within
+ } else {
+ if ( overTop > overBottom ) {
+ position.top = withinOffset + outerHeight - data.collisionHeight;
+ } else {
+ position.top = withinOffset;
+ }
+ }
+ // too far up -> align with top
+ } else if ( overTop > 0 ) {
+ position.top += overTop;
+ // too far down -> align with bottom edge
+ } else if ( overBottom > 0 ) {
+ position.top -= overBottom;
+ // adjust based on position and margin
+ } else {
+ position.top = max( position.top - collisionPosTop, position.top );
+ }
+ }
+ },
+ flip: {
+ left: function( position, data ) {
+ var within = data.within,
+ withinOffset = within.offset.left + within.scrollLeft,
+ outerWidth = within.width,
+ offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
+ collisionPosLeft = position.left - data.collisionPosition.marginLeft,
+ overLeft = collisionPosLeft - offsetLeft,
+ overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
+ myOffset = data.my[ 0 ] === "left" ?
+ -data.elemWidth :
+ data.my[ 0 ] === "right" ?
+ data.elemWidth :
+ 0,
+ atOffset = data.at[ 0 ] === "left" ?
+ data.targetWidth :
+ data.at[ 0 ] === "right" ?
+ -data.targetWidth :
+ 0,
+ offset = -2 * data.offset[ 0 ],
+ newOverRight,
+ newOverLeft;
+
+ if ( overLeft < 0 ) {
+ newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
+ if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
+ position.left += myOffset + atOffset + offset;
+ }
+ }
+ else if ( overRight > 0 ) {
+ newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
+ if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
+ position.left += myOffset + atOffset + offset;
+ }
+ }
+ },
+ top: function( position, data ) {
+ var within = data.within,
+ withinOffset = within.offset.top + within.scrollTop,
+ outerHeight = within.height,
+ offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
+ collisionPosTop = position.top - data.collisionPosition.marginTop,
+ overTop = collisionPosTop - offsetTop,
+ overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
+ top = data.my[ 1 ] === "top",
+ myOffset = top ?
+ -data.elemHeight :
+ data.my[ 1 ] === "bottom" ?
+ data.elemHeight :
+ 0,
+ atOffset = data.at[ 1 ] === "top" ?
+ data.targetHeight :
+ data.at[ 1 ] === "bottom" ?
+ -data.targetHeight :
+ 0,
+ offset = -2 * data.offset[ 1 ],
+ newOverTop,
+ newOverBottom;
+ if ( overTop < 0 ) {
+ newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
+ if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) {
+ position.top += myOffset + atOffset + offset;
+ }
+ }
+ else if ( overBottom > 0 ) {
+ newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
+ if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) {
+ position.top += myOffset + atOffset + offset;
+ }
+ }
+ }
+ },
+ flipfit: {
+ left: function() {
+ $.ui.position.flip.left.apply( this, arguments );
+ $.ui.position.fit.left.apply( this, arguments );
+ },
+ top: function() {
+ $.ui.position.flip.top.apply( this, arguments );
+ $.ui.position.fit.top.apply( this, arguments );
+ }
+ }
+};
+
+// fraction support test
+(function () {
+ var testElement, testElementParent, testElementStyle, offsetLeft, i,
+ body = document.getElementsByTagName( "body" )[ 0 ],
+ div = document.createElement( "div" );
+
+ //Create a "fake body" for testing based on method used in jQuery.support
+ testElement = document.createElement( body ? "div" : "body" );
+ testElementStyle = {
+ visibility: "hidden",
+ width: 0,
+ height: 0,
+ border: 0,
+ margin: 0,
+ background: "none"
+ };
+ if ( body ) {
+ $.extend( testElementStyle, {
+ position: "absolute",
+ left: "-1000px",
+ top: "-1000px"
+ });
+ }
+ for ( i in testElementStyle ) {
+ testElement.style[ i ] = testElementStyle[ i ];
+ }
+ testElement.appendChild( div );
+ testElementParent = body || document.documentElement;
+ testElementParent.insertBefore( testElement, testElementParent.firstChild );
+
+ div.style.cssText = "position: absolute; left: 10.7432222px;";
+
+ offsetLeft = $( div ).offset().left;
+ $.support.offsetFractions = offsetLeft > 10 && offsetLeft < 11;
+
+ testElement.innerHTML = "";
+ testElementParent.removeChild( testElement );
+})();
+
+}( jQuery ) );
+
+(function( $, undefined ) {
+
+$.widget( "ui.progressbar", {
+ version: "1.10.4",
+ options: {
+ max: 100,
+ value: 0,
+
+ change: null,
+ complete: null
+ },
+
+ min: 0,
+
+ _create: function() {
+ // Constrain initial value
+ this.oldValue = this.options.value = this._constrainedValue();
+
+ this.element
+ .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
+ .attr({
+ // Only set static values, aria-valuenow and aria-valuemax are
+ // set inside _refreshValue()
+ role: "progressbar",
+ "aria-valuemin": this.min
+ });
+
+ this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
+ .appendTo( this.element );
+
+ this._refreshValue();
+ },
+
+ _destroy: function() {
+ this.element
+ .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-valuemin" )
+ .removeAttr( "aria-valuemax" )
+ .removeAttr( "aria-valuenow" );
+
+ this.valueDiv.remove();
+ },
+
+ value: function( newValue ) {
+ if ( newValue === undefined ) {
+ return this.options.value;
+ }
+
+ this.options.value = this._constrainedValue( newValue );
+ this._refreshValue();
+ },
+
+ _constrainedValue: function( newValue ) {
+ if ( newValue === undefined ) {
+ newValue = this.options.value;
+ }
+
+ this.indeterminate = newValue === false;
+
+ // sanitize value
+ if ( typeof newValue !== "number" ) {
+ newValue = 0;
+ }
+
+ return this.indeterminate ? false :
+ Math.min( this.options.max, Math.max( this.min, newValue ) );
+ },
+
+ _setOptions: function( options ) {
+ // Ensure "value" option is set after other values (like max)
+ var value = options.value;
+ delete options.value;
+
+ this._super( options );
+
+ this.options.value = this._constrainedValue( value );
+ this._refreshValue();
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "max" ) {
+ // Don't allow a max less than min
+ value = Math.max( this.min, value );
+ }
+
+ this._super( key, value );
+ },
+
+ _percentage: function() {
+ return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
+ },
+
+ _refreshValue: function() {
+ var value = this.options.value,
+ percentage = this._percentage();
+
+ this.valueDiv
+ .toggle( this.indeterminate || value > this.min )
+ .toggleClass( "ui-corner-right", value === this.options.max )
+ .width( percentage.toFixed(0) + "%" );
+
+ this.element.toggleClass( "ui-progressbar-indeterminate", this.indeterminate );
+
+ if ( this.indeterminate ) {
+ this.element.removeAttr( "aria-valuenow" );
+ if ( !this.overlayDiv ) {
+ this.overlayDiv = $( "<div class='ui-progressbar-overlay'></div>" ).appendTo( this.valueDiv );
+ }
+ } else {
+ this.element.attr({
+ "aria-valuemax": this.options.max,
+ "aria-valuenow": value
+ });
+ if ( this.overlayDiv ) {
+ this.overlayDiv.remove();
+ this.overlayDiv = null;
+ }
+ }
+
+ if ( this.oldValue !== value ) {
+ this.oldValue = value;
+ this._trigger( "change" );
+ }
+ if ( value === this.options.max ) {
+ this._trigger( "complete" );
+ }
+ }
+});
+
+})( jQuery );
+
+(function( $, undefined ) {
+
+// number of pages in a slider
+// (how many times can you page up/down to go through the whole range)
+var numPages = 5;
+
+$.widget( "ui.slider", $.ui.mouse, {
+ version: "1.10.4",
+ widgetEventPrefix: "slide",
+
+ options: {
+ animate: false,
+ distance: 0,
+ max: 100,
+ min: 0,
+ orientation: "horizontal",
+ range: false,
+ step: 1,
+ value: 0,
+ values: null,
+
+ // callbacks
+ change: null,
+ slide: null,
+ start: null,
+ stop: null
+ },
+
+ _create: function() {
+ this._keySliding = false;
+ this._mouseSliding = false;
+ this._animateOff = true;
+ this._handleIndex = null;
+ this._detectOrientation();
+ this._mouseInit();
+
+ this.element
+ .addClass( "ui-slider" +
+ " ui-slider-" + this.orientation +
+ " ui-widget" +
+ " ui-widget-content" +
+ " ui-corner-all");
+
+ this._refresh();
+ this._setOption( "disabled", this.options.disabled );
+
+ this._animateOff = false;
+ },
+
+ _refresh: function() {
+ this._createRange();
+ this._createHandles();
+ this._setupEvents();
+ this._refreshValue();
+ },
+
+ _createHandles: function() {
+ var i, handleCount,
+ options = this.options,
+ existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
+ handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",
+ handles = [];
+
+ handleCount = ( options.values && options.values.length ) || 1;
+
+ if ( existingHandles.length > handleCount ) {
+ existingHandles.slice( handleCount ).remove();
+ existingHandles = existingHandles.slice( 0, handleCount );
+ }
+
+ for ( i = existingHandles.length; i < handleCount; i++ ) {
+ handles.push( handle );
+ }
+
+ this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) );
+
+ this.handle = this.handles.eq( 0 );
+
+ this.handles.each(function( i ) {
+ $( this ).data( "ui-slider-handle-index", i );
+ });
+ },
+
+ _createRange: function() {
+ var options = this.options,
+ classes = "";
+
+ if ( options.range ) {
+ if ( options.range === true ) {
+ if ( !options.values ) {
+ options.values = [ this._valueMin(), this._valueMin() ];
+ } else if ( options.values.length && options.values.length !== 2 ) {
+ options.values = [ options.values[0], options.values[0] ];
+ } else if ( $.isArray( options.values ) ) {
+ options.values = options.values.slice(0);
+ }
+ }
+
+ if ( !this.range || !this.range.length ) {
+ this.range = $( "<div></div>" )
+ .appendTo( this.element );
+
+ classes = "ui-slider-range" +
+ // note: this isn't the most fittingly semantic framework class for this element,
+ // but worked best visually with a variety of themes
+ " ui-widget-header ui-corner-all";
+ } else {
+ this.range.removeClass( "ui-slider-range-min ui-slider-range-max" )
+ // Handle range switching from true to min/max
+ .css({
+ "left": "",
+ "bottom": ""
+ });
+ }
+
+ this.range.addClass( classes +
+ ( ( options.range === "min" || options.range === "max" ) ? " ui-slider-range-" + options.range : "" ) );
+ } else {
+ if ( this.range ) {
+ this.range.remove();
+ }
+ this.range = null;
+ }
+ },
+
+ _setupEvents: function() {
+ var elements = this.handles.add( this.range ).filter( "a" );
+ this._off( elements );
+ this._on( elements, this._handleEvents );
+ this._hoverable( elements );
+ this._focusable( elements );
+ },
+
+ _destroy: function() {
+ this.handles.remove();
+ if ( this.range ) {
+ this.range.remove();
+ }
+
+ this.element
+ .removeClass( "ui-slider" +
+ " ui-slider-horizontal" +
+ " ui-slider-vertical" +
+ " ui-widget" +
+ " ui-widget-content" +
+ " ui-corner-all" );
+
+ this._mouseDestroy();
+ },
+
+ _mouseCapture: function( event ) {
+ var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
+ that = this,
+ o = this.options;
+
+ if ( o.disabled ) {
+ return false;
+ }
+
+ this.elementSize = {
+ width: this.element.outerWidth(),
+ height: this.element.outerHeight()
+ };
+ this.elementOffset = this.element.offset();
+
+ position = { x: event.pageX, y: event.pageY };
+ normValue = this._normValueFromMouse( position );
+ distance = this._valueMax() - this._valueMin() + 1;
+ this.handles.each(function( i ) {
+ var thisDistance = Math.abs( normValue - that.values(i) );
+ if (( distance > thisDistance ) ||
+ ( distance === thisDistance &&
+ (i === that._lastChangedValue || that.values(i) === o.min ))) {
+ distance = thisDistance;
+ closestHandle = $( this );
+ index = i;
+ }
+ });
+
+ allowed = this._start( event, index );
+ if ( allowed === false ) {
+ return false;
+ }
+ this._mouseSliding = true;
+
+ this._handleIndex = index;
+
+ closestHandle
+ .addClass( "ui-state-active" )
+ .focus();
+
+ offset = closestHandle.offset();
+ mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
+ this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
+ left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
+ top: event.pageY - offset.top -
+ ( closestHandle.height() / 2 ) -
+ ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) -
+ ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) +
+ ( parseInt( closestHandle.css("marginTop"), 10 ) || 0)
+ };
+
+ if ( !this.handles.hasClass( "ui-state-hover" ) ) {
+ this._slide( event, index, normValue );
+ }
+ this._animateOff = true;
+ return true;
+ },
+
+ _mouseStart: function() {
+ return true;
+ },
+
+ _mouseDrag: function( event ) {
+ var position = { x: event.pageX, y: event.pageY },
+ normValue = this._normValueFromMouse( position );
+
+ this._slide( event, this._handleIndex, normValue );
+
+ return false;
+ },
+
+ _mouseStop: function( event ) {
+ this.handles.removeClass( "ui-state-active" );
+ this._mouseSliding = false;
+
+ this._stop( event, this._handleIndex );
+ this._change( event, this._handleIndex );
+
+ this._handleIndex = null;
+ this._clickOffset = null;
+ this._animateOff = false;
+
+ return false;
+ },
+
+ _detectOrientation: function() {
+ this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
+ },
+
+ _normValueFromMouse: function( position ) {
+ var pixelTotal,
+ pixelMouse,
+ percentMouse,
+ valueTotal,
+ valueMouse;
+
+ if ( this.orientation === "horizontal" ) {
+ pixelTotal = this.elementSize.width;
+ pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
+ } else {
+ pixelTotal = this.elementSize.height;
+ pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
+ }
+
+ percentMouse = ( pixelMouse / pixelTotal );
+ if ( percentMouse > 1 ) {
+ percentMouse = 1;
+ }
+ if ( percentMouse < 0 ) {
+ percentMouse = 0;
+ }
+ if ( this.orientation === "vertical" ) {
+ percentMouse = 1 - percentMouse;
+ }
+
+ valueTotal = this._valueMax() - this._valueMin();
+ valueMouse = this._valueMin() + percentMouse * valueTotal;
+
+ return this._trimAlignValue( valueMouse );
+ },
+
+ _start: function( event, index ) {
+ var uiHash = {
+ handle: this.handles[ index ],
+ value: this.value()
+ };
+ if ( this.options.values && this.options.values.length ) {
+ uiHash.value = this.values( index );
+ uiHash.values = this.values();
+ }
+ return this._trigger( "start", event, uiHash );
+ },
+
+ _slide: function( event, index, newVal ) {
+ var otherVal,
+ newValues,
+ allowed;
+
+ if ( this.options.values && this.options.values.length ) {
+ otherVal = this.values( index ? 0 : 1 );
+
+ if ( ( this.options.values.length === 2 && this.options.range === true ) &&
+ ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
+ ) {
+ newVal = otherVal;
+ }
+
+ if ( newVal !== this.values( index ) ) {
+ newValues = this.values();
+ newValues[ index ] = newVal;
+ // A slide can be canceled by returning false from the slide callback
+ allowed = this._trigger( "slide", event, {
+ handle: this.handles[ index ],
+ value: newVal,
+ values: newValues
+ } );
+ otherVal = this.values( index ? 0 : 1 );
+ if ( allowed !== false ) {
+ this.values( index, newVal );
+ }
+ }
+ } else {
+ if ( newVal !== this.value() ) {
+ // A slide can be canceled by returning false from the slide callback
+ allowed = this._trigger( "slide", event, {
+ handle: this.handles[ index ],
+ value: newVal
+ } );
+ if ( allowed !== false ) {
+ this.value( newVal );
+ }
+ }
+ }
+ },
+
+ _stop: function( event, index ) {
+ var uiHash = {
+ handle: this.handles[ index ],
+ value: this.value()
+ };
+ if ( this.options.values && this.options.values.length ) {
+ uiHash.value = this.values( index );
+ uiHash.values = this.values();
+ }
+
+ this._trigger( "stop", event, uiHash );
+ },
+
+ _change: function( event, index ) {
+ if ( !this._keySliding && !this._mouseSliding ) {
+ var uiHash = {
+ handle: this.handles[ index ],
+ value: this.value()
+ };
+ if ( this.options.values && this.options.values.length ) {
+ uiHash.value = this.values( index );
+ uiHash.values = this.values();
+ }
+
+ //store the last changed value index for reference when handles overlap
+ this._lastChangedValue = index;
+
+ this._trigger( "change", event, uiHash );
+ }
+ },
+
+ value: function( newValue ) {
+ if ( arguments.length ) {
+ this.options.value = this._trimAlignValue( newValue );
+ this._refreshValue();
+ this._change( null, 0 );
+ return;
+ }
+
+ return this._value();
+ },
+
+ values: function( index, newValue ) {
+ var vals,
+ newValues,
+ i;
+
+ if ( arguments.length > 1 ) {
+ this.options.values[ index ] = this._trimAlignValue( newValue );
+ this._refreshValue();
+ this._change( null, index );
+ return;
+ }
+
+ if ( arguments.length ) {
+ if ( $.isArray( arguments[ 0 ] ) ) {
+ vals = this.options.values;
+ newValues = arguments[ 0 ];
+ for ( i = 0; i < vals.length; i += 1 ) {
+ vals[ i ] = this._trimAlignValue( newValues[ i ] );
+ this._change( null, i );
+ }
+ this._refreshValue();
+ } else {
+ if ( this.options.values && this.options.values.length ) {
+ return this._values( index );
+ } else {
+ return this.value();
+ }
+ }
+ } else {
+ return this._values();
+ }
+ },
+
+ _setOption: function( key, value ) {
+ var i,
+ valsLength = 0;
+
+ if ( key === "range" && this.options.range === true ) {
+ if ( value === "min" ) {
+ this.options.value = this._values( 0 );
+ this.options.values = null;
+ } else if ( value === "max" ) {
+ this.options.value = this._values( this.options.values.length-1 );
+ this.options.values = null;
+ }
+ }
+
+ if ( $.isArray( this.options.values ) ) {
+ valsLength = this.options.values.length;
+ }
+
+ $.Widget.prototype._setOption.apply( this, arguments );
+
+ switch ( key ) {
+ case "orientation":
+ this._detectOrientation();
+ this.element
+ .removeClass( "ui-slider-horizontal ui-slider-vertical" )
+ .addClass( "ui-slider-" + this.orientation );
+ this._refreshValue();
+ break;
+ case "value":
+ this._animateOff = true;
+ this._refreshValue();
+ this._change( null, 0 );
+ this._animateOff = false;
+ break;
+ case "values":
+ this._animateOff = true;
+ this._refreshValue();
+ for ( i = 0; i < valsLength; i += 1 ) {
+ this._change( null, i );
+ }
+ this._animateOff = false;
+ break;
+ case "min":
+ case "max":
+ this._animateOff = true;
+ this._refreshValue();
+ this._animateOff = false;
+ break;
+ case "range":
+ this._animateOff = true;
+ this._refresh();
+ this._animateOff = false;
+ break;
+ }
+ },
+
+ //internal value getter
+ // _value() returns value trimmed by min and max, aligned by step
+ _value: function() {
+ var val = this.options.value;
+ val = this._trimAlignValue( val );
+
+ return val;
+ },
+
+ //internal values getter
+ // _values() returns array of values trimmed by min and max, aligned by step
+ // _values( index ) returns single value trimmed by min and max, aligned by step
+ _values: function( index ) {
+ var val,
+ vals,
+ i;
+
+ if ( arguments.length ) {
+ val = this.options.values[ index ];
+ val = this._trimAlignValue( val );
+
+ return val;
+ } else if ( this.options.values && this.options.values.length ) {
+ // .slice() creates a copy of the array
+ // this copy gets trimmed by min and max and then returned
+ vals = this.options.values.slice();
+ for ( i = 0; i < vals.length; i+= 1) {
+ vals[ i ] = this._trimAlignValue( vals[ i ] );
+ }
+
+ return vals;
+ } else {
+ return [];
+ }
+ },
+
+ // returns the step-aligned value that val is closest to, between (inclusive) min and max
+ _trimAlignValue: function( val ) {
+ if ( val <= this._valueMin() ) {
+ return this._valueMin();
+ }
+ if ( val >= this._valueMax() ) {
+ return this._valueMax();
+ }
+ var step = ( this.options.step > 0 ) ? this.options.step : 1,
+ valModStep = (val - this._valueMin()) % step,
+ alignValue = val - valModStep;
+
+ if ( Math.abs(valModStep) * 2 >= step ) {
+ alignValue += ( valModStep > 0 ) ? step : ( -step );
+ }
+
+ // Since JavaScript has problems with large floats, round
+ // the final value to 5 digits after the decimal point (see #4124)
+ return parseFloat( alignValue.toFixed(5) );
+ },
+
+ _valueMin: function() {
+ return this.options.min;
+ },
+
+ _valueMax: function() {
+ return this.options.max;
+ },
+
+ _refreshValue: function() {
+ var lastValPercent, valPercent, value, valueMin, valueMax,
+ oRange = this.options.range,
+ o = this.options,
+ that = this,
+ animate = ( !this._animateOff ) ? o.animate : false,
+ _set = {};
+
+ if ( this.options.values && this.options.values.length ) {
+ this.handles.each(function( i ) {
+ valPercent = ( that.values(i) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100;
+ _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
+ $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
+ if ( that.options.range === true ) {
+ if ( that.orientation === "horizontal" ) {
+ if ( i === 0 ) {
+ that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
+ }
+ if ( i === 1 ) {
+ that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
+ }
+ } else {
+ if ( i === 0 ) {
+ that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
+ }
+ if ( i === 1 ) {
+ that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
+ }
+ }
+ }
+ lastValPercent = valPercent;
+ });
+ } else {
+ value = this.value();
+ valueMin = this._valueMin();
+ valueMax = this._valueMax();
+ valPercent = ( valueMax !== valueMin ) ?
+ ( value - valueMin ) / ( valueMax - valueMin ) * 100 :
+ 0;
+ _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
+ this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
+
+ if ( oRange === "min" && this.orientation === "horizontal" ) {
+ this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );
+ }
+ if ( oRange === "max" && this.orientation === "horizontal" ) {
+ this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
+ }
+ if ( oRange === "min" && this.orientation === "vertical" ) {
+ this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );
+ }
+ if ( oRange === "max" && this.orientation === "vertical" ) {
+ this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
+ }
+ }
+ },
+
+ _handleEvents: {
+ keydown: function( event ) {
+ var allowed, curVal, newVal, step,
+ index = $( event.target ).data( "ui-slider-handle-index" );
+
+ switch ( event.keyCode ) {
+ case $.ui.keyCode.HOME:
+ case $.ui.keyCode.END:
+ case $.ui.keyCode.PAGE_UP:
+ case $.ui.keyCode.PAGE_DOWN:
+ case $.ui.keyCode.UP:
+ case $.ui.keyCode.RIGHT:
+ case $.ui.keyCode.DOWN:
+ case $.ui.keyCode.LEFT:
+ event.preventDefault();
+ if ( !this._keySliding ) {
+ this._keySliding = true;
+ $( event.target ).addClass( "ui-state-active" );
+ allowed = this._start( event, index );
+ if ( allowed === false ) {
+ return;
+ }
+ }
+ break;
+ }
+
+ step = this.options.step;
+ if ( this.options.values && this.options.values.length ) {
+ curVal = newVal = this.values( index );
+ } else {
+ curVal = newVal = this.value();
+ }
+
+ switch ( event.keyCode ) {
+ case $.ui.keyCode.HOME:
+ newVal = this._valueMin();
+ break;
+ case $.ui.keyCode.END:
+ newVal = this._valueMax();
+ break;
+ case $.ui.keyCode.PAGE_UP:
+ newVal = this._trimAlignValue( curVal + ( (this._valueMax() - this._valueMin()) / numPages ) );
+ break;
+ case $.ui.keyCode.PAGE_DOWN:
+ newVal = this._trimAlignValue( curVal - ( (this._valueMax() - this._valueMin()) / numPages ) );
+ break;
+ case $.ui.keyCode.UP:
+ case $.ui.keyCode.RIGHT:
+ if ( curVal === this._valueMax() ) {
+ return;
+ }
+ newVal = this._trimAlignValue( curVal + step );
+ break;
+ case $.ui.keyCode.DOWN:
+ case $.ui.keyCode.LEFT:
+ if ( curVal === this._valueMin() ) {
+ return;
+ }
+ newVal = this._trimAlignValue( curVal - step );
+ break;
+ }
+
+ this._slide( event, index, newVal );
+ },
+ click: function( event ) {
+ event.preventDefault();
+ },
+ keyup: function( event ) {
+ var index = $( event.target ).data( "ui-slider-handle-index" );
+
+ if ( this._keySliding ) {
+ this._keySliding = false;
+ this._stop( event, index );
+ this._change( event, index );
+ $( event.target ).removeClass( "ui-state-active" );
+ }
+ }
+ }
+
+});
+
+}(jQuery));
+
+(function( $ ) {
+
+function modifier( fn ) {
+ return function() {
+ var previous = this.element.val();
+ fn.apply( this, arguments );
+ this._refresh();
+ if ( previous !== this.element.val() ) {
+ this._trigger( "change" );
+ }
+ };
+}
+
+$.widget( "ui.spinner", {
+ version: "1.10.4",
+ defaultElement: "<input>",
+ widgetEventPrefix: "spin",
+ options: {
+ culture: null,
+ icons: {
+ down: "ui-icon-triangle-1-s",
+ up: "ui-icon-triangle-1-n"
+ },
+ incremental: true,
+ max: null,
+ min: null,
+ numberFormat: null,
+ page: 10,
+ step: 1,
+
+ change: null,
+ spin: null,
+ start: null,
+ stop: null
+ },
+
+ _create: function() {
+ // handle string values that need to be parsed
+ this._setOption( "max", this.options.max );
+ this._setOption( "min", this.options.min );
+ this._setOption( "step", this.options.step );
+
+ // Only format if there is a value, prevents the field from being marked
+ // as invalid in Firefox, see #9573.
+ if ( this.value() !== "" ) {
+ // Format the value, but don't constrain.
+ this._value( this.element.val(), true );
+ }
+
+ this._draw();
+ this._on( this._events );
+ this._refresh();
+
+ // turning off autocomplete prevents the browser from remembering the
+ // value when navigating through history, so we re-enable autocomplete
+ // if the page is unloaded before the widget is destroyed. #7790
+ this._on( this.window, {
+ beforeunload: function() {
+ this.element.removeAttr( "autocomplete" );
+ }
+ });
+ },
+
+ _getCreateOptions: function() {
+ var options = {},
+ element = this.element;
+
+ $.each( [ "min", "max", "step" ], function( i, option ) {
+ var value = element.attr( option );
+ if ( value !== undefined && value.length ) {
+ options[ option ] = value;
+ }
+ });
+
+ return options;
+ },
+
+ _events: {
+ keydown: function( event ) {
+ if ( this._start( event ) && this._keydown( event ) ) {
+ event.preventDefault();
+ }
+ },
+ keyup: "_stop",
+ focus: function() {
+ this.previous = this.element.val();
+ },
+ blur: function( event ) {
+ if ( this.cancelBlur ) {
+ delete this.cancelBlur;
+ return;
+ }
+
+ this._stop();
+ this._refresh();
+ if ( this.previous !== this.element.val() ) {
+ this._trigger( "change", event );
+ }
+ },
+ mousewheel: function( event, delta ) {
+ if ( !delta ) {
+ return;
+ }
+ if ( !this.spinning && !this._start( event ) ) {
+ return false;
+ }
+
+ this._spin( (delta > 0 ? 1 : -1) * this.options.step, event );
+ clearTimeout( this.mousewheelTimer );
+ this.mousewheelTimer = this._delay(function() {
+ if ( this.spinning ) {
+ this._stop( event );
+ }
+ }, 100 );
+ event.preventDefault();
+ },
+ "mousedown .ui-spinner-button": function( event ) {
+ var previous;
+
+ // We never want the buttons to have focus; whenever the user is
+ // interacting with the spinner, the focus should be on the input.
+ // If the input is focused then this.previous is properly set from
+ // when the input first received focus. If the input is not focused
+ // then we need to set this.previous based on the value before spinning.
+ previous = this.element[0] === this.document[0].activeElement ?
+ this.previous : this.element.val();
+ function checkFocus() {
+ var isActive = this.element[0] === this.document[0].activeElement;
+ if ( !isActive ) {
+ this.element.focus();
+ this.previous = previous;
+ // support: IE
+ // IE sets focus asynchronously, so we need to check if focus
+ // moved off of the input because the user clicked on the button.
+ this._delay(function() {
+ this.previous = previous;
+ });
+ }
+ }
+
+ // ensure focus is on (or stays on) the text field
+ event.preventDefault();
+ checkFocus.call( this );
+
+ // support: IE
+ // IE doesn't prevent moving focus even with event.preventDefault()
+ // so we set a flag to know when we should ignore the blur event
+ // and check (again) if focus moved off of the input.
+ this.cancelBlur = true;
+ this._delay(function() {
+ delete this.cancelBlur;
+ checkFocus.call( this );
+ });
+
+ if ( this._start( event ) === false ) {
+ return;
+ }
+
+ this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
+ },
+ "mouseup .ui-spinner-button": "_stop",
+ "mouseenter .ui-spinner-button": function( event ) {
+ // button will add ui-state-active if mouse was down while mouseleave and kept down
+ if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) {
+ return;
+ }
+
+ if ( this._start( event ) === false ) {
+ return false;
+ }
+ this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
+ },
+ // TODO: do we really want to consider this a stop?
+ // shouldn't we just stop the repeater and wait until mouseup before
+ // we trigger the stop event?
+ "mouseleave .ui-spinner-button": "_stop"
+ },
+
+ _draw: function() {
+ var uiSpinner = this.uiSpinner = this.element
+ .addClass( "ui-spinner-input" )
+ .attr( "autocomplete", "off" )
+ .wrap( this._uiSpinnerHtml() )
+ .parent()
+ // add buttons
+ .append( this._buttonHtml() );
+
+ this.element.attr( "role", "spinbutton" );
+
+ // button bindings
+ this.buttons = uiSpinner.find( ".ui-spinner-button" )
+ .attr( "tabIndex", -1 )
+ .button()
+ .removeClass( "ui-corner-all" );
+
+ // IE 6 doesn't understand height: 50% for the buttons
+ // unless the wrapper has an explicit height
+ if ( this.buttons.height() > Math.ceil( uiSpinner.height() * 0.5 ) &&
+ uiSpinner.height() > 0 ) {
+ uiSpinner.height( uiSpinner.height() );
+ }
+
+ // disable spinner if element was already disabled
+ if ( this.options.disabled ) {
+ this.disable();
+ }
+ },
+
+ _keydown: function( event ) {
+ var options = this.options,
+ keyCode = $.ui.keyCode;
+
+ switch ( event.keyCode ) {
+ case keyCode.UP:
+ this._repeat( null, 1, event );
+ return true;
+ case keyCode.DOWN:
+ this._repeat( null, -1, event );
+ return true;
+ case keyCode.PAGE_UP:
+ this._repeat( null, options.page, event );
+ return true;
+ case keyCode.PAGE_DOWN:
+ this._repeat( null, -options.page, event );
+ return true;
+ }
+
+ return false;
+ },
+
+ _uiSpinnerHtml: function() {
+ return "<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>";
+ },
+
+ _buttonHtml: function() {
+ return "" +
+ "<a class='ui-spinner-button ui-spinner-up ui-corner-tr'>" +
+ "<span class='ui-icon " + this.options.icons.up + "'>&#9650;</span>" +
+ "</a>" +
+ "<a class='ui-spinner-button ui-spinner-down ui-corner-br'>" +
+ "<span class='ui-icon " + this.options.icons.down + "'>&#9660;</span>" +
+ "</a>";
+ },
+
+ _start: function( event ) {
+ if ( !this.spinning && this._trigger( "start", event ) === false ) {
+ return false;
+ }
+
+ if ( !this.counter ) {
+ this.counter = 1;
+ }
+ this.spinning = true;
+ return true;
+ },
+
+ _repeat: function( i, steps, event ) {
+ i = i || 500;
+
+ clearTimeout( this.timer );
+ this.timer = this._delay(function() {
+ this._repeat( 40, steps, event );
+ }, i );
+
+ this._spin( steps * this.options.step, event );
+ },
+
+ _spin: function( step, event ) {
+ var value = this.value() || 0;
+
+ if ( !this.counter ) {
+ this.counter = 1;
+ }
+
+ value = this._adjustValue( value + step * this._increment( this.counter ) );
+
+ if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false) {
+ this._value( value );
+ this.counter++;
+ }
+ },
+
+ _increment: function( i ) {
+ var incremental = this.options.incremental;
+
+ if ( incremental ) {
+ return $.isFunction( incremental ) ?
+ incremental( i ) :
+ Math.floor( i*i*i/50000 - i*i/500 + 17*i/200 + 1 );
+ }
+
+ return 1;
+ },
+
+ _precision: function() {
+ var precision = this._precisionOf( this.options.step );
+ if ( this.options.min !== null ) {
+ precision = Math.max( precision, this._precisionOf( this.options.min ) );
+ }
+ return precision;
+ },
+
+ _precisionOf: function( num ) {
+ var str = num.toString(),
+ decimal = str.indexOf( "." );
+ return decimal === -1 ? 0 : str.length - decimal - 1;
+ },
+
+ _adjustValue: function( value ) {
+ var base, aboveMin,
+ options = this.options;
+
+ // make sure we're at a valid step
+ // - find out where we are relative to the base (min or 0)
+ base = options.min !== null ? options.min : 0;
+ aboveMin = value - base;
+ // - round to the nearest step
+ aboveMin = Math.round(aboveMin / options.step) * options.step;
+ // - rounding is based on 0, so adjust back to our base
+ value = base + aboveMin;
+
+ // fix precision from bad JS floating point math
+ value = parseFloat( value.toFixed( this._precision() ) );
+
+ // clamp the value
+ if ( options.max !== null && value > options.max) {
+ return options.max;
+ }
+ if ( options.min !== null && value < options.min ) {
+ return options.min;
+ }
+
+ return value;
+ },
+
+ _stop: function( event ) {
+ if ( !this.spinning ) {
+ return;
+ }
+
+ clearTimeout( this.timer );
+ clearTimeout( this.mousewheelTimer );
+ this.counter = 0;
+ this.spinning = false;
+ this._trigger( "stop", event );
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "culture" || key === "numberFormat" ) {
+ var prevValue = this._parse( this.element.val() );
+ this.options[ key ] = value;
+ this.element.val( this._format( prevValue ) );
+ return;
+ }
+
+ if ( key === "max" || key === "min" || key === "step" ) {
+ if ( typeof value === "string" ) {
+ value = this._parse( value );
+ }
+ }
+ if ( key === "icons" ) {
+ this.buttons.first().find( ".ui-icon" )
+ .removeClass( this.options.icons.up )
+ .addClass( value.up );
+ this.buttons.last().find( ".ui-icon" )
+ .removeClass( this.options.icons.down )
+ .addClass( value.down );
+ }
+
+ this._super( key, value );
+
+ if ( key === "disabled" ) {
+ if ( value ) {
+ this.element.prop( "disabled", true );
+ this.buttons.button( "disable" );
+ } else {
+ this.element.prop( "disabled", false );
+ this.buttons.button( "enable" );
+ }
+ }
+ },
+
+ _setOptions: modifier(function( options ) {
+ this._super( options );
+ this._value( this.element.val() );
+ }),
+
+ _parse: function( val ) {
+ if ( typeof val === "string" && val !== "" ) {
+ val = window.Globalize && this.options.numberFormat ?
+ Globalize.parseFloat( val, 10, this.options.culture ) : +val;
+ }
+ return val === "" || isNaN( val ) ? null : val;
+ },
+
+ _format: function( value ) {
+ if ( value === "" ) {
+ return "";
+ }
+ return window.Globalize && this.options.numberFormat ?
+ Globalize.format( value, this.options.numberFormat, this.options.culture ) :
+ value;
+ },
+
+ _refresh: function() {
+ this.element.attr({
+ "aria-valuemin": this.options.min,
+ "aria-valuemax": this.options.max,
+ // TODO: what should we do with values that can't be parsed?
+ "aria-valuenow": this._parse( this.element.val() )
+ });
+ },
+
+ // update the value without triggering change
+ _value: function( value, allowAny ) {
+ var parsed;
+ if ( value !== "" ) {
+ parsed = this._parse( value );
+ if ( parsed !== null ) {
+ if ( !allowAny ) {
+ parsed = this._adjustValue( parsed );
+ }
+ value = this._format( parsed );
+ }
+ }
+ this.element.val( value );
+ this._refresh();
+ },
+
+ _destroy: function() {
+ this.element
+ .removeClass( "ui-spinner-input" )
+ .prop( "disabled", false )
+ .removeAttr( "autocomplete" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-valuemin" )
+ .removeAttr( "aria-valuemax" )
+ .removeAttr( "aria-valuenow" );
+ this.uiSpinner.replaceWith( this.element );
+ },
+
+ stepUp: modifier(function( steps ) {
+ this._stepUp( steps );
+ }),
+ _stepUp: function( steps ) {
+ if ( this._start() ) {
+ this._spin( (steps || 1) * this.options.step );
+ this._stop();
+ }
+ },
+
+ stepDown: modifier(function( steps ) {
+ this._stepDown( steps );
+ }),
+ _stepDown: function( steps ) {
+ if ( this._start() ) {
+ this._spin( (steps || 1) * -this.options.step );
+ this._stop();
+ }
+ },
+
+ pageUp: modifier(function( pages ) {
+ this._stepUp( (pages || 1) * this.options.page );
+ }),
+
+ pageDown: modifier(function( pages ) {
+ this._stepDown( (pages || 1) * this.options.page );
+ }),
+
+ value: function( newVal ) {
+ if ( !arguments.length ) {
+ return this._parse( this.element.val() );
+ }
+ modifier( this._value ).call( this, newVal );
+ },
+
+ widget: function() {
+ return this.uiSpinner;
+ }
+});
+
+}( jQuery ) );
+
+(function( $, undefined ) {
+
+var tabId = 0,
+ rhash = /#.*$/;
+
+function getNextTabId() {
+ return ++tabId;
+}
+
+function isLocal( anchor ) {
+ // support: IE7
+ // IE7 doesn't normalize the href property when set via script (#9317)
+ anchor = anchor.cloneNode( false );
+
+ return anchor.hash.length > 1 &&
+ decodeURIComponent( anchor.href.replace( rhash, "" ) ) ===
+ decodeURIComponent( location.href.replace( rhash, "" ) );
+}
+
+$.widget( "ui.tabs", {
+ version: "1.10.4",
+ delay: 300,
+ options: {
+ active: null,
+ collapsible: false,
+ event: "click",
+ heightStyle: "content",
+ hide: null,
+ show: null,
+
+ // callbacks
+ activate: null,
+ beforeActivate: null,
+ beforeLoad: null,
+ load: null
+ },
+
+ _create: function() {
+ var that = this,
+ options = this.options;
+
+ this.running = false;
+
+ this.element
+ .addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" )
+ .toggleClass( "ui-tabs-collapsible", options.collapsible )
+ // Prevent users from focusing disabled tabs via click
+ .delegate( ".ui-tabs-nav > li", "mousedown" + this.eventNamespace, function( event ) {
+ if ( $( this ).is( ".ui-state-disabled" ) ) {
+ event.preventDefault();
+ }
+ })
+ // support: IE <9
+ // Preventing the default action in mousedown doesn't prevent IE
+ // from focusing the element, so if the anchor gets focused, blur.
+ // We don't have to worry about focusing the previously focused
+ // element since clicking on a non-focusable element should focus
+ // the body anyway.
+ .delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() {
+ if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
+ this.blur();
+ }
+ });
+
+ this._processTabs();
+ options.active = this._initialActive();
+
+ // Take disabling tabs via class attribute from HTML
+ // into account and update option properly.
+ if ( $.isArray( options.disabled ) ) {
+ options.disabled = $.unique( options.disabled.concat(
+ $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
+ return that.tabs.index( li );
+ })
+ ) ).sort();
+ }
+
+ // check for length avoids error when initializing empty list
+ if ( this.options.active !== false && this.anchors.length ) {
+ this.active = this._findActive( options.active );
+ } else {
+ this.active = $();
+ }
+
+ this._refresh();
+
+ if ( this.active.length ) {
+ this.load( options.active );
+ }
+ },
+
+ _initialActive: function() {
+ var active = this.options.active,
+ collapsible = this.options.collapsible,
+ locationHash = location.hash.substring( 1 );
+
+ if ( active === null ) {
+ // check the fragment identifier in the URL
+ if ( locationHash ) {
+ this.tabs.each(function( i, tab ) {
+ if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
+ active = i;
+ return false;
+ }
+ });
+ }
+
+ // check for a tab marked active via a class
+ if ( active === null ) {
+ active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
+ }
+
+ // no active tab, set to false
+ if ( active === null || active === -1 ) {
+ active = this.tabs.length ? 0 : false;
+ }
+ }
+
+ // handle numbers: negative, out of range
+ if ( active !== false ) {
+ active = this.tabs.index( this.tabs.eq( active ) );
+ if ( active === -1 ) {
+ active = collapsible ? false : 0;
+ }
+ }
+
+ // don't allow collapsible: false and active: false
+ if ( !collapsible && active === false && this.anchors.length ) {
+ active = 0;
+ }
+
+ return active;
+ },
+
+ _getCreateEventData: function() {
+ return {
+ tab: this.active,
+ panel: !this.active.length ? $() : this._getPanelForTab( this.active )
+ };
+ },
+
+ _tabKeydown: function( event ) {
+ var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
+ selectedIndex = this.tabs.index( focusedTab ),
+ goingForward = true;
+
+ if ( this._handlePageNav( event ) ) {
+ return;
+ }
+
+ switch ( event.keyCode ) {
+ case $.ui.keyCode.RIGHT:
+ case $.ui.keyCode.DOWN:
+ selectedIndex++;
+ break;
+ case $.ui.keyCode.UP:
+ case $.ui.keyCode.LEFT:
+ goingForward = false;
+ selectedIndex--;
+ break;
+ case $.ui.keyCode.END:
+ selectedIndex = this.anchors.length - 1;
+ break;
+ case $.ui.keyCode.HOME:
+ selectedIndex = 0;
+ break;
+ case $.ui.keyCode.SPACE:
+ // Activate only, no collapsing
+ event.preventDefault();
+ clearTimeout( this.activating );
+ this._activate( selectedIndex );
+ return;
+ case $.ui.keyCode.ENTER:
+ // Toggle (cancel delayed activation, allow collapsing)
+ event.preventDefault();
+ clearTimeout( this.activating );
+ // Determine if we should collapse or activate
+ this._activate( selectedIndex === this.options.active ? false : selectedIndex );
+ return;
+ default:
+ return;
+ }
+
+ // Focus the appropriate tab, based on which key was pressed
+ event.preventDefault();
+ clearTimeout( this.activating );
+ selectedIndex = this._focusNextTab( selectedIndex, goingForward );
+
+ // Navigating with control key will prevent automatic activation
+ if ( !event.ctrlKey ) {
+ // Update aria-selected immediately so that AT think the tab is already selected.
+ // Otherwise AT may confuse the user by stating that they need to activate the tab,
+ // but the tab will already be activated by the time the announcement finishes.
+ focusedTab.attr( "aria-selected", "false" );
+ this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );
+
+ this.activating = this._delay(function() {
+ this.option( "active", selectedIndex );
+ }, this.delay );
+ }
+ },
+
+ _panelKeydown: function( event ) {
+ if ( this._handlePageNav( event ) ) {
+ return;
+ }
+
+ // Ctrl+up moves focus to the current tab
+ if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
+ event.preventDefault();
+ this.active.focus();
+ }
+ },
+
+ // Alt+page up/down moves focus to the previous/next tab (and activates)
+ _handlePageNav: function( event ) {
+ if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
+ this._activate( this._focusNextTab( this.options.active - 1, false ) );
+ return true;
+ }
+ if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
+ this._activate( this._focusNextTab( this.options.active + 1, true ) );
+ return true;
+ }
+ },
+
+ _findNextTab: function( index, goingForward ) {
+ var lastTabIndex = this.tabs.length - 1;
+
+ function constrain() {
+ if ( index > lastTabIndex ) {
+ index = 0;
+ }
+ if ( index < 0 ) {
+ index = lastTabIndex;
+ }
+ return index;
+ }
+
+ while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {
+ index = goingForward ? index + 1 : index - 1;
+ }
+
+ return index;
+ },
+
+ _focusNextTab: function( index, goingForward ) {
+ index = this._findNextTab( index, goingForward );
+ this.tabs.eq( index ).focus();
+ return index;
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "active" ) {
+ // _activate() will handle invalid values and update this.options
+ this._activate( value );
+ return;
+ }
+
+ if ( key === "disabled" ) {
+ // don't use the widget factory's disabled handling
+ this._setupDisabled( value );
+ return;
+ }
+
+ this._super( key, value);
+
+ if ( key === "collapsible" ) {
+ this.element.toggleClass( "ui-tabs-collapsible", value );
+ // Setting collapsible: false while collapsed; open first panel
+ if ( !value && this.options.active === false ) {
+ this._activate( 0 );
+ }
+ }
+
+ if ( key === "event" ) {
+ this._setupEvents( value );
+ }
+
+ if ( key === "heightStyle" ) {
+ this._setupHeightStyle( value );
+ }
+ },
+
+ _tabId: function( tab ) {
+ return tab.attr( "aria-controls" ) || "ui-tabs-" + getNextTabId();
+ },
+
+ _sanitizeSelector: function( hash ) {
+ return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
+ },
+
+ refresh: function() {
+ var options = this.options,
+ lis = this.tablist.children( ":has(a[href])" );
+
+ // get disabled tabs from class attribute from HTML
+ // this will get converted to a boolean if needed in _refresh()
+ options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
+ return lis.index( tab );
+ });
+
+ this._processTabs();
+
+ // was collapsed or no tabs
+ if ( options.active === false || !this.anchors.length ) {
+ options.active = false;
+ this.active = $();
+ // was active, but active tab is gone
+ } else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) {
+ // all remaining tabs are disabled
+ if ( this.tabs.length === options.disabled.length ) {
+ options.active = false;
+ this.active = $();
+ // activate previous tab
+ } else {
+ this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) );
+ }
+ // was active, active tab still exists
+ } else {
+ // make sure active index is correct
+ options.active = this.tabs.index( this.active );
+ }
+
+ this._refresh();
+ },
+
+ _refresh: function() {
+ this._setupDisabled( this.options.disabled );
+ this._setupEvents( this.options.event );
+ this._setupHeightStyle( this.options.heightStyle );
+
+ this.tabs.not( this.active ).attr({
+ "aria-selected": "false",
+ tabIndex: -1
+ });
+ this.panels.not( this._getPanelForTab( this.active ) )
+ .hide()
+ .attr({
+ "aria-expanded": "false",
+ "aria-hidden": "true"
+ });
+
+ // Make sure one tab is in the tab order
+ if ( !this.active.length ) {
+ this.tabs.eq( 0 ).attr( "tabIndex", 0 );
+ } else {
+ 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"
+ });
+ }
+ },
+
+ _processTabs: function() {
+ var that = 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 $( "a", this )[ 0 ];
+ })
+ .addClass( "ui-tabs-anchor" )
+ .attr({
+ role: "presentation",
+ tabIndex: -1
+ });
+
+ this.panels = $();
+
+ this.anchors.each(function( i, anchor ) {
+ var selector, panel, panelId,
+ anchorId = $( anchor ).uniqueId().attr( "id" ),
+ tab = $( anchor ).closest( "li" ),
+ originalAriaControls = tab.attr( "aria-controls" );
+
+ // inline tab
+ if ( isLocal( anchor ) ) {
+ selector = anchor.hash;
+ panel = that.element.find( that._sanitizeSelector( selector ) );
+ // remote tab
+ } else {
+ panelId = that._tabId( tab );
+ selector = "#" + panelId;
+ panel = that.element.find( selector );
+ if ( !panel.length ) {
+ panel = that._createPanel( panelId );
+ panel.insertAfter( that.panels[ i - 1 ] || that.tablist );
+ }
+ panel.attr( "aria-live", "polite" );
+ }
+
+ if ( panel.length) {
+ that.panels = that.panels.add( panel );
+ }
+ if ( originalAriaControls ) {
+ tab.data( "ui-tabs-aria-controls", originalAriaControls );
+ }
+ tab.attr({
+ "aria-controls": selector.substring( 1 ),
+ "aria-labelledby": anchorId
+ });
+ panel.attr( "aria-labelledby", anchorId );
+ });
+
+ this.panels
+ .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
+ .attr( "role", "tabpanel" );
+ },
+
+ // allow overriding how to find the list for rare usage scenarios (#7715)
+ _getList: function() {
+ return this.tablist || this.element.find( "ol,ul" ).eq( 0 );
+ },
+
+ _createPanel: function( id ) {
+ return $( "<div>" )
+ .attr( "id", id )
+ .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
+ .data( "ui-tabs-destroy", true );
+ },
+
+ _setupDisabled: function( disabled ) {
+ if ( $.isArray( disabled ) ) {
+ if ( !disabled.length ) {
+ disabled = false;
+ } else if ( disabled.length === this.anchors.length ) {
+ disabled = true;
+ }
+ }
+
+ // disable tabs
+ for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) {
+ if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
+ $( li )
+ .addClass( "ui-state-disabled" )
+ .attr( "aria-disabled", "true" );
+ } else {
+ $( li )
+ .removeClass( "ui-state-disabled" )
+ .removeAttr( "aria-disabled" );
+ }
+ }
+
+ this.options.disabled = disabled;
+ },
+
+ _setupEvents: function( event ) {
+ var events = {
+ click: function( event ) {
+ event.preventDefault();
+ }
+ };
+ if ( event ) {
+ $.each( event.split(" "), function( index, eventName ) {
+ events[ eventName ] = "_eventHandler";
+ });
+ }
+
+ this._off( this.anchors.add( this.tabs ).add( this.panels ) );
+ this._on( this.anchors, events );
+ this._on( this.tabs, { keydown: "_tabKeydown" } );
+ this._on( this.panels, { keydown: "_panelKeydown" } );
+
+ this._focusable( this.tabs );
+ this._hoverable( this.tabs );
+ },
+
+ _setupHeightStyle: function( heightStyle ) {
+ var maxHeight,
+ parent = this.element.parent();
+
+ if ( heightStyle === "fill" ) {
+ maxHeight = parent.height();
+ maxHeight -= this.element.outerHeight() - this.element.height();
+
+ this.element.siblings( ":visible" ).each(function() {
+ var elem = $( this ),
+ position = elem.css( "position" );
+
+ if ( position === "absolute" || position === "fixed" ) {
+ return;
+ }
+ maxHeight -= elem.outerHeight( true );
+ });
+
+ this.element.children().not( this.panels ).each(function() {
+ maxHeight -= $( this ).outerHeight( true );
+ });
+
+ this.panels.each(function() {
+ $( this ).height( Math.max( 0, maxHeight -
+ $( this ).innerHeight() + $( this ).height() ) );
+ })
+ .css( "overflow", "auto" );
+ } else if ( heightStyle === "auto" ) {
+ maxHeight = 0;
+ this.panels.each(function() {
+ maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
+ }).height( maxHeight );
+ }
+ },
+
+ _eventHandler: function( event ) {
+ var options = this.options,
+ active = this.active,
+ anchor = $( event.currentTarget ),
+ tab = anchor.closest( "li" ),
+ clickedIsActive = tab[ 0 ] === active[ 0 ],
+ collapsing = clickedIsActive && options.collapsible,
+ toShow = collapsing ? $() : this._getPanelForTab( tab ),
+ toHide = !active.length ? $() : this._getPanelForTab( active ),
+ eventData = {
+ oldTab: active,
+ oldPanel: toHide,
+ newTab: collapsing ? $() : tab,
+ newPanel: toShow
+ };
+
+ event.preventDefault();
+
+ if ( tab.hasClass( "ui-state-disabled" ) ||
+ // tab is already loading
+ tab.hasClass( "ui-tabs-loading" ) ||
+ // can't switch durning an animation
+ this.running ||
+ // click on active header, but not collapsible
+ ( clickedIsActive && !options.collapsible ) ||
+ // allow canceling activation
+ ( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
+ return;
+ }
+
+ options.active = collapsing ? false : this.tabs.index( tab );
+
+ this.active = clickedIsActive ? $() : tab;
+ if ( this.xhr ) {
+ this.xhr.abort();
+ }
+
+ if ( !toHide.length && !toShow.length ) {
+ $.error( "jQuery UI Tabs: Mismatching fragment identifier." );
+ }
+
+ if ( toShow.length ) {
+ this.load( this.tabs.index( tab ), event );
+ }
+ this._toggle( event, eventData );
+ },
+
+ // handles show/hide for selecting tabs
+ _toggle: function( event, eventData ) {
+ var that = this,
+ toShow = eventData.newPanel,
+ toHide = eventData.oldPanel;
+
+ this.running = true;
+
+ function complete() {
+ that.running = false;
+ that._trigger( "activate", event, eventData );
+ }
+
+ function show() {
+ eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" );
+
+ if ( toShow.length && that.options.show ) {
+ that._show( toShow, that.options.show, complete );
+ } else {
+ toShow.show();
+ complete();
+ }
+ }
+
+ // start out by hiding, then showing, then completing
+ if ( toHide.length && this.options.hide ) {
+ this._hide( toHide, this.options.hide, function() {
+ eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
+ show();
+ });
+ } else {
+ eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
+ toHide.hide();
+ show();
+ }
+
+ toHide.attr({
+ "aria-expanded": "false",
+ "aria-hidden": "true"
+ });
+ eventData.oldTab.attr( "aria-selected", "false" );
+ // If we're switching tabs, remove the old tab from the tab order.
+ // If we're opening from collapsed state, remove the previous tab from the tab order.
+ // If we're collapsing, then keep the collapsing tab in the tab order.
+ if ( toShow.length && toHide.length ) {
+ eventData.oldTab.attr( "tabIndex", -1 );
+ } else if ( toShow.length ) {
+ this.tabs.filter(function() {
+ return $( this ).attr( "tabIndex" ) === 0;
+ })
+ .attr( "tabIndex", -1 );
+ }
+
+ toShow.attr({
+ "aria-expanded": "true",
+ "aria-hidden": "false"
+ });
+ eventData.newTab.attr({
+ "aria-selected": "true",
+ tabIndex: 0
+ });
+ },
+
+ _activate: function( index ) {
+ var anchor,
+ active = this._findActive( index );
+
+ // trying to activate the already active panel
+ if ( active[ 0 ] === this.active[ 0 ] ) {
+ return;
+ }
+
+ // trying to collapse, simulate a click on the current active header
+ if ( !active.length ) {
+ active = this.active;
+ }
+
+ anchor = active.find( ".ui-tabs-anchor" )[ 0 ];
+ this._eventHandler({
+ target: anchor,
+ currentTarget: anchor,
+ preventDefault: $.noop
+ });
+ },
+
+ _findActive: function( index ) {
+ return index === false ? $() : this.tabs.eq( index );
+ },
+
+ _getIndex: function( index ) {
+ // meta-function to give users option to provide a href string instead of a numerical index.
+ if ( typeof index === "string" ) {
+ index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) );
+ }
+
+ return index;
+ },
+
+ _destroy: function() {
+ if ( 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" )
+ .removeUniqueId();
+
+ this.tabs.add( this.panels ).each(function() {
+ if ( $.data( this, "ui-tabs-destroy" ) ) {
+ $( this ).remove();
+ } else {
+ $( 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 li = $( this ),
+ prev = li.data( "ui-tabs-aria-controls" );
+ if ( prev ) {
+ li
+ .attr( "aria-controls", prev )
+ .removeData( "ui-tabs-aria-controls" );
+ } else {
+ li.removeAttr( "aria-controls" );
+ }
+ });
+
+ this.panels.show();
+
+ if ( this.options.heightStyle !== "content" ) {
+ this.panels.css( "height", "" );
+ }
+ },
+
+ enable: function( index ) {
+ var disabled = this.options.disabled;
+ if ( disabled === false ) {
+ return;
+ }
+
+ if ( index === undefined ) {
+ disabled = false;
+ } else {
+ index = this._getIndex( index );
+ if ( $.isArray( disabled ) ) {
+ disabled = $.map( disabled, function( num ) {
+ return num !== index ? num : null;
+ });
+ } else {
+ disabled = $.map( this.tabs, function( li, num ) {
+ return num !== index ? num : null;
+ });
+ }
+ }
+ this._setupDisabled( disabled );
+ },
+
+ disable: function( index ) {
+ var disabled = this.options.disabled;
+ if ( disabled === true ) {
+ return;
+ }
+
+ if ( index === undefined ) {
+ disabled = true;
+ } else {
+ index = this._getIndex( index );
+ if ( $.inArray( index, disabled ) !== -1 ) {
+ return;
+ }
+ if ( $.isArray( disabled ) ) {
+ disabled = $.merge( [ index ], disabled ).sort();
+ } else {
+ disabled = [ index ];
+ }
+ }
+ this._setupDisabled( disabled );
+ },
+
+ load: function( index, event ) {
+ index = this._getIndex( index );
+ var that = this,
+ tab = this.tabs.eq( index ),
+ anchor = tab.find( ".ui-tabs-anchor" ),
+ panel = this._getPanelForTab( tab ),
+ eventData = {
+ tab: tab,
+ panel: panel
+ };
+
+ // not remote
+ if ( isLocal( anchor[ 0 ] ) ) {
+ return;
+ }
+
+ this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
+
+ // support: jQuery <1.8
+ // jQuery <1.8 returns false if the request is canceled in beforeSend,
+ // but as of 1.8, $.ajax() always returns a jqXHR object.
+ if ( this.xhr && this.xhr.statusText !== "canceled" ) {
+ tab.addClass( "ui-tabs-loading" );
+ panel.attr( "aria-busy", "true" );
+
+ this.xhr
+ .success(function( response ) {
+ // support: jQuery <1.8
+ // http://bugs.jquery.com/ticket/11778
+ setTimeout(function() {
+ panel.html( response );
+ that._trigger( "load", event, eventData );
+ }, 1 );
+ })
+ .complete(function( jqXHR, status ) {
+ // support: jQuery <1.8
+ // http://bugs.jquery.com/ticket/11778
+ setTimeout(function() {
+ if ( status === "abort" ) {
+ that.panels.stop( false, true );
+ }
+
+ tab.removeClass( "ui-tabs-loading" );
+ panel.removeAttr( "aria-busy" );
+
+ if ( jqXHR === that.xhr ) {
+ delete that.xhr;
+ }
+ }, 1 );
+ });
+ }
+ },
+
+ _ajaxSettings: function( anchor, event, eventData ) {
+ var that = this;
+ return {
+ url: anchor.attr( "href" ),
+ beforeSend: function( jqXHR, settings ) {
+ return that._trigger( "beforeLoad", event,
+ $.extend( { jqXHR : jqXHR, ajaxSettings: settings }, eventData ) );
+ }
+ };
+ },
+
+ _getPanelForTab: function( tab ) {
+ var id = $( tab ).attr( "aria-controls" );
+ return this.element.find( this._sanitizeSelector( "#" + id ) );
+ }
+});
+
+})( jQuery );
+
+(function( $ ) {
+
+var increments = 0;
+
+function addDescribedBy( elem, id ) {
+ var describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ );
+ describedby.push( id );
+ elem
+ .data( "ui-tooltip-id", id )
+ .attr( "aria-describedby", $.trim( describedby.join( " " ) ) );
+}
+
+function removeDescribedBy( elem ) {
+ var id = elem.data( "ui-tooltip-id" ),
+ describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ),
+ index = $.inArray( id, describedby );
+ if ( index !== -1 ) {
+ describedby.splice( index, 1 );
+ }
+
+ elem.removeData( "ui-tooltip-id" );
+ describedby = $.trim( describedby.join( " " ) );
+ if ( describedby ) {
+ elem.attr( "aria-describedby", describedby );
+ } else {
+ elem.removeAttr( "aria-describedby" );
+ }
+}
+
+$.widget( "ui.tooltip", {
+ version: "1.10.4",
+ options: {
+ content: function() {
+ // support: IE<9, Opera in jQuery <1.7
+ // .text() can't accept undefined, so coerce to a string
+ var title = $( this ).attr( "title" ) || "";
+ // Escape title, since we're going from an attribute to raw HTML
+ return $( "<a>" ).text( title ).html();
+ },
+ hide: true,
+ // Disabled elements have inconsistent behavior across browsers (#8661)
+ items: "[title]:not([disabled])",
+ position: {
+ my: "left top+15",
+ at: "left bottom",
+ collision: "flipfit flip"
+ },
+ show: true,
+ tooltipClass: null,
+ track: false,
+
+ // callbacks
+ close: null,
+ open: null
+ },
+
+ _create: function() {
+ this._on({
+ mouseover: "open",
+ focusin: "open"
+ });
+
+ // IDs of generated tooltips, needed for destroy
+ this.tooltips = {};
+ // IDs of parent tooltips where we removed the title attribute
+ this.parents = {};
+
+ if ( this.options.disabled ) {
+ this._disable();
+ }
+ },
+
+ _setOption: function( key, value ) {
+ var that = this;
+
+ if ( key === "disabled" ) {
+ this[ value ? "_disable" : "_enable" ]();
+ this.options[ key ] = value;
+ // disable element style changes
+ return;
+ }
+
+ this._super( key, value );
+
+ if ( key === "content" ) {
+ $.each( this.tooltips, function( id, element ) {
+ that._updateContent( element );
+ });
+ }
+ },
+
+ _disable: function() {
+ var that = this;
+
+ // close open tooltips
+ $.each( this.tooltips, function( id, element ) {
+ var event = $.Event( "blur" );
+ event.target = event.currentTarget = element[0];
+ that.close( event, true );
+ });
+
+ // remove title attributes to prevent native tooltips
+ this.element.find( this.options.items ).addBack().each(function() {
+ var element = $( this );
+ if ( element.is( "[title]" ) ) {
+ element
+ .data( "ui-tooltip-title", element.attr( "title" ) )
+ .attr( "title", "" );
+ }
+ });
+ },
+
+ _enable: function() {
+ // restore title attributes
+ this.element.find( this.options.items ).addBack().each(function() {
+ var element = $( this );
+ if ( element.data( "ui-tooltip-title" ) ) {
+ element.attr( "title", element.data( "ui-tooltip-title" ) );
+ }
+ });
+ },
+
+ open: function( event ) {
+ var that = this,
+ target = $( event ? event.target : this.element )
+ // we need closest here due to mouseover bubbling,
+ // but always pointing at the same event target
+ .closest( this.options.items );
+
+ // No element to show a tooltip for or the tooltip is already open
+ if ( !target.length || target.data( "ui-tooltip-id" ) ) {
+ return;
+ }
+
+ if ( target.attr( "title" ) ) {
+ target.data( "ui-tooltip-title", target.attr( "title" ) );
+ }
+
+ target.data( "ui-tooltip-open", true );
+
+ // kill parent tooltips, custom or native, for hover
+ if ( event && event.type === "mouseover" ) {
+ target.parents().each(function() {
+ var parent = $( this ),
+ blurEvent;
+ if ( parent.data( "ui-tooltip-open" ) ) {
+ blurEvent = $.Event( "blur" );
+ blurEvent.target = blurEvent.currentTarget = this;
+ that.close( blurEvent, true );
+ }
+ if ( parent.attr( "title" ) ) {
+ parent.uniqueId();
+ that.parents[ this.id ] = {
+ element: this,
+ title: parent.attr( "title" )
+ };
+ parent.attr( "title", "" );
+ }
+ });
+ }
+
+ this._updateContent( target, event );
+ },
+
+ _updateContent: function( target, event ) {
+ var content,
+ contentOption = this.options.content,
+ that = this,
+ eventType = event ? event.type : null;
+
+ if ( typeof contentOption === "string" ) {
+ return this._open( event, target, contentOption );
+ }
+
+ content = contentOption.call( target[0], function( response ) {
+ // ignore async response if tooltip was closed already
+ if ( !target.data( "ui-tooltip-open" ) ) {
+ return;
+ }
+ // IE may instantly serve a cached response for ajax requests
+ // delay this call to _open so the other call to _open runs first
+ that._delay(function() {
+ // jQuery creates a special event for focusin when it doesn't
+ // exist natively. To improve performance, the native event
+ // object is reused and the type is changed. Therefore, we can't
+ // rely on the type being correct after the event finished
+ // bubbling, so we set it back to the previous value. (#8740)
+ if ( event ) {
+ event.type = eventType;
+ }
+ this._open( event, target, response );
+ });
+ });
+ if ( content ) {
+ this._open( event, target, content );
+ }
+ },
+
+ _open: function( event, target, content ) {
+ var tooltip, events, delayedShow,
+ positionOption = $.extend( {}, this.options.position );
+
+ if ( !content ) {
+ return;
+ }
+
+ // Content can be updated multiple times. If the tooltip already
+ // exists, then just update the content and bail.
+ tooltip = this._find( target );
+ if ( tooltip.length ) {
+ tooltip.find( ".ui-tooltip-content" ).html( content );
+ return;
+ }
+
+ // if we have a title, clear it to prevent the native tooltip
+ // we have to check first to avoid defining a title if none exists
+ // (we don't want to cause an element to start matching [title])
+ //
+ // We use removeAttr only for key events, to allow IE to export the correct
+ // accessible attributes. For mouse events, set to empty string to avoid
+ // native tooltip showing up (happens only when removing inside mouseover).
+ if ( target.is( "[title]" ) ) {
+ if ( event && event.type === "mouseover" ) {
+ target.attr( "title", "" );
+ } else {
+ target.removeAttr( "title" );
+ }
+ }
+
+ tooltip = this._tooltip( target );
+ addDescribedBy( target, tooltip.attr( "id" ) );
+ tooltip.find( ".ui-tooltip-content" ).html( content );
+
+ function position( event ) {
+ positionOption.of = event;
+ if ( tooltip.is( ":hidden" ) ) {
+ return;
+ }
+ tooltip.position( positionOption );
+ }
+ if ( this.options.track && event && /^mouse/.test( event.type ) ) {
+ this._on( this.document, {
+ mousemove: position
+ });
+ // trigger once to override element-relative positioning
+ position( event );
+ } else {
+ tooltip.position( $.extend({
+ of: target
+ }, this.options.position ) );
+ }
+
+ tooltip.hide();
+
+ this._show( tooltip, this.options.show );
+ // Handle tracking tooltips that are shown with a delay (#8644). As soon
+ // as the tooltip is visible, position the tooltip using the most recent
+ // event.
+ if ( this.options.show && this.options.show.delay ) {
+ delayedShow = this.delayedShow = setInterval(function() {
+ if ( tooltip.is( ":visible" ) ) {
+ position( positionOption.of );
+ clearInterval( delayedShow );
+ }
+ }, $.fx.interval );
+ }
+
+ this._trigger( "open", event, { tooltip: tooltip } );
+
+ events = {
+ keyup: function( event ) {
+ if ( event.keyCode === $.ui.keyCode.ESCAPE ) {
+ var fakeEvent = $.Event(event);
+ fakeEvent.currentTarget = target[0];
+ this.close( fakeEvent, true );
+ }
+ },
+ remove: function() {
+ this._removeTooltip( tooltip );
+ }
+ };
+ if ( !event || event.type === "mouseover" ) {
+ events.mouseleave = "close";
+ }
+ if ( !event || event.type === "focusin" ) {
+ events.focusout = "close";
+ }
+ this._on( true, target, events );
+ },
+
+ close: function( event ) {
+ var that = this,
+ target = $( event ? event.currentTarget : this.element ),
+ tooltip = this._find( target );
+
+ // disabling closes the tooltip, so we need to track when we're closing
+ // to avoid an infinite loop in case the tooltip becomes disabled on close
+ if ( this.closing ) {
+ return;
+ }
+
+ // Clear the interval for delayed tracking tooltips
+ clearInterval( this.delayedShow );
+
+ // only set title if we had one before (see comment in _open())
+ if ( target.data( "ui-tooltip-title" ) ) {
+ target.attr( "title", target.data( "ui-tooltip-title" ) );
+ }
+
+ removeDescribedBy( target );
+
+ tooltip.stop( true );
+ this._hide( tooltip, this.options.hide, function() {
+ that._removeTooltip( $( this ) );
+ });
+
+ target.removeData( "ui-tooltip-open" );
+ this._off( target, "mouseleave focusout keyup" );
+ // Remove 'remove' binding only on delegated targets
+ if ( target[0] !== this.element[0] ) {
+ this._off( target, "remove" );
+ }
+ this._off( this.document, "mousemove" );
+
+ if ( event && event.type === "mouseleave" ) {
+ $.each( this.parents, function( id, parent ) {
+ $( parent.element ).attr( "title", parent.title );
+ delete that.parents[ id ];
+ });
+ }
+
+ this.closing = true;
+ this._trigger( "close", event, { tooltip: tooltip } );
+ this.closing = false;
+ },
+
+ _tooltip: function( element ) {
+ var id = "ui-tooltip-" + increments++,
+ tooltip = $( "<div>" )
+ .attr({
+ id: id,
+ role: "tooltip"
+ })
+ .addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " +
+ ( this.options.tooltipClass || "" ) );
+ $( "<div>" )
+ .addClass( "ui-tooltip-content" )
+ .appendTo( tooltip );
+ tooltip.appendTo( this.document[0].body );
+ this.tooltips[ id ] = element;
+ return tooltip;
+ },
+
+ _find: function( target ) {
+ var id = target.data( "ui-tooltip-id" );
+ return id ? $( "#" + id ) : $();
+ },
+
+ _removeTooltip: function( tooltip ) {
+ tooltip.remove();
+ delete this.tooltips[ tooltip.attr( "id" ) ];
+ },
+
+ _destroy: function() {
+ var that = this;
+
+ // close open tooltips
+ $.each( this.tooltips, function( id, element ) {
+ // Delegate to close method to handle common cleanup
+ var event = $.Event( "blur" );
+ event.target = event.currentTarget = element[0];
+ that.close( event, true );
+
+ // Remove immediately; destroying an open tooltip doesn't use the
+ // hide animation
+ $( "#" + id ).remove();
+
+ // Restore the title
+ if ( element.data( "ui-tooltip-title" ) ) {
+ element.attr( "title", element.data( "ui-tooltip-title" ) );
+ element.removeData( "ui-tooltip-title" );
+ }
+ });
+ }
+});
+
+}( jQuery ) );
diff --git a/framework/Web/Javascripts/source/jquery/jquery-ui.min.js b/framework/Web/Javascripts/source/jquery/jquery-ui.min.js
new file mode 100644
index 00000000..6afd6154
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/jquery-ui.min.js
@@ -0,0 +1,12 @@
+/*! jQuery UI - v1.10.4 - 2014-01-17
+* http://jqueryui.com
+* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.effect.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.position.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+(function(t,e){function i(e,i){var n,o,a,r=e.nodeName.toLowerCase();return"area"===r?(n=e.parentNode,o=n.name,e.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap=#"+o+"]")[0],!!a&&s(a)):!1):(/input|select|textarea|button|object/.test(r)?!e.disabled:"a"===r?e.href||i:i)&&s(e)}function s(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}var n=0,o=/^ui-id-\d+$/;t.ui=t.ui||{},t.extend(t.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),t.fn.extend({focus:function(e){return function(i,s){return"number"==typeof i?this.each(function(){var e=this;setTimeout(function(){t(e).focus(),s&&s.call(e)},i)}):e.apply(this,arguments)}}(t.fn.focus),scrollParent:function(){var e;return e=t.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.css(this,"position"))&&/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(i){if(i!==e)return this.css("zIndex",i);if(this.length)for(var s,n,o=t(this[0]);o.length&&o[0]!==document;){if(s=o.css("position"),("absolute"===s||"relative"===s||"fixed"===s)&&(n=parseInt(o.css("zIndex"),10),!isNaN(n)&&0!==n))return n;o=o.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){o.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])},focusable:function(e){return i(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var s=t.attr(e,"tabindex"),n=isNaN(s);return(n||s>=0)&&i(e,!n)}}),t("<a>").outerWidth(1).jquery||t.each(["Width","Height"],function(i,s){function n(e,i,s,n){return t.each(o,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),n&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var o="Width"===s?["Left","Right"]:["Top","Bottom"],a=s.toLowerCase(),r={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+s]=function(i){return i===e?r["inner"+s].call(this):this.each(function(){t(this).css(a,n(this,i)+"px")})},t.fn["outer"+s]=function(e,i){return"number"!=typeof e?r["outer"+s].call(this,e):this.each(function(){t(this).css(a,n(this,e,!0,i)+"px")})}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(i){return arguments.length?e.call(this,t.camelCase(i)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.support.selectstart="onselectstart"in document.createElement("div"),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,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i){var s,n=t.plugins[e];if(n&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(s=0;n.length>s;s++)t.options[n[s][0]]&&n[s][1].apply(t.element,i)}},hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)}})})(jQuery),function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(o){}n(e)},t.widget=function(i,s,n){var o,a,r,h,l={},c=i.split(".")[0];i=i.split(".")[1],o=c+"-"+i,n||(n=s,s=t.Widget),t.expr[":"][o.toLowerCase()]=function(e){return!!t.data(e,o)},t[c]=t[c]||{},a=t[c][i],r=t[c][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new r(t,i)},t.extend(r,a,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),h=new s,h.options=t.widget.extend({},h.options),t.each(n,function(i,n){return t.isFunction(n)?(l[i]=function(){var t=function(){return s.prototype[i].apply(this,arguments)},e=function(t){return s.prototype[i].apply(this,t)};return function(){var i,s=this._super,o=this._superApply;return this._super=t,this._superApply=e,i=n.apply(this,arguments),this._super=s,this._superApply=o,i}}(),e):(l[i]=n,e)}),r.prototype=t.widget.extend(h,{widgetEventPrefix:a?h.widgetEventPrefix||i:i},l,{constructor:r,namespace:c,widgetName:i,widgetFullName:o}),a?(t.each(a._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,r,i._proto)}),delete a._childConstructors):s._childConstructors.push(r),t.widget.bridge(i,r)},t.widget.extend=function(i){for(var n,o,a=s.call(arguments,1),r=0,h=a.length;h>r;r++)for(n in a[r])o=a[r][n],a[r].hasOwnProperty(n)&&o!==e&&(i[n]=t.isPlainObject(o)?t.isPlainObject(i[n])?t.widget.extend({},i[n],o):t.widget.extend({},o):o);return i},t.widget.bridge=function(i,n){var o=n.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,h=s.call(arguments,1),l=this;return a=!r&&h.length?t.widget.extend.apply(null,[a].concat(h)):a,r?this.each(function(){var s,n=t.data(this,o);return n?t.isFunction(n[a])&&"_"!==a.charAt(0)?(s=n[a].apply(n,h),s!==n&&s!==e?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):e):t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new n(a,this))}),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,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(),s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),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(i,s){var n,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},n=i.split("."),i=n.shift(),n.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;n.length-1>a;a++)o[n[a]]=o[n[a]]||{},o=o[n[a]];if(i=n.pop(),1===arguments.length)return o[i]===e?null:o[i];o[i]=s}else{if(1===arguments.length)return this.options[i]===e?null:this.options[i];r[i]=s}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var o,a=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=o=t(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,o=this.widget()),t.each(n,function(n,r){function h(){return i||a.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof r?a[r]:r).apply(a,arguments):e}"string"!=typeof r&&(h.guid=r.guid=r.guid||h.guid||t.guid++);var l=n.match(/^(\w+)\s*(.*)$/),c=l[1]+a.eventNamespace,u=l[2];u?o.delegate(u,c,h):s.bind(c,h)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}})}(jQuery),function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,o="string"==typeof this.options.cancel&&i.target.nodeName?t(i.target).closest(this.options.cancel).length:!1;return n&&!o&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return s._mouseMove(t)},this._mouseUpDelegate=function(t){return s._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0)):!0}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):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)},_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(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(jQuery),function(t){t.widget("ui.draggable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(t(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){t("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"original"!==this.options.helper||t.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1):!1},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;return n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===n.containment?(this.containment=[0,0,t(document).width()-this.helperProportions.width-this.margins.left,(t(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):n.containment.constructor===Array?(this.containment=n.containment,undefined):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(e){var i,s,n,o,a=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=e.pageX,l=e.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,h=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s]),"drag"===e&&(this.positionAbs=this._convertPositionTo("absolute")),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i){var s=t(this).data("ui-draggable"),n=s.options,o=t.extend({},i,{item:s.element});s.sortables=[],t(n.connectToSortable).each(function(){var i=t.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",e,o))})},stop:function(e,i){var s=t(this).data("ui-draggable"),n=t.extend({},i,{item:s.element});t.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,n))})},drag:function(e,i){var s=t(this).data("ui-draggable"),n=this;t.each(s.sortables,function(){var o=!1,a=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,t.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==a&&this.instance._intersectsWith(this.instance.containerCache)&&t.contains(a.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=t(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",e),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",e),s.dropped=!1)})}}),t.ui.plugin.add("draggable","cursor",{start:function(){var e=t("body"),i=t(this).data("ui-draggable").options;e.css("cursor")&&(i._cursor=e.css("cursor")),e.css("cursor",i.cursor)},stop:function(){var e=t(this).data("ui-draggable").options;e._cursor&&t("body").css("cursor",e._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._opacity&&t(i.helper).css("opacity",s._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(){var e=t(this).data("ui-draggable");e.scrollParent[0]!==document&&"HTML"!==e.scrollParent[0].tagName&&(e.overflowOffset=e.scrollParent.offset())},drag:function(e){var i=t(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-e.pageY<s.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+s.scrollSpeed:e.pageY-i.overflowOffset.top<s.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-e.pageX<s.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+s.scrollSpeed:e.pageX-i.overflowOffset.left<s.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(e.pageY-t(document).scrollTop()<s.scrollSensitivity?n=t(document).scrollTop(t(document).scrollTop()-s.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<s.scrollSensitivity&&(n=t(document).scrollTop(t(document).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(e.pageX-t(document).scrollLeft()<s.scrollSensitivity?n=t(document).scrollLeft(t(document).scrollLeft()-s.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<s.scrollSensitivity&&(n=t(document).scrollLeft(t(document).scrollLeft()+s.scrollSpeed)))),n!==!1&&t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(i,e)}}),t.ui.plugin.add("draggable","snap",{start:function(){var e=t(this).data("ui-draggable"),i=e.options;e.snapElements=[],t(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=t(this),s=i.offset();this!==e.element[0]&&e.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:s.top,left:s.left})})},drag:function(e,i){var s,n,o,a,r,h,l,c,u,d,p=t(this).data("ui-draggable"),f=p.options,g=f.snapTolerance,m=i.offset.left,v=m+p.helperProportions.width,_=i.offset.top,b=_+p.helperProportions.height;for(u=p.snapElements.length-1;u>=0;u--)r=p.snapElements[u].left,h=r+p.snapElements[u].width,l=p.snapElements[u].top,c=l+p.snapElements[u].height,r-g>v||m>h+g||l-g>b||_>c+g||!t.contains(p.snapElements[u].item.ownerDocument,p.snapElements[u].item)?(p.snapElements[u].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=!1):("inner"!==f.snapMode&&(s=g>=Math.abs(l-b),n=g>=Math.abs(c-_),o=g>=Math.abs(r-v),a=g>=Math.abs(h-m),s&&(i.position.top=p._convertPositionTo("relative",{top:l-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c,left:0}).top-p.margins.top),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h}).left-p.margins.left)),d=s||n||o||a,"outer"!==f.snapMode&&(s=g>=Math.abs(l-_),n=g>=Math.abs(c-b),o=g>=Math.abs(r-m),a=g>=Math.abs(h-v),s&&(i.position.top=p._convertPositionTo("relative",{top:l,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c-p.helperProportions.height,left:0}).top-p.margins.top),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[u].snapping&&(s||n||o||a||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=s||n||o||a||d)}}),t.ui.plugin.add("draggable","stack",{start:function(){var e,i=this.data("ui-draggable").options,s=t.makeArray(t(i.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});s.length&&(e=parseInt(t(s[0]).css("zIndex"),10)||0,t(s).each(function(i){t(this).css("zIndex",e+i)}),this.css("zIndex",e+s.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._zIndex&&t(i.helper).css("zIndex",s._zIndex)}})}(jQuery),function(t){function e(t,e,i){return t>e&&e+i>t}t.widget("ui.droppable",{version:"1.10.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;
+this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?(e=arguments[0],undefined):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},t.ui.ddmanager.droppables[i.scope]=t.ui.ddmanager.droppables[i.scope]||[],t.ui.ddmanager.droppables[i.scope].push(this),i.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=0,i=t.ui.ddmanager.droppables[this.options.scope];i.length>e;e++)i[e]===this&&i.splice(e,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,i){"accept"===e&&(this.accept=t.isFunction(i)?i:function(t){return t.is(i)}),t.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=t.data(this,"ui-droppable");return e.options.greedy&&!e.options.disabled&&e.options.scope===s.options.scope&&e.accept.call(e.element[0],s.currentItem||s.element)&&t.ui.intersect(s,t.extend(e,{offset:e.element.offset()}),e.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}}}),t.ui.intersect=function(t,i,s){if(!i.offset)return!1;var n,o,a=(t.positionAbs||t.position.absolute).left,r=(t.positionAbs||t.position.absolute).top,h=a+t.helperProportions.width,l=r+t.helperProportions.height,c=i.offset.left,u=i.offset.top,d=c+i.proportions().width,p=u+i.proportions().height;switch(s){case"fit":return a>=c&&d>=h&&r>=u&&p>=l;case"intersect":return a+t.helperProportions.width/2>c&&d>h-t.helperProportions.width/2&&r+t.helperProportions.height/2>u&&p>l-t.helperProportions.height/2;case"pointer":return n=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,o=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,e(o,u,i.proportions().height)&&e(n,c,i.proportions().width);case"touch":return(r>=u&&p>=r||l>=u&&p>=l||u>r&&l>p)&&(a>=c&&d>=a||h>=c&&d>=h||c>a&&h>d);default:return!1}},t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;o.length>s;s++)if(!(o[s].options.disabled||e&&!o[s].accept.call(o[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===o[s].element[0]){o[s].proportions().height=0;continue t}o[s].visible="none"!==o[s].element.css("display"),o[s].visible&&("mousedown"===a&&o[s]._activate.call(o[s],i),o[s].offset=o[s].element.offset(),o[s].proportions({width:o[s].element[0].offsetWidth,height:o[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&t.ui.intersect(e,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,o,a=t.ui.intersect(e,this,this.options.tolerance),r=!a&&this.isover?"isout":a&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,o=this.element.parents(":data(ui-droppable)").filter(function(){return t.data(this,"ui-droppable").options.scope===n}),o.length&&(s=t.data(o[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}}}(jQuery),function(t){function e(t){return parseInt(t,10)||0}function i(t){return!isNaN(parseInt(t,10))}t.widget("ui.resizable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var e,i,s,n,o,a=this,r=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},i=0;e.length>i;i++)s=t.trim(e[i]),o="ui-resizable-"+s,n=t("<div class='ui-resizable-handle "+o+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=t(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),t(this.handles[i]).length},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){a.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(t(this).removeClass("ui-resizable-autohide"),a._handles.show())}).mouseleave(function(){r.disabled||a.resizing||(t(this).addClass("ui-resizable-autohide"),a._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,o,a=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=e(this.helper.css("left")),n=e(this.helper.css("top")),a.containment&&(s+=t(a.containment).scrollLeft()||0,n+=t(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,o=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===o?this.axis+"-resize":o),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(e){var i,s=this.helper,n={},o=this.originalMousePosition,a=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,c=this.size.height,u=e.pageX-o.left||0,d=e.pageY-o.top||0,p=this._change[a];return p?(i=p.apply(this,[e,u,d]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==c&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(n)||this._trigger("resize",e,this.ui()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&t.ui.hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,h=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),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,s,n,o,a,r=this.options;a={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=a.minHeight*this.aspectRatio,n=a.minWidth/this.aspectRatio,s=a.maxHeight*this.aspectRatio,o=a.maxWidth/this.aspectRatio,e>a.minWidth&&(a.minWidth=e),n>a.minHeight&&(a.minHeight=n),a.maxWidth>s&&(a.maxWidth=s),a.maxHeight>o&&(a.maxHeight=o)),this._vBoundaries=a},_updateCache:function(t){this.offset=this.helper.offset(),i(t.left)&&(this.position.left=t.left),i(t.top)&&(this.position.top=t.top),i(t.height)&&(this.size.height=t.height),i(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,s=this.size,n=this.axis;return i(t.height)?t.width=t.height*this.aspectRatio:i(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===n&&(t.left=e.left+(s.width-t.width),t.top=null),"nw"===n&&(t.top=e.top+(s.height-t.height),t.left=e.left+(s.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,s=this.axis,n=i(t.width)&&e.maxWidth&&e.maxWidth<t.width,o=i(t.height)&&e.maxHeight&&e.maxHeight<t.height,a=i(t.width)&&e.minWidth&&e.minWidth>t.width,r=i(t.height)&&e.minHeight&&e.minHeight>t.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,c=/sw|nw|w/.test(s),u=/nw|ne|n/.test(s);return a&&(t.width=e.minWidth),r&&(t.height=e.minHeight),n&&(t.width=e.maxWidth),o&&(t.height=e.maxHeight),a&&c&&(t.left=h-e.minWidth),n&&c&&(t.left=h-e.maxWidth),r&&u&&(t.top=l-e.minHeight),o&&u&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var t,e,i,s,n,o=this.helper||this.element;for(t=0;this._proportionallyResizeElements.length>t;t++){if(n=this._proportionallyResizeElements[t],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],e=0;i.length>e;e++)this.borderDif[e]=(parseInt(i[e],10)||0)+(parseInt(s[e],10)||0);n.css({height:o.height()-this.borderDif[0]-this.borderDif[2]||0,width:o.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,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","animate",{stop:function(e){var i=t(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&t.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=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;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={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)};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,o,a,r,h,l=t(this).data("ui-resizable"),c=l.options,u=l.element,d=c.containment,p=d instanceof t?d.get(0):/parent/.test(d)?u.parent().get(0):d;p&&(l.containerElement=t(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(i=t(p),s=[],t(["Top","Right","Left","Bottom"]).each(function(t,n){s[t]=e(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,o=l.containerSize.height,a=l.containerSize.width,r=t.ui.hasScroll(p,"left")?p.scrollWidth:a,h=t.ui.hasScroll(p)?p.scrollHeight:o,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(e){var i,s,n,o,a=t(this).data("ui-resizable"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio),a.position.top=a._helper?h.top:0),a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top,i=Math.abs((a._helper?a.offset.left-u.left:a.offset.left-u.left)+a.sizeDiff.width),s=Math.abs((a._helper?a.offset.top-u.top:a.offset.top-h.top)+a.sizeDiff.height),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o&&(i-=Math.abs(a.parentData.left)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio))},stop:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=function(e){t(e).each(function(){var e=t(this);e.data("ui-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 i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):t.each(i.alsoResize,function(t){s(t)})},resize:function(e,i){var s=t(this).data("ui-resizable"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0},h=function(e,s){t(e).each(function(){var e=t(this),n=t(this).data("ui-resizable-alsoresize"),o={},a=s&&s.length?s:e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(a,function(t,e){var i=(n[e]||0)+(r[e]||0);i&&i>=0&&(o[e]=i||null)}),e.css(o)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):t.each(n.alsoResize,function(t,e){h(t,e)})},stop:function(){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).data("ui-resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).data("ui-resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,a=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,c=Math.round((s.width-n.width)/h)*h,u=Math.round((s.height-n.height)/l)*l,d=n.width+c,p=n.height+u,f=i.maxWidth&&d>i.maxWidth,g=i.maxHeight&&p>i.maxHeight,m=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=h),v&&(p+=l),f&&(d-=h),g&&(p-=l),/^(se|s|e)$/.test(a)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.top=o.top-u):/^(sw)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.left=o.left-c):(p-l>0?(e.size.height=p,e.position.top=o.top-u):(e.size.height=l,e.position.top=o.top+n.height-l),d-h>0?(e.size.width=d,e.position.left=o.left-c):(e.size.width=h,e.position.left=o.left+n.width-h))}})}(jQuery),function(t){t.widget("ui.selectable",t.ui.mouse,{version:"1.10.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e=t(i.options.filter,i.element[0]),e.addClass("ui-selectee"),e.each(function(){var e=t(this),i=e.offset();t.data(this,"selectable-item",{element:this,$element:e,left:i.left,top:i.top,right:i.left+e.outerWidth(),bottom:i.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=e.addClass("ui-selectee"),this._mouseInit(),this.helper=t("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):undefined}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,o=this.opos[0],a=this.opos[1],r=e.pageX,h=e.pageY;return o>r&&(i=r,r=o,o=i),a>h&&(i=h,h=a,a=i),this.helper.css({left:o,top:a,width:r-o,height:h-a}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||o>i.right||i.top>h||a>i.bottom):"fit"===n.tolerance&&(l=i.left>o&&r>i.right&&i.top>a&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}})}(jQuery),function(t){function e(t,e,i){return t>e&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,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,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):undefined}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=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,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-t(document).scrollTop()<a.scrollSensitivity?r=t(document).scrollTop(t(document).scrollTop()-a.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<a.scrollSensitivity&&(r=t(document).scrollTop(t(document).scrollTop()+a.scrollSpeed)),e.pageX-t(document).scrollLeft()<a.scrollSensitivity?r=t(document).scrollLeft(t(document).scrollLeft()-a.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<a.scrollSensitivity&&(r=t(document).scrollLeft(t(document).scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;
+this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,o=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return n?this.floating?a&&"right"===a||"down"===o?2:1:o&&("down"===o?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&s||"left"===o&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(o=t(l[s]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&h.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?e.currentItem.children().each(function(){t("<td>&#160;</td>",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,o,a,r,h,l,c,u,d,p,f=null,g=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],g=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[g].containerCache.over||(this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1);else{for(a=1e4,r=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],o=this.items.length-1;o>=0;o--)t.contains(this.containers[g].element[0],this.items[o].item[0])&&this.items[o].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[o].top,this.items[o].height))&&(u=this.items[o].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[o][l]-c)&&(d=!0,u+=this.items[o][l]),a>Math.abs(u-c)&&(a=Math.abs(u-c),r=this.items[o],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[g])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[g].element,!0),this._trigger("change",s,this._uiHash()),this.containers[g]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[g],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})}(jQuery),function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,o){var a,r=o.re.exec(i),h=r&&o.parse(r),l=o.space||"rgba";return h?(a=s[l](h),s[c[l].cache]=a[c[l].cache],n=s._rgba=a._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,a,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,h],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),o=c[n],a=0===this.alpha()?l("transparent"):this,r=a[o.cache]||o.to(a._rgba),h=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],l=s[o],c=u[n.type]||{};null!==l&&(null===a?h[o]=l:(c.mod&&(l-a>c.mod/2?a+=c.mod:a-l>c.mod/2&&(a-=c.mod)),h[o]=i((l-a)*e+a,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,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()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),h=Math.min(s,n,o),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-o)/l+360:n===r?60*(o-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},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,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[a]&&(this[a]=h(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[a]=d,n):l(d)},f(o,function(e,i){l.fn[e]||(l.fn[e]=function(n){var o,a=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=l(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.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 i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function s(e,i){var s,n,a={};for(s in i)n=i[s],e[s]!==n&&(o[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(a[s]=n));return a}var n=["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,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,o,a,r){var h=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",l=h.children?a.find("*").addBack():a;l=l.map(function(){var e=t(this);return{el:e,start:i(this)}}),o=function(){t.each(n,function(t,i){e[i]&&a[i+"Class"](e[i])})},o(),l=l.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),a.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,o,a,r){return"boolean"==typeof n||n===e?o?t.effects.animateClass.call(this,n?{add:s}:{remove:s},o,a,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,o,a)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.4",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,o;for(o=0;s.length>o;o++)null!==s[o]&&(n=t.data(i+s[o]),n===e&&(n=""),t.css(s[o],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(o)&&o.call(n[0]),t.isFunction(e)&&e()}var n=t(this),o=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):a.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,o=i.queue,a=t.effects.effect[i.effect];return t.fx.off||!a?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):o===!1?this.each(e):this.queue(o||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=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,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()}(jQuery),function(t){var e=0,i={},s={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",s.height=s.paddingTop=s.paddingBottom=s.borderTopWidth=s.borderBottomWidth="show",t.widget("ui.accordion",{version:"1.10.4",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.options;this.prevShow=this.prevHide=t(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t(),content:this.active.length?this.active.next():t()}},_createIcons:function(){var e=this.options.icons;e&&(t("<span>").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"))
+},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),undefined):("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()),"disabled"===t&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!e),undefined)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:o=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[s-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=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,s=this.options,n=s.heightStyle,o=this.element.parent(),a=this.accordionId="ui-accordion-"+(this.element.attr("id")||++e);this.active=this._findActive(s.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(e){var i=t(this),s=i.attr("id"),n=i.next(),o=n.attr("id");s||(s=a+"-header-"+e,i.attr("id",s)),o||(o=a+"-panel-"+e,n.attr("id",o)),i.attr("aria-controls",o),n.attr("aria-labelledby",s)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(s.event),"fill"===n?(i=o.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.headers.each(function(){i-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===n&&(i=0,this.headers.next().each(function(){i=Math.max(i,t(this).css("height","").height())}).height(i))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n[0]===s[0],a=o&&i.collapsible,r=a?t():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:a?t():n,newPanel:r};e.preventDefault(),o&&!i.collapsible||this._trigger("beforeActivate",e,l)===!1||(i.active=a?!1:this.headers.index(n),this.active=o?t():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),o||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-hidden":"true"}),s.prev().attr("aria-selected","false"),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(t,e,n){var o,a,r,h=this,l=0,c=t.length&&(!e.length||t.index()<e.index()),u=this.options.animate||{},d=c&&u.down||u,p=function(){h._toggleComplete(n)};return"number"==typeof d&&(r=d),"string"==typeof d&&(a=d),a=a||d.easing||u.easing,r=r||d.duration||u.duration,e.length?t.length?(o=t.show().outerHeight(),e.animate(i,{duration:r,easing:a,step:function(t,e){e.now=Math.round(t)}}),t.hide().animate(s,{duration:r,easing:a,complete:p,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?l+=i.now:"content"!==h.options.heightStyle&&(i.now=Math.round(o-e.outerHeight()-l),l=0)}}),undefined):e.animate(i,r,a,p):t.animate(s,r,a,p)},_toggleComplete:function(t){var e=t.oldPanel;e.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}})}(jQuery),function(t){t.widget("ui.autocomplete",{version:"1.10.4",defaultElement:"<input>",options:{appendTo:null,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},requestIndex:0,pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),o="textarea"===n,a="input"===n;this.isMultiLine=o?!0:a?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,undefined;e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,this._keyEvent("previous",n);break;case o.DOWN:e=!0,this._keyEvent("next",n);break;case o.ENTER:case o.NUMPAD_ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case o.TAB:this.menu.active&&this.menu.select(n);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),undefined;if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,t.preventDefault(),undefined):(this._searchTimeout(t),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(t),this._change(t),undefined)}}),this._initSource(),this.menu=t("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];t(e.target).closest(".ui-menu-item").length||this._delay(function(){var e=this;this.document.one("mousedown",function(s){s.target===e.element[0]||s.target===i||t.contains(i,s.target)||e.close()})})},menufocus:function(e,i){if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)}),undefined;var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",e,{item:s})?e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=t("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e||(e=this.element.closest(".ui-front")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):this._trigger("search",e)!==!1?this._search(t):undefined},_search:function(t){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({label:e.label||e.value,value:e.value||e.label},e)})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<a>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this._value(this.term),this.menu.blur(),undefined):(this.menu[t](e),undefined):(this.search(null,e),undefined)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(t,e),e.preventDefault())}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.text(e))}})}(jQuery),function(t){var e,i="ui-button ui-widget ui-state-default ui-corner-all",s="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",n=function(){var e=t(this);setTimeout(function(){e.find(":ui-button").button("refresh")},1)},o=function(e){var i=e.name,s=e.form,n=t([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?t(s).find("[name='"+i+"']"):t("[name='"+i+"']",e.ownerDocument).filter(function(){return!this.form})),n};t.widget("ui.button",{version:"1.10.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,n),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var s=this,a=this.options,r="checkbox"===this.type||"radio"===this.type,h=r?"":"ui-state-active";null===a.label&&(a.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(i).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){a.disabled||this===e&&t(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){a.disabled||t(this).removeClass(h)}).bind("click"+this.eventNamespace,function(t){a.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),r&&this.element.bind("change"+this.eventNamespace,function(){s.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return a.disabled?!1:undefined}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(a.disabled)return!1;t(this).addClass("ui-state-active"),s.buttonElement.attr("aria-pressed","true");var e=s.element[0];o(e).not(e).map(function(){return t(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return a.disabled?!1:(t(this).addClass("ui-state-active"),e=this,s.document.one("mouseup",function(){e=null}),undefined)}).bind("mouseup"+this.eventNamespace,function(){return a.disabled?!1:(t(this).removeClass("ui-state-active"),undefined)}).bind("keydown"+this.eventNamespace,function(e){return a.disabled?!1:((e.keyCode===t.ui.keyCode.SPACE||e.keyCode===t.ui.keyCode.ENTER)&&t(this).addClass("ui-state-active"),undefined)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){t(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(e){e.keyCode===t.ui.keyCode.SPACE&&t(this).click()})),this._setOption("disabled",a.disabled),this._resetButton()},_determineButtonType:function(){var t,e,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(t=this.element.parents().last(),e="label[for='"+this.element.attr("id")+"']",this.buttonElement=t.find(e),this.buttonElement.length||(t=t.length?t.siblings():this.element.siblings(),this.buttonElement=t.filter(e),this.buttonElement.length||(this.buttonElement=t.find(e))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(i+" ui-state-active "+s).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(t,e){return this._super(t,e),"disabled"===t?(this.element.prop("disabled",!!e),e&&this.buttonElement.removeClass("ui-state-focus"),undefined):(this._resetButton(),undefined)},refresh:function(){var e=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");e!==this.options.disabled&&this._setOption("disabled",e),"radio"===this.type?o(this.element[0]).each(function(){t(this).is(":checked")?t(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):t(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),undefined;var e=this.buttonElement.removeClass(s),i=t("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(e.empty()).text(),n=this.options.icons,o=n.primary&&n.secondary,a=[];n.primary||n.secondary?(this.options.text&&a.push("ui-button-text-icon"+(o?"s":n.primary?"-primary":"-secondary")),n.primary&&e.prepend("<span class='ui-button-icon-primary ui-icon "+n.primary+"'></span>"),n.secondary&&e.append("<span class='ui-button-icon-secondary ui-icon "+n.secondary+"'></span>"),this.options.text||(a.push(o?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||e.attr("title",t.trim(i)))):a.push("ui-button-text-only"),e.addClass(a.join(" "))}}),t.widget("ui.buttonset",{version:"1.10.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(t,e){"disabled"===t&&this.buttons.button("option",t,e),this._super(t,e)},refresh:function(){var e="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(e?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(e?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})}(jQuery),function(t,e){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.dpDiv=s(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function s(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(i,"mouseout",function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){t.datepicker._isDisabledDatepicker(o.inline?e.parent()[0]:o.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))})}function n(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}t.extend(t.ui,{datepicker:{version:"1.10.4"}});var o,a="datepicker";t.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return n(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,o;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),o=this._newInst(t(e),n),o.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,o):n&&this._inlineDatepicker(e,o)},_newInst:function(e,i){var n=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:n,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?s(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),t.data(e,a,i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,o,a=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=t("<span class='"+this._appendClass+"'>"+a+"</span>"),e[r?"before":"after"](i.append)),e.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:o,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(o?t("<img/>").attr({src:o,alt:n,title:n}):n)),e[r?"before":"after"](i.trigger),i.trigger.click(function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,o=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,a,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,o,r){var h,l,c,u,d,p=this._dialogInst;return p||(this.uuid+=1,h="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+h+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),t("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},t.data(this._dialogInput[0],a,p)),n(p.settings,o||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=r?r.length?r:[r.pageX,r.pageY]:null,this._pos||(l=document.documentElement.clientWidth,c=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[l/2-100+u,c/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],a,p),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,a);s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,a),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty())},_enableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,a);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,a);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,a)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,s,o){var a,r,h,l,c=this._getInst(i);return 2===arguments.length&&"string"==typeof s?"defaults"===s?t.extend({},t.datepicker._defaults):c?"all"===s?t.extend({},c.settings):this._get(c,s):null:(a=s||{},"string"==typeof s&&(a={},a[s]=o),c&&(this._curInst===c&&this._hideDatepicker(),r=this._getDateDatepicker(i,!0),h=this._getMinMaxDate(c,"min"),l=this._getMinMaxDate(c,"max"),n(c.settings,a),null!==h&&a.dateFormat!==e&&a.minDate===e&&(c.settings.minDate=this._formatDate(c,h)),null!==l&&a.dateFormat!==e&&a.maxDate===e&&(c.settings.maxDate=this._formatDate(c,l)),"disabled"in a&&(a.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(t(i),c),this._autoSize(c),this._setDate(c,r),this._updateAlternate(c),this._updateDatepicker(c)),e)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,o=t.datepicker._getInst(e.target),a=!0,r=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",o.dpDiv),n[0]&&t.datepicker._selectDay(e.target,o.selectedMonth,o.selectedYear,n[0]),i=t.datepicker._get(o,"onSelect"),i?(s=t.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[s,o])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");
+break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(i){var s,n,o=t.datepicker._getInst(i.target);return t.datepicker._get(o,"constrainInput")?(s=t.datepicker._possibleChars(t.datepicker._get(o,"dateFormat")),n=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">n||!s||s.indexOf(n)>-1):e},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var i,s,o,a,r,h,l;i=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==i&&(t.datepicker._curInst.dpDiv.stop(!0,!0),i&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),s=t.datepicker._get(i,"beforeShow"),o=s?s.apply(e,[e,i]):{},o!==!1&&(n(i.settings,o),i.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(i),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),a=!1,t(e).parents().each(function(){return a|="fixed"===t(this).css("position"),!a}),r={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(i),r=t.datepicker._checkOffset(i,r,a),i.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":a?"fixed":"absolute",display:"none",left:r.left+"px",top:r.top+"px"}),i.inline||(h=t.datepicker._get(i,"showAnim"),l=t.datepicker._get(i,"duration"),i.dpDiv.zIndex(t(e).zIndex()+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[h]?i.dpDiv.show(h,t.datepicker._get(i,"showOptions"),l):i.dpDiv[h||"show"](h?l:null),t.datepicker._shouldFocusInput(i)&&i.input.focus(),t.datepicker._curInst=i))}},_updateDatepicker:function(e){this.maxRows=4,o=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,s=this._getNumberOfMonths(e),n=s[1],a=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.focus(),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),o=e.dpDiv.outerHeight(),a=e.input?e.input.outerWidth():0,r=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-a:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+r?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+o>l&&l>o?Math.abs(o+r):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,o,r=this._curInst;!r||e&&r!==t.data(e,a)||this._datepickerShowing&&(i=this._get(r,"showAnim"),s=this._get(r,"duration"),n=function(){t.datepicker._tidyDialog(r)},t.effects&&(t.effects.effect[i]||t.effects[i])?r.dpDiv.hide(i,t.datepicker._get(r,"showOptions"),s,n):r.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,o=this._get(r,"onClose"),o&&o.apply(r.input?r.input[0]:null,[r.input?r.input.val():"",r]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),o=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(o,i+("M"===s?this._get(o,"showCurrentAtPos"):0),s),this._updateDatepicker(o))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),o=this._getInst(n[0]);o["selected"+("M"===s?"Month":"Year")]=o["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(n)},_selectDay:function(e,i,s,n){var o,a=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||(o=this._getInst(a[0]),o.selectedDay=o.currentDay=t("a",n).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=s,this._selectDate(e,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),o=this._getInst(n[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),s=this._get(o,"onSelect"),s?s.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger("change"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],"object"!=typeof o.input[0]&&o.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,o=this._get(e,"altField");o&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(o).each(function(){t(this).val(n)}))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(i,s,n){if(null==i||null==s)throw"Invalid arguments";if(s="object"==typeof s?""+s:s+"",""===s)return null;var o,a,r,h,l=0,c=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof c?c:(new Date).getFullYear()%100+parseInt(c,10),d=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,p=(n?n.dayNames:null)||this._defaults.dayNames,f=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,g=(n?n.monthNames:null)||this._defaults.monthNames,m=-1,v=-1,_=-1,b=-1,y=!1,w=function(t){var e=i.length>o+1&&i.charAt(o+1)===t;return e&&o++,e},x=function(t){var e=w(t),i="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n=RegExp("^\\d{1,"+i+"}"),o=s.substring(l).match(n);if(!o)throw"Missing number at position "+l;return l+=o[0].length,parseInt(o[0],10)},k=function(i,n,o){var a=-1,r=t.map(w(i)?o:n,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(r,function(t,i){var n=i[1];return s.substr(l,n.length).toLowerCase()===n.toLowerCase()?(a=i[0],l+=n.length,!1):e}),-1!==a)return a+1;throw"Unknown name at position "+l},D=function(){if(s.charAt(l)!==i.charAt(o))throw"Unexpected literal at position "+l;l++};for(o=0;i.length>o;o++)if(y)"'"!==i.charAt(o)||w("'")?D():y=!1;else switch(i.charAt(o)){case"d":_=x("d");break;case"D":k("D",d,p);break;case"o":b=x("o");break;case"m":v=x("m");break;case"M":v=k("M",f,g);break;case"y":m=x("y");break;case"@":h=new Date(x("@")),m=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"!":h=new Date((x("!")-this._ticksTo1970)/1e4),m=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"'":w("'")?D():y=!0;break;default:D()}if(s.length>l&&(r=s.substr(l),!/^\s+/.test(r)))throw"Extra/unparsed characters found in date: "+r;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),b>-1)for(v=1,_=b;;){if(a=this._getDaysInMonth(m,v-1),a>=_)break;v++,_-=a}if(h=this._daylightSavingAdjust(new Date(m,v-1,_)),h.getFullYear()!==m||h.getMonth()+1!==v||h.getDate()!==_)throw"Invalid date";return h},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,o=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},l=function(t,e,i){var s=""+e;if(h(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return h(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||h("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=l("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,o);break;case"o":u+=l("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=l("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),a,r);break;case"y":u+=h("y")?e.getFullYear():(10>e.getYear()%100?"0":"")+e.getYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":h("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,i){return t.settings[i]!==e?t.settings[i]:this._defaults[i]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(r){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},o=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,o=n.getFullYear(),a=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":a+=parseInt(l[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a));break;case"y":case"Y":o+=parseInt(l[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a))}l=h.exec(i)}return new Date(o,a,r)},a=null==i||""===i?s:"string"==typeof i?o(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return a=a&&"Invalid Date"==""+a?s:a,a&&(a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)),this._daylightSavingAdjust(a)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,a=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=a.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=a.getMonth(),t.drawYear=t.selectedYear=t.currentYear=a.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(s,-i,"M")},next:function(){t.datepicker._adjustDate(s,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(s)},selectDay:function(){return t.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,h,l,c,u,d,p,f,g,m,v,_,b,y,w,x,k,D,C,I,P,T,M,S,z,A,E,H,N,W,O,F,R,L=new Date,j=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),Y=this._get(t,"isRTL"),B=this._get(t,"showButtonPanel"),V=this._get(t,"hideIfNoPrevNext"),K=this._get(t,"navigationAsDateFormat"),q=this._getNumberOfMonths(t),U=this._get(t,"showCurrentAtPos"),Q=this._get(t,"stepMonths"),X=1!==q[0]||1!==q[1],$=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),G=this._getMinMaxDate(t,"min"),J=this._getMinMaxDate(t,"max"),Z=t.drawMonth-U,te=t.drawYear;if(0>Z&&(Z+=12,te--),J)for(e=this._daylightSavingAdjust(new Date(J.getFullYear(),J.getMonth()-q[0]*q[1]+1,J.getDate())),e=G&&G>e?G:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-Q,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":V?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+Q,1)),this._getFormatConfig(t)):n,o=this._canAdjustMonth(t,1,te,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":V?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",a=this._get(t,"currentText"),r=this._get(t,"gotoCurrent")&&t.currentDay?$:j,a=K?this.formatDate(a,r,this._getFormatConfig(t)):a,h=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(t,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(Y?"":h)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),g=this._get(t,"monthNamesShort"),m=this._get(t,"beforeShowDay"),v=this._get(t,"showOtherMonths"),_=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",x=0;q[0]>x;x++){for(k="",this.maxRows=4,D=0;q[1]>D;D++){if(C=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),I=" ui-corner-all",P="",X){if(P+="<div class='ui-datepicker-group",q[1]>1)switch(D){case 0:P+=" ui-datepicker-group-first",I=" ui-corner-"+(Y?"right":"left");break;case q[1]-1:P+=" ui-datepicker-group-last",I=" ui-corner-"+(Y?"left":"right");break;default:P+=" ui-datepicker-group-middle",I=""}P+="'>"}for(P+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+I+"'>"+(/all|left/.test(I)&&0===x?Y?o:s:"")+(/all|right/.test(I)&&0===x?Y?s:o:"")+this._generateMonthYearHeader(t,Z,te,G,J,x>0||D>0,f,g)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",T=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;7>w;w++)M=(w+c)%7,T+="<th"+((w+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[M]+"'>"+p[M]+"</span></th>";for(P+=T+"</tr></thead><tbody>",S=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,S)),z=(this._getFirstDayOfMonth(te,Z)-c+7)%7,A=Math.ceil((z+S)/7),E=X?this.maxRows>A?this.maxRows:A:A,this.maxRows=E,H=this._daylightSavingAdjust(new Date(te,Z,1-z)),N=0;E>N;N++){for(P+="<tr>",W=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(H)+"</td>":"",w=0;7>w;w++)O=m?m.apply(t.input?t.input[0]:null,[H]):[!0,""],F=H.getMonth()!==Z,R=F&&!_||!O[0]||G&&G>H||J&&H>J,W+="<td class='"+((w+c+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(H.getTime()===C.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===H.getTime()&&b.getTime()===C.getTime()?" "+this._dayOverClass:"")+(R?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!v?"":" "+O[1]+(H.getTime()===$.getTime()?" "+this._currentClass:"")+(H.getTime()===j.getTime()?" ui-datepicker-today":""))+"'"+(F&&!v||!O[2]?"":" title='"+O[2].replace(/'/g,"&#39;")+"'")+(R?"":" data-handler='selectDay' data-event='click' data-month='"+H.getMonth()+"' data-year='"+H.getFullYear()+"'")+">"+(F&&!v?"&#xa0;":R?"<span class='ui-state-default'>"+H.getDate()+"</span>":"<a class='ui-state-default"+(H.getTime()===j.getTime()?" ui-state-highlight":"")+(H.getTime()===$.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+H.getDate()+"</a>")+"</td>",H.setDate(H.getDate()+1),H=this._daylightSavingAdjust(H);P+=W+"</tr>"}Z++,Z>11&&(Z=0,te++),P+="</tbody></table>"+(X?"</div>"+(q[0]>0&&D===q[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=P}y+=k}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var h,l,c,u,d,p,f,g,m=this._get(t,"changeMonth"),v=this._get(t,"changeYear"),_=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(o||!m)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!h||c>=s.getMonth())&&(!l||n.getMonth()>=c)&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(_||(b+=y+(!o&&m&&v?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",o||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e},f=p(u[0]),g=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,g=n?Math.min(g,n.getFullYear()):g,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";g>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),_&&(b+=(!o&&m&&v?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.drawYear+("Y"===i?e:0),n=t.drawMonth+("M"===i?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,o)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_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,i,s){var n=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),o=this._getMinMaxDate(t,"max"),a=null,r=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),a=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(a+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||e.getTime()>=n.getTime())&&(!o||e.getTime()<=o.getTime())&&(!a||e.getFullYear()>=a)&&(!r||r>=e.getFullYear())},_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,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).mousedown(t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new i,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.10.4"}(jQuery),function(t){var e={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.10.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;0>i&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).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},disable:t.noop,enable:t.noop,close:function(e){var i,s=this;if(this._isOpen&&this._trigger("beforeClose",e)!==!1){if(this._isOpen=!1,this._destroyOverlay(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&t(i).blur()}catch(n){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",e)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!e&&this._trigger("focus",t),i},open:function(){var e=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),undefined):(this._isOpen=!0,this.opener=t(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._trigger("open"),undefined)},_focusTabbable:function(){var t=this.element.find("[autofocus]");t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).focus()},_keepFocus:function(e){function i(){var e=this.document[0].activeElement,i=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);i||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),this.close(e),undefined;if(e.keyCode===t.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(n.focus(1),e.preventDefault()):(s.focus(1),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=t("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(e),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title||t.html("&#160;"),t.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),undefined):(t.each(i,function(i,s){var n,o;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(e.element[0],arguments)},o={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,t("<button></button>",s).button(o).appendTo(e.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),undefined)},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){t(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,o){s.position=[o.position.left-i.document.scrollLeft(),o.position.top-i.document.scrollTop()],t(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,e(o))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,s=this.options,n=s.resizable,o=this.uiDialog.css("position"),a="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:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:a,start:function(s,n){t(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function(n,o){s.height=t(this).height(),s.width=t(this).width(),t(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,e(o))}}).css("position",o)},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(s){var n=this,o=!1,a={};t.each(s,function(t,s){n._setOption(t,s),t in e&&(o=!0),t in i&&(a[t]=s)}),o&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",a)},_setOption:function(t,e){var i,s,n=this.uiDialog;"dialogClass"===t&&n.removeClass(this.options.dialogClass).addClass(e),"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:""+e}),"draggable"===t&&(i=n.is(":data(ui-draggable)"),i&&!e&&n.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&(s=n.is(":data(ui-resizable)"),s&&!e&&n.resizable("destroy"),s&&"string"==typeof e&&n.resizable("option","handles",e),s||e===!1||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return t(e.target).closest(".ui-dialog").length?!0:!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=this,i=this.widgetFullName;t.ui.dialog.overlayInstances||this._delay(function(){t.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(s){e._allowInteraction(s)||(s.preventDefault(),t(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=t("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),t.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(t.ui.dialog.overlayInstances--,t.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),t.ui.dialog.overlayInstances=0,t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{_position:function(){var e,i=this.options.position,s=[],n=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(s=i.split?i.split(" "):[i[0],i[1]],1===s.length&&(s[1]=s[0]),t.each(["left","top"],function(t,e){+s[t]===s[t]&&(n[t]=s[t],s[t]=e)}),i={my:s[0]+(0>n[0]?n[0]:"+"+n[0])+" "+s[1]+(0>n[1]?n[1]:"+"+n[1]),at:s.join(" ")}),i=t.extend({},t.ui.dialog.prototype.options.position,i)):i=t.ui.dialog.prototype.options.position,e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.position(i),e||this.uiDialog.hide()}})}(jQuery),function(t){var e=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(s,n){var o,a,r,h=t(this),l=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(h,s.mode||"hide"),u=s.direction||"up",d=e.test(u),p=d?"height":"width",f=d?"top":"left",g=i.test(u),m={},v="show"===c;h.parent().is(".ui-effects-wrapper")?t.effects.save(h.parent(),l):t.effects.save(h,l),h.show(),o=t.effects.createWrapper(h).css({overflow:"hidden"}),a=o[p](),r=parseFloat(o.css(f))||0,m[p]=v?a:0,g||(h.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),m[f]=v?r:a+r),v&&(o.css(p,0),g||o.css(f,r+a)),o.animate(m,{duration:s.duration,easing:s.easing,queue:!1,complete:function(){"hide"===c&&h.hide(),t.effects.restore(h,l),t.effects.removeWrapper(h),n()}})}}(jQuery),function(t){t.effects.effect.bounce=function(e,i){var s,n,o,a=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(a,e.mode||"effect"),l="hide"===h,c="show"===h,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||l?1:0),g=e.duration/f,m=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=a.queue(),y=b.length;for((c||l)&&r.push("opacity"),t.effects.save(a,r),a.show(),t.effects.createWrapper(a),d||(d=a["top"===v?"outerHeight":"outerWidth"]()/3),c&&(o={opacity:1},o[v]=0,a.css("opacity",0).css(v,_?2*-d:2*d).animate(o,g,m)),l&&(d/=Math.pow(2,p-1)),o={},o[v]=0,s=0;p>s;s++)n={},n[v]=(_?"-=":"+=")+d,a.animate(n,g,m).animate(o,g,m),d=l?2*d:d/2;l&&(n={opacity:0},n[v]=(_?"-=":"+=")+d,a.animate(n,g,m)),a.queue(function(){l&&a.hide(),t.effects.restore(a,r),t.effects.removeWrapper(a),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),a.dequeue()}}(jQuery),function(t){t.effects.effect.clip=function(e,i){var s,n,o,a=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(a,e.mode||"hide"),l="show"===h,c=e.direction||"vertical",u="vertical"===c,d=u?"height":"width",p=u?"top":"left",f={};t.effects.save(a,r),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n="IMG"===a[0].tagName?s:a,o=n[d](),l&&(n.css(d,0),n.css(p,o/2)),f[d]=l?o:0,f[p]=l?0:o/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){l||a.hide(),t.effects.restore(a,r),t.effects.removeWrapper(a),i()}})}}(jQuery),function(t){t.effects.effect.drop=function(e,i){var s,n=t(this),o=["position","top","bottom","left","right","opacity","height","width"],a=t.effects.setMode(n,e.mode||"hide"),r="show"===a,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,o),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===c?-s:s),u[l]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&n.hide(),t.effects.restore(n,o),t.effects.removeWrapper(n),i()}})}}(jQuery),function(t){t.effects.effect.explode=function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),g||p.hide(),i()}var o,a,r,h,l,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=t.effects.setMode(p,e.mode||"hide"),g="show"===f,m=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),_=Math.ceil(p.outerHeight()/u),b=[];for(o=0;u>o;o++)for(h=m.top+o*_,c=o-(u-1)/2,a=0;d>a;a++)r=m.left+a*v,l=a-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-a*v,top:-o*_}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:_,left:r+(g?l*v:0),top:h+(g?c*_:0),opacity:g?0:1}).animate({left:r+(g?0:l*v),top:h+(g?0:c*_),opacity:g?1:0},e.duration||500,e.easing,s)}}(jQuery),function(t){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}}(jQuery),function(t){t.effects.effect.fold=function(e,i){var s,n,o=t(this),a=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(o,e.mode||"hide"),h="show"===r,l="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=h!==d,f=p?["width","height"]:["height","width"],g=e.duration/2,m={},v={};t.effects.save(o,a),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[l?0:1]),h&&s.css(d?{height:0,width:c}:{height:c,width:0}),m[f[0]]=h?n[0]:c,v[f[1]]=h?n[1]:0,s.animate(m,g,e.easing).animate(v,g,e.easing,function(){l&&o.hide(),t.effects.restore(o,a),t.effects.removeWrapper(o),i()})}}(jQuery),function(t){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],o=t.effects.setMode(s,e.mode||"show"),a={backgroundColor:s.css("backgroundColor")};"hide"===o&&(a.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(a,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&s.hide(),t.effects.restore(s,n),i()}})}}(jQuery),function(t){t.effects.effect.pulsate=function(e,i){var s,n=t(this),o=t.effects.setMode(n,e.mode||"show"),a="show"===o,r="hide"===o,h=a||"hide"===o,l=2*(e.times||5)+(h?1:0),c=e.duration/l,u=0,d=n.queue(),p=d.length;for((a||!n.is(":visible"))&&(n.css("opacity",0).show(),u=1),s=1;l>s;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,l+1))),n.dequeue()}}(jQuery),function(t){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),o="hide"===n,a=parseInt(e.percent,10)||150,r=a/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:o?a:100,from:o?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),o=t.effects.setMode(s,e.mode||"effect"),a=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===o?0:100),r=e.direction||"both",h=e.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c={y:"horizontal"!==r?a/100:1,x:"vertical"!==r?a/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==o&&(n.origin=h||["middle","center"],n.restore=!0),n.from=e.from||("show"===o?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*c.y,width:l.width*c.x,outerHeight:l.outerHeight*c.y,outerWidth:l.outerWidth*c.x},n.fade&&("show"===o&&(n.from.opacity=0,n.to.opacity=1),"hide"===o&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,o,a=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],c=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(a,e.mode||"effect"),f=e.restore||"effect"!==p,g=e.scale||"both",m=e.origin||["middle","center"],v=a.css("position"),_=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&a.show(),s={height:a.height(),width:a.width(),outerHeight:a.outerHeight(),outerWidth:a.outerWidth()},"toggle"===e.mode&&"show"===p?(a.from=e.to||b,a.to=e.from||s):(a.from=e.from||("show"===p?b:s),a.to=e.to||("hide"===p?b:s)),o={from:{y:a.from.height/s.height,x:a.from.width/s.width},to:{y:a.to.height/s.height,x:a.to.width/s.width}},("box"===g||"both"===g)&&(o.from.y!==o.to.y&&(_=_.concat(u),a.from=t.effects.setTransition(a,u,o.from.y,a.from),a.to=t.effects.setTransition(a,u,o.to.y,a.to)),o.from.x!==o.to.x&&(_=_.concat(d),a.from=t.effects.setTransition(a,d,o.from.x,a.from),a.to=t.effects.setTransition(a,d,o.to.x,a.to))),("content"===g||"both"===g)&&o.from.y!==o.to.y&&(_=_.concat(c).concat(l),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,_),a.show(),t.effects.createWrapper(a),a.css("overflow","hidden").css(a.from),m&&(n=t.effects.getBaseline(m,s),a.from.top=(s.outerHeight-a.outerHeight())*n.y,a.from.left=(s.outerWidth-a.outerWidth())*n.x,a.to.top=(s.outerHeight-a.to.outerHeight)*n.y,a.to.left=(s.outerWidth-a.to.outerWidth)*n.x),a.css(a.from),("content"===g||"both"===g)&&(u=u.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),l=r.concat(u).concat(d),a.find("*[width]").each(function(){var i=t(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&t.effects.save(i,l),i.from={height:s.height*o.from.y,width:s.width*o.from.x,outerHeight:s.outerHeight*o.from.y,outerWidth:s.outerWidth*o.from.x},i.to={height:s.height*o.to.y,width:s.width*o.to.x,outerHeight:s.height*o.to.y,outerWidth:s.width*o.to.x},o.from.y!==o.to.y&&(i.from=t.effects.setTransition(i,u,o.from.y,i.from),i.to=t.effects.setTransition(i,u,o.to.y,i.to)),o.from.x!==o.to.x&&(i.from=t.effects.setTransition(i,d,o.from.x,i.from),i.to=t.effects.setTransition(i,d,o.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){f&&t.effects.restore(i,l)})})),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,_),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,i){var s=parseInt(i,10),n=t?a.to.left:a.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(a),i()}})}}(jQuery),function(t){t.effects.effect.shake=function(e,i){var s,n=t(this),o=["position","top","bottom","left","right","height","width"],a=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",h=e.distance||20,l=e.times||3,c=2*l+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},g={},m={},v=n.queue(),_=v.length;for(t.effects.save(n,o),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+h,g[d]=(p?"+=":"-=")+2*h,m[d]=(p?"-=":"+=")+2*h,n.animate(f,u,e.easing),s=1;l>s;s++)n.animate(g,u,e.easing).animate(m,u,e.easing);n.animate(g,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===a&&n.hide(),t.effects.restore(n,o),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}}(jQuery),function(t){t.effects.effect.slide=function(e,i){var s,n=t(this),o=["position","top","bottom","left","right","width","height"],a=t.effects.setMode(n,e.mode||"show"),r="show"===a,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u={};t.effects.save(n,o),n.show(),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,c?isNaN(s)?"-"+s:-s:s),u[l]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&n.hide(),t.effects.restore(n,o),t.effects.removeWrapper(n),i()}})}}(jQuery),function(t){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),o="fixed"===n.css("position"),a=t("body"),r=o?a.scrollTop():0,h=o?a.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}}(jQuery),function(t){t.widget("ui.menu",{version:"1.10.4",defaultElement:"<ul>",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.mouseHandled=!1,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.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&t(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){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 i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,o,a,r,h=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:h=!1,n=this.previousFilter||"",o=String.fromCharCode(e.keyCode),a=!1,clearTimeout(this.filterTimer),o===n?a=!0:o=n+o,r=RegExp("^"+i(o),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=a&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(o=String.fromCharCode(e.keyCode),r=RegExp("^"+i(o),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=o,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&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,i=this.options.icons.submenu,s=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),s.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),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.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);/[^\-\u2014\u2013\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]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.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),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,o,a,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(o+n):n+r>a&&this.activeMenu.scrollTop(o+n-a+r))},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 i=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(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},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,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})}(jQuery),function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var o,a=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(o!==e)return o;var i,s,n=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=n.children()[0];return t("body").append(n),i=a.offsetWidth,n.css("overflow","scroll"),s=a.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),o=i-s},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,o="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:o?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var o,p,g,m,v,_,b=t(e.of),y=t.position.getWithinInfo(e.within),w=t.position.getScrollInfo(y),x=(e.collision||"flip").split(" "),k={};return _=n(b),b[0].preventDefault&&(e.at="left top"),p=_.width,g=_.height,m=_.offset,v=t.extend({},m),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=l.test(s[0])?s.concat(["center"]):c.test(s[0])?["center"].concat(s):["center","center"]),s[0]=l.test(s[0])?s[0]:"center",s[1]=c.test(s[1])?s[1]:"center",t=u.exec(s[0]),i=u.exec(s[1]),k[this]=[t?t[0]:0,i?i[0]:0],e[this]=[d.exec(s[0])[0],d.exec(s[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===e.at[0]?v.left+=p:"center"===e.at[0]&&(v.left+=p/2),"bottom"===e.at[1]?v.top+=g:"center"===e.at[1]&&(v.top+=g/2),o=i(k.at,p,g),v.left+=o[0],v.top+=o[1],this.each(function(){var n,l,c=t(this),u=c.outerWidth(),d=c.outerHeight(),f=s(this,"marginLeft"),_=s(this,"marginTop"),D=u+f+s(this,"marginRight")+w.width,C=d+_+s(this,"marginBottom")+w.height,I=t.extend({},v),P=i(k.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?I.left-=u:"center"===e.my[0]&&(I.left-=u/2),"bottom"===e.my[1]?I.top-=d:"center"===e.my[1]&&(I.top-=d/2),I.left+=P[0],I.top+=P[1],t.support.offsetFractions||(I.left=h(I.left),I.top=h(I.top)),n={marginLeft:f,marginTop:_},t.each(["left","top"],function(i,s){t.ui.position[x[i]]&&t.ui.position[x[i]][s](I,{targetWidth:p,targetHeight:g,elemWidth:u,elemHeight:d,collisionPosition:n,collisionWidth:D,collisionHeight:C,offset:[o[0]+P[0],o[1]+P[1]],my:e.my,at:e.at,within:y,elem:c})}),e.using&&(l=function(t){var i=m.left-I.left,s=i+p-u,n=m.top-I.top,o=n+g-d,h={target:{element:b,left:m.left,top:m.top,width:p,height:g},element:{element:c,left:I.left,top:I.top,width:u,height:d},horizontal:0>s?"left":i>0?"right":"center",vertical:0>o?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(h.horizontal="center"),d>g&&g>r(n+o)&&(h.vertical="middle"),h.important=a(r(i),r(s))>a(r(n),r(o))?"horizontal":"vertical",e.using.call(this,t,h)}),c.offset(t.extend(I,{using:l}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,o=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-o-n;e.collisionWidth>o?h>0&&0>=l?(i=t.left+h+e.collisionWidth-o-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+o-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=a(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,o=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-o-n;e.collisionHeight>o?h>0&&0>=l?(i=t.top+h+e.collisionHeight-o-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+o-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=a(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,a=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-a-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-a-o,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,a=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-a-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-a-o,t.top+p+f+g>c&&(0>s||r(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-h,t.top+p+f+g>u&&(i>0||u>r(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,o,a=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(a?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},a&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)e.style[o]=s[o];e.appendChild(r),i=a||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()}(jQuery),function(t,e){t.widget("ui.progressbar",{version:"1.10.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()
+},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})}(jQuery),function(t){var e=5;t.widget("ui.slider",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",a=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)a.push(o);this.handles=n.add(t(a.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,o,a,r,h,l,c=this,u=this.options;return u.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-c.values(e));(n>i||n===i&&(e===c._lastChangedValue||c.values(e)===u.min))&&(n=i,o=t(this),a=e)}),r=this._start(e,a),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=a,o.addClass("ui-state-active").focus(),h=o.offset(),l=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-h.left-o.width()/2,top:e.pageY-h.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,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!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,i,s,n,o;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),o=this._valueMin()+s*n,this._trimAlignValue(o)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,o;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,o=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),o!==!1&&this.values(e,i))):i!==this.value()&&(o=this._trigger("slide",t,{handle:this.handles[e],value:i}),o!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(e,i){var s,n,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),undefined;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(s=this.options.values,n=arguments[0],o=0;s.length>o;o+=1)s[o]=this._trimAlignValue(n[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,o,a=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,c={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),c["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](c,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),o=this._valueMax(),i=o!==n?100*((s-n)/(o-n)):0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](c,r.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===a&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===a&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var s,n,o,a,r=t(i.target).data("ui-slider-handle-index");switch(i.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(i.target).addClass("ui-state-active"),s=this._start(i,r),s===!1))return}switch(a=this.options.step,n=o=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case t.ui.keyCode.HOME:o=this._valueMin();break;case t.ui.keyCode.END:o=this._valueMax();break;case t.ui.keyCode.PAGE_UP:o=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.PAGE_DOWN:o=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;o=this._trimAlignValue(n+a);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;o=this._trimAlignValue(n-a)}this._slide(i,r,o)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})}(jQuery),function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.10.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());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 i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,this.element.val(this._format(i)),void 0}("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(e.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(e.down)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(e(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})}(jQuery),function(t,e){function i(){return++n}function s(t){return t=t.cloneNode(!1),t.hash.length>1&&decodeURIComponent(t.href.replace(o,""))===decodeURIComponent(location.href.replace(o,""))}var n=0,o=/#.*$/;t.widget("ui.tabs",{version:"1.10.4",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,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.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(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,o){return t(o).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),o=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:o=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,o),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"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(i,n){var o,a,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),c=l.attr("aria-controls");s(n)?(o=n.hash,a=e.element.find(e._sanitizeSelector(o))):(r=e._tabId(l),o="#"+r,a=e.element.find(o),a.length||(a=e._createPanel(r),a.insertAfter(e.panels[i-1]||e.tablist)),a.attr("aria-live","polite")),a.length&&(e.panels=e.panels.add(a)),c&&l.data("ui-tabs-aria-controls",c),l.attr({"aria-controls":o.substring(1),"aria-labelledby":h}),a.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").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 i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n.closest("li"),a=o[0]===s[0],r=a&&i.collapsible,h=r?t():this._getPanelForTab(o),l=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:l,newTab:r?t():o,newPanel:h};e.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(o),this.active=a?t():o,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(o),e),this._toggle(e,c))},_toggle:function(e,i){function s(){o.running=!1,o._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),a.length&&o.options.show?o._show(a,o.options.show,s):(a.show(),s())}var o=this,a=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),a.length&&r.length?i.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(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").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),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,o=this.tabs.eq(e),a=o.find(".ui-tabs-anchor"),r=this._getPanelForTab(o),h={tab:o,panel:r};s(a[0])||(this.xhr=t.ajax(this._ajaxSettings(a,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(o.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),o.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,o){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:o},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})}(jQuery),function(t){function e(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))}function i(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")}var s=0;t.widget("ui.tooltip",{version:"1.10.4",options:{content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},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,i){var s=this;return"disabled"===e?(this[i?"_disable":"_enable"](),this.options[e]=i,void 0):(this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)}),void 0)},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().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).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;
+return"string"==typeof s?this._open(e,t,s):(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=o),this._open(e,t,i)})}),i&&this._open(e,t,i),void 0)},_open:function(i,s,n){function o(t){l.of=t,a.is(":hidden")||a.position(l)}var a,r,h,l=t.extend({},this.options.position);if(n){if(a=this._find(s),a.length)return a.find(".ui-tooltip-content").html(n),void 0;s.is("[title]")&&(i&&"mouseover"===i.type?s.attr("title",""):s.removeAttr("title")),a=this._tooltip(s),e(s,a.attr("id")),a.find(".ui-tooltip-content").html(n),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:o}),o(i)):a.position(t.extend({of:s},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){a.is(":visible")&&(o(l.of),clearInterval(h))},t.fx.interval)),this._trigger("open",i,{tooltip:a}),r={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var i=t.Event(e);i.currentTarget=s[0],this.close(i,!0)}},remove:function(){this._removeTooltip(a)}},i&&"mouseover"!==i.type||(r.mouseleave="close"),i&&"focusin"!==i.type||(r.focusout="close"),this._on(!0,s,r)}},close:function(e){var s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);this.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&n.attr("title",n.data("ui-tooltip-title")),i(n),o.stop(!0),this._hide(o,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:o}),this.closing=!1)},_tooltip:function(e){var i="ui-tooltip-"+s++,n=t("<div>").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("<div>").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[i]=e,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})}(jQuery); \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/jquery/jquery.js b/framework/Web/Javascripts/source/jquery/jquery.js
new file mode 100644
index 00000000..3c88fa8b
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/jquery.js
@@ -0,0 +1,10337 @@
+/*!
+ * jQuery JavaScript Library v1.11.0
+ * http://jquery.com/
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ *
+ * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2014-01-23T21:02Z
+ */
+
+(function( global, factory ) {
+
+ if ( typeof module === "object" && typeof module.exports === "object" ) {
+ // For CommonJS and CommonJS-like environments where a proper window is present,
+ // execute the factory and get jQuery
+ // For environments that do not inherently posses a window with a document
+ // (such as Node.js), expose a jQuery-making factory as module.exports
+ // This accentuates the need for the creation of a real window
+ // e.g. var jQuery = require("jquery")(window);
+ // See ticket #14549 for more info
+ module.exports = global.document ?
+ factory( global, true ) :
+ function( w ) {
+ if ( !w.document ) {
+ throw new Error( "jQuery requires a window with a document" );
+ }
+ return factory( w );
+ };
+ } else {
+ factory( global );
+ }
+
+// Pass this if window is not defined yet
+}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
+
+// Can't do this because several apps including ASP.NET trace
+// the stack via arguments.caller.callee and Firefox dies if
+// you try to trace through "use strict" call chains. (#13335)
+// Support: Firefox 18+
+//
+
+var deletedIds = [];
+
+var slice = deletedIds.slice;
+
+var concat = deletedIds.concat;
+
+var push = deletedIds.push;
+
+var indexOf = deletedIds.indexOf;
+
+var class2type = {};
+
+var toString = class2type.toString;
+
+var hasOwn = class2type.hasOwnProperty;
+
+var trim = "".trim;
+
+var support = {};
+
+
+
+var
+ version = "1.11.0",
+
+ // Define a local copy of jQuery
+ jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ // Need init if jQuery is called (just allow error to be thrown if not included)
+ return new jQuery.fn.init( selector, context );
+ },
+
+ // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
+
+ // Matches dashed string for camelizing
+ rmsPrefix = /^-ms-/,
+ rdashAlpha = /-([\da-z])/gi,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ };
+
+jQuery.fn = jQuery.prototype = {
+ // The current version of jQuery being used
+ jquery: version,
+
+ constructor: jQuery,
+
+ // Start with an empty selector
+ selector: "",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ toArray: function() {
+ return slice.call( this );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num != null ?
+
+ // Return a 'clean' array
+ ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
+
+ // Return just the object
+ slice.call( this );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems ) {
+
+ // Build a new jQuery matched element set
+ var ret = jQuery.merge( this.constructor(), elems );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+ ret.context = this.context;
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ) );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ eq: function( i ) {
+ var len = this.length,
+ j = +i + ( i < 0 ? len : 0 );
+ return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: deletedIds.sort,
+ splice: deletedIds.splice
+};
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var src, copyIsArray, copy, name, options, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+
+ // skip the boolean and the target
+ target = arguments[ i ] || {};
+ i++;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( i === length ) {
+ target = this;
+ i--;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ // Unique for each copy of jQuery on the page
+ expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
+
+ // Assume jQuery is ready without the ready module
+ isReady: true,
+
+ error: function( msg ) {
+ throw new Error( msg );
+ },
+
+ noop: function() {},
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray || function( obj ) {
+ return jQuery.type(obj) === "array";
+ },
+
+ isWindow: function( obj ) {
+ /* jshint eqeqeq: false */
+ return obj != null && obj == obj.window;
+ },
+
+ isNumeric: function( obj ) {
+ // parseFloat NaNs numeric-cast false positives (null|true|false|"")
+ // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
+ // subtraction forces infinities to NaN
+ return obj - parseFloat( obj ) >= 0;
+ },
+
+ isEmptyObject: function( obj ) {
+ var name;
+ for ( name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ isPlainObject: function( obj ) {
+ var key;
+
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ try {
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !hasOwn.call(obj, "constructor") &&
+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+ } catch ( e ) {
+ // IE8,9 Will throw exceptions on certain host objects #9897
+ return false;
+ }
+
+ // Support: IE<9
+ // Handle iteration over inherited properties before own properties.
+ if ( support.ownLast ) {
+ for ( key in obj ) {
+ return hasOwn.call( obj, key );
+ }
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwn.call( obj, key );
+ },
+
+ type: function( obj ) {
+ if ( obj == null ) {
+ return obj + "";
+ }
+ return typeof obj === "object" || typeof obj === "function" ?
+ class2type[ toString.call(obj) ] || "object" :
+ typeof obj;
+ },
+
+ // Evaluates a script in a global context
+ // Workarounds based on findings by Jim Driscoll
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
+ globalEval: function( data ) {
+ if ( data && jQuery.trim( data ) ) {
+ // We use execScript on Internet Explorer
+ // We use an anonymous function so that context is window
+ // rather than jQuery in Firefox
+ ( window.execScript || function( data ) {
+ window[ "eval" ].call( window, data );
+ } )( data );
+ }
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+ },
+
+ // args is for internal usage only
+ each: function( obj, callback, args ) {
+ var value,
+ i = 0,
+ length = obj.length,
+ isArray = isArraylike( obj );
+
+ if ( args ) {
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback.apply( obj[ i ], args );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ value = callback.apply( obj[ i ], args );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback.call( obj[ i ], i, obj[ i ] );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ value = callback.call( obj[ i ], i, obj[ i ] );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return obj;
+ },
+
+ // Use native String.trim function wherever possible
+ trim: trim && !trim.call("\uFEFF\xA0") ?
+ function( text ) {
+ return text == null ?
+ "" :
+ trim.call( text );
+ } :
+
+ // Otherwise use our own trimming functionality
+ function( text ) {
+ return text == null ?
+ "" :
+ ( text + "" ).replace( rtrim, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( arr, results ) {
+ var ret = results || [];
+
+ if ( arr != null ) {
+ if ( isArraylike( Object(arr) ) ) {
+ jQuery.merge( ret,
+ typeof arr === "string" ?
+ [ arr ] : arr
+ );
+ } else {
+ push.call( ret, arr );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, arr, i ) {
+ var len;
+
+ if ( arr ) {
+ if ( indexOf ) {
+ return indexOf.call( arr, elem, i );
+ }
+
+ len = arr.length;
+ i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
+
+ for ( ; i < len; i++ ) {
+ // Skip accessing in sparse arrays
+ if ( i in arr && arr[ i ] === elem ) {
+ return i;
+ }
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var len = +second.length,
+ j = 0,
+ i = first.length;
+
+ while ( j < len ) {
+ first[ i++ ] = second[ j++ ];
+ }
+
+ // Support: IE<9
+ // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
+ if ( len !== len ) {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, invert ) {
+ var callbackInverse,
+ matches = [],
+ i = 0,
+ length = elems.length,
+ callbackExpect = !invert;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( ; i < length; i++ ) {
+ callbackInverse = !callback( elems[ i ], i );
+ if ( callbackInverse !== callbackExpect ) {
+ matches.push( elems[ i ] );
+ }
+ }
+
+ return matches;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var value,
+ i = 0,
+ length = elems.length,
+ isArray = isArraylike( elems ),
+ ret = [];
+
+ // Go through the array, translating each of the items to their new values
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret.push( value );
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( i in elems ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret.push( value );
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ var args, proxy, tmp;
+
+ if ( typeof context === "string" ) {
+ tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ args = slice.call( arguments, 2 );
+ proxy = function() {
+ return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ now: function() {
+ return +( new Date() );
+ },
+
+ // jQuery.support is not used in Core but other projects attach their
+ // properties to it so it needs to exist.
+ support: support
+});
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+function isArraylike( obj ) {
+ var length = obj.length,
+ type = jQuery.type( obj );
+
+ if ( type === "function" || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ if ( obj.nodeType === 1 && length ) {
+ return true;
+ }
+
+ return type === "array" || length === 0 ||
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj;
+}
+var Sizzle =
+/*!
+ * Sizzle CSS Selector Engine v1.10.16
+ * http://sizzlejs.com/
+ *
+ * Copyright 2013 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2014-01-13
+ */
+(function( window ) {
+
+var i,
+ support,
+ Expr,
+ getText,
+ isXML,
+ compile,
+ outermostContext,
+ sortInput,
+ hasDuplicate,
+
+ // Local document vars
+ setDocument,
+ document,
+ docElem,
+ documentIsHTML,
+ rbuggyQSA,
+ rbuggyMatches,
+ matches,
+ contains,
+
+ // Instance-specific data
+ expando = "sizzle" + -(new Date()),
+ preferredDoc = window.document,
+ dirruns = 0,
+ done = 0,
+ classCache = createCache(),
+ tokenCache = createCache(),
+ compilerCache = createCache(),
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ }
+ return 0;
+ },
+
+ // General-purpose constants
+ strundefined = typeof undefined,
+ MAX_NEGATIVE = 1 << 31,
+
+ // Instance methods
+ hasOwn = ({}).hasOwnProperty,
+ arr = [],
+ pop = arr.pop,
+ push_native = arr.push,
+ push = arr.push,
+ slice = arr.slice,
+ // Use a stripped-down indexOf if we can't use a native one
+ indexOf = arr.indexOf || function( elem ) {
+ var i = 0,
+ len = this.length;
+ for ( ; i < len; i++ ) {
+ if ( this[i] === elem ) {
+ return i;
+ }
+ }
+ return -1;
+ },
+
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
+
+ // Regular expressions
+
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
+ whitespace = "[\\x20\\t\\r\\n\\f]",
+ // http://www.w3.org/TR/css3-syntax/#characters
+ characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
+
+ // Loosely modeled on CSS identifier characters
+ // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+ identifier = characterEncoding.replace( "w", "w#" ),
+
+ // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
+ "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
+
+ // Prefer arguments quoted,
+ // then not containing pseudos/brackets,
+ // then attribute selectors/non-parenthetical expressions,
+ // then anything else
+ // These preferences are here to reduce the number of selectors
+ // needing tokenize in the PSEUDO preFilter
+ pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
+
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
+
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
+
+ rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
+
+ rpseudo = new RegExp( pseudos ),
+ ridentifier = new RegExp( "^" + identifier + "$" ),
+
+ matchExpr = {
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
+ "ATTR": new RegExp( "^" + attributes ),
+ "PSEUDO": new RegExp( "^" + pseudos ),
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+ "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
+ // For use in libraries implementing .is()
+ // We use this for POS matching in `select`
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+ },
+
+ rinputs = /^(?:input|select|textarea|button)$/i,
+ rheader = /^h\d$/i,
+
+ rnative = /^[^{]+\{\s*\[native \w/,
+
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+
+ rsibling = /[+~]/,
+ rescape = /'|\\/g,
+
+ // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+ runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
+ funescape = function( _, escaped, escapedWhitespace ) {
+ var high = "0x" + escaped - 0x10000;
+ // NaN means non-codepoint
+ // Support: Firefox
+ // Workaround erroneous numeric interpretation of +"0x"
+ return high !== high || escapedWhitespace ?
+ escaped :
+ high < 0 ?
+ // BMP codepoint
+ String.fromCharCode( high + 0x10000 ) :
+ // Supplemental Plane codepoint (surrogate pair)
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+ };
+
+// Optimize for push.apply( _, NodeList )
+try {
+ push.apply(
+ (arr = slice.call( preferredDoc.childNodes )),
+ preferredDoc.childNodes
+ );
+ // Support: Android<4.0
+ // Detect silently failing push.apply
+ arr[ preferredDoc.childNodes.length ].nodeType;
+} catch ( e ) {
+ push = { apply: arr.length ?
+
+ // Leverage slice if possible
+ function( target, els ) {
+ push_native.apply( target, slice.call(els) );
+ } :
+
+ // Support: IE<9
+ // Otherwise append directly
+ function( target, els ) {
+ var j = target.length,
+ i = 0;
+ // Can't trust NodeList.length
+ while ( (target[j++] = els[i++]) ) {}
+ target.length = j - 1;
+ }
+ };
+}
+
+function Sizzle( selector, context, results, seed ) {
+ var match, elem, m, nodeType,
+ // QSA vars
+ i, groups, old, nid, newContext, newSelector;
+
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+ setDocument( context );
+ }
+
+ context = context || document;
+ results = results || [];
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( documentIsHTML && !seed ) {
+
+ // Shortcuts
+ if ( (match = rquickExpr.exec( selector )) ) {
+ // Speed-up: Sizzle("#ID")
+ if ( (m = match[1]) ) {
+ if ( nodeType === 9 ) {
+ elem = context.getElementById( m );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document (jQuery #6963)
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE, Opera, and Webkit return items
+ // by name instead of ID
+ if ( elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ } else {
+ return results;
+ }
+ } else {
+ // Context is not a document
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
+ contains( context, elem ) && elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ }
+
+ // Speed-up: Sizzle("TAG")
+ } else if ( match[2] ) {
+ push.apply( results, context.getElementsByTagName( selector ) );
+ return results;
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
+ push.apply( results, context.getElementsByClassName( m ) );
+ return results;
+ }
+ }
+
+ // QSA path
+ if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+ nid = old = expando;
+ newContext = context;
+ newSelector = nodeType === 9 && selector;
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ groups = tokenize( selector );
+
+ if ( (old = context.getAttribute("id")) ) {
+ nid = old.replace( rescape, "\\$&" );
+ } else {
+ context.setAttribute( "id", nid );
+ }
+ nid = "[id='" + nid + "'] ";
+
+ i = groups.length;
+ while ( i-- ) {
+ groups[i] = nid + toSelector( groups[i] );
+ }
+ newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
+ newSelector = groups.join(",");
+ }
+
+ if ( newSelector ) {
+ try {
+ push.apply( results,
+ newContext.querySelectorAll( newSelector )
+ );
+ return results;
+ } catch(qsaError) {
+ } finally {
+ if ( !old ) {
+ context.removeAttribute("id");
+ }
+ }
+ }
+ }
+ }
+
+ // All others
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
+}
+
+/**
+ * Create key-value caches of limited size
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ * deleting the oldest entry
+ */
+function createCache() {
+ var keys = [];
+
+ function cache( key, value ) {
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+ if ( keys.push( key + " " ) > Expr.cacheLength ) {
+ // Only keep the most recent entries
+ delete cache[ keys.shift() ];
+ }
+ return (cache[ key + " " ] = value);
+ }
+ return cache;
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+ fn[ expando ] = true;
+ return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created div and expects a boolean result
+ */
+function assert( fn ) {
+ var div = document.createElement("div");
+
+ try {
+ return !!fn( div );
+ } catch (e) {
+ return false;
+ } finally {
+ // Remove from its parent by default
+ if ( div.parentNode ) {
+ div.parentNode.removeChild( div );
+ }
+ // release memory in IE
+ div = null;
+ }
+}
+
+/**
+ * Adds the same handler for all of the specified attrs
+ * @param {String} attrs Pipe-separated list of attributes
+ * @param {Function} handler The method that will be applied
+ */
+function addHandle( attrs, handler ) {
+ var arr = attrs.split("|"),
+ i = attrs.length;
+
+ while ( i-- ) {
+ Expr.attrHandle[ arr[i] ] = handler;
+ }
+}
+
+/**
+ * Checks document order of two siblings
+ * @param {Element} a
+ * @param {Element} b
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
+ */
+function siblingCheck( a, b ) {
+ var cur = b && a,
+ diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
+ ( ~b.sourceIndex || MAX_NEGATIVE ) -
+ ( ~a.sourceIndex || MAX_NEGATIVE );
+
+ // Use IE sourceIndex if available on both nodes
+ if ( diff ) {
+ return diff;
+ }
+
+ // Check if b follows a
+ if ( cur ) {
+ while ( (cur = cur.nextSibling) ) {
+ if ( cur === b ) {
+ return -1;
+ }
+ }
+ }
+
+ return a ? 1 : -1;
+}
+
+/**
+ * Returns a function to use in pseudos for input types
+ * @param {String} type
+ */
+function createInputPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for buttons
+ * @param {String} type
+ */
+function createButtonPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for positionals
+ * @param {Function} fn
+ */
+function createPositionalPseudo( fn ) {
+ return markFunction(function( argument ) {
+ argument = +argument;
+ return markFunction(function( seed, matches ) {
+ var j,
+ matchIndexes = fn( [], seed.length, argument ),
+ i = matchIndexes.length;
+
+ // Match elements found at the specified indexes
+ while ( i-- ) {
+ if ( seed[ (j = matchIndexes[i]) ] ) {
+ seed[j] = !(matches[j] = seed[j]);
+ }
+ }
+ });
+ });
+}
+
+/**
+ * Checks a node for validity as a Sizzle context
+ * @param {Element|Object=} context
+ * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
+ */
+function testContext( context ) {
+ return context && typeof context.getElementsByTagName !== strundefined && context;
+}
+
+// Expose support vars for convenience
+support = Sizzle.support = {};
+
+/**
+ * Detects XML nodes
+ * @param {Element|Object} elem An element or a document
+ * @returns {Boolean} True iff elem is a non-HTML XML node
+ */
+isXML = Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+/**
+ * Sets document-related variables once based on the current document
+ * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @returns {Object} Returns the current document
+ */
+setDocument = Sizzle.setDocument = function( node ) {
+ var hasCompare,
+ doc = node ? node.ownerDocument || node : preferredDoc,
+ parent = doc.defaultView;
+
+ // If no document and documentElement is available, return
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+ return document;
+ }
+
+ // Set our document
+ document = doc;
+ docElem = doc.documentElement;
+
+ // Support tests
+ documentIsHTML = !isXML( doc );
+
+ // Support: IE>8
+ // If iframe document is assigned to "document" variable and if iframe has been reloaded,
+ // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
+ // IE6-8 do not support the defaultView property so parent will be undefined
+ if ( parent && parent !== parent.top ) {
+ // IE11 does not have attachEvent, so all must suffer
+ if ( parent.addEventListener ) {
+ parent.addEventListener( "unload", function() {
+ setDocument();
+ }, false );
+ } else if ( parent.attachEvent ) {
+ parent.attachEvent( "onunload", function() {
+ setDocument();
+ });
+ }
+ }
+
+ /* Attributes
+ ---------------------------------------------------------------------- */
+
+ // Support: IE<8
+ // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
+ support.attributes = assert(function( div ) {
+ div.className = "i";
+ return !div.getAttribute("className");
+ });
+
+ /* getElement(s)By*
+ ---------------------------------------------------------------------- */
+
+ // Check if getElementsByTagName("*") returns only elements
+ support.getElementsByTagName = assert(function( div ) {
+ div.appendChild( doc.createComment("") );
+ return !div.getElementsByTagName("*").length;
+ });
+
+ // Check if getElementsByClassName can be trusted
+ support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) {
+ div.innerHTML = "<div class='a'></div><div class='a i'></div>";
+
+ // Support: Safari<4
+ // Catch class over-caching
+ div.firstChild.className = "i";
+ // Support: Opera<10
+ // Catch gEBCN failure to find non-leading classes
+ return div.getElementsByClassName("i").length === 2;
+ });
+
+ // Support: IE<10
+ // Check if getElementById returns elements by name
+ // The broken getElementById methods don't pick up programatically-set names,
+ // so use a roundabout getElementsByName test
+ support.getById = assert(function( div ) {
+ docElem.appendChild( div ).id = expando;
+ return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
+ });
+
+ // ID find and filter
+ if ( support.getById ) {
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
+ var m = context.getElementById( id );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [m] : [];
+ }
+ };
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ return elem.getAttribute("id") === attrId;
+ };
+ };
+ } else {
+ // Support: IE6/7
+ // getElementById is not reliable as a find shortcut
+ delete Expr.find["ID"];
+
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
+ return node && node.value === attrId;
+ };
+ };
+ }
+
+ // Tag
+ Expr.find["TAG"] = support.getElementsByTagName ?
+ function( tag, context ) {
+ if ( typeof context.getElementsByTagName !== strundefined ) {
+ return context.getElementsByTagName( tag );
+ }
+ } :
+ function( tag, context ) {
+ var elem,
+ tmp = [],
+ i = 0,
+ results = context.getElementsByTagName( tag );
+
+ // Filter out possible comments
+ if ( tag === "*" ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem.nodeType === 1 ) {
+ tmp.push( elem );
+ }
+ }
+
+ return tmp;
+ }
+ return results;
+ };
+
+ // Class
+ Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
+ if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
+ return context.getElementsByClassName( className );
+ }
+ };
+
+ /* QSA/matchesSelector
+ ---------------------------------------------------------------------- */
+
+ // QSA and matchesSelector support
+
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+ rbuggyMatches = [];
+
+ // qSa(:focus) reports false when true (Chrome 21)
+ // We allow this because of a bug in IE8/9 that throws an error
+ // whenever `document.activeElement` is accessed on an iframe
+ // So, we allow :focus to pass through QSA all the time to avoid the IE error
+ // See http://bugs.jquery.com/ticket/13378
+ rbuggyQSA = [];
+
+ if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
+ // Build QSA regex
+ // Regex strategy adopted from Diego Perini
+ assert(function( div ) {
+ // Select is set to empty string on purpose
+ // This is to test IE's treatment of not explicitly
+ // setting a boolean content attribute,
+ // since its presence should be enough
+ // http://bugs.jquery.com/ticket/12359
+ div.innerHTML = "<select t=''><option selected=''></option></select>";
+
+ // Support: IE8, Opera 10-12
+ // Nothing should be selected when empty strings follow ^= or $= or *=
+ if ( div.querySelectorAll("[t^='']").length ) {
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
+ }
+
+ // Support: IE8
+ // Boolean attributes and "value" are not treated correctly
+ if ( !div.querySelectorAll("[selected]").length ) {
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
+ }
+
+ // Webkit/Opera - :checked should return selected option elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":checked").length ) {
+ rbuggyQSA.push(":checked");
+ }
+ });
+
+ assert(function( div ) {
+ // Support: Windows 8 Native Apps
+ // The type and name attributes are restricted during .innerHTML assignment
+ var input = doc.createElement("input");
+ input.setAttribute( "type", "hidden" );
+ div.appendChild( input ).setAttribute( "name", "D" );
+
+ // Support: IE8
+ // Enforce case-sensitivity of name attribute
+ if ( div.querySelectorAll("[name=d]").length ) {
+ rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
+ }
+
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":enabled").length ) {
+ rbuggyQSA.push( ":enabled", ":disabled" );
+ }
+
+ // Opera 10-11 does not throw on post-comma invalid pseudos
+ div.querySelectorAll("*,:x");
+ rbuggyQSA.push(",.*:");
+ });
+ }
+
+ if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector ||
+ docElem.mozMatchesSelector ||
+ docElem.oMatchesSelector ||
+ docElem.msMatchesSelector) )) ) {
+
+ assert(function( div ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9)
+ support.disconnectedMatch = matches.call( div, "div" );
+
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( div, "[s!='']:x" );
+ rbuggyMatches.push( "!=", pseudos );
+ });
+ }
+
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
+
+ /* Contains
+ ---------------------------------------------------------------------- */
+ hasCompare = rnative.test( docElem.compareDocumentPosition );
+
+ // Element contains another
+ // Purposefully does not implement inclusive descendent
+ // As in, an element does not contain itself
+ contains = hasCompare || rnative.test( docElem.contains ) ?
+ function( a, b ) {
+ var adown = a.nodeType === 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a === bup || !!( bup && bup.nodeType === 1 && (
+ adown.contains ?
+ adown.contains( bup ) :
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+ ));
+ } :
+ function( a, b ) {
+ if ( b ) {
+ while ( (b = b.parentNode) ) {
+ if ( b === a ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ /* Sorting
+ ---------------------------------------------------------------------- */
+
+ // Document order sorting
+ sortOrder = hasCompare ?
+ function( a, b ) {
+
+ // Flag for duplicate removal
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ // Sort on method existence if only one input has compareDocumentPosition
+ var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
+ if ( compare ) {
+ return compare;
+ }
+
+ // Calculate position if both inputs belong to the same document
+ compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
+ a.compareDocumentPosition( b ) :
+
+ // Otherwise we know they are disconnected
+ 1;
+
+ // Disconnected nodes
+ if ( compare & 1 ||
+ (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
+
+ // Choose the first element that is related to our preferred document
+ if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
+ return -1;
+ }
+ if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
+ return 1;
+ }
+
+ // Maintain original order
+ return sortInput ?
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ 0;
+ }
+
+ return compare & 4 ? -1 : 1;
+ } :
+ function( a, b ) {
+ // Exit early if the nodes are identical
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ var cur,
+ i = 0,
+ aup = a.parentNode,
+ bup = b.parentNode,
+ ap = [ a ],
+ bp = [ b ];
+
+ // Parentless nodes are either documents or disconnected
+ if ( !aup || !bup ) {
+ return a === doc ? -1 :
+ b === doc ? 1 :
+ aup ? -1 :
+ bup ? 1 :
+ sortInput ?
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ 0;
+
+ // If the nodes are siblings, we can do a quick check
+ } else if ( aup === bup ) {
+ return siblingCheck( a, b );
+ }
+
+ // Otherwise we need full lists of their ancestors for comparison
+ cur = a;
+ while ( (cur = cur.parentNode) ) {
+ ap.unshift( cur );
+ }
+ cur = b;
+ while ( (cur = cur.parentNode) ) {
+ bp.unshift( cur );
+ }
+
+ // Walk down the tree looking for a discrepancy
+ while ( ap[i] === bp[i] ) {
+ i++;
+ }
+
+ return i ?
+ // Do a sibling check if the nodes have a common ancestor
+ siblingCheck( ap[i], bp[i] ) :
+
+ // Otherwise nodes in our document sort first
+ ap[i] === preferredDoc ? -1 :
+ bp[i] === preferredDoc ? 1 :
+ 0;
+ };
+
+ return doc;
+};
+
+Sizzle.matches = function( expr, elements ) {
+ return Sizzle( expr, null, null, elements );
+};
+
+Sizzle.matchesSelector = function( elem, expr ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace( rattributeQuotes, "='$1']" );
+
+ if ( support.matchesSelector && documentIsHTML &&
+ ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
+
+ try {
+ var ret = matches.call( elem, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || support.disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9
+ elem.document && elem.document.nodeType !== 11 ) {
+ return ret;
+ }
+ } catch(e) {}
+ }
+
+ return Sizzle( expr, document, null, [elem] ).length > 0;
+};
+
+Sizzle.contains = function( context, elem ) {
+ // Set document vars if needed
+ if ( ( context.ownerDocument || context ) !== document ) {
+ setDocument( context );
+ }
+ return contains( context, elem );
+};
+
+Sizzle.attr = function( elem, name ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ var fn = Expr.attrHandle[ name.toLowerCase() ],
+ // Don't get fooled by Object.prototype properties (jQuery #13807)
+ val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
+ fn( elem, name, !documentIsHTML ) :
+ undefined;
+
+ return val !== undefined ?
+ val :
+ support.attributes || !documentIsHTML ?
+ elem.getAttribute( name ) :
+ (val = elem.getAttributeNode(name)) && val.specified ?
+ val.value :
+ null;
+};
+
+Sizzle.error = function( msg ) {
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+/**
+ * Document sorting and removing duplicates
+ * @param {ArrayLike} results
+ */
+Sizzle.uniqueSort = function( results ) {
+ var elem,
+ duplicates = [],
+ j = 0,
+ i = 0;
+
+ // Unless we *know* we can detect duplicates, assume their presence
+ hasDuplicate = !support.detectDuplicates;
+ sortInput = !support.sortStable && results.slice( 0 );
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem === results[ i ] ) {
+ j = duplicates.push( i );
+ }
+ }
+ while ( j-- ) {
+ results.splice( duplicates[ j ], 1 );
+ }
+ }
+
+ // Clear input after sorting to release objects
+ // See https://github.com/jquery/sizzle/pull/225
+ sortInput = null;
+
+ return results;
+};
+
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+ var node,
+ ret = "",
+ i = 0,
+ nodeType = elem.nodeType;
+
+ if ( !nodeType ) {
+ // If no nodeType, this is expected to be an array
+ while ( (node = elem[i++]) ) {
+ // Do not traverse comment nodes
+ ret += getText( node );
+ }
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ // Use textContent for elements
+ // innerText usage removed for consistency of new lines (jQuery #11153)
+ if ( typeof elem.textContent === "string" ) {
+ return elem.textContent;
+ } else {
+ // Traverse its children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ ret += getText( elem );
+ }
+ }
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+ // Do not include comment or processing instruction nodes
+
+ return ret;
+};
+
+Expr = Sizzle.selectors = {
+
+ // Can be adjusted by the user
+ cacheLength: 50,
+
+ createPseudo: markFunction,
+
+ match: matchExpr,
+
+ attrHandle: {},
+
+ find: {},
+
+ relative: {
+ ">": { dir: "parentNode", first: true },
+ " ": { dir: "parentNode" },
+ "+": { dir: "previousSibling", first: true },
+ "~": { dir: "previousSibling" }
+ },
+
+ preFilter: {
+ "ATTR": function( match ) {
+ match[1] = match[1].replace( runescape, funescape );
+
+ // Move the given value to match[3] whether quoted or unquoted
+ match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
+
+ if ( match[2] === "~=" ) {
+ match[3] = " " + match[3] + " ";
+ }
+
+ return match.slice( 0, 4 );
+ },
+
+ "CHILD": function( match ) {
+ /* matches from matchExpr["CHILD"]
+ 1 type (only|nth|...)
+ 2 what (child|of-type)
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
+ 5 sign of xn-component
+ 6 x of xn-component
+ 7 sign of y-component
+ 8 y of y-component
+ */
+ match[1] = match[1].toLowerCase();
+
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
+ // nth-* requires argument
+ if ( !match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // numeric x and y parameters for Expr.filter.CHILD
+ // remember that false/true cast respectively to 0/1
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+
+ // other types prohibit arguments
+ } else if ( match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ return match;
+ },
+
+ "PSEUDO": function( match ) {
+ var excess,
+ unquoted = !match[5] && match[2];
+
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
+ return null;
+ }
+
+ // Accept quoted arguments as-is
+ if ( match[3] && match[4] !== undefined ) {
+ match[2] = match[4];
+
+ // Strip excess characters from unquoted arguments
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
+ // Get excess from tokenize (recursively)
+ (excess = tokenize( unquoted, true )) &&
+ // advance to the next closing parenthesis
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+
+ // excess is a negative index
+ match[0] = match[0].slice( 0, excess );
+ match[2] = unquoted.slice( 0, excess );
+ }
+
+ // Return only captures needed by the pseudo filter method (type and argument)
+ return match.slice( 0, 3 );
+ }
+ },
+
+ filter: {
+
+ "TAG": function( nodeNameSelector ) {
+ var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
+ return nodeNameSelector === "*" ?
+ function() { return true; } :
+ function( elem ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+ };
+ },
+
+ "CLASS": function( className ) {
+ var pattern = classCache[ className + " " ];
+
+ return pattern ||
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+ classCache( className, function( elem ) {
+ return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
+ });
+ },
+
+ "ATTR": function( name, operator, check ) {
+ return function( elem ) {
+ var result = Sizzle.attr( elem, name );
+
+ if ( result == null ) {
+ return operator === "!=";
+ }
+ if ( !operator ) {
+ return true;
+ }
+
+ result += "";
+
+ return operator === "=" ? result === check :
+ operator === "!=" ? result !== check :
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
+ operator === "$=" ? check && result.slice( -check.length ) === check :
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
+ false;
+ };
+ },
+
+ "CHILD": function( type, what, argument, first, last ) {
+ var simple = type.slice( 0, 3 ) !== "nth",
+ forward = type.slice( -4 ) !== "last",
+ ofType = what === "of-type";
+
+ return first === 1 && last === 0 ?
+
+ // Shortcut for :nth-*(n)
+ function( elem ) {
+ return !!elem.parentNode;
+ } :
+
+ function( elem, context, xml ) {
+ var cache, outerCache, node, diff, nodeIndex, start,
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
+ parent = elem.parentNode,
+ name = ofType && elem.nodeName.toLowerCase(),
+ useCache = !xml && !ofType;
+
+ if ( parent ) {
+
+ // :(first|last|only)-(child|of-type)
+ if ( simple ) {
+ while ( dir ) {
+ node = elem;
+ while ( (node = node[ dir ]) ) {
+ if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ // Reverse direction for :only-* (if we haven't yet done so)
+ start = dir = type === "only" && !start && "nextSibling";
+ }
+ return true;
+ }
+
+ start = [ forward ? parent.firstChild : parent.lastChild ];
+
+ // non-xml :nth-child(...) stores cache data on `parent`
+ if ( forward && useCache ) {
+ // Seek `elem` from a previously-cached index
+ outerCache = parent[ expando ] || (parent[ expando ] = {});
+ cache = outerCache[ type ] || [];
+ nodeIndex = cache[0] === dirruns && cache[1];
+ diff = cache[0] === dirruns && cache[2];
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
+
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+
+ // Fallback to seeking `elem` from the start
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ // When found, cache indexes on `parent` and break
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
+ outerCache[ type ] = [ dirruns, nodeIndex, diff ];
+ break;
+ }
+ }
+
+ // Use previously-cached element index if available
+ } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
+ diff = cache[1];
+
+ // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
+ } else {
+ // Use the same loop as above to seek `elem` from the start
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
+ // Cache the index of each encountered element
+ if ( useCache ) {
+ (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
+ }
+
+ if ( node === elem ) {
+ break;
+ }
+ }
+ }
+ }
+
+ // Incorporate the offset, then check against cycle size
+ diff -= last;
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
+ }
+ };
+ },
+
+ "PSEUDO": function( pseudo, argument ) {
+ // pseudo-class names are case-insensitive
+ // http://www.w3.org/TR/selectors/#pseudo-classes
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+ // Remember that setFilters inherits from pseudos
+ var args,
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+ Sizzle.error( "unsupported pseudo: " + pseudo );
+
+ // The user may use createPseudo to indicate that
+ // arguments are needed to create the filter function
+ // just as Sizzle does
+ if ( fn[ expando ] ) {
+ return fn( argument );
+ }
+
+ // But maintain support for old signatures
+ if ( fn.length > 1 ) {
+ args = [ pseudo, pseudo, "", argument ];
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+ markFunction(function( seed, matches ) {
+ var idx,
+ matched = fn( seed, argument ),
+ i = matched.length;
+ while ( i-- ) {
+ idx = indexOf.call( seed, matched[i] );
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
+ }
+ }) :
+ function( elem ) {
+ return fn( elem, 0, args );
+ };
+ }
+
+ return fn;
+ }
+ },
+
+ pseudos: {
+ // Potentially complex pseudos
+ "not": markFunction(function( selector ) {
+ // Trim the selector passed to compile
+ // to avoid treating leading and trailing
+ // spaces as combinators
+ var input = [],
+ results = [],
+ matcher = compile( selector.replace( rtrim, "$1" ) );
+
+ return matcher[ expando ] ?
+ markFunction(function( seed, matches, context, xml ) {
+ var elem,
+ unmatched = matcher( seed, null, xml, [] ),
+ i = seed.length;
+
+ // Match elements unmatched by `matcher`
+ while ( i-- ) {
+ if ( (elem = unmatched[i]) ) {
+ seed[i] = !(matches[i] = elem);
+ }
+ }
+ }) :
+ function( elem, context, xml ) {
+ input[0] = elem;
+ matcher( input, null, xml, results );
+ return !results.pop();
+ };
+ }),
+
+ "has": markFunction(function( selector ) {
+ return function( elem ) {
+ return Sizzle( selector, elem ).length > 0;
+ };
+ }),
+
+ "contains": markFunction(function( text ) {
+ return function( elem ) {
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+ };
+ }),
+
+ // "Whether an element is represented by a :lang() selector
+ // is based solely on the element's language value
+ // being equal to the identifier C,
+ // or beginning with the identifier C immediately followed by "-".
+ // The matching of C against the element's language value is performed case-insensitively.
+ // The identifier C does not have to be a valid language name."
+ // http://www.w3.org/TR/selectors/#lang-pseudo
+ "lang": markFunction( function( lang ) {
+ // lang value must be a valid identifier
+ if ( !ridentifier.test(lang || "") ) {
+ Sizzle.error( "unsupported lang: " + lang );
+ }
+ lang = lang.replace( runescape, funescape ).toLowerCase();
+ return function( elem ) {
+ var elemLang;
+ do {
+ if ( (elemLang = documentIsHTML ?
+ elem.lang :
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
+
+ elemLang = elemLang.toLowerCase();
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
+ }
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+ return false;
+ };
+ }),
+
+ // Miscellaneous
+ "target": function( elem ) {
+ var hash = window.location && window.location.hash;
+ return hash && hash.slice( 1 ) === elem.id;
+ },
+
+ "root": function( elem ) {
+ return elem === docElem;
+ },
+
+ "focus": function( elem ) {
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+ },
+
+ // Boolean properties
+ "enabled": function( elem ) {
+ return elem.disabled === false;
+ },
+
+ "disabled": function( elem ) {
+ return elem.disabled === true;
+ },
+
+ "checked": function( elem ) {
+ // In CSS3, :checked should return both checked and selected elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ var nodeName = elem.nodeName.toLowerCase();
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+ },
+
+ "selected": function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ // Contents
+ "empty": function( elem ) {
+ // http://www.w3.org/TR/selectors/#empty-pseudo
+ // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
+ // but not by others (comment: 8; processing instruction: 7; etc.)
+ // nodeType < 6 works because attributes (2) do not appear as children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ if ( elem.nodeType < 6 ) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ "parent": function( elem ) {
+ return !Expr.pseudos["empty"]( elem );
+ },
+
+ // Element/input types
+ "header": function( elem ) {
+ return rheader.test( elem.nodeName );
+ },
+
+ "input": function( elem ) {
+ return rinputs.test( elem.nodeName );
+ },
+
+ "button": function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === "button" || name === "button";
+ },
+
+ "text": function( elem ) {
+ var attr;
+ return elem.nodeName.toLowerCase() === "input" &&
+ elem.type === "text" &&
+
+ // Support: IE<8
+ // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
+ },
+
+ // Position-in-collection
+ "first": createPositionalPseudo(function() {
+ return [ 0 ];
+ }),
+
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
+ return [ length - 1 ];
+ }),
+
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ argument < 0 ? argument + length : argument ];
+ }),
+
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 0;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 1;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; --i >= 0; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; ++i < length; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ })
+ }
+};
+
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+// Add button/input type pseudos
+for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
+ Expr.pseudos[ i ] = createInputPseudo( i );
+}
+for ( i in { submit: true, reset: true } ) {
+ Expr.pseudos[ i ] = createButtonPseudo( i );
+}
+
+// Easy API for creating new setFilters
+function setFilters() {}
+setFilters.prototype = Expr.filters = Expr.pseudos;
+Expr.setFilters = new setFilters();
+
+function tokenize( selector, parseOnly ) {
+ var matched, match, tokens, type,
+ soFar, groups, preFilters,
+ cached = tokenCache[ selector + " " ];
+
+ if ( cached ) {
+ return parseOnly ? 0 : cached.slice( 0 );
+ }
+
+ soFar = selector;
+ groups = [];
+ preFilters = Expr.preFilter;
+
+ while ( soFar ) {
+
+ // Comma and first run
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
+ if ( match ) {
+ // Don't consume trailing commas as valid
+ soFar = soFar.slice( match[0].length ) || soFar;
+ }
+ groups.push( (tokens = []) );
+ }
+
+ matched = false;
+
+ // Combinators
+ if ( (match = rcombinators.exec( soFar )) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ // Cast descendant combinators to space
+ type: match[0].replace( rtrim, " " )
+ });
+ soFar = soFar.slice( matched.length );
+ }
+
+ // Filters
+ for ( type in Expr.filter ) {
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+ (match = preFilters[ type ]( match ))) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ type: type,
+ matches: match
+ });
+ soFar = soFar.slice( matched.length );
+ }
+ }
+
+ if ( !matched ) {
+ break;
+ }
+ }
+
+ // Return the length of the invalid excess
+ // if we're just parsing
+ // Otherwise, throw an error or return tokens
+ return parseOnly ?
+ soFar.length :
+ soFar ?
+ Sizzle.error( selector ) :
+ // Cache the tokens
+ tokenCache( selector, groups ).slice( 0 );
+}
+
+function toSelector( tokens ) {
+ var i = 0,
+ len = tokens.length,
+ selector = "";
+ for ( ; i < len; i++ ) {
+ selector += tokens[i].value;
+ }
+ return selector;
+}
+
+function addCombinator( matcher, combinator, base ) {
+ var dir = combinator.dir,
+ checkNonElements = base && dir === "parentNode",
+ doneName = done++;
+
+ return combinator.first ?
+ // Check against closest ancestor/preceding element
+ function( elem, context, xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ return matcher( elem, context, xml );
+ }
+ }
+ } :
+
+ // Check against all ancestor/preceding elements
+ function( elem, context, xml ) {
+ var oldCache, outerCache,
+ newCache = [ dirruns, doneName ];
+
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
+ if ( xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ if ( matcher( elem, context, xml ) ) {
+ return true;
+ }
+ }
+ }
+ } else {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
+ if ( (oldCache = outerCache[ dir ]) &&
+ oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
+
+ // Assign to newCache so results back-propagate to previous elements
+ return (newCache[ 2 ] = oldCache[ 2 ]);
+ } else {
+ // Reuse newcache so results back-propagate to previous elements
+ outerCache[ dir ] = newCache;
+
+ // A match means we're done; a fail means we have to keep checking
+ if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ };
+}
+
+function elementMatcher( matchers ) {
+ return matchers.length > 1 ?
+ function( elem, context, xml ) {
+ var i = matchers.length;
+ while ( i-- ) {
+ if ( !matchers[i]( elem, context, xml ) ) {
+ return false;
+ }
+ }
+ return true;
+ } :
+ matchers[0];
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+ var elem,
+ newUnmatched = [],
+ i = 0,
+ len = unmatched.length,
+ mapped = map != null;
+
+ for ( ; i < len; i++ ) {
+ if ( (elem = unmatched[i]) ) {
+ if ( !filter || filter( elem, context, xml ) ) {
+ newUnmatched.push( elem );
+ if ( mapped ) {
+ map.push( i );
+ }
+ }
+ }
+ }
+
+ return newUnmatched;
+}
+
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+ if ( postFilter && !postFilter[ expando ] ) {
+ postFilter = setMatcher( postFilter );
+ }
+ if ( postFinder && !postFinder[ expando ] ) {
+ postFinder = setMatcher( postFinder, postSelector );
+ }
+ return markFunction(function( seed, results, context, xml ) {
+ var temp, i, elem,
+ preMap = [],
+ postMap = [],
+ preexisting = results.length,
+
+ // Get initial elements from seed or context
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
+
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
+ matcherIn = preFilter && ( seed || !selector ) ?
+ condense( elems, preMap, preFilter, context, xml ) :
+ elems,
+
+ matcherOut = matcher ?
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+
+ // ...intermediate processing is necessary
+ [] :
+
+ // ...otherwise use results directly
+ results :
+ matcherIn;
+
+ // Find primary matches
+ if ( matcher ) {
+ matcher( matcherIn, matcherOut, context, xml );
+ }
+
+ // Apply postFilter
+ if ( postFilter ) {
+ temp = condense( matcherOut, postMap );
+ postFilter( temp, [], context, xml );
+
+ // Un-match failing elements by moving them back to matcherIn
+ i = temp.length;
+ while ( i-- ) {
+ if ( (elem = temp[i]) ) {
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+ }
+ }
+ }
+
+ if ( seed ) {
+ if ( postFinder || preFilter ) {
+ if ( postFinder ) {
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
+ temp = [];
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) ) {
+ // Restore matcherIn since elem is not yet a final match
+ temp.push( (matcherIn[i] = elem) );
+ }
+ }
+ postFinder( null, (matcherOut = []), temp, xml );
+ }
+
+ // Move matched elements from seed to results to keep them synchronized
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) &&
+ (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
+
+ seed[temp] = !(results[temp] = elem);
+ }
+ }
+ }
+
+ // Add elements to results, through postFinder if defined
+ } else {
+ matcherOut = condense(
+ matcherOut === results ?
+ matcherOut.splice( preexisting, matcherOut.length ) :
+ matcherOut
+ );
+ if ( postFinder ) {
+ postFinder( null, results, matcherOut, xml );
+ } else {
+ push.apply( results, matcherOut );
+ }
+ }
+ });
+}
+
+function matcherFromTokens( tokens ) {
+ var checkContext, matcher, j,
+ len = tokens.length,
+ leadingRelative = Expr.relative[ tokens[0].type ],
+ implicitRelative = leadingRelative || Expr.relative[" "],
+ i = leadingRelative ? 1 : 0,
+
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
+ matchContext = addCombinator( function( elem ) {
+ return elem === checkContext;
+ }, implicitRelative, true ),
+ matchAnyContext = addCombinator( function( elem ) {
+ return indexOf.call( checkContext, elem ) > -1;
+ }, implicitRelative, true ),
+ matchers = [ function( elem, context, xml ) {
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+ (checkContext = context).nodeType ?
+ matchContext( elem, context, xml ) :
+ matchAnyContext( elem, context, xml ) );
+ } ];
+
+ for ( ; i < len; i++ ) {
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
+ } else {
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+ // Return special upon seeing a positional matcher
+ if ( matcher[ expando ] ) {
+ // Find the next relative operator (if any) for proper handling
+ j = ++i;
+ for ( ; j < len; j++ ) {
+ if ( Expr.relative[ tokens[j].type ] ) {
+ break;
+ }
+ }
+ return setMatcher(
+ i > 1 && elementMatcher( matchers ),
+ i > 1 && toSelector(
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
+ tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
+ ).replace( rtrim, "$1" ),
+ matcher,
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+ j < len && toSelector( tokens )
+ );
+ }
+ matchers.push( matcher );
+ }
+ }
+
+ return elementMatcher( matchers );
+}
+
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+ var bySet = setMatchers.length > 0,
+ byElement = elementMatchers.length > 0,
+ superMatcher = function( seed, context, xml, results, outermost ) {
+ var elem, j, matcher,
+ matchedCount = 0,
+ i = "0",
+ unmatched = seed && [],
+ setMatched = [],
+ contextBackup = outermostContext,
+ // We must always have either seed elements or outermost context
+ elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
+ // Use integer dirruns iff this is the outermost matcher
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
+ len = elems.length;
+
+ if ( outermost ) {
+ outermostContext = context !== document && context;
+ }
+
+ // Add elements passing elementMatchers directly to results
+ // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
+ // Support: IE<9, Safari
+ // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
+ for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
+ if ( byElement && elem ) {
+ j = 0;
+ while ( (matcher = elementMatchers[j++]) ) {
+ if ( matcher( elem, context, xml ) ) {
+ results.push( elem );
+ break;
+ }
+ }
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ }
+ }
+
+ // Track unmatched elements for set filters
+ if ( bySet ) {
+ // They will have gone through all possible matchers
+ if ( (elem = !matcher && elem) ) {
+ matchedCount--;
+ }
+
+ // Lengthen the array for every element, matched or not
+ if ( seed ) {
+ unmatched.push( elem );
+ }
+ }
+ }
+
+ // Apply set filters to unmatched elements
+ matchedCount += i;
+ if ( bySet && i !== matchedCount ) {
+ j = 0;
+ while ( (matcher = setMatchers[j++]) ) {
+ matcher( unmatched, setMatched, context, xml );
+ }
+
+ if ( seed ) {
+ // Reintegrate element matches to eliminate the need for sorting
+ if ( matchedCount > 0 ) {
+ while ( i-- ) {
+ if ( !(unmatched[i] || setMatched[i]) ) {
+ setMatched[i] = pop.call( results );
+ }
+ }
+ }
+
+ // Discard index placeholder values to get only actual matches
+ setMatched = condense( setMatched );
+ }
+
+ // Add matches to results
+ push.apply( results, setMatched );
+
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
+ if ( outermost && !seed && setMatched.length > 0 &&
+ ( matchedCount + setMatchers.length ) > 1 ) {
+
+ Sizzle.uniqueSort( results );
+ }
+ }
+
+ // Override manipulation of globals by nested matchers
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ outermostContext = contextBackup;
+ }
+
+ return unmatched;
+ };
+
+ return bySet ?
+ markFunction( superMatcher ) :
+ superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
+ var i,
+ setMatchers = [],
+ elementMatchers = [],
+ cached = compilerCache[ selector + " " ];
+
+ if ( !cached ) {
+ // Generate a function of recursive functions that can be used to check each element
+ if ( !group ) {
+ group = tokenize( selector );
+ }
+ i = group.length;
+ while ( i-- ) {
+ cached = matcherFromTokens( group[i] );
+ if ( cached[ expando ] ) {
+ setMatchers.push( cached );
+ } else {
+ elementMatchers.push( cached );
+ }
+ }
+
+ // Cache the compiled function
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+ }
+ return cached;
+};
+
+function multipleContexts( selector, contexts, results ) {
+ var i = 0,
+ len = contexts.length;
+ for ( ; i < len; i++ ) {
+ Sizzle( selector, contexts[i], results );
+ }
+ return results;
+}
+
+function select( selector, context, results, seed ) {
+ var i, tokens, token, type, find,
+ match = tokenize( selector );
+
+ if ( !seed ) {
+ // Try to minimize operations if there is only one group
+ if ( match.length === 1 ) {
+
+ // Take a shortcut and set the context if the root selector is an ID
+ tokens = match[0] = match[0].slice( 0 );
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+ support.getById && context.nodeType === 9 && documentIsHTML &&
+ Expr.relative[ tokens[1].type ] ) {
+
+ context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
+ if ( !context ) {
+ return results;
+ }
+ selector = selector.slice( tokens.shift().value.length );
+ }
+
+ // Fetch a seed set for right-to-left matching
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
+ while ( i-- ) {
+ token = tokens[i];
+
+ // Abort if we hit a combinator
+ if ( Expr.relative[ (type = token.type) ] ) {
+ break;
+ }
+ if ( (find = Expr.find[ type ]) ) {
+ // Search, expanding context for leading sibling combinators
+ if ( (seed = find(
+ token.matches[0].replace( runescape, funescape ),
+ rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
+ )) ) {
+
+ // If seed is empty or no tokens remain, we can return early
+ tokens.splice( i, 1 );
+ selector = seed.length && toSelector( tokens );
+ if ( !selector ) {
+ push.apply( results, seed );
+ return results;
+ }
+
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // Compile and execute a filtering function
+ // Provide `match` to avoid retokenization if we modified the selector above
+ compile( selector, match )(
+ seed,
+ context,
+ !documentIsHTML,
+ results,
+ rsibling.test( selector ) && testContext( context.parentNode ) || context
+ );
+ return results;
+}
+
+// One-time assignments
+
+// Sort stability
+support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
+
+// Support: Chrome<14
+// Always assume duplicates if they aren't passed to the comparison function
+support.detectDuplicates = !!hasDuplicate;
+
+// Initialize against the default document
+setDocument();
+
+// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
+// Detached nodes confoundingly follow *each other*
+support.sortDetached = assert(function( div1 ) {
+ // Should return 1, but returns 4 (following)
+ return div1.compareDocumentPosition( document.createElement("div") ) & 1;
+});
+
+// Support: IE<8
+// Prevent attribute/property "interpolation"
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !assert(function( div ) {
+ div.innerHTML = "<a href='#'></a>";
+ return div.firstChild.getAttribute("href") === "#" ;
+}) ) {
+ addHandle( "type|href|height|width", function( elem, name, isXML ) {
+ if ( !isXML ) {
+ return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
+ }
+ });
+}
+
+// Support: IE<9
+// Use defaultValue in place of getAttribute("value")
+if ( !support.attributes || !assert(function( div ) {
+ div.innerHTML = "<input/>";
+ div.firstChild.setAttribute( "value", "" );
+ return div.firstChild.getAttribute( "value" ) === "";
+}) ) {
+ addHandle( "value", function( elem, name, isXML ) {
+ if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
+ return elem.defaultValue;
+ }
+ });
+}
+
+// Support: IE<9
+// Use getAttributeNode to fetch booleans when getAttribute lies
+if ( !assert(function( div ) {
+ return div.getAttribute("disabled") == null;
+}) ) {
+ addHandle( booleans, function( elem, name, isXML ) {
+ var val;
+ if ( !isXML ) {
+ return elem[ name ] === true ? name.toLowerCase() :
+ (val = elem.getAttributeNode( name )) && val.specified ?
+ val.value :
+ null;
+ }
+ });
+}
+
+return Sizzle;
+
+})( window );
+
+
+
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.pseudos;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+
+var rneedsContext = jQuery.expr.match.needsContext;
+
+var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
+
+
+
+var risSimple = /^.[^:#\[\.,]*$/;
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, not ) {
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep( elements, function( elem, i ) {
+ /* jshint -W018 */
+ return !!qualifier.call( elem, i, elem ) !== not;
+ });
+
+ }
+
+ if ( qualifier.nodeType ) {
+ return jQuery.grep( elements, function( elem ) {
+ return ( elem === qualifier ) !== not;
+ });
+
+ }
+
+ if ( typeof qualifier === "string" ) {
+ if ( risSimple.test( qualifier ) ) {
+ return jQuery.filter( qualifier, elements, not );
+ }
+
+ qualifier = jQuery.filter( qualifier, elements );
+ }
+
+ return jQuery.grep( elements, function( elem ) {
+ return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;
+ });
+}
+
+jQuery.filter = function( expr, elems, not ) {
+ var elem = elems[ 0 ];
+
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 && elem.nodeType === 1 ?
+ jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
+ jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
+ return elem.nodeType === 1;
+ }));
+};
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var i,
+ ret = [],
+ self = this,
+ len = self.length;
+
+ if ( typeof selector !== "string" ) {
+ return this.pushStack( jQuery( selector ).filter(function() {
+ for ( i = 0; i < len; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ }) );
+ }
+
+ for ( i = 0; i < len; i++ ) {
+ jQuery.find( selector, self[ i ], ret );
+ }
+
+ // Needed because $( selector, context ) becomes $( context ).find( selector )
+ ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
+ ret.selector = this.selector ? this.selector + " " + selector : selector;
+ return ret;
+ },
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector || [], false) );
+ },
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector || [], true) );
+ },
+ is: function( selector ) {
+ return !!winnow(
+ this,
+
+ // If this is a positional/relative selector, check membership in the returned set
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
+ typeof selector === "string" && rneedsContext.test( selector ) ?
+ jQuery( selector ) :
+ selector || [],
+ false
+ ).length;
+ }
+});
+
+
+// Initialize a jQuery object
+
+
+// A central reference to the root jQuery(document)
+var rootjQuery,
+
+ // Use the correct document accordingly with window argument (sandbox)
+ document = window.document,
+
+ // A simple way to check for HTML strings
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
+ // Strict HTML recognition (#11290: must start with <)
+ rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
+
+ init = jQuery.fn.init = function( selector, context ) {
+ var match, elem;
+
+ // HANDLE: $(""), $(null), $(undefined), $(false)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = rquickExpr.exec( selector );
+ }
+
+ // Match html or make sure no context is specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ context = context instanceof jQuery ? context[0] : context;
+
+ // scripts is true for back-compat
+ // Intentionally let the error be thrown if parseHTML is not present
+ jQuery.merge( this, jQuery.parseHTML(
+ match[1],
+ context && context.nodeType ? context.ownerDocument || context : document,
+ true
+ ) );
+
+ // HANDLE: $(html, props)
+ if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
+ for ( match in context ) {
+ // Properties of context are called as methods if possible
+ if ( jQuery.isFunction( this[ match ] ) ) {
+ this[ match ]( context[ match ] );
+
+ // ...and otherwise set as attributes
+ } else {
+ this.attr( match, context[ match ] );
+ }
+ }
+ }
+
+ return this;
+
+ // HANDLE: $(#id)
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return ( context || rootjQuery ).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(DOMElement)
+ } else if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return typeof rootjQuery.ready !== "undefined" ?
+ rootjQuery.ready( selector ) :
+ // Execute immediately if ready is not present
+ selector( jQuery );
+ }
+
+ if ( selector.selector !== undefined ) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ };
+
+// Give the init function the jQuery prototype for later instantiation
+init.prototype = jQuery.fn;
+
+// Initialize central reference
+rootjQuery = jQuery( document );
+
+
+var rparentsprev = /^(?:parents|prev(?:Until|All))/,
+ // methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.extend({
+ dir: function( elem, dir, until ) {
+ var matched = [],
+ cur = elem[ dir ];
+
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+
+jQuery.fn.extend({
+ has: function( target ) {
+ var i,
+ targets = jQuery( target, this ),
+ len = targets.length;
+
+ return this.filter(function() {
+ for ( i = 0; i < len; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ closest: function( selectors, context ) {
+ var cur,
+ i = 0,
+ l = this.length,
+ matched = [],
+ pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
+ jQuery( selectors, context || this.context ) :
+ 0;
+
+ for ( ; i < l; i++ ) {
+ for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
+ // Always skip document fragments
+ if ( cur.nodeType < 11 && (pos ?
+ pos.index(cur) > -1 :
+
+ // Don't pass non-elements to Sizzle
+ cur.nodeType === 1 &&
+ jQuery.find.matchesSelector(cur, selectors)) ) {
+
+ matched.push( cur );
+ break;
+ }
+ }
+ }
+
+ return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+
+ // No argument, return index in parent
+ if ( !elem ) {
+ return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
+ }
+
+ // index in selector
+ if ( typeof elem === "string" ) {
+ return jQuery.inArray( this[0], jQuery( elem ) );
+ }
+
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ return this.pushStack(
+ jQuery.unique(
+ jQuery.merge( this.get(), jQuery( selector, context ) )
+ )
+ );
+ },
+
+ addBack: function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter(selector)
+ );
+ }
+});
+
+function sibling( cur, dir ) {
+ do {
+ cur = cur[ dir ];
+ } while ( cur && cur.nodeType !== 1 );
+
+ return cur;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return sibling( elem, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return sibling( elem, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.merge( [], elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until );
+
+ if ( name.slice( -5 ) !== "Until" ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ if ( this.length > 1 ) {
+ // Remove duplicates
+ if ( !guaranteedUnique[ name ] ) {
+ ret = jQuery.unique( ret );
+ }
+
+ // Reverse order for parents* and prev-derivatives
+ if ( rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+ }
+
+ return this.pushStack( ret );
+ };
+});
+var rnotwhite = (/\S+/g);
+
+
+
+// String to Object options format cache
+var optionsCache = {};
+
+// Convert String-formatted options into Object-formatted ones and store in cache
+function createOptions( options ) {
+ var object = optionsCache[ options ] = {};
+ jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
+ object[ flag ] = true;
+ });
+ return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ * options: an optional list of space-separated options that will change how
+ * the callback list behaves or a more traditional option object
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible options:
+ *
+ * once: will ensure the callback list can only be fired once (like a Deferred)
+ *
+ * memory: will keep track of previous values and will call any callback added
+ * after the list has been fired right away with the latest "memorized"
+ * values (like a Deferred)
+ *
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
+ *
+ * stopOnFalse: interrupt callings when a callback returns false
+ *
+ */
+jQuery.Callbacks = function( options ) {
+
+ // Convert options from String-formatted to Object-formatted if needed
+ // (we check in cache first)
+ options = typeof options === "string" ?
+ ( optionsCache[ options ] || createOptions( options ) ) :
+ jQuery.extend( {}, options );
+
+ var // Flag to know if list is currently firing
+ firing,
+ // Last fire value (for non-forgettable lists)
+ memory,
+ // Flag to know if list was already fired
+ fired,
+ // End of the loop when firing
+ firingLength,
+ // Index of currently firing callback (modified by remove if needed)
+ firingIndex,
+ // First callback to fire (used internally by add and fireWith)
+ firingStart,
+ // Actual callback list
+ list = [],
+ // Stack of fire calls for repeatable lists
+ stack = !options.once && [],
+ // Fire callbacks
+ fire = function( data ) {
+ memory = options.memory && data;
+ fired = true;
+ firingIndex = firingStart || 0;
+ firingStart = 0;
+ firingLength = list.length;
+ firing = true;
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
+ if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
+ memory = false; // To prevent further calls using add
+ break;
+ }
+ }
+ firing = false;
+ if ( list ) {
+ if ( stack ) {
+ if ( stack.length ) {
+ fire( stack.shift() );
+ }
+ } else if ( memory ) {
+ list = [];
+ } else {
+ self.disable();
+ }
+ }
+ },
+ // Actual Callbacks object
+ self = {
+ // Add a callback or a collection of callbacks to the list
+ add: function() {
+ if ( list ) {
+ // First, we save the current length
+ var start = list.length;
+ (function add( args ) {
+ jQuery.each( args, function( _, arg ) {
+ var type = jQuery.type( arg );
+ if ( type === "function" ) {
+ if ( !options.unique || !self.has( arg ) ) {
+ list.push( arg );
+ }
+ } else if ( arg && arg.length && type !== "string" ) {
+ // Inspect recursively
+ add( arg );
+ }
+ });
+ })( arguments );
+ // Do we need to add the callbacks to the
+ // current firing batch?
+ if ( firing ) {
+ firingLength = list.length;
+ // With memory, if we're not firing then
+ // we should call right away
+ } else if ( memory ) {
+ firingStart = start;
+ fire( memory );
+ }
+ }
+ return this;
+ },
+ // Remove a callback from the list
+ remove: function() {
+ if ( list ) {
+ jQuery.each( arguments, function( _, arg ) {
+ var index;
+ while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+ list.splice( index, 1 );
+ // Handle firing indexes
+ if ( firing ) {
+ if ( index <= firingLength ) {
+ firingLength--;
+ }
+ if ( index <= firingIndex ) {
+ firingIndex--;
+ }
+ }
+ }
+ });
+ }
+ return this;
+ },
+ // Check if a given callback is in the list.
+ // If no argument is given, return whether or not list has callbacks attached.
+ has: function( fn ) {
+ return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
+ },
+ // Remove all callbacks from the list
+ empty: function() {
+ list = [];
+ firingLength = 0;
+ return this;
+ },
+ // Have the list do nothing anymore
+ disable: function() {
+ list = stack = memory = undefined;
+ return this;
+ },
+ // Is it disabled?
+ disabled: function() {
+ return !list;
+ },
+ // Lock the list in its current state
+ lock: function() {
+ stack = undefined;
+ if ( !memory ) {
+ self.disable();
+ }
+ return this;
+ },
+ // Is it locked?
+ locked: function() {
+ return !stack;
+ },
+ // Call all callbacks with the given context and arguments
+ fireWith: function( context, args ) {
+ if ( list && ( !fired || stack ) ) {
+ args = args || [];
+ args = [ context, args.slice ? args.slice() : args ];
+ if ( firing ) {
+ stack.push( args );
+ } else {
+ fire( args );
+ }
+ }
+ return this;
+ },
+ // Call all the callbacks with the given arguments
+ fire: function() {
+ self.fireWith( this, arguments );
+ return this;
+ },
+ // To know if the callbacks have already been called at least once
+ fired: function() {
+ return !!fired;
+ }
+ };
+
+ return self;
+};
+
+
+jQuery.extend({
+
+ Deferred: function( func ) {
+ var tuples = [
+ // action, add listener, listener list, final state
+ [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
+ [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
+ [ "notify", "progress", jQuery.Callbacks("memory") ]
+ ],
+ state = "pending",
+ promise = {
+ state: function() {
+ return state;
+ },
+ always: function() {
+ deferred.done( arguments ).fail( arguments );
+ return this;
+ },
+ then: function( /* fnDone, fnFail, fnProgress */ ) {
+ var fns = arguments;
+ return jQuery.Deferred(function( newDefer ) {
+ jQuery.each( tuples, function( i, tuple ) {
+ var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
+ // deferred[ done | fail | progress ] for forwarding actions to newDefer
+ deferred[ tuple[1] ](function() {
+ var returned = fn && fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise()
+ .done( newDefer.resolve )
+ .fail( newDefer.reject )
+ .progress( newDefer.notify );
+ } else {
+ newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
+ }
+ });
+ });
+ fns = null;
+ }).promise();
+ },
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
+ }
+ },
+ deferred = {};
+
+ // Keep pipe for back-compat
+ promise.pipe = promise.then;
+
+ // Add list-specific methods
+ jQuery.each( tuples, function( i, tuple ) {
+ var list = tuple[ 2 ],
+ stateString = tuple[ 3 ];
+
+ // promise[ done | fail | progress ] = list.add
+ promise[ tuple[1] ] = list.add;
+
+ // Handle state
+ if ( stateString ) {
+ list.add(function() {
+ // state = [ resolved | rejected ]
+ state = stateString;
+
+ // [ reject_list | resolve_list ].disable; progress_list.lock
+ }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
+ }
+
+ // deferred[ resolve | reject | notify ]
+ deferred[ tuple[0] ] = function() {
+ deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
+ return this;
+ };
+ deferred[ tuple[0] + "With" ] = list.fireWith;
+ });
+
+ // Make the deferred a promise
+ promise.promise( deferred );
+
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+
+ // All done!
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( subordinate /* , ..., subordinateN */ ) {
+ var i = 0,
+ resolveValues = slice.call( arguments ),
+ length = resolveValues.length,
+
+ // the count of uncompleted subordinates
+ remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
+
+ // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
+ deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
+
+ // Update function for both resolve and progress values
+ updateFunc = function( i, contexts, values ) {
+ return function( value ) {
+ contexts[ i ] = this;
+ values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
+ if ( values === progressValues ) {
+ deferred.notifyWith( contexts, values );
+
+ } else if ( !(--remaining) ) {
+ deferred.resolveWith( contexts, values );
+ }
+ };
+ },
+
+ progressValues, progressContexts, resolveContexts;
+
+ // add listeners to Deferred subordinates; treat others as resolved
+ if ( length > 1 ) {
+ progressValues = new Array( length );
+ progressContexts = new Array( length );
+ resolveContexts = new Array( length );
+ for ( ; i < length; i++ ) {
+ if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
+ resolveValues[ i ].promise()
+ .done( updateFunc( i, resolveContexts, resolveValues ) )
+ .fail( deferred.reject )
+ .progress( updateFunc( i, progressContexts, progressValues ) );
+ } else {
+ --remaining;
+ }
+ }
+ }
+
+ // if we're not waiting on anything, resolve the master
+ if ( !remaining ) {
+ deferred.resolveWith( resolveContexts, resolveValues );
+ }
+
+ return deferred.promise();
+ }
+});
+
+
+// The deferred used on DOM ready
+var readyList;
+
+jQuery.fn.ready = function( fn ) {
+ // Add the callback
+ jQuery.ready.promise().done( fn );
+
+ return this;
+};
+
+jQuery.extend({
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+
+ // Abort if there are pending holds or we're already ready
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
+ return;
+ }
+
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.trigger ) {
+ jQuery( document ).trigger("ready").off("ready");
+ }
+ }
+});
+
+/**
+ * Clean-up method for dom ready events
+ */
+function detach() {
+ if ( document.addEventListener ) {
+ document.removeEventListener( "DOMContentLoaded", completed, false );
+ window.removeEventListener( "load", completed, false );
+
+ } else {
+ document.detachEvent( "onreadystatechange", completed );
+ window.detachEvent( "onload", completed );
+ }
+}
+
+/**
+ * The ready event handler and self cleanup method
+ */
+function completed() {
+ // readyState === "complete" is good enough for us to call the dom ready in oldIE
+ if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
+ detach();
+ jQuery.ready();
+ }
+}
+
+jQuery.ready.promise = function( obj ) {
+ if ( !readyList ) {
+
+ readyList = jQuery.Deferred();
+
+ // Catch cases where $(document).ready() is called after the browser event has already occurred.
+ // we once tried to use readyState "interactive" here, but it caused issues like the one
+ // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ setTimeout( jQuery.ready );
+
+ // Standards-based browsers support DOMContentLoaded
+ } else if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", completed, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", completed, false );
+
+ // If IE event model is used
+ } else {
+ // Ensure firing before onload, maybe late but safe also for iframes
+ document.attachEvent( "onreadystatechange", completed );
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", completed );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var top = false;
+
+ try {
+ top = window.frameElement == null && document.documentElement;
+ } catch(e) {}
+
+ if ( top && top.doScroll ) {
+ (function doScrollCheck() {
+ if ( !jQuery.isReady ) {
+
+ try {
+ // Use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ top.doScroll("left");
+ } catch(e) {
+ return setTimeout( doScrollCheck, 50 );
+ }
+
+ // detach all dom ready events
+ detach();
+
+ // and execute any waiting functions
+ jQuery.ready();
+ }
+ })();
+ }
+ }
+ }
+ return readyList.promise( obj );
+};
+
+
+var strundefined = typeof undefined;
+
+
+
+// Support: IE<9
+// Iteration over object's inherited properties before its own
+var i;
+for ( i in jQuery( support ) ) {
+ break;
+}
+support.ownLast = i !== "0";
+
+// Note: most support tests are defined in their respective modules.
+// false until the test is run
+support.inlineBlockNeedsLayout = false;
+
+jQuery(function() {
+ // We need to execute this one support test ASAP because we need to know
+ // if body.style.zoom needs to be set.
+
+ var container, div,
+ body = document.getElementsByTagName("body")[0];
+
+ if ( !body ) {
+ // Return for frameset docs that don't have a body
+ return;
+ }
+
+ // Setup
+ container = document.createElement( "div" );
+ container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
+
+ div = document.createElement( "div" );
+ body.appendChild( container ).appendChild( div );
+
+ if ( typeof div.style.zoom !== strundefined ) {
+ // Support: IE<8
+ // Check if natively block-level elements act like inline-block
+ // elements when setting their display to 'inline' and giving
+ // them layout
+ div.style.cssText = "border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1";
+
+ if ( (support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 )) ) {
+ // Prevent IE 6 from affecting layout for positioned elements #11048
+ // Prevent IE from shrinking the body in IE 7 mode #12869
+ // Support: IE<8
+ body.style.zoom = 1;
+ }
+ }
+
+ body.removeChild( container );
+
+ // Null elements to avoid leaks in IE
+ container = div = null;
+});
+
+
+
+
+(function() {
+ var div = document.createElement( "div" );
+
+ // Execute the test only if not already executed in another module.
+ if (support.deleteExpando == null) {
+ // Support: IE<9
+ support.deleteExpando = true;
+ try {
+ delete div.test;
+ } catch( e ) {
+ support.deleteExpando = false;
+ }
+ }
+
+ // Null elements to avoid leaks in IE.
+ div = null;
+})();
+
+
+/**
+ * Determines whether an object can have data
+ */
+jQuery.acceptData = function( elem ) {
+ var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ],
+ nodeType = +elem.nodeType || 1;
+
+ // Do not set data on non-element DOM nodes because it will not be cleared (#8335).
+ return nodeType !== 1 && nodeType !== 9 ?
+ false :
+
+ // Nodes accept data unless otherwise specified; rejection can be conditional
+ !noData || noData !== true && elem.getAttribute("classid") === noData;
+};
+
+
+var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
+ rmultiDash = /([A-Z])/g;
+
+function dataAttr( elem, key, data ) {
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+
+ var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
+
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+ // Only convert to a number if it doesn't change the string
+ +data + "" === data ? +data :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ jQuery.data( elem, key, data );
+
+ } else {
+ data = undefined;
+ }
+ }
+
+ return data;
+}
+
+// checks a cache object for emptiness
+function isEmptyDataObject( obj ) {
+ var name;
+ for ( name in obj ) {
+
+ // if the public data object is empty, the private is still empty
+ if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
+ continue;
+ }
+ if ( name !== "toJSON" ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var ret, thisCache,
+ internalKey = jQuery.expando,
+
+ // We have to handle DOM nodes and JS objects differently because IE6-7
+ // can't GC object references properly across the DOM-JS boundary
+ isNode = elem.nodeType,
+
+ // Only DOM nodes need the global jQuery cache; JS object data is
+ // attached directly to the object so GC can occur automatically
+ cache = isNode ? jQuery.cache : elem,
+
+ // Only defining an ID for JS objects if its cache already exists allows
+ // the code to shortcut on the same path as a DOM node with no cache
+ id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
+
+ // Avoid doing any more work than we need to when trying to get data on an
+ // object that has no data at all
+ if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
+ return;
+ }
+
+ if ( !id ) {
+ // Only DOM nodes need a new unique ID for each element since their data
+ // ends up in the global cache
+ if ( isNode ) {
+ id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++;
+ } else {
+ id = internalKey;
+ }
+ }
+
+ if ( !cache[ id ] ) {
+ // Avoid exposing jQuery metadata on plain JS objects when the object
+ // is serialized using JSON.stringify
+ cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
+ }
+
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
+ // shallow copied over onto the existing cache
+ if ( typeof name === "object" || typeof name === "function" ) {
+ if ( pvt ) {
+ cache[ id ] = jQuery.extend( cache[ id ], name );
+ } else {
+ cache[ id ].data = jQuery.extend( cache[ id ].data, name );
+ }
+ }
+
+ thisCache = cache[ id ];
+
+ // jQuery data() is stored in a separate object inside the object's internal data
+ // cache in order to avoid key collisions between internal data and user-defined
+ // data.
+ if ( !pvt ) {
+ if ( !thisCache.data ) {
+ thisCache.data = {};
+ }
+
+ thisCache = thisCache.data;
+ }
+
+ if ( data !== undefined ) {
+ thisCache[ jQuery.camelCase( name ) ] = data;
+ }
+
+ // Check for both converted-to-camel and non-converted data property names
+ // If a data property was specified
+ if ( typeof name === "string" ) {
+
+ // First Try to find as-is property data
+ ret = thisCache[ name ];
+
+ // Test for null|undefined property data
+ if ( ret == null ) {
+
+ // Try to find the camelCased property
+ ret = thisCache[ jQuery.camelCase( name ) ];
+ }
+ } else {
+ ret = thisCache;
+ }
+
+ return ret;
+}
+
+function internalRemoveData( elem, name, pvt ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var thisCache, i,
+ isNode = elem.nodeType,
+
+ // See jQuery.data for more information
+ cache = isNode ? jQuery.cache : elem,
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
+
+ // If there is already no cache entry for this object, there is no
+ // purpose in continuing
+ if ( !cache[ id ] ) {
+ return;
+ }
+
+ if ( name ) {
+
+ thisCache = pvt ? cache[ id ] : cache[ id ].data;
+
+ if ( thisCache ) {
+
+ // Support array or space separated string names for data keys
+ if ( !jQuery.isArray( name ) ) {
+
+ // try the string as a key before any manipulation
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+
+ // split the camel cased version by spaces unless a key with the spaces exists
+ name = jQuery.camelCase( name );
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+ name = name.split(" ");
+ }
+ }
+ } else {
+ // If "name" is an array of keys...
+ // When data is initially created, via ("key", "val") signature,
+ // keys will be converted to camelCase.
+ // Since there is no way to tell _how_ a key was added, remove
+ // both plain key and camelCase key. #12786
+ // This will only penalize the array argument path.
+ name = name.concat( jQuery.map( name, jQuery.camelCase ) );
+ }
+
+ i = name.length;
+ while ( i-- ) {
+ delete thisCache[ name[i] ];
+ }
+
+ // If there is no data left in the cache, we want to continue
+ // and let the cache object itself get destroyed
+ if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {
+ return;
+ }
+ }
+ }
+
+ // See jQuery.data for more information
+ if ( !pvt ) {
+ delete cache[ id ].data;
+
+ // Don't destroy the parent cache unless the internal data object
+ // had been the only thing left in it
+ if ( !isEmptyDataObject( cache[ id ] ) ) {
+ return;
+ }
+ }
+
+ // Destroy the cache
+ if ( isNode ) {
+ jQuery.cleanData( [ elem ], true );
+
+ // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
+ /* jshint eqeqeq: false */
+ } else if ( support.deleteExpando || cache != cache.window ) {
+ /* jshint eqeqeq: true */
+ delete cache[ id ];
+
+ // When all else fails, null
+ } else {
+ cache[ id ] = null;
+ }
+}
+
+jQuery.extend({
+ cache: {},
+
+ // The following elements (space-suffixed to avoid Object.prototype collisions)
+ // throw uncatchable exceptions if you attempt to set expando properties
+ noData: {
+ "applet ": true,
+ "embed ": true,
+ // ...but Flash objects (which have this classid) *can* handle expandos
+ "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+ },
+
+ hasData: function( elem ) {
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
+ return !!elem && !isEmptyDataObject( elem );
+ },
+
+ data: function( elem, name, data ) {
+ return internalData( elem, name, data );
+ },
+
+ removeData: function( elem, name ) {
+ return internalRemoveData( elem, name );
+ },
+
+ // For internal use only.
+ _data: function( elem, name, data ) {
+ return internalData( elem, name, data, true );
+ },
+
+ _removeData: function( elem, name ) {
+ return internalRemoveData( elem, name, true );
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ var i, name, data,
+ elem = this[0],
+ attrs = elem && elem.attributes;
+
+ // Special expections of .data basically thwart jQuery.access,
+ // so implement the relevant behavior ourselves
+
+ // Gets all values
+ if ( key === undefined ) {
+ if ( this.length ) {
+ data = jQuery.data( elem );
+
+ if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
+ i = attrs.length;
+ while ( i-- ) {
+ name = attrs[i].name;
+
+ if ( name.indexOf("data-") === 0 ) {
+ name = jQuery.camelCase( name.slice(5) );
+
+ dataAttr( elem, name, data[ name ] );
+ }
+ }
+ jQuery._data( elem, "parsedAttrs", true );
+ }
+ }
+
+ return data;
+ }
+
+ // Sets multiple values
+ if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ return arguments.length > 1 ?
+
+ // Sets one value
+ this.each(function() {
+ jQuery.data( this, key, value );
+ }) :
+
+ // Gets one value
+ // Try to fetch any internally stored data first
+ elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined;
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+
+
+jQuery.extend({
+ queue: function( elem, type, data ) {
+ var queue;
+
+ if ( elem ) {
+ type = ( type || "fx" ) + "queue";
+ queue = jQuery._data( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !queue || jQuery.isArray(data) ) {
+ queue = jQuery._data( elem, type, jQuery.makeArray(data) );
+ } else {
+ queue.push( data );
+ }
+ }
+ return queue || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ startLength = queue.length,
+ fn = queue.shift(),
+ hooks = jQuery._queueHooks( elem, type ),
+ next = function() {
+ jQuery.dequeue( elem, type );
+ };
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ startLength--;
+ }
+
+ if ( fn ) {
+
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift( "inprogress" );
+ }
+
+ // clear up the last queue stop function
+ delete hooks.stop;
+ fn.call( elem, next, hooks );
+ }
+
+ if ( !startLength && hooks ) {
+ hooks.empty.fire();
+ }
+ },
+
+ // not intended for public consumption - generates a queueHooks object, or returns the current one
+ _queueHooks: function( elem, type ) {
+ var key = type + "queueHooks";
+ return jQuery._data( elem, key ) || jQuery._data( elem, key, {
+ empty: jQuery.Callbacks("once memory").add(function() {
+ jQuery._removeData( elem, type + "queue" );
+ jQuery._removeData( elem, key );
+ })
+ });
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ var setter = 2;
+
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ setter--;
+ }
+
+ if ( arguments.length < setter ) {
+ return jQuery.queue( this[0], type );
+ }
+
+ return data === undefined ?
+ this :
+ this.each(function() {
+ var queue = jQuery.queue( this, type, data );
+
+ // ensure a hooks for this queue
+ jQuery._queueHooks( this, type );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, obj ) {
+ var tmp,
+ count = 1,
+ defer = jQuery.Deferred(),
+ elements = this,
+ i = this.length,
+ resolve = function() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ };
+
+ if ( typeof type !== "string" ) {
+ obj = type;
+ type = undefined;
+ }
+ type = type || "fx";
+
+ while ( i-- ) {
+ tmp = jQuery._data( elements[ i ], type + "queueHooks" );
+ if ( tmp && tmp.empty ) {
+ count++;
+ tmp.empty.add( resolve );
+ }
+ }
+ resolve();
+ return defer.promise( obj );
+ }
+});
+var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
+
+var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
+
+var isHidden = function( elem, el ) {
+ // isHidden might be called from jQuery#filter function;
+ // in that case, element will be second argument
+ elem = el || elem;
+ return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
+ };
+
+
+
+// Multifunctional method to get and set values of a collection
+// The value/s can optionally be executed if it's a function
+var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
+ var i = 0,
+ length = elems.length,
+ bulk = key == null;
+
+ // Sets many values
+ if ( jQuery.type( key ) === "object" ) {
+ chainable = true;
+ for ( i in key ) {
+ jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
+ }
+
+ // Sets one value
+ } else if ( value !== undefined ) {
+ chainable = true;
+
+ if ( !jQuery.isFunction( value ) ) {
+ raw = true;
+ }
+
+ if ( bulk ) {
+ // Bulk operations run against the entire set
+ if ( raw ) {
+ fn.call( elems, value );
+ fn = null;
+
+ // ...except when executing function values
+ } else {
+ bulk = fn;
+ fn = function( elem, key, value ) {
+ return bulk.call( jQuery( elem ), value );
+ };
+ }
+ }
+
+ if ( fn ) {
+ for ( ; i < length; i++ ) {
+ fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
+ }
+ }
+ }
+
+ return chainable ?
+ elems :
+
+ // Gets
+ bulk ?
+ fn.call( elems ) :
+ length ? fn( elems[0], key ) : emptyGet;
+};
+var rcheckableType = (/^(?:checkbox|radio)$/i);
+
+
+
+(function() {
+ var fragment = document.createDocumentFragment(),
+ div = document.createElement("div"),
+ input = document.createElement("input");
+
+ // Setup
+ div.setAttribute( "className", "t" );
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a>";
+
+ // IE strips leading whitespace when .innerHTML is used
+ support.leadingWhitespace = div.firstChild.nodeType === 3;
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ support.tbody = !div.getElementsByTagName( "tbody" ).length;
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;
+
+ // Makes sure cloning an html5 element does not cause problems
+ // Where outerHTML is undefined, this still works
+ support.html5Clone =
+ document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";
+
+ // Check if a disconnected checkbox will retain its checked
+ // value of true after appended to the DOM (IE6/7)
+ input.type = "checkbox";
+ input.checked = true;
+ fragment.appendChild( input );
+ support.appendChecked = input.checked;
+
+ // Make sure textarea (and checkbox) defaultValue is properly cloned
+ // Support: IE6-IE11+
+ div.innerHTML = "<textarea>x</textarea>";
+ support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
+
+ // #11217 - WebKit loses check when the name is after the checked attribute
+ fragment.appendChild( div );
+ div.innerHTML = "<input type='radio' checked='checked' name='t'/>";
+
+ // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
+ // old WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ // Support: IE<9
+ // Opera does not clone events (and typeof div.attachEvent === undefined).
+ // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
+ support.noCloneEvent = true;
+ if ( div.attachEvent ) {
+ div.attachEvent( "onclick", function() {
+ support.noCloneEvent = false;
+ });
+
+ div.cloneNode( true ).click();
+ }
+
+ // Execute the test only if not already executed in another module.
+ if (support.deleteExpando == null) {
+ // Support: IE<9
+ support.deleteExpando = true;
+ try {
+ delete div.test;
+ } catch( e ) {
+ support.deleteExpando = false;
+ }
+ }
+
+ // Null elements to avoid leaks in IE.
+ fragment = div = input = null;
+})();
+
+
+(function() {
+ var i, eventName,
+ div = document.createElement( "div" );
+
+ // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event)
+ for ( i in { submit: true, change: true, focusin: true }) {
+ eventName = "on" + i;
+
+ if ( !(support[ i + "Bubbles" ] = eventName in window) ) {
+ // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
+ div.setAttribute( eventName, "t" );
+ support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false;
+ }
+ }
+
+ // Null elements to avoid leaks in IE.
+ div = null;
+})();
+
+
+var rformElems = /^(?:input|select|textarea)$/i,
+ rkeyEvent = /^key/,
+ rmouseEvent = /^(?:mouse|contextmenu)|click/,
+ rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
+ rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
+
+function returnTrue() {
+ return true;
+}
+
+function returnFalse() {
+ return false;
+}
+
+function safeActiveElement() {
+ try {
+ return document.activeElement;
+ } catch ( err ) { }
+}
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+ global: {},
+
+ add: function( elem, types, handler, data, selector ) {
+ var tmp, events, t, handleObjIn,
+ special, eventHandle, handleObj,
+ handlers, type, namespaces, origType,
+ elemData = jQuery._data( elem );
+
+ // Don't attach events to noData or text/comment nodes (but allow plain objects)
+ if ( !elemData ) {
+ return;
+ }
+
+ // Caller can pass in an object of custom data in lieu of the handler
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ selector = handleObjIn.selector;
+ }
+
+ // Make sure that the handler has a unique ID, used to find/remove it later
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure and main handler, if this is the first
+ if ( !(events = elemData.events) ) {
+ events = elemData.events = {};
+ }
+ if ( !(eventHandle = elemData.handle) ) {
+ eventHandle = elemData.handle = function( e ) {
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ?
+ jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+ // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
+ eventHandle.elem = elem;
+ }
+
+ // Handle multiple events separated by a space
+ types = ( types || "" ).match( rnotwhite ) || [ "" ];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tmp[1];
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
+
+ // There *must* be a type, no attaching namespace-only handlers
+ if ( !type ) {
+ continue;
+ }
+
+ // If event changes its type, use the special event handlers for the changed type
+ special = jQuery.event.special[ type ] || {};
+
+ // If selector defined, determine special event api type, otherwise given type
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+
+ // Update special based on newly reset type
+ special = jQuery.event.special[ type ] || {};
+
+ // handleObj is passed to all event handlers
+ handleObj = jQuery.extend({
+ type: type,
+ origType: origType,
+ data: data,
+ handler: handler,
+ guid: handler.guid,
+ selector: selector,
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
+ namespace: namespaces.join(".")
+ }, handleObjIn );
+
+ // Init the event handler queue if we're the first
+ if ( !(handlers = events[ type ]) ) {
+ handlers = events[ type ] = [];
+ handlers.delegateCount = 0;
+
+ // Only use addEventListener/attachEvent if the special events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add to the element's handler list, delegates in front
+ if ( selector ) {
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
+ } else {
+ handlers.push( handleObj );
+ }
+
+ // Keep track of which events have ever been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, selector, mappedTypes ) {
+ var j, handleObj, tmp,
+ origCount, t, events,
+ special, handlers, type,
+ namespaces, origType,
+ elemData = jQuery.hasData( elem ) && jQuery._data( elem );
+
+ if ( !elemData || !(events = elemData.events) ) {
+ return;
+ }
+
+ // Once for each type.namespace in types; type may be omitted
+ types = ( types || "" ).match( rnotwhite ) || [ "" ];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tmp[1];
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
+
+ // Unbind all events (on this namespace, if provided) for the element
+ if ( !type ) {
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
+ }
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+ handlers = events[ type ] || [];
+ tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
+
+ // Remove matching events
+ origCount = j = handlers.length;
+ while ( j-- ) {
+ handleObj = handlers[ j ];
+
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
+ ( !handler || handler.guid === handleObj.guid ) &&
+ ( !tmp || tmp.test( handleObj.namespace ) ) &&
+ ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
+ handlers.splice( j, 1 );
+
+ if ( handleObj.selector ) {
+ handlers.delegateCount--;
+ }
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+ }
+
+ // Remove generic event handler if we removed something and no more handlers exist
+ // (avoids potential for endless recursion during removal of special event handlers)
+ if ( origCount && !handlers.length ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ delete elemData.handle;
+
+ // removeData also checks for emptiness and clears the expando if empty
+ // so use it instead of delete
+ jQuery._removeData( elem, "events" );
+ }
+ },
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+ var handle, ontype, cur,
+ bubbleType, special, tmp, i,
+ eventPath = [ elem || document ],
+ type = hasOwn.call( event, "type" ) ? event.type : event,
+ namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
+
+ cur = tmp = elem = elem || document;
+
+ // Don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
+ return;
+ }
+
+ if ( type.indexOf(".") >= 0 ) {
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+ ontype = type.indexOf(":") < 0 && "on" + type;
+
+ // Caller can pass in a jQuery.Event object, Object, or just an event type string
+ event = event[ jQuery.expando ] ?
+ event :
+ new jQuery.Event( type, typeof event === "object" && event );
+
+ // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
+ event.isTrigger = onlyHandlers ? 2 : 3;
+ event.namespace = namespaces.join(".");
+ event.namespace_re = event.namespace ?
+ new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
+ null;
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ if ( !event.target ) {
+ event.target = elem;
+ }
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data == null ?
+ [ event ] :
+ jQuery.makeArray( data, [ event ] );
+
+ // Allow special events to draw outside the lines
+ special = jQuery.event.special[ type ] || {};
+ if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
+ return;
+ }
+
+ // Determine event propagation path in advance, per W3C events spec (#9951)
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
+
+ bubbleType = special.delegateType || type;
+ if ( !rfocusMorph.test( bubbleType + type ) ) {
+ cur = cur.parentNode;
+ }
+ for ( ; cur; cur = cur.parentNode ) {
+ eventPath.push( cur );
+ tmp = cur;
+ }
+
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
+ if ( tmp === (elem.ownerDocument || document) ) {
+ eventPath.push( tmp.defaultView || tmp.parentWindow || window );
+ }
+ }
+
+ // Fire handlers on the event path
+ i = 0;
+ while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
+
+ event.type = i > 1 ?
+ bubbleType :
+ special.bindType || type;
+
+ // jQuery handler
+ handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+
+ // Native handler
+ handle = ontype && cur[ ontype ];
+ if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
+ event.result = handle.apply( cur, data );
+ if ( event.result === false ) {
+ event.preventDefault();
+ }
+ }
+ }
+ event.type = type;
+
+ // If nobody prevented the default action, do it now
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
+
+ if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
+ jQuery.acceptData( elem ) ) {
+
+ // Call a native DOM method on the target with the same name name as the event.
+ // Can't use an .isFunction() check here because IE6/7 fails that test.
+ // Don't do default actions on window, that's where global variables be (#6170)
+ if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
+
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ tmp = elem[ ontype ];
+
+ if ( tmp ) {
+ elem[ ontype ] = null;
+ }
+
+ // Prevent re-triggering of the same event, since we already bubbled it above
+ jQuery.event.triggered = type;
+ try {
+ elem[ type ]();
+ } catch ( e ) {
+ // IE<9 dies on focus/blur to hidden element (#1486,#12518)
+ // only reproducible on winXP IE8 native, not IE9 in IE8 mode
+ }
+ jQuery.event.triggered = undefined;
+
+ if ( tmp ) {
+ elem[ ontype ] = tmp;
+ }
+ }
+ }
+ }
+
+ return event.result;
+ },
+
+ dispatch: function( event ) {
+
+ // Make a writable jQuery.Event from the native event object
+ event = jQuery.event.fix( event );
+
+ var i, ret, handleObj, matched, j,
+ handlerQueue = [],
+ args = slice.call( arguments ),
+ handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
+ special = jQuery.event.special[ event.type ] || {};
+
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
+ args[0] = event;
+ event.delegateTarget = this;
+
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
+ return;
+ }
+
+ // Determine handlers
+ handlerQueue = jQuery.event.handlers.call( this, event, handlers );
+
+ // Run delegates first; they may want to stop propagation beneath us
+ i = 0;
+ while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
+ event.currentTarget = matched.elem;
+
+ j = 0;
+ while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
+
+ // Triggered event must either 1) have no namespace, or
+ // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
+ if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
+
+ event.handleObj = handleObj;
+ event.data = handleObj.data;
+
+ ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
+ .apply( matched.elem, args );
+
+ if ( ret !== undefined ) {
+ if ( (event.result = ret) === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+ }
+ }
+ }
+
+ // Call the postDispatch hook for the mapped type
+ if ( special.postDispatch ) {
+ special.postDispatch.call( this, event );
+ }
+
+ return event.result;
+ },
+
+ handlers: function( event, handlers ) {
+ var sel, handleObj, matches, i,
+ handlerQueue = [],
+ delegateCount = handlers.delegateCount,
+ cur = event.target;
+
+ // Find delegate handlers
+ // Black-hole SVG <use> instance trees (#13180)
+ // Avoid non-left-click bubbling in Firefox (#3861)
+ if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
+
+ /* jshint eqeqeq: false */
+ for ( ; cur != this; cur = cur.parentNode || this ) {
+ /* jshint eqeqeq: true */
+
+ // Don't check non-elements (#13208)
+ // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
+ if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
+ matches = [];
+ for ( i = 0; i < delegateCount; i++ ) {
+ handleObj = handlers[ i ];
+
+ // Don't conflict with Object.prototype properties (#13203)
+ sel = handleObj.selector + " ";
+
+ if ( matches[ sel ] === undefined ) {
+ matches[ sel ] = handleObj.needsContext ?
+ jQuery( sel, this ).index( cur ) >= 0 :
+ jQuery.find( sel, this, null, [ cur ] ).length;
+ }
+ if ( matches[ sel ] ) {
+ matches.push( handleObj );
+ }
+ }
+ if ( matches.length ) {
+ handlerQueue.push({ elem: cur, handlers: matches });
+ }
+ }
+ }
+ }
+
+ // Add the remaining (directly-bound) handlers
+ if ( delegateCount < handlers.length ) {
+ handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
+ }
+
+ return handlerQueue;
+ },
+
+ fix: function( event ) {
+ if ( event[ jQuery.expando ] ) {
+ return event;
+ }
+
+ // Create a writable copy of the event object and normalize some properties
+ var i, prop, copy,
+ type = event.type,
+ originalEvent = event,
+ fixHook = this.fixHooks[ type ];
+
+ if ( !fixHook ) {
+ this.fixHooks[ type ] = fixHook =
+ rmouseEvent.test( type ) ? this.mouseHooks :
+ rkeyEvent.test( type ) ? this.keyHooks :
+ {};
+ }
+ copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
+
+ event = new jQuery.Event( originalEvent );
+
+ i = copy.length;
+ while ( i-- ) {
+ prop = copy[ i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Support: IE<9
+ // Fix target property (#1925)
+ if ( !event.target ) {
+ event.target = originalEvent.srcElement || document;
+ }
+
+ // Support: Chrome 23+, Safari?
+ // Target should not be a text node (#504, #13143)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // Support: IE<9
+ // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
+ event.metaKey = !!event.metaKey;
+
+ return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
+ },
+
+ // Includes some event props shared by KeyEvent and MouseEvent
+ props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
+
+ fixHooks: {},
+
+ keyHooks: {
+ props: "char charCode key keyCode".split(" "),
+ filter: function( event, original ) {
+
+ // Add which for key events
+ if ( event.which == null ) {
+ event.which = original.charCode != null ? original.charCode : original.keyCode;
+ }
+
+ return event;
+ }
+ },
+
+ mouseHooks: {
+ props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
+ filter: function( event, original ) {
+ var body, eventDoc, doc,
+ button = original.button,
+ fromElement = original.fromElement;
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && original.clientX != null ) {
+ eventDoc = event.target.ownerDocument || document;
+ doc = eventDoc.documentElement;
+ body = eventDoc.body;
+
+ event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
+ event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && fromElement ) {
+ event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && button !== undefined ) {
+ event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
+ }
+
+ return event;
+ }
+ },
+
+ special: {
+ load: {
+ // Prevent triggered image.load events from bubbling to window.load
+ noBubble: true
+ },
+ focus: {
+ // Fire native event if possible so blur/focus sequence is correct
+ trigger: function() {
+ if ( this !== safeActiveElement() && this.focus ) {
+ try {
+ this.focus();
+ return false;
+ } catch ( e ) {
+ // Support: IE<9
+ // If we error on focus to hidden element (#1486, #12518),
+ // let .trigger() run the handlers
+ }
+ }
+ },
+ delegateType: "focusin"
+ },
+ blur: {
+ trigger: function() {
+ if ( this === safeActiveElement() && this.blur ) {
+ this.blur();
+ return false;
+ }
+ },
+ delegateType: "focusout"
+ },
+ click: {
+ // For checkbox, fire native event so checked state will be right
+ trigger: function() {
+ if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
+ this.click();
+ return false;
+ }
+ },
+
+ // For cross-browser consistency, don't fire native .click() on links
+ _default: function( event ) {
+ return jQuery.nodeName( event.target, "a" );
+ }
+ },
+
+ beforeunload: {
+ postDispatch: function( event ) {
+
+ // Even when returnValue equals to undefined Firefox will still show alert
+ if ( event.result !== undefined ) {
+ event.originalEvent.returnValue = event.result;
+ }
+ }
+ }
+ },
+
+ simulate: function( type, elem, event, bubble ) {
+ // Piggyback on a donor event to simulate a different one.
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
+ // simulated event prevents default then we do the same on the donor.
+ var e = jQuery.extend(
+ new jQuery.Event(),
+ event,
+ {
+ type: type,
+ isSimulated: true,
+ originalEvent: {}
+ }
+ );
+ if ( bubble ) {
+ jQuery.event.trigger( e, null, elem );
+ } else {
+ jQuery.event.dispatch.call( elem, e );
+ }
+ if ( e.isDefaultPrevented() ) {
+ event.preventDefault();
+ }
+ }
+};
+
+jQuery.removeEvent = document.removeEventListener ?
+ function( elem, type, handle ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle, false );
+ }
+ } :
+ function( elem, type, handle ) {
+ var name = "on" + type;
+
+ if ( elem.detachEvent ) {
+
+ // #8545, #7054, preventing memory leaks for custom events in IE6-8
+ // detachEvent needed property on element, by name of that event, to properly expose it to GC
+ if ( typeof elem[ name ] === strundefined ) {
+ elem[ name ] = null;
+ }
+
+ elem.detachEvent( name, handle );
+ }
+ };
+
+jQuery.Event = function( src, props ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !(this instanceof jQuery.Event) ) {
+ return new jQuery.Event( src, props );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+
+ // Events bubbling up the document may have been marked as prevented
+ // by a handler lower down the tree; reflect the correct value.
+ this.isDefaultPrevented = src.defaultPrevented ||
+ src.defaultPrevented === undefined && (
+ // Support: IE < 9
+ src.returnValue === false ||
+ // Support: Android < 4.0
+ src.getPreventDefault && src.getPreventDefault() ) ?
+ returnTrue :
+ returnFalse;
+
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // Put explicitly provided properties onto the event object
+ if ( props ) {
+ jQuery.extend( this, props );
+ }
+
+ // Create a timestamp if incoming event doesn't have one
+ this.timeStamp = src && src.timeStamp || jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse,
+
+ preventDefault: function() {
+ var e = this.originalEvent;
+
+ this.isDefaultPrevented = returnTrue;
+ if ( !e ) {
+ return;
+ }
+
+ // If preventDefault exists, run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+
+ // Support: IE
+ // Otherwise set the returnValue property of the original event to false
+ } else {
+ e.returnValue = false;
+ }
+ },
+ stopPropagation: function() {
+ var e = this.originalEvent;
+
+ this.isPropagationStopped = returnTrue;
+ if ( !e ) {
+ return;
+ }
+ // If stopPropagation exists, run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+
+ // Support: IE
+ // Set the cancelBubble property of the original event to true
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ }
+};
+
+// Create mouseenter/leave events using mouseover/out and event-time checks
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ delegateType: fix,
+ bindType: fix,
+
+ handle: function( event ) {
+ var ret,
+ target = this,
+ related = event.relatedTarget,
+ handleObj = event.handleObj;
+
+ // For mousenter/leave call the handler if related is outside the target.
+ // NB: No relatedTarget if the mouse left/entered the browser window
+ if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
+ event.type = handleObj.origType;
+ ret = handleObj.handler.apply( this, arguments );
+ event.type = fix;
+ }
+ return ret;
+ }
+ };
+});
+
+// IE submit delegation
+if ( !support.submitBubbles ) {
+
+ jQuery.event.special.submit = {
+ setup: function() {
+ // Only need this for delegated form submit events
+ if ( jQuery.nodeName( this, "form" ) ) {
+ return false;
+ }
+
+ // Lazy-add a submit handler when a descendant form may potentially be submitted
+ jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
+ // Node name check avoids a VML-related crash in IE (#9807)
+ var elem = e.target,
+ form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
+ if ( form && !jQuery._data( form, "submitBubbles" ) ) {
+ jQuery.event.add( form, "submit._submit", function( event ) {
+ event._submit_bubble = true;
+ });
+ jQuery._data( form, "submitBubbles", true );
+ }
+ });
+ // return undefined since we don't need an event listener
+ },
+
+ postDispatch: function( event ) {
+ // If form was submitted by the user, bubble the event up the tree
+ if ( event._submit_bubble ) {
+ delete event._submit_bubble;
+ if ( this.parentNode && !event.isTrigger ) {
+ jQuery.event.simulate( "submit", this.parentNode, event, true );
+ }
+ }
+ },
+
+ teardown: function() {
+ // Only need this for delegated form submit events
+ if ( jQuery.nodeName( this, "form" ) ) {
+ return false;
+ }
+
+ // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
+ jQuery.event.remove( this, "._submit" );
+ }
+ };
+}
+
+// IE change delegation and checkbox/radio fix
+if ( !support.changeBubbles ) {
+
+ jQuery.event.special.change = {
+
+ setup: function() {
+
+ if ( rformElems.test( this.nodeName ) ) {
+ // IE doesn't fire change on a check/radio until blur; trigger it on click
+ // after a propertychange. Eat the blur-change in special.change.handle.
+ // This still fires onchange a second time for check/radio after blur.
+ if ( this.type === "checkbox" || this.type === "radio" ) {
+ jQuery.event.add( this, "propertychange._change", function( event ) {
+ if ( event.originalEvent.propertyName === "checked" ) {
+ this._just_changed = true;
+ }
+ });
+ jQuery.event.add( this, "click._change", function( event ) {
+ if ( this._just_changed && !event.isTrigger ) {
+ this._just_changed = false;
+ }
+ // Allow triggered, simulated change events (#11500)
+ jQuery.event.simulate( "change", this, event, true );
+ });
+ }
+ return false;
+ }
+ // Delegated event; lazy-add a change handler on descendant inputs
+ jQuery.event.add( this, "beforeactivate._change", function( e ) {
+ var elem = e.target;
+
+ if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
+ jQuery.event.add( elem, "change._change", function( event ) {
+ if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
+ jQuery.event.simulate( "change", this.parentNode, event, true );
+ }
+ });
+ jQuery._data( elem, "changeBubbles", true );
+ }
+ });
+ },
+
+ handle: function( event ) {
+ var elem = event.target;
+
+ // Swallow native change events from checkbox/radio, we already triggered them above
+ if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
+ return event.handleObj.handler.apply( this, arguments );
+ }
+ },
+
+ teardown: function() {
+ jQuery.event.remove( this, "._change" );
+
+ return !rformElems.test( this.nodeName );
+ }
+ };
+}
+
+// Create "bubbling" focus and blur events
+if ( !support.focusinBubbles ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+
+ // Attach a single capturing handler on the document while someone wants focusin/focusout
+ var handler = function( event ) {
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
+ };
+
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ var doc = this.ownerDocument || this,
+ attaches = jQuery._data( doc, fix );
+
+ if ( !attaches ) {
+ doc.addEventListener( orig, handler, true );
+ }
+ jQuery._data( doc, fix, ( attaches || 0 ) + 1 );
+ },
+ teardown: function() {
+ var doc = this.ownerDocument || this,
+ attaches = jQuery._data( doc, fix ) - 1;
+
+ if ( !attaches ) {
+ doc.removeEventListener( orig, handler, true );
+ jQuery._removeData( doc, fix );
+ } else {
+ jQuery._data( doc, fix, attaches );
+ }
+ }
+ };
+ });
+}
+
+jQuery.fn.extend({
+
+ on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
+ var type, origFn;
+
+ // Types can be a map of types/handlers
+ if ( typeof types === "object" ) {
+ // ( types-Object, selector, data )
+ if ( typeof selector !== "string" ) {
+ // ( types-Object, data )
+ data = data || selector;
+ selector = undefined;
+ }
+ for ( type in types ) {
+ this.on( type, selector, data, types[ type ], one );
+ }
+ return this;
+ }
+
+ if ( data == null && fn == null ) {
+ // ( types, fn )
+ fn = selector;
+ data = selector = undefined;
+ } else if ( fn == null ) {
+ if ( typeof selector === "string" ) {
+ // ( types, selector, fn )
+ fn = data;
+ data = undefined;
+ } else {
+ // ( types, data, fn )
+ fn = data;
+ data = selector;
+ selector = undefined;
+ }
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ } else if ( !fn ) {
+ return this;
+ }
+
+ if ( one === 1 ) {
+ origFn = fn;
+ fn = function( event ) {
+ // Can use an empty set, since event contains the info
+ jQuery().off( event );
+ return origFn.apply( this, arguments );
+ };
+ // Use same guid so caller can remove using origFn
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
+ }
+ return this.each( function() {
+ jQuery.event.add( this, types, fn, data, selector );
+ });
+ },
+ one: function( types, selector, data, fn ) {
+ return this.on( types, selector, data, fn, 1 );
+ },
+ off: function( types, selector, fn ) {
+ var handleObj, type;
+ if ( types && types.preventDefault && types.handleObj ) {
+ // ( event ) dispatched jQuery.Event
+ handleObj = types.handleObj;
+ jQuery( types.delegateTarget ).off(
+ handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
+ handleObj.selector,
+ handleObj.handler
+ );
+ return this;
+ }
+ if ( typeof types === "object" ) {
+ // ( types-object [, selector] )
+ for ( type in types ) {
+ this.off( type, selector, types[ type ] );
+ }
+ return this;
+ }
+ if ( selector === false || typeof selector === "function" ) {
+ // ( types [, fn] )
+ fn = selector;
+ selector = undefined;
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ }
+ return this.each(function() {
+ jQuery.event.remove( this, types, fn, selector );
+ });
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+ triggerHandler: function( type, data ) {
+ var elem = this[0];
+ if ( elem ) {
+ return jQuery.event.trigger( type, data, elem, true );
+ }
+ }
+});
+
+
+function createSafeFragment( document ) {
+ var list = nodeNames.split( "|" ),
+ safeFrag = document.createDocumentFragment();
+
+ if ( safeFrag.createElement ) {
+ while ( list.length ) {
+ safeFrag.createElement(
+ list.pop()
+ );
+ }
+ }
+ return safeFrag;
+}
+
+var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
+ "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
+ rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
+ rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
+ rtagName = /<([\w:]+)/,
+ rtbody = /<tbody/i,
+ rhtml = /<|&#?\w+;/,
+ rnoInnerhtml = /<(?:script|style|link)/i,
+ // checked="checked" or checked
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+ rscriptType = /^$|\/(?:java|ecma)script/i,
+ rscriptTypeMasked = /^true\/(.*)/,
+ rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
+
+ // We have to close these tags to support XHTML (#13200)
+ wrapMap = {
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
+ legend: [ 1, "<fieldset>", "</fieldset>" ],
+ area: [ 1, "<map>", "</map>" ],
+ param: [ 1, "<object>", "</object>" ],
+ thead: [ 1, "<table>", "</table>" ],
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
+ col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+
+ // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
+ // unless wrapped in a div with non-breaking characters in front of it.
+ _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
+ },
+ safeFragment = createSafeFragment( document ),
+ fragmentDiv = safeFragment.appendChild( document.createElement("div") );
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+function getAll( context, tag ) {
+ var elems, elem,
+ i = 0,
+ found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) :
+ typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) :
+ undefined;
+
+ if ( !found ) {
+ for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
+ if ( !tag || jQuery.nodeName( elem, tag ) ) {
+ found.push( elem );
+ } else {
+ jQuery.merge( found, getAll( elem, tag ) );
+ }
+ }
+ }
+
+ return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
+ jQuery.merge( [ context ], found ) :
+ found;
+}
+
+// Used in buildFragment, fixes the defaultChecked property
+function fixDefaultChecked( elem ) {
+ if ( rcheckableType.test( elem.type ) ) {
+ elem.defaultChecked = elem.checked;
+ }
+}
+
+// Support: IE<8
+// Manipulating tables requires a tbody
+function manipulationTarget( elem, content ) {
+ return jQuery.nodeName( elem, "table" ) &&
+ jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
+
+ elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
+ elem;
+}
+
+// Replace/restore the type attribute of script elements for safe DOM manipulation
+function disableScript( elem ) {
+ elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
+ return elem;
+}
+function restoreScript( elem ) {
+ var match = rscriptTypeMasked.exec( elem.type );
+ if ( match ) {
+ elem.type = match[1];
+ } else {
+ elem.removeAttribute("type");
+ }
+ return elem;
+}
+
+// Mark scripts as having already been evaluated
+function setGlobalEval( elems, refElements ) {
+ var elem,
+ i = 0;
+ for ( ; (elem = elems[i]) != null; i++ ) {
+ jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
+ }
+}
+
+function cloneCopyEvent( src, dest ) {
+
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
+ return;
+ }
+
+ var type, i, l,
+ oldData = jQuery._data( src ),
+ curData = jQuery._data( dest, oldData ),
+ events = oldData.events;
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( type in events ) {
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
+ jQuery.event.add( dest, type, events[ type ][ i ] );
+ }
+ }
+ }
+
+ // make the cloned public data object a copy from the original
+ if ( curData.data ) {
+ curData.data = jQuery.extend( {}, curData.data );
+ }
+}
+
+function fixCloneNodeIssues( src, dest ) {
+ var nodeName, e, data;
+
+ // We do not need to do anything for non-Elements
+ if ( dest.nodeType !== 1 ) {
+ return;
+ }
+
+ nodeName = dest.nodeName.toLowerCase();
+
+ // IE6-8 copies events bound via attachEvent when using cloneNode.
+ if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
+ data = jQuery._data( dest );
+
+ for ( e in data.events ) {
+ jQuery.removeEvent( dest, e, data.handle );
+ }
+
+ // Event data gets referenced instead of copied if the expando gets copied too
+ dest.removeAttribute( jQuery.expando );
+ }
+
+ // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
+ if ( nodeName === "script" && dest.text !== src.text ) {
+ disableScript( dest ).text = src.text;
+ restoreScript( dest );
+
+ // IE6-10 improperly clones children of object elements using classid.
+ // IE10 throws NoModificationAllowedError if parent is null, #12132.
+ } else if ( nodeName === "object" ) {
+ if ( dest.parentNode ) {
+ dest.outerHTML = src.outerHTML;
+ }
+
+ // This path appears unavoidable for IE9. When cloning an object
+ // element in IE9, the outerHTML strategy above is not sufficient.
+ // If the src has innerHTML and the destination does not,
+ // copy the src.innerHTML into the dest.innerHTML. #10324
+ if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
+ dest.innerHTML = src.innerHTML;
+ }
+
+ } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
+ // IE6-8 fails to persist the checked state of a cloned checkbox
+ // or radio button. Worse, IE6-7 fail to give the cloned element
+ // a checked appearance if the defaultChecked value isn't also set
+
+ dest.defaultChecked = dest.checked = src.checked;
+
+ // IE6-7 get confused and end up setting the value of a cloned
+ // checkbox/radio button to an empty string instead of "on"
+ if ( dest.value !== src.value ) {
+ dest.value = src.value;
+ }
+
+ // IE6-8 fails to return the selected option to the default selected
+ // state when cloning options
+ } else if ( nodeName === "option" ) {
+ dest.defaultSelected = dest.selected = src.defaultSelected;
+
+ // IE6-8 fails to set the defaultValue to the correct value when
+ // cloning other types of input fields
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
+ dest.defaultValue = src.defaultValue;
+ }
+}
+
+jQuery.extend({
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+ var destElements, node, clone, i, srcElements,
+ inPage = jQuery.contains( elem.ownerDocument, elem );
+
+ if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
+ clone = elem.cloneNode( true );
+
+ // IE<=8 does not properly clone detached, unknown element nodes
+ } else {
+ fragmentDiv.innerHTML = elem.outerHTML;
+ fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
+ }
+
+ if ( (!support.noCloneEvent || !support.noCloneChecked) &&
+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
+
+ // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
+ destElements = getAll( clone );
+ srcElements = getAll( elem );
+
+ // Fix all IE cloning issues
+ for ( i = 0; (node = srcElements[i]) != null; ++i ) {
+ // Ensure that the destination node is not null; Fixes #9587
+ if ( destElements[i] ) {
+ fixCloneNodeIssues( node, destElements[i] );
+ }
+ }
+ }
+
+ // Copy the events from the original to the clone
+ if ( dataAndEvents ) {
+ if ( deepDataAndEvents ) {
+ srcElements = srcElements || getAll( elem );
+ destElements = destElements || getAll( clone );
+
+ for ( i = 0; (node = srcElements[i]) != null; i++ ) {
+ cloneCopyEvent( node, destElements[i] );
+ }
+ } else {
+ cloneCopyEvent( elem, clone );
+ }
+ }
+
+ // Preserve script evaluation history
+ destElements = getAll( clone, "script" );
+ if ( destElements.length > 0 ) {
+ setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
+ }
+
+ destElements = srcElements = node = null;
+
+ // Return the cloned set
+ return clone;
+ },
+
+ buildFragment: function( elems, context, scripts, selection ) {
+ var j, elem, contains,
+ tmp, tag, tbody, wrap,
+ l = elems.length,
+
+ // Ensure a safe fragment
+ safe = createSafeFragment( context ),
+
+ nodes = [],
+ i = 0;
+
+ for ( ; i < l; i++ ) {
+ elem = elems[ i ];
+
+ if ( elem || elem === 0 ) {
+
+ // Add nodes directly
+ if ( jQuery.type( elem ) === "object" ) {
+ jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
+
+ // Convert non-html into a text node
+ } else if ( !rhtml.test( elem ) ) {
+ nodes.push( context.createTextNode( elem ) );
+
+ // Convert html into DOM nodes
+ } else {
+ tmp = tmp || safe.appendChild( context.createElement("div") );
+
+ // Deserialize a standard representation
+ tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase();
+ wrap = wrapMap[ tag ] || wrapMap._default;
+
+ tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
+
+ // Descend through wrappers to the right content
+ j = wrap[0];
+ while ( j-- ) {
+ tmp = tmp.lastChild;
+ }
+
+ // Manually add leading whitespace removed by IE
+ if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
+ }
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ elem = tag === "table" && !rtbody.test( elem ) ?
+ tmp.firstChild :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] === "<table>" && !rtbody.test( elem ) ?
+ tmp :
+ 0;
+
+ j = elem && elem.childNodes.length;
+ while ( j-- ) {
+ if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
+ elem.removeChild( tbody );
+ }
+ }
+ }
+
+ jQuery.merge( nodes, tmp.childNodes );
+
+ // Fix #12392 for WebKit and IE > 9
+ tmp.textContent = "";
+
+ // Fix #12392 for oldIE
+ while ( tmp.firstChild ) {
+ tmp.removeChild( tmp.firstChild );
+ }
+
+ // Remember the top-level container for proper cleanup
+ tmp = safe.lastChild;
+ }
+ }
+ }
+
+ // Fix #11356: Clear elements from fragment
+ if ( tmp ) {
+ safe.removeChild( tmp );
+ }
+
+ // Reset defaultChecked for any radios and checkboxes
+ // about to be appended to the DOM in IE 6/7 (#8060)
+ if ( !support.appendChecked ) {
+ jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
+ }
+
+ i = 0;
+ while ( (elem = nodes[ i++ ]) ) {
+
+ // #4087 - If origin and destination elements are the same, and this is
+ // that element, do not do anything
+ if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
+ continue;
+ }
+
+ contains = jQuery.contains( elem.ownerDocument, elem );
+
+ // Append to fragment
+ tmp = getAll( safe.appendChild( elem ), "script" );
+
+ // Preserve script evaluation history
+ if ( contains ) {
+ setGlobalEval( tmp );
+ }
+
+ // Capture executables
+ if ( scripts ) {
+ j = 0;
+ while ( (elem = tmp[ j++ ]) ) {
+ if ( rscriptType.test( elem.type || "" ) ) {
+ scripts.push( elem );
+ }
+ }
+ }
+ }
+
+ tmp = null;
+
+ return safe;
+ },
+
+ cleanData: function( elems, /* internal */ acceptData ) {
+ var elem, type, id, data,
+ i = 0,
+ internalKey = jQuery.expando,
+ cache = jQuery.cache,
+ deleteExpando = support.deleteExpando,
+ special = jQuery.event.special;
+
+ for ( ; (elem = elems[i]) != null; i++ ) {
+ if ( acceptData || jQuery.acceptData( elem ) ) {
+
+ id = elem[ internalKey ];
+ data = id && cache[ id ];
+
+ if ( data ) {
+ if ( data.events ) {
+ for ( type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ // This is a shortcut to avoid jQuery.event.remove's overhead
+ } else {
+ jQuery.removeEvent( elem, type, data.handle );
+ }
+ }
+ }
+
+ // Remove cache only if it was not already removed by jQuery.event.remove
+ if ( cache[ id ] ) {
+
+ delete cache[ id ];
+
+ // IE does not allow us to delete expando properties from nodes,
+ // nor does it have a removeAttribute function on Document nodes;
+ // we must handle all of these cases
+ if ( deleteExpando ) {
+ delete elem[ internalKey ];
+
+ } else if ( typeof elem.removeAttribute !== strundefined ) {
+ elem.removeAttribute( internalKey );
+
+ } else {
+ elem[ internalKey ] = null;
+ }
+
+ deletedIds.push( id );
+ }
+ }
+ }
+ }
+ }
+});
+
+jQuery.fn.extend({
+ text: function( value ) {
+ return access( this, function( value ) {
+ return value === undefined ?
+ jQuery.text( this ) :
+ this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
+ }, null, value, arguments.length );
+ },
+
+ append: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+ var target = manipulationTarget( this, elem );
+ target.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+ var target = manipulationTarget( this, elem );
+ target.insertBefore( elem, target.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.parentNode ) {
+ this.parentNode.insertBefore( elem, this );
+ }
+ });
+ },
+
+ after: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.parentNode ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ }
+ });
+ },
+
+ remove: function( selector, keepData /* Internal Use Only */ ) {
+ var elem,
+ elems = selector ? jQuery.filter( selector, this ) : this,
+ i = 0;
+
+ for ( ; (elem = elems[i]) != null; i++ ) {
+
+ if ( !keepData && elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem ) );
+ }
+
+ if ( elem.parentNode ) {
+ if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
+ setGlobalEval( getAll( elem, "script" ) );
+ }
+ elem.parentNode.removeChild( elem );
+ }
+ }
+
+ return this;
+ },
+
+ empty: function() {
+ var elem,
+ i = 0;
+
+ for ( ; (elem = this[i]) != null; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem, false ) );
+ }
+
+ // Remove any remaining nodes
+ while ( elem.firstChild ) {
+ elem.removeChild( elem.firstChild );
+ }
+
+ // If this is a select, ensure that it displays empty (#12336)
+ // Support: IE<9
+ if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
+ elem.options.length = 0;
+ }
+ }
+
+ return this;
+ },
+
+ clone: function( dataAndEvents, deepDataAndEvents ) {
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+
+ return this.map(function() {
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
+ });
+ },
+
+ html: function( value ) {
+ return access( this, function( value ) {
+ var elem = this[ 0 ] || {},
+ i = 0,
+ l = this.length;
+
+ if ( value === undefined ) {
+ return elem.nodeType === 1 ?
+ elem.innerHTML.replace( rinlinejQuery, "" ) :
+ undefined;
+ }
+
+ // See if we can take a shortcut and just use innerHTML
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
+ ( support.htmlSerialize || !rnoshimcache.test( value ) ) &&
+ ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
+ !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
+
+ value = value.replace( rxhtmlTag, "<$1></$2>" );
+
+ try {
+ for (; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ elem = this[i] || {};
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem, false ) );
+ elem.innerHTML = value;
+ }
+ }
+
+ elem = 0;
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {}
+ }
+
+ if ( elem ) {
+ this.empty().append( value );
+ }
+ }, null, value, arguments.length );
+ },
+
+ replaceWith: function() {
+ var arg = arguments[ 0 ];
+
+ // Make the changes, replacing each context element with the new content
+ this.domManip( arguments, function( elem ) {
+ arg = this.parentNode;
+
+ jQuery.cleanData( getAll( this ) );
+
+ if ( arg ) {
+ arg.replaceChild( elem, this );
+ }
+ });
+
+ // Force removal if there was no new content (e.g., from empty arguments)
+ return arg && (arg.length || arg.nodeType) ? this : this.remove();
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, callback ) {
+
+ // Flatten any nested arrays
+ args = concat.apply( [], args );
+
+ var first, node, hasScripts,
+ scripts, doc, fragment,
+ i = 0,
+ l = this.length,
+ set = this,
+ iNoClone = l - 1,
+ value = args[0],
+ isFunction = jQuery.isFunction( value );
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( isFunction ||
+ ( l > 1 && typeof value === "string" &&
+ !support.checkClone && rchecked.test( value ) ) ) {
+ return this.each(function( index ) {
+ var self = set.eq( index );
+ if ( isFunction ) {
+ args[0] = value.call( this, index, self.html() );
+ }
+ self.domManip( args, callback );
+ });
+ }
+
+ if ( l ) {
+ fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
+ first = fragment.firstChild;
+
+ if ( fragment.childNodes.length === 1 ) {
+ fragment = first;
+ }
+
+ if ( first ) {
+ scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
+ hasScripts = scripts.length;
+
+ // Use the original fragment for the last item instead of the first because it can end up
+ // being emptied incorrectly in certain situations (#8070).
+ for ( ; i < l; i++ ) {
+ node = fragment;
+
+ if ( i !== iNoClone ) {
+ node = jQuery.clone( node, true, true );
+
+ // Keep references to cloned scripts for later restoration
+ if ( hasScripts ) {
+ jQuery.merge( scripts, getAll( node, "script" ) );
+ }
+ }
+
+ callback.call( this[i], node, i );
+ }
+
+ if ( hasScripts ) {
+ doc = scripts[ scripts.length - 1 ].ownerDocument;
+
+ // Reenable scripts
+ jQuery.map( scripts, restoreScript );
+
+ // Evaluate executable scripts on first document insertion
+ for ( i = 0; i < hasScripts; i++ ) {
+ node = scripts[ i ];
+ if ( rscriptType.test( node.type || "" ) &&
+ !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
+
+ if ( node.src ) {
+ // Optional AJAX dependency, but won't run scripts if not present
+ if ( jQuery._evalUrl ) {
+ jQuery._evalUrl( node.src );
+ }
+ } else {
+ jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
+ }
+ }
+ }
+ }
+
+ // Fix #11809: Avoid leaking memory
+ fragment = first = null;
+ }
+ }
+
+ return this;
+ }
+});
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var elems,
+ i = 0,
+ ret = [],
+ insert = jQuery( selector ),
+ last = insert.length - 1;
+
+ for ( ; i <= last; i++ ) {
+ elems = i === last ? this : this.clone(true);
+ jQuery( insert[i] )[ original ]( elems );
+
+ // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
+ push.apply( ret, elems.get() );
+ }
+
+ return this.pushStack( ret );
+ };
+});
+
+
+var iframe,
+ elemdisplay = {};
+
+/**
+ * Retrieve the actual display of a element
+ * @param {String} name nodeName of the element
+ * @param {Object} doc Document object
+ */
+// Called only from within defaultDisplay
+function actualDisplay( name, doc ) {
+ var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
+
+ // getDefaultComputedStyle might be reliably used only on attached element
+ display = window.getDefaultComputedStyle ?
+
+ // Use of this method is a temporary fix (more like optmization) until something better comes along,
+ // since it was removed from specification and supported only in FF
+ window.getDefaultComputedStyle( elem[ 0 ] ).display : jQuery.css( elem[ 0 ], "display" );
+
+ // We don't have any data stored on the element,
+ // so use "detach" method as fast way to get rid of the element
+ elem.detach();
+
+ return display;
+}
+
+/**
+ * Try to determine the default display value of an element
+ * @param {String} nodeName
+ */
+function defaultDisplay( nodeName ) {
+ var doc = document,
+ display = elemdisplay[ nodeName ];
+
+ if ( !display ) {
+ display = actualDisplay( nodeName, doc );
+
+ // If the simple way fails, read from inside an iframe
+ if ( display === "none" || !display ) {
+
+ // Use the already-created iframe if possible
+ iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
+
+ // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
+ doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
+
+ // Support: IE
+ doc.write();
+ doc.close();
+
+ display = actualDisplay( nodeName, doc );
+ iframe.detach();
+ }
+
+ // Store the correct default display
+ elemdisplay[ nodeName ] = display;
+ }
+
+ return display;
+}
+
+
+(function() {
+ var a, shrinkWrapBlocksVal,
+ div = document.createElement( "div" ),
+ divReset =
+ "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;" +
+ "display:block;padding:0;margin:0;border:0";
+
+ // Setup
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+ a = div.getElementsByTagName( "a" )[ 0 ];
+
+ a.style.cssText = "float:left;opacity:.5";
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ support.opacity = /^0.5/.test( a.style.opacity );
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ support.cssFloat = !!a.style.cssFloat;
+
+ div.style.backgroundClip = "content-box";
+ div.cloneNode( true ).style.backgroundClip = "";
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
+
+ // Null elements to avoid leaks in IE.
+ a = div = null;
+
+ support.shrinkWrapBlocks = function() {
+ var body, container, div, containerStyles;
+
+ if ( shrinkWrapBlocksVal == null ) {
+ body = document.getElementsByTagName( "body" )[ 0 ];
+ if ( !body ) {
+ // Test fired too early or in an unsupported environment, exit.
+ return;
+ }
+
+ containerStyles = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px";
+ container = document.createElement( "div" );
+ div = document.createElement( "div" );
+
+ body.appendChild( container ).appendChild( div );
+
+ // Will be changed later if needed.
+ shrinkWrapBlocksVal = false;
+
+ if ( typeof div.style.zoom !== strundefined ) {
+ // Support: IE6
+ // Check if elements with layout shrink-wrap their children
+ div.style.cssText = divReset + ";width:1px;padding:1px;zoom:1";
+ div.innerHTML = "<div></div>";
+ div.firstChild.style.width = "5px";
+ shrinkWrapBlocksVal = div.offsetWidth !== 3;
+ }
+
+ body.removeChild( container );
+
+ // Null elements to avoid leaks in IE.
+ body = container = div = null;
+ }
+
+ return shrinkWrapBlocksVal;
+ };
+
+})();
+var rmargin = (/^margin/);
+
+var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
+
+
+
+var getStyles, curCSS,
+ rposition = /^(top|right|bottom|left)$/;
+
+if ( window.getComputedStyle ) {
+ getStyles = function( elem ) {
+ return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
+ };
+
+ curCSS = function( elem, name, computed ) {
+ var width, minWidth, maxWidth, ret,
+ style = elem.style;
+
+ computed = computed || getStyles( elem );
+
+ // getPropertyValue is only needed for .css('filter') in IE9, see #12537
+ ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
+
+ if ( computed ) {
+
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
+ ret = jQuery.style( elem, name );
+ }
+
+ // A tribute to the "awesome hack by Dean Edwards"
+ // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
+ // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
+ // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
+ if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
+
+ // Remember the original values
+ width = style.width;
+ minWidth = style.minWidth;
+ maxWidth = style.maxWidth;
+
+ // Put in the new values to get a computed value out
+ style.minWidth = style.maxWidth = style.width = ret;
+ ret = computed.width;
+
+ // Revert the changed values
+ style.width = width;
+ style.minWidth = minWidth;
+ style.maxWidth = maxWidth;
+ }
+ }
+
+ // Support: IE
+ // IE returns zIndex value as an integer.
+ return ret === undefined ?
+ ret :
+ ret + "";
+ };
+} else if ( document.documentElement.currentStyle ) {
+ getStyles = function( elem ) {
+ return elem.currentStyle;
+ };
+
+ curCSS = function( elem, name, computed ) {
+ var left, rs, rsLeft, ret,
+ style = elem.style;
+
+ computed = computed || getStyles( elem );
+ ret = computed ? computed[ name ] : undefined;
+
+ // Avoid setting ret to empty string here
+ // so we don't default to auto
+ if ( ret == null && style && style[ name ] ) {
+ ret = style[ name ];
+ }
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ // but not position css attributes, as those are proportional to the parent element instead
+ // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
+ if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
+
+ // Remember the original values
+ left = style.left;
+ rs = elem.runtimeStyle;
+ rsLeft = rs && rs.left;
+
+ // Put in the new values to get a computed value out
+ if ( rsLeft ) {
+ rs.left = elem.currentStyle.left;
+ }
+ style.left = name === "fontSize" ? "1em" : ret;
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ if ( rsLeft ) {
+ rs.left = rsLeft;
+ }
+ }
+
+ // Support: IE
+ // IE returns zIndex value as an integer.
+ return ret === undefined ?
+ ret :
+ ret + "" || "auto";
+ };
+}
+
+
+
+
+function addGetHookIf( conditionFn, hookFn ) {
+ // Define the hook, we'll check on the first run if it's really needed.
+ return {
+ get: function() {
+ var condition = conditionFn();
+
+ if ( condition == null ) {
+ // The test was not ready at this point; screw the hook this time
+ // but check again when needed next time.
+ return;
+ }
+
+ if ( condition ) {
+ // Hook not needed (or it's not possible to use it due to missing dependency),
+ // remove it.
+ // Since there are no other hooks for marginRight, remove the whole object.
+ delete this.get;
+ return;
+ }
+
+ // Hook needed; redefine it so that the support test is not executed again.
+
+ return (this.get = hookFn).apply( this, arguments );
+ }
+ };
+}
+
+
+(function() {
+ var a, reliableHiddenOffsetsVal, boxSizingVal, boxSizingReliableVal,
+ pixelPositionVal, reliableMarginRightVal,
+ div = document.createElement( "div" ),
+ containerStyles = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px",
+ divReset =
+ "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;" +
+ "display:block;padding:0;margin:0;border:0";
+
+ // Setup
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+ a = div.getElementsByTagName( "a" )[ 0 ];
+
+ a.style.cssText = "float:left;opacity:.5";
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ support.opacity = /^0.5/.test( a.style.opacity );
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ support.cssFloat = !!a.style.cssFloat;
+
+ div.style.backgroundClip = "content-box";
+ div.cloneNode( true ).style.backgroundClip = "";
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
+
+ // Null elements to avoid leaks in IE.
+ a = div = null;
+
+ jQuery.extend(support, {
+ reliableHiddenOffsets: function() {
+ if ( reliableHiddenOffsetsVal != null ) {
+ return reliableHiddenOffsetsVal;
+ }
+
+ var container, tds, isSupported,
+ div = document.createElement( "div" ),
+ body = document.getElementsByTagName( "body" )[ 0 ];
+
+ if ( !body ) {
+ // Return for frameset docs that don't have a body
+ return;
+ }
+
+ // Setup
+ div.setAttribute( "className", "t" );
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+
+ container = document.createElement( "div" );
+ container.style.cssText = containerStyles;
+
+ body.appendChild( container ).appendChild( div );
+
+ // Support: IE8
+ // Check if table cells still have offsetWidth/Height when they are set
+ // to display:none and there are still other visible table cells in a
+ // table row; if so, offsetWidth/Height are not reliable for use when
+ // determining if an element has been hidden directly using
+ // display:none (it is still safe to use offsets if a parent element is
+ // hidden; don safety goggles and see bug #4512 for more information).
+ div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
+ tds = div.getElementsByTagName( "td" );
+ tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
+ isSupported = ( tds[ 0 ].offsetHeight === 0 );
+
+ tds[ 0 ].style.display = "";
+ tds[ 1 ].style.display = "none";
+
+ // Support: IE8
+ // Check if empty table cells still have offsetWidth/Height
+ reliableHiddenOffsetsVal = isSupported && ( tds[ 0 ].offsetHeight === 0 );
+
+ body.removeChild( container );
+
+ // Null elements to avoid leaks in IE.
+ div = body = null;
+
+ return reliableHiddenOffsetsVal;
+ },
+
+ boxSizing: function() {
+ if ( boxSizingVal == null ) {
+ computeStyleTests();
+ }
+ return boxSizingVal;
+ },
+
+ boxSizingReliable: function() {
+ if ( boxSizingReliableVal == null ) {
+ computeStyleTests();
+ }
+ return boxSizingReliableVal;
+ },
+
+ pixelPosition: function() {
+ if ( pixelPositionVal == null ) {
+ computeStyleTests();
+ }
+ return pixelPositionVal;
+ },
+
+ reliableMarginRight: function() {
+ var body, container, div, marginDiv;
+
+ // Use window.getComputedStyle because jsdom on node.js will break without it.
+ if ( reliableMarginRightVal == null && window.getComputedStyle ) {
+ body = document.getElementsByTagName( "body" )[ 0 ];
+ if ( !body ) {
+ // Test fired too early or in an unsupported environment, exit.
+ return;
+ }
+
+ container = document.createElement( "div" );
+ div = document.createElement( "div" );
+ container.style.cssText = containerStyles;
+
+ body.appendChild( container ).appendChild( div );
+
+ // Check if div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container. (#3333)
+ // Fails in WebKit before Feb 2011 nightlies
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ marginDiv = div.appendChild( document.createElement( "div" ) );
+ marginDiv.style.cssText = div.style.cssText = divReset;
+ marginDiv.style.marginRight = marginDiv.style.width = "0";
+ div.style.width = "1px";
+
+ reliableMarginRightVal =
+ !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
+
+ body.removeChild( container );
+ }
+
+ return reliableMarginRightVal;
+ }
+ });
+
+ function computeStyleTests() {
+ var container, div,
+ body = document.getElementsByTagName( "body" )[ 0 ];
+
+ if ( !body ) {
+ // Test fired too early or in an unsupported environment, exit.
+ return;
+ }
+
+ container = document.createElement( "div" );
+ div = document.createElement( "div" );
+ container.style.cssText = containerStyles;
+
+ body.appendChild( container ).appendChild( div );
+
+ div.style.cssText =
+ "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;" +
+ "position:absolute;display:block;padding:1px;border:1px;width:4px;" +
+ "margin-top:1%;top:1%";
+
+ // Workaround failing boxSizing test due to offsetWidth returning wrong value
+ // with some non-1 values of body zoom, ticket #13543
+ jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {
+ boxSizingVal = div.offsetWidth === 4;
+ });
+
+ // Will be changed later if needed.
+ boxSizingReliableVal = true;
+ pixelPositionVal = false;
+ reliableMarginRightVal = true;
+
+ // Use window.getComputedStyle because jsdom on node.js will break without it.
+ if ( window.getComputedStyle ) {
+ pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
+ boxSizingReliableVal =
+ ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
+ }
+
+ body.removeChild( container );
+
+ // Null elements to avoid leaks in IE.
+ div = body = null;
+ }
+
+})();
+
+
+// A method for quickly swapping in/out CSS properties to get correct calculations.
+jQuery.swap = function( elem, options, callback, args ) {
+ var ret, name,
+ old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ ret = callback.apply( elem, args || [] );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+
+ return ret;
+};
+
+
+var
+ ralpha = /alpha\([^)]*\)/i,
+ ropacity = /opacity\s*=\s*([^)]*)/,
+
+ // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
+ // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
+ rdisplayswap = /^(none|table(?!-c[ea]).+)/,
+ rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
+ rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
+
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+ cssNormalTransform = {
+ letterSpacing: 0,
+ fontWeight: 400
+ },
+
+ cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
+
+
+// return a css property mapped to a potentially vendor prefixed property
+function vendorPropName( style, name ) {
+
+ // shortcut for names that are not vendor prefixed
+ if ( name in style ) {
+ return name;
+ }
+
+ // check for vendor prefixed names
+ var capName = name.charAt(0).toUpperCase() + name.slice(1),
+ origName = name,
+ i = cssPrefixes.length;
+
+ while ( i-- ) {
+ name = cssPrefixes[ i ] + capName;
+ if ( name in style ) {
+ return name;
+ }
+ }
+
+ return origName;
+}
+
+function showHide( elements, show ) {
+ var display, elem, hidden,
+ values = [],
+ index = 0,
+ length = elements.length;
+
+ for ( ; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+
+ values[ index ] = jQuery._data( elem, "olddisplay" );
+ display = elem.style.display;
+ if ( show ) {
+ // Reset the inline display of this element to learn if it is
+ // being hidden by cascaded rules or not
+ if ( !values[ index ] && display === "none" ) {
+ elem.style.display = "";
+ }
+
+ // Set elements which have been overridden with display: none
+ // in a stylesheet to whatever the default browser style is
+ // for such an element
+ if ( elem.style.display === "" && isHidden( elem ) ) {
+ values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
+ }
+ } else {
+
+ if ( !values[ index ] ) {
+ hidden = isHidden( elem );
+
+ if ( display && display !== "none" || !hidden ) {
+ jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
+ }
+ }
+ }
+ }
+
+ // Set the display of most of the elements in a second loop
+ // to avoid the constant reflow
+ for ( index = 0; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+ if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
+ elem.style.display = show ? values[ index ] || "" : "none";
+ }
+ }
+
+ return elements;
+}
+
+function setPositiveNumber( elem, value, subtract ) {
+ var matches = rnumsplit.exec( value );
+ return matches ?
+ // Guard against undefined "subtract", e.g., when used as in cssHooks
+ Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
+ value;
+}
+
+function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
+ var i = extra === ( isBorderBox ? "border" : "content" ) ?
+ // If we already have the right measurement, avoid augmentation
+ 4 :
+ // Otherwise initialize for horizontal or vertical properties
+ name === "width" ? 1 : 0,
+
+ val = 0;
+
+ for ( ; i < 4; i += 2 ) {
+ // both box models exclude margin, so add it if we want it
+ if ( extra === "margin" ) {
+ val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
+ }
+
+ if ( isBorderBox ) {
+ // border-box includes padding, so remove it if we want content
+ if ( extra === "content" ) {
+ val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+ }
+
+ // at this point, extra isn't border nor margin, so remove border
+ if ( extra !== "margin" ) {
+ val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+ }
+ } else {
+ // at this point, extra isn't content, so add padding
+ val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+
+ // at this point, extra isn't content nor padding, so add border
+ if ( extra !== "padding" ) {
+ val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+ }
+ }
+ }
+
+ return val;
+}
+
+function getWidthOrHeight( elem, name, extra ) {
+
+ // Start with offset property, which is equivalent to the border-box value
+ var valueIsBorderBox = true,
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
+ styles = getStyles( elem ),
+ isBorderBox = support.boxSizing() && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
+
+ // some non-html elements return undefined for offsetWidth, so check for null/undefined
+ // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
+ // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
+ if ( val <= 0 || val == null ) {
+ // Fall back to computed then uncomputed css if necessary
+ val = curCSS( elem, name, styles );
+ if ( val < 0 || val == null ) {
+ val = elem.style[ name ];
+ }
+
+ // Computed unit is not pixels. Stop here and return.
+ if ( rnumnonpx.test(val) ) {
+ return val;
+ }
+
+ // we need the check for style in case a browser which returns unreliable values
+ // for getComputedStyle silently falls back to the reliable elem.style
+ valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] );
+
+ // Normalize "", auto, and prepare for extra
+ val = parseFloat( val ) || 0;
+ }
+
+ // use the active box-sizing model to add/subtract irrelevant styles
+ return ( val +
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra || ( isBorderBox ? "border" : "content" ),
+ valueIsBorderBox,
+ styles
+ )
+ ) + "px";
+}
+
+jQuery.extend({
+ // Add in style property hooks for overriding the default
+ // behavior of getting and setting a style property
+ cssHooks: {
+ opacity: {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity" );
+ return ret === "" ? "1" : ret;
+ }
+ }
+ }
+ },
+
+ // Don't automatically add "px" to these possibly-unitless properties
+ cssNumber: {
+ "columnCount": true,
+ "fillOpacity": true,
+ "fontWeight": true,
+ "lineHeight": true,
+ "opacity": true,
+ "order": true,
+ "orphans": true,
+ "widows": true,
+ "zIndex": true,
+ "zoom": true
+ },
+
+ // Add in properties whose names you wish to fix before
+ // setting or getting the value
+ cssProps: {
+ // normalize float css property
+ "float": support.cssFloat ? "cssFloat" : "styleFloat"
+ },
+
+ // Get and set the style property on a DOM Node
+ style: function( elem, name, value, extra ) {
+ // Don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
+ return;
+ }
+
+ // Make sure that we're working with the right name
+ var ret, type, hooks,
+ origName = jQuery.camelCase( name ),
+ style = elem.style;
+
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
+
+ // gets hook for the prefixed version
+ // followed by the unprefixed version
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // Check if we're setting a value
+ if ( value !== undefined ) {
+ type = typeof value;
+
+ // convert relative number strings (+= or -=) to relative numbers. #7345
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
+ value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
+ // Fixes bug #9237
+ type = "number";
+ }
+
+ // Make sure that null and NaN values aren't set. See: #7116
+ if ( value == null || value !== value ) {
+ return;
+ }
+
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
+ value += "px";
+ }
+
+ // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
+ // but it would mean to define eight (for every problematic property) identical functions
+ if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
+ style[ name ] = "inherit";
+ }
+
+ // If a hook was provided, use that value, otherwise just set the specified value
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
+
+ // Support: IE
+ // Swallow errors from 'invalid' CSS values (#5509)
+ try {
+ // Support: Chrome, Safari
+ // Setting style to blank string required to delete "style: x !important;"
+ style[ name ] = "";
+ style[ name ] = value;
+ } catch(e) {}
+ }
+
+ } else {
+ // If a hook was provided get the non-computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
+ return ret;
+ }
+
+ // Otherwise just get the value from the style object
+ return style[ name ];
+ }
+ },
+
+ css: function( elem, name, extra, styles ) {
+ var num, val, hooks,
+ origName = jQuery.camelCase( name );
+
+ // Make sure that we're working with the right name
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
+
+ // gets hook for the prefixed version
+ // followed by the unprefixed version
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // If a hook was provided get the computed value from there
+ if ( hooks && "get" in hooks ) {
+ val = hooks.get( elem, true, extra );
+ }
+
+ // Otherwise, if a way to get the computed value exists, use that
+ if ( val === undefined ) {
+ val = curCSS( elem, name, styles );
+ }
+
+ //convert "normal" to computed value
+ if ( val === "normal" && name in cssNormalTransform ) {
+ val = cssNormalTransform[ name ];
+ }
+
+ // Return, converting to number if forced or a qualifier was provided and val looks numeric
+ if ( extra === "" || extra ) {
+ num = parseFloat( val );
+ return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
+ }
+ return val;
+ }
+});
+
+jQuery.each([ "height", "width" ], function( i, name ) {
+ jQuery.cssHooks[ name ] = {
+ get: function( elem, computed, extra ) {
+ if ( computed ) {
+ // certain elements can have dimension info if we invisibly show them
+ // however, it must have a current display style that would benefit from this
+ return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
+ jQuery.swap( elem, cssShow, function() {
+ return getWidthOrHeight( elem, name, extra );
+ }) :
+ getWidthOrHeight( elem, name, extra );
+ }
+ },
+
+ set: function( elem, value, extra ) {
+ var styles = extra && getStyles( elem );
+ return setPositiveNumber( elem, value, extra ?
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra,
+ support.boxSizing() && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
+ styles
+ ) : 0
+ );
+ }
+ };
+});
+
+if ( !support.opacity ) {
+ jQuery.cssHooks.opacity = {
+ get: function( elem, computed ) {
+ // IE uses filters for opacity
+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
+ ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
+ computed ? "1" : "";
+ },
+
+ set: function( elem, value ) {
+ var style = elem.style,
+ currentStyle = elem.currentStyle,
+ opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
+ filter = currentStyle && currentStyle.filter || style.filter || "";
+
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
+ // if value === "", then remove inline opacity #12685
+ if ( ( value >= 1 || value === "" ) &&
+ jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
+ style.removeAttribute ) {
+
+ // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
+ // if "filter:" is present at all, clearType is disabled, we want to avoid this
+ // style.removeAttribute is IE Only, but so apparently is this code path...
+ style.removeAttribute( "filter" );
+
+ // if there is no filter style applied in a css rule or unset inline opacity, we are done
+ if ( value === "" || currentStyle && !currentStyle.filter ) {
+ return;
+ }
+ }
+
+ // otherwise, set new filter values
+ style.filter = ralpha.test( filter ) ?
+ filter.replace( ralpha, opacity ) :
+ filter + " " + opacity;
+ }
+ };
+}
+
+jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
+ function( elem, computed ) {
+ if ( computed ) {
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ // Work around by temporarily setting element display to inline-block
+ return jQuery.swap( elem, { "display": "inline-block" },
+ curCSS, [ elem, "marginRight" ] );
+ }
+ }
+);
+
+// These hooks are used by animate to expand properties
+jQuery.each({
+ margin: "",
+ padding: "",
+ border: "Width"
+}, function( prefix, suffix ) {
+ jQuery.cssHooks[ prefix + suffix ] = {
+ expand: function( value ) {
+ var i = 0,
+ expanded = {},
+
+ // assumes a single number if not a string
+ parts = typeof value === "string" ? value.split(" ") : [ value ];
+
+ for ( ; i < 4; i++ ) {
+ expanded[ prefix + cssExpand[ i ] + suffix ] =
+ parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
+ }
+
+ return expanded;
+ }
+ };
+
+ if ( !rmargin.test( prefix ) ) {
+ jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
+ }
+});
+
+jQuery.fn.extend({
+ css: function( name, value ) {
+ return access( this, function( elem, name, value ) {
+ var styles, len,
+ map = {},
+ i = 0;
+
+ if ( jQuery.isArray( name ) ) {
+ styles = getStyles( elem );
+ len = name.length;
+
+ for ( ; i < len; i++ ) {
+ map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
+ }
+
+ return map;
+ }
+
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
+ }, name, value, arguments.length > 1 );
+ },
+ show: function() {
+ return showHide( this, true );
+ },
+ hide: function() {
+ return showHide( this );
+ },
+ toggle: function( state ) {
+ if ( typeof state === "boolean" ) {
+ return state ? this.show() : this.hide();
+ }
+
+ return this.each(function() {
+ if ( isHidden( this ) ) {
+ jQuery( this ).show();
+ } else {
+ jQuery( this ).hide();
+ }
+ });
+ }
+});
+
+
+function Tween( elem, options, prop, end, easing ) {
+ return new Tween.prototype.init( elem, options, prop, end, easing );
+}
+jQuery.Tween = Tween;
+
+Tween.prototype = {
+ constructor: Tween,
+ init: function( elem, options, prop, end, easing, unit ) {
+ this.elem = elem;
+ this.prop = prop;
+ this.easing = easing || "swing";
+ this.options = options;
+ this.start = this.now = this.cur();
+ this.end = end;
+ this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
+ },
+ cur: function() {
+ var hooks = Tween.propHooks[ this.prop ];
+
+ return hooks && hooks.get ?
+ hooks.get( this ) :
+ Tween.propHooks._default.get( this );
+ },
+ run: function( percent ) {
+ var eased,
+ hooks = Tween.propHooks[ this.prop ];
+
+ if ( this.options.duration ) {
+ this.pos = eased = jQuery.easing[ this.easing ](
+ percent, this.options.duration * percent, 0, 1, this.options.duration
+ );
+ } else {
+ this.pos = eased = percent;
+ }
+ this.now = ( this.end - this.start ) * eased + this.start;
+
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ if ( hooks && hooks.set ) {
+ hooks.set( this );
+ } else {
+ Tween.propHooks._default.set( this );
+ }
+ return this;
+ }
+};
+
+Tween.prototype.init.prototype = Tween.prototype;
+
+Tween.propHooks = {
+ _default: {
+ get: function( tween ) {
+ var result;
+
+ if ( tween.elem[ tween.prop ] != null &&
+ (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
+ return tween.elem[ tween.prop ];
+ }
+
+ // passing an empty string as a 3rd parameter to .css will automatically
+ // attempt a parseFloat and fallback to a string if the parse fails
+ // so, simple values such as "10px" are parsed to Float.
+ // complex values such as "rotate(1rad)" are returned as is.
+ result = jQuery.css( tween.elem, tween.prop, "" );
+ // Empty strings, null, undefined and "auto" are converted to 0.
+ return !result || result === "auto" ? 0 : result;
+ },
+ set: function( tween ) {
+ // use step hook for back compat - use cssHook if its there - use .style if its
+ // available and use plain properties where available
+ if ( jQuery.fx.step[ tween.prop ] ) {
+ jQuery.fx.step[ tween.prop ]( tween );
+ } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
+ } else {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+ }
+};
+
+// Support: IE <=9
+// Panic based approach to setting things on disconnected nodes
+
+Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
+ set: function( tween ) {
+ if ( tween.elem.nodeType && tween.elem.parentNode ) {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+};
+
+jQuery.easing = {
+ linear: function( p ) {
+ return p;
+ },
+ swing: function( p ) {
+ return 0.5 - Math.cos( p * Math.PI ) / 2;
+ }
+};
+
+jQuery.fx = Tween.prototype.init;
+
+// Back Compat <1.8 extension point
+jQuery.fx.step = {};
+
+
+
+
+var
+ fxNow, timerId,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
+ rrun = /queueHooks$/,
+ animationPrefilters = [ defaultPrefilter ],
+ tweeners = {
+ "*": [ function( prop, value ) {
+ var tween = this.createTween( prop, value ),
+ target = tween.cur(),
+ parts = rfxnum.exec( value ),
+ unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
+
+ // Starting value computation is required for potential unit mismatches
+ start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
+ rfxnum.exec( jQuery.css( tween.elem, prop ) ),
+ scale = 1,
+ maxIterations = 20;
+
+ if ( start && start[ 3 ] !== unit ) {
+ // Trust units reported by jQuery.css
+ unit = unit || start[ 3 ];
+
+ // Make sure we update the tween properties later on
+ parts = parts || [];
+
+ // Iteratively approximate from a nonzero starting point
+ start = +target || 1;
+
+ do {
+ // If previous iteration zeroed out, double until we get *something*
+ // Use a string for doubling factor so we don't accidentally see scale as unchanged below
+ scale = scale || ".5";
+
+ // Adjust and apply
+ start = start / scale;
+ jQuery.style( tween.elem, prop, start + unit );
+
+ // Update scale, tolerating zero or NaN from tween.cur()
+ // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
+ } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
+ }
+
+ // Update tween properties
+ if ( parts ) {
+ start = tween.start = +start || +target || 0;
+ tween.unit = unit;
+ // If a +=/-= token was provided, we're doing a relative animation
+ tween.end = parts[ 1 ] ?
+ start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
+ +parts[ 2 ];
+ }
+
+ return tween;
+ } ]
+ };
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ setTimeout(function() {
+ fxNow = undefined;
+ });
+ return ( fxNow = jQuery.now() );
+}
+
+// Generate parameters to create a standard animation
+function genFx( type, includeWidth ) {
+ var which,
+ attrs = { height: type },
+ i = 0;
+
+ // if we include width, step value is 1 to do all cssExpand values,
+ // if we don't include width, step value is 2 to skip over Left and Right
+ includeWidth = includeWidth ? 1 : 0;
+ for ( ; i < 4 ; i += 2 - includeWidth ) {
+ which = cssExpand[ i ];
+ attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
+ }
+
+ if ( includeWidth ) {
+ attrs.opacity = attrs.width = type;
+ }
+
+ return attrs;
+}
+
+function createTween( value, prop, animation ) {
+ var tween,
+ collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
+ index = 0,
+ length = collection.length;
+ for ( ; index < length; index++ ) {
+ if ( (tween = collection[ index ].call( animation, prop, value )) ) {
+
+ // we're done with this property
+ return tween;
+ }
+ }
+}
+
+function defaultPrefilter( elem, props, opts ) {
+ /* jshint validthis: true */
+ var prop, value, toggle, tween, hooks, oldfire, display, dDisplay,
+ anim = this,
+ orig = {},
+ style = elem.style,
+ hidden = elem.nodeType && isHidden( elem ),
+ dataShow = jQuery._data( elem, "fxshow" );
+
+ // handle queue: false promises
+ if ( !opts.queue ) {
+ hooks = jQuery._queueHooks( elem, "fx" );
+ if ( hooks.unqueued == null ) {
+ hooks.unqueued = 0;
+ oldfire = hooks.empty.fire;
+ hooks.empty.fire = function() {
+ if ( !hooks.unqueued ) {
+ oldfire();
+ }
+ };
+ }
+ hooks.unqueued++;
+
+ anim.always(function() {
+ // doing this makes sure that the complete handler will be called
+ // before this completes
+ anim.always(function() {
+ hooks.unqueued--;
+ if ( !jQuery.queue( elem, "fx" ).length ) {
+ hooks.empty.fire();
+ }
+ });
+ });
+ }
+
+ // height/width overflow pass
+ if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE does not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
+
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height animated
+ display = jQuery.css( elem, "display" );
+ dDisplay = defaultDisplay( elem.nodeName );
+ if ( display === "none" ) {
+ display = dDisplay;
+ }
+ if ( display === "inline" &&
+ jQuery.css( elem, "float" ) === "none" ) {
+
+ // inline-level elements accept inline-block;
+ // block-level elements need to be inline with layout
+ if ( !support.inlineBlockNeedsLayout || dDisplay === "inline" ) {
+ style.display = "inline-block";
+ } else {
+ style.zoom = 1;
+ }
+ }
+ }
+
+ if ( opts.overflow ) {
+ style.overflow = "hidden";
+ if ( !support.shrinkWrapBlocks() ) {
+ anim.always(function() {
+ style.overflow = opts.overflow[ 0 ];
+ style.overflowX = opts.overflow[ 1 ];
+ style.overflowY = opts.overflow[ 2 ];
+ });
+ }
+ }
+
+ // show/hide pass
+ for ( prop in props ) {
+ value = props[ prop ];
+ if ( rfxtypes.exec( value ) ) {
+ delete props[ prop ];
+ toggle = toggle || value === "toggle";
+ if ( value === ( hidden ? "hide" : "show" ) ) {
+
+ // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
+ if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
+ hidden = true;
+ } else {
+ continue;
+ }
+ }
+ orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
+ }
+ }
+
+ if ( !jQuery.isEmptyObject( orig ) ) {
+ if ( dataShow ) {
+ if ( "hidden" in dataShow ) {
+ hidden = dataShow.hidden;
+ }
+ } else {
+ dataShow = jQuery._data( elem, "fxshow", {} );
+ }
+
+ // store state if its toggle - enables .stop().toggle() to "reverse"
+ if ( toggle ) {
+ dataShow.hidden = !hidden;
+ }
+ if ( hidden ) {
+ jQuery( elem ).show();
+ } else {
+ anim.done(function() {
+ jQuery( elem ).hide();
+ });
+ }
+ anim.done(function() {
+ var prop;
+ jQuery._removeData( elem, "fxshow" );
+ for ( prop in orig ) {
+ jQuery.style( elem, prop, orig[ prop ] );
+ }
+ });
+ for ( prop in orig ) {
+ tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
+
+ if ( !( prop in dataShow ) ) {
+ dataShow[ prop ] = tween.start;
+ if ( hidden ) {
+ tween.end = tween.start;
+ tween.start = prop === "width" || prop === "height" ? 1 : 0;
+ }
+ }
+ }
+ }
+}
+
+function propFilter( props, specialEasing ) {
+ var index, name, easing, value, hooks;
+
+ // camelCase, specialEasing and expand cssHook pass
+ for ( index in props ) {
+ name = jQuery.camelCase( index );
+ easing = specialEasing[ name ];
+ value = props[ index ];
+ if ( jQuery.isArray( value ) ) {
+ easing = value[ 1 ];
+ value = props[ index ] = value[ 0 ];
+ }
+
+ if ( index !== name ) {
+ props[ name ] = value;
+ delete props[ index ];
+ }
+
+ hooks = jQuery.cssHooks[ name ];
+ if ( hooks && "expand" in hooks ) {
+ value = hooks.expand( value );
+ delete props[ name ];
+
+ // not quite $.extend, this wont overwrite keys already present.
+ // also - reusing 'index' from above because we have the correct "name"
+ for ( index in value ) {
+ if ( !( index in props ) ) {
+ props[ index ] = value[ index ];
+ specialEasing[ index ] = easing;
+ }
+ }
+ } else {
+ specialEasing[ name ] = easing;
+ }
+ }
+}
+
+function Animation( elem, properties, options ) {
+ var result,
+ stopped,
+ index = 0,
+ length = animationPrefilters.length,
+ deferred = jQuery.Deferred().always( function() {
+ // don't match elem in the :animated selector
+ delete tick.elem;
+ }),
+ tick = function() {
+ if ( stopped ) {
+ return false;
+ }
+ var currentTime = fxNow || createFxNow(),
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
+ // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
+ temp = remaining / animation.duration || 0,
+ percent = 1 - temp,
+ index = 0,
+ length = animation.tweens.length;
+
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( percent );
+ }
+
+ deferred.notifyWith( elem, [ animation, percent, remaining ]);
+
+ if ( percent < 1 && length ) {
+ return remaining;
+ } else {
+ deferred.resolveWith( elem, [ animation ] );
+ return false;
+ }
+ },
+ animation = deferred.promise({
+ elem: elem,
+ props: jQuery.extend( {}, properties ),
+ opts: jQuery.extend( true, { specialEasing: {} }, options ),
+ originalProperties: properties,
+ originalOptions: options,
+ startTime: fxNow || createFxNow(),
+ duration: options.duration,
+ tweens: [],
+ createTween: function( prop, end ) {
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
+ animation.tweens.push( tween );
+ return tween;
+ },
+ stop: function( gotoEnd ) {
+ var index = 0,
+ // if we are going to the end, we want to run all the tweens
+ // otherwise we skip this part
+ length = gotoEnd ? animation.tweens.length : 0;
+ if ( stopped ) {
+ return this;
+ }
+ stopped = true;
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( 1 );
+ }
+
+ // resolve when we played the last frame
+ // otherwise, reject
+ if ( gotoEnd ) {
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );
+ } else {
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );
+ }
+ return this;
+ }
+ }),
+ props = animation.props;
+
+ propFilter( props, animation.opts.specialEasing );
+
+ for ( ; index < length ; index++ ) {
+ result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
+ if ( result ) {
+ return result;
+ }
+ }
+
+ jQuery.map( props, createTween, animation );
+
+ if ( jQuery.isFunction( animation.opts.start ) ) {
+ animation.opts.start.call( elem, animation );
+ }
+
+ jQuery.fx.timer(
+ jQuery.extend( tick, {
+ elem: elem,
+ anim: animation,
+ queue: animation.opts.queue
+ })
+ );
+
+ // attach callbacks from options
+ return animation.progress( animation.opts.progress )
+ .done( animation.opts.done, animation.opts.complete )
+ .fail( animation.opts.fail )
+ .always( animation.opts.always );
+}
+
+jQuery.Animation = jQuery.extend( Animation, {
+ tweener: function( props, callback ) {
+ if ( jQuery.isFunction( props ) ) {
+ callback = props;
+ props = [ "*" ];
+ } else {
+ props = props.split(" ");
+ }
+
+ var prop,
+ index = 0,
+ length = props.length;
+
+ for ( ; index < length ; index++ ) {
+ prop = props[ index ];
+ tweeners[ prop ] = tweeners[ prop ] || [];
+ tweeners[ prop ].unshift( callback );
+ }
+ },
+
+ prefilter: function( callback, prepend ) {
+ if ( prepend ) {
+ animationPrefilters.unshift( callback );
+ } else {
+ animationPrefilters.push( callback );
+ }
+ }
+});
+
+jQuery.speed = function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
+
+ // normalize opt.queue - true/undefined/null -> "fx"
+ if ( opt.queue == null || opt.queue === true ) {
+ opt.queue = "fx";
+ }
+
+ // Queueing
+ opt.old = opt.complete;
+
+ opt.complete = function() {
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+
+ if ( opt.queue ) {
+ jQuery.dequeue( this, opt.queue );
+ }
+ };
+
+ return opt;
+};
+
+jQuery.fn.extend({
+ fadeTo: function( speed, to, easing, callback ) {
+
+ // show any hidden elements after setting opacity to 0
+ return this.filter( isHidden ).css( "opacity", 0 ).show()
+
+ // animate to the value specified
+ .end().animate({ opacity: to }, speed, easing, callback );
+ },
+ animate: function( prop, speed, easing, callback ) {
+ var empty = jQuery.isEmptyObject( prop ),
+ optall = jQuery.speed( speed, easing, callback ),
+ doAnimation = function() {
+ // Operate on a copy of prop so per-property easing won't be lost
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );
+
+ // Empty animations, or finishing resolves immediately
+ if ( empty || jQuery._data( this, "finish" ) ) {
+ anim.stop( true );
+ }
+ };
+ doAnimation.finish = doAnimation;
+
+ return empty || optall.queue === false ?
+ this.each( doAnimation ) :
+ this.queue( optall.queue, doAnimation );
+ },
+ stop: function( type, clearQueue, gotoEnd ) {
+ var stopQueue = function( hooks ) {
+ var stop = hooks.stop;
+ delete hooks.stop;
+ stop( gotoEnd );
+ };
+
+ if ( typeof type !== "string" ) {
+ gotoEnd = clearQueue;
+ clearQueue = type;
+ type = undefined;
+ }
+ if ( clearQueue && type !== false ) {
+ this.queue( type || "fx", [] );
+ }
+
+ return this.each(function() {
+ var dequeue = true,
+ index = type != null && type + "queueHooks",
+ timers = jQuery.timers,
+ data = jQuery._data( this );
+
+ if ( index ) {
+ if ( data[ index ] && data[ index ].stop ) {
+ stopQueue( data[ index ] );
+ }
+ } else {
+ for ( index in data ) {
+ if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
+ stopQueue( data[ index ] );
+ }
+ }
+ }
+
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
+ timers[ index ].anim.stop( gotoEnd );
+ dequeue = false;
+ timers.splice( index, 1 );
+ }
+ }
+
+ // start the next in the queue if the last step wasn't forced
+ // timers currently will call their complete callbacks, which will dequeue
+ // but only if they were gotoEnd
+ if ( dequeue || !gotoEnd ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ finish: function( type ) {
+ if ( type !== false ) {
+ type = type || "fx";
+ }
+ return this.each(function() {
+ var index,
+ data = jQuery._data( this ),
+ queue = data[ type + "queue" ],
+ hooks = data[ type + "queueHooks" ],
+ timers = jQuery.timers,
+ length = queue ? queue.length : 0;
+
+ // enable finishing flag on private data
+ data.finish = true;
+
+ // empty the queue first
+ jQuery.queue( this, type, [] );
+
+ if ( hooks && hooks.stop ) {
+ hooks.stop.call( this, true );
+ }
+
+ // look for any active animations, and finish them
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
+ timers[ index ].anim.stop( true );
+ timers.splice( index, 1 );
+ }
+ }
+
+ // look for any animations in the old queue and finish them
+ for ( index = 0; index < length; index++ ) {
+ if ( queue[ index ] && queue[ index ].finish ) {
+ queue[ index ].finish.call( this );
+ }
+ }
+
+ // turn off finishing flag
+ delete data.finish;
+ });
+ }
+});
+
+jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
+ var cssFn = jQuery.fn[ name ];
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return speed == null || typeof speed === "boolean" ?
+ cssFn.apply( this, arguments ) :
+ this.animate( genFx( name, true ), speed, easing, callback );
+ };
+});
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show"),
+ slideUp: genFx("hide"),
+ slideToggle: genFx("toggle"),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" },
+ fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return this.animate( props, speed, easing, callback );
+ };
+});
+
+jQuery.timers = [];
+jQuery.fx.tick = function() {
+ var timer,
+ timers = jQuery.timers,
+ i = 0;
+
+ fxNow = jQuery.now();
+
+ for ( ; i < timers.length; i++ ) {
+ timer = timers[ i ];
+ // Checks the timer has not already been removed
+ if ( !timer() && timers[ i ] === timer ) {
+ timers.splice( i--, 1 );
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ fxNow = undefined;
+};
+
+jQuery.fx.timer = function( timer ) {
+ jQuery.timers.push( timer );
+ if ( timer() ) {
+ jQuery.fx.start();
+ } else {
+ jQuery.timers.pop();
+ }
+};
+
+jQuery.fx.interval = 13;
+
+jQuery.fx.start = function() {
+ if ( !timerId ) {
+ timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
+ }
+};
+
+jQuery.fx.stop = function() {
+ clearInterval( timerId );
+ timerId = null;
+};
+
+jQuery.fx.speeds = {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+};
+
+
+// Based off of the plugin by Clint Helfers, with permission.
+// http://blindsignals.com/index.php/2009/07/jquery-delay/
+jQuery.fn.delay = function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function( next, hooks ) {
+ var timeout = setTimeout( next, time );
+ hooks.stop = function() {
+ clearTimeout( timeout );
+ };
+ });
+};
+
+
+(function() {
+ var a, input, select, opt,
+ div = document.createElement("div" );
+
+ // Setup
+ div.setAttribute( "className", "t" );
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+ a = div.getElementsByTagName("a")[ 0 ];
+
+ // First batch of tests.
+ select = document.createElement("select");
+ opt = select.appendChild( document.createElement("option") );
+ input = div.getElementsByTagName("input")[ 0 ];
+
+ a.style.cssText = "top:1px";
+
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+ support.getSetAttribute = div.className !== "t";
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText instead)
+ support.style = /top/.test( a.getAttribute("style") );
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ support.hrefNormalized = a.getAttribute("href") === "/a";
+
+ // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
+ support.checkOn = !!input.value;
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ support.optSelected = opt.selected;
+
+ // Tests for enctype support on a form (#6743)
+ support.enctype = !!document.createElement("form").enctype;
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as disabled)
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Support: IE8 only
+ // Check if we can trust getAttribute("value")
+ input = document.createElement( "input" );
+ input.setAttribute( "value", "" );
+ support.input = input.getAttribute( "value" ) === "";
+
+ // Check if an input maintains its value after becoming a radio
+ input.value = "t";
+ input.setAttribute( "type", "radio" );
+ support.radioValue = input.value === "t";
+
+ // Null elements to avoid leaks in IE.
+ a = input = select = opt = div = null;
+})();
+
+
+var rreturn = /\r/g;
+
+jQuery.fn.extend({
+ val: function( value ) {
+ var hooks, ret, isFunction,
+ elem = this[0];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+ return ret;
+ }
+
+ ret = elem.value;
+
+ return typeof ret === "string" ?
+ // handle most common string cases
+ ret.replace(rreturn, "") :
+ // handle cases where value is null/undef or number
+ ret == null ? "" : ret;
+ }
+
+ return;
+ }
+
+ isFunction = jQuery.isFunction( value );
+
+ return this.each(function( i ) {
+ var val;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, jQuery( this ).val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+ } else if ( typeof val === "number" ) {
+ val += "";
+ } else if ( jQuery.isArray( val ) ) {
+ val = jQuery.map( val, function( value ) {
+ return value == null ? "" : value + "";
+ });
+ }
+
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ valHooks: {
+ option: {
+ get: function( elem ) {
+ var val = jQuery.find.attr( elem, "value" );
+ return val != null ?
+ val :
+ jQuery.text( elem );
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var value, option,
+ options = elem.options,
+ index = elem.selectedIndex,
+ one = elem.type === "select-one" || index < 0,
+ values = one ? null : [],
+ max = one ? index + 1 : options.length,
+ i = index < 0 ?
+ max :
+ one ? index : 0;
+
+ // Loop through all the selected options
+ for ( ; i < max; i++ ) {
+ option = options[ i ];
+
+ // oldIE doesn't update selected after form reset (#2551)
+ if ( ( option.selected || i === index ) &&
+ // Don't return options that are disabled or in a disabled optgroup
+ ( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
+ ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var optionSet, option,
+ options = elem.options,
+ values = jQuery.makeArray( value ),
+ i = options.length;
+
+ while ( i-- ) {
+ option = options[ i ];
+
+ if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {
+
+ // Support: IE6
+ // When new option element is added to select box we need to
+ // force reflow of newly added node in order to workaround delay
+ // of initialization properties
+ try {
+ option.selected = optionSet = true;
+
+ } catch ( _ ) {
+
+ // Will be executed only in IE6
+ option.scrollHeight;
+ }
+
+ } else {
+ option.selected = false;
+ }
+ }
+
+ // Force browsers to behave consistently when non-matching value is set
+ if ( !optionSet ) {
+ elem.selectedIndex = -1;
+ }
+
+ return options;
+ }
+ }
+ }
+});
+
+// Radios and checkboxes getter/setter
+jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ set: function( elem, value ) {
+ if ( jQuery.isArray( value ) ) {
+ return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
+ }
+ }
+ };
+ if ( !support.checkOn ) {
+ jQuery.valHooks[ this ].get = function( elem ) {
+ // Support: Webkit
+ // "" is returned instead of "on" if a value isn't specified
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ };
+ }
+});
+
+
+
+
+var nodeHook, boolHook,
+ attrHandle = jQuery.expr.attrHandle,
+ ruseDefault = /^(?:checked|selected)$/i,
+ getSetAttribute = support.getSetAttribute,
+ getSetInput = support.input;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return access( this, jQuery.attr, name, value, arguments.length > 1 );
+ },
+
+ removeAttr: function( name ) {
+ return this.each(function() {
+ jQuery.removeAttr( this, name );
+ });
+ }
+});
+
+jQuery.extend({
+ attr: function( elem, name, value ) {
+ var hooks, ret,
+ nType = elem.nodeType;
+
+ // don't get/set attributes on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ // Fallback to prop when attributes are not supported
+ if ( typeof elem.getAttribute === strundefined ) {
+ return jQuery.prop( elem, name, value );
+ }
+
+ // All attributes are lowercase
+ // Grab necessary hook if one is defined
+ if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
+ name = name.toLowerCase();
+ hooks = jQuery.attrHooks[ name ] ||
+ ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
+ }
+
+ if ( value !== undefined ) {
+
+ if ( value === null ) {
+ jQuery.removeAttr( elem, name );
+
+ } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ elem.setAttribute( name, value + "" );
+ return value;
+ }
+
+ } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+ ret = jQuery.find.attr( elem, name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret == null ?
+ undefined :
+ ret;
+ }
+ },
+
+ removeAttr: function( elem, value ) {
+ var name, propName,
+ i = 0,
+ attrNames = value && value.match( rnotwhite );
+
+ if ( attrNames && elem.nodeType === 1 ) {
+ while ( (name = attrNames[i++]) ) {
+ propName = jQuery.propFix[ name ] || name;
+
+ // Boolean attributes get special treatment (#10870)
+ if ( jQuery.expr.match.bool.test( name ) ) {
+ // Set corresponding property to false
+ if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+ elem[ propName ] = false;
+ // Support: IE<9
+ // Also clear defaultChecked/defaultSelected (if appropriate)
+ } else {
+ elem[ jQuery.camelCase( "default-" + name ) ] =
+ elem[ propName ] = false;
+ }
+
+ // See #9699 for explanation of this approach (setting first, then removal)
+ } else {
+ jQuery.attr( elem, name, "" );
+ }
+
+ elem.removeAttribute( getSetAttribute ? name : propName );
+ }
+ }
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+ // Setting the type on a radio button after the value resets the value in IE6-9
+ // Reset value to default in case type is set after value during creation
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ }
+ }
+});
+
+// Hook for boolean attributes
+boolHook = {
+ set: function( elem, value, name ) {
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+ // IE<8 needs the *property* name
+ elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
+
+ // Use defaultChecked and defaultSelected for oldIE
+ } else {
+ elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
+ }
+
+ return name;
+ }
+};
+
+// Retrieve booleans specially
+jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
+
+ var getter = attrHandle[ name ] || jQuery.find.attr;
+
+ attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
+ function( elem, name, isXML ) {
+ var ret, handle;
+ if ( !isXML ) {
+ // Avoid an infinite loop by temporarily removing this function from the getter
+ handle = attrHandle[ name ];
+ attrHandle[ name ] = ret;
+ ret = getter( elem, name, isXML ) != null ?
+ name.toLowerCase() :
+ null;
+ attrHandle[ name ] = handle;
+ }
+ return ret;
+ } :
+ function( elem, name, isXML ) {
+ if ( !isXML ) {
+ return elem[ jQuery.camelCase( "default-" + name ) ] ?
+ name.toLowerCase() :
+ null;
+ }
+ };
+});
+
+// fix oldIE attroperties
+if ( !getSetInput || !getSetAttribute ) {
+ jQuery.attrHooks.value = {
+ set: function( elem, value, name ) {
+ if ( jQuery.nodeName( elem, "input" ) ) {
+ // Does not return so that setAttribute is also used
+ elem.defaultValue = value;
+ } else {
+ // Use nodeHook if defined (#1954); otherwise setAttribute is fine
+ return nodeHook && nodeHook.set( elem, value, name );
+ }
+ }
+ };
+}
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !getSetAttribute ) {
+
+ // Use this for any attribute in IE6/7
+ // This fixes almost every IE6/7 issue
+ nodeHook = {
+ set: function( elem, value, name ) {
+ // Set the existing or create a new attribute node
+ var ret = elem.getAttributeNode( name );
+ if ( !ret ) {
+ elem.setAttributeNode(
+ (ret = elem.ownerDocument.createAttribute( name ))
+ );
+ }
+
+ ret.value = value += "";
+
+ // Break association with cloned elements by also using setAttribute (#9646)
+ if ( name === "value" || value === elem.getAttribute( name ) ) {
+ return value;
+ }
+ }
+ };
+
+ // Some attributes are constructed with empty-string values when not defined
+ attrHandle.id = attrHandle.name = attrHandle.coords =
+ function( elem, name, isXML ) {
+ var ret;
+ if ( !isXML ) {
+ return (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
+ ret.value :
+ null;
+ }
+ };
+
+ // Fixing value retrieval on a button requires this module
+ jQuery.valHooks.button = {
+ get: function( elem, name ) {
+ var ret = elem.getAttributeNode( name );
+ if ( ret && ret.specified ) {
+ return ret.value;
+ }
+ },
+ set: nodeHook.set
+ };
+
+ // Set contenteditable to false on removals(#10429)
+ // Setting to empty string throws an error as an invalid value
+ jQuery.attrHooks.contenteditable = {
+ set: function( elem, value, name ) {
+ nodeHook.set( elem, value === "" ? false : value, name );
+ }
+ };
+
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
+ // This is for removals
+ jQuery.each([ "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = {
+ set: function( elem, value ) {
+ if ( value === "" ) {
+ elem.setAttribute( name, "auto" );
+ return value;
+ }
+ }
+ };
+ });
+}
+
+if ( !support.style ) {
+ jQuery.attrHooks.style = {
+ get: function( elem ) {
+ // Return undefined in the case of empty string
+ // Note: IE uppercases css property names, but if we were to .toLowerCase()
+ // .cssText, that would destroy case senstitivity in URL's, like in "background"
+ return elem.style.cssText || undefined;
+ },
+ set: function( elem, value ) {
+ return ( elem.style.cssText = value + "" );
+ }
+ };
+}
+
+
+
+
+var rfocusable = /^(?:input|select|textarea|button|object)$/i,
+ rclickable = /^(?:a|area)$/i;
+
+jQuery.fn.extend({
+ prop: function( name, value ) {
+ return access( this, jQuery.prop, name, value, arguments.length > 1 );
+ },
+
+ removeProp: function( name ) {
+ name = jQuery.propFix[ name ] || name;
+ return this.each(function() {
+ // try/catch handles cases where IE balks (such as removing a property on window)
+ try {
+ this[ name ] = undefined;
+ delete this[ name ];
+ } catch( e ) {}
+ });
+ }
+});
+
+jQuery.extend({
+ propFix: {
+ "for": "htmlFor",
+ "class": "className"
+ },
+
+ prop: function( elem, name, value ) {
+ var ret, hooks, notxml,
+ nType = elem.nodeType;
+
+ // don't get/set properties on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ if ( notxml ) {
+ // Fix name and attach hooks
+ name = jQuery.propFix[ name ] || name;
+ hooks = jQuery.propHooks[ name ];
+ }
+
+ if ( value !== undefined ) {
+ return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
+ ret :
+ ( elem[ name ] = value );
+
+ } else {
+ return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
+ ret :
+ elem[ name ];
+ }
+ },
+
+ propHooks: {
+ tabIndex: {
+ get: function( elem ) {
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ // Use proper attribute retrieval(#12072)
+ var tabindex = jQuery.find.attr( elem, "tabindex" );
+
+ return tabindex ?
+ parseInt( tabindex, 10 ) :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ -1;
+ }
+ }
+ }
+});
+
+// Some attributes require a special call on IE
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !support.hrefNormalized ) {
+ // href/src property should get the full normalized URL (#10299/#12915)
+ jQuery.each([ "href", "src" ], function( i, name ) {
+ jQuery.propHooks[ name ] = {
+ get: function( elem ) {
+ return elem.getAttribute( name, 4 );
+ }
+ };
+ });
+}
+
+// Support: Safari, IE9+
+// mis-reports the default selected property of an option
+// Accessing the parent's selectedIndex property fixes it
+if ( !support.optSelected ) {
+ jQuery.propHooks.selected = {
+ get: function( elem ) {
+ var parent = elem.parentNode;
+
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ return null;
+ }
+ };
+}
+
+jQuery.each([
+ "tabIndex",
+ "readOnly",
+ "maxLength",
+ "cellSpacing",
+ "cellPadding",
+ "rowSpan",
+ "colSpan",
+ "useMap",
+ "frameBorder",
+ "contentEditable"
+], function() {
+ jQuery.propFix[ this.toLowerCase() ] = this;
+});
+
+// IE6/7 call enctype encoding
+if ( !support.enctype ) {
+ jQuery.propFix.enctype = "encoding";
+}
+
+
+
+
+var rclass = /[\t\r\n\f]/g;
+
+jQuery.fn.extend({
+ addClass: function( value ) {
+ var classes, elem, cur, clazz, j, finalValue,
+ i = 0,
+ len = this.length,
+ proceed = typeof value === "string" && value;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).addClass( value.call( this, j, this.className ) );
+ });
+ }
+
+ if ( proceed ) {
+ // The disjunction here is for better compressibility (see removeClass)
+ classes = ( value || "" ).match( rnotwhite ) || [];
+
+ for ( ; i < len; i++ ) {
+ elem = this[ i ];
+ cur = elem.nodeType === 1 && ( elem.className ?
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
+ " "
+ );
+
+ if ( cur ) {
+ j = 0;
+ while ( (clazz = classes[j++]) ) {
+ if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
+ cur += clazz + " ";
+ }
+ }
+
+ // only assign if different to avoid unneeded rendering.
+ finalValue = jQuery.trim( cur );
+ if ( elem.className !== finalValue ) {
+ elem.className = finalValue;
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ var classes, elem, cur, clazz, j, finalValue,
+ i = 0,
+ len = this.length,
+ proceed = arguments.length === 0 || typeof value === "string" && value;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).removeClass( value.call( this, j, this.className ) );
+ });
+ }
+ if ( proceed ) {
+ classes = ( value || "" ).match( rnotwhite ) || [];
+
+ for ( ; i < len; i++ ) {
+ elem = this[ i ];
+ // This expression is here for better compressibility (see addClass)
+ cur = elem.nodeType === 1 && ( elem.className ?
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
+ ""
+ );
+
+ if ( cur ) {
+ j = 0;
+ while ( (clazz = classes[j++]) ) {
+ // Remove *all* instances
+ while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
+ cur = cur.replace( " " + clazz + " ", " " );
+ }
+ }
+
+ // only assign if different to avoid unneeded rendering.
+ finalValue = value ? jQuery.trim( cur ) : "";
+ if ( elem.className !== finalValue ) {
+ elem.className = finalValue;
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value;
+
+ if ( typeof stateVal === "boolean" && type === "string" ) {
+ return stateVal ? this.addClass( value ) : this.removeClass( value );
+ }
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className,
+ i = 0,
+ self = jQuery( this ),
+ classNames = value.match( rnotwhite ) || [];
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space separated list
+ if ( self.hasClass( className ) ) {
+ self.removeClass( className );
+ } else {
+ self.addClass( className );
+ }
+ }
+
+ // Toggle whole class name
+ } else if ( type === strundefined || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery._data( this, "__className__", this.className );
+ }
+
+ // If the element has a class name or if we're passed "false",
+ // then remove the whole classname (if there was one, the above saved it).
+ // Otherwise bring back whatever was previously saved (if anything),
+ // falling back to the empty string if nothing was stored.
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ",
+ i = 0,
+ l = this.length;
+ for ( ; i < l; i++ ) {
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+});
+
+
+
+
+// Return jQuery for attributes-only inclusion
+
+
+jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+ "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( data, fn ) {
+ return arguments.length > 0 ?
+ this.on( name, null, data, fn ) :
+ this.trigger( name );
+ };
+});
+
+jQuery.fn.extend({
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ },
+
+ bind: function( types, data, fn ) {
+ return this.on( types, null, data, fn );
+ },
+ unbind: function( types, fn ) {
+ return this.off( types, null, fn );
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.on( types, selector, data, fn );
+ },
+ undelegate: function( selector, types, fn ) {
+ // ( namespace ) or ( selector, types [, fn] )
+ return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
+ }
+});
+
+
+var nonce = jQuery.now();
+
+var rquery = (/\?/);
+
+
+
+var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
+
+jQuery.parseJSON = function( data ) {
+ // Attempt to parse using the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ // Support: Android 2.3
+ // Workaround failure to string-cast null input
+ return window.JSON.parse( data + "" );
+ }
+
+ var requireNonComma,
+ depth = null,
+ str = jQuery.trim( data + "" );
+
+ // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
+ // after removing valid tokens
+ return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
+
+ // Force termination if we see a misplaced comma
+ if ( requireNonComma && comma ) {
+ depth = 0;
+ }
+
+ // Perform no more replacements after returning to outermost depth
+ if ( depth === 0 ) {
+ return token;
+ }
+
+ // Commas must not follow "[", "{", or ","
+ requireNonComma = open || comma;
+
+ // Determine new depth
+ // array/object open ("[" or "{"): depth += true - false (increment)
+ // array/object close ("]" or "}"): depth += false - true (decrement)
+ // other cases ("," or primitive): depth += true - true (numeric cast)
+ depth += !close - !open;
+
+ // Remove this token
+ return "";
+ }) ) ?
+ ( Function( "return " + str ) )() :
+ jQuery.error( "Invalid JSON: " + data );
+};
+
+
+// Cross-browser xml parsing
+jQuery.parseXML = function( data ) {
+ var xml, tmp;
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ try {
+ if ( window.DOMParser ) { // Standard
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data, "text/xml" );
+ } else { // IE
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
+ xml.async = "false";
+ xml.loadXML( data );
+ }
+ } catch( e ) {
+ xml = undefined;
+ }
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+};
+
+
+var
+ // Document location
+ ajaxLocParts,
+ ajaxLocation,
+
+ rhash = /#.*$/,
+ rts = /([?&])_=[^&]*/,
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
+ // #7653, #8125, #8152: local protocol detection
+ rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
+ rnoContent = /^(?:GET|HEAD)$/,
+ rprotocol = /^\/\//,
+ rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
+
+ /* Prefilters
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+ * 2) These are called:
+ * - BEFORE asking for a transport
+ * - AFTER param serialization (s.data is a string if s.processData is true)
+ * 3) key is the dataType
+ * 4) the catchall symbol "*" can be used
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+ */
+ prefilters = {},
+
+ /* Transports bindings
+ * 1) key is the dataType
+ * 2) the catchall symbol "*" can be used
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
+ */
+ transports = {},
+
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+ allTypes = "*/".concat("*");
+
+// #8138, IE may throw an exception when accessing
+// a field from window.location if document.domain has been set
+try {
+ ajaxLocation = location.href;
+} catch( e ) {
+ // Use the href attribute of an A element
+ // since IE will modify it given document.location
+ ajaxLocation = document.createElement( "a" );
+ ajaxLocation.href = "";
+ ajaxLocation = ajaxLocation.href;
+}
+
+// Segment location into parts
+ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+ // dataTypeExpression is optional and defaults to "*"
+ return function( dataTypeExpression, func ) {
+
+ if ( typeof dataTypeExpression !== "string" ) {
+ func = dataTypeExpression;
+ dataTypeExpression = "*";
+ }
+
+ var dataType,
+ i = 0,
+ dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
+
+ if ( jQuery.isFunction( func ) ) {
+ // For each dataType in the dataTypeExpression
+ while ( (dataType = dataTypes[i++]) ) {
+ // Prepend if requested
+ if ( dataType.charAt( 0 ) === "+" ) {
+ dataType = dataType.slice( 1 ) || "*";
+ (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
+
+ // Otherwise append
+ } else {
+ (structure[ dataType ] = structure[ dataType ] || []).push( func );
+ }
+ }
+ }
+ };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
+
+ var inspected = {},
+ seekingTransport = ( structure === transports );
+
+ function inspect( dataType ) {
+ var selected;
+ inspected[ dataType ] = true;
+ jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
+ var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
+ if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
+ options.dataTypes.unshift( dataTypeOrTransport );
+ inspect( dataTypeOrTransport );
+ return false;
+ } else if ( seekingTransport ) {
+ return !( selected = dataTypeOrTransport );
+ }
+ });
+ return selected;
+ }
+
+ return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
+}
+
+// A special extend for ajax options
+// that takes "flat" options (not to be deep extended)
+// Fixes #9887
+function ajaxExtend( target, src ) {
+ var deep, key,
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
+
+ for ( key in src ) {
+ if ( src[ key ] !== undefined ) {
+ ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
+ }
+ }
+ if ( deep ) {
+ jQuery.extend( true, target, deep );
+ }
+
+ return target;
+}
+
+/* Handles responses to an ajax request:
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+ var firstDataType, ct, finalDataType, type,
+ contents = s.contents,
+ dataTypes = s.dataTypes;
+
+ // Remove auto dataType and get content-type in the process
+ while ( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+/* Chain conversions given the request and the original response
+ * Also sets the responseXXX fields on the jqXHR instance
+ */
+function ajaxConvert( s, response, jqXHR, isSuccess ) {
+ var conv2, current, conv, tmp, prev,
+ converters = {},
+ // Work with a copy of dataTypes in case we need to modify it for conversion
+ dataTypes = s.dataTypes.slice();
+
+ // Create converters map with lowercased keys
+ if ( dataTypes[ 1 ] ) {
+ for ( conv in s.converters ) {
+ converters[ conv.toLowerCase() ] = s.converters[ conv ];
+ }
+ }
+
+ current = dataTypes.shift();
+
+ // Convert to each sequential dataType
+ while ( current ) {
+
+ if ( s.responseFields[ current ] ) {
+ jqXHR[ s.responseFields[ current ] ] = response;
+ }
+
+ // Apply the dataFilter if provided
+ if ( !prev && isSuccess && s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ prev = current;
+ current = dataTypes.shift();
+
+ if ( current ) {
+
+ // There's only work to do if current dataType is non-auto
+ if ( current === "*" ) {
+
+ current = prev;
+
+ // Convert response if prev dataType is non-auto and differs from current
+ } else if ( prev !== "*" && prev !== current ) {
+
+ // Seek a direct converter
+ conv = converters[ prev + " " + current ] || converters[ "* " + current ];
+
+ // If none found, seek a pair
+ if ( !conv ) {
+ for ( conv2 in converters ) {
+
+ // If conv2 outputs current
+ tmp = conv2.split( " " );
+ if ( tmp[ 1 ] === current ) {
+
+ // If prev can be converted to accepted input
+ conv = converters[ prev + " " + tmp[ 0 ] ] ||
+ converters[ "* " + tmp[ 0 ] ];
+ if ( conv ) {
+ // Condense equivalence converters
+ if ( conv === true ) {
+ conv = converters[ conv2 ];
+
+ // Otherwise, insert the intermediate dataType
+ } else if ( converters[ conv2 ] !== true ) {
+ current = tmp[ 0 ];
+ dataTypes.unshift( tmp[ 1 ] );
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ // Apply converter (if not an equivalence)
+ if ( conv !== true ) {
+
+ // Unless errors are allowed to bubble, catch and return them
+ if ( conv && s[ "throws" ] ) {
+ response = conv( response );
+ } else {
+ try {
+ response = conv( response );
+ } catch ( e ) {
+ return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return { state: "success", data: response };
+}
+
+jQuery.extend({
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {},
+
+ ajaxSettings: {
+ url: ajaxLocation,
+ type: "GET",
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ processData: true,
+ async: true,
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ throws: false,
+ traditional: false,
+ headers: {},
+ */
+
+ accepts: {
+ "*": allTypes,
+ text: "text/plain",
+ html: "text/html",
+ xml: "application/xml, text/xml",
+ json: "application/json, text/javascript"
+ },
+
+ contents: {
+ xml: /xml/,
+ html: /html/,
+ json: /json/
+ },
+
+ responseFields: {
+ xml: "responseXML",
+ text: "responseText",
+ json: "responseJSON"
+ },
+
+ // Data converters
+ // Keys separate source (or catchall "*") and destination types with a single space
+ converters: {
+
+ // Convert anything to text
+ "* text": String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ },
+
+ // For options that shouldn't be deep extended:
+ // you can add your own custom options here if
+ // and when you create one that shouldn't be
+ // deep extended (see ajaxExtend)
+ flatOptions: {
+ url: true,
+ context: true
+ }
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function( target, settings ) {
+ return settings ?
+
+ // Building a settings object
+ ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
+
+ // Extending ajaxSettings
+ ajaxExtend( jQuery.ajaxSettings, target );
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var // Cross-domain detection vars
+ parts,
+ // Loop variable
+ i,
+ // URL without anti-cache param
+ cacheURL,
+ // Response headers as string
+ responseHeadersString,
+ // timeout handle
+ timeoutTimer,
+
+ // To know if global events are to be dispatched
+ fireGlobals,
+
+ transport,
+ // Response headers
+ responseHeaders,
+ // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+ // Callbacks context
+ callbackContext = s.context || s,
+ // Context for global events is callbackContext if it is a DOM node or jQuery collection
+ globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
+ jQuery( callbackContext ) :
+ jQuery.event,
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery.Callbacks("once memory"),
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+ // The jqXHR state
+ state = 0,
+ // Default abort message
+ strAbort = "canceled",
+ // Fake xhr
+ jqXHR = {
+ readyState: 0,
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while ( (match = rheaders.exec( responseHeadersString )) ) {
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match == null ? null : match;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ var lname = name.toLowerCase();
+ if ( !state ) {
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Status-dependent callbacks
+ statusCode: function( map ) {
+ var code;
+ if ( map ) {
+ if ( state < 2 ) {
+ for ( code in map ) {
+ // Lazy-add the new callback in a way that preserves old ones
+ statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
+ }
+ } else {
+ // Execute the appropriate callbacks
+ jqXHR.always( map[ jqXHR.status ] );
+ }
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ var finalText = statusText || strAbort;
+ if ( transport ) {
+ transport.abort( finalText );
+ }
+ done( 0, finalText );
+ return this;
+ }
+ };
+
+ // Attach deferreds
+ deferred.promise( jqXHR ).complete = completeDeferred.add;
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
+
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+ // Handle falsy url in the settings object (#10093: consistency with old signature)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+ // Alias method option to type as per ticket #12004
+ s.type = options.method || options.type || s.method || s.type;
+
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
+
+ // A cross-domain request is in order when we have a protocol:host:port mismatch
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
+ );
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefilter, stop there
+ if ( state === 2 ) {
+ return jqXHR;
+ }
+
+ // We can fire global events as of now if asked to
+ fireGlobals = s.global;
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger("ajaxStart");
+ }
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Save the URL in case we're toying with the If-Modified-Since
+ // and/or If-None-Match header later on
+ cacheURL = s.url;
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
+ // #9682: remove data so that it's not used in an eventual retry
+ delete s.data;
+ }
+
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+ s.url = rts.test( cacheURL ) ?
+
+ // If there is already a '_' parameter, set its value
+ cacheURL.replace( rts, "$1_=" + nonce++ ) :
+
+ // Otherwise add one to the end
+ cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
+ }
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ if ( jQuery.lastModified[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
+ }
+ if ( jQuery.etag[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+ // Abort if not done already and return
+ return jqXHR.abort();
+ }
+
+ // aborting is no longer a cancellation
+ strAbort = "abort";
+
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = setTimeout(function() {
+ jqXHR.abort("timeout");
+ }, s.timeout );
+ }
+
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch ( e ) {
+ // Propagate exception as error if not done
+ if ( state < 2 ) {
+ done( -1, e );
+ // Simply rethrow otherwise
+ } else {
+ throw e;
+ }
+ }
+ }
+
+ // Callback for when everything is done
+ function done( status, nativeStatusText, responses, headers ) {
+ var isSuccess, success, error, response, modified,
+ statusText = nativeStatusText;
+
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
+
+ // State is "done" now
+ state = 2;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status > 0 ? 4 : 0;
+
+ // Determine if successful
+ isSuccess = status >= 200 && status < 300 || status === 304;
+
+ // Get response data
+ if ( responses ) {
+ response = ajaxHandleResponses( s, jqXHR, responses );
+ }
+
+ // Convert no matter what (that way responseXXX fields are always set)
+ response = ajaxConvert( s, response, jqXHR, isSuccess );
+
+ // If successful, handle type chaining
+ if ( isSuccess ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ modified = jqXHR.getResponseHeader("Last-Modified");
+ if ( modified ) {
+ jQuery.lastModified[ cacheURL ] = modified;
+ }
+ modified = jqXHR.getResponseHeader("etag");
+ if ( modified ) {
+ jQuery.etag[ cacheURL ] = modified;
+ }
+ }
+
+ // if no content
+ if ( status === 204 || s.type === "HEAD" ) {
+ statusText = "nocontent";
+
+ // if not modified
+ } else if ( status === 304 ) {
+ statusText = "notmodified";
+
+ // If we have data, let's convert it
+ } else {
+ statusText = response.state;
+ success = response.data;
+ error = response.error;
+ isSuccess = !error;
+ }
+ } else {
+ // We extract error from statusText
+ // then normalize statusText and status for non-aborts
+ error = statusText;
+ if ( status || !statusText ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger("ajaxStop");
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ }
+});
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+ // shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ return jQuery.ajax({
+ url: url,
+ type: method,
+ dataType: type,
+ data: data,
+ success: callback
+ });
+ };
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
+ jQuery.fn[ type ] = function( fn ) {
+ return this.on( type, fn );
+ };
+});
+
+
+jQuery._evalUrl = function( url ) {
+ return jQuery.ajax({
+ url: url,
+ type: "GET",
+ dataType: "script",
+ async: false,
+ global: false,
+ "throws": true
+ });
+};
+
+
+jQuery.fn.extend({
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+
+ if ( this[0].parentNode ) {
+ wrap.insertBefore( this[0] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ }).append( this );
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapInner( html.call(this, i) );
+ });
+ }
+
+ return this.each(function() {
+ var self = jQuery( this ),
+ contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ var isFunction = jQuery.isFunction( html );
+
+ return this.each(function(i) {
+ jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ }
+});
+
+
+jQuery.expr.filters.hidden = function( elem ) {
+ // Support: Opera <= 12.12
+ // Opera reports offsetWidths and offsetHeights less than zero on some elements
+ return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
+ (!support.reliableHiddenOffsets() &&
+ ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
+};
+
+jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+};
+
+
+
+
+var r20 = /%20/g,
+ rbracket = /\[\]$/,
+ rCRLF = /\r?\n/g,
+ rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
+ rsubmittable = /^(?:input|select|textarea|keygen)/i;
+
+function buildParams( prefix, obj, traditional, add ) {
+ var name;
+
+ if ( jQuery.isArray( obj ) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || rbracket.test( prefix ) ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+
+ } else {
+ // Item is non-scalar (array or object), encode its numeric index.
+ buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
+ }
+ });
+
+ } else if ( !traditional && jQuery.type( obj ) === "object" ) {
+ // Serialize object item.
+ for ( name in obj ) {
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+ }
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+}
+
+// Serialize an array of form elements or a set of
+// key/values into a query string
+jQuery.param = function( a, traditional ) {
+ var prefix,
+ s = [],
+ add = function( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+ };
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( prefix in a ) {
+ buildParams( prefix, a[ prefix ], traditional, add );
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join( "&" ).replace( r20, "+" );
+};
+
+jQuery.fn.extend({
+ serialize: function() {
+ return jQuery.param( this.serializeArray() );
+ },
+ serializeArray: function() {
+ return this.map(function() {
+ // Can add propHook for "elements" to filter or add form elements
+ var elements = jQuery.prop( this, "elements" );
+ return elements ? jQuery.makeArray( elements ) : this;
+ })
+ .filter(function() {
+ var type = this.type;
+ // Use .is(":disabled") so that fieldset[disabled] works
+ return this.name && !jQuery( this ).is( ":disabled" ) &&
+ rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
+ ( this.checked || !rcheckableType.test( type ) );
+ })
+ .map(function( i, elem ) {
+ var val = jQuery( this ).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray( val ) ?
+ jQuery.map( val, function( val ) {
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }) :
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }).get();
+ }
+});
+
+
+// Create the request object
+// (This is still attached to ajaxSettings for backward compatibility)
+jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
+ // Support: IE6+
+ function() {
+
+ // XHR cannot access local files, always use ActiveX for that case
+ return !this.isLocal &&
+
+ // Support: IE7-8
+ // oldIE XHR does not support non-RFC2616 methods (#13240)
+ // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
+ // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
+ // Although this check for six methods instead of eight
+ // since IE also does not support "trace" and "connect"
+ /^(get|post|head|put|delete|options)$/i.test( this.type ) &&
+
+ createStandardXHR() || createActiveXHR();
+ } :
+ // For all other browsers, use the standard XMLHttpRequest object
+ createStandardXHR;
+
+var xhrId = 0,
+ xhrCallbacks = {},
+ xhrSupported = jQuery.ajaxSettings.xhr();
+
+// Support: IE<10
+// Open requests must be manually aborted on unload (#5280)
+if ( window.ActiveXObject ) {
+ jQuery( window ).on( "unload", function() {
+ for ( var key in xhrCallbacks ) {
+ xhrCallbacks[ key ]( undefined, true );
+ }
+ });
+}
+
+// Determine support properties
+support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
+xhrSupported = support.ajax = !!xhrSupported;
+
+// Create transport if the browser can provide an xhr
+if ( xhrSupported ) {
+
+ jQuery.ajaxTransport(function( options ) {
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( !options.crossDomain || support.cors ) {
+
+ var callback;
+
+ return {
+ send: function( headers, complete ) {
+ var i,
+ xhr = options.xhr(),
+ id = ++xhrId;
+
+ // Open the socket
+ xhr.open( options.type, options.url, options.async, options.username, options.password );
+
+ // Apply custom fields if provided
+ if ( options.xhrFields ) {
+ for ( i in options.xhrFields ) {
+ xhr[ i ] = options.xhrFields[ i ];
+ }
+ }
+
+ // Override mime type if needed
+ if ( options.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( options.mimeType );
+ }
+
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !options.crossDomain && !headers["X-Requested-With"] ) {
+ headers["X-Requested-With"] = "XMLHttpRequest";
+ }
+
+ // Set headers
+ for ( i in headers ) {
+ // Support: IE<9
+ // IE's ActiveXObject throws a 'Type Mismatch' exception when setting
+ // request header to a null-value.
+ //
+ // To keep consistent with other XHR implementations, cast the value
+ // to string and ignore `undefined`.
+ if ( headers[ i ] !== undefined ) {
+ xhr.setRequestHeader( i, headers[ i ] + "" );
+ }
+ }
+
+ // Do send the request
+ // This may raise an exception which is actually
+ // handled in jQuery.ajax (so no try/catch here)
+ xhr.send( ( options.hasContent && options.data ) || null );
+
+ // Listener
+ callback = function( _, isAbort ) {
+ var status, statusText, responses;
+
+ // Was never called and is aborted or complete
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
+ // Clean up
+ delete xhrCallbacks[ id ];
+ callback = undefined;
+ xhr.onreadystatechange = jQuery.noop;
+
+ // Abort manually if needed
+ if ( isAbort ) {
+ if ( xhr.readyState !== 4 ) {
+ xhr.abort();
+ }
+ } else {
+ responses = {};
+ status = xhr.status;
+
+ // Support: IE<10
+ // Accessing binary-data responseText throws an exception
+ // (#11426)
+ if ( typeof xhr.responseText === "string" ) {
+ responses.text = xhr.responseText;
+ }
+
+ // Firefox throws an exception when accessing
+ // statusText for faulty cross-domain requests
+ try {
+ statusText = xhr.statusText;
+ } catch( e ) {
+ // We normalize with Webkit giving an empty statusText
+ statusText = "";
+ }
+
+ // Filter status for non standard behaviors
+
+ // If the request is local and we have data: assume a success
+ // (success with no data won't get notified, that's the best we
+ // can do given current implementations)
+ if ( !status && options.isLocal && !options.crossDomain ) {
+ status = responses.text ? 200 : 404;
+ // IE - #1450: sometimes returns 1223 when it should be 204
+ } else if ( status === 1223 ) {
+ status = 204;
+ }
+ }
+ }
+
+ // Call complete if needed
+ if ( responses ) {
+ complete( status, statusText, responses, xhr.getAllResponseHeaders() );
+ }
+ };
+
+ if ( !options.async ) {
+ // if we're in sync mode we fire the callback
+ callback();
+ } else if ( xhr.readyState === 4 ) {
+ // (IE6 & IE7) if it's in cache and has been
+ // retrieved directly we need to fire the callback
+ setTimeout( callback );
+ } else {
+ // Add to the list of active xhr callbacks
+ xhr.onreadystatechange = xhrCallbacks[ id ] = callback;
+ }
+ },
+
+ abort: function() {
+ if ( callback ) {
+ callback( undefined, true );
+ }
+ }
+ };
+ }
+ });
+}
+
+// Functions to create xhrs
+function createStandardXHR() {
+ try {
+ return new window.XMLHttpRequest();
+ } catch( e ) {}
+}
+
+function createActiveXHR() {
+ try {
+ return new window.ActiveXObject( "Microsoft.XMLHTTP" );
+ } catch( e ) {}
+}
+
+
+
+
+// Install script dataType
+jQuery.ajaxSetup({
+ accepts: {
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /(?:java|ecma)script/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+});
+
+// Handle cache's special case and global
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ s.global = false;
+ }
+});
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function(s) {
+
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+
+ var script,
+ head = document.head || jQuery("head")[0] || document.documentElement;
+
+ return {
+
+ send: function( _, callback ) {
+
+ script = document.createElement("script");
+
+ script.async = true;
+
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ script.src = s.url;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
+
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+
+ // Remove the script
+ if ( script.parentNode ) {
+ script.parentNode.removeChild( script );
+ }
+
+ // Dereference the script
+ script = null;
+
+ // Callback if not abort
+ if ( !isAbort ) {
+ callback( 200, "success" );
+ }
+ }
+ };
+
+ // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
+ // Use native DOM manipulation to avoid our domManip AJAX trickery
+ head.insertBefore( script, head.firstChild );
+ },
+
+ abort: function() {
+ if ( script ) {
+ script.onload( undefined, true );
+ }
+ }
+ };
+ }
+});
+
+
+
+
+var oldCallbacks = [],
+ rjsonp = /(=)\?(?=&|$)|\?\?/;
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+ jsonp: "callback",
+ jsonpCallback: function() {
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
+ this[ callback ] = true;
+ return callback;
+ }
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var callbackName, overwritten, responseContainer,
+ jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
+ "url" :
+ typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
+ );
+
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set
+ if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
+
+ // Get callback name, remembering preexisting value associated with it
+ callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
+ s.jsonpCallback() :
+ s.jsonpCallback;
+
+ // Insert callback into url or form data
+ if ( jsonProp ) {
+ s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
+ } else if ( s.jsonp !== false ) {
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
+ }
+
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( callbackName + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Install callback
+ overwritten = window[ callbackName ];
+ window[ callbackName ] = function() {
+ responseContainer = arguments;
+ };
+
+ // Clean-up function (fires after converters)
+ jqXHR.always(function() {
+ // Restore preexisting value
+ window[ callbackName ] = overwritten;
+
+ // Save back as free
+ if ( s[ callbackName ] ) {
+ // make sure that re-using the options doesn't screw things around
+ s.jsonpCallback = originalSettings.jsonpCallback;
+
+ // save the callback name for future use
+ oldCallbacks.push( callbackName );
+ }
+
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( overwritten ) ) {
+ overwritten( responseContainer[ 0 ] );
+ }
+
+ responseContainer = overwritten = undefined;
+ });
+
+ // Delegate to script
+ return "script";
+ }
+});
+
+
+
+
+// data: string of html
+// context (optional): If specified, the fragment will be created in this context, defaults to document
+// keepScripts (optional): If true, will include scripts passed in the html string
+jQuery.parseHTML = function( data, context, keepScripts ) {
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ if ( typeof context === "boolean" ) {
+ keepScripts = context;
+ context = false;
+ }
+ context = context || document;
+
+ var parsed = rsingleTag.exec( data ),
+ scripts = !keepScripts && [];
+
+ // Single tag
+ if ( parsed ) {
+ return [ context.createElement( parsed[1] ) ];
+ }
+
+ parsed = jQuery.buildFragment( [ data ], context, scripts );
+
+ if ( scripts && scripts.length ) {
+ jQuery( scripts ).remove();
+ }
+
+ return jQuery.merge( [], parsed.childNodes );
+};
+
+
+// Keep a copy of the old load method
+var _load = jQuery.fn.load;
+
+/**
+ * Load a url into a page
+ */
+jQuery.fn.load = function( url, params, callback ) {
+ if ( typeof url !== "string" && _load ) {
+ return _load.apply( this, arguments );
+ }
+
+ var selector, response, type,
+ self = this,
+ off = url.indexOf(" ");
+
+ if ( off >= 0 ) {
+ selector = url.slice( off, url.length );
+ url = url.slice( 0, off );
+ }
+
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( params && typeof params === "object" ) {
+ type = "POST";
+ }
+
+ // If we have elements to modify, make the request
+ if ( self.length > 0 ) {
+ jQuery.ajax({
+ url: url,
+
+ // if "type" variable is undefined, then "GET" method will be used
+ type: type,
+ dataType: "html",
+ data: params
+ }).done(function( responseText ) {
+
+ // Save response for use in complete callback
+ response = arguments;
+
+ self.html( selector ?
+
+ // If a selector was specified, locate the right elements in a dummy div
+ // Exclude scripts to avoid IE 'Permission Denied' errors
+ jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
+
+ // Otherwise use the full result
+ responseText );
+
+ }).complete( callback && function( jqXHR, status ) {
+ self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
+ });
+ }
+
+ return this;
+};
+
+
+
+
+jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+};
+
+
+
+
+
+var docElem = window.document.documentElement;
+
+/**
+ * Gets a window from an element
+ */
+function getWindow( elem ) {
+ return jQuery.isWindow( elem ) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+
+jQuery.offset = {
+ setOffset: function( elem, options, i ) {
+ var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
+ position = jQuery.css( elem, "position" ),
+ curElem = jQuery( elem ),
+ props = {};
+
+ // set position first, in-case top/left are set even on static elem
+ if ( position === "static" ) {
+ elem.style.position = "relative";
+ }
+
+ curOffset = curElem.offset();
+ curCSSTop = jQuery.css( elem, "top" );
+ curCSSLeft = jQuery.css( elem, "left" );
+ calculatePosition = ( position === "absolute" || position === "fixed" ) &&
+ jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1;
+
+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
+ if ( calculatePosition ) {
+ curPosition = curElem.position();
+ curTop = curPosition.top;
+ curLeft = curPosition.left;
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
+ }
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ if ( options.top != null ) {
+ props.top = ( options.top - curOffset.top ) + curTop;
+ }
+ if ( options.left != null ) {
+ props.left = ( options.left - curOffset.left ) + curLeft;
+ }
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+jQuery.fn.extend({
+ offset: function( options ) {
+ if ( arguments.length ) {
+ return options === undefined ?
+ this :
+ this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ var docElem, win,
+ box = { top: 0, left: 0 },
+ elem = this[ 0 ],
+ doc = elem && elem.ownerDocument;
+
+ if ( !doc ) {
+ return;
+ }
+
+ docElem = doc.documentElement;
+
+ // Make sure it's not a disconnected DOM node
+ if ( !jQuery.contains( docElem, elem ) ) {
+ return box;
+ }
+
+ // If we don't have gBCR, just use 0,0 rather than error
+ // BlackBerry 5, iOS 3 (original iPhone)
+ if ( typeof elem.getBoundingClientRect !== strundefined ) {
+ box = elem.getBoundingClientRect();
+ }
+ win = getWindow( doc );
+ return {
+ top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
+ left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
+ };
+ },
+
+ position: function() {
+ if ( !this[ 0 ] ) {
+ return;
+ }
+
+ var offsetParent, offset,
+ parentOffset = { top: 0, left: 0 },
+ elem = this[ 0 ];
+
+ // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
+ if ( jQuery.css( elem, "position" ) === "fixed" ) {
+ // we assume that getBoundingClientRect is available when computed position is fixed
+ offset = elem.getBoundingClientRect();
+ } else {
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent();
+
+ // Get correct offsets
+ offset = this.offset();
+ if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
+ parentOffset = offsetParent.offset();
+ }
+
+ // Add offsetParent borders
+ parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
+ parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
+ }
+
+ // Subtract parent offsets and element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ return {
+ top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
+ left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || docElem;
+
+ while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent || docElem;
+ });
+ }
+});
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
+ var top = /Y/.test( prop );
+
+ jQuery.fn[ method ] = function( val ) {
+ return access( this, function( elem, method, val ) {
+ var win = getWindow( elem );
+
+ if ( val === undefined ) {
+ return win ? (prop in win) ? win[ prop ] :
+ win.document.documentElement[ method ] :
+ elem[ method ];
+ }
+
+ if ( win ) {
+ win.scrollTo(
+ !top ? val : jQuery( win ).scrollLeft(),
+ top ? val : jQuery( win ).scrollTop()
+ );
+
+ } else {
+ elem[ method ] = val;
+ }
+ }, method, val, arguments.length, null );
+ };
+});
+
+// Add the top/left cssHooks using jQuery.fn.position
+// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
+// getComputedStyle returns percent when specified for top/left/bottom/right
+// rather than make the css module depend on the offset module, we just check for it here
+jQuery.each( [ "top", "left" ], function( i, prop ) {
+ jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
+ function( elem, computed ) {
+ if ( computed ) {
+ computed = curCSS( elem, prop );
+ // if curCSS returns percentage, fallback to offset
+ return rnumnonpx.test( computed ) ?
+ jQuery( elem ).position()[ prop ] + "px" :
+ computed;
+ }
+ }
+ );
+});
+
+
+// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
+jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
+ jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
+ // margin is only for outerHeight, outerWidth
+ jQuery.fn[ funcName ] = function( margin, value ) {
+ var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
+ extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
+
+ return access( this, function( elem, type, value ) {
+ var doc;
+
+ if ( jQuery.isWindow( elem ) ) {
+ // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
+ // isn't a whole lot we can do. See pull request at this URL for discussion:
+ // https://github.com/jquery/jquery/pull/764
+ return elem.document.documentElement[ "client" + name ];
+ }
+
+ // Get document width or height
+ if ( elem.nodeType === 9 ) {
+ doc = elem.documentElement;
+
+ // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
+ // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
+ return Math.max(
+ elem.body[ "scroll" + name ], doc[ "scroll" + name ],
+ elem.body[ "offset" + name ], doc[ "offset" + name ],
+ doc[ "client" + name ]
+ );
+ }
+
+ return value === undefined ?
+ // Get width or height on the element, requesting but not forcing parseFloat
+ jQuery.css( elem, type, extra ) :
+
+ // Set width or height on the element
+ jQuery.style( elem, type, value, extra );
+ }, type, chainable ? margin : undefined, chainable, null );
+ };
+ });
+});
+
+
+// The number of elements contained in the matched element set
+jQuery.fn.size = function() {
+ return this.length;
+};
+
+jQuery.fn.andSelf = jQuery.fn.addBack;
+
+
+
+
+// Register as a named AMD module, since jQuery can be concatenated with other
+// files that may use define, but not via a proper concatenation script that
+// understands anonymous AMD modules. A named AMD is safest and most robust
+// way to register. Lowercase jquery is used because AMD module names are
+// derived from file names, and jQuery is normally delivered in a lowercase
+// file name. Do this after creating the global so that if an AMD module wants
+// to call noConflict to hide this version of jQuery, it will work.
+if ( typeof define === "function" && define.amd ) {
+ define( "jquery", [], function() {
+ return jQuery;
+ });
+}
+
+
+
+
+var
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$;
+
+jQuery.noConflict = function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+};
+
+// Expose jQuery and $ identifiers, even in
+// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
+// and CommonJS for browser emulators (#13566)
+if ( typeof noGlobal === strundefined ) {
+ window.jQuery = window.$ = jQuery;
+}
+
+
+
+
+return jQuery;
+
+}));
diff --git a/framework/Web/Javascripts/source/jquery/jquery.min.js b/framework/Web/Javascripts/source/jquery/jquery.min.js
new file mode 100644
index 00000000..73f33fb3
--- /dev/null
+++ b/framework/Web/Javascripts/source/jquery/jquery.min.js
@@ -0,0 +1,4 @@
+/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="<select t=''><option selected=''></option></select>",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=jb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=kb(b);function nb(){}nb.prototype=d.filters=d.pseudos,d.setFilters=new nb;function ob(a,b){var c,e,f,g,h,i,j,k=x[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=Q.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?db.error(a):x(a,i).slice(0)}function pb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:z,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f
+}}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},W=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a>",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=$.test(e)?this.mouseHooks:Z.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||z),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||z,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==db()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===db()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=z.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===L&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&(a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault())?bb:cb):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:cb,isPropagationStopped:cb,isImmediatePropagationStopped:cb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=bb,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=bb,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submitBubbles||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?b.form:void 0;c&&!n._data(c,"submitBubbles")&&(n.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),n._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.changeBubbles||(n.event.special.change={setup:function(){return Y.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),n.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),n.event.simulate("change",this,a,!0)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;Y.test(b.nodeName)&&!n._data(b,"changeBubbles")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a,!0)}),n._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!Y.test(this.nodeName)}}),l.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=cb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return n().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=cb),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});function eb(a){var b=fb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var fb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gb=/ jQuery\d+="(?:null|\d+)"/g,hb=new RegExp("<(?:"+fb+")[\\s/>]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/<tbody/i,mb=/<|&#?\w+;/,nb=/<(?:script|style|link)/i,ob=/checked\s*(?:[^=]|=\s*.checked.)/i,pb=/^$|\/(?:java|ecma)script/i,qb=/^true\/(.*)/,rb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,sb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1></$2>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?"<table>"!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(vb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Db[0].contentWindow||Db[0].contentDocument).document,b.write(),b.close(),c=Fb(a,b),Db.detach()),Eb[a]=c),c}!function(){var a,b,c=z.createElement("div"),d="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],a.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(a.style.opacity),l.cssFloat=!!a.style.cssFloat,c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===c.style.backgroundClip,a=c=null,l.shrinkWrapBlocks=function(){var a,c,e,f;if(null==b){if(a=z.getElementsByTagName("body")[0],!a)return;f="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",c=z.createElement("div"),e=z.createElement("div"),a.appendChild(c).appendChild(e),b=!1,typeof e.style.zoom!==L&&(e.style.cssText=d+";width:1px;padding:1px;zoom:1",e.innerHTML="<div></div>",e.firstChild.style.width="5px",b=3!==e.offsetWidth),a.removeChild(c),a=c=e=null}return b}}();var Hb=/^margin/,Ib=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Jb,Kb,Lb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Jb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),Ib.test(g)&&Hb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):z.documentElement.currentStyle&&(Jb=function(a){return a.currentStyle},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ib.test(g)&&!Lb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Mb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h=z.createElement("div"),i="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",j="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";h.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",b=h.getElementsByTagName("a")[0],b.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(b.style.opacity),l.cssFloat=!!b.style.cssFloat,h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,b=h=null,n.extend(l,{reliableHiddenOffsets:function(){if(null!=c)return c;var a,b,d,e=z.createElement("div"),f=z.getElementsByTagName("body")[0];if(f)return e.setAttribute("className","t"),e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=z.createElement("div"),a.style.cssText=i,f.appendChild(a).appendChild(e),e.innerHTML="<table><tr><td></td><td>t</td></tr></table>",b=e.getElementsByTagName("td"),b[0].style.cssText="padding:0;margin:0;border:0;display:none",d=0===b[0].offsetHeight,b[0].style.display="",b[1].style.display="none",c=d&&0===b[0].offsetHeight,f.removeChild(a),e=f=null,c},boxSizing:function(){return null==d&&k(),d},boxSizingReliable:function(){return null==e&&k(),e},pixelPosition:function(){return null==f&&k(),f},reliableMarginRight:function(){var b,c,d,e;if(null==g&&a.getComputedStyle){if(b=z.getElementsByTagName("body")[0],!b)return;c=z.createElement("div"),d=z.createElement("div"),c.style.cssText=i,b.appendChild(c).appendChild(d),e=d.appendChild(z.createElement("div")),e.style.cssText=d.style.cssText=j,e.style.marginRight=e.style.width="0",d.style.width="1px",g=!parseFloat((a.getComputedStyle(e,null)||{}).marginRight),b.removeChild(c)}return g}});function k(){var b,c,h=z.getElementsByTagName("body")[0];h&&(b=z.createElement("div"),c=z.createElement("div"),b.style.cssText=i,h.appendChild(b).appendChild(c),c.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;display:block;padding:1px;border:1px;width:4px;margin-top:1%;top:1%",n.swap(h,null!=h.style.zoom?{zoom:1}:{},function(){d=4===c.offsetWidth}),e=!0,f=!1,g=!0,a.getComputedStyle&&(f="1%"!==(a.getComputedStyle(c,null)||{}).top,e="4px"===(a.getComputedStyle(c,null)||{width:"4px"}).width),h.removeChild(b),c=h=null)}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Nb=/alpha\([^)]*\)/i,Ob=/opacity\s*=\s*([^)]*)/,Pb=/^(none|table(?!-c[ea]).+)/,Qb=new RegExp("^("+T+")(.*)$","i"),Rb=new RegExp("^([+-])=("+T+")","i"),Sb={position:"absolute",visibility:"hidden",display:"block"},Tb={letterSpacing:0,fontWeight:400},Ub=["Webkit","O","Moz","ms"];function Vb(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ub.length;while(e--)if(b=Ub[e]+c,b in a)return b;return d}function Wb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=n._data(d,"olddisplay",Gb(d.nodeName)))):f[g]||(e=V(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Xb(a,b,c){var d=Qb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Yb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Zb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Jb(a),g=l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Kb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ib.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Yb(a,b,c||(g?"border":"content"),d,f)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Kb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=Vb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Rb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]="",i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Vb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Kb(a,b,d)),"normal"===f&&b in Tb&&(f=Tb[b]),""===c||c?(e=parseFloat(f),c===!0||n.isNumeric(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&Pb.test(n.css(a,"display"))?n.swap(a,Sb,function(){return Zb(a,b,d)}):Zb(a,b,d):void 0},set:function(a,c,d){var e=d&&Jb(a);return Xb(a,c,d?Yb(a,b,d,l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Ob.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Nb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Nb.test(f)?f.replace(Nb,e):f+" "+e)}}),n.cssHooks.marginRight=Mb(l.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},Kb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Hb.test(a)||(n.cssHooks[a+b].set=Xb)}),n.fn.extend({css:function(a,b){return W(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Jb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)
+},a,b,arguments.length>1)},show:function(){return Wb(this,!0)},hide:function(){return Wb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function $b(a,b,c,d,e){return new $b.prototype.init(a,b,c,d,e)}n.Tween=$b,$b.prototype={constructor:$b,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=$b.propHooks[this.prop];return a&&a.get?a.get(this):$b.propHooks._default.get(this)},run:function(a){var b,c=$b.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):$b.propHooks._default.set(this),this}},$b.prototype.init.prototype=$b.prototype,$b.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},$b.propHooks.scrollTop=$b.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=$b.prototype.init,n.fx.step={};var _b,ac,bc=/^(?:toggle|show|hide)$/,cc=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),dc=/queueHooks$/,ec=[jc],fc={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=cc.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&cc.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function gc(){return setTimeout(function(){_b=void 0}),_b=n.now()}function hc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=U[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function ic(a,b,c){for(var d,e=(fc[b]||[]).concat(fc["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function jc(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&V(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k=Gb(a.nodeName),"none"===j&&(j=k),"inline"===j&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==k?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],bc.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}if(!n.isEmptyObject(o)){r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=ic(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function kc(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function lc(a,b,c){var d,e,f=0,g=ec.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=_b||gc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:_b||gc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(kc(k,j.opts.specialEasing);g>f;f++)if(d=ec[f].call(j,a,k,j.opts))return d;return n.map(k,ic,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(lc,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],fc[c]=fc[c]||[],fc[c].unshift(b)},prefilter:function(a,b){b?ec.unshift(a):ec.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=lc(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&dc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(hc(b,!0),a,d,e)}}),n.each({slideDown:hc("show"),slideUp:hc("hide"),slideToggle:hc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(_b=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),_b=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ac||(ac=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(ac),ac=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e=z.createElement("div");e.setAttribute("className","t"),e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=e.getElementsByTagName("a")[0],c=z.createElement("select"),d=c.appendChild(z.createElement("option")),b=e.getElementsByTagName("input")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==e.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=d.selected,l.enctype=!!z.createElement("form").enctype,c.disabled=!0,l.optDisabled=!d.disabled,b=z.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value,a=b=c=d=e=null}();var mc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(mc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.text(a)}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(l.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var nc,oc,pc=n.expr.attrHandle,qc=/^(?:checked|selected)$/i,rc=l.getSetAttribute,sc=l.input;n.fn.extend({attr:function(a,b){return W(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===L?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?oc:nc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(F);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?sc&&rc||!qc.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(rc?c:d)},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),oc={set:function(a,b,c){return b===!1?n.removeAttr(a,c):sc&&rc||!qc.test(c)?a.setAttribute(!rc&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=pc[b]||n.find.attr;pc[b]=sc&&rc||!qc.test(b)?function(a,b,d){var e,f;return d||(f=pc[b],pc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,pc[b]=f),e}:function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),sc&&rc||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):nc&&nc.set(a,b,c)}}),rc||(nc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},pc.id=pc.name=pc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:nc.set},n.attrHooks.contenteditable={set:function(a,b,c){nc.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var tc=/^(?:input|select|textarea|button|object)$/i,uc=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return W(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):tc.test(a.nodeName)||uc.test(a.nodeName)&&a.href?0:-1}}}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var vc=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(F)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===L||"boolean"===c)&&(this.className&&n._data(this,"__className__",this.className),this.className=this.className||a===!1?"":n._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(vc," ").indexOf(b)>=0)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var wc=n.now(),xc=/\?/,yc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(yc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var zc,Ac,Bc=/#.*$/,Cc=/([?&])_=[^&]*/,Dc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ec=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Fc=/^(?:GET|HEAD)$/,Gc=/^\/\//,Hc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ic={},Jc={},Kc="*/".concat("*");try{Ac=location.href}catch(Lc){Ac=z.createElement("a"),Ac.href="",Ac=Ac.href}zc=Hc.exec(Ac.toLowerCase())||[];function Mc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(F)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nc(a,b,c,d){var e={},f=a===Jc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Oc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Pc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Qc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ac,type:"GET",isLocal:Ec.test(zc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Oc(Oc(a,n.ajaxSettings),b):Oc(n.ajaxSettings,a)},ajaxPrefilter:Mc(Ic),ajaxTransport:Mc(Jc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Dc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||Ac)+"").replace(Bc,"").replace(Gc,zc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(F)||[""],null==k.crossDomain&&(c=Hc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===zc[1]&&c[2]===zc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(zc[3]||("http:"===zc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),Nc(Ic,k,b,v),2===t)return v;h=k.global,h&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Fc.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(xc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Cc.test(e)?e.replace(Cc,"$1_="+wc++):e+(xc.test(e)?"&":"?")+"_="+wc++)),k.ifModified&&(n.lastModified[e]&&v.setRequestHeader("If-Modified-Since",n.lastModified[e]),n.etag[e]&&v.setRequestHeader("If-None-Match",n.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Kc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Nc(Jc,k,b,v)){v.readyState=1,h&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Pc(k,v,c)),u=Qc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(n.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!l.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||n.css(a,"display"))},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var Rc=/%20/g,Sc=/\[\]$/,Tc=/\r?\n/g,Uc=/^(?:submit|button|image|reset|file)$/i,Vc=/^(?:input|select|textarea|keygen)/i;function Wc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Sc.test(a)?d(a,e):Wc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Wc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Wc(c,a[c],b,e);return d.join("&").replace(Rc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Vc.test(this.nodeName)&&!Uc.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Tc,"\r\n")}}):{name:b.name,value:c.replace(Tc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&$c()||_c()}:$c;var Xc=0,Yc={},Zc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Yc)Yc[a](void 0,!0)}),l.cors=!!Zc&&"withCredentials"in Zc,Zc=l.ajax=!!Zc,Zc&&n.ajaxTransport(function(a){if(!a.crossDomain||l.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Xc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Yc[g],b=void 0,f.onreadystatechange=n.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Yc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function $c(){try{return new a.XMLHttpRequest}catch(b){}}function _c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=z.head||n("head")[0]||z.documentElement;return{send:function(d,e){b=z.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var ad=[],bd=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ad.pop()||n.expando+"_"+wc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(bd.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&bd.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(bd,"$1"+e):b.jsonp!==!1&&(b.url+=(xc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,ad.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||z;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var cd=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&cd)return cd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=a.slice(h,a.length),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&n.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var dd=a.document.documentElement;function ed(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?(typeof e.getBoundingClientRect!==L&&(d=e.getBoundingClientRect()),c=ed(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||dd;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||dd})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return W(this,function(a,d,e){var f=ed(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Mb(l.pixelPosition,function(a,c){return c?(c=Kb(a,b),Ib.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return W(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var fd=a.jQuery,gd=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=gd),b&&a.jQuery===n&&(a.jQuery=fd),n},typeof b===L&&(a.jQuery=a.$=n),n});
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js b/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js
index 3e6fe5b7..0a7511c1 100644
--- a/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js
+++ b/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js
@@ -1,67 +1,66 @@
/**
* Generic postback control.
*/
-Prado.WebUI.CallbackControl = Class.extend(Prado.WebUI.PostBackControl,
+Prado.WebUI.CallbackControl = jQuery.klass(Prado.WebUI.PostBackControl,
{
- onPostBack : function(event, options)
+ onPostBack : function(options, event)
{
var request = new Prado.CallbackRequest(options.EventTarget, options);
request.dispatch();
- Event.stop(event);
+ event.preventDefault();
}
});
/**
* TActiveButton control.
*/
-Prado.WebUI.TActiveButton = Class.extend(Prado.WebUI.CallbackControl);
+Prado.WebUI.TActiveButton = jQuery.klass(Prado.WebUI.CallbackControl);
/**
* TActiveLinkButton control.
*/
-Prado.WebUI.TActiveLinkButton = Class.extend(Prado.WebUI.CallbackControl);
+Prado.WebUI.TActiveLinkButton = jQuery.klass(Prado.WebUI.CallbackControl);
-Prado.WebUI.TActiveImageButton = Class.extend(Prado.WebUI.TImageButton,
+Prado.WebUI.TActiveImageButton = jQuery.klass(Prado.WebUI.TImageButton,
{
- onPostBack : function(event, options)
+ onPostBack : function(options, event)
{
- this.addXYInput(event,options);
+ this.addXYInput(options, event);
var request = new Prado.CallbackRequest(options.EventTarget, options);
request.dispatch();
- Event.stop(event);
- this.removeXYInput(event,options);
+ event.preventDefault();
+ this.removeXYInput(options, event);
}
});
/**
* Active check box.
*/
-Prado.WebUI.TActiveCheckBox = Class.extend(Prado.WebUI.CallbackControl,
+Prado.WebUI.TActiveCheckBox = jQuery.klass(Prado.WebUI.CallbackControl,
{
- onPostBack : function(event, options)
+ onPostBack : function(options, event)
{
var request = new Prado.CallbackRequest(options.EventTarget, options);
if(request.dispatch()==false)
- Event.stop(event);
+ event.preventDefault();
}
});
/**
* TActiveRadioButton control.
*/
-Prado.WebUI.TActiveRadioButton = Class.extend(Prado.WebUI.TActiveCheckBox);
+Prado.WebUI.TActiveRadioButton = jQuery.klass(Prado.WebUI.TActiveCheckBox);
-Prado.WebUI.TActiveCheckBoxList = Base.extend(
+Prado.WebUI.TActiveCheckBoxList = jQuery.klass(Prado.WebUI.Control,
{
- constructor : function(options)
+ onInit : function(options)
{
- Prado.Registry.set(options.ListID, this);
for(var i = 0; i<options.ItemCount; i++)
{
- var checkBoxOptions = Object.extend(
+ var checkBoxOptions = jQuery.extend({}, options,
{
- ID : options.ListID+"_c"+i,
+ ID : options.ID+"_c"+i,
EventTarget : options.ListName+"$c"+i
- }, options);
+ });
new Prado.WebUI.TActiveCheckBox(checkBoxOptions);
}
}
@@ -72,7 +71,7 @@ Prado.WebUI.TActiveRadioButtonList = Prado.WebUI.TActiveCheckBoxList;
/**
* TActiveTextBox control, handles onchange event.
*/
-Prado.WebUI.TActiveTextBox = Class.extend(Prado.WebUI.TTextBox,
+Prado.WebUI.TActiveTextBox = jQuery.klass(Prado.WebUI.TTextBox,
{
onInit : function(options)
{
@@ -80,39 +79,44 @@ Prado.WebUI.TActiveTextBox = Class.extend(Prado.WebUI.TTextBox,
if(options['TextMode'] != 'MultiLine')
this.observe(this.element, "keydown", this.handleReturnKey.bind(this));
if(this.options['AutoPostBack']==true)
- this.observe(this.element, "change", this.doCallback.bindEvent(this,options));
+ this.observe(this.element, "change", jQuery.proxy(this.doCallback,this,options));
},
- doCallback : function(event, options)
+ doCallback : function(options, event)
{
var request = new Prado.CallbackRequest(options.EventTarget, options);
request.dispatch();
- if (!Prototype.Browser.IE)
- Event.stop(event);
+ event.preventDefault();
}
});
/**
- * TAutoComplete control.
+ * TJuiAutoComplete control.
*/
-Prado.WebUI.TAutoComplete = Class.extend(Autocompleter.Base, Prado.WebUI.TActiveTextBox.prototype);
-Prado.WebUI.TAutoComplete = Class.extend(Prado.WebUI.TAutoComplete,
+
+Prado.WebUI.TJuiAutoComplete = jQuery.klass(Prado.WebUI.TActiveTextBox,
{
initialize : function(options)
{
this.options = options;
this.observers = new Array();
this.hasResults = false;
- this.baseInitialize(options.ID, options.ResultPanel, options);
- Object.extend(this.options,
- {
- onSuccess : this.onComplete.bind(this)
+ jQuery.extend(this.options, {
+ source: this.getUpdatedChoices.bind(this),
+ select: this.selectEntry.bind(this)
});
+ jQuery('#'+options.ID).autocomplete(this.options)
+ .data( "ui-autocomplete")._renderItem = function( ul, item ) {
+ return jQuery( "<li>" )
+ .attr( "data-value", item.value )
+ .append( jQuery( "<a>" ).html( item.label ) )
+ .appendTo( ul );
+ };
if(options.AutoPostBack)
this.onInit(options);
- Prado.Registry.set(options.ID, this);
+ Prado.Registry[options.ID] = this;
},
doCallback : function(event, options)
@@ -121,68 +125,54 @@ Prado.WebUI.TAutoComplete = Class.extend(Prado.WebUI.TAutoComplete,
{
var request = new Prado.CallbackRequest(this.options.EventTarget, options);
request.dispatch();
- Event.stop(event);
+ event.stopPropagation();
}
},
- //Overrides parent implementation, fires onchange event.
- onClick: function(event)
- {
- var element = Event.findElement(event, 'LI');
- this.index = element.autocompleteIndex;
- this.selectEntry();
- this.hide();
- Event.fireEvent(this.element, "change");
- },
-
- getUpdatedChoices : function()
+ getUpdatedChoices : function(request, callback)
{
- var options = new Array(this.getToken(),"__TAutoComplete_onSuggest__");
- Prado.Callback(this.options.EventTarget, options, null, this.options);
+ var params = new Array(request.term,"__TJuiAutoComplete_onSuggest__");
+ var options = jQuery.extend(this.options, {
+ 'autocompleteCallback' : callback
+ });
+ Prado.Callback(this.options.EventTarget, params, this.onComplete.bind(this), this.options);
},
/**
* Overrides parent implements, don't update if no results.
*/
- selectEntry: function()
+ selectEntry: function(event, ui)
{
- if(this.hasResults)
- {
- this.active = false;
- this.updateElement(this.getCurrentEntry());
- var options = [this.index, "__TAutoComplete_onSuggestionSelected__"];
- Prado.Callback(this.options.EventTarget, options, null, this.options);
- }
+ var options = [ui.item.id, "__TJuiAutoComplete_onSuggestionSelected__"];
+ Prado.Callback(this.options.EventTarget, options, null, this.options);
},
- onComplete : function(request, boundary)
+ onComplete : function(request, result)
{
- var result = Prado.Element.extractContent(request.transport.responseText, boundary);
- if(typeof(result) == "string")
- {
- if(result.length > 0)
- {
- this.hasResults = true;
- this.updateChoices(result);
- }
- else
- {
- this.active = false;
- this.hasResults = false;
- this.hide();
- }
- }
+ var that = this;
+ if(that.options.textCssClass===undefined)
+ {
+ jQuery.each(result, function(idx, item) {
+ result[idx]['value']=jQuery.trim(jQuery(item['label']).text());
+ });
+ } else {
+ jQuery.each(result, function(idx, item) {
+ result[idx]['value']=jQuery.trim(jQuery(item['label']).find('.'+that.options.textCssClass).text());
+ });
+ }
+
+ request.options.autocompleteCallback(result);
}
});
/**
* Time Triggered Callback class.
*/
-Prado.WebUI.TTimeTriggeredCallback = Class.create(Prado.WebUI.Control,
+Prado.WebUI.TTimeTriggeredCallback = jQuery.klass(Prado.WebUI.Control,
{
onInit : function(options)
{
- this.options = Object.extend({ Interval : 1 }, options || {});
+ this.options = jQuery.extend({ Interval : 1 }, options || {});
Prado.WebUI.TTimeTriggeredCallback.registerTimer(this);
},
@@ -231,7 +221,7 @@ Prado.WebUI.TTimeTriggeredCallback = Class.create(Prado.WebUI.Control,
}
});
-Object.extend(Prado.WebUI.TTimeTriggeredCallback,
+jQuery.extend(Prado.WebUI.TTimeTriggeredCallback,
{
//class methods
@@ -262,7 +252,7 @@ Object.extend(Prado.WebUI.TTimeTriggeredCallback,
}
});
-Prado.WebUI.ActiveListControl = Class.create(Prado.WebUI.Control,
+Prado.WebUI.ActiveListControl = jQuery.klass(Prado.WebUI.Control,
{
onInit : function(options)
{
@@ -277,22 +267,22 @@ Prado.WebUI.ActiveListControl = Class.create(Prado.WebUI.Control,
{
var request = new Prado.CallbackRequest(this.options.EventTarget, this.options);
request.dispatch();
- Event.stop(event);
+ event.preventDefault();
}
});
-Prado.WebUI.TActiveDropDownList = Class.create(Prado.WebUI.ActiveListControl);
-Prado.WebUI.TActiveListBox = Class.create(Prado.WebUI.ActiveListControl);
+Prado.WebUI.TActiveDropDownList = jQuery.klass(Prado.WebUI.ActiveListControl);
+Prado.WebUI.TActiveListBox = jQuery.klass(Prado.WebUI.ActiveListControl);
/**
* Observe event of a particular control to trigger a callback request.
*/
-Prado.WebUI.TEventTriggeredCallback = Class.create(Prado.WebUI.Control,
+Prado.WebUI.TEventTriggeredCallback = jQuery.klass(Prado.WebUI.Control,
{
onInit : function(options)
{
this.options = options || {} ;
- var element = $(options['ControlID']);
+ var element = jQuery('#'+options['ControlID']).get(0);
if(element)
this.observe(element, this.getEventName(element), this.doCallback.bind(this));
},
@@ -320,14 +310,14 @@ Prado.WebUI.TEventTriggeredCallback = Class.create(Prado.WebUI.Control,
var request = new Prado.CallbackRequest(this.options.EventTarget, this.options);
request.dispatch();
if(this.options.StopEvent == true)
- Event.stop(event);
+ event.preventDefault();
}
});
/**
* Observe changes to a property of a particular control to trigger a callback.
*/
-Prado.WebUI.TValueTriggeredCallback = Class.create(Prado.WebUI.Control,
+Prado.WebUI.TValueTriggeredCallback = jQuery.klass(Prado.WebUI.Control,
{
count : 1,
@@ -337,7 +327,7 @@ Prado.WebUI.TValueTriggeredCallback = Class.create(Prado.WebUI.Control,
{
this.options = options || {} ;
this.options.PropertyName = this.options.PropertyName || 'value';
- var element = $(options['ControlID']);
+ var element = jQuery('#'+options['ControlID']).get(0);
this.value = element ? element[this.options.PropertyName] : undefined;
Prado.WebUI.TValueTriggeredCallback.register(this);
this.startObserving();
@@ -356,7 +346,7 @@ Prado.WebUI.TValueTriggeredCallback = Class.create(Prado.WebUI.Control,
checkChanges : function()
{
- var element = $(this.options.ControlID);
+ var element = jQuery('#'+this.options.ControlID).get(0);
if(element)
{
var value = element[this.options.PropertyName];
@@ -389,7 +379,7 @@ Prado.WebUI.TValueTriggeredCallback = Class.create(Prado.WebUI.Control,
}
});
-Object.extend(Prado.WebUI.TValueTriggeredCallback,
+jQuery.extend(Prado.WebUI.TValueTriggeredCallback,
{
//class methods
@@ -406,5 +396,5 @@ Object.extend(Prado.WebUI.TValueTriggeredCallback,
}
});
-Prado.WebUI.TActiveTableCell = Class.create(Prado.WebUI.CallbackControl);
-Prado.WebUI.TActiveTableRow = Class.create(Prado.WebUI.CallbackControl);
+Prado.WebUI.TActiveTableCell = jQuery.klass(Prado.WebUI.CallbackControl);
+Prado.WebUI.TActiveTableRow = jQuery.klass(Prado.WebUI.CallbackControl);
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js b/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js
index f7f63026..dd0fc6f2 100755
--- a/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js
+++ b/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js
@@ -1,12 +1,12 @@
/**
* TActiveDatePicker control
*/
-Prado.WebUI.TActiveDatePicker = Class.create(Prado.WebUI.TDatePicker,
+Prado.WebUI.TActiveDatePicker = jQuery.klass(Prado.WebUI.TDatePicker,
{
onInit : function(options)
{
this.options = options || [];
- this.control = $(options.ID);
+ this.control = jQuery('#'+options.ID).get(0);
this.dateSlot = new Array(42);
this.weekSlot = new Array(6);
this.minimalDaysInFirstWeek = 4;
@@ -17,7 +17,7 @@ Prado.WebUI.TActiveDatePicker = Class.create(Prado.WebUI.TDatePicker,
//which element to trigger to show the calendar
if(this.options.Trigger)
{
- this.trigger = $(this.options.Trigger) ;
+ this.trigger = jQuery('#'+this.options.Trigger).get(0) ;
var triggerEvent = this.options.TriggerEvent || "click";
}
else
@@ -25,36 +25,36 @@ Prado.WebUI.TActiveDatePicker = Class.create(Prado.WebUI.TDatePicker,
this.trigger = this.control;
var triggerEvent = this.options.TriggerEvent || "focus";
}
-
+
// Popup position
if(this.options.PositionMode == 'Top')
{
this.positionMode = this.options.PositionMode;
}
- Object.extend(this,options);
+ jQuery.extend(this,options);
if (this.options.ShowCalendar)
- this.observe(this.trigger, triggerEvent, this.show.bindEvent(this));
-
- // Listen to change event
+ this.observe(this.trigger, triggerEvent, jQuery.proxy(this.show,this));
+
+ // Listen to change event
if(this.options.InputMode == "TextBox")
{
- this.observe(this.control, "change", this.onDateChanged.bindEvent(this));
- }
+ this.observe(this.control, "change", jQuery.proxy(this.onDateChanged,this));
+ }
else
{
var day = Prado.WebUI.TDatePicker.getDayListControl(this.control);
var month = Prado.WebUI.TDatePicker.getMonthListControl(this.control);
var year = Prado.WebUI.TDatePicker.getYearListControl(this.control);
- if (day) this.observe (day, "change", this.onDateChanged.bindEvent(this));
- if (month) this.observe (month, "change", this.onDateChanged.bindEvent(this));
- if (year) this.observe (year, "change", this.onDateChanged.bindEvent(this));
-
+ if (day) this.observe (day, "change", jQuery.proxy(this.onDateChanged,this));
+ if (month) this.observe (month, "change", jQuery.proxy(this.onDateChanged,this));
+ if (year) this.observe (year, "change", jQuery.proxy(this.onDateChanged,this));
+
}
- },
-
+ },
+
// Respond to change event on the textbox or dropdown list
// This method raises OnDateChanged event on client side if it has been defined,
// and raise the callback request
@@ -64,7 +64,7 @@ Prado.WebUI.TActiveDatePicker = Class.create(Prado.WebUI.TDatePicker,
if (this.options.InputMode == "TextBox")
{
date=this.control.value;
- }
+ }
else
{
var day = Prado.WebUI.TDatePicker.getDayListControl(this.control);
@@ -76,7 +76,7 @@ Prado.WebUI.TActiveDatePicker = Class.create(Prado.WebUI.TDatePicker,
date=new Date(year, month, day, 0,0,0).SimpleFormat(this.Format, this);
}
if (typeof(this.options.OnDateChanged) == "function") this.options.OnDateChanged(this, date);
-
+
if(this.options['AutoPostBack']==true)
{
// Make callback request
@@ -84,4 +84,4 @@ Prado.WebUI.TActiveDatePicker = Class.create(Prado.WebUI.TDatePicker,
request.dispatch();
}
}
-});
+});
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js b/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js
index e19f5d49..c42597f1 100644
--- a/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js
+++ b/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js
@@ -1,138 +1,4 @@
-
-Prado.AjaxRequest = Class.create();
-Prado.AjaxRequest.prototype = Object.clone(Ajax.Request.prototype);
-
-/**
- * Override Prototype's response implementation.
- */
-Object.extend(Prado.AjaxRequest.prototype,
-{
- /*initialize: function(request)
- {
- this.CallbackRequest = request;
- this.transport = Ajax.getTransport();
- this.setOptions(request.options);
- this.request(request.url);
- },*/
-
- /**
- * Customize the response, dispatch onXXX response code events, and
- * tries to execute response actions (javascript statements).
- */
- respondToReadyState : function(readyState)
- {
- var event = Ajax.Request.Events[readyState];
- var transport = this.transport, json = this.getBodyDataPart(Prado.CallbackRequest.DATA_HEADER);
-
- if (event == 'Complete')
- {
- var redirectUrl = this.getBodyContentPart(Prado.CallbackRequest.REDIRECT_HEADER);
- if (redirectUrl)
- document.location.href = redirectUrl;
-
- if ((this.getHeader('Content-type') || '').match(/^text\/javascript/i))
- {
- try
- {
- json = eval('(' + transport.responseText + ')');
- }
- catch (e)
- {
- if(typeof(json) == "string")
- json = Prado.CallbackRequest.decode(result);
- }
- }
-
- try
- {
- Prado.CallbackRequest.updatePageState(this,transport);
- Prado.CallbackRequest.checkHiddenFields(this,transport);
- var obj = this;
- Prado.CallbackRequest.loadAssets(this,transport, function()
-
- {
- try
- {
- Ajax.Responders.dispatch('on' + transport.status, obj, transport, json);
- Prado.CallbackRequest.dispatchActions(transport,obj.getBodyDataPart(Prado.CallbackRequest.ACTION_HEADER));
-
- (
- obj.options['on' + obj.transport.status]
- ||
- obj.options['on' + (obj.success() ? 'Success' : 'Failure')]
- ||
- Prototype.emptyFunction
- ) (obj, json);
- }
- catch (e)
- {
- obj.dispatchException(e);
- }
- }
- );
- }
- catch (e)
- {
- this.dispatchException(e);
- }
- }
-
- try {
- (this.options['on' + event] || Prototype.emptyFunction)(this, json);
- Ajax.Responders.dispatch('on' + event, this, transport, json);
- } catch (e) {
- this.dispatchException(e);
- }
-
- /* Avoid memory leak in MSIE: clean up the oncomplete event handler */
- if (event == 'Complete')
- this.transport.onreadystatechange = Prototype.emptyFunction;
- },
-
- /**
- * Gets header data assuming JSON encoding.
- * @param string header name
- * @return object header data as javascript structures.
- */
- getHeaderData : function(name)
- {
- return this.getJsonData(this.getHeader(name));
- },
-
- getBodyContentPart : function(name)
- {
- if(typeof(this.transport.responseText)=="string")
- return Prado.Element.extractContent(this.transport.responseText, name);
- },
-
- getJsonData : function(json)
- {
- try
- {
- return eval('(' + json + ')');
- }
- catch (e)
- {
- if(typeof(json) == "string")
- return Prado.CallbackRequest.decode(json);
- }
- },
-
- getBodyDataPart : function(name)
- {
- return this.getJsonData(this.getBodyContentPart(name));
- }
-});
-
-/**
- * Prado Callback client-side request handler.
- */
-Prado.CallbackRequest = Class.create();
-
-/**
- * Static definitions.
- */
-Object.extend(Prado.CallbackRequest,
+Prado.CallbackRequestManager =
{
/**
* Callback request target POST field name.
@@ -146,15 +12,10 @@ Object.extend(Prado.CallbackRequest,
* Callback request page state field name,
*/
FIELD_CALLBACK_PAGESTATE : 'PRADO_PAGESTATE',
-
- FIELD_POSTBACK_TARGET : 'PRADO_POSTBACK_TARGET',
-
- FIELD_POSTBACK_PARAMETER : 'PRADO_POSTBACK_PARAMETER',
-
/**
- * List of form fields that will be collected during callback.
+ * Response redirect header name.
*/
- PostDataLoaders : [],
+ REDIRECT_HEADER : 'X-PRADO-REDIRECT',
/**
* Response data header name.
*/
@@ -188,216 +49,460 @@ Object.extend(Prado.CallbackRequest,
*/
HIDDENFIELDLIST_HEADER : 'X-PRADO-HIDDENFIELDLIST',
- REDIRECT_HEADER : 'X-PRADO-REDIRECT',
+ /**
+ * Formats the exception message for display in console.
+ */
+ formatException : function(e)
+ {
+ var msg = e.type + " with message \""+e.message+"\"";
+ msg += " in "+e.file+"("+e.line+")\n";
+ msg += "Stack trace:\n";
+ var trace = e.trace;
+ for(var i = 0; i<trace.length; i++)
+ {
+ msg += " #"+i+" "+trace[i].file;
+ msg += "("+trace[i].line+"): ";
+ msg += trace[i]["class"]+"->"+trace[i]["function"]+"()"+"\n";
+ }
+ msg += e.version+" "+e.time+"\n";
+ return msg;
+ },
+
+ /*! jQuery Ajax Queue - v0.1.2pre - 2013-03-19
+ * https://github.com/gnarf37/jquery-ajaxQueue
+ * Copyright (c) 2013 Corey Frang; Licensed MIT
+ * Slightly adapted for use within prado by Fabio Bas <ctrlaltca@gmail.com>
+ */
+
+ // jQuery on an empty object, we are going to use this as our Queue
+ ajaxQueue : jQuery({}),
+
+ ajax : function( ajaxOpts ) {
+ var jqXHR,
+ dfd = jQuery.Deferred(),
+ promise = dfd.promise();
+
+ // run the actual query
+ function doRequest( next ) {
+ jqXHR = jQuery.ajax( ajaxOpts );
+ jqXHR.done( dfd.resolve )
+ .fail( dfd.reject )
+ .then( next, next );
+ }
+
+ // queue our ajax request
+ Prado.CallbackRequestManager.ajaxQueue.queue( doRequest );
+
+ // add the abort method
+ promise.abort = function( statusText ) {
+
+ // proxy abort to the jqXHR if it is active
+ if ( jqXHR ) {
+ return jqXHR.abort( statusText );
+ }
+
+ // if there wasn't already a jqXHR we need to remove from queue
+ var queue = Prado.CallbackRequestManager.ajaxQueue.queue(),
+ index = jQuery.inArray( doRequest, queue );
+
+ if ( index > -1 ) {
+ queue.splice( index, 1 );
+ }
+
+ // and then reject the deferred
+ dfd.rejectWith( ajaxOpts.context || ajaxOpts, [ promise, statusText, "" ] );
+ return promise;
+ };
+
+ return promise;
+ }
+};
+
+Prado.CallbackRequest = jQuery.klass(Prado.PostBack,
+{
+
+ options : {},
+ data : '',
+
+ initialize: function(id, options)
+ {
+ this.options = {
+ RequestTimeOut : 30000, // 30 second timeout.
+ EnablePageStateUpdate : true,
+ CausesValidation : true,
+ ValidationGroup : null,
+ PostInputs : true,
+
+ type: "POST",
+ context: this,
+ success: this.successHandler,
+ error: this.errorHandler,
+ complete: this.completeHandler
+ };
- requestQueue : [],
+ jQuery.extend(this.options, options || {});
+
+ if(this.options.onUninitialized)
+ this.options.onUninitialized(this,null);
+ },
- //all request objects
- requests : {},
+ /**
+ * Sets the request options
+ * @return {Array} request options.
+ */
+ setOptions: function(options) {
+ jQuery.extend(this.options, options || { });
+ },
- getRequestById : function(id)
+ getForm: function()
{
- var requests = Prado.CallbackRequest.requests;
- if(typeof(requests[id]) != "undefined")
- return requests[id];
+ return jQuery('#'+this.options.ID).parents('form:first').get(0) || jQuery('#PRADO_PAGESTATE').get(0).form;
},
- dispatch : function(id)
+ /**
+ * Gets the url from the forms that contains the PRADO_PAGESTATE
+ * @return {String} callback url.
+ */
+ getCallbackUrl : function()
{
- var requests = Prado.CallbackRequest.requests;
- if(typeof(requests[id]) != "undefined")
- requests[id].dispatch();
+ return this.getForm().action;
},
/**
- * Add ids of inputs element to post in the request.
+ * Sets the request parameter
+ * @param {Object} parameter value
*/
- addPostLoaders : function(ids)
+ setCallbackParameter : function(value)
{
- var self = Prado.CallbackRequest;
- self.PostDataLoaders = self.PostDataLoaders.concat(ids);
- var list = [];
- self.PostDataLoaders.each(function(id)
- {
- if(list.indexOf(id) < 0)
- list.push(id);
- });
- self.PostDataLoaders = list;
+ this.options['CallbackParameter'] = value;
},
/**
- * Dispatch callback response actions.
+ * @return {Object} request paramater value.
*/
- dispatchActions : function(transport,actions)
+ getCallbackParameter : function()
{
- var self = Prado.CallbackRequest;
- if(actions && actions.length > 0)
- actions.each(self.__run.bind(self,transport));
+ return JSON.stringify(this.options['CallbackParameter']);
},
/**
- * Prase and evaluate a Callback clien-side action
+ * Sets the callback request timeout.
+ * @param {integer} timeout in milliseconds
*/
- __run : function(transport, command)
+ setRequestTimeOut : function(timeout)
{
- var self = Prado.CallbackRequest;
- self.transport = transport;
- for(var method in command)
+ this.options['RequestTimeOut'] = timeout;
+ },
+
+ /**
+ * @return {integer} request timeout in milliseconds
+ */
+ getRequestTimeOut : function()
+ {
+ return this.options['RequestTimeOut'];
+ },
+
+ /**
+ * Set true to enable validation on callback dispatch.
+ * @param {boolean} true to validate
+ */
+ setCausesValidation : function(validate)
+ {
+ this.options['CausesValidation'] = validate;
+ },
+
+ /**
+ * @return {boolean} validate on request dispatch
+ */
+ getCausesValidation : function()
+ {
+ return this.options['CausesValidation'];
+ },
+
+ /**
+ * Sets the validation group to validate during request dispatch.
+ * @param {string} validation group name
+ */
+ setValidationGroup : function(group)
+ {
+ this.options['ValidationGroup'] = group;
+ },
+
+ /**
+ * @return {string} validation group name.
+ */
+ getValidationGroup : function()
+ {
+ return this.options['ValidationGroup'];
+ },
+
+ dispatch: function()
+ {
+ //Logger.info("dispatching request");
+ //trigger tinyMCE to save data.
+ if(typeof tinyMCE != "undefined")
+ tinyMCE.triggerSave();
+
+ if(this.options['CausesValidation'] && typeof(Prado.Validation) != "undefined")
{
- try
- {
- method.toFunction().apply(self,command[method]);
- }
- catch(e)
- {
- if(typeof(Logger) != "undefined")
- self.Exception.onException(null,e);
- else
- debugger;
- }
+ if(!Prado.Validation.validate(this.getForm().id, this.options['ValidationGroup'], this))
+ return false;
}
+
+ if(this.options.onPreDispatch)
+ this.options.onPreDispatch(this,null);
+
+ // jQuery don't have all these states.. simulate them to avoid breaking old scripts
+ if (this.options.onLoading)
+ this.options.onLoading(this,null);
+ if (this.options.onLoaded)
+ this.options.onLoaded(this,null);
+ if (this.options.onInteractive)
+ this.options.onInteractive(this,null);
+
+ // go!
+ this.options.data = this.getParameters();
+ this.options.url = this.getCallbackUrl();
+
+ this.request = Prado.CallbackRequestManager.ajax(this.options);
+ },
+
+ abort : function()
+ {
+ if(this.request != "undefined")
+ this.request.abort();
},
/**
- * Respond to Prado Callback request exceptions.
+ * Collects the form inputs, encode the parameters, and sets the callback
+ * target id. The resulting string is the request content body.
+ * @return string request body content containing post data.
*/
- Exception :
+ getParameters : function()
{
- /**
- * Server returns 500 exception. Just log it.
- */
- "on500" : function(request, transport, data)
- {
- var e = request.getHeaderData(Prado.CallbackRequest.ERROR_HEADER);
- if (e)
- Logger.error("Callback Server Error "+e.code, this.formatException(e));
- else
- Logger.error("Callback Server Error Unknown",'');
- },
+ var form = this.getForm();
+ var data = {};
- /**
- * Callback OnComplete event,logs reponse and data to console.
- */
- 'on200' : function(request, transport, data)
- {
- if(transport.status < 500)
- {
- var msg = 'HTTP '+transport.status+" with response : \n";
- if(transport.responseText.trim().length >0)
- {
- var f = RegExp('(<!--X-PRADO[^>]+-->)([\\s\\S\\w\\W]*)(<!--//X-PRADO[^>]+-->)',"m");
- msg += transport.responseText.replace(f,'') + "\n";
- }
- if(typeof(data)!="undefined" && data != null)
- msg += "Data : \n"+inspect(data)+"\n";
- data = request.getBodyDataPart(Prado.CallbackRequest.ACTION_HEADER);
- if(data && data.length > 0)
- {
- msg += "Actions : \n";
- data.each(function(action)
- {
- msg += inspect(action)+"\n";
- });
- }
- Logger.info(msg);
- }
- },
+ if(typeof(this.options.CallbackParameter) != "undefined")
+ data[Prado.CallbackRequestManager.FIELD_CALLBACK_PARAMETER] = this.getCallbackParameter();
+ if(this.options.EventTarget)
+ data[Prado.CallbackRequestManager.FIELD_CALLBACK_TARGET] = this.options.EventTarget;
- /**
- * Uncaught exceptions during callback response.
- */
- onException : function(request,e)
- {
- var msg = "";
- $H(e).each(function(item)
- {
- msg += item.key+": "+item.value+"\n";
- })
- Logger.error('Uncaught Callback Client Exception:', msg);
- },
+ if(this.options.PostInputs != false)
+ return jQuery(form).serialize() + '&' + jQuery.param(data);
+ else
+ return jQuery.param(data);
+ },
- /**
- * Formats the exception message for display in console.
- */
- formatException : function(e)
+ /**
+ * Extract content from a text by its boundary id.
+ * Boundaries have this form:
+ * <pre>
+ * &lt;!--123456--&gt;Democontent&lt;!--//123456--&gt;
+ * </pre>
+ * @function {string} ?
+ * @param {string} boundary - Boundary id
+ * @returns Content from given boundaries
+ */
+ extractContent: function (boundary)
+ {
+ var tagStart = '<!--'+boundary+'-->';
+ var tagEnd = '<!--//'+boundary+'-->';
+ var start = this.data.indexOf(tagStart);
+ if(start > -1)
{
- var msg = e.type + " with message \""+e.message+"\"";
- msg += " in "+e.file+"("+e.line+")\n";
- msg += "Stack trace:\n";
- var trace = e.trace;
- for(var i = 0; i<trace.length; i++)
- {
- msg += " #"+i+" "+trace[i].file;
- msg += "("+trace[i].line+"): ";
- msg += trace[i]["class"]+"->"+trace[i]["function"]+"()"+"\n";
- }
- msg += e.version+" "+e.time+"\n";
- return msg;
+ start += tagStart.length;
+ var end = this.data.indexOf(tagEnd,start);
+ if(end > -1)
+ return this.data.substring(start,end);
}
+ return null;
+ },
+
+ errorHandler: function(request, textStatus, errorThrown)
+ {
+//null) are "timeout", "error", "abort", and "parsererror"
+ if (this.options.onFailure)
+ this.options.onFailure(this,textStatus);
+ },
+
+ completeHandler: function(request, textStatus)
+ {
+//"success", "notmodified", "error", "timeout", "abort", or "parsererror"
+ if (this.options.onComplete)
+ this.options.onComplete(this,textStatus);
},
/**
- * @return string JSON encoded data.
+ * Uncaught exceptions during callback response.
*/
- encode : function(data)
+ exceptionHandler: function(e)
{
- return Prado.JSON.stringify(data);
+ if (this.options.onException)
+ this.options.onException(this,e);
+ /*
+ var msg = "";
+ jQuery.each(e, function(item)
+ {
+ msg += item.key+": "+item.value+"\n";
+ })
+ */
+ if(typeof(Logger) != "undefined")
+ {
+ Logger.error('Uncaught Callback Client Exception:', e.message);
+ Logger.error('Stack:', e.message);
+ } else {
+ debugger;
+ }
},
/**
- * @return mixed javascript data decoded from string using JSON decoding.
+ * Callback OnSuccess event,logs reponse and data to console.
*/
- decode : function(data)
+ successHandler: function(data, textStatus, request)
{
- if(typeof(data) == "string" && data.trim().length > 0)
- return Prado.JSON.parse(data);
- else
- return null;
+ this.data = data;
+
+ if (this.options.onSuccess)
+ {
+ var customData=this.extractContent(Prado.CallbackRequestManager.DATA_HEADER);
+ if (typeof(customData) == "string" && customData.length > 0)
+ customData = jQuery.parseJSON(customData);
+
+ this.options.onSuccess(this,customData);
+ }
+
+ var redirectUrl = this.extractContent(Prado.CallbackRequestManager.REDIRECT_HEADER);
+ if (redirectUrl)
+ document.location.href = redirectUrl;
+
+ try {
+ this.updatePageState(this, data);
+ this.checkHiddenFields(this, data);
+ var obj = this;
+ this.loadAssets(this, data, function()
+ {
+ try {
+ obj.dispatchActions(obj, data);
+ } catch (e) {
+ obj.exceptionHandler(e);
+ }
+ }
+ );
+
+ } catch (e) {
+ this.exceptionHandler(e);
+ }
},
/**
- * Dispatch a normal request, no timeouts or aborting of requests.
+ * Updates the page state. It will update only if EnablePageStateUpdate and
+ * HasPriority options are both true.
*/
- dispatchNormalRequest : function(callback)
+ updatePageState : function(request, datain)
{
- callback.options.postBody = callback._getPostData(),
- callback.request(callback.url);
+ var pagestate = jQuery("#"+Prado.CallbackRequestManager.FIELD_CALLBACK_PAGESTATE);
+ var enabled = request.options.EnablePageStateUpdate;
+ var aborted = false; //typeof(self.currentRequest) == 'undefined' || self.currentRequest == null;
+ if(enabled && !aborted && pagestate)
+ {
+ var data = this.extractContent(Prado.CallbackRequestManager.PAGESTATE_HEADER);
+ if(typeof(data) == "string" && data.length > 0)
+ pagestate.val(data);
+ else
+ {
+ if(typeof(Logger) != "undefined")
+ Logger.warn("Missing page state:"+data);
+ //Logger.warn('## bad state: setting current request to null');
+ //self.endCurrentRequest();
+ //self.tryNextRequest();
+ return false;
+ }
+ }
+ //self.endCurrentRequest();
+ //Logger.warn('## state updated: setting current request to null');
+ //self.tryNextRequest();
return true;
},
- /**
- * Abort the current priority request in progress.
- */
- tryNextRequest : function()
+ checkHiddenField: function(name, value)
+ {
+ var id = name.replace(':','_');
+ if (!document.getElementById(id))
+ {
+ var field = document.createElement('input');
+ field.setAttribute('type','hidden');
+ field.id = id;
+ field.name = name;
+ field.value = value;
+ document.body.appendChild(field);
+ }
+ },
+
+ checkHiddenFields : function(request, datain)
{
- var self = Prado.CallbackRequest;
- //Logger.debug('trying next request');
- if(typeof(self.currentRequest) == 'undefined' || self.currentRequest==null)
+ var data = this.extractContent(Prado.CallbackRequestManager.HIDDENFIELDLIST_HEADER);
+ if (typeof(data) == "string" && data.length > 0)
{
- if(self.requestQueue.length > 0)
- return self.dispatchQueue();
- //else
- //Logger.warn('empty queque');
+ json = jQuery.parseJSON(data);
+ if(typeof(json) != "object")
+ {
+ if(typeof(Logger) != "undefined")
+ Logger.warn("Invalid hidden field list:"+data);
+ } else {
+ for(var key in json)
+ this.checkHiddenField(key,json[key]);
+ }
}
- //else
- //Logger.warn('current request ' + self.currentRequest.id);
},
/*
- * Checks which scripts are used by the response and ensures they're loaded
+ * Checks which assets are used by the response and ensures they're loaded
*/
- loadScripts : function(request, transport, callback)
+ loadAssets : function(request, datain, callback)
{
- var self = Prado.CallbackRequest;
- var data = request.getBodyContentPart(self.SCRIPTLIST_HEADER);
+ /*
+
+ ! This is the callback-based loader for stylesheets, which loads them one-by-one, and
+ ! waits for all of them to be loaded before loading scripts and processing the rest of
+ ! the callback.
+ !
+ ! That however is not neccessary, as stylesheets can be loaded asynchronously too.
+ !
+ ! I leave this code here for the case that this turns out to be a compatibility issue
+ ! (for ex. I can imagine some scripts trying to access stylesheet properties and such)
+ ! so if need can be reactivated. If you do so, comment out the async stylesheet loader below!
+
+ var obj = this;
+ this.loadStyleSheets(request,transport, function() {
+ obj.loadScripts(request,transport,callback);
+ });
+
+ */
+
+ this.loadStyleSheetsCode(request,datain);
+
+ this.loadStyleSheetsAsync(request,datain);
+
+ this.loadScripts(request,datain,callback);
+ },
+
+ /*
+ * Checks which scripts are used by the response and ensures they're loaded
+ */
+ loadScripts : function(request, datain, callback)
+ {
+ var data = this.extractContent(Prado.CallbackRequestManager.SCRIPTLIST_HEADER);
if (!this.ScriptsToLoad) this.ScriptsToLoad = new Array();
this.ScriptLoadFinishedCallback = callback;
if (typeof(data) == "string" && data.length > 0)
{
- json = Prado.CallbackRequest.decode(data);
+ json = jQuery.parseJSON(data);
if(typeof(json) != "object")
- Logger.warn("Invalid script list:"+data);
- else
+ {
+ if(typeof(Logger) != "undefined")
+ Logger.warn("Invalid script list:"+data);
+ } else {
for(var key in json)
if (/^\d+$/.test(key))
{
@@ -405,6 +510,7 @@ Object.extend(Prado.CallbackRequest,
if (!Prado.ScriptManager.isAssetLoaded(url))
this.ScriptsToLoad.push(url);
}
+ }
}
this.loadNextScript();
},
@@ -416,10 +522,10 @@ Object.extend(Prado.CallbackRequest,
{
var url = this.ScriptsToLoad.shift(); var obj = this;
if (
- Prado.ScriptManager.ensureAssetIsLoaded(url,
- function() {
- obj.loadNextScript();
- }
+ Prado.ScriptManager.ensureAssetIsLoaded(url,
+ function() {
+ obj.loadNextScript();
+ }
)
)
this.loadNextScript();
@@ -435,50 +541,55 @@ Object.extend(Prado.CallbackRequest,
}
},
- loadStyleSheetsCode : function(request, transport)
+ loadStyleSheetsCode : function(request, datain)
{
- var self = Prado.CallbackRequest;
- var data = request.getBodyContentPart(self.STYLESHEET_HEADER);
+ var data = this.extractContent(Prado.CallbackRequestManager.STYLESHEET_HEADER);
if (typeof(data) == "string" && data.length > 0)
{
- json = Prado.CallbackRequest.decode(data);
+ json = jQuery.parseJSON(data);
if(typeof(json) != "object")
- Logger.warn("Invalid stylesheet list:"+data);
- else
+ {
+ if(typeof(Logger) != "undefined")
+ Logger.warn("Invalid stylesheet list:"+data);
+ } else {
for(var key in json)
if (/^\d+$/.test(key))
Prado.StyleSheetManager.createStyleSheetCode(json[key],null);
+ }
}
},
- loadStyleSheetsAsync : function(request, transport)
+ loadStyleSheetsAsync : function(request, datain)
{
- var self = Prado.CallbackRequest;
- var data = request.getBodyContentPart(self.STYLESHEETLIST_HEADER);
+ var data = this.extractContent(Prado.CallbackRequestManager.STYLESHEETLIST_HEADER);
if (typeof(data) == "string" && data.length > 0)
{
- json = Prado.CallbackRequest.decode(data);
+ json = jQuery.parseJSON(data);
if(typeof(json) != "object")
- Logger.warn("Invalid stylesheet list:"+data);
- else
+ {
+ if(typeof(Logger) != "undefined")
+ Logger.warn("Invalid stylesheet list:"+data);
+ } else {
for(var key in json)
if (/^\d+$/.test(key))
Prado.StyleSheetManager.ensureAssetIsLoaded(json[key],null);
+ }
}
},
- loadStyleSheets : function(request, transport, callback)
+ loadStyleSheets : function(request, datain, callback)
{
- var self = Prado.CallbackRequest;
- var data = request.getBodyContentPart(self.STYLESHEETLIST_HEADER);
+ var data = this.extractContent(Prado.CallbackRequestManager.STYLESHEETLIST_HEADER);
if (!this.StyleSheetsToLoad) this.StyleSheetsToLoad = new Array();
this.StyleSheetLoadFinishedCallback = callback;
if (typeof(data) == "string" && data.length > 0)
{
- json = Prado.CallbackRequest.decode(data);
+ json = jQuery.parseJSON(data);
if(typeof(json) != "object")
- Logger.warn("Invalid stylesheet list:"+data);
- else
+ {
+ if(typeof(Logger) != "undefined")
+ Logger.warn("Invalid stylesheet list:"+data);
+ } else {
for(var key in json)
if (/^\d+$/.test(key))
{
@@ -486,6 +597,7 @@ Object.extend(Prado.CallbackRequest,
if (!Prado.StyleSheetManager.isAssetLoaded(url))
this.StyleSheetsToLoad.push(url);
}
+ }
}
this.loadNextStyleSheet();
},
@@ -497,16 +609,14 @@ Object.extend(Prado.CallbackRequest,
{
var url = this.StyleSheetsToLoad.shift(); var obj = this;
if (
- Prado.StyleSheetManager.ensureAssetIsLoaded(url,
- function() {
- obj.loadNextStyleSheet();
- }
+ Prado.StyleSheetManager.ensureAssetIsLoaded(url,
+ function() {
+ obj.loadNextStyleSheet();
+ }
)
)
this.loadNextStyleSheet();
- }
- else
- {
+ } else {
if (this.StyleSheetLoadFinishedCallback)
{
var cb = this.StyleSheetLoadFinishedCallback;
@@ -516,428 +626,247 @@ Object.extend(Prado.CallbackRequest,
}
},
- /*
- * Checks which assets are used by the response and ensures they're loaded
+ /**
+ * Dispatch callback response actions.
*/
- loadAssets : function(request, transport, callback)
- {
- /*
-
- ! This is the callback-based loader for stylesheets, which loads them one-by-one, and
- ! waits for all of them to be loaded before loading scripts and processing the rest of
- ! the callback.
- !
- ! That however is not neccessary, as stylesheets can be loaded asynchronously too.
- !
- ! I leave this code here for the case that this turns out to be a compatibility issue
- ! (for ex. I can imagine some scripts trying to access stylesheet properties and such)
- ! so if need can be reactivated. If you do so, comment out the async stylesheet loader below!
-
- var obj = this;
- this.loadStyleSheets(request,transport, function() {
- obj.loadScripts(request,transport,callback);
- });
-
- */
-
- this.loadStyleSheetsCode(request,transport);
-
- this.loadStyleSheetsAsync(request,transport);
-
- this.loadScripts(request,transport,callback);
- },
-
- checkHiddenField: function(name, value)
+ dispatchActions : function(request, datain)
{
- var id = name.replace(':','_');
- if (!document.getElementById(id))
- {
- var field = document.createElement('input');
- field.setAttribute('type','hidden');
- field.id = id;
- field.name = name;
- field.value = value;
- document.body.appendChild(field);
- }
- },
-
- checkHiddenFields : function(request, transport)
- {
- var self = Prado.CallbackRequest;
- var data = request.getBodyContentPart(self.HIDDENFIELDLIST_HEADER);
+ var data = this.extractContent(Prado.CallbackRequestManager.ACTION_HEADER);
if (typeof(data) == "string" && data.length > 0)
{
- json = Prado.CallbackRequest.decode(data);
+ json = jQuery.parseJSON(data);
if(typeof(json) != "object")
- Logger.warn("Invalid hidden field list:"+data);
- else
- for(var key in json)
- this.checkHiddenField(key,json[key]);
- }
- },
-
- /**
- * Updates the page state. It will update only if EnablePageStateUpdate and
- * HasPriority options are both true.
- */
- updatePageState : function(request, transport)
- {
- var self = Prado.CallbackRequest;
- var pagestate = $(self.FIELD_CALLBACK_PAGESTATE);
- var enabled = request.ActiveControl.EnablePageStateUpdate && request.ActiveControl.HasPriority;
- var aborted = typeof(self.currentRequest) == 'undefined' || self.currentRequest == null;
- if(enabled && !aborted && pagestate)
- {
- var data = request.getBodyContentPart(self.PAGESTATE_HEADER);
- if(typeof(data) == "string" && data.length > 0)
- pagestate.value = data;
- else
{
if(typeof(Logger) != "undefined")
- Logger.warn("Missing page state:"+data);
- //Logger.warn('## bad state: setting current request to null');
- self.endCurrentRequest();
- //self.tryNextRequest();
- return false;
+ Logger.warn("Invalid action:"+data);
+ } else {
+ var that = this;
+ jQuery.each(json, function(idx, item){
+ that.__run(that, item);
+ });
}
}
- self.endCurrentRequest();
- //Logger.warn('## state updated: setting current request to null');
- //self.tryNextRequest();
- return true;
},
- enqueue : function(callback)
- {
- var self = Prado.CallbackRequest;
- self.requestQueue.push(callback);
- //Logger.warn("equeued "+callback.id+", current queque length="+self.requestQueue.length);
- self.tryNextRequest();
- },
-
- dispatchQueue : function()
- {
- var self = Prado.CallbackRequest;
- //Logger.warn("dispatching queque, length="+self.requestQueue.length+" request="+self.currentRequest);
- var callback = self.requestQueue.shift();
- self.currentRequest = callback;
-
- //get data
- callback.options.postBody = callback._getPostData(),
-
- //callback.request = new Prado.AjaxRequest(callback);
- callback.timeout = setTimeout(function()
- {
- //Logger.warn("priority timeout");
- self.abortRequest(callback.id);
- },callback.ActiveControl.RequestTimeOut);
- callback.request(callback.url);
- //Logger.debug("dispatched "+self.currentRequest.id + " ...")
- },
-
- endCurrentRequest : function()
- {
- var self = Prado.CallbackRequest;
- if(typeof(self.currentRequest) != 'undefined' && self.currentRequest != null)
- clearTimeout(self.currentRequest.timeout);
- self.currentRequest=null;
- },
-
- abortRequest : function(id)
+ /**
+ * Prase and evaluate a Callback clien-side action
+ */
+ __run : function(request, command)
{
- //Logger.warn("abort id="+id);
- var self = Prado.CallbackRequest;
- if(typeof(self.currentRequest) != 'undefined'
- && self.currentRequest != null && self.currentRequest.id == id)
+ for(var method in command)
{
- var request = self.currentRequest;
- if(request.transport.readyState < 4)
- request.transport.abort();
- //Logger.warn('## aborted: setting current request to null');
- self.endCurrentRequest();
+ try {
+ method.toFunction().apply(request,command[method]);
+ } catch(e) {
+ this.exceptionHandler(e);
+ }
}
- self.tryNextRequest();
}
});
-/**
- * Automatically aborts the current request when a priority request has returned.
- */
-Ajax.Responders.register({onComplete : function(request)
-{
- if(request && request instanceof Prado.AjaxRequest)
- {
- if(request.ActiveControl.HasPriority)
- Prado.CallbackRequest.tryNextRequest();
- }
-}});
-
//Add HTTP exception respones when logger is enabled.
-Event.OnLoad(function()
+jQuery(function()
{
if(typeof Logger != "undefined")
- Ajax.Responders.register(Prado.CallbackRequest.Exception);
-});
-
-/**
- * Create and prepare a new callback request.
- * Call the dispatch() method to start the callback request.
- * <code>
- * request = new Prado.CallbackRequest(UniqueID, callback);
- * request.dispatch();
- * </code>
- */
-Prado.CallbackRequest.prototype = Object.extend(Prado.AjaxRequest.prototype,
-{
-
- /**
- * Prepare and inititate a callback request.
- */
- initialize : function(id, options)
{
- /**
- * Callback URL, same url as the current page.
- */
- this.url = this.getCallbackUrl();
-
- this.transport = Ajax.getTransport();
- this.Enabled = true;
- this.id = id;
- this.randomId = this.randomString();
-
- if(typeof(id)=="string"){
- Prado.CallbackRequest.requests[id+"__"+this.randomId] = this;
- }
-
- this.setOptions(Object.extend(
- {
- RequestTimeOut : 30000, // 30 second timeout.
- EnablePageStateUpdate : true,
- HasPriority : true,
- CausesValidation : true,
- ValidationGroup : null,
- PostInputs : true
- }, options || {}));
-
- this.ActiveControl = this.options;
- Prado.CallbackRequest.requests[id+"__"+this.randomId].ActiveControl = this.options;
- },
-
- /**
- * Sets the request options
- * @return {Array} request options.
- */
- setOptions: function(options){
-
- this.options = {
- method: 'post',
- asynchronous: true,
- contentType: 'application/x-www-form-urlencoded',
- encoding: 'UTF-8',
- parameters: '',
- evalJSON: true,
- evalJS: true
- };
-
- Object.extend(this.options, options || { });
+ jQuery( document ).ajaxSuccess(function( event, request, settings ) {
+ Logger.info('HTTP '+request.status+" with response : \n");
- this.options.method = this.options.method.toLowerCase();
- if(Object.isString(this.options.parameters)){
- this.options.parameters = this.options.parameters.toQueryParams();
- }
- },
-
- /**
- * Gets the url from the forms that contains the PRADO_PAGESTATE
- * @return {String} callback url.
- */
- getCallbackUrl : function()
- {
- return $('PRADO_PAGESTATE').form.action;
- },
-
- /**
- * Sets the request parameter
- * @param {Object} parameter value
- */
- setCallbackParameter : function(value)
- {
- var requestId = this.id+"__"+this.randomId;
- this.ActiveControl['CallbackParameter'] = value;
- Prado.CallbackRequest.requests[requestId].ActiveControl['CallbackParameter'] = value;
- },
-
- /**
- * @return {Object} request paramater value.
- */
- getCallbackParameter : function()
- {
- return Prado.CallbackRequest.requests[this.id+"__"+this.randomId].ActiveControl['CallbackParameter'];
- },
-
- /**
- * Sets the callback request timeout.
- * @param {integer} timeout in milliseconds
- */
- setRequestTimeOut : function(timeout)
- {
- this.ActiveControl['RequestTimeOut'] = timeout;
- },
-
- /**
- * @return {integer} request timeout in milliseconds
- */
- getRequestTimeOut : function()
- {
- return this.ActiveControl['RequestTimeOut'];
- },
-
- /**
- * Set true to enable validation on callback dispatch.
- * @param {boolean} true to validate
- */
- setCausesValidation : function(validate)
- {
- this.ActiveControl['CausesValidation'] = validate;
- },
-
- /**
- * @return {boolean} validate on request dispatch
- */
- getCausesValidation : function()
- {
- return this.ActiveControl['CausesValidation'];
- },
-
- /**
- * Sets the validation group to validate during request dispatch.
- * @param {string} validation group name
- */
- setValidationGroup : function(group)
- {
- this.ActiveControl['ValidationGroup'] = group;
- },
-
- /**
- * @return {string} validation group name.
- */
- getValidationGroup : function()
- {
- return this.ActiveControl['ValidationGroup'];
- },
-
- /**
- * Dispatch the callback request.
- */
- dispatch : function()
- {
- //Logger.info("dispatching request");
- //trigger tinyMCE to save data.
- if(typeof tinyMCE != "undefined")
- tinyMCE.triggerSave();
-
- if(this.ActiveControl.CausesValidation && typeof(Prado.Validation) != "undefined")
- {
- var form = this.ActiveControl.Form || Prado.Validation.getForm();
- if(Prado.Validation.validate(form,this.ActiveControl.ValidationGroup,this) == false)
- return false;
- }
-
- if(this.ActiveControl.onPreDispatch)
- this.ActiveControl.onPreDispatch(this,null);
-
- if(!this.Enabled)
- return;
-
- // Opera don't have onLoading/onLoaded state, so, simulate them just
- // before sending the request.
- if (Prototype.Browser.Opera)
- {
- if (this.ActiveControl.onLoading)
+ var tagStart = '<!--';
+ var tagEnd = '<!--//';
+ var start = request.responseText.indexOf(tagStart);
+ while(start > -1)
{
- this.ActiveControl.onLoading(this,null);
- Ajax.Responders.dispatch('onLoading',this, this.transport,null);
+ var end = request.responseText.indexOf(tagEnd,start);
+ if(end > -1)
+ Logger.info(request.responseText.substring(start,end)+'\n');
+ start = request.responseText.indexOf(tagStart,end+6);
}
- if (this.ActiveControl.onLoaded)
- {
- this.ActiveControl.onLoaded(this,null);
- Ajax.Responders.dispatch('onLoaded',this, this.transport,null);
- }
- }
-
- var result;
- if(this.ActiveControl.HasPriority)
- {
- return Prado.CallbackRequest.enqueue(this);
- //return Prado.CallbackRequest.dispatchPriorityRequest(this);
- }
- else
- return Prado.CallbackRequest.dispatchNormalRequest(this);
- },
-
- abort : function()
- {
- return Prado.CallbackRequest.abortRequest(this.id);
- },
+ });
- /**
- * Collects the form inputs, encode the parameters, and sets the callback
- * target id. The resulting string is the request content body.
- * @return string request body content containing post data.
- */
- _getPostData : function()
- {
- var data = {};
- var callback = Prado.CallbackRequest;
- if(this.ActiveControl.PostInputs != false)
- {
- callback.PostDataLoaders.each(function(name)
+ jQuery( document ).ajaxError(function( event, request, settings, exception ) {
+ if(request.status==500)
{
- var elements=$A(document.getElementsByName(name));
- if(elements.size() == 0)
+ /**
+ * Server returns 500 exception. Just log it.
+ */
+ var e = request.getResponseHeader(Prado.CallbackRequestManager.ERROR_HEADER);
+ if (e)
{
- name += '[]';
- elements=$A(document.getElementsByName(name));
+ json = jQuery.parseJSON(e);
+ if(typeof(json) == "object")
+ Logger.error("Callback Server Error "+json.code, Prado.CallbackRequestManager.formatException(json));
+ else
+ Logger.error("Callback Server Error Corrupted");
+ } else {
+ Logger.error("Callback Server Error Unknown",'');
}
- elements.each(function(element)
- {
- //IE will try to get elements with ID == name as well.
- if(element.type && element.name == name)
- {
- var value = $F(element);
- if(typeof(value) != "undefined" && value != null)
- data[name] = value;
- }
- })
- })
- }
- if(typeof(this.ActiveControl.CallbackParameter) != "undefined")
- data[callback.FIELD_CALLBACK_PARAMETER] = callback.encode(this.getCallbackParameter());
- var pageState = $F(callback.FIELD_CALLBACK_PAGESTATE);
- if(typeof(pageState) != "undefined")
- data[callback.FIELD_CALLBACK_PAGESTATE] = pageState;
- data[callback.FIELD_CALLBACK_TARGET] = this.id;
- if(this.ActiveControl.EventTarget)
- data[callback.FIELD_POSTBACK_TARGET] = this.ActiveControl.EventTarget;
- if(this.ActiveControl.EventParameter)
- data[callback.FIELD_POSTBACK_PARAMETER] = this.ActiveControl.EventParameter;
- return $H(data).toQueryString();
- },
-
- /**
- * Creates a random string with a length of 8 chars.
- * @return string
- */
- randomString : function()
- {
- chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
- randomString = "";
- for(x=0;x<8;x++)
- randomString += chars.charAt(Math.floor(Math.random() * 62));
- return randomString
+ }
+ });
}
});
+// /**
+// * Prado Callback client-side request handler.
+// */
+// Prado.CallbackRequestManager =
+// {
+
+// requestQueue : [],
+
+// //all request objects
+// requests : {},
+
+// getRequestById : function(id)
+// {
+// var requests = Prado.CallbackRequest.requests;
+// if(typeof(requests[id]) != "undefined")
+// return requests[id];
+// },
+
+// dispatch : function(id)
+// {
+// var requests = Prado.CallbackRequest.requests;
+// if(typeof(requests[id]) != "undefined")
+// requests[id].dispatch();
+// },
+
+// /**
+// * Dispatch a normal request, no timeouts or aborting of requests.
+// */
+// dispatchNormalRequest : function(callback)
+// {
+// callback.options.postBody = callback._getPostData(),
+// //callback.request(callback.url);
+// jQuery.ajax(callback.url, callback.options);
+// return true;
+// },
+
+// /**
+// * Abort the current priority request in progress.
+// */
+// tryNextRequest : function()
+// {
+// var self = Prado.CallbackRequest;
+// //Logger.debug('trying next request');
+// if(typeof(self.currentRequest) == 'undefined' || self.currentRequest==null)
+// {
+// if(self.requestQueue.length > 0)
+// return self.dispatchQueue();
+// //else
+// //Logger.warn('empty queque');
+// }
+// //else
+// //Logger.warn('current request ' + self.currentRequest.id);
+// },
+
+// enqueue : function(callback)
+// {
+// var self = Prado.CallbackRequest;
+// self.requestQueue.push(callback);
+// //Logger.warn("equeued "+callback.id+", current queque length="+self.requestQueue.length);
+// self.tryNextRequest();
+// },
+
+// dispatchQueue : function()
+// {
+// var self = Prado.CallbackRequest;
+// //Logger.warn("dispatching queque, length="+self.requestQueue.length+" request="+self.currentRequest);
+// var callback = self.requestQueue.shift();
+// self.currentRequest = callback;
+
+// //get data
+// callback.options.postBody = callback._getPostData(),
+
+// //callback.request = new Prado.AjaxRequest(callback);
+// callback.timeout = setTimeout(function()
+// {
+// //Logger.warn("priority timeout");
+// self.abortRequest(callback.id);
+// },callback.ActiveControl.RequestTimeOut);
+// callback.request(callback.url);
+// //Logger.debug("dispatched "+self.currentRequest.id + " ...")
+// },
+
+// endCurrentRequest : function()
+// {
+// var self = Prado.CallbackRequest;
+// if(typeof(self.currentRequest) != 'undefined' && self.currentRequest != null)
+// clearTimeout(self.currentRequest.timeout);
+// self.currentRequest=null;
+// },
+
+// abortRequest : function(id)
+// {
+// //Logger.warn("abort id="+id);
+// var self = Prado.CallbackRequest;
+// if(typeof(self.currentRequest) != 'undefined'
+// && self.currentRequest != null && self.currentRequest.id == id)
+// {
+// var request = self.currentRequest;
+// if(request.transport.readyState < 4)
+// request.transport.abort();
+// //Logger.warn('## aborted: setting current request to null');
+// self.endCurrentRequest();
+// }
+// self.tryNextRequest();
+// }
+// };
+
+// /**
+// * Automatically aborts the current request when a priority request has returned.
+// */
+// /*
+// Ajax.Responders.register({onComplete : function(request)
+// {
+// if(request && request instanceof Prado.AjaxRequest)
+// {
+// if(request.ActiveControl.HasPriority)
+// Prado.CallbackRequest.tryNextRequest();
+// }
+// }});
+// */
+
+// /**
+// * Create and prepare a new callback request.
+// * Call the dispatch() method to start the callback request.
+// * <code>
+// * request = new Prado.CallbackRequest(UniqueID, callback);
+// * request.dispatch();
+// * </code>
+// */
+// Prado.CallbackRequest = jQuery.klass({
+
+// /**
+// * Prepare and inititate a callback request.
+// */
+// initialize : function(id, options)
+// {
+// this.Enabled = true;
+// this.id = id;
+// this.randomId = this.randomString();
+
+// if(typeof(id)=="string"){
+// Prado.CallbackRequestManager.requests[id+"__"+this.randomId] = this;
+// }
+
+// Prado.CallbackRequestManager.requests[id+"__"+this.randomId].ActiveControl = this.options;
+// },
+
+// /**
+// * Creates a random string with a length of 8 chars.
+// * @return string
+// */
+// randomString : function()
+// {
+// chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
+// randomString = "";
+// for(x=0;x<8;x++)
+// randomString += chars.charAt(Math.floor(Math.random() * 62));
+// return randomString
+// }
+// });
+
/**
* Create a new callback request using default settings.
* @param string callback handler unique ID.
@@ -950,166 +879,203 @@ Prado.Callback = function(UniqueID, parameter, onSuccess, options)
{
var callback =
{
+ 'EventTarget' : UniqueID || '',
'CallbackParameter' : parameter || '',
- 'onSuccess' : onSuccess || Prototype.emptyFunction
+ 'onSuccess' : onSuccess || jQuery.noop()
};
- Object.extend(callback, options || {});
+ jQuery.extend(callback, options || {});
var request = new Prado.CallbackRequest(UniqueID, callback);
request.dispatch();
return false;
};
+/**
+ * Create a new callback request initiated by jQuery-UI elements.
+ * @param event object as sent by jQuery-UI events
+ * @param ui object as sent by jQuery-UI events
+ * @return boolean always false.
+ */
+Prado.JuiCallback = function(UniqueID, eventType, event, ui, target)
+{
+ // Retuns an array of all properties of the object received as parameter and their values.
+ // If a property represent a jQuery element, its id is returnet instead
+ var cleanUi = {};
+ jQuery.each( ui, function( key, value ) {
+ if(value instanceof jQuery)
+ cleanUi[key]=value[0].id;
+ else
+ cleanUi[key]=value;
+ });
+ target=jQuery(target);
+ cleanUi['target']= {
+ 'position' : target.position(),
+ 'offset' : target.offset()
+ };
+
+ var callback =
+ {
+ 'EventTarget' : UniqueID,
+ 'CallbackParameter' : {
+ 'event' : eventType,
+ 'ui' : cleanUi
+ }
+ };
+
+ var request = new Prado.CallbackRequest(UniqueID, callback);
+ request.dispatch();
+ return false;
+};
/**
- * Asset manager classes for lazy loading of scripts and stylesheets
- * @author Gabor Berczi (gabor.berczi@devworx.hu)
- */
+* Asset manager classes for lazy loading of scripts and stylesheets
+* @author Gabor Berczi (gabor.berczi@devworx.hu)
+*/
if (typeof(Prado.AssetManagerClass)=="undefined") {
- Prado.AssetManagerClass = Class.create();
- Prado.AssetManagerClass.prototype = {
+ Prado.AssetManagerClass = jQuery.klass();
+ Prado.AssetManagerClass.prototype = {
- initialize: function() {
- this.loadedAssets = new Array();
- this.discoverLoadedAssets();
- },
+ initialize: function() {
+ this.loadedAssets = new Array();
+ this.discoverLoadedAssets();
+ },
-
- /**
- * Detect which assets are already loaded by page markup.
- * This is done by looking up all <asset> elements and registering the values of their src attributes.
- */
- discoverLoadedAssets: function() {
- // wait until document has finished loading to avoid javascript errors
- if (!document.body) return;
+ /**
+ * Detect which assets are already loaded by page markup.
+ * This is done by looking up all <asset> elements and registering the values of their src attributes.
+ */
+ discoverLoadedAssets: function() {
- var assets = this.findAssetUrlsInMarkup();
- for(var i=0;i<assets.length;i++)
- this.markAssetAsLoaded(assets[i]);
- },
+ // wait until document has finished loading to avoid javascript errors
+ if (!document.body) return;
- /**
- * Extend url to a fully qualified url.
- * @param string url
- */
- makeFullUrl: function(url) {
+ var assets = this.findAssetUrlsInMarkup();
+ for(var i=0;i<assets.length;i++)
+ this.markAssetAsLoaded(assets[i]);
+ },
- // this is not intended to be a fully blown url "canonicalizator",
- // just to handle the most common and basic asset paths used by Prado
+ /**
+ * Extend url to a fully qualified url.
+ * @param string url
+ */
+ makeFullUrl: function(url) {
- if (!this.baseUri) this.baseUri = window.location;
+ // this is not intended to be a fully blown url "canonicalizator",
+ // just to handle the most common and basic asset paths used by Prado
- if (url.indexOf('://')==-1)
- {
- var a = document.createElement('a');
- a.href = url;
+ if (!this.baseUri) this.baseUri = window.location;
- if (a.href.indexOf('://')!=-1)
- url = a.href;
- else
- {
- var path = a.pathname;
- if (path.substr(0,1)!='/') path = '/'+path;
- url = this.baseUri.protocol+'//'+this.baseUri.host+path;
- }
- }
- return url;
- },
+ if (url.indexOf('://')==-1)
+ {
+ var a = document.createElement('a');
+ a.href = url;
- isAssetLoaded: function(url) {
- url = this.makeFullUrl(url);
- return (this.loadedAssets.indexOf(url)!=-1);
- },
+ if (a.href.indexOf('://')!=-1)
+ url = a.href;
+ else
+ {
+ var path = a.pathname;
+ if (path.substr(0,1)!='/') path = '/'+path;
+ url = this.baseUri.protocol+'//'+this.baseUri.host+path;
+ }
+ }
+ return url;
+ },
- /**
- * Mark asset as being already loaded
- * @param string url of the asset
- */
- markAssetAsLoaded: function(url) {
- url = this.makeFullUrl(url);
- if (this.loadedAssets.indexOf(url)==-1)
- this.loadedAssets.push(url);
- },
+ isAssetLoaded: function(url) {
+ url = this.makeFullUrl(url);
+ return (jQuery.inArray(url, this.loadedAssets)!=-1);
+ },
- assetReadyStateChanged: function(url, element, callback, finalevent) {
- if (finalevent || (element.readyState == 'loaded') || (element.readyState == 'complete'))
- if (!element.assetCallbackFired)
- {
- element.assetCallbackFired = true;
- callback(url,element);
- }
- },
+ /**
+ * Mark asset as being already loaded
+ * @param string url of the asset
+ */
+ markAssetAsLoaded: function(url) {
+ url = this.makeFullUrl(url);
+ if (jQuery.inArray(url, this.loadedAssets)==-1)
+ this.loadedAssets.push(url);
+ },
- assetLoadFailed: function(url, element, callback) {
- debugger;
- element.assetCallbackFired = true;
- if(typeof Logger != "undefined")
- Logger.error("Failed to load asset: "+url, this);
- if (!element.assetCallbackFired)
- callback(url,element,false);
- },
+ assetReadyStateChanged: function(url, element, callback, finalevent) {
+ if (finalevent || (element.readyState == 'loaded') || (element.readyState == 'complete'))
+ if (!element.assetCallbackFired)
+ {
+ element.assetCallbackFired = true;
+ callback(url,element);
+ }
+ },
- /**
- * Load a new asset dynamically into the page.
- * Please not thet loading is asynchronous and therefore you can't assume that
- * the asset is loaded and ready when returning from this function.
- * @param string url of the asset to load
- * @param callback will be called when the asset has loaded (or failed to load)
- */
- startAssetLoad: function(url, callback) {
+ assetLoadFailed: function(url, element, callback) {
+ debugger;
+ element.assetCallbackFired = true;
+ if(typeof Logger != "undefined")
+ Logger.error("Failed to load asset: "+url, this);
+ if (!element.assetCallbackFired)
+ callback(url,element,false);
+ },
- // create new <asset> element in page header
- var asset = this.createAssetElement(url);
+ /**
+ * Load a new asset dynamically into the page.
+ * Please not thet loading is asynchronous and therefore you can't assume that
+ * the asset is loaded and ready when returning from this function.
+ * @param string url of the asset to load
+ * @param callback will be called when the asset has loaded (or failed to load)
+ */
+ startAssetLoad: function(url, callback) {
- if (callback)
- {
- asset.onreadystatechange = this.assetReadyStateChanged.bind(this, url, asset, callback, false);
- asset.onload = this.assetReadyStateChanged.bind(this, url, asset, callback, true);
- asset.onerror = this.assetLoadFailed.bind(this, url, asset, callback);
- asset.assetCallbackFired = false;
- }
+ // create new <asset> element in page header
+ var asset = this.createAssetElement(url);
- var head = document.getElementsByTagName('head')[0];
- head.appendChild(asset);
+ if (callback)
+ {
+ asset.onreadystatechange = this.assetReadyStateChanged.bind(this, url, asset, callback, false);
+ asset.onload = this.assetReadyStateChanged.bind(this, url, asset, callback, true);
+ asset.onerror = this.assetLoadFailed.bind(this, url, asset, callback);
+ asset.assetCallbackFired = false;
+ }
- // mark this asset as loaded
- this.markAssetAsLoaded(url);
+ var head = document.getElementsByTagName('head')[0];
+ head.appendChild(asset);
- return (callback!=false);
- },
+ // mark this asset as loaded
+ this.markAssetAsLoaded(url);
- /**
- * Check whether a asset is loaded into the page, and if itsn't, load it now
- * @param string url of the asset to check/load
- * @return boolean returns true if asset is already loaded, or false, if loading has just started. callback will be called when loading has finished.
- */
- ensureAssetIsLoaded: function(url, callback) {
- url = this.makeFullUrl(url);
- if (this.loadedAssets.indexOf(url)==-1)
+ return (callback!=false);
+ },
+
+ /**
+ * Check whether a asset is loaded into the page, and if itsn't, load it now
+ * @param string url of the asset to check/load
+ * @return boolean returns true if asset is already loaded, or false, if loading has just started. callback will be called when loading has finished.
+ */
+ ensureAssetIsLoaded: function(url, callback) {
+ url = this.makeFullUrl(url);
+ if (jQuery.inArray(url, this.loadedAssets)==-1)
{
this.startAssetLoad(url,callback);
return false;
}
- else
- return true;
- }
+ else
+ return true;
+ }
- }
+ }
};
- Prado.ScriptManagerClass = Class.extend(Prado.AssetManagerClass, {
+Prado.ScriptManagerClass = jQuery.klass(Prado.AssetManagerClass, {
findAssetUrlsInMarkup: function() {
var urls = new Array();
var scripts = document.getElementsByTagName('script');
for(var i=0;i<scripts.length;i++)
- {
+ {
var e = scripts[i]; var src = e.src;
if (src!="")
urls.push(src);
@@ -1118,22 +1084,22 @@ if (typeof(Prado.AssetManagerClass)=="undefined") {
},
createAssetElement: function(url) {
- var asset = document.createElement('script');
- asset.type = 'text/javascript';
- asset.src = url;
-// asset.async = false; // HTML5 only
+ var asset = document.createElement('script');
+ asset.type = 'text/javascript';
+ asset.src = url;
+ // asset.async = false; // HTML5 only
return asset;
}
- });
+});
- Prado.StyleSheetManagerClass = Class.extend(Prado.AssetManagerClass, {
+Prado.StyleSheetManagerClass = jQuery.klass(Prado.AssetManagerClass, {
findAssetUrlsInMarkup: function() {
var urls = new Array();
var scripts = document.getElementsByTagName('link');
for(var i=0;i<scripts.length;i++)
- {
+ {
var e = scripts[i]; var href = e.href;
if ((e.rel=="stylesheet") && (href.length>0))
urls.push(href);
@@ -1142,34 +1108,39 @@ if (typeof(Prado.AssetManagerClass)=="undefined") {
},
createAssetElement: function(url) {
- var asset = document.createElement('link');
- asset.rel = 'stylesheet';
- asset.media = 'screen';
- asset.setAttribute('type', 'text/css');
- asset.href = url;
-// asset.async = false; // HTML5 only
+ var asset = document.createElement('link');
+ asset.rel = 'stylesheet';
+ asset.media = 'screen';
+ asset.setAttribute('type', 'text/css');
+ asset.href = url;
+ // asset.async = false; // HTML5 only
return asset;
},
createStyleSheetCode: function(code) {
- var asset = document.createElement('style');
- asset.setAttribute('type', 'text/css');
- asset.innerText = code;
+ var asset = document.createElement('style');
+ asset.setAttribute('type', 'text/css');
+
+ if(asset.styleSheet)
+ asset.styleSheet.cssText = code; // IE7+IE8
+ else {
+ var cssCodeNode = document.createTextNode(code);
+ asset.appendChild(cssCodeNode);
+ }
var head = document.getElementsByTagName('head')[0];
- head.appendChild(asset);
+ head.appendChild(asset);
}
- });
+});
- if (typeof(Prado.ScriptManager)=="undefined") Prado.ScriptManager = new Prado.ScriptManagerClass();
- if (typeof(Prado.StyleSheetManager)=="undefined") Prado.StyleSheetManager = new Prado.StyleSheetManagerClass();
+if (typeof(Prado.ScriptManager)=="undefined") Prado.ScriptManager = new Prado.ScriptManagerClass();
+if (typeof(Prado.StyleSheetManager)=="undefined") Prado.StyleSheetManager = new Prado.StyleSheetManagerClass();
- // make sure we scan for loaded scripts again when the page has been loaded
- var discover = function() {
+// make sure we scan for loaded scripts again when the page has been loaded
+var discover = function() {
Prado.ScriptManager.discoverLoadedAssets();
Prado.StyleSheetManager.discoverLoadedAssets();
- }
- if (window.attachEvent) window.attachEvent('onload', discover);
- else if (window.addEventListener) window.addEventListener('load', discover, false);
-
+}
+if (window.attachEvent) window.attachEvent('onload', discover);
+else if (window.addEventListener) window.addEventListener('load', discover, false);
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/autocomplete.js b/framework/Web/Javascripts/source/prado/activecontrols/autocomplete.js
new file mode 100644
index 00000000..da5f4b56
--- /dev/null
+++ b/framework/Web/Javascripts/source/prado/activecontrols/autocomplete.js
@@ -0,0 +1,83 @@
+jQuery.noConflict();
+
+/**
+ * TAutoComplete control.
+ */
+Prado.WebUI.TAutoComplete = jQuery.klass(Autocompleter.Base, Prado.WebUI.TActiveTextBox.prototype,
+{
+ initialize : function(options)
+ {
+ this.options = options;
+ this.observers = new Array();
+ this.hasResults = false;
+ this.baseInitialize(options.ID, options.ResultPanel, options);
+ Object.extend(this.options,
+ {
+ onSuccess : this.onComplete.bind(this)
+ });
+
+ if(options.AutoPostBack)
+ this.onInit(options);
+
+ Prado.Registry[options.ID] = this;
+ },
+
+ doCallback : function(options, event)
+ {
+ if(!this.active)
+ {
+ var request = new Prado.CallbackRequest(this.options.EventTarget, options);
+ request.dispatch();
+ event.preventDefault();
+ }
+ },
+
+ //Overrides parent implementation, fires onchange event.
+ onClick: function(event)
+ {
+ var element = Event.findElement(event, 'LI');
+ this.index = element.autocompleteIndex;
+ this.selectEntry();
+ this.hide();
+ jQuery(this.element).trigger('change');
+ },
+
+ getUpdatedChoices : function()
+ {
+ var options = new Array(this.getToken(),"__TAutoComplete_onSuggest__");
+ Prado.Callback(this.options.EventTarget, options, null, this.options);
+ },
+
+ /**
+ * Overrides parent implements, don't update if no results.
+ */
+ selectEntry: function()
+ {
+ if(this.hasResults)
+ {
+ this.active = false;
+ this.updateElement(this.getCurrentEntry());
+ var options = [this.index, "__TAutoComplete_onSuggestionSelected__"];
+ Prado.Callback(this.options.EventTarget, options, null, this.options);
+ }
+ },
+
+ onComplete : function(request, boundary)
+ {
+ var result = request.extractContent(boundary);
+ if(typeof(result) == "string")
+ {
+ if(result.length > 0)
+ {
+ this.hasResults = true;
+ this.updateChoices(result);
+ }
+ else
+ {
+ this.active = false;
+ this.hasResults = false;
+ this.hide();
+ }
+ }
+ }
+}); \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js b/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js
index 511c2ab9..9e583c1f 100755
--- a/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js
+++ b/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js
@@ -1,20 +1,22 @@
+jQuery.noConflict();
+
/**
* DropContainer control
*/
-
+
Prado.WebUI.DropContainer = Class.create(Prado.WebUI.CallbackControl,
{
onInit: function(options)
{
this.options = options;
- Object.extend (this.options,
+ Object.extend (this.options,
{
onDrop: this.onDrop.bind(this)
});
-
+
Droppables.add (options.ID, this.options);
},
-
+
onDrop: function(dragElement, dropElement, event)
{
var elementId=dragElement.id.replace(/clone_/,"");
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js b/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js
index 0260c219..66862584 100644
--- a/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js
+++ b/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js
@@ -1,4 +1,4 @@
-Prado.WebUI.TInPlaceTextBox = Class.create(Prado.WebUI.Control,
+Prado.WebUI.TInPlaceTextBox = jQuery.klass(Prado.WebUI.Control,
{
onInit : function(options)
{
@@ -8,13 +8,13 @@ Prado.WebUI.TInPlaceTextBox = Class.create(Prado.WebUI.Control,
this.editField = null;
this.readOnly = options.ReadOnly;
- this.options = Object.extend(
+ this.options = jQuery.extend(
{
LoadTextFromSource : false,
TextMode : 'SingleLine'
}, options || {});
- this.element = $(this.options.ID);
+ this.element = jQuery('#'+this.options.ID).get(0);
Prado.WebUI.TInPlaceTextBox.register(this);
this.createEditorInput();
this.initializeListeners();
@@ -25,10 +25,10 @@ Prado.WebUI.TInPlaceTextBox = Class.create(Prado.WebUI.Control,
*/
initializeListeners : function()
{
- this.onclickListener = this.enterEditMode.bindAsEventListener(this);
+ this.onclickListener = this.enterEditMode.bind(this);
this.observe(this.element, 'click', this.onclickListener);
if (this.options.ExternalControl)
- this.observe($(this.options.ExternalControl), 'click', this.onclickListener);
+ this.observe(jQuery('#'+this.options.ExternalControl).get(0), 'click', this.onclickListener);
},
/**
@@ -45,9 +45,9 @@ Prado.WebUI.TInPlaceTextBox = Class.create(Prado.WebUI.Control,
this.editField.disabled = false;
if(this.options.LoadTextOnEdit)
this.loadExternalText();
- Prado.Element.focus(this.editField);
+ jQuery(this.editField).focus();
if (evt)
- Event.stop(evt);
+ evt.preventDefault();
return false;
},
@@ -62,14 +62,14 @@ Prado.WebUI.TInPlaceTextBox = Class.create(Prado.WebUI.Control,
showTextBox : function()
{
- Element.hide(this.element);
- Element.show(this.editField);
+ jQuery(this.element).hide();
+ jQuery(this.editField).show();
},
showLabel : function()
{
- Element.show(this.element);
- Element.hide(this.editField);
+ jQuery(this.element).show();
+ jQuery(this.editField).hide();
},
/**
@@ -91,8 +91,8 @@ Prado.WebUI.TInPlaceTextBox = Class.create(Prado.WebUI.Control,
var request = new Prado.CallbackRequest(this.options.EventTarget, this.options);
request.setCausesValidation(false);
request.setCallbackParameter(options);
- request.ActiveControl.onSuccess = this.onloadExternalTextSuccess.bind(this);
- request.ActiveControl.onFailure = this.onloadExternalTextFailure.bind(this);
+ request.options.onSuccess = this.onloadExternalTextSuccess.bind(this);
+ request.options.onFailure = this.onloadExternalTextFailure.bind(this);
request.dispatch();
},
@@ -103,41 +103,44 @@ Prado.WebUI.TInPlaceTextBox = Class.create(Prado.WebUI.Control,
{
var cssClass= this.element.className || '';
var inputName = this.options.EventTarget;
- var options = {'className' : cssClass, name : inputName, id : this.options.TextBoxID};
+
if(this.options.TextMode == 'SingleLine')
{
+ this.editField = document.createElement("input");
if(this.options.MaxLength > 0)
- options['maxlength'] = this.options.MaxLength;
+ this.editField.maxlength = this.options.MaxLength;
if(this.options.Columns > 0)
- options['size'] = this.options.Columns;
- this.editField = INPUT(options);
+ this.editField.size = this.options.Columns;
}
else
{
+ this.editField = document.createElement("textarea");
if(this.options.Rows > 0)
- options['rows'] = this.options.Rows;
+ this.editField.rows = this.options.Rows;
if(this.options.Columns > 0)
- options['cols'] = this.options.Columns;
+ this.editField.cols = this.options.Columns;
if(this.options.Wrap)
- options['wrap'] = 'off';
- this.editField = TEXTAREA(options);
+ this.editField.wrap = 'off';
}
+ this.editField.className = cssClass;
+ this.editField.name = inputName;
+ this.editField.id = this.options.TextBoxID;
this.editField.style.display="none";
- this.element.parentNode.insertBefore(this.editField,this.element)
-
+ this.element.parentNode.insertBefore(this.editField, this.element)
+
//handle return key within single line textbox
if(this.options.TextMode == 'SingleLine')
{
this.observe(this.editField, "keydown", function(e)
{
- if(Event.keyCode(e) == Event.KEY_RETURN)
+ if(e.keyCode == 13) //KEY_RETURN
{
- var target = Event.element(e);
+ var target = e.target;
if(target)
{
- Event.fireEvent(target, "blur");
- Event.stop(e);
+ jQuery(target).trigger("blur");
+ e.preventDefault();
}
}
});
@@ -183,15 +186,16 @@ Prado.WebUI.TInPlaceTextBox = Class.create(Prado.WebUI.Control,
onKeyPressed : function(e)
{
- if (Event.keyCode(e) == Event.KEY_ESC)
+ if (e.keyCode == 27) //KEY_ESC
{
this.editField.value = this.getText();
this.isEditing = false;
if(this.options.AutoHide)
this.showLabel();
}
- else if (Event.keyCode(e) == Event.KEY_RETURN && this.options.TextMode != 'MultiLine')
- Event.stop(e);
+ else if (e.keyCode == 13 // KEY_RETURN
+ && this.options.TextMode != 'MultiLine')
+ e.preventDefault()
},
/**
@@ -202,8 +206,8 @@ Prado.WebUI.TInPlaceTextBox = Class.create(Prado.WebUI.Control,
{
var request = new Prado.CallbackRequest(this.options.EventTarget, this.options);
request.setCallbackParameter(text);
- request.ActiveControl.onSuccess = this.onTextChangedSuccess.bind(this);
- request.ActiveControl.onFailure = this.onTextChangedFailure.bind(this);
+ request.options.onSuccess = this.onTextChangedSuccess.bind(this);
+ request.options.onFailure = this.onTextChangedFailure.bind(this);
if(request.dispatch())
{
this.isSaving = true;
@@ -224,7 +228,7 @@ Prado.WebUI.TInPlaceTextBox = Class.create(Prado.WebUI.Control,
this.isEditing = true;
this.editField.disabled = false;
this.editField.value = this.getText();
- Prado.Element.focus(this.editField);
+ jQuery(this.editField).focus();
if(typeof(this.options.onSuccess)=="function")
this.options.onSuccess(sender,parameter);
},
@@ -266,7 +270,7 @@ Prado.WebUI.TInPlaceTextBox = Class.create(Prado.WebUI.Control,
});
-Object.extend(Prado.WebUI.TInPlaceTextBox,
+jQuery.extend(Prado.WebUI.TInPlaceTextBox,
{
//class methods
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/json2.js b/framework/Web/Javascripts/source/prado/activecontrols/json2.js
deleted file mode 100644
index 3eec6f20..00000000
--- a/framework/Web/Javascripts/source/prado/activecontrols/json2.js
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
- http://www.JSON.org/json2.js
- 2011-02-23
-
- Public Domain.
-
- NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
-
- See http://www.JSON.org/js.html
-
-
- This code should be minified before deployment.
- See http://javascript.crockford.com/jsmin.html
-
- USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
- NOT CONTROL.
-
-
- This file creates a global JSON object containing two methods: stringify
- and parse.
-
- JSON.stringify(value, replacer, space)
- value any JavaScript value, usually an object or array.
-
- replacer an optional parameter that determines how object
- values are stringified for objects. It can be a
- function or an array of strings.
-
- space an optional parameter that specifies the indentation
- of nested structures. If it is omitted, the text will
- be packed without extra whitespace. If it is a number,
- it will specify the number of spaces to indent at each
- level. If it is a string (such as '\t' or '&nbsp;'),
- it contains the characters used to indent at each level.
-
- This method produces a JSON text from a JavaScript value.
-
- When an object value is found, if the object contains a toJSON
- method, its toJSON method will be called and the result will be
- stringified. A toJSON method does not serialize: it returns the
- value represented by the name/value pair that should be serialized,
- or undefined if nothing should be serialized. The toJSON method
- will be passed the key associated with the value, and this will be
- bound to the value
-
- For example, this would serialize Dates as ISO strings.
-
- Date.prototype.toJSON = function (key) {
- function f(n) {
- // Format integers to have at least two digits.
- return n < 10 ? '0' + n : n;
- }
-
- return this.getUTCFullYear() + '-' +
- f(this.getUTCMonth() + 1) + '-' +
- f(this.getUTCDate()) + 'T' +
- f(this.getUTCHours()) + ':' +
- f(this.getUTCMinutes()) + ':' +
- f(this.getUTCSeconds()) + 'Z';
- };
-
- You can provide an optional replacer method. It will be passed the
- key and value of each member, with this bound to the containing
- object. The value that is returned from your method will be
- serialized. If your method returns undefined, then the member will
- be excluded from the serialization.
-
- If the replacer parameter is an array of strings, then it will be
- used to select the members to be serialized. It filters the results
- such that only members with keys listed in the replacer array are
- stringified.
-
- Values that do not have JSON representations, such as undefined or
- functions, will not be serialized. Such values in objects will be
- dropped; in arrays they will be replaced with null. You can use
- a replacer function to replace those with JSON values.
- JSON.stringify(undefined) returns undefined.
-
- The optional space parameter produces a stringification of the
- value that is filled with line breaks and indentation to make it
- easier to read.
-
- If the space parameter is a non-empty string, then that string will
- be used for indentation. If the space parameter is a number, then
- the indentation will be that many spaces.
-
- Example:
-
- text = JSON.stringify(['e', {pluribus: 'unum'}]);
- // text is '["e",{"pluribus":"unum"}]'
-
-
- text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
- // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
-
- text = JSON.stringify([new Date()], function (key, value) {
- return this[key] instanceof Date ?
- 'Date(' + this[key] + ')' : value;
- });
- // text is '["Date(---current time---)"]'
-
-
- JSON.parse(text, reviver)
- This method parses a JSON text to produce an object or array.
- It can throw a SyntaxError exception.
-
- The optional reviver parameter is a function that can filter and
- transform the results. It receives each of the keys and values,
- and its return value is used instead of the original value.
- If it returns what it received, then the structure is not modified.
- If it returns undefined then the member is deleted.
-
- Example:
-
- // Parse the text. Values that look like ISO date strings will
- // be converted to Date objects.
-
- myData = JSON.parse(text, function (key, value) {
- var a;
- if (typeof value === 'string') {
- a =
-/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
- if (a) {
- return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
- +a[5], +a[6]));
- }
- }
- return value;
- });
-
- myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
- var d;
- if (typeof value === 'string' &&
- value.slice(0, 5) === 'Date(' &&
- value.slice(-1) === ')') {
- d = new Date(value.slice(5, -1));
- if (d) {
- return d;
- }
- }
- return value;
- });
-
-
- This is a reference implementation. You are free to copy, modify, or
- redistribute.
-*/
-
-/*jslint evil: true, strict: false, regexp: false */
-
-/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
- call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
- getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
- lastIndex, length, parse, prototype, push, replace, slice, stringify,
- test, toJSON, toString, valueOf
-*/
-
-
-// Create a JSON object only if one does not already exist. We create the
-// methods in a closure to avoid creating global variables.
-
-if (!Prado.JSON) {
- Prado.JSON = {};
-}
-
-(function () {
- "use strict";
-
- function f(n) {
- // Format integers to have at least two digits.
- return n < 10 ? '0' + n : n;
- }
-
- if (typeof Date.prototype.toJSON !== 'function') {
-
- Date.prototype.toJSON = function (key) {
-
- return isFinite(this.valueOf()) ?
- this.getUTCFullYear() + '-' +
- f(this.getUTCMonth() + 1) + '-' +
- f(this.getUTCDate()) + 'T' +
- f(this.getUTCHours()) + ':' +
- f(this.getUTCMinutes()) + ':' +
- f(this.getUTCSeconds()) + 'Z' : null;
- };
-
- String.prototype.toJSON =
- Number.prototype.toJSON =
- Boolean.prototype.toJSON = function (key) {
- return this.valueOf();
- };
- }
-
- var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- gap,
- indent,
- meta = { // table of character substitutions
- '\b': '\\b',
- '\t': '\\t',
- '\n': '\\n',
- '\f': '\\f',
- '\r': '\\r',
- '"' : '\\"',
- '\\': '\\\\'
- },
- rep;
-
-
- function quote(string) {
-
-// If the string contains no control characters, no quote characters, and no
-// backslash characters, then we can safely slap some quotes around it.
-// Otherwise we must also replace the offending characters with safe escape
-// sequences.
-
- escapable.lastIndex = 0;
- return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
- var c = meta[a];
- return typeof c === 'string' ? c :
- '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- }) + '"' : '"' + string + '"';
- }
-
-
- function str(key, holder) {
-
-// Produce a string from holder[key].
-
- var i, // The loop counter.
- k, // The member key.
- v, // The member value.
- length,
- mind = gap,
- partial,
- value = holder[key];
-
-// If the value has a toJSON method, call it to obtain a replacement value.
-
- if (value && typeof value === 'object' &&
- typeof value.toJSON === 'function') {
- value = value.toJSON(key);
- }
-
-// If we were called with a replacer function, then call the replacer to
-// obtain a replacement value.
-
- if (typeof rep === 'function') {
- value = rep.call(holder, key, value);
- }
-
-// What happens next depends on the value's type.
-
- switch (typeof value) {
- case 'string':
- return quote(value);
-
- case 'number':
-
-// JSON numbers must be finite. Encode non-finite numbers as null.
-
- return isFinite(value) ? String(value) : 'null';
-
- case 'boolean':
- case 'null':
-
-// If the value is a boolean or null, convert it to a string. Note:
-// typeof null does not produce 'null'. The case is included here in
-// the remote chance that this gets fixed someday.
-
- return String(value);
-
-// If the type is 'object', we might be dealing with an object or an array or
-// null.
-
- case 'object':
-
-// Due to a specification blunder in ECMAScript, typeof null is 'object',
-// so watch out for that case.
-
- if (!value) {
- return 'null';
- }
-
-// Make an array to hold the partial results of stringifying this object value.
-
- gap += indent;
- partial = [];
-
-// Is the value an array?
-
- if (Object.prototype.toString.apply(value) === '[object Array]') {
-
-// The value is an array. Stringify every element. Use null as a placeholder
-// for non-JSON values.
-
- length = value.length;
- for (i = 0; i < length; i += 1) {
- partial[i] = str(i, value) || 'null';
- }
-
-// Join all of the elements together, separated with commas, and wrap them in
-// brackets.
-
- v = partial.length === 0 ? '[]' : gap ?
- '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' :
- '[' + partial.join(',') + ']';
- gap = mind;
- return v;
- }
-
-// If the replacer is an array, use it to select the members to be stringified.
-
- if (rep && typeof rep === 'object') {
- length = rep.length;
- for (i = 0; i < length; i += 1) {
- if (typeof rep[i] === 'string') {
- k = rep[i];
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ': ' : ':') + v);
- }
- }
- }
- } else {
-
-// Otherwise, iterate through all of the keys in the object.
-
- for (k in value) {
- if (Object.prototype.hasOwnProperty.call(value, k)) {
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ': ' : ':') + v);
- }
- }
- }
- }
-
-// Join all of the member texts together, separated with commas,
-// and wrap them in braces.
-
- v = partial.length === 0 ? '{}' : gap ?
- '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' :
- '{' + partial.join(',') + '}';
- gap = mind;
- return v;
- }
- }
-
-// If the JSON object does not yet have a stringify method, give it one.
-
- if (typeof Prado.JSON.stringify !== 'function') {
- Prado.JSON.stringify = function (value, replacer, space) {
-
-// The stringify method takes a value and an optional replacer, and an optional
-// space parameter, and returns a JSON text. The replacer can be a function
-// that can replace values, or an array of strings that will select the keys.
-// A default replacer method can be provided. Use of the space parameter can
-// produce text that is more easily readable.
-
- var i;
- gap = '';
- indent = '';
-
-// If the space parameter is a number, make an indent string containing that
-// many spaces.
-
- if (typeof space === 'number') {
- for (i = 0; i < space; i += 1) {
- indent += ' ';
- }
-
-// If the space parameter is a string, it will be used as the indent string.
-
- } else if (typeof space === 'string') {
- indent = space;
- }
-
-// If there is a replacer, it must be a function or an array.
-// Otherwise, throw an error.
-
- rep = replacer;
- if (replacer && typeof replacer !== 'function' &&
- (typeof replacer !== 'object' ||
- typeof replacer.length !== 'number')) {
- throw new Error('JSON.stringify');
- }
-
-// Make a fake root object containing our value under the key of ''.
-// Return the result of stringifying the value.
-
- return str('', {'': value});
- };
- }
-
-
-// If the JSON object does not yet have a parse method, give it one.
-
- if (typeof Prado.JSON.parse !== 'function') {
- Prado.JSON.parse = function (text, reviver) {
-
-// The parse method takes a text and an optional reviver function, and returns
-// a JavaScript value if the text is a valid JSON text.
-
- var j;
-
- function walk(holder, key) {
-
-// The walk method is used to recursively walk the resulting structure so
-// that modifications can be made.
-
- var k, v, value = holder[key];
- if (value && typeof value === 'object') {
- for (k in value) {
- if (Object.prototype.hasOwnProperty.call(value, k)) {
- v = walk(value, k);
- if (v !== undefined) {
- value[k] = v;
- } else {
- delete value[k];
- }
- }
- }
- }
- return reviver.call(holder, key, value);
- }
-
-
-// Parsing happens in four stages. In the first stage, we replace certain
-// Unicode characters with escape sequences. JavaScript handles many characters
-// incorrectly, either silently deleting them, or treating them as line endings.
-
- text = String(text);
- cx.lastIndex = 0;
- if (cx.test(text)) {
- text = text.replace(cx, function (a) {
- return '\\u' +
- ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- });
- }
-
-// In the second stage, we run the text against regular expressions that look
-// for non-JSON patterns. We are especially concerned with '()' and 'new'
-// because they can cause invocation, and '=' because it can cause mutation.
-// But just to be safe, we want to reject all unexpected forms.
-
-// We split the second stage into 4 regexp operations in order to work around
-// crippling inefficiencies in IE's and Safari's regexp engines. First we
-// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
-// replace all simple value tokens with ']' characters. Third, we delete all
-// open brackets that follow a colon or comma or that begin the text. Finally,
-// we look to see that the remaining characters are only whitespace or ']' or
-// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
-
- if (/^[\],:{}\s]*$/
- .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
- .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
- .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
-
-// In the third stage we use the eval function to compile the text into a
-// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
-// in JavaScript: it can begin a block or an object literal. We wrap the text
-// in parens to eliminate the ambiguity.
-
- j = eval('(' + text + ')');
-
-// In the optional fourth stage, we recursively walk the new structure, passing
-// each name/value pair to a reviver function for possible transformation.
-
- return typeof reviver === 'function' ?
- walk({'': j}, '') : j;
- }
-
-// If the text is not JSON parseable, then a SyntaxError is thrown.
-
- throw new SyntaxError('JSON.parse');
- };
- }
-}());
diff --git a/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js
index 5f20944e..15998278 100755
--- a/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js
+++ b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js
@@ -1,24 +1,24 @@
-Prado.WebUI.TActiveFileUpload = Class.create(Prado.WebUI.Control,
+Prado.WebUI.TActiveFileUpload = jQuery.klass(Prado.WebUI.Control,
{
onInit : function(options)
{
this.options = options || {};
Prado.WebUI.TActiveFileUpload.register(this);
-
- this.input = $(options.inputID);
- this.flag = $(options.flagID);
- this.form = $(options.formID);
-
- this.indicator = $(options.indicatorID);
- this.complete = $(options.completeID);
- this.error = $(options.errorID);
-
+
+ this.input = jQuery('#'+options.inputID).get(0);
+ this.flag = jQuery('#'+options.flagID).get(0);
+ this.form = jQuery('#'+options.formID).get(0);
+
+ this.indicator = jQuery('#'+options.indicatorID).get(0);
+ this.complete = jQuery('#'+options.completeID).get(0);
+ this.error = jQuery('#'+options.errorID).get(0);
+
// set up events
if (options.autoPostBack){
this.observe(this.input,"change",this.fileChanged.bind(this));
}
},
-
+
fileChanged : function(){
// show the upload indicator, and hide the complete and error indicators (if they areSn't already).
this.flag.value = '1';
@@ -43,25 +43,25 @@ Prado.WebUI.TActiveFileUpload = Class.create(Prado.WebUI.Control,
this.form.method = this.oldFormMethod;
this.form.enctype = this.oldFormEnctype;
},
-
+
finishUpload : function(options){
if (this.options.targetID == options.targetID)
- {
- this.finishoptions = options;
- var e = this;
- var callback =
- {
- 'CallbackParameter' : options || '',
- 'onSuccess' : function() { e.finishCallBack(true); },
- 'onFailure' : function() { e.finishCallBack(false); }
- };
-
- Object.extend(callback, this.options);
-
- var request = new Prado.CallbackRequest(this.options.EventTarget, callback);
- request.dispatch();
- }
+ {
+ this.finishoptions = options;
+ var e = this;
+ var callback =
+ {
+ 'CallbackParameter' : options || '',
+ 'onSuccess' : function() { e.finishCallBack(true); },
+ 'onFailure' : function() { e.finishCallBack(false); }
+ };
+
+ jQuery.extend(callback, this.options);
+
+ var request = new Prado.CallbackRequest(this.options.EventTarget, callback);
+ request.dispatch();
+ }
else
this.finishCallBack(true);
@@ -71,18 +71,18 @@ Prado.WebUI.TActiveFileUpload = Class.create(Prado.WebUI.Control,
// hide the display indicator.
this.flag.value = '';
this.indicator.style.display = 'none';
- // show the complete indicator.
- if ((this.finishoptions.errorCode == 0) && (success)) {
- this.complete.style.display = '';
- this.input.value = '';
- } else {
- this.error.style.display = '';
- }
+ // show the complete indicator.
+ if ((this.finishoptions.errorCode == 0) && (success)) {
+ this.complete.style.display = '';
+ this.input.value = '';
+ } else {
+ this.error.style.display = '';
+ }
}
});
-Object.extend(Prado.WebUI.TActiveFileUpload,
+jQuery.extend(Prado.WebUI.TActiveFileUpload,
{
//class methods
@@ -92,12 +92,12 @@ Object.extend(Prado.WebUI.TActiveFileUpload,
{
Prado.WebUI.TActiveFileUpload.controls[control.options.ID] = control;
},
-
+
onFileUpload : function(options)
{
Prado.WebUI.TActiveFileUpload.controls[options.clientID].finishUpload(options);
},
-
+
fileChanged : function(controlID){
Prado.WebUI.TActiveFileUpload.controls[controlID].fileChanged();
}
diff --git a/framework/Web/Javascripts/source/prado/colorpicker/colorpicker.js b/framework/Web/Javascripts/source/prado/colorpicker/colorpicker.js
index 142745cf..9915eb81 100644
--- a/framework/Web/Javascripts/source/prado/colorpicker/colorpicker.js
+++ b/framework/Web/Javascripts/source/prado/colorpicker/colorpicker.js
@@ -1,7 +1,7 @@
//-------------------- ricoColor.js
if(typeof(Rico) == "undefined") Rico = {};
-Rico.Color = Class.create();
+Rico.Color = jQuery.klass();
Rico.Color.prototype = {
@@ -79,7 +79,7 @@ Rico.Color.prototype = {
},
asHex: function() {
- return "#" + this.rgb.r.toColorPart() + this.rgb.g.toColorPart() + this.rgb.b.toColorPart();
+ return "#" + this.toColorPart(this.rgb.r) + this.toColorPart(this.rgb.g) + this.toColorPart(this.rgb.b);
},
asHSB: function() {
@@ -88,8 +88,13 @@ Rico.Color.prototype = {
toString: function() {
return this.asHex();
- }
+ },
+ toColorPart: function(number) {
+ number = (number > 255 ? 255 : (number < 0 ? 0 : number));
+ var hex = number.toString(16);
+ return hex.length < 2 ? "0" + hex : hex;
+ }
};
Rico.Color.createFromHex = function(hexCode) {
@@ -122,7 +127,7 @@ Rico.Color.createFromHex = function(hexCode) {
*/
Rico.Color.createColorFromBackground = function(elem) {
- var actualColor = Element.getStyle($(elem), "background-color");
+ var actualColor = jQuery(elem).css("background-color");
if ( actualColor == "transparent" && elem.parent )
return Rico.Color.createColorFromBackground(elem.parent);
@@ -241,40 +246,9 @@ Rico.Color.RGBtoHSB = function(r, g, b) {
return { h : hue, s : saturation, b : brightness };
};
+Prado.WebUI.TColorPicker = jQuery.klass(Prado.WebUI.Control, {
-Prado.WebUI.TColorPicker = Class.create();
-
-Object.extend(Prado.WebUI.TColorPicker,
-{
- palettes:
- {
- Small : [["fff", "fcc", "fc9", "ff9", "ffc", "9f9", "9ff", "cff", "ccf", "fcf"],
- ["ccc", "f66", "f96", "ff6", "ff3", "6f9", "3ff", "6ff", "99f", "f9f"],
- ["c0c0c0", "f00", "f90", "fc6", "ff0", "3f3", "6cc", "3cf", "66c", "c6c"],
- ["999", "c00", "f60", "fc3", "fc0", "3c0", "0cc", "36f", "63f", "c3c"],
- ["666", "900", "c60", "c93", "990", "090", "399", "33f", "60c", "939"],
- ["333", "600", "930", "963", "660", "060", "366", "009", "339", "636"],
- ["000", "300", "630", "633", "330", "030", "033", "006", "309", "303"]],
-
- Tiny : [["ffffff"/*white*/, "00ff00"/*lime*/, "008000"/*green*/, "0000ff"/*blue*/],
- ["c0c0c0"/*silver*/, "ffff00"/*yellow*/, "ff00ff"/*fuchsia*/, "000080"/*navy*/],
- ["808080"/*gray*/, "ff0000"/*red*/, "800080"/*purple*/, "000000"/*black*/]]
- },
-
- UIImages :
- {
- 'button.gif' : 'button.gif',
-// 'target_black.gif' : 'target_black.gif',
-// 'target_white.gif' : 'target_white.gif',
- 'background.png' : 'background.png'
-// 'slider.gif' : 'slider.gif',
-// 'hue.gif' : 'hue.gif'
- }
-});
-
-Object.extend(Prado.WebUI.TColorPicker.prototype,
-{
- initialize : function(options)
+ onInit : function(options)
{
var basics =
{
@@ -289,16 +263,16 @@ Object.extend(Prado.WebUI.TColorPicker.prototype,
this.element = null;
this.showing = false;
- options = Object.extend(basics, options);
+ options = jQuery.extend(basics, options);
this.options = options;
- this.input = $(options['ID']);
- this.button = $(options['ID']+'_button');
- this._buttonOnClick = this.buttonOnClick.bind(this);
+ this.input = jQuery('#'+options['ID']).get(0);
+ this.button = jQuery('#'+options['ID']+'_button').get(0);
+ this._buttonOnClick = jQuery.proxy(this.buttonOnClick, this);
if(options['ShowColorPicker'])
- Event.observe(this.button, "click", this._buttonOnClick);
- Event.observe(this.input, "change", this.updatePicker.bind(this));
-
- Prado.Registry.set(options.ID, this);
+ this.observe(this.button, "click", this._buttonOnClick);
+ this.observe(this.input, "change", jQuery.proxy(this.updatePicker, this));
+
+ Prado.Registry[options.ID] = this;
},
updatePicker : function(e)
@@ -317,15 +291,6 @@ Object.extend(Prado.WebUI.TColorPicker.prototype,
this.input.parentNode.appendChild(this.element);
this.element.style.display = "none";
- if(Prado.Browser().ie)
- {
- this.iePopUp = document.createElement('iframe');
- this.iePopUp.src = Prado.WebUI.TColorPicker.UIImages['button.gif'];
- this.iePopUp.style.position = "absolute"
- this.iePopUp.scrolling="no"
- this.iePopUp.frameBorder="0"
- this.input.parentNode.appendChild(this.iePopUp);
- }
if(mode == "Full")
this.initializeFullPicker();
}
@@ -336,20 +301,18 @@ Object.extend(Prado.WebUI.TColorPicker.prototype,
{
if(!this.showing)
{
- var pos = this.input.positionedOffset();
- pos[1] += this.input.offsetHeight;
+ var pos = jQuery(this.input).position();
+ pos['top'] += this.input.offsetHeight;
- this.element.style.top = (pos[1]-1) + "px";
- this.element.style.left = pos[0] + "px";
+ this.element.style.top = (pos['top']-1) + "px";
+ this.element.style.left = pos['left'] + "px";
this.element.style.display = "block";
- this.ieHack(type);
-
//observe for clicks on the document body
- this._documentClickEvent = this.hideOnClick.bindEvent(this, type);
- this._documentKeyDownEvent = this.keyPressed.bindEvent(this, type);
- Event.observe(document.body, "click", this._documentClickEvent);
- Event.observe(document,"keydown", this._documentKeyDownEvent);
+ this._documentClickEvent = jQuery.bind(this.hideOnClick, this, type);
+ this._documentKeyDownEvent = jQuery.bind(this.keyPressed, this, type);
+ this.observe(document.body, "click", this._documentClickEvent);
+ this.observe(document,"keydown", this._documentKeyDownEvent);
this.showing = true;
if(type == "Full")
@@ -366,17 +329,14 @@ Object.extend(Prado.WebUI.TColorPicker.prototype,
{
if(this.showing)
{
- if(this.iePopUp)
- this.iePopUp.style.display = "none";
-
this.element.style.display = "none";
this.showing = false;
- Event.stopObserving(document.body, "click", this._documentClickEvent);
- Event.stopObserving(document,"keydown", this._documentKeyDownEvent);
+ this.stopObserving(document.body, "click", this._documentClickEvent);
+ this.stopObserving(document,"keydown", this._documentKeyDownEvent);
if(this._observingMouseMove)
{
- Event.stopObserving(document.body, "mousemove", this._onMouseMove);
+ this.stopObserving(document.body, "mousemove", this._onMouseMove);
this._observingMouseMove = false;
}
}
@@ -384,14 +344,15 @@ Object.extend(Prado.WebUI.TColorPicker.prototype,
keyPressed : function(event,type)
{
- if(Event.keyCode(event) == Event.KEY_ESC)
+ // esc
+ if(event.keyCode == 27)
this.hide(event,type);
},
hideOnClick : function(ev)
{
if(!this.showing) return;
- var el = Event.element(ev);
+ var el = ev.target;
var within = false;
do
{ within = within || String(el.className).indexOf('FullColorPicker') > -1
@@ -404,53 +365,60 @@ Object.extend(Prado.WebUI.TColorPicker.prototype,
if(!within) this.hide(ev);
},
- ieHack : function()
- {
- // IE hack
- if(this.iePopUp)
- {
- this.iePopUp.style.display = "block";
- this.iePopUp.style.top = (this.element.offsetTop) + "px";
- this.iePopUp.style.left = (this.element.offsetLeft)+ "px";
- this.iePopUp.style.width = Math.abs(this.element.offsetWidth)+ "px";
- this.iePopUp.style.height = (this.element.offsetHeight + 1)+ "px";
- }
- },
-
getBasicPickerContainer : function(pickerID, palette)
{
- var table = TABLE({className:'basic_colors palette_'+palette},TBODY());
+ var div;
+ var table;
+ var tbody;
+ var tr;
+ var td;
+
+ // main div
+ div = document.createElement("div");
+ div.className = this.options['ClassName']+" BasicColorPicker";
+ div.id = pickerID+"_picker";
+
+ table = document.createElement("table");
+ table.className = 'basic_colors palette_'+palette;
+ div.appendChild(table);
+
+ tbody = document.createElement("tbody");
+ table.appendChild(tbody);
+
var colors = Prado.WebUI.TColorPicker.palettes[palette];
var pickerOnClick = this.cellOnClick.bind(this);
- colors.each(function(color)
+ var obj=this;
+ jQuery.each(colors, function(idx, color)
{
var row = document.createElement("tr");
- color.each(function(c)
+ jQuery.each(color, function(idx, c)
{
var td = document.createElement("td");
- var img = IMG({src:Prado.WebUI.TColorPicker.UIImages['button.gif'],width:16,height:16});
+ var img = document.createElement("img");
+ img.src=Prado.WebUI.TColorPicker.UIImages['button.gif'];
+ img.width=16;
+ img.height=16;
img.style.backgroundColor = "#"+c;
- Event.observe(img,"click", pickerOnClick);
- Event.observe(img,"mouseover", function(e)
+ obj.observe(img,"click", pickerOnClick);
+ obj.observe(img,"mouseover", function(e)
{
- Element.addClassName(Event.element(e), "pickerhover");
+ jQuery(e.target).addClass("pickerhover");
});
- Event.observe(img,"mouseout", function(e)
+ obj.observe(img,"mouseout", function(e)
{
- Element.removeClassName(Event.element(e), "pickerhover");
+ jQuery(e.target).removeClass("pickerhover");
});
td.appendChild(img);
row.appendChild(td);
});
table.childNodes[0].appendChild(row);
});
- return DIV({className:this.options['ClassName']+" BasicColorPicker",
- id:pickerID+"_picker"}, table);
+ return div;
},
cellOnClick : function(e)
{
- var el = Event.element(e);
+ var el = e.target;
if(el.tagName.toLowerCase() != "img")
return;
var color = Rico.Color.createColorFromBackground(el);
@@ -469,98 +437,148 @@ Object.extend(Prado.WebUI.TColorPicker.prototype,
getFullPickerContainer : function(pickerID)
{
- //create the 3 buttons
+ //create the buttons
+ var okBtn = document.createElement("input");
+ okBtn.className = 'button';
+ okBtn.type = 'button';
+ okBtn.value = this.options.OKButtonText;
+
+ var cancelBtn = document.createElement("input");
+ cancelBtn.className = 'button';
+ cancelBtn.type = 'button';
+ cancelBtn.value = this.options.CancelButtonText;
+
this.buttons =
{
- //Less : INPUT({value:'Less Colors', className:'button', type:'button'}),
- OK : INPUT({value:this.options.OKButtonText, className:'button', type:'button'}),
- Cancel : INPUT({value:this.options.CancelButtonText, className:'button', type:'button'})
+ OK : okBtn,
+ Cancel : cancelBtn
};
//create the 6 inputs
var inputs = {};
- ['H','S','V','R','G','B'].each(function(type)
+ jQuery.each(['H','S','V','R','G','B'], function(idx, type)
{
- inputs[type] = INPUT({type:'text',size:'3',maxlength:'3'});
+ inputs[type] = document.createElement("input");
+ inputs[type].type='text';
+ inputs[type].size='3';
+ inputs[type].maxlength='3';
});
//create the HEX input
- inputs['HEX'] = INPUT({className:'hex',type:'text',size:'6',maxlength:'6'});
+ inputs['HEX'] = document.createElement("input");
+ inputs['HEX'].className = 'hex';
+ inputs['HEX'].type='text';
+ inputs['HEX'].size='6';
+ inputs['HEX'].maxlength='6';
+
this.inputs = inputs;
var images = Prado.WebUI.TColorPicker.UIImages;
- this.inputs['currentColor'] = SPAN({className:'currentColor'});
- this.inputs['oldColor'] = SPAN({className:'oldColor'});
-
- var inputsTable =
- TABLE({className:'inputs'}, TBODY(null,
- TR(null,
- TD({className:'currentcolor',colSpan:2},
- this.inputs['currentColor'], this.inputs['oldColor'])),
-
- TR(null,
- TD(null,'H:'),
- TD(null,this.inputs['H'], '??')),
+ this.inputs['currentColor'] = document.createElement("span");
+ this.inputs['currentColor'].className='currentColor';
+ this.inputs['oldColor'] = document.createElement("span");
+ this.inputs['oldColor'].className='oldColor';
- TR(null,
- TD(null,'S:'),
- TD(null,this.inputs['S'], '%')),
+ var inputsTable = document.createElement("table");
+ inputsTable.className='inputs';
- TR(null,
- TD(null,'V:'),
- TD(null,this.inputs['V'], '%')),
+ var tbody = document.createElement("tbody");
+ inputsTable.appendChild(tbody);
- TR(null,
- TD({className:'gap'},'R:'),
- TD({className:'gap'},this.inputs['R'])),
+ var tr = document.createElement("tr");
+ tbody.appendChild(tr);
- TR(null,
- TD(null,'G:'),
- TD(null, this.inputs['G'])),
+ var td= document.createElement("td");
+ tr.appendChild(td);
+ td.className='currentcolor';
+ td.colSpan=2;
+ td.appendChild(this.inputs['currentColor']);
+ td.appendChild(this.inputs['oldColor']);
- TR(null,
- TD(null,'B:'),
- TD(null, this.inputs['B'])),
-
- TR(null,
- TD({className:'gap'},'#'),
- TD({className:'gap'},this.inputs['HEX']))
- ));
+ this.internalAddRow(tbody, 'H:', this.inputs['H'], '°');
+ this.internalAddRow(tbody, 'S:', this.inputs['S'], '%');
+ this.internalAddRow(tbody, 'V:', this.inputs['V'], '%');
+ this.internalAddRow(tbody, 'R:', this.inputs['R'], null, 'gap');
+ this.internalAddRow(tbody, 'G:', this.inputs['G']);
+ this.internalAddRow(tbody, 'B:', this.inputs['B']);
+ this.internalAddRow(tbody, '#', this.inputs['HEX'], null, 'gap');
var UIimages =
{
- selector : SPAN({className:'selector'}),
- background : SPAN({className:'colorpanel'}),
- slider : SPAN({className:'slider'}),
- hue : SPAN({className:'strip'})
+ selector : document.createElement("span"),
+ background : document.createElement("span"),
+ slider : document.createElement("span"),
+ hue : document.createElement("span")
}
- //png alpha channels for IE
- if(Prado.Browser().ie)
- {
- var filter = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader";
- UIimages['background'] = SPAN({className:'colorpanel',style:filter+"(src='"+images['background.png']+"' sizingMethod=scale);"})
- }
+ UIimages['selector'].className='selector';
+ UIimages['background'].className='colorpanel';
+ UIimages['slider'].className='slider';
+ UIimages['hue'].className='strip';
+
+ this.inputs = jQuery.extend(this.inputs, UIimages);
+
+ var pickerTable = document.createElement("table");
+ tbody=document.createElement("tbody");
+ pickerTable.appendChild(tbody);
+
+ var tr = document.createElement("tr");
+ tr.className='selection';
+ tbody.appendChild(tr);
+
+ var td= document.createElement("td");
+ tr.appendChild(td);
+ td.className='colors';
+ td.appendChild(UIimages['selector']);
+ td.appendChild(UIimages['background']);
+
+ var td= document.createElement("td");
+ tr.appendChild(td);
+ td.className='hue';
+ td.appendChild(UIimages['slider']);
+ td.appendChild(UIimages['hue']);
+
+ var td= document.createElement("td");
+ tr.appendChild(td);
+ td.className='inputs';
+ td.appendChild(inputsTable);
+
+ var tr = document.createElement("tr");
+ tr.className='options';
+ tbody.appendChild(tr);
+
+ var td= document.createElement("td");
+ tr.appendChild(td);
+ td.colSpan=3;
+ td.appendChild(this.buttons['OK']);
+ td.appendChild(this.buttons['Cancel']);
+
+ var div = document.createElement('div');
+ div.className=this.options['ClassName']+" FullColorPicker";
+ div.id=pickerID+"_picker";
+ div.appendChild(pickerTable);
+ return div;
+ },
- this.inputs = Object.extend(this.inputs, UIimages);
-
- var pickerTable =
- TABLE(null,TBODY(null,
- TR({className:'selection'},
- TD({className:'colors'},UIimages['selector'],UIimages['background']),
- TD({className:'hue'},UIimages['slider'],UIimages['hue']),
- TD({className:'inputs'}, inputsTable)
- ),
- TR({className:'options'},
- TD({colSpan:3},
- this.buttons['OK'],
- this.buttons['Cancel'])
- )
- ));
-
- return DIV({className:this.options['ClassName']+" FullColorPicker",
- id:pickerID+"_picker"},pickerTable);
+ internalAddRow : function(tbody, label1, object2, label2, className)
+ {
+ var tr = document.createElement("tr");
+ tbody.appendChild(tr);
+
+ var td= document.createElement("td");
+ if(className!==undefined && className!==null)
+ td.className=className;
+ tr.appendChild(td);
+ td.appendChild(document.createTextNode(label1));
+
+ var td= document.createElement("td");
+ if(className!==undefined && className!==null)
+ td.className=className;
+ tr.appendChild(td);
+ td.appendChild(object2);
+ if(label2!==undefined && label2!==null)
+ td.appendChild(document.createTextNode(label2));
},
initializeFullPicker : function()
@@ -572,8 +590,8 @@ Object.extend(Prado.WebUI.TColorPicker.prototype,
var i = 0;
for(var type in this.inputs)
{
- Event.observe(this.inputs[type], "change",
- this.onInputChanged.bindEvent(this,type));
+ this.observe(this.inputs[type], "change",
+ jQuery.proxy(this.onInputChanged,this,type));
i++;
if(i > 6) break;
@@ -587,24 +605,24 @@ Object.extend(Prado.WebUI.TColorPicker.prototype,
this._onMouseUp = this.onMouseUp.bind(this);
this._onMouseMove = this.onMouseMove.bind(this);
- Event.observe(this.inputs.background, "mousedown", this._onColorMouseDown);
- Event.observe(this.inputs.selector, "mousedown", this._onColorMouseDown);
- Event.observe(this.inputs.hue, "mousedown", this._onHueMouseDown);
- Event.observe(this.inputs.slider, "mousedown", this._onHueMouseDown);
+ this.observe(this.inputs.background, "mousedown", this._onColorMouseDown);
+ this.observe(this.inputs.selector, "mousedown", this._onColorMouseDown);
+ this.observe(this.inputs.hue, "mousedown", this._onHueMouseDown);
+ this.observe(this.inputs.slider, "mousedown", this._onHueMouseDown);
- Event.observe(document.body, "mouseup", this._onMouseUp);
+ this.observe(document.body, "mouseup", this._onMouseUp);
this.observeMouseMovement();
- Event.observe(this.buttons.Cancel, "click", this.hide.bindEvent(this,this.options['Mode']));
- Event.observe(this.buttons.OK, "click", this.onOKClicked.bind(this));
+ this.observe(this.buttons.Cancel, "click", jQuery.proxy(this.hide,this,this.options['Mode']));
+ this.observe(this.buttons.OK, "click", this.onOKClicked.bind(this));
},
observeMouseMovement : function()
{
if(!this._observingMouseMove)
{
- Event.observe(document.body, "mousemove", this._onMouseMove);
+ this.observe(document.body, "mousemove", this._onMouseMove);
this._observingMouseMove = true;
}
},
@@ -613,21 +631,21 @@ Object.extend(Prado.WebUI.TColorPicker.prototype,
{
this.isMouseDownOnColor = true;
this.onMouseMove(ev);
- Event.stop(ev);
+ ev.stopPropagation();
},
onHueMouseDown : function(ev)
{
this.isMouseDownOnHue = true;
this.onMouseMove(ev);
- Event.stop(ev);
+ ev.stopPropagation();
},
onMouseUp : function(ev)
{
this.isMouseDownOnColor = false;
this.isMouseDownOnHue = false;
- Event.stop(ev);
+ ev.stopPropagation();
},
onMouseMove : function(ev)
@@ -636,17 +654,17 @@ Object.extend(Prado.WebUI.TColorPicker.prototype,
this.changeSV(ev);
if(this.isMouseDownOnHue)
this.changeH(ev);
- Event.stop(ev);
+ ev.stopPropagation();
},
changeSV : function(ev)
{
- var px = Event.pointerX(ev);
- var py = Event.pointerY(ev);
- var pos = this.inputs.background.cumulativeOffset();
+ var px = ev.pageX;
+ var py = ev.pageY;
+ var pos = jQuery(this.inputs.background).offset();
- var x = this.truncate(px - pos[0],0,255);
- var y = this.truncate(py - pos[1],0,255);
+ var x = this.truncate(px - pos['left'],0,255);
+ var y = this.truncate(py - pos['top'],0,255);
var s = x/255;
@@ -673,9 +691,9 @@ Object.extend(Prado.WebUI.TColorPicker.prototype,
changeH : function(ev)
{
- var py = Event.pointerY(ev);
- var pos = this.inputs.background.cumulativeOffset();
- var y = this.truncate(py - pos[1],0,255);
+ var py = ev.pageY;
+ var pos = jQuery(this.inputs.background).offset();
+ var y = this.truncate(py - pos['top'],0,255);
var h = (255-y)/255;
var current_h = this.truncate(this.inputs.H.value,0,360);
@@ -750,8 +768,10 @@ Object.extend(Prado.WebUI.TColorPicker.prototype,
var images = Prado.WebUI.TColorPicker.UIImages;
- var changeCss = color.isBright() ? 'removeClassName' : 'addClassName';
- Element[changeCss](this.inputs.selector, 'target_white');
+ if(color.isBright())
+ jQuery(this.inputs.selector).removeClass('target_white');
+ else
+ jQuery(this.inputs.selector).addClass('target_white');
if(update)
this.updateSelectors(color);
@@ -778,3 +798,32 @@ Object.extend(Prado.WebUI.TColorPicker.prototype,
return value < min ? min : value > max ? max : value;
}
});
+
+jQuery.extend(Prado.WebUI.TColorPicker,
+{
+ palettes:
+ {
+ Small : [["fff", "fcc", "fc9", "ff9", "ffc", "9f9", "9ff", "cff", "ccf", "fcf"],
+ ["ccc", "f66", "f96", "ff6", "ff3", "6f9", "3ff", "6ff", "99f", "f9f"],
+ ["c0c0c0", "f00", "f90", "fc6", "ff0", "3f3", "6cc", "3cf", "66c", "c6c"],
+ ["999", "c00", "f60", "fc3", "fc0", "3c0", "0cc", "36f", "63f", "c3c"],
+ ["666", "900", "c60", "c93", "990", "090", "399", "33f", "60c", "939"],
+ ["333", "600", "930", "963", "660", "060", "366", "009", "339", "636"],
+ ["000", "300", "630", "633", "330", "030", "033", "006", "309", "303"]],
+
+ Tiny : [["ffffff"/*white*/, "00ff00"/*lime*/, "008000"/*green*/, "0000ff"/*blue*/],
+ ["c0c0c0"/*silver*/, "ffff00"/*yellow*/, "ff00ff"/*fuchsia*/, "000080"/*navy*/],
+ ["808080"/*gray*/, "ff0000"/*red*/, "800080"/*purple*/, "000000"/*black*/]]
+ },
+
+ UIImages :
+ {
+ 'button.gif' : 'button.gif',
+// 'target_black.gif' : 'target_black.gif',
+// 'target_white.gif' : 'target_white.gif',
+// 'background.png' : 'background.png'
+// 'slider.gif' : 'slider.gif',
+// 'hue.gif' : 'hue.gif'
+ }
+});
+
diff --git a/framework/Web/Javascripts/source/prado/controls/accordion.js b/framework/Web/Javascripts/source/prado/controls/accordion.js
index 90d01316..084aef7f 100644
--- a/framework/Web/Javascripts/source/prado/controls/accordion.js
+++ b/framework/Web/Javascripts/source/prado/controls/accordion.js
@@ -1,19 +1,20 @@
-/* Simple Accordion Script
+/* Simple Accordion Script
* Requires Prototype and Script.aculo.us Libraries
* By: Brian Crescimanno <brian.crescimanno@gmail.com>
* http://briancrescimanno.com
* Adapted to Prado & minor improvements: Gabor Berczi <gabor.berczi@devworx.hu>
+ * jQuery port by Bas Fabio <ctrlaltca@gmail.com>
* This work is licensed under the Creative Commons Attribution-Share Alike 3.0
* http://creativecommons.org/licenses/by-sa/3.0/us/
*/
-Prado.WebUI.TAccordion = Class.create(Prado.WebUI.Control,
+Prado.WebUI.TAccordion = jQuery.klass(Prado.WebUI.Control,
{
onInit : function(options)
{
- this.accordion = $(options.ID);
+ this.accordion = jQuery('#'+options.ID).get(0);
this.options = options;
- this.hiddenField = $(options.ID+'_1');
+ this.hiddenField = jQuery('#'+options.ID+'_1').get(0);
if (this.options.maxHeight)
{
@@ -29,15 +30,15 @@ Prado.WebUI.TAccordion = Class.create(Prado.WebUI.Control,
var i = 0;
for(var view in this.options.Views)
{
- var header = $(view+'_0');
+ var header = jQuery('#'+view+'_0').get(0);
if(header)
{
- this.observe(header, "click", this.elementClicked.bindEvent(this,view));
+ this.observe(header, "click", jQuery.proxy(this.elementClicked,this,view));
if(this.hiddenField.value == i)
{
this.currentView = view;
- if($(this.currentView).getHeight() != this.maxHeight)
- $(this.currentView).setStyle({height: this.maxHeight+"px"});
+ if(jQuery('#'+this.currentView).height() != this.maxHeight)
+ jQuery('#'+this.currentView).css({height: this.maxHeight+"px"});
}
}
i++;
@@ -48,38 +49,20 @@ Prado.WebUI.TAccordion = Class.create(Prado.WebUI.Control,
{
for(var viewID in this.options.Views)
{
- var view = $(viewID);
- if(view.getHeight() > this.maxHeight)
- this.maxHeight = view.getHeight();
+ var view = jQuery('#'+viewID);
+ if(view.height() > this.maxHeight)
+ this.maxHeight = view.height();
}
},
- elementClicked : function(event,viewID)
- {
- // dummy effect to force processing of click into the event queue
- // is not actually supposed to change the appearance of the accordion
- var obj = this;
- new Effect.Opacity(
- this.element,
- {
- from: 1.0, to: 1.0, duration: 0.0,
- queue: {
- position: 'end',
- scope: 'accordion'
- },
- afterFinish: function() { obj.processElementClick(event, viewID); }
- }
- );
- },
-
- processElementClick : function(event,viewID)
+ elementClicked : function(viewID, event)
{
var i = 0;
for(var index in this.options.Views)
{
- if ($(index))
+ if (jQuery('#'+index).get(0))
{
- var header = $(index+'_0');
+ var header = jQuery('#'+index+'_0').get(0);
if(index == viewID)
{
this.oldView = this.currentView;
@@ -96,75 +79,31 @@ Prado.WebUI.TAccordion = Class.create(Prado.WebUI.Control,
{
this.animate();
} else {
- $(this.currentView).setStyle({ height: this.maxHeight+"px" });
- $(this.currentView).show();
- $(this.oldView).hide();
-
- var oldHeader = $(this.oldView+'_0');
- var currentHeader = $(this.currentView+'_0');
- oldHeader.className=this.options.HeaderCssClass;
- currentHeader.className=this.options.ActiveHeaderCssClass;
+ jQuery('#'+this.currentView).css({ height: this.maxHeight+"px" });
+ jQuery('#'+this.currentView).show();
+ jQuery('#'+this.oldView).hide();
+
+ jQuery('#'+this.oldView+'_0').removeClass().addClass(this.options.HeaderCssClass);
+ jQuery('#'+this.currentView+'_0').removeClass().addClass(this.options.ActiveHeaderCssClass);
}
}
},
animate: function() {
- var effects = new Array();
- var options = {
- sync: true,
- queue: {
- position: 'end',
- scope: 'accordion'
- },
- scaleFrom: 0,
- scaleContent: false,
- transition: Effect.Transitions.sinoidal,
- scaleMode: {
- originalHeight: this.maxHeight,
- originalWidth: this.accordion.getWidth()
- },
- scaleX: false,
- scaleY: true
- };
-
- effects.push(new Effect.Scale(this.currentView, 100, options));
-
- options = {
- sync: true,
- queue: {
- position: 'end',
- scope: 'accordion'
- },
- scaleContent: false,
- transition: Effect.Transitions.sinoidal,
- scaleX: false,
- scaleY: true
- };
-
- effects.push(new Effect.Scale(this.oldView, 0, options));
-
- var oldHeader = $(this.oldView+'_0');
- var currentHeader = $(this.currentView+'_0');
-
- new Effect.Parallel(effects, {
- duration: this.options.Duration,
- fps: 35,
- queue: {
- position: 'end',
- scope: 'accordion'
- },
- beforeStart: function() {
- $(this.currentView).setStyle({ height: "0px" });
- $(this.currentView).show();
-
- oldHeader.className=this.options.HeaderCssClass;
- currentHeader.className=this.options.ActiveHeaderCssClass;
- }.bind(this),
- afterFinish: function() {
- $(this.oldView).hide();
- $(this.currentView).setStyle({ height: this.maxHeight+"px" });
- }.bind(this)
- });
+ jQuery('#'+this.oldView+'_0').removeClass().addClass(this.options.HeaderCssClass);
+ jQuery('#'+this.currentView+'_0').removeClass().addClass(this.options.ActiveHeaderCssClass);
+
+ jQuery('#'+this.oldView).animate(
+ {height: 0},
+ this.options.Duration,
+ function() {
+ jQuery(this).hide()
+ }
+ );
+ jQuery('#'+this.currentView).css({height: 0}).show().animate(
+ {height: this.maxHeight+'px'},
+ this.options.Duration
+ );
}
});
diff --git a/framework/Web/Javascripts/source/prado/controls/controls.js b/framework/Web/Javascripts/source/prado/controls/controls.js
index 8ea6afe3..3ff089c3 100644
--- a/framework/Web/Javascripts/source/prado/controls/controls.js
+++ b/framework/Web/Javascripts/source/prado/controls/controls.js
@@ -1,21 +1,21 @@
-Prado.WebUI = Class.create();
+Prado.WebUI = jQuery.klass();
-Prado.WebUI.Control = Class.create({
+Prado.WebUI.Control = jQuery.klass({
initialize : function(options)
{
this.registered = false;
this.ID = options.ID;
- this.element = $(this.ID);
+ this.element = jQuery("#" + this.ID).get(0);
this.observers = new Array();
this.intervals = new Array();
var e;
- if (e = Prado.Registry.get(this.ID))
- this.replace(e, options);
- else
+ if (jQuery.inArray(this.ID, Prado.Registry) == -1)
this.register(options);
+ else
+ this.replace(Prado.Registry[this.ID], options);
- if (this === Prado.Registry.get(this.ID))
+ if (this === Prado.Registry[this.ID])
{
this.registered = true;
if(this.onInit)
@@ -29,7 +29,7 @@ Prado.WebUI.Control = Class.create({
*/
register : function(options)
{
- return Prado.Registry.set(options.ID, this);
+ return Prado.Registry[options.ID] = this;
},
/**
@@ -38,8 +38,12 @@ Prado.WebUI.Control = Class.create({
deregister : function()
{
// extra check so we don't ever deregister another wrapper
- if (Prado.Registry.get(this.ID)===this)
- return Prado.Registry.unset(this.ID);
+ var value = Prado.Registry[this.ID];
+ if (value===this)
+ {
+ delete Prado.Registry[this.ID];
+ return value;
+ }
else
debugger; // invoke debugger - this should never happen
},
@@ -56,11 +60,11 @@ Prado.WebUI.Control = Class.create({
// from the old wrapper to this new one (which then could live on, while the old
// one could get destroyed), or to copy the new, changed options to the old wrapper,
// (which could then left intact to keep working, while this new wrapper could be
- // disposed of by exiting its initialization without installing any handlers or
+ // disposed of by exiting its initialization without installing any handlers or
// leaving any references to it)
//
- // for now this method is simply deinitializing and deregistering the old wrapper,
+ // for now this method is simply deinitializing and deregistering the old wrapper,
// and then registering the new wrapper for the control id
if (oldwrapper.deinitialize)
@@ -70,17 +74,17 @@ Prado.WebUI.Control = Class.create({
},
/**
- * Registers an event observer which will be automatically disposed of when the wrapper
+ * Registers an event observer which will be automatically disposed of when the wrapper
* is deregistered
* @param element DOM element reference or id to attach the event handler to
* @param string event name to observe
* @param handler event handler function
*/
- observe: function(element, eventName, handler)
+ observe: function(element, eventName, handler, options)
{
var e = { _element: element, _eventName: eventName, _handler: handler };
this.observers.push(e);
- return Event.observe(e._element,e._eventName,e._handler);
+ return jQuery(e._element).bind(e._eventName, options, e._handler);
},
/**
@@ -95,7 +99,7 @@ Prado.WebUI.Control = Class.create({
var e = { _element: element, _eventName: eventName, _handler: handler };
var idx = -1;
for(var i=0;i<this.observers.length;i++)
- {
+ {
var o = this.observers[i];
if ((o._element===element) && (o._eventName===eventName) && (o._handler===handler))
{
@@ -105,7 +109,7 @@ Prado.WebUI.Control = Class.create({
}
return idx;
},
-
+
/**
* Degisters an event observer from the list of automatically disposed handlers
@@ -117,11 +121,11 @@ Prado.WebUI.Control = Class.create({
{
var idx = this.findObserver(element,eventName,handler);
if (idx!=-1)
- this.observers = this.observers.without(this.observers[idx]);
+ this.observers.splice(idx, 1);
else
debugger; // shouldn't happen
- return Event.stopObserving(element,eventName,handler);
+ return jQuery(element).unbind(eventName, handler);
},
/**
@@ -129,11 +133,11 @@ Prado.WebUI.Control = Class.create({
* wrapper hasn't been destroyed in the meantime
* @param code function or code snippet to execute
* @param int number of milliseconds to wait before executing
- * @return int unique ID that can be used to cancel the scheduled execution
+ * @return int unique ID that can be used to cancel the scheduled execution
*/
setTimeout: function(func, delay)
{
- if (!Object.isFunction(func))
+ if (!jQuery.isFunction(func))
{
var expr = func;
func = function() { return eval(expr); }
@@ -164,7 +168,7 @@ Prado.WebUI.Control = Class.create({
*/
setInterval: function(func, delay)
{
- if (!Object.isFunction(func)) func = function() { eval(func); };
+ if (!jQuery.isFunction(func)) func = function() { eval(func); };
var obj = this;
var h = window.setInterval(function() {
if (!obj.isLingering())
@@ -181,7 +185,7 @@ Prado.WebUI.Control = Class.create({
clearInterval: function(intervalid)
{
window.clearInterval(intervalid);
- this.intervals = this.intervals.without(intervalid);
+ this.intervals.splice( jQuery.inArray(intervalid, this.intervals), 1 );
},
/**
@@ -205,14 +209,14 @@ Prado.WebUI.Control = Class.create({
this.onDone();
// automatically stop all intervals
- while (this.intervals.length>0)
+ while (this.intervals.length>0)
window.clearInterval(this.intervals.pop());
// automatically deregister all installed observers
- while (this.observers.length>0)
+ while (this.observers.length>0)
{
var e = this.observers.pop();
- Event.stopObserving(e._element,e._eventName,e._handler);
+ jQuery(e._element).unbind(e._eventName, e._handler);
}
}
else
@@ -225,13 +229,13 @@ Prado.WebUI.Control = Class.create({
});
-Prado.WebUI.PostBackControl = Class.create(Prado.WebUI.Control, {
+Prado.WebUI.PostBackControl = jQuery.klass(Prado.WebUI.Control, {
onInit : function(options)
{
this._elementOnClick = null;
- if (!this.element)
+ if (!this.element)
debugger; // element not found
else
{
@@ -241,13 +245,13 @@ Prado.WebUI.PostBackControl = Class.create(Prado.WebUI.Control, {
this._elementOnClick = this.element.onclick.bind(this.element);
this.element.onclick = null;
}
- this.observe(this.element, "click", this.elementClicked.bindEvent(this,options));
+ this.observe(this.element, "click", jQuery.proxy(this.elementClicked,this,options));
}
},
- elementClicked : function(event, options)
+ elementClicked : function(options, event)
{
- var src = Event.element(event);
+ var src = event.target;
var doPostBack = true;
var onclicked = null;
@@ -257,40 +261,40 @@ Prado.WebUI.PostBackControl = Class.create(Prado.WebUI.Control, {
if(typeof(onclicked) == "boolean")
doPostBack = onclicked;
}
- if(doPostBack && !Prado.Element.isDisabled(src))
- this.onPostBack(event,options);
+ if(doPostBack && !jQuery(src).is(':disabled'))
+ this.onPostBack(options,event);
if(typeof(onclicked) == "boolean" && !onclicked)
- Event.stop(event);
+ event.stopPropagation();
},
- onPostBack : function(event, options)
+ onPostBack : function(options, event)
{
- Prado.PostBack(event,options);
+ new Prado.PostBack(options, event);
}
});
-Prado.WebUI.TButton = Class.create(Prado.WebUI.PostBackControl);
-Prado.WebUI.TLinkButton = Class.create(Prado.WebUI.PostBackControl);
-Prado.WebUI.TCheckBox = Class.create(Prado.WebUI.PostBackControl);
-Prado.WebUI.TBulletedList = Class.create(Prado.WebUI.PostBackControl);
-Prado.WebUI.TImageMap = Class.create(Prado.WebUI.PostBackControl);
+Prado.WebUI.TButton = jQuery.klass(Prado.WebUI.PostBackControl);
+Prado.WebUI.TLinkButton = jQuery.klass(Prado.WebUI.PostBackControl);
+Prado.WebUI.TCheckBox = jQuery.klass(Prado.WebUI.PostBackControl);
+Prado.WebUI.TBulletedList = jQuery.klass(Prado.WebUI.PostBackControl);
+Prado.WebUI.TImageMap = jQuery.klass(Prado.WebUI.PostBackControl);
/**
* TImageButton client-side behaviour. With validation, Firefox needs
* to capture the x,y point of the clicked image in hidden form fields.
*/
-Prado.WebUI.TImageButton = Class.create(Prado.WebUI.PostBackControl,
+Prado.WebUI.TImageButton = jQuery.klass(Prado.WebUI.PostBackControl,
{
/**
* Override parent onPostBack function, tried to add hidden forms
* inputs to capture x,y clicked point.
*/
- onPostBack : function(event, options)
+ onPostBack : function(options, event)
{
- this.addXYInput(event,options);
- Prado.PostBack(event, options);
- this.removeXYInput(event,options);
+ this.addXYInput(options, event);
+ new Prado.PostBack(options, event);
+ this.removeXYInput(options, event);
},
/**
@@ -298,35 +302,32 @@ Prado.WebUI.TImageButton = Class.create(Prado.WebUI.PostBackControl,
* @param event DOM click event.
* @param array image button options.
*/
- addXYInput : function(event,options)
+ addXYInput : function(options, event)
{
- var imagePos = this.element.cumulativeOffset();
+ var imagePos = jQuery(this.element).offset();
var clickedPos = [event.clientX, event.clientY];
- var x = clickedPos[0]-imagePos[0]+1;
- var y = clickedPos[1]-imagePos[1]+1;
+ var x = clickedPos[0]-imagePos['left']+1;
+ var y = clickedPos[1]-imagePos['top']+1;
x = x < 0 ? 0 : x;
y = y < 0 ? 0 : y;
- var id = options['EventTarget'];
- var x_input = $(id+"_x");
- var y_input = $(id+"_y");
- if(x_input)
- {
- x_input.value = x;
- }
- else
- {
- x_input = INPUT({type:'hidden',name:id+'_x','id':id+'_x',value:x});
- this.element.parentNode.appendChild(x_input);
- }
- if(y_input)
- {
- y_input.value = y;
- }
- else
- {
- y_input = INPUT({type:'hidden',name:id+'_y','id':id+'_y',value:y});
- this.element.parentNode.appendChild(y_input);
- }
+ var id = this.element.id;
+ var name = options['EventTarget'];
+ var form = this.element.form;
+
+ var input=null;
+ input = document.createElement("input");
+ input.setAttribute("type", "hidden");
+ input.setAttribute("id", id+"_x");
+ input.setAttribute("name", name+"_x");
+ input.setAttribute("value", x);
+ form.appendChild(input);
+
+ input = document.createElement("input");
+ input.setAttribute("type", "hidden");
+ input.setAttribute("id", id+"_y");
+ input.setAttribute("name", name+"_y");
+ input.setAttribute("value", y);
+ form.appendChild(input);
},
/**
@@ -334,11 +335,11 @@ Prado.WebUI.TImageButton = Class.create(Prado.WebUI.PostBackControl,
* @param event DOM click event.
* @param array image button options.
*/
- removeXYInput : function(event,options)
+ removeXYInput : function(options, event)
{
- var id = options['EventTarget'];
- this.element.parentNode.removeChild($(id+"_x"));
- this.element.parentNode.removeChild($(id+"_y"));
+ var id = this.element.id;
+ jQuery('#'+id+'_x').remove();
+ jQuery('#'+id+'_y').remove();
}
});
@@ -346,11 +347,11 @@ Prado.WebUI.TImageButton = Class.create(Prado.WebUI.PostBackControl,
/**
* Radio button, only initialize if not already checked.
*/
-Prado.WebUI.TRadioButton = Class.create(Prado.WebUI.PostBackControl,
+Prado.WebUI.TRadioButton = jQuery.klass(Prado.WebUI.PostBackControl,
{
initialize : function($super, options)
{
- this.element = $(options['ID']);
+ this.element = jQuery("#" + options['ID']).get(0);
if(this.element)
{
if(!this.element.checked)
@@ -360,7 +361,7 @@ Prado.WebUI.TRadioButton = Class.create(Prado.WebUI.PostBackControl,
});
-Prado.WebUI.TTextBox = Class.create(Prado.WebUI.PostBackControl,
+Prado.WebUI.TTextBox = jQuery.klass(Prado.WebUI.PostBackControl,
{
onInit : function(options)
{
@@ -368,27 +369,32 @@ Prado.WebUI.TTextBox = Class.create(Prado.WebUI.PostBackControl,
if(this.options['TextMode'] != 'MultiLine')
this.observe(this.element, "keydown", this.handleReturnKey.bind(this));
if(this.options['AutoPostBack']==true)
- this.observe(this.element, "change", Prado.PostBack.bindEvent(this,options));
+ this.observe(this.element, "change", jQuery.proxy(this.doPostback,this,options));
+ },
+
+ doPostback : function(options, event)
+ {
+ new Prado.PostBack(options, event);
},
handleReturnKey : function(e)
{
- if(Event.keyCode(e) == Event.KEY_RETURN)
+ if(e.keyCode == 13) // KEY_RETURN
{
- var target = Event.element(e);
+ var target = e.target;
if(target)
{
if(this.options['AutoPostBack']==true)
{
- Event.fireEvent(target, "change");
- Event.stop(e);
+ jQuery(target).trigger( "change" );
+ e.stopPropagation();
}
else
{
if(this.options['CausesValidation'] && typeof(Prado.Validation) != "undefined")
{
- if(!Prado.Validation.validate(this.options['FormID'], this.options['ValidationGroup'], $(this.options['ID'])))
- return Event.stop(e);
+ if(!Prado.Validation.validate(this.options['FormID'], this.options['ValidationGroup'], jQuery(this.options['ID'])))
+ return e.stopPropagation();
}
}
}
@@ -396,46 +402,51 @@ Prado.WebUI.TTextBox = Class.create(Prado.WebUI.PostBackControl,
}
});
-Prado.WebUI.TListControl = Class.create(Prado.WebUI.PostBackControl,
+Prado.WebUI.TListControl = jQuery.klass(Prado.WebUI.PostBackControl,
{
onInit : function(options)
{
- this.observe(this.element, "change", Prado.PostBack.bindEvent(this,options));
+ this.observe(this.element, "change", jQuery.proxy(this.doPostback,this,options));
+ },
+
+ doPostback : function(options, event)
+ {
+ new Prado.PostBack(options, event);
}
});
-Prado.WebUI.TListBox = Class.create(Prado.WebUI.TListControl);
-Prado.WebUI.TDropDownList = Class.create(Prado.WebUI.TListControl);
+Prado.WebUI.TListBox = jQuery.klass(Prado.WebUI.TListControl);
+Prado.WebUI.TDropDownList = jQuery.klass(Prado.WebUI.TListControl);
-Prado.WebUI.DefaultButton = Class.create(Prado.WebUI.Control,
+Prado.WebUI.DefaultButton = jQuery.klass(Prado.WebUI.Control,
{
onInit : function(options)
{
this.options = options;
- this.observe(options['Panel'], 'keydown', this.triggerEvent.bindEvent(this));
+ this.observe(jQuery('#'+options['Panel']), "keydown", jQuery.proxy(this.triggerEvent,this));
},
- triggerEvent : function(ev, target)
+ triggerEvent : function(ev)
{
- var enterPressed = Event.keyCode(ev) == Event.KEY_RETURN;
- var isTextArea = Event.element(ev).tagName.toLowerCase() == "textarea";
- var isHyperLink = Event.element(ev).tagName.toLowerCase() == "a" && Event.element(ev).hasAttribute("href");
- var isValidButton = Event.element(ev).tagName.toLowerCase() == "input" && Event.element(ev).type.toLowerCase() == "submit";
-
+ var enterPressed = ev.keyCode == 13;
+ var isTextArea = ev.target.tagName.toLowerCase() == "textarea";
+ var isHyperLink = ev.target.tagName.toLowerCase() == "a" && ev.target.hasAttribute("href");
+ var isValidButton = ev.target.tagName.toLowerCase() == "input" && ev.target.type.toLowerCase() == "submit";
+
if(enterPressed && !isTextArea && !isValidButton && !isHyperLink)
{
- var defaultButton = $(this.options['Target']);
+ var defaultButton = jQuery('#'+this.options['Target']);
if(defaultButton)
{
this.triggered = true;
- Event.fireEvent(defaultButton, this.options['Event']);
- Event.stop(ev);
+ defaultButton.trigger(this.options['Event']);
+ ev.preventDefault();
}
}
}
});
-Prado.WebUI.TTextHighlighter = Class.create();
+Prado.WebUI.TTextHighlighter = jQuery.klass();
Prado.WebUI.TTextHighlighter.prototype =
{
initialize:function(id)
@@ -453,7 +464,7 @@ Prado.WebUI.TTextHighlighter.prototype =
}
};
-Object.extend(Prado.WebUI.TTextHighlighter,
+jQuery.klass(Prado.WebUI.TTextHighlighter,
{
copy : function(obj)
{
@@ -483,35 +494,33 @@ Object.extend(Prado.WebUI.TTextHighlighter,
});
-Prado.WebUI.TCheckBoxList = Base.extend(
+Prado.WebUI.TCheckBoxList = jQuery.klass(Prado.WebUI.Control,
{
- constructor : function(options)
+ onInit : function(options)
{
- Prado.Registry.set(options.ListID, this);
for(var i = 0; i<options.ItemCount; i++)
{
- var checkBoxOptions = Object.extend(
+ var checkBoxOptions = jQuery.extend({}, options,
{
- ID : options.ListID+"_c"+i,
+ ID : options.ID+"_c"+i,
EventTarget : options.ListName+"$c"+i
- }, options);
+ });
new Prado.WebUI.TCheckBox(checkBoxOptions);
}
}
});
-Prado.WebUI.TRadioButtonList = Base.extend(
+Prado.WebUI.TRadioButtonList = jQuery.klass(Prado.WebUI.Control,
{
- constructor : function(options)
+ onInit : function(options)
{
- Prado.Registry.set(options.ListID, this);
for(var i = 0; i<options.ItemCount; i++)
{
- var radioButtonOptions = Object.extend(
+ var radioButtonOptions = jQuery.extend({}, options,
{
- ID : options.ListID+"_c"+i,
+ ID : options.ID+"_c"+i,
EventTarget : options.ListName+"$c"+i
- }, options);
+ });
new Prado.WebUI.TRadioButton(radioButtonOptions);
}
}
diff --git a/framework/Web/Javascripts/source/prado/controls/htmlarea.js b/framework/Web/Javascripts/source/prado/controls/htmlarea.js
index 5cba4f6c..7bf820ab 100644
--- a/framework/Web/Javascripts/source/prado/controls/htmlarea.js
+++ b/framework/Web/Javascripts/source/prado/controls/htmlarea.js
@@ -1,6 +1,6 @@
/*
- *
+ *
* HtmlArea (tinyMCE) wrapper
*
* @author Gabor Berczi <gabor.berczi@devworx.hu>
@@ -8,7 +8,7 @@
*/
-Prado.WebUI.THtmlArea = Class.create(Prado.WebUI.Control,
+Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control,
{
initialize: function($super, options)
{
@@ -20,19 +20,13 @@ Prado.WebUI.THtmlArea = Class.create(Prado.WebUI.Control,
{
this.options = options;
- var obj = this;
- this.ajaxresponder = {
- onComplete : function(request)
- {
- if(request && (request instanceof Prado.AjaxRequest))
- obj.checkInstance();
- }
- };
this.registerAjaxHook();
this.registerInstance();
},
-
+
+
+
registerInstance: function()
{
if (typeof tinyMCE_GZ == 'undefined')
@@ -44,7 +38,7 @@ Prado.WebUI.THtmlArea = Class.create(Prado.WebUI.Control,
{
// we're in a callback
// try it again in some time, as tinyMCE is most likely still loading
- this.setTimeout(this.registerInstance.bind(this), 50);
+ this.setTimeout(this.registerInstance.bind(this), 50);
return;
}
throw "TinyMCE libraries must be loaded first";
@@ -68,13 +62,13 @@ Prado.WebUI.THtmlArea = Class.create(Prado.WebUI.Control,
}
}
},
-
+
compressedScriptsLoaded: function()
{
Prado.WebUI.THtmlArea.tinyMCELoadState = 255;
var wrapper;
while(Prado.WebUI.THtmlArea.pendingRegistrations.length>0)
- if (wrapper = Prado.Registry.get(Prado.WebUI.THtmlArea.pendingRegistrations.pop()))
+ if (wrapper = Prado.Registry[Prado.WebUI.THtmlArea.pendingRegistrations.pop()])
wrapper.initInstance();
},
@@ -103,17 +97,19 @@ Prado.WebUI.THtmlArea = Class.create(Prado.WebUI.Control,
registerAjaxHook: function()
{
- if (typeof(Ajax)!="undefined")
- if (typeof(Ajax.Responders)!="undefined")
- Ajax.Responders.register(this.ajaxresponder);
+ jQuery(document).on('ajaxComplete', this.ajaxresponder.bind(this));
},
deRegisterAjaxHook: function()
{
- if (typeof(Ajax)!="undefined")
- if (typeof(Ajax.Responders)!="undefined")
- Ajax.Responders.unregister(this.ajaxresponder);
+ jQuery(document).off('ajaxComplete', this.ajaxresponder.bind(this));
+ },
+
+ ajaxresponder: function(request)
+ {
+ if(request && (request instanceof Prado.AjaxRequest))
+ obj.checkInstance();
},
onDone: function()
@@ -123,14 +119,14 @@ Prado.WebUI.THtmlArea = Class.create(Prado.WebUI.Control,
if (prev)
try
{
- tinyMCE.execCommand('mceFocus', false, this.ID);
+ tinyMCE.execCommand('mceFocus', false, this.ID);
// when removed, tinyMCE restores its content to the textarea. If the textarea content has been
// updated in this same callback, it will be overwritten with the old content. Workaround this.
- var curtext = $(this.ID).value;
+ var curtext = jQuery('#'+this.ID).get(0).value;
tinyMCE.execCommand('mceRemoveControl', false, this.ID);
- $(this.ID).value = curtext;
+ jQuery('#'+this.ID).get(0).value = curtext;
}
- catch (e)
+ catch (e)
{
// suppress error here in case editor can't be properly removed
// (happens when <textarea> has been removed from DOM tree without deinitialzing the tinyMCE editor first)
@@ -143,7 +139,7 @@ Prado.WebUI.THtmlArea = Class.create(Prado.WebUI.Control,
}
});
-Object.extend(Prado.WebUI.THtmlArea,
+jQuery.extend(Prado.WebUI.THtmlArea,
{
pendingRegistrations : [],
tinyMCELoadState : 0
diff --git a/framework/Web/Javascripts/source/prado/controls/htmlarea4.js b/framework/Web/Javascripts/source/prado/controls/htmlarea4.js
index cd3c6a0e..64a78176 100644
--- a/framework/Web/Javascripts/source/prado/controls/htmlarea4.js
+++ b/framework/Web/Javascripts/source/prado/controls/htmlarea4.js
@@ -1,6 +1,6 @@
/*
- *
+ *
* HtmlArea (tinyMCE 4) wrapper
*
* @author Gabor Berczi <gabor.berczi@devworx.hu>
@@ -8,7 +8,7 @@
*/
-Prado.WebUI.THtmlArea4 = Class.create(Prado.WebUI.Control,
+Prado.WebUI.THtmlArea4 = jQuery.klass(Prado.WebUI.Control,
{
initialize: function($super, options)
{
@@ -39,14 +39,14 @@ Prado.WebUI.THtmlArea4 = Class.create(Prado.WebUI.Control,
if (prev)
try
{
- tinyMCE.execCommand('mceFocus', false, this.ID);
+ tinyMCE.execCommand('mceFocus', false, this.ID);
// when removed, tinyMCE restores its content to the textarea. If the textarea content has been
// updated in this same callback, it will be overwritten with the old content. Workaround this.
- // var curtext = $(this.ID).html();
+ // var curtext = jQuery(this.ID).html();
tinyMCE.execCommand('mceRemoveControl', false, this.ID);
- // $(this.ID).html(curtext);
+ // jQuery(this.ID).html(curtext);
}
- catch (e)
+ catch (e)
{
// suppress error here in case editor can't be properly removed
// (happens when <textarea> has been removed from DOM tree without deinitialzing the tinyMCE editor first)
diff --git a/framework/Web/Javascripts/source/prado/controls/keyboard.js b/framework/Web/Javascripts/source/prado/controls/keyboard.js
index 25541074..768b8d8d 100644
--- a/framework/Web/Javascripts/source/prado/controls/keyboard.js
+++ b/framework/Web/Javascripts/source/prado/controls/keyboard.js
@@ -1,4 +1,4 @@
-Prado.WebUI.TKeyboard = Class.create(Prado.WebUI.Control,
+Prado.WebUI.TKeyboard = jQuery.klass(Prado.WebUI.Control,
{
onInit : function(options)
{
diff --git a/framework/Web/Javascripts/source/prado/controls/slider.js b/framework/Web/Javascripts/source/prado/controls/slider.js
index 2e26ee51..1f1507e9 100644
--- a/framework/Web/Javascripts/source/prado/controls/slider.js
+++ b/framework/Web/Javascripts/source/prado/controls/slider.js
@@ -3,96 +3,110 @@
* This clas is mainly based on Scriptaculous Slider control (http://script.aculo.us)
*/
-Prado.WebUI.TSlider = Class.extend(Prado.WebUI.PostBackControl,
+Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl,
{
onInit : function (options)
{
var slider = this;
this.options=options || {};
- this.track = $(options.ID+'_track');
- this.handle =$(options.ID+'_handle');
- this.progress = $(options.ID+'_progress');
+ this.track = jQuery('#'+options.ID+'_track').get(0);
+ this.handle =jQuery('#'+options.ID+'_handle').get(0);
+ this.progress = jQuery('#'+options.ID+'_progress').get(0);
this.axis = this.options.axis || 'horizontal';
- this.range = this.options.range || $R(0,1);
+ this.range = this.options.range || [0, 1];
this.value = 0;
- this.maximum = this.options.maximum || this.range.end;
- this.minimum = this.options.minimum || this.range.start;
- this.hiddenField=$(this.options.ID+'_1');
-
- // Will be used to align the handle onto the track, if necessary
- this.alignX = parseInt(this.options.alignX || - this.track.offsetLeft);
- this.alignY = parseInt(this.options.alignY || - this.track.offsetTop);
-
- this.trackLength = this.maximumOffset() - this.minimumOffset();
- this.handleLength = this.isVertical() ?
- (this.handle.offsetHeight != 0 ?
- this.handle.offsetHeight : this.handles.style.height.replace(/px$/,"")) :
- (this.handle.offsetWidth != 0 ? this.handle.offsetWidth :
- this.handle.style.width.replace(/px$/,""));
-
+ this.maximum = this.options.maximum || this.range[1];
+ this.minimum = this.options.minimum || this.range[0];
+ this.hiddenField=jQuery('#'+this.options.ID+'_1').get(0);
+ this.trackInitialized=false;
+
+ this.initializeTrack();
+
this.active = false;
this.dragging = false;
this.disabled = false;
if(this.options.disabled) this.setDisabled();
-
+
// Allowed values array
- this.allowedValues = this.options.values ? this.options.values.sortBy(Prototype.K) : false;
+ this.allowedValues = this.options.values ? this.options.values.sort() : false;
if(this.allowedValues) {
- this.minimum = this.allowedValues.min();
- this.maximum = this.allowedValues.max();
+ this.minimum = Math.min.apply( Math, this.allowedValues );
+ this.maximum = Math.max.apply( Math, this.allowedValues );
}
- this.eventMouseDown = this.startDrag.bindAsEventListener(this);
- this.eventMouseUp = this.endDrag.bindAsEventListener(this);
- this.eventMouseMove = this.update.bindAsEventListener(this);
+ this.eventMouseDown = this.startDrag.bind(this);
+ this.eventMouseUp = this.endDrag.bind(this);
+ this.eventMouseMove = this.update.bind(this);
// Initialize handle
this.setValue(parseFloat(slider.options.sliderValue));
- Element.makePositioned(this.handle); // fix IE
this.observe (this.handle, "mousedown", this.eventMouseDown);
-
+
this.observe (this.track, "mousedown", this.eventMouseDown);
if (this.progress) this.observe (this.progress, "mousedown", this.eventMouseDown);
-
+
this.observe (document, "mouseup", this.eventMouseUp);
this.observe (document, "mousemove", this.eventMouseMove);
-
+
this.initialized=true;
-
-
+
if(this.options['AutoPostBack']==true)
- this.observe(this.hiddenField, "change", Prado.PostBack.bindEvent(this,options));
-
+ this.observe(this.hiddenField, "change", jQuery.proxy(this.doPostback,this,options));
+ },
+
+ initializeTrack : function()
+ {
+ if(this.trackInitialized || !$(this.track).is(":visible"))
+ return;
+
+ // Will be used to align the handle onto the track, if necessary
+ this.alignX = parseInt(this.options.alignX || - this.track.offsetLeft);
+ this.alignY = parseInt(this.options.alignY || - this.track.offsetTop);
+
+ this.trackLength = this.maximumOffset() - this.minimumOffset();
+ this.handleLength = this.isVertical() ?
+ (this.handle.offsetHeight != 0 ?
+ this.handle.offsetHeight : this.handles.style.height.replace(/px$/,"")) :
+ (this.handle.offsetWidth != 0 ? this.handle.offsetWidth :
+ this.handle.style.width.replace(/px$/,""));
+ this.trackInitialized=true;
+ },
+
+ doPostback : function(options, event)
+ {
+ new Prado.PostBack(options, event);
},
-
+
setDisabled: function(){
this.disabled = true;
},
setEnabled: function(){
this.disabled = false;
- },
+ },
getNearestValue: function(value){
if(this.allowedValues){
- if(value >= this.allowedValues.max()) return(this.allowedValues.max());
- if(value <= this.allowedValues.min()) return(this.allowedValues.min());
-
+ var max = Math.max.apply( Math, this.allowedValues );
+ var min = Math.min.apply( Math, this.allowedValues );
+ if(value >= max) return(max);
+ if(value <= min) return(min);
+
var offset = Math.abs(this.allowedValues[0] - value);
var newValue = this.allowedValues[0];
- this.allowedValues.each( function(v) {
+ jQuery.each(this.allowedValues, function(idx, v) {
var currentOffset = Math.abs(v - value);
if(currentOffset <= offset){
newValue = v;
offset = currentOffset;
- }
+ }
});
return newValue;
}
- if(value > this.range.end) return this.range.end;
- if(value < this.range.start) return this.range.start;
+ if(value > this.range[1]) return this.range[1];
+ if(value < this.range[0]) return this.range[0];
return value;
},
-
+
setValue: function(sliderValue){
if(!this.active) {
this.updateStyles();
@@ -102,124 +116,119 @@ Prado.WebUI.TSlider = Class.extend(Prado.WebUI.PostBackControl,
this.handle.style[this.isVertical() ? 'top' : 'left'] = pixelValue;
if (this.progress)
this.progress.style[this.isVertical() ? 'height' : 'width'] = pixelValue;
-
+
//this.drawSpans();
if(!this.dragging || !this.event) this.updateFinished();
},
-
+
setValueBy: function(delta) {
this.setValue(this.value + delta);
},
-
+
translateToPx: function(value) {
return Math.round(
- ((this.trackLength-this.handleLength)/(this.range.end-this.range.start)) * (value - this.range.start)) + "px";
+ ((this.trackLength-this.handleLength)/(this.range[1]-this.range[0])) * (value - this.range[0])) + "px";
},
-
+
translateToValue: function(offset) {
- return ((offset/(this.trackLength-this.handleLength) * (this.range.end-this.range.start)) + this.range.start);
- },
-
- getRange: function(range) {
- var v = this.values.sortBy(Prototype.K);
- range = range || 0;
- return $R(v[range],v[range+1]);
+ return ((offset/(this.trackLength-this.handleLength) * (this.range[1]-this.range[0])) + this.range[0]);
},
-
+
minimumOffset: function(){
return(this.isVertical() ? this.alignY : this.alignX);
},
-
+
maximumOffset: function(){
- return(this.isVertical() ?
+ return(this.isVertical() ?
(this.track.offsetHeight != 0 ? this.track.offsetHeight :
- this.track.style.height.replace(/px$/,"")) - this.alignY :
- (this.track.offsetWidth != 0 ? this.track.offsetWidth :
+ this.track.style.height.replace(/px$/,"")) - this.alignY :
+ (this.track.offsetWidth != 0 ? this.track.offsetWidth :
this.track.style.width.replace(/px$/,"")) - this.alignX);
},
-
+
isVertical: function(){
return (this.axis == 'vertical');
},
-
+
updateStyles: function() {
- if (this.active)
- Element.addClassName(this.handle, 'selected');
+ if (this.active)
+ jQuery(this.handle).addClass('selected');
else
- Element.removeClassName(this.handle, 'selected');
+ jQuery(this.handle).removeClass('selected');
},
-
+
startDrag: function(event) {
- if(Event.isLeftClick(event)) {
+ if (event.which === 1) {
+ this.initializeTrack();
+ // left click
if(!this.disabled){
this.active = true;
- var handle = Event.element(event);
- var pointer = [Event.pointerX(event), Event.pointerY(event)];
+ var handle = event.target;
+ var pointer = [event.pageX, event.pageY];
var track = handle;
if(track==this.track) {
- var offsets = this.track.cumulativeOffset();
+ var offsets = jQuery(this.track).offset();
this.event = event;
- this.setValue(this.translateToValue(
- (this.isVertical() ? pointer[1]-offsets[1] : pointer[0]-offsets[0])-(this.handleLength/2)
+ this.setValue(this.translateToValue(
+ (this.isVertical() ? pointer[1]-offsets['top'] : pointer[0]-offsets['left'])-(this.handleLength/2)
));
- var offsets = this.handle.cumulativeOffset();
- this.offsetX = (pointer[0] - offsets[0]);
- this.offsetY = (pointer[1] - offsets[1]);
+ var offsets = jQuery(this.handle).offset();
+ this.offsetX = (pointer[0] - offsets['left']);
+ this.offsetY = (pointer[1] - offsets['top']);
} else {
this.updateStyles();
- var offsets = this.handle.cumulativeOffset();
- this.offsetX = (pointer[0] - offsets[0]);
- this.offsetY = (pointer[1] - offsets[1]);
+ var offsets = jQuery(this.handle).offset();
+ this.offsetX = (pointer[0] - offsets['left']);
+ this.offsetY = (pointer[1] - offsets['top']);
}
}
- Event.stop(event);
+ event.stopPropagation();
}
},
-
+
update: function(event) {
if(this.active) {
if(!this.dragging) this.dragging = true;
this.draw(event);
- if(Prototype.Browser.WebKit) window.scrollBy(0,0);
- Event.stop(event);
+ event.stopPropagation();
}
},
-
+
draw: function(event) {
- var pointer = [Event.pointerX(event), Event.pointerY(event)];
- var offsets = this.track.cumulativeOffset();
- pointer[0] -= this.offsetX + offsets[0];
- pointer[1] -= this.offsetY + offsets[1];
+ var pointer = [event.pageX, event.pageY];
+ var offsets = jQuery(this.track).offset();
+ pointer[0] -= this.offsetX + offsets['left'];
+ pointer[1] -= this.offsetY + offsets['top'];
this.event = event;
this.setValue(this.translateToValue( this.isVertical() ? pointer[1] : pointer[0] ));
if(this.initialized && this.options.onSlide)
this.options.onSlide(this.value, this);
},
-
+
endDrag: function(event) {
if(this.active && this.dragging) {
this.finishDrag(event, true);
- Event.stop(event);
+ event.stopPropagation();
}
this.active = false;
this.dragging = false;
- },
-
+ },
+
finishDrag: function(event, success) {
this.active = false;
this.dragging = false;
this.updateFinished();
},
-
+
updateFinished: function() {
this.hiddenField.value=this.value;
this.updateStyles();
- if(this.initialized && this.options.onChange)
+ if(this.initialized && this.options.onChange)
this.options.onChange(this.value, this);
this.event = null;
if (this.options['AutoPostBack']==true)
{
- Event.fireEvent(this.hiddenField,"change");
+ jQuery(this.hiddenField).trigger("change");
}
}
diff --git a/framework/Web/Javascripts/source/prado/controls/tabpanel.js b/framework/Web/Javascripts/source/prado/controls/tabpanel.js
index bd0a7494..61a18a28 100644
--- a/framework/Web/Javascripts/source/prado/controls/tabpanel.js
+++ b/framework/Web/Javascripts/source/prado/controls/tabpanel.js
@@ -1,58 +1,58 @@
-Prado.WebUI.TTabPanel = Class.create(Prado.WebUI.Control,
+Prado.WebUI.TTabPanel = jQuery.klass(Prado.WebUI.Control,
{
onInit : function(options)
{
this.views = options.Views;
this.viewsvis = options.ViewsVis;
- this.hiddenField = $(options.ID+'_1');
+ this.hiddenField = jQuery("#"+options.ID+'_1').get(0);
this.activeCssClass = options.ActiveCssClass;
this.normalCssClass = options.NormalCssClass;
var length = options.Views.length;
for(var i = 0; i<length; i++)
{
var item = options.Views[i];
- var element = $(item+'_0');
+ var element = jQuery("#"+item+'_0').get(0);
if (element && options.ViewsVis[i])
{
- this.observe(element, "click", this.elementClicked.bindEvent(this,item));
+ this.observe(element, "click", jQuery.proxy(this.elementClicked,this,item));
if (options.AutoSwitch)
- this.observe(element, "mouseenter", this.elementClicked.bindEvent(this,item));
+ this.observe(element, "mouseenter", jQuery.proxy(this.elementClicked,this,item));
}
-
+
if(element)
{
- var view = $(options.Views[i]);
+ var view = jQuery("#"+options.Views[i]).get(0);
if (view)
if(this.hiddenField.value == i)
{
- element.className=this.activeCssClass;
- view.show();
+ jQuery(element).addClass(this.activeCssClass).removeClass(this.normalCssClass);
+ jQuery(view).show();
} else {
- element.className=this.normalCssClass;
- view.hide();
+ jQuery(element).addClass(this.normalCssClass).removeClass(this.activeCssClass);
+ jQuery(view).hide();
}
}
}
},
- elementClicked : function(event,viewID)
+ elementClicked : function(viewID, event)
{
var length = this.views.length;
for(var i = 0; i<length; i++)
{
var item = this.views[i];
- if ($(item))
+ if (jQuery("#"+item))
{
if(item == viewID)
{
- $(item+'_0').className=this.activeCssClass;
- $(item).show();
+ jQuery("#"+item+'_0').removeClass(this.normalCssClass).addClass(this.activeCssClass);
+ jQuery("#"+item).show();
this.hiddenField.value=i;
}
else
{
- $(item+'_0').className=this.normalCssClass;
- $(item).hide();
+ jQuery("#"+item+'_0').removeClass(this.activeCssClass).addClass(this.normalCssClass);
+ jQuery("#"+item).hide();
}
}
}
diff --git a/framework/Web/Javascripts/source/prado/datepicker/datepicker.js b/framework/Web/Javascripts/source/prado/datepicker/datepicker.js
index ae1ad4b9..68b31455 100644
--- a/framework/Web/Javascripts/source/prado/datepicker/datepicker.js
+++ b/framework/Web/Javascripts/source/prado/datepicker/datepicker.js
@@ -1,4 +1,4 @@
-Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
+Prado.WebUI.TDatePicker = jQuery.klass(Prado.WebUI.Control,
{
MonthNames : [ "January", "February", "March", "April",
"May", "June", "July", "August",
@@ -22,18 +22,18 @@ Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
onInit : function(options)
{
this.options = options || [];
- this.control = $(options.ID);
+ this.control = jQuery('#'+options.ID).get(0);
this.dateSlot = new Array(42);
this.weekSlot = new Array(6);
this.minimalDaysInFirstWeek = 4;
this.positionMode = 'Bottom';
-
- Prado.Registry.set(options.ID, this);
+
+ Prado.Registry[options.ID] = this;
//which element to trigger to show the calendar
if(this.options.Trigger)
{
- this.trigger = $(this.options.Trigger) ;
+ this.trigger = jQuery('#'+this.options.Trigger).get(0);
var triggerEvent = this.options.TriggerEvent || "click";
}
else
@@ -41,38 +41,38 @@ Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
this.trigger = this.control;
var triggerEvent = this.options.TriggerEvent || "focus";
}
-
+
// Popup position
if(this.options.PositionMode == 'Top')
{
this.positionMode = this.options.PositionMode;
}
- Object.extend(this,options);
+ jQuery.extend(this,options);
// generate default date _after_ extending options
this.selectedDate = this.newDate();
-
- Event.observe(this.trigger, triggerEvent, this.show.bindEvent(this));
-
+
+ this.observe(this.trigger, triggerEvent, jQuery.proxy(this.show,this));
+
// Listen to change event if needed
if (typeof(this.options.OnDateChanged) == "function")
{
if(this.options.InputMode == "TextBox")
{
- Event.observe(this.control, "change", this.onDateChanged.bindEvent(this));
- }
+ this.observe(this.control, "change", jQuery.proxy(this.onDateChanged,this));
+ }
else
{
var day = Prado.WebUI.TDatePicker.getDayListControl(this.control);
var month = Prado.WebUI.TDatePicker.getMonthListControl(this.control);
var year = Prado.WebUI.TDatePicker.getYearListControl(this.control);
- Event.observe (day, "change", this.onDateChanged.bindEvent(this));
- Event.observe (month, "change", this.onDateChanged.bindEvent(this));
- Event.observe (year, "change", this.onDateChanged.bindEvent(this));
-
+ this.observe (day, "change", jQuery.proxy(this.onDateChanged,this));
+ this.observe (month, "change", jQuery.proxy(this.onDateChanged,this));
+ this.observe (year, "change", jQuery.proxy(this.onDateChanged,this));
+
}
-
-
+
+
}
},
@@ -214,8 +214,8 @@ Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
tmp.data = text;
this.dateSlot[(week*7)+day] = tmp;
- Event.observe(td, "mouseover", this.hover.bindEvent(this));
- Event.observe(td, "mouseout", this.hover.bindEvent(this));
+ this.observe(td, "mouseover", jQuery.proxy(this.hover,this));
+ this.observe(td, "mouseout", jQuery.proxy(this.hover,this));
}
}
@@ -233,60 +233,28 @@ Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
todayButton.value = buttonText;
div.appendChild(todayButton);
- if(Prado.Browser().ie)
- {
- this.iePopUp = document.createElement('iframe');
- this.iePopUp.src = Prado.WebUI.TDatePicker.spacer;
- this.iePopUp.style.position = "absolute"
- this.iePopUp.scrolling="no"
- this.iePopUp.frameBorder="0"
- this.control.parentNode.appendChild(this.iePopUp);
- }
-
this.control.parentNode.appendChild(this._calDiv);
this.update();
this.updateHeader();
- this.ieHack(true);
-
- // IE55+ extension
- previousMonth.hideFocus = true;
- nextMonth.hideFocus = true;
- todayButton.hideFocus = true;
- // end IE55+ extension
-
// hook up events
- Event.observe(previousMonth, "click", this.prevMonth.bindEvent(this));
- Event.observe(nextMonth, "click", this.nextMonth.bindEvent(this));
- Event.observe(todayButton, "click", this.selectToday.bindEvent(this));
- //Event.observe(clearButton, "click", this.clearSelection.bindEvent(this));
- Event.observe(this._monthSelect, "change", this.monthSelect.bindEvent(this));
- Event.observe(this._yearSelect, "change", this.yearSelect.bindEvent(this));
+ this.observe(previousMonth, "click", jQuery.proxy(this.prevMonth,this));
+ this.observe(nextMonth, "click", jQuery.proxy(this.nextMonth,this));
+ this.observe(todayButton, "click", jQuery.proxy(this.selectToday,this));
+ //Event.observe(clearButton, "click", jQuery.proxy(this.clearSelection,this));
+ this.observe(this._monthSelect, "change", jQuery.proxy(this.monthSelect,this));
+ this.observe(this._yearSelect, "change", jQuery.proxy(this.yearSelect,this));
// ie, opera
- Event.observe(this._calDiv, "mousewheel", this.mouseWheelChange.bindEvent(this));
+ this.observe(this._calDiv, "mousewheel", jQuery.proxy(this.mouseWheelChange,this));
// ff
- Event.observe(this._calDiv, "DOMMouseScroll", this.mouseWheelChange.bindEvent(this));
-
- Event.observe(calendarBody, "click", this.selectDate.bindEvent(this));
+ this.observe(this._calDiv, "DOMMouseScroll", jQuery.proxy(this.mouseWheelChange,this));
- Prado.Element.focus(this.control);
+ this.observe(calendarBody, "click", jQuery.proxy(this.selectDate,this));
- },
+ jQuery(this.control).focus();
- ieHack : function(cleanup)
- {
- // IE hack
- if(this.iePopUp)
- {
- this.iePopUp.style.display = "block";
- this.iePopUp.style.left = (this._calDiv.offsetLeft -1)+ "px";
- this.iePopUp.style.top = (this._calDiv.offsetTop -1 ) + "px";
- this.iePopUp.style.width = Math.abs(this._calDiv.offsetWidth -2)+ "px";
- this.iePopUp.style.height = (this._calDiv.offsetHeight + 1)+ "px";
- if(cleanup) this.iePopUp.style.display = "none";
- }
},
keyPressed : function(ev)
@@ -295,15 +263,18 @@ Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
if (!ev) ev = document.parentWindow.event;
var kc = ev.keyCode != null ? ev.keyCode : ev.charCode;
- if(kc == Event.KEY_RETURN || kc == Event.KEY_SPACEBAR || kc == Event.KEY_TAB)
+ // return, space, tab
+ if(kc == 13 || kc == 32 || kc == 9)
{
this.setSelectedDate(this.selectedDate);
- Event.stop(ev);
+ ev.preventDefault();
this.hide();
}
- if(kc == Event.KEY_ESC)
+ // esc
+ if(kc == 27)
{
- Event.stop(ev); this.hide();
+ ev.preventDefault();
+ this.hide();
}
var getDaysPerMonth = function (nMonth, nYear)
@@ -320,7 +291,7 @@ Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
var current = this.selectedDate;
var d = current.valueOf();
- if(kc == Event.KEY_LEFT)
+ if(kc == 37) // left
{
if(ev.ctrlKey || ev.shiftKey) // -1 month
{
@@ -330,7 +301,7 @@ Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
else
d -= 86400000; //-1 day
}
- else if (kc == Event.KEY_RIGHT)
+ else if (kc == 39) // right
{
if(ev.ctrlKey || ev.shiftKey) // +1 month
{
@@ -340,7 +311,7 @@ Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
else
d += 86400000; //+1 day
}
- else if (kc == Event.KEY_UP)
+ else if (kc == 38) // up
{
if(ev.ctrlKey || ev.shiftKey) //-1 year
{
@@ -350,7 +321,7 @@ Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
else
d -= 604800000; // -7 days
}
- else if (kc == Event.KEY_DOWN)
+ else if (kc == 40) // down
{
if(ev.ctrlKey || ev.shiftKey) // +1 year
{
@@ -361,12 +332,12 @@ Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
d += 7 * 24 * 61 * 60 * 1000; // +7 days
}
this.setSelectedDate(d);
- Event.stop(ev);
+ ev.preventDefault();
},
selectDate : function(ev)
{
- var el = Event.element(ev);
+ var el = ev.target;
while (el.nodeType != 1)
el = el.parentNode;
@@ -403,12 +374,12 @@ Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
monthSelect : function(ev)
{
- this.setMonth(Form.Element.getValue(Event.element(ev)));
+ this.setMonth(ev.target.value);
},
yearSelect : function(ev)
{
- this.setYear(Form.Element.getValue(Event.element(ev)));
+ this.setYear(ev.target.value);
},
mouseWheelChange : function (event)
@@ -436,7 +407,7 @@ Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
if (this.options.InputMode == "TextBox")
{
date=this.control.value;
- }
+ }
else
{
var day = Prado.WebUI.TDatePicker.getDayListControl(this.control).selectedIndex+1;
@@ -460,16 +431,16 @@ Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
obj.changeeventtimer = null;
}
obj.changeeventtimer = setTimeout(
- function() { obj.changeeventtimer = null; Event.fireEvent(element, "change"); },
+ function() { obj.changeeventtimer = null; jQuery(element).trigger("change"); },
1500
);
}
else
- Event.fireEvent(element, "change");
+ jQuery(element).trigger("change");
},
-
+
onChange : function(ref, date, capevents)
- {
+ {
if(this.options.InputMode == "TextBox")
{
this.control.value = this.formatDate();
@@ -598,39 +569,36 @@ Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
if(!this.showing)
{
- var pos = this.control.positionedOffset();
+ var pos = jQuery(this.control).position();
- pos[1] += this.getDatePickerOffsetHeight();
- this._calDiv.style.top = (pos[1]-1) + "px";
+ pos['top'] += this.getDatePickerOffsetHeight();
+ this._calDiv.style.top = (pos['top']-1) + "px";
this._calDiv.style.display = "block";
- this._calDiv.style.left = pos[0] + "px";
+ this._calDiv.style.left = pos['left'] + "px";
- this.documentClickEvent = this.hideOnClick.bindEvent(this);
- this.documentKeyDownEvent = this.keyPressed.bindEvent(this);
- Event.observe(document.body, "click", this.documentClickEvent);
+ this.documentClickEvent = jQuery.bind(this.hideOnClick, this);
+ this.documentKeyDownEvent = jQuery.bind(this.keyPressed, this);
+ this.observe(document.body, "click", this.documentClickEvent);
var date = this.getDateFromInput();
if(date)
{
this.selectedDate = date;
this.setSelectedDate(date);
}
- Event.observe(document,"keydown", this.documentKeyDownEvent);
+ this.observe(document,"keydown", this.documentKeyDownEvent);
this.showing = true;
-
+
if(this.positionMode=='Top')
{
- this._calDiv.style.top = ((pos[1]-1) - this.getDatePickerOffsetHeight() - this._calDiv.offsetHeight) + 'px';
- if(Prado.Browser().ie)
- this.iePopup = this._calDiv.style.top;
+ this._calDiv.style.top = ((pos['top']-1) - this.getDatePickerOffsetHeight() - this._calDiv.offsetHeight) + 'px';
}
- this.ieHack(false);
}
},
getDateFromInput : function()
{
if(this.options.InputMode == "TextBox")
- return Date.SimpleParse($F(this.control), this.Format);
+ return Date.SimpleParse(this.control.value, this.Format);
else
return Prado.WebUI.TDatePicker.getDropDownDate(this.control);
},
@@ -639,11 +607,11 @@ Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
hideOnClick : function(ev)
{
if(!this.showing) return;
- var el = Event.element(ev);
+ var el = ev.target;
var within = false;
do
{
- within = within || (el.className && Element.hasClassName(el, "TDatePicker_"+this.CalendarStyle));
+ within = within || (el.className && jQuery(el).hasClass("TDatePicker_"+this.CalendarStyle));
within = within || el == this.trigger;
within = within || el == this.control;
if(within) break;
@@ -659,11 +627,9 @@ Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
if(this.showing)
{
this._calDiv.style.display = "none";
- if(this.iePopUp)
- this.iePopUp.style.display = "none";
this.showing = false;
- Event.stopObserving(document.body, "click", this.documentClickEvent);
- Event.stopObserving(document,"keydown", this.documentKeyDownEvent);
+ this.stopObserving(document.body, "click", this.documentClickEvent);
+ this.stopObserving(document,"keydown", this.documentKeyDownEvent);
}
},
@@ -721,12 +687,12 @@ Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
hover : function(ev)
{
- if(Event.element(ev).tagName)
+ if(ev.target.tagName)
{
if(ev.type == "mouseover")
- Event.element(ev).addClassName("hover");
- else
- Event.element(ev).removeClassName("hover");
+ jQuery(ev.target).addClass("hover");
+ else
+ jQuery(ev.target).removeClass("hover");
}
},
@@ -753,7 +719,7 @@ Prado.WebUI.TDatePicker = Class.create(Prado.WebUI.Control,
}
});
-Object.extend(Prado.WebUI.TDatePicker,
+jQuery.extend(Prado.WebUI.TDatePicker,
{
/**
* @return Date the date from drop down list options.
@@ -769,25 +735,25 @@ Object.extend(Prado.WebUI.TDatePicker,
var day_list = Prado.WebUI.TDatePicker.getDayListControl(control);
var year_list = Prado.WebUI.TDatePicker.getYearListControl(control);
- var day = day_list ? $F(day_list) : 1;
- var month = month_list ? $F(month_list) : now.getMonth();
- var year = year_list ? $F(year_list) : now.getFullYear();
+ var day = day_list ? day_list.value : 1;
+ var month = month_list ? month_list.value : now.getMonth();
+ var year = year_list ? year_list.value : now.getFullYear();
return new Date(year,month,day, 0, 0, 0);
},
getYearListControl : function(control)
{
- return $(control.id+"_year");
+ return jQuery('#'+control.id+"_year").get(0);
},
getMonthListControl : function(control)
{
- return $(control.id+"_month");
+ return jQuery('#'+control.id+"_month").get(0);
},
getDayListControl : function(control)
{
- return $(control.id+"_day");
+ return jQuery('#'+control.id+"_day").get(0);
}
}); \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/prado/logger/logger.js b/framework/Web/Javascripts/source/prado/logger/logger.js
index 55cc1aa3..fde772ce 100644
--- a/framework/Web/Javascripts/source/prado/logger/logger.js
+++ b/framework/Web/Javascripts/source/prado/logger/logger.js
@@ -13,8 +13,7 @@ Use it all you want. Just remember to give me some credit :)
// Custom Event
// ------------
-CustomEvent = Class.create();
-CustomEvent.prototype = {
+CustomEvent = jQuery.klass({
initialize : function() {
this.listeners = []
},
@@ -54,7 +53,7 @@ CustomEvent.prototype = {
return indexes
}
-};
+});
// ------
// Cookie
@@ -179,16 +178,14 @@ Logger = {
}
};
-LogEntry = Class.create()
-LogEntry.prototype = {
+LogEntry = jQuery.klass({
initialize : function(message, tag) {
this.message = message
this.tag = tag
}
-};
+});
-LogConsole = Class.create();
-LogConsole.prototype = {
+LogConsole = jQuery.klass({
// Properties
// ----------
@@ -207,7 +204,7 @@ LogConsole.prototype = {
// I hate writing javascript in HTML... but what's a better alternative
this.logElement = document.createElement('div')
document.body.appendChild(this.logElement)
- Element.hide(this.logElement)
+ jQuery(this.logElement).hide();
this.logElement.style.position = "absolute"
this.logElement.style.left = '0px'
@@ -247,8 +244,8 @@ LogConsole.prototype = {
this.tagFilterElement.value = this.tagPattern
this.tagFilterElement.setAttribute('autocomplete', 'off') // So Firefox doesn't flip out
- Event.observe(this.tagFilterElement, 'keyup', this.updateTags.bind(this))
- Event.observe(this.tagFilterElement, 'click', function() {this.tagFilterElement.select()}.bind(this))
+ jQuery(this.tagFilterElement).on('keyup', this.updateTags.bind(this));
+ jQuery(this.tagFilterElement).on('click', function() {this.tagFilterElement.select()}.bind(this));
// Add outputElement
this.outputElement = document.createElement('div')
@@ -271,8 +268,8 @@ LogConsole.prototype = {
this.inputElement.value = 'Type command here'
this.inputElement.setAttribute('autocomplete', 'off') // So Firefox doesn't flip out
- Event.observe(this.inputElement, 'keyup', this.handleInput.bind(this))
- Event.observe(this.inputElement, 'click', function() {this.inputElement.select()}.bind(this))
+ jQuery(this.inputElement).on('keyup', this.handleInput.bind(this));
+ jQuery(this.inputElement).on('click', function() {this.inputElement.select()}.bind(this));
if(document.all && !window.opera)
{
@@ -284,9 +281,9 @@ LogConsole.prototype = {
this.logElement.style.bottom="0px";
}
var self=this;
- Event.observe(document, 'keydown', function(e)
+ jQuery(document).on('keydown', function(e)
{
- if((e.altKey==true) && Event.keyCode(e) == toggleKey ) //Alt+J | Ctrl+J
+ if((e.altKey==true) && e.keyCode == toggleKey ) //Alt+J | Ctrl+J
self.toggle();
});
@@ -301,7 +298,7 @@ LogConsole.prototype = {
// Feed all errors into the logger (For some unknown reason I can only get this to work
// with an inline event declaration)
- Event.observe(window, 'error', function(msg, url, lineNumber) {Logger.error("Error in (" + (url || location) + ") on line "+lineNumber+"", msg)})
+ jQuery(window).on('error', function(msg, url, lineNumber) {Logger.error("Error in (" + (url || location) + ") on line "+lineNumber+"", msg)});
// Allow acess key link
var accessElement = document.createElement('span')
@@ -315,27 +312,27 @@ LogConsole.prototype = {
toggle : function() {
if (this.logElement.style.display == 'none') {
- this.show()
+ this.show();
}
else {
- this.hide()
+ this.hide();
}
},
show : function() {
- Element.show(this.logElement)
+ jQuery(this.logElement).show();
this.outputElement.scrollTop = this.outputElement.scrollHeight // Scroll to bottom when toggled
if(document.all && !window.opera)
this.repositionWindow();
Cookie.set('ConsoleVisible', 'true')
- this.inputElement.select()
+ this.inputElement.select();
this.hidden = false;
},
hide : function() {
this.hidden = true;
- Element.hide(this.logElement)
- Cookie.set('ConsoleVisible', 'false')
+ jQuery(this.logElement).hide();
+ Cookie.set('ConsoleVisible', 'false');
},
output : function(message, style) {
@@ -349,7 +346,7 @@ LogConsole.prototype = {
if (this.outputCount % 2 == 0) style += ";background-color:#101010"
message = message || "undefined"
- message = message.toString().escapeHTML()
+ message = message.toString().replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
this.outputElement.innerHTML += "<pre style='" + style + "'>" + message + "</pre>"
@@ -408,7 +405,7 @@ LogConsole.prototype = {
},
handleInput : function(e) {
- if (e.keyCode == Event.KEY_RETURN ) {
+ if (e.keyCode == 13 ) {
var command = this.inputElement.value
switch(command) {
@@ -438,14 +435,14 @@ LogConsole.prototype = {
this.commandIndex = 0
this.inputElement.value = ""
}
- else if (e.keyCode == Event.KEY_UP && this.commandHistory.length > 0) {
+ else if (e.keyCode == 38 && this.commandHistory.length > 0) {
this.inputElement.value = this.commandHistory[this.commandIndex]
if (this.commandIndex < this.commandHistory.length - 1) {
this.commandIndex += 1
}
}
- else if (e.keyCode == Event.KEY_DOWN && this.commandHistory.length > 0) {
+ else if (e.keyCode == 40 && this.commandHistory.length > 0) {
if (this.commandIndex > 0) {
this.commandIndex -= 1
}
@@ -456,7 +453,7 @@ LogConsole.prototype = {
this.commandIndex = 0
}
}
-};
+});
// -------------------------
@@ -697,8 +694,7 @@ Prado.Inspector =
{
this.d.body.removeChild(this.d.getElementById("so_mContainer"));
this.d.body.removeChild(this.d.getElementById("so_mStyle"));
- if(typeof Event != "undefined")
- Event.stopObserving(this.d, "keydown", this.dKeyDownEvent);
+ jQuery(this.d).unbind("keydown", this.dKeyDownEvent);
this.types = new Array();
this.objs = new Array();
this.hidden = new Array();
@@ -718,8 +714,7 @@ Prado.Inspector =
sObj.type="text/css";
sObj.innerHTML = this.style;
this.dKeyDownEvent = this.handleKeyEvent.bind(this);
- if(typeof Event != "undefined")
- Event.observe(this.d, "keydown", this.dKeyDownEvent);
+ jQuery(this.d).on("keydown", this.dKeyDownEvent);
this.parseJS(obj);
this.buildTree();
diff --git a/framework/Web/Javascripts/source/prado/prado.js b/framework/Web/Javascripts/source/prado/prado.js
index 05f11dcd..ec7f68fc 100644
--- a/framework/Web/Javascripts/source/prado/prado.js
+++ b/framework/Web/Javascripts/source/prado/prado.js
@@ -1,3 +1,266 @@
+/*
+ * Polyfill for ECMAScript5's bind() function.
+ * ----------
+ * Adds compatible .bind() function; needed for Internet Explorer < 9
+ * Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
+ */
+
+if (!Function.prototype.bind) {
+ Function.prototype.bind = function (oThis) {
+ if (typeof this !== "function") {
+ // closest thing possible to the ECMAScript 5 internal IsCallable function
+ throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
+ }
+
+ var aArgs = Array.prototype.slice.call(arguments, 1),
+ fToBind = this,
+ fNOP = function () {},
+ fBound = function () {
+ return fToBind.apply(this instanceof fNOP && oThis
+ ? this
+ : oThis,
+ aArgs.concat(Array.prototype.slice.call(arguments)));
+ };
+
+ fNOP.prototype = this.prototype;
+ fBound.prototype = new fNOP();
+
+ return fBound;
+ };
+}
+
+/*
+ * Low Pro JQ
+ * ----------
+ *
+ * Author: Dan Webb (dan@danwebb.net)
+ * GIT: github.com:danwrong/low-pro-for-jquery.git
+ * Download: http://github.com/danwrong/low-pro-for-jquery/tree/master/src/lowpro.jquery.js?raw=true
+ *
+ * A jQuery port of the Low Pro behavior framework that was originally written for Prototype.
+ *
+ * Prado actually uses it as a base to emulate OOP subclassing, inheritance and contructor events.
+ * The "behaviour" and the "Remote" bits are not used and have been commented out.
+ */
+
+(function($) {
+
+ var addMethods = function(source) {
+ var ancestor = this.superclass && this.superclass.prototype;
+ var properties = $.keys(source);
+
+ if (!$.keys({ toString: true }).length) properties.push("toString", "valueOf");
+
+ for (var i = 0, length = properties.length; i < length; i++) {
+ var property = properties[i], value = source[property];
+ if (ancestor && $.isFunction(value) && $.argumentNames(value)[0] == "$super") {
+
+ var method = value, value = $.extend($.wrap((function(m) {
+ return function() { return ancestor[m].apply(this, arguments) };
+ })(property), method), {
+ valueOf: function() { return method },
+ toString: function() { return method.toString() }
+ });
+ }
+ this.prototype[property] = value;
+ }
+
+ return this;
+ };
+
+ $.extend({
+ keys: function(obj) {
+ var keys = [];
+ for (var key in obj) keys.push(key);
+ return keys;
+ },
+
+ argumentNames: function(func) {
+ var names = func.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(/, ?/);
+ return names.length == 1 && !names[0] ? [] : names;
+ },
+
+ bind: function(func, scope) {
+ return function() {
+ return func.apply(scope, $.makeArray(arguments));
+ };
+ },
+
+ wrap: function(func, wrapper) {
+ var __method = func;
+ return function() {
+ return wrapper.apply(this, [$.bind(__method, this)].concat($.makeArray(arguments)));
+ };
+ },
+
+ klass: function() {
+ var parent = null, properties = $.makeArray(arguments);
+ if ($.isFunction(properties[0])) parent = properties.shift();
+
+ var klass = function() {
+ this.initialize.apply(this, arguments);
+ };
+
+ klass.superclass = parent;
+ klass.subclasses = [];
+ klass.addMethods = addMethods;
+
+ if (parent) {
+ var subclass = function() { };
+ subclass.prototype = parent.prototype;
+ klass.prototype = new subclass;
+ parent.subclasses.push(klass);
+ }
+
+ for (var i = 0; i < properties.length; i++)
+ klass.addMethods(properties[i]);
+
+ if (!klass.prototype.initialize)
+ klass.prototype.initialize = function() {};
+
+ klass.prototype.constructor = klass;
+
+ return klass;
+ },
+ delegate: function(rules) {
+ return function(e) {
+ var target = $(e.target), parent = null;
+ for (var selector in rules) {
+ if (target.is(selector) || ((parent = target.parents(selector)) && parent.length > 0)) {
+ return rules[selector].apply(this, [parent || target].concat($.makeArray(arguments)));
+ }
+ parent = null;
+ }
+ };
+ }
+ });
+/*
+ var bindEvents = function(instance) {
+ for (var member in instance) {
+ if (member.match(/^on(.+)/) && typeof instance[member] == 'function') {
+ instance.element.live(RegExp.$1, {'behavior': instance}, instance[member]);
+ }
+ }
+ };
+
+ var behaviorWrapper = function(behavior) {
+ return $.klass(behavior, {
+ initialize: function($super, element, args) {
+ this.element = element;
+ if ($super) $super.apply(this, args);
+ },
+ trigger: function(eventType, extraParameters) {
+ var parameters = [this].concat(extraParameters);
+ this.element.trigger(eventType, parameters);
+ }
+ });
+ };
+
+ var attachBehavior = function(el, behavior, args) {
+ var wrapper = behaviorWrapper(behavior);
+ var instance = new wrapper(el, args);
+
+ bindEvents(instance);
+
+ if (!behavior.instances) behavior.instances = [];
+
+ behavior.instances.push(instance);
+
+ return instance;
+ };
+
+
+ $.fn.extend({
+ attach: function() {
+ var args = $.makeArray(arguments), behavior = args.shift();
+ attachBehavior(this, behavior, args);
+ return this;
+ },
+ delegate: function(type, rules) {
+ return this.bind(type, $.delegate(rules));
+ },
+ attached: function(behavior) {
+ var instances = [];
+
+ if (!behavior.instances) return instances;
+
+ this.each(function(i, element) {
+ $.each(behavior.instances, function(i, instance) {
+ if (instance.element.get(0) == element) instances.push(instance);
+ });
+ });
+
+ return instances;
+ },
+ firstAttached: function(behavior) {
+ return this.attached(behavior)[0];
+ }
+ });
+
+ Remote = $.klass({
+ initialize: function(options) {
+ if (this.element.attr('nodeName') == 'FORM') this.element.attach(Remote.Form, options);
+ else this.element.attach(Remote.Link, options);
+ }
+ });
+
+ Remote.Base = $.klass({
+ initialize : function(options) {
+ this.options = $.extend(true, {}, options || {});
+ },
+ _makeRequest : function(options) {
+ $.ajax(options);
+ return false;
+ }
+ });
+
+ Remote.Link = $.klass(Remote.Base, {
+ onclick: function(e) {
+ var options = $.extend({
+ url: $(this).attr('href'),
+ type: 'GET'
+ }, this.options);
+ return e.data.behavior._makeRequest(e.data.behavior.options);
+ }
+ });
+
+ Remote.Form = $.klass(Remote.Base, {
+ onclick: function(e) {
+ var target = e.target;
+
+ if ($.inArray(target.nodeName.toLowerCase(), ['input', 'button']) >= 0 && target.type.match(/submit|image/))
+ e.data.behavior._submitButton = target;
+ },
+ onsubmit: function(e) {
+ var elm = $(this), data = elm.serializeArray();
+
+ if (e.data.behavior._submitButton) data.push({
+ name: e.data.behavior._submitButton.name,
+ value: e.data.behavior._submitButton.value
+ });
+
+ var options = $.extend({
+ url : elm.attr('action'),
+ type : elm.attr('method') || 'GET',
+ data : data
+ }, e.data.behavior.options);
+
+ e.data.behavior._makeRequest(options);
+
+ return false;
+ }
+ });
+
+ $.ajaxSetup({
+ beforeSend: function(xhr) {
+ if (!this.dataType)
+ xhr.setRequestHeader("Accept", "text/javascript, text/html, application/xml, text/xml, *\/*");
+ }
+ });
+*/
+})(jQuery);
+
+
/**
* Prado base namespace
* @namespace Prado
@@ -9,86 +272,963 @@ var Prado =
* @var Version
*/
Version: '3.2.3',
-
+
/**
* Registry for Prado components
* @var Registry
*/
- Registry: $H(),
+ Registry: {}
+};
+
+Prado.RequestManager =
+{
+ FIELD_POSTBACK_TARGET : 'PRADO_POSTBACK_TARGET',
+
+ FIELD_POSTBACK_PARAMETER : 'PRADO_POSTBACK_PARAMETER'
+};
+/**
+ * Performs a PostBack using javascript.
+ * @function Prado.PostBack
+ * @param options - Postback options
+ * @param event - Event that triggered this postback
+ * @... {string} FormID - Form that should be posted back
+ * @... {optional boolean} CausesValidation - Validate before PostBack if true
+ * @... {optional string} ValidationGroup - Group to Validate
+ * @... {optional string} ID - Validation ID
+ * @... {optional string} PostBackUrl - Postback URL
+ * @... {optional boolean} TrackFocus - Keep track of focused element if true
+ * @... {string} EventTarget - Id of element that triggered PostBack
+ * @... {string} EventParameter - EventParameter for PostBack
+ */
+Prado.PostBack = jQuery.klass(
+{
+ options : {},
+
+ initialize: function(options, event)
+ {
+ jQuery.extend(this.options, options || {});
+ this.event = event;
+ this.doPostBack();
+ },
+
+ getForm : function()
+ {
+ return jQuery("#" + this.options['FormID']).get(0);
+ },
+
+ doPostBack : function()
+ {
+ var form = this.getForm();
+ if(this.options['CausesValidation'] && typeof(Prado.Validation) != "undefined")
+ {
+ if(!Prado.Validation.validate(this.options['FormID'], this.options['ValidationGroup'], jQuery("#" + this.options['ID'])))
+ return this.event.preventDefault();
+ }
+
+ if(this.options['PostBackUrl'] && this.options['PostBackUrl'].length > 0)
+ form.action = this.options['PostBackUrl'];
+
+ if(this.options['TrackFocus'])
+ {
+ var lastFocus = jQuery('#PRADO_LASTFOCUS');
+ if(lastFocus)
+ {
+ var active = document.activeElement; //where did this come from
+ if(active)
+ lastFocus.value = active.id;
+ else
+ lastFocus.value = this.options['EventTarget'];
+ }
+ }
+
+ var input=null;
+ if(this.options.EventTarget)
+ {
+ input = document.createElement("input");
+ input.setAttribute("type", "hidden");
+ input.setAttribute("name", Prado.RequestManager.FIELD_POSTBACK_TARGET);
+ input.setAttribute("value", this.options.EventTarget);
+ form.appendChild(input);
+ }
+ if(this.options.EventParameter)
+ {
+ input = document.createElement("input");
+ input.setAttribute("type", "hidden");
+ input.setAttribute("name", Prado.RequestManager.FIELD_POSTBACK_PARAMETER);
+ input.setAttribute("value", this.options.EventParameter);
+ form.appendChild(input);
+ }
+
+ jQuery(form).trigger('submit');
+ }
+});
+
+/**
+ * Prado utilities to manipulate DOM elements.
+ * @object Prado.Element
+ */
+Prado.Element =
+{
+ /**
+ * Executes a jQuery method on a particular element.
+ * @function ?
+ * @param {string} element - Element id
+ * @param {string} method - method name
+ * @param {array} value - method parameters
+ */
+ j: function(element, method, params)
+ {
+ var obj=jQuery("#" + element);
+ obj[method].apply(obj, params);
+ },
+
+ /**
+ * Select options from a selectable element.
+ * @function ?
+ * @param {string} element - Element id
+ * @param {string} method - Name of any {@link Prado.Element.Selection} method
+ * @param {array|boolean|string} value - Values that should be selected
+ * @param {int} total - Number of elements
+ */
+ select : function(element, method, value, total)
+ {
+ var el = jQuery("#" + element).get(0);
+ if(!el) return;
+ var selection = Prado.Element.Selection;
+ if(typeof(selection[method]) == "function")
+ {
+ var control = selection.isSelectable(el) ? [el] : selection.getListElements(element,total);
+ selection[method](control, value);
+ }
+ },
+
+ /**
+ * Sets an attribute of a DOM element.
+ * @function ?
+ * @param {string} element - Element id
+ * @param {string} attribute - Name of attribute
+ * @param {string} value - Value of attribute
+ */
+ setAttribute : function(element, attribute, value)
+ {
+ var el = jQuery("#" + element);
+ if(!el) return;
+ if((attribute == "disabled" || attribute == "multiple" || attribute == "readonly" || attribute == "href") && value==false)
+ el.removeAttr(attribute);
+ else if(attribute.match(/^on/i)) //event methods
+ {
+ try
+ {
+ eval("(func = function(event){"+value+"})");
+ el.get(0)[attribute] = func;
+ }
+ catch(e)
+ {
+ debugger;
+ throw "Error in evaluating '"+value+"' for attribute "+attribute+" for element "+element;
+ }
+ }
+ else
+ el.attr(attribute, value);
+ },
+
+ scrollTo : function(element, options)
+ {
+ var op = {
+ duration : 500,
+ offset : 50
+ };
+ jQuery.extend(op, options || {});
+ jQuery('html, body').animate({
+ scrollTop: jQuery("#"+element).offset().top - op.offset
+ }, op.duration);
+ },
+
+ focus : function(element)
+ {
+ jQuery("#"+element).focus();
+ },
+
+ /**
+ * Sets the options for a select element.
+ * @function ?
+ * @param {string} element - Element id
+ * @param {array[]} options - Array of options, each an array of structure
+ * [ "optionText" , "optionValue" , "optionGroup" ]
+ */
+ setOptions : function(element, options)
+ {
+ var el = jQuery("#" + element).get(0);
+ var previousGroup = null;
+ var optGroup=null;
+ if(el && el.tagName.toLowerCase() == "select")
+ {
+ while(el.childNodes.length > 0)
+ el.removeChild(el.lastChild);
+
+ var optDom = Prado.Element.createOptions(options);
+ for(var i = 0; i < optDom.length; i++)
+ el.appendChild(optDom[i]);
+ }
+ },
+
+ /**
+ * Create opt-group options from an array of options.
+ * @function {array} ?
+ * @param {array[]} options - Array of options, each an array of structure
+ * [ "optionText" , "optionValue" , "optionGroup" ]
+ * @returns Array of option DOM elements
+ */
+ createOptions : function(options)
+ {
+ var previousGroup = null;
+ var optgroup=null;
+ var result = [];
+ for(var i = 0; i<options.length; i++)
+ {
+ var option = options[i];
+ if(option.length > 2)
+ {
+ var group = option[2];
+ if(group!=previousGroup)
+ {
+ if(previousGroup!=null && optgroup!=null)
+ {
+ result.push(optgroup);
+ previousGroup=null;
+ optgroup=null;
+ }
+ optgroup = document.createElement('optgroup');
+ optgroup.label = group;
+ previousGroup = group;
+ }
+ }
+ var opt = document.createElement('option');
+ opt.text = option[0];
+ opt.innerHTML = option[0];
+ opt.value = option[1];
+ if(optgroup!=null)
+ optgroup.appendChild(opt);
+ else
+ result.push(opt);
+ }
+ if(optgroup!=null)
+ result.push(optgroup);
+ return result;
+ },
+
+ /**
+ * Replace a DOM element either with given content or
+ * with content from a CallBack response boundary
+ * using a replacement method.
+ * @function ?
+ * @param {string|element} element - DOM element or element id
+ * @param {optional string} content - New content of element
+ * @param {optional string} boundary - Boundary of new content
+ */
+ replace : function(element, content, boundary)
+ {
+ if(boundary)
+ {
+ var result = this.extractContent(boundary);
+ if(result != null)
+ content = result;
+ }
+ jQuery('#'+element).replaceWith(content);
+ },
+
+ /**
+ * Appends a javascript block to the document.
+ * @function ?
+ * @param {string} boundary - Boundary containing the javascript code
+ */
+ appendScriptBlock : function(boundary)
+ {
+ var content = this.extractContent(boundary);
+ if(content == null)
+ return;
+
+ var el = document.createElement("script");
+ el.type = "text/javascript";
+ el.id = 'inline_' + boundary;
+ el.text = content;
+
+ (document.getElementsByTagName('head')[0] || document.documentElement).appendChild(el);
+ el.parentNode.removeChild(el);
+ },
+
+ /**
+ * Evaluate a javascript snippet from a string.
+ * @function ?
+ * @param {string} content - String containing the script
+ * @param {string} boundary - Boundary containing the script
+ */
+ evaluateScript : function(content, boundary)
+ {
+ if(boundary)
+ {
+ var result = this.extractContent(boundary);
+ if(result != null)
+ content = result;
+ }
+
+ try
+ {
+ jQuery.globalEval(content);
+ }
+ catch(e)
+ {
+ if(typeof(Logger) != "undefined")
+ Logger.error('Error during evaluation of script "'+content+'"');
+ else
+ debugger;
+ throw e;
+ }
+ }
+};
+
+/**
+ * Utilities for selections.
+ * @object Prado.Element.Selection
+ */
+Prado.Element.Selection =
+{
+ /**
+ * Check if an DOM element can be selected.
+ * @function {boolean} ?
+ * @param {element} el - DOM elemet
+ * @returns true if element is selectable
+ */
+ isSelectable : function(el)
+ {
+ if(el && el.type)
+ {
+ switch(el.type.toLowerCase())
+ {
+ case 'checkbox':
+ case 'radio':
+ case 'select':
+ case 'select-multiple':
+ case 'select-one':
+ return true;
+ }
+ }
+ return false;
+ },
+
+ /**
+ * Set checked attribute of a checkbox or radiobutton to value.
+ * @function {boolean} ?
+ * @param {element} el - DOM element
+ * @param {boolean} value - New value of checked attribute
+ * @returns New value of checked attribute
+ */
+ inputValue : function(el, value)
+ {
+ switch(el.type.toLowerCase())
+ {
+ case 'checkbox':
+ case 'radio':
+ return el.checked = value;
+ }
+ },
+
+ /**
+ * Set selected attribute for elements options by value.
+ * If value is boolean, all elements options selected attribute will be set
+ * to value. Otherwhise all options that have the given value will be selected.
+ * @function ?
+ * @param {element[]} elements - Array of selectable DOM elements
+ * @param {boolean|string} value - Value of options that should be selected or boolean value of selection status
+ */
+ selectValue : function(elements, value)
+ {
+ jQuery.each(elements, function(idx, el)
+ {
+ jQuery.each(el.options, function(idx, option)
+ {
+ if(typeof(value) == "boolean")
+ option.selected = value;
+ else if(option.value == value)
+ option.selected = true;
+ });
+ })
+ },
+
+ /**
+ * Set selected attribute for elements options by array of values.
+ * @function ?
+ * @param {element[]} elements - Array of selectable DOM elements
+ * @param {string[]} value - Array of values to select
+ */
+ selectValues : function(elements, values)
+ {
+ var selection = this;
+ jQuery.each(values, function(idx, value)
+ {
+ selection.selectValue(elements,value);
+ })
+ },
/**
- * Returns browser information.
+ * Set selected attribute for elements options by option index.
+ * @function ?
+ * @param {element[]} elements - Array of selectable DOM elements
+ * @param {int} index - Index of option to select
+ */
+ selectIndex : function(elements, index)
+ {
+ jQuery.each(elements, function(idx, el)
+ {
+ if(el.type.toLowerCase() == 'select-one')
+ el.selectedIndex = index;
+ else
+ {
+ for(var i = 0; i<el.length; i++)
+ {
+ if(i == index)
+ el.options[i].selected = true;
+ }
+ }
+ })
+ },
+
+ /**
+ * Set selected attribute to true for all elements options.
+ * @function ?
+ * @param {element[]} elements - Array of selectable DOM elements
+ */
+ selectAll : function(elements)
+ {
+ jQuery.each(elements, function(idx, el)
+ {
+ if(el.type.toLowerCase() != 'select-one')
+ {
+ jQuery.each(el.options, function(idx, option)
+ {
+ option.selected = true;
+ })
+ }
+ })
+ },
+
+ /**
+ * Toggle the selected attribute for elements options.
+ * @function ?
+ * @param {element[]} elements - Array of selectable DOM elements
+ */
+ selectInvert : function(elements)
+ {
+ jQuery.each(elements, function(idx, el)
+ {
+ if(el.type.toLowerCase() != 'select-one')
+ {
+ jQuery.each(el.options, function(idx, option)
+ {
+ option.selected = !option.selected;
+ })
+ }
+ })
+ },
+
+ /**
+ * Set selected attribute for elements options by array of option indices.
+ * @function ?
+ * @param {element[]} elements - Array of selectable DOM elements
+ * @param {int[]} indices - Array of option indices to select
+ */
+ selectIndices : function(elements, indices)
+ {
+ var selection = this;
+ jQuery.each(indices, function(idx, index)
+ {
+ selection.selectIndex(elements,index);
+ })
+ },
+
+ /**
+ * Unselect elements.
+ * @function ?
+ * @param {element[]} elements - Array of selectable DOM elements
+ */
+ selectClear : function(elements)
+ {
+ jQuery.each(elements, function(idx, el)
+ {
+ el.selectedIndex = -1;
+ })
+ },
+
+ /**
+ * Get list elements of an element.
+ * @function {element[]} ?
+ * @param {element[]} elements - Array of selectable DOM elements
+ * @param {int} total - Number of list elements to return
+ * @returns Array of list DOM elements
+ */
+ getListElements : function(element, total)
+ {
+ var elements = new Array();
+ var el;
+ for(var i = 0; i < total; i++)
+ {
+ el = jQuery("#"+element+"_c"+i).get(0);
+ if(el)
+ elements.push(el);
+ }
+ return elements;
+ },
+
+ /**
+ * Set checked attribute of elements by value.
+ * If value is boolean, checked attribute will be set to value.
+ * Otherwhise all elements that have the given value will be checked.
+ * @function ?
+ * @param {element[]} elements - Array of checkable DOM elements
+ * @param {boolean|String} value - Value that should be checked or boolean value of checked status
+ *
+ */
+ checkValue : function(elements, value)
+ {
+ jQuery.each(elements, function(idx, el)
+ {
+ if(typeof(value) == "boolean")
+ el.checked = value;
+ else if(el.value == value)
+ el.checked = true;
+ });
+ },
+
+ /**
+ * Set checked attribute of elements by array of values.
+ * @function ?
+ * @param {element[]} elements - Array of checkable DOM elements
+ * @param {string[]} values - Values that should be checked
+ *
+ */
+ checkValues : function(elements, values)
+ {
+ var selection = this;
+ jQuery(values).each(function(idx, value)
+ {
+ selection.checkValue(elements, value);
+ })
+ },
+
+ /**
+ * Set checked attribute of elements by list index.
+ * @function ?
+ * @param {element[]} elements - Array of checkable DOM elements
+ * @param {int} index - Index of element to set checked
+ */
+ checkIndex : function(elements, index)
+ {
+ for(var i = 0; i<elements.length; i++)
+ {
+ if(i == index)
+ elements[i].checked = true;
+ }
+ },
+
+ /**
+ * Set checked attribute of elements by array of list indices.
+ * @function ?
+ * @param {element[]} elements - Array of selectable DOM elements
+ * @param {int[]} indices - Array of list indices to set checked
+ */
+ checkIndices : function(elements, indices)
+ {
+ var selection = this;
+ jQuery.each(indices, function(idx, index)
+ {
+ selection.checkIndex(elements, index);
+ })
+ },
+
+ /**
+ * Uncheck elements.
+ * @function ?
+ * @param {element[]} elements - Array of checkable DOM elements
+ */
+ checkClear : function(elements)
+ {
+ jQuery.each(elements, function(idx, el)
+ {
+ el.checked = false;
+ });
+ },
+
+ /**
+ * Set checked attribute of all elements to true.
+ * @function ?
+ * @param {element[]} elements - Array of checkable DOM elements
+ */
+ checkAll : function(elements)
+ {
+ jQuery.each(elements, function(idx, el)
+ {
+ el.checked = true;
+ })
+ },
+
+ /**
+ * Toggle the checked attribute of elements.
+ * @function ?
+ * @param {element[]} elements - Array of selectable DOM elements
+ */
+ checkInvert : function(elements)
+ {
+ jQuery.each(elements, function(idx, el)
+ {
+ el.checked = !el.checked;
+ })
+ }
+};
+
+jQuery.extend(String.prototype, {
+
+ /**
+ * Add padding to string
+ * @function {string} ?
+ * @param {string} side - "left" to pad the string on the left, "right" to pad right.
+ * @param {int} len - Minimum string length.
+ * @param {string} chr - Character(s) to pad
+ * @returns Padded string
+ */
+ pad : function(side, len, chr) {
+ if (!chr) chr = ' ';
+ var s = this;
+ var left = side.toLowerCase()=='left';
+ while (s.length<len) s = left? chr + s : s + chr;
+ return s;
+ },
+
+ /**
+ * Add left padding to string
+ * @function {string} ?
+ * @param {int} len - Minimum string length.
+ * @param {string} chr - Character(s) to pad
+ * @returns Padded string
+ */
+ padLeft : function(len, chr) {
+ return this.pad('left',len,chr);
+ },
+
+ /**
+ * Add right padding to string
+ * @function {string} ?
+ * @param {int} len - Minimum string length.
+ * @param {string} chr - Character(s) to pad
+ * @returns Padded string
+ */
+ padRight : function(len, chr) {
+ return this.pad('right',len,chr);
+ },
+
+ /**
+ * Add zeros to the right of string
+ * @function {string} ?
+ * @param {int} len - Minimum string length.
+ * @returns Padded string
+ */
+ zerofill : function(len) {
+ return this.padLeft(len,'0');
+ },
+
+ /**
+ * Remove white spaces from both ends of string.
+ * @function {string} ?
+ * @returns Trimmed string
+ */
+ trim : function() {
+ return this.replace(/^\s+|\s+$/g,'');
+ },
+
+ /**
+ * Remove white spaces from the left side of string.
+ * @function {string} ?
+ * @returns Trimmed string
+ */
+ trimLeft : function() {
+ return this.replace(/^\s+/,'');
+ },
+
+ /**
+ * Remove white spaces from the right side of string.
+ * @function {string} ?
+ * @returns Trimmed string
+ */
+ trimRight : function() {
+ return this.replace(/\s+$/,'');
+ },
+
+ /**
+ * Convert period separated function names into a function reference.
+ * <br />Example:
* <pre>
- * var browser = Prado.Browser();
- * alert(browser.ie); //should ouput true if IE, false otherwise
+ * "Prado.AJAX.Callback.Action.setValue".toFunction()
* </pre>
- * @function {object} ?
- * @version 1.0
- * @returns browserinfo
- * @... {string} agent - Reported user agent
- * @... {string} ver - Reported agent version
- * @... {0|1} dom - 1 for DOM browsers
- * @... {0|1} ns4 - 1 for Netscape 4
- * @... {0|1} ns6 - 1 for Netscape 6 and Firefox
- * @... {boolean} ie3 - true for IE 3
- * @... {0|1} ie5 - 1 for IE 5
- * @... {0|1} ie6 - 1 for IE 6
- * @... {0|1} ie4 - 1 for IE 4
- * @... {0|1} ie - 1 for IE 4-6
- * @... {0|1} hotjava - 1 for HotJava
- * @... {0|1} ver3 - 1 for IE3 and HotJava
- * @... {0|1} opera - 1 for Opera
- * @... {boolean} opera7 - true for Opera 7
- * @... {0|1} operaOld - 1 for older Opera
- * @... {0|1} bw - 1 for IE 4-6, Netscape 4&6, Firefox and Opera
- * @... {boolean} mac - true for mac systems
- * @... {static} Version - Version of returned structure (1.0)
- */
- Browser : function()
- {
- var info = { Version : "1.0" };
- var is_major = parseInt( navigator.appVersion );
- info.nver = is_major;
- info.ver = navigator.appVersion;
- info.agent = navigator.userAgent;
- info.dom = document.getElementById ? 1 : 0;
- info.opera = window.opera ? 1 : 0;
- info.ie5 = ( info.ver.indexOf( "MSIE 5" ) > -1 && info.dom && !info.opera ) ? 1 : 0;
- info.ie6 = ( info.ver.indexOf( "MSIE 6" ) > -1 && info.dom && !info.opera ) ? 1 : 0;
- info.ie4 = ( document.all && !info.dom && !info.opera ) ? 1 : 0;
- info.ie = info.ie4 || info.ie5 || info.ie6;
- info.mac = info.agent.indexOf( "Mac" ) > -1;
- info.ns6 = ( info.dom && parseInt( info.ver ) >= 5 ) ? 1 : 0;
- info.ie3 = ( info.ver.indexOf( "MSIE" ) && ( is_major < 4 ) );
- info.hotjava = ( info.agent.toLowerCase().indexOf( 'hotjava' ) != -1 ) ? 1 : 0;
- info.ns4 = ( document.layers && !info.dom && !info.hotjava ) ? 1 : 0;
- info.bw = ( info.ie6 || info.ie5 || info.ie4 || info.ns4 || info.ns6 || info.opera );
- info.ver3 = ( info.hotjava || info.ie3 );
- info.opera7 = ( ( info.agent.toLowerCase().indexOf( 'opera 7' ) > -1 ) || ( info.agent.toLowerCase().indexOf( 'opera/7' ) > -1 ) );
- info.operaOld = info.opera && !info.opera7;
- return info;
- },
-
- /**
- * Import CSS from Url.
- * @function ?
- * @param doc - document DOM object
- * @param css_file - Url to CSS file
- */
- ImportCss : function(doc, css_file)
- {
- if (Prado.Browser().ie)
- var styleSheet = doc.createStyleSheet(css_file);
+ * @function {function} ?
+ * @returns Reference to the corresponding function
+ */
+ toFunction : function()
+ {
+ var commands = this.split(/\./);
+ var command = window;
+ jQuery(commands).each(function(idx, action)
+ {
+ if(command[new String(action)])
+ command=command[new String(action)];
+ });
+ if(typeof(command) == "function")
+ return command;
else
{
- var elm = doc.createElement("link");
+ if(typeof Logger != "undefined")
+ Logger.error("Missing function", this);
- elm.rel = "stylesheet";
- elm.href = css_file;
- var headArr;
+ throw new Error ("Missing function '"+this+"'");
+ }
+ },
- if (headArr = doc.getElementsByTagName("head"))
- headArr[0].appendChild(elm);
+ /**
+ * Convert string into integer, returns null if not integer.
+ * @function {int} ?
+ * @returns Integer, null if string does not represent an integer.
+ */
+ toInteger : function()
+ {
+ var exp = /^\s*[-\+]?\d+\s*$/;
+ if (this.match(exp) == null)
+ return null;
+ var num = parseInt(this, 10);
+ return (isNaN(num) ? null : num);
+ },
+
+ /**
+ * Convert string into a double/float value. <b>Internationalization
+ * is not supported</b>
+ * @function {double} ?
+ * @param {string} decimalchar - Decimal character, defaults to "."
+ * @returns Double, null if string does not represent a float value
+ */
+ toDouble : function(decimalchar)
+ {
+ if(this.length <= 0) return null;
+ decimalchar = decimalchar || ".";
+ var exp = new RegExp("^\\s*([-\\+])?(\\d+)?(\\" + decimalchar + "(\\d+))?\\s*$");
+ var m = this.match(exp);
+
+ if (m == null)
+ return null;
+ m[1] = m[1] || "";
+ m[2] = m[2] || "0";
+ m[4] = m[4] || "0";
+
+ var cleanInput = m[1] + (m[2].length>0 ? m[2] : "0") + "." + m[4];
+ var num = parseFloat(cleanInput);
+ return (isNaN(num) ? null : num);
+ },
+
+ /**
+ * Convert strings that represent a currency value to float.
+ * E.g. "10,000.50" will become "10000.50". The number
+ * of dicimal digits, grouping and decimal characters can be specified.
+ * <i>The currency input format is <b>very</b> strict, null will be returned if
+ * the pattern does not match</i>.
+ * @function {double} ?
+ * @param {string} groupchar - Grouping character, defaults to ","
+ * @param {int} digits - Number of decimal digits
+ * @param {string} decimalchar - Decimal character, defaults to "."
+ * @returns Double, null if string does not represent a currency value
+ */
+ toCurrency : function(groupchar, digits, decimalchar)
+ {
+ groupchar = groupchar || ",";
+ decimalchar = decimalchar || ".";
+ digits = typeof(digits) == "undefined" ? 2 : digits;
+
+ var exp = new RegExp("^\\s*([-\\+])?(((\\d+)\\" + groupchar + ")*)(\\d+)"
+ + ((digits > 0) ? "(\\" + decimalchar + "(\\d{1," + digits + "}))?" : "")
+ + "\\s*$");
+ var m = this.match(exp);
+ if (m == null)
+ return null;
+ var intermed = m[2] + m[5] ;
+ var cleanInput = m[1] + intermed.replace(
+ new RegExp("(\\" + groupchar + ")", "g"), "")
+ + ((digits > 0) ? "." + m[7] : "");
+ var num = parseFloat(cleanInput);
+ return (isNaN(num) ? null : num);
+ }
+});
+
+jQuery.extend(Date.prototype,
+{
+ /**
+ * SimpleFormat
+ * @function ?
+ * @param {string} format - TODO
+ * @param {string} data - TODO
+ * @returns TODO
+ */
+ SimpleFormat: function(format, data)
+ {
+ data = data || {};
+ var bits = new Array();
+ bits['d'] = this.getDate();
+ bits['dd'] = String(this.getDate()).zerofill(2);
+
+ bits['M'] = this.getMonth()+1;
+ bits['MM'] = String(this.getMonth()+1).zerofill(2);
+ if(data.AbbreviatedMonthNames)
+ bits['MMM'] = data.AbbreviatedMonthNames[this.getMonth()];
+ if(data.MonthNames)
+ bits['MMMM'] = data.MonthNames[this.getMonth()];
+ var yearStr = "" + this.getFullYear();
+ yearStr = (yearStr.length == 2) ? '19' + yearStr: yearStr;
+ bits['yyyy'] = yearStr;
+ bits['yy'] = bits['yyyy'].toString().substr(2,2);
+
+ // do some funky regexs to replace the format string
+ // with the real values
+ var frm = new String(format);
+ for (var sect in bits)
+ {
+ var reg = new RegExp("\\b"+sect+"\\b" ,"g");
+ frm = frm.replace(reg, bits[sect]);
}
+ return frm;
+ },
+
+ /**
+ * toISODate
+ * @function {string} ?
+ * @returns TODO
+ */
+ toISODate : function()
+ {
+ var y = this.getFullYear();
+ var m = String(this.getMonth() + 1).zerofill(2);
+ var d = String(this.getDate()).zerofill(2);
+ return String(y) + String(m) + String(d);
}
-};
+});
+
+jQuery.extend(Date,
+{
+ /**
+ * SimpleParse
+ * @function ?
+ * @param {string} format - TODO
+ * @param {string} data - TODO
+ * @returns TODO
+ */
+ SimpleParse: function(value, format)
+ {
+ var val=String(value);
+ format=String(format);
+
+ if(val.length <= 0) return null;
+
+ if(format.length <= 0) return new Date(value);
+
+ var isInteger = function (val)
+ {
+ var digits="1234567890";
+ for (var i=0; i < val.length; i++)
+ {
+ if (digits.indexOf(val.charAt(i))==-1) { return false; }
+ }
+ return true;
+ };
+
+ var getInt = function(str,i,minlength,maxlength)
+ {
+ for (var x=maxlength; x>=minlength; x--)
+ {
+ var token=str.substring(i,i+x);
+ if (token.length < minlength) { return null; }
+ if (isInteger(token)) { return token; }
+ }
+ return null;
+ };
+
+ var i_val=0;
+ var i_format=0;
+ var c="";
+ var token="";
+ var token2="";
+ var x,y;
+ var now=new Date();
+ var year=now.getFullYear();
+ var month=now.getMonth()+1;
+ var date=1;
+
+ while (i_format < format.length)
+ {
+ // Get next token from format string
+ c=format.charAt(i_format);
+ token="";
+ while ((format.charAt(i_format)==c) && (i_format < format.length))
+ {
+ token += format.charAt(i_format++);
+ }
+
+ // Extract contents of value based on format token
+ if (token=="yyyy" || token=="yy" || token=="y")
+ {
+ if (token=="yyyy") { x=4;y=4; }
+ if (token=="yy") { x=2;y=2; }
+ if (token=="y") { x=2;y=4; }
+ year=getInt(val,i_val,x,y);
+ if (year==null) { return null; }
+ i_val += year.length;
+ if (year.length==2)
+ {
+ if (year > 70) { year=1900+(year-0); }
+ else { year=2000+(year-0); }
+ }
+ }
+
+ else if (token=="MM"||token=="M")
+ {
+ month=getInt(val,i_val,token.length,2);
+ if(month==null||(month<1)||(month>12)){return null;}
+ i_val+=month.length;
+ }
+ else if (token=="dd"||token=="d")
+ {
+ date=getInt(val,i_val,token.length,2);
+ if(date==null||(date<1)||(date>31)){return null;}
+ i_val+=date.length;
+ }
+ else
+ {
+ if (val.substring(i_val,i_val+token.length)!=token) {return null;}
+ else {i_val+=token.length;}
+ }
+ }
+
+ // If there are any trailing characters left in the value, it doesn't match
+ if (i_val != val.length) { return null; }
+
+ // Is date valid for month?
+ if (month==2)
+ {
+ // Check for leap year
+ if ( ( (year%4==0)&&(year%100 != 0) ) || (year%400==0) ) { // leap year
+ if (date > 29){ return null; }
+ }
+ else { if (date > 28) { return null; } }
+ }
+
+ if ((month==4)||(month==6)||(month==9)||(month==11))
+ {
+ if (date > 30) { return null; }
+ }
+
+ var newdate=new Date(year,month-1,date, 0, 0, 0);
+ return newdate;
+ }
+});
diff --git a/framework/Web/Javascripts/source/prado/ratings/ratings.js b/framework/Web/Javascripts/source/prado/ratings/ratings.js
index 1369c740..eb541b99 100644
--- a/framework/Web/Javascripts/source/prado/ratings/ratings.js
+++ b/framework/Web/Javascripts/source/prado/ratings/ratings.js
@@ -1,78 +1,67 @@
-Prado.WebUI.TRatingList = Base.extend(
+Prado.WebUI.TRatingList = jQuery.klass(Prado.WebUI.Control,
{
selectedIndex : -1,
rating: -1,
readOnly : false,
- constructor : function(options)
+ onInit : function(options)
{
- var cap = $(options.CaptionID);
- this.options = Object.extend(
+ var cap = $('#'+options.CaptionID).get(0);
+ this.options = jQuery.extend(
{
caption : cap ? cap.innerHTML : ''
}, options || {});
- Prado.WebUI.TRatingList.register(this);
- this._init();
- Prado.Registry.set(options.ListID, this);
- this.selectedIndex = options.SelectedIndex;
- this.rating = options.Rating;
- this.readOnly = options.ReadOnly
- if(options.Rating <= 0 && options.SelectedIndex >= 0)
- this.rating = options.SelectedIndex+1;
- this.setReadOnly(this.readOnly);
- },
+ this.radios = [];
- _init: function(options)
- {
- Element.addClassName($(this.options.ListID),this.options.Style);
- this.radios = new Array();
- this._mouseOvers = new Array();
- this._mouseOuts = new Array();
- this._clicks = new Array();
- var index=0;
- for(var i = 0; i<this.options.ItemCount; i++)
+ $('#'+options.ID).addClass(options.Style);
+ for(var i = 0; i<options.ItemCount; i++)
{
- var radio = $(this.options.ListID+'_c'+i);
+ var radio = $('#'+options.ID+"_c"+i).get(0);
var td = radio.parentNode.parentNode;
+
if(radio && td.tagName.toLowerCase()=='td')
{
this.radios.push(radio);
- this._mouseOvers.push(this.hover.bindEvent(this,index));
- this._mouseOuts.push(this.recover.bindEvent(this,index));
- this._clicks.push(this.click.bindEvent(this,index));
- index++;
- Element.addClassName(td,"rating");
+ $(td).addClass("rating");
}
}
+
+ this.selectedIndex = options.SelectedIndex;
+ this.rating = options.Rating;
+ this.readOnly = options.ReadOnly
+ if(options.Rating <= 0 && options.SelectedIndex >= 0)
+ this.rating = options.SelectedIndex+1;
+ this.setReadOnly(this.readOnly);
},
- hover : function(ev,index)
+ hover : function(index, ev)
{
if(this.readOnly==true) return;
+
for(var i = 0; i<this.radios.length; i++)
{
var node = this.radios[i].parentNode.parentNode;
- var action = i <= index ? 'addClassName' : 'removeClassName'
- Element[action](node,"rating_hover");
- Element.removeClassName(node,"rating_selected");
- Element.removeClassName(node,"rating_half");
+ if(i <= index)
+ $(node).addClass('rating_hover');
+ else
+ $(node).removeClass('rating_hover');
+ $(node).removeClass("rating_selected");
+ $(node).removeClass("rating_half");
}
this.showCaption(this.getIndexCaption(index));
},
- recover : function(ev,index)
+ recover : function(index, ev)
{
if(this.readOnly==true) return;
this.showRating(this.rating);
this.showCaption(this.options.caption);
},
- click : function(ev, index)
+ click : function(index, ev)
{
if(this.readOnly==true) return;
- for(var i = 0; i<this.radios.length; i++)
- this.radios[i].checked = (i == index);
this.selectedIndex = index;
this.setRating(index+1);
@@ -83,13 +72,13 @@ Prado.WebUI.TRatingList = Base.extend(
dispatchRequest : function(ev)
{
- var requestOptions = Object.extend(
+ var requestOptions =jQuery.extend({}, this.options,
{
- ID : this.options.ListID+"_c"+this.selectedIndex,
+ ID : this.options.ID+"_c"+this.selectedIndex,
EventTarget : this.options.ListName+"$c"+this.selectedIndex
- },this.options);
- Prado.PostBack(ev, requestOptions);
- },
+ });
+ new Prado.PostBack(requestOptions, ev);
+ },
setRating : function(value)
{
@@ -119,16 +108,19 @@ Prado.WebUI.TRatingList = Base.extend(
for(var i = 0; i<this.radios.length; i++)
{
var node = this.radios[i].parentNode.parentNode;
- var action = i > index ? 'removeClassName' : 'addClassName';
- Element[action](node, "rating_selected");
+ if(i <= index)
+ $(node).addClass('rating_selected');
+ else
+ $(node).removeClass('rating_selected');
+
if(i==index+1 && hasHalf)
- Element.addClassName(node, "rating_half");
+ $(node).addClass("rating_half");
else
- Element.removeClassName(node, "rating_half");
- Element.removeClassName(node,"rating_hover");
+ $(node).removeClass("rating_half");
+ $(node).removeClass("rating_hover");
}
},
-
+
getIndexCaption : function(index)
{
return index > -1 ? this.radios[index].value : this.options.caption;
@@ -136,9 +128,8 @@ Prado.WebUI.TRatingList = Base.extend(
showCaption : function(value)
{
- var caption = $(this.options.CaptionID);
- if(caption) caption.innerHTML = value;
- $(this.options.ListID).title = value;
+ $('#'+this.options.CaptionID).html(value);
+ $('#'+this.options.ID).attr( "title", value);
},
setCaption : function(value)
@@ -152,55 +143,37 @@ Prado.WebUI.TRatingList = Base.extend(
this.readOnly = value;
for(var i = 0; i<this.radios.length; i++)
{
-
- var action = value ? 'addClassName' : 'removeClassName';
- Element[action](this.radios[i].parentNode.parentNode, "rating_disabled");
-
- var action = value ? 'stopObserving' : 'observe';
- var td = this.radios[i].parentNode.parentNode;
- Event[action](td, "mouseover", this._mouseOvers[i]);
- Event[action](td, "mouseout", this._mouseOuts[i]);
- Event[action](td, "click", this._clicks[i]);
+ var node = this.radios[i].parentNode.parentNode;
+ if(value)
+ {
+ $(node).addClass('rating_disabled');
+ $(node).off('mouseover', jQuery.proxy(this.hover, this, i));
+ $(node).off('mouseout', jQuery.proxy(this.recover, this, i));
+ $(node).off('click', jQuery.proxy(this.click, this, i));
+ } else {
+ $(node).removeClass('rating_disabled');
+ $(node).on('mouseover', jQuery.proxy(this.hover, this, i));
+ $(node).on('mouseout', jQuery.proxy(this.recover, this, i));
+ $(node).on('click', jQuery.proxy(this.click, this, i));
+ }
}
this.showRating(this.rating);
}
-},
-{
-ratings : {},
-register : function(rating)
-{
- Prado.WebUI.TRatingList.ratings[rating.options.ListID] = rating;
-},
-
-setReadOnly : function(id,value)
-{
- Prado.WebUI.TRatingList.ratings[id].setReadOnly(value);
-},
-
-setRating : function(id,value)
-{
- Prado.WebUI.TRatingList.ratings[id].setRating(value);
-},
-
-setCaption : function(id,value)
-{
- Prado.WebUI.TRatingList.ratings[id].setCaption(value);
-}
});
-Prado.WebUI.TActiveRatingList = Prado.WebUI.TRatingList.extend(
-{
+Prado.WebUI.TActiveRatingList = jQuery.klass(Prado.WebUI.TRatingList,
+{
dispatchRequest : function(ev)
{
- var requestOptions = Object.extend(
+ var requestOptions =jQuery.extend({}, this.options,
{
- ID : this.options.ListID+"_c"+this.selectedIndex,
+ ID : this.options.ID+"_c"+this.selectedIndex,
EventTarget : this.options.ListName+"$c"+this.selectedIndex
- },this.options);
+ });
var request = new Prado.CallbackRequest(requestOptions.EventTarget, requestOptions);
if(request.dispatch()==false)
- Event.stop(ev);
+ ev.preventDefault();
}
-
+
});
diff --git a/framework/Web/Javascripts/source/prado/validator/validation3.js b/framework/Web/Javascripts/source/prado/validator/validation3.js
index 0361389f..9f8c7a98 100644
--- a/framework/Web/Javascripts/source/prado/validator/validation3.js
+++ b/framework/Web/Javascripts/source/prado/validator/validation3.js
@@ -1,24 +1,24 @@
/**
* Prado client-side javascript validation fascade.
*
- * <p>There are 4 basic classes: {@link Prado.Validation},
+ * <p>There are 4 basic classes: {@link Prado.Validation},
* {@link Prado.ValidationManager}, {@link Prado.WebUI.TValidationSummary}
- * and {@link Prado.WebUI.TBaseValidator},
+ * and {@link Prado.WebUI.TBaseValidator},
* that interact together to perform validation.
* The {@link Prado.Validation} class co-ordinates together the
* validation scheme and is responsible for maintaining references
* to ValidationManagers.</p>
*
- * <p>The {@link Prado.ValidationManager} class is responsible for
+ * <p>The {@link Prado.ValidationManager} class is responsible for
* maintaining refereneces
* to individual validators, validation summaries and their associated
* groupings.</p>
*
- * <p>The {@link Prado.WebUI.TValidationSummary} takes care of displaying
+ * <p>The {@link Prado.WebUI.TValidationSummary} takes care of displaying
* the validator error messages
* as html output or an alert output.</p>
*
- * <p>The {@link Prado.WebUI.TBaseValidator} is the base class for all
+ * <p>The {@link Prado.WebUI.TBaseValidator} is the base class for all
* validators and contains
* methods to interact with the actual inputs, data type conversion.</p>
*
@@ -57,15 +57,15 @@
* &lt;/div&gt;
* &lt;/form&gt;
* </pre>
- *
+ *
* @module validation
*/
-
-Prado.Validation = Class.create();
+
+Prado.Validation = jQuery.klass();
/**
* Global Validation Object.
- *
+ *
* <p>To validate the inputs of a particular form, call
* <code>{@link Prado.Validation.validate}(formID, groupID)</code>
* where <tt>formID</tt> is the HTML form ID, and the optional
@@ -73,10 +73,10 @@ Prado.Validation = Class.create();
* in a particular group.</p>
* <p>Use <code>{@link Prado.Validation.validateControl}(controlClientID)</code>
* to trigger validation for a single control.</p>
- *
+ *
* @object {static} Prado.Validation
*/
-Object.extend(Prado.Validation,
+jQuery.extend(Prado.Validation,
{
/**
* Hash of registered validation managers
@@ -111,10 +111,10 @@ Object.extend(Prado.Validation,
/**
* Validate all validators of a specific control.
* @function {boolean} ?
- * @param {string} id - ID of DOM element to validate
+ * @param {string} id - ID of DOM element to validate
* @return true if all validators are valid or no validators present, false otherwise.
*/
- validateControl : function(id)
+ validateControl : function(id)
{
var formId=this.getForm();
@@ -133,8 +133,10 @@ Object.extend(Prado.Validation,
*/
getForm : function()
{
- var keys = $H(this.managers).keys();
- return keys[0];
+ var keys = jQuery.map(this.managers, function(value, key) {
+ return key;
+ });
+ return keys.length>0 ? keys[0] : null;
},
/**
@@ -201,24 +203,24 @@ Object.extend(Prado.Validation,
setErrorMessage : function(validatorID, message)
{
- $H(Prado.Validation.managers).each(function(manager)
+ jQuery.each(Prado.Validation.managers, function(manager)
{
- manager[1].validators.each(function(validator)
+ jQuery.each(manager.validators, function(validator)
{
if(validator.options.ID == validatorID)
{
validator.options.ErrorMessage = message;
- $(validatorID).innerHTML = message;
+ jQuery("#" + validatorID).get(0).innerHTML = message;
}
});
});
},
-
+
updateActiveCustomValidator : function(validatorID, isValid)
{
- $H(Prado.Validation.managers).each(function(manager)
+ jQuery.each(Prado.Validation.managers, function(idx, manager)
{
- manager[1].validators.each(function(validator)
+ jQuery.each(manager.validators, function(idx, validator)
{
if(validator.options.ID == validatorID)
{
@@ -231,15 +233,15 @@ Object.extend(Prado.Validation,
/**
* Manages validators for a particular HTML form.
- *
+ *
* <p>The manager contains references to all the validators
* summaries, and their groupings for a particular form.
* Generally, {@link Prado.Validation} methods should be called rather
* than calling directly the ValidationManager.</p>
- *
+ *
* @class Prado.ValidationManager
*/
-Prado.ValidationManager = Class.create();
+Prado.ValidationManager = jQuery.klass();
Prado.ValidationManager.prototype =
{
/**
@@ -262,20 +264,20 @@ Prado.ValidationManager.prototype =
* List of validators
* @var {TBaseValidator[]} validators
*/
- this.validators = [];
+ this.validators = [];
/**
* List of validation summaries
* @var {TValidationSummary[]} summaries
*/
- this.summaries = [];
+ this.summaries = [];
/**
* List of ValidationGroups
* @var {string[]} groups
*/
- this.groups = [];
+ this.groups = [];
/**
* Options of this ValidationManager
- * @var {object} options
+ * @var {object} options
*/
this.options = {};
@@ -301,7 +303,10 @@ Prado.ValidationManager.prototype =
*/
reset : function(group)
{
- this.validatorPartition(group)[0].invoke('reset');
+ var vals = this.validatorPartition(group)[0];
+ for(var i = 0; i < vals.length; i++)
+ vals[i].reset();
+
this.updateSummary(group, true);
},
@@ -316,9 +321,14 @@ Prado.ValidationManager.prototype =
validate : function(group, source)
{
var partition = this.validatorPartition(group);
- var valid = partition[0].invoke('validate', source).all();
+ var valid=true;
+ for(var i = 0; i < partition[0].length; i++)
+ {
+ if(!partition[0][i].validate(source))
+ valid=false;
+ }
this.focusOnError(partition[0]);
- partition[1].invoke('hide');
+ jQuery(partition[1]).hide();
this.updateSummary(group, true);
return valid;
},
@@ -326,10 +336,10 @@ Prado.ValidationManager.prototype =
/**
* Perform validation for all validators of a single control.
* @function {boolean} ?
- * @param {string} id - ID of DOM element to validate
+ * @param {string} id - ID of DOM element to validate
* @return true if all validators are valid or no validators present, false otherwise.
*/
- validateControl : function (id)
+ validateControl : function (id)
{
return this.controls[id] ? this.controls[id].invoke('validate',null).all() : true;
},
@@ -350,8 +360,8 @@ Prado.ValidationManager.prototype =
/**
* Get all validators in a group and all other validators.
- * Returns an array with two arrays of validators. The first
- * array contains all validators in the group if group is given,
+ * Returns an array with two arrays of validators. The first
+ * array contains all validators in the group if group is given,
* otherwhise all validators without a group. The second array
* contains all other validators.
* @function {[ TBaseValidator[] , TBaseValidator[] ]} ?
@@ -365,7 +375,7 @@ Prado.ValidationManager.prototype =
/**
* Get all validators in a group.
- * Returns an array with two arrays of validators. The first
+ * Returns an array with two arrays of validators. The first
* array contains all validators in the group. The second array
* contains all other validators.
* @function {[ TBaseValidator[] , TBaseValidator[] ]} ?
@@ -374,12 +384,16 @@ Prado.ValidationManager.prototype =
*/
validatorsInGroup : function(groupID)
{
- if(this.groups.include(groupID))
+ if(jQuery.inArray(groupID, this.groups)!=-1)
{
- return this.validators.partition(function(val)
- {
- return val.group == groupID;
+ var trues = [], falses = [];
+ jQuery.each(this.validators, function(idx, val) {
+ if(val.group == groupID)
+ trues.push(val);
+ else
+ falses.push(val);
});
+ return [trues, falses];
}
else
return [[],[]];
@@ -387,8 +401,8 @@ Prado.ValidationManager.prototype =
/**
* Get all validators without a group.
- * Returns an array with two arrays of validators. The first
- * array contains all validators without a group. The second
+ * Returns an array with two arrays of validators. The first
+ * array contains all validators without a group. The second
* array contains all other validators.
* @function {[ TBaseValidator[] , TBaseValidator[] ]} ?
* @return Array with two arrays of validators: Array[0] has all
@@ -396,15 +410,19 @@ Prado.ValidationManager.prototype =
*/
validatorsWithoutGroup : function()
{
- return this.validators.partition(function(val)
- {
- return !val.group;
+ var trues = [], falses = [];
+ jQuery.each(this.validators, function(idx, val) {
+ if(!val.group)
+ trues.push(val);
+ else
+ falses.push(val);
});
+ return [trues, falses];
},
/**
* Get the state of validators.
- * If group is set, only validators in that group are checked.
+ * If group is set, only validators in that group are checked.
* Otherwhise only validators without a group are checked.
* @function {booelan} ?
* @param {optional string} group - ID of ValidationGroup
@@ -412,7 +430,13 @@ Prado.ValidationManager.prototype =
*/
isValid : function(group)
{
- return this.validatorPartition(group)[0].pluck('isValid').all();
+ for(var i = 0; i < this.validatorPartition(group)[0]; i++)
+ {
+ if(!this.validatorPartition(group)[0].isValid())
+ return false;
+ }
+
+ return true;
},
/**
@@ -427,7 +451,7 @@ Prado.ValidationManager.prototype =
this.removeValidator(validator);
this.validators.push(validator);
- if(validator.group && !this.groups.include(validator.group))
+ if(validator.group && jQuery.inArray(validator.group, this.groups)==-1)
this.groups.push(validator.group);
if (typeof this.controls[validator.control.id] === 'undefined')
@@ -452,20 +476,21 @@ Prado.ValidationManager.prototype =
*/
removeValidator : function(validator)
{
- this.validators = this.validators.reject(function(v)
+ this.validators = jQuery.grep(this.validators, function(v)
{
- return (v.options.ID==validator.options.ID);
+ return (v.options.ID!=validator.options.ID);
});
+ // WTF?
if (this.controls[validator.control.id])
- this.controls[validator.control.id].reject( function(v)
+ jQuery.grep(this.controls[validator.control.id], function(v)
{
- return (v.options.ID==validator.options.ID)
+ return (v.options.ID!=validator.options.ID)
});
},
/**
* Gets validators with errors.
- * If group is set, only validators in that group are returned.
+ * If group is set, only validators in that group are returned.
* Otherwhise only validators without a group are returned.
* @function {TBaseValidator[]} ?
* @param {optional string} group - ID of ValidationGroup
@@ -473,7 +498,7 @@ Prado.ValidationManager.prototype =
*/
getValidatorsWithError : function(group)
{
- return this.validatorPartition(group)[0].findAll(function(validator)
+ return jQuery.grep(this.validatorPartition(group)[0], function(validator)
{
return !validator.isValid;
});
@@ -481,8 +506,8 @@ Prado.ValidationManager.prototype =
/**
* Update the summary of a particular group.
- * If group is set, only the summary for validators in that
- * group is updated. Otherwhise only the summary for validators
+ * If group is set, only the summary for validators in that
+ * group is updated. Otherwhise only the summary for validators
* without a group is updated.
* @function ?
* @param {optional string} group - ID of ValidationGroup
@@ -491,7 +516,7 @@ Prado.ValidationManager.prototype =
updateSummary : function(group, refresh)
{
var validators = this.getValidatorsWithError(group);
- this.summaries.each(function(summary)
+ jQuery.each(this.summaries, function(idx, summary)
{
var inGroup = group && summary.group == group;
var noGroup = !group || !summary.group;
@@ -505,7 +530,7 @@ Prado.ValidationManager.prototype =
/**
* TValidationSummary displays a summary of validation errors.
- *
+ *
* <p>The summary is displayed inline on a Web page,
* in a message box, or both. By default, a validation summary will collect
* <tt>ErrorMessage</tt> of all failed validators on the page. If
@@ -519,10 +544,10 @@ Prado.ValidationManager.prototype =
* <p>The summary can be displayed on the Web page and in a message box by setting
* the <tt>ShowSummary</tt> and <tt>ShowMessageBox</tt>
* options, respectively.</p>
- *
+ *
* @class Prado.WebUI.TValidationSummary
*/
-Prado.WebUI.TValidationSummary = Class.create();
+Prado.WebUI.TValidationSummary = jQuery.klass();
Prado.WebUI.TValidationSummary.prototype =
{
/**
@@ -546,7 +571,7 @@ Prado.WebUI.TValidationSummary.prototype =
{
/**
* Validator options
- * @var {object} options
+ * @var {object} options
*/
this.options = options;
/**
@@ -558,13 +583,13 @@ Prado.WebUI.TValidationSummary.prototype =
* Summary DOM element
* @var {element} messages
*/
- this.messages = $(options.ID);
- Prado.Registry.set(options.ID, this);
+ this.messages = jQuery("#" + options.ID).get(0);
+ Prado.Registry[options.ID] = this;
if(this.messages)
{
/**
- * Current visibility state of summary
- * @var {boolean} visible
+ * Current visibility state of summary
+ * @var {boolean} visible
*/
this.visible = this.messages.style.visibility != "hidden"
this.visible = this.visible && this.messages.style.display != "none";
@@ -592,7 +617,14 @@ Prado.WebUI.TValidationSummary.prototype =
var refresh = update || this.visible == false || this.options.Refresh != false;
// Also, do not refresh summary if at least 1 validator is waiting for callback response.
// This will avoid the flickering of summary if the validator passes its test
- refresh = refresh && validators.any(function(v) { return !v.requestDispatched; });
+ for(var i = 0; i < validators.length; i++)
+ {
+ if(validators[i].requestDispatched)
+ {
+ refresh=false;
+ break;
+ }
+ }
if(this.options.ShowSummary != false && refresh)
{
@@ -619,7 +651,7 @@ Prado.WebUI.TValidationSummary.prototype =
{
while(this.messages.childNodes.length > 0)
this.messages.removeChild(this.messages.lastChild);
- this.messages.insert(this.formatSummary(messages));
+ jQuery(this.messages).append(this.formatSummary(messages));
},
/**
@@ -635,14 +667,14 @@ Prado.WebUI.TValidationSummary.prototype =
/**
* Get messages from validators.
- * @function {string[]} ?
+ * @function {string[]} ?
* @param {TBaseValidator[]} validators - Array of validators.
* @return Array of validator error messages.
*/
getMessages : function(validators)
{
var messages = [];
- validators.each(function(validator)
+ jQuery.each(validators, function(idx, validator)
{
var message = validator.getErrorMessage();
if(typeof(message) == 'string' && message.length > 0)
@@ -666,7 +698,7 @@ Prado.WebUI.TValidationSummary.prototype =
{
this.messages.style.visibility="hidden";
if(this.options.Display == "None" || this.options.Display == "Dynamic")
- this.messages.hide();
+ jQuery(this.messages).hide();
}
this.visible = false;
},
@@ -682,7 +714,7 @@ Prado.WebUI.TValidationSummary.prototype =
if(typeof(this.options.OnShowSummary) == "function")
this.options.OnShowSummary(this,validators);
else
- this.messages.show();
+ jQuery(this.messages).show();
this.visible = true;
},
@@ -724,7 +756,7 @@ Prado.WebUI.TValidationSummary.prototype =
var format = this.formats(this.options.DisplayMode);
var output = this.options.HeaderText ? this.options.HeaderText + format.header : "";
output += format.first;
- messages.each(function(message)
+ jQuery.each(messages, function(idx, message)
{
output += message.length > 0 ? format.pre + message + format.post : "";
});
@@ -743,7 +775,7 @@ Prado.WebUI.TValidationSummary.prototype =
{
if(this.options.DisplayMode == 'HeaderOnly' && this.options.HeaderText)
return this.options.HeaderText;
-
+
var output = this.options.HeaderText ? this.options.HeaderText + "\n" : "";
for(var i = 0; i < messages.length; i++)
{
@@ -773,10 +805,10 @@ Prado.WebUI.TValidationSummary.prototype =
* the page and its <tt>CausesValidation</tt> option is true.
* The input control to be validated is specified by <tt>ControlToValidate</tt>
* option.</p>
- *
+ *
* @class Prado.WebUI.TBaseValidator
*/
-Prado.WebUI.TBaseValidator = Class.create(Prado.WebUI.Control,
+Prado.WebUI.TBaseValidator = jQuery.klass(Prado.WebUI.Control,
{
/**
* Initialize TBaseValidator.
@@ -839,21 +871,21 @@ Prado.WebUI.TBaseValidator = Class.create(Prado.WebUI.Control,
/**
* Validator options
- * @var {object} options
+ * @var {object} options
*/
this.options = options;
/**
* DOM element of control to validate
* @var {element} control
*/
- this.control = $(options.ControlToValidate);
+ this.control = jQuery("#" + options.ControlToValidate).get(0);
/**
* DOM element of validator
* @var {element} message
*/
- this.message = $(options.ID);
+ this.message = jQuery("#" + options.ID).get(0);
- Prado.Registry.set(options.ID, this);
+ Prado.Registry[options.ID] = this;
if (this.onInit) this.onInit();
@@ -907,7 +939,7 @@ Prado.WebUI.TBaseValidator = Class.create(Prado.WebUI.Control,
if(this.options.Display == "Dynamic")
{
var msg=this.message;
- this.isValid ? msg.hide() : msg.show();
+ this.isValid ? jQuery(msg).hide() : jQuery(msg).show();
}
this.message.style.visibility = this.isValid ? "hidden" : "visible";
}
@@ -933,13 +965,13 @@ Prado.WebUI.TBaseValidator = Class.create(Prado.WebUI.Control,
if (control.lastValidator == this.options.ID)
{
control.lastValidator = null;
- control.removeClassName(CssClass);
+ jQuery(control).removeClass(CssClass);
}
}
else
{
control.lastValidator = this.options.ID;
- control.addClassName(CssClass);
+ jQuery(control).addClass(CssClass);
}
}
},
@@ -977,9 +1009,9 @@ Prado.WebUI.TBaseValidator = Class.create(Prado.WebUI.Control,
{
//try to find the control.
if(!this.control)
- this.control = $(this.options.ControlToValidate);
+ this.control = jQuery("#" + this.options.ControlToValidate).get(0);
- if(!this.control || this.control.disabled)
+ if(!this.control || this.control.disabled || !jQuery.contains(document, this.control))
{
this.isValid = true;
return this.isValid;
@@ -1039,7 +1071,7 @@ Prado.WebUI.TBaseValidator = Class.create(Prado.WebUI.Control,
/**
* Add control to observe for changes.
- * Re-validates upon change. If the validator is not visible,
+ * Re-validates upon change. If the validator is not visible,
* no updates are propagated.
* @function ?
* @param {element} control - DOM element of control to observe
@@ -1102,7 +1134,7 @@ Prado.WebUI.TBaseValidator = Class.create(Prado.WebUI.Control,
return value;
else
{
- var value = string.toDate(this.options.DateFormat);
+ var value = Date.SimpleParse(string, this.options.DateFormat);
if(value && typeof(value.getTime) == "function")
return value.getTime();
else
@@ -1119,7 +1151,7 @@ Prado.WebUI.TBaseValidator = Class.create(Prado.WebUI.Control,
* The ControlType property comes from TBaseValidator::getClientControlClass()
* Be sure to update the TBaseValidator::$_clientClass if new cases are added.
* @function {mixed} ?
- * @param {optional element} control - Control to get value from (default: this.control)
+ * @param {optional element} control - Control to get value from (default: this.control)
* @return Control value to validate
*/
getRawValidationValue : function(control)
@@ -1131,11 +1163,11 @@ Prado.WebUI.TBaseValidator = Class.create(Prado.WebUI.Control,
case 'TDatePicker':
if(control.type == "text")
{
- var value = this.trim($F(control));
+ var value = this.trim(jQuery(control).val());
if(this.options.DateFormat)
{
- var date = value.toDate(this.options.DateFormat);
+ var date = Date.SimpleParse(value, this.options.DateFormat);
return date == null ? value : date;
}
else
@@ -1151,18 +1183,22 @@ Prado.WebUI.TBaseValidator = Class.create(Prado.WebUI.Control,
case 'THtmlArea4':
if(typeof tinyMCE != "undefined")
tinyMCE.triggerSave();
- return $F(control);
+ return control.value;
case 'TRadioButton':
+ case 'TActiveRadioButton':
if(this.options.GroupName)
return this.getRadioButtonGroupValue();
+ case 'TCheckBox':
+ case 'TActiveCheckBox':
+ return control.checked;
default:
if(this.isListControlType())
return this.getFirstSelectedListValue();
else
- return $F(control);
+ return jQuery(control).val();
}
},
-
+
/**
* Get a trimmed value that should be validated.
* The ControlType property comes from TBaseValidator::getClientControlClass()
@@ -1184,6 +1220,9 @@ Prado.WebUI.TBaseValidator = Class.create(Prado.WebUI.Control,
case 'THtmlArea4':
return this.trim(value);
case 'TRadioButton':
+ case 'TCheckBox':
+ case 'TActiveCheckBox':
+ case 'TActiveRadioButton':
return value;
default:
if(this.isListControlType())
@@ -1202,7 +1241,7 @@ Prado.WebUI.TBaseValidator = Class.create(Prado.WebUI.Control,
{
var name = this.control.name;
var value = "";
- $A(document.getElementsByName(name)).each(function(el)
+ jQuery.each(document.getElementsByName(name), function(idx, el)
{
if(el.checked)
value = el.value;
@@ -1216,13 +1255,10 @@ Prado.WebUI.TBaseValidator = Class.create(Prado.WebUI.Control,
*/
observeDatePickerChanges : function()
{
- if(Prado.Browser().ie)
- {
- var DatePicker = Prado.WebUI.TDatePicker;
- this.observeChanges(DatePicker.getDayListControl(this.control));
- this.observeChanges(DatePicker.getMonthListControl(this.control));
- this.observeChanges(DatePicker.getYearListControl(this.control));
- }
+ var DatePicker = Prado.WebUI.TDatePicker;
+ this.observeChanges(DatePicker.getDayListControl(this.control));
+ this.observeChanges(DatePicker.getMonthListControl(this.control));
+ this.observeChanges(DatePicker.getYearListControl(this.control));
},
/**
@@ -1239,7 +1275,7 @@ Prado.WebUI.TBaseValidator = Class.create(Prado.WebUI.Control,
var checked = 0;
var values = [];
var isSelected = this.isCheckBoxType(elements[0]) ? 'checked' : 'selected';
- elements.each(function(element)
+ jQuery.each(elements, function(idx, element)
{
if(element[isSelected] && element.value != initialValue)
{
@@ -1253,7 +1289,7 @@ Prado.WebUI.TBaseValidator = Class.create(Prado.WebUI.Control,
/**
* Get list elements of TCheckBoxList or TListBox.
* Gets an array of the list control item input elements, for TCheckBoxList
- * checkbox input elements are returned, for TListBox HTML option elements
+ * checkbox input elements are returned, for TListBox HTML option elements
* are returned.
* @function {element[]} ?
* @return Array of list control option DOM elements.
@@ -1266,19 +1302,19 @@ Prado.WebUI.TBaseValidator = Class.create(Prado.WebUI.Control,
var elements = [];
for(var i = 0; i < this.options.TotalItems; i++)
{
- var element = $(this.options.ControlToValidate+"_c"+i);
+ var element = jQuery("#" + this.options.ControlToValidate+"_c"+i).get(0);
if(this.isCheckBoxType(element))
elements.push(element);
}
return elements;
case 'TListBox':
var elements = [];
- var element = $(this.options.ControlToValidate);
+ var element = jQuery("#" + this.options.ControlToValidate).get(0);
var type;
if(element && (type = element.type.toLowerCase()))
{
if(type == "select-one" || type == "select-multiple")
- elements = $A(element.options);
+ elements = element.options;
}
return elements;
default:
@@ -1310,7 +1346,7 @@ Prado.WebUI.TBaseValidator = Class.create(Prado.WebUI.Control,
isListControlType : function()
{
var list = ['TCheckBoxList', 'TRadioButtonList', 'TListBox'];
- return list.include(this.options.ControlType);
+ return (jQuery.inArray(this.options.ControlType, list)!=-1);
},
/**
@@ -1332,14 +1368,14 @@ Prado.WebUI.TBaseValidator = Class.create(Prado.WebUI.Control,
/**
* TRequiredFieldValidator makes the associated input control a required field.
- *
+ *
* <p>The input control fails validation if its value does not change from
* the <tt>InitialValue</tt> option upon losing focus.</p>
- *
+ *
* @class Prado.WebUI.TRequiredFieldValidator
* @extends Prado.WebUI.TBaseValidator
*/
-Prado.WebUI.TRequiredFieldValidator = Class.extend(Prado.WebUI.TBaseValidator,
+Prado.WebUI.TRequiredFieldValidator = jQuery.klass(Prado.WebUI.TBaseValidator,
{
/**
* Evaluate validation state
@@ -1358,7 +1394,7 @@ Prado.WebUI.TRequiredFieldValidator = Class.extend(Prado.WebUI.TBaseValidator,
/**
* TCompareValidator compares the value entered by the user into an input
* control with the value entered into another input control or a constant value.
- *
+ *
* <p>To compare the associated input control with another input control,
* set the <tt>ControlToCompare</tt> option to the ID path
* of the control to compare with. To compare the associated input control with
@@ -1376,11 +1412,11 @@ Prado.WebUI.TRequiredFieldValidator = Class.extend(Prado.WebUI.TBaseValidator,
* Use the <tt>Operator</tt> property to specify the type of comparison
* to perform. Valid operators include Equal, NotEqual, GreaterThan, GreaterThanEqual,
* LessThan and LessThanEqual.
- *
+ *
* @class Prado.WebUI.TCompareValidator
* @extends Prado.WebUI.TBaseValidator
*/
-Prado.WebUI.TCompareValidator = Class.extend(Prado.WebUI.TBaseValidator,
+Prado.WebUI.TCompareValidator = jQuery.klass(Prado.WebUI.TBaseValidator,
{
/**
* Additional constructor options.
@@ -1407,7 +1443,7 @@ Prado.WebUI.TCompareValidator = Class.extend(Prado.WebUI.TBaseValidator,
if (value.length <= 0)
return true;
- var comparee = $(this.options.ControlToCompare);
+ var comparee = jQuery("#" + this.options.ControlToCompare).get(0);
if(comparee)
var compareTo = this.getValidationValue(comparee);
@@ -1467,7 +1503,7 @@ Prado.WebUI.TCompareValidator = Class.extend(Prado.WebUI.TBaseValidator,
* <p>To create a client-side validation function, add the client-side
* validation javascript function to the page template.
* The function should have the following signature:</p>
- *
+ *
* <pre>
* &lt;script type="text/javascript"&gt;
* function ValidationFunctionName(sender, parameter)
@@ -1479,15 +1515,15 @@ Prado.WebUI.TCompareValidator = Class.extend(Prado.WebUI.TBaseValidator,
* }
* &lt;/script&gt;
* </pre>
- *
+ *
* <p>Use the <tt>ClientValidationFunction</tt> option
* to specify the name of the client-side validation script function associated
* with the TCustomValidator.</p>
- *
+ *
* @class Prado.WebUI.TCustomValidator
* @extends Prado.WebUI.TBaseValidator
*/
-Prado.WebUI.TCustomValidator = Class.extend(Prado.WebUI.TBaseValidator,
+Prado.WebUI.TCustomValidator = jQuery.klass(Prado.WebUI.TBaseValidator,
{
/**
* Additional constructor options.
@@ -1517,11 +1553,11 @@ Prado.WebUI.TCustomValidator = Class.extend(Prado.WebUI.TBaseValidator,
/**
* Uses callback request to perform validation.
- *
+ *
* @class Prado.WebUI.TActiveCustomValidator
* @extends Prado.WebUI.TBaseValidator
*/
-Prado.WebUI.TActiveCustomValidator = Class.extend(Prado.WebUI.TBaseValidator,
+Prado.WebUI.TActiveCustomValidator = jQuery.klass(Prado.WebUI.TBaseValidator,
{
/**
* Override the parent implementation to store the invoker, in order to
@@ -1538,7 +1574,7 @@ Prado.WebUI.TActiveCustomValidator = Class.extend(Prado.WebUI.TBaseValidator,
//try to find the control.
if(!this.control)
- this.control = $(this.options.ControlToValidate);
+ this.control = jQuery("#" + this.options.ControlToValidate).get(0);
if(!this.control || this.control.disabled)
{
@@ -1586,25 +1622,25 @@ Prado.WebUI.TActiveCustomValidator = Class.extend(Prado.WebUI.TBaseValidator,
* TRangeValidator tests whether an input value is within a specified range.
*
* <p>TRangeValidator uses three key properties to perform its validation.</p>
- *
+ *
* <p>The <tt>MinValue</tt> and <tt>MaxValue</tt> options specify the minimum
- * and maximum values of the valid range.</p>
+ * and maximum values of the valid range.</p>
* <p>The <tt>DataType</tt> option is
* used to specify the data type of the value and the minimum and maximum range values.
* The values are converted to this data type before the validation
* operation is performed. The following value types are supported:</p>
- *
+ *
* - <b>Integer</b> A 32-bit signed integer data type.<br />
* - <b>Float</b> A double-precision floating point number data type.<br />
* - <b>Date</b> A date data type. The date format can be specified by<br />
* setting <tt>DateFormat</tt> option, which must be recognizable
* by <tt>Date.SimpleParse</tt> javascript function.
* - <b>String</b> A string data type.
- *
+ *
* @class Prado.WebUI.TRangeValidator
* @extends Prado.WebUI.TBaseValidator
*/
-Prado.WebUI.TRangeValidator = Class.extend(Prado.WebUI.TBaseValidator,
+Prado.WebUI.TRangeValidator = jQuery.klass(Prado.WebUI.TBaseValidator,
{
/**
* Additional constructor options.
@@ -1619,7 +1655,7 @@ Prado.WebUI.TRangeValidator = Class.extend(Prado.WebUI.TBaseValidator,
/**
* Evaluate validation state
* @function {boolean} ?
- * @return True if value is in range or value is empty,
+ * @return True if value is in range or value is empty,
* false otherwhise and when type conversion failed.
*/
evaluateIsValid : function()
@@ -1659,11 +1695,11 @@ Prado.WebUI.TRangeValidator = Class.extend(Prado.WebUI.TBaseValidator,
/**
* TRegularExpressionValidator validates whether the value of an associated
* input component matches the pattern specified by a regular expression.
- *
+ *
* @class Prado.WebUI.TRegularExpressionValidator
* @extends Prado.WebUI.TBaseValidator
*/
-Prado.WebUI.TRegularExpressionValidator = Class.extend(Prado.WebUI.TBaseValidator,
+Prado.WebUI.TRegularExpressionValidator = jQuery.klass(Prado.WebUI.TBaseValidator,
{
/**
* Additional constructor option.
@@ -1676,7 +1712,7 @@ Prado.WebUI.TRegularExpressionValidator = Class.extend(Prado.WebUI.TBaseValidato
/**
* Evaluate validation state
* @function {boolean} ?
- * @return True if value matches regular expression or value is empty.
+ * @return True if value matches regular expression or value is empty.
*/
evaluateIsValid : function()
{
@@ -1693,7 +1729,7 @@ Prado.WebUI.TRegularExpressionValidator = Class.extend(Prado.WebUI.TBaseValidato
/**
* TEmailAddressValidator validates whether the value of an associated
* input component is a valid email address.
- *
+ *
* @class Prado.WebUI.TEmailAddressValidator
* @extends Prado.WebUI.TRegularExpressionValidator
*/
@@ -1703,16 +1739,16 @@ Prado.WebUI.TEmailAddressValidator = Prado.WebUI.TRegularExpressionValidator;
/**
* TListControlValidator checks the number of selection and their values
* for a TListControl that allows multiple selections.
- *
+ *
* @class Prado.WebUI.TListControlValidator
* @extends Prado.WebUI.TBaseValidator
*/
-Prado.WebUI.TListControlValidator = Class.extend(Prado.WebUI.TBaseValidator,
+Prado.WebUI.TListControlValidator = jQuery.klass(Prado.WebUI.TBaseValidator,
{
/**
* Evaluate validation state
* @function {boolean} ?
- * @return True if number of selections and/or their values match requirements.
+ * @return True if number of selections and/or their values match requirements.
*/
evaluateIsValid : function()
{
@@ -1733,10 +1769,10 @@ Prado.WebUI.TListControlValidator = Class.extend(Prado.WebUI.TBaseValidator,
*/
observeListElements : function(elements)
{
- if(Prado.Browser().ie && this.isCheckBoxType(elements[0]))
+ if(this.isCheckBoxType(elements[0]))
{
var validator = this;
- elements.each(function(element)
+ jQuery.each(elements, function(idx, element)
{
validator.observeChanges(element);
});
@@ -1763,9 +1799,9 @@ Prado.WebUI.TListControlValidator = Class.extend(Prado.WebUI.TBaseValidator,
{
if(values.length < required.length)
return false;
- required.each(function(requiredValue)
+ jQuery.each(required, function(idx, requiredValue)
{
- exists = exists && values.include(requiredValue);
+ exists = exists && (jQuery.inArray(requiredValue, values)!=-1);
});
}
@@ -1794,21 +1830,21 @@ Prado.WebUI.TListControlValidator = Class.extend(Prado.WebUI.TBaseValidator,
/**
* TDataTypeValidator verifies if the input data is of the type specified
* by <tt>DataType</tt> option.
- *
+ *
* <p>The following data types are supported:</p>
- *
+ *
* - <b>Integer</b> A 32-bit signed integer data type.<br />
* - <b>Float</b> A double-precision floating point number data type.<br />
* - <b>Date</b> A date data type.<br />
* - <b>String</b> A string data type.<br />
- *
+ *
* <p>For <b>Date</b> type, the option <tt>DateFormat</tt>
* will be used to determine how to parse the date string.</p>
- *
+ *
* @class Prado.WebUI.TDataTypeValidator
* @extends Prado.WebUI.TBaseValidator
*/
-Prado.WebUI.TDataTypeValidator = Class.extend(Prado.WebUI.TBaseValidator,
+Prado.WebUI.TDataTypeValidator = jQuery.klass(Prado.WebUI.TBaseValidator,
{
/**
* Additional constructor option.
@@ -1821,7 +1857,7 @@ Prado.WebUI.TDataTypeValidator = Class.extend(Prado.WebUI.TBaseValidator,
/**
* Evaluate validation state
* @function {boolean} ?
- * @return True if value matches required data type.
+ * @return True if value matches required data type.
*/
evaluateIsValid : function()
{
@@ -1833,18 +1869,18 @@ Prado.WebUI.TDataTypeValidator = Class.extend(Prado.WebUI.TBaseValidator,
});
/**
- * TCaptchaValidator verifies if the input data is the same as
+ * TCaptchaValidator verifies if the input data is the same as
* the token shown in the associated CAPTCHA control.
- *
+ *
* @class Prado.WebUI.TCaptchaValidator
* @extends Prado.WebUI.TBaseValidator
*/
-Prado.WebUI.TCaptchaValidator = Class.extend(Prado.WebUI.TBaseValidator,
+Prado.WebUI.TCaptchaValidator = jQuery.klass(Prado.WebUI.TBaseValidator,
{
/**
* Evaluate validation state
* @function {boolean} ?
- * @return True if value matches captcha text
+ * @return True if value matches captcha text
*/
evaluateIsValid : function()
{
@@ -1906,11 +1942,11 @@ Prado.WebUI.TCaptchaValidator = Class.extend(Prado.WebUI.TBaseValidator,
/**
* TReCaptchaValidator client-side control.
- *
+ *
* @class Prado.WebUI.TReCaptchaValidator
* @extends Prado.WebUI.TBaseValidator
*/
-Prado.WebUI.TReCaptchaValidator = Class.create(Prado.WebUI.TBaseValidator,
+Prado.WebUI.TReCaptchaValidator = jQuery.klass(Prado.WebUI.TBaseValidator,
{
onInit : function()
{
@@ -1926,7 +1962,7 @@ Prado.WebUI.TReCaptchaValidator = Class.create(Prado.WebUI.TBaseValidator,
responseChanged: function()
{
- var field = $(this.options.ID+'_1');
+ var field = jQuery("#" + this.options.ID+'_1').get(0);
if (field.value=='1') return;
field.value = '1';
Prado.Validation.validateControl(this.options.ID);
@@ -1939,7 +1975,7 @@ Prado.WebUI.TReCaptchaValidator = Class.create(Prado.WebUI.TBaseValidator,
*/
evaluateIsValid : function()
{
- return ($(this.options.ID+'_1').value=='1');
+ return (jQuery("#" + this.options.ID+'_1').get(0).value=='1');
}
});
diff --git a/framework/Web/Services/TFeedService.php b/framework/Web/Services/TFeedService.php
index a1518d4e..75775f49 100644
--- a/framework/Web/Services/TFeedService.php
+++ b/framework/Web/Services/TFeedService.php
@@ -5,7 +5,7 @@
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Knut Urdalen <knut.urdalen@gmail.com>
* @link http://www.pradosoft.com
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.Services
@@ -132,7 +132,7 @@ class TFeedService extends TService
else
throw new TConfigurationException('feedservice_class_required',$id);
}
-
+
// init feed properties
foreach($properties as $name=>$value)
$feed->setSubproperty($name,$value);
diff --git a/framework/Web/Services/TJsonService.php b/framework/Web/Services/TJsonService.php
index 15701a9a..e3b9b1cb 100644
--- a/framework/Web/Services/TJsonService.php
+++ b/framework/Web/Services/TJsonService.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TJsonService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.Services
*/
@@ -47,7 +46,6 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
- * @version $Id: TJsonService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.Services
* @since 3.1
*/
@@ -132,7 +130,7 @@ class TJsonService extends TService
throw new TConfigurationException('jsonservice_response_type_invalid',$id);
}
else
- throw new TConfigurationException('jsonservice_class_required',$id);
+ throw new TConfigurationException('jsonservice_class_required',$id);
}
}
else
@@ -172,7 +170,6 @@ class TJsonService extends TService
* will be empty if the returned content is null.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TJsonService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.Services
* @since 3.1
*/
diff --git a/framework/Web/Services/TPageService.php b/framework/Web/Services/TPageService.php
index 8e052693..f0dd8c1a 100644
--- a/framework/Web/Services/TPageService.php
+++ b/framework/Web/Services/TPageService.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPageService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.Services
*/
@@ -70,7 +69,6 @@ Prado::using('System.Web.UI.TThemeManager');
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
- * @version $Id: TPageService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.Services
* @since 3.0
*/
@@ -547,7 +545,6 @@ class TPageService extends TService
* Configurations along this path are merged together to be provided for the page.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPageService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.Services
* @since 3.0
*/
@@ -657,14 +654,14 @@ class TPageConfiguration extends TComponent
Prado::trace("Loading page configuration file $fname",'System.Web.Services.TPageService');
if(empty($fname) || !is_file($fname))
return;
-
+
if(Prado::getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP)
{
$fcontent = include $fname;
$this->loadFromPhp($fcontent,dirname($fname),$configPagePath);
}
else
- {
+ {
$dom=new TXmlDocument;
if($dom->loadFromFile($fname))
$this->loadFromXml($dom,dirname($fname),$configPagePath);
@@ -692,7 +689,7 @@ class TPageConfiguration extends TComponent
$this->loadApplicationConfigurationFromXml($dom,$configPath);
$this->loadPageConfigurationFromXml($dom,$configPath,$configPagePath);
}
-
+
public function loadApplicationConfigurationFromPhp($config,$configPath)
{
$appConfig=new TApplicationConfiguration;
@@ -775,7 +772,7 @@ class TPageConfiguration extends TComponent
if(isset($page['properties']))
{
$properties=$page['properties'];
- unset($page['properties']);
+ unset($page['properties']);
}
$matching=false;
$id=($configPagePath==='')?$id:$configPagePath.'.'.$id;
@@ -787,7 +784,7 @@ class TPageConfiguration extends TComponent
$this->_properties=array_merge($this->_properties,$properties);
}
}
-
+
// external configurations
if(isset($config['includes']) && is_array($config['includes']))
{
diff --git a/framework/Web/Services/TRpcService.php b/framework/Web/Services/TRpcService.php
index a2691af4..546ab82a 100644
--- a/framework/Web/Services/TRpcService.php
+++ b/framework/Web/Services/TRpcService.php
@@ -480,7 +480,6 @@ class TJsonRpcProtocol extends TRpcProtocol
if(!is_array($parameters))
$parameters = array($parameters);
- $ret = $this->callApiMethod($_request['method'], $parameters);
// a request without an id is a notification that doesn't need a response
if($this->_id !== null)
{
@@ -489,7 +488,7 @@ class TJsonRpcProtocol extends TRpcProtocol
return $this->encode(array(
'jsonrpc' => '2.0',
'id' => $this->_id,
- 'result' => $ret
+ 'result' => $this->callApiMethod($_request['method'], $parameters);
));
} else {
return $this->encode(array(
diff --git a/framework/Web/Services/TSoapService.php b/framework/Web/Services/TSoapService.php
index 2d59f462..c928dc06 100644
--- a/framework/Web/Services/TSoapService.php
+++ b/framework/Web/Services/TSoapService.php
@@ -5,9 +5,8 @@
* @author Knut Urdalen <knut.urdalen@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSoapService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.Services
*/
@@ -156,7 +155,7 @@ class TSoapService extends TService
* @throws TConfigurationException if soap server id is not specified or duplicated
*/
private function loadConfig($config)
- {
+ {
if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP)
{
if(is_array($config))
@@ -296,7 +295,6 @@ class TSoapService extends TService
* It also manages the URI for the SOAP service and WSDL.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TSoapService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.Services
* @since 3.1
*/
diff --git a/framework/Web/TAssetManager.php b/framework/Web/TAssetManager.php
index f29b0707..272d4400 100644
--- a/framework/Web/TAssetManager.php
+++ b/framework/Web/TAssetManager.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TAssetManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
*/
@@ -38,7 +37,6 @@
* pointing to a valid directory writable by the Web server process.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TAssetManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
* @since 3.0
*/
diff --git a/framework/Web/TCacheHttpSession.php b/framework/Web/TCacheHttpSession.php
index d658c0f3..02e84e22 100644
--- a/framework/Web/TCacheHttpSession.php
+++ b/framework/Web/TCacheHttpSession.php
@@ -5,9 +5,8 @@
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCacheHttpSession.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
* @since 3.1.1
*/
@@ -36,7 +35,6 @@
*
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCacheHttpSession.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
* @since 3.1.1
*/
diff --git a/framework/Web/THttpRequest.php b/framework/Web/THttpRequest.php
index f621d1eb..5d77ba60 100644
--- a/framework/Web/THttpRequest.php
+++ b/framework/Web/THttpRequest.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THttpRequest.php 3273 2013-02-13 21:51:21Z ctrlaltca $
* @package System.Web
*/
@@ -64,7 +63,6 @@ Prado::using('System.Web.TUrlManager');
* request module. It can be accessed via {@link TApplication::getRequest()}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpRequest.php 3273 2013-02-13 21:51:21Z ctrlaltca $
* @package System.Web
* @since 3.0
*/
@@ -267,7 +265,7 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar
if($this->getEnableCache())
{
$cache = $this->getApplication()->getCache();
- if($cache !== null)
+ if($cache !== null)
{
$dependencies = null;
if($this->getApplication()->getMode() !== TApplicationMode::Performance)
@@ -969,7 +967,6 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpRequest.php 3273 2013-02-13 21:51:21Z ctrlaltca $
* @package System.Web
* @since 3.0
*/
@@ -1057,7 +1054,6 @@ class THttpCookieCollection extends TList
* domain, path, expire, and secure.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpRequest.php 3273 2013-02-13 21:51:21Z ctrlaltca $
* @package System.Web
* @since 3.0
*/
@@ -1232,7 +1228,6 @@ class THttpCookie extends TComponent
* - fragment: anchor
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpRequest.php 3273 2013-02-13 21:51:21Z ctrlaltca $
* @package System.Web
* @since 3.0
*/
@@ -1399,7 +1394,6 @@ class TUri extends TComponent
* - HiddenPath: the URL format is like /path/to/name1,value1/name2,value2...
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpRequest.php 3273 2013-02-13 21:51:21Z ctrlaltca $
* @package System.Web
* @since 3.0.4
*/
diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php
index ebcb9cc7..75563ef9 100644
--- a/framework/Web/THttpResponse.php
+++ b/framework/Web/THttpResponse.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THttpResponse.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
*/
@@ -60,7 +59,6 @@ Prado::using('System.Web.THttpResponseAdapter');
* will force the browser to ask for a username and a password.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpResponse.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
* @since 3.0
*/
diff --git a/framework/Web/THttpResponseAdapter.php b/framework/Web/THttpResponseAdapter.php
index 635752ed..3411e71c 100644
--- a/framework/Web/THttpResponseAdapter.php
+++ b/framework/Web/THttpResponseAdapter.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web
diff --git a/framework/Web/THttpSession.php b/framework/Web/THttpSession.php
index f32b7063..79c6e6df 100644
--- a/framework/Web/THttpSession.php
+++ b/framework/Web/THttpSession.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THttpSession.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
*/
@@ -57,7 +56,6 @@
* and {@link getTimeout TimeOut} are configurable properties of THttpSession.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpSession.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
* @since 3.0
*/
@@ -159,7 +157,7 @@ class THttpSession extends TApplicationComponent implements IteratorAggregate,Ar
$this->_started=false;
}
}
-
+
/**
* Update the current session id with a newly generated one
*
@@ -628,7 +626,6 @@ class THttpSession extends TApplicationComponent implements IteratorAggregate,Ar
* for traversing the session variables.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpSession.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
* @since 3.0
*/
@@ -717,7 +714,6 @@ class TSessionIterator implements Iterator
* - Only: using cookie only.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpSession.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
* @since 3.0.4
*/
diff --git a/framework/Web/THttpUtility.php b/framework/Web/THttpUtility.php
index 128dee55..f41060f7 100644
--- a/framework/Web/THttpUtility.php
+++ b/framework/Web/THttpUtility.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THttpUtility.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
*/
@@ -14,7 +13,6 @@
* THttpUtility class
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpUtility.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
* @since 3.0
*/
diff --git a/framework/Web/TUrlManager.php b/framework/Web/TUrlManager.php
index 75abdcf1..2d3fa572 100644
--- a/framework/Web/TUrlManager.php
+++ b/framework/Web/TUrlManager.php
@@ -4,7 +4,7 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id $
* @package System.Web
@@ -50,7 +50,7 @@ class TUrlManager extends TModule
* In order to use the 'HiddenPath' format you need proper url rewrite configuration;
* here's an example for Apache's .htaccess:
* <cdde>
- * Options +FollowSymLinks
+ * Options +FollowSymLinks
* RewriteEngine On
* RewriteCond %{REQUEST_FILENAME} !-d
* RewriteCond %{REQUEST_FILENAME} !-f
diff --git a/framework/Web/TUrlMapping.php b/framework/Web/TUrlMapping.php
index 929a873e..4c93f004 100644
--- a/framework/Web/TUrlMapping.php
+++ b/framework/Web/TUrlMapping.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TUrlMapping.php 3290 2013-05-06 08:32:15Z ctrlaltca $
* @package System.Web
*/
@@ -63,7 +62,6 @@ Prado::using('System.Collections.TAttributeCollection');
* in the GET variables.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TUrlMapping.php 3290 2013-05-06 08:32:15Z ctrlaltca $
* @package System.Web
* @since 3.0.5
*/
@@ -477,7 +475,7 @@ class TUrlMapping extends TUrlManager
* Since 3.2.2 you can also add a list of "constants" parameters that can be used just
* like the original "parameters" parameters, except that the supplied value will be treated
* as a simple string constant instead of a regular expression. For example
- *
+ *
* <url ServiceParameter="MyPage" pattern="/mypage/mypath/list/detail/{pageidx}" parameters.pageidx="\d+" constants.listtype="detailed"/>
* <url ServiceParameter="MyPage" pattern="/mypage/mypath/list/summary/{pageidx}" parameters.pageidx="\d+" constants.listtype="summarized"/>
*
@@ -486,7 +484,6 @@ class TUrlMapping extends TUrlManager
* The constants is practically a table-based validation and translation of specified, fixed-set parameter values.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TUrlMapping.php 3290 2013-05-06 08:32:15Z ctrlaltca $
* @package System.Web
* @since 3.0.5
*/
@@ -1003,7 +1000,6 @@ class TUrlMappingPattern extends TComponent
* URL prefix behavior that can be used by {@link TUrlMappingPattern::constructUrl()}.
*
* @author Yves Berkholz <godzilla80[at]gmx[dot]net>
- * @version $Id: TUrlMapping.php 3290 2013-05-06 08:32:15Z ctrlaltca $
* @package System.Web
* @since 3.2
*/
diff --git a/framework/Web/UI/ActiveControls/TActiveButton.php b/framework/Web/UI/ActiveControls/TActiveButton.php
index 16ba5339..697e96f1 100644
--- a/framework/Web/UI/ActiveControls/TActiveButton.php
+++ b/framework/Web/UI/ActiveControls/TActiveButton.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -29,7 +28,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
* will update the button's caption upon callback response completion.
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
- * @version $Id: TActiveButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -63,7 +61,7 @@ class TActiveButton extends TButton implements ICallbackEventHandler, IActiveCon
}
/**
- * Raises the callback event. This method is required by
+ * Raises the callback event. This method is required by
* {@link ICallbackEventHandler} interface. If {@link getCausesValidation CausesValidation}
* is true, it will invoke the page's {@link TPage::validate validate}
* method first. It will raise {@link onClick OnClick} event first
diff --git a/framework/Web/UI/ActiveControls/TActiveCheckBox.php b/framework/Web/UI/ActiveControls/TActiveCheckBox.php
index 6221150d..b5d7393c 100644
--- a/framework/Web/UI/ActiveControls/TActiveCheckBox.php
+++ b/framework/Web/UI/ActiveControls/TActiveCheckBox.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveCheckBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -26,7 +25,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
* changed during a callback.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveCheckBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -121,9 +119,9 @@ class TActiveCheckBox extends TCheckBox implements ICallbackEventHandler, IActiv
/**
* Ensure that the ID attribute is rendered and registers the javascript code
* for initializing the active control.
- *
+ *
* Since 3.1.4, the javascript code is not rendered if {@link setAutoPostBack AutoPostBack} is false
- *
+ *
* @param THtmlWriter the writer for the rendering purpose
* @param string checkbox id
* @param string onclick js
diff --git a/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php b/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php
index a42044fb..ea174c94 100644
--- a/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php
+++ b/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveCheckBoxList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -30,7 +29,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveListControlAdapter');
* List items can not be changed dynamically during a callback request.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveCheckBoxList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -78,7 +76,7 @@ class TActiveCheckBoxList extends TCheckBoxList implements IActiveControl, ICall
*/
protected function createRepeatedControl()
{
- $control = new TActiveCheckBox;
+ $control = new TActiveCheckBoxListItem;
$control->getAdapter()->setBaseActiveControl($this->getActiveControl());
return $control;
}
@@ -117,5 +115,29 @@ class TActiveCheckBoxList extends TCheckBoxList implements IActiveControl, ICall
$this->getClientClassName(), $this->getPostBackOptions());
}
+ /**
+ * Gets the name of the javascript class responsible for performing postback for this control.
+ * This method overrides the parent implementation.
+ * @return string the javascript class name
+ */
+ protected function getClientClassName()
+ {
+ return 'Prado.WebUI.TActiveCheckBoxList';
+ }
+}
+
+class TActiveCheckBoxListItem extends TActiveCheckBox
+{
+ /**
+ * Override client implementation to avoid emitting the javascript
+ *
+ * @param THtmlWriter the writer for the rendering purpose
+ * @param string checkbox id
+ * @param string onclick js
+ */
+ protected function renderInputTag($writer,$clientID,$onclick)
+ {
+ TCheckBox::renderInputTag($writer,$clientID,$onclick);
+ }
}
diff --git a/framework/Web/UI/ActiveControls/TActiveClientScript.php b/framework/Web/UI/ActiveControls/TActiveClientScript.php
index 8fce726a..4443ea30 100755
--- a/framework/Web/UI/ActiveControls/TActiveClientScript.php
+++ b/framework/Web/UI/ActiveControls/TActiveClientScript.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveClientScript.php 3144 2012-05-19 10:07:03Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -15,13 +14,13 @@
*
* This is the active counterpart of the {@link TClientScript} class.
*
- * TActiveClientScript has the ability to render itself on ajax
+ * TActiveClientScript has the ability to render itself on ajax
* callbacks. This means that every variable or function declared in javascript
* code will be available to the page.
*
* Beware that when rendered on normal (postback) or ajax callbacks, some
- * javascript code won't behave in the same way.
- * When rendered as part of a normal/postback response, scripts will execute instantly
+ * javascript code won't behave in the same way.
+ * When rendered as part of a normal/postback response, scripts will execute instantly
* where they are in the page and in a synchronous fashion.
* Instead, when they are rendered as part of a callback response,
* they will be executed when all DOM modifications are complete and any dynamic
@@ -30,7 +29,6 @@
* This can potentially hurt compatibility and graceful fallback.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveClientScript.php 3144 2012-05-19 10:07:03Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.2
*/
diff --git a/framework/Web/UI/ActiveControls/TActiveControlAdapter.php b/framework/Web/UI/ActiveControls/TActiveControlAdapter.php
index ab15f091..bf1bc9f5 100644
--- a/framework/Web/UI/ActiveControls/TActiveControlAdapter.php
+++ b/framework/Web/UI/ActiveControls/TActiveControlAdapter.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -29,7 +28,6 @@ Prado::using('System.Web.UI.ActiveControls.TBaseActiveControl');
* corresponding client-side properties.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -89,7 +87,6 @@ class TActiveControlAdapter extends TControlAdapter
public function render($writer)
{
$this->getPage()->getClientScript()->registerPradoScript('ajax');
- $this->renderCallbackClientScripts();
if($this->_control->getVisible(false))
{
parent::render($writer);
@@ -99,25 +96,6 @@ class TActiveControlAdapter extends TControlAdapter
}
/**
- * Register the callback clientscripts and sets the post loader IDs.
- */
- protected function renderCallbackClientScripts()
- {
- $cs = $this->getPage()->getClientScript();
- $key = 'Prado.CallbackRequest.addPostLoaders';
- if(!$cs->isEndScriptRegistered($key))
- {
- $data = $this->getPage()->getPostDataLoaders();
- if(count($data) > 0)
- {
- $options = TJavaScript::encode($data,false);
- $script = "Prado.CallbackRequest.addPostLoaders({$options});";
- $cs->registerEndScript($key, $script);
- }
- }
- }
-
- /**
* @param TBaseActiveControl change base active control
*/
public function setBaseActiveControl($control)
@@ -197,7 +175,6 @@ class TActiveControlAdapter extends TControlAdapter
* Tracking changes to the page state during callback.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -387,7 +364,6 @@ class TCallbackPageStateTracker
* Calculates the viewstate changes during the request.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -431,7 +407,6 @@ abstract class TViewStateDiff
* Calculate the changes to a scalar value.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -456,7 +431,6 @@ class TScalarDiff extends TViewStateDiff
* Calculates the changes to the Style properties.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -548,7 +522,6 @@ class TStyleDiff extends TViewStateDiff
* Calculate the changes to attributes collection.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/ActiveControls/TActiveCustomValidator.php b/framework/Web/UI/ActiveControls/TActiveCustomValidator.php
index cc2a54a1..f05704fc 100644
--- a/framework/Web/UI/ActiveControls/TActiveCustomValidator.php
+++ b/framework/Web/UI/ActiveControls/TActiveCustomValidator.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveCustomValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -28,7 +27,6 @@ Prado::using('System.Web.UI.ActiveControls.TCallbackClientSide');
* will be true when validation is made during a callback request.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveCustomValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -186,7 +184,6 @@ class TActiveCustomValidator extends TCustomValidator
* Custom Validator callback client side options class.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveCustomValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/ActiveControls/TActiveDataGrid.php b/framework/Web/UI/ActiveControls/TActiveDataGrid.php
index 00c9cb49..d5084e2d 100644
--- a/framework/Web/UI/ActiveControls/TActiveDataGrid.php
+++ b/framework/Web/UI/ActiveControls/TActiveDataGrid.php
@@ -107,7 +107,7 @@ class TActiveDataGrid extends TDataGrid implements IActiveControl, ISurroundable
* If it is enabled (clickable), its command name and parameter will also be set.
* It overrides the datagrid's original method to create active controls instead, thus
* the pager will do callbacks instead of the regular postbacks.
- * @param mixed the container pager instance of TActiveDatagridPager
+ * @param mixed the container pager instance of TActiveDatagridPager
* @param string button type, either LinkButton or PushButton
* @param boolean whether the button should be enabled
* @param string caption of the button
@@ -786,7 +786,6 @@ class TActiveLiteralColumn extends TLiteralColumn {
* TActiveDataGridPager represents a pager in an activedatagrid.
*
* @author Fabio Bas <ctrlaltca@gmail.com>
- * @version $Id: TDataGrid.php 3057 2011-11-09 12:35:57Z ctrlaltca@gmail.com $
* @package System.Web.UI.ActiveControls
* @since 3.2.1
*/
@@ -813,7 +812,6 @@ class TActiveDataGridPager extends TDataGridPager
* The {@link getPager Pager} property indicates the datagrid pager related with the event.
*
* @author Fabio Bas <ctrlaltca@gmail.com>
- * @version $Id: TActiveDataGrid.php 3057 2011-11-09 12:35:57Z ctrlaltca@gmail.com $
* @package System.Web.UI.ActiveControls
* @since 3.2.1
*/
diff --git a/framework/Web/UI/ActiveControls/TActiveDataList.php b/framework/Web/UI/ActiveControls/TActiveDataList.php
index dbf70067..6b749b40 100644
--- a/framework/Web/UI/ActiveControls/TActiveDataList.php
+++ b/framework/Web/UI/ActiveControls/TActiveDataList.php
@@ -1,12 +1,11 @@
<?php
/**
* TActiveDataList class file
- *
+ *
* @author Marcos Aurelio Nobre <marconobre@gmail.com>
* @copyright Copyright &copy; 2008, PradoSoft
* @license http://www.pradosoft.com/license
* @package System.Web.UI.ActiveControls
- * @version $Id: TActiveDataList.php 2706 2009-09-24 14:42:30Z rojaro $
*/
/**
@@ -14,7 +13,7 @@
*
* TActiveDataList represents a data bound and updatable grid control which is the
* active counterpart to the original {@link TDataList} control.
- *
+ *
* This component can be used in the same way as the regular datalist, the only
* difference is that the active datalist uses callbacks instead of postbacks
* for interaction.
@@ -25,10 +24,10 @@
* @package System.Web.UI.ActiveControls
*/
class TActiveDataList extends TDataList implements IActiveControl {
-
+
/**
* Creates a new callback control, sets the adapter to
- * TActiveControlAdapter.
+ * TActiveControlAdapter.
*/
public function __construct()
{
@@ -43,7 +42,7 @@ class TActiveDataList extends TDataList implements IActiveControl {
{
return $this->getAdapter()->getBaseActiveControl();
}
-
+
/**
* Sets the data source object associated with the repeater control.
* In addition, the render method of all connected pagers is called so they
@@ -59,7 +58,7 @@ class TActiveDataList extends TDataList implements IActiveControl {
$this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter());
}
}
-
+
/**
* Returns the id of the surrounding container (span).
* @return string container id
@@ -68,7 +67,7 @@ class TActiveDataList extends TDataList implements IActiveControl {
{
return $this->ClientID.'_Container';
}
-
+
/**
* Renders the repeater.
* If the repeater did not pass the prerender phase yet, it will register itself for rendering later.
@@ -85,10 +84,10 @@ class TActiveDataList extends TDataList implements IActiveControl {
$this->getPage()->getAdapter()->registerControlToRender($this,$writer);
}
}
-
+
/**
* Loops through all {@link TActivePager} on the page and registers the ones which are set to paginate
- * the repeater for rendering. This is to ensure that the connected pagers are also rendered if the
+ * the repeater for rendering. This is to ensure that the connected pagers are also rendered if the
* data source changed.
*/
private function renderPager()
@@ -102,7 +101,7 @@ class TActiveDataList extends TDataList implements IActiveControl {
}
}
}
-
+
/**
* Renders the repeater by writing a span tag with the container id obtained from {@link getContainerID()}
* which will be called by the replacement method of the client script to update it's content.
diff --git a/framework/Web/UI/ActiveControls/TActiveDatePicker.php b/framework/Web/UI/ActiveControls/TActiveDatePicker.php
index 279739a8..ad363d9c 100755
--- a/framework/Web/UI/ActiveControls/TActiveDatePicker.php
+++ b/framework/Web/UI/ActiveControls/TActiveDatePicker.php
@@ -1,13 +1,12 @@
<?php
/**
* TActiveDatePicker class file
- *
+ *
* @author Bradley Booms <Bradley.Booms@nsighttel.com>
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveDatePicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -18,20 +17,19 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
/**
* TActiveDatePicker class
- *
+ *
* The active control counter part to date picker control.
* When the date selection is changed, the {@link onCallback OnCallback} event is
* raised.
- *
+ *
* @author Bradley Booms <Bradley.Booms@nsighttel.com>
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
- * @version $Id: TActiveDatePicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1.3
*/
class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, IActiveControl
{
-
+
/**
* @return boolean a value indicating whether an automatic postback to the server
* will occur whenever the user modifies the text in the TActiveDatePicker control and
@@ -67,7 +65,7 @@ class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, I
$options['AutoPostBack'] = $this->getAutoPostBack();
return $options;
}
-
+
/**
* Creates a new callback control, sets the adapter to
* TActiveControlAdapter. If you override this class, be sure to set the
@@ -78,7 +76,7 @@ class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, I
parent::__construct();
$this->setAdapter(new TActiveControlAdapter($this));
}
-
+
/**
* @return TBaseActiveCallbackControl standard callback control options.
*/
@@ -103,21 +101,21 @@ class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, I
$cb->select($id.TControl::CLIENT_ID_SEPARATOR.'day', 'Value', $date['mday'], 'select');
$cb->select($id.TControl::CLIENT_ID_SEPARATOR.'month', 'Value', $date['mon']-1, 'select');
$cb->select($id.TControl::CLIENT_ID_SEPARATOR.'year', 'Value', $date['year'], 'select');
-
+
}
}
}
-
+
/**
* Raises the callback event. This method is required by {@link
- * ICallbackEventHandler} interface.
+ * ICallbackEventHandler} interface.
* This method is mainly used by framework and control developers.
* @param TCallbackEventParameter the event parameter
*/
public function raiseCallbackEvent($param){
$this->onCallback($param);
- }
-
+ }
+
/**
* This method is invoked when a callback is requested. The method raises
* 'OnCallback' event to fire up the event handlers. If you override this
@@ -128,7 +126,7 @@ class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, I
public function onCallback($param){
$this->raiseEvent('OnCallback', $this, $param);
}
-
+
/**
* Registers the javascript code to initialize the date picker.
*/
@@ -174,9 +172,8 @@ class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, I
* is changed.
* The formatted date according to {@link TDatePicker::getDateFormat DateFormat} is sent
* as parameter to this event
- *
+ *
* @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
- * @version $Id: TActiveDatePicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.2.1
*/
diff --git a/framework/Web/UI/ActiveControls/TActiveDropDownList.php b/framework/Web/UI/ActiveControls/TActiveDropDownList.php
index f0f8bba2..0de95078 100644
--- a/framework/Web/UI/ActiveControls/TActiveDropDownList.php
+++ b/framework/Web/UI/ActiveControls/TActiveDropDownList.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveDropDownList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -31,7 +30,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveListControlAdapter');
* List items can be changed dynamically during a callback request.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveDropDownList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/ActiveControls/TActiveFileUpload.php b/framework/Web/UI/ActiveControls/TActiveFileUpload.php
index 10aa2ed3..b478e119 100755
--- a/framework/Web/UI/ActiveControls/TActiveFileUpload.php
+++ b/framework/Web/UI/ActiveControls/TActiveFileUpload.php
@@ -1,11 +1,10 @@
<?php
/**
* TActiveFileUpload.php
- *
+ *
* @author Bradley Booms <Bradley.Booms@nsighttel.com>
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
* @author Gabor Berczi <gabor.berczi@devworx.hu> (issue 349 remote vulnerability fix)
- * @version $Id: TActiveFileUpload.php 3232 2013-01-02 14:42:24Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -17,7 +16,7 @@ Prado::using('System.Web.UI.WebControls.TFileUpload');
/**
* TActiveFileUpload
- *
+ *
* TActiveFileUpload displays a file upload field on a page. Upon postback,
* the text entered into the field will be treated as the name of the file
* that will be uploaded to the server. The property {@link getHasFile HasFile}
@@ -31,22 +30,21 @@ Prado::using('System.Web.UI.WebControls.TFileUpload');
*
* TActiveFileUpload raises {@link onFileUpload OnFileUpload} event if a file is uploaded
* (whether it succeeds or not).
- *
+ *
* TActiveFileUpload actually does a postback in a hidden IFrame, and then does a callback.
* This callback then raises the {@link onFileUpload OnFileUpload} event. After the postback
* a status icon is displayed; either a green checkmark if the upload is successful,
* or a red x if there was an error.
- *
+ *
* @author Bradley Booms <Bradley.Booms@nsighttel.com>
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
- * @version $Id: TActiveFileUpload.php 3232 2013-01-02 14:42:24Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
-class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallbackEventHandler, INamingContainer
+class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallbackEventHandler, INamingContainer
{
-
+
const SCRIPT_PATH = 'prado/activefileupload';
-
+
/**
* @var THiddenField a flag to tell which component is doing the callback.
*/
@@ -68,7 +66,7 @@ class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallback
*/
private $_target;
-
+
/**
* Creates a new callback control, sets the adapter to
* TActiveControlAdapter. If you override this class, be sure to set the
@@ -78,8 +76,8 @@ class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallback
parent::__construct();
$this->setAdapter(new TActiveControlAdapter($this));
}
-
-
+
+
/**
* @param string asset file in the self::SCRIPT_PATH directory.
* @return string asset file url.
@@ -89,8 +87,8 @@ class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallback
$base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl();
return $base.'/'.self::SCRIPT_PATH.'/'.$file;
}
-
-
+
+
/**
* This method is invoked when a file is uploaded.
* If you override this method, be sure to call the parent implementation to ensure
@@ -103,10 +101,10 @@ class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallback
// save the file so that it will persist past the end of this return.
$localName = str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()),''));
parent::saveAs($localName);
-
+
$filename=addslashes($this->getFileName());
-
-
+
+
$params = new TActiveFileUploadCallbackParams;
$params->localName = $localName;
$params->fileName = $filename;
@@ -128,11 +126,11 @@ class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallback
parent.Prado.WebUI.TActiveFileUpload.onFileUpload(Options);
</script>
EOS;
-
+
exit();
}
}
-
+
/**
* @return string the path where the uploaded file will be stored temporarily, in namespace format
* default "Application.runtime.*"
@@ -140,7 +138,7 @@ EOS;
public function getTempPath(){
return $this->getViewState('TempPath', 'Application.runtime.*');
}
-
+
/**
* @param string the path where the uploaded file will be stored temporarily in namespace format
* default "Application.runtime.*"
@@ -148,7 +146,7 @@ EOS;
public function setTempPath($value){
$this->setViewState('TempPath',$value,'Application.runtime.*');
}
-
+
/**
* @return boolean a value indicating whether an automatic callback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to true.
* Note: When set to false, you will need to trigger the callback yourself.
@@ -156,7 +154,7 @@ EOS;
public function getAutoPostBack(){
return $this->getViewState('AutoPostBack', true);
}
-
+
/**
* @param boolean a value indicating whether an automatic callback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to true.
* Note: When set to false, you will need to trigger the callback yourself.
@@ -164,49 +162,49 @@ EOS;
public function setAutoPostBack($value){
$this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),true);
}
-
+
/**
* @return string A chuck of javascript that will need to be called if {{@link getAutoPostBack AutoPostBack} is set to false}
- */
+ */
public function getCallbackJavascript(){
return "Prado.WebUI.TActiveFileUpload.fileChanged(\"{$this->getClientID()}\")";
}
-
+
/**
* @throws TInvalidDataValueException if the {@link getTempPath TempPath} is not writable.
*/
public function onInit($sender){
parent::onInit($sender);
-
+
if (!Prado::getApplication()->getCache())
if (!Prado::getApplication()->getSecurityManager())
throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely');
-
+
if (!is_writable(Prado::getPathOfNamespace($this->getTempPath()))){
throw new TInvalidDataValueException("activefileupload_temppath_invalid", $this->getTempPath());
}
}
-
+
/**
* Raises <b>OnFileUpload</b> event.
- *
- * This method is required by {@link ICallbackEventHandler} interface.
+ *
+ * This method is required by {@link ICallbackEventHandler} interface.
* This method is mainly used by framework and control developers.
* @param TCallbackEventParameter the event parameter
*/
public function raiseCallbackEvent($param){
$cp = $param->getCallbackParameter();
if ($key = $cp->targetID == $this->_target->getUniqueID()){
-
+
$params = $this->popParamsByToken($cp->callbackToken);
-
+
$_FILES[$key]['name'] = $params->fileName;
$_FILES[$key]['size'] = intval($params->fileSize);
$_FILES[$key]['type'] = $params->fileType;
$_FILES[$key]['error'] = intval($params->errorCode);
$_FILES[$key]['tmp_name'] = $params->localName;
$this->loadPostData($key, null);
-
+
$this->raiseEvent('OnFileUpload', $this, $param);
}
}
@@ -220,7 +218,7 @@ EOS;
{
$this->onFileUpload($this->getPage()->getRequest()->itemAt('TActiveFileUpload_TargetId'));
}
-
+
protected function pushParamsAndGetToken(TActiveFileUploadCallbackParams $params)
{
if ($cache = Prado::getApplication()->getCache())
@@ -237,10 +235,10 @@ EOS;
}
else
throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely');
-
+
return $token;
}
-
+
protected function popParamsByToken($token)
{
if ($cache = Prado::getApplication()->getCache())
@@ -260,7 +258,7 @@ EOS;
throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely');
assert($params instanceof TActiveFileUploadCallbackParams);
-
+
return $params;
}
@@ -277,14 +275,14 @@ EOS;
$this->_errorCode = UPLOAD_ERR_FORM_SIZE;
$localName = str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()),''));
$fileName = addslashes($this->getFileName());
-
+
$params = new TActiveFileUploadCallbackParams;
$params->localName = $localName;
$params->fileName = $fileName;
$params->fileSize = $this->getFileSize();
$params->fileType = $this->getFileType();
$params->errorCode = $this->getErrorCode();
-
+
echo <<<EOS
<script language="Javascript">
Options = new Object();
@@ -295,35 +293,35 @@ EOS;
Options.fileType = '{$params->fileType}';
Options.errorCode = '{$params->errorCode}';
Options.callbackToken = '{$this->pushParamsAndGetToken($params)}';
- parent.Prado.WebUI.TactiveFileUpload.onFileUpload(Options);
+ parent.Prado.WebUI.TActiveFileUpload.onFileUpload(Options);
</script>
EOS;
}
}
-
+
public function createChildControls(){
$this->_flag = Prado::createComponent('THiddenField');
$this->_flag->setID('Flag');
$this->getControls()->add($this->_flag);
-
+
$this->_busy = Prado::createComponent('TImage');
$this->_busy->setID('Busy');
$this->_busy->setImageUrl($this->getAssetUrl('ActiveFileUploadIndicator.gif'));
$this->_busy->setStyle("display:none");
$this->getControls()->add($this->_busy);
-
+
$this->_success = Prado::createComponent('TImage');
$this->_success->setID('Success');
$this->_success->setImageUrl($this->getAssetUrl('ActiveFileUploadComplete.png'));
$this->_success->setStyle("display:none");
$this->getControls()->add($this->_success);
-
+
$this->_error = Prado::createComponent('TImage');
$this->_error->setID('Error');
$this->_error->setImageUrl($this->getAssetUrl('ActiveFileUploadError.png'));
$this->_error->setStyle("display:none");
$this->getControls()->add($this->_error);
-
+
$this->_target = Prado::createComponent('TInlineFrame');
$this->_target->setID('Target');
$this->_target->setFrameUrl($this->getAssetUrl('ActiveFileUploadBlank.html'));
@@ -331,14 +329,14 @@ EOS;
$this->_target->setShowBorder(false);
$this->getControls()->add($this->_target);
}
-
-
+
+
/**
- * Removes localfile on ending of the callback.
+ * Removes localfile on ending of the callback.
*/
public function onUnload($param){
- if ($this->getPage()->getIsCallback() &&
- $this->getHasFile() &&
+ if ($this->getPage()->getIsCallback() &&
+ $this->getHasFile() &&
file_exists($this->getLocalName())){
unlink($this->getLocalName());
}
@@ -367,7 +365,7 @@ EOS;
public function addAttributesToRender($writer){
parent::addAttributesToRender($writer);
$writer->addAttribute('id',$this->getClientID());
-
+
$this->getPage()->getClientScript()->registerPradoScript('activefileupload');
$this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(),$this->getClientOptions());
}
@@ -392,7 +390,7 @@ EOS;
protected function getClientOptions(){
$options['ID'] = $this->getClientID();
$options['EventTarget'] = $this->getUniqueID();
-
+
$options['inputID'] = $this->getClientID();
$options['flagID'] = $this->_flag->getClientID();
$options['targetID'] = $this->_target->getUniqueID();
@@ -422,25 +420,25 @@ EOS;
}
/**
- * @return TImage the image displayed when an upload
+ * @return TImage the image displayed when an upload
* completes successfully.
*/
public function getSuccessImage(){
$this->ensureChildControls();
return $this->_success;
}
-
+
/**
- * @return TImage the image displayed when an upload
+ * @return TImage the image displayed when an upload
* does not complete successfully.
*/
public function getErrorImage(){
$this->ensureChildControls();
return $this->_error;
}
-
+
/**
- * @return TImage the image displayed when an upload
+ * @return TImage the image displayed when an upload
* is in progress.
*/
public function getBusyImage(){
@@ -451,10 +449,9 @@ EOS;
/**
* TActiveFileUploadCallbackParams is an internal class used by {@link TActiveFileUpload}.
- *
+ *
* @author Bradley Booms <Bradley.Booms@nsighttel.com>
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
- * @version $Id: TActiveFileUpload.php 3232 2013-01-02 14:42:24Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
class TActiveFileUploadCallbackParams
diff --git a/framework/Web/UI/ActiveControls/TActiveHiddenField.php b/framework/Web/UI/ActiveControls/TActiveHiddenField.php
index 0d4b3737..28be574a 100644
--- a/framework/Web/UI/ActiveControls/TActiveHiddenField.php
+++ b/framework/Web/UI/ActiveControls/TActiveHiddenField.php
@@ -4,7 +4,7 @@
*
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.ActiveControls
diff --git a/framework/Web/UI/ActiveControls/TActiveHyperLink.php b/framework/Web/UI/ActiveControls/TActiveHyperLink.php
index 6ba8a801..13161eec 100644
--- a/framework/Web/UI/ActiveControls/TActiveHyperLink.php
+++ b/framework/Web/UI/ActiveControls/TActiveHyperLink.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveHyperLink.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -21,7 +20,6 @@
* {@link setNavigateUrl NavigateUrl} and {@link setTarget Target}.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveHyperLink.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/ActiveControls/TActiveImage.php b/framework/Web/UI/ActiveControls/TActiveImage.php
index 752c7a04..27ec337e 100644
--- a/framework/Web/UI/ActiveControls/TActiveImage.php
+++ b/framework/Web/UI/ActiveControls/TActiveImage.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveImage.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -19,7 +18,6 @@
* a callback request.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveImage.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/ActiveControls/TActiveImageButton.php b/framework/Web/UI/ActiveControls/TActiveImageButton.php
index b2aa9960..17068412 100644
--- a/framework/Web/UI/ActiveControls/TActiveImageButton.php
+++ b/framework/Web/UI/ActiveControls/TActiveImageButton.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveImageButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -21,7 +20,6 @@
* and it is raise <b>after</b> the {@link onClick OnClick} event.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveImageButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -135,18 +133,6 @@ class TActiveImageButton extends TImageButton implements IActiveControl, ICallba
}
/**
- * Register the x and y hidden input names of the position clicked.
- * @param THtmlWriter the renderer.
- */
- public function onPreRender($writer)
- {
- parent::onPreRender($writer);
- $uid = $uid=$this->getUniqueID();
- $this->getPage()->registerPostDataLoader($uid.'_x');
- $this->getPage()->registerPostDataLoader($uid.'_y');
- }
-
- /**
* Ensure that the ID attribute is rendered and registers the javascript code
* for initializing the active control.
*/
diff --git a/framework/Web/UI/ActiveControls/TActiveLabel.php b/framework/Web/UI/ActiveControls/TActiveLabel.php
index 4fd19a56..0a20e2b0 100644
--- a/framework/Web/UI/ActiveControls/TActiveLabel.php
+++ b/framework/Web/UI/ActiveControls/TActiveLabel.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveLabel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -26,7 +25,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
* the client-side "for" attribute on the label.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveLabel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/ActiveControls/TActiveLinkButton.php b/framework/Web/UI/ActiveControls/TActiveLinkButton.php
index d8a8ffcb..304d1cef 100644
--- a/framework/Web/UI/ActiveControls/TActiveLinkButton.php
+++ b/framework/Web/UI/ActiveControls/TActiveLinkButton.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveLinkButton.php 3292 2013-05-31 08:51:42Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -29,7 +28,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
* will update the link text upon callback response completion.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveLinkButton.php 3292 2013-05-31 08:51:42Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -145,7 +143,7 @@ class TActiveLinkButton extends TLinkButton implements IActiveControl, ICallback
$this->getClientClassName(), $this->getPostBackOptions());
} else {
- $this->getPage()->getCallbackClient()->setAttribute($this, 'href', false);
+ $this->getPage()->getCallbackClient()->setAttribute($this, 'href', false);
}
}
}
diff --git a/framework/Web/UI/ActiveControls/TActiveListBox.php b/framework/Web/UI/ActiveControls/TActiveListBox.php
index dfb4bf6e..efc9dfcc 100644
--- a/framework/Web/UI/ActiveControls/TActiveListBox.php
+++ b/framework/Web/UI/ActiveControls/TActiveListBox.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveListBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -21,7 +20,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveListControlAdapter');
* List items can be added dynamically during a callback request.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveListBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -95,8 +93,6 @@ class TActiveListBox extends TListBox implements IActiveControl, ICallbackEventH
$client = $this->getPage()->getCallbackClient();
$client->setAttribute($this, 'multiple', $multiple ? 'multiple' : false);
$client->setAttribute($this, 'name', $multiple ? $multi_id : $id);
- if($multiple)
- $client->addPostDataLoader($multi_id);
}
}
@@ -130,10 +126,6 @@ class TActiveListBox extends TListBox implements IActiveControl, ICallbackEventH
{
parent::onPreRender($param);
$this->getAdapter()->updateListItems();
- $multiple = $this->getIsMultiSelect();
- $id = $this->getUniqueID(); $multi_id = $id.'[]';
- if($multiple)
- $this->getPage()->registerPostDataLoader($multi_id);
}
/**
diff --git a/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php b/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php
index e48b9364..ca88477d 100644
--- a/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php
+++ b/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveListControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -23,7 +22,6 @@ Prado::using('System.Web.UI.WebControls.TListControl');
* during callback response.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveListControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -170,7 +168,6 @@ class TActiveListControlAdapter extends TActiveControlAdapter implements IListCo
* repopulate the client-side options.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveListControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/ActiveControls/TActivePageAdapter.php b/framework/Web/UI/ActiveControls/TActivePageAdapter.php
index 03fe2f16..8f5055f6 100644
--- a/framework/Web/UI/ActiveControls/TActivePageAdapter.php
+++ b/framework/Web/UI/ActiveControls/TActivePageAdapter.php
@@ -5,9 +5,8 @@
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @author Gabor Berczi <gabor.berczi@devworx.hu> (lazyload additions & progressive rendering)
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActivePageAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -25,7 +24,6 @@ Prado::using('System.Web.UI.ActiveControls.TCallbackEventParameter');
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @author Gabor Berczi <gabor.berczi@devworx.hu> (lazyload additions & progressive rendering)
- * @version $Id: TActivePageAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -150,7 +148,6 @@ class TActivePageAdapter extends TControlAdapter
{
Prado::trace("ActivePage redirect()",'System.Web.UI.ActiveControls.TActivePageAdapter');
$this->appendContentPart($this->getResponse(), self::CALLBACK_REDIRECT, $url);
- //$this->getResponse()->appendHeader(self::CALLBACK_REDIRECT.': '.$url);
}
/**
@@ -176,7 +173,6 @@ class TActivePageAdapter extends TControlAdapter
$data = TJavaScript::jsonEncode($responseData);
$this->appendContentPart($response, self::CALLBACK_DATA_HEADER, $data);
- //$response->appendHeader(self::CALLBACK_DATA_HEADER.': '.$data);
}
}
@@ -187,7 +183,6 @@ class TActivePageAdapter extends TControlAdapter
{
$pagestate = $this->getPage()->getClientState();
$this->appendContentPart($response, self::CALLBACK_PAGESTATE_HEADER, $pagestate);
- //$response->appendHeader(self::CALLBACK_PAGESTATE_HEADER.': '.$pagestate);
}
}
@@ -198,7 +193,7 @@ class TActivePageAdapter extends TControlAdapter
if($this->getPage()->getClientScript()->hasEndScripts())
{
$writer = $response->createHtmlWriter();
- $this->getPage()->getClientScript()->renderEndScripts($writer);
+ $this->getPage()->getClientScript()->renderEndScriptsCallback($writer);
$this->getPage()->getCallbackClient()->evaluateScript($writer);
}
@@ -206,7 +201,6 @@ class TActivePageAdapter extends TControlAdapter
$executeJavascript = $this->getCallbackClientHandler()->getClientFunctionsToExecute();
$actions = TJavaScript::jsonEncode($executeJavascript);
$this->appendContentPart($response, self::CALLBACK_ACTION_HEADER, $actions);
- //$response->appendHeader(self::CALLBACK_ACTION_HEADER.': '.$actions);
$cs = $this->Page->getClientScript();
@@ -296,7 +290,7 @@ class TActivePageAdapter extends TControlAdapter
}
/**
- * Gets callback parameter. JSON encoding is assumed.
+ * Gets callback parameter.
* @return string postback event parameter
*/
public function getCallbackEventParameter()
@@ -304,8 +298,7 @@ class TActivePageAdapter extends TControlAdapter
if($this->_callbackEventParameter===null)
{
$param = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER);
- if(strlen($param) > 0)
- $this->_callbackEventParameter=TJavaScript::jsonDecode((string)$param);
+ $this->_callbackEventParameter=$param;
}
return $this->_callbackEventParameter;
}
@@ -340,7 +333,6 @@ class TActivePageAdapter extends TControlAdapter
* the error stack trace.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActivePageAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -357,14 +349,22 @@ class TCallbackErrorHandler extends TErrorHandler
{
$response = $this->getApplication()->getResponse();
$trace = $this->getExceptionStackTrace($exception);
+ // avoid error on non-utf8 strings
try {
$trace = TJavaScript::jsonEncode($trace);
} catch (Exception $e) {
// strip everythin not 7bit ascii
$trace = preg_replace('/[^(\x20-\x7F)]*/','', serialize($trace));
}
- $response->setStatusCode(500, 'Internal Server Error');
- $response->appendHeader(TActivePageAdapter::CALLBACK_ERROR_HEADER.': '.$trace);
+
+ // avoid exception loop if headers have already been sent
+ try {
+ $response->setStatusCode(500, 'Internal Server Error');
+ } catch (Exception $e) { }
+
+ $content = $response->createHtmlWriter();
+ $content->getWriter()->setBoundary(TActivePageAdapter::CALLBACK_ERROR_HEADER);
+ $content->write($trace);
}
else
{
@@ -406,7 +406,6 @@ class TCallbackErrorHandler extends TErrorHandler
* TInvalidCallbackException class.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActivePageAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/ActiveControls/TActivePager.php b/framework/Web/UI/ActiveControls/TActivePager.php
index 7dcd3212..078bd5be 100644
--- a/framework/Web/UI/ActiveControls/TActivePager.php
+++ b/framework/Web/UI/ActiveControls/TActivePager.php
@@ -4,9 +4,8 @@
*
* @author "gevik" (forum contributor) and Christophe Boulain (Christophe.Boulain@gmail.com)
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActivePager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -17,15 +16,14 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
/**
* TActivePager is the active control counter part of TPager.
- *
+ *
* When a page change is requested, TActivePager raises a callback instead of the
* traditional postback.
*
* The {@link onCallback OnCallback} event is raised during a callback request
* and it is raise <b>after</b> the {@link onPageIndexChanged OnPageIndexChanged} event.
- *
+ *
* @author "gevik" (forum contributor) and Christophe Boulain (Christophe.Boulain@gmail.com)
- * @version $Id: TActivePager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1.2
*/
@@ -41,7 +39,7 @@ class TActivePager extends TPager implements IActiveControl, ICallbackEventHandl
parent::__construct();
$this->setAdapter(new TActiveControlAdapter($this));
}
-
+
/**
* @return TBaseActiveControl standard active control options.
*/
@@ -60,11 +58,11 @@ class TActivePager extends TPager implements IActiveControl, ICallbackEventHandl
/**
* Raises the callback event. This method is required by {@link
- * ICallbackEventHandler} interface.
+ * ICallbackEventHandler} interface.
* This method is mainly used by framework and control developers.
* @param TCallbackEventParameter the event parameter
*/
-
+
public function raiseCallbackEvent($param)
{
$this->onCallback($param);
@@ -82,7 +80,7 @@ class TActivePager extends TPager implements IActiveControl, ICallbackEventHandl
{
$this->raiseEvent('OnCallback', $this, $param);
}
-
+
/**
* Builds a dropdown list pager
* Override parent implementation to build Active dropdown lists.
@@ -90,25 +88,25 @@ class TActivePager extends TPager implements IActiveControl, ICallbackEventHandl
protected function buildListPager()
{
$list=new TActiveDropDownList;
-
+
$list->getAdapter()->getBaseActiveControl()->setClientSide(
$this->getClientSide()
);
-
+
$this->getControls()->add($list);
$list->setDataSource(range(1,$this->getPageCount()));
$list->dataBind();
$list->setSelectedIndex($this->getCurrentPageIndex());
$list->setAutoPostBack(true);
$list->attachEventHandler('OnSelectedIndexChanged',array($this,'listIndexChanged'));
- $list->attachEventHandler('OnCallback', array($this, 'handleCallback'));
- }
-
+ $list->attachEventHandler('OnCallback', array($this, 'handleCallback'));
+ }
+
/**
* Creates a pager button.
* Override parent implementation to create, depending on the button type, a TActiveLinkButton,
* a TActiveButton or a TActiveImageButton may be created.
- *
+ *
* @param string button type, either LinkButton or PushButton
* @param boolean whether the button should be enabled
* @param string caption of the button
@@ -126,6 +124,7 @@ class TActivePager extends TPager implements IActiveControl, ICallbackEventHandl
{
$button=new TLabel;
$button->setText($text);
+ $button->setCssClass($this->getButtonCssClass());
return $button;
}
}
@@ -144,28 +143,29 @@ class TActivePager extends TPager implements IActiveControl, ICallbackEventHandl
if(!$enabled)
$button->setEnabled(false);
}
-
+
if($buttonType===TPagerButtonType::ImageButton)
{
$button->ImageUrl = $text;
}
-
+
$button->setText($text);
$button->setCommandName($commandName);
$button->setCommandParameter($commandParameter);
$button->setCausesValidation(false);
-
- $button->attachEventHandler('OnCallback', array($this, 'handleCallback'));
+ $button->setCssClass($this->getButtonCssClass());
+
+ $button->attachEventHandler('OnCallback', array($this, 'handleCallback'));
$button->getAdapter()->getBaseActiveControl()->setClientSide(
$this->getClientSide()
);
-
+
return $button;
}
-
+
/**
* Event handler to the OnCallback active buttons or active dropdownlist.
- * This handler will raise the {@link onCallback OnCallback} event
+ * This handler will raise the {@link onCallback OnCallback} event
*
* @param mixed $sender
* @param TCallbackEventParameter $param
@@ -181,14 +181,14 @@ class TActivePager extends TPager implements IActiveControl, ICallbackEventHandl
{
$control->render($param->getNewWriter());
// FIXME : With some very fast machine, the getNewWriter() consecutive calls are in the same microsecond, resulting
- // of getting the same boundaries in ajax response. Wait 1 microsecond to avoid this.
+ // of getting the same boundaries in ajax response. Wait 1 microsecond to avoid this.
usleep(1);
}
}
// Raise callback event
$this->onCallback($param);
- }
-
+ }
+
public function render ($writer)
{
if($this->getHasPreRendered())
diff --git a/framework/Web/UI/ActiveControls/TActivePanel.php b/framework/Web/UI/ActiveControls/TActivePanel.php
index 39636cad..4b00b013 100644
--- a/framework/Web/UI/ActiveControls/TActivePanel.php
+++ b/framework/Web/UI/ActiveControls/TActivePanel.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActivePanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -32,7 +31,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
* </code>
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActivePanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -87,7 +85,7 @@ class TActivePanel extends TPanel implements IActiveControl
if ($this->getHasControls())
{
// If we update a TActivePanel on callback,
- // We shouldn't update all childs, because the whole content will be replaced by
+ // We shouldn't update all childs, because the whole content will be replaced by
// the parent
foreach ($this->findControlsByType('IActiveControl', false) as $control)
{
diff --git a/framework/Web/UI/ActiveControls/TActiveRadioButton.php b/framework/Web/UI/ActiveControls/TActiveRadioButton.php
index d192536a..46dbbaf7 100644
--- a/framework/Web/UI/ActiveControls/TActiveRadioButton.php
+++ b/framework/Web/UI/ActiveControls/TActiveRadioButton.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveRadioButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -25,7 +24,6 @@
* and can not be changed using javascript.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveRadioButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -121,7 +119,7 @@ class TActiveRadioButton extends TRadioButton implements IActiveControl, ICallba
* Ensure that the ID attribute is rendered and registers the javascript code
* for initializing the active control.
* Since 3.1.4, the javascript code is not rendered if {@link setAutoPostBack AutoPostBack} is false
- *
+ *
*/
protected function renderInputTag($writer,$clientID,$onclick)
{
diff --git a/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php b/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php
index 3244ce11..84a71951 100644
--- a/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php
+++ b/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveRadioButtonList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -31,7 +30,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveRadioButton');
* List items can not be changed dynamically during a callback request.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveRadioButtonList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -79,7 +77,7 @@ class TActiveRadioButtonList extends TRadioButtonList implements IActiveControl,
*/
protected function createRepeatedControl()
{
- $control = new TActiveRadioButton;
+ $control = new TActiveRadioButtonItem;
$control->getAdapter()->setBaseActiveControl($this->getActiveControl());
return $control;
}
@@ -117,5 +115,31 @@ class TActiveRadioButtonList extends TRadioButtonList implements IActiveControl,
$this->getActiveControl()->registerCallbackClientScript(
$this->getClientClassName(), $this->getPostBackOptions());
}
+
+ /**
+ * Gets the name of the javascript class responsible for performing postback for this control.
+ * This method overrides the parent implementation.
+ * @return string the javascript class name
+ */
+ protected function getClientClassName()
+ {
+ return 'Prado.WebUI.TActiveRadioButtonList';
+ }
+
}
+
+class TActiveRadioButtonItem extends TActiveRadioButton
+{
+ /**
+ * Override client implementation to avoid emitting the javascript
+ *
+ * @param THtmlWriter the writer for the rendering purpose
+ * @param string checkbox id
+ * @param string onclick js
+ */
+ protected function renderInputTag($writer,$clientID,$onclick)
+ {
+ TRadioButton::renderInputTag($writer,$clientID,$onclick);
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/ActiveControls/TActiveRatingList.php b/framework/Web/UI/ActiveControls/TActiveRatingList.php
index 022efe65..6f6dd847 100644
--- a/framework/Web/UI/ActiveControls/TActiveRatingList.php
+++ b/framework/Web/UI/ActiveControls/TActiveRatingList.php
@@ -5,7 +5,7 @@
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @author Bradley Booms <bradley[dot]booms[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.ActiveControls
@@ -105,8 +105,8 @@ class TActiveRatingList extends TRatingList implements IActiveControl, ICallback
if($this->getActiveControl()->canUpdateClientSide())
{
$client = $this->getPage()->getCallbackClient();
- $code = parent::getClientClassName().'.'.$func;
- $client->callClientFunction($code,array($this,$value));
+ $code = 'Prado.Registry[\''.$this->ClientID.'\'].'.$func.'('.$value.')';
+ $client->evaluateScript($code,array($value));
}
}
@@ -116,7 +116,7 @@ class TActiveRatingList extends TRatingList implements IActiveControl, ICallback
public function setCaption($value)
{
parent::setCaption($value);
- // if it's an active control, this should not be needed.
+ // if it's an active control, this should not be needed.
$this->callClientFunction('setCaption',$value);
}
diff --git a/framework/Web/UI/ActiveControls/TActiveRepeater.php b/framework/Web/UI/ActiveControls/TActiveRepeater.php
index 08e6f93a..08aeefab 100644
--- a/framework/Web/UI/ActiveControls/TActiveRepeater.php
+++ b/framework/Web/UI/ActiveControls/TActiveRepeater.php
@@ -5,7 +5,6 @@
* @author LANDWEHR Computer und Software GmbH <programmierung@landwehr-software.de>
* @package System.Web.UI.ActiveControls
* @since 3.1.9
- * @version $Id: TActiveRepeater.php 2707 2009-09-29 10:33:30Z Christophe.Boulain $
*/
/**
diff --git a/framework/Web/UI/ActiveControls/TActiveTextBox.php b/framework/Web/UI/ActiveControls/TActiveTextBox.php
index 5f96ff29..1b8791fd 100644
--- a/framework/Web/UI/ActiveControls/TActiveTextBox.php
+++ b/framework/Web/UI/ActiveControls/TActiveTextBox.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -25,7 +24,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
* event.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/ActiveControls/TAutoComplete.php b/framework/Web/UI/ActiveControls/TAutoComplete.php
index 5e144040..4ed0d34c 100644
--- a/framework/Web/UI/ActiveControls/TAutoComplete.php
+++ b/framework/Web/UI/ActiveControls/TAutoComplete.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TAutoComplete.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -77,7 +76,6 @@ Prado::using('System.Web.UI.ActiveControls.TCallbackEventParameter');
* "informal" are ignored as text for suggestions.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TAutoComplete.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -276,11 +274,12 @@ class TAutoComplete extends TActiveTextBox implements INamingContainer
}
/**
- * Renders the end tag and registers javascript effects library.
+ * Renders the end tag and registers the needed javascript library.
*/
public function renderEndTag($writer)
{
- $this->getPage()->getClientScript()->registerPradoScript('effects');
+ $cs=$this->getPage()->getClientScript();
+ $cs->registerPradoScript('autocomplete');
parent::renderEndTag($writer);
$this->renderResultPanel($writer);
}
@@ -375,7 +374,6 @@ class TAutoComplete extends TActiveTextBox implements INamingContainer
* suggestion selected by the user, -1 if not suggestion is selected.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TAutoComplete.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -416,7 +414,6 @@ class TAutoCompleteEventParameter extends TCallbackEventParameter
* item template.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TAutoComplete.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/ActiveControls/TBaseActiveControl.php b/framework/Web/UI/ActiveControls/TBaseActiveControl.php
index 61230719..c9b6f36e 100644
--- a/framework/Web/UI/ActiveControls/TBaseActiveControl.php
+++ b/framework/Web/UI/ActiveControls/TBaseActiveControl.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TBaseActiveControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -23,7 +22,6 @@ Prado::using('System.Web.UI.ActiveControls.TCallbackClientSide');
* response returns.
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
- * @version $Id: TBaseActiveControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -155,7 +153,6 @@ class TBaseActiveControl extends TComponent
* </code>
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TBaseActiveControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -332,6 +329,9 @@ class TBaseActiveCallbackControl extends TBaseActiveControl
$options['CausesValidation']= $validate ? '' : false;
$options['ValidationGroup']=$this->getValidationGroup();
$options['CallbackParameter'] = $this->getCallbackParameter();
+ // needed for TCallback
+ if(!isset($options['EventTarget']))
+ $options['EventTarget'] = $this->getControl()->getUniqueID();
return $options;
}
diff --git a/framework/Web/UI/ActiveControls/TCallback.php b/framework/Web/UI/ActiveControls/TCallback.php
index 2c20567c..557001b2 100644
--- a/framework/Web/UI/ActiveControls/TCallback.php
+++ b/framework/Web/UI/ActiveControls/TCallback.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -37,7 +36,6 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
* </code>
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/ActiveControls/TCallbackClientScript.php b/framework/Web/UI/ActiveControls/TCallbackClientScript.php
index 40051f76..82f597bb 100644
--- a/framework/Web/UI/ActiveControls/TCallbackClientScript.php
+++ b/framework/Web/UI/ActiveControls/TCallbackClientScript.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCallbackClientScript.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -17,7 +16,7 @@
* executed on the client-side (i.e. the browser client that is viewing
* the page) during a callback response.
*
- * The avaiable methods includes setting/clicking input elements, changing Css
+ * The available methods includes setting/clicking input elements, changing Css
* styles, hiding/showing elements, and adding visual effects to elements on the
* page. The client-side methods can be access through the CallbackClient
* property available in TPage.
@@ -27,8 +26,33 @@
* $this->getPage()->getCallbackClient()->hide($myTextBox);
* </code>
*
- * @author Wei Zhuo <weizhuo[at]gamil[dot]com>
- * @version $Id: TCallbackClientScript.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * To call a specific jQuery method on an element, use the {@link jQuery} method:
+ * <code>
+ * // simple example: focus a textbox
+ * $this->getCallbackClient()->jQuery($myTextBox, 'focus');
+ *
+ * // complex example: resize a textbox using an animation
+ * $this->getCallbackClient()->jQuery($myTextBox, 'animate', array(
+ * array( 'width' => '+=100',
+ * 'height' => '+=50'
+ * ),
+ * array('duration' => 1000)
+ * ));
+ * </code>
+ *
+ * To call a jQueryUI effect on an element, use the {@link juiEffect} method:
+ * <code>
+ * // simple example: focus a textbox
+ * $this->getCallbackClient()->juiEffect($myTextBox, 'highlight');
+ * </code>
+ *
+ * In order to use the jQueryUI effects, the jqueryui script must be registered:
+ * <code>
+ * $this->getPage()->getClientScript()->registerPradoScript('jqueryui');
+ * </code>
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -61,27 +85,48 @@ class TCallbackClientScript extends TApplicationComponent
* @param string javascript function name
* @param array list of arguments for the function
*/
- public function callClientFunction($function, $params=null)
+ public function callClientFunction($function, $params=array())
{
if(!is_array($params))
$params = array($params);
if(count($params) > 0)
{
- if($params[0] instanceof TControl)
+ if ($params[0] instanceof ISurroundable)
+ $params[0] = $params[0]->getSurroundingTagID();
+ elseif($params[0] instanceof TControl)
$params[0] = $params[0]->getClientID();
}
$this->_actions->add(array($function => $params));
}
/**
+ * Executes a jQuery client-side method over an element.
+ * @param string control or element id
+ * @param string jQuery method name
+ * @param array list of arguments for the function
+ */
+ public function jQuery($element, $method, $params=array())
+ {
+ if ($element instanceof ISurroundable)
+ $element = $element->getSurroundingTagID();
+ elseif($element instanceof TControl)
+ $element = $element->getClientID();
+
+ if(!is_array($params))
+ $params = array($params);
+
+ $this->_actions->add(array('Prado.Element.j' => array($element, $method, $params)));
+ }
+
+ /**
* Client script to set the value of a particular input element.
* @param TControl control element to set the new value
* @param string new value
*/
public function setValue($input, $text)
{
- $this->callClientFunction('Prado.Element.setValue', array($input, $text));
+ $this->jQuery($input, 'val', $text);
}
/**
@@ -106,6 +151,11 @@ class TCallbackClientScript extends TApplicationComponent
'Value', 'Index', 'Clear', 'Indices', 'Values', 'All', 'Invert');
$type = ($type===null) ? $this->getSelectionControlType($control) : $type;
$total = $this->getSelectionControlIsListType($control) ? $control->getItemCount() : 1;
+
+ // pass the ID to avoid getting the surrounding elements (ISurroundable)
+ if($control instanceof TControl)
+ $control = $control->getClientID();
+
$this->callClientFunction('Prado.Element.select',
array($control, $type.$method, $value, $total));
}
@@ -127,12 +177,12 @@ class TCallbackClientScript extends TApplicationComponent
/**
* Client script to click on an element. <b>This client-side function is unpredictable.</b>
- *
+ *
* @param TControl control element or element id
*/
public function click($control)
{
- $this->callClientFunction('Prado.Element.click', $control);
+ $this->jQuery($control, 'trigger', 'click');
}
/**
@@ -152,8 +202,7 @@ class TCallbackClientScript extends TApplicationComponent
*/
public function raiseClientEvent($control, $eventName)
{
- $this->callClientFunction('Event.fireEvent',
- array($control, strtolower($eventName)));
+ $this->jQuery($control, 'trigger', $eventName);
}
/**
@@ -164,9 +213,9 @@ class TCallbackClientScript extends TApplicationComponent
*/
public function setAttribute($control, $name, $value)
{
- // Attributes should be applied on Surrounding tag, except for 'disabled' attribute
+ // Attributes should be applied on Surrounding tag, except for 'disabled' attribute
if ($control instanceof ISurroundable && strtolower($name)!=='disabled')
- $control=$control->getSurroundingTagID();
+ $control=$control->getSurroundingTagID();
$this->callClientFunction('Prado.Element.setAttribute',array($control, $name, $value));
}
@@ -182,14 +231,14 @@ class TCallbackClientScript extends TApplicationComponent
{
$promptText = $control->getPromptText();
$promptValue = $control->getPromptValue();
-
+
if($promptValue==='')
$promptValue = $promptText;
-
+
if($promptValue!=='')
$options[] = array($promptText, $promptValue);
}
-
+
foreach($items as $item)
{
if($item->getHasAttributes())
@@ -206,9 +255,7 @@ class TCallbackClientScript extends TApplicationComponent
*/
public function show($element)
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->callClientFunction('Element.show', $element);
+ $this->jQuery($element, 'show');
}
/**
@@ -217,22 +264,33 @@ class TCallbackClientScript extends TApplicationComponent
*/
public function hide($element)
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->callClientFunction('Element.hide', $element);
+ $this->jQuery($element, 'hide');
}
/**
* Toggles the visibility of the element.
* @param TControl control element or element id
- * @param string visual effect, such as, 'appear' or 'slide' or 'blind'.
+ * @param string visual effect, such as, 'fade' or 'slide'.
* @param array additional options.
*/
public function toggle($element, $effect=null, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->callClientFunction('Element.toggle', array($element,$effect,$options));
+ switch(strtolower($effect))
+ {
+ case 'fade':
+ $method='fadeToggle';
+ break;
+ case 'slide':
+ $method='slideToggle';
+ break;
+ default:
+ $method='toggle';
+ // avoid fancy effect by default
+ if(!array_key_exists('duration', $options))
+ $options['duration']=0;
+ break;
+ }
+ $this->jQuery($element, $method, $options);
}
/**
@@ -241,14 +299,7 @@ class TCallbackClientScript extends TApplicationComponent
*/
public function remove($element)
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->callClientFunction('Element.remove', $element);
- }
-
- public function addPostDataLoader($name)
- {
- $this->callClientFunction('Prado.CallbackRequest.addPostLoaders', $name);
+ $this->jQuery($element, 'remove');
}
/**
@@ -259,9 +310,7 @@ class TCallbackClientScript extends TApplicationComponent
*/
public function update($element, $content)
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->replace($element, $content, 'Element.update');
+ $this->jQuery($element, 'html', $content);
}
/**
@@ -271,9 +320,7 @@ class TCallbackClientScript extends TApplicationComponent
*/
public function addCssClass($element, $cssClass)
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->callClientFunction('Element.addClassName', array($element, $cssClass));
+ $this->jQuery($element, 'addClass', $cssClass);
}
/**
@@ -283,31 +330,19 @@ class TCallbackClientScript extends TApplicationComponent
*/
public function removeCssClass($element, $cssClass)
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->callClientFunction('Element.removeClassName', array($element, $cssClass));
+ $this->jQuery($element, 'removeClass', $cssClass);
}
/**
- * Sets the CssClass of an element.
- * @param TControl control element or element id
- * @param string new CssClass name for the element.
- */
- /*public function setCssClass($element, $cssClass)
- {
- $this->callClientFunction('Prado.Element.CssClass.set', array($element, $cssClass));
- }*/
-
- /**
* Scroll the top of the browser viewing area to the location of the
* element.
+ *
* @param TControl control element or element id
+ * @param array additional options: 'duration' in ms, 'offset' from the top in pixels
*/
- public function scrollTo($element)
+ public function scrollTo($element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->callClientFunction('Element.scrollTo', $element);
+ $this->callClientFunction('Prado.Element.scrollTo', array($element, $options));
}
/**
@@ -316,7 +351,7 @@ class TCallbackClientScript extends TApplicationComponent
*/
public function focus($element)
{
- $this->callClientFunction('Prado.Element.focus', $element);
+ $this->jQuery($element, 'trigger', 'focus');
}
/**
@@ -327,9 +362,7 @@ class TCallbackClientScript extends TApplicationComponent
*/
public function setStyle($element, $styles)
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->callClientFunction('Prado.Element.setStyle', array($element, $styles));
+ $this->jQuery($element, 'css', array($styles));
}
/**
@@ -339,9 +372,7 @@ class TCallbackClientScript extends TApplicationComponent
*/
public function appendContent($element, $content)
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->replace($element, $content, 'Prado.Element.Insert.append');
+ $this->jQuery($element, 'append', $content);
}
/**
@@ -351,9 +382,7 @@ class TCallbackClientScript extends TApplicationComponent
*/
public function prependContent($element, $content)
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->replace($element, $content, 'Prado.Element.Insert.prepend');
+ $this->jQuery($element, 'prepend', $content);
}
/**
@@ -363,9 +392,7 @@ class TCallbackClientScript extends TApplicationComponent
*/
public function insertContentAfter($element, $content)
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->replace($element, $content, 'Prado.Element.Insert.after');
+ $this->jQuery($element, 'after', $content);
}
/**
@@ -375,9 +402,7 @@ class TCallbackClientScript extends TApplicationComponent
*/
public function insertContentBefore($element, $content)
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->replace($element, $content, 'Prado.Element.Insert.before');
+ $this->jQuery($element, 'before', $content);
}
/**
@@ -387,15 +412,13 @@ class TCallbackClientScript extends TApplicationComponent
* will be used for replacement.
* @param TControl control element or HTML element id.
* @param string HTML fragement or the control to be rendered
- * @param string replacement method, default is to replace the outter
- * html content.
* @param string provide a custom boundary.
* @see insertAbout
* @see insertBelow
* @see insertBefore
* @see insertAfter
*/
- protected function replace($element, $content, $method="Element.replace", $boundary=null)
+ protected function replace($element, $content, $boundary=null)
{
if($content instanceof TControl)
{
@@ -408,8 +431,7 @@ class TCallbackClientScript extends TApplicationComponent
$content = null;
}
- $this->callClientFunction('Prado.Element.replace',
- array($element, $method, $content, $boundary));
+ $this->callClientFunction('Prado.Element.replace', array($element, $content, $boundary));
}
/**
@@ -419,8 +441,6 @@ class TCallbackClientScript extends TApplicationComponent
*/
public function replaceContent($element,$content)
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
$this->replace($element, $content);
}
@@ -430,7 +450,16 @@ class TCallbackClientScript extends TApplicationComponent
*/
public function evaluateScript($writer)
{
- $this->replace(null, $writer, 'Prado.Element.evaluateScript');
+ if($writer instanceof THtmlWriter)
+ {
+ $boundary = $this->getResponseContentBoundary($writer);
+ $content = null;
+ } else {
+ $boundary = null;
+ $content = $writer;
+ }
+
+ $this->callClientFunction('Prado.Element.evaluateScript', array($content, $boundary));
}
/**
@@ -445,11 +474,11 @@ class TCallbackClientScript extends TApplicationComponent
{
$boundary = $this->getRenderedContentBoundary($content);
}
- else if($content instanceof THtmlWriter)
+ elseif($content instanceof THtmlWriter)
{
$boundary = $this->getResponseContentBoundary($content);
}
-
+
$this->callClientFunction('Prado.Element.appendScriptBlock', array($boundary));
}
@@ -483,223 +512,311 @@ class TCallbackClientScript extends TApplicationComponent
return null;
}
+ /* VISUAL EFFECTS */
+
/**
* Add a visual effect the element.
* @param string visual effect function name.
* @param TControl control element or element id
* @param array visual effect key-value pair options.
*/
- public function visualEffect($type, $element, $options=null)
+ public function visualEffect($type, $element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->callClientFunction($type, array($element, $options));
+ $this->jQuery($element, $type, $options);
}
+ /* BASIC EFFECTS (JQUERY CORE) */
+
/**
* Visual Effect: Gradually make the element appear.
+ * This effect doesn't need jQueryUI.
* @param TControl control element or element id
* @param array visual effect key-value pair options.
*/
- public function appear($element, $options=null)
+ public function fadeIn($element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->visualEffect('Effect.Appear', $element, $options);
+ $this->visualEffect('fadeIn', $element, $options);
}
/**
- * Visual Effect: Blind down.
+ * Visual Effect: Gradually fade the element.
+ * This effect doesn't need jQueryUI.
* @param TControl control element or element id
* @param array visual effect key-value pair options.
*/
- public function blindDown($element, $options=null)
+ public function fadeOut($element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->visualEffect('Effect.BlindDown', $element, $options);
+ $this->visualEffect('fadeOut', $element, $options);
}
/**
- * Visual Effect: Blind up.
+ * Set the opacity on a html element or control.
+ * This effect doesn't need jQueryUI.
+ * @param TControl control element or element id
+ * @param float opacity value between 1 and 0
+ */
+ public function fadeTo($element, $value, $duration=500)
+ {
+ $value = TPropertyValue::ensureFloat($value);
+ $this->visualEffect('fadeTo', $element, array($duration, $value));
+ }
+
+ /**
+ * Visual Effect: Slide down.
+ * This effect doesn't need jQueryUI.
* @param TControl control element or element id
* @param array visual effect key-value pair options.
*/
- public function blindUp($element, $options=null)
+ public function slideDown($element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->visualEffect('Effect.BlindUp', $element, $options);
+ $this->visualEffect('slideDown', $element, $options);
+ }
+ /**
+ * Visual Effect: Slide up.
+ * This effect doesn't need jQueryUI.
+ * @param TControl control element or element id
+ * @param array visual effect key-value pair options.
+ */
+ public function slideUp($element, $options=array())
+ {
+ $this->visualEffect('slideUp', $element, $options);
}
+ /* OLD METHODS, DEPRECATED, BACKWARDS-COMPATIBILITY */
+
/**
- * Visual Effect: Drop out.
+ * Alias of fadeIn()
+ * @deprecated since 3.4
* @param TControl control element or element id
* @param array visual effect key-value pair options.
*/
- public function dropOut($element, $options=null)
+ public function appear($element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->visualEffect('Effect.DropOut', $element, $options);
+ $this->fadeIn($element, $options);
}
/**
- * Visual Effect: Gradually fade the element.
+ * Alias of fadeOut()
+ * @deprecated since 3.4
+ * @param TControl control element or element id
+ * @param array visual effect key-value pair options.
+ */
+ public function fade($element, $options=array())
+ {
+ $this->fadeOut($element, $options);
+ }
+
+ /**
+ * Alias of fadeTo()
+ * @deprecated since 3.4
+ * @param TControl control element or element id
+ * @param float opacity value between 1 and 0
+ */
+ public function setOpacity($element, $value)
+ {
+ $this->fadeTo($element, $value);
+ }
+
+ /* JQUERY UI EFFECTS */
+
+ /**
+ * Add a jQuery-ui effect the element.
+ * This method needs jQueryUI.
+ * @param string visual effect function name.
+ * @param TControl control element or element id
+ * @param array effect options.
+ */
+ public function juiEffect($element, $effect, $options=array())
+ {
+ $options['effect']=$effect;
+ $this->jQuery($element, 'effect', array($options));
+ }
+
+ /**
+ * Visual Effect: Blind.
+ * This effect needs jQueryUI.
* @param TControl control element or element id
* @param array visual effect key-value pair options.
*/
- public function fade($element, $options=null)
+ public function blind($element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->visualEffect('Effect.Fade', $element, $options);
+ $this->juiEffect($element, 'blind', $options);
+ }
+
+ /**
+ * Visual Effect: Drop out.
+ * This effect needs jQueryUI.
+ * @param TControl control element or element id
+ * @param array visual effect key-value pair options.
+ */
+ public function drop($element, $options=array())
+ {
+ $this->juiEffect($element, 'drop', $options);
}
/**
* Visual Effect: Fold.
+ * This effect needs jQueryUI.
* @param TControl control element or element id
* @param array visual effect key-value pair options.
*/
- public function fold($element, $options = null)
+ public function fold($element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->visualEffect('Effect.Fold', $element, $options);
+ $this->juiEffect($element, 'fold', $options);
}
/**
* Visual Effect: Gradually make an element grow to a predetermined size.
+ * This effect needs jQueryUI.
* @param TControl control element or element id
* @param array visual effect key-value pair options.
*/
- public function grow($element, $options=null)
+ public function size($element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->visualEffect('Effect.Grow', $element, $options);
+ $this->juiEffect($element, 'size', $options);
}
/**
* Visual Effect: Gradually grow and fade the element.
+ * This effect needs jQueryUI.
* @param TControl control element or element id
* @param array visual effect key-value pair options.
*/
- public function puff($element, $options=null)
+ public function puff($element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->visualEffect('Effect.Puff', $element, $options);
+ $this->juiEffect($element, 'puff', $options);
}
/**
* Visual Effect: Pulsate.
+ * This effect needs jQueryUI.
* @param TControl control element or element id
* @param array visual effect key-value pair options.
*/
- public function pulsate($element, $options=null)
+ public function pulsate($element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->visualEffect('Effect.Pulsate', $element, $options);
+ $this->juiEffect($element, 'pulsate', $options);
}
/**
* Visual Effect: Shake the element.
+ * This effect needs jQueryUI.
* @param TControl control element or element id
* @param array visual effect key-value pair options.
*/
- public function shake($element, $options=null)
+ public function shake($element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->visualEffect('Effect.Shake', $element, $options);
+ $this->juiEffect($element, 'shake', $options);
}
/**
- * Visual Effect: Shrink the element.
+ * Visual Effect: Scale the element.
+ * This effect needs jQueryUI.
* @param TControl control element or element id
* @param array visual effect key-value pair options.
*/
- public function shrink($element, $options=null)
+ public function scale($element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->visualEffect('Effect.Shrink', $element, $options);
+ $this->juiEffect($element, 'scale', $options);
}
/**
- * Visual Effect: Slide down.
+ * Visual Effect: High light the element for about 2 seconds.
+ * This effect needs jQueryUI.
* @param TControl control element or element id
* @param array visual effect key-value pair options.
*/
- public function slideDown($element, $options=null)
+ public function highlight($element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->visualEffect('Effect.SlideDown', $element, $options);
+ $this->juiEffect($element, 'highlight', $options);
}
+ /* jui - OLD METHODS, DEPRECATED, BACKWARDS-COMPATIBILITY */
+
/**
- * Visual Effect: Side up.
+ * Alias of blind(), presets the direction to 'down'
+ * @deprecated since 3.4
* @param TControl control element or element id
* @param array visual effect key-value pair options.
*/
- public function slideUp($element, $options=null)
+ public function blindDown($element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->visualEffect('Effect.SlideUp', $element, $options);
+ $options['direction']='down';
+ $this->blind($element, $options);
}
/**
- * Visual Effect: Squish the element.
+ * Alias of blind(), presets the direction to 'up'
+ * @deprecated since 3.4
* @param TControl control element or element id
* @param array visual effect key-value pair options.
*/
- public function squish($element, $options=null)
+ public function blindUp($element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->visualEffect('Effect.Squish', $element, $options);
+ $options['direction']='up';
+ $this->blind($element, $options);
}
/**
- * Visual Effect: Switch Off effect.
+ * Alias of drop()
+ * @deprecated since 3.4
* @param TControl control element or element id
* @param array visual effect key-value pair options.
*/
- public function switchOff($element, $options=null)
+ public function dropOut($element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->visualEffect('Effect.SwitchOff', $element, $options);
+ $this->drop($element, $options);
}
/**
- * Visual Effect: High light the element for about 2 seconds.
+ * Alias of size()
+ * @deprecated since 3.4
* @param TControl control element or element id
* @param array visual effect key-value pair options.
*/
- public function highlight($element, $options=null)
+ public function grow($element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $this->visualEffect('Prado.Effect.Highlight', $element, $options);
+ $this->size($element, $options);
}
/**
- * Set the opacity on a html element or control.
+ * Alias of scale()
+ * @deprecated since 3.4
* @param TControl control element or element id
- * @param float opacity value between 1 and 0
+ * @param array visual effect key-value pair options.
*/
- public function setOpacity($element, $value)
+ public function shrink($element, $options=array())
{
- if ($element instanceof ISurroundable)
- $element=$element->getSurroundingTagID();
- $value = TPropertyValue::ensureFloat($value);
- $this->callClientFunction('Element.setOpacity', array($element,$value));
+ $options['percent']=0;
+ $this->scale($element, $options);
}
+
+ /**
+ * Alias of scale()
+ * @deprecated since 3.4
+ * @param TControl control element or element id
+ * @param array visual effect key-value pair options.
+ */
+ public function squish($element, $options=array())
+ {
+ $options['origin']=array('top', 'left');
+ $options['percent']=0;
+ $this->scale($element, $options);
+ }
+
+ /**
+ * Alias of scale()
+ * @deprecated since 3.4
+ * @param TControl control element or element id
+ * @param array visual effect key-value pair options.
+ */
+ public function switchOff($element, $options=array())
+ {
+ $options['direction']='vertical';
+ $options['percent']=0;
+ $this->scale($element, $options);
+ }
+
}
diff --git a/framework/Web/UI/ActiveControls/TCallbackClientSide.php b/framework/Web/UI/ActiveControls/TCallbackClientSide.php
index ec993c14..449bea80 100644
--- a/framework/Web/UI/ActiveControls/TCallbackClientSide.php
+++ b/framework/Web/UI/ActiveControls/TCallbackClientSide.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCallbackClientSide.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -28,8 +27,8 @@
*
* * Note that theses 2 events are not fired correctly by Opera. To make
* them work in this browser, Prado will fire them just after onPreDispatch.
- *
- * In a general way, onUninitialized, onLoading, onLoaded and onInteractive events
+ *
+ * In a general way, onUninitialized, onLoading, onLoaded and onInteractive events
* are not implemented consistently in all browsers.When cross browser compatibility is
* needed, it is best to avoid use them
*
@@ -46,7 +45,6 @@
* viewstate update. This will automatically set HasPriority to true when enabled.
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
- * @version $Id: TCallbackClientSide.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/ActiveControls/TCallbackEventParameter.php b/framework/Web/UI/ActiveControls/TCallbackEventParameter.php
index 728ebbba..2d4451a8 100644
--- a/framework/Web/UI/ActiveControls/TCallbackEventParameter.php
+++ b/framework/Web/UI/ActiveControls/TCallbackEventParameter.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.ActiveControls
@@ -28,7 +28,6 @@
* callback handler function) can be set using {@link setResponseData ResponseData} property.
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
- * @version $Id: TActivePageAdapter.php 1648 2007-01-24 05:52:22Z wei $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/ActiveControls/TCallbackOptions.php b/framework/Web/UI/ActiveControls/TCallbackOptions.php
index 19d53aeb..0d929ed1 100644
--- a/framework/Web/UI/ActiveControls/TCallbackOptions.php
+++ b/framework/Web/UI/ActiveControls/TCallbackOptions.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCallbackOptions.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -17,7 +16,6 @@
* to be attached to other active controls.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TCallbackOptions.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php b/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php
index 47b5fae4..cad3c9ee 100755
--- a/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php
+++ b/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCallbackResponseAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -22,7 +21,6 @@
* property.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TCallbackResponseAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -110,7 +108,6 @@ class TCallbackResponseAdapter extends THttpResponseAdapter
* is generated using microtime.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TCallbackResponseAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/ActiveControls/TDraggable.php b/framework/Web/UI/ActiveControls/TDraggable.php
index df92bec5..fe2ac4cc 100755
--- a/framework/Web/UI/ActiveControls/TDraggable.php
+++ b/framework/Web/UI/ActiveControls/TDraggable.php
@@ -1,17 +1,16 @@
<?php
/**
* TDraggable class file
- *
+ *
* @author Christophe BOULAIN (Christophe.Boulain@gmail.com)
* @copyright Copyright &copy; 2008, PradoSoft
* @license http://www.pradosoft.com/license
* @package System.Web.UI.ActiveControls
- * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $
*/
/**
* TDraggable is a control which can be dragged
- *
+ *
* This control will make "draggable" control.
* Properties :
*
@@ -21,14 +20,13 @@
* <b>{@link setRevert Revert}</b>: Set to True if you want your dragged element to revert to its initial position if not dropped on a valid area.
* <b>{@link setConstraint Constraint}</b>: Set this to Horizontal or Vertical if you want to constraint your move in one direction.
* <b>{@link setHandle Handle}</b>:
- *
+ *
* @author Christophe BOULAIN (Christophe.Boulain@gmail.com)
* @copyright Copyright &copy; 2008, PradoSoft
* @license http://www.pradosoft.com/license
* @package System.Web.UI.ActiveControls
- * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $
*/
-class TDraggable extends TPanel
+class TDraggable extends TPanel
{
/**
* Set the handle id or css class
@@ -38,7 +36,7 @@ class TDraggable extends TPanel
{
$this->setViewState('DragHandle', TPropertyValue::ensureString($value), null);
}
-
+
/**
* Get the handle id or css class
* @return string
@@ -47,7 +45,7 @@ class TDraggable extends TPanel
{
return $this->getViewState('DragHandle', null);
}
-
+
/**
* Determine if draggable element should revert to it orginal position
* upon release in an non-droppable container.
@@ -61,7 +59,7 @@ class TDraggable extends TPanel
{
return $this->getViewState('Revert', TDraggableRevertOptions::Revert);
}
-
+
/**
* Sets whether the draggable element should revert to it orginal position
* upon release in an non-droppable container.
@@ -79,7 +77,7 @@ class TDraggable extends TPanel
$value=TDraggableRevertOptions::None;
$this->setViewState('Revert', TPropertyValue::ensureEnum($value, 'TDraggableRevertOptions'), true);
}
-
+
/**
* Determine if the element should be cloned when dragged
* If true, Clones the element and drags the clone, leaving the original in place until the clone is dropped.
@@ -96,7 +94,7 @@ class TDraggable extends TPanel
{
return $this->getViewState('Ghosting', TDraggableGhostingOptions::None);
}
-
+
/**
* Sets wether the element should be cloned when dragged
* If true, Clones the element and drags the clone, leaving the original in place until the clone is dropped.
@@ -117,7 +115,7 @@ class TDraggable extends TPanel
$value=TDraggableGhostingOptions::None;
$this->setViewState('Ghosting', TPropertyValue::ensureEnum($value, 'TDraggableGhostingOptions'), TDraggableGhostingOptions::None);
}
-
+
/**
* Determine if the element should be constrainted in one direction or not
* @return CDraggableConstraint
@@ -126,7 +124,7 @@ class TDraggable extends TPanel
{
return $this->getViewState('Constraint', TDraggableConstraint::None);
}
-
+
/**
* Set wether the element should be constrainted in one direction
* @param CDraggableConstraint
@@ -135,7 +133,7 @@ class TDraggable extends TPanel
{
$this->setViewState('Constraint', TPropertyValue::ensureEnum($value, 'TDraggableConstraint'), TDraggableConstraint::None);
}
-
+
/**
* Registers clientscripts
*
@@ -166,7 +164,7 @@ class TDraggable extends TPanel
$code="new {$class}('{$this->getClientId()}', {$options}) ";
$cs->registerEndScript(sprintf('%08X', crc32($code)), $code);
}
-
+
/**
* Gets the name of the javascript class responsible for performing postback for this control.
* This method overrides the parent implementation.
@@ -176,7 +174,7 @@ class TDraggable extends TPanel
{
return 'Draggable';
}
-
+
/**
* Gets the post back options for this textbox.
* @return array
@@ -193,7 +191,7 @@ class TDraggable extends TPanel
else
$options['revert']=strtolower($revert);
if (($constraint=$this->getConstraint())!==TDraggableConstraint::None) $options['constraint']=strtolower($constraint);
- switch ($this->getGhosting())
+ switch ($this->getGhosting())
{
case TDraggableGhostingOptions::SuperGhosting:
$options['superghosting']=true;
@@ -205,7 +203,7 @@ class TDraggable extends TPanel
return $options;
}
-
+
}
/**
@@ -213,7 +211,6 @@ class TDraggable extends TPanel
* @copyright Copyright &copy; 2008, PradoSoft
* @license http://www.pradosoft.com/license
* @package System.Web.UI.ActiveControls
- * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $
*/
class TDraggableConstraint extends TEnumerable
{
@@ -227,7 +224,6 @@ class TDraggableConstraint extends TEnumerable
* @copyright Copyright &copy; 2008, PradoSoft
* @license http://www.pradosoft.com/license
* @package System.Web.UI.ActiveControls
- * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $
*/
class TDraggableGhostingOptions extends TEnumerable
{
@@ -241,7 +237,6 @@ class TDraggableGhostingOptions extends TEnumerable
* @copyright Copyright &copy; 2008, PradoSoft
* @license http://www.pradosoft.com/license
* @package System.Web.UI.ActiveControls
- * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $
*/
class TDraggableRevertOptions extends TEnumerable
{
diff --git a/framework/Web/UI/ActiveControls/TDropContainer.php b/framework/Web/UI/ActiveControls/TDropContainer.php
index 43e8017c..e0fea5df 100755
--- a/framework/Web/UI/ActiveControls/TDropContainer.php
+++ b/framework/Web/UI/ActiveControls/TDropContainer.php
@@ -1,13 +1,11 @@
<?php
/**
* TDropContainer class file
- *
+ *
* @author Christophe BOULAIN (Christophe.Boulain@gmail.com)
* @copyright Copyright &copy; 2008, PradoSoft
* @license http://www.pradosoft.com/license
- * @version $Id: TDropContainer.php 3159 2012-2013 PradoSoft
* @license http://www.pradosoft.com/license
- * @version $Id: TDropContainer.php 3285 2013-04-11 07:28:07Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -24,29 +22,28 @@ Prado::using('System.Web.UI.ActiveControls.TActivePanel');
/**
* TDropContainer is a panel where TDraggable controls can be dropped.
* When a TDraggable component is dropped into a TDropContainer, the {@link OnDrop OnDrop} event is raised.
- * The {@link TDropContainerEventParameter} param will contain the dropped control.
- *
+ * The {@link TDropContainerEventParameter} param will contain the dropped control.
+ *
* Properties :
- *
+ *
* <b>{@link setAcceptCssClass AcceptCssClass}</b> : a coma delimited classname of elements that the drop container can accept.
* <b>{@link setHoverCssClass HoverCssClass}</b>: CSS classname of the container when a draggable element hovers over the container.
- *
+ *
* Events:
- *
+ *
* <b>{@link OnDrop OnDrop}</b> : raised when a TDraggable control is dropped. The dropped control id is encapsulated in the event parameter,
* as well as mouse coordinates and key modifiers status
*
- *
+ *
* @author Christophe BOULAIN (Christophe.Boulain@gmail.com)
* @copyright Copyright &copy; 2008, PradoSoft
* @license http://www.pradosoft.com/license
- * @version $Id: TDropContainer.php 3285 2013-04-11 07:28:07Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
-class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHandler
-{
+class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHandler
+{
private $_container=null;
-
+
/**
* Creates a new callback control, sets the adapter to
* TActiveControlAdapter. If you override this class, be sure to set the
@@ -91,7 +88,7 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan
{
$this->setViewState('Accepts', TPropertyValue::ensureArray($value), '');
}
-
+
/**
* Sets the Css class name used when a draggble element is hovering
* over this container.
@@ -111,8 +108,8 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan
{
return $this->getViewState('HoverClass', '');
}
-
-
+
+
/**
* Raises callback event. This method is required bu {@link ICallbackEventHandler}
* interface.
@@ -125,19 +122,19 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan
$this->onDrop($param->getCallbackParameter());
$this->onCallback($param);
}
-
+
/**
- * Raises the onDrop event.
+ * Raises the onDrop event.
* The drop parameters are encapsulated into a {@link TDropContainerEventParameter}
- *
+ *
* @param object $dropControlId
*/
public function onDrop ($dropParams)
{
$this->raiseEvent('OnDrop', $this, new TDropContainerEventParameter ($dropParams));
-
+
}
-
+
/**
* This method is invoked when a callback is requested. The method raises
* 'OnCallback' event to fire up the event handlers. If you override this
@@ -149,7 +146,7 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan
{
$this->raiseEvent('OnCallback', $this, $param);
}
-
+
/**
* Gets the post back options for this textbox.
* @return array
@@ -163,7 +160,7 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan
$options['hoverclass'] = $this->getHoverCssClass();
return $options;
}
-
+
/**
* Gets the name of the javascript class responsible for performing postback for this control.
* This method overrides the parent implementation.
@@ -172,7 +169,7 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan
protected function getClientClassName()
{
return 'Prado.WebUI.DropContainer';
- }
+ }
/**
* Registers clientscripts
@@ -198,7 +195,7 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan
$this->getActiveControl()->registerCallbackClientScript(
$this->getClientClassName(), $this->getPostBackOptions());
}
-
+
/**
* Creates child control
* Override parent implementation to create a container which will contain all
@@ -214,7 +211,7 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan
parent::getControls()->add($this->_container);
}
}
-
+
/**
* Override parent implementation to return the container control collection.
*
@@ -225,7 +222,7 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan
$this->ensureChildControls();
return $this->_container->getControls();
}
-
+
/**
* Renders and replaces the panel's content on the client-side.
* When render() is called before the OnPreRender event, such as when render()
@@ -246,19 +243,18 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan
$this->getPage()->getAdapter()->registerControlToRender($this->_container,$writer);
}
}
-
+
}
/**
* TDropContainerEventParameter class
- *
+ *
* TDropContainerEventParameter encapsulate the parameter
* data for <b>OnDrop</b> event of TDropContainer components
- *
+ *
* @author Christophe BOULAIN (Christophe.Boulain@ceram.fr)
* @copyright Copyright &copy; 2008, PradoSoft
* @license http://www.pradosoft.com/license
- * @version $Id: TDropContainer.php 3285 2013-04-11 07:28:07Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
class TDropContainerEventParameter extends TEventParameter
diff --git a/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php b/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php
index 4f1dbbf8..53d6aead 100644
--- a/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php
+++ b/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TEventTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -22,7 +21,6 @@ Prado::using('System.Web.UI.ActiveControls.TTriggeredCallback');
* {@link setPreventDefaultAction PreventDefaultAction} is set to true.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TEventTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/ActiveControls/TInPlaceTextBox.php b/framework/Web/UI/ActiveControls/TInPlaceTextBox.php
index 5309b7e8..012f2da3 100644
--- a/framework/Web/UI/ActiveControls/TInPlaceTextBox.php
+++ b/framework/Web/UI/ActiveControls/TInPlaceTextBox.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TInPlaceTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -38,9 +37,8 @@ Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
*
* Since 3.1.2, you can set the {@link setReadOnly ReadOnly} property to make
* the control not editable. This property can be also changed on callback
- *
+ *
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TInPlaceTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -145,7 +143,7 @@ class TInPlaceTextBox extends TActiveTextBox
$client->setValue($this, $value);
}
}
-
+
/**
* Update ClientSide Readonly property
* @param boolean value
@@ -232,7 +230,7 @@ class TInPlaceTextBox extends TActiveTextBox
if($this->hasEventHandler('OnLoadingText'))
$options['LoadTextOnEdit'] = true;
-
+
$options['ReadOnly']=$this->getReadOnly();
return $options;
}
diff --git a/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php b/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php
index 46df7a22..bc250521 100644
--- a/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php
+++ b/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTimeTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -26,7 +25,6 @@ Prado::using('System.Web.UI.ActiveControls.TCallback');
* {@link setStartTimerOnLoad StartTimerOnLoad} is true.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TTimeTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/ActiveControls/TTriggeredCallback.php b/framework/Web/UI/ActiveControls/TTriggeredCallback.php
index 2365326b..544707b0 100644
--- a/framework/Web/UI/ActiveControls/TTriggeredCallback.php
+++ b/framework/Web/UI/ActiveControls/TTriggeredCallback.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -18,7 +17,6 @@ Prado::using('System.Web.UI.ActiveControls.TCallback');
* property sets the control ID to observe the trigger.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php b/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php
index e9db1bed..0b323066 100644
--- a/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php
+++ b/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TValueTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -25,7 +24,6 @@ Prado::using('System.Web.UI.ActiveControls.TTriggeredCallback');
* observed, the polling interval is reset to the original value.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TValueTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
diff --git a/framework/Web/UI/JuiControls/TJuiAutoComplete.php b/framework/Web/UI/JuiControls/TJuiAutoComplete.php
new file mode 100644
index 00000000..115969c5
--- /dev/null
+++ b/framework/Web/UI/JuiControls/TJuiAutoComplete.php
@@ -0,0 +1,430 @@
+<?php
+/**
+ * TJuiAutoComplete class file.
+ *
+ * @author Wei Zhuo <weizhuo[at]gamil[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.ActiveControls
+ */
+
+/**
+ * Load active text box.
+ */
+Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
+Prado::using('System.Web.UI.ActiveControls.TCallbackEventParameter');
+Prado::using('System.Web.UI.JuiControls.TJuiControlAdapter');
+/**
+ * TJuiAutoComplete class.
+ *
+ * TJuiAutoComplete is a textbox that provides a list of suggestion on
+ * the current partial word typed in the textbox. The suggestions are
+ * requested using callbacks, and raises the {@link onSuggestion OnSuggestion}
+ * event. The events of the TActiveText (from which TJuiAutoComplete is extended from)
+ * and {@link onSuggestion OnSuggestion} are mutually exculsive. That is,
+ * if {@link onTextChange OnTextChange} and/or {@link onCallback OnCallback}
+ * events are raise, then {@link onSuggestion OnSuggestion} will not be raise, and
+ * vice versa.
+ *
+ * The list of suggestions should be set in the {@link onSuggestion OnSuggestion}
+ * event handler. The partial word to match the suggestion is in the
+ * {@link TCallbackEventParameter::getCallbackParameter TCallbackEventParameter::CallbackParameter}
+ * property. The datasource of the TJuiAutoComplete must be set using {@link setDataSource}
+ * method. This sets the datasource for the suggestions repeater, available through
+ * the {@link getSuggestions Suggestions} property. Header, footer templates and
+ * other properties of the repeater can be access via the {@link getSuggestions Suggestions}
+ * property and its sub-properties.
+ *
+ * The {@link setTextCssClass TextCssClass} property if set is used to find
+ * the element within the Suggestions.ItemTemplate and Suggestions.AlternatingItemTemplate
+ * that contains the actual text for the suggestion selected. That is,
+ * only text inside elements with CSS class name equal to {@link setTextCssClass TextCssClass}
+ * will be used as suggestions.
+ *
+ * To return the list of suggestions back to the browser, supply a non-empty data source
+ * and call databind. For example,
+ * <code>
+ * function autocomplete_suggestion($sender, $param)
+ * {
+ * $token = $param->getToken(); //the partial word to match
+ * $sender->setDataSource($this->getSuggestionsFor($token)); //set suggestions
+ * $sender->dataBind();
+ * }
+ * </code>
+ *
+ * The suggestion will be rendered when the {@link dataBind()} method is called
+ * <strong>during a callback request</strong>.
+ *
+ * When an suggestion is selected, that is, when the use has clicked, pressed
+ * the "Enter" key, or pressed the "Tab" key, the {@link onSuggestionSelected OnSuggestionSelected}
+ * event is raised. The
+ * {@link TCallbackEventParameter::getCallbackParameter TCallbackEventParameter::CallbackParameter}
+ * property contains the index of the selected suggestion.
+ *
+ * TJuiAutoComplete allows multiple suggestions within one textbox with each
+ * word or phrase separated by any characters specified in the
+ * {@link setSeparator Separator} property. The {@link setFrequency Frequency}
+ * and {@link setMinChars MinChars} properties sets the delay and minimum number
+ * of characters typed, respectively, before requesting for sugggestions.
+ *
+ * Use {@link onTextChange OnTextChange} and/or {@link onCallback OnCallback} events
+ * to handle post backs due to {@link setAutoPostBack AutoPostBack}.
+ *
+ * In the {@link getSuggestions Suggestions} TRepater item template, all HTML text elements
+ * are considered as text for the suggestion. Text within HTML elements with CSS class name
+ * "informal" are ignored as text for suggestions.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @package System.Web.UI.ActiveControls
+ * @since 3.1
+ */
+class TJuiAutoComplete extends TActiveTextBox implements INamingContainer, IJuiOptions
+{
+ /**
+ * @var ITemplate template for repeater items
+ */
+ private $_repeater=null;
+ /**
+ * @var TPanel result panel holding the suggestion items.
+ */
+ private $_resultPanel=null;
+
+ /**
+ * Creates a new callback control, sets the adapter to
+ * TActiveControlAdapter. If you override this class, be sure to set the
+ * adapter appropriately by, for example, by calling this constructor.
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->setAdapter(new TJuiControlAdapter($this));
+ }
+
+ /**
+ * Object containing defined javascript options
+ * @return TJuiControlOptions
+ */
+ public function getOptions()
+ {
+ static $options;
+ if($options===null)
+ $options=new TJuiControlOptions($this);
+ return $options;
+ }
+
+ /**
+ * Array containing valid javascript options
+ * @return array()
+ */
+ public function getValidOptions()
+ {
+ return array('appendTo', 'autoFocus', 'delay', 'disabled', 'minLength', 'position', 'source');
+ }
+
+ /**
+ * Array containing valid javascript events
+ * @return array()
+ */
+ public function getValidEvents()
+ {
+ return array();
+ }
+
+ /**
+ * @param string Css class name of the element to use for suggestion.
+ */
+ public function setTextCssClass($value)
+ {
+ $this->setViewState('TextCssClass', $value);
+ }
+
+ /**
+ * @return string Css class name of the element to use for suggestion.
+ */
+ public function getTextCssClass()
+ {
+ return $this->getViewState('TextCssClass');
+ }
+
+ /**
+ * Raises the callback event. This method is overrides the parent implementation.
+ * If {@link setAutoPostBack AutoPostBack} is enabled it will raise
+ * {@link onTextChanged OnTextChanged} event event and then the
+ * {@link onCallback OnCallback} event. The {@link onSuggest OnSuggest} event is
+ * raise if the request is to find sugggestions, the {@link onTextChanged OnTextChanged}
+ * and {@link onCallback OnCallback} events are <b>NOT</b> raised.
+ * This method is mainly used by framework and control developers.
+ * @param TCallbackEventParameter the event parameter
+ */
+ public function raiseCallbackEvent($param)
+ {
+ $token = $param->getCallbackParameter();
+ if(is_array($token) && count($token) == 2)
+ {
+ if($token[1] === '__TJuiAutoComplete_onSuggest__')
+ {
+ $parameter = new TJuiAutoCompleteEventParameter($this->getResponse(), $token[0]);
+ $this->onSuggest($parameter);
+ }
+ else if($token[1] === '__TJuiAutoComplete_onSuggestionSelected__')
+ {
+ $parameter = new TJuiAutoCompleteEventParameter($this->getResponse(), null, $token[0]);
+ $this->onSuggestionSelected($parameter);
+ }
+ }
+ else if($this->getAutoPostBack())
+ parent::raiseCallbackEvent($param);
+ }
+
+ /**
+ * This method is invoked when an autocomplete suggestion is requested.
+ * The method raises 'OnSuggest' event. If you override this
+ * method, be sure to call the parent implementation so that the event
+ * handler can be invoked.
+ * @param TCallbackEventParameter event parameter to be passed to the event handlers
+ */
+ public function onSuggest($param)
+ {
+ $this->raiseEvent('OnSuggest', $this, $param);
+ }
+
+ /**
+ * This method is invoked when an autocomplete suggestion is selected.
+ * The method raises 'OnSuggestionSelected' event. If you override this
+ * method, be sure to call the parent implementation so that the event
+ * handler can be invoked.
+ * @param TCallbackEventParameter event parameter to be passed to the event handlers
+ */
+ public function onSuggestionSelected($param)
+ {
+ $this->raiseEvent('OnSuggestionSelected', $this, $param);
+ }
+
+ /**
+ * @param array data source for suggestions.
+ */
+ public function setDataSource($data)
+ {
+ $this->getSuggestions()->setDataSource($data);
+ }
+
+ /**
+ * Overrides parent implementation. Callback {@link renderSuggestions()} when
+ * page's IsCallback property is true.
+ */
+ public function dataBind()
+ {
+ parent::dataBind();
+ if($this->getPage()->getIsCallback())
+ $this->renderSuggestions($this->getResponse()->createHtmlWriter());
+ }
+
+ /**
+ * @return TPanel suggestion results panel.
+ */
+ public function getResultPanel()
+ {
+ if($this->_resultPanel===null)
+ $this->_resultPanel = $this->createResultPanel();
+ return $this->_resultPanel;
+ }
+
+ /**
+ * @return TPanel new instance of result panel. Default uses TPanel.
+ */
+ protected function createResultPanel()
+ {
+ $panel = Prado::createComponent('System.Web.UI.WebControls.TPanel');
+ $this->getControls()->add($panel);
+ $panel->setID('result');
+ return $panel;
+ }
+
+ /**
+ * @return TRepeater suggestion list repeater
+ */
+ public function getSuggestions()
+ {
+ if($this->_repeater===null)
+ $this->_repeater = $this->createRepeater();
+ return $this->_repeater;
+ }
+
+ /**
+ * @return TRepeater new instance of TRepater to render the list of suggestions.
+ */
+ protected function createRepeater()
+ {
+ $repeater = Prado::createComponent('System.Web.UI.WebControls.TRepeater');
+ $repeater->setItemTemplate(new TTemplate('<%# $this->Data %>',null));
+ $this->getControls()->add($repeater);
+ return $repeater;
+ }
+
+ /**
+ * Renders the end tag and registers javascript effects library.
+ */
+ public function renderEndTag($writer)
+ {
+ parent::renderEndTag($writer);
+ $this->renderResultPanel($writer);
+ }
+
+ /**
+ * Renders the result panel.
+ * @param THtmlWriter the renderer.
+ */
+ protected function renderResultPanel($writer)
+ {
+ $this->getResultPanel()->render($writer);
+ }
+
+ /**
+ * Renders the suggestions during a callback respones.
+ * @param THtmlWriter the renderer.
+ */
+ public function renderCallback($writer)
+ {
+ $this->renderSuggestions($writer);
+ }
+
+ /**
+ * Renders the suggestions repeater.
+ * @param THtmlWriter the renderer.
+ */
+ public function renderSuggestions($writer)
+ {
+ if($this->getActiveControl()->canUpdateClientSide())
+ {
+ $data=array();
+ $items=$this->getSuggestions()->getItems();
+ $writer = new TTextWriter;
+ for($i=0; $i<$items->Count; $i++)
+ {
+ $items->itemAt($i)->render($writer);
+ $item=$writer->flush();
+ $data[]=array( 'id' => $i, 'label' => $item);
+ }
+
+ $this->getResponse()->getAdapter()->setResponseData($data);
+ }
+ }
+
+ /**
+ * @return array list of callback options.
+ */
+ protected function getPostBackOptions()
+ {
+ //disallow page state update ?
+ //$this->getActiveControl()->getClientSide()->setEnablePageStateUpdate(false);
+ $options = $this->getOptions()->toArray();
+ /*
+ if(strlen($string = $this->getSeparator()))
+ {
+ $string = strtr($string,array('\t'=>"\t",'\n'=>"\n",'\r'=>"\r"));
+ $token = preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY);
+ $options['tokens'] = $token;
+ }
+ */
+ if($this->getAutoPostBack())
+ {
+ $options = array_merge($options,parent::getPostBackOptions());
+ $options['AutoPostBack'] = true;
+ }
+ if(strlen($textCssClass = $this->getTextCssClass()))
+ $options['textCssClass'] = $textCssClass;
+ $options['appendTo'] = '#'.$this->getResultPanel()->getClientID();
+ $options['ID'] = $this->getClientID();
+ $options['EventTarget'] = $this->getUniqueID();
+ $options['CausesValidation'] = $this->getCausesValidation();
+ $options['ValidationGroup'] = $this->getValidationGroup();
+ return $options;
+ }
+
+ /**
+ * Override parent implementation, no javascript is rendered here instead
+ * the javascript required for active control is registered in {@link addAttributesToRender}.
+ */
+ protected function renderClientControlScript($writer)
+ {
+ }
+
+ /**
+ * @return string corresponding javascript class name for this TActiveButton.
+ */
+ protected function getClientClassName()
+ {
+ return 'Prado.WebUI.TJuiAutoComplete';
+ }
+}
+
+/**
+ * TAutCompleteEventParameter contains the {@link getToken Token} requested by
+ * the user for a partial match of the suggestions.
+ *
+ * The {@link getSelectedIndex SelectedIndex} is a zero-based index of the
+ * suggestion selected by the user, -1 if not suggestion is selected.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @package System.Web.UI.ActiveControls
+ * @since 3.1
+ */
+class TJuiAutoCompleteEventParameter extends TCallbackEventParameter
+{
+ private $_selectedIndex=-1;
+
+ /**
+ * Creates a new TCallbackEventParameter.
+ */
+ public function __construct($response, $parameter, $index=-1)
+ {
+ parent::__construct($response, $parameter);
+ $this->_selectedIndex=$index;
+ }
+
+ /**
+ * @return int selected suggestion zero-based index, -1 if not selected.
+ */
+ public function getSelectedIndex()
+ {
+ return $this->_selectedIndex;
+ }
+
+ /**
+ * @return string token for matching a list of suggestions.
+ */
+ public function getToken()
+ {
+ return $this->getCallbackParameter();
+ }
+}
+
+/**
+ * TJuiAutoCompleteTemplate class.
+ *
+ * TJuiAutoCompleteTemplate is the default template for TJuiAutoCompleteTemplate
+ * item template.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @package System.Web.UI.ActiveControls
+ * @since 3.1
+ */
+class TJuiAutoCompleteTemplate extends TComponent implements ITemplate
+{
+ private $_template;
+
+ public function __construct($template)
+ {
+ $this->_template = $template;
+ }
+ /**
+ * Instantiates the template.
+ * It creates a {@link TDataList} control.
+ * @param TControl parent to hold the content within the template
+ */
+ public function instantiateIn($parent)
+ {
+ $parent->getControls()->add($this->_template);
+ }
+}
diff --git a/framework/Web/UI/JuiControls/TJuiControlAdapter.php b/framework/Web/UI/JuiControls/TJuiControlAdapter.php
new file mode 100644
index 00000000..3668a8b4
--- /dev/null
+++ b/framework/Web/UI/JuiControls/TJuiControlAdapter.php
@@ -0,0 +1,292 @@
+<?php
+/**
+ * TJuiControlAdapter class file.
+ *
+ * @author Fabio Bas <ctrlaltca@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2013-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.JuiControls
+ */
+
+Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
+
+/**
+ * TJuiControlAdapter class
+ *
+ * TJuiControlAdapter is the base adapter class for controls that are
+ * derived from a jQuery-ui widget. It exposes convenience methods to
+ * publish jQuery-UI javascript and css assets.
+ *
+ * @author Fabio Bas <ctrlaltca@gmail.com>
+ * @package System.Web.UI.JuiControls
+ * @since 3.3
+ */
+class TJuiControlAdapter extends TActiveControlAdapter
+{
+ const SCRIPT_PATH = 'jquery';
+ const CSS_PATH = 'css';
+ const BASE_CSS_FILENAME ='jquery-ui.css';
+
+ /**
+ * @param string set the jquery-ui style
+ */
+ public function setJuiBaseStyle($value)
+ {
+ $this->getControl()->setViewState('JuiBaseStyle', $value, 'base');
+ }
+
+ /**
+ * @return string current jquery-ui style
+ */
+ public function getJuiBaseStyle()
+ {
+ return $this->getControl()->getViewState('JuiBaseStyle', 'base');
+ }
+
+ /**
+ * Inject jquery script and styles before render
+ */
+ public function onPreRender($param)
+ {
+ parent::onPreRender($param);
+ $this->getPage()->getClientScript()->registerPradoScript('jqueryui');
+ $this->publishJuiStyle(self::BASE_CSS_FILENAME);
+ }
+
+ /**
+ * @param string jQuery asset file in the self::SCRIPT_PATH directory.
+ * @return string jQuery asset url.
+ */
+ protected function getAssetUrl($file='')
+ {
+ $base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl();
+ return $base.'/'.self::SCRIPT_PATH.'/'.$file;
+ }
+
+ /**
+ * Publish the jQuery-ui style Css asset file.
+ * @param file name
+ * @return string Css file url.
+ */
+ public function publishJuiStyle($file)
+ {
+ $url = $this->getAssetUrl(self::CSS_PATH.'/'.$this->getJuiBaseStyle().'/'.$file);
+ $cs = $this->getPage()->getClientScript();
+ if(!$cs->isStyleSheetFileRegistered($url))
+ $cs->registerStyleSheetFile($url, $url);
+ return $url;
+ }
+
+}
+
+/**
+ * IJuiOptions interface
+ *
+ * IJuiOptions is the interface that must be implemented by controls using
+ * {@link TJuiControlOptions}.
+ *
+ * @author Fabio Bas <ctrlaltca@gmail.com>
+ * @package System.Web.UI.JuiControls
+ * @since 3.3
+ */
+interface IJuiOptions
+{
+ public function getOptions();
+ public function getValidOptions();
+ public function getValidEvents();
+}
+
+/**
+ * TJuiControlOptions interface
+ *
+ * TJuiControlOptions is an helper class that can collect a list of options
+ * for a control. The control must implement {@link IJuiOptions}.
+ * The options are validated againg an array of valid options provided by the control itself.
+ * Since component properties are case insensitive, the array of valid options is used
+ * to ensure the option name has the correct case.
+ * The options array can then get retrieved using {@link toArray} and applied to the jQuery-ui widget.
+ * In addition to the options, this class will render the needed javascript to raise a callback
+ * for any event for which an handler is defined in the control.
+ *
+ * @author Fabio Bas <ctrlaltca@gmail.com>
+ * @package System.Web.UI.JuiControls
+ * @since 3.3
+ */
+class TJuiControlOptions
+{
+ /**
+ * @var TMap map of javascript options.
+ */
+ private $_options;
+ /**
+ * @var TControl parent control.
+ */
+ private $_control;
+
+ public function __construct($control)
+ {
+ if(!$control instanceof IJuiOptions)
+ throw new THttpException(500,'juioptions_control_invalid',$control->ID);
+ $this->_control=$control;
+ }
+ /**
+ * Sets a named options with a value. Options are used to store and retrive
+ * named values for the javascript control.
+ * @param string option name.
+ * @param mixed option value.
+ * @throws THttpException
+ */
+ public function __set($name,$value)
+ {
+ if($this->_options===null)
+ $this->_options=array();
+
+ foreach($this->_control->getValidOptions() as $option)
+ {
+ if(0 == strcasecmp($name, $option))
+ {
+ $low = strtolower($value);
+ if($low === 'null')
+ {
+ $this->_options[$option] = null;
+ } elseif($low === 'true') {
+ $this->_options[$option] = true;
+ } elseif($low === 'false') {
+ $this->_options[$option] = false;
+ } elseif(is_numeric($value)) {
+ // trick to get float or integer automatically when needed
+ $this->_options[$option] = $value + 0;
+ } else {
+ $this->_options[$option] = $value;
+ }
+ return;
+ }
+ }
+
+ throw new THttpException(500,'juioptions_option_invalid',$this->_control->ID, $name);
+ }
+
+ /**
+ * Gets an option named value. Options are used to store and retrive
+ * named values for the base active controls.
+ * @param string option name.
+ * @return mixed options value or null if not set.
+ */
+ public function __get($name)
+ {
+ if($this->_options===null)
+ $this->_options=array();
+
+ foreach($this->_control->getValidOptions() as $option)
+ {
+ if(0 == strcasecmp($name, $option) && isset($this->_options[$option]))
+ {
+ return $this->_options[$option];
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @return Array of active control options
+ */
+ public function toArray()
+ {
+ $ret= ($this->_options===null) ? array() : $this->_options;
+
+ foreach($this->_control->getValidEvents() as $event)
+ if($this->_control->hasEventHandler('on'.$event))
+ $ret[$event]=new TJavaScriptLiteral("function( event, ui ) { Prado.JuiCallback(".TJavascript::encode($this->_control->getUniqueID()).", ".TJavascript::encode($event).", event, ui, this); }");
+
+ return $ret;
+ }
+
+ /**
+ * Raise the specific callback event handler of the target control.
+ * @param mixed callback parameters
+ */
+ public function raiseCallbackEvent($param)
+ {
+ $callbackParam=$param->CallbackParameter;
+ if(isset($callbackParam->event))
+ {
+ $eventName = 'On'.ucfirst($callbackParam->event);
+ if($this->_control->hasEventHandler($eventName))
+ {
+ $this->_control->$eventName( new TJuiEventParameter(
+ $this->_control->getResponse(),
+ isset($callbackParam->ui) ? $callbackParam->ui : null)
+ );
+ }
+ }
+ }
+}
+
+/**
+ * TJuiEventParameter class
+ *
+ * TJuiEventParameter encapsulate the parameters for callback
+ * events of TJui* components.
+ * Any parameter representing a control is identified by its
+ * clientside ID.
+ * TJuiEventParameter contains a {@link getControl} helper method
+ * that retrieves an existing PRADO control on che current page from its
+ * clientside ID as returned by the callback.
+ * For example, if the parameter contains a "draggable" item (as returned in
+ * {@link TJuiDroppable}::OnDrop event), the relative PRADO control can be
+ * retrieved using:
+ * <code>
+ * $draggable = $param->getControl($param->getCallbackParameter()->draggable);
+ * </code>
+ *
+ * A shortcut __get() method is implemented, too:
+ * <code>
+ * $draggable = $param->DraggableControl;
+ * </code>
+ *
+ * @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
+ * @license http://www.pradosoft.com/license
+ * @package System.Web.UI.JuiControls
+ */
+class TJuiEventParameter extends TCallbackEventParameter
+{
+ /**
+ * getControl
+ *
+ * Compatibility method to get a control from its clientside id
+ * @return TControl control, or null if not found
+ */
+ public function getControl($id)
+ {
+ $control=null;
+ $service=prado::getApplication()->getService();
+ if ($service instanceof TPageService)
+ {
+ // Find the control
+ // Warning, this will not work if you have a '_' in your control Id !
+ $controlId=str_replace(TControl::CLIENT_ID_SEPARATOR,TControl::ID_SEPARATOR,$id);
+ $control=$service->getRequestedPage()->findControl($controlId);
+ }
+ return $control;
+ }
+
+ /**
+ * Gets a control instance named after a returned control id.
+ * Example: if a $param->draggable control id is returned from clientside,
+ * calling $param->DraggableControl will return the control instance
+ * @return mixed control or null if not set.
+ */
+ public function __get($name)
+ {
+ $pos=strpos($name, 'Control',1);
+ $name=strtolower(substr($name, 0, $pos));
+
+ $cp=$this->getCallbackParameter();
+ if(!isset($cp->$name) || $cp->$name=='')
+ return null;
+
+ return $this->getControl($cp->$name);
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/JuiControls/TJuiDraggable.php b/framework/Web/UI/JuiControls/TJuiDraggable.php
new file mode 100644
index 00000000..56e6c7e7
--- /dev/null
+++ b/framework/Web/UI/JuiControls/TJuiDraggable.php
@@ -0,0 +1,150 @@
+<?php
+/**
+ * TJuiDraggable class file.
+ *
+ * @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2013-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.JuiControls
+ */
+
+Prado::using('System.Web.UI.JuiControls.TJuiControlAdapter');
+Prado::using('System.Web.UI.ActiveControls.TActivePanel');
+
+/**
+ * TJuiDraggable class.
+ *
+ * TJuiDraggable is an extension to {@link TActivePanel} based on jQuery-UI's
+ * {@link http://jqueryui.com/draggable/ Draggable} interaction.
+ * The panel can be moved using the mouse, and eventually dropped over a
+ * {@link TJuiDroppable}.
+ *
+ * <code>
+ * <com:TJuiDraggable
+ * ID="drag1"
+ * Style="border: 1px solid red; width:100px;height:100px"
+ * Options.Axis="y"
+ * OnStop="drag1_dragged"
+ * >
+ * drag me
+ * </com:TJuiDraggable>
+ * </code>
+ *
+ * @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
+ * @package System.Web.UI.JuiControls
+ * @since 3.3
+ */
+class TJuiDraggable extends TActivePanel implements IJuiOptions, ICallbackEventHandler
+{
+ protected $_options;
+
+ /**
+ * Creates a new callback control, sets the adapter to
+ * TActiveControlAdapter. If you override this class, be sure to set the
+ * adapter appropriately by, for example, by calling this constructor.
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->setAdapter(new TJuiControlAdapter($this));
+ }
+
+ /**
+ * Object containing defined javascript options
+ * @return TJuiControlOptions
+ */
+ public function getOptions()
+ {
+ if($this->_options===null)
+ $this->_options=new TJuiControlOptions($this);
+ return $this->_options;
+ }
+
+ /**
+ * Array containing valid javascript options
+ * @return array()
+ */
+ public function getValidOptions()
+ {
+ return array('addClasses', 'appendTo', 'axis', 'cancel', 'connectToSortable', 'containment', 'cursor', 'cursorAt', 'delay', 'disabled', 'distance', 'grid', 'handle', 'helper', 'iframeFix', 'opacity', 'refreshPositions', 'revert', 'revertDuration', 'scope', 'scroll', 'scrollSensitivity', 'scrollSpeed', 'snap', 'snapMode', 'snapTolerance', 'stack', 'zIndex');
+ }
+
+ /**
+ * Array containing valid javascript events
+ * @return array()
+ */
+ public function getValidEvents()
+ {
+ return array('create', 'drag', 'start', 'stop');
+ }
+
+ /**
+ * @return array list of callback options.
+ */
+ protected function getPostBackOptions()
+ {
+ return $this->getOptions()->toArray();
+ }
+
+ /**
+ * Ensure that the ID attribute is rendered and registers the javascript code
+ * for initializing the active control.
+ */
+ protected function addAttributesToRender($writer)
+ {
+ parent::addAttributesToRender($writer);
+
+ $writer->addAttribute('id',$this->getClientID());
+ $options=TJavascript::encode($this->getPostBackOptions());
+ $cs=$this->getPage()->getClientScript();
+ $code="jQuery('#".$this->getClientId()."').draggable(".$options.");";
+ $cs->registerEndScript(sprintf('%08X', crc32($code)), $code);
+ }
+
+ /**
+ * Raises callback event. This method is required by the {@link ICallbackEventHandler}
+ * interface.
+ * @param TCallbackEventParameter the parameter associated with the callback event
+ */
+ public function raiseCallbackEvent($param)
+ {
+ $this->getOptions()->raiseCallbackEvent($param);
+ }
+
+ /**
+ * Raises the OnCreate event
+ * @param object $params event parameters
+ */
+ public function onCreate ($params)
+ {
+ $this->raiseEvent('OnCreate', $this, $params);
+ }
+
+ /**
+ * Raises the OnDrag event
+ * @param object $params event parameters
+ */
+ public function onDrag ($params)
+ {
+ $this->raiseEvent('OnDrag', $this, $params);
+ }
+
+ /**
+ * Raises the OnStart event
+ * @param object $params event parameters
+ */
+ public function onStart ($params)
+ {
+ $this->raiseEvent('OnStart', $this, $params);
+ }
+
+ /**
+ * Raises the OnStop event
+ * @param object $params event parameters
+ */
+ public function onStop ($params)
+ {
+ $this->raiseEvent('OnStop', $this, $params);
+ }
+}
diff --git a/framework/Web/UI/JuiControls/TJuiDroppable.php b/framework/Web/UI/JuiControls/TJuiDroppable.php
new file mode 100644
index 00000000..2d2ed6b9
--- /dev/null
+++ b/framework/Web/UI/JuiControls/TJuiDroppable.php
@@ -0,0 +1,201 @@
+<?php
+/**
+ * TJuiDroppable class file.
+ *
+ * @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2013-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.JuiControls
+ */
+
+Prado::using('System.Web.UI.JuiControls.TJuiControlAdapter');
+Prado::using('System.Web.UI.ActiveControls.TActivePanel');
+
+/**
+ * TJuiDroppable class.
+ *
+ * TJuiDroppable is an extension to {@link TActivePanel} based on jQuery-UI's
+ * {@link http://jqueryui.com/droppable/ Droppable} interaction.
+ * When a {@link TJuiDraggable} is dropped over a TJuiDroppable panel, the
+ * {@link onDrop OnDrop} event will be triggered. The event hanler will receive
+ * a {@link TJuiEventParameter} object containing a reference to the dropped control
+ * in the <tt>DraggableControl</tt> property.
+ *
+ * <code>
+ * <com:TJuiDraggable
+ * ID="drag1"
+ * Style="border: 1px solid red; width:100px;height:100px;background-color: #fff"
+ * >
+ * drag me
+ * </com:TJuiDraggable>
+ *
+ * <com:TJuiDroppable
+ * ID="drop1"
+ * Style="border: 1px solid blue; width:600px;height:600px; background-color: lime"
+ * OnDrop="drop1_ondrop"
+ * >
+ * drop it over me
+ * </com:TJuiDroppable>
+ * </code>
+ *
+ * <code>
+ * public function drop1_ondrop($sender, $param)
+ * {
+ * $draggable=$param->DraggableControl;
+ * $offset=$param->getCallbackParameter()->offset;
+ * $target=$param->getCallbackParameter()->target->offset;
+ * $top=$offset->top - $target->top;
+ * $left=$offset->left - $target->left;
+ * $this->label1->Text="Dropped ".$draggable->ID." at: <br/>Top=".$top." Left=".$left;
+ * }
+ * </code>
+ *
+ * @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
+ * @package System.Web.UI.JuiControls
+ * @since 3.3
+ */
+class TJuiDroppable extends TActivePanel implements IJuiOptions, ICallbackEventHandler
+{
+ protected $_options;
+
+ /**
+ * Creates a new callback control, sets the adapter to
+ * TActiveControlAdapter. If you override this class, be sure to set the
+ * adapter appropriately by, for example, by calling this constructor.
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->setAdapter(new TJuiControlAdapter($this));
+ }
+
+ /**
+ * Object containing defined javascript options
+ * @return TJuiControlOptions
+ */
+ public function getOptions()
+ {
+ if($this->_options===null)
+ $this->_options=new TJuiControlOptions($this);
+ return $this->_options;
+ }
+
+ /**
+ * Array containing valid javascript options
+ * @return array()
+ */
+ public function getValidOptions()
+ {
+ return array('addClasses', 'appendTo', 'axis', 'cancel', 'connectToSortable', 'containment', 'cursor', 'cursorAt', 'delay', 'disabled', 'distance', 'grid', 'handle', 'helper', 'iframeFix', 'opacity', 'refreshPositions', 'revert', 'revertDuration', 'scope', 'scroll', 'scrollSensitivity', 'scrollSpeed', 'snap', 'snapMode', 'snapTolerance', 'stack', 'zIndex');
+ }
+
+ /**
+ * Array containing valid javascript events
+ * @return array()
+ */
+ public function getValidEvents()
+ {
+ return array('activate', 'create', 'deactivate', 'drop', 'out', 'over');
+ }
+
+ /**
+ * @return array list of callback options.
+ */
+ protected function getPostBackOptions()
+ {
+ return $this->getOptions()->toArray();
+ }
+
+ /**
+ * Ensure that the ID attribute is rendered and registers the javascript code
+ * for initializing the active control.
+ */
+ protected function addAttributesToRender($writer)
+ {
+ parent::addAttributesToRender($writer);
+
+ $writer->addAttribute('id',$this->getClientID());
+ $options=TJavascript::encode($this->getPostBackOptions());
+ $cs=$this->getPage()->getClientScript();
+ $code="jQuery('#".$this->getClientId()."').droppable(".$options.");";
+ $cs->registerEndScript(sprintf('%08X', crc32($code)), $code);
+ }
+
+ /**
+ * Raises callback event. This method is required by the {@link ICallbackEventHandler}
+ * interface.
+ * @param TCallbackEventParameter the parameter associated with the callback event
+ */
+ public function raiseCallbackEvent($param)
+ {
+ $this->getOptions()->raiseCallbackEvent($param);
+ }
+
+ /**
+ * Raises the OnActivate event
+ * @param object $params event parameters
+ */
+ public function onActivate ($params)
+ {
+ $this->raiseEvent('OnActivate', $this, $params);
+ }
+
+ /**
+ * Raises the OnCreate event
+ * @param object $params event parameters
+ */
+ public function onCreate ($params)
+ {
+ $this->raiseEvent('OnCreate', $this, $params);
+ }
+
+ /**
+ * Raises the OnDeactivate event
+ * @param object $params event parameters
+ */
+ public function onDeactivate ($params)
+ {
+ $this->raiseEvent('OnDeactivate', $this, $params);
+ }
+
+ /**
+ * Raises the OnDrop event
+ * @param object $params event parameters
+ */
+ public function onDrop ($params)
+ {
+ $this->raiseEvent('OnDrop', $this, $params);
+ }
+
+ /**
+ * Raises the OnOut event
+ * @param object $params event parameters
+ */
+ public function OnOut ($params)
+ {
+ $this->raiseEvent('OnOut', $this, $params);
+ }
+
+ /**
+ * Raises the OnOver event
+ * @param object $params event parameters
+ */
+ public function OnOver ($params)
+ {
+ $this->raiseEvent('OnOver', $this, $params);
+ }
+
+ /**
+ * This method is invoked when a callback is requested. The method raises
+ * 'OnCallback' event to fire up the event handlers. If you override this
+ * method, be sure to call the parent implementation so that the event
+ * handler can be invoked.
+ * @param TCallbackEventParameter event parameter to be passed to the event handlers
+ */
+
+ public function onCallback($param)
+ {
+ $this->raiseEvent('OnCallback', $this, $param);
+ }
+}
diff --git a/framework/Web/UI/JuiControls/TJuiProgressbar.php b/framework/Web/UI/JuiControls/TJuiProgressbar.php
new file mode 100644
index 00000000..41f3eab4
--- /dev/null
+++ b/framework/Web/UI/JuiControls/TJuiProgressbar.php
@@ -0,0 +1,137 @@
+<?php
+/**
+ * TJuiProgressbar class file.
+ *
+ * @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2013-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.JuiControls
+ */
+
+Prado::using('System.Web.UI.JuiControls.TJuiControlAdapter');
+Prado::using('System.Web.UI.ActiveControls.TActivePanel');
+
+/**
+ * TJuiProgressbar class.
+ *
+ * TJuiProgressbar is an extension to {@link TActivePanel} based on jQuery-UI's
+ * {@link http://jqueryui.com/progressbar/ Progressbar} widget.
+ *
+ * <code>
+ * <com:TJuiProgressbar
+ * ID="pbar1"
+ * Options.Max="100"
+ * Options.Value="75"
+ * OnChange="pbar1_changed"
+ * />
+ * </code>
+ *
+ * @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
+ * @package System.Web.UI.JuiControls
+ * @since 3.3
+ */
+class TJuiProgressbar extends TActivePanel implements IJuiOptions, ICallbackEventHandler
+{
+ protected $_options;
+
+ /**
+ * Creates a new callback control, sets the adapter to
+ * TActiveControlAdapter. If you override this class, be sure to set the
+ * adapter appropriately by, for example, by calling this constructor.
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->setAdapter(new TJuiControlAdapter($this));
+ }
+
+ /**
+ * Object containing defined javascript options
+ * @return TJuiControlOptions
+ */
+ public function getOptions()
+ {
+ if($this->_options===null)
+ $this->_options=new TJuiControlOptions($this);
+ return $this->_options;
+ }
+
+ /**
+ * Array containing valid javascript options
+ * @return array()
+ */
+ public function getValidOptions()
+ {
+ return array('disabled', 'max', 'value');
+ }
+
+ /**
+ * Array containing valid javascript events
+ * @return array()
+ */
+ public function getValidEvents()
+ {
+ return array('change', 'complete', 'create');
+ }
+
+ /**
+ * @return array list of callback options.
+ */
+ protected function getPostBackOptions()
+ {
+ return $this->getOptions()->toArray();
+ }
+
+ /**
+ * Ensure that the ID attribute is rendered and registers the javascript code
+ * for initializing the active control.
+ */
+ protected function addAttributesToRender($writer)
+ {
+ parent::addAttributesToRender($writer);
+
+ $writer->addAttribute('id',$this->getClientID());
+ $options=TJavascript::encode($this->getPostBackOptions());
+ $cs=$this->getPage()->getClientScript();
+ $code="jQuery('#".$this->getClientId()."').progressbar(".$options.");";
+ $cs->registerEndScript(sprintf('%08X', crc32($code)), $code);
+ }
+
+ /**
+ * Raises callback event. This method is required by the {@link ICallbackEventHandler}
+ * interface.
+ * @param TCallbackEventParameter the parameter associated with the callback event
+ */
+ public function raiseCallbackEvent($param)
+ {
+ $this->getOptions()->raiseCallbackEvent($param);
+ }
+
+ /**
+ * Raises the OnChange event
+ * @param object $params event parameters
+ */
+ public function onChange($params)
+ {
+ $this->raiseEvent('OnChange', $this, $params);
+ }
+
+ /**
+ * Raises the OnComplete event
+ * @param object $params event parameters
+ */
+ public function onComplete($params)
+ {
+ $this->raiseEvent('OnComplete', $this, $params);
+ }
+
+ /**
+ * Raises the OnCreate event
+ * @param object $params event parameters
+ */
+ public function onCreate($params)
+ {
+ $this->raiseEvent('OnCreate', $this, $params);
+ }
+}
diff --git a/framework/Web/UI/JuiControls/TJuiResizable.php b/framework/Web/UI/JuiControls/TJuiResizable.php
new file mode 100644
index 00000000..5e1f8d31
--- /dev/null
+++ b/framework/Web/UI/JuiControls/TJuiResizable.php
@@ -0,0 +1,153 @@
+<?php
+/**
+ * TJuiResizable class file.
+ *
+ * @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2013-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.JuiControls
+ */
+
+Prado::using('System.Web.UI.JuiControls.TJuiControlAdapter');
+Prado::using('System.Web.UI.ActiveControls.TActivePanel');
+
+/**
+ * TJuiResizable class.
+ *
+ * TJuiResizable is an extension to {@link TActivePanel} based on jQuery-UI's
+ * {@link http://jqueryui.com/resizable/ Resizable} interaction.
+ * A small handle is shown on the bottom right corner of the panel, that permits
+ * the panel to be resized using the mouse.
+ *
+ * <code>
+ * <com:TJuiResizable
+ * ID="resize1"
+ * Style="border: 1px solid green; width:100px;height:100px;background-color: #00dd00"
+ * Options.maxHeight="250"
+ * Options.maxWidth="350"
+ * Options.minHeight="150"
+ * Options.minWidth="200"
+ * >
+ * resize me
+ * </com:TJuiResizable>
+ * </code>
+ *
+ * @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
+ * @package System.Web.UI.JuiControls
+ * @since 3.3
+ */
+class TJuiResizable extends TActivePanel implements IJuiOptions, ICallbackEventHandler
+{
+ protected $_options;
+
+ /**
+ * Creates a new callback control, sets the adapter to
+ * TActiveControlAdapter. If you override this class, be sure to set the
+ * adapter appropriately by, for example, by calling this constructor.
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->setAdapter(new TJuiControlAdapter($this));
+ }
+
+ /**
+ * Object containing defined javascript options
+ * @return TJuiControlOptions
+ */
+ public function getOptions()
+ {
+ if($this->_options===null)
+ $this->_options=new TJuiControlOptions($this);
+ return $this->_options;
+ }
+
+ /**
+ * Array containing valid javascript options
+ * @return array()
+ */
+ public function getValidOptions()
+ {
+ return array('alsoResize', 'animate', 'animateDuration', 'animateEasing', 'aspectRatio', 'autoHide', 'cancel', 'containment', 'delay', 'disabled', 'distance', 'ghost', 'grid', 'handles', 'helper', 'maxHeight', 'maxWidth', 'minHeight', 'minWidth');
+ }
+
+ /**
+ * Array containing valid javascript events
+ * @return array()
+ */
+ public function getValidEvents()
+ {
+ return array('create', 'resize', 'start', 'stop');
+ }
+
+ /**
+ * @return array list of callback options.
+ */
+ protected function getPostBackOptions()
+ {
+ $options = $this->getOptions()->toArray();
+ return $options;
+ }
+
+ /**
+ * Ensure that the ID attribute is rendered and registers the javascript code
+ * for initializing the active control.
+ */
+ protected function addAttributesToRender($writer)
+ {
+ parent::addAttributesToRender($writer);
+
+ $writer->addAttribute('id',$this->getClientID());
+ $options=TJavascript::encode($this->getPostBackOptions());
+ $cs=$this->getPage()->getClientScript();
+ $code="jQuery('#".$this->getClientId()."').resizable(".$options.");";
+ $cs->registerEndScript(sprintf('%08X', crc32($code)), $code);
+ }
+
+ /**
+ * Raises callback event. This method is required by the {@link ICallbackEventHandler}
+ * interface.
+ * @param TCallbackEventParameter the parameter associated with the callback event
+ */
+ public function raiseCallbackEvent($param)
+ {
+ $this->getOptions()->raiseCallbackEvent($param);
+ }
+
+ /**
+ * Raises the OnCreate event
+ * @param object $params event parameters
+ */
+ public function onCreate ($params)
+ {
+ $this->raiseEvent('OnCreate', $this, $params);
+ }
+
+ /**
+ * Raises the OnResize event
+ * @param object $params event parameters
+ */
+ public function onResize ($params)
+ {
+ $this->raiseEvent('OnResize', $this, $params);
+ }
+
+ /**
+ * Raises the OnStart event
+ * @param object $params event parameters
+ */
+ public function onStart ($params)
+ {
+ $this->raiseEvent('OnStart', $this, $params);
+ }
+
+ /**
+ * Raises the OnStop event
+ * @param object $params event parameters
+ */
+ public function onStop ($params)
+ {
+ $this->raiseEvent('OnStop', $this, $params);
+ }
+}
diff --git a/framework/Web/UI/JuiControls/TJuiSelectable.php b/framework/Web/UI/JuiControls/TJuiSelectable.php
new file mode 100644
index 00000000..b370d14a
--- /dev/null
+++ b/framework/Web/UI/JuiControls/TJuiSelectable.php
@@ -0,0 +1,261 @@
+<?php
+/**
+ * TJuiSelectable class file.
+ *
+ * @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2013-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.JuiControls
+ */
+
+Prado::using('System.Web.UI.JuiControls.TJuiControlAdapter');
+Prado::using('System.Web.UI.ActiveControls.TActivePanel');
+
+/**
+ * TJuiSelectable class.
+ *
+ * TJuiSelectable is an extension to {@link TActivePanel} based on jQuery-UI's
+ * {@link http://jqueryui.com/selectable/ Selectable} interaction.
+ * TJuiSelectable can be feed a {@link setDataSource DataSource} and will interally
+ * render a {@link TRepeater} that displays items in an unordered list.
+ * Items can be selected by clicking on them, individually or in a group.
+ *
+ * <code>
+ * <style>
+ * .ui-selecting { background: #FECA40; }
+ * .ui-selected { background: #F39814; color: white; }
+ * </style>
+ * <com:TJuiSelectable ID="repeater1" />
+ * </code>
+ *
+ * <code>
+ * $this->repeater1->DataSource=array('home', 'office', 'car', 'boat', 'plane');
+ * $this->repeater1->dataBind();
+ * </code>
+ * @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
+ * @package System.Web.UI.JuiControls
+ * @since 3.3
+ */
+class TJuiSelectable extends TActivePanel implements IJuiOptions, ICallbackEventHandler
+{
+ protected $_options;
+
+ /**
+ * Creates a new callback control, sets the adapter to
+ * TActiveControlAdapter. If you override this class, be sure to set the
+ * adapter appropriately by, for example, by calling this constructor.
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->setAdapter(new TJuiControlAdapter($this));
+ }
+
+ /**
+ * Object containing defined javascript options
+ * @return TJuiControlOptions
+ */
+ public function getOptions()
+ {
+ if($this->_options===null)
+ $this->_options=new TJuiControlOptions($this);
+ return $this->_options;
+ }
+
+ /**
+ * Array containing valid javascript options
+ * @return array()
+ */
+ public function getValidOptions()
+ {
+ return array('appendTo', 'autoRefresh', 'cancel', 'delay', 'disabled', 'distance', 'filter', 'tolerance');
+ }
+
+ /**
+ * Array containing valid javascript events
+ * @return array()
+ */
+ public function getValidEvents()
+ {
+ return array('create', 'selected', 'selecting', 'start', 'stop', 'unselected', 'unselecting');
+ }
+
+ /**
+ * @return array list of callback options.
+ */
+ protected function getPostBackOptions()
+ {
+ $options = $this->getOptions()->toArray();
+ // overload the "OnStop" event to add information about the current selected items
+ if(isset($options['stop']))
+ {
+ $options['stop']=new TJavaScriptLiteral('function( event, ui ) { ui.index = new Array(); jQuery(\'#'.$this->getClientID().' .ui-selected\').each(function(idx, item){ ui.index.push(item.id) }); Prado.JuiCallback('.TJavascript::encode($this->getUniqueID()).', \'stop\', event, ui, this); }');
+ }
+ return $options;
+ }
+
+ /**
+ * Ensure that the ID attribute is rendered and registers the javascript code
+ * for initializing the active control.
+ */
+ protected function addAttributesToRender($writer)
+ {
+ parent::addAttributesToRender($writer);
+ $writer->addAttribute('id',$this->getClientID());
+ $options=TJavascript::encode($this->getPostBackOptions());
+ $cs=$this->getPage()->getClientScript();
+ $code="jQuery('#".$this->getClientId()."_0').selectable(".$options.");";
+ $cs->registerEndScript(sprintf('%08X', crc32($code)), $code);
+ }
+
+ /**
+ * Raises callback event. This method is required by the {@link ICallbackEventHandler}
+ * interface.
+ * @param TCallbackEventParameter the parameter associated with the callback event
+ */
+ public function raiseCallbackEvent($param)
+ {
+ $this->getOptions()->raiseCallbackEvent($param);
+ }
+
+ /**
+ * Raises the OnCreate event
+ * @param object $params event parameters
+ */
+ public function onCreate ($params)
+ {
+ $this->raiseEvent('OnCreate', $this, $params);
+ }
+
+ /**
+ * Raises the OnSelected event
+ * @param object $params event parameters
+ */
+ public function onSelected ($params)
+ {
+ $this->raiseEvent('OnSelected', $this, $params);
+ }
+
+ /**
+ * Raises the OnSelecting event
+ * @param object $params event parameters
+ */
+ public function onSelecting ($params)
+ {
+ $this->raiseEvent('OnSelecting', $this, $params);
+ }
+
+ /**
+ * Raises the OnStart event
+ * @param object $params event parameters
+ */
+ public function onStart ($params)
+ {
+ $this->raiseEvent('OnStart', $this, $params);
+ }
+
+ /**
+ * Raises the OnStop event
+ * @param object $params event parameters
+ */
+ public function onStop ($params)
+ {
+ $this->raiseEvent('OnStop', $this, $params);
+ }
+
+ /**
+ * Raises the OnUnselected event
+ * @param object $params event parameters
+ */
+ public function onUnselected ($params)
+ {
+ $this->raiseEvent('OnUnselected', $this, $params);
+ }
+
+ /**
+ * Raises the OnUnselecting event
+ * @param object $params event parameters
+ */
+ public function onUnselecting ($params)
+ {
+ $this->raiseEvent('OnUnselecting', $this, $params);
+ }
+
+ /**
+ * @var ITemplate template for repeater items
+ */
+ private $_repeater=null;
+
+ /**
+ * @param array data source for Selectables.
+ */
+ public function setDataSource($data)
+ {
+ $this->getSelectables()->setDataSource($data);
+ }
+
+ /**
+ * Overrides parent implementation. Callback {@link renderSelectables()} when
+ * page's IsCallback property is true.
+ */
+ public function dataBind()
+ {
+ parent::dataBind();
+ if($this->getPage()->getIsCallback())
+ $this->renderSelectables($this->getResponse()->createHtmlWriter());
+ }
+
+ /**
+ * @return TRepeater suggestion list repeater
+ */
+ public function getSelectables()
+ {
+ if($this->_repeater===null)
+ $this->_repeater = $this->createRepeater();
+ return $this->_repeater;
+ }
+
+ /**
+ * @return TRepeater new instance of TRepater to render the list of Selectables.
+ */
+ protected function createRepeater()
+ {
+ $repeater = Prado::createComponent('System.Web.UI.WebControls.TRepeater');
+ $repeater->setHeaderTemplate(new TJuiSelectableTemplate('<ul id="'.$this->getClientId().'_0'.'">'));
+ $repeater->setFooterTemplate(new TJuiSelectableTemplate('</ul>'));
+ $repeater->setItemTemplate(new TTemplate('<li id="<%# $this->ItemIndex %>"><%# $this->DataItem %></li>',null));
+ $repeater->setEmptyTemplate(new TJuiSelectableTemplate('<ul></ul>'));
+ $this->getControls()->add($repeater);
+ return $repeater;
+ }
+}
+
+/**
+ * TJuiSelectableTemplate class.
+ *
+ * TJuiSelectableTemplate is the default template for TJuiSelectableTemplate
+ * item template.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @package System.Web.UI.ActiveControls
+ * @since 3.1
+ */
+class TJuiSelectableTemplate extends TComponent implements ITemplate
+{
+ private $_template;
+
+ public function __construct($template)
+ {
+ $this->_template = $template;
+ }
+ /**
+ * Instantiates the template.
+ * It creates a {@link TDataList} control.
+ * @param TControl parent to hold the content within the template
+ */
+ public function instantiateIn($parent)
+ {
+ $parent->getControls()->add($this->_template);
+ }
+}
diff --git a/framework/Web/UI/JuiControls/TJuiSortable.php b/framework/Web/UI/JuiControls/TJuiSortable.php
new file mode 100644
index 00000000..2fdf80dc
--- /dev/null
+++ b/framework/Web/UI/JuiControls/TJuiSortable.php
@@ -0,0 +1,314 @@
+<?php
+/**
+ * TJuiSortable class file.
+ *
+ * @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2013-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.JuiControls
+ */
+
+Prado::using('System.Web.UI.JuiControls.TJuiControlAdapter');
+Prado::using('System.Web.UI.ActiveControls.TActivePanel');
+
+/**
+ * TJuiSortable class.
+ *
+ * TJuiSortable is an extension to {@link TActivePanel} based on jQuery-UI's
+ * {@link http://jqueryui.com/sortable/ Sortable} interaction.
+ * The panel can be feed a {@link setDataSource DataSource} and will interally
+ * render a {@link TRepeater} that displays items in an unordered list.
+ * Items can be sortered dragging and dropping them.
+ *
+ * <code>
+ * <com:TJuiSortable ID="repeater1" />
+ * </code>
+ *
+ * <code>
+ * $this->repeater1->DataSource=array('home', 'office', 'car', 'boat', 'plane');
+ * $this->repeater1->dataBind();
+ * </code>
+ *
+ * @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
+ * @package System.Web.UI.JuiControls
+ * @since 3.3
+ */
+class TJuiSortable extends TActivePanel implements IJuiOptions, ICallbackEventHandler
+{
+ protected $_options;
+
+ /**
+ * Creates a new callback control, sets the adapter to
+ * TActiveControlAdapter. If you override this class, be sure to set the
+ * adapter appropriately by, for example, by calling this constructor.
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->setAdapter(new TJuiControlAdapter($this));
+ }
+
+ /**
+ * Object containing defined javascript options
+ * @return TJuiControlOptions
+ */
+ public function getOptions()
+ {
+ if($this->_options===null)
+ $this->_options=new TJuiControlOptions($this);
+ return $this->_options;
+ }
+
+ /**
+ * Array containing valid javascript options
+ * @return array()
+ */
+ public function getValidOptions()
+ {
+ return array('appendTo', 'axis', 'cancel', 'connectWith', 'containment', 'cursor', 'cursorAt', 'delay', 'disabled', 'distance', 'dropOnEmpty', 'forceHelperSize', 'forcePlaceholderSize', 'grid', 'handle', 'helper', 'items', 'opacity', 'placeholder', 'revert', 'scroll', 'scrollSensitivity', 'scrollSpeed', 'tolerance', 'zIndex');
+ }
+
+ /**
+ * Array containing valid javascript events
+ * @return array()
+ */
+ public function getValidEvents()
+ {
+ return array('activate', 'beforeStop', 'change', 'create', 'deactivate', 'out', 'over', 'receive', 'remove', 'sort', 'start', 'stop', 'update');
+ }
+
+ /**
+ * @return array list of callback options.
+ */
+ protected function getPostBackOptions()
+ {
+ $options = $this->getOptions()->toArray();
+ // overload some events to add information about the items order
+ foreach($options as $event => $implementation)
+ {
+ if($event=='sort' || $event=='stop')
+ $options[$event]=new TJavaScriptLiteral('function( event, ui ) { ui.index = jQuery(this).sortable(\'toArray\'); Prado.JuiCallback('.TJavascript::encode($this->getUniqueID()).', \''.$event.'\', event, ui, this); }');
+ }
+ return $options;
+ }
+
+ /**
+ * Ensure that the ID attribute is rendered and registers the javascript code
+ * for initializing the active control.
+ */
+ protected function addAttributesToRender($writer)
+ {
+ parent::addAttributesToRender($writer);
+ $writer->addAttribute('id',$this->getClientID());
+ $options=TJavascript::encode($this->getPostBackOptions());
+ $cs=$this->getPage()->getClientScript();
+ $code="jQuery('#".$this->getClientId()."_0').sortable(".$options.");";
+ $cs->registerEndScript(sprintf('%08X', crc32($code)), $code);
+ }
+
+ /**
+ * Raises callback event. This method is required by the {@link ICallbackEventHandler}
+ * interface.
+ * @param TCallbackEventParameter the parameter associated with the callback event
+ */
+ public function raiseCallbackEvent($param)
+ {
+ $this->getOptions()->raiseCallbackEvent($param);
+ }
+
+ /**
+ * Raises the OnActivate event
+ * @param object $params event parameters
+ */
+ public function onActivate ($params)
+ {
+ $this->raiseEvent('OnActivate', $this, $params);
+ }
+
+ /**
+ * Raises the OnBeforeStop event
+ * @param object $params event parameters
+ */
+ public function onBeforeStop ($params)
+ {
+ $this->raiseEvent('OnBeforeStop', $this, $params);
+ }
+
+ /**
+ * Raises the OnChange event
+ * @param object $params event parameters
+ */
+ public function onChange ($params)
+ {
+ $this->raiseEvent('OnChange', $this, $params);
+ }
+
+ /**
+ * Raises the OnCreate event
+ * @param object $params event parameters
+ */
+ public function onCreate ($params)
+ {
+ $this->raiseEvent('OnCreate', $this, $params);
+ }
+
+ /**
+ * Raises the OnDeactivate event
+ * @param object $params event parameters
+ */
+ public function onDeactivate ($params)
+ {
+ $this->raiseEvent('OnDeactivate', $this, $params);
+ }
+
+ /**
+ * Raises the OnOut event
+ * @param object $params event parameters
+ */
+ public function onOut ($params)
+ {
+ $this->raiseEvent('OnOut', $this, $params);
+ }
+
+ /**
+ * Raises the OnOver event
+ * @param object $params event parameters
+ */
+ public function onOver ($params)
+ {
+ $this->raiseEvent('OnOver', $this, $params);
+ }
+
+ /**
+ * Raises the OnReceive event
+ * @param object $params event parameters
+ */
+ public function onReceive ($params)
+ {
+ $this->raiseEvent('OnReceive', $this, $params);
+ }
+
+ /**
+ * Raises the OnRemove event
+ * @param object $params event parameters
+ */
+ public function onRemove ($params)
+ {
+ $this->raiseEvent('OnRemove', $this, $params);
+ }
+
+ /**
+ * Raises the OnSort event
+ * @param object $params event parameters
+ */
+ public function onSort ($params)
+ {
+ $this->raiseEvent('OnSort', $this, $params);
+ }
+
+ /**
+ * Raises the OnStart event
+ * @param object $params event parameters
+ */
+ public function onStart ($params)
+ {
+ $this->raiseEvent('OnStart', $this, $params);
+ }
+
+ /**
+ * Raises the OnStop event
+ * @param object $params event parameters
+ */
+ public function OnStop ($params)
+ {
+ $this->raiseEvent('OnStop', $this, $params);
+ }
+
+ /**
+ * Raises the OnUpdate event
+ * @param object $params event parameters
+ */
+ public function onUpdate ($params)
+ {
+ $this->raiseEvent('OnUpdate', $this, $params);
+ }
+
+ /**
+ * @var ITemplate template for repeater items
+ */
+ private $_repeater=null;
+
+ /**
+ * @param array data source for Sortables.
+ */
+ public function setDataSource($data)
+ {
+ $this->getSortables()->setDataSource($data);
+ }
+
+ /**
+ * Overrides parent implementation. Callback {@link renderSortables()} when
+ * page's IsCallback property is true.
+ */
+ public function dataBind()
+ {
+ parent::dataBind();
+ if($this->getPage()->getIsCallback())
+ $this->renderSortables($this->getResponse()->createHtmlWriter());
+ }
+
+ /**
+ * @return TRepeater suggestion list repeater
+ */
+ public function getSortables()
+ {
+ if($this->_repeater===null)
+ $this->_repeater = $this->createRepeater();
+ return $this->_repeater;
+ }
+
+ /**
+ * @return TRepeater new instance of TRepater to render the list of Sortables.
+ */
+ protected function createRepeater()
+ {
+ $repeater = Prado::createComponent('System.Web.UI.WebControls.TRepeater');
+ $repeater->setHeaderTemplate(new TJuiSortableTemplate('<ul id="'.$this->getClientId().'_0'.'">'));
+ $repeater->setFooterTemplate(new TJuiSortableTemplate('</ul>'));
+ $repeater->setItemTemplate(new TTemplate('<li id="<%# $this->ItemIndex %>"><%# $this->Data %></li>',null));
+ $repeater->setEmptyTemplate(new TJuiSortableTemplate('<ul></ul>'));
+ $this->getControls()->add($repeater);
+ return $repeater;
+ }
+}
+
+
+/**
+ * TJuiSortableTemplate class.
+ *
+ * TJuiSortableTemplate is the default template for TJuiSortableTemplate
+ * item template.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @package System.Web.UI.ActiveControls
+ * @since 3.1
+ */
+class TJuiSortableTemplate extends TComponent implements ITemplate
+{
+ private $_template;
+
+ public function __construct($template)
+ {
+ $this->_template = $template;
+ }
+ /**
+ * Instantiates the template.
+ * It creates a {@link TDataList} control.
+ * @param TControl parent to hold the content within the template
+ */
+ public function instantiateIn($parent)
+ {
+ $parent->getControls()->add($this->_template);
+ }
+}
diff --git a/framework/Web/UI/TCachePageStatePersister.php b/framework/Web/UI/TCachePageStatePersister.php
index 4f3d60cc..0914c650 100644
--- a/framework/Web/UI/TCachePageStatePersister.php
+++ b/framework/Web/UI/TCachePageStatePersister.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCachePageStatePersister.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
@@ -54,7 +53,6 @@
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCachePageStatePersister.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.1.1
*/
diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php
index ea828187..937bd84e 100644
--- a/framework/Web/UI/TClientScriptManager.php
+++ b/framework/Web/UI/TClientScriptManager.php
@@ -5,9 +5,8 @@
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Gabor Berczi <gabor.berczi@devworx.hu> (lazyload additions & progressive rendering)
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TClientScriptManager.php 3280 2013-03-13 20:19:30Z ctrlaltca $
* @package System.Web.UI
*/
@@ -18,7 +17,6 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Gabor Berczi <gabor.berczi@devworx.hu> (lazyload additions & progressive rendering)
- * @version $Id: TClientScriptManager.php 3280 2013-03-13 20:19:30Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -150,7 +148,7 @@ class TClientScriptManager extends TApplicationComponent
$this->_registeredPradoScripts[$name]=true;
else
throw new TInvalidOperationException('csmanager_pradoscript_invalid',$name);
-
+
if(($packages=array_keys($this->_registeredPradoScripts))!==array())
{
$base = Prado::getFrameworkPath().DIRECTORY_SEPARATOR.self::SCRIPT_PATH;
@@ -286,8 +284,6 @@ class TClientScriptManager extends TApplicationComponent
$code="new {$class}({$optionString});";
$this->_endScripts[sprintf('%08X', crc32($code))]=$code;
- $this->_hiddenFields[TPage::FIELD_POSTBACK_TARGET]='';
- $this->_hiddenFields[TPage::FIELD_POSTBACK_PARAMETER]='';
$this->registerPradoScriptInternal('prado');
$params=func_get_args();
@@ -315,7 +311,6 @@ class TClientScriptManager extends TApplicationComponent
$code = "new Prado.WebUI.DefaultButton($options);";
$this->_endScripts['prado:'.$panelID]=$code;
- $this->_hiddenFields[TPage::FIELD_POSTBACK_TARGET]='';
$this->registerPradoScriptInternal('prado');
$params=array($panelID,$buttonID);
@@ -343,11 +338,10 @@ class TClientScriptManager extends TApplicationComponent
*/
public function registerFocusControl($target)
{
- $this->registerPradoScriptInternal('effects');
+ $this->registerPradoScriptInternal('jquery');
if($target instanceof TControl)
$target=$target->getClientID();
- $id = TJavaScript::quoteString($target);
- $this->_endScripts['prado:focus'] = 'new Effect.ScrollTo('.$id.'); Prado.Element.focus('.$id.');';
+ $this->_endScripts['prado:focus'] = 'jQuery(\'#'.$target.'\').focus();';
$params=func_get_args();
$this->_page->registerCachingAction('Page.ClientScript','registerFocusControl',$params);
@@ -369,7 +363,6 @@ class TClientScriptManager extends TApplicationComponent
* $this->Page->ClientScript->registerStyleSheetFile($url, $url);
* }
* }
- * ?>
* </code>
*
* @param string a unique key identifying the file
@@ -466,7 +459,7 @@ class TClientScriptManager extends TApplicationComponent
public function registerScriptFile($key, $url)
{
$this->_scriptFiles[$key]=$url;
-
+
$params=func_get_args();
$this->_page->registerCachingAction('Page.ClientScript','registerScriptFile',$params);
}
@@ -700,6 +693,22 @@ class TClientScriptManager extends TApplicationComponent
$writer->write(TJavaScript::renderScriptBlocks($this->_endScripts));
}
+ /**
+ * @param THtmlWriter writer for the rendering purpose
+ */
+ public function renderBeginScriptsCallback($writer)
+ {
+ $writer->write(TJavaScript::renderScriptBlocksCallback($this->_beginScripts));
+ }
+
+ /**
+ * @param THtmlWriter writer for the rendering purpose
+ */
+ public function renderEndScriptsCallback($writer)
+ {
+ $writer->write(TJavaScript::renderScriptBlocksCallback($this->_endScripts));
+ }
+
public function renderHiddenFieldsBegin($writer)
{
$this->renderHiddenFieldsInt($writer,true);
@@ -717,8 +726,11 @@ class TClientScriptManager extends TApplicationComponent
*/
public function flushScriptFiles($writer, $control=null)
{
- $this->_page->ensureRenderInForm($control);
- $this->renderAllPendingScriptFiles($writer);
+ if(!$this->_page->getIsCallback())
+ {
+ $this->_page->ensureRenderInForm($control);
+ $this->renderAllPendingScriptFiles($writer);
+ }
}
/**
@@ -747,7 +759,7 @@ class TClientScriptManager extends TApplicationComponent
$writer->write("<div style=\"visibility:hidden;\">\n".$str."</div>\n");
}
- public function getHiddenFields()
+ public function getHiddenFields()
{
return $this->_hiddenFields;
}
@@ -770,7 +782,6 @@ class TClientScriptManager extends TApplicationComponent
* between ActiveControls and validators.
*
* @author <weizhuo[at]gmail[dot]com>
- * @version $Id: TClientScriptManager.php 3280 2013-03-13 20:19:30Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
diff --git a/framework/Web/UI/TCompositeControl.php b/framework/Web/UI/TCompositeControl.php
index 21e4c46f..5a54271d 100644
--- a/framework/Web/UI/TCompositeControl.php
+++ b/framework/Web/UI/TCompositeControl.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCompositeControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
@@ -16,7 +15,6 @@
* by other controls.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCompositeControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php
index 5ee20d61..e5e6fa18 100644
--- a/framework/Web/UI/TControl.php
+++ b/framework/Web/UI/TControl.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
@@ -64,7 +63,6 @@ Prado::using('System.Web.UI.TControlAdapter');
* They work together with page lifecycles to process a page request.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -1330,21 +1328,11 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable
$control->evaluateDynamicContent();
}
}
- $this->addToPostDataLoader();
}
$this->_stage=self::CS_PRERENDERED;
}
/**
- * Add controls implementing IPostBackDataHandler to post data loaders.
- */
- protected function addToPostDataLoader()
- {
- if($this instanceof IPostBackDataHandler)
- $this->getPage()->registerPostDataLoader($this);
- }
-
- /**
* Performs the Unload step for the control and all its child controls.
* Only framework developers should use this method.
*/
@@ -1771,7 +1759,6 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable
* controls to maintain a list of their child controls.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -1856,7 +1843,6 @@ class TControlCollection extends TList
* controls to it. This is useful for controls that do not allow child controls.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -1889,7 +1875,6 @@ class TEmptyControlCollection extends TControlCollection
* INamingContainer marks a control as a naming container.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -1903,7 +1888,6 @@ interface INamingContainer
* If a control wants to respond to postback event, it must implement this interface.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -1924,7 +1908,6 @@ interface IPostBackEventHandler
* If a control wants to load post data, it must implement this interface.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -1958,7 +1941,6 @@ interface IPostBackDataHandler
* If a control wants to validate user input, it must implement this interface.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -1996,7 +1978,6 @@ interface IValidator
* If a control wants to be validated by a validator, it must implement this interface.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -2022,7 +2003,6 @@ interface IValidatable
* If a control wants to check broadcast event, it must implement this interface.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -2046,7 +2026,6 @@ interface IBroadcastEventReceiver
* This interface must be implemented by theme.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -2066,7 +2045,6 @@ interface ITheme
* parsed template structures.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -2089,7 +2067,6 @@ interface ITemplate
* {@link TImageButton}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -2194,7 +2171,6 @@ interface ISurroundable
* {@link setParameter Parameter} property.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -2256,7 +2232,6 @@ class TBroadcastEventParameter extends TEventParameter
* with the command via {@link getCommandParameter CommandParameter} property.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -2301,7 +2276,6 @@ class TCommandEventParameter extends TEventParameter
* consecutive static strings, expressions and statements.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
diff --git a/framework/Web/UI/TControlAdapter.php b/framework/Web/UI/TControlAdapter.php
index 1ef2d1fb..2e89e5e7 100644
--- a/framework/Web/UI/TControlAdapter.php
+++ b/framework/Web/UI/TControlAdapter.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
@@ -17,7 +16,6 @@
* various behaviors for the control to which the adapter is attached.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
diff --git a/framework/Web/UI/TForm.php b/framework/Web/UI/TForm.php
index 9db8682c..c9280e9a 100644
--- a/framework/Web/UI/TForm.php
+++ b/framework/Web/UI/TForm.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TForm.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
@@ -23,7 +22,6 @@
* URLs.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TForm.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -87,7 +85,7 @@ class TForm extends TControl
$this->renderChildren($writer);
$cs->renderHiddenFieldsEnd($writer);
$page->endFormRender($writer);
-
+
$cs->renderScriptFilesEnd($writer);
$cs->renderEndScripts($writer);
}
diff --git a/framework/Web/UI/THtmlWriter.php b/framework/Web/UI/THtmlWriter.php
index 9f070d5f..0339ac83 100644
--- a/framework/Web/UI/THtmlWriter.php
+++ b/framework/Web/UI/THtmlWriter.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THtmlWriter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
@@ -32,7 +31,6 @@
* tags in HTML and XHTML.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THtmlWriter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -87,7 +85,7 @@ class THtmlWriter extends TApplicationComponent implements ITextWriter
{
return $this->_writer;
}
-
+
public function setWriter($writer)
{
$this->_writer = $writer;
diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php
index 39656e13..2dc1cac3 100644
--- a/framework/Web/UI/TPage.php
+++ b/framework/Web/UI/TPage.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPage.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
@@ -22,7 +21,6 @@ Prado::using('System.Web.UI.TClientScriptManager');
* TPage class
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPage.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -155,10 +153,6 @@ class TPage extends TTemplateControl
*/
private $_clientState='';
/**
- * @var array post data loader IDs.
- */
- protected $_postDataLoaders=array();
- /**
* @var boolean true if loading post data.
*/
protected $_isLoadingPostData=false;
@@ -297,7 +291,7 @@ class TPage extends TTemplateControl
return $data;
}
}
-
+
/**
* Sets Adapter to TActivePageAdapter and calls apter to process the
* callback request.
@@ -308,6 +302,10 @@ class TPage extends TTemplateControl
$this->setAdapter(new TActivePageAdapter($this));
+ $callbackEventParameter = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER);
+ if(strlen($callbackEventParameter) > 0)
+ $this->_postData[TPage::FIELD_CALLBACK_PARAMETER]=TJavaScript::jsonDecode((string)$callbackEventParameter);
+
// Decode Callback postData from UTF-8 to current Charset
if (($g=$this->getApplication()->getGlobalization(false))!==null &&
strtoupper($enc=$g->getCharset())!='UTF-8')
@@ -427,27 +425,6 @@ class TPage extends TTemplateControl
}
/**
- * Register post data loaders for Callback to collect post data.
- * This method should only be called by framework developers.
- * @param TControl control that requires post data.
- * @see TControl::preRenderRecursive();
- */
- public function registerPostDataLoader($control)
- {
- $id=is_string($control)?$control:$control->getUniqueID();
- $this->_postDataLoaders[$id] = true;
- }
-
- /**
- * Get a list of IDs of controls that are enabled and require post data.
- * @return array list of IDs implementing IPostBackDataHandler
- */
- public function getPostDataLoaders()
- {
- return array_keys($this->_postDataLoaders);
- }
-
- /**
* @return TForm the form on the page
*/
public function getForm()
@@ -825,7 +802,6 @@ class TPage extends TTemplateControl
{
$id=is_string($control)?$control:$control->getUniqueID();
$this->_controlsRegisteredForPostData[$id]=true;
- $this->registerPostDataLoader($id);
$params=func_get_args();
foreach($this->getCachingStack() as $item)
$item->registerAction('Page','registerRequiresPostData',array($id));
@@ -1245,7 +1221,6 @@ class TPage extends TTemplateControl
* classes.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPage.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.1
*/
@@ -1301,9 +1276,9 @@ class TPageStateFormatter
{
$sm=$page->getApplication()->getSecurityManager();
if($page->getEnableStateValidation())
- $str=$sm->hashData(Prado::serialize($data));
+ $str=$sm->hashData(serialize($data));
else
- $str=Prado::serialize($data);
+ $str=serialize($data);
if($page->getEnableStateCompression() && extension_loaded('zlib'))
$str=gzcompress($str);
if($page->getEnableStateEncryption())
@@ -1331,10 +1306,10 @@ class TPageStateFormatter
if($page->getEnableStateValidation())
{
if(($str=$sm->validateData($str))!==false)
- return Prado::unserialize($str);
+ return unserialize($str);
}
else
- return Prado::unserialize($str);
+ return unserialize($str);
}
return null;
}
diff --git a/framework/Web/UI/TPageStatePersister.php b/framework/Web/UI/TPageStatePersister.php
index 7d2330b7..bbb20098 100644
--- a/framework/Web/UI/TPageStatePersister.php
+++ b/framework/Web/UI/TPageStatePersister.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPageStatePersister.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
@@ -22,7 +21,6 @@
* traffic for transmitting bulky page state.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPageStatePersister.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
diff --git a/framework/Web/UI/TSessionPageStatePersister.php b/framework/Web/UI/TSessionPageStatePersister.php
index 5448fd22..a1a1f601 100644
--- a/framework/Web/UI/TSessionPageStatePersister.php
+++ b/framework/Web/UI/TSessionPageStatePersister.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSessionPageStatePersister.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
@@ -39,7 +38,6 @@
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TSessionPageStatePersister.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.1
*/
diff --git a/framework/Web/UI/TTemplateControl.php b/framework/Web/UI/TTemplateControl.php
index f5780928..df6482c6 100644
--- a/framework/Web/UI/TTemplateControl.php
+++ b/framework/Web/UI/TTemplateControl.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTemplateControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
@@ -23,7 +22,6 @@ Prado::using('System.Web.UI.TCompositeControl');
* different extension name. For template file, the extension name is ".tpl".
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTemplateControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php
index 91630241..0ffb6bec 100644
--- a/framework/Web/UI/TTemplateManager.php
+++ b/framework/Web/UI/TTemplateManager.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTemplateManager.php 3251 2013-01-15 18:37:04Z ctrlaltca $
* @package System.Web.UI
*/
@@ -32,7 +31,6 @@ Prado::using('System.Web.UI.WebControls.TOutputCache');
* template manager module that can be accessed via {@link TPageService::getTemplateManager()}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTemplateManager.php 3251 2013-01-15 18:37:04Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -162,7 +160,6 @@ class TTemplateManager extends TModule
* set their parent as $control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTemplateManager.php 3251 2013-01-15 18:37:04Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
diff --git a/framework/Web/UI/TThemeManager.php b/framework/Web/UI/TThemeManager.php
index ba007dc0..f8c86bb7 100644
--- a/framework/Web/UI/TThemeManager.php
+++ b/framework/Web/UI/TThemeManager.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TThemeManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
@@ -34,7 +33,6 @@ Prado::using('System.Web.Services.TPageService');
* and {@link getBufferOutput BufferOutput} are configurable properties of THttpResponse.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TThemeManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -206,7 +204,6 @@ class TThemeManager extends TModule
* To apply a theme to a particular control, call {@link applySkin}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TThemeManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TAccordion.php b/framework/Web/UI/WebControls/TAccordion.php
index dbf761a2..fc794cd4 100644
--- a/framework/Web/UI/WebControls/TAccordion.php
+++ b/framework/Web/UI/WebControls/TAccordion.php
@@ -4,9 +4,8 @@
*
* @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TAccordion.php 2915 2011-05-15 16:26:11Z ctrlaltca@gmail.com $
* @package System.Web.UI.WebControls
* @since 3.2
*/
@@ -59,7 +58,6 @@
* </code>
*
* @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu>
- * @version $Id: TAccordion.php 2915 2011-05-15 16:26:11Z ctrlaltca@gmail.com $
* @package System.Web.UI.WebControls
* @since 3.2
*/
@@ -198,7 +196,7 @@ class TAccordion extends TWebControl implements IPostBackDataHandler
}
/**
- * @return string CSS class for the whole accordion control div.
+ * @return string CSS class for the whole accordion control div.
*/
public function getCssClass()
{
@@ -426,15 +424,15 @@ class TAccordion extends TWebControl implements IPostBackDataHandler
protected function registerStyleSheet()
{
$url = $this->getCssUrl();
-
+
if($url === '') {
return;
}
-
+
if($url === 'default') {
$url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'accordion.css');
}
-
+
if($url !== '') {
$this->getPage()->getClientScript()->registerStyleSheetFile($url, $url);
}
@@ -540,13 +538,12 @@ class TAccordion extends TWebControl implements IPostBackDataHandler
* Class TAccordionView.
*
* TAccordionView represents a single view in a {@link TAccordion}.
- *
+ *
* TAccordionView is represented inside the {@link TAccordion} with an header label whose text is defined by
* the {@link setCaption Caption} property; optionally the label can be an hyperlink: use the
* {@link setNavigateUrl NavigateUrl} property to define the destination url.
*
* @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu>
- * @version $Id: TAccordion.php 2915 2011-05-15 16:26:11Z ctrlaltca@gmail.com $
* @package System.Web.UI.WebControls
* @since 3.2
*/
@@ -669,7 +666,7 @@ class TAccordionView extends TWebControl
$writer->addAttribute('id',$this->getClientID().'_0');
$style=$this->getActive()?$this->getParent()->getActiveHeaderStyle():$this->getParent()->getHeaderStyle();
-
+
$style->addAttributesToRender($writer);
$writer->renderBeginTag($this->getTagName());
@@ -690,7 +687,7 @@ class TAccordionView extends TWebControl
$url = $this->getNavigateUrl();
if(($caption=$this->getCaption())==='')
$caption='&nbsp;';
-
+
if ($url!='')
$writer->write("<a href=\"{$url}\">");
$writer->write("{$caption}");
@@ -703,9 +700,8 @@ class TAccordionView extends TWebControl
* Class TAccordionViewCollection.
*
* TAccordionViewCollection is a collection of {@link TAccordionView} to be used inside a {@link TAccordion}.
- *
+ *
* @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu>
- * @version $Id: TAccordion.php 2915 2011-05-15 16:26:11Z ctrlaltca@gmail.com $
* @package System.Web.UI.WebControls
* @since 3.2
*/
diff --git a/framework/Web/UI/WebControls/TBaseDataList.php b/framework/Web/UI/WebControls/TBaseDataList.php
index 0ef22752..9ebe551e 100644
--- a/framework/Web/UI/WebControls/TBaseDataList.php
+++ b/framework/Web/UI/WebControls/TBaseDataList.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TBaseDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -37,7 +36,6 @@ Prado::using('System.Util.TDataFieldAccessor');
* content can be specified via {@link setHorizontalAlign HorizontalAlign}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBaseDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php
index 074939c1..a23e2104 100644
--- a/framework/Web/UI/WebControls/TBaseValidator.php
+++ b/framework/Web/UI/WebControls/TBaseValidator.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TBaseValidator.php 3319 2013-09-08 20:59:44Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -70,7 +69,6 @@ Prado::using('System.Web.UI.WebControls.TLabel');
* override the method {@link evaluateIsValid}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBaseValidator.php 3319 2013-09-08 20:59:44Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -513,7 +511,7 @@ abstract class TBaseValidator extends TLabel implements IValidator
$target=$this->getValidationTarget();
// if the target is not a disabled web control
if($target===null ||
- ($target!==null &&
+ ($target!==null &&
!($target instanceof TWebControl && !$target->getEnabled(true))))
{
if($this->evaluateIsValid())
@@ -625,7 +623,6 @@ abstract class TBaseValidator extends TLabel implements IValidator
* See the quickstart documentation for further details.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TBaseValidator.php 3319 2013-09-08 20:59:44Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -715,7 +712,6 @@ class TValidatorClientSide extends TClientSideOptions
* - Fixed: Similar to Dynamic except that the error message physically occupies the page layout (even though it may not be visible)
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBaseValidator.php 3319 2013-09-08 20:59:44Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
@@ -738,7 +734,6 @@ class TValidatorDisplayStyle extends TEnumerable
* - String
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBaseValidator.php 3319 2013-09-08 20:59:44Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TBoundColumn.php b/framework/Web/UI/WebControls/TBoundColumn.php
index 7534fcbc..d7ac7750 100644
--- a/framework/Web/UI/WebControls/TBoundColumn.php
+++ b/framework/Web/UI/WebControls/TBoundColumn.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TBoundColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -42,7 +41,6 @@ Prado::using('System.Web.UI.WebControls.TDataGridColumn');
* For more details, see {@link TRepeater} and {@link TDataList}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBoundColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TBulletedList.php b/framework/Web/UI/WebControls/TBulletedList.php
index e5c17b38..9cd3654e 100644
--- a/framework/Web/UI/WebControls/TBulletedList.php
+++ b/framework/Web/UI/WebControls/TBulletedList.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TBulletedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -33,7 +32,6 @@ Prado::using('System.Web.UI.WebControls.TListControl');
* will be raised under such a circumstance.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBulletedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -414,7 +412,6 @@ class TBulletedList extends TListControl implements IPostBackEventHandler
* of the item that is currently being clicked.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBulletedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -449,7 +446,6 @@ class TBulletedListEventParameter extends TEventParameter
* for a {@link TBulletedList} control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBulletedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
@@ -479,7 +475,6 @@ class TBulletStyle extends TEnumerable
* - LinkButton: the bulleted list items are displayed as link buttons that can cause postbacks
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBulletedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TButton.php b/framework/Web/UI/WebControls/TButton.php
index e7d0f5bf..f24985e6 100644
--- a/framework/Web/UI/WebControls/TButton.php
+++ b/framework/Web/UI/WebControls/TButton.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -43,7 +42,6 @@
* if the button does not cause a postback.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -355,7 +353,6 @@ class TButton extends TWebControl implements IPostBackEventHandler, IButtonContr
* - Button: a client button (normally does not perform form submission)
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TButtonColumn.php b/framework/Web/UI/WebControls/TButtonColumn.php
index 258fecf2..939fc721 100644
--- a/framework/Web/UI/WebControls/TButtonColumn.php
+++ b/framework/Web/UI/WebControls/TButtonColumn.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TButtonColumn.php 3287 2013-04-30 10:10:16Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -48,7 +47,6 @@ Prado::using('System.Web.UI.WebControls.TImageButton');
* datagrid cell is the first child.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TButtonColumn.php 3287 2013-04-30 10:10:16Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TCaptcha.php b/framework/Web/UI/WebControls/TCaptcha.php
index 79f402a5..4523ea40 100644
--- a/framework/Web/UI/WebControls/TCaptcha.php
+++ b/framework/Web/UI/WebControls/TCaptcha.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCaptcha.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -57,7 +56,6 @@ Prado::using('System.Web.UI.WebControls.TImage');
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCaptcha.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
diff --git a/framework/Web/UI/WebControls/TCaptchaValidator.php b/framework/Web/UI/WebControls/TCaptchaValidator.php
index c8cc7aea..2758cac7 100644
--- a/framework/Web/UI/WebControls/TCaptchaValidator.php
+++ b/framework/Web/UI/WebControls/TCaptchaValidator.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCaptchaValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -31,7 +30,6 @@ Prado::using('System.Web.UI.WebControls.TCaptcha');
* the CAPTCHA control that the user input should be compared with.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCaptchaValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
diff --git a/framework/Web/UI/WebControls/TCheckBox.php b/framework/Web/UI/WebControls/TCheckBox.php
index e12946be..a28beac7 100644
--- a/framework/Web/UI/WebControls/TCheckBox.php
+++ b/framework/Web/UI/WebControls/TCheckBox.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCheckBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -36,7 +35,6 @@
* that may bring security vulnerabilities.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCheckBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -127,7 +125,7 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl
}
/**
- * Returns true if this control validated successfully.
+ * Returns true if this control validated successfully.
* Defaults to true.
* @return bool wether this control validated successfully.
*/
@@ -412,7 +410,7 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl
/**
* Check if we need a span tag to surround this control. The span tag will be created if
- * the Text property is set for this control.
+ * the Text property is set for this control.
*
* @return bool wether this control needs a surrounding span tag
*/
@@ -519,7 +517,6 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl
* - Right: right aligned
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCheckBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TCheckBoxColumn.php b/framework/Web/UI/WebControls/TCheckBoxColumn.php
index c0206676..8f67df55 100644
--- a/framework/Web/UI/WebControls/TCheckBoxColumn.php
+++ b/framework/Web/UI/WebControls/TCheckBoxColumn.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCheckBoxColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -38,7 +37,6 @@ Prado::using('System.Web.UI.WebControls.TCheckBox');
* datagrid cell is the first child.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCheckBoxColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TCheckBoxList.php b/framework/Web/UI/WebControls/TCheckBoxList.php
index 5122432c..029b6c89 100644
--- a/framework/Web/UI/WebControls/TCheckBoxList.php
+++ b/framework/Web/UI/WebControls/TCheckBoxList.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCheckBoxList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -43,7 +42,6 @@ Prado::using('System.Web.UI.WebControls.TCheckBox');
* The alignment of the text besides each checkbox can be specified via {@link setTextAlign TextAlign}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCheckBoxList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -74,7 +72,7 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont
*/
protected function createRepeatedControl()
{
- return new TCheckBox;
+ return new TCheckBoxItem;
}
/**
@@ -256,7 +254,7 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont
{
return false;
}
-
+
/**
* @param boolean whether the control is to be enabled.
*/
@@ -264,8 +262,8 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont
{
parent::setEnabled($value);
$value = !TPropertyValue::ensureBoolean($value);
- // if this is an active control,
- // and it's a callback,
+ // if this is an active control,
+ // and it's a callback,
// and we can update clientside,
// then update the 'disabled' attribute of the items.
if(($this instanceof IActiveControl) &&
@@ -389,14 +387,14 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont
/**
* Wether the list should be rendered inside a span or not
- *
+ *
*@return boolean true if we need a span
*/
protected function getSpanNeeded ()
{
return $this->getRepeatLayout()===TRepeatLayout::Raw;
}
-
+
/**
* Renders the checkbox list control.
* This method overrides the parent implementation.
@@ -459,7 +457,7 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont
}
/**
- * Returns true if this control validated successfully.
+ * Returns true if this control validated successfully.
* Defaults to true.
* @return bool wether this control validated successfully.
*/
@@ -491,13 +489,21 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont
*/
protected function getPostBackOptions()
{
- $options['ListID'] = $this->getClientID();
+ $options['ID'] = $this->getClientID();
$options['ValidationGroup'] = $this->getValidationGroup();
$options['CausesValidation'] = $this->getCausesValidation();
$options['ListName'] = $this->getUniqueID();
$options['ItemCount'] = $this->getItemCount();
return $options;
}
-
+
}
+class TCheckBoxItem extends TCheckBox {
+ /**
+ * Override client implementation to avoid emitting the javascript
+ */
+ protected function renderClientControlScript($writer)
+ {
+ }
+}
diff --git a/framework/Web/UI/WebControls/TClientScript.php b/framework/Web/UI/WebControls/TClientScript.php
index f28a507a..6fca14d3 100644
--- a/framework/Web/UI/WebControls/TClientScript.php
+++ b/framework/Web/UI/WebControls/TClientScript.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TClientScript.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -38,9 +37,8 @@
* set the {@link setFlushScriptFiles FlushScriptFiles} property to false, so Prado
* can postpone the loading of all the referenced script files further down the page
* generation cycle.
- *
+ *
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TClientScript.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TColorPicker.php b/framework/Web/UI/WebControls/TColorPicker.php
index fcb129b9..7b20318c 100644
--- a/framework/Web/UI/WebControls/TColorPicker.php
+++ b/framework/Web/UI/WebControls/TColorPicker.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TColorPicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -23,17 +22,16 @@
* # <b>Simple</b> - Grid with 12 simple colors.
* # <b>Basic</b> - Grid with the most common 70 colors. This is the default mode.
* # <b>Full</b> - Full-featured color picker.
- *
+ *
* The <b>CssClass</b> property can be used to override the CSS class name
* for the color picker panel. The <b>ColorStyle</b> property sets the packages
* styles available. E.g. <b>default</b>.
- *
+ *
* If the <b>Mode</b> property is set to <b>Full</b>, the color picker panel will
* display an "Ok" and "Cancel" buttons. You can customize the button labels setting the <b>OKButtonText</b>
* and <b>CancelButtonText</b> properties.
- *
+ *
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TColorPicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -248,7 +246,6 @@ class TColorPicker extends TTextBox
* # Full - Full-featured color picker.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TColorPicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
@@ -265,7 +262,6 @@ class TColorPickerMode extends TEnumerable
* Client-side javascript code options.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TColorPicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1
*/
diff --git a/framework/Web/UI/WebControls/TCompareValidator.php b/framework/Web/UI/WebControls/TCompareValidator.php
index eaaa8f51..b902b67b 100644
--- a/framework/Web/UI/WebControls/TCompareValidator.php
+++ b/framework/Web/UI/WebControls/TCompareValidator.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCompareValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -40,7 +39,6 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator');
* LessThan and LessThanEqual.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCompareValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -249,7 +247,6 @@ class TCompareValidator extends TBaseValidator
* - LessThanEqual
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCompareValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TConditional.php b/framework/Web/UI/WebControls/TConditional.php
index 054e1a76..61cc3988 100644
--- a/framework/Web/UI/WebControls/TConditional.php
+++ b/framework/Web/UI/WebControls/TConditional.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TConditional.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -39,7 +38,6 @@
* or {@link getFalseTemplate FalseTemplate}, but never both. And the condition is evaluated only once.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TConditional.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
diff --git a/framework/Web/UI/WebControls/TContent.php b/framework/Web/UI/WebControls/TContent.php
index f0a67674..a2f15e3d 100644
--- a/framework/Web/UI/WebControls/TContent.php
+++ b/framework/Web/UI/WebControls/TContent.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TContent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -25,7 +24,6 @@
* {@link TContent} and {@link TContentPlaceHolder} controls.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TContent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TContentPlaceHolder.php b/framework/Web/UI/WebControls/TContentPlaceHolder.php
index d9464fa3..8a4d7284 100644
--- a/framework/Web/UI/WebControls/TContentPlaceHolder.php
+++ b/framework/Web/UI/WebControls/TContentPlaceHolder.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TContentPlaceHolder.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -24,7 +23,6 @@
* {@link TContent} and {@link TContentPlaceHolder} controls.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TContentPlaceHolder.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TCustomValidator.php b/framework/Web/UI/WebControls/TCustomValidator.php
index b4987f06..6966a075 100644
--- a/framework/Web/UI/WebControls/TCustomValidator.php
+++ b/framework/Web/UI/WebControls/TCustomValidator.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCustomValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -48,7 +47,6 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator');
* with the TCustomValidator.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCustomValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -153,7 +151,6 @@ class TCustomValidator extends TBaseValidator
* <b>OnServerValidate</b> event of TCustomValidator components.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCustomValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TDataBoundControl.php b/framework/Web/UI/WebControls/TDataBoundControl.php
index 08d130c1..2a287aac 100644
--- a/framework/Web/UI/WebControls/TDataBoundControl.php
+++ b/framework/Web/UI/WebControls/TDataBoundControl.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataBoundControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -39,7 +38,6 @@ Prado::using('System.Collections.TPagedDataSource');
* custom paging, set {@link setAllowCustomPaging AllowCustomPaging} to true.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataBoundControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -527,7 +525,6 @@ abstract class TDataBoundControl extends TWebControl
* - Pager: pager
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataBoundControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
@@ -553,7 +550,6 @@ class TListItemType extends TEnumerable
* {@link getItemType ItemType} property.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataBoundControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.0
*/
diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php
index 249d8108..96e799aa 100644
--- a/framework/Web/UI/WebControls/TDataGrid.php
+++ b/framework/Web/UI/WebControls/TDataGrid.php
@@ -9,9 +9,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -145,7 +144,6 @@ Prado::using('System.Web.UI.WebControls.TDataGridPagerStyle');
* - Save the data in viewstate and get it back during postbacks.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1233,7 +1231,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer
* Depending on the button type, a TLinkButton or a TButton may be created.
* If it is enabled (clickable), its command name and parameter will also be set.
* Derived classes may override this method to create additional types of buttons, such as TImageButton.
- * @param mixed the container pager instance of TActiveDatagridPager
+ * @param mixed the container pager instance of TActiveDatagridPager
* @param string button type, either LinkButton or PushButton
* @param boolean whether the button should be enabled
* @param string caption of the button
@@ -1680,7 +1678,6 @@ class TDataGrid extends TBaseDataList implements INamingContainer
* The {@link getItem Item} property indicates the datagrid item related with the event.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1718,7 +1715,6 @@ class TDataGridItemEventParameter extends TEventParameter
* The {@link getPager Pager} property indicates the datagrid pager related with the event.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1759,7 +1755,6 @@ class TDataGridPagerEventParameter extends TEventParameter
* raises the Command event.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1815,7 +1810,6 @@ class TDataGridCommandEventParameter extends TCommandEventParameter
* gives the sort expression carried with the sort command.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1869,7 +1863,6 @@ class TDataGridSortCommandEventParameter extends TEventParameter
* returns the new page index carried with the page command.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1923,7 +1916,6 @@ class TDataGridPageChangedEventParameter extends TEventParameter
* gives the index of the item from the bound data source.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -2060,7 +2052,6 @@ class TDataGridItem extends TTableRow implements INamingContainer
* TDataGridPager represents a datagrid pager.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -2119,7 +2110,6 @@ class TDataGridPager extends TPanel implements INamingContainer
* TDataGridItemCollection represents a collection of data grid items.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -2147,7 +2137,6 @@ class TDataGridItemCollection extends TList
* TDataGridColumnCollection represents a collection of data grid columns.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -2204,7 +2193,6 @@ class TDataGridColumnCollection extends TList
* - Numeric: pager buttons are displayed as numeric page numbers
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
@@ -2224,7 +2212,6 @@ class TDataGridPagerMode extends TEnumerable
* - PushButton: form submit buttons
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
@@ -2245,7 +2232,6 @@ class TDataGridPagerButtonType extends TEnumerable
* - TopAndBottom: pager appears on both top and bottom of the data grid.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TDataGridColumn.php b/framework/Web/UI/WebControls/TDataGridColumn.php
index ad3be81f..1c8831d2 100644
--- a/framework/Web/UI/WebControls/TDataGridColumn.php
+++ b/framework/Web/UI/WebControls/TDataGridColumn.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataGridColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -58,7 +57,6 @@ Prado::using('System.Web.UI.WebControls.TDataGrid');
* which is the major logic for managing the data and presentation of cells in the column.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGridColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -554,7 +552,6 @@ abstract class TDataGridColumn extends TApplicationComponent
* - ImageButton: image buttons
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGridColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TDataGridItemRenderer.php b/framework/Web/UI/WebControls/TDataGridItemRenderer.php
index 6e37a739..376eea17 100644
--- a/framework/Web/UI/WebControls/TDataGridItemRenderer.php
+++ b/framework/Web/UI/WebControls/TDataGridItemRenderer.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataGridItemRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -20,7 +19,6 @@ Prado::using('System.Web.UI.WebControls.TItemDataRenderer');
* define an item renderer class specific for {@link TDataGrid}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGridItemRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.0
*/
diff --git a/framework/Web/UI/WebControls/TDataGridPagerStyle.php b/framework/Web/UI/WebControls/TDataGridPagerStyle.php
index 31c0380b..4e143e05 100644
--- a/framework/Web/UI/WebControls/TDataGridPagerStyle.php
+++ b/framework/Web/UI/WebControls/TDataGridPagerStyle.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataGridPagerStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -18,7 +17,6 @@ Prado::using('System.Web.UI.WebControls.TDataGrid');
* TDataGridPagerStyle specifies the styles available for a datagrid pager.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGridPagerStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TDataList.php b/framework/Web/UI/WebControls/TDataList.php
index 6b3c4a73..021fdf6d 100644
--- a/framework/Web/UI/WebControls/TDataList.php
+++ b/framework/Web/UI/WebControls/TDataList.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -146,7 +145,6 @@ Prado::using('System.Web.UI.WebControls.TRepeatInfo');
* complex data may also have serializing problem if saved in viewstate.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1499,7 +1497,6 @@ class TDataList extends TBaseDataList implements INamingContainer, IRepeatInfoUs
* The {@link getItem Item} property indicates the DataList item related with the event.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1540,7 +1537,6 @@ class TDataListItemEventParameter extends TEventParameter
* raises the Command event.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1595,7 +1591,6 @@ class TDataListCommandEventParameter extends TCommandEventParameter
* is given by {@link getItemType ItemType} property.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1742,7 +1737,6 @@ class TDataListItem extends TWebControl implements INamingContainer, IItemDataRe
* TDataListItemCollection represents a collection of data list items.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TDataListItemRenderer.php b/framework/Web/UI/WebControls/TDataListItemRenderer.php
index df63c1f2..cf42c9a4 100644
--- a/framework/Web/UI/WebControls/TDataListItemRenderer.php
+++ b/framework/Web/UI/WebControls/TDataListItemRenderer.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataListItemRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -26,7 +25,6 @@ Prado::using('System.Web.UI.WebControls.TItemDataRenderer');
* which allows TDataList to apply CSS styles to the renders.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataListItemRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.0
*/
diff --git a/framework/Web/UI/WebControls/TDataRenderer.php b/framework/Web/UI/WebControls/TDataRenderer.php
index 8bde0152..0e98a1b4 100644
--- a/framework/Web/UI/WebControls/TDataRenderer.php
+++ b/framework/Web/UI/WebControls/TDataRenderer.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.2
*/
@@ -22,7 +21,6 @@
* - {@link getData Data}: data associated with this renderer.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.2
*/
diff --git a/framework/Web/UI/WebControls/TDataSourceControl.php b/framework/Web/UI/WebControls/TDataSourceControl.php
index 93037c03..afe4de2d 100644
--- a/framework/Web/UI/WebControls/TDataSourceControl.php
+++ b/framework/Web/UI/WebControls/TDataSourceControl.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataSourceControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -14,7 +13,6 @@
* IDataSource class
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataSourceControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -29,7 +27,6 @@ interface IDataSource
* TDataSourceControl class
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataSourceControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -90,7 +87,6 @@ abstract class TDataSourceControl extends TControl implements IDataSource
* TDataSourceControl class
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataSourceControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TDataSourceView.php b/framework/Web/UI/WebControls/TDataSourceView.php
index 1e1ad7a9..b9a76a32 100644
--- a/framework/Web/UI/WebControls/TDataSourceView.php
+++ b/framework/Web/UI/WebControls/TDataSourceView.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataSourceView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -14,7 +13,6 @@
* TDataSourceSelectParameters class
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataSourceView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -76,7 +74,6 @@ class TDataSourceSelectParameters extends TComponent
* TDataSourceView class
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataSourceView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -179,7 +176,6 @@ abstract class TDataSourceView extends TComponent
* TReadOnlyDataSourceView class
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataSourceView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TDataTypeValidator.php b/framework/Web/UI/WebControls/TDataTypeValidator.php
index b9ddbf6c..3881bb84 100644
--- a/framework/Web/UI/WebControls/TDataTypeValidator.php
+++ b/framework/Web/UI/WebControls/TDataTypeValidator.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataTypeValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -30,7 +29,6 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator');
* provided, the string will be assumed to be in GNU datetime format.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TDataTypeValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php
index 0e8d7bda..f910f06e 100644
--- a/framework/Web/UI/WebControls/TDatePicker.php
+++ b/framework/Web/UI/WebControls/TDatePicker.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDatePicker.php 3318 2013-09-04 14:04:51Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -73,7 +72,6 @@ Prado::using('System.Web.UI.WebControls.TTextBox');
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
- * @version $Id: TDatePicker.php 3318 2013-09-04 14:04:51Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -276,7 +274,7 @@ class TDatePicker extends TTextBox
{
return $this->getViewState('UpToYear', intval(@date('Y'))+10);
}
-
+
/**
* @param TDatePickerPositionMode calendar UI position
*/
@@ -406,14 +404,6 @@ class TDatePicker extends TTextBox
public function onPreRender($param)
{
parent::onPreRender($param);
- if($this->getInputMode() === TDatePickerInputMode::DropDownList)
- {
- $page = $this->getPage();
- $uniqueID = $this->getUniqueID();
- $page->registerPostDataLoader($uniqueID.TControl::ID_SEPARATOR.'day');
- $page->registerPostDataLoader($uniqueID.TControl::ID_SEPARATOR.'month');
- $page->registerPostDataLoader($uniqueID.TControl::ID_SEPARATOR.'year');
- }
$this->publishCalendarStyle();
$this->registerCalendarClientScriptPre();
}
@@ -902,9 +892,8 @@ class TDatePicker extends TTextBox
* is changed.
* The formatted date according to {@link TDatePicker::getDateFormat DateFormat} is sent
* as parameter to this event
- *
+ *
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TDatePicker.php 3318 2013-09-04 14:04:51Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
@@ -938,7 +927,6 @@ class TDatePickerClientScript extends TClientSideOptions
* - DropDownList: dropdown lists are used to pick up date values
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDatePicker.php 3318 2013-09-04 14:04:51Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
@@ -960,7 +948,6 @@ class TDatePickerInputMode extends TEnumerable
* - ImageButton: Shows an image next to the text input, clicking on the image shows the date picker,
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDatePicker.php 3318 2013-09-04 14:04:51Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TDropDownList.php b/framework/Web/UI/WebControls/TDropDownList.php
index 8dda857b..ab56bc7a 100644
--- a/framework/Web/UI/WebControls/TDropDownList.php
+++ b/framework/Web/UI/WebControls/TDropDownList.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDropDownList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -39,7 +38,6 @@ Prado::using('System.Web.UI.WebControls.TListControl');
* available item in the dropdown list will be selected.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDropDownList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -136,7 +134,7 @@ class TDropDownList extends TListControl implements IPostBackDataHandler, IValid
}
/**
- * Returns true if this control validated successfully.
+ * Returns true if this control validated successfully.
* Defaults to true.
* @return bool wether this control validated successfully.
*/
diff --git a/framework/Web/UI/WebControls/TDropDownListColumn.php b/framework/Web/UI/WebControls/TDropDownListColumn.php
index 40e07aef..13a47aa7 100644
--- a/framework/Web/UI/WebControls/TDropDownListColumn.php
+++ b/framework/Web/UI/WebControls/TDropDownListColumn.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDropDownListColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -54,7 +53,6 @@ Prado::using('System.Web.UI.WebControls.TDropDownList');
* datagrid cell is the first child.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDropDownListColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TEditCommandColumn.php b/framework/Web/UI/WebControls/TEditCommandColumn.php
index 2f69c001..d8db8059 100644
--- a/framework/Web/UI/WebControls/TEditCommandColumn.php
+++ b/framework/Web/UI/WebControls/TEditCommandColumn.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TEditCommandColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -47,7 +46,6 @@ Prado::using('System.Web.UI.WebControls.TDataGridColumn');
* datagrid cell is the first child.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TEditCommandColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TEmailAddressValidator.php b/framework/Web/UI/WebControls/TEmailAddressValidator.php
index dffe912e..b5ed78c6 100644
--- a/framework/Web/UI/WebControls/TEmailAddressValidator.php
+++ b/framework/Web/UI/WebControls/TEmailAddressValidator.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TEmailAddressValidator.php 3283 2013-03-24 10:19:08Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -24,7 +23,6 @@ Prado::using('System.Web.UI.WebControls.TRegularExpressionValidator');
* checkdnsrr() is available in the installed PHP.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TEmailAddressValidator.php 3283 2013-03-24 10:19:08Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TExpression.php b/framework/Web/UI/WebControls/TExpression.php
index 3cb1aa8c..f1fea77b 100644
--- a/framework/Web/UI/WebControls/TExpression.php
+++ b/framework/Web/UI/WebControls/TExpression.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TExpression.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -22,7 +21,6 @@
* make sure {@link setExpression Expression} does not come directly from user input.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TExpression.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TFileUpload.php b/framework/Web/UI/WebControls/TFileUpload.php
index c6dc595a..af2ad3f2 100644
--- a/framework/Web/UI/WebControls/TFileUpload.php
+++ b/framework/Web/UI/WebControls/TFileUpload.php
@@ -4,9 +4,8 @@
*
* @author Marcus Nyeholt <tanus@users.sourceforge.net>, Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TFileUpload.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -28,7 +27,6 @@
* (whether it succeeds or not).
*
* @author Marcus Nyeholt <tanus@users.sourceforge.net>, Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TFileUpload.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -261,7 +259,7 @@ class TFileUpload extends TWebControl implements IPostBackDataHandler, IValidata
}
/**
- * Returns true if this control validated successfully.
+ * Returns true if this control validated successfully.
* Defaults to true.
* @return bool wether this control validated successfully.
*/
diff --git a/framework/Web/UI/WebControls/TFlushOutput.php b/framework/Web/UI/WebControls/TFlushOutput.php
index dba35c79..0dbe0692 100644
--- a/framework/Web/UI/WebControls/TFlushOutput.php
+++ b/framework/Web/UI/WebControls/TFlushOutput.php
@@ -5,7 +5,6 @@
* @author Berczi Gabor <gabor.berczi@devworx.hu>
* @link http://www.pradosoft.com/
* @license http://www.pradosoft.com/license/
- * @version $Id: TFlushOutput.php $
* @package System.Web.UI.WebControls
*/
@@ -23,17 +22,16 @@
* <com:TFlushOutput />
* </code>
*
- * You can specify whether you want to keep buffering of the output
+ * You can specify whether you want to keep buffering of the output
* (if it was enabled) till the next occourence of a <com: TFlushOutput />
- * or the end of the page rendering, or stop buffering, by using the
+ * or the end of the page rendering, or stop buffering, by using the
* {@link setContinueBuffering ContinueBuffering}.
*
* @author Berczi Gabor <gabor.berczi@devworx.hu>
- * @version $Id: TFlushOutput.php $
* @package System.Web.UI.WebControls
* @since 3.1
*/
-class TFlushOutput extends TControl
+class TFlushOutput extends TControl
{
/**
* @var boolean whether to continue buffering of output
@@ -73,7 +71,7 @@ class TFlushOutput extends TControl
public function render($writer)
{
//$writer->write('<!-- flush -->');
- // ajax responses can't be parsed by the client side before loaded and returned completely,
+ // ajax responses can't be parsed by the client side before loaded and returned completely,
// so don't bother with flushing output somewhere mid-page if refreshing in a callback
if (!$this->Page->IsCallback)
{
diff --git a/framework/Web/UI/WebControls/TFont.php b/framework/Web/UI/WebControls/TFont.php
index 12da993b..a07b8621 100644
--- a/framework/Web/UI/WebControls/TFont.php
+++ b/framework/Web/UI/WebControls/TFont.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TFont.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -16,7 +15,6 @@
* TFont encapsulates the CSS style fields related with font settings.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TFont.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/THead.php b/framework/Web/UI/WebControls/THead.php
index 52ce3013..707bbfcc 100644
--- a/framework/Web/UI/WebControls/THead.php
+++ b/framework/Web/UI/WebControls/THead.php
@@ -4,9 +4,8 @@
*
* @author Marcus Nyeholt <tanus@users.sourceforge.net> and Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THead.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
@@ -37,7 +36,6 @@
* theme will not be rendered.
*
* @author Marcus Nyeholt <tanus@users.sourceforge.net> and Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THead.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -186,7 +184,6 @@ class THead extends TControl
* attributes for a meta tag, respectively.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THead.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -321,7 +318,6 @@ class TMetaTag extends TComponent
* contained in a {@link THead} control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THead.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/THeader1.php b/framework/Web/UI/WebControls/THeader1.php
index db516679..8aa635b5 100644
--- a/framework/Web/UI/WebControls/THeader1.php
+++ b/framework/Web/UI/WebControls/THeader1.php
@@ -4,9 +4,8 @@
*
* @author Brad Anderson <javalizard@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THeader1.php 2590 2008-12-10 11:34:24Z carlgmathisen $
* @package System.Web.UI.WebControls
*/
@@ -18,13 +17,12 @@
* This is also useful for the {@link TWebControlDecorator} (used by themes).
*
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: THeader1.php 2541 2008-10-21 15:05:13Z javalizard $
* @package System.Web.UI.WebControls
* @since 3.2a
*/
-
-class THeader1 extends THtmlElement {
-
+
+class THeader1 extends THtmlElement {
+
/**
* @return string tag name
*/
@@ -32,5 +30,5 @@ class THeader1 extends THtmlElement {
{
return 'h1';
}
-
+
}
diff --git a/framework/Web/UI/WebControls/THeader2.php b/framework/Web/UI/WebControls/THeader2.php
index be1d76ae..16631312 100644
--- a/framework/Web/UI/WebControls/THeader2.php
+++ b/framework/Web/UI/WebControls/THeader2.php
@@ -4,9 +4,8 @@
*
* @author Brad Anderson <javalizard@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THeader2.php 2590 2008-12-10 11:34:24Z carlgmathisen $
* @package System.Web.UI.WebControls
*/
@@ -18,13 +17,12 @@
* This is also useful for the {@link TWebControlDecorator} (used by themes).
*
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: THeader2.php 2541 2008-10-21 15:05:13Z javalizard $
* @package System.Web.UI.WebControls
* @since 3.2a
*/
-
-class THeader2 extends THtmlElement {
-
+
+class THeader2 extends THtmlElement {
+
/**
* @return string tag name
*/
@@ -32,5 +30,5 @@ class THeader2 extends THtmlElement {
{
return 'h2';
}
-
+
}
diff --git a/framework/Web/UI/WebControls/THeader3.php b/framework/Web/UI/WebControls/THeader3.php
index ff96a190..64e48366 100644
--- a/framework/Web/UI/WebControls/THeader3.php
+++ b/framework/Web/UI/WebControls/THeader3.php
@@ -4,9 +4,8 @@
*
* @author Brad Anderson <javalizard@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THeader3.php 2590 2008-12-10 11:34:24Z carlgmathisen $
* @package System.Web.UI.WebControls
*/
@@ -18,13 +17,12 @@
* This is also useful for the {@link TWebControlDecorator} (used by themes).
*
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: THeader3.php 2541 2008-10-21 15:05:13Z javalizard $
* @package System.Web.UI.WebControls
* @since 3.2a
*/
-
-class THeader3 extends THtmlElement {
-
+
+class THeader3 extends THtmlElement {
+
/**
* @return string tag name
*/
@@ -32,5 +30,5 @@ class THeader3 extends THtmlElement {
{
return 'h3';
}
-
+
}
diff --git a/framework/Web/UI/WebControls/THeader4.php b/framework/Web/UI/WebControls/THeader4.php
index 1374c700..6622dd34 100644
--- a/framework/Web/UI/WebControls/THeader4.php
+++ b/framework/Web/UI/WebControls/THeader4.php
@@ -4,9 +4,8 @@
*
* @author Brad Anderson <javalizard@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THeader4.php 2590 2008-12-10 11:34:24Z carlgmathisen $
* @package System.Web.UI.WebControls
*/
@@ -18,13 +17,12 @@
* This is also useful for the {@link TWebControlDecorator} (used by themes).
*
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: THeader4.php 2541 2008-10-21 15:05:13Z javalizard $
* @package System.Web.UI.WebControls
* @since 3.2
*/
-
-class THeader4 extends THtmlElement {
-
+
+class THeader4 extends THtmlElement {
+
/**
* @return string tag name
*/
@@ -32,5 +30,5 @@ class THeader4 extends THtmlElement {
{
return 'h4';
}
-
+
}
diff --git a/framework/Web/UI/WebControls/THeader5.php b/framework/Web/UI/WebControls/THeader5.php
index 911e17ed..4d061943 100644
--- a/framework/Web/UI/WebControls/THeader5.php
+++ b/framework/Web/UI/WebControls/THeader5.php
@@ -4,9 +4,8 @@
*
* @author Brad Anderson <javalizard@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THeader5.php 2590 2008-12-10 11:34:24Z carlgmathisen $
* @package System.Web.UI.WebControls
*/
@@ -18,13 +17,12 @@
* This is also useful for the {@link TWebControlDecorator} (used by themes).
*
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: THeader5.php 2541 2008-10-21 15:05:13Z javalizard $
* @package System.Web.UI.WebControls
* @since 3.2
*/
-
-class THeader5 extends THtmlElement {
-
+
+class THeader5 extends THtmlElement {
+
/**
* @return string tag name
*/
@@ -32,5 +30,5 @@ class THeader5 extends THtmlElement {
{
return 'h5';
}
-
+
}
diff --git a/framework/Web/UI/WebControls/THeader6.php b/framework/Web/UI/WebControls/THeader6.php
index a2891c3f..164c391c 100644
--- a/framework/Web/UI/WebControls/THeader6.php
+++ b/framework/Web/UI/WebControls/THeader6.php
@@ -4,9 +4,8 @@
*
* @author Brad Anderson <javalizard@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THeader6.php 2590 2008-12-10 11:34:24Z carlgmathisen $
* @package System.Web.UI.WebControls
*/
@@ -18,13 +17,12 @@
* This is also useful for the {@link TWebControlDecorator} (used by themes).
*
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: THeader6.php 2541 2008-10-21 15:05:13Z javalizard $
* @package System.Web.UI.WebControls
* @since 3.2
*/
-
-class THeader6 extends THtmlElement {
-
+
+class THeader6 extends THtmlElement {
+
/**
* @return string tag name
*/
@@ -32,5 +30,5 @@ class THeader6 extends THtmlElement {
{
return 'h6';
}
-
+
}
diff --git a/framework/Web/UI/WebControls/THiddenField.php b/framework/Web/UI/WebControls/THiddenField.php
index 041acdb2..d887a5e6 100644
--- a/framework/Web/UI/WebControls/THiddenField.php
+++ b/framework/Web/UI/WebControls/THiddenField.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.xisc.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
- * @version $Id: THiddenField.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -19,7 +18,6 @@
* event will be raised.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THiddenField.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -113,7 +111,7 @@ class THiddenField extends TControl implements IPostBackDataHandler, IValidatabl
}
/**
- * Returns true if this control validated successfully.
+ * Returns true if this control validated successfully.
* Defaults to true.
* @return bool wether this control validated successfully.
*/
diff --git a/framework/Web/UI/WebControls/THtmlArea.php b/framework/Web/UI/WebControls/THtmlArea.php
index 9d9ff3fa..6c2985f8 100644
--- a/framework/Web/UI/WebControls/THtmlArea.php
+++ b/framework/Web/UI/WebControls/THtmlArea.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THtmlArea.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -72,7 +71,6 @@ Prado::using('System.Web.UI.WebControls.TTextBox');
* </code>
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: THtmlArea.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -471,6 +469,8 @@ class THtmlArea extends TTextBox
$options['theme_advanced_toolbar_align'] = 'left';
$options['theme_advanced_path_location'] = 'bottom';
$options['extended_valid_elements'] = 'a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]';
+ if($this->getReadOnly())
+ $options['readonly'] = true;
$options = array_merge($options, $this->parseEditorOptions($this->getOptions()));
return $options;
@@ -491,7 +491,7 @@ class THtmlArea extends TTextBox
if(count($option) == 2)
{
$value=trim(trim($option[1]),"'\"");
- if (($s=strtolower($value))==='false')
+ if (($s=strtolower($value))==='false')
$value=false;
elseif ($s==='true')
$value=true;
diff --git a/framework/Web/UI/WebControls/THtmlArea4.php b/framework/Web/UI/WebControls/THtmlArea4.php
index f98c2ddf..d5410eae 100644
--- a/framework/Web/UI/WebControls/THtmlArea4.php
+++ b/framework/Web/UI/WebControls/THtmlArea4.php
@@ -4,9 +4,8 @@
*
* @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THtmlArea4.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -20,7 +19,7 @@ Prado::using('System.Web.UI.WebControls.TTextBox');
*
* THtmlArea4 wraps the visual editing functionalities provided by the
* version 4 of TinyMCE project {@link http://tinymce.com/}. It has been
- * developed as a plug'n'play substitute for {@link THtmlArea}, that is
+ * developed as a plug'n'play substitute for {@link THtmlArea}, that is
* based on the previous iteration (version 3) of the same project.
* Please note that both components can't be used together in the same page.
*
@@ -53,7 +52,6 @@ Prado::using('System.Web.UI.WebControls.TTextBox');
* </code>
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: THtmlArea.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -408,6 +406,13 @@ class THtmlArea4 extends TTextBox
$options['height'] = $this->getHeight();
$options['resize'] = 'both';
$options['menubar'] = false;
+ if($this->getReadOnly())
+ {
+ $options['readonly'] = true;
+ $options['toolbar'] = false;
+ $options['menubar'] = false;
+ $options['statusbar'] = false;
+ }
$options['extended_valid_elements'] = 'a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]';
@@ -430,7 +435,7 @@ class THtmlArea4 extends TTextBox
if(count($option) == 2)
{
$value=trim(trim($option[1]),"'\"");
- if (($s=strtolower($value))==='false')
+ if (($s=strtolower($value))==='false')
$value=false;
elseif ($s==='true')
$value=true;
diff --git a/framework/Web/UI/WebControls/THtmlElement.php b/framework/Web/UI/WebControls/THtmlElement.php
index 5646a6ff..f5bee915 100644
--- a/framework/Web/UI/WebControls/THtmlElement.php
+++ b/framework/Web/UI/WebControls/THtmlElement.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THtmlElement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -23,7 +22,6 @@ Prado::using('System.Web.UI.WebControls.TWebControl');
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: THtmlElement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.2
*/
@@ -49,18 +47,18 @@ class THtmlElement extends TWebControl
{
$this->_tagName=TPropertyValue::ensureString($value);
}
-
+
/**
* This is the default tag when no other is specified
- * @return string the default tag
+ * @return string the default tag
*/
public function getDefaultTagName() {
return 'span';
}
-
+
/**
* This tells you if this TagName has deviated from the original
- * @return boolean true if TagName has deviated from the default.
+ * @return boolean true if TagName has deviated from the default.
*/
public function getIsMutated() {
return $this->_tagName !== null && $this->_tagName != $this->getDefaultTagName();
diff --git a/framework/Web/UI/WebControls/THyperLink.php b/framework/Web/UI/WebControls/THyperLink.php
index 56aa5391..3cda0c48 100644
--- a/framework/Web/UI/WebControls/THyperLink.php
+++ b/framework/Web/UI/WebControls/THyperLink.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.xisc.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
- * @version $Id: THyperLink.php 3286 2013-04-18 06:09:19Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -20,13 +19,12 @@
* the alignment of the image displayed is set by the
* {@link setImageAlign ImageAlign} property and {@link getText Text} is
* displayed as the alternate text of the image.
- *
+ *
* The link target is specified via the {@link setTarget Target} property.
* If both {@link getImageUrl ImageUrl} and {@link getText Text} are empty,
* the content enclosed within the control tag will be rendered.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THyperLink.php 3286 2013-04-18 06:09:19Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -145,7 +143,7 @@ class THyperLink extends TWebControl implements IDataRenderer
{
return $this->getViewState('ImageHeight','');
}
-
+
/**
* Sets the height of the image in the THyperLink
* @param string height of the image in the THyperLink
@@ -171,7 +169,7 @@ class THyperLink extends TWebControl implements IDataRenderer
{
$this->setViewState('ImageUrl',$value,'');
}
-
+
/**
* @return string width of the image in the THyperLink
*/
@@ -179,7 +177,7 @@ class THyperLink extends TWebControl implements IDataRenderer
{
return $this->getViewState('ImageWidth','');
}
-
+
/**
* Sets the width of the image in the THyperLink
* @param string width of the image
diff --git a/framework/Web/UI/WebControls/THyperLinkColumn.php b/framework/Web/UI/WebControls/THyperLinkColumn.php
index 171accad..05060ea6 100644
--- a/framework/Web/UI/WebControls/THyperLinkColumn.php
+++ b/framework/Web/UI/WebControls/THyperLinkColumn.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THyperLinkColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -45,7 +44,6 @@ Prado::using('System.Web.UI.WebControls.THyperLink');
* datagrid cell is the first child.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THyperLinkColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -107,7 +105,7 @@ class THyperLinkColumn extends TDataGridColumn
{
return $this->getViewState('ImageHeight','');
}
-
+
/**
* @param string height of the image in the THyperLink
*/
@@ -123,7 +121,7 @@ class THyperLinkColumn extends TDataGridColumn
{
return $this->getViewState('ImageUrl','');
}
-
+
/**
* @param string url of the image in the THyperLink
*/
@@ -131,7 +129,7 @@ class THyperLinkColumn extends TDataGridColumn
{
$this->setViewState('ImageUrl',$value,'');
}
-
+
/**
* @return string width of the image in the THyperLink
*/
@@ -139,7 +137,7 @@ class THyperLinkColumn extends TDataGridColumn
{
return $this->getViewState('ImageWidth','');
}
-
+
/**
* @param string width of the image in the THyperLink
*/
diff --git a/framework/Web/UI/WebControls/TImage.php b/framework/Web/UI/WebControls/TImage.php
index 04a6d116..6ebbca5d 100644
--- a/framework/Web/UI/WebControls/TImage.php
+++ b/framework/Web/UI/WebControls/TImage.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TImage.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -21,7 +20,6 @@
* or {@link setDescriptionUrl DescriptionUrl} property, respectively.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImage.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TImageButton.php b/framework/Web/UI/WebControls/TImageButton.php
index 0ee52a94..ff876b07 100644
--- a/framework/Web/UI/WebControls/TImageButton.php
+++ b/framework/Web/UI/WebControls/TImageButton.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TImageButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -52,7 +51,6 @@ Prado::using('System.Web.UI.WebControls.TImage');
* TImageButton displays the {@link setText Text} property as the hint text to the displayed image.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -378,7 +376,6 @@ class TImageButton extends TImage implements IPostBackDataHandler, IPostBackEven
* {@link TImageButton::onClick Click} event of {@link TImageButton} controls.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TImageMap.php b/framework/Web/UI/WebControls/TImageMap.php
index 340f5089..23409b1c 100644
--- a/framework/Web/UI/WebControls/TImageMap.php
+++ b/framework/Web/UI/WebControls/TImageMap.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -33,7 +32,6 @@ Prado::using('System.Web.UI.WebControls.TImage');
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -230,7 +228,6 @@ class TImageMap extends TImage implements IPostBackEventHandler
* access {@link getPostBackValue PostBackValue}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -262,7 +259,6 @@ class TImageMapEventParameter extends TEventParameter
* THotSpotCollection represents a collection of hotspots in an imagemap.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -293,7 +289,6 @@ class THotSpotCollection extends TList
* and {@link TRectangleHotSpot}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -604,7 +599,6 @@ abstract class THotSpot extends TComponent
* control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -682,7 +676,6 @@ class TCircleHotSpot extends THotSpot
* TImageMap} control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -776,7 +769,6 @@ class TRectangleHotSpot extends THotSpot
* TImageMap} control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -823,7 +815,6 @@ class TPolygonHotSpot extends THotSpot
* - Inactive: the hotspot is inactive (not clickable)
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TInlineFrame.php b/framework/Web/UI/WebControls/TInlineFrame.php
index 2c1371aa..09e82315 100644
--- a/framework/Web/UI/WebControls/TInlineFrame.php
+++ b/framework/Web/UI/WebControls/TInlineFrame.php
@@ -5,9 +5,8 @@
* @author Jason Ragsdale <jrags@jasrags.net>
* @author Harry Pottash <hpottash@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TInlineFrame.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -27,7 +26,6 @@
* Original Prado v2 IFrame Author Information
* @author Jason Ragsdale <jrags@jasrags.net>
* @author Harry Pottash <hpottash@gmail.com>
- * @version $Id: TInlineFrame.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -239,7 +237,6 @@ class TInlineFrame extends TWebControl implements IDataRenderer
* - Bottom: bottom aligned
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TInlineFrame.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
@@ -264,7 +261,6 @@ class TInlineFrameAlign extends TEnumerable
* - Both: show both horizontal and vertical scroll bars all the time.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TInlineFrame.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TItemDataRenderer.php b/framework/Web/UI/WebControls/TItemDataRenderer.php
index 2809e046..eb6fabef 100644
--- a/framework/Web/UI/WebControls/TItemDataRenderer.php
+++ b/framework/Web/UI/WebControls/TItemDataRenderer.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TItemDataRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.2
*/
@@ -28,7 +27,6 @@ Prado::using('System.Web.UI.WebControls.TDataRenderer');
* - {@link getData Data}: data associated with this renderer
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TItemDataRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.2
*/
diff --git a/framework/Web/UI/WebControls/TJavascriptLogger.php b/framework/Web/UI/WebControls/TJavascriptLogger.php
index a2f1c1c2..2434237b 100644
--- a/framework/Web/UI/WebControls/TJavascriptLogger.php
+++ b/framework/Web/UI/WebControls/TJavascriptLogger.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TJavascriptLogger.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -26,14 +25,13 @@
* http://web.archive.org/web/20060512041505/gleepglop.com/javascripts/logger/
*
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
- * @version $Id: TJavascriptLogger.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
class TJavascriptLogger extends TWebControl
{
private static $_keyCodes = array(
- '0'=>48, '1'=>49, '2'=>50, '3'=>51, '4'=>52, '5'=>53, '6'=>54, '7'=>55, '8'=>56, '9'=>57,
+ '0'=>48, '1'=>49, '2'=>50, '3'=>51, '4'=>52, '5'=>53, '6'=>54, '7'=>55, '8'=>56, '9'=>57,
'a'=>65, 'b'=>66, 'c'=>67, 'd'=>68, 'e'=>69, 'f'=>70, 'g'=>71, 'h'=>72,
'i'=>73, 'j'=>74, 'k'=>75, 'l'=>76, 'm'=>77, 'n'=>78, 'o'=>79, 'p'=>80,
'q'=>81, 'r'=>82, 's'=>83, 't'=>84, 'u'=>85, 'v'=>86, 'w'=>87, 'x'=>88, 'y'=>89, 'z'=>90);
@@ -70,7 +68,7 @@ class TJavascriptLogger extends TWebControl
{
$key = strtolower($this->getToggleKey());
$code = isset(self::$_keyCodes[$key]) ? self::$_keyCodes[$key] : 74;
- $js = "var logConsole; Event.OnLoad(function() { logConsole = new LogConsole($code)}); ";
+ $js = "var logConsole; jQuery(function() { logConsole = new LogConsole($code)}); ";
$cs = $this->getPage()->getClientScript();
$cs->registerBeginScript($this->getClientID(),$js);
$cs->registerPradoScript('logger');
diff --git a/framework/Web/UI/WebControls/TKeyboard.php b/framework/Web/UI/WebControls/TKeyboard.php
index 1260c5af..d423107a 100644
--- a/framework/Web/UI/WebControls/TKeyboard.php
+++ b/framework/Web/UI/WebControls/TKeyboard.php
@@ -4,9 +4,8 @@
*
* @author Sergey Morkovkin <sergeymorkovkin@mail.ru> and Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TKeyboard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
@@ -33,7 +32,6 @@
* also be changed by specifying {@link setKeyboardCssClass KeyboardCssClass}.
*
* @author Sergey Morkovkin <sergeymorkovkin@mail.ru> and Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TKeyboard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
diff --git a/framework/Web/UI/WebControls/TLabel.php b/framework/Web/UI/WebControls/TLabel.php
index 4552b1a5..6ffd025b 100644
--- a/framework/Web/UI/WebControls/TLabel.php
+++ b/framework/Web/UI/WebControls/TLabel.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TLabel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -26,7 +25,6 @@
* Make sure it does not contain dangerous characters that you want to avoid.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TLabel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TLinkButton.php b/framework/Web/UI/WebControls/TLinkButton.php
index a9e6f4cf..fe1ae33b 100644
--- a/framework/Web/UI/WebControls/TLinkButton.php
+++ b/framework/Web/UI/WebControls/TLinkButton.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TLinkButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -50,7 +49,6 @@
* as an image button by enclosing an &lt;img&gt; tag as the body of TLinkButton.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TLinkButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TListBox.php b/framework/Web/UI/WebControls/TListBox.php
index a616a2be..1d72f0c2 100644
--- a/framework/Web/UI/WebControls/TListBox.php
+++ b/framework/Web/UI/WebControls/TListBox.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TListBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -32,7 +31,6 @@ Prado::using('System.Web.UI.WebControls.TListControl');
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TListBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -223,7 +221,7 @@ class TListBox extends TListControl implements IPostBackDataHandler, IValidatabl
}
/**
- * Returns true if this control validated successfully.
+ * Returns true if this control validated successfully.
* Defaults to true.
* @return bool wether this control validated successfully.
*/
@@ -250,7 +248,6 @@ class TListBox extends TListControl implements IPostBackDataHandler, IValidatabl
* - Multiple: allow multiple selection
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TListBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TListControl.php b/framework/Web/UI/WebControls/TListControl.php
index f9fdd77f..f8655761 100644
--- a/framework/Web/UI/WebControls/TListControl.php
+++ b/framework/Web/UI/WebControls/TListControl.php
@@ -6,9 +6,8 @@
* @author Robin J. Rogge <rojaro@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TListControl.php 3288 2013-04-30 10:36:50Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -79,7 +78,6 @@ Prado::using('System.Util.TDataFieldAccessor');
* be used to add a dummy list item that will be rendered first.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TListControl.php 3288 2013-04-30 10:36:50Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -794,7 +792,7 @@ abstract class TListControl extends TDataBoundControl implements IDataRenderer
public function renderContents($writer)
{
$this->renderPrompt($writer);
-
+
if($this->_items)
{
$writer->writeLine();
diff --git a/framework/Web/UI/WebControls/TListControlValidator.php b/framework/Web/UI/WebControls/TListControlValidator.php
index 7d9801ef..04cc6ef6 100644
--- a/framework/Web/UI/WebControls/TListControlValidator.php
+++ b/framework/Web/UI/WebControls/TListControlValidator.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TListControlValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -57,7 +56,6 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator');
* </code>
*
* @author Xiang Wei Zhuo <weizhuo[at]gmail.com>
- * @version $Id: TListControlValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TListItem.php b/framework/Web/UI/WebControls/TListItem.php
index e9bfa175..cf5e487a 100644
--- a/framework/Web/UI/WebControls/TListItem.php
+++ b/framework/Web/UI/WebControls/TListItem.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TListItem.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -21,7 +20,6 @@
* if the list control supports so.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TListItem.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TLiteral.php b/framework/Web/UI/WebControls/TLiteral.php
index da195f50..35d35e02 100644
--- a/framework/Web/UI/WebControls/TLiteral.php
+++ b/framework/Web/UI/WebControls/TLiteral.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TLiteral.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -27,7 +26,6 @@
* does not contain unwanted characters that may bring security vulnerabilities.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TLiteral.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TLiteralColumn.php b/framework/Web/UI/WebControls/TLiteralColumn.php
index f40f8f4e..4b2c39fc 100644
--- a/framework/Web/UI/WebControls/TLiteralColumn.php
+++ b/framework/Web/UI/WebControls/TLiteralColumn.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TLiteralColumn.php 1397 2006-09-07 07:55:53Z wei $
* @package System.Web.UI.WebControls
*/
@@ -29,7 +28,6 @@ Prado::using('System.Web.UI.WebControls.TDataGridColumn');
* If {@link setEncode Encode} is true, the static texts will be HTML-encoded.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TLiteralColumn.php 1397 2006-09-07 07:55:53Z wei $
* @package System.Web.UI.WebControls
* @since 3.0.5
*/
@@ -111,18 +109,13 @@ class TLiteralColumn extends TDataGridColumn
if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::EditItem || $itemType===TListItemType::SelectedItem)
{
if($this->getDataField()!=='')
- $cell->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
- else
{
- if(($dataField=$this->getDataField())!=='')
- $control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
- else
- {
- $text=$this->getText();
- if($this->getEncode())
- $text=THttpUtility::htmlEncode($text);
- $cell->setText($text);
- }
+ $cell->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
+ } else {
+ $text=$this->getText();
+ if($this->getEncode())
+ $text=THttpUtility::htmlEncode($text);
+ $cell->setText($text);
}
}
else
diff --git a/framework/Web/UI/WebControls/TMarkdown.php b/framework/Web/UI/WebControls/TMarkdown.php
index 1a2855eb..75c8ec1b 100644
--- a/framework/Web/UI/WebControls/TMarkdown.php
+++ b/framework/Web/UI/WebControls/TMarkdown.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMarkdown.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -14,7 +13,7 @@
* Using TTextHighlighter and MarkdownParser classes
*/
Prado::using('System.Web.UI.WebControls.TTextHighlighter');
-Prado::using('System.3rdParty.Markdown.MarkdownParser');
+Prado::using('System.3rdParty.Parsedown.Parsedown');
/**
* TMarkdown class
@@ -30,7 +29,7 @@ Prado::using('System.3rdParty.Markdown.MarkdownParser');
* To use TMarkdown, simply enclose the content to be rendered within
* the body of TMarkdown in a template.
*
- * See http://www.pradosoft.com/demos/quickstart/?page=Markdown for
+ * See https://daringfireball.net/projects/markdown/basics for
* details on the Markdown syntax usage.
*
* TMarkdown also performs syntax highlighting for code blocks whose language
@@ -39,7 +38,6 @@ Prado::using('System.3rdParty.Markdown.MarkdownParser');
* and enclosed within a pair of square brackets (e.g. [php]).
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TMarkdown.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.1
*/
@@ -53,10 +51,9 @@ class TMarkdown extends TTextHighlighter
*/
public function processText($text)
{
- $renderer = new MarkdownParser;
- $result = $renderer->parse($text);
+ $result = Parsedown::instance()->parse($text);
return preg_replace_callback(
- '/<pre><code>\[\s*(\w+)\s*\]\n+((.|\n)*?)\s*<\\/code><\\/pre>/im',
+ '/<pre><code class="language-(\w+)">((.|\n)*?)<\\/code><\\/pre>/im',
array($this, 'highlightCode'), $result);
}
diff --git a/framework/Web/UI/WebControls/TMultiView.php b/framework/Web/UI/WebControls/TMultiView.php
index 286f4e95..05725ff7 100644
--- a/framework/Web/UI/WebControls/TMultiView.php
+++ b/framework/Web/UI/WebControls/TMultiView.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMultiView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -32,7 +31,6 @@
* when its active view is changed during a postback.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TMultiView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -272,7 +270,6 @@ class TMultiView extends TControl
* TViewCollection represents a collection that only takes {@link TView} instances
* as collection elements.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TMultiView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -307,7 +304,6 @@ class TViewCollection extends TControlCollection
* and when a view is deactivated, it raises {@link onDeactivate OnDeactivate}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TMultiView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TOutputCache.php b/framework/Web/UI/WebControls/TOutputCache.php
index 89c0c849..2a5ce734 100644
--- a/framework/Web/UI/WebControls/TOutputCache.php
+++ b/framework/Web/UI/WebControls/TOutputCache.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TOutputCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -63,7 +62,6 @@
* to determine whether the content is cached or not.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TOutputCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1
*/
@@ -481,7 +479,7 @@ class TOutputCache extends TControl implements INamingContainer
$textwriter = new TTextWriter();
$multiwriter = new TOutputCacheTextWriterMulti(array($writer->getWriter(),$textwriter));
$htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), $multiwriter);
-
+
$stack=$this->getPage()->getCachingStack();
$stack->push($this);
parent::render($htmlWriter);
@@ -503,7 +501,6 @@ class TOutputCache extends TControl implements INamingContainer
* <b>OnCheckDependency</b> event of {@link TOutputCache} control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TOutputCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -555,7 +552,6 @@ class TOutputCacheCheckDependencyEventParameter extends TEventParameter
* <b>OnCalculateKey</b> event of {@link TOutputCache} control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TOutputCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -591,7 +587,6 @@ class TOutputCacheCalculateKeyEventParameter extends TEventParameter
*
* @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu>
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TOutputCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.2
*/
@@ -604,7 +599,7 @@ class TOutputCacheTextWriterMulti extends TTextWriter
//parent::__construct();
$this->_writers = $writers;
}
-
+
public function write($s)
{
foreach($this->_writers as $writer)
diff --git a/framework/Web/UI/WebControls/TPager.php b/framework/Web/UI/WebControls/TPager.php
index 6379fedd..b4b9c2b0 100644
--- a/framework/Web/UI/WebControls/TPager.php
+++ b/framework/Web/UI/WebControls/TPager.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -34,7 +33,7 @@
*
* Since Prado 3.2.1, you can use the {@link setButtonCssClass ButtonCssClass} property to specify a css class
* that will be applied to each button created by the pager in NextPrev or Numeric mode.
- *
+ *
* TPager raises an {@link onPageIndexChanged OnPageIndexChanged} event when
* the end-user interacts with it and specifies a new page (e.g. clicking
* on a page button that leads to a new page.) The new page index may be obtained
@@ -45,7 +44,6 @@
* Multiple pagers can be associated with the same data-bound control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.2
*/
@@ -727,7 +725,6 @@ class TPager extends TWebControl implements INamingContainer
* returns the new page index carried with the page command.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.2
*/
@@ -781,7 +778,6 @@ class TPagerPageChangedEventParameter extends TEventParameter
* - DropDownList: a dropdown list is used to select pages
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
@@ -802,7 +798,6 @@ class TPagerMode extends TEnumerable
* - PushButton: form submit buttons
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TPanel.php b/framework/Web/UI/WebControls/TPanel.php
index cf20a864..2bf1b40d 100644
--- a/framework/Web/UI/WebControls/TPanel.php
+++ b/framework/Web/UI/WebControls/TPanel.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -35,7 +34,6 @@ Prado::using('System.Web.UI.WebControls.TPanelStyle');
* by setting the {@link setDefaultButton DefaultButton} property.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -231,12 +229,7 @@ class TPanel extends TWebControl
if(($butt=$this->getDefaultButton())!=='')
{
- $buttons = $this->findControlsByID($butt);
- if (count($buttons)>0)
- $button = reset($buttons);
- else
- $button = null;
- if($button===null)
+ if(($button=$this->findControl($butt))===null)
throw new TInvalidDataValueException('panel_defaultbutton_invalid',$butt);
else
$this->getPage()->getClientScript()->registerDefaultButton($this, $button);
diff --git a/framework/Web/UI/WebControls/TPanelStyle.php b/framework/Web/UI/WebControls/TPanelStyle.php
index cb49b715..d1dfe62e 100644
--- a/framework/Web/UI/WebControls/TPanelStyle.php
+++ b/framework/Web/UI/WebControls/TPanelStyle.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPanelStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -20,7 +19,6 @@ Prado::using('System.Web.UI.WebControls.TStyle');
* TPanelStyle represents the CSS style specific for panel HTML tag.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPanelStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -239,7 +237,6 @@ class TPanelStyle extends TStyle
* - RightToLeft: content in a panel is right to left
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPanelStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
@@ -263,7 +260,6 @@ class TContentDirection extends TEnumerable
* - Vertical: vertical scroll bar only
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPanelStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TPlaceHolder.php b/framework/Web/UI/WebControls/TPlaceHolder.php
index 020141cf..6809a402 100644
--- a/framework/Web/UI/WebControls/TPlaceHolder.php
+++ b/framework/Web/UI/WebControls/TPlaceHolder.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPlaceHolder.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -18,7 +17,6 @@
* by manipulating the {@link TControl::getControls Controls} property.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPlaceHolder.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TRadioButton.php b/framework/Web/UI/WebControls/TRadioButton.php
index 144704b4..cd3d8480 100644
--- a/framework/Web/UI/WebControls/TRadioButton.php
+++ b/framework/Web/UI/WebControls/TRadioButton.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRadioButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -14,10 +13,6 @@
* Using TCheckBox parent class
*/
Prado::using('System.Web.UI.WebControls.TCheckBox');
-/**
- * Using TRadioButtonList class
- */
-Prado::using('System.Web.UI.WebControls.TRadioButtonList');
/**
* TRadioButton class
@@ -49,7 +44,6 @@ Prado::using('System.Web.UI.WebControls.TRadioButtonList');
* that may bring security vulnerabilities.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRadioButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -156,16 +150,6 @@ class TRadioButton extends TCheckBox
}
/**
- * Add the group name as post data loader if group name is set.
- */
- protected function addToPostDataLoader()
- {
- parent::addToPostDataLoader();
- $group = $this->getGroupName();
- if(!empty($group) || $this->getViewState('UniqueGroupName','') !== '')
- $this->getPage()->registerPostDataLoader($this->getUniqueGroupName());
- }
- /**
* @return string the name used to fetch radiobutton post data
*/
public function getUniqueGroupName()
@@ -182,7 +166,7 @@ class TRadioButton extends TCheckBox
{
if($groupName!=='')
$groupName=substr($uniqueID,0,$pos+1).$groupName;
- else if($this->getNamingContainer() instanceof TRadioButtonList)
+ else if(is_a($this->getNamingContainer(), 'TRadioButtonList'))
$groupName=substr($uniqueID,0,$pos);
}
if($groupName==='')
diff --git a/framework/Web/UI/WebControls/TRadioButtonList.php b/framework/Web/UI/WebControls/TRadioButtonList.php
index d93caaa2..3afe3ec2 100644
--- a/framework/Web/UI/WebControls/TRadioButtonList.php
+++ b/framework/Web/UI/WebControls/TRadioButtonList.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRadioButtonList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -29,7 +28,6 @@ Prado::using('System.Web.UI.WebControls.TCheckBoxList');
* one radiobutton can be selected at a time.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRadioButtonList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -49,7 +47,7 @@ class TRadioButtonList extends TCheckBoxList
*/
protected function createRepeatedControl()
{
- return new TRadioButton;
+ return new TRadioButtonItem;
}
/**
@@ -99,3 +97,11 @@ class TRadioButtonList extends TCheckBoxList
}
}
+class TRadioButtonItem extends TRadioButton {
+ /**
+ * Override client implementation to avoid emitting the javascript
+ */
+ protected function renderClientControlScript($writer)
+ {
+ }
+}
diff --git a/framework/Web/UI/WebControls/TRangeValidator.php b/framework/Web/UI/WebControls/TRangeValidator.php
index 8b7550c8..8a3c0e35 100644
--- a/framework/Web/UI/WebControls/TRangeValidator.php
+++ b/framework/Web/UI/WebControls/TRangeValidator.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRangeValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -46,7 +45,6 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator');
* defaulted as UTF-8.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRangeValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -350,7 +348,6 @@ class TRangeValidator extends TBaseValidator
* - StringLength
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRangeValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TRatingList.php b/framework/Web/UI/WebControls/TRatingList.php
index f4d4adcf..b1673ac0 100644
--- a/framework/Web/UI/WebControls/TRatingList.php
+++ b/framework/Web/UI/WebControls/TRatingList.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRatingList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -22,7 +21,6 @@ Prado::using('System.Web.UI.WebControls.TRadioButtonList');
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @author Bradley Booms <bradley[dot]booms[at]gmail[dot]com>
- * @version $Id: TRatingList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -125,7 +123,7 @@ class TRatingList extends TRadioButtonList
$index = $this->getRatingIndex($value);
parent::setSelectedIndex($index);
}
-
+
public function setSelectedIndex($value)
{
$this->setRating($value+1);
@@ -175,7 +173,9 @@ class TRatingList extends TRadioButtonList
{
if(($id=$this->getCaptionID())!=='')
{
- if($control=$this->getParent()->findControl($id))
+ if($control=$this->getPage()->findControl($id))
+ return $control;
+ if($control=$this->getNamingContainer()->findControl($id))
return $control;
}
throw new TInvalidDataValueException(
@@ -213,7 +213,7 @@ class TRatingList extends TRadioButtonList
{
return $this->getViewState('RatingStyle', 'default');
}
-
+
/**
* @return string rating style css class name.
*/
diff --git a/framework/Web/UI/WebControls/TReCaptcha.php b/framework/Web/UI/WebControls/TReCaptcha.php
index 31fcf1ca..a5a360c3 100644
--- a/framework/Web/UI/WebControls/TReCaptcha.php
+++ b/framework/Web/UI/WebControls/TReCaptcha.php
@@ -227,7 +227,7 @@ class TReCaptcha extends TWebControl implements IValidatable
public function renderContents($writer)
{
- $readyscript = 'Event.fire(document, '.TJavaScript::quoteString('captchaready:'.$this->getClientID()).')';
+ $readyscript = 'jQuery(document).trigger('.TJavaScript::quoteString('captchaready:'.$this->getClientID()).')';
$cs = $this->Page->ClientScript;
$id = $this->getClientID();
$divid = $id.'_1_recaptchadiv';
@@ -250,7 +250,7 @@ class TReCaptcha extends TWebControl implements IValidatable
*/
$writer->write($html);
- $cs->registerEndScript('ReCaptcha::EventScript', 'Event.observe(document, "dom:loaded", function() { '.$readyscript.'; } );');
+ $cs->registerEndScript('ReCaptcha::EventScript', 'jQuery(document).ready(function() { '.$readyscript.'; } );');
}
else
{
@@ -258,7 +258,7 @@ class TReCaptcha extends TWebControl implements IValidatable
$options['callback'] = new TJavaScriptLiteral('function() { '.$readyscript.'; '.$this->getCallbackScript().'; }');
$cs->registerScriptFile('ReCaptcha::AjaxScript', 'http://www.google.com/recaptcha/api/js/recaptcha_ajax.js');
$cs->registerEndScript('ReCaptcha::CreateScript::'.$id, implode(' ', array(
- 'if (!$('.TJavaScript::quoteString($this->getResponseFieldName()).'))',
+ 'if (!jQuery('.TJavaScript::quoteString('#'.$this->getResponseFieldName()).'))',
'{',
'Recaptcha.destroy();',
'Recaptcha.create(',
diff --git a/framework/Web/UI/WebControls/TReCaptchaValidator.php b/framework/Web/UI/WebControls/TReCaptchaValidator.php
index bba356b8..e25d0f84 100644
--- a/framework/Web/UI/WebControls/TReCaptchaValidator.php
+++ b/framework/Web/UI/WebControls/TReCaptchaValidator.php
@@ -116,8 +116,7 @@ class TReCaptchaValidator extends TBaseValidator
// this function will be used to update the validator
'function '.$fn.'(valid)',
'{',
- ' var v = $('.TJavaScript::quoteString($this->getClientID()).');',
- ' $('.TJavaScript::quoteString($this->getClientID().'_1').').value = valid;',
+ ' jQuery('.TJavaScript::quoteString('#'.$this->getClientID().'_1').').val(valid);',
' Prado.Validation.validateControl('.TJavaScript::quoteString($control->ClientID).'); ',
'}',
'',
@@ -126,9 +125,9 @@ class TReCaptchaValidator extends TBaseValidator
$this->Page->IsCallback ? $fn.'('.$value.');' : '',
'',
// wait for the captcha to be constructed
- 'Event.observe(document,"captchaready:'.$control->getClientID().'",function() { ',
+ 'jQuery(document).on("captchaready:'.$control->getClientID().'",function() { ',
// install event handler that clears the validation error when user changes the captcha response field
- 'Event.observe('.TJavaScript::quoteString($control->getResponseFieldName()).',"keyup",function() { ',
+ 'jQuery('.TJavaScript::quoteString('#'.$control->getResponseFieldName()).').on("keyup",function() { ',
$fn.'("1");',
'});',
'});',
diff --git a/framework/Web/UI/WebControls/TRegularExpressionValidator.php b/framework/Web/UI/WebControls/TRegularExpressionValidator.php
index 890fb56e..2c155e28 100644
--- a/framework/Web/UI/WebControls/TRegularExpressionValidator.php
+++ b/framework/Web/UI/WebControls/TRegularExpressionValidator.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRegularExpressionValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -43,7 +42,6 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator');
* Use a {@link TRequiredFieldValidator} to ensure the input is not empty.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRegularExpressionValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TRepeatInfo.php b/framework/Web/UI/WebControls/TRepeatInfo.php
index 929d31e7..7b65b3b3 100644
--- a/framework/Web/UI/WebControls/TRepeatInfo.php
+++ b/framework/Web/UI/WebControls/TRepeatInfo.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRepeatInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -17,7 +16,6 @@ Prado::using('System.Web.UI.WebControls.TTable');
* This interface must be implemented by classes who want to use {@link TRepeatInfo}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeatInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -70,7 +68,6 @@ interface IRepeatInfoUser
* the column and repeat direction settings.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeatInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -526,7 +523,6 @@ class TRepeatInfo extends TComponent
* - Horizontal
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeatInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
@@ -547,7 +543,6 @@ class TRepeatDirection extends TEnumerable
* - Raw: the repeated contents are stacked together without any additional decorations
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeatInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TRepeater.php b/framework/Web/UI/WebControls/TRepeater.php
index c32636fd..a563a12d 100644
--- a/framework/Web/UI/WebControls/TRepeater.php
+++ b/framework/Web/UI/WebControls/TRepeater.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRepeater.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -87,7 +86,6 @@ Prado::using('System.Util.TDataFieldAccessor');
* complex data may also have serializing problem if saved in viewstate.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeater.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -784,7 +782,6 @@ class TRepeater extends TDataBoundControl implements INamingContainer
* The {@link getItem Item} property indicates the repeater item related with the event.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeater.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -825,7 +822,6 @@ class TRepeaterItemEventParameter extends TEventParameter
* raises the Command event.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeater.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -880,7 +876,6 @@ class TRepeaterCommandEventParameter extends TCommandEventParameter
* is given by {@link getItemType ItemType} property.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeater.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1001,7 +996,6 @@ class TRepeaterItem extends TControl implements INamingContainer, IItemDataRende
* TRepeaterItemCollection represents a collection of repeater items.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeater.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TRepeaterItemRenderer.php b/framework/Web/UI/WebControls/TRepeaterItemRenderer.php
index 0e39e765..1c41e65f 100644
--- a/framework/Web/UI/WebControls/TRepeaterItemRenderer.php
+++ b/framework/Web/UI/WebControls/TRepeaterItemRenderer.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRepeaterItemRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -23,7 +22,6 @@ Prado::using('System.Web.UI.WebControls.TItemDataRenderer');
* the bubbling scheme for the OnCommand event of repeater items.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeaterItemRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.0
*/
diff --git a/framework/Web/UI/WebControls/TRequiredFieldValidator.php b/framework/Web/UI/WebControls/TRequiredFieldValidator.php
index 7a0bad8c..3db2457d 100644
--- a/framework/Web/UI/WebControls/TRequiredFieldValidator.php
+++ b/framework/Web/UI/WebControls/TRequiredFieldValidator.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRequiredFieldValidator.php 3288 2013-04-30 10:36:50Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -29,7 +28,6 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator');
* set, it will be automatically considered as the validator's {@link setInitialValue InitialValue}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRequiredFieldValidator.php 3288 2013-04-30 10:36:50Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -99,7 +97,7 @@ class TRequiredFieldValidator extends TBaseValidator
else
return $this->validateStandardControl($control);
}
-
+
private function validateListControl($control)
{
$initial = trim($this->getInitialValue());
@@ -111,7 +109,7 @@ class TRequiredFieldValidator extends TBaseValidator
}
return $count > 0;
}
-
+
private function validateRadioButtonGroup($control)
{
$initial = trim($this->getInitialValue());
@@ -127,7 +125,7 @@ class TRequiredFieldValidator extends TBaseValidator
}
return false;
}
-
+
private function validateStandardControl($control)
{
$initial = trim($this->getInitialValue());
diff --git a/framework/Web/UI/WebControls/TSafeHtml.php b/framework/Web/UI/WebControls/TSafeHtml.php
index 775086b4..b7b14f79 100644
--- a/framework/Web/UI/WebControls/TSafeHtml.php
+++ b/framework/Web/UI/WebControls/TSafeHtml.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSafeHtml.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -34,7 +33,6 @@
* to ensure the contents gets parsed correctly.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TSafeHtml.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TSlider.php b/framework/Web/UI/WebControls/TSlider.php
index dcf34bfc..e9573ea9 100644
--- a/framework/Web/UI/WebControls/TSlider.php
+++ b/framework/Web/UI/WebControls/TSlider.php
@@ -4,9 +4,8 @@
*
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSlider.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
@@ -26,10 +25,10 @@
* You can also provide the allowed values by setting the {@link SetValues Values} array.
*
* A 'Progress Indicator' can be displayed within the track with the {@link SetProgressIndicator ProgressIndicator} property.
- *
+ *
* The TSlider control can be easily customized using CssClasses. You can provide your own css file, using the
* {@link SetCssUrl CssUrl} property.
- * The css class for TSlider can be set by the {@link setCssClass CssClass} property. Default value is "Slider HorizontalSlider"
+ * The css class for TSlider can be set by the {@link setCssClass CssClass} property. Default value is "Slider HorizontalSlider"
* for an horizontal slider, and "Slider VerticalSlider" for a vertical one.
*
* If {@link SetAutoPostBack AutoPostBack} property is true, postback is sent as soon as the value changed.
@@ -42,7 +41,6 @@
* - ClientSide.onChange is called when the slider value has changed (at the end of a move).
*
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
- * @version $Id: TSlider.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
@@ -145,7 +143,7 @@ class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer
{
$this->setViewState('StepSize', $value, 1.0);
}
-
+
/**
* @return boolean wether to display a progress indicator or not. Defaults to true.
*/
@@ -219,7 +217,7 @@ class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer
{
$this->setViewState('Values', TPropertyValue::ensureArray($value), array());
}
-
+
/**
* @return boolean a value indicating whether an automatic postback to the server
* will occur whenever the user modifies the slider value. Defaults to false.
@@ -351,7 +349,7 @@ class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer
$class=($this->getDirection()==TSliderDirection::Horizontal)?'HorizontalSlider':'VerticalSlider';
$writer->addAttribute('class', 'Slider '.$class);
}
-
+
}
/**
@@ -387,9 +385,9 @@ class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer
}
$writer->renderEndTag();
*/
-
+
$writer->renderEndTag();
-
+
// Render the 'Handle'
$writer->addAttribute('class', 'Handle');
$writer->addAttribute('id', $this->getClientID().'_handle');
@@ -457,7 +455,7 @@ class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer
$options['axis'] = strtolower($this->getDirection());
$options['maximum'] = $maxValue;
$options['minimum'] = $minValue;
- $options['range'] = TJavascript::quoteJsLiteral('$R('.$minValue.",".$maxValue.")");
+ $options['range'] = array($minValue, $maxValue);
$options['sliderValue'] = $this->getValue();
$options['disabled'] = !$this->getEnabled();
$values=$this->getValues();
@@ -508,7 +506,6 @@ class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer
* The <tt>OnChange</tt> event is raised when the slider value is changed (or at the end of a move)
*
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
- * @version $Id: TSlider.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
@@ -561,7 +558,6 @@ class TSliderClientScript extends TClientSideOptions
* - Vertical : Vertical slider
*
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
- * @version $Id: TSlider.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
diff --git a/framework/Web/UI/WebControls/TStatements.php b/framework/Web/UI/WebControls/TStatements.php
index 32f98296..0602732b 100644
--- a/framework/Web/UI/WebControls/TStatements.php
+++ b/framework/Web/UI/WebControls/TStatements.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TStatements.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -23,7 +22,6 @@
* make sure {@link setStatements Statements} does not come directly from user input.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TStatements.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TStyle.php b/framework/Web/UI/WebControls/TStyle.php
index 4ba37d53..f30b3461 100644
--- a/framework/Web/UI/WebControls/TStyle.php
+++ b/framework/Web/UI/WebControls/TStyle.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -21,7 +20,6 @@ Prado::using('System.Web.UI.WebControls.TFont');
* TStyle encapsulates the CSS style applied to a control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -418,7 +416,6 @@ class TStyle extends TComponent
* - Hidden: the control is not displayed and is included in the layout.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1
*/
@@ -435,7 +432,6 @@ class TDisplayStyle extends TEnumerable
* TTableStyle represents the CSS style specific for HTML table.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -676,7 +672,6 @@ class TTableStyle extends TStyle
* TTableItemStyle represents the CSS style specific for HTML table item.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -831,7 +826,6 @@ class TTableItemStyle extends TStyle
* - Justify: the begin and end are justified
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
@@ -855,7 +849,6 @@ class THorizontalAlign extends TEnumerable
* - Middle: middle aligned
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
@@ -879,7 +872,6 @@ class TVerticalAlign extends TEnumerable
* - Both: both horizontal and vertical grid lines are shown
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TStyleSheet.php b/framework/Web/UI/WebControls/TStyleSheet.php
index 5faf52f0..32c0faf1 100644
--- a/framework/Web/UI/WebControls/TStyleSheet.php
+++ b/framework/Web/UI/WebControls/TStyleSheet.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TStyleSheet.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
diff --git a/framework/Web/UI/WebControls/TTabPanel.php b/framework/Web/UI/WebControls/TTabPanel.php
index 0c6128f1..8f1564db 100644
--- a/framework/Web/UI/WebControls/TTabPanel.php
+++ b/framework/Web/UI/WebControls/TTabPanel.php
@@ -4,9 +4,8 @@
*
* @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTabPanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
@@ -54,7 +53,6 @@
* </code>
*
* @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTabPanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
@@ -408,15 +406,15 @@ class TTabPanel extends TWebControl implements IPostBackDataHandler
protected function registerStyleSheet()
{
$url = $this->getCssUrl();
-
+
if($url === '') {
return;
}
-
+
if($url === 'default') {
$url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'tabpanel.css');
}
-
+
if($url !== '') {
$this->getPage()->getClientScript()->registerStyleSheetFile($url, $url);
}
@@ -540,7 +538,6 @@ class TTabPanel extends TWebControl implements IPostBackDataHandler
* setting the {@link setActive Active} property.
*
* @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTabPanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
@@ -694,7 +691,6 @@ class TTabView extends TWebControl
* TTabViewCollection is used to maintain a list of views belong to a {@link TTabPanel}.
*
* @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTabPanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
diff --git a/framework/Web/UI/WebControls/TTable.php b/framework/Web/UI/WebControls/TTable.php
index 5be68cbd..4102cd4b 100644
--- a/framework/Web/UI/WebControls/TTable.php
+++ b/framework/Web/UI/WebControls/TTable.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTable.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -61,7 +60,6 @@ Prado::using('System.Web.UI.WebControls.TTableRow');
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTable.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -358,7 +356,6 @@ class TTable extends TWebControl
* TTableRowCollection is used to maintain a list of rows belong to a table.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTable.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -395,7 +392,6 @@ class TTableRowCollection extends TControlCollection
* - Right: right aligned
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTable.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TTableCell.php b/framework/Web/UI/WebControls/TTableCell.php
index 96254e62..d78aebbd 100644
--- a/framework/Web/UI/WebControls/TTableCell.php
+++ b/framework/Web/UI/WebControls/TTableCell.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTableCell.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -28,7 +27,6 @@
* indicates whether the contents in the cell should be wrapped.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTableCell.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TTableFooterRow.php b/framework/Web/UI/WebControls/TTableFooterRow.php
index 46d1a3be..32be1e12 100644
--- a/framework/Web/UI/WebControls/TTableFooterRow.php
+++ b/framework/Web/UI/WebControls/TTableFooterRow.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTableFooterRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -21,7 +20,6 @@ Prado::using('System.Web.UI.WebControls.TTableRow');
* TTableFooterRow displays a table footer row.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTableFooterRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.1
*/
diff --git a/framework/Web/UI/WebControls/TTableHeaderCell.php b/framework/Web/UI/WebControls/TTableHeaderCell.php
index 80036d41..43b21b45 100644
--- a/framework/Web/UI/WebControls/TTableHeaderCell.php
+++ b/framework/Web/UI/WebControls/TTableHeaderCell.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTableHeaderCell.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -22,7 +21,6 @@ Prado::using('System.Web.UI.WebControls.TTableCell');
* TTableHeaderCell displays a table header cell on a Web page.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTableHeaderCell.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -111,7 +109,6 @@ class TTableHeaderCell extends TTableCell
* - Column: the scope is column-wise
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTableHeaderCell.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TTableHeaderRow.php b/framework/Web/UI/WebControls/TTableHeaderRow.php
index 166a20e4..0e42a416 100644
--- a/framework/Web/UI/WebControls/TTableHeaderRow.php
+++ b/framework/Web/UI/WebControls/TTableHeaderRow.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTableHeaderRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -21,7 +20,6 @@ Prado::using('System.Web.UI.WebControls.TTableRow');
* TTableHeaderRow displays a table header row.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTableHeaderRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.1
*/
diff --git a/framework/Web/UI/WebControls/TTableRow.php b/framework/Web/UI/WebControls/TTableRow.php
index a998e6fb..d0bc6bfb 100644
--- a/framework/Web/UI/WebControls/TTableRow.php
+++ b/framework/Web/UI/WebControls/TTableRow.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTableRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -24,7 +23,6 @@ Prado::using('System.Web.UI.WebControls.TTableCell');
* {@link setVerticalAlign VerticalAlign} properties, respectively.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTableRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -160,7 +158,6 @@ class TTableRow extends TWebControl
* TTableCellCollection is used to maintain a list of cells belong to a table row.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTableRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -195,7 +192,6 @@ class TTableCellCollection extends TControlCollection
* - Footer: in table footer
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTableRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TTemplateColumn.php b/framework/Web/UI/WebControls/TTemplateColumn.php
index 173476f2..947f0c47 100644
--- a/framework/Web/UI/WebControls/TTemplateColumn.php
+++ b/framework/Web/UI/WebControls/TTemplateColumn.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTemplateColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -34,7 +33,6 @@ Prado::using('System.Web.UI.WebControls.TDataGridColumn');
* takes precedence.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTemplateColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TTextBox.php b/framework/Web/UI/WebControls/TTextBox.php
index 969d2969..0d14dd7c 100644
--- a/framework/Web/UI/WebControls/TTextBox.php
+++ b/framework/Web/UI/WebControls/TTextBox.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -44,7 +43,6 @@
* Currently, no alternatives are available.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -593,7 +591,6 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable
* - Password: the textbox will hide user input like a password input box
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
@@ -610,7 +607,6 @@ class TTextBoxMode extends TEnumerable
* by a {@link TTextBox} control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TTextHighlighter.php b/framework/Web/UI/WebControls/TTextHighlighter.php
index 64878d49..a10171db 100644
--- a/framework/Web/UI/WebControls/TTextHighlighter.php
+++ b/framework/Web/UI/WebControls/TTextHighlighter.php
@@ -4,9 +4,8 @@
*
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTextHighlighter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -31,7 +30,6 @@ Prado::using('System.Web.UI.WebControls.TTextProcessor');
* because it needs to insert some CSS styles.
*
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
- * @version $Id: TTextHighlighter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -202,7 +200,6 @@ class TTextHighlighter extends TTextProcessor
/**
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
- * @version $Id: TTextHighlighter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TTextProcessor.php b/framework/Web/UI/WebControls/TTextProcessor.php
index e569e780..daba9b46 100644
--- a/framework/Web/UI/WebControls/TTextProcessor.php
+++ b/framework/Web/UI/WebControls/TTextProcessor.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTextProcessor.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -23,7 +22,6 @@
* Note, all child classes must implement {@link processText} method.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTextProcessor.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0.1
*/
diff --git a/framework/Web/UI/WebControls/TValidationSummary.php b/framework/Web/UI/WebControls/TValidationSummary.php
index 00c96c90..3d5b61ca 100644
--- a/framework/Web/UI/WebControls/TValidationSummary.php
+++ b/framework/Web/UI/WebControls/TValidationSummary.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TValidationSummary.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -30,7 +29,6 @@
* {@link setEnableClientScript EnableClientScript} is true.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TValidationSummary.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -430,7 +428,6 @@ class TValidationSummary extends TWebControl
* See the quickstart documentation for further details.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TValidationSummary.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -499,7 +496,6 @@ class TClientSideValidationSummaryOptions extends TClientSideOptions
* - HeaderOnly: only the HeaderText will be display.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TValidationSummary.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
@@ -523,7 +519,6 @@ class TValidationSummaryDisplayMode extends TEnumerable
* - Fixed: Similar to Dynamic except that the error messages physically occupy the page layout (even though they may not be visible)
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TValidationSummary.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TWebControl.php b/framework/Web/UI/WebControls/TWebControl.php
index 0da4d88c..e0bd6194 100644
--- a/framework/Web/UI/WebControls/TWebControl.php
+++ b/framework/Web/UI/WebControls/TWebControl.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TWebControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -35,7 +34,6 @@ Prado::using('System.Web.UI.WebControls.TWebControlDecorator');
* the body contents enclosed within the HTML tag.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWebControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -45,12 +43,12 @@ class TWebControl extends TControl implements IStyleable
* @var boolean ensures the inclusion the id in the tag rendering.
*/
private $_ensureid=false;
-
+
/**
* @var TWebControlDecorator this render things before and after both the open and close tag
*/
protected $_decorator;
-
+
/**
* Subclasses can override getEnsureId or just set this property. eg. If your subclass
@@ -80,7 +78,7 @@ class TWebControl extends TControl implements IStyleable
$this->_decorator = Prado::createComponent('TWebControlDecorator', $this);
return $this->_decorator;
}
-
+
/**
* Copies basic control attributes from another control.
* Properties including AccessKey, ToolTip, TabIndex, Enabled
@@ -397,10 +395,10 @@ class TWebControl extends TControl implements IStyleable
{
$this->getStyle()->setWidth($value);
}
-
+
/**
- * If your subclass overrides the onPreRender method be sure to call
+ * If your subclass overrides the onPreRender method be sure to call
* this method through parent::onPreRender($param); so your sub-class can be decorated,
* among other things.
* @param TEventParameter event parameter to be passed to the event handlers
@@ -408,7 +406,7 @@ class TWebControl extends TControl implements IStyleable
public function onPreRender($param) {
if($decorator = $this->getDecorator(false))
$decorator->instantiate();
-
+
parent::onPreRender($param);
}
@@ -494,7 +492,7 @@ class TWebControl extends TControl implements IStyleable
$decorator->renderPostContentsText($writer);
$writer->renderEndTag();
$decorator->renderPostTagText($writer);
- } else
+ } else
$writer->renderEndTag($writer);
}
}
diff --git a/framework/Web/UI/WebControls/TWebControlAdapter.php b/framework/Web/UI/WebControls/TWebControlAdapter.php
index 5de15419..6b969456 100644
--- a/framework/Web/UI/WebControls/TWebControlAdapter.php
+++ b/framework/Web/UI/WebControls/TWebControlAdapter.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TWebControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -19,7 +18,6 @@
* browsers.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWebControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TWebControlDecorator.php b/framework/Web/UI/WebControls/TWebControlDecorator.php
index 9b1c3652..d08d9c82 100644
--- a/framework/Web/UI/WebControls/TWebControlDecorator.php
+++ b/framework/Web/UI/WebControls/TWebControlDecorator.php
@@ -4,23 +4,22 @@
*
* @author Brad Anderson <javalizard@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TWebControlDecorator.php 2541 2008-10-21 15:05:13Z qiang.xue $
* @package System.Web.UI.WebControls
*/
/**
* TWebControlDecorator class
- *
+ *
* A TWebControlDecorator can be applied to a {@link TWebControl} to customize its rendering.
- * TWebControlDecorator can add custom html code before and after both the open and close
+ * TWebControlDecorator can add custom html code before and after both the open and close
* tag of a {@link TWebControl}.
* The html code can be an user-defined text or an external template file that will be
* instantiated and rendered in place.
- *
- * This is an easy way to have your look and feel depend upon the theme instead of writing
+ *
+ * This is an easy way to have your look and feel depend upon the theme instead of writing
* specific html in your templates to achieve your website desires.
* Here is an example of how to code your theme skin:
* <code>
@@ -51,40 +50,39 @@
*
*
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: TWebControlDecorator.php 2541 2008-10-21 15:05:13Z qiang.xue $
* @package System.Web.UI.WebControls
* @since 3.2
*/
class TWebControlDecorator extends TComponent {
-
+
/**
* @var boolean tells if there should only be decoration around the inner content
*/
private $_internalonly;
-
+
/**
* @var boolean tells if the decoration uses state in its templates. If there are no templates
- * in the instance of the decoration this variable is unused.
+ * in the instance of the decoration this variable is unused.
*/
private $_usestate = false;
-
+
/**
* @var TWebControl the control to decorate
*/
private $_control;
-
+
/**
* @var TControl to tell the decorator where to place the outer controls
*/
private $_outercontrol;
-
+
/**
- * @var boolean This tells if the Templates have been
+ * @var boolean This tells if the Templates have been
*/
private $_addedTemplateDecoration=false;
-
-
+
+
/**
* @var string the text that goes before the open tag
*/
@@ -101,9 +99,9 @@ class TWebControlDecorator extends TComponent {
* @var string the text that goes after the close tag
*/
private $_posttagtext = '';
-
-
-
+
+
+
/**
* @var TTemplate the template that goes before the open tag
*/
@@ -120,7 +118,7 @@ class TWebControlDecorator extends TComponent {
* @var TTemplate the template that goes after the close tag
*/
private $_posttagtemplate;
-
+
/**
* Constructor.
* Initializes the control .
@@ -131,7 +129,7 @@ class TWebControlDecorator extends TComponent {
$this->_control = $control;
$this->_internalonly = $onlyinternal;
}
-
+
/**
* @return boolean if the templates in this decoration need state. This defaults to false
*/
@@ -139,23 +137,23 @@ class TWebControlDecorator extends TComponent {
{
return $this->_usestate;
}
-
+
/**
- * @param boolean $value true to tell the decoration that the templates need state and should be
+ * @param boolean $value true to tell the decoration that the templates need state and should be
* placed in a control step before the state is saved.
*/
public function setUseState($value)
{
$this->_usestate = TPropertyValue::ensureBoolean($value);
}
-
+
/**
* @return string gets the text before the open tag in the TWebControl
*/
public function getPreTagText() {
return $this->_pretagtext;
}
-
+
/**
* @param string sets the text before the open tag in the TWebControl
*/
@@ -163,15 +161,15 @@ class TWebControlDecorator extends TComponent {
if(!$this->_internalonly && !$this->_control->getIsSkinApplied())
$this->_pretagtext = TPropertyValue::ensureString($value);
}
-
-
+
+
/**
* @return string the text after the open tag in the TWebControl
*/
public function getPreContentsText() {
return $this->_precontentstext;
}
-
+
/**
* @param string sets the text after the open tag in the TWebControl
*/
@@ -179,15 +177,15 @@ class TWebControlDecorator extends TComponent {
if(!$this->_control->getIsSkinApplied())
$this->_precontentstext = TPropertyValue::ensureString($value);
}
-
-
+
+
/**
* @return string the text before the close tag in the TWebControl
*/
public function getPostContentsText() {
return $this->_postcontentstext;
}
-
+
/**
* @param string sets the text before the close tag in the TWebControl
*/
@@ -195,15 +193,15 @@ class TWebControlDecorator extends TComponent {
if(!$this->_control->getIsSkinApplied())
$this->_postcontentstext = TPropertyValue::ensureString($value);
}
-
-
+
+
/**
* @return string the text before the close tag in the TWebControl
*/
public function getPostTagText() {
return $this->_posttagtext;
}
-
+
/**
* @param string sets the text after the close tag in the TWebControl
*/
@@ -211,15 +209,15 @@ class TWebControlDecorator extends TComponent {
if(!$this->_internalonly && !$this->_control->getIsSkinApplied())
$this->_posttagtext = TPropertyValue::ensureString($value);
}
-
-
+
+
/**
* @return TTemplate|null the template before the open tag in the TWebControl. Defaults to null.
*/
public function getPreTagTemplate() {
return $this->_pretagtemplate;
}
-
+
/**
* @param TTemplate sets the template before the open tag in the TWebControl
*/
@@ -227,15 +225,15 @@ class TWebControlDecorator extends TComponent {
if(!$this->_internalonly && !$this->_control->getIsSkinApplied())
$this->_pretagtemplate = $value;
}
-
-
+
+
/**
* @return TTemplate|null the template after the open tag in the TWebControl. Defaults to null.
*/
public function getPreContentsTemplate() {
return $this->_precontentstemplate;
}
-
+
/**
* @param TTemplate sets the template after the open tag in the TWebControl
*/
@@ -243,15 +241,15 @@ class TWebControlDecorator extends TComponent {
if(!$this->_control->getIsSkinApplied())
$this->_precontentstemplate = $value;
}
-
-
+
+
/**
* @return TTemplate|null the template before the close tag in the TWebControl. Defaults to null.
*/
public function getPostContentsTemplate() {
return $this->_postcontentstemplate;
}
-
+
/**
* @param TTemplate sets the template before the close tag in the TWebControl
*/
@@ -259,15 +257,15 @@ class TWebControlDecorator extends TComponent {
if(!$this->_control->getIsSkinApplied())
$this->_postcontentstemplate = $value;
}
-
-
+
+
/**
* @return TTemplate|null the template after the close tag in the TWebControl. Defaults to null.
*/
public function getPostTagTemplate() {
return $this->_posttagtemplate;
}
-
+
/**
* @param TTemplate sets the template before the close tag in the TWebControl
*/
@@ -275,17 +273,17 @@ class TWebControlDecorator extends TComponent {
if(!$this->_internalonly && !$this->_control->getIsSkinApplied())
$this->_posttagtemplate = $value;
}
-
+
/**
- * this is a framework call. The Text decoration can't
+ * this is a framework call. The Text decoration can't
* influence the object hierarchy because they are rendered into into the writer directly.
- * This call attaches the ensureTemplateDecoration to the TPage onSaveStateComplete so
+ * This call attaches the ensureTemplateDecoration to the TPage onSaveStateComplete so
* these controls don't have page states. This is as close to not influencing the page as possible.
*/
public function instantiate($outercontrol = null) {
- if($this->getPreTagTemplate() || $this->getPreContentsTemplate() ||
+ if($this->getPreTagTemplate() || $this->getPreContentsTemplate() ||
$this->getPostContentsTemplate() || $this->getPostTagTemplate()) {
-
+
$this->_outercontrol = $outercontrol;
if($this->getUseState())
$this->ensureTemplateDecoration();
@@ -293,53 +291,53 @@ class TWebControlDecorator extends TComponent {
$this->_control->getPage()->onSaveStateComplete[] = array($this, 'ensureTemplateDecoration');
}
}
-
-
+
+
/**
* This method places the templates around the open and close tag. This takes a parameter which is
* to specify the control to get the outer template decoration. If no outer control is specified
- * @param TComponent this indicates the component or control to get the outer tag elements, just in case it's
+ * @param TComponent this indicates the component or control to get the outer tag elements, just in case it's
* different than attached TWebControl. If none is provided, the outer templates default to the attached
* control
* @return boolean returns true if the template decorations have been added
*/
public function ensureTemplateDecoration($sender=null, $param=null) {
-
+
$control = $this->_control;
$outercontrol = $this->_outercontrol;
if($outercontrol === null)
$outercontrol = $control;
-
+
if($this->_addedTemplateDecoration)
return $this->_addedTemplateDecoration;
-
+
$this->_addedTemplateDecoration = true;
-
+
if($this->getPreContentsTemplate())
{
$precontents = Prado::createComponent('TCompositeControl');
$this->getPreContentsTemplate()->instantiateIn($precontents);
$control->getControls()->insertAt(0, $precontents);
}
-
+
if($this->getPostContentsTemplate())
{
$postcontents = Prado::createComponent('TCompositeControl');
$this->getPostContentsTemplate()->instantiateIn($postcontents);
$control->getControls()->add($postcontents);
}
-
+
if(!$outercontrol->getParent())
return $this->_addedTemplateDecoration;
-
-
+
+
if($this->getPreTagTemplate())
{
$pretag = Prado::createComponent('TCompositeControl');
$this->getPreTagTemplate()->instantiateIn($pretag);
$outercontrol->getParent()->getControls()->insertBefore($outercontrol, $pretag);
}
-
+
if($this->getPostTagTemplate())
{
$posttag = Prado::createComponent('TCompositeControl');
@@ -348,8 +346,8 @@ class TWebControlDecorator extends TComponent {
}
return true;
}
-
-
+
+
/**
* This method places the pre tag text into the {@link TTextWriter}
* @param {@link TTextWriter} the writer to which the text is written
@@ -357,7 +355,7 @@ class TWebControlDecorator extends TComponent {
public function renderPreTagText($writer) {
$writer->write($this->getPreTagText());
}
-
+
/**
* This method places the pre contents text into the {@link TTextWriter}
* @param {@link TTextWriter} the writer to which the text is written
@@ -365,7 +363,7 @@ class TWebControlDecorator extends TComponent {
public function renderPreContentsText($writer) {
$writer->write($this->getPreContentsText());
}
-
+
/**
* This method places the post contents text into the {@link TTextWriter}
* @param {@link TTextWriter} the writer to which the text is written
@@ -373,7 +371,7 @@ class TWebControlDecorator extends TComponent {
public function renderPostContentsText($writer) {
$writer->write($this->getPostContentsText());
}
-
+
/**
* This method places the post tag text into the {@link TTextWriter}
* @param {@link TTextWriter} the writer to which the text is written
diff --git a/framework/Web/UI/WebControls/TWizard.php b/framework/Web/UI/WebControls/TWizard.php
index 67cbc4e4..6b82a691 100644
--- a/framework/Web/UI/WebControls/TWizard.php
+++ b/framework/Web/UI/WebControls/TWizard.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -77,7 +76,6 @@ Prado::using('System.Web.UI.WebControls.TWizardNavigationButtonStyle');
* - side bar: {@link getSideBarStyle SideBarStyle} and {@link getSideBarButtonStyle SideBarButtonStyle}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1449,7 +1447,6 @@ class TWizard extends TWebControl implements INamingContainer
* set {@link setAllowReturn AllowReturn} to true.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1539,7 +1536,6 @@ class TWizardStep extends TView
* TCompleteWizardStep represents a wizard step of type TWizardStepType::Complete.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1574,7 +1570,6 @@ class TCompleteWizardStep extends TWizardStep
* if the navigation template is not specified, default navigation will be used.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1676,7 +1671,6 @@ class TTemplatedWizardStep extends TWizardStep implements INamingContainer
* by a {@link TWizard}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1740,7 +1734,6 @@ class TWizardStepCollection extends TList
* {@link getCancelButton CancelButton}, {@link getCompleteButton CompleteButton}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1832,7 +1825,6 @@ class TWizardNavigationContainer extends TControl implements INamingContainer
* to true.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1897,7 +1889,6 @@ class TWizardNavigationEventParameter extends TEventParameter
* TWizardSideBarTemplate class.
* TWizardSideBarTemplate is the default template for wizard sidebar.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1922,7 +1913,6 @@ class TWizardSideBarTemplate extends TComponent implements ITemplate
* TWizardSideBarListItemTemplate class.
* TWizardSideBarListItemTemplate is the default template for each item in the sidebar datalist.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1945,7 +1935,6 @@ class TWizardSideBarListItemTemplate extends TComponent implements ITemplate
* TWizardNavigationTemplate class.
* TWizardNavigationTemplate is the base class for various navigation templates.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -2017,7 +2006,6 @@ class TWizardNavigationTemplate extends TComponent implements ITemplate
* TWizardStartNavigationTemplate is the template used as default wizard start navigation panel.
* It consists of two buttons, Next and Cancel.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -2047,7 +2035,6 @@ class TWizardStartNavigationTemplate extends TWizardNavigationTemplate
* TWizardFinishNavigationTemplate is the template used as default wizard finish navigation panel.
* It consists of three buttons, Previous, Complete and Cancel.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -2081,7 +2068,6 @@ class TWizardFinishNavigationTemplate extends TWizardNavigationTemplate
* TWizardStepNavigationTemplate is the template used as default wizard step navigation panel.
* It consists of three buttons, Previous, Next and Cancel.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -2122,7 +2108,6 @@ class TWizardStepNavigationTemplate extends TWizardNavigationTemplate
* - Link: a hyperlink button
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
@@ -2146,7 +2131,6 @@ class TWizardNavigationButtonType extends TEnumerable
* - Finish: the last step before the Complete step.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
diff --git a/framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php b/framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php
index f0873df8..c84f28a1 100644
--- a/framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php
+++ b/framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php
@@ -4,7 +4,7 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id $
* @package System.Web.UI.WebControls
@@ -25,7 +25,6 @@ Prado::using('System.Web.UI.WebControls.TStyle');
* Otherwise, {@link setButtonText ButtonText} will be displayed as the button caption.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizardNavigationButtonStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TXmlTransform.php b/framework/Web/UI/WebControls/TXmlTransform.php
index 7b4d5cf7..c32ab440 100644
--- a/framework/Web/UI/WebControls/TXmlTransform.php
+++ b/framework/Web/UI/WebControls/TXmlTransform.php
@@ -5,7 +5,7 @@
* @author Knut Urdalen <knut.urdalen@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package System.Web.UI.WebControls
*/
diff --git a/framework/Web/UI/WebControls/assets/captcha.php b/framework/Web/UI/WebControls/assets/captcha.php
index ac71d696..1c35e6eb 100644
--- a/framework/Web/UI/WebControls/assets/captcha.php
+++ b/framework/Web/UI/WebControls/assets/captcha.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: captcha.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls.assets
*/
@@ -116,7 +115,7 @@ function displayToken($token,$fontSize,$theme)
imagettftext($image,$size,$angle,$x+2,$y+2,$color,$font,$token[$i]);
imagecolordeallocate($image,$color);
}
-
+
header('Content-Type: image/png');
imagepng($image);
imagedestroy($image);
diff --git a/framework/Wsat/TWsatARGenerator.php b/framework/Wsat/TWsatARGenerator.php
new file mode 100644
index 00000000..c6cef1d5
--- /dev/null
+++ b/framework/Wsat/TWsatARGenerator.php
@@ -0,0 +1,283 @@
+<?php
+
+/**
+ * @author Daniel Sampedro Bello <darthdaniel85@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @since 3.3
+ * @package Wsat
+ */
+
+Prado::using('System.Data.Common.TDbMetaData');
+
+class TWsatARGenerator
+{
+
+ /**
+ * @return TDbMetaData for retrieving metadata information, such as
+ * table and columns information, from a database connection.
+ */
+ private $_dbMetaData;
+
+ /**
+ * Output folder where AR classes will be saved.
+ */
+ private $_opFile;
+
+ /**
+ * Class name prefix
+ */
+ private $_clasPrefix;
+
+ /**
+ * Class name sufix
+ */
+ private $_classSufix;
+
+ /**
+ * all table relations array
+ */
+ private $_relations;
+
+ /**
+ * unquote chars
+ * @var array
+ */
+ private $uqChars = array('[', ']', '"', '`', "'");
+
+ function __construct()
+ {
+ if(!class_exists("TActiveRecordManager", false))
+ throw new Exception("You need to enable the ActiveRecord module in your application configuration file.");
+ $ar_manager = TActiveRecordManager::getInstance();
+ $_conn = $ar_manager->getDbConnection();
+ $_conn->Active = true;
+ $this->_dbMetaData = TDbMetaData::getInstance($_conn);
+ }
+
+ public function setOpFile($op_file_namespace)
+ {
+ $op_file = Prado::getPathOfNamespace($op_file_namespace);
+ if (empty($op_file))
+ throw new Exception("You need to fix your output folder namespace.");
+ if (!is_dir($op_file))
+ mkdir($op_file, 0777, true);
+ $this->_opFile = $op_file;
+ }
+
+ public function setClasPrefix($_clas_prefix)
+ {
+ $this->_clasPrefix = $_clas_prefix;
+ }
+
+ public function setClassSufix($_clas_sufix)
+ {
+ $this->_classSufix = $_clas_sufix;
+ }
+
+//-----------------------------------------------------------------------------
+ // <editor-fold defaultstate="collapsed" desc="Main APIs">
+ public function generate($tableName)
+ {
+ $tableInfo = $this->_dbMetaData->getTableInfo($tableName);
+ $this->_commonGenerate($tableName, $tableInfo);
+ }
+
+ public function generateAll()
+ {
+ foreach ($this->_dbMetaData->findTableNames() as $tableName)
+ {
+ if ($tableName == "pradocache")
+ continue;
+ $tableInfo = $this->_dbMetaData->getTableInfo($tableName);
+ if (!empty($this->_relations))
+ {
+ // Cancel generation of M-M relationships middle table
+ if (count($tableInfo->getPrimaryKeys()) === 2 && count($tableInfo->getColumns()) === 2)//M-M relationships
+ continue;
+ }
+ $this->_commonGenerate($tableName, $tableInfo);
+ }
+ }
+
+ public function buildRelations()
+ {
+ $this->_relations = array();
+ foreach ($this->_dbMetaData->findTableNames() as $table_name)
+ {
+ $tableInfo = $this->_dbMetaData->getTableInfo($table_name);
+ $pks = $tableInfo->getPrimaryKeys();
+ $fks = $tableInfo->getForeignKeys();
+
+ if (count($pks) === 2 && count($tableInfo->getColumns()) === 2)//M-M relationships
+ {
+ $table_name_mm = $fks[0]["table"];
+ $table_name_mm2 = $fks[1]["table"];
+
+ $this->_relations[$table_name_mm][] = array(
+ "prop_name" => strtolower($table_name_mm2),
+ "rel_type" => "self::MANY_TO_MANY",
+ "ref_class_name" => $this->_getProperClassName($table_name_mm2),
+ "prop_ref" => $table_name
+ );
+
+ $this->_relations[$table_name_mm2][] = array(
+ "prop_name" => strtolower($table_name_mm),
+ "rel_type" => "self::MANY_TO_MANY",
+ "ref_class_name" => $this->_getProperClassName($table_name_mm),
+ "prop_ref" => $table_name
+ );
+ continue;
+ }
+ foreach ($fks as $fk_data)//1-M relationships
+ {
+ $owner_table = $fk_data["table"];
+ $slave_table = $table_name;
+ $fk_prop = key($fk_data["keys"]);
+
+ $this->_relations[$owner_table][] = array(
+ "prop_name" => strtolower($slave_table),
+ "rel_type" => "self::HAS_MANY",
+ "ref_class_name" => $this->_getProperClassName($slave_table),
+ "prop_ref" => $fk_prop
+ );
+
+ $this->_relations[$slave_table][] = array(
+ "prop_name" => strtolower($owner_table),
+ "rel_type" => "self::BELONGS_TO",
+ "ref_class_name" => $this->_getProperClassName($owner_table),
+ "prop_ref" => $fk_prop
+ );
+ }
+ }
+ }
+
+// </editor-fold>
+//-----------------------------------------------------------------------------
+ // <editor-fold defaultstate="collapsed" desc="Common Methods">
+
+ private function _commonGenerate($tableName, $tableInfo)
+ {
+ if (count($tableInfo->getColumns()) === 0)
+ throw new Exception("Unable to find table or view $tableName in " . $this->_dbMetaData->getDbConnection()->getConnectionString() . ".");
+ else
+ {
+ $properties = array();
+ foreach ($tableInfo->getColumns() as $field => $column)
+ $properties[] = $this->generateProperty($field, $column);
+ $toString = $this->_buildSmartToString($tableInfo);
+ }
+
+ $clasName = $this->_getProperClassName($tableName);
+ $class = $this->generateClass($properties, $tableName, $clasName, $toString);
+ $output = $this->_opFile . DIRECTORY_SEPARATOR . $clasName . ".php";
+ file_put_contents($output, $class);
+ }
+
+ private function _getProperClassName($tableName)
+ {
+ $table_name_words = str_replace("_", " ", strtolower($tableName));
+ $final_conversion = str_replace(" ", "", ucwords($table_name_words));
+ return $this->_clasPrefix . $final_conversion . $this->_classSufix;
+ }
+
+ public function renderAllTablesInformation()
+ {
+ foreach ($this->_dbMetaData->findTableNames() as $table_name)
+ {
+ echo $table_name . "<br>";
+
+ $tableInfo = $this->_dbMetaData->getTableInfo($table_name);
+ echo "Table info:" . "<br>";
+ echo "<pre>";
+ var_dump($tableInfo);
+ echo "</pre>";
+ }
+ }
+
+//-----------------------------------------------------------------------------
+
+ protected function generateProperty($field, $column)
+ {
+ $prop = '';
+ $name = '$' . $field;
+
+ /* TODO use in version 2.0 */
+ // $type = $column->getPHPType();
+
+ $prop .= "\tpublic $name;";
+ return $prop;
+ }
+
+ private function _renderRelations($tablename)
+ {
+ if (!isset($this->_relations[$tablename]))
+ return "";
+
+ $code = "\tpublic static \$RELATIONS = array (";
+ foreach ($this->_relations[$tablename] as $rel_data)
+ $code .= "\n\t\t'" . $rel_data["prop_name"] . "' => array(" . $rel_data["rel_type"] . ", '" . $rel_data["ref_class_name"] . "', '" . $rel_data["prop_ref"] . "'),";
+
+ $code = substr($code, 0, -1);
+ $code .= "\n\t);";
+ return $code;
+ }
+
+ private function _buildSmartToString($tableInfo)
+ {
+ $code = "\tpublic function __toString() {";
+ $property = "throw new THttpException(500, 'Not implemented yet.');";
+ try
+ {
+ foreach ($tableInfo->getColumns() as $column)
+ {
+ if (isset($column->IsPrimaryKey) && $column->IsPrimaryKey)
+ $property = str_replace($this->uqChars, "", $column->ColumnName);
+ elseif ($column->PdoType == PDO::PARAM_STR && $column->DBType != "date")
+ {
+ $property = str_replace($this->uqChars, "", $column->ColumnName);
+ break;
+ }
+ }
+ } catch (Exception $ex)
+ {
+ Prado::trace($ex->getMessage());
+ }
+ $code .= "\n\t\treturn \$this->$property;";
+ $code .= "\n\t}";
+ return $code;
+ }
+
+ protected function generateClass($properties, $tablename, $classname, $toString)
+ {
+ $props = implode("\n", $properties);
+ $relations = $this->_renderRelations($tablename);
+ $date = date('Y-m-d h:i:s');
+ $env_user = getenv("username");
+ return <<<EOD
+<?php
+/**
+ * Auto generated by PRADO - WSAT on $date.
+ * @author $env_user
+ */
+class $classname extends TActiveRecord
+{
+ const TABLE='$tablename';
+
+$props
+
+ public static function finder(\$className=__CLASS__) {
+ return parent::finder(\$className);
+ }
+
+$relations
+
+$toString
+}
+EOD;
+ }
+
+// </editor-fold>
+} \ No newline at end of file
diff --git a/framework/Wsat/TWsatService.php b/framework/Wsat/TWsatService.php
new file mode 100644
index 00000000..3796bd48
--- /dev/null
+++ b/framework/Wsat/TWsatService.php
@@ -0,0 +1,81 @@
+<?php
+
+/**
+ * @author Daniel Sampedro Bello <darthdaniel85@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @since 3.3
+ * @package Wsat
+ */
+
+/**
+ * TWsatService class
+ *
+ * Wsat is inspired in both Asp.Net - Web Site Administration Tool(WSAT) and Yii's Gii.
+ * Wsat enables you to generate code saving your time in too many tedious tasks in a GUI fashion.
+ *
+ * Current options:
+ * 1- Generate one or all Active Record Classes from your DataBase.
+ * 1.1- Automatically generate all relations between the AR Classes (new).
+ * 1.2- Automatically generate the __toString() magic method in a smart way (new).
+ *
+ * To use TWsatService, configure it in the application configuration file like following:
+ * <code>
+ * <services>
+ * ...
+ * <service id="wsat" class="System.Wsat.TWsatService" Password="my_secret_password" />
+ * </services>
+ * </code>
+ * ...and then you need to go to http://localhost/yoursite/index.php?wsat=TWsatLogin
+ * and generate code and configure your site.
+ *
+ * Warning: You should only use Wsat in development mode.
+ */
+class TWsatService extends TPageService
+{
+
+ private $_pass = '';
+
+ public function init($config)
+ {
+ if ($this->getApplication()->getMode() === TApplicationMode::Performance || $this->getApplication()->getMode() === TApplicationMode::Normal)
+ throw new TInvalidOperationException("You should not use Prado WSAT in any of the production modes.");
+
+ if (empty($this->_pass))
+ throw new TConfigurationException("You need to specify the Password attribute.");
+
+ $this->setDefaultPage("TWsatHome");
+ $this->_startThemeManager();
+ parent::init($config);
+ }
+
+ public function getBasePath()
+ {
+ $basePath = Prado::getPathOfNamespace("System.Wsat.pages");
+ return realpath($basePath);
+ }
+
+ private function _startThemeManager()
+ {
+ $themeManager = new TThemeManager;
+ $themeManager->BasePath = "System.Wsat.themes";
+ $url = Prado::getApplication()->getAssetManager()->publishFilePath(Prado::getPathOfNamespace('System.Wsat'));
+ $themeManager->BaseUrl = "$url/themes";
+
+ $themeManager->init(null);
+ $this->setThemeManager($themeManager);
+ }
+
+ public function getPassword()
+ {
+ return $this->_pass;
+ }
+
+ public function setPassword($_pass)
+ {
+ $this->_pass = $_pass;
+ }
+
+} \ No newline at end of file
diff --git a/framework/Wsat/pages/TWsatGenerateAR.page b/framework/Wsat/pages/TWsatGenerateAR.page
new file mode 100644
index 00000000..926d6b0f
--- /dev/null
+++ b/framework/Wsat/pages/TWsatGenerateAR.page
@@ -0,0 +1,56 @@
+<com:TContent ID="Content">
+ <div style="margin: 10px; font-size: 16px; font-weight: bold">Active Record Classes Generator</div>
+ <div class="green_panel" style="text-align: left; font-size: 14px; margin: 15px 5px">
+ <label>This generator generates an AR class for the specified database table.</label><br/>
+ <label>Fields with <b style="color: red">*</b> are required.</label>
+ <hr/>
+ <div style="font-size: 12px; font-style: italic">
+ <ul>
+ <li>If you want to generate all AR Classes, keep the "Table Name" field as appears by default.</li>
+ <li>"Output Folder" field refers to the directory that the new AR class file should be generated under... where Application refers to the protected folder of your project. You can let this default field value and PRADO will create the proper folders for you.</li>
+ </ul>
+ </div>
+ </div>
+
+ <div style="font-size: 14px">
+ <div class="form_row">
+ <com:TLabel Text="Table Name:" ForControl="table_name" style="margin-right: 24px" />
+ <com:TTextBox ID="table_name" Text="*" CssClass="in_text" />
+ <label style="color: red">*</label>
+ <com:TRequiredFieldValidator ControlToValidate="table_name" Text="Table name cannot be blank." Display="Dynamic" />
+ </div>
+
+ <div class="form_row">
+ <com:TLabel Text="Output Folder:" ForControl="output_folder" style="margin-right: 8px"/>
+ <com:TTextBox ID="output_folder" Text="Application.App_Data.AR_Classes" CssClass="in_text" />
+ <label style="color: red">*</label>
+ <com:TRequiredFieldValidator ControlToValidate="output_folder" Text="Output folder cannot be blank." Display="Dynamic" />
+ </div>
+
+ <div class="form_row">
+ <com:TLabel Text="Class Prefix:" ForControl="class_prefix" style="margin-right: 25px"/>
+ <com:TTextBox ID="class_prefix" Text="AR_" CssClass="in_text" />
+ </div>
+
+ <div class="form_row">
+ <com:TLabel Text="Class Suffix:" ForControl="class_suffix" style="margin-right: 27px"/>
+ <com:TTextBox ID="class_suffix" CssClass="in_text" />
+ </div>
+
+ <div class="form_row">
+ <com:TLabel Text="Build Relations:" ForControl="build_rel"/>
+ <com:TCheckBox ID="build_rel" Checked="true" />
+ </div>
+
+ <com:TPanel ID="feedback_panel" Visible="false" style="width: 400px">
+ <com:TLabel ID="generation_msg" />
+ </com:TPanel>
+
+ <br/>
+ <div style="text-align: center; width: 400px">
+ <com:TButton Text="Preview" OnClick="preview" Visible="false" />
+ <com:TButton Text="Generate" OnClick="generate" />
+ </div>
+ </div>
+
+</com:TContent>
diff --git a/framework/Wsat/pages/TWsatGenerateAR.php b/framework/Wsat/pages/TWsatGenerateAR.php
new file mode 100644
index 00000000..4a3714de
--- /dev/null
+++ b/framework/Wsat/pages/TWsatGenerateAR.php
@@ -0,0 +1,57 @@
+<?php
+
+/**
+ * @author Daniel Sampedro Bello <darthdaniel85@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @since 3.3
+ * @package Wsat.pages
+ */
+Prado::using("System.Wsat.TWsatARGenerator");
+
+class TWsatGenerateAR extends TPage
+{
+
+ public function generate($sender)
+ {
+ if ($this->IsValid)
+ {
+ $tableName = $this->table_name->Text;
+ $outputFolderNs = $this->output_folder->Text;
+ $classPrefix = $this->class_prefix->Text;
+ $classSuffix = $this->class_suffix->Text;
+
+ try
+ {
+ $ar_generator = new TWsatARGenerator();
+ $ar_generator->setOpFile($outputFolderNs);
+ $ar_generator->setClasPrefix($classPrefix);
+ $ar_generator->setClassSufix($classSuffix);
+
+ if ($this->build_rel->Checked)
+ $ar_generator->buildRelations();
+
+ if ($tableName != "*")
+ $ar_generator->generate($tableName);
+ else
+ $ar_generator->generateAll();
+
+ $this->feedback_panel->CssClass = "green_panel";
+ $this->generation_msg->Text = "The code has been generated successfully.";
+ } catch (Exception $ex)
+ {
+ $this->feedback_panel->CssClass = "red_panel";
+ $this->generation_msg->Text = $ex->getMessage();
+ }
+ $this->feedback_panel->Visible = true;
+ }
+ }
+
+ public function preview($sender)
+ {
+// throw new THttpException(500, "Not implemented yet.");
+ }
+
+} \ No newline at end of file
diff --git a/framework/Wsat/pages/TWsatHome.page b/framework/Wsat/pages/TWsatHome.page
new file mode 100644
index 00000000..e8796ccd
--- /dev/null
+++ b/framework/Wsat/pages/TWsatHome.page
@@ -0,0 +1,17 @@
+<com:TContent ID="Content">
+ <label style="font-size: 18px; font-weight: bold">Welcome to the Web Site Administration Tool</label>
+
+ <div style="margin-top: 25px"><b>Application Dir:</b> <%= Prado::getPathOfNamespace('Application') %></div>
+
+ <br/>
+ <table>
+ <tr style="background-color: #cccccc">
+ <td style="padding: 5px; width: 100px">
+ <com:THyperLink NavigateUrl="<%= $this->Service->constructUrl('TWsatGenerateAR') %>" Text="AR Classes" />
+ </td>
+ <td style="padding: 5px">
+ Enables you to generate all Active Record Classes with relations included.
+ </td>
+ </tr>
+ </table>
+</com:TContent>
diff --git a/framework/Wsat/pages/TWsatHome.php b/framework/Wsat/pages/TWsatHome.php
new file mode 100644
index 00000000..b4beb07c
--- /dev/null
+++ b/framework/Wsat/pages/TWsatHome.php
@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * @author Daniel Sampedro Bello <darthdaniel85@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @since 3.3
+ * @package Wsat.pages
+ */
+Prado::using("System.Wsat.TWsatARGenerator");
+
+class TWsatHome extends TPage
+{
+
+} \ No newline at end of file
diff --git a/framework/Wsat/pages/TWsatLogin.page b/framework/Wsat/pages/TWsatLogin.page
new file mode 100644
index 00000000..79578f59
--- /dev/null
+++ b/framework/Wsat/pages/TWsatLogin.page
@@ -0,0 +1,45 @@
+<%@ MasterClass="" %>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <com:THead Title="PRADO - WSAT">
+ <com:TMetaTag HttpEquiv="Content-Type" Content="text/html; charset=utf-8" />
+ <com:TMetaTag HttpEquiv="Content-Language" Content="en" />
+ </com:THead>
+
+ <body>
+ <com:TForm>
+
+ <div id="header">
+ <a href="<%= $this->Service->DefaultPageUrl %>">
+ <div class="logo"></div>
+ <div style="float: left; margin-top: 17px">PRADO <br /> Web Site Administration Tool</div>
+ </a>
+ <div class="mantisbg"></div>
+ <div style="clear: both"></div>
+ </div>
+
+ <div class="mainmenu">
+ <div style="float: right"><com:THyperLink NavigateUrl="http://www.pradosoft.com/" Text="PradoSoft.com" Target="_blank" />&nbsp;|&nbsp;</div>
+ <div style="float: right"><com:THyperLink NavigateUrl="<%= $this->Service->DefaultPageUrl %>" Text="Web App" Target="_blank" />&nbsp;|&nbsp;</div>
+ <div style="float: right"><com:THyperLink NavigateUrl="http://www.pradosoft.com/forum/" Text="Help" Target="_blank" />&nbsp;|&nbsp;</div>
+ <div style="clear: both"></div>
+ </div>
+
+ <div class="login_form">
+ <com:TLabel Text="Please enter your password:" ForControl="password"/><br/>
+ <com:TTextBox ID="password" TextMode="Password" style="margin: 5px" /><br/>
+ <com:TRequiredFieldValidator ControlToValidate="password" ValidationGroup="loginGroup" Text="Password cannot be blank." Display="Dynamic" /><br/>
+ <com:TCustomValidator ControlToValidate="password" ValidationGroup="loginGroup" OnServerValidate="validatePassword" Text="Incorrect password." Display="Dynamic" />
+
+ <div><com:TButton Text="Enter" ValidationGroup="loginGroup" OnClick="login" /></div>
+ </div>
+
+ <div id="footer">
+ Copyright &copy; 2005-<%= date('Y') %> <a href="http://www.pradosoft.com">PradoSoft</a>.
+ <br/><br/>
+ <%= Prado::poweredByPrado() %>
+ </div>
+ </com:TForm>
+ </body>
+</html>
diff --git a/framework/Wsat/pages/TWsatLogin.php b/framework/Wsat/pages/TWsatLogin.php
new file mode 100644
index 00000000..051937d7
--- /dev/null
+++ b/framework/Wsat/pages/TWsatLogin.php
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * @author Daniel Sampedro Bello <darthdaniel85@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @since 3.3
+ * @package Wsat.pages
+ */
+class TWsatLogin extends TPage
+{
+
+ public function login()
+ {
+ if ($this->IsValid)
+ {
+ $this->Session["wsat_password"] = $this->getService()->getPassword();
+
+ $url = $this->Service->constructUrl('TWsatHome');
+ $this->Response->redirect($url);
+ }
+ }
+
+ public function validatePassword($sender, $param)
+ {
+ $config_pass = $this->Service->Password;
+ $user_pass = $this->password->Text;
+ $param->IsValid = $user_pass === $config_pass;
+ }
+
+} \ No newline at end of file
diff --git a/framework/Wsat/pages/TWsatScaffolding.page b/framework/Wsat/pages/TWsatScaffolding.page
new file mode 100644
index 00000000..42f78d09
--- /dev/null
+++ b/framework/Wsat/pages/TWsatScaffolding.page
@@ -0,0 +1,3 @@
+<com:TContent ID="Content">
+ Scaffolding will be avaliable in Prado 3.4
+</com:TContent>
diff --git a/framework/Wsat/pages/TWsatScaffolding.php b/framework/Wsat/pages/TWsatScaffolding.php
new file mode 100644
index 00000000..fe691dd9
--- /dev/null
+++ b/framework/Wsat/pages/TWsatScaffolding.php
@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * @author Daniel Sampedro Bello <darthdaniel85@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @since 3.3
+ * @package Wsat.pages
+ */
+Prado::using("System.Wsat.TWsatARGenerator");
+
+class TWsatScaffolding extends TPage
+{
+
+} \ No newline at end of file
diff --git a/framework/Wsat/pages/config.xml b/framework/Wsat/pages/config.xml
new file mode 100644
index 00000000..727e8eab
--- /dev/null
+++ b/framework/Wsat/pages/config.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration>
+ <modules>
+ <module id="session" class="THttpSession" CookieMode="Allow" UseCustomStorage="false"
+ AutoStart="true" GCProbability="1" UseTransparentSessionID="true" TimeOut="3600" />
+ </modules>
+ <pages Theme="PradoSoft" MasterClass="System.Wsat.pages.layout.TWsatLayout" />
+</configuration> \ No newline at end of file
diff --git a/framework/Wsat/pages/layout/TWsatLayout.php b/framework/Wsat/pages/layout/TWsatLayout.php
new file mode 100644
index 00000000..67caa77d
--- /dev/null
+++ b/framework/Wsat/pages/layout/TWsatLayout.php
@@ -0,0 +1,36 @@
+<?php
+
+/**
+ * Description of MainLayout
+ *
+ * @author daniels
+ */
+class TWsatLayout extends TTemplateControl
+{
+
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ $this->validateSecurity();
+ }
+
+ private function validateSecurity()
+ {
+ if ($this->Session["wsat_password"] !== $this->getService()->getPassword())
+ {
+ if (!$this->getPage() instanceof TWsatLogin)
+ {
+ $url = $this->Service->constructUrl('TWsatLogin');
+ $this->Response->redirect($url);
+ }
+ }
+ }
+
+ public function logout()
+ {
+ $this->Session["wsat_password"] = "";
+ $url = $this->Service->constructUrl('TWsatLogin');
+ $this->Response->redirect($url);
+ }
+
+} \ No newline at end of file
diff --git a/framework/Wsat/pages/layout/TWsatLayout.tpl b/framework/Wsat/pages/layout/TWsatLayout.tpl
new file mode 100644
index 00000000..d91ff333
--- /dev/null
+++ b/framework/Wsat/pages/layout/TWsatLayout.tpl
@@ -0,0 +1,53 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <com:THead Title="PRADO - WSAT">
+ <com:TMetaTag HttpEquiv="Content-Type" Content="text/html; charset=utf-8" />
+ <com:TMetaTag HttpEquiv="Content-Language" Content="en" />
+ </com:THead>
+
+ <body>
+ <com:TForm>
+
+ <div id="header">
+ <a href="<%= $this->Service->DefaultPageUrl %>">
+ <div class="logo"></div>
+ <div style="float: left; margin-top: 17px">PRADO <br /> Web Site Administration Tool</div>
+ </a>
+ <div class="mantisbg"></div>
+ <div style="clear: both"></div>
+ </div>
+
+ <div class="mainmenu">
+ <div style="float: right"><com:TLinkButton Text="Logout" OnClick="logout" /></div>
+ <div style="float: right"><com:THyperLink NavigateUrl="http://www.pradosoft.com/" Text="PradoSoft.com" Target="_blank" />&nbsp;|&nbsp;</div>
+ <div style="float: right"><com:THyperLink NavigateUrl="<%= $this->Service->DefaultPageUrl %>" Text="Web App" Target="_blank" />&nbsp;|&nbsp;</div>
+ <div style="float: right"><com:THyperLink NavigateUrl="http://www.pradosoft.com/forum/" Text="Help" Target="_blank" />&nbsp;|&nbsp;</div>
+ <div style="clear: both"></div>
+ </div>
+
+ <div id="central_div">
+ <div id="toc">
+ <div class="topic">
+ <div>Code Generation</div>
+ <ul>
+ <li><com:THyperLink NavigateUrl="<%= $this->Service->constructUrl('TWsatGenerateAR') %>" Text="AR Classes" /></li>
+ <li><com:THyperLink NavigateUrl="<%= $this->Service->constructUrl('TWsatScaffolding') %>" Text="Scaffolding" /></li>
+ </ul>
+ </div>
+ </div>
+
+ <div id="content">
+ <com:TContentPlaceHolder ID="Content" />
+ </div>
+
+ <div style="clear: both"></div>
+ </div>
+
+ <div id="footer">
+ Copyright &copy; 2005-<%= date('Y') %> <a href="http://www.pradosoft.com">PradoSoft</a>.
+ <br/><br/>
+ <%= Prado::poweredByPrado() %>
+ </div>
+ </com:TForm>
+ </body>
+</html> \ No newline at end of file
diff --git a/framework/Wsat/themes/.htaccess b/framework/Wsat/themes/.htaccess
new file mode 100644
index 00000000..f7661d04
--- /dev/null
+++ b/framework/Wsat/themes/.htaccess
@@ -0,0 +1 @@
+allow from all
diff --git a/framework/Wsat/themes/PradoSoft/imgs/arrowdown.gif b/framework/Wsat/themes/PradoSoft/imgs/arrowdown.gif
new file mode 100644
index 00000000..1b508cd6
--- /dev/null
+++ b/framework/Wsat/themes/PradoSoft/imgs/arrowdown.gif
Binary files differ
diff --git a/framework/Wsat/themes/PradoSoft/imgs/mantisbg.jpg b/framework/Wsat/themes/PradoSoft/imgs/mantisbg.jpg
new file mode 100644
index 00000000..ee06998d
--- /dev/null
+++ b/framework/Wsat/themes/PradoSoft/imgs/mantisbg.jpg
Binary files differ
diff --git a/framework/Wsat/themes/PradoSoft/imgs/pradologo.gif b/framework/Wsat/themes/PradoSoft/imgs/pradologo.gif
new file mode 100644
index 00000000..3b073b80
--- /dev/null
+++ b/framework/Wsat/themes/PradoSoft/imgs/pradologo.gif
Binary files differ
diff --git a/framework/Wsat/themes/PradoSoft/main.css b/framework/Wsat/themes/PradoSoft/main.css
new file mode 100644
index 00000000..9970c88b
--- /dev/null
+++ b/framework/Wsat/themes/PradoSoft/main.css
@@ -0,0 +1,152 @@
+html, body{
+ margin: 0px;
+ padding: 0px;
+ font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Helvetica, Arial, sans-serif;
+ font-weight: normal;
+}
+
+#header {
+ font-size:25px;
+ font-weight:bold;
+ color: #666;
+}
+
+.logo{
+ width: 204px;
+ height:100px;
+ background-image: url('imgs/pradologo.gif');
+ background-repeat: no-repeat;
+ float: left;
+}
+
+.mantisbg{
+ width: 221px;
+ height: 100px;
+ background-image: url('imgs/mantisbg.jpg');
+ background-repeat: no-repeat;
+ float: right;
+}
+
+.mainmenu {
+ padding:10px;
+ padding-right:10px;
+ background:#EDEDED;
+ border-bottom: 1px solid #A6A6A6;
+ border-top: 1px solid #DCDCDC;
+ color:white;
+ text-align:right;
+ font-size: 10pt;
+}
+
+.mainmenu a {
+ color:#737373;
+ text-decoration:none;
+}
+
+.mainmenu a:hover {
+ color: #FF0000;
+}
+
+#toc {
+ background-color: #F3F3F3;
+ width:220px;
+ padding:0px 10px 0px 10px;
+ float: left;
+}
+
+#content {
+ padding: 1em 1em 1em 1em;
+ line-height: 135%;
+ float: left;
+ width: 700px;
+}
+
+.topic {
+ font-size: 9pt;
+ padding: 0px 0px 0px 0px;
+}
+
+.topic div {
+ background-image: url('imgs/arrowdown.gif');
+ background-repeat: no-repeat;
+ background-position: left center;
+ margin: 0px;
+ font-size: 8pt;
+ font-weight:bold;
+ color:#2A480A;
+ padding: 5px;
+ padding-left: 15px;
+ border-top: 1px solid #fff;
+ border-bottom: 1px solid #E2E2E2;
+}
+
+.topic ul
+{
+ margin: 0px;
+ padding: 0px;
+}
+
+.topic ul li
+{
+ list-style: none;
+ margin: 0px;
+ padding: 5px;
+ padding-left: 15px;
+ border-bottom: 1px dotted #D8D8D8;
+}
+
+.topic a {
+ color:#4F811A;
+ font-size: 8pt;
+ text-decoration: none;
+}
+
+.topic a:hover {
+ color:#2A480A;
+}
+
+/* form styles */
+.form_row{
+ margin: 10px;
+}
+
+.in_text{
+ width: 250px;
+}
+
+.login_form{
+ text-align: center;
+ margin: 30px auto;
+ border: 1px solid red;
+ border-radius: 5px;
+ padding: 10px;
+ width: 250px;
+ font-size: 11px;
+}
+
+.green_panel{
+ background-color: #C5FBBD;
+ border: 1px solid #76C376;
+ padding: 10px;
+ margin: 10px 0;
+ border-radius: 5px;
+ text-align: center;
+}
+
+.red_panel{
+ background-color: #ff6666;
+ border: 1px solid red;
+ padding: 10px;
+ margin: 10px 0;
+ border-radius: 5px;
+ text-align: center;
+}
+
+#footer {
+ clear:both;
+ color: gray;
+ font-size:8pt;
+ text-align:center;
+ margin-top:25px;
+ padding:10px;
+} \ No newline at end of file
diff --git a/framework/Xml/TXmlDocument.php b/framework/Xml/TXmlDocument.php
index b0252ae8..69017660 100644
--- a/framework/Xml/TXmlDocument.php
+++ b/framework/Xml/TXmlDocument.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TXmlDocument.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Xml
*/
@@ -22,7 +21,6 @@
* TBD: xpath
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TXmlDocument.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Xml
* @since 3.0
*/
@@ -300,7 +298,6 @@ class TXmlElement extends TComponent
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TXmlDocument.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Xml
* @since 3.0
*/
@@ -478,7 +475,7 @@ class TXmlDocument extends TXmlElement
* @param DOMXmlNode the node to be converted
* @return TXmlElement the converted TXmlElement
*/
- private function buildElement($node)
+ protected function buildElement($node)
{
$element=new TXmlElement($node->tagName);
$element->setValue($node->nodeValue);
@@ -502,7 +499,6 @@ class TXmlDocument extends TXmlElement
* You may manipulate the collection with the operations defined in {@link TList}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TXmlDocument.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Xml
* @since 3.0
*/
diff --git a/framework/interfaces.php b/framework/interfaces.php
index d05123ba..1c2bbc19 100644
--- a/framework/interfaces.php
+++ b/framework/interfaces.php
@@ -4,9 +4,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
*/
@@ -16,7 +15,6 @@
* This interface must be implemented by application modules.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
@@ -43,7 +41,6 @@ interface IModule
* This interface must be implemented by services.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
@@ -82,7 +79,6 @@ interface IService
* This interface must be implemented by writers.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
@@ -106,7 +102,6 @@ interface ITextWriter
* This interface must be implemented by user objects.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
@@ -159,7 +154,6 @@ interface IUser
* {@link TPageStatePersister}, {@link TApplicationStatePersister}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
@@ -184,7 +178,6 @@ interface IStatePersister
* This interface must be implemented by cache managers.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
@@ -240,7 +233,6 @@ interface ICache
* Classes implementing this interface must support serialization and unserialization.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
@@ -259,7 +251,6 @@ interface ICacheDependency
* to end-users.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
@@ -278,7 +269,6 @@ interface IRenderable
* This interface must be implemented by classes that are capable of performing databinding.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
@@ -296,7 +286,6 @@ interface IBindable
* This interface should be implemented by classes that support CSS styles.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.1.0
*/
@@ -322,7 +311,6 @@ interface IStyleable
* Active controls must implement IActiveControl interface.
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.1
*/
@@ -341,7 +329,6 @@ interface IActiveControl
* interface.
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.1
*/
@@ -363,7 +350,6 @@ interface ICallbackEventHandler
* this interface must be implemented.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.1
*/
diff --git a/framework/prado.php b/framework/prado.php
index 0bb11789..1dd4bb47 100644
--- a/framework/prado.php
+++ b/framework/prado.php
@@ -12,9 +12,8 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2013 PradoSoft
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: prado.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
*/
@@ -32,7 +31,6 @@ if(!class_exists('Prado',false))
* Prado class.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: prado.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
diff --git a/framework/pradolite.php b/framework/pradolite.php
index d9627d13..fcf73364 100644
--- a/framework/pradolite.php
+++ b/framework/pradolite.php
@@ -1,7 +1,7 @@
<?php
/**
* File Name: pradolite.php
- * Last Update: 2013/11/26 10:04:34
+ * Last Update: 2014/02/02 21:38:53
* Generated By: buildscripts/phpbuilder/build.php
*
* This file is used in lieu of prado.php to boost PRADO application performance.
@@ -81,14 +81,6 @@ class PradoBase
{
return PRADO_DIR;
}
- public static function serialize($data)
- {
- return serialize($data);
- }
- public static function unserialize($str)
- {
- return unserialize($str);
- }
public static function createComponent($type)
{
if(!isset(self::$classExists[$type]))
@@ -1248,7 +1240,7 @@ class TTextWriter extends TComponent implements ITextWriter
$this->write($str."\n");
}
}
-class TPriorityList extends TList
+class TPriorityList extends TList
{
private $_d=array();
private $_o=false;
@@ -1483,7 +1475,7 @@ class TPriorityList extends TList
foreach($this->_d as $priority=>$items) {
if(($index=array_search($item,$items,true))!==false) {
$absindex+=$index;
- return $withindex?array($priority,$index,$absindex,
+ return $withindex?array($priority,$index,$absindex,
'priority'=>$priority,'index'=>$index,'absindex'=>$absindex):$priority;
} else
$absindex+=count($items);
@@ -1500,7 +1492,7 @@ class TPriorityList extends TList
if($index>=($c=count($items)))
$index-=$c;
else
- return $withindex?array($priority,$index,$absindex,
+ return $withindex?array($priority,$index,$absindex,
'priority'=>$priority,'index'=>$index,'absindex'=>$absindex):$priority;
}
return false;
@@ -2799,6 +2791,13 @@ class TJavaScript
else
return '';
}
+ public static function renderScriptBlocksCallback($scripts)
+ {
+ if(count($scripts))
+ return implode("\n",$scripts)."\n";
+ else
+ return '';
+ }
public static function renderScriptBlock($script)
{
return "<script type=\"text/javascript\">\n/*<![CDATA[*/\n{$script}\n/*]]>*/\n</script>\n";
@@ -3129,7 +3128,7 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar
if($this->getEnableCache())
{
$cache = $this->getApplication()->getCache();
- if($cache !== null)
+ if($cache !== null)
{
$dependencies = null;
if($this->getApplication()->getMode() !== TApplicationMode::Performance)
@@ -5191,15 +5190,9 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable
$control->evaluateDynamicContent();
}
}
- $this->addToPostDataLoader();
}
$this->_stage=self::CS_PRERENDERED;
}
- protected function addToPostDataLoader()
- {
- if($this instanceof IPostBackDataHandler)
- $this->getPage()->registerPostDataLoader($this);
- }
protected function unloadRecursive()
{
if(!($this->_flags & self::IS_ID_SET))
@@ -6385,7 +6378,7 @@ class TWebControlDecorator extends TComponent {
$this->_posttagtemplate = $value;
}
public function instantiate($outercontrol = null) {
- if($this->getPreTagTemplate() || $this->getPreContentsTemplate() ||
+ if($this->getPreTagTemplate() || $this->getPreContentsTemplate() ||
$this->getPostContentsTemplate() || $this->getPostTagTemplate()) {
$this->_outercontrol = $outercontrol;
if($this->getUseState())
@@ -6684,7 +6677,7 @@ class TWebControl extends TControl implements IStyleable
$decorator->renderPostContentsText($writer);
$writer->renderEndTag();
$decorator->renderPostTagText($writer);
- } else
+ } else
$writer->renderEndTag($writer);
}
}
@@ -7050,8 +7043,6 @@ class TClientScriptManager extends TApplicationComponent
$optionString=TJavaScript::encode($options);
$code="new {$class}({$optionString});";
$this->_endScripts[sprintf('%08X', crc32($code))]=$code;
- $this->_hiddenFields[TPage::FIELD_POSTBACK_TARGET]='';
- $this->_hiddenFields[TPage::FIELD_POSTBACK_PARAMETER]='';
$this->registerPradoScriptInternal('prado');
$params=func_get_args();
$this->_page->registerCachingAction('Page.ClientScript','registerPostBackControl',$params);
@@ -7069,7 +7060,6 @@ class TClientScriptManager extends TApplicationComponent
$options = TJavaScript::encode($this->getDefaultButtonOptions($panelID, $buttonID));
$code = "new Prado.WebUI.DefaultButton($options);";
$this->_endScripts['prado:'.$panelID]=$code;
- $this->_hiddenFields[TPage::FIELD_POSTBACK_TARGET]='';
$this->registerPradoScriptInternal('prado');
$params=array($panelID,$buttonID);
$this->_page->registerCachingAction('Page.ClientScript','registerDefaultButton',$params);
@@ -7085,11 +7075,10 @@ class TClientScriptManager extends TApplicationComponent
}
public function registerFocusControl($target)
{
- $this->registerPradoScriptInternal('effects');
+ $this->registerPradoScriptInternal('jquery');
if($target instanceof TControl)
$target=$target->getClientID();
- $id = TJavaScript::quoteString($target);
- $this->_endScripts['prado:focus'] = 'new Effect.ScrollTo('.$id.'); Prado.Element.focus('.$id.');';
+ $this->_endScripts['prado:focus'] = 'new Prado.Element.scrollTo(\''.$target.'\'); jQuery(\'#'.$target.'\').focus();';
$params=func_get_args();
$this->_page->registerCachingAction('Page.ClientScript','registerFocusControl',$params);
}
@@ -7271,6 +7260,14 @@ class TClientScriptManager extends TApplicationComponent
{
$writer->write(TJavaScript::renderScriptBlocks($this->_endScripts));
}
+ public function renderBeginScriptsCallback($writer)
+ {
+ $writer->write(TJavaScript::renderScriptBlocksCallback($this->_beginScripts));
+ }
+ public function renderEndScriptsCallback($writer)
+ {
+ $writer->write(TJavaScript::renderScriptBlocksCallback($this->_endScripts));
+ }
public function renderHiddenFieldsBegin($writer)
{
$this->renderHiddenFieldsInt($writer,true);
@@ -7281,8 +7278,11 @@ class TClientScriptManager extends TApplicationComponent
}
public function flushScriptFiles($writer, $control=null)
{
- $this->_page->ensureRenderInForm($control);
- $this->renderAllPendingScriptFiles($writer);
+ if(!$this->_page->getIsCallback())
+ {
+ $this->_page->ensureRenderInForm($control);
+ $this->renderAllPendingScriptFiles($writer);
+ }
}
protected function renderHiddenFieldsInt($writer, $initial)
{
@@ -7306,7 +7306,7 @@ class TClientScriptManager extends TApplicationComponent
if($str!=='')
$writer->write("<div style=\"visibility:hidden;\">\n".$str."</div>\n");
}
- public function getHiddenFields()
+ public function getHiddenFields()
{
return $this->_hiddenFields;
}
@@ -7389,7 +7389,6 @@ class TPage extends TTemplateControl
private $_statePersister;
private $_cachingStack;
private $_clientState='';
- protected $_postDataLoaders=array();
protected $_isLoadingPostData=false;
private $_enableJavaScript=true;
private $_writer;
@@ -7465,6 +7464,9 @@ class TPage extends TTemplateControl
{
Prado::using('System.Web.UI.ActiveControls.TActivePageAdapter');
$this->setAdapter(new TActivePageAdapter($this));
+ $callbackEventParameter = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER);
+ if(strlen($callbackEventParameter) > 0)
+ $this->_postData[TPage::FIELD_CALLBACK_PARAMETER]=TJavaScript::jsonDecode((string)$callbackEventParameter);
if (($g=$this->getApplication()->getGlobalization(false))!==null &&
strtoupper($enc=$g->getCharset())!='UTF-8')
foreach ($this->_postData as $k=>$v)
@@ -7515,15 +7517,6 @@ class TPage extends TTemplateControl
{
$this->getAdapter()->setCallbackEventParameter($value);
}
- public function registerPostDataLoader($control)
- {
- $id=is_string($control)?$control:$control->getUniqueID();
- $this->_postDataLoaders[$id] = true;
- }
- public function getPostDataLoaders()
- {
- return array_keys($this->_postDataLoaders);
- }
public function getForm()
{
return $this->_form;
@@ -7721,7 +7714,6 @@ class TPage extends TTemplateControl
{
$id=is_string($control)?$control:$control->getUniqueID();
$this->_controlsRegisteredForPostData[$id]=true;
- $this->registerPostDataLoader($id);
$params=func_get_args();
foreach($this->getCachingStack() as $item)
$item->registerAction('Page','registerRequiresPostData',array($id));
@@ -7978,9 +7970,9 @@ class TPageStateFormatter
{
$sm=$page->getApplication()->getSecurityManager();
if($page->getEnableStateValidation())
- $str=$sm->hashData(Prado::serialize($data));
+ $str=$sm->hashData(serialize($data));
else
- $str=Prado::serialize($data);
+ $str=serialize($data);
if($page->getEnableStateCompression() && extension_loaded('zlib'))
$str=gzcompress($str);
if($page->getEnableStateEncryption())
@@ -8002,10 +7994,10 @@ class TPageStateFormatter
if($page->getEnableStateValidation())
{
if(($str=$sm->validateData($str))!==false)
- return Prado::unserialize($str);
+ return unserialize($str);
}
else
- return Prado::unserialize($str);
+ return unserialize($str);
}
return null;
}
@@ -9672,7 +9664,7 @@ class TPageConfiguration extends TComponent
$this->loadFromPhp($fcontent,dirname($fname),$configPagePath);
}
else
- {
+ {
$dom=new TXmlDocument;
if($dom->loadFromFile($fname))
$this->loadFromXml($dom,dirname($fname),$configPagePath);
@@ -9759,7 +9751,7 @@ class TPageConfiguration extends TComponent
if(isset($page['properties']))
{
$properties=$page['properties'];
- unset($page['properties']);
+ unset($page['properties']);
}
$matching=false;
$id=($configPagePath==='')?$id:$configPagePath.'.'.$id;
@@ -10173,7 +10165,7 @@ class TApplication extends TComponent
const STATE_PERFORMANCE='Performance';
const PAGE_SERVICE_ID='page';
const CONFIG_FILE_XML='application.xml';
- const CONFIG_FILE_EXT_XML='.xml';
+ const CONFIG_FILE_EXT_XML='.xml';
const CONFIG_TYPE_XML = 'xml';
const CONFIG_FILE_PHP='application.php';
const CONFIG_FILE_EXT_PHP='.php';
@@ -10674,10 +10666,10 @@ class TApplication extends TComponent
$config=new TApplicationConfiguration;
$config->loadFromFile($this->_configFile);
if($this->_cacheFile!==null)
- file_put_contents($this->_cacheFile,Prado::serialize($config),LOCK_EX);
+ file_put_contents($this->_cacheFile,serialize($config),LOCK_EX);
}
else
- $config=Prado::unserialize(file_get_contents($this->_cacheFile));
+ $config=unserialize(file_get_contents($this->_cacheFile));
$this->applyConfiguration($config,false);
}
if(($serviceID=$this->getRequest()->resolveRequest(array_keys($this->_services)))===null)
@@ -10822,7 +10814,7 @@ class TApplicationConfiguration extends TComponent
$this->_properties[$name]=$value;
}
$this->_empty = false;
- }
+ }
if(isset($config['paths']) && is_array($config['paths']))
$this->loadPathsPhp($config['paths'],$configPath);
if(isset($config['modules']) && is_array($config['modules']))
@@ -10946,7 +10938,7 @@ class TApplicationConfiguration extends TComponent
$properties['id'] = $id;
$this->_modules[$id]=array($type,$properties,$module);
$this->_empty=false;
- }
+ }
}
protected function loadModulesXml($modulesNode,$configPath)
{
@@ -10982,7 +10974,7 @@ class TApplicationConfiguration extends TComponent
$properties['id'] = $id;
$this->_services[$id] = array($type,$properties,$service);
$this->_empty = false;
- }
+ }
}
protected function loadServicesXml($servicesNode,$configPath)
{
@@ -11118,18 +11110,18 @@ class TApplicationStatePersister extends TModule implements IStatePersister
public function load()
{
if(($cache=$this->getApplication()->getCache())!==null && ($value=$cache->get(self::CACHE_NAME))!==false)
- return Prado::unserialize($value);
+ return unserialize($value);
else
{
if(($content=@file_get_contents($this->getStateFilePath()))!==false)
- return Prado::unserialize($content);
+ return unserialize($content);
else
return null;
}
}
public function save($state)
{
- $content=Prado::serialize($state);
+ $content=serialize($state);
$saveFile=true;
if(($cache=$this->getApplication()->getCache())!==null)
{
diff --git a/index.html b/index.html
index 37a2a60d..4fb55fcf 100644
--- a/index.html
+++ b/index.html
@@ -9,7 +9,7 @@
<body>
<h1>PRADO Framework for PHP 5 </h1>
<p>Version 3.2.3<br>
-Copyright&copy; 2004-2013 by <a href="http://www.pradosoft.com/">Prado Software</a><br>
+Copyright&copy; 2004-2014 by <a href="http://www.pradosoft.com/">Prado Software</a><br>
All Rights Reserved.
</p>
@@ -152,7 +152,7 @@ The PRADO framework and the included demos are free software. They are released
the terms of the following BSD License.
</p>
<p>
-Copyright 2004-2013 by The PRADO Group (http://www.pradosoft.com)<br/>
+Copyright 2004-2014 by The PRADO Group (http://www.pradosoft.com)<br/>
All rights reserved.
</p>
<p>
diff --git a/jQuery-WIP.txt b/jQuery-WIP.txt
new file mode 100644
index 00000000..7e7a5056
--- /dev/null
+++ b/jQuery-WIP.txt
@@ -0,0 +1,34 @@
+Targets:
+
+ * Import jQuery as a prado js package (done)
+ * Basic class/inheritance support to replace prototype's Class.create (done, using lowpro)
+ * Glue prado PostBack/PostbackControl/Registry to jQuery (done)
+ * port standard controls (done)
+ * port features (defaultbutton, validators) (done)
+ * port Prado.Element's functions (replace, setStyle, ..) (done)
+ * port Effects (done)
+ * port basic active controls (done)
+ * create substitutes for exotic standard controls (date picker, accordion, colorpicker, slider, ..) (done)
+ * port exotic active controls (done)
+ * get tests running (wip)
+ * ensure jQuery's compatibility mode with prototype (support old third party components from users? (done)
+ * fix debug components (TJavascriptLogger) (done, but maybe dropping it is a good idea)
+ * implement some Jui components (deprecate old scriptculous, create substituted based on jquery-ui) (wip)
+ * port demos using javascript
+ * add demos for new controls (wip)
+ * document everything (wip)
+
+DONE
+Basic postback controls (TButton, TCheckBox, TLinkButton, TRadioButton, TTextBox, ..)
+Js-based controls (TTabPanel, TDatePicker, TColorPicker, TSlider, THtmlArea, TAccordion, TRatingList)
+List, Data controls
+*Validators
+Ajax queue
+Basic callback controls (TActive*, TInPlaceTextBox)
+jQuery-UI interactions
+
+WIP
+TJuiAutoComplete
+Add JQuery-ui-Effects: clip, explode, transfer, switchclass
+Add JQuery-ui-Methods: show, hide, toggle?
+Add JQuery-ui-controls
diff --git a/requirements/index.php b/requirements/index.php
index b5b6dc82..2fd392ba 100644
--- a/requirements/index.php
+++ b/requirements/index.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: index.php 3281 2013-03-13 21:01:40Z ctrlaltca $
* @package prado
*/
@@ -291,5 +290,3 @@ function getPradoVersion()
}
return '';
}
-
-?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveBricksTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveBricksTest.page
index 7cb8c6b3..f3df76a2 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveBricksTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveBricksTest.page
@@ -1,4 +1,4 @@
-<com:TForm>
+<com:TContent ID="Content">
<h3 class="ContentAlternating">Some AJAX Tests</h3>
<com:TPanel CssClass="Content">
@@ -37,6 +37,4 @@
AIP
</com:TActivePanel>
- <com:TJavascriptLogger />
-
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page
index 2e192c19..9e293934 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page
@@ -1,4 +1,4 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveButton Functional Test</h1>
<com:TActiveButton ID="button2" Text="Button 1"
@@ -6,6 +6,4 @@
<com:TActiveLabel ID="label1" Text="Label 1" />
- <com:TJavascriptLogger />
-
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page
index 431d42f2..297cde15 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page
@@ -1,4 +1,4 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>Active CheckBox Test</h1>
<com:TActiveCheckBox ID="checkbox1" Text="CheckBox 1" OnCallback="checkbox_requested" />
<com:TActiveCheckBox ID="checkbox2" Text="CheckBox 2" OnCallback="checkbox_requested">
@@ -25,5 +25,4 @@
position: absolute; right: 0; top: 0">
Loading...
</div>
- <com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveControlExpressionTag.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveControlExpressionTag.page
index 7b983cd7..5a1c5023 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveControlExpressionTag.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveControlExpressionTag.page
@@ -1,4 +1,4 @@
-<com:TForm>
+<com:TContent ID="Content">
<h1>Active Control With Expression Tag Test</h1>
@@ -22,6 +22,5 @@
<com:TActiveButton ID="button2" Text="Show More!" Enabled="false"
OnCallback="button2_callback" />
-<com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveControlWithTinyMce.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveControlWithTinyMce.page
index aa3be754..9a561458 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveControlWithTinyMce.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveControlWithTinyMce.page
@@ -1,4 +1,4 @@
-<com:TForm>
+<com:TContent ID="Content">
<h1>Active Control with TinyMCE</h1>
<com:THtmlArea ID="text1" />
@@ -7,5 +7,4 @@
<com:TActiveLabel ID="label1" />
-<com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page
index 88117744..ce40e1cb 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page
@@ -1,15 +1,12 @@
-<html>
-<com:THead/>
-<body>
-<com:TForm>
+<com:TContent ID="Content">
<h1>TActiveDatePicker test</h1>
<p>
-<com:TActiveDatePicker ID="datepicker" DateFormat="MM-dd-yyyy" OnCallback="testDatePicker"/>
<com:TActiveLabel ID="status" /><br/>
<com:TActiveButton ID="decreaseButton" OnClick="decrease" Text="-1" OnCallback="testDatePicker"/>
<com:TActiveButton ID="todayButton" OnClick="today" Text="Today" OnCallback="testDatePicker"/>
<com:TActiveButton ID="increaseButton" OnClick="increase" Text="+1" OnCallback="testDatePicker"/>
<com:TButton ID="toggleButton" OnClick="toggleMode" Text="Toggle input mode (postback)"/>
+<com:TActiveDatePicker ID="datepicker" DateFormat="MM-dd-yyyy" OnCallback="testDatePicker"/>
</p>
<p>
ShowCalendar=false
@@ -23,6 +20,4 @@ ShowCalendar=false
<com:TActiveDatePicker ID="datepicker3" DateFormat="MMMM/yyyy" OnCallback="testDatePicker3" InputMode="DropDownList" ShowCalendar="true"/>
<com:TActiveLabel ID="status3" /><br/>
-</com:TForm>
-</body>
-</html> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveDropDownList.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveDropDownList.page
index dc71a228..bf15ba0e 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveDropDownList.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveDropDownList.page
@@ -1,4 +1,4 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>Active Drop Down List Test Case</h1>
<com:TActiveDropDownList ID="list1" AutoPostBack="true" SelectedIndex="0" OnSelectedIndexChanged="list1_changed">
@@ -26,6 +26,4 @@
<com:TButton ID="button5" Text="Post Back" OnClick="do_postback"/>
</div>
- <com:TJavascriptLogger />
-
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page
index f0fc4b92..317da643 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page
@@ -1,9 +1,9 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>Active HiddenField Test Case</h1>
-
+
<com:TActiveHiddenField ID="HiddenFieldEmpty" />
<com:TActiveHiddenField ID="HiddenFieldUsed" Value="My value" />
-
+
<div>
<com:TActiveButton ID="Button1" Text="Set value to HiddenFieldEmpty" OnClick="onSetValue" />
<com:TActiveButton ID="Button2" Text="Get value from HiddenFieldUsed" OnClick="onGetValue" />
@@ -12,5 +12,4 @@
<div>
<com:TActiveLabel ID="ResponseLabel" Text="Value of current hidden field" />
</div>
- <com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveHyperLinkTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveHyperLinkTest.page
index 59098052..9b149b45 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveHyperLinkTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveHyperLinkTest.page
@@ -1,6 +1,6 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>Active HyperLink Test Case</h1>
-
+
<div style="margin:1em; padding:1em; border:1px solid #ccc; text-align:center;">
<com:TActiveHyperLink ID="link1" Text="Link 1" NavigateUrl="http://www.pradosoft.com" />
</div>
@@ -8,6 +8,4 @@
<com:TActiveButton ID="button2" Text="Change Image" OnClick="change_image" />
<com:TActiveButton ID="button3" Text="Change Target" OnClick="change_target" />
<com:TActiveButton ID="button4" Text="Change URL" OnClick="change_url" />
-
- <com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page
index 7696261a..15cf2380 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page
@@ -1,4 +1,4 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveImageButton Functional Test</h1>
@@ -19,6 +19,4 @@
<com:TActiveButton ID="button3" Text="Change Align" OnClick="change_align" />
<com:TActiveButton ID="button4" Text="Change Description" OnClick="change_description" />
- <com:TJavascriptLogger />
-
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.page
index cb9f0322..16ea578d 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.page
@@ -1,4 +1,4 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveLinkButton Functional Test</h1>
<com:TActiveLinkButton ID="button2" Text="Button 1"
@@ -6,6 +6,4 @@
<com:TActiveLabel ID="label1" Text="Label 1" />
- <com:TJavascriptLogger />
-
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxMasterTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxMasterTest.page
index f7c6baaf..115b833a 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxMasterTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxMasterTest.page
@@ -23,6 +23,4 @@
<com:TActiveButton ID="button6" Text="Change to Multi-Select" OnClick="change_to_multiple" />
<com:TActiveButton ID="button7" Text="Change to Single-Select" OnClick="change_to_single" />
</div>
-
- <com:TJavascriptLogger />
</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.page
index 318d53c3..2bf480b4 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.page
@@ -1,4 +1,4 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>Active List Box Functional Test</h1>
@@ -22,6 +22,4 @@
<com:TActiveButton ID="button6" Text="Change to Multi-Select" OnClick="change_to_multiple" />
<com:TActiveButton ID="button7" Text="Change to Single-Select" OnClick="change_to_single" />
</div>
-
- <com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page
index 7ab4bab9..573c6e8b 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page
@@ -1,4 +1,4 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>Active Panel replacement tests </h1>
<com:TCallback ID="callback1" OnCallback="callback1_requested" />
<com:TActivePanel ID="panel1">
@@ -9,14 +9,11 @@
<div id="div1" style="border:1px solid #666; background-color: #ffe; text-align: center; padding:3em">
Click Me!
</div>
- <script type="text/javascript">
- Event.OnLoad(function()
- {
- Event.observe($("div1"), "click", function()
- {
- Prado.Callback("<%= $this->callback1->UniqueID %>")
- })
- })
- </script>
- <com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+ <com:TClientScript>
+ jQuery( document ).ready(function() {
+ jQuery("#div1").click(function() {
+ Prado.Callback("<%= $this->callback1->UniqueID %>");
+ });
+ });
+ </com:TClientScript>
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelVisibleTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelVisibleTest.page
index 0795e46b..93684bef 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelVisibleTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelVisibleTest.page
@@ -1,4 +1,4 @@
-<com:TForm>
+<com:TContent ID="Content">
<h1>ActivePanel Visible Test</h1>
@@ -12,6 +12,5 @@
<com:TActivePanel ID="pnlB">bar</com:TActivePanel>
-<com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.page
index 26feb594..e222a70f 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.page
@@ -1,4 +1,4 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveRadioButtonList Test Case</h1>
<com:TActiveRadioButtonList ID="list1" OnCallback="list1_callback">
@@ -17,6 +17,4 @@
<com:TActiveButton ID="button4" Text="Select Index 4" OnClick="select_index_4" />
</div>
- <com:TJavascriptLogger />
-
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page
index 2bb4c9de..66587943 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page
@@ -1,4 +1,4 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>Active Radio Button Test</h1>
<com:TActiveRadioButton ID="radio1"
GroupName="group1" Text="Radio Button 1"
@@ -34,5 +34,4 @@
position: absolute; right: 0; top: 0">
Loading...
</div>
- <com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.page
index 35fcadc7..d3c551b4 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.page
@@ -1,5 +1,4 @@
-<com:THead />
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveRatingList AllowInput Test Case</h1>
<com:TActiveRatingList ID="RatingList" AllowInput="false"
OnSelectedIndexChanged="ratingChanged">
@@ -11,4 +10,4 @@
<com:TListItem Text="Super" />
</com:TActiveRatingList>
<com:TActiveLabel ID="Status" Text="AllowInput=false" />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.page
index 84ce4ef3..e0d3cbbe 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.page
@@ -1,5 +1,4 @@
-<com:THead />
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveRatingList AutoPostBack Test Case</h1>
<com:TActiveRatingList ID="RatingList" AutoPostback="false"
OnSelectedIndexChanged="ratingChanged">
@@ -13,4 +12,4 @@
<com:TActiveLabel ID="Status" Text="AutoPostback=false" />
<br />
<com:TActiveButton ID="Submit" Text="Submit" />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.page
index 36f4404d..cba50947 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.page
@@ -1,5 +1,4 @@
-<com:THead />
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveRatingList Check Boxes Test Case</h1>
<com:TActiveRatingList ID="RatingList">
<com:TListItem Text="Poor" />
@@ -9,4 +8,4 @@
<com:TListItem Text="Excellent" />
<com:TListItem Text="Super" />
</com:TActiveRatingList>
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.page
index 5f732e0d..791176df 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.page
@@ -1,5 +1,4 @@
-<com:THead />
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveRatingList Enabled Test Case</h1>
<com:TActiveRatingList ID="RatingList" Enabled="false"
OnSelectedIndexChanged="ratingChanged">
@@ -14,4 +13,4 @@
<br />
<com:TActiveButton ID="Enable" Text="Enable" OnClick="enable" />
<com:TActiveButton ID="Disable" Text="Disable" OnClick="disable" />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.page
index 01e47a34..0a2a5f50 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.page
@@ -1,5 +1,4 @@
-<com:THead />
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveRatingList Hover Caption Test Case</h1>
<com:TActiveRatingList ID="RatingList" CaptionID="Status"
OnSelectedIndexChanged="ratingChanged" Rating="3.5">
@@ -11,4 +10,4 @@
<com:TListItem Text="Super" />
</com:TActiveRatingList>
<com:TActiveLabel ID="Status" Text="CaptionID='Status'" />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.page
index 942a5b45..c9aed5b4 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.page
@@ -1,5 +1,4 @@
-<com:THead />
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveRatingList Rating Test Case</h1>
<com:TActiveRatingList ID="RatingList" Rating="5"
OnSelectedIndexChanged="ratingChanged">
@@ -14,4 +13,4 @@
<br />
<com:TActiveButton ID="SetRating" Text="Set Rating=3"
OnClick="setRating" />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.page
index dad3fd6e..70220e58 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.page
@@ -1,5 +1,4 @@
-<com:THead />
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveRatingList ReadOnly Test Case</h1>
<com:TActiveRatingList ID="RatingList" ReadOnly="true"
OnSelectedIndexChanged="ratingChanged">
@@ -14,4 +13,4 @@
<br />
<com:TActiveButton ID="Writable" Text="Writable" OnClick="writable" />
<com:TActiveButton ID="ReadOnly" Text="ReadOnly" OnClick="readOnly" />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.page
index 6fb52822..ee26568d 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.page
@@ -1,5 +1,4 @@
-<com:THead />
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveRatingList SelectedIndex Test Case</h1>
<com:TActiveRatingList ID="RatingList" SelectedIndex="1"
OnSelectedIndexChanged="ratingChanged">
@@ -14,4 +13,4 @@
<br />
<com:TActiveButton ID="SetSelectedIndex" Text="Set SelectedIndex=5"
OnClick="setSelectedIndex" />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRedirectionTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRedirectionTest.page
index 5f7959c5..8f4e175d 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRedirectionTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRedirectionTest.page
@@ -1,8 +1,7 @@
-<com:TForm>
+<com:TContent ID="Content">
<h1>Redirection Test</h1>
<com:TActiveButton Text="Redirect to Default Page" OnClick="button_clicked" />
-<com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.page
index b05ce62e..50b244b5 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.page
@@ -1,6 +1,5 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>ActiveTextBox Callback Test</h1>
<com:TActiveTextBox ID="textbox1" AutoPostBack="true" OnCallback="textbox1_callback" />
<com:TActiveLabel ID="label1" Text="Label 1" />
- <com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page
index 477764c3..98745b55 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page
@@ -1,4 +1,4 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<style>
.autocomplete
@@ -58,7 +58,7 @@
<li>
&lt;&lt;
<span class="select"><%# $this->Data %></span>
- &gt;&gt;
+ &gt;&gt;
</li>
</prop:Suggestions.ItemTemplate>
</com:TAutoComplete>
@@ -79,7 +79,7 @@
OnSuggest="suggestCountries"
OnCallback="callback_requested"
OnSuggestionSelected="suggestion_selected"
- ResultPanel.CssClass="autocomplete"
+ ResultPanel.CssClass="autocomplete"
MinChars="4" Frequency="2" />
<p><br /></p>
@@ -91,5 +91,4 @@
<p><br /></p>
<p><br /></p>
<p><br /></p>
- <com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/Calculator.page b/tests/FunctionalTests/active-controls/protected/pages/Calculator.page
index 7a565658..e7b1f180 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/Calculator.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/Calculator.page
@@ -1,17 +1,17 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>Callback Enabled Calculator</h1>
-
+
<com:TActiveTextBox id="a" />
+
<com:TActiveTextBox id="b" />
=
<com:TActiveTextBox id="c" />
-
- <com:TActiveButton id="sum"
- onclick="do_sum"
+
+ <com:TActiveButton id="sum"
+ onclick="do_sum"
text="Calculate!" />
-
- <com:TRequiredFieldValidator
+
+ <com:TRequiredFieldValidator
ControlToValidate="a"
ErrorMessage="left summand is required."
ControlCssClass="required"
@@ -27,5 +27,5 @@
ID="summary"
HeaderText="Unable to calculate because" />
</div>
-
-</com:TForm> \ No newline at end of file
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/Callback.page b/tests/FunctionalTests/active-controls/protected/pages/Callback.page
index d8744760..f8489af3 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/Callback.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/Callback.page
@@ -1,15 +1,13 @@
-<com:TForm>
+<com:TContent ID="Content">
<com:TCallback ID="callback1" OnCallback="callback1_Requested" />
- <script type="text/javascript">
+ <script type="text/javascript">
function do_callback1()
- {
+ {
var callback = <%= $this->callback1->ActiveControl->Javascript %>;
callback.dispatch();
- }
- </script>
+ }
+ </script>
<div onclick="do_callback1()">Click Me!</div>
- <com:TJavascriptLogger />
-
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page b/tests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page
index a99fbf55..134e45cb 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page
@@ -1,4 +1,4 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<style>
.loader
{
@@ -37,6 +37,4 @@
<span id="loader" style="display:none;" onfocus="alert('ok')" class="loader">Loading...</span>
- <com:TJavascriptLogger />
-
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/CallbackOptionsTest.page b/tests/FunctionalTests/active-controls/protected/pages/CallbackOptionsTest.page
index 3cecbade..5adc646f 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/CallbackOptionsTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/CallbackOptionsTest.page
@@ -1,27 +1,27 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TCallbackOptions Test</h1>
<com:TCallbackOptions ID="options1">
<prop:ClientSide.OnLoading>
- $("status").show();
+ $("#status").show();
</prop:ClientSide.OnLoading>
<prop:ClientSide.OnComplete>
- $("status").hide();
+ $("#status").hide();
</prop:ClientSide.OnComplete>
<prop:ClientSide.OnSuccess>
- Element.update("label1", "Button 1 has returned");
+ $("#label1").html("Button 1 has returned");
</prop:ClientSide.OnSuccess>
</com:TCallbackOptions>
<com:TActiveButton id="button1" Text="Button 1" ActiveControl.CallbackOptions="options1" />
<com:TActiveButton id="button2" Text="Button 2" ActiveControl.CallbackOptions="options1">
<prop:ClientSide.OnSuccess>
- Element.update("label2", "Button 2 has returned");
+ $("#label2").html("Button 2 has returned");
</prop:ClientSide.OnSuccess>
</com:TActiveButton>
<com:TActiveButton id="button3" Text="Button 3">
<prop:ClientSide.OnSuccess>
- Element.update("label3", "Button 3 has returned");
+ $("#label3").html("Button 3 has returned");
</prop:ClientSide.OnSuccess>
</com:TActiveButton>
@@ -31,4 +31,4 @@
<div id="status" style="display:none; background-color: #c00; color:white; text-align:center; padding: 1em" >
Loading...
</div>
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ClientSideDispatch.page b/tests/FunctionalTests/active-controls/protected/pages/ClientSideDispatch.page
index acf56bfe..3b5ed15f 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ClientSideDispatch.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ClientSideDispatch.page
@@ -1,4 +1,4 @@
-<com:TForm>
+<com:TContent ID="Content">
<com:TCallback ID="callback1" OnCallback="method1" />
@@ -7,21 +7,20 @@
var link1 = Prado.CallbackRequest.getRequestById('<%= $this->link1->ClientID %>');
Prado.Callback('<%= $this->callback1->UniqueID %>', link1.getCallbackParameter());
</prop:ClientSide.OnSuccess>
-
+
</com:TCallbackOptions>
- <com:TActiveLinkButton
+ <com:TActiveLinkButton
ID="link1"
- Text="Tab 1"
- OnCallback="method2"
- ActiveControl.CallbackParameter="test"
+ Text="Tab 1"
+ OnCallback="method2"
+ ActiveControl.CallbackParameter="test"
ActiveControl.CallbackOptions="options1"/>
<com:TActiveLabel ID="status1" />
<com:TActiveLabel ID="status2" />
-<com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page b/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page
index f0f3044d..2dc07852 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page
@@ -1,10 +1,10 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>Control Adapter - State Tracking Tests</h1>
<com:TActiveButton ID="button1" Text="Test Button 1" />
- <com:TActiveButton ID="button2" Text="Test Button 2"
+ <com:TActiveButton ID="button2" Text="Test Button 2"
Attributes.onclick="alert('ok')"
Style.Font.Size="12" Style.BackColor="blue" Style.Height="2em" />
-
+
<div style="margin:1em; padding: 0.5em; border:1px solid #ccc; text-align:center">
<com:TActiveButton ID="test1" Text="Enable/Disable Button 1" OnClick="change_enabled"/>
<com:TActiveButton ID="test2" Text="Hide/Show Button 1" OnClick="change_visible"/>
@@ -19,5 +19,4 @@
<com:TActiveButton ID="test8" Text="Change Button 1 Attributes" OnClick="change_attributes1"/>
<com:TActiveButton ID="test9" Text="Change Button 2 Attributes" OnClick="change_attributes2"/>
</div>
- <com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.page b/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.page
index 3bed7d5b..cd34ff98 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.page
@@ -1,4 +1,4 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>Add Dynamic Custom TTemplateControl Test</h1>
<com:TActivePanel ID="Foo">
@@ -10,7 +10,4 @@
<com:TActivePanel ID="placeholder" />
<com:TActiveLabel ID="label1" Text="Label 1" />
-
-
- <com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page b/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page
index 08b7bb3e..0bebcd59 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page
@@ -1,8 +1,8 @@
-<com:TForm>
+<com:TContent ID="Content">
<h1>Custom Login</h1>
-<a id="showLogin" href="#" onclick="new Effect.Appear('loginBox')">Login</a>
+<a id="showLogin" href="#" onclick="$('#loginBox').fadeIn()">Login</a>
<div id="loginBox" style="display: none;">
<div style="height:1em">
@@ -10,29 +10,28 @@
</div>
<span>Username:</span><br />
<com:TActiveTextBox ID="Username" />
- <com:TRequiredFieldValidator
+ <com:TRequiredFieldValidator
ID="validator1"
- ControlToValidate="Username"
- ValidationGroup="login"
+ ControlToValidate="Username"
+ ValidationGroup="login"
Text="...is required" Display="Dynamic"/>
<br />
<span>Password:</span><br />
<com:TActiveTextBox TextMode="Password" ID="Password" />
- <com:TActiveCustomValidator
- ID="validator2"
- ControlToValidate="Password"
+ <com:TActiveCustomValidator
+ ID="validator2"
+ ControlToValidate="Password"
Text="*"
OnServerValidate="validateUser" ValidationGroup="login" />
<br />
<com:TActiveLinkButton ID="checkLogin" OnCallback="doLogin" Text="Login" ValidationGroup="login" />
- <a href="#" onclick="new Effect.Fade('loginBox')">Close</a>
+ <a href="#" onclick="$('#loginBox').fadeOut()">Close</a>
</div>
-<com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/DatePickerInCallback.page b/tests/FunctionalTests/active-controls/protected/pages/DatePickerInCallback.page
index 8b39dc55..2f51eff2 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/DatePickerInCallback.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/DatePickerInCallback.page
@@ -1,7 +1,7 @@
-<com:TForm>
+<com:TContent ID="Content">
<h1>DatePicker in Callback</h1>
<com:TDatePicker ID="datepicker" />
<com:TActiveLinkButton OnCallback="testDatePicker" Text="testDatePicker" />
<com:TActiveLabel ID="status" />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page b/tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page
index b8fba648..f858e8eb 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page
@@ -1,7 +1,6 @@
-<com:TForm>
+<com:TContent ID="Content">
<h1>Delayed Callback Test</h1>
<com:TActiveButton ID="button1" Text="Delayed 4000" OnCallback="callback1" />
<com:TActiveButton ID="button2" Text="Delayed 2000" OnCallback="callback2" />
<com:TActiveLabel ID="status" />
-<com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/DisplayStyleTest.page b/tests/FunctionalTests/active-controls/protected/pages/DisplayStyleTest.page
index df1db27a..c27ea397 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/DisplayStyleTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/DisplayStyleTest.page
@@ -1,4 +1,4 @@
-<com:TForm>
+<com:TContent ID="Content">
<h1>Display Style Test</h1>
<div>
@@ -17,6 +17,5 @@ here.
<com:TActiveLabel ID="status" />
-<com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/DynamicRepeaterDataTest.page b/tests/FunctionalTests/active-controls/protected/pages/DynamicRepeaterDataTest.page
index 913f6a17..26407827 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/DynamicRepeaterDataTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/DynamicRepeaterDataTest.page
@@ -1,4 +1,4 @@
-<com:TForm>
+<com:TContent ID="Content">
<h1>Dynamic Repeater Data Test</h1>
<com:TActiveButton Text="Click Me!" OnClick="button_clicked" OnCallback="button_callback"/>
@@ -11,6 +11,5 @@
</com:TRepeater>
</com:TActivePanel>
-<com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page b/tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page
index 889636f3..1adbaac1 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page
@@ -1,4 +1,4 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>Event Triggered Callback Test</h1>
@@ -27,5 +27,4 @@
<div style="padding: 2em; border:1px solid #ccc; margin-top:2em">
<com:TActiveLabel ID="label1" Text="Label 1" />
</div>
- <com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/FeatureList.page b/tests/FunctionalTests/active-controls/protected/pages/FeatureList.page
index eab14a87..a01e6b5e 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/FeatureList.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/FeatureList.page
@@ -1,3 +1,3 @@
-<com:TForm ID="form1">
- <com:TBulletedList ID="List" DisplayMode="HyperLink"/>
-</com:TForm>
+<com:TContent ID="Content">
+ <com:TBulletedList ID="List" DisplayMode="HyperLink"/>
+</com:TContent>
diff --git a/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.page b/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.page
index f4bf644c..bf2b48b7 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.page
@@ -1,7 +1,7 @@
-<com:TForm>
+<com:TContent ID="Content">
<com:TLabel ForControl="DDropTurno" Text="Turno:"/>
-<com:TActiveDropDownList ID="DDropTurno"
+<com:TActiveDropDownList ID="DDropTurno"
onSelectedIndexChanged="trocaTurno" AutoPostBack="true"/>
<com:TLabel Text="Código:" ForControl="Codigo"/>
@@ -11,6 +11,5 @@
<com:TActiveTextBox ID="Descricao" MaxLength="25" Columns="25"/>
-<com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.page b/tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.page
index ba3a35db..e4fd93e9 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.page
@@ -1,4 +1,4 @@
-
+<com:TContent ID="Content">
<style>
.textbox
{
@@ -35,7 +35,6 @@
}
</style>
-<com:TForm>
<com:TInPlaceTextBox
ID="Firstname"
Text="firstname"
@@ -60,19 +59,18 @@
ValidationGroup="Group"
/>
<br />
- <com:TActiveButton ID="active_button"
- Text="Active Submit"
+ <com:TActiveButton ID="active_button"
+ Text="Active Submit"
ValidationGroup="Group"
CausesValidation="true"
OnCallback="button_valid"
- />
- <com:TButton ID="passive_button"
- Text="Passive Submit"
+ />
+ <com:TButton ID="passive_button"
+ Text="Passive Submit"
ValidationGroup="Group"
CausesValidation="true"
OnClick="button_valid"
- />
+ />
<br />
<com:TActiveLabel ID="status" Text="Status:" />
- <com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest.page b/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest.page
index 701bd74c..b4798fe1 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest.page
@@ -1,12 +1,11 @@
-<com:TForm>
+<com:TContent ID="Content">
<h1>Large Page State Test</h1>
<com:TActiveButton Text="Show Changes" OnClick="button_clicked"/>
<com:TActiveLabel ID="status" />
-<com:TJavascriptLogger />
<com:TPanel ID="Panel1">
</com:TPanel>
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest2.page b/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest2.page
index 0b662617..56ad075e 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest2.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/LargePageStateTest2.page
@@ -1,13 +1,12 @@
<%@ StatePersisterClass="System.Web.UI.TSessionPageStatePersister" %>
-<com:TForm>
+<com:TContent ID="Content">
<h1>Large Page State Test (using Session page state)</h1>
<com:TActiveButton Text="Show Changes" OnClick="button_clicked"/>
<com:TActiveLabel ID="status" />
-<com:TJavascriptLogger />
<com:TPanel ID="Panel1">
</com:TPanel>
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/Layout.php b/tests/FunctionalTests/active-controls/protected/pages/Layout.php
new file mode 100755
index 00000000..723f200c
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/Layout.php
@@ -0,0 +1,5 @@
+<?php
+
+class Layout extends TTemplateControl
+{
+}
diff --git a/tests/FunctionalTests/active-controls/protected/pages/Layout.tpl b/tests/FunctionalTests/active-controls/protected/pages/Layout.tpl
new file mode 100755
index 00000000..ead6c66f
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/Layout.tpl
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC
+ "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<com:THead Title="PRADO Functional Tests">
+ <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
+ <style type="text/css">
+ /*<![CDATA[*/
+ .defect
+ {
+ color: #c00;
+ font-size: 1.15em;
+ }
+ body
+ {
+ font-family: Georgia, "Times New Roman", Times, serif;
+ }
+ .w3c
+ {
+ margin-top: 2em;
+ display: block;
+ }
+ .required
+ {
+ border: 1px solid red;
+ background-color: pink;
+ }
+ /*]]>*/
+ </style>
+</com:THead>
+<body>
+<com:TForm>
+<com:TContentPlaceHolder ID="Content" />
+<hr style="margin-top: 2em" />
+</com:TForm>
+</body>
+</html> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/MessagesPanelTest.page b/tests/FunctionalTests/active-controls/protected/pages/MessagesPanelTest.page
index ab4798a8..33868332 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/MessagesPanelTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/MessagesPanelTest.page
@@ -1,7 +1,6 @@
-<com:TForm>
+<com:TContent ID="Content">
<com:Application.pages.DMessagesPanel ID="panel1" PanelCssClass="one1" />
<com:TActiveButton Text="Show" OnClick="show_clicked" />
<com:TActiveButton Text="Hide" OnClick="hide_clicked" />
-<com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.page b/tests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.page
index 7371086a..c877c083 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.page
@@ -1,4 +1,4 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>My Tab Panel Test</h1>
@@ -36,6 +36,5 @@
This is the contents of panel C
</com:TActivePanel>
-<com:TJavascriptLogger />
-</com:TForm>
+</com:TContent>
diff --git a/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page b/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page
index 9d3a3d61..a79c5afa 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page
@@ -1,12 +1,12 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>Nested Active Controls Test</h1>
<com:TCallback ID="callback1" OnCallback="callback1_requested" />
<com:TActivePanel ID="panel1">
<com:TPlaceHolder ID="content1" Visible="false">
- Something lalala
+ Something lalala
<com:TActiveButton ID="button1" Text="Button 1" OnClick="button1_clicked" />
<com:TActiveLabel ID="label3" Text="Label 3" />
-
+
</com:TPlaceHolder>
<com:TActiveLabel ID="label1" Text="Label 1" />
</com:TActivePanel>
@@ -14,15 +14,12 @@
Click Me!
</div>
<com:TActiveLabel ID="label2" Text="Label 2" />
- <script type="text/javascript">
- Event.OnLoad(function()
- {
- Event.observe($("div1"), "click", function()
- {
- Prado.Callback("<%= $this->callback1->UniqueID %>")
- })
- })
- </script>
- <com:TJavascriptLogger />
-
-</com:TForm>
+ <com:TClientScript>
+ jQuery( document ).ready(function() {
+ jQuery("#div1").click(function() {
+ Prado.Callback("<%= $this->callback1->UniqueID %>");
+ });
+ });
+ </com:TClientScript>
+
+</com:TContent>
diff --git a/tests/FunctionalTests/active-controls/protected/pages/NullStateTest.page b/tests/FunctionalTests/active-controls/protected/pages/NullStateTest.page
index 2ce98f5b..6b5ed334 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/NullStateTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/NullStateTest.page
@@ -1,10 +1,9 @@
-<com:TForm>
+<com:TContent ID="Content">
<h1>Null State Test</h1>
<com:TActiveLabel ID="lblTest"/>
<com:TActiveButton OnCallback="btnTest_OnCallback" Text="Clickme"/>
-<com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/PopulateActiveList.page b/tests/FunctionalTests/active-controls/protected/pages/PopulateActiveList.page
index c7bf0952..3ab9d8fb 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/PopulateActiveList.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/PopulateActiveList.page
@@ -1,4 +1,4 @@
-<com:TForm>
+<com:TContent ID="Content">
<h1>Populate active list controls</h1>
<com:TActiveListBox ID="list1" OnCallback="list_changed" />
@@ -12,6 +12,5 @@
<com:TActiveButton ID="button2" Text="populate list 2" OnClick="populate_list2" />
-<com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page
index 09ab2fbc..0a07c515 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page
@@ -1,4 +1,4 @@
-<com:TForm>
+<com:TContent ID="Content">
<h1 id="heading">PostLoading Test</h1>
<com:TCallback ID="callback1" OnCallback="Page.callback1_requested" />
@@ -8,17 +8,11 @@
<div id="div1" style="border:1px solid #666; background-color: #ffe; text-align: center; padding:3em">
Click Me!
</div>
-
- <script type="text/javascript">
- Event.OnLoad(function()
- {
- Event.observe($("div1"), "click", function()
- {
- Prado.Callback("<%= $this->callback1->UniqueID %>")
- })
- })
- </script>
-
- <com:TJavascriptLogger />
-
-</com:TForm> \ No newline at end of file
+ <com:TClientScript>
+ jQuery( document ).ready(function() {
+ jQuery("#div1").click(function() {
+ Prado.Callback("<%= $this->callback1->UniqueID %>");
+ });
+ });
+ </com:TClientScript>
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/RadioButtonListTest.page b/tests/FunctionalTests/active-controls/protected/pages/RadioButtonListTest.page
index 7de9c6ab..e1a2cb93 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/RadioButtonListTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/RadioButtonListTest.page
@@ -1,4 +1,4 @@
-<com:TForm>
+<com:TContent ID="Content">
<com:TRequiredFieldValidator
ControlToValidate="rad_button_list"
@@ -6,8 +6,8 @@
Display="Dynamic"
ValidationGroup="Group"
/>
- <br />
- <com:TActiveRadioButtonList
+ <br />
+ <com:TActiveRadioButtonList
ID="rad_button_list"
OnCallback="radChange">
<com:TListItem Value="yes" Text="Yes" />
@@ -16,15 +16,14 @@
</com:TActiveRadioButtonList>
<br />
<com:TActiveLabel
- ID="label"
+ ID="label"
Text="Choice : " />
<br /><br /><br />
<com:TActiveButton
ID="action_button"
Text="action"
OnCallback="action"
- ValidationGroup="Group" />
+ ValidationGroup="Group" />
-<com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/RatingList.page b/tests/FunctionalTests/active-controls/protected/pages/RatingList.page
index ba9c2e5d..6cb9d34a 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/RatingList.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/RatingList.page
@@ -1,5 +1,4 @@
-<com:THead/>
-<com:TForm>
+<com:TContent ID="Content">
<style>
.more td
{
@@ -93,6 +92,5 @@
Loading...
</div>
-<com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.page b/tests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.page
index b94fdbfb..52fdea2d 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/RepeaterWithActiveControls.page
@@ -1,4 +1,4 @@
-<com:TForm>
+<com:TContent ID="Content">
<style>
.textbox
{
@@ -56,6 +56,5 @@
<com:TActiveLabel ID="label1" />
-<com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page b/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page
index 7842cde9..c946d5fd 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page
@@ -1,4 +1,4 @@
-<com:TForm>
+<com:TContent ID="Content">
<h1>Callback Replace Content Test</h1>
@@ -26,6 +26,5 @@ Main Panel
<com:TActiveButton id="btn_replace" Text="Replace" OnCallback="replaceContent"/>
-<com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page b/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page
index fdd4a604..48d1207f 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page
@@ -1,5 +1,4 @@
-<com:THead />
-<com:TForm>
+<com:TContent ID="Content">
<com:TActiveButton ID="button1"
CustomData="0"
@@ -41,7 +40,4 @@
Loading...
</div>
-
-<com:TJavascriptLogger />
-
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/TActiveCheckBoxListTest.page b/tests/FunctionalTests/active-controls/protected/pages/TActiveCheckBoxListTest.page
index f3332bad..915092d2 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/TActiveCheckBoxListTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/TActiveCheckBoxListTest.page
@@ -1,4 +1,4 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TActiveCheckBoxList Test Case</h1>
<com:TActiveCheckBoxList ID="list1" OnCallback="list1_callback">
@@ -19,6 +19,4 @@
<com:TActiveButton ID="button5" Text="Select Values 'value 2', 'value 5'" OnClick="select_values_25" />
</div>
- <com:TJavascriptLogger />
-
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.page b/tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.page
index 41390e52..e126f34a 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/TActiveFileUploadAutoPostBackTest.page
@@ -1,14 +1,12 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1 id="heading">TActiveFileUpload AutoPostBack Functional Test</h1>
<com:TActiveFileUpload ID='uploader' OnFileUpload="uploadComplete" AutoPostBack="false"/>
-
+
<com:TActiveButton ID="button1" Text="Submit File"/>
-
+
<com:TActiveButton ID="button2" Text="This won't submit the file"/>
-
- <com:TActiveLabel ID="label1" Text="Label 1" />
- <com:TJavascriptLogger />
+ <com:TActiveLabel ID="label1" Text="Label 1" />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page b/tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page
index 8c0a0d71..6b0c5109 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page
@@ -1,6 +1,5 @@
<%@ Application.Globalization.Charset="UTF-8" %>
-<com:TForm ID="form1">
-
+<com:TContent ID="Content">
<style>
.textbox
{
@@ -61,7 +60,7 @@
<com:TActiveLabel ID="status" Text="Status:" />
- <com:TInPlaceTextBox
+ <com:TInPlaceTextBox
id="lblNewPackageTitle"
OnTextChanged="NewPackageSubject"
CssClass="textbox"
@@ -72,6 +71,4 @@
<com:TActiveButton Text="ad" OnCallback="button_clicked" />
- <com:TJavascriptLogger />
-
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.page b/tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.page
index 79fc17e0..b9d2c6f3 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.page
@@ -1,4 +1,4 @@
-<com:TForm>
+<com:TContent ID="Content">
<h1>TextBox AutoPostBack With Group Validation</h1>
<com:TTextBox ID="Address" Columns="60" Maxlength="128" />
<com:TRequiredFieldValidator
@@ -14,8 +14,7 @@
Maxlength="12"
ValidationGroup="post"
OnCallback="lookupZipCode"/>
-<com:TJavascriptLogger />
<com:TActiveTextBox ID="City" Columns="60" Maxlength="128" />
-</com:TForm>
+</com:TContent>
diff --git a/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page b/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page
index a285f03d..050f6681 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page
@@ -1,4 +1,4 @@
-<com:TForm ID="form1">
+<com:TContent ID="Content">
<h1>TTimeTriggeredCallback + ViewState Tests</h1>
<com:TActiveButton id="button1" Text="Start Timer" OnCallback="start_timer" />
<com:TActiveButton Text="Stop Timer" OnCallback="stop_timer" />
@@ -17,5 +17,4 @@
position: absolute; right: 0; top: 0">
Loading...
</div>
- <com:TJavascriptLogger />
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.page b/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.page
index 1281cc5c..a164afc9 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.page
@@ -1,4 +1,4 @@
-<com:TForm>
+<com:TContent ID="Content">
<h1>Value Trigger Callback Test</h1>
<com:TTextBox ID="text1" />
@@ -9,6 +9,4 @@
<com:TActiveLabel ID="label1" Text="Label 1" />
-<com:TJavascriptLogger />
-
-</com:TForm> \ No newline at end of file
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/config.xml b/tests/FunctionalTests/active-controls/protected/pages/config.xml
new file mode 100755
index 00000000..05909075
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/config.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<configuration>
+ <pages MasterClass="Application.pages.Layout" />
+</configuration> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveButtonTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveButtonTestCase.php
index c8fcfa57..acbdbb2a 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveButtonTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveButtonTestCase.php
@@ -1,14 +1,15 @@
<?php
-class ActiveButtonTestCase extends PradoGenericSeleniumTest
+class ActiveButtonTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=ActiveButtonTest");
- $this->verifyTextPresent("TActiveButton Functional Test");
- $this->assertText("label1", "Label 1");
- $this->click("button2");
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=ActiveButtonTest");
+ $this->assertContains("TActiveButton Functional Test", $this->source());
+ $this->assertText("{$base}label1", "Label 1");
+ $this->clickOnElement("{$base}button2");
$this->pause(800);
- $this->assertText("label1", "Button 1 was clicked using callback!");
+ $this->assertText("{$base}label1", "Button 1 was clicked using callback!");
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxListTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxListTestCase.php
index 312b8443..c032c084 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxListTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxListTestCase.php
@@ -1,55 +1,57 @@
<?php
-class ActiveCheckBoxListTestCase extends PradoGenericSeleniumTest
+class ActiveCheckBoxListTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=TActiveCheckBoxListTest");
- $this->verifyTextPresent("TActiveCheckBoxList Test Case");
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=TActiveCheckBoxListTest");
+ $this->assertContains("TActiveCheckBoxList Test Case", $this->source());
- $this->assertText("label1", "Label 1");
+ $this->assertText("{$base}label1", "Label 1");
- $this->click("button1");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
$this->assertCheckBoxes(array(1,2,3));
- $this->click("button2");
+ $this->byId("{$base}button2")->click();
$this->pause(800);
$this->assertCheckBoxes(array());
- $this->click("button3");
+ $this->byId("{$base}button3")->click();
$this->pause(800);
$this->assertCheckBoxes(array(0));
- $this->click("button4");
+ $this->byId("{$base}button4")->click();
$this->pause(800);
$this->assertCheckBoxes(array(4));
- $this->click("button5");
+ $this->byId("{$base}button5")->click();
$this->pause(800);
$this->assertCheckBoxes(array(1,4));
- $this->click("list1_c2");
+ $this->byId("{$base}list1_c2")->click();
$this->pause(800);
- $this->assertText("label1", "Selection: value 2, value 3, value 5");
+ $this->assertText("{$base}label1", "Selection: value 2, value 3, value 5");
- $this->click("list1_c2");
+ $this->byId("{$base}list1_c2")->click();
$this->pause(800);
- $this->assertText("label1", "Selection: value 2, value 5");
+ $this->assertText("{$base}label1", "Selection: value 2, value 5");
}
function assertCheckBoxes($checks, $total = 5)
{
+ $base='ctl0_Content_';
for($i = 0; $i < $total; $i++)
{
if(in_array($i, $checks))
- $this->assertChecked("list1_c{$i}");
+ $this->assertTrue($this->byId("{$base}list1_c{$i}")->selected());
else
- $this->assertNotChecked("list1_c{$i}");
+ $this->assertFalse($this->byId("{$base}list1_c{$i}")->selected());
}
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxTestCase.php
index 6f235273..782b35be 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxTestCase.php
@@ -1,59 +1,60 @@
<?php
-class ActiveCheckBoxTestCase extends PradoGenericSeleniumTest
+class ActiveCheckBoxTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=ActiveCheckBoxTest");
- $this->verifyTextPresent("Active CheckBox Test");
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=ActiveCheckBoxTest");
+ $this->assertContains("Active CheckBox Test", $this->source());
- $this->assertText("checkbox1_label", "CheckBox 1");
- $this->assertText("checkbox2_label", "CheckBox 2");
- $this->assertText('label1', 'Label 1');
+ $this->assertText("{$base}checkbox1_label", "CheckBox 1");
+ $this->assertText("{$base}checkbox2_label", "CheckBox 2");
+ $this->assertText("{$base}label1", 'Label 1');
- $this->click("change_text1");
+ $this->byId("{$base}change_text1")->click();
$this->pause(800);
- $this->assertText('checkbox1_label', 'Hello CheckBox 1');
+ $this->assertText("{$base}checkbox1_label", 'Hello CheckBox 1');
- $this->click("change_text2");
+ $this->byId("{$base}change_text2")->click();
$this->pause(800);
- $this->assertText('checkbox2_label', 'CheckBox 2 World');
+ $this->assertText("{$base}checkbox2_label", 'CheckBox 2 World');
//check box 1
- $this->click('change_checked1');
+ $this->byId("{$base}change_checked1")->click();
$this->pause(800);
- $this->assertChecked('checkbox1');
+ $this->assertTrue($this->byId("{$base}checkbox1")->selected());
- $this->click('change_checked1');
+ $this->byId("{$base}change_checked1")->click();
$this->pause(800);
- $this->assertNotChecked('checkbox1');
+ $this->assertFalse($this->byId("{$base}checkbox1")->selected());
//check box 2
- $this->click('change_checked2');
+ $this->byId("{$base}change_checked2")->click();
$this->pause(800);
- $this->assertChecked('checkbox2');
+ $this->assertTrue($this->byId("{$base}checkbox2")->selected());
- $this->click('change_checked2');
+ $this->byId("{$base}change_checked2")->click();
$this->pause(800);
- $this->assertNotChecked('checkbox2');
+ $this->assertFalse($this->byId("{$base}checkbox2")->selected());
//click checkbox 1
- $this->click("checkbox1");
+ $this->byId("{$base}checkbox1")->click();
$this->pause(800);
- $this->assertText("label1", "Label 1:Hello CheckBox 1 Checked");
+ $this->assertText("{$base}label1", "Label 1:Hello CheckBox 1 Checked");
- $this->click("checkbox1");
+ $this->byId("{$base}checkbox1")->click();
$this->pause(800);
- $this->assertText("label1", "Label 1:Hello CheckBox 1 Not Checked");
+ $this->assertText("{$base}label1", "Label 1:Hello CheckBox 1 Not Checked");
//click checkbox 2
- $this->click("checkbox2");
+ $this->byId("{$base}checkbox2")->click();
$this->pause(800);
- $this->assertText("label1", "Label 1:CheckBox 2 World Checked");
+ $this->assertText("{$base}label1", "Label 1:CheckBox 2 World Checked");
- $this->click("checkbox2");
+ $this->byId("{$base}checkbox2")->click();
$this->pause(800);
- $this->assertText("label1", "Label 1:CheckBox 2 World Not Checked");
+ $this->assertText("{$base}label1", "Label 1:CheckBox 2 World Not Checked");
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveControlExpressTagTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveControlExpressTagTestCase.php
index 75b86e19..c41988cc 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveControlExpressTagTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveControlExpressTagTestCase.php
@@ -1,18 +1,19 @@
<?php
-class ActiveControlExpressionTagTestCase extends PradoGenericSeleniumTest
+class ActiveControlExpressionTagTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('active-controls/index.php?page=ActiveControlExpressionTag');
- $this->assertTextPresent('Active Control With Expression Tag Test');
- $this->assertTextNotPresent('Text box content:');
+ $base='ctl0_Content_';
+ $this->url('active-controls/index.php?page=ActiveControlExpressionTag');
+ $this->assertContains('Active Control With Expression Tag Test', $this->source());
+ $this->assertNotContains('Text box content:', $this->source());
- $this->type('textbox1', 'Hello world');
- $this->click('button1');
+ $this->type("{$base}textbox1", 'Hello world');
+ $this->byId("{$base}button1")->click();
$this->pause(800);
- $this->assertText('repeats', 'result - 1 result - two');
- $this->assertText('contents', 'Text box content: Hello world');
+ $this->assertText("repeats", 'result - 1 result - two');
+ $this->assertText("contents", 'Text box content: Hello world');
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php
index be0a6fb4..570a6717 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php
@@ -1,118 +1,119 @@
<?php
-class ActiveDatePickerTestCase extends PradoGenericSeleniumTest
+class ActiveDatePickerTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=ActiveDatePicker");
- $this->verifyTextPresent("TActiveDatePicker test");
- $this->verifyText("status", "");
- $this->verifyValue("datepicker", date('m-d-Y'));
- $this->click("increaseButton");
- $this->pause(800);
- $this->verifyValue("datepicker", date('m-d-Y', strtotime('+ 1 day')));
- $this->verifyText("status", date('m-d-Y', strtotime('+ 1 day')));
- $this->click("increaseButton");
- $this->pause(800);
- $this->verifyValue("datepicker", date('m-d-Y', strtotime('+ 2 day')));
- $this->verifyText("status", date('m-d-Y', strtotime('+ 2 day')));
- $this->click("todayButton");
- $this->pause(800);
- $this->verifyValue("datepicker", date('m-d-Y'));
- $this->verifyText("status", date('m-d-Y'));
- $this->click("decreaseButton");
- $this->pause(800);
- $this->verifyValue("datepicker", date('m-d-Y', strtotime('- 1 day')));
- $this->verifyText("status", date('m-d-Y', strtotime('- 1 day')));
- $this->click("datepicker");
- $this->pause(800);
- $this->click("css=input.todayButton");
- $this->pause(800);
- $this->verifyValue("datepicker", date('m-d-Y'));
- $this->verifyText("status", date('m-d-Y'));
- $this->click("css=input.nextMonthButton");
- $this->pause(800);
- $this->verifyValue("datepicker", date('m-d-Y', strtotime('+ 1 month')));
- $this->verifyText("status", date('m-d-Y', strtotime('+1 month')));
-
- $this->click('toggleButton');
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=ActiveDatePicker");
+ $this->assertContains("TActiveDatePicker test", $this->source());
+ $this->assertText("{$base}status", "");
+ $this->assertValue("{$base}datepicker", date('m-d-Y'));
+ $this->byId("{$base}increaseButton")->click();
+ $this->pause(800);
+ $this->assertValue("{$base}datepicker", date('m-d-Y', strtotime('+ 1 day')));
+ $this->assertText("{$base}status", date('m-d-Y', strtotime('+ 1 day')));
+ $this->byId("{$base}increaseButton")->click();
+ $this->pause(800);
+ $this->assertValue("{$base}datepicker", date('m-d-Y', strtotime('+ 2 day')));
+ $this->assertText("{$base}status", date('m-d-Y', strtotime('+ 2 day')));
+ $this->byId("{$base}todayButton")->click();
+ $this->pause(800);
+ $this->assertValue("{$base}datepicker", date('m-d-Y'));
+ $this->assertText("{$base}status", date('m-d-Y'));
+ $this->byId("{$base}decreaseButton")->click();
+ $this->pause(800);
+ $this->assertValue("{$base}datepicker", date('m-d-Y', strtotime('- 1 day')));
+ $this->assertText("{$base}status", date('m-d-Y', strtotime('- 1 day')));
+ $this->byId("{$base}datepicker")->click();
+ $this->pause(800);
+ $this->byCssSelector("input.todayButton")->click();
+ $this->pause(800);
+ $this->assertValue("{$base}datepicker", date('m-d-Y'));
+ $this->assertText("{$base}status", date('m-d-Y'));
+ $this->byCssSelector("input.nextMonthButton")->click();
+ $this->pause(800);
+ $this->assertValue("{$base}datepicker", date('m-d-Y', strtotime('+ 1 month')));
+ $this->assertText("{$base}status", date('m-d-Y', strtotime('+1 month')));
+
+ $this->byId("{$base}toggleButton")->click();
$this->pause(2000);
-
- $this->click("todayButton");
+
+ $this->byId("{$base}todayButton")->click();
$this->pause(800);
- $this->assertSelected("datepicker_month", date('m'));
- $this->verifyText("status", date('m-d-Y'));
-
- $this->click("increaseButton");
+ $this->assertSelected("{$base}datepicker_month", date('m'));
+ $this->assertText("{$base}status", date('m-d-Y'));
+
+ $this->byId("{$base}increaseButton")->click();
$this->pause(800);
$dateToCheck=strtotime('+ 1 day');
- $this->assertSelected("datepicker_month", date('m', $dateToCheck));
- $this->assertSelected("datepicker_day", date('d', $dateToCheck));
- $this->assertSelected("datepicker_year", date('Y', $dateToCheck));
- $this->verifyText("status", date('m-d-Y', $dateToCheck));
-
- $this->click("increaseButton");
+ $this->assertSelected("{$base}datepicker_month", date('m', $dateToCheck));
+ $this->assertSelected("{$base}datepicker_day", date('d', $dateToCheck));
+ $this->assertSelected("{$base}datepicker_year", date('Y', $dateToCheck));
+ $this->assertText("{$base}status", date('m-d-Y', $dateToCheck));
+
+ $this->byId("{$base}increaseButton")->click();
$this->pause(800);
$dateToCheck=strtotime('+ 2 day');
- $this->assertSelected("datepicker_month", date('m', $dateToCheck));
- $this->assertSelected("datepicker_day", date('d', $dateToCheck));
- $this->assertSelected("datepicker_year", date('Y', $dateToCheck));
- $this->verifyText("status", date('m-d-Y', $dateToCheck));
-
- $this->click("todayButton");
+ $this->assertSelected("{$base}datepicker_month", date('m', $dateToCheck));
+ $this->assertSelected("{$base}datepicker_day", date('d', $dateToCheck));
+ $this->assertSelected("{$base}datepicker_year", date('Y', $dateToCheck));
+ $this->assertText("{$base}status", date('m-d-Y', $dateToCheck));
+
+ $this->byId("{$base}todayButton")->click();
$this->pause(800);
$dateToCheck=time();
- $this->assertSelected("datepicker_month", date('m', $dateToCheck));
- $this->assertSelected("datepicker_day", date('d', $dateToCheck));
- $this->assertSelected("datepicker_year", date('Y', $dateToCheck));
- $this->verifyText("status", date('m-d-Y', $dateToCheck));
-
- $this->click("decreaseButton");
+ $this->assertSelected("{$base}datepicker_month", date('m', $dateToCheck));
+ $this->assertSelected("{$base}datepicker_day", date('d', $dateToCheck));
+ $this->assertSelected("{$base}datepicker_year", date('Y', $dateToCheck));
+ $this->assertText("{$base}status", date('m-d-Y', $dateToCheck));
+
+ $this->byId("{$base}decreaseButton")->click();
$this->pause(800);
$dateToCheck=strtotime('- 1 day');
- $this->assertSelected("datepicker_month", date('m', $dateToCheck));
- $this->assertSelected("datepicker_day", date('d', $dateToCheck));
- $this->assertSelected("datepicker_year", date('Y', $dateToCheck));
- $this->verifyText("status", date('m-d-Y', $dateToCheck));
-
- $this->click("datepickerbutton");
+ $this->assertSelected("{$base}datepicker_month", date('m', $dateToCheck));
+ $this->assertSelected("{$base}datepicker_day", date('d', $dateToCheck));
+ $this->assertSelected("{$base}datepicker_year", date('Y', $dateToCheck));
+ $this->assertText("{$base}status", date('m-d-Y', $dateToCheck));
+
+ $this->byId("{$base}datepickerbutton")->click();
$this->pause(800);
- $this->click("css=input.todayButton");
+ $this->byCssSelector("input.todayButton")->click();
$this->pause(800);
$dateToCheck=time();
- $this->assertSelected("datepicker_month", date('m', $dateToCheck));
- $this->assertSelected("datepicker_day", date('d', $dateToCheck));
- $this->assertSelected("datepicker_year", date('Y', $dateToCheck));
- $this->verifyText("status", date('m-d-Y', $dateToCheck));
-
- $this->click("css=input.nextMonthButton");
+ $this->assertSelected("{$base}datepicker_month", date('m', $dateToCheck));
+ $this->assertSelected("{$base}datepicker_day", date('d', $dateToCheck));
+ $this->assertSelected("{$base}datepicker_year", date('Y', $dateToCheck));
+ $this->assertText("{$base}status", date('m-d-Y', $dateToCheck));
+
+ $this->byCssSelector("input.nextMonthButton")->click();
$this->pause(800);
$dateToCheck=strtotime('+ 1 month');
- $this->assertSelected("datepicker_month", date('m', $dateToCheck));
- $this->assertSelected("datepicker_day", date('d', $dateToCheck));
- $this->assertSelected("datepicker_year", date('Y', $dateToCheck));
- $this->verifyText("status", date('m-d-Y', $dateToCheck));
-
- $this->click('ctl1');
- $this->pause(800);
-
- $this->verifyText("status2", "");
+ $this->assertSelected("{$base}datepicker_month", date('m', $dateToCheck));
+ $this->assertSelected("{$base}datepicker_day", date('d', $dateToCheck));
+ $this->assertSelected("{$base}datepicker_year", date('Y', $dateToCheck));
+ $this->assertText("{$base}status", date('m-d-Y', $dateToCheck));
+
+ $this->byId('ctl0_ctl1')->click();
+ $this->pause(800);
+
+ $this->assertText("{$base}status2", "");
$dateToCheck=time();
- $this->assertSelected("datepicker2_month", date('m', $dateToCheck));
- $this->assertSelected("datepicker2_day", date('d', $dateToCheck));
- $this->assertSelected("datepicker2_year", date('Y', $dateToCheck));
- $this->select("datepicker2_year", date('Y')+1);
+ $this->assertSelected("{$base}datepicker2_month", date('m', $dateToCheck));
+ $this->assertSelected("{$base}datepicker2_day", date('d', $dateToCheck));
+ $this->assertSelected("{$base}datepicker2_year", date('Y', $dateToCheck));
+ $this->select("{$base}datepicker2_year", date('Y')+1);
$this->pause(800);
$dateToCheck=mktime(0,0,0,(int)date('m'),(int)date('d'), date('Y')+1);
- $this->verifyText("status2", date('m-d-Y', $dateToCheck));
+ $this->assertText("{$base}status2", date('m-d-Y', $dateToCheck));
- $this->verifyText("status3", "");
+ $this->assertText("{$base}status3", "");
$dateToCheck=time();
- $this->assertSelected("datepicker3_month", date('F', $dateToCheck));
- $this->assertSelected("datepicker3_year", date('Y', $dateToCheck));
- $this->select("datepicker3_year", date('Y')+1);
+ $this->assertSelected("{$base}datepicker3_month", date('F', $dateToCheck));
+ $this->assertSelected("{$base}datepicker3_year", date('Y', $dateToCheck));
+ $this->select("{$base}datepicker3_year", date('Y')+1);
$this->pause(800);
$dateToCheck=mktime(0,0,0,(int)date('m'),(int)date('d'), date('Y')+1);
- $this->verifyText("status3", date('m/Y', $dateToCheck));
+ $this->assertText("{$base}status3", date('m/Y', $dateToCheck));
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php
index a54cbd75..cb8c953f 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php
@@ -1,45 +1,46 @@
<?php
-class ActiveDropDownListTestCase extends PradoGenericSeleniumTest
+class ActiveDropDownListTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=ActiveDropDownList");
- $this->assertTextPresent('Active Drop Down List Test Case');
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=ActiveDropDownList");
+ $this->assertContains('Active Drop Down List Test Case', $this->source());
- $this->assertText("label1", "Label 1");
+ $this->assertText("{$base}label1", "Label 1");
- $this->click("button1");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
- $this->assertSelected("list1", "item 4");
+ $this->assertSelected("{$base}list1", "item 4");
- $this->click("button2");
+ $this->byId("{$base}button2")->click();
$this->pause(800);
- $this->assertSelectedIndex("list1", 0);
+ $this->assertSelectedValue("{$base}list1", 'value 1');
- $this->click("button3");
+ $this->byId("{$base}button3")->click();
$this->pause(800);
- $this->assertSelected("list1", "item 2");
+ $this->assertSelected("{$base}list1", "item 2");
- $this->assertText("label1", "Selection 1: value 1");
+ $this->assertText("{$base}label1", "Selection 1: value 1");
- $this->select("list1", "item 1");
+ $this->select("{$base}list1", "item 1");
$this->pause(800);
- $this->select("list2", "value 1 - item 4");
+ $this->select("{$base}list2", "value 1 - item 4");
$this->pause(800);
- $this->assertText("label2", "Selection 2: value 1 - item 4");
+ $this->assertText("{$base}label2", "Selection 2: value 1 - item 4");
- $this->select("list1", "item 3");
+ $this->select("{$base}list1", "item 3");
$this->pause(800);
- $this->select("list2", "value 3 - item 5");
+ $this->select("{$base}list2", "value 3 - item 5");
$this->pause(800);
- $this->assertText("label2", "Selection 2: value 3 - item 5");
+ $this->assertText("{$base}label2", "Selection 2: value 3 - item 5");
- $this->click('button4');
+ $this->byId("{$base}button4")->click();
$this->pause(800);
- $this->assertSelected('list1', 'item 3');
+ $this->assertSelected("{$base}list1", 'item 3');
$this->pause(300);
- $this->assertSelected('list2', 'value 3 - item 3');
+ $this->assertSelected("{$base}list2", 'value 3 - item 3');
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php
index b8c02868..d4b82068 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php
@@ -1,22 +1,23 @@
<?php
-class ActiveHiddenFieldTestCase extends PradoGenericSeleniumTest
+class ActiveHiddenFieldTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=ActiveHiddenFieldTest");
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=ActiveHiddenFieldTest");
$fieldEmpty = 'No longer empty';
$fieldUsed = 'My value';
-
- $this->verifyTextPresent('Value of current hidden field');
- $this->click('Button1');
+
+ $this->assertContains('Value of current hidden field', $this->source());
+ $this->byId("{$base}Button1")->click();
$this->pause(800);
- $this->assertText('ResponseLabel', $fieldEmpty);
- $this->click('Button2');
+ $this->assertText("{$base}ResponseLabel", $fieldEmpty);
+ $this->byId("{$base}Button2")->click();
$this->pause(800);
- $this->assertText('ResponseLabel', $fieldUsed);
- $this->click('Button3');
+ $this->assertText("{$base}ResponseLabel", $fieldUsed);
+ $this->byId("{$base}Button3")->click();
$this->pause(800);
- $this->assertText('ResponseLabel', $fieldEmpty.'|'.$fieldUsed);
+ $this->assertText("{$base}ResponseLabel", $fieldEmpty.'|'.$fieldUsed);
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveHyperLinkTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveHyperLinkTestCase.php
index bfcdd206..6329d826 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveHyperLinkTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveHyperLinkTestCase.php
@@ -1,16 +1,17 @@
<?php
-class ActiveHyperLinkTestCase extends PradoGenericSeleniumTest
+class ActiveHyperLinkTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=ActiveHyperLinkTest");
- $this->assertTextPresent("Active HyperLink Test Case");
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=ActiveHyperLinkTest");
+ $this->assertContains("Active HyperLink Test Case", $this->source());
- $this->assertText("link1", "Link 1");
+ $this->assertText("{$base}link1", "Link 1");
- $this->click("button1");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
- $this->assertText("link1", "Pradosoft.com");
+ $this->assertText("{$base}link1", "Pradosoft.com");
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveImageButtonTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveImageButtonTestCase.php
index 2989ab27..0ef2e082 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveImageButtonTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveImageButtonTestCase.php
@@ -1,15 +1,16 @@
<?php
-class ActiveImageButtonTestCase extends PradoGenericSeleniumTest
+class ActiveImageButtonTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=ActiveImageButtonTest");
- $this->assertTextPresent("TActiveImageButton Functional Test");
- $this->assertText("label1", "Label 1");
- $this->click("image1");
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=ActiveImageButtonTest");
+ $this->assertContains("TActiveImageButton Functional Test", $this->source());
+ $this->assertText("{$base}label1", "Label 1");
+ $this->byId("{$base}image1")->click();
$this->pause(800);
//unable to determine mouse position
- $this->assertTextPresent("regexp:Image clicked at x=\d+, y=\d+");
+ $this->assertRegExp('/Image clicked at x=\d+, y=\d+/', $this->source());
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveLinkButtonTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveLinkButtonTestCase.php
index 88cdf15e..1f7c40ea 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveLinkButtonTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveLinkButtonTestCase.php
@@ -1,14 +1,15 @@
<?php
-class ActiveLinkButtonTestCase extends PradoGenericSeleniumTest
+class ActiveLinkButtonTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=ActiveLinkButtonTest");
- $this->verifyTextPresent("TActiveLinkButton Functional Test");
- $this->assertText("label1", "Label 1");
- $this->click("button2");
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=ActiveLinkButtonTest");
+ $this->assertContains("TActiveLinkButton Functional Test", $this->source());
+ $this->assertText("{$base}label1", "Label 1");
+ $this->byId("{$base}button2")->click();
$this->pause(800);
- $this->assertText("label1", "Button 1 was clicked using callback!");
+ $this->assertText("{$base}label1", "Button 1 was clicked using callback!");
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php
index 911e3cc7..be2bf174 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php
@@ -1,48 +1,48 @@
<?php
-class ActiveListBoxMasterTestCase extends PradoGenericSeleniumTest
+class ActiveListBoxMasterTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=ActiveListBoxMasterTest");
- $this->assertTextPresent('Active List Box Functional Test');
+ $this->url("active-controls/index.php?page=ActiveListBoxMasterTest");
+ $this->assertContains('Active List Box Functional Test', $this->source());
$base = 'ctl0_body_';
- $this->assertText($base."label1", "Label 1");
+ $this->assertText("{$base}label1", "Label 1");
- $this->click($base."button1");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
- $this->assertEquals($this->getSelectedLabels($base.'list1'), array('item 2', 'item 3', 'item 4'));
+ $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 2', 'item 3', 'item 4'));
- $this->click($base.'button3');
+ $this->byId("{$base}button3")->click();
$this->pause(800);
- $this->assertEquals($this->getSelectedLabels($base.'list1'), array('item 1'));
+ $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 1'));
- $this->click($base.'button4');
+ $this->byId("{$base}button4")->click();
$this->pause(800);
- $this->assertEquals($this->getSelectedLabels($base.'list1'), array('item 5'));
+ $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 5'));
- $this->click($base.'button5');
+ $this->byId("{$base}button5")->click();
$this->pause(800);
- $this->assertEquals($this->getSelectedLabels($base.'list1'), array('item 2', 'item 5'));
+ $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 2', 'item 5'));
- $this->click($base.'button2');
+ $this->byId("{$base}button2")->click();
$this->pause(800);
- $this->assertNotSomethingSelected($base."list1");
+ $this->assertNotSomethingSelected("{$base}list1");
- $this->click($base.'button6');
+ $this->byId("{$base}button6")->click();
$this->pause(800);
- $this->click($base."button1");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
- $this->assertEquals($this->getSelectedLabels($base.'list1'), array('item 2', 'item 3', 'item 4'));
+ $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 2', 'item 3', 'item 4'));
- $this->select($base."list1", "item 1");
+ $this->select("{$base}list1", "item 1");
$this->pause(800);
- $this->assertText($base.'label1', 'Selection: value 1');
+ $this->assertText("{$base}label1", 'Selection: value 1');
- $this->addSelection($base."list1", "item 4");
+ $this->addSelection("{$base}list1", "item 4");
$this->pause(800);
- $this->assertText($base.'label1', 'Selection: value 1, value 4');
+ $this->assertText("{$base}label1", 'Selection: value 1, value 4');
}
} \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveListBoxTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveListBoxTestCase.php
index d45cb42c..1830f5ab 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveListBoxTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveListBoxTestCase.php
@@ -1,46 +1,47 @@
<?php
-class ActiveListBoxTestCase extends PradoGenericSeleniumTest
+class ActiveListBoxTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=ActiveListBoxTest");
- $this->assertTextPresent('Active List Box Functional Test');
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=ActiveListBoxTest");
+ $this->assertContains('Active List Box Functional Test', $this->source());
- $this->assertText("label1", "Label 1");
+ $this->assertText("{$base}label1", "Label 1");
- $this->click("button1");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
- $this->assertEquals($this->getSelectedLabels('list1'), array('item 2', 'item 3', 'item 4'));
+ $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 2', 'item 3', 'item 4'));
- $this->click('button3');
+ $this->byId("{$base}button3")->click();
$this->pause(800);
- $this->assertEquals($this->getSelectedLabels('list1'), array('item 1'));
+ $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 1'));
- $this->click('button4');
+ $this->byId("{$base}button4")->click();
$this->pause(800);
- $this->assertEquals($this->getSelectedLabels('list1'), array('item 5'));
+ $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 5'));
- $this->click('button5');
+ $this->byId("{$base}button5")->click();
$this->pause(800);
- $this->assertEquals($this->getSelectedLabels('list1'), array('item 2', 'item 5'));
+ $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 2', 'item 5'));
- $this->click('button2');
+ $this->byId("{$base}button2")->click();
$this->pause(800);
- $this->assertNotSomethingSelected("list1");
+ $this->assertNotSomethingSelected("{$base}list1");
- $this->click('button6');
+ $this->byId("{$base}button6")->click();
$this->pause(800);
- $this->click("button1");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
- $this->assertEquals($this->getSelectedLabels('list1'), array('item 2', 'item 3', 'item 4'));
+ $this->assertEquals($this->getSelectedLabels("{$base}list1"), array('item 2', 'item 3', 'item 4'));
- $this->select("list1", "item 1");
+ $this->select("{$base}list1", "item 1");
$this->pause(800);
- $this->assertText('label1', 'Selection: value 1');
+ $this->assertText("{$base}label1", 'Selection: value 1');
- $this->addSelection("list1", "item 4");
+ $this->addSelection("{$base}list1", "item 4");
$this->pause(800);
- $this->assertText('label1', 'Selection: value 1, value 4');
+ $this->assertText("{$base}label1", 'Selection: value 1, value 4');
}
} \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/tests/ActivePanelTestCase.php b/tests/FunctionalTests/active-controls/tests/ActivePanelTestCase.php
index 9b069a14..73ab3ad0 100755
--- a/tests/FunctionalTests/active-controls/tests/ActivePanelTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActivePanelTestCase.php
@@ -1,14 +1,15 @@
<?php
-class ActivePanelTestCase extends PradoGenericSeleniumTest
+class ActivePanelTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=ActivePanelTest");
- $this->verifyTextPresent("Active Panel replacement tests");
- $this->assertTextNotPresent('Something lalala');
- $this->click("div1");
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=ActivePanelTest");
+ $this->assertContains("Active Panel replacement tests", $this->source());
+ $this->assertNotContains('Something lalala', $this->source());
+ $this->byId("div1")->click();
$this->pause(800);
- $this->assertTextPresent("Something lalala");
+ $this->assertContains("Something lalala", $this->source());
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonListTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonListTestCase.php
index b0942ffa..82408732 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonListTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonListTestCase.php
@@ -1,45 +1,47 @@
<?php
-class ActiveRadioButtonListTestCase extends PradoGenericSeleniumTest
+class ActiveRadioButtonListTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=ActiveRadioButtonListTest");
- $this->verifyTextPresent("TActiveRadioButtonList Test Case");
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=ActiveRadioButtonListTest");
+ $this->assertContains("TActiveRadioButtonList Test Case", $this->source());
- $this->assertText("label1", "Label 1");
+ $this->assertText("{$base}label1", "Label 1");
- $this->click("button3");
+ $this->byId("{$base}button3")->click();
$this->pause(800);
$this->assertCheckBoxes(array(0));
- $this->click("button2");
+ $this->byId("{$base}button2")->click();
$this->pause(800);
$this->assertCheckBoxes(array());
- $this->click("button4");
+ $this->byId("{$base}button4")->click();
$this->pause(800);
$this->assertCheckBoxes(array(4));
- $this->click("list1_c2");
+ $this->byId("{$base}list1_c2")->click();
$this->pause(800);
- $this->assertText("label1", "Selection: value 3");
+ $this->assertText("{$base}label1", "Selection: value 3");
- $this->click("list1_c3");
+ $this->byId("{$base}list1_c3")->click();
$this->pause(800);
- $this->assertText("label1", "Selection: value 4");
+ $this->assertText("{$base}label1", "Selection: value 4");
}
function assertCheckBoxes($checks, $total = 5)
{
+ $base='ctl0_Content_';
for($i = 0; $i < $total; $i++)
{
if(in_array($i, $checks))
- $this->assertChecked("list1_c{$i}");
+ $this->assertTrue($this->byId("{$base}list1_c{$i}")->selected());
else
- $this->assertNotChecked("list1_c{$i}");
+ $this->assertFalse($this->byId("{$base}list1_c{$i}")->selected());
}
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonTestCase.php
index fceb2e21..7606e46b 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonTestCase.php
@@ -1,52 +1,53 @@
<?php
-class ActiveRadioButtonTestCase extends PradoGenericSeleniumTest
+class ActiveRadioButtonTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=ActiveRadioButtonTest");
- $this->verifyTextPresent("Active Radio Button Test");
- $this->assertText('label1', 'Label 1');
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=ActiveRadioButtonTest");
+ $this->assertContains("Active Radio Button Test", $this->source());
+ $this->assertText("{$base}label1", 'Label 1');
- $this->assertNotChecked('radio1');
- $this->assertNotChecked('radio2');
- $this->assertNotChecked('radio3');
+ $this->assertFalse($this->byId("{$base}radio1")->selected());
+ $this->assertFalse($this->byId("{$base}radio2")->selected());
+ $this->assertFalse($this->byId("{$base}radio3")->selected());
- $this->assertText('radio1_label', 'Radio Button 1');
- $this->assertText('radio2_label', 'Radio Button 2');
- $this->assertText('radio3_label', 'Radio Button 3');
+ $this->assertText("{$base}radio1_label", 'Radio Button 1');
+ $this->assertText("{$base}radio2_label", 'Radio Button 2');
+ $this->assertText("{$base}radio3_label", 'Radio Button 3');
- $this->click('change_text1');
+ $this->byId("{$base}change_text1")->click();
$this->pause(800);
- $this->assertText('radio1_label', 'Hello Radio Button 1');
- $this->assertText('radio2_label', 'Radio Button 2');
- $this->assertText('radio3_label', 'Radio Button 3');
+ $this->assertText("{$base}radio1_label", 'Hello Radio Button 1');
+ $this->assertText("{$base}radio2_label", 'Radio Button 2');
+ $this->assertText("{$base}radio3_label", 'Radio Button 3');
- $this->click('change_text2');
+ $this->byId("{$base}change_text2")->click();
$this->pause(800);
- $this->assertText('radio1_label', 'Hello Radio Button 1');
- $this->assertText('radio2_label', 'Radio Button 2 World');
- $this->assertText('radio3_label', 'Radio Button 3');
+ $this->assertText("{$base}radio1_label", 'Hello Radio Button 1');
+ $this->assertText("{$base}radio2_label", 'Radio Button 2 World');
+ $this->assertText("{$base}radio3_label", 'Radio Button 3');
- $this->click('change_radio1');
+ $this->byId("{$base}change_radio1")->click();
$this->pause(800);
- $this->assertChecked('radio1');
- $this->assertNotChecked('radio2');
- $this->assertNotChecked('radio3');
+ $this->assertTrue($this->byId("{$base}radio1")->selected());
+ $this->assertFalse($this->byId("{$base}radio2")->selected());
+ $this->assertFalse($this->byId("{$base}radio3")->selected());
- $this->click('change_radio2');
+ $this->byId("{$base}change_radio2")->click();
$this->pause(800);
- $this->assertNotChecked('radio1');
- $this->assertChecked('radio2');
- $this->assertNotChecked('radio3');
+ $this->assertFalse($this->byId("{$base}radio1")->selected());
+ $this->assertTrue($this->byId("{$base}radio2")->selected());
+ $this->assertFalse($this->byId("{$base}radio3")->selected());
- $this->click('radio3');
+ $this->byId("{$base}radio3")->click();
$this->pause(800);
- $this->assertNotChecked('radio1');
- $this->assertChecked('radio2');
- $this->assertChecked('radio3');
- $this->assertText('label1', 'Label 1:Radio Button 3 Checked');
+ $this->assertFalse($this->byId("{$base}radio1")->selected());
+ $this->assertTrue($this->byId("{$base}radio2")->selected());
+ $this->assertTrue($this->byId("{$base}radio3")->selected());
+ $this->assertText("{$base}label1", 'Label 1:Radio Button 3 Checked');
}
diff --git a/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php b/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php
index 2033d6ff..058aae01 100755
--- a/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php
@@ -1,42 +1,43 @@
<?php
-class AutoCompleteTestCase extends PradoGenericSeleniumTest
+class AutoCompleteTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=AutoCompleteTest");
- $this->verifyTextPresent("TAutoComplete Test");
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=AutoCompleteTest");
+ $this->assertContains("TAutoComplete Test", $this->source());
- $this->assertText("label1", "Label 1");
+ $this->assertText("{$base}label1", "Label 1");
- $this->type("textbox3", 'a');
- $this->runScript('Prado.Registry.get(\'textbox3\').onKeyPress({})');
+ $this->byId("{$base}textbox3")->click();
+ $this->keys('a');
$this->pause(500);
- $this->verifyTextPresent('Andorra');
- $this->assertText("label1", "suggestion for a");
+ $this->assertContains('Andorra', $this->source());
+ $this->assertText("{$base}label1", "suggestion for a");
- $this->type("textbox3", 'au');
- $this->runScript('Prado.Registry.get(\'textbox3\').onKeyPress({})');
+ $this->keys('u');
$this->pause(500);
- $this->verifyTextPresent('Australia');
- $this->assertText("label1", "suggestion for au");
+ $this->assertContains('Australia', $this->source());
+ $this->assertText("{$base}label1", "suggestion for au");
- $this->click("css=#textbox3_result ul li");
+ $this->byCssSelector("#{$base}textbox3_result ul li")->click();
$this->pause(500);
- $this->assertText("label1", "Label 1: Austria");
+ $this->assertText("{$base}label1", "Label 1: Austria");
- $this->type("textbox2", "cu");
- $this->runScript('Prado.Registry.get(\'textbox2\').onKeyPress({})');
+
+ $this->byId("{$base}textbox2")->click();
+ $this->keys('cu');
$this->pause(500);
- $this->click('css=#textbox2_result ul li');
+ $this->byCssSelector("#{$base}textbox2_result ul li")->click();
$this->pause(500);
- $this->assertText("label1", "Label 1: Cuba");
+ $this->assertText("{$base}label1", "Label 1: Cuba");
- $this->type("textbox2", "Cuba,me");
- $this->runScript('Prado.Registry.get(\'textbox2\').onKeyPress({})');
+ $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::END);
+ $this->keys(',me');
$this->pause(500);
- $this->click('css=#textbox2_result ul li');
+ $this->byCssSelector("#{$base}textbox2_result ul li")->click();
$this->pause(500);
- $this->assertText("label1", "Label 1: Cuba,Mexico");
+ $this->assertText("{$base}label1", "Label 1: Cuba,Mexico");
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/CalculatorTestCase.php b/tests/FunctionalTests/active-controls/tests/CalculatorTestCase.php
index 48960d39..9bef7d00 100755
--- a/tests/FunctionalTests/active-controls/tests/CalculatorTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/CalculatorTestCase.php
@@ -1,23 +1,24 @@
<?php
-class CalculatorTestCase extends PradoGenericSeleniumTest
+class CalculatorTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=Calculator");
- $this->assertTextPresent("Callback Enabled Calculator");
- $this->assertNotVisible("summary");
-
- $this->click("sum");
- $this->assertVisible("summary");
-
- $this->type("a", "2");
- $this->type("b", "5");
-
- $this->click("sum");
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=Calculator");
+ $this->assertContains("Callback Enabled Calculator", $this->source());
+ $this->assertNotVisible("{$base}summary");
+
+ $this->byId("{$base}sum")->click();
+ $this->assertVisible("{$base}summary");
+
+ $this->type("{$base}a", "2");
+ $this->type("{$base}b", "5");
+
+ $this->byId("{$base}sum")->click();
$this->pause(500);
- $this->assertNotVisible("summary");
- $this->assertValue("c", "7");
+ $this->assertNotVisible("{$base}summary");
+ $this->assertValue("{$base}c", "7");
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php b/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php
index c495935a..25dabe24 100755
--- a/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php
@@ -1,58 +1,65 @@
<?php
-class CallbackAdapterTestCase extends PradoGenericSeleniumTest
+class CallbackAdapterTestCase extends PradoGenericSelenium2Test
{
function test()
{
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=ControlAdapterTest");
+ $this->assertContains('Control Adapter - State Tracking Tests', $this->source());
- $this->open("active-controls/index.php?page=ControlAdapterTest");
- $this->assertTextPresent('Control Adapter - State Tracking Tests');
+ $this->byId("{$base}button2")->click();
+ $this->assertEquals('ok', $this->alertText());
+ $this->acceptAlert();
- $this->click('button2');
- $this->assertAlert('ok');
-
- $this->click('test6');
+ $this->byId("{$base}test6")->click();
$this->pause(800);
- $this->click('test7');
+ $this->byId("{$base}test7")->click();
$this->pause(800);
- $this->click('test8');
+ $this->byId("{$base}test8")->click();
$this->pause(800);
- $this->click('test9');
+ $this->byId("{$base}test9")->click();
$this->pause(800);
- $this->click('button1');
- $this->assertAlert('haha!');
-
- $this->click('button2');
- $this->assertAlert('ok');
- $this->assertAlert('baz!');
+ $this->byId("{$base}button1")->click();
+ $this->assertEquals('haha!', $this->alertText());
+ $this->acceptAlert();
+ $this->byId("{$base}button2")->click();
+ $this->assertEquals('ok', $this->alertText());
+ $this->acceptAlert();
+ $this->assertEquals('baz!', $this->alertText());
+ $this->acceptAlert();
}
/*
function testIE()
{
- $this->open("active-controls/index.php?page=ControlAdapterTest");
- $this->assertTextPresent('Control Adapter - State Tracking Tests');
+ $this->url("active-controls/index.php?page=ControlAdapterTest");
+ $this->assertContains('Control Adapter - State Tracking Tests', $this->source());
- $this->click('button2');
- $this->assertAlert('ok');
+ $this->byId("{$base}button2")->click();
+ $this->assertEquals('ok', $this->alertText());
+ $this->acceptAlert();
- $this->click('test6');
+ $this->byId('test6')->click();
$this->pause(800);
- $this->click('test7');
+ $this->byId('test7')->click();
$this->pause(800);
- $this->click('test8');
+ $this->byId('test8')->click();
$this->pause(800);
- $this->click('test9');
+ $this->byId('test9')->click();
$this->pause(800);
- $this->click('button1');
- $this->assertAlert('haha!');
+ $this->byId("{$base}button1")->click();
+ $this->assertEquals('haha!', $this->alertText());
+ $this->acceptAlert();
//IE alerts in diffrent order
- $this->click('button2');
- $this->assertAlert('baz!');
- $this->assertAlert('ok');
+ $this->byId("{$base}button2")->click();
+ $this->assertEquals('baz!', $this->alertText());
+ $this->acceptAlert();
+ $this->assertEquals('ok', $this->alertText());
+ $this->acceptAlert();
}
*/
}
diff --git a/tests/FunctionalTests/active-controls/tests/CallbackOptionsTestCase.php b/tests/FunctionalTests/active-controls/tests/CallbackOptionsTestCase.php
index d1f48cf3..4c2c7070 100755
--- a/tests/FunctionalTests/active-controls/tests/CallbackOptionsTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/CallbackOptionsTestCase.php
@@ -1,29 +1,30 @@
<?php
-class CallbackOptionsTestCase extends PradoGenericSeleniumTest
+class CallbackOptionsTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=CallbackOptionsTest");
- $this->verifyTextPresent("TCallbackOptions Test");
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=CallbackOptionsTest");
+ $this->assertContains("TCallbackOptions Test", $this->source());
$this->assertText("label1", "Label 1");
$this->assertText("label2", "Label 2");
$this->assertText("label3", "Label 3");
- $this->click("button1");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
$this->assertText("label1", "Button 1 has returned");
$this->assertText("label2", "Label 2");
$this->assertText("label3", "Label 3");
- $this->click("button2");
+ $this->byId("{$base}button2")->click();
$this->pause(800);
$this->assertText("label1", "Button 1 has returned");
$this->assertText("label2", "Button 2 has returned");
$this->assertText("label3", "Label 3");
- $this->click("button3");
+ $this->byId("{$base}button3")->click();
$this->pause(800);
$this->assertText("label1", "Button 1 has returned");
$this->assertText("label2", "Button 2 has returned");
diff --git a/tests/FunctionalTests/active-controls/tests/CustomTemplateTestCase.php b/tests/FunctionalTests/active-controls/tests/CustomTemplateTestCase.php
index 7e38423e..3b594b39 100755
--- a/tests/FunctionalTests/active-controls/tests/CustomTemplateTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/CustomTemplateTestCase.php
@@ -1,20 +1,21 @@
<?php
-class CustomTemplateTestCase extends PradoGenericSeleniumTest
+class CustomTemplateTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('active-controls/index.php?page=CustomTemplateControlTest');
- $this->assertTextPresent('Add Dynamic Custom TTemplateControl Test');
- $this->assertText('label1', 'Label 1');
+ $base='ctl0_Content_';
+ $this->url('active-controls/index.php?page=CustomTemplateControlTest');
+ $this->assertContains('Add Dynamic Custom TTemplateControl Test', $this->source());
+ $this->assertText("{$base}label1", 'Label 1');
- $this->type('foo', 'Foo Bar!');
- $this->click('button2');
+ $this->type("{$base}foo", 'Foo Bar!');
+ $this->byId("{$base}button2")->click();
$this->pause(800);
- $this->assertVisible('ctl1_ThePanel');
- $this->assertTextPresent('Client ID: ctl1_ThePanel');
+ $this->assertVisible("{$base}ctl0_ThePanel");
+ $this->assertContains("Client ID: {$base}ctl0_ThePanel", $this->source());
- $this->assertText('label1', 'Button 1 was clicked Foo Bar! using callback!... and this is the textbox text: Foo Bar!');
+ $this->assertText("{$base}label1", 'Button 1 was clicked Foo Bar! using callback!... and this is the textbox text: Foo Bar!');
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/DelayedCallbackTestCase.php b/tests/FunctionalTests/active-controls/tests/DelayedCallbackTestCase.php
index 841de5aa..49c268ad 100755
--- a/tests/FunctionalTests/active-controls/tests/DelayedCallbackTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/DelayedCallbackTestCase.php
@@ -1,20 +1,21 @@
<?php
-class DelayedCallbackTestCase extends PradoGenericSeleniumTest
+class DelayedCallbackTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=DelayedCallback");
- $this->verifyTextPresent("Delayed Callback Test");
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=DelayedCallback");
+ $this->assertContains("Delayed Callback Test", $this->source());
- $this->assertText("status", "");
- $this->click("button1");
- $this->click("button2");
+ $this->assertText("{$base}status", "");
+ $this->byId("{$base}button1")->click();
+ $this->byId("{$base}button2")->click();
$this->pause("5000");
- $this->assertText("status", "Callback 1 returned after 4s");
+ $this->assertText("{$base}status", "Callback 1 returned after 4s");
$this->pause("3000");
- $this->assertText("status", "Callback 2 delayed 2s");
+ $this->assertText("{$base}status", "Callback 2 delayed 2s");
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/EventTriggerTestCase.php b/tests/FunctionalTests/active-controls/tests/EventTriggerTestCase.php
index 30678786..7cc9a3bd 100755
--- a/tests/FunctionalTests/active-controls/tests/EventTriggerTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/EventTriggerTestCase.php
@@ -1,20 +1,21 @@
<?php
-class EventTriggerTestCase extends PradoGenericSeleniumTest
+class EventTriggerTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=EventTriggeredCallback");
- $this->verifyTextPresent("Event Triggered Callback Test");
+ $base = "ctl0_Content_";
+ $this->url("active-controls/index.php?page=EventTriggeredCallback");
+ $this->assertContains("Event Triggered Callback Test", $this->source());
- $this->assertText('label1', 'Label 1');
+ $this->assertText("{$base}label1", 'Label 1');
- $this->click('button1');
+ $this->byId("button1")->click();
$this->pause(800);
- $this->assertText('label1', 'button 1 clicked');
+ $this->assertText("{$base}label1", 'button 1 clicked');
- $this->type('text1', 'test');
+ $this->byId("{$base}text1")->value('test');
$this->pause(800);
- $this->assertText('label1', 'text 1 focused');
+ $this->assertText("{$base}label1", 'text 1 focused');
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/NestedActiveControlsTestCase.php b/tests/FunctionalTests/active-controls/tests/NestedActiveControlsTestCase.php
index e2ceb33e..f08a6f78 100755
--- a/tests/FunctionalTests/active-controls/tests/NestedActiveControlsTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/NestedActiveControlsTestCase.php
@@ -1,24 +1,25 @@
<?php
-class NestedActiveControlsTestCase extends PradoGenericSeleniumTest
+class NestedActiveControlsTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=NestedActiveControls");
- $this->verifyTextPresent("Nested Active Controls Test");
- $this->assertText("label1", "Label 1");
- $this->assertText("label2", "Label 2");
- $this->assertTextNotPresent("Label 3");
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=NestedActiveControls");
+ $this->assertContains("Nested Active Controls Test", $this->source());
+ $this->assertText("{$base}label1", "Label 1");
+ $this->assertText("{$base}label2", "Label 2");
+ $this->assertNotContains("Label 3", $this->source());
- $this->click("div1");
+ $this->byId("div1")->click();
$this->pause(800);
- $this->assertTextPresent("Something lalala");
- $this->assertText("label3", "Label 3");
+ $this->assertContains("Something lalala", $this->source());
+ $this->assertText("{$base}label3", "Label 3");
- $this->click("button1");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
- $this->assertText("label1", "Label 1: Button 1 Clicked");
- $this->assertText("label2", "Label 2: Button 1 Clicked");
- $this->assertText("label3", "Label 3: Button 1 Clicked");
+ $this->assertText("{$base}label1", "Label 1: Button 1 Clicked");
+ $this->assertText("{$base}label2", "Label 2: Button 1 Clicked");
+ $this->assertText("{$base}label3", "Label 3: Button 1 Clicked");
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/PopulateListTestCase.php b/tests/FunctionalTests/active-controls/tests/PopulateListTestCase.php
index adb5a3a5..e7f7f287 100755
--- a/tests/FunctionalTests/active-controls/tests/PopulateListTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/PopulateListTestCase.php
@@ -1,23 +1,24 @@
<?php
-class PopulateListTestCase extends PradoGenericSeleniumTest
+class PopulateListTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=PopulateActiveList");
- $this->verifyTextPresent("Populate active list controls");
- $this->assertText("label1", "");
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=PopulateActiveList");
+ $this->assertContains("Populate active list controls", $this->source());
+ $this->assertText("{$base}label1", "");
- $this->click("button1");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
- $this->select("list1", "World");
+ $this->select("{$base}list1", "World");
$this->pause(800);
- $this->assertText("label1", "list1: World");
+ $this->assertText("{$base}label1", "list1: World");
- $this->click("button2");
+ $this->byId("{$base}button2")->click();
$this->pause(800);
- $this->select("list2", "Prado");
+ $this->select("{$base}list2", "Prado");
$this->pause(800);
- $this->assertText("label1", "list2: Prado");
+ $this->assertText("{$base}label1", "list2: Prado");
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php b/tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php
index 21a5128d..271a2ffb 100755
--- a/tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php
@@ -1,20 +1,21 @@
<?php
-class PostLoadingTestCase extends PradoGenericSeleniumTest
+class PostLoadingTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('active-controls/index.php?page=PostLoadingTest');
- $this->assertTextPresent('PostLoading Test');
+ $base="ctl0_Content_";
+ $this->url('active-controls/index.php?page=PostLoadingTest');
+ $this->assertContains('PostLoading Test', $this->source());
- $this->assertTextNotPresent('Hello World');
+ $this->assertNotContains('Hello World', $this->source());
- $this->click('div1');
+ $this->byId('div1')->click();
$this->pause(800);
- $this->type('MyTextBox', 'Hello World');
- $this->click('MyButton');
+ $this->type("{$base}MyTextBox", 'Hello World');
+ $this->byId("{$base}MyButton")->click();
$this->pause(800);
- $this->assertTextPresent('Result is Hello World');
+ $this->assertContains('Result is Hello World', $this->source());
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/ReplaceContentTestCase.php b/tests/FunctionalTests/active-controls/tests/ReplaceContentTestCase.php
index fd273ae7..c3345d6a 100755
--- a/tests/FunctionalTests/active-controls/tests/ReplaceContentTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ReplaceContentTestCase.php
@@ -1,90 +1,90 @@
<?php
-class ReplaceContentTestCase extends PradoGenericSeleniumTest
+class ReplaceContentTestCase extends PradoGenericSelenium2Test
{
function test()
{
+ $base='ctl0_Content_';
+ $this->url('active-controls/index.php?page=ReplaceContentTest');
+ $this->assertContains('Callback Replace Content Test', $this->source());
- $this->open('active-controls/index.php?page=ReplaceContentTest');
- $this->assertTextPresent('Callback Replace Content Test');
+ $this->assertText("{$base}subpanel", 'Sub Panel');
+ $this->assertText("{$base}panel1", "Main Panel\nSub Panel");
- $this->assertText('subpanel', 'Sub Panel');
- $this->assertText('panel1', 'Main Panel Sub Panel');
+ $this->type("{$base}content", 'something');
- $this->type('content', 'something');
-
- $this->click('btn_append');
+ $this->byId("{$base}btn_append")->click();
$this->pause(800);
- $this->assertText('subpanel', 'Sub Panel something');
- $this->assertText('panel1', 'Main Panel Sub Panel something');
+ $this->assertText("{$base}subpanel", 'Sub Panel something');
+ $this->assertText("{$base}panel1", "Main Panel\nSub Panel something");
- $this->type('content', 'more');
- $this->click('btn_prepend');
+ $this->type("{$base}content", 'more');
+ $this->byId("{$base}btn_prepend")->click();
$this->pause(800);
- $this->assertText('subpanel', 'more Sub Panel something');
- $this->assertText('panel1', 'Main Panel more Sub Panel something');
+ $this->assertText("{$base}subpanel", 'more Sub Panel something');
+ $this->assertText("{$base}panel1", "Main Panel\nmore Sub Panel something");
- $this->type('content', 'prado');
- $this->click('btn_before');
+ $this->type("{$base}content", 'prado');
+ $this->byId("{$base}btn_before")->click();
$this->pause(800);
- $this->assertText('subpanel', 'more Sub Panel something');
- $this->assertText('panel1', 'Main Panel pradomore Sub Panel something');
+ $this->assertText("{$base}subpanel", 'more Sub Panel something');
+ $this->assertText("{$base}panel1", "Main Panel prado\nmore Sub Panel something");
- $this->type('content', ' php ');
- $this->click('btn_after');
+ $this->type("{$base}content", ' php ');
+ $this->byId("{$base}btn_after")->click();
$this->pause(800);
- $this->type('content', 'mauahahaha');
- $this->click('btn_replace');
+ $this->type("{$base}content", 'mauahahaha');
+ $this->byId("{$base}btn_replace")->click();
$this->pause(1000);
- $this->assertText('panel1', 'Main Panel pradomauahahahaphp');
+ $this->assertText("{$base}panel1", 'Main Panel pradomauahahaha php');
}
/*
function testIE()
{
- $this->open('active-controls/index.php?page=ReplaceContentTest');
- $this->assertTextPresent('Callback Replace Content Test');
+ $this->url('active-controls/index.php?page=ReplaceContentTest');
+ $this->assertContains('Callback Replace Content Test', $this->source());
- $this->assertText('subpanel', 'Sub Panel');
- $this->assertText('panel1', 'regexp:Main Panel\s*Sub Panel');
+ $this->assertText("{$base}subpanel", 'Sub Panel');
+ $this->assertText("{$base}panel1", 'regexp:Main Panel\s*Sub Panel');
- $this->type('content', 'something');
+ $this->type("{$base}content", 'something');
- $this->click('btn_append');
+ $this->byId('btn_append')->click();
$this->pause(800);
- $this->assertText('subpanel', 'Sub Panel something');
- $this->assertText('panel1', 'regexp:Main Panel\s*Sub Panel\s*something');
+ $this->assertText("{$base}subpanel", 'Sub Panel something');
+ $this->assertText("{$base}panel1", 'regexp:Main Panel\s*Sub Panel\s*something');
- $this->type('content', 'more');
- $this->click('btn_prepend');
+ $this->type("{$base}content", 'more');
+ $this->byId('btn_prepend')->click();
$this->pause(800);
- $this->assertText('subpanel', 'regexp:more\s*Sub Panel\s*something');
- $this->assertText('panel1', 'regexp:Main Panel\s*moreSub Panel\s*something');
+ $this->assertText("{$base}subpanel", 'regexp:more\s*Sub Panel\s*something');
+ $this->assertText("{$base}panel1", 'regexp:Main Panel\s*moreSub Panel\s*something');
- $this->type('content', 'prado');
- $this->click('btn_before');
+ $this->type("{$base}content", 'prado');
+ $this->byId('btn_before')->click();
$this->pause(800);
- $this->assertText('subpanel', 'regexp:more\s*Sub Panel\s*something');
- $this->assertText('panel1', 'regexp:Main Panel\s*prado\s*more\s*Sub Panel\s*something');
+ $this->assertText("{$base}subpanel", 'regexp:more\s*Sub Panel\s*something');
+ $this->assertText("{$base}panel1", 'regexp:Main Panel\s*prado\s*more\s*Sub Panel\s*something');
- $this->type('content', ' php ');
- $this->click('btn_after');
+ $this->type("{$base}content", ' php ');
+ $this->byId('btn_after')->click();
$this->pause(800);
- $this->type('content', 'mauahahaha');
- $this->click('btn_replace');
+ $this->type("{$base}content", 'mauahahaha');
+ $this->byId('btn_replace')->click();
$this->pause(1000);
- $this->assertText('panel1', 'Main Panel pradomauahahahaphp');
+ $this->assertText("{$base}panel1", 'Main Panel pradomauahahahaphp');
}
*/
}
diff --git a/tests/FunctionalTests/active-controls/tests/TextBoxCallbackTestCase.php b/tests/FunctionalTests/active-controls/tests/TextBoxCallbackTestCase.php
index 14d575fe..559c80a6 100755
--- a/tests/FunctionalTests/active-controls/tests/TextBoxCallbackTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/TextBoxCallbackTestCase.php
@@ -1,15 +1,16 @@
<?php
-class TextBoxCallbackTestCase extends PradoGenericSeleniumTest
+class TextBoxCallbackTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=ActiveTextBoxCallback");
- $this->verifyTextPresent("ActiveTextBox Callback Test");
- $this->assertText("label1", "Label 1");
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=ActiveTextBoxCallback");
+ $this->assertContains("ActiveTextBox Callback Test", $this->source());
+ $this->assertText("{$base}label1", "Label 1");
- $this->type("textbox1", "hello!");
+ $this->type("{$base}textbox1", "hello!");
$this->pause(800);
- $this->assertText("label1", "Label 1: hello!");
+ $this->assertText("{$base}label1", "Label 1: hello!");
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/TextBoxGroupValidationTestCase.php b/tests/FunctionalTests/active-controls/tests/TextBoxGroupValidationTestCase.php
index ffc1ac72..2562a18b 100755
--- a/tests/FunctionalTests/active-controls/tests/TextBoxGroupValidationTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/TextBoxGroupValidationTestCase.php
@@ -1,22 +1,23 @@
<?php
-class TextBoxGroupValidationTestCase extends PradoGenericSeleniumTest
+class TextBoxGroupValidationTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=TextBoxValidationCallback");
- $this->assertTextPresent('TextBox AutoPostBack With Group Validation');
- $this->assertNotVisible('validator1');
+ $base="ctl0_Content_";
+ $this->url("active-controls/index.php?page=TextBoxValidationCallback");
+ $this->assertContains('TextBox AutoPostBack With Group Validation', $this->source());
+ $this->assertNotVisible("{$base}validator1");
- $this->type('ZipCode', 'test');
- $this->assertVisible('validator1');
+ $this->type("{$base}ZipCode", 'test');
+ $this->assertVisible("{$base}validator1");
- $this->type('Address', 'Sydney');
- $this->type('ZipCode', '2000');
+ $this->type("{$base}Address", 'Sydney');
+ $this->type("{$base}ZipCode", '2000');
- $this->assertNotVisible('validator1');
+ $this->assertNotVisible("{$base}validator1");
$this->pause(800);
- $this->assertValue('City', 'City: Sydney Zip: 2000');
+ $this->assertValue("{$base}City", 'City: Sydney Zip: 2000');
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/TimeTriggeredCallbackTestCase.php b/tests/FunctionalTests/active-controls/tests/TimeTriggeredCallbackTestCase.php
index de0ecad8..741c7a2d 100755
--- a/tests/FunctionalTests/active-controls/tests/TimeTriggeredCallbackTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/TimeTriggeredCallbackTestCase.php
@@ -1,19 +1,20 @@
<?php
-class TimeTriggeredCallbackTestCase extends PradoGenericSeleniumTest
+class TimeTriggeredCallbackTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=TimeTriggeredCallbackTest");
- $this->verifyTextPresent("TimeTriggeredCallback + ViewState Tests");
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=TimeTriggeredCallbackTest");
+ $this->assertContains("TimeTriggeredCallback + ViewState Tests", $this->source());
- $this->assertText("label1", "ViewState Counter :");
+ $this->assertText("{$base}label1", "ViewState Counter :");
- $this->click("button1");
+ $this->byId("{$base}button1")->click();
$this->pause(8000);
- $this->assertText("label1", "ViewState Counter : 1 2 3 4 5 6 7 8 9 10");
+ $this->assertText("{$base}label1", "ViewState Counter : 1 2 3 4 5 6 7 8 9 10");
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php b/tests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php
index 5113cc92..8b0428a9 100755
--- a/tests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php
@@ -1,20 +1,21 @@
<?php
-class ValueTriggerTestCase extends PradoGenericSeleniumTest
+class ValueTriggerTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("active-controls/index.php?page=ValueTriggerCallbackTest");
- $this->verifyTextPresent("Value Trigger Callback Test");
+ $base='ctl0_Content_';
+ $this->url("active-controls/index.php?page=ValueTriggerCallbackTest");
+ $this->assertContains("Value Trigger Callback Test", $this->source());
- $this->assertText('label1', 'Label 1');
+ $this->assertText("{$base}label1", 'Label 1');
- $this->type('text1', 'test');
+ $this->type("{$base}text1", 'test');
$this->pause(2000);
- $this->assertText('label1', 'Old = : New Value = test');
+ $this->assertText("{$base}label1", 'Old = : New Value = test');
- $this->type('text1', 'more');
+ $this->type("{$base}text1", 'more');
$this->pause(3000);
- $this->assertText('label1', 'Old = test : New Value = more');
+ $this->assertText("{$base}label1", 'Old = test : New Value = more');
}
}
diff --git a/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php b/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php
index ef82eaa3..2b9a0166 100755
--- a/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php
+++ b/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php
@@ -1,242 +1,250 @@
<?php
/**
* ActiveRatingListTestCase.php
- *
+ *
* @author Bradley Booms <Bradley.Booms@nsighttel.com>
* @version Creation Date: Oct 22, 2008
*/
/**
* ActiveRatingListTestCase.php class
- *
- *
- *
+ *
+ *
+ *
* Properties
* -
- *
+ *
* @author Bradley Booms <Bradley.Booms@nsighttel.com>
* @version Modified Date: Oct 22, 2008
- *
+ *
* Modifications:
*/
-class ActiveRatingListTestCase extends PradoGenericSeleniumTest
+class ActiveRatingListTestCase extends PradoGenericSelenium2Test
{
function testCheckBoxes()
{
+ $base='ctl0_Content_';
// Verify we're on the right page.
- $this->open("active-controls/index.php?page=ActiveRatingListCheckBoxesTest");
- $this->verifyTextPresent("TActiveRatingList Check Boxes Test Case");
- $this->assertCheckBoxes("RatingList", array(2), 6);
-
+ $this->url("active-controls/index.php?page=ActiveRatingListCheckBoxesTest");
+ $this->assertContains("TActiveRatingList Check Boxes Test Case", $this->source());
+ $this->assertCheckBoxes("{$base}RatingList", array(2), 6);
+
// Change the list and make sure the radio buttons get updated properly.
- $this->clickTD("RatingList_c4");
+ $this->clickTD("{$base}RatingList_c4");
$this->pause(800);
- $this->assertCheckBoxes("RatingList", array(4), 6);
-
- $this->clickTD("RatingList_c2");
+ $this->assertCheckBoxes("{$base}RatingList", array(4), 6);
+
+ $this->clickTD("{$base}RatingList_c2");
$this->pause(800);
- $this->assertCheckBoxes("RatingList", array(2), 6);
+ $this->assertCheckBoxes("{$base}RatingList", array(2), 6);
}
function testRating()
{
+ $base='ctl0_Content_';
// Verify we're on the right page.
- $this->open("active-controls/index.php?page=ActiveRatingListRatingTest");
- $this->verifyTextPresent("TActiveRatingList Rating Test Case");
-
+ $this->url("active-controls/index.php?page=ActiveRatingListRatingTest");
+ $this->assertContains("TActiveRatingList Rating Test Case", $this->source());
+
// Check the list, make sure it starts out with 5 stars.
- $this->assertText("Status", "Rating: 5");
-
+ $this->assertText("{$base}Status", "Rating: 5");
+
// Click on 1 star and make sure the Rating property updates.
- $this->clickTD("RatingList_c0");
+ $this->clickTD("{$base}RatingList_c0");
$this->pause(800);
- $this->assertText("Status", "Rating: 1");
-
+ $this->assertText("{$base}Status", "Rating: 1");
+
// Then set Rating to three on the server side and make sure it's correct.
- $this->click("SetRating");
+ $this->byId("{$base}SetRating")->click();
$this->pause(800);
- $this->assertText("Status", "Rating: 3");
+ $this->assertText("{$base}Status", "Rating: 3");
}
function testSelectedIndex()
{
+ $base='ctl0_Content_';
// Verify we're on the right page.
- $this->open("active-controls/index.php?page=ActiveRatingListSelectedIndexTest");
- $this->verifyTextPresent("TActiveRatingList SelectedIndex Test Case");
- $this->assertText("Status", " SelectedIndex: 1");
-
+ $this->url("active-controls/index.php?page=ActiveRatingListSelectedIndexTest");
+ $this->assertContains("TActiveRatingList SelectedIndex Test Case", $this->source());
+ $this->assertText("{$base}Status", "SelectedIndex: 1");
+
// Click on 5 stars and make sure the SelectedIndex property updates.
- $this->clickTD("RatingList_c4");
+ $this->clickTD("{$base}RatingList_c4");
$this->pause(800);
- $this->assertText("Status", " SelectedIndex: 4");
-
+ $this->assertText("{$base}Status", "SelectedIndex: 4");
+
// Then set SelectedIndex to 5 on the server side and make sure it's correct.
- $this->click("SetSelectedIndex");
+ $this->byId("{$base}SetSelectedIndex")->click();
$this->pause(800);
- $this->assertText("Status", " SelectedIndex: 5");
+ $this->assertText("{$base}Status", "SelectedIndex: 5");
}
function testAutoPostBack()
{
+ $base='ctl0_Content_';
// Verify we're on the right page.
- $this->open("active-controls/index.php?page=ActiveRatingListAutoPostBackTest");
- $this->verifyTextPresent("TActiveRatingList AutoPostBack Test Case");
- $this->assertText("Status", "AutoPostback=false");
-
+ $this->url("active-controls/index.php?page=ActiveRatingListAutoPostBackTest");
+ $this->assertContains("TActiveRatingList AutoPostBack Test Case", $this->source());
+ $this->assertText("{$base}Status", "AutoPostback=false");
+
// Make sure that it doesn't auto post when clicked.
- $this->clickTD("RatingList_c3");
+ $this->clickTD("{$base}RatingList_c3");
$this->pause(800);
- $this->assertText("Status", "AutoPostback=false");
-
+ $this->assertText("{$base}Status", "AutoPostback=false");
+
// Then submit with an active button and make sure it updates.
- $this->click("Submit");
+ $this->byId("{$base}Submit")->click();
$this->pause(800);
- $this->assertText("Status", "4 : Good");
+ $this->assertText("{$base}Status", "4 : Good");
}
function testAllowInput()
{
+ $base='ctl0_Content_';
// Verify we're on the right page.
- $this->open("active-controls/index.php?page=ActiveRatingListAllowInputTest");
- $this->verifyTextPresent("TActiveRatingList AllowInput Test Case");
- $this->assertText("Status", "AllowInput=false");
- $this->assertCheckBoxes("RatingList", array(3), 6);
+ $this->url("active-controls/index.php?page=ActiveRatingListAllowInputTest");
+ $this->assertContains("TActiveRatingList AllowInput Test Case", $this->source());
+ $this->assertText("{$base}Status", "AllowInput=false");
+ $this->assertCheckBoxes("{$base}RatingList", array(3), 6);
// Make sure that clicking doesn't change anything.
- $this->clickTD("RatingList_c5");
+ $this->clickTD("{$base}RatingList_c5");
$this->pause(800);
- $this->assertText("Status", "AllowInput=false");
- $this->assertCheckBoxes("RatingList", array(3), 6);
+ $this->assertText("{$base}Status", "AllowInput=false");
+ $this->assertCheckBoxes("{$base}RatingList", array(3), 6);
}
function testReadOnly()
{
+ $base='ctl0_Content_';
// Verify we're on the right page.
- $this->open("active-controls/index.php?page=ActiveRatingListReadOnlyTest");
- $this->verifyTextPresent("TActiveRatingList ReadOnly Test Case");
- $this->assertText("Status", "ReadOnly=true");
- $this->assertCheckBoxes("RatingList", array(0), 6);
+ $this->url("active-controls/index.php?page=ActiveRatingListReadOnlyTest");
+ $this->assertContains("TActiveRatingList ReadOnly Test Case", $this->source());
+ $this->assertText("{$base}Status", "ReadOnly=true");
+ $this->assertCheckBoxes("{$base}RatingList", array(0), 6);
- $this->clickTD("RatingList_c4");
+ $this->clickTD("{$base}RatingList_c4");
$this->pause(800);
- $this->assertText("Status", "ReadOnly=true");
- $this->assertCheckBoxes("RatingList", array(0), 6);
-
+ $this->assertText("{$base}Status", "ReadOnly=true");
+ $this->assertCheckBoxes("{$base}RatingList", array(0), 6);
+
// Then set ReadOnly to false, and make sure it works.
- $this->click("Writable");
+ $this->byId("{$base}Writable")->click();
$this->pause(800);
- $this->assertText("Status", "ReadOnly=false");
- $this->assertCheckBoxes("RatingList", array(0), 6);
-
-
- $this->clickTD("RatingList_c1");
+ $this->assertText("{$base}Status", "ReadOnly=false");
+ $this->assertCheckBoxes("{$base}RatingList", array(0), 6);
+
+
+ $this->clickTD("{$base}RatingList_c1");
$this->pause(800);
- $this->assertText("Status", "2 : Fair");
- $this->assertCheckBoxes("RatingList", array(1), 6);
-
+ $this->assertText("{$base}Status", "2 : Fair");
+ $this->assertCheckBoxes("{$base}RatingList", array(1), 6);
+
// Then set ReadOnly to true, and make sure it doesn't work anymore.
- $this->click("ReadOnly");
+ $this->byId("{$base}ReadOnly")->click();
$this->pause(800);
- $this->assertText("Status", "ReadOnly=true");
- $this->assertCheckBoxes("RatingList", array(1), 6);
-
-
- $this->clickTD("RatingList_c2");
+ $this->assertText("{$base}Status", "ReadOnly=true");
+ $this->assertCheckBoxes("{$base}RatingList", array(1), 6);
+
+
+ $this->clickTD("{$base}RatingList_c2");
$this->pause(800);
- $this->assertText("Status", "ReadOnly=true");
- $this->assertCheckBoxes("RatingList", array(1), 6);
+ $this->assertText("{$base}Status", "ReadOnly=true");
+ $this->assertCheckBoxes("{$base}RatingList", array(1), 6);
}
function testEnabled()
{
+ $base='ctl0_Content_';
// Verify we're on the right page.
- $this->open("active-controls/index.php?page=ActiveRatingListEnabledTest");
- $this->verifyTextPresent("TActiveRatingList Enabled Test Case");
- $this->assertText("Status", "Enabled=false");
- $this->assertCheckBoxes("RatingList", array(5), 6);
+ $this->url("active-controls/index.php?page=ActiveRatingListEnabledTest");
+ $this->assertContains("TActiveRatingList Enabled Test Case", $this->source());
+ $this->assertText("{$base}Status", "Enabled=false");
+ $this->assertCheckBoxes("{$base}RatingList", array(5), 6);
- $this->clickTD("RatingList_c4");
+ $this->clickTD("{$base}RatingList_c4");
$this->pause(800);
- $this->assertText("Status", "Enabled=false");
- $this->assertCheckBoxes("RatingList", array(5), 6);
-
+ $this->assertText("{$base}Status", "Enabled=false");
+ $this->assertCheckBoxes("{$base}RatingList", array(5), 6);
+
// Then set Enable to true, and make sure it works.
- $this->click("Enable");
+ $this->byId("{$base}Enable")->click();
$this->pause(800);
- $this->assertText("Status", "Enabled=true");
- $this->assertCheckBoxes("RatingList", array(5), 6);
-
-
- $this->clickTD("RatingList_c3");
+ $this->assertText("{$base}Status", "Enabled=true");
+ $this->assertCheckBoxes("{$base}RatingList", array(5), 6);
+
+
+ $this->clickTD("{$base}RatingList_c3");
$this->pause(800);
- $this->assertText("Status", "4 : Good");
- $this->assertCheckBoxes("RatingList", array(3), 6);
-
+ $this->assertText("{$base}Status", "4 : Good");
+ $this->assertCheckBoxes("{$base}RatingList", array(3), 6);
+
// Then set Enable to false, and make sure it doesn't work anymore.
- $this->click("Disable");
+ $this->byId("{$base}Disable")->click();
$this->pause(800);
- $this->assertText("Status", "Enabled=false");
- $this->assertCheckBoxes("RatingList", array(3), 6);
-
-
- $this->clickTD("RatingList_c5");
+ $this->assertText("{$base}Status", "Enabled=false");
+ $this->assertCheckBoxes("{$base}RatingList", array(3), 6);
+
+
+ $this->clickTD("{$base}RatingList_c5");
$this->pause(800);
- $this->assertText("Status", "Enabled=false");
- $this->assertCheckBoxes("RatingList", array(3), 6);
+ $this->assertText("{$base}Status", "Enabled=false");
+ $this->assertCheckBoxes("{$base}RatingList", array(3), 6);
}
-
+
function testHoverCaption()
{
+ $base='ctl0_Content_';
// Verify we're on the right page.
- $this->open("active-controls/index.php?page=ActiveRatingListHoverCaptionTest");
- $this->verifyTextPresent("TActiveRatingList Hover Caption Test Case");
- $this->assertText("Status", "CaptionID='Status'");
- $this->assertElementPresent("//input[@id='RatingList_c0']/../../../td[contains(@class, 'rating_selected')]");
- $this->assertElementPresent("//input[@id='RatingList_c1']/../../../td[contains(@class, 'rating_selected')]");
- $this->assertElementPresent("//input[@id='RatingList_c2']/../../../td[contains(@class, 'rating_selected')]");
- $this->assertElementPresent("//input[@id='RatingList_c3']/../../../td[contains(@class, 'rating_half')]");
- $this->assertElementPresent("//input[@id='RatingList_c3']/../../../td[contains(@class, 'rating')]");
- $this->assertElementPresent("//input[@id='RatingList_c4']/../../../td[contains(@class, 'rating')]");
- $this->assertElementPresent("//input[@id='RatingList_c5']/../../../td[contains(@class, 'rating')]");
-
- $this->mouseOver("//input[@id='RatingList_c4']/../../");
- $this->assertText("Status", "Excellent");
- $this->assertElementPresent("//input[@id='RatingList_c0']/../../../td[contains(@class, 'rating_hover')]");
- $this->assertElementPresent("//input[@id='RatingList_c1']/../../../td[contains(@class, 'rating_hover')]");
- $this->assertElementPresent("//input[@id='RatingList_c2']/../../../td[contains(@class, 'rating_hover')]");
- $this->assertElementPresent("//input[@id='RatingList_c3']/../../../td[contains(@class, 'rating_hover')]");
- $this->assertElementPresent("//input[@id='RatingList_c4']/../../../td[contains(@class, 'rating_hover')]");
- $this->assertElementPresent("//input[@id='RatingList_c5']/../../../td[not(contains(@class, 'rating_hover'))]");
- $this->assertElementPresent("//input[@id='RatingList_c5']/../../../td[contains(@class, 'rating')]");
-
- $this->mouseOut("//input[@id='RatingList_c4']/../../");
- $this->assertText("Status", "CaptionID='Status'");
- $this->assertElementPresent("//input[@id='RatingList_c0']/../../../td[contains(@class, 'rating_selected')]");
- $this->assertElementPresent("//input[@id='RatingList_c1']/../../../td[contains(@class, 'rating_selected')]");
- $this->assertElementPresent("//input[@id='RatingList_c2']/../../../td[contains(@class, 'rating_selected')]");
- $this->assertElementPresent("//input[@id='RatingList_c3']/../../../td[not(contains(@class, 'rating_selected'))]");
- $this->assertElementPresent("//input[@id='RatingList_c3']/../../../td[contains(@class, 'rating')]");
- $this->assertElementPresent("//input[@id='RatingList_c4']/../../../td[contains(@class, 'rating')]");
- $this->assertElementPresent("//input[@id='RatingList_c5']/../../../td[contains(@class, 'rating')]");
-
-
- $this->mouseOver("//input[@id='RatingList_c1']/../../");
- $this->assertText("Status", "Fair");
-
- $this->click("//input[@id='RatingList_c1']/../../");
- $this->pause(800);
- $this->assertText("Status", "2 : Fair");
- $this->assertElementPresent("//input[@id='RatingList_c0']/../../../td[contains(@class, 'rating_selected')]");
- $this->assertElementPresent("//input[@id='RatingList_c1']/../../../td[contains(@class, 'rating_selected')]");
- $this->assertElementPresent("//input[@id='RatingList_c2']/../../../td[not(contains(@class, 'rating_selected'))]");
- $this->assertElementPresent("//input[@id='RatingList_c2']/../../../td[contains(@class, 'rating')]");
- $this->assertElementPresent("//input[@id='RatingList_c3']/../../../td[contains(@class, 'rating')]");
- $this->assertElementPresent("//input[@id='RatingList_c4']/../../../td[contains(@class, 'rating')]");
- $this->assertElementPresent("//input[@id='RatingList_c5']/../../../td[contains(@class, 'rating')]");
+ $this->url("active-controls/index.php?page=ActiveRatingListHoverCaptionTest");
+ $this->assertContains("TActiveRatingList Hover Caption Test Case", $this->source());
+ $this->assertText("{$base}Status", "CaptionID='Status'");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c0']/../../../td[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c1']/../../../td[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c2']/../../../td[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c3']/../../../td[contains(@class, 'rating_half')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c3']/../../../td[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c4']/../../../td[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c5']/../../../td[contains(@class, 'rating')]");
+
+ $this->moveto($this->byXPath("//input[@id='{$base}RatingList_c4']/../.."));
+ $this->assertText("{$base}Status", "Excellent");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c0']/../../../td[contains(@class, 'rating_hover')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c1']/../../../td[contains(@class, 'rating_hover')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c2']/../../../td[contains(@class, 'rating_hover')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c3']/../../../td[contains(@class, 'rating_hover')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c4']/../../../td[contains(@class, 'rating_hover')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c5']/../../../td[not(contains(@class, 'rating_hover'))]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c5']/../../../td[contains(@class, 'rating')]");
+
+ $this->moveto($this->byCssSelector('body'));
+ $this->assertText("{$base}Status", "CaptionID='Status'");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c0']/../../../td[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c1']/../../../td[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c2']/../../../td[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c3']/../../../td[not(contains(@class, 'rating_selected'))]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c3']/../../../td[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c4']/../../../td[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c5']/../../../td[contains(@class, 'rating')]");
+
+
+ $this->moveto($this->byXPath("//input[@id='{$base}RatingList_c1']/../.."));
+ $this->assertText("{$base}Status", "Fair");
+
+ $this->byXPath("//input[@id='{$base}RatingList_c1']/../..")->click();
+ $this->pause(800);
+ $this->assertText("{$base}Status", "2 : Fair");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c0']/../../../td[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c1']/../../../td[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c2']/../../../td[not(contains(@class, 'rating_selected'))]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c2']/../../../td[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c3']/../../../td[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c4']/../../../td[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='{$base}RatingList_c5']/../../../td[contains(@class, 'rating')]");
}
-
+
function clickTD($clientID){
- $this->click("//input[@id='{$clientID}']/../..");
+ $this->byXPath("//input[@id='{$clientID}']/../..")->click();
}
function assertCheckBoxes($clientID, $checks, $total = 5)
@@ -244,9 +252,9 @@ class ActiveRatingListTestCase extends PradoGenericSeleniumTest
for($i = 0; $i < $total; $i++)
{
if(in_array($i, $checks))
- $this->assertChecked("{$clientID}_c{$i}");
+ $this->assertTrue($this->byId("{$clientID}_c{$i}")->selected());
else
- $this->assertNotChecked("{$clientID}_c{$i}");
+ $this->assertFalse($this->byId("{$clientID}_c{$i}")->selected());
}
}
} \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/controls/Layout.tpl b/tests/FunctionalTests/features/protected/controls/Layout.tpl
index dbd433b8..66b42f6c 100755
--- a/tests/FunctionalTests/features/protected/controls/Layout.tpl
+++ b/tests/FunctionalTests/features/protected/controls/Layout.tpl
@@ -27,7 +27,6 @@
<body>
<com:TForm>
<com:TContentPlaceHolder ID="Content" />
-<com:TJavascriptLogger />
</com:TForm>
</body>
</html> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php b/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php
index d4a98e26..5292affb 100755
--- a/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php
+++ b/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php
@@ -22,23 +22,23 @@ class BasicI18N extends TPage
* @version $Revision: 1.66 $ $Date: ${DATE} ${TIME} $
* @package ${package}
*//*
-class BasicI18NTestCase extends PradoGenericSeleniumTest
+class BasicI18NTestCase extends PradoGenericSelenium2Test
{
function setup()
{
$page = Prado::getApplication()->getTestPage(__FILE__);
- $this->open($page);
+ $this->url($page);
}
function testI18N()
{
- $this->verifyTitle("Basic I18N Test", "");
- $this->verifyTextPresent("Hello", "");
- $this->verifyTextPresent("US$10,000.00", "");
- $this->verifyTextPresent("2006年1月15日 上午12时00分00秒", "");
- $this->verifyTextPresent("None", "");
- $this->verifyTextPresent("One thing.", "");
- $this->verifyTextPresent("Many things.", "");
+ $this->assertEquals("Basic I18N Test", $this->title());
+ $this->assertContains("Hello", $this->source());
+ $this->assertContains("US$10,000.00", $this->source());
+ $this->assertContains("2006年1月15日 上午12时00分00秒", $this->source());
+ $this->assertContains("None", $this->source());
+ $this->assertContains("One thing.", $this->source());
+ $this->assertContains("Many things.", $this->source());
}
}
*/ \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/RatingList.page b/tests/FunctionalTests/features/protected/pages/RatingList.page
index 909180c7..eaf9a282 100755
--- a/tests/FunctionalTests/features/protected/pages/RatingList.page
+++ b/tests/FunctionalTests/features/protected/pages/RatingList.page
@@ -2,40 +2,46 @@
<h1>TRatingList Examples</h1>
<h2>Default TRatingList</h2>
- <com:TRatingList RepeatDirection="Vertical" Style="caption-side: right;">
+ <com:TLabel ID="label1" Text="Rate it:" />
+ <com:TRatingList CaptionID="label1">
<com:TListItem Text="Fair" />
<com:TListItem Text="Average" />
<com:TListItem Text="Good" />
- <com:TListItem Text="Execellent" />
+ <com:TListItem Text="Excellent" />
</com:TRatingList>
-<h2>TRatingList </h2>
- <com:TRatingList SelectedIndex="2">
+<h2>TRatingList in vertical mode, SelectedIndex=2</h2>
+ <com:TLabel ID="label2" Text="Rate it:" />
+ <com:TRatingList CaptionID="label2" SelectedIndex="2" RepeatDirection="Vertical" Style="caption-side: right;">
<com:TListItem Text="Poor" />
<com:TListItem Text="Fair" />
<com:TListItem Text="Average" />
<com:TListItem Text="Good" />
- <com:TListItem Text="Execellent" />
+ <com:TListItem Text="Excellent" />
<com:TListItem Text="Super" />
</com:TRatingList>
-<h2>TRatingList </h2>
- <com:TRatingList RatingStyle="blocks" SelectedValue="Good">
+<h2>TRatingList with RatingStyle=blocks, AutoPostback=true, SelectedValue=Good</h2>
+ <com:TLabel ID="label3" Text="Rate it:" />
+ <com:TRatingList ID="Rating3" CaptionID="label3" RatingStyle="blocks" SelectedValue="Good" AutoPostBack="true" OnSelectedIndexChanged="rating3_selectionChanged">
<com:TListItem Text="Poor" />
<com:TListItem Text="Fair" />
<com:TListItem Text="Average" />
<com:TListItem Text="Good" />
- <com:TListItem Text="Execellent" />
+ <com:TListItem Text="Excellent" />
<com:TListItem Text="Super" />
</com:TRatingList>
+ Postback result: <com:TLabel ID="labelResult3" />
-<h2>TRatingList </h2>
- <com:TRatingList ID="Rating1" AllowInput="false" Caption="Rating:" Rating="4.6">
+<h2>TRatingList with AllowInput=false, Rating=4.6</h2>
+ <com:TLabel ID="label4" Text="Rate it:" />
+ <com:TRatingList CaptionID="label4" AllowInput="false" Rating="4.6">
<com:TListItem Text="Poor" />
<com:TListItem Text="Fair" />
<com:TListItem Text="Average" />
<com:TListItem Text="Good" />
- <com:TListItem Text="Execellent" />
+ <com:TListItem Text="Excellent" />
<com:TListItem Text="Super" />
- </com:TRatingList>
+ </com:TRatingList>
+
</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/RatingList.php b/tests/FunctionalTests/features/protected/pages/RatingList.php
new file mode 100755
index 00000000..9592680a
--- /dev/null
+++ b/tests/FunctionalTests/features/protected/pages/RatingList.php
@@ -0,0 +1,9 @@
+<?php
+
+class RatingList extends TPage
+{
+ protected function rating3_selectionChanged($sender, $param)
+ {
+ $this->labelResult3->Text=$this->Rating3->SelectedValue;
+ }
+} \ No newline at end of file
diff --git a/tests/FunctionalTests/features/tests/MyTestCase.php b/tests/FunctionalTests/features/tests/MyTestCase.php
index 92b0886a..d748b6b0 100755
--- a/tests/FunctionalTests/features/tests/MyTestCase.php
+++ b/tests/FunctionalTests/features/tests/MyTestCase.php
@@ -1,10 +1,10 @@
<?php
-class MyTestCase extends PradoGenericSeleniumTest
+class MyTestCase extends PradoGenericSelenium2Test
{
function test1()
{
- $this->open('http://127.0.0.1');
- $this->assertTextNotPresent('asd');
+ $this->url('http://127.0.0.1');
+ $this->assertNotContains('asd', $this->source());
}
}
diff --git a/tests/FunctionalTests/issues/protected/pages/Issue516.page b/tests/FunctionalTests/issues/protected/pages/Issue516.page
new file mode 100644
index 00000000..c922c6e1
--- /dev/null
+++ b/tests/FunctionalTests/issues/protected/pages/Issue516.page
@@ -0,0 +1,50 @@
+ <com:TContent ID="Content">
+
+<h1>Issue 516 Test</h1>
+
+<com:TActiveDataGrid
+ Width="800px"
+ CellPadding="2"
+ ID="DataGrid"
+ DataKeyField="ISBN"
+ AutoGenerateColumns="false"
+ HeaderStyle.BackColor="black"
+ HeaderStyle.ForeColor="white"
+ ItemStyle.BackColor="#BFCFFF"
+ ItemStyle.Font.Italic="true"
+ AlternatingItemStyle.BackColor="#E6ECFF"
+ EditItemStyle.BackColor="lightyellow"
+ OnEditCommand="editItem"
+ OnUpdateCommand="saveItem"
+ OnCancelCommand="cancelItem"
+ >
+ <com:TTemplateColumn
+ ID="BookTitleColumn"
+ HeaderText="Book Title"
+ HeaderStyle.Width="400px"
+ >
+ <prop:ItemTemplate>
+ <com:TLiteral Text="<%# $this->Parent->Data['title'] %>" Encode="true" />
+ </prop:ItemTemplate>
+ <prop:EditItemTemplate>
+ <com:TTextBox ID="TextBox" Text="<%# $this->Parent->Data['title'] %>" />
+ <com:TRequiredFieldValidator
+ ControlToValidate="TextBox"
+ Display="Dynamic"
+ ErrorMessage="<br/>Please provide a title."
+ ValidationGroup = "Group1"
+ />
+ </prop:EditItemTemplate>
+ </com:TTemplateColumn>
+ <com:TActiveEditCommandColumn
+ HeaderText="Edit"
+ HeaderStyle.Width="100px"
+ UpdateText="Save"
+ ItemStyle.HorizontalAlign="Center"
+ ItemStyle.Font.Italic="false"
+ ValidationGroup = "Group1"
+ />
+</com:TActiveDataGrid>
+
+ </com:TContent>
+
diff --git a/tests/FunctionalTests/issues/protected/pages/Issue516.php b/tests/FunctionalTests/issues/protected/pages/Issue516.php
new file mode 100644
index 00000000..bd3e7a72
--- /dev/null
+++ b/tests/FunctionalTests/issues/protected/pages/Issue516.php
@@ -0,0 +1,115 @@
+<?php
+
+Prado::using('System.Web.UI.ActiveControls.*');
+
+class Issue516 extends TPage
+{
+ private $_data=null;
+
+ protected function getData()
+ {
+ if($this->_data===null)
+ $this->loadData();
+ return $this->_data;
+ }
+
+ protected function loadData()
+ {
+ // We use viewstate keep track of data.
+ // In real applications, data should come from database using an SQL SELECT statement.
+ // In the following tabular data, field 'ISBN' is the primary key.
+ // All update and delete operations should come with an 'id' value in order to go through.
+ if(($this->_data=$this->getViewState('Data',null))===null)
+ {
+ $this->_data=array(
+ array(
+ 'ISBN'=>'0596007124',
+ 'title'=>'',
+ ),
+ array(
+ 'ISBN'=>'0201633612',
+ 'title'=>'Design Patterns: Elements of Reusable Object-Oriented Software',
+ ),
+ array(
+ 'ISBN'=>'0321247140',
+ 'title'=>'Design Patterns Explained : A New Perspective on Object-Oriented Design',
+ ),
+ array(
+ 'ISBN'=>'0201485672',
+ 'title'=>'Refactoring: Improving the Design of Existing Code',
+ ),
+ array(
+ 'ISBN'=>'0321213351',
+ 'title'=>'Refactoring to Patterns',
+ ),
+ array(
+ 'ISBN'=>'0735619670',
+ 'title'=>'Code Complete',
+ ),
+ array(
+ 'ISBN'=>'0321278658 ',
+ 'title'=>'Extreme Programming Explained : Embrace Change',
+ ),
+ );
+ $this->saveData();
+ }
+ }
+
+ protected function saveData()
+ {
+ $this->setViewState('Data',$this->_data);
+ }
+
+ protected function updateBook($isbn,$title)
+ {
+ // In real applications, data should be saved to database using an SQL UPDATE statement
+ if($this->_data===null)
+ $this->loadData();
+ $updateRow=null;
+ foreach($this->_data as $index=>$row)
+ if($row['ISBN']===$isbn)
+ $updateRow=&$this->_data[$index];
+ if($updateRow!==null)
+ {
+ $updateRow['title']=$title;
+ $this->saveData();
+ }
+ }
+
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ if(!$this->IsPostBack && !$this->IsCallBack)
+ {
+ $this->DataGrid->DataSource=$this->Data;
+ $this->DataGrid->dataBind();
+ }
+ }
+
+ public function editItem($sender,$param)
+ {
+ $this->DataGrid->EditItemIndex=$param->Item->ItemIndex;
+ $this->DataGrid->DataSource=$this->Data;
+ $this->DataGrid->dataBind();
+ }
+
+ public function saveItem($sender,$param)
+ {
+ $item=$param->Item;
+ $this->updateBook(
+ $this->DataGrid->DataKeys[$item->ItemIndex], // ISBN
+ $item->BookTitleColumn->TextBox->Text // title
+ );
+ $this->DataGrid->EditItemIndex=-1;
+ $this->DataGrid->DataSource=$this->Data;
+ $this->DataGrid->dataBind();
+ }
+
+ public function cancelItem($sender,$param)
+ {
+ $this->DataGrid->EditItemIndex=-1;
+ $this->DataGrid->DataSource=$this->Data;
+ $this->DataGrid->dataBind();
+ }
+
+}
diff --git a/tests/FunctionalTests/issues/tests/Issue516TestCase.php b/tests/FunctionalTests/issues/tests/Issue516TestCase.php
new file mode 100644
index 00000000..363e9f84
--- /dev/null
+++ b/tests/FunctionalTests/issues/tests/Issue516TestCase.php
@@ -0,0 +1,37 @@
+<?php
+
+class Issue516TestCase extends PradoGenericSelenium2Test
+{
+ function test()
+ {
+ $this->url('issues/index.php?page=Issue516');
+ $this->assertContains('Issue 516 Test', $this->source());
+ $base='ctl0_Content_';
+ $row1='DataGrid_ctl1_';
+ $row2='DataGrid_ctl2_';
+
+ // click "edit" and check for textbox
+ $this->byID("{$base}{$row1}ctl3")->click();
+ $this->pause(800);
+ $this->assertElementPresent("{$base}{$row1}TextBox");
+ // click "save" and check for validator
+ $this->byID("{$base}{$row1}ctl3")->click();
+ $this->pause(800);
+ $this->assertEquals('Please provide a title.', $this->getElement("{$base}{$row1}ctl1")->text());
+ // click "cancel" and ensure validator has disappeared
+ $this->byID("{$base}{$row1}ctl4")->click();
+ $this->pause(800);
+ $this->assertElementNotPresent("{$base}{$row1}ctl1");
+
+ // click "edit" and check for textbox on the second row
+ $this->byID("{$base}{$row2}ctl3")->click();
+ $this->pause(800);
+ $this->assertTrue($this->getElement("{$base}{$row2}TextBox")!==null);
+ // click "save" and ensure bvalidation has been successfull
+ $this->byID("{$base}{$row2}ctl3")->click();
+ $this->pause(800);
+ $this->assertElementNotPresent("{$base}{$row2}ctl1");
+ $this->assertElementNotPresent("{$base}{$row2}TextBox");
+ $this->assertEquals('Edit', $this->getElement("{$base}{$row2}ctl3")->text());
+ }
+}
diff --git a/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php b/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php
index 03861440..9d816978 100755
--- a/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php
+++ b/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php
@@ -1,36 +1,36 @@
<?php
//$Id: ActiveButtonTestCase.php 3187 2012-07-12 11:21:01Z ctrlaltca $
-class QuickstartActiveButtonTestCase extends PradoGenericSeleniumTest
+class QuickstartActiveButtonTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveButton.Home&amp;notheme=true&amp;lang=en");
+ $this->url("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveButton.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
- $this->assertTextPresent('TActiveButton Samples (AJAX)');
+ $this->assertContains('TActiveButton Samples (AJAX)', $this->source());
// a click button
- $this->verifyElementNotPresent("//input[@type='submit' and @value=\"I'm clicked\"]");
- $this->click("//input[@type='submit' and @value='click me']", "");
+ $this->assertElementNotPresent("//input[@type='submit' and @value=\"I'm clicked\"]");
+ $this->byXPath("//input[@type='submit' and @value='click me']")->click();
$this->pause(800);
- $this->verifyElementPresent("//input[@type='submit' and @value=\"I'm clicked\"]");
+ $this->assertElementPresent("//input[@type='submit' and @value=\"I'm clicked\"]");
// a command button
- $this->verifyElementNotPresent("//input[@type='submit' and @value=\"Name: test, Param: value using callback\"]");
- $this->click("//input[@type='submit' and @value='click me']", "");
+ $this->assertElementNotPresent("//input[@type='submit' and @value=\"Name: test, Param: value using callback\"]");
+ $this->byXPath("//input[@type='submit' and @value='click me']")->click();
$this->pause(800);
- $this->verifyElementPresent("//input[@type='submit' and @value=\"Name: test, Param: value using callback\"]");
+ $this->assertElementPresent("//input[@type='submit' and @value=\"Name: test, Param: value using callback\"]");
// a button causing validation
- $this->verifyNotVisible('ctl0_body_ctl2');
- $this->click("//input[@type='submit' and @value='submit']", "");
+ $this->assertNotVisible('ctl0_body_ctl2');
+ $this->byXPath("//input[@type='submit' and @value='submit']")->click();
$this->pause(800);
- $this->verifyVisible('ctl0_body_ctl2');
+ $this->assertVisible('ctl0_body_ctl2');
$this->type("ctl0\$body\$TextBox", "test");
- $this->click("//input[@type='submit' and @value='submit']", "");
+ $this->byXPath("//input[@type='submit' and @value='submit']")->click();
$this->pause(800);
- $this->verifyNotVisible('ctl0_body_ctl2');
- $this->verifyElementPresent("//input[@type='submit' and @value=\"I'm clicked using callback\"]", "");
+ $this->assertNotVisible('ctl0_body_ctl2');
+ $this->assertElementPresent("//input[@type='submit' and @value=\"I'm clicked using callback\"]", "");
}
}
diff --git a/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php b/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php
index 257917ec..9e537abd 100755
--- a/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php
+++ b/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php
@@ -1,58 +1,57 @@
<?php
//$Id: ActiveCheckBoxTestCase.php 3187 2012-07-12 11:21:01Z ctrlaltca $
-class QuickstartActiveCheckBoxTestCase extends PradoGenericSeleniumTest
+class QuickstartActiveCheckBoxTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->setSpeed(500);
- $this->open("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveCheckBox.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveCheckBox.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
- $this->assertTextPresent('TActiveCheckBox Samples (AJAX)');
+ $this->assertContains('TActiveCheckBox Samples (AJAX)', $this->source());
// an auto postback checkbox
- $this->verifyTextNotPresent("ctl0_body_ctl0 clicked using callback");
- $this->click("//input[@name='ctl0\$body\$ctl0']");
+ $this->assertNotContains("ctl0_body_ctl0 clicked using callback", $this->source());
+ $this->byXPath("//input[@name='ctl0\$body\$ctl0']")->click();
$this->pause(800);
- $this->assertChecked("//input[@name='ctl0\$body\$ctl0']");
- $this->verifyTextPresent("ctl0_body_ctl0 clicked using callback");
- $this->click("//input[@name='ctl0\$body\$ctl0']");
+ $this->assertTrue($this->byXPath("//input[@name='ctl0\$body\$ctl0']")->selected());
+ $this->assertContains("ctl0_body_ctl0 clicked using callback", $this->source());
+ $this->byXPath("//input[@name='ctl0\$body\$ctl0']")->click();
$this->pause(800);
- $this->verifyTextPresent("ctl0_body_ctl0 clicked using callback");
- $this->assertNotChecked("//input[@name='ctl0\$body\$ctl0']");
+ $this->assertContains("ctl0_body_ctl0 clicked using callback", $this->source());
+ $this->assertFalse($this->byXPath("//input[@name='ctl0\$body\$ctl0']")->selected());
// a checkbox causing validation on a textbox
- $this->verifyNotVisible('ctl0_body_ctl1');
- $this->click("//input[@name='ctl0\$body\$ctl2']");
- $this->verifyVisible('ctl0_body_ctl1');
- $this->click("//input[@name='ctl0\$body\$ctl2']", "");
- $this->verifyVisible('ctl0_body_ctl3');
+ $this->assertNotVisible('ctl0_body_ctl1');
+ $this->byXPath("//input[@name='ctl0\$body\$ctl2']")->click();
+ $this->assertVisible('ctl0_body_ctl1');
+ $this->byXPath("//input[@name='ctl0\$body\$ctl2']")->click();
+ $this->assertVisible('ctl0_body_ctl3');
$this->type("ctl0\$body\$TextBox", "test");
- $this->click("//input[@name='ctl0\$body\$ctl2']", "");
+ $this->byXPath("//input[@name='ctl0\$body\$ctl2']")->click();
$this->pause(800);
- $this->verifyNotVisible('ctl0_body_ctl1');
- $this->assertTextPresent("ctl0_body_ctl2 clicked using callback");
+ $this->assertNotVisible('ctl0_body_ctl1');
+ $this->assertContains("ctl0_body_ctl2 clicked using callback", $this->source());
// a checkbox validated by a required field validator
- $this->assertNotChecked("//input[@name='ctl0\$body\$CheckBox']");
- $this->verifyNotVisible('ctl0_body_ctl4');
- $this->click("//input[@type='submit' and @value='Submit']", "");
- $this->verifyVisible('ctl0_body_ctl4');
- $this->click("//input[@name='ctl0\$body\$CheckBox']", "");
- $this->assertChecked("//input[@name='ctl0\$body\$CheckBox']");
- $this->click("//input[@type='submit' and @value='Submit']", "");
- $this->verifyNotVisible('ctl0_body_ctl4');
- $this->assertTextPresent("ctl0_body_CheckBox clicked");
+ $this->assertFalse($this->byXPath("//input[@name='ctl0\$body\$CheckBox']")->selected());
+ $this->assertNotVisible('ctl0_body_ctl4');
+ $this->byXPath("//input[@type='submit' and @value='Submit']")->click();
+ $this->assertVisible('ctl0_body_ctl4');
+ $this->byXPath("//input[@name='ctl0\$body\$CheckBox']")->click();
+ $this->assertTrue($this->byXPath("//input[@name='ctl0\$body\$CheckBox']")->selected());
+ $this->byXPath("//input[@type='submit' and @value='Submit']")->click();
+ $this->pause(800);
+ $this->assertNotVisible('ctl0_body_ctl4');
+ $this->assertContains("ctl0_body_CheckBox clicked", $this->source());
// a checkbox validated by a required field validator using AutoPostBack
- $this->assertChecked("//input[@name='ctl0\$body\$CheckBox2']");
- $this->verifyNotVisible('ctl0_body_ctl5');
- $this->click("//input[@name='ctl0\$body\$CheckBox2']", "");
- $this->verifyVisible('ctl0_body_ctl5');
- $this->assertChecked("//input[@name='ctl0\$body\$CheckBox2']");
- $this->setSpeed(0);
+ $this->assertTrue($this->byXPath("//input[@name='ctl0\$body\$CheckBox2']")->selected());
+ $this->assertNotVisible('ctl0_body_ctl5');
+ $this->byXPath("//input[@name='ctl0\$body\$CheckBox2']")->click();
+ $this->assertVisible('ctl0_body_ctl5');
+ $this->assertTrue($this->byXPath("//input[@name='ctl0\$body\$CheckBox2']")->selected());
}
}
diff --git a/tests/FunctionalTests/quickstart/ActiveControls/ActiveCustomValidatorTestCase.php b/tests/FunctionalTests/quickstart/ActiveControls/ActiveCustomValidatorTestCase.php
index 967842b0..7cb29382 100755
--- a/tests/FunctionalTests/quickstart/ActiveControls/ActiveCustomValidatorTestCase.php
+++ b/tests/FunctionalTests/quickstart/ActiveControls/ActiveCustomValidatorTestCase.php
@@ -1,19 +1,19 @@
<?php
//$Id: ActiveButtonTestCase.php 1405 2006-09-10 01:03:56Z wei $
-class QuickstartActiveCustomValidatorTestCase extends PradoGenericSeleniumTest
+class QuickstartActiveCustomValidatorTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveCustomValidator.Home&amp;notheme=true&amp;lang=en");
+ $this->url("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveCustomValidator.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
- $this->assertTextPresent('TActiveCustomValidator Samples (AJAX)');
+ $this->assertContains('TActiveCustomValidator Samples (AJAX)', $this->source());
$base = 'ctl0_body_';
$this->assertNotVisible($base.'validator1');
- $this->click($base.'button1');
+ $this->byId($base.'button1')->click();
$this->pause(800);
$this->assertVisible($base.'validator1');
@@ -25,7 +25,7 @@ class QuickstartActiveCustomValidatorTestCase extends PradoGenericSeleniumTest
$this->pause(800);
$this->assertVisible($base.'validator1');
- $this->click($base.'button1');
+ $this->byId($base.'button1')->click();
$this->pause(800);
$this->assertNotVisible($base.'validator1');
}
diff --git a/tests/FunctionalTests/quickstart/Advanced/I18N.php b/tests/FunctionalTests/quickstart/Advanced/I18N.php
index 726501ce..ccb8c961 100755
--- a/tests/FunctionalTests/quickstart/Advanced/I18N.php
+++ b/tests/FunctionalTests/quickstart/Advanced/I18N.php
@@ -1,52 +1,52 @@
<?php
//New Test
-class QuickstartI18NTestCase extends PradoGenericSeleniumTest
+class QuickstartI18NTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?notheme=true&page=Advanced.Samples.I18N.Home&amp;lang=en&amp;notheme=true", "");
- $this->verifyTextPresent("Internationlization in PRADO", "");
- $this->verifyTextPresent("46.412,42 €", "");
- $this->verifyTextPresent("$12.40", "");
- $this->verifyTextPresent("€100.00", "");
- $this->verifyTextPresent("December 6, 2004", "");
- $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&amp;lang=zh&amp;notheme=true", "");
- $this->verifyTextPresent("PRADO 国际化", "");
- $this->verifyTextPresent("2004 十二月", "");
- $this->verifyTextPresent("US$ 12.40", "");
- $this->verifyTextPresent("46.412,42 €", "");
- $this->verifyTextPresent("€100.00 ", "");
- $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&amp;lang=zh_TW&amp;notheme=true", "");
- $this->verifyTextPresent("PRADO 國際化", "");
- $this->verifyTextPresent("2004年12月6日", "");
- $this->verifyTextPresent("US$12.40", "");
- $this->verifyTextPresent("46.412,42 €", "");
- $this->verifyTextPresent("€100.00", "");
- $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&amp;lang=de&amp;notheme=true", "");
- $this->verifyTextPresent("Internationalisierung in PRADO", "");
- $this->verifyTextPresent("6. Dezember 2004 ", "");
- $this->verifyTextPresent("$ 12,40", "");
- $this->verifyTextPresent("46.412,42 €", "");
- $this->verifyTextPresent("€100.00", "");
- $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&amp;lang=es&amp;notheme=true", "");
- $this->verifyTextPresent("Internationlization en PRADO", "");
- $this->verifyTextPresent("6 de diciembre de 2004", "");
- $this->verifyTextPresent("US$12.40", "");
- $this->verifyTextPresent("46.412,42 €", "");
- $this->verifyTextPresent("€100.00", "");
- $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&amp;lang=fr&amp;notheme=true", "");
- $this->verifyTextPresent("Internationalisation avec PRADO", "");
- $this->verifyTextPresent("6 décembre 2004", "");
- $this->verifyTextPresent("12,40 $", "");
- $this->verifyTextPresent("46.412,42 €", "");
- $this->verifyTextPresent("€100.00", "");
- $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&amp;lang=pl&amp;notheme=true", "");
- $this->verifyTextPresent("Internacjonalizacja w PRADO", "");
- $this->verifyTextPresent("6 grudnia 2004", "");
- $this->verifyTextPresent("US$ 12,40", "");
- $this->verifyTextPresent("46.412,42 €", "");
- $this->verifyTextPresent("€100.00", "");
+ $this->url("../../demos/quickstart/index.php?notheme=true&page=Advanced.Samples.I18N.Home&amp;lang=en&amp;notheme=true");
+ $this->assertContains("Internationlization in PRADO", $this->source());
+ $this->assertContains("46.412,42 €", $this->source());
+ $this->assertContains("$12.40", $this->source());
+ $this->assertContains("€100.00", $this->source());
+ $this->assertContains("December 6, 2004", $this->source());
+ $this->url("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&amp;lang=zh&amp;notheme=true");
+ $this->assertContains("PRADO 国际化", $this->source());
+ $this->assertContains("2004 十二月", $this->source());
+ $this->assertContains("US$ 12.40", $this->source());
+ $this->assertContains("46.412,42 €", $this->source());
+ $this->assertContains("€100.00 ", $this->source());
+ $this->url("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&amp;lang=zh_TW&amp;notheme=true");
+ $this->assertContains("PRADO 國際化", $this->source());
+ $this->assertContains("2004年12月6日", $this->source());
+ $this->assertContains("US$12.40", $this->source());
+ $this->assertContains("46.412,42 €", $this->source());
+ $this->assertContains("€100.00", $this->source());
+ $this->url("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&amp;lang=de&amp;notheme=true");
+ $this->assertContains("Internationalisierung in PRADO", $this->source());
+ $this->assertContains("6. Dezember 2004 ", $this->source());
+ $this->assertContains("$ 12,40", $this->source());
+ $this->assertContains("46.412,42 €", $this->source());
+ $this->assertContains("€100.00", $this->source());
+ $this->url("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&amp;lang=es&amp;notheme=true");
+ $this->assertContains("Internationlization en PRADO", $this->source());
+ $this->assertContains("6 de diciembre de 2004", $this->source());
+ $this->assertContains("US$12.40", $this->source());
+ $this->assertContains("46.412,42 €", $this->source());
+ $this->assertContains("€100.00", $this->source());
+ $this->url("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&amp;lang=fr&amp;notheme=true");
+ $this->assertContains("Internationalisation avec PRADO", $this->source());
+ $this->assertContains("6 décembre 2004", $this->source());
+ $this->assertContains("12,40 $", $this->source());
+ $this->assertContains("46.412,42 €", $this->source());
+ $this->assertContains("€100.00", $this->source());
+ $this->url("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&amp;lang=pl&amp;notheme=true");
+ $this->assertContains("Internacjonalizacja w PRADO", $this->source());
+ $this->assertContains("6 grudnia 2004", $this->source());
+ $this->assertContains("US$ 12,40", $this->source());
+ $this->assertContains("46.412,42 €", $this->source());
+ $this->assertContains("€100.00", $this->source());
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/BulletedListTestCase.php b/tests/FunctionalTests/quickstart/Controls/BulletedListTestCase.php
index 0b272428..a23f1d1d 100755
--- a/tests/FunctionalTests/quickstart/Controls/BulletedListTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/BulletedListTestCase.php
@@ -1,36 +1,36 @@
<?php
-class QuickstartBulletedListTestCase extends PradoGenericSeleniumTest
+class QuickstartBulletedListTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TBulletedList.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TBulletedList.Home&amp;notheme=true&amp;lang=en");
// verify if all required texts are present
- $this->verifyTextPresent('item 1','');
- $this->verifyTextPresent('item 2','');
- $this->verifyTextPresent('item 3','');
- $this->verifyTextPresent('item 4','');
- $this->verifyTextPresent('google','');
- $this->verifyTextPresent('yahoo','');
- $this->verifyTextPresent('amazon','');
+ $this->assertContains('item 1', $this->source());
+ $this->assertContains('item 2', $this->source());
+ $this->assertContains('item 3', $this->source());
+ $this->assertContains('item 4', $this->source());
+ $this->assertContains('google', $this->source());
+ $this->assertContains('yahoo', $this->source());
+ $this->assertContains('amazon', $this->source());
// verify order list starting from 5
- $this->verifyElementPresent("//ol[@start='5']");
+ $this->assertElementPresent("//ol[@start='5']");
// unable to verify styles
// verify hyperlink list
- $this->verifyElementPresent("//a[@href='http://www.google.com/']");
- $this->verifyElementPresent("//a[@href='http://www.yahoo.com/']");
- $this->verifyElementPresent("//a[@href='http://www.amazon.com/']");
+ $this->assertElementPresent("//a[@href='http://www.google.com/']");
+ $this->assertElementPresent("//a[@href='http://www.yahoo.com/']");
+ $this->assertElementPresent("//a[@href='http://www.amazon.com/']");
// verify linkbutton list
- $this->clickAndWait("id=ctl0_body_ctl40", "");
- $this->verifyTextPresent("You clicked google : http://www.google.com/.", "");
- $this->clickAndWait("id=ctl0_body_ctl41", "");
- $this->verifyTextPresent("You clicked yahoo : http://www.yahoo.com/.", "");
- $this->clickAndWait("id=ctl0_body_ctl42", "");
- $this->verifyTextPresent("You clicked amazon : http://www.amazon.com/.", "");
+ $this->byId("ctl0_body_ctl40")->click();
+ $this->assertContains("You clicked google : http://www.google.com/.", $this->source());
+ $this->byId("ctl0_body_ctl41")->click();
+ $this->assertContains("You clicked yahoo : http://www.yahoo.com/.", $this->source());
+ $this->byId("ctl0_body_ctl42")->click();
+ $this->assertContains("You clicked amazon : http://www.amazon.com/.", $this->source());
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php
index ad84e1d0..f5a4a979 100755
--- a/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php
@@ -1,33 +1,33 @@
<?php
-class QuickstartButtonTestCase extends PradoGenericSeleniumTest
+class QuickstartButtonTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TButton.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TButton.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
// a regular button
- $this->clickAndWait("//input[@type='submit' and @value='text']", "");
+ $this->byXPath("//input[@type='submit' and @value='text']")->click();
// a click button
- $this->verifyElementNotPresent("//input[@type='submit' and @value=\"I'm clicked\"]");
- $this->clickAndWait("//input[@type='submit' and @value='click me']", "");
- $this->verifyElementPresent("//input[@type='submit' and @value=\"I'm clicked\"]");
+ $this->assertElementNotPresent("//input[@type='submit' and @value=\"I'm clicked\"]");
+ $this->byXPath("//input[@type='submit' and @value='click me']")->click();
+ $this->assertElementPresent("//input[@type='submit' and @value=\"I'm clicked\"]");
// a command button
- $this->verifyElementNotPresent("//input[@type='submit' and @value=\"Name: test, Param: value\"]");
- $this->clickAndWait("//input[@type='submit' and @value='click me']", "");
- $this->verifyElementPresent("//input[@type='submit' and @value=\"Name: test, Param: value\"]");
+ $this->assertElementNotPresent("//input[@type='submit' and @value=\"Name: test, Param: value\"]");
+ $this->byXPath("//input[@type='submit' and @value='click me']")->click();
+ $this->assertElementPresent("//input[@type='submit' and @value=\"Name: test, Param: value\"]");
// a button causing validation
- $this->verifyNotVisible('ctl0_body_ctl3');
- $this->click("//input[@type='submit' and @value='submit']", "");
+ $this->assertNotVisible('ctl0_body_ctl3');
+ $this->byXPath("//input[@type='submit' and @value='submit']")->click();
// $this->pause(1000);
- $this->verifyVisible('ctl0_body_ctl3');
+ $this->assertVisible('ctl0_body_ctl3');
$this->type("ctl0\$body\$TextBox", "test");
- $this->clickAndWait("//input[@type='submit' and @value='submit']", "");
- $this->verifyNotVisible('ctl0_body_ctl3');
+ $this->byXPath("//input[@type='submit' and @value='submit']")->click();
+ $this->assertNotVisible('ctl0_body_ctl3');
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php b/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php
index 242bc815..781701cf 100755
--- a/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php
@@ -1,17 +1,17 @@
<?php
//New Test
-class QuickstartCheckBoxListTestCase extends PradoGenericSeleniumTest
+class QuickstartCheckBoxListTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TCheckBoxList.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TCheckBoxList.Home&amp;notheme=true&amp;lang=en");
// Check box list with default settings:
- $this->click("//input[@name='ctl0\$body\$ctl0\$c0' and @value='value 1']", "");
+ $this->byXPath("//input[@name='ctl0\$body\$ctl0\$c0' and @value='value 1']")->click();
// Check box list with customized cellpadding, cellspacing, color and text alignment:
- $this->click("//input[@name='ctl0\$body\$ctl1\$c1' and @value='value 2']", "");
+ $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c1' and @value='value 2']")->click();
// *** Currently unable to test the following cases:
// Check box list with vertical (default) repeat direction
@@ -20,33 +20,33 @@ class QuickstartCheckBoxListTestCase extends PradoGenericSeleniumTest
// Check box list with flow layout and horizontal repeat direction:
// Check box list's behavior upon postback
- $this->click("//input[@name='ctl0\$body\$CheckBoxList\$c2' and @value='value 3']", "");
- $this->clickAndWait("//input[@type='submit' and @value='Submit']", "");
- $this->verifyTextPresent("Your selection is: (Index: 1, Value: value 2, Text: item 2)(Index: 2, Value: value 3, Text: item 3)(Index: 4, Value: value 5, Text: item 5)", "");
+ $this->byXPath("//input[@name='ctl0\$body\$CheckBoxList\$c2' and @value='value 3']")->click();
+ $this->byXPath("//input[@type='submit' and @value='Submit']")->click();
+ $this->assertContains("Your selection is: (Index: 1, Value: value 2, Text: item 2)(Index: 2, Value: value 3, Text: item 3)(Index: 4, Value: value 5, Text: item 5)", $this->source());
// Auto postback check box list
- $this->clickAndWait("//input[@name='ctl0\$body\$ctl7\$c1' and @value='value 2']", "");
- $this->verifyTextPresent("Your selection is: (Index: 4, Value: value 5, Text: item 5)", "");
+ $this->byXPath("//input[@name='ctl0\$body\$ctl7\$c1' and @value='value 2']")->click();
+ $this->assertContains("Your selection is: (Index: 4, Value: value 5, Text: item 5)", $this->source());
// Databind to an integer-indexed array
- $this->clickAndWait("//input[@name='ctl0\$body\$DBCheckBoxList1\$c1' and @value='1']", "");
- $this->verifyTextPresent("Your selection is: (Index: 1, Value: 1, Text: item 2)", "");
+ $this->byXPath("//input[@name='ctl0\$body\$DBCheckBoxList1\$c1' and @value='1']")->click();
+ $this->assertContains("Your selection is: (Index: 1, Value: 1, Text: item 2)", $this->source());
// Databind to an associative array:
- $this->clickAndWait("//input[@name='ctl0\$body\$DBCheckBoxList2\$c1' and @value='key 2']", "");
- $this->verifyTextPresent("Your selection is: (Index: 1, Value: key 2, Text: item 2)", "");
+ $this->byXPath("//input[@name='ctl0\$body\$DBCheckBoxList2\$c1' and @value='key 2']")->click();
+ $this->assertContains("Your selection is: (Index: 1, Value: key 2, Text: item 2)", $this->source());
// Databind with DataTextField and DataValueField specified
- $this->clickAndWait("//input[@name='ctl0\$body\$DBCheckBoxList3\$c2' and @value='003']", "");
- $this->verifyTextPresent("Your selection is: (Index: 2, Value: 003, Text: Cary)", "");
+ $this->byXPath("//input[@name='ctl0\$body\$DBCheckBoxList3\$c2' and @value='003']")->click();
+ $this->assertContains("Your selection is: (Index: 2, Value: 003, Text: Cary)", $this->source());
// CheckBox list causing validation
- $this->verifyNotVisible('ctl0_body_ctl8');
- $this->click("//input[@name='ctl0\$body\$ctl9\$c0' and @value='Agree']", "");
+ $this->assertNotVisible('ctl0_body_ctl8');
+ $this->byXPath("//input[@name='ctl0\$body\$ctl9\$c0' and @value='Agree']")->click();
// $this->pause(1000);
- $this->verifyVisible('ctl0_body_ctl8');
+ $this->assertVisible('ctl0_body_ctl8');
$this->type("ctl0\$body\$TextBox", "test");
- $this->clickAndWait("//input[@name='ctl0\$body\$ctl9\$c0' and @value='Agree']", "");
- $this->verifyNotVisible('ctl0_body_ctl8');
+ $this->byXPath("//input[@name='ctl0\$body\$ctl9\$c0' and @value='Agree']")->click();
+ $this->assertNotVisible('ctl0_body_ctl8');
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php b/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php
index 57b50dd9..ca89b3a0 100755
--- a/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php
@@ -1,53 +1,53 @@
<?php
-class QuickstartCheckBoxTestCase extends PradoGenericSeleniumTest
+class QuickstartCheckBoxTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TCheckBox.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TCheckBox.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
// a regular checkbox
- $this->click("//input[@name='ctl0\$body\$ctl0']", "");
+ $this->byXPath("//input[@name='ctl0\$body\$ctl0']")->click();
// a checkbox with customized value
- $this->click("//input[@name='ctl0\$body\$ctl1' and @value='value']", "");
+ $this->byXPath("//input[@name='ctl0\$body\$ctl1' and @value='value']")->click();
// an auto postback checkbox
- $this->verifyTextNotPresent("I'm clicked");
- $this->clickAndWait("//input[@name='ctl0\$body\$ctl2']", "");
- $this->verifyTextPresent("I'm clicked");
- $this->clickAndWait("//input[@name='ctl0\$body\$ctl2']", "");
- $this->verifyTextPresent("I'm clicked");
+ $this->assertNotContains("I'm clicked", $this->source());
+ $this->byXPath("//input[@name='ctl0\$body\$ctl2']")->click();
+ $this->assertContains("I'm clicked", $this->source());
+ $this->byXPath("//input[@name='ctl0\$body\$ctl2']")->click();
+ $this->assertContains("I'm clicked", $this->source());
// a checkbox causing validation on a textbox
- $this->verifyNotVisible('ctl0_body_ctl3');
- $this->click("//input[@name='ctl0\$body\$ctl4']", "");
+ $this->assertNotVisible('ctl0_body_ctl3');
+ $this->byXPath("//input[@name='ctl0\$body\$ctl4']")->click();
// $this->pause(1000);
- $this->verifyVisible('ctl0_body_ctl3');
- $this->click("//input[@name='ctl0\$body\$ctl4']", "");
+ $this->assertVisible('ctl0_body_ctl3');
+ $this->byXPath("//input[@name='ctl0\$body\$ctl4']")->click();
// $this->pause(1000);
- $this->verifyVisible('ctl0_body_ctl3');
+ $this->assertVisible('ctl0_body_ctl3');
$this->type("ctl0\$body\$TextBox", "test");
- $this->clickAndWait("//input[@name='ctl0\$body\$ctl4']", "");
- $this->verifyNotVisible('ctl0_body_ctl3');
+ $this->byXPath("//input[@name='ctl0\$body\$ctl4']")->click();
+ $this->assertNotVisible('ctl0_body_ctl3');
// a checkbox validated by a required field validator
- $this->verifyNotVisible('ctl0_body_ctl6');
- $this->click("//input[@type='submit' and @value='Submit']", "");
+ $this->assertNotVisible('ctl0_body_ctl6');
+ $this->byXPath("//input[@type='submit' and @value='Submit']")->click();
// $this->pause(1000);
- $this->verifyVisible('ctl0_body_ctl6');
- $this->click("//input[@name='ctl0\$body\$CheckBox']", "");
- $this->clickAndWait("//input[@type='submit' and @value='Submit']", "");
- $this->verifyNotVisible('ctl0_body_ctl6');
+ $this->assertVisible('ctl0_body_ctl6');
+ $this->byXPath("//input[@name='ctl0\$body\$CheckBox']")->click();
+ $this->byXPath("//input[@type='submit' and @value='Submit']")->click();
+ $this->assertNotVisible('ctl0_body_ctl6');
// a checkbox validated by a required field validator using AutoPostBack
- $this->verifyNotVisible('ctl0_body_ctl7');
- $this->click("//input[@name='ctl0\$body\$CheckBox2']", "");
+ $this->assertNotVisible('ctl0_body_ctl7');
+ $this->byXPath("//input[@name='ctl0\$body\$CheckBox2']")->click();
// $this->pause(1000);
- $this->verifyVisible('ctl0_body_ctl7');
-// $this->clickAndWait("//input[@name='ctl0\$body\$CheckBox2' and @value='ctl0\$body\$CheckBox2']", "");
-// $this->verifyNotVisible('ctl0_body_ctl7');
+ $this->assertVisible('ctl0_body_ctl7');
+// $this->byXPath("//input[@name='ctl0\$body\$CheckBox2' and @value='ctl0\$body\$CheckBox2']")->click();
+// $this->assertNotVisible('ctl0_body_ctl7');
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php
index 57ee92ae..4f4ca60a 100755
--- a/tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php
@@ -1,29 +1,29 @@
<?php
-class QuickstartDataGrid1TestCase extends PradoGenericSeleniumTest
+class QuickstartDataGrid1TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample1&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample1&amp;notheme=true&amp;lang=en");
// verify if all required texts are present
- $this->verifyTextPresent('id','');
- $this->verifyTextPresent('name','');
- $this->verifyTextPresent('quantity','');
- $this->verifyTextPresent('price','');
- $this->verifyTextPresent('imported','');
- $this->verifyTextPresent('ITN001','');
- $this->verifyTextPresent('Motherboard','');
- $this->verifyTextPresent('100','');
- $this->verifyTextPresent('true','');
- $this->verifyTextPresent('ITN019','');
- $this->verifyTextPresent('Speaker','');
- $this->verifyTextPresent('35','');
- $this->verifyTextPresent('65','');
- $this->verifyTextPresent('false','');
+ $this->assertContains('id', $this->source());
+ $this->assertContains('name', $this->source());
+ $this->assertContains('quantity', $this->source());
+ $this->assertContains('price', $this->source());
+ $this->assertContains('imported', $this->source());
+ $this->assertContains('ITN001', $this->source());
+ $this->assertContains('Motherboard', $this->source());
+ $this->assertContains('100', $this->source());
+ $this->assertContains('true', $this->source());
+ $this->assertContains('ITN019', $this->source());
+ $this->assertContains('Speaker', $this->source());
+ $this->assertContains('35', $this->source());
+ $this->assertContains('65', $this->source());
+ $this->assertContains('false', $this->source());
// verify specific table tags
- $this->verifyElementPresent("ctl0_body_DataGrid");
- $this->verifyAttribute("ctl0_body_DataGrid@cellpadding","2");
+ $this->assertElementPresent("ctl0_body_DataGrid");
+ $this->assertAttribute("ctl0_body_DataGrid@cellpadding","2");
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid2TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid2TestCase.php
index 7efd69cc..548b04e3 100755
--- a/tests/FunctionalTests/quickstart/Controls/DataGrid2TestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/DataGrid2TestCase.php
@@ -1,49 +1,49 @@
<?php
-class QuickstartDataGrid2TestCase extends PradoGenericSeleniumTest
+class QuickstartDataGrid2TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample2&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample2&amp;notheme=true&amp;lang=en");
// verify if all required texts are present
- $this->verifyTextPresent('Book Title','');
- $this->verifyTextPresent('Publisher','');
- $this->verifyTextPresent('Price','');
- $this->verifyTextPresent('In-stock','');
- $this->verifyTextPresent('Rating','');
+ $this->assertContains('Book Title', $this->source());
+ $this->assertContains('Publisher', $this->source());
+ $this->assertContains('Price', $this->source());
+ $this->assertContains('In-stock', $this->source());
+ $this->assertContains('Rating', $this->source());
// verify book titles
- $this->verifyElementPresent("//a[@href='http://www.amazon.com/gp/product/0596007124' and text()='Head First Design Patterns']",'');
- $this->verifyElementPresent("//a[@href='http://www.amazon.com/gp/product/0321278658' and text()='Extreme Programming Explained : Embrace Change']",'');
+ $this->assertElementPresent("//a[@href='http://www.amazon.com/gp/product/0596007124' and text()='Head First Design Patterns']",'');
+ $this->assertElementPresent("//a[@href='http://www.amazon.com/gp/product/0321278658' and text()='Extreme Programming Explained : Embrace Change']",'');
// verify publishers
- $this->verifyTextPresent("O'Reilly Media, Inc.",'');
- $this->verifyTextPresent("Addison-Wesley Professional",'');
+ $this->assertContains("O'Reilly Media, Inc.", $this->source());
+ $this->assertContains("Addison-Wesley Professional", $this->source());
// verify prices
- $this->verifyTextPresent("\$37.49",'');
- $this->verifyTextPresent("\$38.49",'');
+ $this->assertContains("\$37.49", $this->source());
+ $this->assertContains("\$38.49", $this->source());
// verify in-stock
- $this->verifyAttribute('ctl0_body_DataGrid_ctl1_ctl5@checked','regexp:true|checked');
- $this->verifyAttribute('ctl0_body_DataGrid_ctl1_ctl5@disabled','regexp:true|disabled');
- $this->verifyAttribute('ctl0_body_DataGrid_ctl2_ctl5@checked','regexp:true|checked');
- $this->assertEquals($this->getEval('this.browserbot.findElement("ctl0_body_DataGrid_ctl6_ctl5").hasAttribute("checked")'), 'false');
- $this->verifyAttribute('ctl0_body_DataGrid_ctl6_ctl5@disabled','regexp:true|disabled');
+ $this->assertAttribute('ctl0_body_DataGrid_ctl1_ctl5@checked','regexp:true|checked');
+ $this->assertAttribute('ctl0_body_DataGrid_ctl1_ctl5@disabled','regexp:true|disabled');
+ $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl5@checked','regexp:true|checked');
+ $this->assertAttribute('ctl0_body_DataGrid_ctl6_ctl5@checked',null);
+ $this->assertAttribute('ctl0_body_DataGrid_ctl6_ctl5@disabled','regexp:true|disabled');
// verify ratings
- //$this->verifyElementPresent("//img[@src='images/star5.gif']",'');
- //$this->verifyElementPresent("//img[@src='images/star2.gif']",'');
+ //$this->assertElementPresent("//img[@src='images/star5.gif']",'');
+ //$this->assertElementPresent("//img[@src='images/star2.gif']",'');
// verify toggle column visibility
- $this->clickAndWait("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Book Title']", "");
- $this->verifyTextNotPresent('Head First Design Patterns','');
- $this->clickAndWait("//input[@name='ctl0\$body\$ctl1\$c3' and @value='In-stock']", "");
- $this->verifyElementNotPresent('ctl0_body_DataGrid_ctl1_ctl5','');
- $this->clickAndWait("//input[@name='ctl0\$body\$ctl1\$c3' and @value='In-stock']", "");
- $this->verifyElementPresent('ctl0_body_DataGrid_ctl1_ctl5','');
- $this->clickAndWait("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Book Title']", "");
- $this->verifyTextPresent('Head First Design Patterns','');
+ $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Book Title']")->click();
+ $this->assertNotContains('Head First Design Patterns', $this->source());
+ $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c3' and @value='In-stock']")->click();
+ $this->assertElementNotPresent('ctl0_body_DataGrid_ctl1_ctl5','');
+ $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c3' and @value='In-stock']")->click();
+ $this->assertElementPresent('ctl0_body_DataGrid_ctl1_ctl5','');
+ $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Book Title']")->click();
+ $this->assertContains('Head First Design Patterns', $this->source());
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid3TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid3TestCase.php
index 2cdace20..f0e88996 100755
--- a/tests/FunctionalTests/quickstart/Controls/DataGrid3TestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/DataGrid3TestCase.php
@@ -1,50 +1,55 @@
<?php
-class QuickstartDataGrid3TestCase extends PradoGenericSeleniumTest
+class QuickstartDataGrid3TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample3&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample3&amp;notheme=true&amp;lang=en");
// verify the 2nd row of data
- $this->verifyTextPresent("Design Patterns: Elements of Reusable Object-Oriented Software", "");
- $this->verifyTextPresent("Addison-Wesley Professional", "");
- $this->verifyTextPresent("$47.04", "");
- $this->verifyAttribute('ctl0_body_DataGrid_ctl2_ctl4@checked','regexp:true|checked');
- $this->verifyAttribute('ctl0_body_DataGrid_ctl2_ctl4@disabled','regexp:true|disabled');
- //$this->verifyElementPresent("//img[@src='images/star5.gif']",'');
+ $this->assertContains("Design Patterns: Elements of Reusable Object-Oriented Software", $this->source());
+ $this->assertContains("Addison-Wesley Professional", $this->source());
+ $this->assertContains("$47.04", $this->source());
+ $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl4@checked','regexp:true|checked');
+ $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl4@disabled','regexp:true|disabled');
+ //$this->assertElementPresent("//img[@src='images/star5.gif']",'');
// edit the 2nd row
- $this->clickAndWait("id=ctl0_body_DataGrid_ctl2_ctl7", "");
+ $this->byId("ctl0_body_DataGrid_ctl2_ctl7")->click();
$this->type("ctl0\$body\$DataGrid\$ctl2\$ctl1", "Design Pattern: Elements of Reusable Object-Oriented Software");
$this->type("ctl0\$body\$DataGrid\$ctl2\$ctl3", "Addison Wesley Professional");
$this->type("ctl0\$body\$DataGrid\$ctl2\$ctl5", "\$57.04");
- $this->click("//input[@name='ctl0\$body\$DataGrid\$ctl2\$ctl7']", "");
- $this->select("ctl0\$body\$DataGrid\$ctl2\$ctl9", "label=1");
- $this->clickAndWait("link=Save", "");
+ $this->byXPath("//input[@name='ctl0\$body\$DataGrid\$ctl2\$ctl7']")->click();
+ $this->select("ctl0\$body\$DataGrid\$ctl2\$ctl9", "1");
+ $this->byLinkText("Save")->click();
// verify the 2nd row is saved
- $this->verifyTextPresent("Design Pattern: Elements of Reusable Object-Oriented Software", "");
- $this->verifyTextPresent("Addison Wesley Professional", "");
- $this->verifyTextPresent("$57.04", "");
- $this->assertEquals($this->getEval('this.browserbot.findElement("ctl0_body_DataGrid_ctl2_ctl4").hasAttribute("checked")'), 'false');
- $this->verifyAttribute('ctl0_body_DataGrid_ctl2_ctl4@disabled','regexp:true|disabled');
- //$this->verifyElementPresent("//img[@src='images/star1.gif']",'');
+ $this->assertContains("Design Pattern: Elements of Reusable Object-Oriented Software", $this->source());
+ $this->assertContains("Addison Wesley Professional", $this->source());
+ $this->assertContains("$57.04", $this->source());
+ $this->assertAttribute("ctl0_body_DataGrid_ctl2_ctl4@checked", null);
+ $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl4@disabled','regexp:true|disabled');
+ //$this->assertElementPresent("//img[@src='images/star1.gif']",'');
// verify cancel editting the 3rd row
- $this->clickAndWait("id=ctl0_body_DataGrid_ctl3_ctl7", "");
- $this->clickAndWait("link=Cancel", "");
- $this->verifyTextPresent("Design Patterns Explained : A New Perspective on Object-Oriented Design", "");
+ $this->byId("ctl0_body_DataGrid_ctl3_ctl7")->click();
+ $this->byLinkText("Cancel")->click();
+ $this->assertContains("Design Patterns Explained : A New Perspective on Object-Oriented Design", $this->source());
// verify deleting
- $this->clickAndWait("id=ctl0_body_DataGrid_ctl3_ctl9", "");
- $this->verifyConfirmation("Are you sure?");
- $this->verifyTextNotPresent("Design Patterns Explained : A New Perspective on Object-Oriented Design", "");
-
- $this->verifyTextPresent("Extreme Programming Explained : Embrace Change",'');
- $this->chooseCancelOnNextConfirmation();
- $this->click("id=ctl0_body_DataGrid_ctl6_ctl9", "");
- $this->verifyConfirmation("Are you sure?");
- $this->verifyTextPresent("Extreme Programming Explained : Embrace Change",'');
+ $this->byId("ctl0_body_DataGrid_ctl3_ctl9")->click();
+
+ $this->assertEquals("Are you sure?", $this->alertText());
+ $this->acceptAlert();
+
+ $this->assertNotContains("Design Patterns Explained : A New Perspective on Object-Oriented Design", $this->source());
+
+ $this->assertContains("Extreme Programming Explained : Embrace Change", $this->source());
+ $this->byId("ctl0_body_DataGrid_ctl6_ctl9")->click();
+
+ $this->assertEquals("Are you sure?", $this->alertText());
+ $this->dismissAlert();
+
+ $this->assertContains("Extreme Programming Explained : Embrace Change", $this->source());
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid4TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid4TestCase.php
index 702b997e..f67f5634 100755
--- a/tests/FunctionalTests/quickstart/Controls/DataGrid4TestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/DataGrid4TestCase.php
@@ -1,28 +1,28 @@
<?php
-class QuickstartDataGrid4TestCase extends PradoGenericSeleniumTest
+class QuickstartDataGrid4TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample4&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample4&amp;notheme=true&amp;lang=en");
// verify the 2nd row of data
- $this->verifyTextPresent("Design Patterns: Elements of Reusable Object-Oriented Software", "");
- $this->verifyTextPresent("Addison-Wesley Professional", "");
- $this->verifyTextPresent("$47.04", "");
- $this->verifyAttribute('ctl0_body_DataGrid_ctl2_ctl5@checked','regexp:true|checked');
- $this->verifyAttribute('ctl0_body_DataGrid_ctl2_ctl5@disabled','regexp:true|disabled');
+ $this->assertContains("Design Patterns: Elements of Reusable Object-Oriented Software", $this->source());
+ $this->assertContains("Addison-Wesley Professional", $this->source());
+ $this->assertContains("$47.04", $this->source());
+ $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl5@checked','regexp:true|checked');
+ $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl5@disabled','regexp:true|disabled');
// verify sorting
- $this->clickAndWait("link=Book Title", "");
- $this->assertEquals($this->getEval('this.browserbot.findElement("ctl0_body_DataGrid_ctl1_ctl5").hasAttribute("checked")'), 'false');
- $this->clickAndWait("link=Publisher", "");
- $this->assertEquals($this->getEval('this.browserbot.findElement("ctl0_body_DataGrid_ctl6_ctl5").hasAttribute("checked")'), 'false');
- $this->clickAndWait("link=Price", "");
- $this->assertEquals($this->getEval('this.browserbot.findElement("ctl0_body_DataGrid_ctl2_ctl5").hasAttribute("checked")'), 'false');
- $this->clickAndWait("link=In-stock", "");
- $this->assertEquals($this->getEval('this.browserbot.findElement("ctl0_body_DataGrid_ctl1_ctl5").hasAttribute("checked")'), 'false');
- $this->clickAndWait("link=Rating", "");
- $this->assertEquals($this->getEval('this.browserbot.findElement("ctl0_body_DataGrid_ctl4_ctl5").hasAttribute("checked")'), 'false');
+ $this->byLinkText("Book Title")->click();
+ $this->assertAttribute('ctl0_body_DataGrid_ctl1_ctl5@checked', null);
+ $this->byLinkText("Publisher")->click();
+ $this->assertAttribute('ctl0_body_DataGrid_ctl6_ctl5@checked', null);
+ $this->byLinkText("Price")->click();
+ $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl5@checked', null);
+ $this->byLinkText("In-stock")->click();
+ $this->assertAttribute('ctl0_body_DataGrid_ctl1_ctl5@checked', null);
+ $this->byLinkText("Rating")->click();
+ $this->assertAttribute('ctl0_body_DataGrid_ctl4_ctl5@checked', null);
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid5TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid5TestCase.php
index f854d44c..3df22ff8 100755
--- a/tests/FunctionalTests/quickstart/Controls/DataGrid5TestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/DataGrid5TestCase.php
@@ -1,113 +1,113 @@
<?php
-class QuickstartDataGrid5TestCase extends PradoGenericSeleniumTest
+class QuickstartDataGrid5TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample5&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample5&amp;notheme=true&amp;lang=en");
// verify if all required texts are present
// verify column headers
- $this->verifyTextPresent('id','');
- $this->verifyTextPresent('name','');
- $this->verifyTextPresent('quantity','');
- $this->verifyTextPresent('price','');
- $this->verifyTextPresent('imported','');
+ $this->assertContains('id', $this->source());
+ $this->assertContains('name', $this->source());
+ $this->assertContains('quantity', $this->source());
+ $this->assertContains('price', $this->source());
+ $this->assertContains('imported', $this->source());
- $this->verifyTextPresent('ITN001','');
- $this->verifyTextPresent('ITN002','');
- $this->verifyTextPresent('ITN003','');
- $this->verifyTextPresent('ITN004','');
- $this->verifyTextPresent('ITN005','');
- $this->verifyTextNotPresent('ITN006','');
+ $this->assertContains('ITN001', $this->source());
+ $this->assertContains('ITN002', $this->source());
+ $this->assertContains('ITN003', $this->source());
+ $this->assertContains('ITN004', $this->source());
+ $this->assertContains('ITN005', $this->source());
+ $this->assertNotContains('ITN006', $this->source());
// verify paging
- $this->clickAndWait("link=2", "");
- $this->verifyTextPresent('ITN006','');
- $this->verifyTextPresent('ITN007','');
- $this->verifyTextPresent('ITN008','');
- $this->verifyTextPresent('ITN009','');
- $this->verifyTextPresent('ITN010','');
- $this->verifyTextNotPresent('ITN011','');
- $this->verifyTextNotPresent('ITN005','');
+ $this->byLinkText("2")->click();
+ $this->assertContains('ITN006', $this->source());
+ $this->assertContains('ITN007', $this->source());
+ $this->assertContains('ITN008', $this->source());
+ $this->assertContains('ITN009', $this->source());
+ $this->assertContains('ITN010', $this->source());
+ $this->assertNotContains('ITN011', $this->source());
+ $this->assertNotContains('ITN005', $this->source());
- $this->clickAndWait("link=4", "");
- $this->verifyTextPresent('ITN016','');
- $this->verifyTextPresent('ITN017','');
- $this->verifyTextPresent('ITN018','');
- $this->verifyTextPresent('ITN019','');
- $this->verifyTextNotPresent('ITN015','');
+ $this->byLinkText("4")->click();
+ $this->assertContains('ITN016', $this->source());
+ $this->assertContains('ITN017', $this->source());
+ $this->assertContains('ITN018', $this->source());
+ $this->assertContains('ITN019', $this->source());
+ $this->assertNotContains('ITN015', $this->source());
- $this->clickAndWait("link=1", "");
- $this->verifyTextPresent('ITN001','');
- $this->verifyTextPresent('ITN002','');
- $this->verifyTextPresent('ITN003','');
- $this->verifyTextPresent('ITN004','');
- $this->verifyTextPresent('ITN005','');
- $this->verifyTextNotPresent('ITN006','');
+ $this->byLinkText("1")->click();
+ $this->assertContains('ITN001', $this->source());
+ $this->assertContains('ITN002', $this->source());
+ $this->assertContains('ITN003', $this->source());
+ $this->assertContains('ITN004', $this->source());
+ $this->assertContains('ITN005', $this->source());
+ $this->assertNotContains('ITN006', $this->source());
// show top pager
- $this->clickAndWait("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Top']", "");
- $this->clickAndWait("id=ctl0_body_DataGrid_ctl8_ctl3", "");
- $this->clickAndWait("link=1", "");
+ $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Top']")->click();
+ $this->byId("ctl0_body_DataGrid_ctl8_ctl3")->click();
+ $this->byLinkText("1")->click();
// hide top pager
- $this->clickAndWait("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Top']", "");
+ $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Top']")->click();
// change next prev caption
$this->type("ctl0\$body\$NextPageText", "Next Page");
$this->type("ctl0\$body\$PrevPageText", "Prev Page");
- $this->clickAndWait("//input[@type='submit' and @value='Submit']", "");
+ $this->byXPath("//input[@type='submit' and @value='Submit']")->click();
// verify next prev paging
- $this->verifyTextPresent('ITN001','');
- $this->verifyTextNotPresent('ITN006','');
- $this->clickAndWait("link=Next Page", "");
- $this->verifyTextNotPresent('ITN005','');
- $this->verifyTextPresent('ITN006','');
- $this->verifyTextNotPresent('ITN011','');
- $this->clickAndWait("link=Next Page", "");
- $this->verifyTextNotPresent('ITN010','');
- $this->verifyTextPresent('ITN011','');
- $this->verifyTextNotPresent('ITN016','');
- $this->clickAndWait("link=Next Page", "");
- $this->verifyTextNotPresent('ITN015','');
- $this->verifyTextPresent('ITN016','');
- $this->clickAndWait("link=Prev Page", "");
- $this->verifyTextNotPresent('ITN010','');
- $this->verifyTextPresent('ITN011','');
- $this->verifyTextNotPresent('ITN016','');
- $this->clickAndWait("link=Prev Page", "");
- $this->verifyTextNotPresent('ITN005','');
- $this->verifyTextPresent('ITN006','');
- $this->verifyTextNotPresent('ITN011','');
- $this->clickAndWait("link=Prev Page", "");
- $this->verifyTextPresent('ITN001','');
- $this->verifyTextNotPresent('ITN006','');
+ $this->assertContains('ITN001', $this->source());
+ $this->assertNotContains('ITN006', $this->source());
+ $this->byLinkText("Next Page")->click();
+ $this->assertNotContains('ITN005', $this->source());
+ $this->assertContains('ITN006', $this->source());
+ $this->assertNotContains('ITN011', $this->source());
+ $this->byLinkText("Next Page")->click();
+ $this->assertNotContains('ITN010', $this->source());
+ $this->assertContains('ITN011', $this->source());
+ $this->assertNotContains('ITN016', $this->source());
+ $this->byLinkText("Next Page")->click();
+ $this->assertNotContains('ITN015', $this->source());
+ $this->assertContains('ITN016', $this->source());
+ $this->byLinkText("Prev Page")->click();
+ $this->assertNotContains('ITN010', $this->source());
+ $this->assertContains('ITN011', $this->source());
+ $this->assertNotContains('ITN016', $this->source());
+ $this->byLinkText("Prev Page")->click();
+ $this->assertNotContains('ITN005', $this->source());
+ $this->assertContains('ITN006', $this->source());
+ $this->assertNotContains('ITN011', $this->source());
+ $this->byLinkText("Prev Page")->click();
+ $this->assertContains('ITN001', $this->source());
+ $this->assertNotContains('ITN006', $this->source());
// change button count
$this->type("ctl0\$body\$PageButtonCount", "2");
- $this->clickAndWait("name=ctl0\$body\$ctl6", "");
- $this->clickAndWait("link=Next Page", "");
- $this->verifyTextNotPresent('ITN010','');
- $this->verifyTextPresent('ITN011','');
- $this->verifyTextNotPresent('ITN016','');
- $this->clickAndWait("link=4", "");
- $this->verifyTextNotPresent('ITN015','');
- $this->verifyTextPresent('ITN016','');
- $this->clickAndWait("link=Prev Page", "");
- $this->verifyTextNotPresent('ITN005','');
- $this->verifyTextPresent('ITN006','');
- $this->verifyTextNotPresent('ITN011','');
+ $this->byName("ctl0\$body\$ctl6")->click();
+ $this->byLinkText("Next Page")->click();
+ $this->assertNotContains('ITN010', $this->source());
+ $this->assertContains('ITN011', $this->source());
+ $this->assertNotContains('ITN016', $this->source());
+ $this->byLinkText("4")->click();
+ $this->assertNotContains('ITN015', $this->source());
+ $this->assertContains('ITN016', $this->source());
+ $this->byLinkText("Prev Page")->click();
+ $this->assertNotContains('ITN005', $this->source());
+ $this->assertContains('ITN006', $this->source());
+ $this->assertNotContains('ITN011', $this->source());
$this->type("ctl0\$body\$PageButtonCount", "10");
- $this->clickAndWait("name=ctl0\$body\$ctl6", "");
+ $this->byName("ctl0\$body\$ctl6")->click();
$this->type("ctl0\$body\$PageSize", "2");
- $this->clickAndWait("name=ctl0\$body\$ctl8", "");
- $this->verifyTextPresent('ITN001','');
- $this->verifyTextPresent('ITN002','');
- $this->verifyTextNotPresent('ITN003','');
- $this->clickAndWait("link=10", "");
- $this->verifyTextPresent('ITN019','');
- $this->verifyTextNotPresent('ITN018','');
+ $this->byName("ctl0\$body\$ctl8")->click();
+ $this->assertContains('ITN001', $this->source());
+ $this->assertContains('ITN002', $this->source());
+ $this->assertNotContains('ITN003', $this->source());
+ $this->byLinkText("10")->click();
+ $this->assertContains('ITN019', $this->source());
+ $this->assertNotContains('ITN018', $this->source());
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid6TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid6TestCase.php
index c6fba20f..54af86a8 100755
--- a/tests/FunctionalTests/quickstart/Controls/DataGrid6TestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/DataGrid6TestCase.php
@@ -1,48 +1,48 @@
<?php
-class QuickstartDataGrid6TestCase extends PradoGenericSeleniumTest
+class QuickstartDataGrid6TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample6&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample6&amp;notheme=true&amp;lang=en");
// verify column headers
- $this->verifyTextPresent('id','');
- $this->verifyTextPresent('name','');
- $this->verifyTextPresent('quantity','');
- $this->verifyTextPresent('price','');
- $this->verifyTextPresent('imported','');
+ $this->assertContains('id', $this->source());
+ $this->assertContains('name', $this->source());
+ $this->assertContains('quantity', $this->source());
+ $this->assertContains('price', $this->source());
+ $this->assertContains('imported', $this->source());
- $this->verifyTextPresent('ITN001','');
- $this->verifyTextPresent('ITN002','');
- $this->verifyTextPresent('ITN003','');
- $this->verifyTextPresent('ITN004','');
- $this->verifyTextPresent('ITN005','');
- $this->verifyTextNotPresent('ITN006','');
+ $this->assertContains('ITN001', $this->source());
+ $this->assertContains('ITN002', $this->source());
+ $this->assertContains('ITN003', $this->source());
+ $this->assertContains('ITN004', $this->source());
+ $this->assertContains('ITN005', $this->source());
+ $this->assertNotContains('ITN006', $this->source());
// verify paging
- $this->clickAndWait("link=2", "");
- $this->verifyTextPresent('ITN006','');
- $this->verifyTextPresent('ITN007','');
- $this->verifyTextPresent('ITN008','');
- $this->verifyTextPresent('ITN009','');
- $this->verifyTextPresent('ITN010','');
- $this->verifyTextNotPresent('ITN011','');
- $this->verifyTextNotPresent('ITN005','');
+ $this->byLinkText("2")->click();
+ $this->assertContains('ITN006', $this->source());
+ $this->assertContains('ITN007', $this->source());
+ $this->assertContains('ITN008', $this->source());
+ $this->assertContains('ITN009', $this->source());
+ $this->assertContains('ITN010', $this->source());
+ $this->assertNotContains('ITN011', $this->source());
+ $this->assertNotContains('ITN005', $this->source());
- $this->clickAndWait("link=4", "");
- $this->verifyTextPresent('ITN016','');
- $this->verifyTextPresent('ITN017','');
- $this->verifyTextPresent('ITN018','');
- $this->verifyTextPresent('ITN019','');
- $this->verifyTextNotPresent('ITN015','');
+ $this->byLinkText("4")->click();
+ $this->assertContains('ITN016', $this->source());
+ $this->assertContains('ITN017', $this->source());
+ $this->assertContains('ITN018', $this->source());
+ $this->assertContains('ITN019', $this->source());
+ $this->assertNotContains('ITN015', $this->source());
- $this->clickAndWait("link=1", "");
- $this->verifyTextPresent('ITN001','');
- $this->verifyTextPresent('ITN002','');
- $this->verifyTextPresent('ITN003','');
- $this->verifyTextPresent('ITN004','');
- $this->verifyTextPresent('ITN005','');
- $this->verifyTextNotPresent('ITN006','');
+ $this->byLinkText("1")->click();
+ $this->assertContains('ITN001', $this->source());
+ $this->assertContains('ITN002', $this->source());
+ $this->assertContains('ITN003', $this->source());
+ $this->assertContains('ITN004', $this->source());
+ $this->assertContains('ITN005', $this->source());
+ $this->assertNotContains('ITN006', $this->source());
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/DataList1TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataList1TestCase.php
index 4ff6478a..436af2ad 100755
--- a/tests/FunctionalTests/quickstart/Controls/DataList1TestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/DataList1TestCase.php
@@ -1,24 +1,24 @@
<?php
-class QuickstartDataList1TestCase extends PradoGenericSeleniumTest
+class QuickstartDataList1TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataList.Sample1&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataList.Sample1&amp;notheme=true&amp;lang=en");
// verify if all required texts are present
- $this->verifyTextPresent('ITN001','');
- $this->verifyTextPresent('$100','');
- $this->verifyTextPresent('Motherboard','');
- $this->verifyTextPresent('ITN018','');
- $this->verifyTextPresent('Surge protector','');
- $this->verifyTextPresent('45','');
- $this->verifyTextPresent('$15','');
- $this->verifyTextPresent('Total 19 products.','');
- $this->verifyTextPresent('Computer Parts','');
+ $this->assertContains('ITN001', $this->source());
+ $this->assertContains('$100', $this->source());
+ $this->assertContains('Motherboard', $this->source());
+ $this->assertContains('ITN018', $this->source());
+ $this->assertContains('Surge protector', $this->source());
+ $this->assertContains('45', $this->source());
+ $this->assertContains('$15', $this->source());
+ $this->assertContains('Total 19 products.', $this->source());
+ $this->assertContains('Computer Parts', $this->source());
// verify specific table tags
- $this->verifyElementPresent("ctl0_body_DataList");
- $this->verifyElementPresent("//td[@align='right']");
+ $this->assertElementPresent("ctl0_body_DataList");
+ $this->assertElementPresent("//td[@align='right']");
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php
index 4fb3743e..911fdc93 100755
--- a/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php
@@ -1,59 +1,64 @@
<?php
-class QuickstartDataList2TestCase extends PradoGenericSeleniumTest
+class QuickstartDataList2TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataList.Sample2&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataList.Sample2&amp;notheme=true&amp;lang=en");
// verify initial presentation
- $this->verifyTextPresent("Motherboard ", "");
- $this->verifyTextPresent("Monitor ", "");
+ $this->assertContains("Motherboard", $this->source());
+ $this->assertContains("Monitor", $this->source());
// verify selecting an item
- $this->clickAndWait("link=ITN003", "");
- $this->verifyTextPresent("Quantity", "");
- $this->verifyTextPresent("Price", "");
- $this->verifyTextPresent("\$80", "");
- $this->clickAndWait("link=ITN005", "");
- $this->verifyTextPresent("\$150", "");
+ $this->byLinkText("ITN003")->click();
+ $this->assertContains("Quantity", $this->source());
+ $this->assertContains("Price", $this->source());
+ $this->assertContains("\$80", $this->source());
+ $this->byLinkText("ITN005")->click();
+ $this->assertContains("\$150", $this->source());
// verify editting an item
- $this->clickAndWait("id=ctl0_body_DataList_ctl5_ctl0", "");
+ $this->byId("ctl0_body_DataList_ctl5_ctl0")->click();
$this->type("ctl0\$body\$DataList\$ctl5\$ProductQuantity", "11");
$this->type("ctl0\$body\$DataList\$ctl5\$ProductPrice", "140.99");
- $this->click("//input[@name='ctl0\$body\$DataList\$ctl5\$ProductImported']", "");
- $this->clickAndWait("link=Save", "");
+ $this->byXPath("//input[@name='ctl0\$body\$DataList\$ctl5\$ProductImported']")->click();
+ $this->byLinkText("Save")->click();
// verify item is saved
- $this->clickAndWait("link=ITN005", "");
- $this->verifyTextPresent("\$140.99", "");
- $this->verifyTextPresent("11", "");
+ $this->byLinkText("ITN005")->click();
+ $this->assertContains("\$140.99", $this->source());
+ $this->assertContains("11", $this->source());
// verify editting another item
- $this->clickAndWait("id=ctl0_body_DataList_ctl3_ctl1", "");
+ $this->byId("ctl0_body_DataList_ctl3_ctl1")->click();
$this->type("ctl0\$body\$DataList\$ctl3\$ProductName", "Hard Drive");
$this->type("ctl0\$body\$DataList\$ctl3\$ProductQuantity", "23");
- $this->click("//input[@name='ctl0\$body\$DataList\$ctl3\$ProductImported']", "");
- $this->clickAndWait("link=Cancel", "");
+ $this->byXPath("//input[@name='ctl0\$body\$DataList\$ctl3\$ProductImported']")->click();
+ $this->byLinkText("Cancel")->click();
// verify item is canceled
- $this->clickAndWait("link=ITN003", "");
- $this->verifyTextPresent("2", "");
- $this->verifyTextPresent("Harddrive ", "");
+ $this->byLinkText("ITN003")->click();
+ $this->assertContains("2", $this->source());
+ $this->assertContains("Harddrive", $this->source());
// verify item deletion
- $this->clickAndWait("id=ctl0_body_DataList_ctl3_ctl1", "");
- $this->verifyConfirmation("Are you sure?");
- $this->chooseCancelOnNextConfirmation();
- $this->click("id=ctl0_body_DataList_ctl5_ctl2", "");
- $this->verifyConfirmation("Are you sure?");
- $this->verifyTextPresent("Motherboard ", "");
- $this->verifyTextPresent("CPU ", "");
- $this->verifyTextNotPresent("Harddrive","");
- $this->verifyTextPresent("Sound card", "");
- $this->verifyTextPresent("Video card", "");
- $this->verifyTextPresent("Keyboard","");
- $this->verifyTextPresent("Monitor ", "");
+ $this->byId("ctl0_body_DataList_ctl3_ctl1")->click();
+
+ $this->assertEquals("Are you sure?", $this->alertText());
+ $this->acceptAlert();
+
+ $this->byId("ctl0_body_DataList_ctl5_ctl2")->click();
+
+ $this->assertEquals("Are you sure?", $this->alertText());
+ $this->dismissAlert();
+
+ $this->assertContains("Motherboard", $this->source());
+ $this->assertContains("CPU", $this->source());
+ $this->assertNotContains("Harddrive", $this->source());
+ $this->assertContains("Sound card", $this->source());
+ $this->assertContains("Video card", $this->source());
+ $this->assertContains("Keyboard", $this->source());
+ $this->assertContains("Monitor", $this->source());
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/DropDownListTestCase.php b/tests/FunctionalTests/quickstart/Controls/DropDownListTestCase.php
index eae8ab36..cb01e948 100755
--- a/tests/FunctionalTests/quickstart/Controls/DropDownListTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/DropDownListTestCase.php
@@ -1,65 +1,65 @@
<?php
-class QuickstartDropDownListTestCase extends PradoGenericSeleniumTest
+class QuickstartDropDownListTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDropDownList.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDropDownList.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
// dropdown list with default settings
- $this->verifyElementPresent("ctl0\$body\$ctl0");
+ $this->assertElementPresent("ctl0\$body\$ctl0");
// dropdown list with initial options
- $this->assertEquals($this->getSelectOptions("ctl0\$body\$ctl1"), array('item 1', 'item 2', 'item 3', 'item 4'));
+ $this->assertEquals($this->getSelectOptions("ctl0\$body\$ctl1"), array('item 1', 'item 2', 'item 3', 'item 4'));
$this->assertSelected("ctl0\$body\$ctl1","item 2");
// dropdown list with customized styles
- $this->assertEquals($this->getSelectOptions("ctl0\$body\$ctl2"), array('item 1', 'item 2', 'item 3', 'item 4'));
+ $this->assertEquals($this->getSelectOptions("ctl0\$body\$ctl2"), array('item 1', 'item 2', 'item 3', 'item 4'));
$this->assertSelected("ctl0\$body\$ctl2","item 2");
// a disabled dropdown list
- $this->verifyAttribute("ctl0\$body\$ctl3@disabled","regexp:true|disabled");
+ $this->assertAttribute("ctl0\$body\$ctl3@disabled","regexp:true|disabled");
// an auto postback dropdown list
- $this->verifyTextNotPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", "");
- $this->selectAndWait("ctl0\$body\$ctl4", "label=item 3");
- $this->verifyTextPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", "");
+ $this->assertNotContains("Your selection is: (Index: 2, Value: value 3, Text: item 3)", $this->source());
+ $this->selectAndWait("ctl0\$body\$ctl4", "item 3");
+ $this->assertContains("Your selection is: (Index: 2, Value: value 3, Text: item 3)", $this->source());
// a single selection list box upon postback
- $this->select("ctl0\$body\$DropDownList1", "label=item 4");
- $this->verifyTextNotPresent("Your selection is: (Index: 3, Value: value 4, Text: item 4)", "");
- $this->clickAndWait("//input[@type='submit' and @value='Submit']", "");
- $this->verifyTextPresent("Your selection is: (Index: 3, Value: value 4, Text: item 4)", "");
+ $this->select("ctl0\$body\$DropDownList1", "item 4");
+ $this->assertNotContains("Your selection is: (Index: 3, Value: value 4, Text: item 4)", $this->source());
+ $this->byXPath("//input[@type='submit' and @value='Submit']")->click();
+ $this->assertContains("Your selection is: (Index: 3, Value: value 4, Text: item 4)", $this->source());
// Databind to an integer-indexed array
- $this->selectAndWait("ctl0\$body\$DBDropDownList1", "label=item 3");
- $this->verifyTextPresent("Your selection is: (Index: 2, Value: 2, Text: item 3)", "");
+ $this->selectAndWait("ctl0\$body\$DBDropDownList1", "item 3");
+ $this->assertContains("Your selection is: (Index: 2, Value: 2, Text: item 3)", $this->source());
// Databind to an associative array
- $this->selectAndWait("ctl0\$body\$DBDropDownList2", "label=item 2");
- $this->verifyTextPresent("Your selection is: (Index: 1, Value: key 2, Text: item 2)", "");
+ $this->selectAndWait("ctl0\$body\$DBDropDownList2", "item 2");
+ $this->assertContains("Your selection is: (Index: 1, Value: key 2, Text: item 2)", $this->source());
// Databind with DataTextField and DataValueField specified
- $this->selectAndWait("ctl0\$body\$DBDropDownList3", "label=Cary");
- $this->verifyTextPresent("Your selection is: (Index: 2, Value: 003, Text: Cary)", "");
+ $this->selectAndWait("ctl0\$body\$DBDropDownList3", "Cary");
+ $this->assertContains("Your selection is: (Index: 2, Value: 003, Text: Cary)", $this->source());
// dropdown list is being validated
- $this->verifyNotVisible('ctl0_body_ctl6');
- $this->click("id=ctl0_body_ctl7", "");
- $this->verifyVisible('ctl0_body_ctl6');
- $this->select("ctl0\$body\$VDropDownList1", "label=item 2");
- $this->clickAndWait("id=ctl0_body_ctl7", "");
- $this->verifyNotVisible('ctl0_body_ctl6');
+ $this->assertNotVisible('ctl0_body_ctl6');
+ $this->byId("ctl0_body_ctl7")->click();
+ $this->assertVisible('ctl0_body_ctl6');
+ $this->select("ctl0\$body\$VDropDownList1", "item 2");
+ $this->byId("ctl0_body_ctl7")->click();
+ $this->assertNotVisible('ctl0_body_ctl6');
// dropdown list causing validation
- $this->verifyNotVisible('ctl0_body_ctl8');
- $this->select("ctl0\$body\$VDropDownList2", "label=Disagree");
+ $this->assertNotVisible('ctl0_body_ctl8');
+ $this->select("ctl0\$body\$VDropDownList2", "Disagree");
$this->pause(1000);
- $this->verifyVisible('ctl0_body_ctl8');
+ $this->assertVisible('ctl0_body_ctl8');
$this->type("ctl0\$body\$TextBox", "test");
- $this->selectAndWait("ctl0\$body\$VDropDownList2", "label=Agree");
- $this->verifyNotVisible('ctl0_body_ctl8');
+ $this->selectAndWait("ctl0\$body\$VDropDownList2", "Agree");
+ $this->assertNotVisible('ctl0_body_ctl8');
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/ExpressionTestCase.php b/tests/FunctionalTests/quickstart/Controls/ExpressionTestCase.php
index 4d47fecd..8c5add48 100755
--- a/tests/FunctionalTests/quickstart/Controls/ExpressionTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/ExpressionTestCase.php
@@ -1,13 +1,13 @@
<?php
-class QuickstartExpressionTestCase extends PradoGenericSeleniumTest
+class QuickstartExpressionTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TExpression.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TExpression.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
- $this->verifyTextPresent('PRADO QuickStart Sample');
+ $this->assertContains('PRADO QuickStart Sample', $this->source());
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/HtmlAreaTestCase.php b/tests/FunctionalTests/quickstart/Controls/HtmlAreaTestCase.php
index caa7a893..53ee6697 100755
--- a/tests/FunctionalTests/quickstart/Controls/HtmlAreaTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/HtmlAreaTestCase.php
@@ -1,12 +1,12 @@
<?php
-class QuickstartHtmlAreaTestCase extends PradoGenericSeleniumTest
+class QuickstartHtmlAreaTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.THtmlArea.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.THtmlArea.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
// can't perform any test
}
diff --git a/tests/FunctionalTests/quickstart/Controls/HyperLinkTestCase.php b/tests/FunctionalTests/quickstart/Controls/HyperLinkTestCase.php
index dc0261e7..bc7ef8b8 100755
--- a/tests/FunctionalTests/quickstart/Controls/HyperLinkTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/HyperLinkTestCase.php
@@ -1,15 +1,15 @@
<?php
-class QuickstartHyperLinkTestCase extends PradoGenericSeleniumTest
+class QuickstartHyperLinkTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.THyperLink.Home&amp;notheme=true&amp;lang=en", "");
- $this->verifyTitle("PRADO QuickStart Sample", "");
- $this->verifyElementPresent("//a[@href=\"http://www.pradosoft.com/\" and @target=\"_blank\"]");
- $this->verifyTextPresent("Welcome to", "");
- $this->verifyTextPresent("Body contents", "");
- $this->verifyElementPresent("//a[img/@alt='Hello World']");
- $this->verifyElementPresent("//a[contains(text(),'Body contents')]");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.THyperLink.Home&amp;notheme=true&amp;lang=en");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
+ $this->assertElementPresent("//a[@href=\"http://www.pradosoft.com/\" and @target=\"_blank\"]");
+ $this->assertContains("Welcome to", $this->source());
+ $this->assertContains("Body contents", $this->source());
+ $this->assertElementPresent("//a[img/@alt='Hello World']");
+ $this->assertElementPresent("//a[contains(text(),'Body contents')]");
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php
index bf531d72..0f86216e 100755
--- a/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php
@@ -1,28 +1,28 @@
<?php
-class QuickstartImageButtonTestCase extends PradoGenericSeleniumTest
+class QuickstartImageButtonTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TImageButton.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TImageButton.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
// a click button
- $this->clickAndWait("//input[@type='image' and @alt='hello world']", "");
- $this->verifyTextPresent("You clicked at ","");
+ $this->byXPath("//input[@type='image' and @alt='hello world']")->click();
+ $this->assertContains("You clicked at ", $this->source());
// a command button
- $this->clickAndWait("ctl0\$body\$ctl1", "");
- $this->verifyTextPresent("Command name: test, Command parameter: value","");
+ $this->byName("ctl0\$body\$ctl1")->click();
+ $this->assertContains("Command name: test, Command parameter: value", $this->source());
// a button causing validation
- $this->verifyNotVisible('ctl0_body_ctl2');
- $this->click("id=ctl0_body_ctl3", "");
+ $this->assertNotVisible('ctl0_body_ctl2');
+ $this->byId("ctl0_body_ctl3")->click();
// $this->pause(1000);
- $this->verifyVisible('ctl0_body_ctl2');
+ $this->assertVisible('ctl0_body_ctl2');
$this->type("ctl0\$body\$TextBox", "test");
- $this->clickAndWait("id=ctl0_body_ctl3", "");
- $this->verifyNotVisible('ctl0_body_ctl2');
+ $this->byId("ctl0_body_ctl3")->click();
+ $this->assertNotVisible('ctl0_body_ctl2');
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/ImageTestCase.php b/tests/FunctionalTests/quickstart/Controls/ImageTestCase.php
index 19e80470..f3bd4775 100755
--- a/tests/FunctionalTests/quickstart/Controls/ImageTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/ImageTestCase.php
@@ -1,18 +1,18 @@
<?php
//New Test
-class QuickstartImageTestCase extends PradoGenericSeleniumTest
+class QuickstartImageTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TImage.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TImage.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
- //$this->verifyElementPresent("//img[contains(@src,'/hello_world.gif') and @alt='']");
- $this->verifyElementPresent("//img[contains(@src,'/hello_world.gif') and @alt='Hello World!']");
- $this->verifyTextPresent("Hello World! Hello World! Hello World!", "");
- //$this->verifyElementPresent("//img[contains(@src,'/hello_world.gif') and @align='baseline']");
- //$this->verifyElementPresent("//img[contains(@src,'/hello_world.gif') and contains(@longdesc,'HelloWorld.html')]");
+ //$this->assertElementPresent("//img[contains(@src,'/hello_world.gif') and @alt='']");
+ $this->assertElementPresent("//img[contains(@src,'/hello_world.gif') and @alt='Hello World!']");
+ $this->assertContains("Hello World! Hello World! Hello World!", $this->source());
+ //$this->assertElementPresent("//img[contains(@src,'/hello_world.gif') and @align='baseline']");
+ //$this->assertElementPresent("//img[contains(@src,'/hello_world.gif') and contains(@longdesc,'HelloWorld.html')]");
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/LabelTestCase.php b/tests/FunctionalTests/quickstart/Controls/LabelTestCase.php
index 03bba8ed..a9aa0bbe 100755
--- a/tests/FunctionalTests/quickstart/Controls/LabelTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/LabelTestCase.php
@@ -1,20 +1,20 @@
<?php
//New Test
-class QuickstartLabelTestCase extends PradoGenericSeleniumTest
+class QuickstartLabelTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TLabel.Home&amp;notheme=true&amp;lang=en", "");
- $this->verifyTitle("PRADO QuickStart Sample", "");
- $this->verifyTextPresent("This is a label with customized color and font.", "");
- $this->verifyTextPresent("This is a form label associated with the TTextBox control below", "");
- $this->verifyTextPresent("This is a label with empty Text property and nonempty body", "");
- $this->verifyTextPresent("This is a disabled label", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TLabel.Home&amp;notheme=true&amp;lang=en");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
+ $this->assertContains("This is a label with customized color and font.", $this->source());
+ $this->assertContains("This is a form label associated with the TTextBox control below", $this->source());
+ $this->assertContains("This is a label with empty Text property and <b>nonempty body</b>", $this->source());
+ $this->assertContains("This is a disabled label", $this->source());
- $this->verifyAttribute("ctl0_body_Label2@disabled","regexp:true|disabled");
+ $this->assertAttribute("ctl0_body_Label2@disabled","regexp:true|disabled");
- //$this->verifyAttribute("ctl0_body_Label1@for","ctl0_body_test");
+ //$this->assertAttribute("ctl0_body_Label1@for","ctl0_body_test");
$this->type("ctl0\$body\$test", "test");
}
diff --git a/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php
index 57e7b975..97b4863d 100755
--- a/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php
@@ -1,32 +1,32 @@
<?php
-class QuickstartLinkButtonTestCase extends PradoGenericSeleniumTest
+class QuickstartLinkButtonTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TLinkButton.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TLinkButton.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
// regular buttons
- $this->clickAndWait("link=link button", "");
- $this->clickAndWait("//a[contains(text(),'body content')]", "");
+ $this->byLinkText("link button")->click();
+ $this->byXPath("//a[contains(text(),'body content')]")->click();
// a click button
- $this->clickAndWait("link=click me", "");
- $this->clickAndWait("link=I'm clicked", "");
+ $this->byLinkText("click me")->click();
+ $this->byLinkText("I'm clicked")->click();
// a command button
- $this->clickAndWait("link=click me", "");
- $this->clickAndWait("//a[contains(text(),'Name: test, Param: value')]", "");
+ $this->byLinkText("click me")->click();
+ $this->byXPath("//a[contains(text(),'Name: test, Param: value')]")->click();
// a button causing validation
- $this->verifyNotVisible('ctl0_body_ctl4');
- $this->click("link=submit", "");
+ $this->assertNotVisible('ctl0_body_ctl4');
+ $this->byLinkText("submit")->click();
// $this->pause(1000);
- $this->verifyVisible('ctl0_body_ctl4');
+ $this->assertVisible('ctl0_body_ctl4');
$this->type("ctl0\$body\$TextBox", "test");
- $this->clickAndWait("link=submit", "");
- $this->verifyNotVisible('ctl0_body_ctl4');
+ $this->byLinkText("submit")->click();
+ $this->assertNotVisible('ctl0_body_ctl4');
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php b/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php
index 1cae0d43..11910ba5 100755
--- a/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php
@@ -1,82 +1,81 @@
<?php
//New Test
-class QuickstartListBoxTestCase extends PradoGenericSeleniumTest
+class QuickstartListBoxTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TListBox.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TListBox.Home&amp;notheme=true&amp;lang=en");
// a default single selection listbox
- $this->verifyAttribute("ctl0\$body\$ctl0@size","4");
+ $this->assertAttribute("ctl0\$body\$ctl0@size","4");
// single selection list box with initial options
- $this->assertEquals($this->getSelectOptions("ctl0\$body\$ctl1"), array('item 1', 'item 2', 'item 3', 'item 4'));
+ $this->assertEquals($this->getSelectOptions("ctl0\$body\$ctl1"), array('item 1', 'item 2', 'item 3', 'item 4'));
$this->assertSelected("ctl0\$body\$ctl1","item 2");
// a single selection list box with customized style
- $this->verifyAttribute("ctl0\$body\$ctl2@size","3");
- $this->assertEquals($this->getSelectOptions("ctl0\$body\$ctl2"), array('item 1', 'item 2', 'item 3', 'item 4'));
+ $this->assertAttribute("ctl0\$body\$ctl2@size","3");
+ $this->assertEquals($this->getSelectOptions("ctl0\$body\$ctl2"), array('item 1', 'item 2', 'item 3', 'item 4'));
$this->assertSelected("ctl0\$body\$ctl2","item 2");
// a disabled list box
- $this->verifyAttribute("ctl0\$body\$ctl3@disabled","regexp:true|disabled");
+ $this->assertAttribute("ctl0\$body\$ctl3@disabled","regexp:true|disabled");
// an auto postback single selection list box
- $this->verifyTextNotPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", "");
- $this->selectAndWait("ctl0\$body\$ctl4", "label=item 3");
- $this->verifyTextPresent("exact:Your selection is: (Index: 2, Value: value 3, Text: item 3)", "");
+ $this->assertNotContains("Your selection is: (Index: 2, Value: value 3, Text: item 3)", $this->source());
+ $this->selectAndWait("ctl0\$body\$ctl4", "item 3");
+ $this->assertContains("Your selection is: (Index: 2, Value: value 3, Text: item 3)", $this->source());
// a single selection list box upon postback
- $this->select("ctl0\$body\$ListBox1", "label=item 4");
- $this->verifyTextNotPresent("Your selection is: (Index: 3, Value: value 4, Text: item 4)", "");
- $this->clickAndWait("//input[@type='submit' and @value='Submit']", "");
- $this->verifyTextPresent("exact:Your selection is: (Index: 3, Value: value 4, Text: item 4)", "");
+ $this->select("ctl0\$body\$ListBox1", "item 4");
+ $this->assertNotContains("Your selection is: (Index: 3, Value: value 4, Text: item 4)", $this->source());
+ $this->byXPath("//input[@type='submit' and @value='Submit']")->click();
+ $this->assertContains("Your selection is: (Index: 3, Value: value 4, Text: item 4)", $this->source());
// a multiple selection list box
- $this->verifyAttribute("ctl0\$body\$ctl6[]@size","4");
- $this->verifyAttribute("ctl0\$body\$ctl6[]@multiple","regexp:true|multiple");
+ $this->assertAttribute("ctl0\$body\$ctl6[]@size","4");
+ $this->assertAttribute("ctl0\$body\$ctl6[]@multiple","regexp:true|multiple");
// a multiple selection list box with initial options
- $this->verifyAttribute("ctl0\$body\$ctl7[]@multiple","regexp:true|multiple");
+ $this->assertAttribute("ctl0\$body\$ctl7[]@multiple","regexp:true|multiple");
$this->assertEquals($this->getSelectOptions("ctl0\$body\$ctl7[]"), array('item 1', 'item 2', 'item 3', 'item 4'));
// multiselection list box's behavior upon postback
- $this->addSelection("ctl0\$body\$ListBox2[]", "label=item 3");
- $this->clickAndWait("name=ctl0\$body\$ctl8", "");
- $this->verifyText("ctl0_body_MultiSelectionResult2","exact:Your selection is: (Index: 1, Value: value 2, Text: item 2)(Index: 2, Value: value 3, Text: item 3)(Index: 3, Value: value 4, Text: item 4)");
+ $this->addSelection("ctl0\$body\$ListBox2[]", "item 3");
+ $this->byName("ctl0\$body\$ctl8")->click();
+ $this->assertText("ctl0_body_MultiSelectionResult2","Your selection is: (Index: 1, Value: value 2, Text: item 2)(Index: 2, Value: value 3, Text: item 3)(Index: 3, Value: value 4, Text: item 4)");
// Auto postback multiselection list box
- $this->addSelection("ctl0\$body\$ctl9[]", "label=item 1");
- $this->waitForPageToLoad(1000);
- $this->verifyText("ctl0_body_MultiSelectionResult","exact:Your selection is: (Index: 0, Value: value 1, Text: item 1)(Index: 1, Value: value 2, Text: item 2)(Index: 3, Value: value 4, Text: item 4)");
+ $this->addSelection("ctl0\$body\$ctl9[]", "item 1");
+ $this->assertText("ctl0_body_MultiSelectionResult","Your selection is: (Index: 0, Value: value 1, Text: item 1)(Index: 1, Value: value 2, Text: item 2)(Index: 3, Value: value 4, Text: item 4)");
// Databind to an integer-indexed array
- $this->selectAndWait("ctl0\$body\$DBListBox1[]", "label=item 3");
- $this->verifyTextPresent("exact:Your selection is: (Index: 2, Value: 2, Text: item 3)", "");
+ $this->selectAndWait("ctl0\$body\$DBListBox1[]", "item 3");
+ $this->assertContains("Your selection is: (Index: 2, Value: 2, Text: item 3)", $this->source());
// Databind to an associative array
- $this->selectAndWait("ctl0\$body\$DBListBox2[]", "label=item 2");
- $this->verifyTextPresent("exact:Your selection is: (Index: 1, Value: key 2, Text: item 2)", "");
+ $this->selectAndWait("ctl0\$body\$DBListBox2[]", "item 2");
+ $this->assertContains("Your selection is: (Index: 1, Value: key 2, Text: item 2)", $this->source());
// Databind with DataTextField and DataValueField specified
- $this->selectAndWait("ctl0\$body\$DBListBox3[]", "label=Cary");
- $this->verifyTextPresent("exact:Your selection is: (Index: 2, Value: 003, Text: Cary)", "");
+ $this->selectAndWait("ctl0\$body\$DBListBox3[]", "Cary");
+ $this->assertContains("Your selection is: (Index: 2, Value: 003, Text: Cary)", $this->source());
// List box is being validated
- $this->verifyNotVisible('ctl0_body_ctl10');
- $this->click("id=ctl0_body_ctl11", "");
- $this->verifyVisible('ctl0_body_ctl10');
- $this->select("ctl0\$body\$VListBox1", "label=item 2");
- $this->clickAndWait("id=ctl0_body_ctl11", "");
- $this->verifyNotVisible('ctl0_body_ctl10');
+ $this->assertNotVisible('ctl0_body_ctl10');
+ $this->byId("ctl0_body_ctl11")->click();
+ $this->assertVisible('ctl0_body_ctl10');
+ $this->select("ctl0\$body\$VListBox1", "item 2");
+ $this->byId("ctl0_body_ctl11")->click();
+ $this->assertNotVisible('ctl0_body_ctl10');
// List box causing validation
- $this->verifyNotVisible('ctl0_body_ctl12');
- $this->select("ctl0\$body\$VListBox2", "label=Agree");
- $this->verifyVisible('ctl0_body_ctl12');
+ $this->assertNotVisible('ctl0_body_ctl12');
+ $this->select("ctl0\$body\$VListBox2", "Agree");
+ $this->assertVisible('ctl0_body_ctl12');
$this->type("ctl0\$body\$TextBox", "test");
- $this->selectAndWait("ctl0\$body\$VListBox2", "label=Disagree");
- $this->verifyNotVisible('ctl0_body_ctl12');
+ $this->selectAndWait("ctl0\$body\$VListBox2", "Disagree");
+ $this->assertNotVisible('ctl0_body_ctl12');
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/MultiViewTestCase.php b/tests/FunctionalTests/quickstart/Controls/MultiViewTestCase.php
index 2b47456e..d7a5ebec 100755
--- a/tests/FunctionalTests/quickstart/Controls/MultiViewTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/MultiViewTestCase.php
@@ -1,35 +1,35 @@
<?php
-class QuickstartMultiViewTestCase extends PradoGenericSeleniumTest
+class QuickstartMultiViewTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TMultiView.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TMultiView.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
// view 1 : type in a string
- $this->verifyElementNotPresent('ctl0_body_Result1');
- $this->verifyElementNotPresent('ctl0_body_Result2');
+ $this->assertElementNotPresent('ctl0_body_Result1');
+ $this->assertElementNotPresent('ctl0_body_Result2');
$this->type('ctl0_body_Memo','test');
- $this->clickAndWait('ctl0$body$ctl0'); // view 2 to select the dropdown
- $this->clickAndWait('ctl0$body$ctl4');
+ $this->byName('ctl0$body$ctl0')->click(); // view 2 to select the dropdown
+ $this->byName('ctl0$body$ctl4')->click();
// view 3 : check if the output is updated
- $this->verifyTextPresent('Your text input is: test');
- $this->verifyTextPresent('Your color choice is: Red');
- $this->clickAndWait('ctl0$body$ctl7');
+ $this->assertContains('Your text input is: test', $this->source());
+ $this->assertContains('Your color choice is: Red', $this->source());
+ $this->byName('ctl0$body$ctl7')->click();
// view 2 : update dropdownlist
- $this->verifyElementNotPresent('ctl0_body_Result1');
- $this->verifyElementNotPresent('ctl0_body_Result2');
- $this->select('ctl0$body$DropDownList', "label=Blue");
- $this->clickAndWait('ctl0$body$ctl4');
+ $this->assertElementNotPresent('ctl0_body_Result1');
+ $this->assertElementNotPresent('ctl0_body_Result2');
+ $this->select('ctl0$body$DropDownList', "Blue");
+ $this->byName('ctl0$body$ctl4')->click();
// view 3 : check if the output is updated
- $this->verifyTextPresent('Your text input is: test');
- $this->verifyTextPresent('Your color choice is: Blue');
- $this->clickAndWait('ctl0$body$ctl7');
+ $this->assertContains('Your text input is: test', $this->source());
+ $this->assertContains('Your color choice is: Blue', $this->source());
+ $this->byName('ctl0$body$ctl7')->click();
// view 2 : check if dropdownlist maintains state
$this->assertSelected('ctl0$body$DropDownList', "Blue");
diff --git a/tests/FunctionalTests/quickstart/Controls/PagerTestCase.php b/tests/FunctionalTests/quickstart/Controls/PagerTestCase.php
index a1fefed6..7e4a6627 100755
--- a/tests/FunctionalTests/quickstart/Controls/PagerTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/PagerTestCase.php
@@ -1,56 +1,56 @@
<?php
-class QuickstartPagerTestCase extends PradoGenericSeleniumTest
+class QuickstartPagerTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TPager.Sample1&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TPager.Sample1&amp;notheme=true&amp;lang=en");
// verify datalist content
- $this->verifyTextPresent('ITN001','');
- $this->verifyTextPresent('ITN002','');
- $this->verifyTextNotPresent('ITN003','');
+ $this->assertContains('ITN001', $this->source());
+ $this->assertContains('ITN002', $this->source());
+ $this->assertNotContains('ITN003', $this->source());
// verify numeric paging
- $this->clickAndWait("ctl0_body_Pager_ctl1", ""); // 2nd page
- $this->verifyTextPresent('ITN003','');
- $this->verifyTextPresent('ITN004','');
- $this->verifyTextNotPresent('ITN002','');
- $this->verifyTextNotPresent('ITN005','');
- $this->clickAndWait("ctl0_body_Pager_ctl3", ""); // 4rd page
- $this->verifyTextPresent('ITN007','');
- $this->verifyTextPresent('ITN008','');
- $this->verifyTextNotPresent('ITN006','');
- $this->verifyTextNotPresent('ITN009','');
- $this->clickAndWait("ctl0_body_Pager_ctl6", ""); // last page
- $this->verifyTextPresent('ITN019','');
- $this->verifyTextNotPresent('ITN018','');
- $this->verifyTextNotPresent('ITN001','');
+ $this->byId("ctl0_body_Pager_ctl1")->click(); // 2nd page
+ $this->assertContains('ITN003', $this->source());
+ $this->assertContains('ITN004', $this->source());
+ $this->assertNotContains('ITN002', $this->source());
+ $this->assertNotContains('ITN005', $this->source());
+ $this->byId("ctl0_body_Pager_ctl3")->click(); // 4rd page
+ $this->assertContains('ITN007', $this->source());
+ $this->assertContains('ITN008', $this->source());
+ $this->assertNotContains('ITN006', $this->source());
+ $this->assertNotContains('ITN009', $this->source());
+ $this->byId("ctl0_body_Pager_ctl6")->click(); // last page
+ $this->assertContains('ITN019', $this->source());
+ $this->assertNotContains('ITN018', $this->source());
+ $this->assertNotContains('ITN001', $this->source());
// verify next-prev paging
- $this->clickAndWait("ctl0_body_Pager2_ctl1", ""); // prev page
- $this->verifyTextPresent('ITN017','');
- $this->verifyTextPresent('ITN018','');
- $this->verifyTextNotPresent('ITN019','');
- $this->verifyTextNotPresent('ITN016','');
- $this->clickAndWait("ctl0_body_Pager2_ctl0", ""); // first page
- $this->verifyTextPresent('ITN001','');
- $this->verifyTextPresent('ITN002','');
- $this->verifyTextNotPresent('ITN003','');
- $this->clickAndWait("ctl0_body_Pager2_ctl2", ""); // next page
- $this->verifyTextPresent('ITN003','');
- $this->verifyTextPresent('ITN004','');
- $this->verifyTextNotPresent('ITN002','');
- $this->verifyTextNotPresent('ITN005','');
+ $this->byId("ctl0_body_Pager2_ctl1")->click(); // prev page
+ $this->assertContains('ITN017', $this->source());
+ $this->assertContains('ITN018', $this->source());
+ $this->assertNotContains('ITN019', $this->source());
+ $this->assertNotContains('ITN016', $this->source());
+ $this->byId("ctl0_body_Pager2_ctl0")->click(); // first page
+ $this->assertContains('ITN001', $this->source());
+ $this->assertContains('ITN002', $this->source());
+ $this->assertNotContains('ITN003', $this->source());
+ $this->byId("ctl0_body_Pager2_ctl2")->click(); // next page
+ $this->assertContains('ITN003', $this->source());
+ $this->assertContains('ITN004', $this->source());
+ $this->assertNotContains('ITN002', $this->source());
+ $this->assertNotContains('ITN005', $this->source());
$this->assertSelected("ctl0_body_Pager3_ctl0","2");
- $this->selectAndWait("ctl0_body_Pager3_ctl0", "label=5");
- $this->verifyTextPresent('ITN009','');
- $this->verifyTextPresent('ITN010','');
- $this->verifyTextNotPresent('ITN008','');
- $this->verifyTextNotPresent('ITN011','');
- $this->selectAndWait("ctl0_body_Pager3_ctl0", "label=10");
- $this->verifyTextPresent('ITN019','');
- $this->verifyTextNotPresent('ITN018','');
+ $this->selectAndWait("ctl0_body_Pager3_ctl0", "5");
+ $this->assertContains('ITN009', $this->source());
+ $this->assertContains('ITN010', $this->source());
+ $this->assertNotContains('ITN008', $this->source());
+ $this->assertNotContains('ITN011', $this->source());
+ $this->selectAndWait("ctl0_body_Pager3_ctl0", "10");
+ $this->assertContains('ITN019', $this->source());
+ $this->assertNotContains('ITN018', $this->source());
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/PanelTestCase.php b/tests/FunctionalTests/quickstart/Controls/PanelTestCase.php
index 3def308b..0d3e2797 100755
--- a/tests/FunctionalTests/quickstart/Controls/PanelTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/PanelTestCase.php
@@ -1,16 +1,16 @@
<?php
-class QuickstartPanelTestCase extends PradoGenericSeleniumTest
+class QuickstartPanelTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TPanel.Home&amp;notheme=true&amp;lang=en", "");
- $this->verifyTextPresent("This is panel content with", "");
- $this->verifyElementPresent("//span[text()='label']");
- $this->verifyTextPresent("grouping text", "");
- $this->click("//input[@name='ctl0\$body\$ctl17']", "");
- $this->verifyTextNotPresent("You have clicked on 'button2'.");
- $this->clickAndWait("//input[@type='submit' and @value='button2']", "");
- $this->verifyTextPresent("You have clicked on 'button2'.");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TPanel.Home&amp;notheme=true&amp;lang=en");
+ $this->assertContains("This is panel content with", $this->source());
+ $this->assertElementPresent("//span[text()='label']");
+ $this->assertContains("grouping text", $this->source());
+ $this->byXPath("//input[@name='ctl0\$body\$ctl17']")->click();
+ $this->assertNotContains("You have clicked on 'button2'.", $this->source());
+ $this->byXPath("//input[@type='submit' and @value='button2']")->click();
+ $this->assertContains("You have clicked on 'button2'.", $this->source());
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php b/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php
index 659f20ff..6242cebe 100755
--- a/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php
@@ -1,17 +1,17 @@
<?php
//New Test
-class QuickstartRadioButtonListTestCase extends PradoGenericSeleniumTest
+class QuickstartRadioButtonListTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TRadioButtonList.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TRadioButtonList.Home&amp;notheme=true&amp;lang=en");
// RadioButton list with default settings:
- $this->click("//input[@name='ctl0\$body\$ctl0' and @value='value 3']", "");
+ $this->byXPath("//input[@name='ctl0\$body\$ctl0' and @value='value 3']")->click();
// RadioButton list with customized cellpadding, cellspacing, color and text alignment:
- $this->click("//input[@name='ctl0\$body\$ctl1' and @value='value 1']", "");
+ $this->byXPath("//input[@name='ctl0\$body\$ctl1' and @value='value 1']")->click();
// *** Currently unable to test the following cases:
// RadioButton list with vertical (default) repeat direction
@@ -20,33 +20,33 @@ class QuickstartRadioButtonListTestCase extends PradoGenericSeleniumTest
// RadioButton list with flow layout and horizontal repeat direction:
// RadioButton list's behavior upon postback
- $this->click("//input[@name='ctl0\$body\$RadioButtonList' and @value='value 3']", "");
- $this->clickAndWait("//input[@type='submit' and @value='Submit']", "");
- $this->verifyTextPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", "");
+ $this->byXPath("//input[@name='ctl0\$body\$RadioButtonList' and @value='value 3']")->click();
+ $this->byXPath("//input[@type='submit' and @value='Submit']")->click();
+ $this->assertContains("Your selection is: (Index: 2, Value: value 3, Text: item 3)", $this->source());
// Auto postback check box list
- $this->clickAndWait("//input[@name='ctl0\$body\$ctl7' and @value='value 5']", "");
- $this->verifyTextPresent("Your selection is: (Index: 4, Value: value 5, Text: item 5)", "");
+ $this->byXPath("//input[@name='ctl0\$body\$ctl7' and @value='value 5']")->click();
+ $this->assertContains("Your selection is: (Index: 4, Value: value 5, Text: item 5)", $this->source());
// Databind to an integer-indexed array
- $this->clickAndWait("//input[@name='ctl0\$body\$DBRadioButtonList1' and @value='0']", "");
- $this->verifyTextPresent("Your selection is: (Index: 0, Value: 0, Text: item 1)", "");
+ $this->byXPath("//input[@name='ctl0\$body\$DBRadioButtonList1' and @value='0']")->click();
+ $this->assertContains("Your selection is: (Index: 0, Value: 0, Text: item 1)", $this->source());
// Databind to an associative array:
- $this->clickAndWait("//input[@name='ctl0\$body\$DBRadioButtonList2' and @value='key 2']", "");
- $this->verifyTextPresent("Your selection is: (Index: 1, Value: key 2, Text: item 2)", "");
+ $this->byXPath("//input[@name='ctl0\$body\$DBRadioButtonList2' and @value='key 2']")->click();
+ $this->assertContains("Your selection is: (Index: 1, Value: key 2, Text: item 2)", $this->source());
// Databind with DataTextField and DataValueField specified
- $this->clickAndWait("//input[@name='ctl0\$body\$DBRadioButtonList3' and @value='003']", "");
- $this->verifyTextPresent("Your selection is: (Index: 2, Value: 003, Text: Cary)", "");
+ $this->byXPath("//input[@name='ctl0\$body\$DBRadioButtonList3' and @value='003']")->click();
+ $this->assertContains("Your selection is: (Index: 2, Value: 003, Text: Cary)", $this->source());
// RadioButton list causing validation
- $this->verifyNotVisible('ctl0_body_ctl8');
- $this->click("//input[@name='ctl0\$body\$ctl9' and @value='Agree']", "");
+ $this->assertNotVisible('ctl0_body_ctl8');
+ $this->byXPath("//input[@name='ctl0\$body\$ctl9' and @value='Agree']")->click();
// $this->pause(1000);
- $this->verifyVisible('ctl0_body_ctl8');
+ $this->assertVisible('ctl0_body_ctl8');
$this->type("ctl0\$body\$TextBox", "test");
- $this->clickAndWait("//input[@name='ctl0\$body\$ctl9' and @value='Disagree']", "");
- $this->verifyNotVisible('ctl0_body_ctl8');
+ $this->byXPath("//input[@name='ctl0\$body\$ctl9' and @value='Disagree']")->click();
+ $this->assertNotVisible('ctl0_body_ctl8');
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php
index 22031235..214b1596 100755
--- a/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php
@@ -1,56 +1,56 @@
<?php
-class QuickstartRadioButtonTestCase extends PradoGenericSeleniumTest
+class QuickstartRadioButtonTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TRadioButton.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TRadioButton.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
// a regular radiobutton
- $this->click("//input[@name='ctl0\$body\$ctl0' and @value='ctl0\$body\$ctl0']", "");
+ $this->byXPath("//input[@name='ctl0\$body\$ctl0' and @value='ctl0\$body\$ctl0']")->click();
// a radiobutton with customized value
- $this->click("//input[@name='ctl0\$body\$ctl1' and @value='value']", "");
+ $this->byXPath("//input[@name='ctl0\$body\$ctl1' and @value='value']")->click();
// an auto postback radiobutton
- $this->verifyTextNotPresent("I'm clicked");
- $this->clickAndWait("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']", "");
- $this->verifyTextPresent("I'm clicked");
- $this->click("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']", "");
- $this->verifyTextPresent("I'm clicked");
+ $this->assertNotContains("I'm clicked", $this->source());
+ $this->byXPath("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']")->click();
+ $this->assertContains("I'm clicked", $this->source());
+ $this->byXPath("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']")->click();
+ $this->assertContains("I'm clicked", $this->source());
// a radiobutton causing validation on a textbox
- $this->verifyNotVisible('ctl0_body_ctl3');
- $this->click("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", "");
+ $this->assertNotVisible('ctl0_body_ctl3');
+ $this->byXPath("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']")->click();
$this->pause(1000);
- $this->verifyVisible('ctl0_body_ctl3');
- $this->click("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", "");
+ $this->assertVisible('ctl0_body_ctl3');
+ $this->byXPath("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']")->click();
$this->pause(1000);
- $this->verifyVisible('ctl0_body_ctl3');
+ $this->assertVisible('ctl0_body_ctl3');
$this->type("ctl0\$body\$TextBox", "test");
- $this->clickAndWait("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", "");
- $this->verifyNotVisible('ctl0_body_ctl3');
+ $this->byXPath("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']")->click();
+ $this->assertNotVisible('ctl0_body_ctl3');
// a radiobutton validated by a required field validator
- $this->verifyNotVisible('ctl0_body_ctl6');
- $this->click("//input[@type='submit' and @value='Submit']", "");
+ $this->assertNotVisible('ctl0_body_ctl6');
+ $this->byXPath("//input[@type='submit' and @value='Submit']")->click();
$this->pause(1000);
- $this->verifyVisible('ctl0_body_ctl6');
- $this->click("//input[@name='ctl0\$body\$RadioButton' and @value='ctl0\$body\$RadioButton']", "");
- $this->clickAndWait("//input[@type='submit' and @value='Submit']", "");
- $this->verifyNotVisible('ctl0_body_ctl6');
+ $this->assertVisible('ctl0_body_ctl6');
+ $this->byXPath("//input[@name='ctl0\$body\$RadioButton' and @value='ctl0\$body\$RadioButton']")->click();
+ $this->byXPath("//input[@type='submit' and @value='Submit']")->click();
+ $this->assertNotVisible('ctl0_body_ctl6');
// a radiobutton group
- $this->clickAndWait("name=ctl0\$body\$ctl7", "");
- $this->verifyTextPresent("Your selection is empty");
- $this->click("//input[@name='ctl0\$body\$RadioGroup' and @value='ctl0\$body\$Radio2']", "");
- $this->clickAndWait("name=ctl0\$body\$ctl7", "");
- $this->verifyTextPresent("Your selection is 2");
- $this->click("//input[@name='ctl0\$body\$RadioGroup' and @value='ctl0\$body\$Radio3']", "");
- $this->click("//input[@name='ctl0\$body\$Radio4' and @value='ctl0\$body\$Radio4']", "");
- $this->clickAndWait("name=ctl0\$body\$ctl7", "");
- $this->verifyTextPresent("Your selection is 34");
+ $this->byName("ctl0\$body\$ctl7")->click();
+ $this->assertContains("Your selection is empty", $this->source());
+ $this->byXPath("//input[@name='ctl0\$body\$RadioGroup' and @value='ctl0\$body\$Radio2']")->click();
+ $this->byName("ctl0\$body\$ctl7")->click();
+ $this->assertContains("Your selection is 2", $this->source());
+ $this->byXPath("//input[@name='ctl0\$body\$RadioGroup' and @value='ctl0\$body\$Radio3']")->click();
+ $this->byXPath("//input[@name='ctl0\$body\$Radio4' and @value='ctl0\$body\$Radio4']")->click();
+ $this->byName("ctl0\$body\$ctl7")->click();
+ $this->assertContains("Your selection is 34", $this->source());
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/Repeater1TestCase.php b/tests/FunctionalTests/quickstart/Controls/Repeater1TestCase.php
index 948055e1..4d7db9b3 100755
--- a/tests/FunctionalTests/quickstart/Controls/Repeater1TestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/Repeater1TestCase.php
@@ -1,27 +1,27 @@
<?php
-class QuickstartRepeater1TestCase extends PradoGenericSeleniumTest
+class QuickstartRepeater1TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TRepeater.Sample1&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TRepeater.Sample1&amp;notheme=true&amp;lang=en");
// verify if all required texts are present
- $this->verifyTextPresent('ID','');
- $this->verifyTextPresent('Name','');
- $this->verifyTextPresent('Quantity','');
- $this->verifyTextPresent('Price','');
- $this->verifyTextPresent('Imported','');
- $this->verifyTextPresent('ITN001','');
- $this->verifyTextPresent('Motherboard','');
- $this->verifyTextPresent('Yes','');
- $this->verifyTextPresent('ITN019','');
- $this->verifyTextPresent('Speaker','');
- $this->verifyTextPresent('No','');
- $this->verifyTextPresent('Computer Parts Inventory','');
+ $this->assertContains('ID', $this->source());
+ $this->assertContains('Name', $this->source());
+ $this->assertContains('Quantity', $this->source());
+ $this->assertContains('Price', $this->source());
+ $this->assertContains('Imported', $this->source());
+ $this->assertContains('ITN001', $this->source());
+ $this->assertContains('Motherboard', $this->source());
+ $this->assertContains('Yes', $this->source());
+ $this->assertContains('ITN019', $this->source());
+ $this->assertContains('Speaker', $this->source());
+ $this->assertContains('No', $this->source());
+ $this->assertContains('Computer Parts Inventory', $this->source());
// verify specific table tags
- $this->verifyElementPresent("//td[@colspan='5']");
- $this->verifyElementPresent("//table[@cellpadding='2']");
+ $this->assertElementPresent("//td[@colspan='5']");
+ $this->assertElementPresent("//table[@cellpadding='2']");
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/Repeater2TestCase.php b/tests/FunctionalTests/quickstart/Controls/Repeater2TestCase.php
index 7d989fd0..8eb8c863 100755
--- a/tests/FunctionalTests/quickstart/Controls/Repeater2TestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/Repeater2TestCase.php
@@ -1,35 +1,35 @@
<?php
-class QuickstartRepeater2TestCase extends PradoGenericSeleniumTest
+class QuickstartRepeater2TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TRepeater.Sample2&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TRepeater.Sample2&amp;notheme=true&amp;lang=en");
// verify if all required texts are present
- $this->verifyTextPresent('North','');
- $this->verifyTextPresent('John','');
- $this->verifyTextPresent('Developer','');
- $this->verifyTextPresent('South','');
- $this->verifyTextPresent('Carter','');
- $this->verifyTextPresent('Program Manager','');
+ $this->assertContains('North', $this->source());
+ $this->assertContains('John', $this->source());
+ $this->assertContains('Developer', $this->source());
+ $this->assertContains('South', $this->source());
+ $this->assertContains('Carter', $this->source());
+ $this->assertContains('Program Manager', $this->source());
// verify specific table tags
- $this->verifyElementPresent("//table[@cellspacing='1']");
- $this->verifyElementPresent("//td[@id='ctl0_body_Repeater_ctl1_Cell' and contains(text(),'North')]","");
- $this->verifyElementPresent("//td[@id='ctl0_body_Repeater_ctl1_Cell']","");
- $this->verifyElementPresent("//td[@id='ctl0_body_Repeater_ctl2_Cell']","");
- $this->verifyElementPresent("//td[@id='ctl0_body_Repeater_ctl3_Cell']","");
- $this->verifyElementPresent("//td[@id='ctl0_body_Repeater_ctl4_Cell']","");
- $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl1_Repeater2_ctl1_Row']","");
- $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl1_Repeater2_ctl2_Row']","");
- $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl1_Repeater2_ctl3_Row']","");
- $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl2_Repeater2_ctl1_Row']","");
- $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl2_Repeater2_ctl2_Row']","");
- $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl2_Repeater2_ctl3_Row']","");
- $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl3_Repeater2_ctl1_Row']","");
- $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl3_Repeater2_ctl2_Row']","");
- $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl4_Repeater2_ctl1_Row']","");
- $this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl4_Repeater2_ctl2_Row']","");
+ $this->assertElementPresent("//table[@cellspacing='1']");
+ $this->assertElementPresent("//td[@id='ctl0_body_Repeater_ctl1_Cell' and contains(text(),'North')]","");
+ $this->assertElementPresent("//td[@id='ctl0_body_Repeater_ctl1_Cell']","");
+ $this->assertElementPresent("//td[@id='ctl0_body_Repeater_ctl2_Cell']","");
+ $this->assertElementPresent("//td[@id='ctl0_body_Repeater_ctl3_Cell']","");
+ $this->assertElementPresent("//td[@id='ctl0_body_Repeater_ctl4_Cell']","");
+ $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl1_Repeater2_ctl1_Row']","");
+ $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl1_Repeater2_ctl2_Row']","");
+ $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl1_Repeater2_ctl3_Row']","");
+ $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl2_Repeater2_ctl1_Row']","");
+ $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl2_Repeater2_ctl2_Row']","");
+ $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl2_Repeater2_ctl3_Row']","");
+ $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl3_Repeater2_ctl1_Row']","");
+ $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl3_Repeater2_ctl2_Row']","");
+ $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl4_Repeater2_ctl1_Row']","");
+ $this->assertElementPresent("//tr[@id='ctl0_body_Repeater_ctl4_Repeater2_ctl2_Row']","");
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/Repeater3TestCase.php b/tests/FunctionalTests/quickstart/Controls/Repeater3TestCase.php
index a5031af5..3572a36f 100755
--- a/tests/FunctionalTests/quickstart/Controls/Repeater3TestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/Repeater3TestCase.php
@@ -1,35 +1,35 @@
<?php
-class QuickstartRepeater3TestCase extends PradoGenericSeleniumTest
+class QuickstartRepeater3TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TRepeater.Sample3&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TRepeater.Sample3&amp;notheme=true&amp;lang=en");
// verify product name is required
- $this->verifyNotVisible('ctl0_body_Repeater_ctl0_ctl0');
+ $this->assertNotVisible('ctl0_body_Repeater_ctl0_ctl0');
$this->type("ctl0_body_Repeater_ctl0_ProductName", "");
- $this->click("//input[@type='submit' and @value='Save']", "");
- $this->verifyVisible('ctl0_body_Repeater_ctl0_ctl0');
+ $this->byXPath("//input[@type='submit' and @value='Save']")->click();
+ $this->assertVisible('ctl0_body_Repeater_ctl0_ctl0');
// verify product price is of proper format
- $this->verifyNotVisible('ctl0_body_Repeater_ctl0_ctl1');
+ $this->assertNotVisible('ctl0_body_Repeater_ctl0_ctl1');
$this->type("ctl0_body_Repeater_ctl0_ProductPrice", "abc");
- $this->click("//input[@type='submit' and @value='Save']", "");
- $this->verifyVisible('ctl0_body_Repeater_ctl0_ctl1');
+ $this->byXPath("//input[@type='submit' and @value='Save']")->click();
+ $this->assertVisible('ctl0_body_Repeater_ctl0_ctl1');
// perform postback
- $this->click("ctl0_body_Repeater_ctl0_ProductImported",'');
+ $this->byId("ctl0_body_Repeater_ctl0_ProductImported",'')->click();
$this->type("ctl0_body_Repeater_ctl0_ProductName", "Mother Board");
$this->type("ctl0_body_Repeater_ctl0_ProductPrice", "99.01");
- $this->select("ctl0_body_Repeater_ctl3_ProductCategory", "label=Accessories");
- $this->clickAndWait("//input[@type='submit' and @value='Save']", "");
- $this->verifyNotVisible('ctl0_body_Repeater_ctl0_ctl0');
- $this->verifyNotVisible('ctl0_body_Repeater_ctl0_ctl1');
+ $this->select("ctl0_body_Repeater_ctl3_ProductCategory", "Accessories");
+ $this->byXPath("//input[@type='submit' and @value='Save']")->click();
+ $this->assertNotVisible('ctl0_body_Repeater_ctl0_ctl0');
+ $this->assertNotVisible('ctl0_body_Repeater_ctl0_ctl1');
// verify postback results
- $this->verifyElementPresent("//td[text()='Mother Board']",'');
- $this->verifyElementNotPresent("//td[text()='Input Devices']",'');
- $this->verifyElementPresent("//td[text()='99.01']",'');
+ $this->assertElementPresent("//td[text()='Mother Board']",'');
+ $this->assertElementNotPresent("//td[text()='Input Devices']",'');
+ $this->assertElementPresent("//td[text()='99.01']",'');
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/StatementsTestCase.php b/tests/FunctionalTests/quickstart/Controls/StatementsTestCase.php
index a7c4c579..df0e6f89 100755
--- a/tests/FunctionalTests/quickstart/Controls/StatementsTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/StatementsTestCase.php
@@ -1,13 +1,13 @@
<?php
-class QuickstartStatementsTestCase extends PradoGenericSeleniumTest
+class QuickstartStatementsTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TStatements.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TStatements.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
- $this->verifyTextPresent('UniqueID is \'ctl0$body$ctl0\'');
+ $this->assertContains('UniqueID is \'ctl0$body$ctl0\'', $this->source());
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/TabPanelTestCase.php b/tests/FunctionalTests/quickstart/Controls/TabPanelTestCase.php
index d01e824d..13392ca5 100755
--- a/tests/FunctionalTests/quickstart/Controls/TabPanelTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/TabPanelTestCase.php
@@ -1,47 +1,47 @@
<?php
-class QuickstartTabPanelTestCase extends PradoGenericSeleniumTest
+class QuickstartTabPanelTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TTabPanel.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TTabPanel.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
// verify initial visibility
- $this->verifyNotVisible('ctl0_body_View1'); // view 1
- $this->verifyVisible('ctl0_body_View2'); // view 2
- $this->verifyNotVisible('ctl0_body_ctl2'); // view 3
+ $this->assertNotVisible('ctl0_body_View1'); // view 1
+ $this->assertVisible('ctl0_body_View2'); // view 2
+ $this->assertNotVisible('ctl0_body_ctl2'); // view 3
// switching to the first view
- $this->click('ctl0_body_View1_0');
+ $this->byId('ctl0_body_View1_0')->click();
$this->pause(500);
- $this->verifyVisible('ctl0_body_View1'); // view 1
- $this->verifyNotVisible('ctl0_body_View2'); // view 2
- $this->verifyNotVisible('ctl0_body_ctl2'); // view 3
- $this->verifyNotVisible('ctl0_body_View11'); // view 11
- $this->verifyVisible('ctl0_body_View21'); // view 21
+ $this->assertVisible('ctl0_body_View1'); // view 1
+ $this->assertNotVisible('ctl0_body_View2'); // view 2
+ $this->assertNotVisible('ctl0_body_ctl2'); // view 3
+ $this->assertNotVisible('ctl0_body_View11'); // view 11
+ $this->assertVisible('ctl0_body_View21'); // view 21
// switching to View11
- $this->click('ctl0_body_View11_0');
+ $this->byId('ctl0_body_View11_0')->click();
$this->pause(500);
- $this->verifyVisible('ctl0_body_View1'); // view 1
- $this->verifyNotVisible('ctl0_body_View2'); // view 2
- $this->verifyNotVisible('ctl0_body_ctl2'); // view 3
- $this->verifyVisible('ctl0_body_View11'); // view 11
- $this->verifyNotVisible('ctl0_body_View21'); // view 21
+ $this->assertVisible('ctl0_body_View1'); // view 1
+ $this->assertNotVisible('ctl0_body_View2'); // view 2
+ $this->assertNotVisible('ctl0_body_ctl2'); // view 3
+ $this->assertVisible('ctl0_body_View11'); // view 11
+ $this->assertNotVisible('ctl0_body_View21'); // view 21
// switching to the third view
- $this->click('ctl0_body_ctl2_0');
+ $this->byId('ctl0_body_ctl2_0')->click();
$this->pause(500);
- $this->verifyNotVisible('ctl0_body_View1'); // view 1
- $this->verifyNotVisible('ctl0_body_View2'); // view 2
- $this->verifyVisible('ctl0_body_ctl2'); // view 3
+ $this->assertNotVisible('ctl0_body_View1'); // view 1
+ $this->assertNotVisible('ctl0_body_View2'); // view 2
+ $this->assertVisible('ctl0_body_ctl2'); // view 3
// submit: check if the visibility is kept
- $this->clickAndWait("//input[@type='submit' and @value='Submit']", "");
- $this->verifyNotVisible('ctl0_body_View1'); // view 1
- $this->verifyNotVisible('ctl0_body_View2'); // view 2
- $this->verifyVisible('ctl0_body_ctl2'); // view 3
+ $this->byXPath("//input[@type='submit' and @value='Submit']")->click();
+ $this->assertNotVisible('ctl0_body_View1'); // view 1
+ $this->assertNotVisible('ctl0_body_View2'); // view 2
+ $this->assertVisible('ctl0_body_ctl2'); // view 3
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/TableTestCase.php b/tests/FunctionalTests/quickstart/Controls/TableTestCase.php
index 128f4b22..aafd6f80 100755
--- a/tests/FunctionalTests/quickstart/Controls/TableTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/TableTestCase.php
@@ -1,18 +1,18 @@
<?php
-class QuickstartTableTestCase extends PradoGenericSeleniumTest
+class QuickstartTableTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TTable.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TTable.Home&amp;notheme=true&amp;lang=en");
- $this->verifyElementPresent("//table[@rules='all' and @border='1']");
- $this->verifyElementPresent("//table/caption[@align='bottom' and text()='This is table caption']");
- $this->verifyElementPresent("//th[text()='header cell 2']");
- $this->verifyElementPresent("//tr[@align='right']/td[text()='text']");
- $this->verifyElementPresent("//td[@align='center' and contains(text(),'cell 5')]");
+ $this->assertElementPresent("//table[@rules='all' and @border='1']");
+ $this->assertElementPresent("//table/caption[@align='bottom' and text()='This is table caption']");
+ $this->assertElementPresent("//th[text()='header cell 2']");
+ $this->assertElementPresent("//tr[@align='right']/td[text()='text']");
+ $this->assertElementPresent("//td[@align='center' and contains(text(),'cell 5')]");
- $this->verifyElementPresent("//th[text()='Header 1']");
- $this->verifyElementPresent("//td[text()='Cell 1']");
+ $this->assertElementPresent("//th[text()='Header 1']");
+ $this->assertElementPresent("//td[text()='Cell 1']");
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php b/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php
index a3464702..3865e33d 100755
--- a/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php
@@ -1,58 +1,58 @@
<?php
-class QuickstartTextBoxTestCase extends PradoGenericSeleniumTest
+class QuickstartTextBoxTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TTextBox.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TTextBox.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
// a normal textbox
$this->type("ctl0\$body\$ctl0", "test");
// textbox with maxlength set
- $this->verifyAttribute("ctl0\$body\$ctl1@size","4");
- $this->verifyAttribute("ctl0\$body\$ctl1@maxlength","6");
+ $this->assertAttribute("ctl0\$body\$ctl1@size","4");
+ $this->assertAttribute("ctl0\$body\$ctl1@maxlength","6");
$this->type("ctl0\$body\$ctl1", "textte");
// vCard textboxes
- $this->verifyAttribute("ctl0\$body\$ctl2@vcard_name","vCard.FirstName");
+ $this->assertAttribute("ctl0\$body\$ctl2@vcard_name","vCard.FirstName");
$this->type("ctl0\$body\$ctl2", "first");
- $this->verifyAttribute("ctl0\$body\$ctl3@vcard_name","vCard.LastName");
+ $this->assertAttribute("ctl0\$body\$ctl3@vcard_name","vCard.LastName");
$this->type("ctl0\$body\$ctl3", "last");
// a disabled textbox
- $this->verifyAttribute("ctl0\$body\$ctl4@disabled","regexp:true|disabled");
+ $this->assertAttribute("ctl0\$body\$ctl4@disabled","regexp:true|disabled");
// a read-only textbox
- $this->verifyAttribute("ctl0\$body\$ctl5@readonly","regexp:true|readonly");
+ $this->assertAttribute("ctl0\$body\$ctl5@readonly","regexp:true|readonly");
// auto postback textbox, CausesValidation=false
- $this->verifyValue("ctl0\$body\$ctl6", "change me");
- $this->typeAndWait("ctl0\$body\$ctl6", "change mes");
- $this->verifyValue("ctl0\$body\$ctl6", "text changed");
+ $this->assertValue("ctl0\$body\$ctl6", "change me");
+ $this->typeSpecial("ctl0\$body\$ctl6", "change mes");
+ $this->assertValue("ctl0\$body\$ctl6", "text changed");
// auto postback textbox, CausesValidation=true
- $this->verifyNotVisible('ctl0_body_ctl7');
- $this->type("ctl0\$body\$TextBox3", "test");
+ $this->assertNotVisible('ctl0_body_ctl7');
+ $this->typeSpecial("ctl0\$body\$TextBox3", "test");
// $this->pause(1000);
- $this->verifyVisible('ctl0_body_ctl7');
- $this->typeAndWait("ctl0\$body\$TextBox3", "non test");
- $this->verifyNotVisible('ctl0_body_ctl7');
+ $this->assertVisible('ctl0_body_ctl7');
+ $this->typeSpecial("ctl0\$body\$TextBox3", "non test");
+ $this->assertNotVisible('ctl0_body_ctl7');
// submitting textbox with a button
$this->type("ctl0\$body\$TextBox1", "texttext");
- $this->clickAndWait("//input[@type='submit' and @value='Submit']", "");
- $this->verifyValue("ctl0\$body\$TextBox1", "You just entered 'texttext'.");
+ $this->byXPath("//input[@type='submit' and @value='Submit']")->click();
+ $this->assertValue("ctl0\$body\$TextBox1", "You just entered 'texttext'.");
// SafeText
- $this->verifyText("ctl0_body_Output","test");
- $this->typeAndWait("ctl0\$body\$TextBox2","<a href=javascript:xxx>malicious code</a>");
- $this->verifyText("ctl0_body_Output","malicious code");
+ $this->assertText("ctl0_body_Output","test");
+ $this->typeSpecial("ctl0\$body\$TextBox2","<a href=javascript:xxx>malicious code</a>");
+ $this->assertText("ctl0_body_Output","malicious code");
// password
- $this->verifyAttribute("ctl0\$body\$ctl9@type","password");
+ $this->assertAttribute("ctl0\$body\$ctl9@type","password");
// ------------------multiline textbox----------------------
@@ -64,28 +64,28 @@ End of message
");
// a disabled multiline textbox
- $this->verifyAttribute("ctl0\$body\$ctl12@disabled","regexp:true|disabled");
+ $this->assertAttribute("ctl0\$body\$ctl12@disabled","regexp:true|disabled");
// a read-only multiline textbox
- $this->verifyAttribute("ctl0\$body\$ctl13@readonly","regexp:true|readonly");
- $this->verifyAttribute("ctl0\$body\$ctl13@wrap","off");
+ $this->assertAttribute("ctl0\$body\$ctl13@readonly","regexp:true|readonly");
+ $this->assertAttribute("ctl0\$body\$ctl13@wrap","off");
// auto postback textbox
- $this->verifyValue("ctl0\$body\$ctl14", "change me");
- $this->typeAndWait("ctl0\$body\$ctl14", "change mes");
- $this->verifyValue("ctl0\$body\$ctl14", "text changed");
- $this->verifyValue("ctl0\$body\$ctl10", "This is a\nmultiline\ntextbox.");
- $this->verifyValue("ctl0\$body\$ctl11", "This is a multiline text box.
+ $this->assertValue("ctl0\$body\$ctl14", "change me");
+ $this->typeSpecial("ctl0\$body\$ctl14", "change mes");
+ $this->assertValue("ctl0\$body\$ctl14", "text changed");
+ $this->assertValue("ctl0\$body\$ctl10", "This is a\nmultiline\ntextbox.");
+ $this->assertValue("ctl0\$body\$ctl11", "This is a multiline text box.
In HTML, it is displayed as a textarea.
End of message
");
// textbox associated with a validator
- $this->verifyNotVisible('ctl0_body_ctl15');
- $this->type("ctl0\$body\$MultiTextBox3", "demo");
+ $this->assertNotVisible('ctl0_body_ctl15');
+ $this->typeSpecial("ctl0\$body\$MultiTextBox3", "demo");
// $this->pause(1000);
- $this->verifyVisible('ctl0_body_ctl15');
- $this->typeAndWait("ctl0\$body\$MultiTextBox3", "non demo");
- $this->verifyNotVisible('ctl0_body_ctl15');
+ $this->assertVisible('ctl0_body_ctl15');
+ $this->typeSpecial("ctl0\$body\$MultiTextBox3", "non demo");
+ $this->assertNotVisible('ctl0_body_ctl15');
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard1TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard1TestCase.php
index 5e7018c4..7ac55349 100755
--- a/tests/FunctionalTests/quickstart/Controls/Wizard1TestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/Wizard1TestCase.php
@@ -1,24 +1,24 @@
<?php
-class QuickstartWizard1TestCase extends PradoGenericSeleniumTest
+class QuickstartWizard1TestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample1&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample1&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
// step 1
- $this->verifyTextPresent('Wizard Step 1');
- $this->verifyTextNotPresent('Wizard Step 2');
- $this->verifyVisible('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton');
- $this->verifyAttribute('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton@disabled','regexp:true|disabled');
- $this->select('ctl0$body$Wizard1$DropDownList1', "label=Purple");
- $this->clickAndWait('ctl0$body$Wizard1$ctl6$ctl1');
+ $this->assertContains('Wizard Step 1', $this->source());
+ $this->assertNotContains('Wizard Step 2', $this->source());
+ $this->assertVisible('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton');
+ $this->assertAttribute('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton@disabled','regexp:true|disabled');
+ $this->select('ctl0$body$Wizard1$DropDownList1', "Purple");
+ $this->byName('ctl0$body$Wizard1$ctl6$ctl1')->click();
// step 2
- $this->verifyTextPresent('Your favorite color is: Purple');
- $this->verifyTextNotPresent('Wizard Step 1');
- $this->verifyTextPresent('Wizard Step 2');
+ $this->assertContains('Your favorite color is: Purple', $this->source());
+ $this->assertNotContains('Wizard Step 1', $this->source());
+ $this->assertContains('Wizard Step 2', $this->source());
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard2TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard2TestCase.php
index a77280ff..85ef8655 100755
--- a/tests/FunctionalTests/quickstart/Controls/Wizard2TestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/Wizard2TestCase.php
@@ -1,24 +1,24 @@
<?php
-class QuickstartWizard2TestCase extends PradoGenericSeleniumTest
+class QuickstartWizard2TestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample2&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample2&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
// step 1
- $this->verifyTextPresent('Please let us know your preference');
- $this->verifyTextNotPresent('Thank you for your answer');
- $this->verifyVisible('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton');
- $this->verifyAttribute('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton@disabled','regexp:true|disabled');
- $this->select('ctl0$body$Wizard1$DropDownList1', "label=Blue");
- $this->clickAndWait('ctl0$body$Wizard1$ctl6$ctl1');
+ $this->assertContains('Please let us know your preference', $this->source());
+ $this->assertNotContains('Thank you for your answer', $this->source());
+ $this->assertVisible('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton');
+ $this->assertAttribute('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton@disabled','regexp:true|disabled');
+ $this->select('ctl0$body$Wizard1$DropDownList1', "Blue");
+ $this->byName('ctl0$body$Wizard1$ctl6$ctl1')->click();
// step 2
- $this->verifyTextPresent('Your favorite color is: Blue');
- $this->verifyTextNotPresent('Please let us know your preference');
- $this->verifyTextPresent('Thank you for your answer');
+ $this->assertContains('Your favorite color is: Blue', $this->source());
+ $this->assertNotContains('Please let us know your preference', $this->source());
+ $this->assertContains('Thank you for your answer', $this->source());
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard3TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard3TestCase.php
index ec0efe90..2568f233 100755
--- a/tests/FunctionalTests/quickstart/Controls/Wizard3TestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/Wizard3TestCase.php
@@ -1,44 +1,44 @@
<?php
-class QuickstartWizard3TestCase extends PradoGenericSeleniumTest
+class QuickstartWizard3TestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample3&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample3&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
// step 1
- $this->verifyTextPresent('A Mini Survey');
- $this->verifyTextPresent('PRADO QuickStart Sample');
- $this->click('ctl0_body_Wizard3_StudentCheckBox');
- $this->clickAndWait('ctl0$body$Wizard3$ctl4$ctl0');
+ $this->assertContains('A Mini Survey', $this->source());
+ $this->assertContains('PRADO QuickStart Sample', $this->source());
+ $this->byId('ctl0_body_Wizard3_StudentCheckBox')->click();
+ $this->byName('ctl0$body$Wizard3$ctl4$ctl0')->click();
// step 2
- $this->select('ctl0$body$Wizard3$DropDownList11', "label=Chemistry");
- $this->clickAndWait('ctl0$body$Wizard3$ctl5$ctl1');
+ $this->select('ctl0$body$Wizard3$DropDownList11', "Chemistry");
+ $this->byName('ctl0$body$Wizard3$ctl5$ctl1')->click();
// step 3
- $this->select('ctl0$body$Wizard3$DropDownList22', "label=Tennis");
- $this->clickAndWait('ctl0$body$Wizard3$ctl6$ctl1');
+ $this->select('ctl0$body$Wizard3$DropDownList22', "Tennis");
+ $this->byName('ctl0$body$Wizard3$ctl6$ctl1')->click();
// step 4
- $this->verifyTextPresent('You are a college student');
- $this->verifyTextPresent('You are in major: Chemistry');
- $this->verifyTextPresent('Your favorite sport is: Tennis');
+ $this->assertContains('You are a college student', $this->source());
+ $this->assertContains('You are in major: Chemistry', $this->source());
+ $this->assertContains('Your favorite sport is: Tennis', $this->source());
// run the example again. this time we skip the page asking about major
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample3&amp;notheme=true", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample3&amp;notheme=true");
// step 1
- $this->clickAndWait('ctl0$body$Wizard3$ctl4$ctl0');
+ $this->byName('ctl0$body$Wizard3$ctl4$ctl0')->click();
// step 3
- $this->select('ctl0$body$Wizard3$DropDownList22', "label=Baseball");
- $this->clickAndWait('ctl0$body$Wizard3$ctl6$ctl1');
+ $this->select('ctl0$body$Wizard3$DropDownList22', "Baseball");
+ $this->byName('ctl0$body$Wizard3$ctl6$ctl1')->click();
// step 4
- $this->verifyTextNotPresent('You are a college student');
- $this->verifyTextPresent('Your favorite sport is: Baseball');
+ $this->assertNotContains('You are a college student', $this->source());
+ $this->assertContains('Your favorite sport is: Baseball', $this->source());
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard4TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard4TestCase.php
index f2b8ad6e..41d3463e 100755
--- a/tests/FunctionalTests/quickstart/Controls/Wizard4TestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/Wizard4TestCase.php
@@ -1,42 +1,42 @@
<?php
-class QuickstartWizard4TestCase extends PradoGenericSeleniumTest
+class QuickstartWizard4TestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample4&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample4&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
// step 1
- $this->verifyTextPresent('Step 1 of 3');
- $this->select('ctl0_body_Wizard1_DropDownList1', "label=Cyan");
- $this->clickAndWait('ctl0_body_Wizard1_SideBarList_ctl2_SideBarButton');
+ $this->assertContains('Step 1 of 3', $this->source());
+ $this->select('ctl0_body_Wizard1_DropDownList1', "Cyan");
+ $this->byId('ctl0_body_Wizard1_SideBarList_ctl2_SideBarButton')->click();
// step 3
- $this->verifyTextPresent('Step 3 of 3');
- $this->verifyTextPresent('Thank you for completing this survey.');
- $this->clickAndWait('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton');
+ $this->assertContains('Step 3 of 3', $this->source());
+ $this->assertContains('Thank you for completing this survey.', $this->source());
+ $this->byId('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton')->click();
// step 1
$this->assertSelected('ctl0_body_Wizard1_DropDownList1', "Cyan");
- $this->select('ctl0_body_Wizard1_DropDownList1', "label=Black");
- $this->clickAndWait('ctl0_body_Wizard1_ctl4_ctl0');
+ $this->select('ctl0_body_Wizard1_DropDownList1', "Black");
+ $this->byId('ctl0_body_Wizard1_ctl4_ctl0')->click();
// step 2
- $this->verifyTextPresent('Step 2 of 3');
- $this->verifyTextPresent('Your favorite color is: Black');
- $this->clickAndWait('ctl0_body_Wizard1_ctl5_ctl0');
+ $this->assertContains('Step 2 of 3', $this->source());
+ $this->assertContains('Your favorite color is: Black', $this->source());
+ $this->byId('ctl0_body_Wizard1_ctl5_ctl0')->click();
// step 1
- $this->verifyTextPresent('Step 1 of 3');
+ $this->assertContains('Step 1 of 3', $this->source());
$this->assertSelected('ctl0_body_Wizard1_DropDownList1', "Black");
- $this->clickAndWait('ctl0_body_Wizard1_ctl4_ctl0');
+ $this->byId('ctl0_body_Wizard1_ctl4_ctl0')->click();
// step 2
- $this->clickAndWait('ctl0_body_Wizard1_ctl5_ctl1');
+ $this->byId('ctl0_body_Wizard1_ctl5_ctl1')->click();
// step 3
- $this->verifyTextPresent('Step 3 of 3');
+ $this->assertContains('Step 3 of 3', $this->source());
}
}
diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard5TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard5TestCase.php
index eb5edb3b..4c41a074 100755
--- a/tests/FunctionalTests/quickstart/Controls/Wizard5TestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/Wizard5TestCase.php
@@ -1,35 +1,35 @@
<?php
-class QuickstartWizard5TestCase extends PradoGenericSeleniumTest
+class QuickstartWizard5TestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample5&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample5&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
// step 1
- $this->verifyTextPresent('Please let us know your preference');
- $this->verifyVisible('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton');
- $this->verifyVisible('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton');
- $this->verifyAttribute('ctl0_body_Wizard1_SideBarList_ctl2_SideBarButton@disabled','regexp:true|disabled');
- $this->select('ctl0_body_Wizard1_DropDownList1', "label=Cyan");
- $this->clickAndWait('ctl0$body$Wizard1$ctl4$ctl0');
+ $this->assertContains('Please let us know your preference', $this->source());
+ $this->assertVisible('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton');
+ $this->assertVisible('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton');
+ $this->assertAttribute('ctl0_body_Wizard1_SideBarList_ctl2_SideBarButton@disabled','regexp:true|disabled');
+ $this->select('ctl0_body_Wizard1_DropDownList1', "Cyan");
+ $this->byName('ctl0$body$Wizard1$ctl4$ctl0')->click();
// step 2
- $this->select('ctl0_body_Wizard1_Step2_DropDownList2','label=Football');
- $this->clickAndWait('ctl0$body$Wizard1$ctl6$ctl0');
+ $this->select('ctl0_body_Wizard1_Step2_DropDownList2','Football');
+ $this->byName('ctl0$body$Wizard1$ctl6$ctl0')->click();
// step 1
$this->assertSelected('ctl0_body_Wizard1_DropDownList1','Cyan');
- $this->clickAndWait('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton');
+ $this->byId('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton')->click();
// step 2
$this->assertSelected('ctl0_body_Wizard1_Step2_DropDownList2','Football');
- $this->clickAndWait('ctl0$body$Wizard1$ctl6$ctl1');
+ $this->byName('ctl0$body$Wizard1$ctl6$ctl1')->click();
// step 3
- $this->verifyTextPresent('Your favorite color is: Cyan');
- $this->verifyTextPresent('Your favorite sport is: Football');
+ $this->assertContains('Your favorite color is: Cyan', $this->source());
+ $this->assertContains('Your favorite sport is: Football', $this->source());
}
}
diff --git a/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php b/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php
index 3d531b47..8f5557ca 100755
--- a/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php
+++ b/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php
@@ -1,32 +1,32 @@
<?php
-class QuickstartHangmanTestCase extends PradoGenericSeleniumTest
+class QuickstartHangmanTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=Fundamentals.Samples.Hangman.Home&amp;notheme=true&amp;lang=en", "");
- $this->verifyTitle("Hangman Game", "");
- $this->verifyTextPresent("Medium game; you are allowed 5 misses.", "");
- $this->clickAndWait("//input[@type='submit' and @value='Play!']", "");
- $this->verifyTextPresent("You must choose a difficulty level", "");
- $this->clickAndWait("//input[@type='submit' and @value='Play!']", "");
- $this->click("//input[@name='ctl0\$body\$LevelSelection' and @value='3']", "");
- $this->clickAndWait("//input[@type='submit' and @value='Play!']", "");
- $this->verifyTextPresent("Please make a guess", "");
- $this->verifyTextPresent("maximum of 3", "");
- $this->clickAndWait("link=B", "");
- $this->clickAndWait("link=F", "");
- $this->clickAndWait("link=Give up?", "");
- $this->verifyTextPresent("You Lose", "");
- $this->clickAndWait("link=Start Again", "");
- $this->clickAndWait("//input[@type='submit' and @value='Play!']", "");
- $this->verifyTextPresent("Please make a guess", "");
- $this->verifyTextPresent("maximum of 3", "");
- $this->clickAndWait("link=Give up?", "");
- $this->verifyTextPresent("You Lose", "");
- $this->clickAndWait("link=Start Again", "");
- $this->click("//input[@name='ctl0\$body\$LevelSelection' and @value='5']", "");
- $this->clickAndWait("//input[@type='submit' and @value='Play!']", "");
- $this->verifyTextPresent("maximum of 5", "");
+ $this->url("../../demos/quickstart/index.php?page=Fundamentals.Samples.Hangman.Home&amp;notheme=true&amp;lang=en");
+ $this->assertEquals("Hangman Game", $this->title());
+ $this->assertContains("Medium game; you are allowed 5 misses.", $this->source());
+ $this->byXPath("//input[@type='submit' and @value='Play!']")->click();
+ $this->assertContains("You must choose a difficulty level", $this->source());
+ $this->byXPath("//input[@type='submit' and @value='Play!']")->click();
+ $this->byXPath("//input[@name='ctl0\$body\$LevelSelection' and @value='3']")->click();
+ $this->byXPath("//input[@type='submit' and @value='Play!']")->click();
+ $this->assertContains("Please make a guess", $this->source());
+ $this->assertContains("maximum of 3", $this->source());
+ $this->byLinkText("B")->click();
+ $this->byLinkText("F")->click();
+ $this->byLinkText("Give up?")->click();
+ $this->assertContains("You Lose", $this->source());
+ $this->byLinkText("Start Again")->click();
+ $this->byXPath("//input[@type='submit' and @value='Play!']")->click();
+ $this->assertContains("Please make a guess", $this->source());
+ $this->assertContains("maximum of 3", $this->source());
+ $this->byLinkText("Give up?")->click();
+ $this->assertContains("You Lose", $this->source());
+ $this->byLinkText("Start Again")->click();
+ $this->byXPath("//input[@name='ctl0\$body\$LevelSelection' and @value='5']")->click();
+ $this->byXPath("//input[@type='submit' and @value='Play!']")->click();
+ $this->assertContains("maximum of 5", $this->source());
}
}
diff --git a/tests/FunctionalTests/tickets/protected/controls/ToggleImageButton.php b/tests/FunctionalTests/tickets/protected/controls/ToggleImageButton.php
index 9aecda84..0165edac 100755
--- a/tests/FunctionalTests/tickets/protected/controls/ToggleImageButton.php
+++ b/tests/FunctionalTests/tickets/protected/controls/ToggleImageButton.php
@@ -6,7 +6,6 @@
* @author Christophe BOULAIN (Christophe.Boulain@ceram.fr)
* @copyright Copyright &copy; 2007, CERAM Sophia Antipolis
* @license url nameoflicense
- * @version $Id: ToggleImageButton.php 2043 2007-06-30 15:07:50Z xue $
*
*/
diff --git a/tests/FunctionalTests/tickets/protected/pages/ExtendedToggleImageButton.php b/tests/FunctionalTests/tickets/protected/pages/ExtendedToggleImageButton.php
index 934efcef..7bc53ba3 100755
--- a/tests/FunctionalTests/tickets/protected/pages/ExtendedToggleImageButton.php
+++ b/tests/FunctionalTests/tickets/protected/pages/ExtendedToggleImageButton.php
@@ -1,16 +1,15 @@
<?php
/**
*
- *
+ *
* @author Christophe BOULAIN (Christophe.Boulain@ceram.fr)
* @copyright Copyright &copy; 2007, CERAM Sophia Antipolis
* @license url nameoflicense
- * @version $Id: ExtendedToggleImageButton.php 2039 2007-06-28 08:41:57Z tof $
- *
+ *
*/
prado::using ('Application.controls.ToggleImageButton');
class ExtendedToggleImageButton extends ToggleImageButton {
-
+
} \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Layout.tpl b/tests/FunctionalTests/tickets/protected/pages/Layout.tpl
index bf2f8fab..b245a50d 100755
--- a/tests/FunctionalTests/tickets/protected/pages/Layout.tpl
+++ b/tests/FunctionalTests/tickets/protected/pages/Layout.tpl
@@ -1,7 +1,7 @@
-<!DOCTYPE html PUBLIC
- "-//W3C//DTD XHTML 1.0 Strict//EN"
+<!DOCTYPE html PUBLIC
+ "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<com:THead Title="PRADO Functional Tests">
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
@@ -30,7 +30,6 @@
<com:TContentPlaceHolder ID="Content" />
<hr style="margin-top: 2em" />
-<com:TJavascriptLogger />
</com:TForm>
<div class="w3c">
<a href="http://validator.w3.org/check?uri=referer">
@@ -38,7 +37,7 @@
</a>
<a href="?page=ViewSource&amp;path=<%= str_replace('.','/', $this->Request->ServiceParameter) %>.page"
style="margin: 0 1em;"
- onclick="window.open(this.href); return false;"
+ onclick="window.open(this.href); return false;"
onkeypress="window.open(this.href); return false;">View Source</a>
</div>
</body>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket220.page b/tests/FunctionalTests/tickets/protected/pages/Ticket220.page
index e4c8fa95..fec54092 100755
--- a/tests/FunctionalTests/tickets/protected/pages/Ticket220.page
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket220.page
@@ -1,30 +1,26 @@
<com:TContent ID="Content">
<h1>ClientScript Test</h1>
-
+
<com:TClientScript ScriptUrl=<%~ test.js %>>
if(typeof(ClientScriptInfo) == "undefined")
ClientScriptInfo = [];
ClientScriptInfo.push("ok 3?")
</com:TClientScript>
-
+
<com:TClientScript>
if(typeof(ClientScriptInfo) == "undefined")
ClientScriptInfo = [];
ClientScriptInfo.push("ok 2!")
</com:TClientScript>
-
+
<com:TLabel ID="label1" Text="Label 1" />
<input type="button" id="button1" value="update" />
-
+
<com:TClientScript PradoScripts="prado">
- Event.observe("button1", "click", function()
+ $('#button1').click(function()
{
- element = $("<%= $this->label1->ClientID %>");
- if(element)
- element.innerHTML = "Label 1: "+inspect(ClientScriptInfo);
- else
- alert("failed");
+ $("#<%= $this->label1->ClientID %>").html('Label 1: ' + ClientScriptInfo.join('; '));
});
</com:TClientScript>
-
+
</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket278.page b/tests/FunctionalTests/tickets/protected/pages/Ticket278.page
index e7341bcc..8afaff22 100755
--- a/tests/FunctionalTests/tickets/protected/pages/Ticket278.page
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket278.page
@@ -21,7 +21,7 @@
OnPreRender="validate2_onPostValidate"
ErrorMessage="Text 2 is required">
<prop:ClientSide.OnValidate>
- sender.enabled = $("<%= $this->check1->ClientID %>").checked;
+ sender.enabled = $("#<%= $this->check1->ClientID %>").get(0).checked;
</prop:ClientSide.OnValidate>
</com:TRequiredFieldValidator>
@@ -30,13 +30,11 @@
<com:TButton ID="button1" Text="Submit!" />
<com:TClientScript>
- Event.OnLoad(function()
- {
- Event.observe("<%= $this->check1->ClientID %>", "click", function(ev)
- {
- $("<%= $this->panel1->ClientID %>").toggle();
+ jQuery( document ).ready(function() {
+ jQuery("#<%= $this->check1->ClientID %>").click(function() {
+ $("#<%= $this->panel1->ClientID %>").toggle();
+ });
});
- });
</com:TClientScript>
</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket290.page b/tests/FunctionalTests/tickets/protected/pages/Ticket290.page
index e9d40b92..3d4bf647 100755
--- a/tests/FunctionalTests/tickets/protected/pages/Ticket290.page
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket290.page
@@ -1,18 +1,17 @@
<com:TContent ID="Content">
- <h3>Needs manual testing</h3>
<com:TPanel ID="panel1" DefaultButton="button2"
Style="border:1px solid #ccc; padding:2em">
<com:TTextBox ID="textbox1" />
-
+
<com:TCustomValidator
ControlToValidate="textbox1"
OnServerValidate="customValidate"
ValidationGroup="group1"
ErrorMessage="required" />
-
- <com:TButton ID="button1" Text="Button 1"
+
+ <com:TButton ID="button1" Text="Button 1"
ValidationGroup="group1" OnClick="button_clicked" />
- <com:TButton ID="button2" Text="Button 2 (default)"
+ <com:TButton ID="button2" Text="Button 2 (default)"
ValidationGroup="group1" OnClick="button_clicked" />
<com:TLabel ID="label1" Text="Label 1" />
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket504.page b/tests/FunctionalTests/tickets/protected/pages/Ticket504.page
index 767a9c3a..535997d1 100755
--- a/tests/FunctionalTests/tickets/protected/pages/Ticket504.page
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket504.page
@@ -9,48 +9,48 @@
<com:TCallbackOptions ID="LoadDataOptions">
<prop:ClientSide.OnSuccess>
- $('status').innerHTML = sender.ActiveControl.CallbackParameter + " updated";
+ $('#status').html(sender.options.CallbackParameter + " updated");
</prop:ClientSide.OnSuccess>
<prop:ClientSide.OnLoading>
- $('loading').show();
+ $('#loading').show();
</prop:ClientSide.OnLoading>
<prop:ClientSide.OnComplete>
- $('loading').hide();
+ $('#loading').hide();
</prop:ClientSide.OnComplete>
</com:TCallbackOptions>
-
-<com:TActiveLinkButton
+
+<com:TActiveLinkButton
Text="Tab A"
ID="linka"
OnCallback="changePanel"
ActiveControl.CallbackOptions="LoadDataOptions"
ActiveControl.CallbackParameter="panelA"
- />
+ />
<com:TActiveLinkButton
Text="Tab B"
ID="linkb"
OnCallback="changePanel"
ActiveControl.CallbackOptions="LoadDataOptions"
ActiveControl.CallbackParameter="panelB"
- />
+ />
<com:TActiveLinkButton
Text="Tab C"
ID="linkc"
OnCallback="changePanel"
ActiveControl.CallbackOptions="LoadDataOptions"
ActiveControl.CallbackParameter="panelC"
- />
+ />
<com:TActiveLinkButton
Text="Tab D"
ID="linkd"
OnCallback="changePanel"
ActiveControl.CallbackOptions="LoadDataOptions"
ActiveControl.CallbackParameter="panelD"
- />
+ />
<com:TActivePanel ID="panelA">
<h1>Panel A</h1>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket585.page b/tests/FunctionalTests/tickets/protected/pages/Ticket585.page
index 9c02df4e..58cff91c 100755
--- a/tests/FunctionalTests/tickets/protected/pages/Ticket585.page
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket585.page
@@ -5,12 +5,12 @@
ID="validator1"
ControlToValidate="test"
OnServerValidate="ChkDate"
- ErrorMessage="*">
+ ErrorMessage="*">
<prop:ClientSide
- OnValidationError="$('error').innerHTML='Error'"
- OnValidationSuccess="$('error').innerHTML='Success'"
+ OnValidationError="$('#error').html('Error')"
+ OnValidationSuccess="$('#error').html('Success')"
ObserveChanges="false"
-
+
/>
</com:TActiveCustomValidator>
<span id="error"></span>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket586.page b/tests/FunctionalTests/tickets/protected/pages/Ticket586.page
index 29751cab..31bc7237 100755
--- a/tests/FunctionalTests/tickets/protected/pages/Ticket586.page
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket586.page
@@ -1,5 +1,4 @@
<com:TContent ID="Content">
-<h3>Needs manual testing</h3>
<com:TPanel DefaultButton="button2" Style="border:1px solid #ccc; padding:2em;">
<com:TTextBox ID="text1" />
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket653/Layout.tpl b/tests/FunctionalTests/tickets/protected/pages/Ticket653/Layout.tpl
index bf2f8fab..b245a50d 100755
--- a/tests/FunctionalTests/tickets/protected/pages/Ticket653/Layout.tpl
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket653/Layout.tpl
@@ -1,7 +1,7 @@
-<!DOCTYPE html PUBLIC
- "-//W3C//DTD XHTML 1.0 Strict//EN"
+<!DOCTYPE html PUBLIC
+ "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<com:THead Title="PRADO Functional Tests">
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
@@ -30,7 +30,6 @@
<com:TContentPlaceHolder ID="Content" />
<hr style="margin-top: 2em" />
-<com:TJavascriptLogger />
</com:TForm>
<div class="w3c">
<a href="http://validator.w3.org/check?uri=referer">
@@ -38,7 +37,7 @@
</a>
<a href="?page=ViewSource&amp;path=<%= str_replace('.','/', $this->Request->ServiceParameter) %>.page"
style="margin: 0 1em;"
- onclick="window.open(this.href); return false;"
+ onclick="window.open(this.href); return false;"
onkeypress="window.open(this.href); return false;">View Source</a>
</div>
</body>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket659.php b/tests/FunctionalTests/tickets/protected/pages/Ticket659.php
index cb266fd7..85b87d55 100755
--- a/tests/FunctionalTests/tickets/protected/pages/Ticket659.php
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket659.php
@@ -1,12 +1,11 @@
<?php
/**
*
- *
+ *
* @author Christophe BOULAIN (Christophe.Boulain@ceram.fr)
* @copyright Copyright &copy; 2007, CERAM Sophia Antipolis
* @license url nameoflicense
- * @version $Id: Ticket659.php 2039 2007-06-28 08:41:57Z tof $
- *
+ *
*/
prado::using ('Application.pages.ExtendedToggleImageButton');
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket691.page b/tests/FunctionalTests/tickets/protected/pages/Ticket691.page
index e5c4d8f7..ce55715d 100755
--- a/tests/FunctionalTests/tickets/protected/pages/Ticket691.page
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket691.page
@@ -3,7 +3,7 @@
<com:TCallbackOptions ID="RatingOption">
<prop:ClientSide.OnComplete>
- $('<%=$this->Title->ClientID%>').innerHTML = 'Thanks';
+ $('#<%=$this->Title->ClientID%>').html('Thanks');
</prop:ClientSide.OnComplete>
</com:TCallbackOptions>
<com:TActiveLabel ID="Title" Text="Cast your vote:" />
@@ -16,7 +16,7 @@
<com:TListItem Value="5" Text="Five stars" />
<com:TListItem Value="6" Text="Six stars" />
</com:TActiveRatingList>
-<com:TActiveLabel ID="Result"/>
+<com:TActiveLabel ID="Result"/>
</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket703/Ticket703.php b/tests/FunctionalTests/tickets/protected/pages/Ticket703/Ticket703.php
index adf71837..f254cf6d 100755
--- a/tests/FunctionalTests/tickets/protected/pages/Ticket703/Ticket703.php
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket703/Ticket703.php
@@ -6,24 +6,24 @@ class Ticket703 extends TPage {
parent::onLoad($param);
if (!$this->isPostBack && !$this->isCallback)
{
- $this->refreshLog();
+ $this->clearLog(null, null);
}
}
-
+
public function refreshLog ()
{
$this->logBox->Text=file_get_contents(prado::getPathOfNameSpace('Ticket703.Logs.LogFile', '.txt'));
}
-
+
public function clearLog ($sender, $param)
{
$file=prado::getPathOfNameSpace('Ticket703.Logs.LogFile', '.txt');
file_put_contents($file, '');
$this->refreshLog();
}
-
+
public function addLog($sender,$param)
{
- prado::log($this->logMessage->getText(), TLogger::DEBUG, "Tickets");
+ prado::log($this->logMessage->getText(), TLogger::DEBUG, "Tickets");
}
} \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket719.page b/tests/FunctionalTests/tickets/protected/pages/Ticket719.page
index b36d2d66..3f2bc17b 100755
--- a/tests/FunctionalTests/tickets/protected/pages/Ticket719.page
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket719.page
@@ -1,5 +1,4 @@
<com:TContent id="Content">
-<h3>Needs manual testing</h3>
<style>
.autocomplete
{
@@ -45,7 +44,7 @@ ul.different
OnSuggest="suggestCountries" Separator=", "
OnSuggestionSelected="suggestion_selected"
ResultPanel.CssClass="autocomplete" CausesValidation="false" />
-
+
</p>
<p>
<com:TButton OnClick="validForm" Text="Validate Form" /><br/>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket785.page b/tests/FunctionalTests/tickets/protected/pages/Ticket785.page
index 1b402a17..cd5a8783 100755
--- a/tests/FunctionalTests/tickets/protected/pages/Ticket785.page
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket785.page
@@ -1,20 +1,20 @@
-<com:TContent ID="Content">
-<com:TDatePicker Id="datePicker" InputMode="DropDownList">
+<com:TContent ID="Content">
+<com:TDatePicker Id="datePicker" InputMode="DropDownList">
<prop:ClientSide.OnDateChanged>
- $('selDate').innerHTML=parameter;
- </prop:ClientSide.OnDateChanged>
+ $('#selDate').html(parameter);
+ </prop:ClientSide.OnDateChanged>
</com:TDatePicker>
<p>
Client Side Selected date : <span id="selDate"></span>
</p>
-<com:TDatePicker Id="datePicker2" InputMode="TextBox" DateFormat="MM/dd/yyyy" Date="12/01/20007" >
+<com:TDatePicker Id="datePicker2" InputMode="TextBox" DateFormat="MM/dd/yyyy" Date="12/01/20007" >
<prop:ClientSide.OnDateChanged>
- $('selDate2').innerHTML=parameter;
- </prop:ClientSide.OnDateChanged>
+ $('#selDate2').html(parameter);
+ </prop:ClientSide.OnDateChanged>
</com:TDatePicker>
<p>
Client Side Selected date : <span id="selDate2"></span>
-</p>
+</p>
</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket897.php b/tests/FunctionalTests/tickets/protected/pages/Ticket897.php
index 358572bc..ec39d1b7 100755
--- a/tests/FunctionalTests/tickets/protected/pages/Ticket897.php
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket897.php
@@ -1,8 +1,8 @@
<?php
class Ticket897 extends TPage {
-
+
public function onButtonClicked($sender, $param) {
$this->Output->Text = date('Y-m-d', $this->Date->TimeStamp);
}
-
+
}
diff --git a/tests/FunctionalTests/tickets/protected/pages/ToggleTest.page b/tests/FunctionalTests/tickets/protected/pages/ToggleTest.page
index 0d633657..0d633657 100644..100755
--- a/tests/FunctionalTests/tickets/protected/pages/ToggleTest.page
+++ b/tests/FunctionalTests/tickets/protected/pages/ToggleTest.page
diff --git a/tests/FunctionalTests/tickets/protected/pages/ToggleTest.php b/tests/FunctionalTests/tickets/protected/pages/ToggleTest.php
index 73a2cc57..98492ffb 100644..100755
--- a/tests/FunctionalTests/tickets/protected/pages/ToggleTest.php
+++ b/tests/FunctionalTests/tickets/protected/pages/ToggleTest.php
@@ -1,12 +1,11 @@
<?php
/**
*
- *
+ *
* @author Christophe BOULAIN (Christophe.Boulain@ceram.fr)
* @copyright Copyright &copy; 2007, CERAM Sophia Antipolis
* @license url nameoflicense
- * @version $Id: ToggleTest.php 2039 2007-06-28 08:41:57Z tof $
- *
+ *
*/
prado::using ('Application.controls.ToggleImageButton');
@@ -15,5 +14,4 @@ class ToggleTest extends TPage {
public function clickToggleButton ($sender, $param) {
$this->lbl->Text=$sender->State;
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Issue120TestCase.php b/tests/FunctionalTests/tickets/tests/Issue120TestCase.php
index 20a4096b..0c6945ba 100755
--- a/tests/FunctionalTests/tickets/tests/Issue120TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Issue120TestCase.php
@@ -1,16 +1,16 @@
<?php
-class Issue120TestCase extends PradoGenericSeleniumTest
+class Issue120TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Issue120');
- $this->assertTextPresent('TActiveDropDownList PromptValue Test');
-
+ $this->url('tickets/index.php?page=Issue120');
+ $this->assertContains('TActiveDropDownList PromptValue Test', $this->source());
+
$this->assertSelectedIndex("ctl0_Content_ddl1", 0);
$this->assertSelectedValue("ctl0_Content_ddl1", 'PromptValue');
-
- $this->click("ctl0_Content_btn1");
+
+ $this->byId("ctl0_Content_btn1")->click();
$this->pause(800);
$this->assertSelectedIndex("ctl0_Content_ddl1", 0);
diff --git a/tests/FunctionalTests/tickets/tests/Issue216TestCase.php b/tests/FunctionalTests/tickets/tests/Issue216TestCase.php
index 375f90a7..d71db0e1 100755
--- a/tests/FunctionalTests/tickets/tests/Issue216TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Issue216TestCase.php
@@ -1,25 +1,25 @@
<?php
-class Issue216TestCase extends PradoGenericSeleniumTest
+class Issue216TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Issue216');
- $this->assertTextPresent('TTabPanel doesn\'t preserve active tab on callback request');
-
+ $this->url('tickets/index.php?page=Issue216');
+ $this->assertContains('TTabPanel doesn\'t preserve active tab on callback request', $this->source());
+
$this->assertVisible('ctl0_Content_tab1');
- $this->click("ctl0_Content_btn1");
+ $this->byId("ctl0_Content_btn1")->click();
$this->pause(800);
$this->assertText("ctl0_Content_result", "Tab ActiveIndex is : 0");
- $this->click("ctl0_Content_tab2_0");
+ $this->byId("ctl0_Content_tab2_0")->click();
$this->pause(800);
$this->assertVisible('ctl0_Content_tab2');
- $this->click("ctl0_Content_btn1");
+ $this->byId("ctl0_Content_btn1")->click();
$this->pause(800);
$this->assertText("ctl0_Content_result", "Tab ActiveIndex is : 1");
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket121TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket121TestCase.php
index 905a31a4..547ffb38 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket121TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket121TestCase.php
@@ -1,17 +1,17 @@
<?php
-class Ticket121TestCase extends PradoGenericSeleniumTest
+class Ticket121TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket121');
+ $this->url('tickets/index.php?page=Ticket121');
$this->type("ctl0\$Content\$FooTextBox", "");
- $this->verifyNotVisible('ctl0_Content_ctl1');
- $this->click("//input[@type='image' and @id='ctl0_Content_ctl0']", "");
- $this->verifyVisible('ctl0_Content_ctl1');
+ $this->assertNotVisible('ctl0_Content_ctl1');
+ $this->byXPath("//input[@type='image' and @id='ctl0_Content_ctl0']")->click();
+ $this->assertVisible('ctl0_Content_ctl1');
$this->type("ctl0\$Content\$FooTextBox", "content");
- $this->clickAndWait("//input[@type='image' and @id='ctl0_Content_ctl0']", "");
- $this->verifyNotVisible('ctl0_Content_ctl1');
- $this->verifyTextPresent("clicked at", "");
+ $this->byXPath("//input[@type='image' and @id='ctl0_Content_ctl0']")->click();
+ $this->assertNotVisible('ctl0_Content_ctl1');
+ $this->assertContains("clicked at", $this->source());
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket163TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket163TestCase.php
index 1727ac40..20d9c645 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket163TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket163TestCase.php
@@ -1,12 +1,12 @@
<?php
-class Ticket163TestCase extends PradoGenericSeleniumTest
+class Ticket163TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket163');
- $this->assertTextPresent('kr 100,00');
- $this->assertTextPresent('kr 0,00');
- $this->assertTextPresent('-kr 100,00');
+ $this->url('tickets/index.php?page=Ticket163');
+ $this->assertContains('kr 100,00', $this->source());
+ $this->assertContains('kr 0,00', $this->source());
+ $this->assertContains('-kr 100,00', $this->source());
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket169TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket169TestCase.php
index 9889ea50..47bb380b 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket169TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket169TestCase.php
@@ -1,12 +1,12 @@
<?php
-class Ticket169TestCase extends PradoGenericSeleniumTest
+class Ticket169TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket169');
+ $this->url('tickets/index.php?page=Ticket169');
$this->assertNotVisible('ctl0_Content_validator1');
- $this->click('ctl0_Content_ctl0');
+ $this->byId('ctl0_Content_ctl0')->click();
$this->assertVisible('ctl0_Content_validator1');
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket191TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket191TestCase.php
index 88de08cc..c0bccaa9 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket191TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket191TestCase.php
@@ -1,14 +1,14 @@
<?php
-class Ticket191TestCase extends PradoGenericSeleniumTest
+class Ticket191TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket191');
+ $this->url('tickets/index.php?page=Ticket191');
$this->type("ctl0\$Content\$TextBox2", "test");
- $this->clickAndWait("name=ctl0\$Content\$ctl0");
+ $this->byName("ctl0\$Content\$ctl0")->click();
$this->type("ctl0\$Content\$TextBox", "test");
- $this->clickAndWait("name=ctl0\$Content\$ctl1");
- $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->byName("ctl0\$Content\$ctl1")->click();
+ $this->assertNotVisible('ctl0_Content_ctl2');
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php
index 86768354..35274e6f 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php
@@ -1,21 +1,29 @@
<?php
-class Ticket205TestCase extends PradoGenericSeleniumTest
+class Ticket205TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open("tickets/index.php?page=Ticket205");
- $this->assertTitle("Verifying Ticket 205");
- $this->assertNotVisible("{$base}validator1");
+ $this->url("tickets/index.php?page=Ticket205");
+ $this->assertEquals($this->title(), "Verifying Ticket 205");
+
+ $validator=$this->byId("{$base}validator1");
+ $this->assertFalse($validator->displayed());
$this->type("{$base}textbox1", "test");
- $this->click("{$base}button1");
- $this->assertAlert("error");
- $this->assertVisible("{$base}validator1");
+ $this->byId("{$base}button1")->click();
+
+ $this->assertEquals("error", $this->alertText());
+ $this->acceptAlert();
+
+ $this->assertTrue($validator->displayed());
+
+ // type() calls clear() that triggers a focus change and thus a second alert
+ $this->typeSpecial("{$base}textbox1", "Prado");
- $this->type("{$base}textbox1", "Prado");
- $this->clickAndWait("{$base}button1");
- $this->assertNotVisible("{$base}validator1");
+ $this->byId("{$base}button1")->click();
+ $validator=$this->byId("{$base}validator1");
+ $this->assertFalse($validator->displayed());
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket207TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket207TestCase.php
index cd618a5d..cc993192 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket207TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket207TestCase.php
@@ -1,25 +1,28 @@
<?php
-class Ticket207TestCase extends PradoGenericSeleniumTest
+class Ticket207TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket207');
- $this->assertTitle("Verifying Ticket 207");
+ $this->url('tickets/index.php?page=Ticket207');
+ $this->assertEquals($this->title(), "Verifying Ticket 207");
$this->assertNotVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
-
- $this->click("{$base}button1");
- $this->assertAlert('error on text1 fired');
+
+ $this->byId("{$base}button1")->click();
+
+ $this->assertEquals('error on text1 fired', $this->alertText());
+ $this->acceptAlert();
+
$this->assertVisible("{$base}validator1");
$this->assertVisible("{$base}validator2");
-
+
$this->type("{$base}text1", 'test');
$this->assertVisible("{$base}validator1");
$this->assertVisible("{$base}validator2");
- $this->click("{$base}button1");
+ $this->byId("{$base}button1")->click();
$this->assertNotVisible("{$base}validator1");
$this->assertVisible("{$base}validator2");
@@ -27,8 +30,11 @@ class Ticket207TestCase extends PradoGenericSeleniumTest
$this->assertNotVisible("{$base}validator1");
$this->assertVisible("{$base}validator2");
- $this->click("{$base}button1");
- $this->assertAlert('error on text1 fired');
+ $this->byId("{$base}button1")->click();
+
+ $this->assertEquals('error on text1 fired', $this->alertText());
+ $this->acceptAlert();
+
$this->assertVisible("{$base}validator1");
$this->assertVisible("{$base}validator2");
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php
index 5e48ff2d..b9a0f0c9 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php
@@ -1,14 +1,14 @@
<?php
-class Ticket21TestCase extends PradoGenericSeleniumTest
+class Ticket21TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket21');
- $this->assertTitle("Verifying Ticket 21");
- $this->clickAndWait("ctl0_Content_button1");
- $this->verifyTextPresent("Radio button clicks: 1", "");
- $this->click("ctl0_Content_button1");
- $this->verifyTextPresent("Radio button clicks: 1", "");
+ $this->url('tickets/index.php?page=Ticket21');
+ $this->assertEquals($this->title(), "Verifying Ticket 21");
+ $this->byId("ctl0_Content_button1")->click();
+ $this->assertContains("Radio button clicks: 1", $this->source());
+ $this->byId("ctl0_Content_button1")->click();
+ $this->assertContains("Radio button clicks: 1", $this->source());
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php
index da5e8c15..3b31b23d 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php
@@ -1,16 +1,16 @@
<?php
-class Ticket220TestCase extends PradoGenericSeleniumTest
+class Ticket220TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base="ctl0_Content_";
- $this->open('tickets/index.php?page=Ticket220');
- $this->assertTextPresent('ClientScript Test');
+ $this->url('tickets/index.php?page=Ticket220');
+ $this->assertContains('ClientScript Test', $this->source());
$this->assertText("{$base}label1", "Label 1");
-
- $this->click("button1");
- $this->assertText("{$base}label1", 'exact:Label 1: ["ok", "ok 3?", "ok 2!"]');
+
+ $this->byId("button1")->click();
+ $this->assertText("{$base}label1", 'Label 1: ok; ok 3?; ok 2!');
$this->assertAlertNotPresent();
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php
index 3680eea1..74ad6505 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php
@@ -1,22 +1,22 @@
<?php
-class Ticket225TestCase extends PradoGenericSeleniumTest
+class Ticket225TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base="ctl0_Content_";
- $this->open('tickets/index.php?page=Ticket225');
- $this->assertTextPresent('RadioButton Group Tests');
+ $this->url('tickets/index.php?page=Ticket225');
+ $this->assertContains('RadioButton Group Tests', $this->source());
$this->assertText("{$base}label1", "Label 1");
$this->assertNotVisible("{$base}validator1");
- $this->click("{$base}button4");
+ $this->byId("{$base}button4")->click();
$this->assertVisible("{$base}validator1");
- $this->click("{$base}button2");
- $this->clickAndWait("{$base}button4");
+ $this->byId("{$base}button2")->click();
+ $this->byId("{$base}button4")->click();
- $this->assertText("{$base}label1", 'exact:ctl0$Content$button1 ctl0$Content$button2 ctl0$Content$button3');
+ $this->assertText("{$base}label1", 'ctl0$Content$button1 ctl0$Content$button2 ctl0$Content$button3');
$this->assertNotVisible("{$base}validator1");
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket227TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket227TestCase.php
index 1f1c0fb9..3defa014 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket227TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket227TestCase.php
@@ -1,10 +1,10 @@
<?php
-class Ticket227TestCase extends PradoGenericSeleniumTest
+class Ticket227TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket227');
- $this->assertTitle('Verifying Ticket 227');
+ $this->url('tickets/index.php?page=Ticket227');
+ $this->assertEquals($this->title(), 'Verifying Ticket 227');
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket239TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket239TestCase.php
index 57251d23..e5595a13 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket239TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket239TestCase.php
@@ -1,53 +1,53 @@
<?php
-class Ticket239TestCase extends PradoGenericSeleniumTest
+class Ticket239TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket239');
+ $this->url('tickets/index.php?page=Ticket239');
// view1
- $this->verifyTextPresent('view1 is activated','');
- $this->verifyTextNotPresent('view1 is deactivated','');
- $this->verifyTextNotPresent('view2 is activated','');
- $this->verifyTextNotPresent('view2 is deactivated','');
- $this->verifyTextNotPresent('view3 is activated','');
- $this->verifyTextNotPresent('view3 is deactivated','');
+ $this->assertContains('view1 is activated', $this->source());
+ $this->assertNotContains('view1 is deactivated', $this->source());
+ $this->assertNotContains('view2 is activated', $this->source());
+ $this->assertNotContains('view2 is deactivated', $this->source());
+ $this->assertNotContains('view3 is activated', $this->source());
+ $this->assertNotContains('view3 is deactivated', $this->source());
// goto view2
- $this->clickAndWait('name=ctl0$Content$ctl1');
- $this->verifyTextNotPresent('view1 is activated','');
- $this->verifyTextPresent('view1 is deactivated','');
- $this->verifyTextPresent('view2 is activated','');
- $this->verifyTextNotPresent('view2 is deactivated','');
- $this->verifyTextNotPresent('view3 is activated','');
- $this->verifyTextNotPresent('view3 is deactivated','');
+ $this->byName('ctl0$Content$ctl1')->click();
+ $this->assertNotContains('view1 is activated', $this->source());
+ $this->assertContains('view1 is deactivated', $this->source());
+ $this->assertContains('view2 is activated', $this->source());
+ $this->assertNotContains('view2 is deactivated', $this->source());
+ $this->assertNotContains('view3 is activated', $this->source());
+ $this->assertNotContains('view3 is deactivated', $this->source());
// goto view3
- $this->clickAndWait('name=ctl0$Content$ctl3');
- $this->verifyTextNotPresent('view1 is activated','');
- $this->verifyTextNotPresent('view1 is deactivated','');
- $this->verifyTextNotPresent('view2 is activated','');
- $this->verifyTextPresent('view2 is deactivated','');
- $this->verifyTextPresent('view3 is activated','');
- $this->verifyTextNotPresent('view3 is deactivated','');
+ $this->byName('ctl0$Content$ctl3')->click();
+ $this->assertNotContains('view1 is activated', $this->source());
+ $this->assertNotContains('view1 is deactivated', $this->source());
+ $this->assertNotContains('view2 is activated', $this->source());
+ $this->assertContains('view2 is deactivated', $this->source());
+ $this->assertContains('view3 is activated', $this->source());
+ $this->assertNotContains('view3 is deactivated', $this->source());
// goto view2
- $this->clickAndWait('name=ctl0$Content$ctl4');
- $this->verifyTextNotPresent('view1 is activated','');
- $this->verifyTextNotPresent('view1 is deactivated','');
- $this->verifyTextPresent('view2 is activated','');
- $this->verifyTextNotPresent('view2 is deactivated','');
- $this->verifyTextNotPresent('view3 is activated','');
- $this->verifyTextPresent('view3 is deactivated','');
+ $this->byName('ctl0$Content$ctl4')->click();
+ $this->assertNotContains('view1 is activated', $this->source());
+ $this->assertNotContains('view1 is deactivated', $this->source());
+ $this->assertContains('view2 is activated', $this->source());
+ $this->assertNotContains('view2 is deactivated', $this->source());
+ $this->assertNotContains('view3 is activated', $this->source());
+ $this->assertContains('view3 is deactivated', $this->source());
// goto view1
- $this->clickAndWait('name=ctl0$Content$ctl2');
- $this->verifyTextPresent('view1 is activated','');
- $this->verifyTextNotPresent('view1 is deactivated','');
- $this->verifyTextNotPresent('view2 is activated','');
- $this->verifyTextPresent('view2 is deactivated','');
- $this->verifyTextNotPresent('view3 is activated','');
- $this->verifyTextNotPresent('view3 is deactivated','');
+ $this->byName('ctl0$Content$ctl2')->click();
+ $this->assertContains('view1 is activated', $this->source());
+ $this->assertNotContains('view1 is deactivated', $this->source());
+ $this->assertNotContains('view2 is activated', $this->source());
+ $this->assertContains('view2 is deactivated', $this->source());
+ $this->assertNotContains('view3 is activated', $this->source());
+ $this->assertNotContains('view3 is deactivated', $this->source());
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket246TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket246TestCase.php
index bedd6e2c..7c4fe364 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket246TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket246TestCase.php
@@ -1,10 +1,10 @@
<?php
-class Ticket246TestCase extends PradoGenericSeleniumTest
+class Ticket246TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket246');
- $this->assertTitle('Verifying Ticket 246');
+ $this->url('tickets/index.php?page=Ticket246');
+ $this->assertEquals($this->title(), 'Verifying Ticket 246');
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket274TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket274TestCase.php
index b2b17de7..ebb60ca9 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket274TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket274TestCase.php
@@ -1,21 +1,21 @@
<?php
-class Ticket274TestCase extends PradoGenericSeleniumTest
+class Ticket274TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket274');
- $this->assertTitle('Verifying Ticket 274');
+ $this->url('tickets/index.php?page=Ticket274');
+ $this->assertEquals($this->title(), 'Verifying Ticket 274');
$this->assertNotVisible($base.'validator1');
$this->assertNotVisible($base.'validator2');
- $this->clickAndWait($base.'button1');
+ $this->byId($base.'button1')->click();
$this->assertVisible($base.'validator1');
$this->assertNotVisible($base.'validator2');
$this->type($base.'MyDate', 'asd');
- $this->clickAndWait($base.'button1');
+ $this->byId($base.'button1')->click();
$this->assertNotVisible($base.'validator1');
$this->assertVisible($base.'validator2');
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket278TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket278TestCase.php
index 4bfffede..ca11f626 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket278TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket278TestCase.php
@@ -1,28 +1,28 @@
<?php
-class Ticket278TestCase extends PradoGenericSeleniumTest
+class Ticket278TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket278');
- $this->assertTitle('Verifying Ticket 278');
+ $this->url('tickets/index.php?page=Ticket278');
+ $this->assertEquals($this->title(), 'Verifying Ticket 278');
$this->assertNotVisible($base.'validator1');
$this->assertNotVisible($base.'validator2');
$this->assertNotVisible($base.'panel1');
- $this->click($base.'button1');
+ $this->byId($base.'button1')->click();
$this->assertVisible($base.'validator1');
$this->assertNotVisible($base.'validator2');
$this->type($base.'text1', 'asd');
- $this->clickAndWait($base.'button1');
+ $this->byId($base.'button1')->click();
$this->assertNotVisible($base.'validator1');
$this->assertNotVisible($base.'validator2');
$this->assertNotVisible($base.'panel1');
- $this->click($base.'check1');
- $this->click($base.'button1');
+ $this->byId($base.'check1')->click();
+ $this->byId($base.'button1')->click();
$this->assertNotVisible($base.'validator1');
$this->assertVisible($base.'validator2');
$this->assertVisible($base.'panel1');
@@ -30,21 +30,21 @@ class Ticket278TestCase extends PradoGenericSeleniumTest
$this->type($base.'text1', '');
$this->type($base.'text2', 'asd');
- $this->click($base.'button1');
+ $this->byId($base.'button1')->click();
$this->assertVisible($base.'validator1');
$this->assertNotVisible($base.'validator2');
$this->assertVisible($base.'panel1');
$this->type($base.'text1', 'asd');
- $this->clickAndWait($base.'button1');
+ $this->byId($base.'button1')->click();
$this->assertNotVisible($base.'validator1');
$this->assertNotVisible($base.'validator2');
$this->assertVisible($base.'panel1');
$this->type($base.'text1', '');
$this->type($base.'text2', '');
- $this->click($base.'button1');
+ $this->byId($base.'button1')->click();
$this->assertVisible($base.'validator1');
$this->assertVisible($base.'validator2');
$this->assertVisible($base.'panel1');
diff --git a/tests/FunctionalTests/tickets/tests/Ticket27TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket27TestCase.php
index 7defd7ae..bc478895 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket27TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket27TestCase.php
@@ -1,16 +1,16 @@
<?php
-class Ticket27TestCase extends PradoGenericSeleniumTest
+class Ticket27TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket27');
- $this->verifyTitle("Verifying Ticket 27", "");
- $this->click("//input[@value='Agree']", "");
- $this->assertVisible("ctl0_Content_validator1", "");
+ $this->url('tickets/index.php?page=Ticket27');
+ $this->assertEquals("Verifying Ticket 27", $this->title());
+ $this->byXPath("//input[@value='Agree']")->click();
+ $this->assertVisible("ctl0_Content_validator1");
$this->type("ctl0_Content_TextBox", "122");
- $this->assertNotVisible("ctl0_Content_validator1", "");
- $this->clickAndWait("//input[@value='Disagree']", "");
- $this->assertNotVisible("ctl0_Content_validator1", "");
+ $this->assertNotVisible("ctl0_Content_validator1");
+ $this->byXPath("//input[@value='Disagree']")->click();
+ $this->assertNotVisible("ctl0_Content_validator1");
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket284TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket284TestCase.php
index d28ea771..b4a32c19 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket284TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket284TestCase.php
@@ -1,12 +1,12 @@
<?php
-class Ticket284TestCase extends PradoGenericSeleniumTest
+class Ticket284TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket284');
- $this->assertTextPresent('Verifying Ticket 284');
- $this->click('ctl0_Content_ctl1');
-
+ $this->url('tickets/index.php?page=Ticket284');
+ $this->assertContains('Verifying Ticket 284', $this->source());
+ $this->byId('ctl0_Content_ctl1')->click();
+
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket285TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket285TestCase.php
index 8b996964..04a451df 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket285TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket285TestCase.php
@@ -1,11 +1,11 @@
<?php
-class Ticket285TestCase extends PradoGenericSeleniumTest
+class Ticket285TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket285');
- $this->assertTextPresent('350.00');
- $this->assertTextPresent('349.99');
+ $this->url('tickets/index.php?page=Ticket285');
+ $this->assertContains('350.00', $this->source());
+ $this->assertContains('349.99', $this->source());
}
} \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket28TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket28TestCase.php
index 1f64b3f9..92bf1eb9 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket28TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket28TestCase.php
@@ -1,13 +1,13 @@
<?php
-class Ticket28TestCase extends PradoGenericSeleniumTest
+class Ticket28TestCase extends PradoGenericSelenium2Test
{
-
+
function test()
{
- $this->open('tickets/index.php?page=Ticket28');
- $this->assertTextPresent('Label 1');
- $this->clickAndWait('link=Click Me');
- $this->assertTextPresent('Link Button 1 Clicked!');
+ $this->url('tickets/index.php?page=Ticket28');
+ $this->assertContains('Label 1', $this->source());
+ $this->byLinkText("Click Me")->click();
+ $this->assertContains('Link Button 1 Clicked!', $this->source());
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket290TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket290TestCase.php
index f541d63d..8116e753 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket290TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket290TestCase.php
@@ -1,28 +1,27 @@
<?php
/**
-*
+*
*/
-class Ticket290TestCase extends PradoGenericSeleniumTest
+class Ticket290TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket290');
- $this->assertTitle("Verifying Ticket 290");
-
+ $this->url('tickets/index.php?page=Ticket290');
+ $this->assertEquals($this->title(), "Verifying Ticket 290");
+
$this->assertText("{$base}label1", "Label 1");
$this->assertText("{$base}label2", "Label 2");
$this->type("{$base}textbox1", "test");
- // bad hack to simulate enter key..
- $this->submit('ctl0_ctl1');
+
+ $this->byId("{$base}textbox1")->click();
+ $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::ENTER);
$this->pause(800);
-
- $this->assertText("{$base}label1", "Doing Validation");
- // this can't work properly without manual testing
- //$this->assertText("{$base}label2", "Button 2 (default) Clicked!");
+ $this->assertText("{$base}label1", "Doing Validation");
+ $this->assertText("{$base}label2", "Button 2 (default) Clicked!");
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket433TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket433TestCase.php
index b8462988..aae4ee21 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket433TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket433TestCase.php
@@ -1,15 +1,15 @@
<?php
-class Ticket433TestCase extends PradoGenericSeleniumTest
+class Ticket433TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket433');
- $this->assertTitle("Verifying Ticket 433");
+ $this->url('tickets/index.php?page=Ticket433');
+ $this->assertEquals($this->title(), "Verifying Ticket 433");
$this->assertText("{$base}VoteClick", "BEFORE click");
- $this->click("{$base}VoteClick");
+ $this->byId("{$base}VoteClick")->click();
$this->pause(800);
$this->assertText("{$base}VoteClick", "AFTER click CALLBACK DONE");
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket439TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket439TestCase.php
index c393de91..f586a6c9 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket439TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket439TestCase.php
@@ -1,15 +1,14 @@
<?php
-class Ticket439TestCase extends PradoGenericSeleniumTest
+class Ticket439TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket439');
- $this->assertTitle("Verifying Ticket 439");
- $this->click("{$base}button1");
- $this->waitForPageToLoad(3000);
+ $this->url('tickets/index.php?page=Ticket439');
+ $this->assertEquals($this->title(), "Verifying Ticket 439");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
- $this->assertTitle("Verifying Home");
+ $this->assertEquals($this->title(), "Verifying Home");
}
} \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket463TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket463TestCase.php
index 34ffb8fd..14f00970 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket463TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket463TestCase.php
@@ -1,11 +1,11 @@
<?php
-class Ticket463TestCase extends PradoGenericSeleniumTest
+class Ticket463TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket463');
- $this->verifyTitle("Verifying Ticket 463", "");
- $this->assertTextPresent('May 1, 2005 12:00:00 AM');
+ $this->url('tickets/index.php?page=Ticket463');
+ $this->assertEquals("Verifying Ticket 463", $this->title());
+ $this->assertContains('May 1, 2005 12:00:00 AM', $this->source());
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket470TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket470TestCase.php
index 4a2804ea..a3e25e85 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket470TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket470TestCase.php
@@ -1,31 +1,31 @@
<?php
-class Ticket470TestCase extends PradoGenericSeleniumTest
+class Ticket470TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket470');
- $this->verifyTitle("Verifying Ticket 470");
+ $this->url('tickets/index.php?page=Ticket470');
+ $this->assertEquals("Verifying Ticket 470", $this->title());
$this->assertText("{$base}counter", "0");
$this->assertText("{$base}Results", "");
$this->assertNotVisible("{$base}validator1");
- $this->click("{$base}button1");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
$this->assertText("{$base}counter", "0");
$this->assertText("{$base}Results", "");
$this->assertVisible("{$base}validator1");
$this->type("{$base}TextBox", "hello");
- $this->click("{$base}button1");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
$this->assertText("{$base}counter", "0");
$this->assertText("{$base}Results", "OK!!!");
$this->assertNotVisible("{$base}validator1");
//reload
- $this->click("{$base}reloadButton");
+ $this->byId("{$base}reloadButton")->click();
$this->pause(800);
$this->assertValue("{$base}TextBox", "hello");
$this->assertText("{$base}counter", "1");
@@ -33,14 +33,14 @@ class Ticket470TestCase extends PradoGenericSeleniumTest
$this->assertNotVisible("{$base}validator1");
$this->type("{$base}TextBox", "");
- $this->click("{$base}button1");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
$this->assertText("{$base}counter", "1");
$this->assertText("{$base}Results", "");
$this->assertVisible("{$base}validator1");
-
+
$this->type("{$base}TextBox", "test");
- $this->click("{$base}button1");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
$this->assertText("{$base}counter", "1");
$this->assertText("{$base}Results", "OK!!!");
diff --git a/tests/FunctionalTests/tickets/tests/Ticket477TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket477TestCase.php
index 16ebc56e..7f9bc58c 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket477TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket477TestCase.php
@@ -1,21 +1,21 @@
<?php
-class Ticket477TestCase extends PradoGenericSeleniumTest
+class Ticket477TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket477');
- $this->assertTitle("Verifying Ticket 477");
+ $this->url('tickets/index.php?page=Ticket477');
+ $this->assertEquals($this->title(), "Verifying Ticket 477");
$this->assertNotVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
- $this->clickAndWait("{$base}list1_c1");
+ $this->byId("{$base}list1_c1")->click();
$this->assertVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
- $this->clickAndWait("{$base}list2_c1");
+ $this->byId("{$base}list2_c1")->click();
$this->assertNotVisible("{$base}validator1");
$this->assertVisible("{$base}validator2");
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket488TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket488TestCase.php
index c3b2f43f..e4b72aaf 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket488TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket488TestCase.php
@@ -1,40 +1,41 @@
<?php
-class Ticket488TestCase extends PradoGenericSeleniumTest
+class Ticket488TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('active-controls/index.php?page=CustomValidatorByPass');
- $this->assertTextPresent('Custom Login');
+ $base='ctl0_Content_';
+ $this->url('active-controls/index.php?page=CustomValidatorByPass');
+ $this->assertContains('Custom Login', $this->source());
$this->assertNotVisible('loginBox');
- $this->click("showLogin");
+ $this->byId("showLogin")->click();
$this->assertVisible("loginBox");
- $this->assertNotVisible("validator1");
- $this->assertNotVisible("validator2");
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
- $this->click("checkLogin");
+ $this->byId("{$base}checkLogin")->click();
$this->pause(800);
- $this->assertVisible("validator1");
- $this->assertNotVisible("validator2");
+ $this->assertVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
- $this->type('Username', 'tea');
- $this->type('Password', 'mmama');
+ $this->type("{$base}Username", 'tea');
+ $this->type("{$base}Password", 'mmama');
- $this->click("checkLogin");
+ $this->byId("{$base}checkLogin")->click();
$this->pause(800);
- $this->assertNotVisible("validator1");
- $this->assertVisible("validator2");
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertVisible("{$base}validator2");
- $this->type('Password', 'test');
- $this->click("checkLogin");
+ $this->type("{$base}Password", 'test');
+ $this->byId("{$base}checkLogin")->click();
$this->pause(800);
- $this->assertNotVisible("validator1");
- $this->assertNotVisible("validator2");
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
}
function test_more()
{
- $this->open('tickets/index.php?page=Ticket488');
+ $this->url('tickets/index.php?page=Ticket488');
//add test assertions here.
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket504TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket504TestCase.php
index 63ecfe2f..f3bdd0a9 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket504TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket504TestCase.php
@@ -1,12 +1,12 @@
<?php
-class Ticket504TestCase extends PradoGenericSeleniumTest
+class Ticket504TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket504');
- $this->verifyTitle("Verifying Ticket 504", "");
+ $this->url('tickets/index.php?page=Ticket504');
+ $this->assertEquals("Verifying Ticket 504", $this->title());
$this->assertText("status", "");
@@ -15,7 +15,7 @@ class Ticket504TestCase extends PradoGenericSeleniumTest
$this->assertVisible("{$base}panelC");
$this->assertVisible("{$base}panelD");
- $this->click("{$base}linka");
+ $this->byId("{$base}linka")->click();
$this->pause(800);
$this->assertVisible("{$base}panelA");
$this->assertNotVisible("{$base}panelB");
@@ -23,7 +23,7 @@ class Ticket504TestCase extends PradoGenericSeleniumTest
$this->assertNotVisible("{$base}panelD");
$this->assertText("status", "panelA updated");
- $this->click("{$base}linkb");
+ $this->byId("{$base}linkb")->click();
$this->pause(800);
$this->assertNotVisible("{$base}panelA");
$this->assertVisible("{$base}panelB");
@@ -31,7 +31,7 @@ class Ticket504TestCase extends PradoGenericSeleniumTest
$this->assertNotVisible("{$base}panelD");
$this->assertText("status", "panelB updated");
- $this->click("{$base}linkc");
+ $this->byId("{$base}linkc")->click();
$this->pause(800);
$this->assertNotVisible("{$base}panelA");
$this->assertNotVisible("{$base}panelB");
@@ -39,7 +39,7 @@ class Ticket504TestCase extends PradoGenericSeleniumTest
$this->assertNotVisible("{$base}panelD");
$this->assertText("status", "panelC updated");
- $this->click("{$base}linkd");
+ $this->byId("{$base}linkd")->click();
$this->pause(800);
$this->assertNotVisible("{$base}panelA");
$this->assertNotVisible("{$base}panelB");
diff --git a/tests/FunctionalTests/tickets/tests/Ticket507TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket507TestCase.php
index 19d54e9b..68c94b03 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket507TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket507TestCase.php
@@ -1,16 +1,16 @@
<?php
-class Ticket507TestCase extends PradoGenericSeleniumTest
+class Ticket507TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base='ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket507');
- $this->verifyTitle("Verifying Ticket 507", "");
+ $this->url('tickets/index.php?page=Ticket507');
+ $this->assertEquals("Verifying Ticket 507", $this->title());
$this->assertText("{$base}label1", "Label 1");
- $this->click("{$base}button1");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
$this->select("{$base}list1", "item 1");
diff --git a/tests/FunctionalTests/tickets/tests/Ticket521TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket521TestCase.php
index 2df88612..71457b58 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket521TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket521TestCase.php
@@ -1,15 +1,15 @@
<?php
-class Ticket521TestCase extends PradoGenericSeleniumTest
+class Ticket521TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open("tickets/index.php?page=Ticket521");
- $this->assertTitle("Verifying Ticket 521");
+ $this->url("tickets/index.php?page=Ticket521");
+ $this->assertEquals($this->title(), "Verifying Ticket 521");
$this->assertText("{$base}label1", "Label 1");
- $this->click("{$base}button1");
+ $this->byId("{$base}button1")->click();
$this->pause(1200);
$this->assertText("{$base}label1", "Button 1 was clicked on callback");
diff --git a/tests/FunctionalTests/tickets/tests/Ticket526TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket526TestCase.php
index 7476db69..c8659002 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket526TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket526TestCase.php
@@ -1,16 +1,16 @@
<?php
-class Ticket526TestCase extends PradoGenericSeleniumTest
+class Ticket526TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base="ctl0_Content_";
- $this->open('tickets/index.php?page=Ticket526');
- $this->verifyTitle("Verifying Ticket 526", "");
+ $this->url('tickets/index.php?page=Ticket526');
+ $this->assertEquals("Verifying Ticket 526", $this->title());
$this->assertElementNotPresent("{$base}dpbutton");
- $this->click("{$base}btn");
+ $this->byId("{$base}btn")->click();
$this->pause(800);
$this->assertElementPresent("{$base}dpbutton");
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket528TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket528TestCase.php
index 3903000a..7fb24d04 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket528TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket528TestCase.php
@@ -1,12 +1,12 @@
<?php
-class Ticket528TestCase extends PradoGenericSeleniumTest
+class Ticket528TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket528');
- $this->assertTitle("Verifying Ticket 528");
+ $this->url('tickets/index.php?page=Ticket528');
+ $this->assertEquals($this->title(), "Verifying Ticket 528");
$this->select("{$base}DDropTurno", "Tarde");
$this->pause(800);
diff --git a/tests/FunctionalTests/tickets/tests/Ticket535TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket535TestCase.php
index 26f5a7d7..eebd2336 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket535TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket535TestCase.php
@@ -1,34 +1,34 @@
<?php
-class Ticket535TestCase extends PradoGenericSeleniumTest
+class Ticket535TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket535');
- $this->assertTitle("Verifying Ticket 535");
+ $this->url('tickets/index.php?page=Ticket535');
+ $this->assertEquals($this->title(), "Verifying Ticket 535");
$this->assertText("{$base}label1", "Label 1");
- $this->click("{$base}radio1");
- $this->click("{$base}button1");
+ $this->byId("{$base}radio1")->click();
+ $this->byId("{$base}button1")->click();
$this->pause(800);
- $this->assertText("{$base}label1", 'exact:radio1 checked:{1} radio2 checked:{}');
+ $this->assertText("{$base}label1", 'radio1 checked:{1} radio2 checked:{}');
- $this->click("{$base}radio2");
- $this->click("{$base}button1");
+ $this->byId("{$base}radio2")->click();
+ $this->byId("{$base}button1")->click();
$this->pause(800);
- $this->assertText("{$base}label1", 'exact:radio1 checked:{1} radio2 checked:{1}');
+ $this->assertText("{$base}label1", 'radio1 checked:{1} radio2 checked:{1}');
- $this->click("{$base}bad_radio1");
- $this->click("{$base}button2");
+ $this->byId("{$base}bad_radio1")->click();
+ $this->byId("{$base}button2")->click();
$this->pause(800);
- $this->assertText("{$base}label1", 'exact:bad_radio1 checked:{1} bad_radio2 checked:{}');
+ $this->assertText("{$base}label1", 'bad_radio1 checked:{1} bad_radio2 checked:{}');
- $this->click("{$base}bad_radio2");
- $this->click("{$base}button2");
+ $this->byId("{$base}bad_radio2")->click();
+ $this->byId("{$base}button2")->click();
$this->pause(800);
- $this->assertText("{$base}label1", 'exact:bad_radio1 checked:{} bad_radio2 checked:{1}');
+ $this->assertText("{$base}label1", 'bad_radio1 checked:{} bad_radio2 checked:{1}');
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket538TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket538TestCase.php
index 16b0f863..2970837f 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket538TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket538TestCase.php
@@ -1,17 +1,17 @@
<?php
-class Ticket538TestCase extends PradoGenericSeleniumTest
+class Ticket538TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base="ctl0_Content_";
- $this->open('tickets/index.php?page=Ticket538');
- $this->verifyTitle("Verifying Ticket 538", "");
+ $this->url('tickets/index.php?page=Ticket538');
+ $this->assertEquals("Verifying Ticket 538", $this->title());
$this->assertText("{$base}ALLog", 'waiting for response...');
$this->select("{$base}DataViewer", "empty :(");
- $this->click("{$base}selectBtn");
+ $this->byId("{$base}selectBtn")->click();
$this->pause(800);
$this->assertText("{$base}ALLog", '0,');
@@ -21,7 +21,7 @@ class Ticket538TestCase extends PradoGenericSeleniumTest
$this->select("{$base}DataViewer", "G1: Steven=>10");
$this->addSelection("{$base}DataViewer", "G2: Kevin=>65");
- $this->click("{$base}selectBtn");
+ $this->byId("{$base}selectBtn")->click();
$this->pause(800);
$this->assertText("{$base}ALLog", '4- "test1", 10- "test2",');
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket54TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket54TestCase.php
index f8e5a469..cf1433b6 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket54TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket54TestCase.php
@@ -1,10 +1,10 @@
<?php
-class Ticket54TestCase extends PradoGenericSeleniumTest
+class Ticket54TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket54');
- $this->verifyTextPresent("|A|a|B|b|C|", "");
+ $this->url('tickets/index.php?page=Ticket54');
+ $this->assertContains("|A|a|B|b|C|", $this->source());
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket573TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket573TestCase.php
index 996d72e9..cccdbaf3 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket573TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket573TestCase.php
@@ -1,11 +1,11 @@
<?php
-class Ticket573TestCase extends PradoGenericSeleniumTest
+class Ticket573TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket573');
- $this->verifyTitle("Verifying Ticket 573", "");
+ $this->url('tickets/index.php?page=Ticket573');
+ $this->assertEquals("Verifying Ticket 573", $this->title());
$this->assertText('test1', '10.00');
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket578TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket578TestCase.php
index 47330326..948d8642 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket578TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket578TestCase.php
@@ -1,22 +1,27 @@
<?php
-class Ticket578TestCase extends PradoGenericSeleniumTest
+class Ticket578TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket578');
- $this->verifyTitle("Verifying Ticket 578", "");
+ $this->url('tickets/index.php?page=Ticket578');
+ $this->assertEquals("Verifying Ticket 578", $this->title());
$this->assertText("{$base}label1", "Label 1");
- $this->click("{$base}button1", "");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
- $this->assertText("{$base}label1", "Button 1 was clicked : ");
+ $this->assertText("{$base}label1", "Button 1 was clicked :");
$text="helloworld";
- $this->runScript("tinyMCE.get('{$base}text1').setContent('{$text}')");
- $this->click("{$base}button1", "");
+
+ $this->execute(array(
+ 'script' => "tinyMCE.get('{$base}text1').setContent('{$text}')",
+ 'args' => array()
+ ));
+
+ $this->byId("{$base}button1")->click();
$this->pause(800);
- $this->assertText("{$base}label1", "exact:Button 1 was clicked : <p>{$text}</p>");
+ $this->assertText("{$base}label1", "Button 1 was clicked : <p>{$text}</p>");
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket585TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket585TestCase.php
index 8b2d36b3..58b42c33 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket585TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket585TestCase.php
@@ -1,23 +1,23 @@
<?php
-class Ticket585TestCase extends PradoGenericSeleniumTest
+class Ticket585TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket585');
- $this->verifyTitle("Verifying Ticket 585", "");
+ $this->url('tickets/index.php?page=Ticket585');
+ $this->assertEquals("Verifying Ticket 585", $this->title());
$this->assertText("error", "");
$this->assertNotVisible("{$base}validator1");
- $this->click("{$base}button1");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
$this->assertText("error", "Success");
$this->assertNotVisible("{$base}validator1");
$this->type("{$base}test", "15-03-2007");
- $this->click("{$base}button1");
+ $this->byId("{$base}button1")->click();
$this->pause(800);
$this->assertText("error", "Error");
$this->assertVisible("{$base}validator1");
diff --git a/tests/FunctionalTests/tickets/tests/Ticket586TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket586TestCase.php
index 612c086a..5fd47f86 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket586TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket586TestCase.php
@@ -1,15 +1,15 @@
<?php
-class Ticket586TestCase extends PradoGenericSeleniumTest
+class Ticket586TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket586');
- $this->verifyTitle("Verifying Ticket 586", "");
+ $this->url('tickets/index.php?page=Ticket586');
+ $this->assertEquals("Verifying Ticket 586", $this->title());
$this->assertText("{$base}label1", "Status");
- $this->clickAndWait("{$base}button1");
+ $this->byId("{$base}button1")->click();
$this->assertText("{$base}label1", "Button 1 Clicked!");
$this->type("{$base}text1", "testing");
diff --git a/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php
index d5064c1e..cb42c343 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php
@@ -1,12 +1,12 @@
<?php
-class Ticket587TestCase extends PradoGenericSeleniumTest
+class Ticket587TestCase extends PradoGenericSelenium2Test
{
function testKeyPress()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket587_reopened');
- $this->assertTitle("Verifying Ticket 587_reopened");
+ $this->url('tickets/index.php?page=Ticket587_reopened');
+ $this->assertEquals($this->title(), "Verifying Ticket 587_reopened");
$this->assertText($base."label1", "Label 1");
$this->select($base."list1", "item 3");
@@ -16,7 +16,6 @@ class Ticket587TestCase extends PradoGenericSeleniumTest
$this->assertText($base."label1", "Selection 2: value 3 - item 4");
$this->type($base.'text1', 't');
- $this->runScript("Prado.Registry.get('{$base}text1').onKeyPress({})");
$this->pause(800);
$this->select($base."list2", "asd 3 - item 2");
$this->pause(800);
@@ -26,8 +25,8 @@ class Ticket587TestCase extends PradoGenericSeleniumTest
function testButtonClick()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket587_reopened');
- $this->assertTitle("Verifying Ticket 587_reopened");
+ $this->url('tickets/index.php?page=Ticket587_reopened');
+ $this->assertEquals($this->title(), "Verifying Ticket 587_reopened");
$this->assertText($base."label1", "Label 1");
$this->select($base."list1", "item 3");
@@ -36,7 +35,7 @@ class Ticket587TestCase extends PradoGenericSeleniumTest
$this->pause(800);
$this->assertText($base."label1", "Selection 2: value 3 - item 4");
- $this->click($base.'button6');
+ $this->byId($base.'button6')->click();
$this->pause(800);
$this->select($base."list2", "asd 3 - item 2");
$this->pause(800);
diff --git a/tests/FunctionalTests/tickets/tests/Ticket592TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket592TestCase.php
index ec8d2284..692e2451 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket592TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket592TestCase.php
@@ -1,45 +1,45 @@
<?php
-class Ticket592TestCase extends PradoGenericSeleniumTest
+class Ticket592TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket592');
- $this->assertTitle("Verifying Ticket 592");
+ $this->url('tickets/index.php?page=Ticket592');
+ $this->assertEquals($this->title(), "Verifying Ticket 592");
$this->assertText("{$base}label1", "Label 1");
- $this->click("{$base}radio1");
- $this->click("{$base}button1");
+ $this->byId("{$base}radio1")->click();
+ $this->byId("{$base}button1")->click();
$this->pause(800);
- $this->assertText("{$base}label1", 'exact:radio1 checked:{1} radio2 checked:{}');
+ $this->assertText("{$base}label1", 'radio1 checked:{1} radio2 checked:{}');
- $this->click("{$base}radio2");
- $this->click("{$base}button1");
+ $this->byId("{$base}radio2")->click();
+ $this->byId("{$base}button1")->click();
$this->pause(800);
- $this->assertText("{$base}label1", 'exact:radio1 checked:{1} radio2 checked:{1}');
+ $this->assertText("{$base}label1", 'radio1 checked:{1} radio2 checked:{1}');
- $this->click("{$base}bad_radio1");
- $this->click("{$base}button2");
+ $this->byId("{$base}bad_radio1")->click();
+ $this->byId("{$base}button2")->click();
$this->pause(800);
- $this->assertText("{$base}label1", 'exact:bad_radio1 checked:{1} bad_radio2 checked:{}');
+ $this->assertText("{$base}label1", 'bad_radio1 checked:{1} bad_radio2 checked:{}');
- $this->click("{$base}bad_radio2");
- $this->click("{$base}button2");
+ $this->byId("{$base}bad_radio2")->click();
+ $this->byId("{$base}button2")->click();
$this->pause(800);
- $this->assertText("{$base}label1", 'exact:bad_radio1 checked:{} bad_radio2 checked:{1}');
-
- $this->click("{$base}bad_radio3");
- $this->click("{$base}button3");
+ $this->assertText("{$base}label1", 'bad_radio1 checked:{} bad_radio2 checked:{1}');
+
+ $this->byId("{$base}bad_radio3")->click();
+ $this->byId("{$base}button3")->click();
$this->pause(800);
- $this->assertText("{$base}label1", 'exact:bad_radio3 checked:{1} bad_radio4 checked:{}');
+ $this->assertText("{$base}label1", 'bad_radio3 checked:{1} bad_radio4 checked:{}');
- $this->click("{$base}bad_radio4");
- $this->click("{$base}button3");
+ $this->byId("{$base}bad_radio4")->click();
+ $this->byId("{$base}button3")->click();
$this->pause(800);
- $this->assertText("{$base}label1", 'exact:bad_radio3 checked:{} bad_radio4 checked:{1}');
-
+ $this->assertText("{$base}label1", 'bad_radio3 checked:{} bad_radio4 checked:{1}');
+
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php
index 14b2f985..27d57a91 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php
@@ -1,36 +1,36 @@
<?php
-class Ticket595TestCase extends PradoGenericSeleniumTest
+class Ticket595TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base="ctl0_Content_";
- $this->open('tickets/index.php?page=Ticket595');
- $this->assertTitle("Verifying Ticket 595");
-
- $this->click($base.'ctl2');
+ $this->url('tickets/index.php?page=Ticket595');
+ $this->assertEquals($this->title(), "Verifying Ticket 595");
+
+ $this->byId($base.'ctl2')->click();
$this->assertAttribute($base.'A@class','errorclassA');
-
+
$this->type($base.'A', 'Prado');
- $this->click($base.'ctl2');
+ $this->byId($base.'ctl2')->click();
$this->assertAttribute($base.'A@class','errorclassA');
-
+
$this->type($base.'A', 'test@pradosoft.com');
- $this->click($base.'ctl2');
+ $this->byId($base.'ctl2')->click();
$this->pause(800);
$this->assertAttribute($base.'A@class','');
- $this->click($base.'ctl5');
+ $this->byId($base.'ctl5')->click();
$this->pause(800);
- $this->assertAttribute($base.'B@class','exact: errorclassB');
-
+ $this->assertAttribute($base.'B@class',' errorclassB');
+
$this->type($base.'B', 'Prado');
- $this->click($base.'ctl5');
+ $this->byId($base.'ctl5')->click();
$this->pause(800);
- $this->assertAttribute($base.'B@class','exact: errorclassB');
-
+ $this->assertAttribute($base.'B@class',' errorclassB');
+
$this->type($base.'B', 'test@pradosoft.com');
- $this->click($base.'ctl5');
+ $this->byId($base.'ctl5')->click();
$this->pause(800);
$this->assertAttribute($base.'B@class','');
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket622TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket622TestCase.php
index 0d0fe3d2..b51f55d3 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket622TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket622TestCase.php
@@ -1,17 +1,18 @@
<?php
-class Ticket622TestCase extends PradoGenericSeleniumTest
+class Ticket622TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base="ctl0_Content_";
- $this->open('tickets/index.php?page=Ticket622');
- $this->assertTitle("Verifying Ticket 622");
-
- $this->click($base.'ctl0');
+ $this->url('tickets/index.php?page=Ticket622');
+ $this->assertEquals($this->title(), "Verifying Ticket 622");
+
+ $this->byId($base.'ctl0')->click();
$this->pause(800);
- $this->assertAttribute($base.'ALB@style',';');
- $this->assertAttribute('css=span#acb span@style', ';');
- $this->assertAttribute('css=span#arb span@style', ';');
+
+ $this->assertEquals('', $this->byId($base.'ALB')->attribute('style'));
+ $this->assertEquals('', $this->byCssSelector('span#acb span')->attribute('style'));
+ $this->assertEquals('', $this->byCssSelector('span#arb span')->attribute('style'));
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket653TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket653TestCase.php
index ec5eceb4..09987387 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket653TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket653TestCase.php
@@ -1,12 +1,12 @@
<?php
-class Ticket653TestCase extends PradoGenericSeleniumTest
+class Ticket653TestCase extends PradoGenericSelenium2Test
{
function test()
{
// Open with 'Friendly URL'
- $this->open('tickets/index.php/ticket653');
- $this->verifyTitle("Verifying Ticket 653", "");
+ $this->url('tickets/index.php/ticket653');
+ $this->assertEquals("Verifying Ticket 653", $this->title());
$this->assertText('textspan', 'This is the page for Ticket653');
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket656TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket656TestCase.php
index ff167b0e..174b096b 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket656TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket656TestCase.php
@@ -1,24 +1,25 @@
<?php
-class Ticket656TestCase extends PradoGenericSeleniumTest
+class Ticket656TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket656');
- $this->assertTitle("Verifying Ticket 656");
-
+ $this->url('tickets/index.php?page=Ticket656');
+ $this->assertEquals($this->title(), "Verifying Ticket 656");
+
// First test, current date
- $this->click($base."btnUpdate");
+ $this->byId($base."btnUpdate")->click();
$this->pause(800);
$this->assertText($base."lblStatus",date("d-m-Y"));
-
+
// Then, set another date
+ $year=date('Y')-2;
$this->select($base."datePicker_day",20);
$this->select($base."datePicker_month", 10);
- $this->select($base."datePicker_year", 2008);
- $this->click($base."btnUpdate");
+ $this->select($base."datePicker_year", $year);
+ $this->byId($base."btnUpdate")->click();
$this->pause(800);
- $this->assertText($base."lblStatus",date("d-m-Y", mktime(0,0,0,10,20,2008)));
+ $this->assertText($base."lblStatus",date("d-m-Y", mktime(0,0,0,10,20,$year)));
}
} \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket659TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket659TestCase.php
index 91326e9d..d5d73bc8 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket659TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket659TestCase.php
@@ -1,20 +1,20 @@
<?php
-class Ticket659TestCase extends PradoGenericSeleniumTest
+class Ticket659TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
// Normal component (working)
- $this->open('tickets/index.php?page=ToggleTest');
+ $this->url('tickets/index.php?page=ToggleTest');
$this->assertText("${base}lbl", "Down");
- $this->click("${base}btn", "");
+ $this->byId("${base}btn")->click();
$this->pause(800);
$this->assertText("${base}lbl", "Up");
// Extended component (not working)
- $this->open('tickets/index.php?page=Ticket659');
+ $this->url('tickets/index.php?page=Ticket659');
$this->assertText("${base}lbl", "Down");
- $this->click("${base}btn", "");
+ $this->byId("${base}btn")->click();
$this->pause(800);
$this->assertText("${base}lbl", "Up");
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket660TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket660TestCase.php
index e0c97e53..86f03442 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket660TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket660TestCase.php
@@ -1,24 +1,24 @@
<?php
-class Ticket660TestCase extends PradoGenericSeleniumTest
+class Ticket660TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket660');
- $this->assertTitle("Verifying Ticket 660");
-
- $this->click($base.'PB');
+ $this->url('tickets/index.php?page=Ticket660');
+ $this->assertEquals($this->title(), "Verifying Ticket 660");
+
+ $this->byId($base.'PB')->click();
$this->pause(800);
$this->assertText($base.'A','ÄÖÜ äöü');
$this->type($base.'T', 'äää');
- $this->click($base.'PB');
+ $this->byId($base.'PB')->click();
$this->pause(800);
$this->assertText($base.'A','äääÄÖÜ äöü');
/*
// CALLBACK CURRENTLY CAN'T WORK ON NON-UTF8 strings
$this->type($base.'T', 'ööö');
- $this->click($base.'CB');
+ $this->byId($base.'CB')->click();
$this->pause(800);
$this->assertText($base.'A','öööÄÖÜ äöü');
*/
diff --git a/tests/FunctionalTests/tickets/tests/Ticket669TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket669TestCase.php
index b6931808..8b5a0166 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket669TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket669TestCase.php
@@ -1,47 +1,47 @@
<?php
-class Ticket669TestCase extends PradoGenericSeleniumTest
+class Ticket669TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket669');
- $this->assertTitle("Verifying Ticket 669");
-
- $this->assertTextPresent('1 - Test without callback');
- $this->assertValue($base.'tb1', 'exact:ActiveTextBox');
- $this->assertValue($base.'tb2', 'exact:TextBox in ActivePanel');
-
- $this->click($base.'ctl4');
+ $this->url('tickets/index.php?page=Ticket669');
+ $this->assertEquals($this->title(), "Verifying Ticket 669");
+
+ $this->assertContains('1 - Test without callback', $this->source());
+ $this->assertValue($base.'tb1', 'ActiveTextBox');
+ $this->assertValue($base.'tb2', 'TextBox in ActivePanel');
+
+ $this->byId($base.'ctl4')->click();
$this->pause(800);
- $this->assertValue($base.'tb1', 'exact:ActiveTextBox +1');
- $this->assertValue($base.'tb2', 'exact:TextBox in ActivePanel +1');
-
- $this->click($base.'ctl1');
+ $this->assertValue($base.'tb1', 'ActiveTextBox +1');
+ $this->assertValue($base.'tb2', 'TextBox in ActivePanel +1');
+
+ $this->byId($base.'ctl1')->click();
$this->pause(800);
- $this->assertTextPresent('2 - Test callback with 2nd ActivePanel');
- $this->assertValue($base.'tb3', 'exact:ActiveTextBox');
- $this->assertValue($base.'tb4', 'exact:TextBox in ActivePanel');
- $this->assertValue($base.'tb5', 'exact:TextBox in ActivePanel');
-
- $this->click($base.'ctl6');
+ $this->assertContains('2 - Test callback with 2nd ActivePanel', $this->source());
+ $this->assertValue($base.'tb3', 'ActiveTextBox');
+ $this->assertValue($base.'tb4', 'TextBox in ActivePanel');
+ $this->assertValue($base.'tb5', 'TextBox in ActivePanel');
+
+ $this->byId($base.'ctl6')->click();
$this->pause(800);
-
- $this->assertValue($base.'tb3', 'exact:ActiveTextBox +1');
- $this->assertValue($base.'tb4', 'exact:TextBox in ActivePanel +1');
- $this->assertValue($base.'tb5', 'exact:TextBox in ActivePanel +1');
-
- $this->click($base.'ctl2');
+
+ $this->assertValue($base.'tb3', 'ActiveTextBox +1');
+ $this->assertValue($base.'tb4', 'TextBox in ActivePanel +1');
+ $this->assertValue($base.'tb5', 'TextBox in ActivePanel +1');
+
+ $this->byId($base.'ctl2')->click();
$this->pause(800);
- $this->assertTextPresent('3 - Test callback without 2nd ActivePanel');
- $this->assertValue($base.'tb6', 'exact:ActiveTextBox');
- $this->assertValue($base.'tb7', 'exact:TextBox in Panel');
-
- $this->click($base.'ctl8');
+ $this->assertContains('3 - Test callback without 2nd ActivePanel', $this->source());
+ $this->assertValue($base.'tb6', 'ActiveTextBox');
+ $this->assertValue($base.'tb7', 'TextBox in Panel');
+
+ $this->byId($base.'ctl8')->click();
$this->pause(800);
-
- $this->assertValue($base.'tb6', 'exact:ActiveTextBox +1');
- $this->assertValue($base.'tb7', 'exact:TextBox in Panel +1');
-
+
+ $this->assertValue($base.'tb6', 'ActiveTextBox +1');
+ $this->assertValue($base.'tb7', 'TextBox in Panel +1');
+
}
} \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket670TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket670TestCase.php
index 33e45b49..a88b689c 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket670TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket670TestCase.php
@@ -1,21 +1,21 @@
<?php
-class Ticket670TestCase extends PradoGenericSeleniumTest
+class Ticket670TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket670');
- $this->assertTitle("Verifying Ticket 670");
-
+ $this->url('tickets/index.php?page=Ticket670');
+ $this->assertEquals($this->title(), "Verifying Ticket 670");
+
$this->type($base."datePicker", '07-07-2003');
$this->pause(800);
//$this->assertText($base."datePicker",'07-07-2003');
- $this->click($base."datePickerbutton");
+ $this->byId($base."datePickerbutton")->click();
$this->pause(800);
- $this->click($base."ok");
+ $this->byId($base."ok")->click();
$this->pause(800);
$this->assertText($base."lbl",'07-07-2007');
-
+
}
} \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket671TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket671TestCase.php
index 031dc991..4e6409af 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket671TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket671TestCase.php
@@ -1,41 +1,41 @@
<?php
-class Ticket671TestCase extends PradoGenericSeleniumTest
+class Ticket671TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket671');
- $this->assertTitle("Verifying Ticket 671");
-
- $this->verifyNotVisible($base.'ctl0');
+ $this->url('tickets/index.php?page=Ticket671');
+ $this->assertEquals($this->title(), "Verifying Ticket 671");
+
+ $this->assertNotVisible($base.'ctl0');
// Click submit
- $this->click($base.'ctl1');
+ $this->byId($base.'ctl1')->click();
$this->pause(800);
- $this->verifyText($base.'ctl0', 'Please Select Test 3');
- $this->verifyVisible($base.'ctl0');
+ $this->assertText($base.'ctl0', 'Please Select Test 3');
+ $this->assertVisible($base.'ctl0');
$this->select($base.'addl', 'Test 2');
$this->pause(800);
- $this->verifyVisible($base.'ctl0');
- $this->verifyText($base."lblResult", "You have selected 'Test 2'. But this is not valid !");
+ $this->assertVisible($base.'ctl0');
+ $this->assertText($base."lblResult", "You have selected 'Test 2'. But this is not valid !");
$this->select($base.'addl', 'Test 3');
$this->pause(800);
- $this->verifyNotVisible($base.'ctl0');
- $this->verifyText($base."lblResult", "You have selected 'Test 3'.");
- $this->click($base.'ctl1');
+ $this->assertNotVisible($base.'ctl0');
+ $this->assertText($base."lblResult", "You have selected 'Test 3'.");
+ $this->byId($base.'ctl1')->click();
$this->pause(800);
- $this->verifyText($base."lblResult", "You have successfully validated the form");
-
+ $this->assertText($base."lblResult", "You have successfully validated the form");
+
$this->type($base.'testTextBox', 'test');
$this->pause(800);
- $this->click($base.'ctl3');
+ $this->byId($base.'ctl3')->click();
$this->pause(800);
- $this->verifyVisible($base.'ctl2');
+ $this->assertVisible($base.'ctl2');
$this->type($base.'testTextBox',"Prado");
$this->pause(800);
- $this->click($base.'ctl3');
+ $this->byId($base.'ctl3')->click();
$this->pause(800);
- $this->verifyNotVisible($base.'ctl2');
- $this->verifyText($base.'lblResult2', 'Thanks !');
+ $this->assertNotVisible($base.'ctl2');
+ $this->assertText($base.'lblResult2', 'Thanks !');
}
} \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket671_reopenedTestCase.php b/tests/FunctionalTests/tickets/tests/Ticket671_reopenedTestCase.php
index 7ba24dcc..a3394bca 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket671_reopenedTestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket671_reopenedTestCase.php
@@ -1,46 +1,46 @@
<?php
-class Ticket671_reopenedTestCase extends PradoGenericSeleniumTest
+class Ticket671_reopenedTestCase extends PradoGenericSelenium2Test
{
function test()
{
$base="ctl0_Content_";
- $this->open('tickets/index.php?page=Ticket671_reopened');
- $this->assertTitle("Verifying Ticket 671_reopened");
+ $this->url('tickets/index.php?page=Ticket671_reopened');
+ $this->assertEquals($this->title(), "Verifying Ticket 671_reopened");
// Type wrong value
$this->type($base.'testField', 'abcd');
- $this->click($base.'ctl4');
+ $this->byId($base.'ctl4')->click();
$this->pause(800);
$this->assertVisible($base.'ctl2');
- $this->assertText($base.'Result', 'exact:Check callback called (1) --- Save callback called DATA NOK');
-
+ $this->assertText($base.'Result', 'Check callback called (1) --- Save callback called DATA NOK');
+
// Reclick, should not have any callback
- $this->click($base.'ctl4');
+ $this->byId($base.'ctl4')->click();
$this->pause(800);
$this->assertVisible($base.'ctl2');
- $this->assertText($base.'Result', 'exact:Check callback called (2) --- Save callback called DATA NOK');
-
+ $this->assertText($base.'Result', 'Check callback called (2) --- Save callback called DATA NOK');
+
// Type right value
$this->type($base.'testField', 'Test');
- $this->click($base.'ctl4');
+ $this->byId($base.'ctl4')->click();
$this->pause(800);
$this->assertNotVisible($base.'ctl2');
- $this->assertText($base.'Result', 'exact:Check callback called (3) --- Save callback called DATA OK');
-
+ $this->assertText($base.'Result', 'Check callback called (3) --- Save callback called DATA OK');
+
// Type empty value
$this->type($base.'testField', '');
- $this->click($base.'ctl4');
+ $this->byId($base.'ctl4')->click();
$this->pause(800);
$this->assertVisible($base.'ctl1');
$this->assertNotVisible($base.'ctl2');
- $this->assertText($base.'Result', 'exact:Check callback called (3) --- Save callback called DATA OK');
-
+ $this->assertText($base.'Result', 'Check callback called (3) --- Save callback called DATA OK');
+
// Type right value
$this->type($base.'testField', 'Test');
- $this->click($base.'ctl4');
+ $this->byId($base.'ctl4')->click();
$this->pause(800);
$this->assertNotVisible($base.'ctl1');
$this->assertNotVisible($base.'ctl2');
- $this->assertText($base.'Result', 'exact:Check callback called (4) --- Save callback called DATA OK');
+ $this->assertText($base.'Result', 'Check callback called (4) --- Save callback called DATA OK');
}
} \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket679TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket679TestCase.php
index 4ee22c20..2891a386 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket679TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket679TestCase.php
@@ -1,35 +1,35 @@
<?php
-class Ticket679TestCase extends PradoGenericSeleniumTest
+class Ticket679TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket679');
- $this->assertTitle("Verifying Ticket 679");
-
+ $this->url('tickets/index.php?page=Ticket679');
+ $this->assertEquals($this->title(), "Verifying Ticket 679");
+
// First part of ticket : Repeater bug
- $this->click($base."ctl0");
+ $this->byId($base."ctl0")->click();
$this->pause(800);
$this->assertText($base."myLabel",'outside');
- $this->verifyVisible($base."myLabel");
-
+ $this->assertVisible($base."myLabel");
+
// Reload completly the page
$this->refresh();
$this->pause(800);
- $this->click($base."Repeater_ctl0_ctl0");
+ $this->byId($base."Repeater_ctl0_ctl0")->click();
$this->pause(800);
$this->assertText($base."myLabel",'inside');
- $this->verifyVisible($base."myLabel");
-
+ $this->assertVisible($base."myLabel");
+
// Second part of ticket : ARB bug
- $this->verifyNotChecked($base."myRadioButton");
- $this->click($base."ctl1");
+ $this->assertFalse($this->byId("{$base}myRadioButton")->selected());
+ $this->byId($base."ctl1")->click();
$this->pause(800);
- $this->verifyChecked($base."myRadioButton");
- $this->click($base."ctl2");
+ $this->assertTrue($this->byId("{$base}myRadioButton")->selected());
+ $this->byId($base."ctl2")->click();
$this->pause(800);
- $this->verifyNotChecked($base."myRadioButton");
+ $this->assertFalse($this->byId("{$base}myRadioButton")->selected());
$this->pause(800);
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket691TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket691TestCase.php
index a441f82c..d014f2f4 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket691TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket691TestCase.php
@@ -1,16 +1,16 @@
<?php
-class Ticket691TestCase extends PradoGenericSeleniumTest
+class Ticket691TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket691');
- $this->assertTitle("Verifying Ticket 691");
-
- $this->click($base."List_c2");
+ $this->url('tickets/index.php?page=Ticket691');
+ $this->assertEquals($this->title(), "Verifying Ticket 691");
+
+ $this->byXPath("//input[@id='{$base}List_c2']/../..")->click();
$this->pause(800);
- $this->assertText($base."Title", "Thanks");
- $this->assertText($base."Result", "You vote 3");
+ $this->assertText("{$base}Title", "Thanks");
+ $this->assertText("{$base}Result", "You vote 3");
}
} \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket698TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket698TestCase.php
index 8f58a320..8aa9cb4e 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket698TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket698TestCase.php
@@ -1,17 +1,17 @@
<?php
-class Ticket698TestCase extends PradoGenericSeleniumTest
+class Ticket698TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket698');
- $this->assertTitle("Verifying Ticket 698");
-
- $this->click($base."switchContentTypeButton");
+ $this->url('tickets/index.php?page=Ticket698');
+ $this->assertEquals($this->title(), "Verifying Ticket 698");
+
+ $this->byId($base."switchContentTypeButton")->click();
$this->pause(800);
$this->assertVisible($base."EditHtmlTextBox");
$this->pause(800);
- $this->click($base."switchContentTypeButton");
+ $this->byId($base."switchContentTypeButton")->click();
$this->pause(1000);
$this->assertNotVisible($base."EditHtmlTextBox");
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket700TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket700TestCase.php
index 0366c2fc..d10529ce 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket700TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket700TestCase.php
@@ -1,71 +1,71 @@
<?php
-class Ticket700TestCase extends PradoGenericSeleniumTest
+class Ticket700TestCase extends PradoGenericSelenium2Test
{
function test()
{
// page: Home
- $this->open('tickets/index700.php');
- $this->clickAndWait('ctl0_Logout');
- $this->clickAndWait('pageHome');
- $this->assertTitle("Home");
- $this->assertTextPresent('|Param1: Set at app config|');
- $this->assertTextPresent('|Param2: Set at root|');
- $this->assertTextPresent('|Param3: default 3|');
- $this->assertTextPresent('|Param4: default 4|');
- $this->assertTextPresent('|Param5: Set at root|');
+ $this->url('tickets/index700.php');
+ $this->byId('ctl0_Logout')->click();
+ $this->byId('pageHome')->click();
+ $this->assertEquals($this->title(), "Home");
+ $this->assertContains('|Param1: Set at app config|', $this->source());
+ $this->assertContains('|Param2: Set at root|', $this->source());
+ $this->assertContains('|Param3: default 3|', $this->source());
+ $this->assertContains('|Param4: default 4|', $this->source());
+ $this->assertContains('|Param5: Set at root|', $this->source());
// page: admin.Home
- $this->clickAndWait('pageAdminHome');
- $this->assertTitle('UserLogin');
+ $this->byId('pageAdminHome')->click();
+ $this->assertEquals($this->title(), 'UserLogin');
$this->type('ctl0_Main_Username','AdminUser');
$this->type('ctl0_Main_Password','demo');
- $this->clickAndWait('ctl0_Main_LoginButton');
- $this->clickAndWait('pageAdminHome');
- $this->assertTitle('admin.Home');
- $this->assertTextPresent('|Param1: Set at app config|');
- $this->assertTextPresent('|Param2: Set at admin|');
- $this->assertTextPresent('|Param3: Set at admin|');
- $this->assertTextPresent('|Param4: Set at app config|');
- $this->assertTextPresent('|Param5: Set at app config|');
+ $this->byId('ctl0_Main_LoginButton')->click();
+ $this->byId('pageAdminHome')->click();
+ $this->assertEquals($this->title(), 'admin.Home');
+ $this->assertContains('|Param1: Set at app config|', $this->source());
+ $this->assertContains('|Param2: Set at admin|', $this->source());
+ $this->assertContains('|Param3: Set at admin|', $this->source());
+ $this->assertContains('|Param4: Set at app config|', $this->source());
+ $this->assertContains('|Param5: Set at app config|', $this->source());
// page: admin.Home2
- $this->clickAndWait('pageAdminHome2');
- $this->assertTitle('admin.Home2');
- $this->clickAndWait('ctl0_Logout');
- $this->clickAndWait('pageAdminHome2');
- $this->assertTitle('admin.Home2');
+ $this->byId('pageAdminHome2')->click();
+ $this->assertEquals($this->title(), 'admin.Home2');
+ $this->byId('ctl0_Logout')->click();
+ $this->byId('pageAdminHome2')->click();
+ $this->assertEquals($this->title(), 'admin.Home2');
// page: admin.users.Home
- $this->clickAndWait('pageAdminUsersHome');
- $this->assertTitle('UserLogin');
+ $this->byId('pageAdminUsersHome')->click();
+ $this->assertEquals($this->title(), 'UserLogin');
$this->type('ctl0_Main_Username','NormalUser');
$this->type('ctl0_Main_Password','demo');
- $this->clickAndWait('ctl0_Main_LoginButton');
- $this->clickAndWait('pageAdminUsersHome');
- $this->assertTitle('UserLogin');
+ $this->byId('ctl0_Main_LoginButton')->click();
+ $this->byId('pageAdminUsersHome')->click();
+ $this->assertEquals($this->title(), 'UserLogin');
$this->type('ctl0_Main_Username','AdminUser');
$this->type('ctl0_Main_Password','demo');
- $this->clickAndWait('ctl0_Main_LoginButton');
- $this->clickAndWait('pageAdminUsersHome');
- $this->assertTitle('admin.users.Home');
- $this->assertTextPresent('|Param1: Set at admin|');
- $this->assertTextPresent('|Param2: Set at admin.users|');
- $this->assertTextPresent('|Param3: default 3|');
- $this->assertTextPresent('|Param4: Set at admin|');
- $this->assertTextPresent('|Param5: Set at app config|');
+ $this->byId('ctl0_Main_LoginButton')->click();
+ $this->byId('pageAdminUsersHome')->click();
+ $this->assertEquals($this->title(), 'admin.users.Home');
+ $this->assertContains('|Param1: Set at admin|', $this->source());
+ $this->assertContains('|Param2: Set at admin.users|', $this->source());
+ $this->assertContains('|Param3: default 3|', $this->source());
+ $this->assertContains('|Param4: Set at admin|', $this->source());
+ $this->assertContains('|Param5: Set at app config|', $this->source());
// page: admin.users.Home2
- $this->clickAndWait('pageAdminUsersHome2');
- $this->assertTitle('admin.users.Home2');
+ $this->byId('pageAdminUsersHome2')->click();
+ $this->assertEquals($this->title(), 'admin.users.Home2');
// page: content.Home
- $this->clickAndWait('pageContentHome');
- $this->assertTitle('content.Home');
- $this->assertTextPresent('|Param1: Set at app config|');
- $this->assertTextPresent('|Param2: Set at root|');
- $this->assertTextPresent('|Param3: default 3|');
- $this->assertTextPresent('|Param4: default 4|');
- $this->assertTextPresent('|Param5: Set at app config|');
- $this->clickAndWait('ctl0_Logout');
+ $this->byId('pageContentHome')->click();
+ $this->assertEquals($this->title(), 'content.Home');
+ $this->assertContains('|Param1: Set at app config|', $this->source());
+ $this->assertContains('|Param2: Set at root|', $this->source());
+ $this->assertContains('|Param3: default 3|', $this->source());
+ $this->assertContains('|Param4: default 4|', $this->source());
+ $this->assertContains('|Param5: Set at app config|', $this->source());
+ $this->byId('ctl0_Logout')->click();
}
} \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket703TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket703TestCase.php
index dedb491f..46c240b1 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket703TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket703TestCase.php
@@ -1,25 +1,26 @@
<?php
-class Ticket703TestCase extends PradoGenericSeleniumTest
+class Ticket703TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket703.Ticket703');
- $this->assertTitle("Verifying Ticket703.Ticket703 703.703");
+ $this->url('tickets/index.php?page=Ticket703.Ticket703');
+ $this->assertEquals($this->title(), "Verifying Ticket703.Ticket703 703.703");
// Start with an empty log
- $this->click($base.'ctl2');
+ $this->byId($base.'ctl2')->click();
// Wait for callback to be lanched
$this->pause(1000);
$this->assertText($base.'logBox', "");
$this->type($base.'logMessage', "Test of prado logging system");
- $this->click($base.'ctl0');
+ $this->byId($base.'ctl0')->click();
$this->pause(800);
- $this->click($base.'ctl1');
- $this->assertTextPresent($base.'logBox', "Test of prado logging system");
+ $this->byId($base.'ctl1')->click();
+ $this->pause(1000);
+ $this->assertContains("Test of prado logging system", $this->byId($base.'logBox')->value());
// Clean log for next run
- $this->click($base.'ctl2');
+ $this->byId($base.'ctl2')->click();
// Wait for callback to be lanched
$this->pause(1000);
$this->assertText($base.'logBox', "");
diff --git a/tests/FunctionalTests/tickets/tests/Ticket708TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket708TestCase.php
index 87509b29..ab8780f6 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket708TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket708TestCase.php
@@ -1,25 +1,25 @@
<?php
-class Ticket708TestCase extends PradoGenericSeleniumTest
+class Ticket708TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket708');
- $this->assertTitle("Verifying Ticket 708");
-
- $this->click($base."grid_ctl1_RadioButton");
+ $this->url('tickets/index.php?page=Ticket708');
+ $this->assertEquals($this->title(), "Verifying Ticket 708");
+
+ $this->byId($base."grid_ctl1_RadioButton")->click();
$this->pause(800);
$this->assertText($base."Result", "You have selected Radio Button #1");
-
- $this->click($base."grid_ctl2_RadioButton");
+
+ $this->byId($base."grid_ctl2_RadioButton")->click();
$this->pause(800);
$this->assertText($base."Result", "You have selected Radio Button #2");
-
- $this->click($base."grid_ctl3_RadioButton");
+
+ $this->byId($base."grid_ctl3_RadioButton")->click();
$this->pause(800);
$this->assertText($base."Result", "You have selected Radio Button #3");
-
- $this->click($base."grid_ctl4_RadioButton");
+
+ $this->byId($base."grid_ctl4_RadioButton")->click();
$this->pause(800);
$this->assertText($base."Result", "You have selected Radio Button #4");
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php
index c71cb0a8..7c4a1d67 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php
@@ -1,42 +1,45 @@
<?php
-class Ticket719TestCase extends PradoGenericSeleniumTest
+class Ticket719TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open("tickets/index.php?page=Ticket719");
- $this->verifyTextPresent("Verifying Ticket 719");
-
+ $this->url("tickets/index.php?page=Ticket719");
+ $this->assertContains("Verifying Ticket 719", $this->source());
+
$base="ctl0_Content_";
-
- $this->click("${base}ctl2");
+
+ $this->byId("${base}ctl2")->click();
$this->pause(800);
$this->assertVisible("${base}ctl0", 'Required');
$this->assertVisible("${base}ctl1", 'Required');
-
- $this->type("${base}autocomplete", 'f');
- $this->runScript("Prado.Registry.get('${base}autocomplete').onKeyPress({})");
+
+ $this->byId("${base}autocomplete")->click();
+
+ $this->keys('f');
$this->pause(500);
- $this->verifyTextPresent('Finland');
+ $this->assertContains('Finland', $this->source());
- $this->type("${base}autocomplete", 'fr');
- $this->runScript("Prado.Registry.get('${base}autocomplete').onKeyPress({})");
+ $this->keys('r');
$this->pause(500);
- $this->verifyTextPresent('French');
+ $this->assertContains('French', $this->source());
- $this->type("${base}autocomplete", 'fra');
- $this->runScript("Prado.Registry.get('${base}autocomplete').onKeyPress({})");
+ $this->keys('a');
$this->pause(500);
- $this->verifyTextPresent('France');
-
- $this->click("css=#${base}autocomplete_result ul li");
+ $this->assertContains('France', $this->source());
+
+ $this->byCssSelector("#${base}autocomplete_result ul li")->click();
$this->pause(800);
$this->assertNotVisible("${base}ctl1");
- $this->type("${base}textbox", "Prado");
+ $this->byId("${base}textbox")->clear();
+ $this->byId("${base}textbox")->value('Prado');
+ // trigger onblur() event
+ $this->byCssSelector('body')->click();
+
$this->assertNotVisible("${base}ctl0");
-
- $this->click("${base}ctl2");
+
+ $this->byId("${base}ctl2")->click();
$this->pause(800);
$this->assertText("${base}Result", "TextBox Content : Prado -- Autocomplete Content :France");
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket722TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket722TestCase.php
index 90711162..dfa93089 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket722TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket722TestCase.php
@@ -1,28 +1,32 @@
<?php
-class Ticket722TestCase extends PradoGenericSeleniumTest
+class Ticket722TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket722');
- $this->assertTitle("Verifying Ticket 722");
-
- $this->assertText($base.'InPlaceTextBox__label', 'Editable Text');
- $this->click($base.'InPlaceTextBox__label');
+ $this->url('tickets/index.php?page=Ticket722');
+ $this->assertEquals($this->title(), "Verifying Ticket 722");
+
+ $label = $this->byID("{$base}InPlaceTextBox__label");
+ $this->assertEquals('Editable Text', $label->text());
+ $label->click();
$this->pause(800);
- $this->assertVisible($base.'InPlaceTextBox');
+
+ $textbox = $this->byID("{$base}InPlaceTextBox");
+ $this->assertTrue($textbox->displayed());
+
$this->type($base.'InPlaceTextBox',"Prado");
- $this->fireEvent($base.'InPlaceTextBox', 'blur'); // Release textbox
$this->pause(800);
- $this->assertNotVisible($base.'InPlaceTextBox');
- $this->assertText($base.'InPlaceTextBox__label', 'Prado');
- $this->click($base.'ctl0');
+ $this->assertFalse($textbox->displayed());
+ $this->assertEquals('Prado', $label->text());
+
+ $this->byId("{$base}ctl0")->click();
$this->pause(800);
- $this->assertText($base.'InPlaceTextBox__label', 'exact:Prado [Read Only]');
- $this->click($base.'InPlaceTextBox__label');
+ $this->assertEquals('Prado [Read Only]', $label->text());
+
+ $label->click();
$this->pause(800);
- $this->assertNotVisible($base.'InPlaceTextBox');
-
+ $this->assertFalse($textbox->displayed());
}
} \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket72TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket72TestCase.php
index 111b7583..91fc9420 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket72TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket72TestCase.php
@@ -1,14 +1,14 @@
<?php
-class Ticket72TestCase extends PradoGenericSeleniumTest
+class Ticket72TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket72');
+ $this->url('tickets/index.php?page=Ticket72');
$this->type("ctl0\$Content\$K1", "abc");
$this->type("ctl0\$Content\$K2", "efg");
- $this->clickAndWait("//input[@type='submit' and @value='Send']", "");
- $this->verifyTextPresent("efg", "");
- $this->verifyTextNotPresent("abcefg", "");
+ $this->byXPath("//input[@type='submit' and @value='Send']")->click();
+ $this->assertContains("efg", $this->source());
+ $this->assertNotContains("abcefg", $this->source());
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket745TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket745TestCase.php
index f822e37f..690df8a1 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket745TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket745TestCase.php
@@ -1,17 +1,16 @@
<?php
-class Ticket745TestCase extends PradoGenericSeleniumTest
+class Ticket745TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket745');
- $this->assertTitle("Verifying Ticket 745");
-
+ $this->url('tickets/index.php?page=Ticket745');
+ $this->assertEquals($this->title(), "Verifying Ticket 745");
+
$this->select($base.'Wizard1_DropDownList1', 'Green');
- $this->click($base.'Wizard1_ctl4_ctl1');
+ $this->byId($base.'Wizard1_ctl4_ctl1')->click();
$this->pause(800);
- $this->assertTextPresent ('Step 3 of 3');
-
+ $this->assertContains('Step 3 of 3', $this->source());
}
} \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php
index 468342a5..03816667 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php
@@ -1,36 +1,35 @@
<?php
-class Ticket769TestCase extends PradoGenericSeleniumTest
+class Ticket769TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base="ctl0_Content_";
- $this->open('tickets/index.php?page=Ticket769');
- $this->assertTitle("Verifying Ticket 769");
-
- $this->click($base.'ctl0');
+ $this->url('tickets/index.php?page=Ticket769');
+ $this->assertEquals($this->title(), "Verifying Ticket 769");
+
+ $this->byId($base.'ctl0')->click();
$this->assertVisible($base.'ctl1');
-
+
$this->type($base.'T1', 'Prado');
- $this->click($base.'ctl0');
+ $this->byId($base.'ctl0')->click();
$this->pause(800);
$this->assertNotVisible($base.'ctl1');
- $this->verifyTextPresent($base.'ctl0', 'T1 clicked' );
-
- $this->click($base.'ctl2');
+ $this->assertValue($base.'ctl0', 'T1 clicked' );
+
+ $this->byId($base.'ctl2')->click();
$this->pause(800);
- $this->verifyTextPresent($base.'B', 'This is B');
- $this->click($base.'ctl3');
+ $this->assertText($base.'B', 'This is B');
+ $this->byId($base.'ctl3')->click();
$this->pause(800);
-
+
$this->type($base.'T1', '');
- $this->click($base.'ctl0');
+ $this->byId($base.'ctl0')->click();
$this->assertVisible($base.'ctl1');
$this->type($base.'T1', 'Prado');
- $this->click($base.'ctl0');
+ $this->byId($base.'ctl0')->click();
$this->pause(800);
$this->assertNotVisible($base.'ctl1');
- $this->verifyTextPresent($base.'ctl0', 'T1 clicked clicked' );
-
+ $this->assertValue($base.'ctl0', 'T1 clicked clicked' );
}
} \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket785TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket785TestCase.php
index 229a68eb..c20f29a3 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket785TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket785TestCase.php
@@ -1,33 +1,33 @@
<?php
-class Ticket785TestCase extends PradoGenericSeleniumTest
+class Ticket785TestCase extends PradoGenericSelenium2Test
{
function test()
{
$year=date('Y')-1;
$base = 'ctl0_Content_';
- $this->open('tickets/index.php?page=Ticket785');
- $this->assertTitle("Verifying Ticket 785");
-
+ $this->url('tickets/index.php?page=Ticket785');
+ $this->assertEquals($this->title(), "Verifying Ticket 785");
+
$this->assertText('selDate', '');
$this->select($base."datePicker_year", $year);
$this->pause(800);
$expectedDate=date("d-m").'-'.$year;
$this->assertText('selDate', $expectedDate);
-
- $this->click($base."datePickerbutton");
+
+ $this->byId($base."datePickerbutton")->click();
$this->pause(800);
- $this->click("css=input.todayButton");
+ $this->byCssSelector("input.todayButton")->click();
$this->pause(800);
- $this->clickAt("css=body","0,0"); // Hide calendar
+ $this->byCssSelector("body")->click(); // Hide calendar
$expectedDate=date("d-m-Y");
$this->assertText('selDate', $expectedDate);
-
+
$this->assertText('selDate2', '');
$this->type($base.'datePicker2', '12/05/2006');
$this->pause(800);
- $this->clickAt("css=body","0,0");
- $this->assertText('selDate2', '12/05/2006');
-
+ $this->byCssSelector("body")->click();
+ $this->assertText('selDate2', '12/05/2006');
+
}
} \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket823TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket823TestCase.php
index 11e363ba..163eb541 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket823TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket823TestCase.php
@@ -1,12 +1,12 @@
<?php
-class Ticket823TestCase extends PradoGenericSeleniumTest {
+class Ticket823TestCase extends PradoGenericSelenium2Test {
public function test() {
- $this->open('tickets/index.php?page=Ticket823');
- $this->assertTitle("Verifying Ticket 823");
+ $this->url('tickets/index.php?page=Ticket823');
+ $this->assertEquals($this->title(), "Verifying Ticket 823");
$base = 'ctl0_Content_';
- $this->assertElementPresent('xpath=//option[@value="Choose..."]');
+ $this->assertElementPresent('//option[@value="Choose..."]');
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket828TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket828TestCase.php
index bbe185ad..9a44a5ec 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket828TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket828TestCase.php
@@ -1,34 +1,34 @@
<?php
-class Ticket828TestCase extends PradoGenericSeleniumTest
+class Ticket828TestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = "ctl0_Content_";
- $this->open("tickets/index.php?page=Ticket828");
- $this->click("{$base}submit1");
+ $this->url("tickets/index.php?page=Ticket828");
+ $this->byId("{$base}submit1")->click();
$this->assertVisible("{$base}validator1");
$this->assertVisible("{$base}validator2");
$this->assertVisible("{$base}validator3");
- $this->click("{$base}list1_c0");
- $this->addSelection("{$base}list2", "label=One");
- $this->addSelection("{$base}list2", "label=Two");
- $this->click("{$base}list3_c3");
- $this->clickAndWait("{$base}submit1");
+ $this->byId("{$base}list1_c0")->click();
+ $this->addSelection("{$base}list2", "One");
+ $this->addSelection("{$base}list2", "Two");
+ $this->byId("{$base}list3_c3")->click();
+ $this->byId("{$base}submit1")->click();
$this->assertNotVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
$this->assertNotVisible("{$base}validator3");
- $this->click("{$base}list1_c1");
- $this->click("{$base}list1_c2");
- $this->click("{$base}list1_c3");
- $this->addSelection("{$base}list2", "label=Two");
- $this->click("{$base}list1_c3");
- $this->clickAndWait("{$base}submit1");
+ $this->byId("{$base}list1_c1")->click();
+ $this->byId("{$base}list1_c2")->click();
+ $this->byId("{$base}list1_c3")->click();
+ $this->addSelection("{$base}list2", "Two");
+ $this->byId("{$base}list1_c3")->click();
+ $this->byId("{$base}submit1")->click();
$this->assertNotVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
$this->assertNotVisible("{$base}validator3");
- $this->click("{$base}list3_c3");
- $this->clickAndWait("{$base}submit1");
+ $this->byId("{$base}list3_c3")->click();
+ $this->byId("{$base}submit1")->click();
$this->pause(200);
$this->assertNotVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
diff --git a/tests/FunctionalTests/tickets/tests/Ticket849TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket849TestCase.php
index fef9ac31..e354b126 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket849TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket849TestCase.php
@@ -1,15 +1,15 @@
<?php
-class Ticket849TestCase extends PradoGenericSeleniumTest
+class Ticket849TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket849');
- $this->assertTitle("Verifying Ticket 849");
+ $this->url('tickets/index.php?page=Ticket849');
+ $this->assertEquals($this->title(), "Verifying Ticket 849");
$base='ctl0_Content_';
- $this->click($base.'ctl0');
+ $this->byId($base.'ctl0')->click();
$this->pause(800);
- $this->click('css=td.date.today.selected');
+ $this->byCssSelector('td.date.today.selected')->click();
$this->pause(1000);
$this->assertValue($base.'ctl0', date('m-d-Y'));
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php
index 8006dd09..361235fc 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php
@@ -1,22 +1,22 @@
<?php
-class Ticket876TestCase extends PradoGenericSeleniumTest {
+class Ticket876TestCase extends PradoGenericSelenium2Test {
public function test() {
- $this->open('tickets/index.php?page=Ticket876');
- $this->assertTitle("Verifying Ticket 876");
+ $this->url('tickets/index.php?page=Ticket876');
+ $this->assertEquals($this->title(), "Verifying Ticket 876");
$base = 'ctl0_Content_';
-
- $this->assertElementPresent('xpath=//link[@rel="stylesheet"]');
- $this->clickAndWait($base.'Button');
- $this->assertElementNotPresent('xpath=//link[@rel="stylesheet"]');
-
+
+ $this->assertElementPresent('//link[@rel="stylesheet"]');
+ $this->byId($base.'Button')->click();
+ $this->assertElementNotPresent('//link[@rel="stylesheet"]');
+
/*$this->select($base.'Date_month', 10);
$this->select($base.'Date_day', 22);
-
- $this->clickAndWait($base.'SendButton');
- $this->assertTextPresent('2008-10-22');*/
+
+ $this->byId($base.'SendButton')->click();
+ $this->assertContains('2008-10-22', $this->source());*/
}
-
+
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket886TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket886TestCase.php
index 99990ebf..7f9c23f3 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket886TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket886TestCase.php
@@ -1,14 +1,14 @@
<?php
-class Ticket886TestCase extends PradoGenericSeleniumTest
+class Ticket886TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket886');
- $this->assertTitle("Verifying Ticket 886");
+ $this->url('tickets/index.php?page=Ticket886');
+ $this->assertEquals($this->title(), "Verifying Ticket 886");
$base = 'ctl0_Content_';
- $this->clickAndWait($base.'SendButton');
- $this->assertTextPresent(date('Y').'-01-01');
+ $this->byId($base.'SendButton')->click();
+ $this->assertContains(date('Y').'-01-01', $this->source());
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket897TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket897TestCase.php
index 67d1f1f2..e3bac037 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket897TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket897TestCase.php
@@ -1,18 +1,18 @@
<?php
-class Ticket897TestCase extends PradoGenericSeleniumTest
+class Ticket897TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket897');
- $this->assertTitle("Verifying Ticket 897");
+ $this->url('tickets/index.php?page=Ticket897');
+ $this->assertEquals($this->title(), "Verifying Ticket 897");
$base = 'ctl0_Content_';
-
+
$this->select($base.'Date_month', 10);
$this->select($base.'Date_day', 22);
-
- $this->clickAndWait($base.'SendButton');
- $this->assertTextPresent(date('Y').'-10-22');
+
+ $this->byId($base.'SendButton')->click();
+ $this->assertContains(date('Y').'-10-22', $this->source());
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket900TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket900TestCase.php
index 3ec69873..fc0bcc01 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket900TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket900TestCase.php
@@ -1,17 +1,17 @@
<?php
-class Ticket900TestCase extends PradoGenericSeleniumTest
+class Ticket900TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket900');
- $this->assertTitle("Verifying Ticket 900");
+ $this->url('tickets/index.php?page=Ticket900');
+ $this->assertEquals($this->title(), "Verifying Ticket 900");
$base = 'ctl0_Content_';
-
- $this->clickAndWait('ctl0$Content$DataGrid$ctl1$ctl3');
+
+ $this->byName('ctl0$Content$DataGrid$ctl1$ctl3')->click();
$this->type($base.'DataGrid_ctl1_TextBox', '');
- $this->click($base.'DataGrid_ctl1_ctl3');
- $this->clickAndWait('ctl0$Content$DataGrid$ctl1$ctl4');
+ $this->byId($base.'DataGrid_ctl1_ctl3')->click();
+ $this->byName('ctl0$Content$DataGrid$ctl1$ctl4')->click();
$this->assertText($base.'CommandName', 'cancel');
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket922TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket922TestCase.php
index 208bd1d0..f03f980e 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket922TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket922TestCase.php
@@ -1,15 +1,15 @@
<?php
-class Ticket922TestCase extends PradoGenericSeleniumTest
+class Ticket922TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket922');
- $this->assertTitle("Verifying Ticket 922");
+ $this->url('tickets/index.php?page=Ticket922');
+ $this->assertEquals($this->title(), "Verifying Ticket 922");
$base = 'ctl0_Content_';
-
+
$this->type($base.'Text', 'two words');
- $this->clickAndWait('ctl0$Content$ctl0');
+ $this->byName('ctl0$Content$ctl0')->click();
$this->assertText($base.'Result','two words');
}
diff --git a/tests/FunctionalTests/tickets/tests/Ticket93TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket93TestCase.php
index a56925a8..538860d4 100755
--- a/tests/FunctionalTests/tickets/tests/Ticket93TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket93TestCase.php
@@ -4,12 +4,12 @@
*
*/
-class Ticket93TestCase extends PradoGenericSeleniumTest
+class Ticket93TestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('tickets/index.php?page=Ticket93');
- $this->verifyTextPresent("ValidationGroups without any inputs with grouping");
+ $this->url('tickets/index.php?page=Ticket93');
+ $this->assertContains("ValidationGroups without any inputs with grouping", $this->source());
}
-
+
}
diff --git a/tests/FunctionalTests/validators/protected/pages/ConditionalValidation.page b/tests/FunctionalTests/validators/protected/pages/ConditionalValidation.page
index ad43135b..582fff59 100755
--- a/tests/FunctionalTests/validators/protected/pages/ConditionalValidation.page
+++ b/tests/FunctionalTests/validators/protected/pages/ConditionalValidation.page
@@ -16,7 +16,7 @@
ErrorMessage="*"
ControlCssClass="required">
<prop:ClientSide.OnValidate>
- sender.enabled = $('<%= $this->check1->ClientID %>').checked;
+ sender.enabled = $('#<%= $this->check1->ClientID %>').get(0).checked;
</prop:ClientSide.OnValidate>
</com:TRequiredFieldValidator>
diff --git a/tests/FunctionalTests/validators/protected/pages/CustomValidator.page b/tests/FunctionalTests/validators/protected/pages/CustomValidator.page
index 2d0d490b..47238e48 100755
--- a/tests/FunctionalTests/validators/protected/pages/CustomValidator.page
+++ b/tests/FunctionalTests/validators/protected/pages/CustomValidator.page
@@ -2,7 +2,7 @@
<h1>Prado CustomValidator Tests</h1>
<script type="text/javascript">
-var MyCustomValidator =
+var MyCustomValidator =
{
validate : function(sender, value)
{
@@ -17,7 +17,7 @@ var MyCustomValidator =
ControlToValidate="text1"
ErrorMessage="Enter 'Prado'"
ControlCssClass="required"
- ClientValidationFunction="MyCustomValidator.validate"
+ ClientValidationFunction="MyCustomValidator.validate"
OnServerValidate="CustomValidation"
/>
<com:TButton ID="submit1" Text="Test" />
diff --git a/tests/FunctionalTests/validators/protected/pages/Layout.tpl b/tests/FunctionalTests/validators/protected/pages/Layout.tpl
index 25dbea09..47591ef3 100755
--- a/tests/FunctionalTests/validators/protected/pages/Layout.tpl
+++ b/tests/FunctionalTests/validators/protected/pages/Layout.tpl
@@ -33,7 +33,6 @@
<com:TForm>
<com:TContentPlaceHolder ID="Content" />
<hr style="margin-top: 2em" />
-<com:TJavascriptLogger />
</com:TForm>
</body>
</html> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/ListControl.page b/tests/FunctionalTests/validators/protected/pages/ListControl.page
index 1429e184..a75dc3ff 100755
--- a/tests/FunctionalTests/validators/protected/pages/ListControl.page
+++ b/tests/FunctionalTests/validators/protected/pages/ListControl.page
@@ -1,58 +1,58 @@
<com:TContent ID="Content">
- <h1>List Control Required Field Validation Test</h1>
+ <h1>List Control Required Field Validation Test</h1>
<com:TCheckBoxList ID="list1">
<com:TListItem Text="Select a color below" Value="" />
<com:TListItem Text="Red" />
<com:TListItem Text="Blue" />
<com:TListItem Text="Green" />
</com:TCheckBoxList>
-
+
<com:TRequiredFieldValidator ID="validator1"
ControlToValidate="list1"
InitialValue="Select a color below"
ErrorMessage="*" />
-
+
<hr />
-
+
<com:TDropDownList ID="list2">
<com:TListItem Text="--- Select a color ---" />
<com:TListItem Text="Red" />
<com:TListItem Text="Blue" />
<com:TListItem Text="Green" />
</com:TDropDownList>
-
+
<com:TRequiredFieldValidator ID="validator2"
ControlToValidate="list2"
InitialValue="--- Select a color ---"
ErrorMessage="*" />
-
+
<hr />
-
+
<com:TListBox ID="list3">
- <com:TListItem Text="Don't select this one" />
+ <com:TListItem Text="Dont select this one" />
<com:TListItem Text="Red" />
<com:TListItem Text="Blue" />
<com:TListItem Text="Green" />
</com:TListBox>
-
+
<com:TRequiredFieldValidator ID="validator3"
ControlToValidate="list3"
- InitialValue="Don't select this one"
+ InitialValue="Dont select this one"
ErrorMessage="*" />
-
+
<hr />
-
+
<com:TRadioButtonList ID="list4">
<com:TListItem Text="Select something else" />
<com:TListItem Text="Red" />
<com:TListItem Text="Blue" />
<com:TListItem Text="Green" />
</com:TRadioButtonList>
-
+
<com:TRequiredFieldValidator ID="validator4"
ControlToValidate="list4"
InitialValue="Select something else"
ErrorMessage="*" />
-
+
<com:TButton ID="submit1" Text="Submit!" />
</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/tests/ButtonTestCase.php b/tests/FunctionalTests/validators/tests/ButtonTestCase.php
index 58001322..90265156 100755
--- a/tests/FunctionalTests/validators/tests/ButtonTestCase.php
+++ b/tests/FunctionalTests/validators/tests/ButtonTestCase.php
@@ -1,63 +1,63 @@
<?php
-class ButtonTestCase extends PradoGenericSeleniumTest
+class ButtonTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('validators/index.php?page=Button');
+ $this->url('validators/index.php?page=Button');
// verify all error messages are invisible
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
// verify the first validator shows the error
- $this->click("ctl0_Content_ctl1");
- $this->verifyVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->byId("ctl0_Content_ctl1")->click();
+ $this->assertVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
// verify the first validation is passed
$this->pause(500);
- $this->verifyTextNotPresent('Button1 is clicked');
+ $this->assertNotContains('Button1 is clicked', $this->source());
$this->type("ctl0_Content_TextBox1", "test");
- $this->clickAndWait("ctl0_Content_ctl1");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
- $this->verifyTextPresent('Button1 is clicked and valid');
+ $this->byId("ctl0_Content_ctl1")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
+ $this->assertContains('Button1 is clicked and valid', $this->source());
// verify the second validator shows the error
- $this->click("ctl0_Content_ctl3");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->byId("ctl0_Content_ctl3")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
// verify the second validation is passed
$this->pause(500);
- $this->verifyTextNotPresent('Button2 is clicked');
+ $this->assertNotContains('Button2 is clicked', $this->source());
$this->type("ctl0_Content_TextBox2", "test");
- $this->clickAndWait("ctl0_Content_ctl3");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
- $this->verifyTextPresent('Button2 is clicked and valid');
+ $this->byId("ctl0_Content_ctl3")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
+ $this->assertContains('Button2 is clicked and valid', $this->source());
// verify the third validator shows the error
- $this->clickAndWait("ctl0_Content_ctl5");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyVisible('ctl0_Content_ctl4');
+ $this->byId("ctl0_Content_ctl5")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertVisible('ctl0_Content_ctl4');
// verify the third validation is passed
- $this->verifyTextPresent('Button3 is clicked');
- $this->verifyTextNotPresent('Button3 is clicked and valid');
+ $this->assertContains('Button3 is clicked', $this->source());
+ $this->assertNotContains('Button3 is clicked and valid', $this->source());
$this->type("ctl0_Content_TextBox3", "test");
- $this->clickAndWait("ctl0_Content_ctl5");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
- $this->verifyTextPresent('Button3 is clicked and valid');
+ $this->byId("ctl0_Content_ctl5")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
+ $this->assertContains('Button3 is clicked and valid', $this->source());
}
}
diff --git a/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php b/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php
index 847cbc9a..8e6e1583 100755
--- a/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php
+++ b/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php
@@ -1,65 +1,65 @@
<?php
-class CheckBoxTestCase extends PradoGenericSeleniumTest
+class CheckBoxTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('validators/index.php?page=CheckBox');
+ $this->url('validators/index.php?page=CheckBox');
// verify all error messages are invisible
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
// verify the first validator shows the error
- $this->click("ctl0_Content_ctl1");
- $this->verifyVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->byId("ctl0_Content_ctl1")->click();
+ $this->assertVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
// verify the first validation is passed
$this->pause(500);
- $this->verifyTextNotPresent('Button1 is clicked');
+ $this->assertNotContains('Button1 is clicked', $this->source());
$this->type("ctl0_Content_TextBox1", "test");
- $this->clickAndWait("ctl0_Content_ctl1");
- $this->clickAndWait("ctl0_Content_ctl1");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
- $this->verifyTextPresent('Button1 is clicked and valid');
+ $this->byId("ctl0_Content_ctl1")->click();
+ $this->byId("ctl0_Content_ctl1")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
+ $this->assertContains('Button1 is clicked and valid', $this->source());
// verify the second validator shows the error
- $this->click("ctl0_Content_ctl3");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->byId("ctl0_Content_ctl3")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
// verify the second validation is passed
$this->pause(500);
- $this->verifyTextNotPresent('Button2 is clicked');
+ $this->assertNotContains('Button2 is clicked', $this->source());
$this->type("ctl0_Content_TextBox2", "test");
- $this->clickAndWait("ctl0_Content_ctl3");
- $this->clickAndWait("ctl0_Content_ctl3");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
- $this->verifyTextPresent('Button2 is clicked and valid');
+ $this->byId("ctl0_Content_ctl3")->click();
+ $this->byId("ctl0_Content_ctl3")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
+ $this->assertContains('Button2 is clicked and valid', $this->source());
// verify the third validator shows the error
- $this->clickAndWait("ctl0_Content_ctl5");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyVisible('ctl0_Content_ctl4');
+ $this->byId("ctl0_Content_ctl5")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertVisible('ctl0_Content_ctl4');
// verify the third validation is passed
- $this->verifyTextPresent('Button3 is clicked');
- $this->verifyTextNotPresent('Button3 is clicked and valid');
+ $this->assertContains('Button3 is clicked', $this->source());
+ $this->assertNotContains('Button3 is clicked and valid', $this->source());
$this->type("ctl0_Content_TextBox3", "test");
- $this->clickAndWait("ctl0_Content_ctl5");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
- $this->verifyTextPresent('Button3 is clicked and valid');
+ $this->byId("ctl0_Content_ctl5")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
+ $this->assertContains('Button3 is clicked and valid', $this->source());
}
}
diff --git a/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php b/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php
index 187351c1..f9652e76 100755
--- a/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php
+++ b/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php
@@ -1,42 +1,43 @@
<?php
//New Test
-class CompareValidatorTestCase extends PradoGenericSeleniumTest
+class CompareValidatorTestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = "ctl0_Content_";
-
- $this->open("validators/index.php?page=CompareValidator", "");
- $this->verifyTextPresent("Prado CompareValidator Tests", "");
+
+ $this->url("validators/index.php?page=CompareValidator");
+ $this->assertContains("Prado CompareValidator Tests", $this->source());
$this->type("{$base}text1", "qwe");
$this->assertNotVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
-
- $this->click("//input[@type='submit' and @value='Test']", "");
+
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
$this->type("{$base}text2", "1234");
- $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
$this->assertVisible("{$base}validator1");
$this->type("{$base}text2", "qwe");
- $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
$this->assertNotVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
-
+
$this->type("{$base}text3", "12312");
- $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->pause(500);
$this->assertVisible("{$base}validator2");
-
+
$this->type("{$base}text3", "13/1/2005");
$this->assertVisible("{$base}validator2");
-
+
$this->type("{$base}text3", "12/1/2005");
- $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
-
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+
$this->assertNotVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
diff --git a/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php b/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php
index 02b174ef..32e79a90 100755
--- a/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php
+++ b/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php
@@ -1,52 +1,52 @@
<?php
-class ConditionalValidationTestCase extends PradoGenericSeleniumTest
+class ConditionalValidationTestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = "ctl0_Content_";
- $this->open("validators/index.php?page=ConditionalValidation", "");
- $this->verifyTextPresent("Conditional Validation (clientside + server side)", "");
- $this->assertNotVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
+ $this->url("validators/index.php?page=ConditionalValidation");
+ $this->assertContains("Conditional Validation (clientside + server side)", $this->source());
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
- $this->click("{$base}submit1");
- $this->assertVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
+ $this->byId("{$base}submit1")->click();
+ $this->assertVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
- $this->click("{$base}check1");
- $this->click("{$base}submit1");
- $this->assertVisible("{$base}validator1", "");
- $this->assertVisible("{$base}validator2", "");
+ $this->byId("{$base}check1")->click();
+ $this->byId("{$base}submit1")->click();
+ $this->assertVisible("{$base}validator1");
+ $this->assertVisible("{$base}validator2");
- $this->click("{$base}check1");
- $this->click("{$base}submit1");
- $this->assertVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
+ $this->byId("{$base}check1")->click();
+ $this->byId("{$base}submit1")->click();
+ $this->assertVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
$this->type("{$base}text1", "testing");
- $this->clickAndWait("{$base}submit1");
- $this->assertNotVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
+ $this->byId("{$base}submit1")->click();
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
$this->type("{$base}text1" ,"");
- $this->click("{$base}check1");
- $this->click("{$base}submit1");
- $this->assertVisible("{$base}validator1", "");
- $this->assertVisible("{$base}validator2", "");
+ $this->byId("{$base}check1")->click();
+ $this->byId("{$base}submit1")->click();
+ $this->assertVisible("{$base}validator1");
+ $this->assertVisible("{$base}validator2");
$this->type("{$base}text1", "test");
$this->type("{$base}text2", "123");
- $this->clickAndWait("{$base}submit1");
- $this->assertNotVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
+ $this->byId("{$base}submit1")->click();
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
- $this->click("{$base}check1");
+ $this->byId("{$base}check1")->click();
$this->type("{$base}text1", "");
$this->type("{$base}text2", "");
- $this->click("{$base}submit1");
- $this->assertVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
+ $this->byId("{$base}submit1")->click();
+ $this->assertVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
}
diff --git a/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php b/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php
index 106f7a00..ca48a453 100755
--- a/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php
+++ b/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php
@@ -1,18 +1,18 @@
<?php
//New Test
-class CustomValidatorTestCase extends PradoGenericSeleniumTest
+class CustomValidatorTestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = "ctl0_Content_";
- $this->open("validators/index.php?page=CustomValidator", "");
- $this->assertTextPresent("Prado CustomValidator Tests", "");
+ $this->url("validators/index.php?page=CustomValidator");
+ $this->assertContains("Prado CustomValidator Tests", $this->source());
$this->assertNotVisible("{$base}validator1");
- $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
$this->assertVisible("{$base}validator1");
-
+
$this->type("{$base}text1", "Prado");
$this->pause(250);
$this->assertNotVisible("{$base}validator1");
@@ -22,7 +22,7 @@ class CustomValidatorTestCase extends PradoGenericSeleniumTest
$this->type("{$base}text1", "Prado");
$this->pause(250);
$this->assertNotVisible("{$base}validator1");
- $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
$this->assertNotVisible("{$base}validator1");
}
diff --git a/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php b/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php
index 7ec220f0..3b5ebfcb 100755
--- a/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php
+++ b/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php
@@ -3,16 +3,16 @@
* Created on 25/04/2006
*/
-class DataTypeValidatorTestCase extends PradoGenericSeleniumTest
+class DataTypeValidatorTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->setSpeed(500);
$base = "ctl0_Content_";
- $this->open("validators/index.php?page=DataTypeValidator", "");
- $this->verifyTextPresent("Data Type Validator Tests", "");
- $this->click("//input[@type='submit' and @value='submit!']", "");
-
+ $this->url("validators/index.php?page=DataTypeValidator");
+ $this->assertContains("Data Type Validator Tests", $this->source());
+ $this->byXPath("//input[@type='submit' and @value='submit!']")->click();
+ $this->pause(500);
+
$this->assertNotVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
$this->assertNotVisible("{$base}validator3");
@@ -20,31 +20,32 @@ class DataTypeValidatorTestCase extends PradoGenericSeleniumTest
$this->type("{$base}textbox1", "a");
$this->type("{$base}textbox2", "b");
$this->type("{$base}textbox3", "c");
- $this->click("//input[@type='submit' and @value='submit!']", "");
+ $this->byXPath("//input[@type='submit' and @value='submit!']")->click();
+ $this->pause(500);
$this->assertVisible("{$base}validator1");
$this->assertVisible("{$base}validator2");
$this->assertVisible("{$base}validator3");
-
+
$this->type("{$base}textbox1", "12");
$this->type("{$base}textbox2", "12.5");
$this->type("{$base}textbox3", "2/10/2005");
- $this->clickAndWait("//input[@type='submit' and @value='submit!']", "");
-
+ $this->byXPath("//input[@type='submit' and @value='submit!']")->click();
+
$this->assertNotVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
$this->assertNotVisible("{$base}validator3");
-
+
$this->type("{$base}textbox1", "12.2");
$this->type("{$base}textbox2", "-12.5");
$this->type("{$base}textbox3", "2/13/2005");
- $this->click("//input[@type='submit' and @value='submit!']", "");
-
+ $this->byXPath("//input[@type='submit' and @value='submit!']")->click();
+ $this->pause(500);
+
$this->assertVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
$this->assertVisible("{$base}validator3");
- $this->setSpeed(0);
}
-
-}
+
+}
diff --git a/tests/FunctionalTests/validators/tests/DatePickerTestCase.php b/tests/FunctionalTests/validators/tests/DatePickerTestCase.php
index e7425a33..953c2f16 100755
--- a/tests/FunctionalTests/validators/tests/DatePickerTestCase.php
+++ b/tests/FunctionalTests/validators/tests/DatePickerTestCase.php
@@ -1,70 +1,69 @@
<?php
-class DatePickerTestCase extends PradoGenericSeleniumTest
+class DatePickerTestCase extends PradoGenericSelenium2Test
{
function test()
{
$year=2012;
$year2=2013;
$base = "ctl0_Content_";
- $this->open("validators/index.php?page=DatePicker", "");
- $this->verifyTextPresent("Date Picker validation Test", "");
- $this->assertNotVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
- $this->assertNotVisible("{$base}validator4", "");
- $this->assertNotVisible("{$base}validator5", "");
- $this->assertNotVisible("{$base}validator6", "");
- $this->assertNotVisible("{$base}validator8", "");
+ $this->url("validators/index.php?page=DatePicker");
+ $this->assertContains("Date Picker validation Test", $this->source());
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
+ $this->assertNotVisible("{$base}validator4");
+ $this->assertNotVisible("{$base}validator5");
+ $this->assertNotVisible("{$base}validator6");
+ $this->assertNotVisible("{$base}validator8");
- $this->click("{$base}submit1");
- $this->assertVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
+ $this->byId("{$base}submit1")->click();
+ $this->pause(500);
+ $this->assertVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
//the range validator is visible because the date is a drop down list
//thus has default value != ""
- $this->assertVisible("{$base}validator4", "");
- $this->assertVisible("{$base}validator5", "");
- $this->assertNotVisible("{$base}validator6", "");
- $this->assertVisible("{$base}validator8", "");
+ $this->assertVisible("{$base}validator4");
+ $this->assertVisible("{$base}validator5");
+ $this->assertNotVisible("{$base}validator6");
+ $this->assertVisible("{$base}validator8");
- $this->click("{$base}submit1");
- $this->pause(250);
$this->type("{$base}picker1", "13/4/$year");
- $this->select("{$base}picker2_month", "label=9");
- $this->select("{$base}picker2_day", "label=10");
- $this->select("{$base}picker2_year", "label=$year");
+ $this->select("{$base}picker2_month", "9");
+ $this->select("{$base}picker2_day", "10");
+ $this->select("{$base}picker2_year", "$year");
$this->pause(250);
$this->type("{$base}picker3", "14/4/$year");
$this->pause(250);
$this->type("{$base}picker4", "7/4/$year");
- $this->select("{$base}picker5_day", "label=6");
- $this->select("{$base}picker5_month", "label=3");
- $this->select("{$base}picker5_year", "label=$year2");
- $this->select("{$base}picker6_month", "label=3");
- $this->select("{$base}picker6_year", "label=$year2");
- $this->select("{$base}picker6_day", "label=5");
-
- $this->click("{$base}submit1");
+ $this->select("{$base}picker5_day", "6");
+ $this->select("{$base}picker5_month", "3");
+ $this->select("{$base}picker5_year", "$year2");
+ $this->select("{$base}picker6_month", "3");
+ $this->select("{$base}picker6_year", "$year2");
+ $this->select("{$base}picker6_day", "5");
+ $this->byId("{$base}submit1")->click();
+ $this->pause(500);
- $this->assertNotVisible("{$base}validator1", "");
- $this->assertVisible("{$base}validator2", "");
- $this->assertNotVisible("{$base}validator4", "");
- $this->assertNotVisible("{$base}validator5", "");
- $this->assertVisible("{$base}validator6", "");
- $this->assertVisible("{$base}validator8", "");
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertVisible("{$base}validator2");
+ $this->assertNotVisible("{$base}validator4");
+ $this->assertNotVisible("{$base}validator5");
+ $this->assertVisible("{$base}validator6");
+ $this->assertVisible("{$base}validator8");
$this->type("{$base}picker1", "20/4/$year2");
$this->type("{$base}picker4", "29/4/$year");
- $this->select("{$base}picker6_day", "label=10");
+ $this->select("{$base}picker6_day", "10");
- $this->clickAndWait("{$base}submit1");
+ $this->byId("{$base}submit1")->click();
- $this->assertNotVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
- $this->assertNotVisible("{$base}validator4", "");
- $this->assertNotVisible("{$base}validator5", "");
- $this->assertNotVisible("{$base}validator6", "");
- $this->assertNotVisible("{$base}validator8", "");
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
+ $this->assertNotVisible("{$base}validator4");
+ $this->assertNotVisible("{$base}validator5");
+ $this->assertNotVisible("{$base}validator6");
+ $this->assertNotVisible("{$base}validator8");
}
}
diff --git a/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php b/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php
index e6b5d6d8..800e36ff 100755
--- a/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php
+++ b/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php
@@ -1,63 +1,63 @@
<?php
-class ImageButtonTestCase extends PradoGenericSeleniumTest
+class ImageButtonTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('validators/index.php?page=ImageButton');
+ $this->url('validators/index.php?page=ImageButton');
// verify all error messages are invisible
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
// verify the first validator shows the error
- $this->click("ctl0_Content_ctl1");
- $this->verifyVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->byId("ctl0_Content_ctl1")->click();
+ $this->assertVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
// verify the first validation is passed
$this->pause(500);
- $this->verifyTextNotPresent('Button1 is clicked');
+ $this->assertNotContains('Button1 is clicked', $this->source());
$this->type("ctl0_Content_TextBox1", "test");
- $this->clickAndWait("ctl0_Content_ctl1");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
- $this->verifyTextPresent('Button1 is clicked and valid');
+ $this->byId("ctl0_Content_ctl1")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
+ $this->assertContains('Button1 is clicked and valid', $this->source());
// verify the second validator shows the error
- $this->click("ctl0_Content_ctl3");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->byId("ctl0_Content_ctl3")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
// verify the second validation is passed
$this->pause(500);
- $this->verifyTextNotPresent('Button2 is clicked');
+ $this->assertNotContains('Button2 is clicked', $this->source());
$this->type("ctl0_Content_TextBox2", "test");
- $this->clickAndWait("ctl0_Content_ctl3");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
- $this->verifyTextPresent('Button2 is clicked and valid');
+ $this->byId("ctl0_Content_ctl3")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
+ $this->assertContains('Button2 is clicked and valid', $this->source());
// verify the third validator shows the error
- $this->clickAndWait("ctl0_Content_ctl5");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyVisible('ctl0_Content_ctl4');
+ $this->byId("ctl0_Content_ctl5")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertVisible('ctl0_Content_ctl4');
// verify the third validation is passed
- $this->verifyTextPresent('Button3 is clicked');
- $this->verifyTextNotPresent('Button3 is clicked and valid');
+ $this->assertContains('Button3 is clicked', $this->source());
+ $this->assertNotContains('Button3 is clicked and valid', $this->source());
$this->type("ctl0_Content_TextBox3", "test");
- $this->clickAndWait("ctl0_Content_ctl5");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
- $this->verifyTextPresent('Button3 is clicked and valid');
+ $this->byId("ctl0_Content_ctl5")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
+ $this->assertContains('Button3 is clicked and valid', $this->source());
}
}
diff --git a/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php b/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php
index b523452c..394556e9 100755
--- a/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php
+++ b/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php
@@ -1,62 +1,62 @@
<?php
-class LinkButtonTestCase extends PradoGenericSeleniumTest
+class LinkButtonTestCase extends PradoGenericSelenium2Test
{
function test()
{
- $this->open('validators/index.php?page=LinkButton');
+ $this->url('validators/index.php?page=LinkButton');
// verify all error messages are invisible
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
// verify the first validator shows the error
- $this->click("ctl0_Content_ctl1");
- $this->verifyVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->byId("ctl0_Content_ctl1")->click();
+ $this->assertVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
// verify the first validation is passed
$this->pause(500);
- $this->verifyTextNotPresent('Button1 is clicked');
+ $this->assertNotContains('Button1 is clicked', $this->source());
$this->type("ctl0_Content_TextBox1", "test");
- $this->clickAndWait("ctl0_Content_ctl1");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
- $this->verifyTextPresent('Button1 is clicked and valid');
+ $this->byId("ctl0_Content_ctl1")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
+ $this->assertContains('Button1 is clicked and valid', $this->source());
// verify the second validator shows the error
- $this->click("ctl0_Content_ctl3");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->byId("ctl0_Content_ctl3")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
// verify the second validation is passed
$this->pause(500);
- $this->verifyTextNotPresent('Button2 is clicked');
+ $this->assertNotContains('Button2 is clicked', $this->source());
$this->type("ctl0_Content_TextBox2", "test");
- $this->clickAndWait("ctl0_Content_ctl3");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
- $this->verifyTextPresent('Button2 is clicked and valid');
+ $this->byId("ctl0_Content_ctl3")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
+ $this->assertContains('Button2 is clicked and valid', $this->source());
// verify the third validator shows the error
- $this->clickAndWait("ctl0_Content_ctl5");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyVisible('ctl0_Content_ctl4');
+ $this->byId("ctl0_Content_ctl5")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertVisible('ctl0_Content_ctl4');
// verify the third validation is passed
- $this->verifyTextPresent('Button3 is clicked');
- $this->verifyTextNotPresent('Button3 is clicked and valid');
+ $this->assertContains('Button3 is clicked', $this->source());
+ $this->assertNotContains('Button3 is clicked and valid', $this->source());
$this->type("ctl0_Content_TextBox3", "test");
- $this->clickAndWait("ctl0_Content_ctl5");
- $this->verifyNotVisible('ctl0_Content_ctl0');
- $this->verifyNotVisible('ctl0_Content_ctl2');
- $this->verifyNotVisible('ctl0_Content_ctl4');
- $this->verifyTextPresent('Button3 is clicked and valid');
+ $this->byId("ctl0_Content_ctl5")->click();
+ $this->assertNotVisible('ctl0_Content_ctl0');
+ $this->assertNotVisible('ctl0_Content_ctl2');
+ $this->assertNotVisible('ctl0_Content_ctl4');
+ $this->assertContains('Button3 is clicked and valid', $this->source());
}
}
diff --git a/tests/FunctionalTests/validators/tests/ListControlTestCase.php b/tests/FunctionalTests/validators/tests/ListControlTestCase.php
index 68feee84..55e370c5 100755
--- a/tests/FunctionalTests/validators/tests/ListControlTestCase.php
+++ b/tests/FunctionalTests/validators/tests/ListControlTestCase.php
@@ -3,38 +3,39 @@
* Created on 24/04/2006
*/
-class ListControlTestCase extends PradoGenericSeleniumTest
+class ListControlTestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = "ctl0_Content_";
- $this->open("validators/index.php?page=ListControl", "");
- $this->verifyTextPresent("List Control Required Field Validation Test", "");
- $this->click("//input[@type='submit' and @value='Submit!']", "");
+ $this->url("validators/index.php?page=ListControl");
+ $this->assertContains("List Control Required Field Validation Test", $this->source());
+ $this->byXPath("//input[@type='submit' and @value='Submit!']")->click();
$this->assertVisible("{$base}validator1");
$this->assertVisible("{$base}validator2");
$this->assertVisible("{$base}validator3");
$this->assertVisible("{$base}validator4");
- $this->click("//input[@id='{$base}list1_c1' and @value='Red']", "");
- $this->select("{$base}list2", "label=Red");
- $this->select("{$base}list3", "label=Blue");
- $this->click("{$base}list4_c3", "");
- $this->clickAndWait("//input[@type='submit' and @value='Submit!']", "");
+ $this->byXPath("//input[@id='{$base}list1_c1' and @value='Red']")->click();
+ $this->select("{$base}list2", "Red");
+ $this->select("{$base}list3", "Blue");
+ $this->byId("{$base}list4_c3")->click();
+ $this->byXPath("//input[@type='submit' and @value='Submit!']")->click();
$this->assertNotVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
$this->assertNotVisible("{$base}validator3");
$this->assertNotVisible("{$base}validator4");
- $this->select("{$base}list3", "label=Don't select this one");
- $this->click("{$base}list4_c0");
- $this->select("{$base}list2", "label=--- Select a color ---");
- $this->click("//input[@type='submit' and @value='Submit!']", "");
- $this->click("//input[@id='{$base}list1_c1' and @value='Red']", "");
- $this->click("//input[@id='{$base}list1_c0' and @value='Select a color below']", "");
- $this->click("//input[@type='submit' and @value='Submit!']", "");
+ //invalid selector: Unable to locate an element with the xpath expression .//option[.='Don\'t select this one'] because of the following error: SyntaxError: Failed to execute 'evaluate' on 'Document': The string './/option[.='Don\'t select this one']' is not a valid XPath expression.
+ $this->select("{$base}list3", "Dont select this one");
+ $this->byId("{$base}list4_c0")->click();
+ $this->select("{$base}list2", "--- Select a color ---");
+ $this->byXPath("//input[@type='submit' and @value='Submit!']")->click();
+ $this->byXPath("//input[@id='{$base}list1_c1' and @value='Red']")->click();
+ $this->byXPath("//input[@id='{$base}list1_c0' and @value='Select a color below']")->click();
+ $this->byXPath("//input[@type='submit' and @value='Submit!']")->click();
$this->assertVisible("{$base}validator1");
$this->assertVisible("{$base}validator2");
diff --git a/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php b/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php
index 022ee7f6..485c6a24 100755
--- a/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php
+++ b/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php
@@ -1,166 +1,166 @@
<?php
//New Test
-class RangeValidatorTestCase extends PradoGenericSeleniumTest
+class RangeValidatorTestCase extends PradoGenericSelenium2Test
{
function testIntegerRange()
{
$base = "ctl0_Content_";
- $this->open("validators/index.php?page=RangeValidatorInteger", "");
- $this->verifyTextPresent("Prado RangeValidator Tests Integer", "");
-
+ $this->url("validators/index.php?page=RangeValidatorInteger");
+ $this->assertContains("Prado RangeValidator Tests Integer", $this->source());
+
//between 1 and 4
$this->type("{$base}text1", "ad");
- $this->assertNotVisible("{$base}validator1", "");
- $this->click("//input[@type='submit' and @value='Test']", "");
- $this->assertVisible("{$base}validator1", "");
+ $this->assertNotVisible("{$base}validator1");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertVisible("{$base}validator1");
$this->type("{$base}text1", "12");
- $this->click("//input[@type='submit' and @value='Test']", "");
- $this->assertVisible("{$base}validator1", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertVisible("{$base}validator1");
$this->type("{$base}text1", "2");
- $this->assertNotVisible("{$base}validator1", "");
- $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
- $this->assertNotVisible("{$base}validator1", "");
-
-
+ $this->assertNotVisible("{$base}validator1");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertNotVisible("{$base}validator1");
+
+
// >= 2
- $this->assertNotVisible("{$base}validator2", "");
+ $this->assertNotVisible("{$base}validator2");
$this->type("{$base}text2", "1");
- $this->click("//input[@type='submit' and @value='Test']", "");
- $this->assertVisible("{$base}validator2", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertVisible("{$base}validator2");
$this->type("{$base}text2", "10");
- $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
- $this->assertNotVisible("{$base}validator2", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertNotVisible("{$base}validator2");
// <= 20
- $this->assertNotVisible("{$base}validator3", "");
+ $this->assertNotVisible("{$base}validator3");
$this->type("{$base}text3", "100");
- $this->click("//input[@type='submit' and @value='Test']", "");
- $this->assertVisible("{$base}validator3", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertVisible("{$base}validator3");
$this->type("{$base}text3", "10");
- $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
- $this->assertNotVisible("{$base}validator3", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertNotVisible("{$base}validator3");
}
-
+
function testFloatRange()
{
$base = "ctl0_Content_";
- $this->open("validators/index.php?page=RangeValidatorFloat", "");
- $this->verifyTextPresent("Prado RangeValidator Tests Float", "");
-
+ $this->url("validators/index.php?page=RangeValidatorFloat");
+ $this->assertContains("Prado RangeValidator Tests Float", $this->source());
+
//between 1 and 4
$this->type("{$base}text1", "ad");
- $this->assertNotVisible("{$base}validator1", "");
- $this->click("//input[@type='submit' and @value='Test']", "");
- $this->assertVisible("{$base}validator1", "");
+ $this->assertNotVisible("{$base}validator1");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertVisible("{$base}validator1");
$this->type("{$base}text1", "12");
- $this->click("//input[@type='submit' and @value='Test']", "");
- $this->assertVisible("{$base}validator1", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertVisible("{$base}validator1");
$this->type("{$base}text1", "2");
- $this->assertNotVisible("{$base}validator1", "");
- $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
- $this->assertNotVisible("{$base}validator1", "");
-
-
+ $this->assertNotVisible("{$base}validator1");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertNotVisible("{$base}validator1");
+
+
// >= 2
- $this->assertNotVisible("{$base}validator2", "");
+ $this->assertNotVisible("{$base}validator2");
$this->type("{$base}text2", "1");
- $this->click("//input[@type='submit' and @value='Test']", "");
- $this->assertVisible("{$base}validator2", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertVisible("{$base}validator2");
$this->type("{$base}text2", "10");
- $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
- $this->assertNotVisible("{$base}validator2", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertNotVisible("{$base}validator2");
// <= 20
- $this->assertNotVisible("{$base}validator3", "");
+ $this->assertNotVisible("{$base}validator3");
$this->type("{$base}text3", "100");
- $this->click("//input[@type='submit' and @value='Test']", "");
- $this->assertVisible("{$base}validator3", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertVisible("{$base}validator3");
$this->type("{$base}text3", "10");
- $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
- $this->assertNotVisible("{$base}validator3", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertNotVisible("{$base}validator3");
}
-
+
function testDateRange()
{
$base = "ctl0_Content_";
- $this->open("validators/index.php?page=RangeValidatorDate", "");
- $this->verifyTextPresent("Prado RangeValidator Tests Date", "");
-
+ $this->url("validators/index.php?page=RangeValidatorDate");
+ $this->assertContains("Prado RangeValidator Tests Date", $this->source());
+
//between 22/1/2005 and 3/2/2005
$this->type("{$base}text1", "ad");
- $this->assertNotVisible("{$base}validator1", "");
- $this->click("//input[@type='submit' and @value='Test']", "");
- $this->assertVisible("{$base}validator1", "");
+ $this->assertNotVisible("{$base}validator1");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertVisible("{$base}validator1");
$this->type("{$base}text1", "27/2/2005");
- $this->click("//input[@type='submit' and @value='Test']", "");
- $this->assertVisible("{$base}validator1", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertVisible("{$base}validator1");
$this->type("{$base}text1", "1/2/2005");
- $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
- $this->assertNotVisible("{$base}validator1", "");
- $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
- $this->assertNotVisible("{$base}validator1", "");
-
-
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertNotVisible("{$base}validator1");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertNotVisible("{$base}validator1");
+
+
// >= 22/1/2005
- $this->assertNotVisible("{$base}validator2", "");
+ $this->assertNotVisible("{$base}validator2");
$this->type("{$base}text2", "1/1/2005");
- $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
$this->pause(250);
- $this->assertVisible("{$base}validator2", "");
+ $this->assertVisible("{$base}validator2");
$this->type("{$base}text2", "1/4/2005");
- $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
- $this->assertNotVisible("{$base}validator2", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertNotVisible("{$base}validator2");
// <= 3/2/2005
- $this->assertNotVisible("{$base}validator3", "");
+ $this->assertNotVisible("{$base}validator3");
$this->type("{$base}text3", "4/5/2005");
- $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
$this->pause(250);
- $this->assertVisible("{$base}validator3", "");
+ $this->assertVisible("{$base}validator3");
$this->type("{$base}text3", "1/2/2005");
- $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
- $this->assertNotVisible("{$base}validator3", "");
- }
-
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertNotVisible("{$base}validator3");
+ }
+
function testStringRange()
{
$base = "ctl0_Content_";
- $this->open("validators/index.php?page=RangeValidatorString", "");
- $this->verifyTextPresent("Prado RangeValidator Tests String", "");
-
+ $this->url("validators/index.php?page=RangeValidatorString");
+ $this->assertContains("Prado RangeValidator Tests String", $this->source());
+
//between 'd' and 'y'
$this->type("{$base}text1", "a");
- $this->assertNotVisible("{$base}validator1", "");
- $this->click("//input[@type='submit' and @value='Test']", "");
- $this->assertVisible("{$base}validator1", "");
+ $this->assertNotVisible("{$base}validator1");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertVisible("{$base}validator1");
$this->type("{$base}text1", "b");
- $this->click("//input[@type='submit' and @value='Test']", "");
- $this->assertVisible("{$base}validator1", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertVisible("{$base}validator1");
$this->type("{$base}text1", "f");
- $this->assertNotVisible("{$base}validator1", "");
- $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
- $this->assertNotVisible("{$base}validator1", "");
-
-
+ $this->assertNotVisible("{$base}validator1");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertNotVisible("{$base}validator1");
+
+
// >= 'd'
- $this->assertNotVisible("{$base}validator2", "");
+ $this->assertNotVisible("{$base}validator2");
$this->type("{$base}text2", "a");
- $this->click("//input[@type='submit' and @value='Test']", "");
- $this->assertVisible("{$base}validator2", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertVisible("{$base}validator2");
$this->type("{$base}text2", "g");
- $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
- $this->assertNotVisible("{$base}validator2", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertNotVisible("{$base}validator2");
// <= 'y'
- $this->assertNotVisible("{$base}validator3", "");
+ $this->assertNotVisible("{$base}validator3");
$this->type("{$base}text3", "z");
- $this->click("//input[@type='submit' and @value='Test']", "");
- $this->assertVisible("{$base}validator3", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertVisible("{$base}validator3");
$this->type("{$base}text3", "t");
- $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
- $this->assertNotVisible("{$base}validator3", "");
- }
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertNotVisible("{$base}validator3");
+ }
}
diff --git a/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php b/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php
index f269bf3b..ffa30126 100755
--- a/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php
+++ b/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php
@@ -1,32 +1,32 @@
<?php
//New Test
-class RegExpValidatorTestCase extends PradoGenericSeleniumTest
+class RegExpValidatorTestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = "ctl0_Content_";
- $this->open("validators/index.php?page=RegularExpressionValidator", "");
- $this->verifyTextPresent("Prado RegularExpressionValidator Tests", "");
- $this->assertNotVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
+ $this->url("validators/index.php?page=RegularExpressionValidator");
+ $this->assertContains("Prado RegularExpressionValidator Tests", $this->source());
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
$this->type("{$base}text1", "1");
$this->type("{$base}text2", "2");
- $this->click("//input[@type='submit' and @value='Test']", "");
- $this->assertVisible("{$base}validator1", "");
- $this->assertVisible("{$base}validator2", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertVisible("{$base}validator1");
+ $this->assertVisible("{$base}validator2");
$this->type("{$base}text1", "asdasd");
- $this->click("//input[@type='submit' and @value='Test']", "");
- $this->assertVisible("{$base}validator1", "");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertVisible("{$base}validator1");
$this->type("{$base}text1", "12345");
- $this->assertNotVisible("{$base}validator1", "");
- $this->assertVisible("{$base}validator2", "");
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertVisible("{$base}validator2");
$this->type("{$base}text2", "wei@gmail.com");
- $this->assertNotVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
- $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
- $this->assertNotVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
+ $this->byXPath("//input[@type='submit' and @value='Test']")->click();
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
}
}
diff --git a/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php b/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php
index f8b54eb0..e868155c 100755
--- a/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php
+++ b/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php
@@ -1,54 +1,54 @@
<?php
-class RequiredFieldTestCase extends PradoGenericSeleniumTest
+class RequiredFieldTestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = "ctl0_Content_";
- $this->open("validators/index.php?page=RequiredFieldValidator");
- $this->assertTextPresent("RequiredFieldValidator Tests");
+ $this->url("validators/index.php?page=RequiredFieldValidator");
+ $this->assertContains("RequiredFieldValidator Tests", $this->source());
$this->assertNotVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
- $this->click("{$base}submit1");
+ $this->byId("{$base}submit1")->click();
$this->assertVisible("{$base}validator1");
$this->assertVisible("{$base}validator2");
$this->type("{$base}text1", "testing");
- $this->click("{$base}submit1");
+ $this->byId("{$base}submit1")->click();
$this->assertNotVisible("{$base}validator1");
- $this->click("{$base}submit2");
+ $this->byId("{$base}submit2")->click();
$this->assertNotVisible("{$base}validator1");
- $this->assertNotVisible("{$base}validator2");
+ $this->assertVisible("{$base}validator2");
$this->assertVisible("{$base}validator3");
$this->assertVisible("{$base}validator4");
$this->type("{$base}text2", "testing2");
- $this->click("{$base}submit2");
+ $this->byId("{$base}submit2")->click();
$this->assertNotVisible("{$base}validator3");
- $this->click("{$base}submit3");
+ $this->byId("{$base}submit3")->click();
$this->assertVisible("{$base}summary3");
- $this->clickAndWait("{$base}submit4");
+ $this->byId("{$base}submit4")->click();
$this->assertNotVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
$this->assertNotVisible("{$base}validator3");
$this->assertNotVisible("{$base}validator4");
- $this->click("{$base}submit1");
+ $this->byId("{$base}submit1")->click();
$this->assertVisible("{$base}validator2");
- $this->click("{$base}check1");
- $this->click("{$base}submit2");
+ $this->byId("{$base}check1")->click();
+ $this->byId("{$base}submit2")->click();
$this->assertVisible("{$base}validator4");
- $this->clickAndWait("{$base}submit1");
+ $this->byId("{$base}submit1")->click();
$this->assertNotVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
$this->type("{$base}text1");
- $this->click("{$base}check1");
- $this->click("{$base}submit1");
+ $this->byId("{$base}check1")->click();
+ $this->byId("{$base}submit1")->click();
$this->assertVisible("{$base}validator1");
$this->assertVisible("{$base}validator2");
- $this->click("{$base}check2");
- $this->clickAndWait("{$base}submit2");
+ $this->byId("{$base}check2")->click();
+ $this->byId("{$base}submit2")->click();
$this->type("{$base}text1", "Hello");
- $this->click("{$base}check1");
- $this->click("{$base}submit2");
+ $this->byId("{$base}check1")->click();
+ $this->byId("{$base}submit2")->click();
$this->assertNotVisible("{$base}validator5");
$this->assertNotVisible("{$base}validator6");
@@ -56,14 +56,14 @@ class RequiredFieldTestCase extends PradoGenericSeleniumTest
$this->assertNotVisible("{$base}validator8");
$this->type("{$base}text1");
$this->type("{$base}text2");
- $this->click("{$base}check1");
- $this->click("{$base}check2");
- $this->click("{$base}submit3");
+ $this->byId("{$base}check1")->click();
+ $this->byId("{$base}check2")->click();
+ $this->byId("{$base}submit3")->click();
$this->assertVisible("{$base}validator5");
$this->assertVisible("{$base}validator6");
$this->assertVisible("{$base}validator7");
$this->assertVisible("{$base}validator8");
- $this->clickAndWait("{$base}submit4");
+ $this->byId("{$base}submit4")->click();
$this->assertNotVisible("{$base}validator5");
$this->assertNotVisible("{$base}validator6");
$this->assertNotVisible("{$base}validator7");
@@ -73,10 +73,10 @@ class RequiredFieldTestCase extends PradoGenericSeleniumTest
function testInitialValue()
{
$base = "ctl0_Content_";
- $this->open("validators/index.php?page=RequiredFieldValidator");
- $this->assertTextPresent("InitialValue Test");
+ $this->url("validators/index.php?page=RequiredFieldValidator");
+ $this->assertContains("InitialValue Test", $this->source());
$this->assertNotVisible("{$base}validator9");
- $this->click("{$base}submit5");
+ $this->byId("{$base}submit5")->click();
$this->pause(250);
$this->assertVisible("{$base}validator9");
$this->type("{$base}text5", "adasd");
diff --git a/tests/FunctionalTests/validators/tests/RequiredListTestCase.php b/tests/FunctionalTests/validators/tests/RequiredListTestCase.php
index 2662c721..0de6815e 100755
--- a/tests/FunctionalTests/validators/tests/RequiredListTestCase.php
+++ b/tests/FunctionalTests/validators/tests/RequiredListTestCase.php
@@ -1,35 +1,35 @@
<?php
-class RequiredListTestCase extends PradoGenericSeleniumTest
+class RequiredListTestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = "ctl0_Content_";
- $this->open("validators/index.php?page=RequiredListValidator");
- $this->click("{$base}submit1");
+ $this->url("validators/index.php?page=RequiredListValidator");
+ $this->byId("{$base}submit1")->click();
$this->assertVisible("{$base}validator1");
$this->assertVisible("{$base}validator2");
$this->assertVisible("{$base}validator3");
- $this->click("{$base}list1_c0");
- $this->addSelection("{$base}list2", "label=One");
- $this->addSelection("{$base}list2", "label=Two");
- $this->click("{$base}list3_c3");
- $this->clickAndWait("{$base}submit1");
+ $this->byId("{$base}list1_c0")->click();
+ $this->addSelection("{$base}list2", "One");
+ $this->addSelection("{$base}list2", "Two");
+ $this->byId("{$base}list3_c3")->click();
+ $this->byId("{$base}submit1")->click();
$this->assertNotVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
$this->assertNotVisible("{$base}validator3");
- $this->click("{$base}list1_c1");
- $this->click("{$base}list1_c2");
- $this->click("{$base}list1_c3");
- $this->addSelection("{$base}list2", "label=Two");
- $this->click("{$base}list1_c3");
- $this->clickAndWait("{$base}submit1");
+ $this->byId("{$base}list1_c1")->click();
+ $this->byId("{$base}list1_c2")->click();
+ $this->byId("{$base}list1_c3")->click();
+ $this->addSelection("{$base}list2", "Two");
+ $this->byId("{$base}list1_c3")->click();
+ $this->byId("{$base}submit1")->click();
$this->assertNotVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
$this->assertNotVisible("{$base}validator3");
- $this->click("{$base}list3_c3");
- $this->clickAndWait("{$base}submit1");
+ $this->byId("{$base}list3_c3")->click();
+ $this->byId("{$base}submit1")->click();
$this->pause(200);
$this->assertNotVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
diff --git a/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php b/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php
index 7dc1d6b1..d4c44a34 100755
--- a/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php
+++ b/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php
@@ -1,46 +1,46 @@
<?php
//New Test
-class ValidationSummaryTestCase extends PradoGenericSeleniumTest
+class ValidationSummaryTestCase extends PradoGenericSelenium2Test
{
function test()
{
$base = "ctl0_Content_";
-
- $this->open("validators/index.php?page=ValidationSummary", "");
- $this->verifyTextPresent("Validation Summary Test", "");
- //$this->verifyText("{$base}summary1", "");
- //$this->verifyText("{$base}summary2", "");
-
- $this->click("//input[@type='submit' and @value='Create New Account']", "");
+
+ $this->url("validators/index.php?page=ValidationSummary");
+ $this->assertContains("Validation Summary Test", $this->source());
+ //$this->assertText("{$base}summary1", "");
+ //$this->assertText("{$base}summary2", "");
+
+ $this->byXPath("//input[@type='submit' and @value='Create New Account']")->click();
$this->assertVisible("{$base}summary1");
$this->assertNotVisible("{$base}summary2");
- $this->click("//input[@type='submit' and @value='Sign In']", "");
+ $this->byXPath("//input[@type='submit' and @value='Sign In']")->click();
$this->assertNotVisible("{$base}summary1");
- $this->assertVisible("{$base}summary2");
-
+ $this->assertVisible("{$base}summary2");
+
$this->type("{$base}Username", "qwe");
$this->type("{$base}Password", "ewwq");
- $this->click("//input[@type='submit' and @value='Sign In']", "");
+ $this->byXPath("//input[@type='submit' and @value='Sign In']")->click();
$this->assertNotVisible("{$base}summary1");
- $this->assertVisible("{$base}summary2");
-
- /*$this->clickAndWait("//input[@type='submit' and @value='Create New Account']", "");
+ $this->assertVisible("{$base}summary2");
+
+ /*$this->byXPath("//input[@type='submit' and @value='Create New Account']")->click();
$this->type("{$base}UserID", "123");
$this->type("{$base}Pass", "123");
- $this->clickAndWait("//input[@type='submit' and @value='Sign In']", "");
- //$this->verifyText("{$base}summary1", "");
- //$this->verifyText("{$base}summary2", "");
- $this->clickAndWait("//input[@type='submit' and @value='Create New Account']", "");
- //$this->verifyText("{$base}summary1", "");
- //$this->verifyText("{$base}summary2", "");
+ $this->byXPath("//input[@type='submit' and @value='Sign In']")->click();
+ //$this->assertText("{$base}summary1", "");
+ //$this->assertText("{$base}summary2", "");
+ $this->byXPath("//input[@type='submit' and @value='Create New Account']")->click();
+ //$this->assertText("{$base}summary1", "");
+ //$this->assertText("{$base}summary2", "");
$this->type("{$base}Password", "");
- $this->click("//input[@type='submit' and @value='Create New Account']", "");
+ $this->byXPath("//input[@type='submit' and @value='Create New Account']")->click();
$this->assertVisible("{$base}summary1");
$this->assertNotVisible("{$base}summary2");
-
+
$this->type("{$base}Password", "12312");
$this->assertVisible("{$base}summary1");
*/
diff --git a/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php b/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php
index 8d7fa46a..58c9977a 100644
--- a/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php
+++ b/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php
@@ -65,5 +65,3 @@ class ActiveRecordDynamicCallTestCase extends UnitTestCase
var_dump($param);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/ActiveRecordFinderTestCase.php b/tests/simple_unit/ActiveRecord/ActiveRecordFinderTestCase.php
index e962046b..d9bd7420 100644
--- a/tests/simple_unit/ActiveRecord/ActiveRecordFinderTestCase.php
+++ b/tests/simple_unit/ActiveRecord/ActiveRecordFinderTestCase.php
@@ -41,5 +41,3 @@ class ActiveRecordFinderTestCase extends UnitTestCase
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/ActiveRecordMySql5TestCase.php b/tests/simple_unit/ActiveRecord/ActiveRecordMySql5TestCase.php
index d173f005..09981f43 100644
--- a/tests/simple_unit/ActiveRecord/ActiveRecordMySql5TestCase.php
+++ b/tests/simple_unit/ActiveRecord/ActiveRecordMySql5TestCase.php
@@ -42,5 +42,4 @@ class ActiveRecordMySql5TestCase extends UnitTestCase
$this->assertEqual($check->{$prop}, $blog->{$prop});
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/ActiveRecordRegistryTestCase.php b/tests/simple_unit/ActiveRecord/ActiveRecordRegistryTestCase.php
index fe1507cd..12b0796c 100644
--- a/tests/simple_unit/ActiveRecord/ActiveRecordRegistryTestCase.php
+++ b/tests/simple_unit/ActiveRecord/ActiveRecordRegistryTestCase.php
@@ -163,5 +163,3 @@ class ActiveRecordRegistryTestCase extends UnitTestCase
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php b/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php
index c356216b..676a0dd0 100644
--- a/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php
+++ b/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php
@@ -29,5 +29,3 @@ class BaseActiveRecordTestCase extends UnitTestCase
}
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/CountRecordsTestCase.php b/tests/simple_unit/ActiveRecord/CountRecordsTestCase.php
index 4c489d49..36a96ab6 100644
--- a/tests/simple_unit/ActiveRecord/CountRecordsTestCase.php
+++ b/tests/simple_unit/ActiveRecord/CountRecordsTestCase.php
@@ -31,5 +31,3 @@ class CountRecordsTestCase extends UnitTestCase
$this->assertEqual($finder->count(), 8);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/CriteriaTestCase.php b/tests/simple_unit/ActiveRecord/CriteriaTestCase.php
index de5b3b71..a320f38c 100644
--- a/tests/simple_unit/ActiveRecord/CriteriaTestCase.php
+++ b/tests/simple_unit/ActiveRecord/CriteriaTestCase.php
@@ -46,5 +46,3 @@ class CriteriaTestCase extends UnitTestCase
$this->assertEqual($criteria->getParameters()->toArray(), $expect);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/DeleteByPkTestCase.php b/tests/simple_unit/ActiveRecord/DeleteByPkTestCase.php
index f848033c..0c09a9b0 100644
--- a/tests/simple_unit/ActiveRecord/DeleteByPkTestCase.php
+++ b/tests/simple_unit/ActiveRecord/DeleteByPkTestCase.php
@@ -27,5 +27,4 @@ class DeleteByPkTestCase extends UnitTestCase
$this->assertEqual($finder->deleteByPk(array(100, 101), array(102, 103)),0);
$this->assertEqual($finder->deleteByPk(array(array(100, 101), array(102, 103))),0);
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/FindByPksTestCase.php b/tests/simple_unit/ActiveRecord/FindByPksTestCase.php
index 4ccbddd5..32a79cea 100644
--- a/tests/simple_unit/ActiveRecord/FindByPksTestCase.php
+++ b/tests/simple_unit/ActiveRecord/FindByPksTestCase.php
@@ -60,5 +60,3 @@ class FindByPksTestCase extends UnitTestCase
$this->assertEqual($dep->section_id, $sec_id);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/FindBySqlTestCase.php b/tests/simple_unit/ActiveRecord/FindBySqlTestCase.php
index e613cc30..14da0833 100644
--- a/tests/simple_unit/ActiveRecord/FindBySqlTestCase.php
+++ b/tests/simple_unit/ActiveRecord/FindBySqlTestCase.php
@@ -42,5 +42,3 @@ class FindBySqlTestCase extends UnitTestCase
var_dump($users);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/ForeignKeyTestCase.php b/tests/simple_unit/ActiveRecord/ForeignKeyTestCase.php
index b960760e..86462ca6 100644
--- a/tests/simple_unit/ActiveRecord/ForeignKeyTestCase.php
+++ b/tests/simple_unit/ActiveRecord/ForeignKeyTestCase.php
@@ -171,5 +171,3 @@ class ForeignKeyTestCase extends UnitTestCase
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/ForeignObjectUpdateTest.php b/tests/simple_unit/ActiveRecord/ForeignObjectUpdateTest.php
index 672c2d0f..29fbff42 100644
--- a/tests/simple_unit/ActiveRecord/ForeignObjectUpdateTest.php
+++ b/tests/simple_unit/ActiveRecord/ForeignObjectUpdateTest.php
@@ -238,5 +238,3 @@ class ForeignObjectUpdateTest extends UnitTestCase
}
//*/
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/MultipleForeignKeyTestCase.php b/tests/simple_unit/ActiveRecord/MultipleForeignKeyTestCase.php
index c43db032..4b149503 100644
--- a/tests/simple_unit/ActiveRecord/MultipleForeignKeyTestCase.php
+++ b/tests/simple_unit/ActiveRecord/MultipleForeignKeyTestCase.php
@@ -188,5 +188,3 @@ class MultipleForeignKeyTestCase extends UnitTestCase
$this->assertNotIdentical($arr, $arr->state2[0]->object2);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/RecordEventTestCase.php b/tests/simple_unit/ActiveRecord/RecordEventTestCase.php
index 3e98d46b..12c57421 100644
--- a/tests/simple_unit/ActiveRecord/RecordEventTestCase.php
+++ b/tests/simple_unit/ActiveRecord/RecordEventTestCase.php
@@ -33,5 +33,3 @@ class RecordEventTestCase extends UnitTestCase
//var_dump($param);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/SqliteTestCase.php b/tests/simple_unit/ActiveRecord/SqliteTestCase.php
index 7d860b9a..ed0ea496 100644
--- a/tests/simple_unit/ActiveRecord/SqliteTestCase.php
+++ b/tests/simple_unit/ActiveRecord/SqliteTestCase.php
@@ -17,5 +17,3 @@ class SqliteTestCase extends UnitTestCase
$this->assertNotNull($user);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/UserRecordTestCase.php b/tests/simple_unit/ActiveRecord/UserRecordTestCase.php
index 34e45ca8..85b12594 100644
--- a/tests/simple_unit/ActiveRecord/UserRecordTestCase.php
+++ b/tests/simple_unit/ActiveRecord/UserRecordTestCase.php
@@ -62,5 +62,3 @@ class UserRecordTestCase extends UnitTestCase
$this->assertEqual($user->$prop,$check->$prop);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/ViewRecordTestCase.php b/tests/simple_unit/ActiveRecord/ViewRecordTestCase.php
index adf0beed..bb13a96f 100644
--- a/tests/simple_unit/ActiveRecord/ViewRecordTestCase.php
+++ b/tests/simple_unit/ActiveRecord/ViewRecordTestCase.php
@@ -72,5 +72,4 @@ class ViewRecordTestCase extends UnitTestCase
$this->pass();
}
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/records/Blogs.php b/tests/simple_unit/ActiveRecord/records/Blogs.php
index 680b3141..6523f029 100644
--- a/tests/simple_unit/ActiveRecord/records/Blogs.php
+++ b/tests/simple_unit/ActiveRecord/records/Blogs.php
@@ -10,5 +10,3 @@ class Blogs extends TActiveRecord
return parent::finder($className);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/records/DepSections.php b/tests/simple_unit/ActiveRecord/records/DepSections.php
index 6f37ae3e..bf01ed12 100644
--- a/tests/simple_unit/ActiveRecord/records/DepSections.php
+++ b/tests/simple_unit/ActiveRecord/records/DepSections.php
@@ -12,5 +12,3 @@ class DepSections extends TActiveRecord
return parent::finder($className);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/records/DepartmentRecord.php b/tests/simple_unit/ActiveRecord/records/DepartmentRecord.php
index 732610ae..b60c7930 100644
--- a/tests/simple_unit/ActiveRecord/records/DepartmentRecord.php
+++ b/tests/simple_unit/ActiveRecord/records/DepartmentRecord.php
@@ -14,5 +14,3 @@ class DepartmentRecord extends TActiveRecord
return parent::finder($className);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/records/ItemRecord.php b/tests/simple_unit/ActiveRecord/records/ItemRecord.php
index 8585ebaf..e6707cde 100644
--- a/tests/simple_unit/ActiveRecord/records/ItemRecord.php
+++ b/tests/simple_unit/ActiveRecord/records/ItemRecord.php
@@ -45,5 +45,3 @@ class ItemRecord extends TActiveRecord
return parent::finder($className);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/records/SimpleUser.php b/tests/simple_unit/ActiveRecord/records/SimpleUser.php
index cfba272e..b6748857 100644
--- a/tests/simple_unit/ActiveRecord/records/SimpleUser.php
+++ b/tests/simple_unit/ActiveRecord/records/SimpleUser.php
@@ -10,5 +10,3 @@ class SimpleUser extends TActiveRecord
return parent::finder($className);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/records/SqliteUsers.php b/tests/simple_unit/ActiveRecord/records/SqliteUsers.php
index 8e5b9fde..f8fa12c5 100644
--- a/tests/simple_unit/ActiveRecord/records/SqliteUsers.php
+++ b/tests/simple_unit/ActiveRecord/records/SqliteUsers.php
@@ -12,5 +12,3 @@ class SqliteUsers extends TActiveRecord
return parent::finder($className);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ActiveRecord/records/UserRecord.php b/tests/simple_unit/ActiveRecord/records/UserRecord.php
index c4e8ce60..4ef98baf 100644
--- a/tests/simple_unit/ActiveRecord/records/UserRecord.php
+++ b/tests/simple_unit/ActiveRecord/records/UserRecord.php
@@ -34,5 +34,3 @@ class UserRecord extends TActiveRecord
return parent::finder($className);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/DbCommon/CommandBuilderMssqlTest.php b/tests/simple_unit/DbCommon/CommandBuilderMssqlTest.php
index f8a4257c..d309c1cc 100644
--- a/tests/simple_unit/DbCommon/CommandBuilderMssqlTest.php
+++ b/tests/simple_unit/DbCommon/CommandBuilderMssqlTest.php
@@ -42,5 +42,3 @@ class CommandBuilderMssqlTest extends UnitTestCase
// var_dump($sql);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/DbCommon/CommandBuilderMysqlTest.php b/tests/simple_unit/DbCommon/CommandBuilderMysqlTest.php
index e248defd..e47914aa 100644
--- a/tests/simple_unit/DbCommon/CommandBuilderMysqlTest.php
+++ b/tests/simple_unit/DbCommon/CommandBuilderMysqlTest.php
@@ -15,5 +15,3 @@ class CommandBuilderMysqlTest extends UnitTestCase
$this->mysql_meta_data()->getTableInfo("tests.table1");
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/DbCommon/CommandBuilderPgsqlTest.php b/tests/simple_unit/DbCommon/CommandBuilderPgsqlTest.php
index 63660aee..8e339073 100644
--- a/tests/simple_unit/DbCommon/CommandBuilderPgsqlTest.php
+++ b/tests/simple_unit/DbCommon/CommandBuilderPgsqlTest.php
@@ -72,5 +72,3 @@ class CommandBuilderPgsqlTest extends UnitTestCase
$this->assertEqual($expect, $limit);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/DbCommon/MssqlColumnTest.php b/tests/simple_unit/DbCommon/MssqlColumnTest.php
index 16d73bc4..f64615e8 100644
--- a/tests/simple_unit/DbCommon/MssqlColumnTest.php
+++ b/tests/simple_unit/DbCommon/MssqlColumnTest.php
@@ -44,5 +44,3 @@ class MssqlColumnTest extends UnitTestCase
var_dump($result);
}*/
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/DbCommon/Mysql4ColumnTest.php b/tests/simple_unit/DbCommon/Mysql4ColumnTest.php
index 234a212f..6216cdd7 100644
--- a/tests/simple_unit/DbCommon/Mysql4ColumnTest.php
+++ b/tests/simple_unit/DbCommon/Mysql4ColumnTest.php
@@ -250,5 +250,3 @@ class Mysql4ColumnTest extends UnitTestCase
}
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/DbCommon/MysqlColumnTest.php b/tests/simple_unit/DbCommon/MysqlColumnTest.php
index 08fdb545..57565ca1 100644
--- a/tests/simple_unit/DbCommon/MysqlColumnTest.php
+++ b/tests/simple_unit/DbCommon/MysqlColumnTest.php
@@ -250,5 +250,3 @@ class MysqlColumnTest extends UnitTestCase
}
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/DbCommon/PgsqlColumnTest.php b/tests/simple_unit/DbCommon/PgsqlColumnTest.php
index a16de964..5859c115 100644
--- a/tests/simple_unit/DbCommon/PgsqlColumnTest.php
+++ b/tests/simple_unit/DbCommon/PgsqlColumnTest.php
@@ -135,5 +135,3 @@ class PgsqlColumnTest extends UnitTestCase
}
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/DbCommon/SqliteColumnTest.php b/tests/simple_unit/DbCommon/SqliteColumnTest.php
index 246c4a27..712d2977 100644
--- a/tests/simple_unit/DbCommon/SqliteColumnTest.php
+++ b/tests/simple_unit/DbCommon/SqliteColumnTest.php
@@ -25,5 +25,4 @@ class SqliteColumnTest extends UnitTestCase
//$table = new TTableGateway('Accounts', $conn);
// var_dump($table->findAll()->readAll());
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php b/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php
index 80e9c1fd..0728baf7 100644
--- a/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php
+++ b/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php
@@ -41,5 +41,3 @@ class MysqlMessageSourceTestCase extends UnitTestCase
}
*/
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/Soap/ContactManager.php b/tests/simple_unit/Soap/ContactManager.php
index 290063b3..2fbeec48 100644
--- a/tests/simple_unit/Soap/ContactManager.php
+++ b/tests/simple_unit/Soap/ContactManager.php
@@ -23,12 +23,12 @@ class ContactManager{
$Contact->email = "me@you.com";
$Contact->id = 1;
$Contact->name ="me";
-
+
$ret[] = $Contact;
//debugObject("Contacten: ",$ret);
return $ret;
}
-
+
/**
* Gets the Contact with the given id.
* @param int $id The id
@@ -48,7 +48,7 @@ class ContactManager{
public function newContact() {
return new Contact();
}
-
+
/**
* Saves a given Contact
* @param Contact $Contact
@@ -60,7 +60,7 @@ class ContactManager{
//$Contact->save();
return true;
}
-
+
/**
* @return mixed
* @soapmethod
@@ -69,7 +69,7 @@ class ContactManager{
{
return array(array(1,2), array("12", 1.2));
}
-
+
/**
* @return array
* @soapmethod
@@ -92,13 +92,13 @@ class ContactManager{
*/
class Contact{
- /**
+ /**
* @var int $id
* @soapproperty
*/
public $id;
-
- /**
+
+ /**
* @var string $name
* @soapproperty
*/
@@ -110,10 +110,10 @@ class Contact{
public $address;
/** @var string $email
- * @soapproperty
+ * @soapproperty
*/
public $email;
-
+
/**
* saves a Contact
*
@@ -134,24 +134,22 @@ class Contact{
*/
class Address{
/** @var string $street
- * @soapproperty
+ * @soapproperty
*/
public $street;
-
+
/** @var string $nr
* @soapproperty
*/
public $nr;
-
+
/** @var string $zipcode
* @soapproperty
*/
- public $zipcode;
-
+ public $zipcode;
+
/** @var string $city
* @soapproperty
*/
- public $city;
+ public $city;
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/Soap/SoapTestCase.php b/tests/simple_unit/Soap/SoapTestCase.php
index fe151b04..3aaa60d3 100644
--- a/tests/simple_unit/Soap/SoapTestCase.php
+++ b/tests/simple_unit/Soap/SoapTestCase.php
@@ -35,7 +35,7 @@ class SoapTestCase extends UnitTestCase
{
try
{
- $result = $this->getClient()->getContact(1);
+ $result = $this->getClient()->getContact(1);
$this->fail();
}
catch (SoapFault $f)
@@ -88,4 +88,3 @@ class SoapTestCase extends UnitTestCase
}
}
-?>
diff --git a/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php b/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php
index b3cde511..2ae051e8 100644
--- a/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php
+++ b/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php
@@ -83,5 +83,3 @@ class ActiveRecordSqlMapTest extends BaseCase
$this->assertEqual($account1->{$prop}, $account2->{$prop});
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/BaseCase.php b/tests/simple_unit/SqlMap/BaseCase.php
index b0961b5b..4f44a5b7 100644
--- a/tests/simple_unit/SqlMap/BaseCase.php
+++ b/tests/simple_unit/SqlMap/BaseCase.php
@@ -258,5 +258,3 @@ class TDateTime
$this->_datetime = $value;
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/CacheTest.php b/tests/simple_unit/SqlMap/CacheTest.php
index 131ddfbb..ff87cd3a 100644
--- a/tests/simple_unit/SqlMap/CacheTest.php
+++ b/tests/simple_unit/SqlMap/CacheTest.php
@@ -160,5 +160,3 @@ class CacheTest extends BaseCase
$this->assertIdentical(0.5, $cache->getHitRatio());
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/DelegateTest.php b/tests/simple_unit/SqlMap/DelegateTest.php
index 800e4240..80b23332 100644
--- a/tests/simple_unit/SqlMap/DelegateTest.php
+++ b/tests/simple_unit/SqlMap/DelegateTest.php
@@ -60,5 +60,3 @@ class DelegateTest extends BaseCase
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/Dynamic/DynamicTest.php b/tests/simple_unit/SqlMap/Dynamic/DynamicTest.php
index 436cd49e..be7a1820 100644
--- a/tests/simple_unit/SqlMap/Dynamic/DynamicTest.php
+++ b/tests/simple_unit/SqlMap/Dynamic/DynamicTest.php
@@ -7,5 +7,3 @@ class DynamicTest extends UnitTestCase
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/GroupByTest.php b/tests/simple_unit/SqlMap/GroupByTest.php
index 11bd86bb..a16211c3 100644
--- a/tests/simple_unit/SqlMap/GroupByTest.php
+++ b/tests/simple_unit/SqlMap/GroupByTest.php
@@ -39,5 +39,3 @@ class GroupByTest extends BaseCase
/**/
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/InheritanceTest.php b/tests/simple_unit/SqlMap/InheritanceTest.php
index 82f86af3..81cad4a5 100644
--- a/tests/simple_unit/SqlMap/InheritanceTest.php
+++ b/tests/simple_unit/SqlMap/InheritanceTest.php
@@ -141,5 +141,4 @@ class CustomInheritance extends TSqlMapTypeHandler
{
throw new TDataMapperException('can not create');
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/ParameterMapTest.php b/tests/simple_unit/SqlMap/ParameterMapTest.php
index fb29c162..557b9f4d 100644
--- a/tests/simple_unit/SqlMap/ParameterMapTest.php
+++ b/tests/simple_unit/SqlMap/ParameterMapTest.php
@@ -245,5 +245,3 @@ class ParameterMapTest extends BaseCase
}
/**/
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/PropertyAccessTest.php b/tests/simple_unit/SqlMap/PropertyAccessTest.php
index d580f965..80199628 100644
--- a/tests/simple_unit/SqlMap/PropertyAccessTest.php
+++ b/tests/simple_unit/SqlMap/PropertyAccessTest.php
@@ -73,5 +73,3 @@ class PropertyAccessTest extends BaseCase
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/ResultClassTest.php b/tests/simple_unit/SqlMap/ResultClassTest.php
index 041c124e..773268b9 100644
--- a/tests/simple_unit/SqlMap/ResultClassTest.php
+++ b/tests/simple_unit/SqlMap/ResultClassTest.php
@@ -245,5 +245,3 @@ class ResultClassTest extends BaseCase
/**/
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/ResultMapTest.php b/tests/simple_unit/SqlMap/ResultMapTest.php
index d545b65e..b14cee31 100644
--- a/tests/simple_unit/SqlMap/ResultMapTest.php
+++ b/tests/simple_unit/SqlMap/ResultMapTest.php
@@ -269,5 +269,3 @@ class ResultMapTest extends BaseCase
*/
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/SelectKeyTest.php b/tests/simple_unit/SqlMap/SelectKeyTest.php
index a1efa640..464b94f1 100644
--- a/tests/simple_unit/SqlMap/SelectKeyTest.php
+++ b/tests/simple_unit/SqlMap/SelectKeyTest.php
@@ -116,5 +116,3 @@ class SelectKeyTest extends BaseCase
$this->initScript('line-item-init.sql');
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/SqlMapCacheTest.php b/tests/simple_unit/SqlMap/SqlMapCacheTest.php
index 1bb9b8d4..7c3495b5 100644
--- a/tests/simple_unit/SqlMap/SqlMapCacheTest.php
+++ b/tests/simple_unit/SqlMap/SqlMapCacheTest.php
@@ -73,5 +73,3 @@ class SqlMapCacheTest extends UnitTestCase
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/StatementExtendsTest.php b/tests/simple_unit/SqlMap/StatementExtendsTest.php
index f496f154..69beaa58 100644
--- a/tests/simple_unit/SqlMap/StatementExtendsTest.php
+++ b/tests/simple_unit/SqlMap/StatementExtendsTest.php
@@ -25,5 +25,3 @@ class StatementExtendsTest extends UnitTestCase
$this->assertPattern('/img_progress/', $sql2);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/StatementTest.php b/tests/simple_unit/SqlMap/StatementTest.php
index f9c3fb13..3f9f4506 100644
--- a/tests/simple_unit/SqlMap/StatementTest.php
+++ b/tests/simple_unit/SqlMap/StatementTest.php
@@ -1131,5 +1131,3 @@ class StatementTest extends BaseCase
#endregion
/**/
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/TestQueryForMap.php b/tests/simple_unit/SqlMap/TestQueryForMap.php
index 89676469..2de020a8 100644
--- a/tests/simple_unit/SqlMap/TestQueryForMap.php
+++ b/tests/simple_unit/SqlMap/TestQueryForMap.php
@@ -39,5 +39,3 @@ class TestQueryForMap extends BaseCase
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/common.php b/tests/simple_unit/SqlMap/common.php
index 5146d123..020a296b 100644
--- a/tests/simple_unit/SqlMap/common.php
+++ b/tests/simple_unit/SqlMap/common.php
@@ -151,5 +151,3 @@ class BaseTestConfig
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/A.php b/tests/simple_unit/SqlMap/domain/A.php
index af1f925d..a4f204e4 100644
--- a/tests/simple_unit/SqlMap/domain/A.php
+++ b/tests/simple_unit/SqlMap/domain/A.php
@@ -23,5 +23,3 @@ class A
public function getF(){ return $this->_F; }
public function setF($value){ $this->_F = $value; }
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/Account.php b/tests/simple_unit/SqlMap/domain/Account.php
index 9502eb85..b4bcbcc8 100644
--- a/tests/simple_unit/SqlMap/domain/Account.php
+++ b/tests/simple_unit/SqlMap/domain/Account.php
@@ -32,5 +32,3 @@ class Account
public function setCartOptions($value){ $this->_CartOptions = $value; }
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/AccountBis.php b/tests/simple_unit/SqlMap/domain/AccountBis.php
index d454f2a8..e48184b6 100644
--- a/tests/simple_unit/SqlMap/domain/AccountBis.php
+++ b/tests/simple_unit/SqlMap/domain/AccountBis.php
@@ -9,5 +9,3 @@ class AccountBis
public $More;
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/AccountCollection.php b/tests/simple_unit/SqlMap/domain/AccountCollection.php
index b14ece5e..06e30dc8 100644
--- a/tests/simple_unit/SqlMap/domain/AccountCollection.php
+++ b/tests/simple_unit/SqlMap/domain/AccountCollection.php
@@ -13,5 +13,3 @@ class AccountCollection extends TList
$array->copyFrom($this);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/B.php b/tests/simple_unit/SqlMap/domain/B.php
index 788b804e..ab42e6b6 100644
--- a/tests/simple_unit/SqlMap/domain/B.php
+++ b/tests/simple_unit/SqlMap/domain/B.php
@@ -19,5 +19,3 @@ class B
public function getLibelle(){ return $this->_Libelle; }
public function setLibelle($value){ $this->_Libelle = $value; }
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/Book.php b/tests/simple_unit/SqlMap/domain/Book.php
index 80877112..4c0670e8 100644
--- a/tests/simple_unit/SqlMap/domain/Book.php
+++ b/tests/simple_unit/SqlMap/domain/Book.php
@@ -5,7 +5,5 @@ class Book extends Document
private $_PageNumber='';
public function getPageNumber(){ return $this->_PageNumber; }
- public function setPageNumber($value){ $this->_PageNumber = $value; }
+ public function setPageNumber($value){ $this->_PageNumber = $value; }
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/C.php b/tests/simple_unit/SqlMap/domain/C.php
index 47118d44..642f97e9 100644
--- a/tests/simple_unit/SqlMap/domain/C.php
+++ b/tests/simple_unit/SqlMap/domain/C.php
@@ -11,5 +11,3 @@ class C
public function getLibelle(){ return $this->_Libelle; }
public function setLibelle($value){ $this->_Libelle = $value; }
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/Category.php b/tests/simple_unit/SqlMap/domain/Category.php
index db76edb4..895819e9 100644
--- a/tests/simple_unit/SqlMap/domain/Category.php
+++ b/tests/simple_unit/SqlMap/domain/Category.php
@@ -15,5 +15,3 @@ class Category
public function getGuidString(){ return $this->_Guid; }
public function setGuidString($value){ $this->_Guid = $value; }
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/Complex.php b/tests/simple_unit/SqlMap/domain/Complex.php
index 99cb04b8..01082343 100644
--- a/tests/simple_unit/SqlMap/domain/Complex.php
+++ b/tests/simple_unit/SqlMap/domain/Complex.php
@@ -7,5 +7,3 @@ class Complex
public function getMap(){ return $this->_map; }
public function setMap(TMap $map){ $this->_map = $map; }
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/D.php b/tests/simple_unit/SqlMap/domain/D.php
index 2cbd2883..f120e2d1 100644
--- a/tests/simple_unit/SqlMap/domain/D.php
+++ b/tests/simple_unit/SqlMap/domain/D.php
@@ -12,5 +12,3 @@ class D
public function setLibelle($value){ $this->_Libelle = $value; }
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/Document.php b/tests/simple_unit/SqlMap/domain/Document.php
index 682f8eb3..518851e6 100644
--- a/tests/simple_unit/SqlMap/domain/Document.php
+++ b/tests/simple_unit/SqlMap/domain/Document.php
@@ -12,5 +12,3 @@ class Document
public function setTitle($value){ $this->_Title = $value; }
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/DocumentCollection.php b/tests/simple_unit/SqlMap/domain/DocumentCollection.php
index c130db56..a2d5d89d 100644
--- a/tests/simple_unit/SqlMap/domain/DocumentCollection.php
+++ b/tests/simple_unit/SqlMap/domain/DocumentCollection.php
@@ -4,5 +4,3 @@ class DocumentCollection extends TList
{
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/E.php b/tests/simple_unit/SqlMap/domain/E.php
index 8473c156..c69c8027 100644
--- a/tests/simple_unit/SqlMap/domain/E.php
+++ b/tests/simple_unit/SqlMap/domain/E.php
@@ -12,5 +12,3 @@ class E
public function setLibelle($value){ $this->_Libelle = $value; }
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/F.php b/tests/simple_unit/SqlMap/domain/F.php
index 2bbbb2fb..159d8d63 100644
--- a/tests/simple_unit/SqlMap/domain/F.php
+++ b/tests/simple_unit/SqlMap/domain/F.php
@@ -12,5 +12,3 @@ class F
public function setLibelle($value){ $this->_Libelle = $value; }
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/LineItem.php b/tests/simple_unit/SqlMap/domain/LineItem.php
index f6908bbd..a989ab8b 100644
--- a/tests/simple_unit/SqlMap/domain/LineItem.php
+++ b/tests/simple_unit/SqlMap/domain/LineItem.php
@@ -28,5 +28,3 @@ class LineItem
public function setPictureData($value){ $this->_PictureData = $value; }
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/LineItemCollection.php b/tests/simple_unit/SqlMap/domain/LineItemCollection.php
index 8bc95622..1c31dca3 100644
--- a/tests/simple_unit/SqlMap/domain/LineItemCollection.php
+++ b/tests/simple_unit/SqlMap/domain/LineItemCollection.php
@@ -4,5 +4,3 @@ class LineItemCollection extends TList
{
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/Newspaper.php b/tests/simple_unit/SqlMap/domain/Newspaper.php
index 08716c6d..12ebce5b 100644
--- a/tests/simple_unit/SqlMap/domain/Newspaper.php
+++ b/tests/simple_unit/SqlMap/domain/Newspaper.php
@@ -8,5 +8,3 @@ class Newspaper extends Document
public function setCity($value){ $this->_City = $value; }
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/Order.php b/tests/simple_unit/SqlMap/domain/Order.php
index 312626fe..2b907ac6 100644
--- a/tests/simple_unit/SqlMap/domain/Order.php
+++ b/tests/simple_unit/SqlMap/domain/Order.php
@@ -67,5 +67,3 @@ class Order
public function setFavouriteLineItem($value){ $this->_FavouriteLineItem = $value; }
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/Other.php b/tests/simple_unit/SqlMap/domain/Other.php
index 9e78ab97..89f9d490 100644
--- a/tests/simple_unit/SqlMap/domain/Other.php
+++ b/tests/simple_unit/SqlMap/domain/Other.php
@@ -19,5 +19,3 @@ class Other
public function getLong(){ return $this->_Long; }
public function setLong($value){ $this->_Long = $value; }
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/Sample.php b/tests/simple_unit/SqlMap/domain/Sample.php
index e03be2df..f2a8951f 100644
--- a/tests/simple_unit/SqlMap/domain/Sample.php
+++ b/tests/simple_unit/SqlMap/domain/Sample.php
@@ -51,5 +51,3 @@ class Sample
public function getSequenceDate(){ return $this->_SequenceDate; }
public function setSequenceDate($value){ $this->_SequenceDate = $value; }
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/Search.php b/tests/simple_unit/SqlMap/domain/Search.php
index c01891a9..d2170044 100644
--- a/tests/simple_unit/SqlMap/domain/Search.php
+++ b/tests/simple_unit/SqlMap/domain/Search.php
@@ -19,5 +19,3 @@ class Search
public function getStartDateAnd(){ return $this->_StartDateAnd; }
public function setStartDateAnd($value){ $this->_StartDateAnd = $value; }
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/domain/User.php b/tests/simple_unit/SqlMap/domain/User.php
index b21712a3..1106d1e9 100644
--- a/tests/simple_unit/SqlMap/domain/User.php
+++ b/tests/simple_unit/SqlMap/domain/User.php
@@ -23,5 +23,3 @@ class User
public function getLastLogon(){ return $this->_LastLogon; }
public function setLastLogon($value){ $this->_LastLogon = $value; }
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/gen.php b/tests/simple_unit/SqlMap/gen.php
index 855172ba..40ddc297 100644
--- a/tests/simple_unit/SqlMap/gen.php
+++ b/tests/simple_unit/SqlMap/gen.php
@@ -29,5 +29,3 @@ function print_funcs($props)
echo $getter.$setter."\n";
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/queryForListLimitTest.php b/tests/simple_unit/SqlMap/queryForListLimitTest.php
index 349314a5..af550dcb 100644
--- a/tests/simple_unit/SqlMap/queryForListLimitTest.php
+++ b/tests/simple_unit/SqlMap/queryForListLimitTest.php
@@ -36,5 +36,3 @@ class queryForListLimitTest extends BaseCase
$this->assertEqual($list1[1][2],'Dalton');
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/TableGateway/BaseGatewayTest.php b/tests/simple_unit/TableGateway/BaseGatewayTest.php
index 98b236ee..f3117ed2 100644
--- a/tests/simple_unit/TableGateway/BaseGatewayTest.php
+++ b/tests/simple_unit/TableGateway/BaseGatewayTest.php
@@ -90,5 +90,4 @@ class BaseGatewayTest extends UnitTestCase
{
$this->getGateway()->deleteAll('1=1');
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/simple_unit/TableGateway/CountTest.php b/tests/simple_unit/TableGateway/CountTest.php
index 0e159ab0..97211e3c 100644
--- a/tests/simple_unit/TableGateway/CountTest.php
+++ b/tests/simple_unit/TableGateway/CountTest.php
@@ -12,5 +12,4 @@ class CountTest extends BaseGatewayTest
$result = $this->getGateway2()->count('department_id = ?', 1);
$this->assertEqual(4, $result);
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/simple_unit/TableGateway/DeleteByPkTest.php b/tests/simple_unit/TableGateway/DeleteByPkTest.php
index 57d9dd31..49b2d86c 100644
--- a/tests/simple_unit/TableGateway/DeleteByPkTest.php
+++ b/tests/simple_unit/TableGateway/DeleteByPkTest.php
@@ -48,5 +48,4 @@ class DeleteByPkTest extends BaseGatewayTest
$this->assertEqual(2, $deleted);
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/simple_unit/TableGateway/MagicCallTest.php b/tests/simple_unit/TableGateway/MagicCallTest.php
index 8d42fba8..87f9e785 100644
--- a/tests/simple_unit/TableGateway/MagicCallTest.php
+++ b/tests/simple_unit/TableGateway/MagicCallTest.php
@@ -27,5 +27,4 @@ class MagicCallTest extends BaseGatewayTest
$this->assertEqual(0, count($result));
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php b/tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php
index f34dcefc..96c9351d 100644
--- a/tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php
+++ b/tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php
@@ -52,5 +52,4 @@ class TableGatewayPgsqlTest extends BaseGatewayTest
$this->assertEqual($result['username'], 'record2');
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/simple_unit/TableGateway/TableInfoGatewayTest.php b/tests/simple_unit/TableGateway/TableInfoGatewayTest.php
index 51af7634..6c85248c 100644
--- a/tests/simple_unit/TableGateway/TableInfoGatewayTest.php
+++ b/tests/simple_unit/TableGateway/TableInfoGatewayTest.php
@@ -13,5 +13,4 @@ class TableInfoGatewayTest extends BaseGatewayTest
$table = new TTableGateway($info, $conn);
$this->assertEqual(count($table->findAll()->readAll()), 2);
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/simple_unit/TableGateway/TestFindByPk.php b/tests/simple_unit/TableGateway/TestFindByPk.php
index 5a7a081c..3756d35a 100644
--- a/tests/simple_unit/TableGateway/TestFindByPk.php
+++ b/tests/simple_unit/TableGateway/TestFindByPk.php
@@ -44,5 +44,4 @@ class TestFindByPk extends BaseGatewayTest
$this->assertEqual($expect, $result);
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/simple_unit/Tickets/Ticket589Test.php b/tests/simple_unit/Tickets/Ticket589Test.php
index 2fedda6f..487181ff 100644
--- a/tests/simple_unit/Tickets/Ticket589Test.php
+++ b/tests/simple_unit/Tickets/Ticket589Test.php
@@ -18,5 +18,3 @@ class Ticket589Test extends UnitTestCase
}
}
}
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/unit.php b/tests/simple_unit/unit.php
index 63910f68..b0e7874d 100644
--- a/tests/simple_unit/unit.php
+++ b/tests/simple_unit/unit.php
@@ -5,5 +5,3 @@ $test_cases = dirname(__FILE__)."/";
$tester = new PradoUnitTester($test_cases);
$tester->run(new HtmlReporter());
-
-?> \ No newline at end of file
diff --git a/tests/simple_unit/ws.php b/tests/simple_unit/ws.php
index 703235d1..9096183e 100644
--- a/tests/simple_unit/ws.php
+++ b/tests/simple_unit/ws.php
@@ -5,5 +5,3 @@ include_once './Soap/ContactManager.php';
$app = new TApplication('.');
$app->run();
-
-?> \ No newline at end of file
diff --git a/tests/test_tools/PradoGenericSelenium2Test.php b/tests/test_tools/PradoGenericSelenium2Test.php
new file mode 100755
index 00000000..23dfeb61
--- /dev/null
+++ b/tests/test_tools/PradoGenericSelenium2Test.php
@@ -0,0 +1,230 @@
+<?php
+require_once 'PHPUnit/Extensions/Selenium2TestCase.php';
+
+// TODO: stub
+class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase
+{
+ public static $browsers = array(
+/*
+ array(
+ 'name' => 'Firefox on OSX',
+ 'browserName' => '*firefox',
+ 'host' => '127.0.0.1',
+ 'port' => 4444,
+ ),
+*/
+ array(
+ 'name' => 'Chrome on OSX',
+ 'browserName' => 'chrome',
+ 'sessionStrategy' => 'shared',
+ 'host' => '127.0.0.1',
+ 'port' => 4444,
+ ),
+/*
+ array(
+ 'name' => 'Firefox on WindowsXP',
+ 'browserName' => '*firefox',
+ 'host' => '127.0.0.1',
+ 'port' => 4445,
+ ),
+ array(
+ 'name' => 'Internet Explorer 8 on WindowsXP',
+ 'browserName' => '*iehta',
+ 'host' => '127.0.0.1',
+ 'port' => 4445,
+ )
+*/
+ );
+
+ static $baseurl='http://127.0.0.1/prado-master/tests/FunctionalTests/';
+
+ static $timeout=5; //seconds
+
+ protected function setUp()
+ {
+ self::shareSession(true);
+ $this->setBrowserUrl(static::$baseurl);
+ $this->setSeleniumServerRequestsTimeout(static::$timeout);
+ }
+
+ protected function assertAttribute($idattr, $txt)
+ {
+ list($id, $attr) = explode('@', $idattr);
+
+ $element = $this->getElement($id);
+ $value=$element->attribute($attr);
+
+ if(strpos($txt, 'regexp:')===0)
+ {
+ $this->assertRegExp('/'.substr($txt, 7).'/', $value);
+ } else {
+ $this->assertEquals($txt, $value);
+ }
+ }
+
+ protected function getElement($id)
+ {
+ if(strpos($id, 'id=')===0) {
+ return $this->byId(substr($id, 3));
+ } elseif(strpos($id, 'name=')===0) {
+ return $this->byName(substr($id, 5));
+ } elseif(strpos($id, '//')===0) {
+ return $this->byXPath($id);
+ } elseif(strpos($id, '$')!==false) {
+ return $this->byName($id);
+ } else {
+ return $this->byId($id);
+ }
+ }
+
+ protected function assertText($id, $txt)
+ {
+ $this->assertEquals($txt, $this->getElement($id)->text());
+ }
+
+ protected function assertValue($id, $txt)
+ {
+ $this->assertEquals($txt, $this->getElement($id)->value());
+ }
+
+ protected function assertVisible($id)
+ {
+ $this->assertTrue($this->getElement($id)->displayed());
+ }
+
+ protected function assertNotVisible($id)
+ {
+ $this->assertFalse($this->getElement($id)->displayed());
+ }
+
+ protected function assertElementPresent($id)
+ {
+ $this->assertTrue($this->getElement($id)!==null);
+ }
+
+ protected function assertElementNotPresent($id)
+ {
+ try {
+ $el = $this->getElement($id);
+ } catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) {
+ $this->assertEquals(PHPUnit_Extensions_Selenium2TestCase_WebDriverException::NoSuchElement, $e->getCode());
+ return;
+ }
+ $this->fail('The element '.$id.' shouldn\'t exist.');
+ }
+
+ protected function type($id, $txt='')
+ {
+ $element = $this->getElement($id);
+ $element->clear();
+ $element->value($txt);
+ // trigger onblur() event
+ $this->byCssSelector('body')->click();
+ }
+
+ protected function typeSpecial($id, $txt='')
+ {
+ $element = $this->getElement($id);
+ // clear the textbox without using clear() that triggers onchange()
+ // the idea is to focus the input, move to the end of the text and hit
+ // backspace until the input is empty.
+ // on multiline textareas, line feeds can make this difficult, so we mix
+ // sequences of end+backspace and start+delete
+
+ $element->click();
+ while(strlen($element->value())>0)
+ {
+ $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::END);
+ // the number 100 is purely empiric
+ for($i=0;$i<100;$i++)
+ $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::BACKSPACE);
+
+ $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::HOME);
+ // the number 100 is purely empiric
+ for($i=0;$i<100;$i++)
+ $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::DELETE);
+ }
+
+ $element->value($txt);
+ // trigger onblur() event
+ $this->byCssSelector('body')->click();
+ }
+
+ protected function select($id, $value)
+ {
+ $select = parent::select($this->getElement($id));
+ $select->clearSelectedOptions();
+
+ $select->selectOptionByLabel($value);
+ }
+
+ protected function selectAndWait($id, $value)
+ {
+ $this->select($id, $value);
+ }
+
+ protected function addSelection($id, $value)
+ {
+ parent::select($this->getElement($id))->selectOptionByLabel($value);
+ }
+
+ protected function getSelectedLabels($id)
+ {
+ return parent::select($this->getElement($id))->selectedLabels();
+ }
+
+ protected function getSelectOptions($id)
+ {
+ return parent::select($this->getElement($id))->selectOptionLabels();
+ }
+
+ protected function assertSelectedIndex($id, $value)
+ {
+ $options=parent::select($this->getElement($id))->selectOptionValues();
+ $curval=parent::select($this->getElement($id))->selectedValue();
+
+ $i=0;
+ foreach($options as $option)
+ {
+ if($option==$curval)
+ {
+ $this->assertEquals($i, $value);
+ return;
+ }
+ $i++;
+ }
+ $this->fail('Current value '.$curval.' not found in: '.implode(',', $options));
+ }
+
+ protected function assertSelected($id, $label)
+ {
+ $this->assertSame($label, parent::select($this->getElement($id))->selectedLabel());
+ }
+
+ protected function assertNotSomethingSelected($id)
+ {
+ $this->assertSame(array(), $this->getSelectedLabels($id));
+ }
+
+ protected function assertSelectedValue($id, $index)
+ {
+ $this->assertSame($index, parent::select($this->getElement($id))->selectedValue());
+ }
+
+ protected function assertAlertNotPresent()
+ {
+ try {
+ $foo=$this->alertText();
+ } catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) {
+ $this->assertEquals(PHPUnit_Extensions_Selenium2TestCase_WebDriverException::NoAlertOpenError, $e->getCode());
+ return;
+ }
+ $this->fail('Failed asserting no alert is open');
+ }
+
+ protected function pause($msec)
+ {
+ usleep($msec*1000);
+ }
+
+} \ No newline at end of file
diff --git a/tests/test_tools/PradoGenericSeleniumTest.php b/tests/test_tools/PradoGenericSeleniumTest.php
deleted file mode 100644
index 2c9ceb21..00000000
--- a/tests/test_tools/PradoGenericSeleniumTest.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
-require_once 'PHPUnit/Extensions/Selenium2TestCase.php';
-
-class PradoGenericSeleniumTest extends PHPUnit_Extensions_SeleniumTestCase
-{
- static $browser='*googlechrome';
- static $baseurl='http://127.0.0.1/prado-3.2/tests/FunctionalTests/';
-
- protected function setUp()
- {
- $this->shareSession(true);
- $this->setBrowser(static::$browser);
- $this->setBrowserUrl(static::$baseurl);
- }
-
- protected function tearDown()
- {
- }
-}
-
-// TODO: stub
-class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase
-{
- static $browser='chrome';
- static $baseurl='http://127.0.0.1/prado-3.2/tests/FunctionalTests/';
-
- protected function setUp()
- {
- $this->setBrowser(static::$browser);
- $this->setBrowserUrl(static::$baseurl);
- }
-
- protected function open($url)
- {
- $this->setBrowserUrl(static::$baseurl.$url);
- }
-
- protected function tearDown()
- {
- }
-} \ No newline at end of file
diff --git a/tests/test_tools/README.txt b/tests/test_tools/README.txt
index cfa02abe..6bc3aa79 100644
--- a/tests/test_tools/README.txt
+++ b/tests/test_tools/README.txt
@@ -4,7 +4,7 @@ Functional tests are browser based that tests the overall functional of a Prado
=== Writing Tests ===
-Lets test some part of a Prado application. Create a new php file, e.g.
+Lets test some part of a Prado application. Create a new php file, e.g.
testExample1.php
@@ -21,11 +21,10 @@ class testExample1 extends SeleniumTestCase
{
//using xpath to find the button with value "Click Me!"
$this->click('//input[@value="Click Me!"]');
-
+
//..more commands and assertions
}
}
-?>
</php>
=== Tests as part of Example code ===
@@ -50,9 +49,9 @@ class testMyButtonExample extends SeleniumTestCase
{
//get the test page url
$page = Prado::getApplication()->getTestPage(__FILE__);
-
+
//open MyButtonExample page
- $this->open($page);
+ $this->open($page);
}
function testButtonClick()
@@ -62,7 +61,6 @@ class testMyButtonExample extends SeleniumTestCase
$this->click('//input[@value="Hello World!"]');
}
}
-?>
</php>
File: MyButtonExample.tpl
@@ -108,7 +106,7 @@ Select the element with the specified @id attribute. If no match is found, sele
Find an element using JavaScript traversal of the HTML Document Object Model. DOM locators ''must'' begin with "document.".
* dom=document.forms['myForm'].myDropdown
* dom=document.images[56]
-
+
==== '''xpath='''''xpathExpression''====
Locate an element using an XPath expression. XPath locators ''must'' begin with "//".
* xpath=//img[@alt='The image alt text']
@@ -133,15 +131,15 @@ Select Option Specifiers provide different ways of specifying options of an HTML
matches options based on their labels, i.e. the visible text.
* label=regexp:^[Oo]ther
-==== value=valuePattern ====
+==== value=valuePattern ====
matches options based on their values.
* value=other
-==== id=id ====
+==== id=id ====
matches options based on their ids.
* id=option1
-==== index=index ====
+==== index=index ====
matches an option based on its index (offset from zero).
* index=2
@@ -174,8 +172,8 @@ Selenium Actions
examples:
- open /mypage
- open http://localhost/
+ open /mypage
+ open http://localhost/
click( elementLocator )
@@ -183,9 +181,9 @@ Selenium Actions
examples:
- click aCheckbox
- clickAndWait submitButton
- clickAndWait anyLink
+ click aCheckbox
+ clickAndWait submitButton
+ clickAndWait anyLink
note:
Selenium will always automatically click on a popup dialog raised by the alert() or confirm() methods. (The exception is those raised during 'onload', which are not yet handled by Selenium). You must use [verify|assert]Alert or [verify|assert]Confirmation to tell Selenium that you expect the popup dialog. You may use chooseCancelOnNextConfirmation to click 'cancel' on the next confirmation dialog instead of clicking 'OK'.
@@ -222,8 +220,8 @@ Selenium Actions
examples:
- selectWindow myPopupWindow
- selectWindow null
+ selectWindow myPopupWindow
+ selectWindow null
goBack()
@@ -231,7 +229,7 @@ Selenium Actions
examples:
- goBack
+ goBack
close()
@@ -239,7 +237,7 @@ Selenium Actions
examples:
- close
+ close
pause( milliseconds )
@@ -247,8 +245,8 @@ Selenium Actions
examples:
- pause 5000
- pause 2000
+ pause 5000
+ pause 2000
fireEvent( elementLocator, eventName )
@@ -310,7 +308,7 @@ Selenium Actions
examples:
- chooseCancelOnNextConfirmation
+ chooseCancelOnNextConfirmation
answerOnNextPrompt( answerString )
@@ -318,7 +316,7 @@ Selenium Actions
examples:
- answerOnNextPrompt Kangaroo
+ answerOnNextPrompt Kangaroo
Selenium Checks
@@ -330,8 +328,8 @@ Selenium Checks
examples:
- verifyLocation /mypage
- assertLocation /mypage
+ verifyLocation /mypage
+ assertLocation /mypage
assertTitle( titlePattern )
@@ -339,8 +337,8 @@ Selenium Checks
examples:
- verifyTitle My Page
- assertTitle My Page
+ verifyTitle My Page
+ assertTitle My Page
assertValue( inputLocator, valuePattern )
@@ -396,8 +394,8 @@ Selenium Checks
examples:
- verifyTextPresent You are now logged in.
- assertTextPresent You are now logged in.
+ verifyTextPresent You are now logged in.
+ assertTextPresent You are now logged in.
assertTextNotPresent( text )
@@ -409,8 +407,8 @@ Selenium Checks
examples:
- verifyElementPresent submitButton
- assertElementPresent //img[@alt='foo']
+ verifyElementPresent submitButton
+ assertElementPresent //img[@alt='foo']
assertElementNotPresent( elementLocator )
@@ -418,8 +416,8 @@ Selenium Checks
examples:
- verifyElementNotPresent cancelButton
- assertElementNotPresent cancelButton
+ verifyElementNotPresent cancelButton
+ assertElementNotPresent cancelButton
assertTable( cellAddress, valuePattern )
@@ -436,8 +434,8 @@ Selenium Checks
examples:
- verifyVisible postcode
- assertVisible postcode
+ verifyVisible postcode
+ assertVisible postcode
assertNotVisible( elementLocator )
@@ -445,8 +443,8 @@ Selenium Checks
examples:
- verifyNotVisible postcode
- assertNotVisible postcode
+ verifyNotVisible postcode
+ assertNotVisible postcode
verifyEditable / assertEditable( inputLocator )
@@ -454,8 +452,8 @@ Selenium Checks
examples:
- verifyEditable shape
- assertEditable colour
+ verifyEditable shape
+ assertEditable colour
assertNotEditable( inputLocator )
@@ -473,8 +471,8 @@ Selenium Checks
examples:
- verifyAlert Invalid Phone Number
- assertAlert Invalid Phone Number
+ verifyAlert Invalid Phone Number
+ assertAlert Invalid Phone Number
assertConfirmation( messagePattern )
@@ -488,8 +486,8 @@ Selenium Checks
examples:
- assertConfirmation Remove this user?
- verifyConfirmation Are you sure?
+ assertConfirmation Remove this user?
+ verifyConfirmation Are you sure?
assertPrompt( messagePattern )
@@ -499,9 +497,9 @@ Selenium Checks
examples:
- answerOnNextPrompt Joe
- click id=delegate
- verifyPrompt Delegate to who?
+ answerOnNextPrompt Joe
+ click id=delegate
+ verifyPrompt Delegate to who?
Parameter construction and Variables
diff --git a/tests/test_tools/phpunit_bootstrap.php b/tests/test_tools/phpunit_bootstrap.php
index 1154e5fc..c1cb423f 100644
--- a/tests/test_tools/phpunit_bootstrap.php
+++ b/tests/test_tools/phpunit_bootstrap.php
@@ -13,6 +13,8 @@ set_include_path(PRADO_FRAMEWORK_DIR.PATH_SEPARATOR.get_include_path());
// coverage tests waste a lot of memory!
ini_set('memory_limit', '1G');
+date_default_timezone_set('UTC');
+
if (!@include_once VENDOR_DIR.'/autoload.php') {
die('You must set up the project dependencies, run the following commands:
wget http://getcomposer.org/composer.phar
@@ -22,4 +24,4 @@ if (!@include_once VENDOR_DIR.'/autoload.php') {
require_once(PRADO_FRAMEWORK_DIR.'/prado.php');
// for FunctionalTests
-require_once(__DIR__.'/PradoGenericSeleniumTest.php'); \ No newline at end of file
+require_once(__DIR__.'/PradoGenericSelenium2Test.php'); \ No newline at end of file
diff --git a/tests/test_tools/simpletest/HtmlReporterWithCoverage.php b/tests/test_tools/simpletest/HtmlReporterWithCoverage.php
index abd10076..f3ae2391 100644
--- a/tests/test_tools/simpletest/HtmlReporterWithCoverage.php
+++ b/tests/test_tools/simpletest/HtmlReporterWithCoverage.php
@@ -1,11 +1,11 @@
<?php
-if (!defined('T_ML_COMMENT'))
+if (!defined('T_ML_COMMENT'))
define('T_ML_COMMENT', T_COMMENT);
-else
+else
define('T_DOC_COMMENT', T_ML_COMMENT);
-class HtmlReporterWithCoverage extends HtmlReporter
+class HtmlReporterWithCoverage extends HtmlReporter
{
protected $coverage = array();
@@ -19,7 +19,7 @@ class HtmlReporterWithCoverage extends HtmlReporter
$this->base_dir = $base_dir;
}
- function paintHeader($test_name, $charset="UTF-8")
+ function paintHeader($test_name, $charset="UTF-8")
{
$this->sendNoCacheHeaders();
header('Content-Type: text/html; Charset='.$charset);
@@ -31,30 +31,30 @@ class HtmlReporterWithCoverage extends HtmlReporter
print "</head>\n<body>\n";
print "<h1>$test_name</h1>\n";
flush();
-
- if (extension_loaded('xdebug'))
+
+ if (extension_loaded('xdebug'))
xdebug_start_code_coverage(XDEBUG_CC_UNUSED);
- }
+ }
/**
*
*/
- function _getCss()
+ function _getCss()
{
$contents = parent::_getCss()."\n ";
$contents .= '
- .bar { float: left; display: inline; border: 1px solid #eee; width: 300px; white-space: nowrap;}
- .percentage { float: left; background-color: #eef; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 0.65em; padding: 5px; margin-right: }
- .coverage {margin: 0.4em; }
+ .bar { float: left; display: inline; border: 1px solid #eee; width: 300px; white-space: nowrap;}
+ .percentage { float: left; background-color: #eef; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 0.65em; padding: 5px; margin-right: }
+ .coverage {margin: 0.4em; }
.coverage a {
padding-left: 0.5em;
}
- .coverage:after {
- content: ".";
- display: block;
- height: 0;
- clear: both;
+ .coverage:after {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
visibility: hidden;
}
.coverage {display: inline-block;}
@@ -66,9 +66,9 @@ class HtmlReporterWithCoverage extends HtmlReporter
Return $contents;
}
- function paintFooter($test_name)
+ function paintFooter($test_name)
{
- if (extension_loaded('xdebug'))
+ if (extension_loaded('xdebug'))
{
$this->coverage = xdebug_get_code_coverage();
xdebug_stop_code_coverage();
@@ -93,10 +93,10 @@ class HtmlReporterWithCoverage extends HtmlReporter
$dir = dirname(__FILE__);
if(count($this->coverage) > 0)
print '<h2>Code Coverage</h2>';
-
-
- ksort($this->coverage);
-
+
+
+ ksort($this->coverage);
+
$details = array();
foreach($this->coverage as $file => $coverage)
{
@@ -110,7 +110,7 @@ class HtmlReporterWithCoverage extends HtmlReporter
$width = $percentage * 3;
$filename = str_replace($this->base_dir, '',$file);
$link = $this->constructURL($filename, $coverage);
-
+
$detail['total'] = $total;
$detail['executed'] = $executed;
$detail['width'] = $width;
@@ -150,7 +150,7 @@ class HtmlReporterWithCoverage extends HtmlReporter
}
-class HTMLCoverageReport extends HtmlReporter
+class HTMLCoverageReport extends HtmlReporter
{
protected $file;
protected $lines;
@@ -184,7 +184,7 @@ class HTMLCoverageReport extends HtmlReporter
$this->paintFooter();
}
- function paintHeader($file, $charset="UTF-8")
+ function paintHeader($file, $charset="UTF-8")
{
$total = $this->codelines($this->file);
$executed = count($this->lines);
@@ -218,21 +218,21 @@ class HTMLCoverageReport extends HtmlReporter
$lines = '';
- foreach ($tokens as $token)
+ foreach ($tokens as $token)
{
- if (is_string($token))
+ if (is_string($token))
{
// simple 1-character token
$lines .= $token;
- }
- else
+ }
+ else
{
// token array
list($id, $text) = $token;
- switch ($id)
- {
- case T_COMMENT:
+ switch ($id)
+ {
+ case T_COMMENT:
case T_ML_COMMENT: // we've defined this
case T_DOC_COMMENT: // and this
// no action on comments
@@ -265,4 +265,3 @@ class HTMLCoverageReport extends HtmlReporter
}
}
-?>
diff --git a/tests/test_tools/simpletest/authentication.php b/tests/test_tools/simpletest/authentication.php
index cae366b3..86b68402 100644
--- a/tests/test_tools/simpletest/authentication.php
+++ b/tests/test_tools/simpletest/authentication.php
@@ -234,5 +234,4 @@
'Authorization: Basic ' . base64_encode("$username:$password"));
}
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/browser.php b/tests/test_tools/simpletest/browser.php
index 44c8ddd4..410b18b9 100644
--- a/tests/test_tools/simpletest/browser.php
+++ b/tests/test_tools/simpletest/browser.php
@@ -220,7 +220,7 @@
function useFrames() {
$this->_ignore_frames = false;
}
-
+
/**
* Switches off cookie sending and recieving.
* @access public
@@ -228,7 +228,7 @@
function ignoreCookies() {
$this->_user_agent->ignoreCookies();
}
-
+
/**
* Switches back on the cookie sending and recieving.
* @access public
@@ -257,7 +257,7 @@
}
return $frameset;
}
-
+
/**
* Assembles the parsing machinery and actually parses
* a single page. Frees all of the builder memory and so
@@ -1053,5 +1053,4 @@
}
return $raw;
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/collector.php b/tests/test_tools/simpletest/collector.php
index 5bcde179..ded847c9 100644
--- a/tests/test_tools/simpletest/collector.php
+++ b/tests/test_tools/simpletest/collector.php
@@ -1,12 +1,11 @@
<?php
/**
- * This file contains the following classes: {@link SimpleCollector},
+ * This file contains the following classes: {@link SimpleCollector},
* {@link SimplePatternCollector}.
- *
+ *
* @author Travis Swicegood <development@domain51.com>
* @package SimpleTest
* @subpackage UnitTester
- * @version $Id: collector.php 1398 2006-09-08 19:31:03Z xue $
*/
/**
@@ -17,7 +16,7 @@
* @subpackage UnitTester
*/
class SimpleCollector {
-
+
/**
* Strips off any kind of slash at the end so as to normalise the path
*
@@ -25,12 +24,12 @@ class SimpleCollector {
*/
function _removeTrailingSlash($path) {
return preg_replace('|[\\/]$|', '', $path);
-
+
/**
* @internal
* Try benchmarking the following. It's more code, but by not using the
- * regex, it may be faster? Also, shouldn't be looking for
- * DIRECTORY_SEPERATOR instead of a manual "/"?
+ * regex, it may be faster? Also, shouldn't be looking for
+ * DIRECTORY_SEPERATOR instead of a manual "/"?
*/
if (substr($path, -1) == DIRECTORY_SEPERATOR) {
return substr($path, 0, -1);
@@ -54,12 +53,12 @@ class SimpleCollector {
closedir($handle);
}
}
-
+
/**
* This method determines what should be done with a given file and adds
* it via {@link GroupTest::addTestFile()} if necessary.
*
- * This method should be overriden to provide custom matching criteria,
+ * This method should be overriden to provide custom matching criteria,
* such as pattern matching, recursive matching, etc. For an example, see
* {@link SimplePatternCollector::_handle()}.
*
@@ -85,8 +84,8 @@ class SimpleCollector {
*/
class SimplePatternCollector extends SimpleCollector {
protected $_pattern;
-
-
+
+
/**
*
* @param string $pattern Perl compatible regex to test name against
@@ -96,8 +95,8 @@ class SimplePatternCollector extends SimpleCollector {
function SimplePatternCollector($pattern = '/php$/i') {
$this->_pattern = $pattern;
}
-
-
+
+
/**
* Attempts to add files that match a given pattern.
*
@@ -111,5 +110,4 @@ class SimplePatternCollector extends SimpleCollector {
parent::_handle($test, $filename);
}
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/test_tools/simpletest/compatibility.php b/tests/test_tools/simpletest/compatibility.php
index 92cf70d3..a181793e 100644
--- a/tests/test_tools/simpletest/compatibility.php
+++ b/tests/test_tools/simpletest/compatibility.php
@@ -181,4 +181,3 @@
return array();
}
}
-?>
diff --git a/tests/test_tools/simpletest/cookies.php b/tests/test_tools/simpletest/cookies.php
index 4a2b0d4e..eba8776e 100644
--- a/tests/test_tools/simpletest/cookies.php
+++ b/tests/test_tools/simpletest/cookies.php
@@ -11,7 +11,7 @@
*/
require_once(dirname(__FILE__) . '/url.php');
/**#@-*/
-
+
/**
* Cookie data holder. Cookie rules are full of pretty
* arbitary stuff. I have used...
@@ -27,7 +27,7 @@
protected $_path;
protected $_expiry;
protected $_is_secure;
-
+
/**
* Constructor. Sets the stored values.
* @param string $name Cookie key.
@@ -49,7 +49,7 @@
}
$this->_is_secure = $is_secure;
}
-
+
/**
* Sets the host. The cookie rules determine
* that the first two parts are taken for
@@ -67,7 +67,7 @@
}
return false;
}
-
+
/**
* Accessor for the truncated host to which this
* cookie applies.
@@ -77,7 +77,7 @@
function getHost() {
return $this->_host;
}
-
+
/**
* Test for a cookie being valid for a host name.
* @param string $host Host to test against.
@@ -87,7 +87,7 @@
function isValidHost($host) {
return ($this->_truncateHost($host) === $this->getHost());
}
-
+
/**
* Extracts just the domain part that determines a
* cookie's host validity.
@@ -104,7 +104,7 @@
}
return false;
}
-
+
/**
* Accessor for name.
* @return string Cookie key.
@@ -113,7 +113,7 @@
function getName() {
return $this->_name;
}
-
+
/**
* Accessor for value. A deleted cookie will
* have an empty string for this.
@@ -123,7 +123,7 @@
function getValue() {
return $this->_value;
}
-
+
/**
* Accessor for path.
* @return string Valid cookie path.
@@ -132,7 +132,7 @@
function getPath() {
return $this->_path;
}
-
+
/**
* Tests a path to see if the cookie applies
* there. The test path must be longer or
@@ -147,7 +147,7 @@
$this->getPath(),
strlen($this->getPath())) == 0);
}
-
+
/**
* Accessor for expiry.
* @return string Expiry string.
@@ -159,7 +159,7 @@
}
return gmdate("D, d M Y H:i:s", $this->_expiry) . " GMT";
}
-
+
/**
* Test to see if cookie is expired against
* the cookie format time or timestamp.
@@ -180,7 +180,7 @@
}
return ($this->_expiry < $now);
}
-
+
/**
* Ages the cookie by the specified number of
* seconds.
@@ -192,7 +192,7 @@
$this->_expiry -= $interval;
}
}
-
+
/**
* Accessor for the secure flag.
* @return boolean True if cookie needs SSL.
@@ -201,7 +201,7 @@
function isSecure() {
return $this->_is_secure;
}
-
+
/**
* Adds a trailing and leading slash to the path
* if missing.
@@ -218,7 +218,7 @@
return $path;
}
}
-
+
/**
* Repository for cookies. This stuff is a
* tiny bit browser dependent.
@@ -227,7 +227,7 @@
*/
class SimpleCookieJar {
protected $_cookies;
-
+
/**
* Constructor. Jar starts empty.
* @access public
@@ -235,7 +235,7 @@
function SimpleCookieJar() {
$this->_cookies = array();
}
-
+
/**
* Removes expired and temporary cookies as if
* the browser was closed and re-opened.
@@ -258,7 +258,7 @@
}
$this->_cookies = $surviving_cookies;
}
-
+
/**
* Ages all cookies in the cookie jar.
* @param integer $interval The old session is moved
@@ -272,7 +272,7 @@
$this->_cookies[$i]->agePrematurely($interval);
}
}
-
+
/**
* Sets an additional cookie. If a cookie has
* the same name and path it is replaced.
@@ -290,7 +290,7 @@
}
$this->_cookies[$this->_findFirstMatch($cookie)] = $cookie;
}
-
+
/**
* Finds a matching cookie to write over or the
* first empty slot if none.
@@ -311,7 +311,7 @@
}
return count($this->_cookies);
}
-
+
/**
* Reads the most specific cookie value from the
* browser cookies. Looks for the longest path that
@@ -335,7 +335,7 @@
}
return (isset($value) ? $value : false);
}
-
+
/**
* Tests cookie for matching against search
* criteria.
@@ -359,7 +359,7 @@
}
return true;
}
-
+
/**
* Uses a URL to sift relevant cookies by host and
* path. Results are list of strings of form "name=value".
@@ -376,5 +376,4 @@
}
return $pairs;
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/detached.php b/tests/test_tools/simpletest/detached.php
index 1f3638bb..06665781 100644
--- a/tests/test_tools/simpletest/detached.php
+++ b/tests/test_tools/simpletest/detached.php
@@ -92,5 +92,4 @@
function &_createParser($reporter) {
return new SimpleTestXmlParser($reporter);
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/dumper.php b/tests/test_tools/simpletest/dumper.php
index a2ea30b0..9c3f745a 100644
--- a/tests/test_tools/simpletest/dumper.php
+++ b/tests/test_tools/simpletest/dumper.php
@@ -398,5 +398,4 @@
}
return false;
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/encoding.php b/tests/test_tools/simpletest/encoding.php
index 0dc9fbfa..ca2083a3 100644
--- a/tests/test_tools/simpletest/encoding.php
+++ b/tests/test_tools/simpletest/encoding.php
@@ -5,7 +5,7 @@
* @subpackage WebTester
* @version $Id: encoding.php 1398 2006-09-08 19:31:03Z xue $
*/
-
+
/**#@+
* include other SimpleTest class files
*/
@@ -20,7 +20,7 @@
class SimpleEncodedPair {
protected $_key;
protected $_value;
-
+
/**
* Stashes the data for rendering later.
* @param string $key Form element name.
@@ -30,7 +30,7 @@
$this->_key = $key;
$this->_value = $value;
}
-
+
/**
* The pair as a single string.
* @return string Encoded pair.
@@ -39,7 +39,7 @@
function asRequest() {
return $this->_key . '=' . urlencode($this->_value);
}
-
+
/**
* The MIME part as a string.
* @return string MIME part encoding.
@@ -51,7 +51,7 @@
$part .= "\r\n" . $this->_value;
return $part;
}
-
+
/**
* Is this the value we are looking for?
* @param string $key Identifier.
@@ -61,7 +61,7 @@
function isKey($key) {
return $key == $this->_key;
}
-
+
/**
* Is this the value we are looking for?
* @return string Identifier.
@@ -70,7 +70,7 @@
function getKey() {
return $this->_key;
}
-
+
/**
* Is this the value we are looking for?
* @return string Content.
@@ -90,7 +90,7 @@
protected $_key;
protected $_content;
protected $_filename;
-
+
/**
* Stashes the data for rendering later.
* @param string $key Key to add value to.
@@ -102,7 +102,7 @@
$this->_content = $content;
$this->_filename = $filename;
}
-
+
/**
* The pair as a single string.
* @return string Encoded pair.
@@ -111,7 +111,7 @@
function asRequest() {
return '';
}
-
+
/**
* The MIME part as a string.
* @return string MIME part encoding.
@@ -125,7 +125,7 @@
$part .= "\r\n\r\n" . $this->_content;
return $part;
}
-
+
/**
* Attempts to figure out the MIME type from the
* file extension and the content.
@@ -138,7 +138,7 @@
}
return 'application/octet-stream';
}
-
+
/**
* Tests each character is in the range 0-127.
* @param string $ascii String to test.
@@ -152,7 +152,7 @@
}
return true;
}
-
+
/**
* Is this the value we are looking for?
* @param string $key Identifier.
@@ -162,7 +162,7 @@
function isKey($key) {
return $key == $this->_key;
}
-
+
/**
* Is this the value we are looking for?
* @return string Identifier.
@@ -171,7 +171,7 @@
function getKey() {
return $this->_key;
}
-
+
/**
* Is this the value we are looking for?
* @return string Content.
@@ -190,7 +190,7 @@
*/
class SimpleEncoding {
protected $_request;
-
+
/**
* Starts empty.
* @param array $query Hash of parameters.
@@ -205,7 +205,7 @@
$this->clear();
$this->merge($query);
}
-
+
/**
* Empties the request of parameters.
* @access public
@@ -213,7 +213,7 @@
function clear() {
$this->_request = array();
}
-
+
/**
* Adds a parameter to the query.
* @param string $key Key to add value to.
@@ -232,7 +232,7 @@
$this->_addPair($key, $value);
}
}
-
+
/**
* Adds a new value into the request.
* @param string $key Key to add value to.
@@ -242,7 +242,7 @@
function _addPair($key, $value) {
$this->_request[] = new SimpleEncodedPair($key, $value);
}
-
+
/**
* Adds a MIME part to the query. Does nothing for a
* form encoded packet.
@@ -254,7 +254,7 @@
function attach($key, $content, $filename) {
$this->_request[] = new SimpleAttachment($key, $content, $filename);
}
-
+
/**
* Adds a set of parameters to this query.
* @param array/SimpleQueryString $query Multiple values are
@@ -270,7 +270,7 @@
}
}
}
-
+
/**
* Accessor for single value.
* @return string/array False if missing, string
@@ -293,7 +293,7 @@
return $values;
}
}
-
+
/**
* Accessor for listing of pairs.
* @return array All pair objects.
@@ -302,7 +302,7 @@
function getAll() {
return $this->_request;
}
-
+
/**
* Renders the query string as a URL encoded
* request part.
@@ -319,7 +319,7 @@
return implode('&', $statements);
}
}
-
+
/**
* Bundle of GET parameters. Can include
* repeated parameters.
@@ -327,7 +327,7 @@
* @subpackage WebTester
*/
class SimpleGetEncoding extends SimpleEncoding {
-
+
/**
* Starts empty.
* @param array $query Hash of parameters.
@@ -338,7 +338,7 @@
function SimpleGetEncoding($query = false) {
$this->SimpleEncoding($query);
}
-
+
/**
* HTTP request method.
* @return string Always GET.
@@ -347,7 +347,7 @@
function getMethod() {
return 'GET';
}
-
+
/**
* Writes no extra headers.
* @param SimpleSocket $socket Socket to write to.
@@ -355,7 +355,7 @@
*/
function writeHeadersTo($socket) {
}
-
+
/**
* No data is sent to the socket as the data is encoded into
* the URL.
@@ -364,7 +364,7 @@
*/
function writeTo($socket) {
}
-
+
/**
* Renders the query string as a URL encoded
* request part for attaching to a URL.
@@ -375,14 +375,14 @@
return $this->_encode();
}
}
-
+
/**
* Bundle of URL parameters for a HEAD request.
* @package SimpleTest
* @subpackage WebTester
*/
class SimpleHeadEncoding extends SimpleGetEncoding {
-
+
/**
* Starts empty.
* @param array $query Hash of parameters.
@@ -393,7 +393,7 @@
function SimpleHeadEncoding($query = false) {
$this->SimpleGetEncoding($query);
}
-
+
/**
* HTTP request method.
* @return string Always HEAD.
@@ -403,7 +403,7 @@
return 'HEAD';
}
}
-
+
/**
* Bundle of POST parameters. Can include
* repeated parameters.
@@ -411,7 +411,7 @@
* @subpackage WebTester
*/
class SimplePostEncoding extends SimpleEncoding {
-
+
/**
* Starts empty.
* @param array $query Hash of parameters.
@@ -422,7 +422,7 @@
function SimplePostEncoding($query = false) {
$this->SimpleEncoding($query);
}
-
+
/**
* HTTP request method.
* @return string Always POST.
@@ -431,7 +431,7 @@
function getMethod() {
return 'POST';
}
-
+
/**
* Dispatches the form headers down the socket.
* @param SimpleSocket $socket Socket to write to.
@@ -441,7 +441,7 @@
$socket->write("Content-Length: " . (integer)strlen($this->_encode()) . "\r\n");
$socket->write("Content-Type: application/x-www-form-urlencoded\r\n");
}
-
+
/**
* Dispatches the form data down the socket.
* @param SimpleSocket $socket Socket to write to.
@@ -450,7 +450,7 @@
function writeTo($socket) {
$socket->write($this->_encode());
}
-
+
/**
* Renders the query string as a URL encoded
* request part for attaching to a URL.
@@ -461,7 +461,7 @@
return '';
}
}
-
+
/**
* Bundle of POST parameters in the multipart
* format. Can include file uploads.
@@ -470,7 +470,7 @@
*/
class SimpleMultipartEncoding extends SimplePostEncoding {
protected $_boundary;
-
+
/**
* Starts empty.
* @param array $query Hash of parameters.
@@ -482,7 +482,7 @@
$this->SimplePostEncoding($query);
$this->_boundary = ($boundary === false ? uniqid('st') : $boundary);
}
-
+
/**
* Dispatches the form headers down the socket.
* @param SimpleSocket $socket Socket to write to.
@@ -492,7 +492,7 @@
$socket->write("Content-Length: " . (integer)strlen($this->_encode()) . "\r\n");
$socket->write("Content-Type: multipart/form-data, boundary=" . $this->_boundary . "\r\n");
}
-
+
/**
* Dispatches the form data down the socket.
* @param SimpleSocket $socket Socket to write to.
@@ -501,7 +501,7 @@
function writeTo($socket) {
$socket->write($this->_encode());
}
-
+
/**
* Renders the query string as a URL encoded
* request part.
@@ -517,5 +517,4 @@
$stream .= "--" . $this->_boundary . "--\r\n";
return $stream;
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/errors.php b/tests/test_tools/simpletest/errors.php
index a756bd7c..c10d68a5 100644
--- a/tests/test_tools/simpletest/errors.php
+++ b/tests/test_tools/simpletest/errors.php
@@ -178,5 +178,4 @@
$queue->add($severity, $message, $filename, $line, $super_globals);
set_error_handler('simpleTestErrorHandler');
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/exceptions.php b/tests/test_tools/simpletest/exceptions.php
index 63558ad1..30d35386 100644
--- a/tests/test_tools/simpletest/exceptions.php
+++ b/tests/test_tools/simpletest/exceptions.php
@@ -42,5 +42,4 @@
$test_case->exception($exception);
}
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/expectation.php b/tests/test_tools/simpletest/expectation.php
index 8513aff4..a660fa9c 100644
--- a/tests/test_tools/simpletest/expectation.php
+++ b/tests/test_tools/simpletest/expectation.php
@@ -717,4 +717,3 @@
"] should contain method [$method]";
}
}
-?>
diff --git a/tests/test_tools/simpletest/form.php b/tests/test_tools/simpletest/form.php
index 0e6aea14..fba26bf6 100644
--- a/tests/test_tools/simpletest/form.php
+++ b/tests/test_tools/simpletest/form.php
@@ -5,7 +5,7 @@
* @subpackage WebTester
* @version $Id: form.php 1398 2006-09-08 19:31:03Z xue $
*/
-
+
/**#@+
* include SimpleTest files
*/
@@ -13,7 +13,7 @@
require_once(dirname(__FILE__) . '/encoding.php');
require_once(dirname(__FILE__) . '/selector.php');
/**#@-*/
-
+
/**
* Form tag class to hold widget values.
* @package SimpleTest
@@ -30,7 +30,7 @@
protected $_widgets;
protected $_radios;
protected $_checkboxes;
-
+
/**
* Starts with no held controls/widgets.
* @param SimpleTag $tag Form tag to read.
@@ -48,7 +48,7 @@
$this->_radios = array();
$this->_checkboxes = array();
}
-
+
/**
* Creates the request packet to be sent by the form.
* @param SimpleTag $tag Form tag to read.
@@ -64,7 +64,7 @@
}
return 'SimpleGetEncoding';
}
-
+
/**
* Sets the frame target within a frameset.
* @param string $frame Name of frame.
@@ -73,7 +73,7 @@
function setDefaultTarget($frame) {
$this->_default_target = $frame;
}
-
+
/**
* Accessor for method of form submission.
* @return string Either get or post.
@@ -82,7 +82,7 @@
function getMethod() {
return ($this->_method ? strtolower($this->_method) : 'get');
}
-
+
/**
* Combined action attribute with current location
* to get an absolute form target.
@@ -97,7 +97,7 @@
$url = new SimpleUrl($action);
return $url->makeAbsolute($base);
}
-
+
/**
* Absolute URL of the target.
* @return SimpleUrl URL target.
@@ -110,7 +110,7 @@
}
return $url;
}
-
+
/**
* Creates the encoding for the current values in the
* form.
@@ -125,7 +125,7 @@
}
return $encoding;
}
-
+
/**
* ID field of form for unique identification.
* @return string Unique tag ID.
@@ -134,7 +134,7 @@
function getId() {
return $this->_id;
}
-
+
/**
* Adds a tag contents to the form.
* @param SimpleWidget $tag Input tag to add.
@@ -149,7 +149,7 @@
$this->_setWidget($tag);
}
}
-
+
/**
* Sets the widget into the form, grouping radio
* buttons if any.
@@ -165,7 +165,7 @@
$this->_widgets[] = $tag;
}
}
-
+
/**
* Adds a radio button, building a group if necessary.
* @param SimpleRadioButtonTag $tag Incoming form control.
@@ -178,7 +178,7 @@
}
$this->_widgets[$this->_radios[$tag->getName()]]->addWidget($tag);
}
-
+
/**
* Adds a checkbox, making it a group on a repeated name.
* @param SimpleCheckboxTag $tag Incoming form control.
@@ -198,7 +198,7 @@
$this->_widgets[$index]->addWidget($tag);
}
}
-
+
/**
* Extracts current value from form.
* @param SimpleSelector $selector Criteria to apply.
@@ -219,7 +219,7 @@
}
return null;
}
-
+
/**
* Sets a widget value within the form.
* @param SimpleSelector $selector Criteria to apply.
@@ -240,7 +240,7 @@
}
return $success;
}
-
+
/**
* Used by the page object to set widgets labels to
* external label tags.
@@ -257,7 +257,7 @@
}
}
}
-
+
/**
* Test to see if a form has a submit button.
* @param SimpleSelector $selector Criteria to apply.
@@ -272,7 +272,7 @@
}
return false;
}
-
+
/**
* Test to see if a form has an image control.
* @param SimpleSelector $selector Criteria to apply.
@@ -287,7 +287,7 @@
}
return false;
}
-
+
/**
* Gets the submit values for a selected button.
* @param SimpleSelector $selector Criteria to apply.
@@ -306,12 +306,12 @@
if ($additional) {
$encoding->merge($additional);
}
- return $encoding;
+ return $encoding;
}
}
return false;
}
-
+
/**
* Gets the submit values for an image.
* @param SimpleSelector $selector Criteria to apply.
@@ -332,12 +332,12 @@
if ($additional) {
$encoding->merge($additional);
}
- return $encoding;
+ return $encoding;
}
}
return false;
}
-
+
/**
* Simply submits the form without the submit button
* value. Used when there is only one button or it
@@ -349,4 +349,3 @@
return $this->_encode();
}
}
-?>
diff --git a/tests/test_tools/simpletest/frames.php b/tests/test_tools/simpletest/frames.php
index 60ced141..86e03157 100644
--- a/tests/test_tools/simpletest/frames.php
+++ b/tests/test_tools/simpletest/frames.php
@@ -584,5 +584,4 @@
}
return null;
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/http.php b/tests/test_tools/simpletest/http.php
index 9344a5b9..78c91b7e 100644
--- a/tests/test_tools/simpletest/http.php
+++ b/tests/test_tools/simpletest/http.php
@@ -13,7 +13,7 @@
require_once(dirname(__FILE__) . '/cookies.php');
require_once(dirname(__FILE__) . '/url.php');
/**#@-*/
-
+
/**
* Creates HTTP headers for the end point of
* a HTTP request.
@@ -22,7 +22,7 @@
*/
class SimpleRoute {
protected $_url;
-
+
/**
* Sets the target URL.
* @param SimpleUrl $url URL as object.
@@ -31,7 +31,7 @@
function SimpleRoute($url) {
$this->_url = $url;
}
-
+
/**
* Resource name.
* @return SimpleUrl Current url.
@@ -40,7 +40,7 @@
function getUrl() {
return $this->_url;
}
-
+
/**
* Creates the first line which is the actual request.
* @param string $method HTTP request method, usually GET.
@@ -51,7 +51,7 @@
return $method . ' ' . $this->_url->getPath() .
$this->_url->getEncodedRequest() . ' HTTP/1.0';
}
-
+
/**
* Creates the host part of the request.
* @return string Host line content.
@@ -64,7 +64,7 @@
}
return $line;
}
-
+
/**
* Opens a socket to the route.
* @param string $method HTTP request method, usually GET.
@@ -86,7 +86,7 @@
}
return $socket;
}
-
+
/**
* Factory for socket.
* @param string $scheme Protocol to use.
@@ -105,7 +105,7 @@
return $socket;
}
}
-
+
/**
* Creates HTTP headers for the end point of
* a HTTP request via a proxy server.
@@ -116,7 +116,7 @@
protected $_proxy;
protected $_username;
protected $_password;
-
+
/**
* Stashes the proxy address.
* @param SimpleUrl $url URL as object.
@@ -131,7 +131,7 @@
$this->_username = $username;
$this->_password = $password;
}
-
+
/**
* Creates the first line which is the actual request.
* @param string $method HTTP request method, usually GET.
@@ -146,7 +146,7 @@
return $method . ' ' . $scheme . '://' . $url->getHost() . $port .
$url->getPath() . $url->getEncodedRequest() . ' HTTP/1.0';
}
-
+
/**
* Creates the host part of the request.
* @param SimpleUrl $url URL as object.
@@ -158,7 +158,7 @@
$port = $this->_proxy->getPort() ? $this->_proxy->getPort() : 8080;
return "$host:$port";
}
-
+
/**
* Opens a socket to the route.
* @param string $method HTTP request method, usually GET.
@@ -198,7 +198,7 @@
protected $_encoding;
protected $_headers;
protected $_cookies;
-
+
/**
* Builds the socket request from the different pieces.
* These include proxy information, URL, cookies, headers,
@@ -214,7 +214,7 @@
$this->_headers = array();
$this->_cookies = array();
}
-
+
/**
* Dispatches the content to the route's socket.
* @param integer $timeout Connection timeout.
@@ -231,7 +231,7 @@
$response = $this->_createResponse($socket);
return $response;
}
-
+
/**
* Sends the headers.
* @param SimpleSocket $socket Open socket.
@@ -251,7 +251,7 @@
$socket->write("\r\n");
$encoding->writeTo($socket);
}
-
+
/**
* Adds a header line to the request.
* @param string $header_line Text of full header line.
@@ -260,7 +260,7 @@
function addHeaderLine($header_line) {
$this->_headers[] = $header_line;
}
-
+
/**
* Reads all the relevant cookies from the
* cookie jar.
@@ -271,7 +271,7 @@
function readCookiesFromJar($jar, $url) {
$this->_cookies = $jar->selectAsPairs($url);
}
-
+
/**
* Wraps the socket in a response parser.
* @param SimpleSocket $socket Responding socket.
@@ -286,7 +286,7 @@
return $response;
}
}
-
+
/**
* Collection of header lines in the response.
* @package SimpleTest
@@ -301,7 +301,7 @@
protected $_cookies;
protected $_authentication;
protected $_realm;
-
+
/**
* Parses the incoming header block.
* @param string $headers Header block.
@@ -320,7 +320,7 @@
$this->_parseHeaderLine($header_line);
}
}
-
+
/**
* Accessor for parsed HTTP protocol version.
* @return integer HTTP error code.
@@ -329,7 +329,7 @@
function getHttpVersion() {
return $this->_http_version;
}
-
+
/**
* Accessor for raw header block.
* @return string All headers as raw string.
@@ -338,7 +338,7 @@
function getRaw() {
return $this->_raw_headers;
}
-
+
/**
* Accessor for parsed HTTP error code.
* @return integer HTTP error code.
@@ -347,7 +347,7 @@
function getResponseCode() {
return (integer)$this->_response_code;
}
-
+
/**
* Returns the redirected URL or false if
* no redirection.
@@ -357,7 +357,7 @@
function getLocation() {
return $this->_location;
}
-
+
/**
* Test to see if the response is a valid redirect.
* @return boolean True if valid redirect.
@@ -367,7 +367,7 @@
return in_array($this->_response_code, array(301, 302, 303, 307)) &&
(boolean)$this->getLocation();
}
-
+
/**
* Test to see if the response is an authentication
* challenge.
@@ -379,7 +379,7 @@
(boolean)$this->_authentication &&
(boolean)$this->_realm;
}
-
+
/**
* Accessor for MIME type header information.
* @return string MIME type.
@@ -388,7 +388,7 @@
function getMimeType() {
return $this->_mime_type;
}
-
+
/**
* Accessor for authentication type.
* @return string Type.
@@ -397,7 +397,7 @@
function getAuthentication() {
return $this->_authentication;
}
-
+
/**
* Accessor for security realm.
* @return string Realm.
@@ -406,7 +406,7 @@
function getRealm() {
return $this->_realm;
}
-
+
/**
* Writes new cookies to the cookie jar.
* @param SimpleCookieJar $jar Jar to write to.
@@ -449,7 +449,7 @@
$this->_realm = trim($matches[2]);
}
}
-
+
/**
* Parse the Set-cookie content.
* @param string $cookie_line Text after "Set-cookie:"
@@ -472,7 +472,7 @@
isset($cookie["expires"]) ? $cookie["expires"] : false);
}
}
-
+
/**
* Basic HTTP response.
* @package SimpleTest
@@ -484,7 +484,7 @@
protected $_sent;
protected $_content;
protected $_headers;
-
+
/**
* Constructor. Reads and parses the incoming
* content and headers.
@@ -507,7 +507,7 @@
}
$this->_parse($raw);
}
-
+
/**
* Splits up the headers and the rest of the content.
* @param string $raw Content to parse.
@@ -525,7 +525,7 @@
$this->_headers = new SimpleHttpHeaders($headers);
}
}
-
+
/**
* Original request method.
* @return string GET, POST or HEAD.
@@ -534,7 +534,7 @@
function getMethod() {
return $this->_encoding->getMethod();
}
-
+
/**
* Resource name.
* @return SimpleUrl Current url.
@@ -543,7 +543,7 @@
function getUrl() {
return $this->_url;
}
-
+
/**
* Original request data.
* @return mixed Sent content.
@@ -552,7 +552,7 @@
function getRequestData() {
return $this->_encoding;
}
-
+
/**
* Raw request that was sent down the wire.
* @return string Bytes actually sent.
@@ -561,7 +561,7 @@
function getSent() {
return $this->_sent;
}
-
+
/**
* Accessor for the content after the last
* header line.
@@ -571,7 +571,7 @@
function getContent() {
return $this->_content;
}
-
+
/**
* Accessor for header block. The response is the
* combination of this and the content.
@@ -581,7 +581,7 @@
function getHeaders() {
return $this->_headers;
}
-
+
/**
* Accessor for any new cookies.
* @return array List of new cookies.
@@ -590,7 +590,7 @@
function getNewCookies() {
return $this->_headers->getNewCookies();
}
-
+
/**
* Reads the whole of the socket output into a
* single string.
@@ -606,7 +606,7 @@
}
return $all;
}
-
+
/**
* Test to see if the packet from the socket is the
* last one.
@@ -620,5 +620,4 @@
}
return ! $packet;
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/invoker.php b/tests/test_tools/simpletest/invoker.php
index d5bf4996..dfe9263c 100644
--- a/tests/test_tools/simpletest/invoker.php
+++ b/tests/test_tools/simpletest/invoker.php
@@ -136,4 +136,3 @@
$this->_invoker->after($method);
}
}
-?>
diff --git a/tests/test_tools/simpletest/mock_objects.php b/tests/test_tools/simpletest/mock_objects.php
index 1636600e..b63d1760 100644
--- a/tests/test_tools/simpletest/mock_objects.php
+++ b/tests/test_tools/simpletest/mock_objects.php
@@ -1269,5 +1269,4 @@
}
return $code;
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/options.php b/tests/test_tools/simpletest/options.php
index da4d8b2f..23008ff9 100644
--- a/tests/test_tools/simpletest/options.php
+++ b/tests/test_tools/simpletest/options.php
@@ -363,4 +363,3 @@
return array();
}
}
-?>
diff --git a/tests/test_tools/simpletest/page.php b/tests/test_tools/simpletest/page.php
index eeae0cc9..7d0ac7b8 100644
--- a/tests/test_tools/simpletest/page.php
+++ b/tests/test_tools/simpletest/page.php
@@ -128,7 +128,7 @@
function SimplePageBuilder() {
$this->SimpleSaxListener();
}
-
+
/**
* Frees up any references so as to allow the PHP garbage
* collection from unset() to work.
@@ -177,7 +177,7 @@
$parser = new SimpleHtmlSaxParser($listener);
return $parser;
}
-
+
/**
* Start of element event. Opens a new tag.
* @param string $name Element name.
@@ -972,4 +972,3 @@
return null;
}
}
-?>
diff --git a/tests/test_tools/simpletest/parser.php b/tests/test_tools/simpletest/parser.php
index d6c10579..94fd40d0 100644
--- a/tests/test_tools/simpletest/parser.php
+++ b/tests/test_tools/simpletest/parser.php
@@ -769,5 +769,4 @@
*/
function addContent($text) {
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/reflection_php4.php b/tests/test_tools/simpletest/reflection_php4.php
index 4af685ec..df9c76cc 100644
--- a/tests/test_tools/simpletest/reflection_php4.php
+++ b/tests/test_tools/simpletest/reflection_php4.php
@@ -111,5 +111,4 @@
function getSignature($method) {
return "function $method()";
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/reflection_php5.php b/tests/test_tools/simpletest/reflection_php5.php
index 58a30856..6d2ad360 100644
--- a/tests/test_tools/simpletest/reflection_php5.php
+++ b/tests/test_tools/simpletest/reflection_php5.php
@@ -124,7 +124,7 @@
}
return array_unique($methods);
}
-
+
/**
* Checks to see if the method signature has to be tightly
* specified.
@@ -207,7 +207,7 @@
}
return "function $name()";
}
-
+
/**
* For a signature specified in an interface, full
* details must be replicated to be a valid implementation.
@@ -271,5 +271,4 @@
}
return false;
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/remote.php b/tests/test_tools/simpletest/remote.php
index 7e6898cb..1868733d 100644
--- a/tests/test_tools/simpletest/remote.php
+++ b/tests/test_tools/simpletest/remote.php
@@ -23,7 +23,7 @@
protected $_url;
protected $_dry_url;
protected $_size;
-
+
/**
* Sets the location of the remote test.
* @param string $url Test location.
@@ -35,7 +35,7 @@
$this->_dry_url = $dry_url ? $dry_url : $url;
$this->_size = false;
}
-
+
/**
* Accessor for the test name for subclasses.
* @return string Name of the test.
@@ -67,7 +67,7 @@
}
return true;
}
-
+
/**
* Creates a new web browser object for fetching
* the XML report.
@@ -77,7 +77,7 @@
function &_createBrowser() {
return new SimpleBrowser();
}
-
+
/**
* Creates the XML parser.
* @param SimpleReporter $reporter Target of test results.
@@ -87,7 +87,7 @@
function &_createParser($reporter) {
return new SimpleTestXmlParser($reporter);
}
-
+
/**
* Accessor for the number of subtests.
* @return integer Number of test cases.
@@ -111,5 +111,4 @@
}
return $this->_size;
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/reporter.php b/tests/test_tools/simpletest/reporter.php
index c8c1639d..a6b5a85a 100644
--- a/tests/test_tools/simpletest/reporter.php
+++ b/tests/test_tools/simpletest/reporter.php
@@ -363,5 +363,4 @@
$this->_within_test_case = false;
}
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/runner.php b/tests/test_tools/simpletest/runner.php
index 57939f7a..d7303895 100644
--- a/tests/test_tools/simpletest/runner.php
+++ b/tests/test_tools/simpletest/runner.php
@@ -5,7 +5,7 @@
* @subpackage UnitTester
* @version $Id: runner.php 1398 2006-09-08 19:31:03Z xue $
*/
-
+
/**#@+
* Includes SimpleTest files and defined the root constant
* for dependent libraries.
@@ -19,7 +19,7 @@
define('SIMPLE_TEST', dirname(__FILE__) . '/');
}
/**#@-*/
-
+
/**
* This is called by the class runner to run a
* single test method. Will also run the setUp()
@@ -29,7 +29,7 @@
*/
class SimpleInvoker {
protected $_test_case;
-
+
/**
* Stashes the test case for later.
* @param SimpleTestCase $test_case Test case to run.
@@ -37,7 +37,7 @@
function SimpleInvoker($test_case) {
$this->_test_case = $test_case;
}
-
+
/**
* Accessor for test case being run.
* @return SimpleTestCase Test case.
@@ -46,7 +46,7 @@
function getTestCase() {
return $this->_test_case;
}
-
+
/**
* Invokes a test method and buffered with setUp()
* and tearDown() calls.
@@ -59,7 +59,7 @@
$this->_test_case->tearDown();
}
}
-
+
/**
* Do nothing decorator. Just passes the invocation
* straight through.
@@ -68,7 +68,7 @@
*/
class SimpleInvokerDecorator {
protected $_invoker;
-
+
/**
* Stores the invoker to wrap.
* @param SimpleInvoker $invoker Test method runner.
@@ -76,7 +76,7 @@
function SimpleInvokerDecorator($invoker) {
$this->_invoker = $invoker;
}
-
+
/**
* Accessor for test case being run.
* @return SimpleTestCase Test case.
@@ -85,7 +85,7 @@
function getTestCase() {
return $this->_invoker->getTestCase();
}
-
+
/**
* Invokes a test method and buffered with setUp()
* and tearDown() calls.
@@ -103,7 +103,7 @@
* @subpackage UnitTester
*/
class SimpleErrorTrappingInvoker extends SimpleInvokerDecorator {
-
+
/**
/**
* Stores the invoker to wrap.
@@ -112,7 +112,7 @@
function SimpleErrorTrappingInvoker($invoker) {
$this->SimpleInvokerDecorator($invoker);
}
-
+
/**
* Invokes a test method and dispatches any
* untrapped errors. Called back from
@@ -142,7 +142,7 @@
class SimpleRunner {
protected $_test_case;
protected $_scorer;
-
+
/**
* Takes in the test case and reporter to mediate between.
* @param SimpleTestCase $test_case Test case to run.
@@ -152,7 +152,7 @@
$this->_test_case = $test_case;
$this->_scorer = $scorer;
}
-
+
/**
* Accessor for test case being run.
* @return SimpleTestCase Test case.
@@ -161,7 +161,7 @@
function getTestCase() {
return $this->_test_case;
}
-
+
/**
* Runs the test methods in the test case.
* @param SimpleTest $test_case Test case to run test on.
@@ -185,7 +185,7 @@
$this->_scorer->paintMethodEnd($method);
}
}
-
+
/**
* Tests to see if the method is the constructor and
* so should be ignored.
@@ -198,7 +198,7 @@
$this->_test_case,
strtolower($method));
}
-
+
/**
* Tests to see if the method is a test that should
* be run. Currently any method that starts with 'test'
@@ -219,7 +219,7 @@
function paintMethodStart($test_name) {
$this->_scorer->paintMethodStart($test_name);
}
-
+
/**
* Paints the end of a test method.
* @param string $test_name Name of test or other label.
@@ -228,7 +228,7 @@
function paintMethodEnd($test_name) {
$this->_scorer->paintMethodEnd($test_name);
}
-
+
/**
* Chains to the wrapped reporter.
* @param string $message Message is ignored.
@@ -237,7 +237,7 @@
function paintPass($message) {
$this->_scorer->paintPass($message);
}
-
+
/**
* Chains to the wrapped reporter.
* @param string $message Message is ignored.
@@ -246,7 +246,7 @@
function paintFail($message) {
$this->_scorer->paintFail($message);
}
-
+
/**
* Chains to the wrapped reporter.
* @param string $message Text of error formatted by
@@ -256,7 +256,7 @@
function paintError($message) {
$this->_scorer->paintError($message);
}
-
+
/**
* Chains to the wrapped reporter.
* @param Exception $exception Object thrown.
@@ -265,7 +265,7 @@
function paintException($exception) {
$this->_scorer->paintException($exception);
}
-
+
/**
* Chains to the wrapped reporter.
* @param string $message Text to display.
@@ -274,7 +274,7 @@
function paintMessage($message) {
$this->_scorer->paintMessage($message);
}
-
+
/**
* Chains to the wrapped reporter.
* @param string $message Text to display.
@@ -283,7 +283,7 @@
function paintFormattedMessage($message) {
$this->_scorer->paintFormattedMessage($message);
}
-
+
/**
* Chains to the wrapped reporter.
* @param string $type Event type as text.
@@ -297,4 +297,3 @@
$this->_scorer->paintSignal($type, $payload);
}
}
-?>
diff --git a/tests/test_tools/simpletest/scorer.php b/tests/test_tools/simpletest/scorer.php
index 2c81c954..48b7162b 100644
--- a/tests/test_tools/simpletest/scorer.php
+++ b/tests/test_tools/simpletest/scorer.php
@@ -773,5 +773,4 @@
$this->_reporters[$i]->paintSignal($type, $payload);
}
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/selector.php b/tests/test_tools/simpletest/selector.php
index 901815ad..6af21ff6 100644
--- a/tests/test_tools/simpletest/selector.php
+++ b/tests/test_tools/simpletest/selector.php
@@ -129,5 +129,4 @@
}
return ($widget->getName() == $this->_label);
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/shell_tester.php b/tests/test_tools/simpletest/shell_tester.php
index 5719e9d3..5ac6013d 100644
--- a/tests/test_tools/simpletest/shell_tester.php
+++ b/tests/test_tools/simpletest/shell_tester.php
@@ -127,7 +127,7 @@
$shell = $this->_getShell();
return $shell->getOutputAsList();
}
-
+
/**
* Will trigger a pass if the two parameters have
* the same value only. Otherwise a fail. This
@@ -144,7 +144,7 @@
$second,
$message);
}
-
+
/**
* Will trigger a pass if the two parameters have
* a different value. Otherwise a fail. This
@@ -302,5 +302,4 @@
$shell = new SimpleShell();
return $shell;
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/simple_test.php b/tests/test_tools/simpletest/simple_test.php
index 3bb1d40e..cc39a08b 100644
--- a/tests/test_tools/simpletest/simple_test.php
+++ b/tests/test_tools/simpletest/simple_test.php
@@ -550,4 +550,3 @@
return 0;
}
}
-?>
diff --git a/tests/test_tools/simpletest/simpletest.php b/tests/test_tools/simpletest/simpletest.php
index f859ac0f..df1536ac 100644
--- a/tests/test_tools/simpletest/simpletest.php
+++ b/tests/test_tools/simpletest/simpletest.php
@@ -278,5 +278,4 @@
function getDefaultProxyPassword() {
return Simpletest::getDefaultProxyPassword();
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/socket.php b/tests/test_tools/simpletest/socket.php
index 7b47aa9c..cfeed48a 100644
--- a/tests/test_tools/simpletest/socket.php
+++ b/tests/test_tools/simpletest/socket.php
@@ -212,5 +212,4 @@
function _openSocket($host, $port, $error_number, $error, $timeout) {
return parent::_openSocket("tls://$host", $port, $error_number, $error, $timeout);
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/tag.php b/tests/test_tools/simpletest/tag.php
index 5d8de890..46fb740a 100644
--- a/tests/test_tools/simpletest/tag.php
+++ b/tests/test_tools/simpletest/tag.php
@@ -5,14 +5,14 @@
* @subpackage WebTester
* @version $Id: tag.php 1398 2006-09-08 19:31:03Z xue $
*/
-
+
/**#@+
* include SimpleTest files
*/
require_once(dirname(__FILE__) . '/parser.php');
require_once(dirname(__FILE__) . '/encoding.php');
/**#@-*/
-
+
/**
* HTML or XML tag.
* @package SimpleTest
@@ -22,7 +22,7 @@
protected $_name;
protected $_attributes;
protected $_content;
-
+
/**
* Starts with a named tag with attributes only.
* @param string $name Tag name.
@@ -36,7 +36,7 @@
$this->_attributes = $attributes;
$this->_content = '';
}
-
+
/**
* Check to see if the tag can have both start and
* end tags with content in between.
@@ -46,7 +46,7 @@
function expectEndTag() {
return true;
}
-
+
/**
* The current tag should not swallow all content for
* itself as it's searchable page content. Private
@@ -68,7 +68,7 @@
function addContent($content) {
$this->_content .= (string)$content;
}
-
+
/**
* Adds an enclosed tag to the content.
* @param SimpleTag $tag New tag.
@@ -76,7 +76,7 @@
*/
function addTag($tag) {
}
-
+
/**
* Accessor for tag name.
* @return string Name of tag.
@@ -85,7 +85,7 @@
function getTagName() {
return $this->_name;
}
-
+
/**
* List of legal child elements.
* @return array List of element names.
@@ -94,7 +94,7 @@
function getChildElements() {
return array();
}
-
+
/**
* Accessor for an attribute.
* @param string $label Attribute name.
@@ -108,7 +108,7 @@
}
return (string)$this->_attributes[$label];
}
-
+
/**
* Sets an attribute.
* @param string $label Attribute name.
@@ -118,7 +118,7 @@
function _setAttribute($label, $value) {
$this->_attributes[strtolower($label)] = $value;
}
-
+
/**
* Accessor for the whole content so far.
* @return string Content as big raw string.
@@ -127,7 +127,7 @@
function getContent() {
return $this->_content;
}
-
+
/**
* Accessor for content reduced to visible text. Acts
* like a text mode browser, normalising space and
@@ -138,7 +138,7 @@
function getText() {
return SimpleHtmlSaxParser::normalise($this->_content);
}
-
+
/**
* Test to see if id attribute matches.
* @param string $id ID to test against.
@@ -149,14 +149,14 @@
return ($this->getAttribute('id') == $id);
}
}
-
+
/**
* Page title.
* @package SimpleTest
* @subpackage WebTester
*/
class SimpleTitleTag extends SimpleTag {
-
+
/**
* Starts with a named tag with attributes only.
* @param hash $attributes Attribute names and
@@ -166,14 +166,14 @@
$this->SimpleTag('title', $attributes);
}
}
-
+
/**
* Link.
* @package SimpleTest
* @subpackage WebTester
*/
class SimpleAnchorTag extends SimpleTag {
-
+
/**
* Starts with a named tag with attributes only.
* @param hash $attributes Attribute names and
@@ -182,7 +182,7 @@
function SimpleAnchorTag($attributes) {
$this->SimpleTag('a', $attributes);
}
-
+
/**
* Accessor for URL as string.
* @return string Coerced as string.
@@ -196,7 +196,7 @@
return $url;
}
}
-
+
/**
* Form element.
* @package SimpleTest
@@ -206,7 +206,7 @@
protected $_value;
protected $_label;
protected $_is_set;
-
+
/**
* Starts with a named tag with attributes only.
* @param string $name Tag name.
@@ -219,7 +219,7 @@
$this->_label = false;
$this->_is_set = false;
}
-
+
/**
* Accessor for name submitted as the key in
* GET/POST variables hash.
@@ -229,7 +229,7 @@
function getName() {
return $this->getAttribute('name');
}
-
+
/**
* Accessor for default value parsed with the tag.
* @return string Parsed value.
@@ -238,7 +238,7 @@
function getDefault() {
return $this->getAttribute('value');
}
-
+
/**
* Accessor for currently set value or default if
* none.
@@ -252,7 +252,7 @@
}
return $this->_value;
}
-
+
/**
* Sets the current form element value.
* @param string $value New value.
@@ -264,7 +264,7 @@
$this->_is_set = true;
return true;
}
-
+
/**
* Resets the form element value back to the
* default.
@@ -273,7 +273,7 @@
function resetValue() {
$this->_is_set = false;
}
-
+
/**
* Allows setting of a label externally, say by a
* label tag.
@@ -283,7 +283,7 @@
function setLabel($label) {
$this->_label = trim($label);
}
-
+
/**
* Reads external or internal label.
* @param string $label Label to test.
@@ -293,7 +293,7 @@
function isLabel($label) {
return $this->_label == trim($label);
}
-
+
/**
* Dispatches the value into the form encoded packet.
* @param SimpleEncoding $encoding Form packet.
@@ -305,14 +305,14 @@
}
}
}
-
+
/**
* Text, password and hidden field.
* @package SimpleTest
* @subpackage WebTester
*/
class SimpleTextTag extends SimpleWidget {
-
+
/**
* Starts with a named tag with attributes only.
* @param hash $attributes Attribute names and
@@ -324,7 +324,7 @@
$this->_setAttribute('value', '');
}
}
-
+
/**
* Tag contains no content.
* @return boolean False.
@@ -333,7 +333,7 @@
function expectEndTag() {
return false;
}
-
+
/**
* Sets the current form element value. Cannot
* change the value of a hidden field.
@@ -348,14 +348,14 @@
return parent::setValue($value);
}
}
-
+
/**
* Submit button as input tag.
* @package SimpleTest
* @subpackage WebTester
*/
class SimpleSubmitTag extends SimpleWidget {
-
+
/**
* Starts with a named tag with attributes only.
* @param hash $attributes Attribute names and
@@ -367,7 +367,7 @@
$this->_setAttribute('value', 'Submit');
}
}
-
+
/**
* Tag contains no end element.
* @return boolean False.
@@ -376,7 +376,7 @@
function expectEndTag() {
return false;
}
-
+
/**
* Disables the setting of the button value.
* @param string $value Ignored.
@@ -386,7 +386,7 @@
function setValue($value) {
return false;
}
-
+
/**
* Value of browser visible text.
* @return string Visible label.
@@ -395,7 +395,7 @@
function getLabel() {
return $this->getValue();
}
-
+
/**
* Test for a label match when searching.
* @param string $label Label to test.
@@ -406,14 +406,14 @@
return trim($label) == trim($this->getLabel());
}
}
-
+
/**
* Image button as input tag.
* @package SimpleTest
* @subpackage WebTester
*/
class SimpleImageSubmitTag extends SimpleWidget {
-
+
/**
* Starts with a named tag with attributes only.
* @param hash $attributes Attribute names and
@@ -422,7 +422,7 @@
function SimpleImageSubmitTag($attributes) {
$this->SimpleWidget('input', $attributes);
}
-
+
/**
* Tag contains no end element.
* @return boolean False.
@@ -431,7 +431,7 @@
function expectEndTag() {
return false;
}
-
+
/**
* Disables the setting of the button value.
* @param string $value Ignored.
@@ -441,7 +441,7 @@
function setValue($value) {
return false;
}
-
+
/**
* Value of browser visible text.
* @return string Visible label.
@@ -453,7 +453,7 @@
}
return $this->getAttribute('alt');
}
-
+
/**
* Test for a label match when searching.
* @param string $label Label to test.
@@ -463,7 +463,7 @@
function isLabel($label) {
return trim($label) == trim($this->getLabel());
}
-
+
/**
* Dispatches the value into the form encoded packet.
* @param SimpleEncoding $encoding Form packet.
@@ -481,14 +481,14 @@
}
}
}
-
+
/**
* Submit button as button tag.
* @package SimpleTest
* @subpackage WebTester
*/
class SimpleButtonTag extends SimpleWidget {
-
+
/**
* Starts with a named tag with attributes only.
* Defaults are very browser dependent.
@@ -498,7 +498,7 @@
function SimpleButtonTag($attributes) {
$this->SimpleWidget('button', $attributes);
}
-
+
/**
* Check to see if the tag can have both start and
* end tags with content in between.
@@ -508,7 +508,7 @@
function expectEndTag() {
return true;
}
-
+
/**
* Disables the setting of the button value.
* @param string $value Ignored.
@@ -518,7 +518,7 @@
function setValue($value) {
return false;
}
-
+
/**
* Value of browser visible text.
* @return string Visible label.
@@ -527,7 +527,7 @@
function getLabel() {
return $this->getContent();
}
-
+
/**
* Test for a label match when searching.
* @param string $label Label to test.
@@ -538,14 +538,14 @@
return trim($label) == trim($this->getLabel());
}
}
-
+
/**
* Content tag for text area.
* @package SimpleTest
* @subpackage WebTester
*/
class SimpleTextAreaTag extends SimpleWidget {
-
+
/**
* Starts with a named tag with attributes only.
* @param hash $attributes Attribute names and
@@ -554,7 +554,7 @@
function SimpleTextAreaTag($attributes) {
$this->SimpleWidget('textarea', $attributes);
}
-
+
/**
* Accessor for starting value.
* @return string Parsed value.
@@ -563,7 +563,7 @@
function getDefault() {
return $this->_wrap(SimpleHtmlSaxParser::decodeHtml($this->getContent()));
}
-
+
/**
* Applies word wrapping if needed.
* @param string $value New value.
@@ -573,7 +573,7 @@
function setValue($value) {
return parent::setValue($this->_wrap($value));
}
-
+
/**
* Test to see if text should be wrapped.
* @return boolean True if wrapping on.
@@ -588,7 +588,7 @@
}
return false;
}
-
+
/**
* Performs the formatting that is peculiar to
* this tag. There is strange behaviour in this
@@ -613,7 +613,7 @@
}
return $text;
}
-
+
/**
* The content of textarea is not part of the page.
* @return boolean True.
@@ -623,14 +623,14 @@
return true;
}
}
-
+
/**
* File upload widget.
* @package SimpleTest
* @subpackage WebTester
*/
class SimpleUploadTag extends SimpleWidget {
-
+
/**
* Starts with attributes only.
* @param hash $attributes Attribute names and
@@ -639,7 +639,7 @@
function SimpleUploadTag($attributes) {
$this->SimpleWidget('input', $attributes);
}
-
+
/**
* Tag contains no content.
* @return boolean False.
@@ -648,7 +648,7 @@
function expectEndTag() {
return false;
}
-
+
/**
* Dispatches the value into the form encoded packet.
* @param SimpleEncoding $encoding Form packet.
@@ -664,7 +664,7 @@
basename($this->getValue()));
}
}
-
+
/**
* Drop down widget.
* @package SimpleTest
@@ -673,7 +673,7 @@
class SimpleSelectionTag extends SimpleWidget {
protected $_options;
protected $_choice;
-
+
/**
* Starts with attributes only.
* @param hash $attributes Attribute names and
@@ -684,7 +684,7 @@
$this->_options = array();
$this->_choice = false;
}
-
+
/**
* Adds an option tag to a selection field.
* @param SimpleOptionTag $tag New option.
@@ -695,7 +695,7 @@
$this->_options[] = $tag;
}
}
-
+
/**
* Text within the selection element is ignored.
* @param string $content Ignored.
@@ -703,7 +703,7 @@
*/
function addContent($content) {
}
-
+
/**
* Scans options for defaults. If none, then
* the first option is selected.
@@ -721,7 +721,7 @@
}
return '';
}
-
+
/**
* Can only set allowed values.
* @param string $value New choice.
@@ -737,7 +737,7 @@
}
return false;
}
-
+
/**
* Accessor for current selection value.
* @return string Value attribute or
@@ -751,7 +751,7 @@
return $this->_options[$this->_choice]->getValue();
}
}
-
+
/**
* Drop down widget.
* @package SimpleTest
@@ -760,7 +760,7 @@
class MultipleSelectionTag extends SimpleWidget {
protected $_options;
protected $_values;
-
+
/**
* Starts with attributes only.
* @param hash $attributes Attribute names and
@@ -771,7 +771,7 @@
$this->_options = array();
$this->_values = false;
}
-
+
/**
* Adds an option tag to a selection field.
* @param SimpleOptionTag $tag New option.
@@ -782,7 +782,7 @@
$this->_options[] = $tag;
}
}
-
+
/**
* Text within the selection element is ignored.
* @param string $content Ignored.
@@ -790,7 +790,7 @@
*/
function addContent($content) {
}
-
+
/**
* Scans options for defaults to populate the
* value array().
@@ -806,7 +806,7 @@
}
return $default;
}
-
+
/**
* Can only set allowed values. Any illegal value
* will result in a failure, but all correct values
@@ -833,7 +833,7 @@
$this->_values = $achieved;
return true;
}
-
+
/**
* Accessor for current selection value.
* @return array List of currently set options.
@@ -846,21 +846,21 @@
return $this->_values;
}
}
-
+
/**
* Option for selection field.
* @package SimpleTest
* @subpackage WebTester
*/
class SimpleOptionTag extends SimpleWidget {
-
+
/**
* Stashes the attributes.
*/
function SimpleOptionTag($attributes) {
$this->SimpleWidget('option', $attributes);
}
-
+
/**
* Does nothing.
* @param string $value Ignored.
@@ -870,7 +870,7 @@
function setValue($value) {
return false;
}
-
+
/**
* Test to see if a value matches the option.
* @param string $compare Value to compare with.
@@ -884,7 +884,7 @@
}
return trim($this->getContent()) == $compare;
}
-
+
/**
* Accessor for starting value. Will be set to
* the option label if no value exists.
@@ -897,7 +897,7 @@
}
return $this->getAttribute('value');
}
-
+
/**
* The content of options is not part of the page.
* @return boolean True.
@@ -907,14 +907,14 @@
return true;
}
}
-
+
/**
* Radio button.
* @package SimpleTest
* @subpackage WebTester
*/
class SimpleRadioButtonTag extends SimpleWidget {
-
+
/**
* Stashes the attributes.
* @param array $attributes Hash of attributes.
@@ -925,7 +925,7 @@
$this->_setAttribute('value', 'on');
}
}
-
+
/**
* Tag contains no content.
* @return boolean False.
@@ -934,7 +934,7 @@
function expectEndTag() {
return false;
}
-
+
/**
* The only allowed value sn the one in the
* "value" attribute.
@@ -951,7 +951,7 @@
}
return parent::setValue($value);
}
-
+
/**
* Accessor for starting value.
* @return string Parsed value.
@@ -964,14 +964,14 @@
return false;
}
}
-
+
/**
* Checkbox widget.
* @package SimpleTest
* @subpackage WebTester
*/
class SimpleCheckboxTag extends SimpleWidget {
-
+
/**
* Starts with attributes only.
* @param hash $attributes Attribute names and
@@ -983,7 +983,7 @@
$this->_setAttribute('value', 'on');
}
}
-
+
/**
* Tag contains no content.
* @return boolean False.
@@ -992,7 +992,7 @@
function expectEndTag() {
return false;
}
-
+
/**
* The only allowed value in the one in the
* "value" attribute. The default for this
@@ -1014,7 +1014,7 @@
}
return parent::setValue($value);
}
-
+
/**
* Accessor for starting value. The default
* value is "on".
@@ -1028,7 +1028,7 @@
return false;
}
}
-
+
/**
* A group of multiple widgets with some shared behaviour.
* @package SimpleTest
@@ -1045,7 +1045,7 @@
function addWidget($widget) {
$this->_widgets[] = $widget;
}
-
+
/**
* Accessor to widget set.
* @return array All widgets.
@@ -1064,7 +1064,7 @@
function getAttribute($label) {
return false;
}
-
+
/**
* Fetches the name for the widget from the first
* member.
@@ -1076,7 +1076,7 @@
return $this->_widgets[0]->getName();
}
}
-
+
/**
* Scans the widgets for one with the appropriate
* ID field.
@@ -1092,7 +1092,7 @@
}
return false;
}
-
+
/**
* Scans the widgets for one with the appropriate
* attached label.
@@ -1108,7 +1108,7 @@
}
return false;
}
-
+
/**
* Dispatches the value into the form encoded packet.
* @param SimpleEncoding $encoding Form packet.
@@ -1125,7 +1125,7 @@
* @subpackage WebTester
*/
class SimpleCheckboxGroup extends SimpleTagGroup {
-
+
/**
* Accessor for current selected widget or false
* if none.
@@ -1142,7 +1142,7 @@
}
return $this->_coerceValues($values);
}
-
+
/**
* Accessor for starting value that is active.
* @return string/array Widget values or false if none.
@@ -1158,7 +1158,7 @@
}
return $this->_coerceValues($values);
}
-
+
/**
* Accessor for current set values.
* @param string/array/boolean $values Either a single string, a
@@ -1182,7 +1182,7 @@
}
return true;
}
-
+
/**
* Tests to see if a possible value set is legal.
* @param string/array/boolean $values Either a single string, a
@@ -1202,7 +1202,7 @@
}
return ($values == $matches);
}
-
+
/**
* Converts the output to an appropriate format. This means
* that no values is false, a single value is just that
@@ -1220,7 +1220,7 @@
return $values;
}
}
-
+
/**
* Converts false or string into array. The opposite of
* the coercian method.
@@ -1248,7 +1248,7 @@
* @subpackage WebTester
*/
class SimpleRadioGroup extends SimpleTagGroup {
-
+
/**
* Each tag is tried in turn until one is
* successfully set. The others will be
@@ -1270,7 +1270,7 @@
}
return true;
}
-
+
/**
* Tests to see if a value is allowed.
* @param string Attempted value.
@@ -1286,7 +1286,7 @@
}
return false;
}
-
+
/**
* Accessor for current selected widget or false
* if none.
@@ -1303,7 +1303,7 @@
}
return false;
}
-
+
/**
* Accessor for starting value that is active.
* @return string/boolean Value of first checked
@@ -1320,14 +1320,14 @@
return false;
}
}
-
+
/**
* Tag to keep track of labels.
* @package SimpleTest
* @subpackage WebTester
*/
class SimpleLabelTag extends SimpleTag {
-
+
/**
* Starts with a named tag with attributes only.
* @param hash $attributes Attribute names and
@@ -1336,7 +1336,7 @@
function SimpleLabelTag($attributes) {
$this->SimpleTag('label', $attributes);
}
-
+
/**
* Access for the ID to attach the label to.
* @return string For attribute.
@@ -1346,14 +1346,14 @@
return $this->getAttribute('for');
}
}
-
+
/**
* Tag to aid parsing the form.
* @package SimpleTest
* @subpackage WebTester
*/
class SimpleFormTag extends SimpleTag {
-
+
/**
* Starts with a named tag with attributes only.
* @param hash $attributes Attribute names and
@@ -1363,14 +1363,14 @@
$this->SimpleTag('form', $attributes);
}
}
-
+
/**
* Tag to aid parsing the frames in a page.
* @package SimpleTest
* @subpackage WebTester
*/
class SimpleFrameTag extends SimpleTag {
-
+
/**
* Starts with a named tag with attributes only.
* @param hash $attributes Attribute names and
@@ -1379,7 +1379,7 @@
function SimpleFrameTag($attributes) {
$this->SimpleTag('frame', $attributes);
}
-
+
/**
* Tag contains no content.
* @return boolean False.
@@ -1388,5 +1388,4 @@
function expectEndTag() {
return false;
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/test_case.php b/tests/test_tools/simpletest/test_case.php
index 91a356d8..74253d80 100644
--- a/tests/test_tools/simpletest/test_case.php
+++ b/tests/test_tools/simpletest/test_case.php
@@ -687,4 +687,3 @@
return 0;
}
}
-?>
diff --git a/tests/test_tools/simpletest/unit_tester.php b/tests/test_tools/simpletest/unit_tester.php
index 7a382b5f..672a3050 100644
--- a/tests/test_tools/simpletest/unit_tester.php
+++ b/tests/test_tools/simpletest/unit_tester.php
@@ -370,4 +370,3 @@
return $this->assertError(new PatternExpectation($pattern), $message);
}
}
-?>
diff --git a/tests/test_tools/simpletest/url.php b/tests/test_tools/simpletest/url.php
index b208d1b3..dedc6a9b 100644
--- a/tests/test_tools/simpletest/url.php
+++ b/tests/test_tools/simpletest/url.php
@@ -521,5 +521,4 @@
static function getAllTopLevelDomains() {
return 'com|edu|net|org|gov|mil|int|biz|info|name|pro|aero|coop|museum';
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/user_agent.php b/tests/test_tools/simpletest/user_agent.php
index a901e6d4..161a1b68 100644
--- a/tests/test_tools/simpletest/user_agent.php
+++ b/tests/test_tools/simpletest/user_agent.php
@@ -14,11 +14,11 @@
require_once(dirname(__FILE__) . '/encoding.php');
require_once(dirname(__FILE__) . '/authentication.php');
/**#@-*/
-
+
if (! defined('DEFAULT_MAX_REDIRECTS')) {
define('DEFAULT_MAX_REDIRECTS', 3);
}
-
+
if (! defined('DEFAULT_CONNECTION_TIMEOUT')) {
define('DEFAULT_CONNECTION_TIMEOUT', 15);
}
@@ -39,7 +39,7 @@
protected $_proxy_password = false;
protected $_connection_timeout = DEFAULT_CONNECTION_TIMEOUT;
protected $_additional_headers = array();
-
+
/**
* Starts with no cookies, realms or proxies.
* @access public
@@ -48,7 +48,7 @@
$this->_cookie_jar = new SimpleCookieJar();
$this->_authenticator = new SimpleAuthenticator();
}
-
+
/**
* Removes expired and temporary cookies as if
* the browser was closed and re-opened. Authorisation
@@ -62,7 +62,7 @@
$this->_cookie_jar->restartSession($date);
$this->_authenticator->restartSession();
}
-
+
/**
* Adds a header to every fetch.
* @param string $header Header line to add to every
@@ -72,7 +72,7 @@
function addHeader($header) {
$this->_additional_headers[] = $header;
}
-
+
/**
* Ages the cookies by the specified time.
* @param integer $interval Amount in seconds.
@@ -81,7 +81,7 @@
function ageCookies($interval) {
$this->_cookie_jar->agePrematurely($interval);
}
-
+
/**
* Sets an additional cookie. If a cookie has
* the same name and path it is replaced.
@@ -95,7 +95,7 @@
function setCookie($name, $value, $host = false, $path = '/', $expiry = false) {
$this->_cookie_jar->setCookie($name, $value, $host, $path, $expiry);
}
-
+
/**
* Reads the most specific cookie value from the
* browser cookies.
@@ -109,7 +109,7 @@
function getCookieValue($host, $path, $name) {
return $this->_cookie_jar->getCookieValue($host, $path, $name);
}
-
+
/**
* Reads the current cookies within the base URL.
* @param string $name Key of cookie to find.
@@ -124,7 +124,7 @@
}
return $this->getCookieValue($base->getHost(), $base->getPath(), $name);
}
-
+
/**
* Switches off cookie sending and recieving.
* @access public
@@ -132,7 +132,7 @@
function ignoreCookies() {
$this->_cookies_enabled = false;
}
-
+
/**
* Switches back on the cookie sending and recieving.
* @access public
@@ -140,7 +140,7 @@
function useCookies() {
$this->_cookies_enabled = true;
}
-
+
/**
* Sets the socket timeout for opening a connection.
* @param integer $timeout Maximum time in seconds.
@@ -149,7 +149,7 @@
function setConnectionTimeout($timeout) {
$this->_connection_timeout = $timeout;
}
-
+
/**
* Sets the maximum number of redirects before
* a page will be loaded anyway.
@@ -159,7 +159,7 @@
function setMaximumRedirects($max) {
$this->_max_redirects = $max;
}
-
+
/**
* Sets proxy to use on all requests for when
* testing from behind a firewall. Set URL
@@ -181,7 +181,7 @@
$this->_proxy_username = $username;
$this->_proxy_password = $password;
}
-
+
/**
* Test to see if the redirect limit is passed.
* @param integer $redirects Count so far.
@@ -191,7 +191,7 @@
function _isTooManyRedirects($redirects) {
return ($redirects > $this->_max_redirects);
}
-
+
/**
* Sets the identity for the current realm.
* @param string $host Host to which realm applies.
@@ -203,7 +203,7 @@
function setIdentity($host, $realm, $username, $password) {
$this->_authenticator->setIdentityForRealm($host, $realm, $username, $password);
}
-
+
/**
* Fetches a URL as a response object. Will keep trying if redirected.
* It will also collect authentication realm information.
@@ -228,7 +228,7 @@
}
return $response;
}
-
+
/**
* Fetches the page until no longer redirected or
* until the redirect limit runs out.
@@ -257,7 +257,7 @@
} while (! $this->_isTooManyRedirects(++$redirects));
return $response;
}
-
+
/**
* Actually make the web request.
* @param SimpleUrl $url Target to fetch.
@@ -270,7 +270,7 @@
$response = $request->fetch($this->_connection_timeout);
return $response;
}
-
+
/**
* Creates a full page request.
* @param SimpleUrl $url Target to fetch as url object.
@@ -287,7 +287,7 @@
$this->_authenticator->addHeaders($request, $url);
return $request;
}
-
+
/**
* Builds the appropriate HTTP request object.
* @param SimpleUrl $url Target to fetch as url object.
@@ -299,7 +299,7 @@
$request = new SimpleHttpRequest($this->_createRoute($url), $encoding);
return $request;
}
-
+
/**
* Sets up either a direct route or via a proxy.
* @param SimpleUrl $url Target to fetch as url object.
@@ -318,7 +318,7 @@
}
return $route;
}
-
+
/**
* Adds additional manual headers.
* @param SimpleHttpRequest $request Outgoing request.
@@ -329,5 +329,4 @@
$request->addHeaderLine($header);
}
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/web_tester.php b/tests/test_tools/simpletest/web_tester.php
index c582a6ff..c6a48110 100644
--- a/tests/test_tools/simpletest/web_tester.php
+++ b/tests/test_tools/simpletest/web_tester.php
@@ -14,7 +14,7 @@
require_once(dirname(__FILE__) . '/page.php');
require_once(dirname(__FILE__) . '/expectation.php');
/**#@-*/
-
+
/**
* Test for an HTML widget value match.
* @package SimpleTest
@@ -22,7 +22,7 @@
*/
class FieldExpectation extends SimpleExpectation {
protected $_value;
-
+
/**
* Sets the field value to compare against.
* @param mixed $value Test value to match. Can be an
@@ -38,7 +38,7 @@
}
$this->_value = $value;
}
-
+
/**
* Tests the expectation. True if it matches
* a string value or an array value in any order.
@@ -59,7 +59,7 @@
}
return false;
}
-
+
/**
* Tests for valid field comparisons with a single option.
* @param mixed $value Value to type check.
@@ -69,7 +69,7 @@
function _isSingle($value) {
return is_string($value) || is_integer($value) || is_float($value);
}
-
+
/**
* String comparison for simple field with a single option.
* @param mixed $compare String to test against.
@@ -85,7 +85,7 @@
}
return ($this->_value == $compare);
}
-
+
/**
* List comparison for multivalue field.
* @param mixed $compare List in any order to test against.
@@ -102,7 +102,7 @@
sort($compare);
return ($this->_value === $compare);
}
-
+
/**
* Returns a human readable test message.
* @param mixed $compare Comparison value.
@@ -125,7 +125,7 @@
}
}
}
-
+
/**
* Test for a specific HTTP header within a header block.
* @package SimpleTest
@@ -134,7 +134,7 @@
class HttpHeaderExpectation extends SimpleExpectation {
protected $_expected_header;
protected $_expected_value;
-
+
/**
* Sets the field and value to compare against.
* @param string $header Case insenstive trimmed header name.
@@ -150,7 +150,7 @@
$this->_expected_header = $this->_normaliseHeader($header);
$this->_expected_value = $value;
}
-
+
/**
* Accessor for aggregated object.
* @return mixed Expectation set in constructor.
@@ -159,7 +159,7 @@
function _getExpectation() {
return $this->_expected_value;
}
-
+
/**
* Removes whitespace at ends and case variations.
* @param string $header Name of header.
@@ -170,7 +170,7 @@
function _normaliseHeader($header) {
return strtolower(trim($header));
}
-
+
/**
* Tests the expectation. True if it matches
* a string value or an array value in any order.
@@ -181,7 +181,7 @@
function test($compare) {
return is_string($this->_findHeader($compare));
}
-
+
/**
* Searches the incoming result. Will extract the matching
* line as text.
@@ -198,7 +198,7 @@
}
return false;
}
-
+
/**
* Compares a single header line against the expectation.
* @param string $line A single line to compare.
@@ -215,7 +215,7 @@
}
return $this->_testHeaderValue($value, $this->_expected_value);
}
-
+
/**
* Tests the value part of the header.
* @param string $value Value to test.
@@ -232,7 +232,7 @@
}
return (trim($value) == trim($expected));
}
-
+
/**
* Returns a human readable test message.
* @param mixed $compare Raw header block to search.
@@ -254,7 +254,7 @@
}
}
}
-
+
/**
* Test for a specific HTTP header within a header block that
* should not be found.
@@ -264,7 +264,7 @@
class NoHttpHeaderExpectation extends HttpHeaderExpectation {
protected $_expected_header;
protected $_expected_value;
-
+
/**
* Sets the field and value to compare against.
* @param string $unwanted Case insenstive trimmed header name.
@@ -274,7 +274,7 @@
function NoHttpHeaderExpectation($unwanted, $message = '%s') {
$this->HttpHeaderExpectation($unwanted, false, $message);
}
-
+
/**
* Tests that the unwanted header is not found.
* @param mixed $compare Raw header block to search.
@@ -284,7 +284,7 @@
function test($compare) {
return ($this->_findHeader($compare) === false);
}
-
+
/**
* Returns a human readable test message.
* @param mixed $compare Raw header block to search.
@@ -301,7 +301,7 @@
}
}
}
-
+
/**
* Test for a text substring.
* @package SimpleTest
@@ -309,7 +309,7 @@
*/
class TextExpectation extends SimpleExpectation {
protected $_substring;
-
+
/**
* Sets the value to compare against.
* @param string $substring Text to search for.
@@ -320,7 +320,7 @@
$this->SimpleExpectation($message);
$this->_substring = $substring;
}
-
+
/**
* Accessor for the substring.
* @return string Text to match.
@@ -329,7 +329,7 @@
function _getSubstring() {
return $this->_substring;
}
-
+
/**
* Tests the expectation. True if the text contains the
* substring.
@@ -340,7 +340,7 @@
function test($compare) {
return (strpos($compare, $this->_substring) !== false);
}
-
+
/**
* Returns a human readable test message.
* @param mixed $compare Comparison value.
@@ -358,7 +358,7 @@
$dumper->describeValue($compare) . "]";
}
}
-
+
/**
* Describes a pattern match including the string
* found and it's position.
@@ -374,7 +374,7 @@
$dumper->clipString($subject, 100, $position) . "]";
}
}
-
+
/**
* Fail if a substring is detected within the
* comparison text.
@@ -382,7 +382,7 @@
* @subpackage UnitTester
*/
class NoTextExpectation extends TextExpectation {
-
+
/**
* Sets the reject pattern
* @param string $substring Text to search for.
@@ -392,7 +392,7 @@
function NoTextExpectation($substring, $message = '%s') {
$this->TextExpectation($substring, $message);
}
-
+
/**
* Tests the expectation. False if the substring appears
* in the text.
@@ -403,7 +403,7 @@
function test($compare) {
return ! parent::test($compare);
}
-
+
/**
* Returns a human readable test message.
* @param string $compare Comparison value.
@@ -422,7 +422,7 @@
}
}
}
-
+
/**
* Test case for testing of web pages. Allows
* fetching of pages, parsing of HTML and
@@ -433,7 +433,7 @@
class WebTestCase extends SimpleTestCase {
protected $_browser;
protected $_ignore_errors = false;
-
+
/**
* Creates an empty test case. Should be subclassed
* with test methods for a functional test case.
@@ -444,7 +444,7 @@
function WebTestCase($label = false) {
$this->SimpleTestCase($label);
}
-
+
/**
* Announces the start of the test.
* @param string $method Test method just started.
@@ -464,7 +464,7 @@
$this->unsetBrowser();
parent::after($method);
}
-
+
/**
* Gets a current browser reference for setting
* special expectations or for detailed
@@ -475,7 +475,7 @@
function &getBrowser() {
return $this->_browser;
}
-
+
/**
* Gets a current browser reference for setting
* special expectations or for detailed
@@ -486,7 +486,7 @@
function setBrowser($browser) {
return $this->_browser = $browser;
}
-
+
/**
* Clears the current browser reference to help the
* PHP garbage collector.
@@ -495,7 +495,7 @@
function unsetBrowser() {
unset($this->_browser);
}
-
+
/**
* Creates a new default web browser object.
* Will be cleared at the end of the test method.
@@ -506,7 +506,7 @@
$browser = new SimpleBrowser();
return $browser;
}
-
+
/**
* Gets the last response error.
* @return string Last low level HTTP error.
@@ -515,7 +515,7 @@
function getTransportError() {
return $this->_browser->getTransportError();
}
-
+
/**
* Accessor for the currently selected URL.
* @return string Current location or false if
@@ -525,7 +525,7 @@
function getUrl() {
return $this->_browser->getUrl();
}
-
+
/**
* Dumps the current request for debugging.
* @access public
@@ -533,7 +533,7 @@
function showRequest() {
$this->dump($this->_browser->getRequest());
}
-
+
/**
* Dumps the current HTTP headers for debugging.
* @access public
@@ -541,7 +541,7 @@
function showHeaders() {
$this->dump($this->_browser->getHeaders());
}
-
+
/**
* Dumps the current HTML source for debugging.
* @access public
@@ -549,7 +549,7 @@
function showSource() {
$this->dump($this->_browser->getContent());
}
-
+
/**
* Dumps the visible text only for debugging.
* @access public
@@ -557,7 +557,7 @@
function showText() {
$this->dump(wordwrap($this->_browser->getContentAsText(), 80));
}
-
+
/**
* Simulates the closing and reopening of the browser.
* Temporary cookies will be discarded and timed
@@ -575,7 +575,7 @@
}
$this->_browser->restart($date);
}
-
+
/**
* Moves cookie expiry times back into the past.
* Useful for testing timeouts and expiries.
@@ -585,7 +585,7 @@
function ageCookies($interval) {
$this->_browser->ageCookies($interval);
}
-
+
/**
* Disables frames support. Frames will not be fetched
* and the frameset page will be used instead.
@@ -594,7 +594,7 @@
function ignoreFrames() {
$this->_browser->ignoreFrames();
}
-
+
/**
* Switches off cookie sending and recieving.
* @access public
@@ -602,7 +602,7 @@
function ignoreCookies() {
$this->_browser->ignoreCookies();
}
-
+
/**
* Skips errors for the next request only. You might
* want to confirm that a page is unreachable for
@@ -612,7 +612,7 @@
function ignoreErrors() {
$this->_ignore_errors = true;
}
-
+
/**
* Issues a fail if there is a transport error anywhere
* in the current frameset. Only one such error is
@@ -640,7 +640,7 @@
function addHeader($header) {
$this->_browser->addHeader($header);
}
-
+
/**
* Sets the maximum number of redirects before
* the web page is loaded regardless.
@@ -654,7 +654,7 @@
}
$this->_browser->setMaximumRedirects($max);
}
-
+
/**
* Sets the socket timeout for opening a connection and
* receiving at least one byte of information.
@@ -664,7 +664,7 @@
function setConnectionTimeout($timeout) {
$this->_browser->setConnectionTimeout($timeout);
}
-
+
/**
* Sets proxy to use on all requests for when
* testing from behind a firewall. Set URL
@@ -677,7 +677,7 @@
function useProxy($proxy, $username = false, $password = false) {
$this->_browser->useProxy($proxy, $username, $password);
}
-
+
/**
* Fetches a page into the page buffer. If
* there is no base for the URL then the
@@ -691,7 +691,7 @@
function get($url, $parameters = false) {
return $this->_failOnError($this->_browser->get($url, $parameters));
}
-
+
/**
* Fetches a page by POST into the page buffer.
* If there is no base for the URL then the
@@ -705,7 +705,7 @@
function post($url, $parameters = false) {
return $this->_failOnError($this->_browser->post($url, $parameters));
}
-
+
/**
* Does a HTTP HEAD fetch, fetching only the page
* headers. The current base URL is unchanged by this.
@@ -717,7 +717,7 @@
function head($url, $parameters = false) {
return $this->_failOnError($this->_browser->head($url, $parameters));
}
-
+
/**
* Equivalent to hitting the retry button on the
* browser. Will attempt to repeat the page fetch.
@@ -727,7 +727,7 @@
function retry() {
return $this->_failOnError($this->_browser->retry());
}
-
+
/**
* Equivalent to hitting the back button on the
* browser.
@@ -738,7 +738,7 @@
function back() {
return $this->_failOnError($this->_browser->back());
}
-
+
/**
* Equivalent to hitting the forward button on the
* browser.
@@ -749,7 +749,7 @@
function forward() {
return $this->_failOnError($this->_browser->forward());
}
-
+
/**
* Retries a request after setting the authentication
* for the current realm.
@@ -764,7 +764,7 @@
return $this->_failOnError(
$this->_browser->authenticate($username, $password));
}
-
+
/**
* Gets the cookie value for the current browser context.
* @param string $name Name of cookie.
@@ -774,7 +774,7 @@
function getCookie($name) {
return $this->_browser->getCurrentCookieValue($name);
}
-
+
/**
* Sets a cookie in the current browser.
* @param string $name Name of cookie.
@@ -787,7 +787,7 @@
function setCookie($name, $value, $host = false, $path = "/", $expiry = false) {
$this->_browser->setCookie($name, $value, $host, $path, $expiry);
}
-
+
/**
* Accessor for current frame focus. Will be
* false if no frame has focus.
@@ -799,7 +799,7 @@
function getFrameFocus() {
return $this->_browser->getFrameFocus();
}
-
+
/**
* Sets the focus by index. The integer index starts from 1.
* @param integer $choice Chosen frame.
@@ -809,7 +809,7 @@
function setFrameFocusByIndex($choice) {
return $this->_browser->setFrameFocusByIndex($choice);
}
-
+
/**
* Sets the focus by name.
* @param string $name Chosen frame.
@@ -819,7 +819,7 @@
function setFrameFocus($name) {
return $this->_browser->setFrameFocus($name);
}
-
+
/**
* Clears the frame focus. All frames will be searched
* for content.
@@ -828,7 +828,7 @@
function clearFrameFocus() {
return $this->_browser->clearFrameFocus();
}
-
+
/**
* Clicks a visible text item. Will first try buttons,
* then links and then images.
@@ -839,7 +839,7 @@
function click($label) {
return $this->_failOnError($this->_browser->click($label));
}
-
+
/**
* Clicks the submit button by label. The owning
* form will be submitted by this.
@@ -853,7 +853,7 @@
return $this->_failOnError(
$this->_browser->clickSubmit($label, $additional));
}
-
+
/**
* Clicks the submit button by name attribute. The owning
* form will be submitted by this.
@@ -866,7 +866,7 @@
return $this->_failOnError(
$this->_browser->clickSubmitByName($name, $additional));
}
-
+
/**
* Clicks the submit button by ID attribute. The owning
* form will be submitted by this.
@@ -879,7 +879,7 @@
return $this->_failOnError(
$this->_browser->clickSubmitById($id, $additional));
}
-
+
/**
* Clicks the submit image by some kind of label. Usually
* the alt tag or the nearest equivalent. The owning
@@ -897,7 +897,7 @@
return $this->_failOnError(
$this->_browser->clickImage($label, $x, $y, $additional));
}
-
+
/**
* Clicks the submit image by the name. Usually
* the alt tag or the nearest equivalent. The owning
@@ -915,7 +915,7 @@
return $this->_failOnError(
$this->_browser->clickImageByName($name, $x, $y, $additional));
}
-
+
/**
* Clicks the submit image by ID attribute. The owning
* form will be submitted by this. Clicking outside of
@@ -932,7 +932,7 @@
return $this->_failOnError(
$this->_browser->clickImageById($id, $x, $y, $additional));
}
-
+
/**
* Submits a form by the ID.
* @param string $id Form ID. No button information
@@ -943,7 +943,7 @@
function submitFormById($id) {
return $this->_failOnError($this->_browser->submitFormById($id));
}
-
+
/**
* Follows a link by name. Will click the first link
* found with this link text by default, or a later
@@ -957,7 +957,7 @@
function clickLink($label, $index = 0) {
return $this->_failOnError($this->_browser->clickLink($label, $index));
}
-
+
/**
* Follows a link by id attribute.
* @param string $id ID attribute value.
@@ -967,7 +967,7 @@
function clickLinkById($id) {
return $this->_failOnError($this->_browser->clickLinkById($id));
}
-
+
/**
* Will trigger a pass if the two parameters have
* the same value only. Otherwise a fail. This
@@ -984,7 +984,7 @@
$second,
$message);
}
-
+
/**
* Will trigger a pass if the two parameters have
* a different value. Otherwise a fail. This
@@ -1001,7 +1001,7 @@
$second,
$message);
}
-
+
/**
* Tests for the presence of a link label. Match is
* case insensitive with normalised space.
@@ -1032,7 +1032,7 @@
$this->_browser->isLink($label),
sprintf($message, "Link [$label] should not exist"));
}
-
+
/**
* Tests for the presence of a link id attribute.
* @param string $id Id attribute value.
@@ -1061,7 +1061,7 @@
$this->_browser->isLinkById($id),
sprintf($message, "Link ID [$id] should not exist"));
}
-
+
/**
* Sets all form fields with that label, or name if there
* is no label attached.
@@ -1073,7 +1073,7 @@
function setField($label, $value) {
return $this->_browser->setField($label, $value);
}
-
+
/**
* Sets all form fields with that name.
* @param string $name Name of field in forms.
@@ -1084,7 +1084,7 @@
function setFieldByName($name, $value) {
return $this->_browser->setFieldByName($name, $value);
}
-
+
/**
* Sets all form fields with that name.
* @param string/integer $id Id of field in forms.
@@ -1095,7 +1095,7 @@
function setFieldById($id, $value) {
return $this->_browser->setFieldById($id, $value);
}
-
+
/**
* Confirms that the form element is currently set
* to the expected value. A missing form will always
@@ -1113,7 +1113,7 @@
$value = $this->_browser->getField($label);
return $this->_assertFieldValue($label, $value, $expected, $message);
}
-
+
/**
* Confirms that the form element is currently set
* to the expected value. A missing form element will always
@@ -1131,7 +1131,7 @@
$value = $this->_browser->getFieldByName($name);
return $this->_assertFieldValue($name, $value, $expected, $message);
}
-
+
/**
* Confirms that the form element is currently set
* to the expected value. A missing form will always
@@ -1149,7 +1149,7 @@
$value = $this->_browser->getFieldById($id);
return $this->_assertFieldValue($id, $value, $expected, $message);
}
-
+
/**
* Tests the field value against the expectation.
* @param string $identifier Name, ID or label.
@@ -1173,7 +1173,7 @@
}
return $this->assert($expected, $value, $message);
}
-
+
/**
* Checks the response code against a list
* of possible values.
@@ -1190,7 +1190,7 @@
implode(", ", $responses) . "] got [$code]");
return $this->assertTrue(in_array($code, $responses), $message);
}
-
+
/**
* Checks the mime type against a list
* of possible values.
@@ -1206,7 +1206,7 @@
implode(", ", $types) . "] got [$type]");
return $this->assertTrue(in_array($type, $types), $message);
}
-
+
/**
* Attempt to match the authentication type within
* the security realm we are currently matching.
@@ -1230,7 +1230,7 @@
$message);
}
}
-
+
/**
* Checks that no authentication is necessary to view
* the desired page.
@@ -1243,7 +1243,7 @@
$this->_browser->getAuthentication() . "]");
return $this->assertFalse($this->_browser->getAuthentication(), $message);
}
-
+
/**
* Attempts to match the current security realm.
* @param string $realm Name of security realm.
@@ -1260,7 +1260,7 @@
$this->_browser->getRealm(),
"Expected realm -> $message");
}
-
+
/**
* Checks each header line for the required value. If no
* value is given then only an existence check is made.
@@ -1277,7 +1277,7 @@
$this->_browser->getHeaders(),
$message);
}
-
+
/**
* @deprecated
*/
@@ -1303,14 +1303,14 @@
$this->_browser->getHeaders(),
$message);
}
-
+
/**
* @deprecated
*/
function assertNoUnwantedHeader($header, $message = '%s') {
return $this->assertNoHeader($header, $message);
}
-
+
/**
* Tests the text between the title tags.
* @param string $title Expected title.
@@ -1324,7 +1324,7 @@
}
return $this->assert($title, $this->_browser->getTitle(), $message);
}
-
+
/**
* Will trigger a pass if the text is found in the plain
* text form of the page.
@@ -1339,14 +1339,14 @@
$this->_browser->getContentAsText(),
$message);
}
-
+
/**
* @deprecated
*/
function assertWantedText($text, $message = '%s') {
return $this->assertText($text, $message);
}
-
+
/**
* Will trigger a pass if the text is not found in the plain
* text form of the page.
@@ -1361,14 +1361,14 @@
$this->_browser->getContentAsText(),
$message);
}
-
+
/**
* @deprecated
*/
function assertNoUnwantedText($text, $message = '%s') {
return $this->assertNoText($text, $message);
}
-
+
/**
* Will trigger a pass if the Perl regex pattern
* is found in the raw content.
@@ -1384,14 +1384,14 @@
$this->_browser->getContent(),
$message);
}
-
+
/**
* @deprecated
*/
function assertWantedPattern($pattern, $message = '%s') {
return $this->assertPattern($pattern, $message);
}
-
+
/**
* Will trigger a pass if the perl regex pattern
* is not present in raw content.
@@ -1407,14 +1407,14 @@
$this->_browser->getContent(),
$message);
}
-
+
/**
* @deprecated
*/
function assertNoUnwantedPattern($pattern, $message = '%s') {
return $this->assertNoPattern($pattern, $message);
}
-
+
/**
* Checks that a cookie is set for the current page
* and optionally checks the value.
@@ -1437,7 +1437,7 @@
}
return $this->assert($expected, $value, "Expecting cookie [$name] -> $message");
}
-
+
/**
* Checks that no cookie is present or that it has
* been successfully cleared.
@@ -1451,5 +1451,4 @@
$this->getCookie($name) === false,
sprintf($message, "Not expecting cookie [$name]"));
}
- }
-?> \ No newline at end of file
+ } \ No newline at end of file
diff --git a/tests/test_tools/simpletest/xml.php b/tests/test_tools/simpletest/xml.php
index 9d1ab3b2..54b53011 100644
--- a/tests/test_tools/simpletest/xml.php
+++ b/tests/test_tools/simpletest/xml.php
@@ -611,4 +611,3 @@
function _default($expat, $default) {
}
}
-?>
diff --git a/tests/unit/AllTests.php b/tests/unit/AllTests.php
index 7b8027b3..eb08a5f7 100644
--- a/tests/unit/AllTests.php
+++ b/tests/unit/AllTests.php
@@ -50,5 +50,3 @@ class AllTests {
if(PHPUnit_MAIN_METHOD == 'AllTests::main') {
AllTests::main();
}
-
-?> \ No newline at end of file
diff --git a/tests/unit/Caching/AllTests.php b/tests/unit/Caching/AllTests.php
index bffe3b2f..179840fc 100644
--- a/tests/unit/Caching/AllTests.php
+++ b/tests/unit/Caching/AllTests.php
@@ -12,14 +12,14 @@ class Caching_AllTests {
public static function main() {
PHPUnit_TextUI_TestRunner::run(self::suite());
}
-
+
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('System.Caching');
-
+
$suite->addTestSuite('TSqliteCacheTest');
$suite->addTestSuite('TAPCCacheTest');
$suite->addTestSuite('TMemCacheTest');
-
+
return $suite;
}
}
@@ -27,4 +27,3 @@ class Caching_AllTests {
if(PHPUnit_MAIN_METHOD == 'Caching_AllTests::main') {
Caching_AllTests::main();
}
-?>
diff --git a/tests/unit/Caching/TAPCCacheTest.php b/tests/unit/Caching/TAPCCacheTest.php
index 3cb04361..ccb6ee85 100644
--- a/tests/unit/Caching/TAPCCacheTest.php
+++ b/tests/unit/Caching/TAPCCacheTest.php
@@ -26,7 +26,7 @@ class TAPCCacheTest extends PHPUnit_Framework_TestCase {
} catch(TConfigurationException $e) {
self::markTestSkipped($e->getMessage());
}
-
+
}
}
@@ -38,24 +38,24 @@ class TAPCCacheTest extends PHPUnit_Framework_TestCase {
public function testInit() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testPrimaryCache() {
self::$cache->PrimaryCache = true;
self::assertEquals(true, self::$cache->PrimaryCache);
self::$cache->PrimaryCache = false;
self::assertEquals(false, self::$cache->PrimaryCache);
}
-
+
public function testKeyPrefix() {
self::$cache->KeyPrefix = 'prefix';
self::assertEquals('prefix', self::$cache->KeyPrefix);
}
-
+
public function testSetAndGet() {
self::$cache->set('key', 'value');
self::assertEquals('value', self::$cache->get('key'));
}
-
+
public function testAdd() {
try {
self::$cache->add('anotherkey', 'value');
@@ -65,12 +65,12 @@ class TAPCCacheTest extends PHPUnit_Framework_TestCase {
}
self::assertEquals('value', self::$cache->get('anotherkey'));
}
-
+
public function testDelete() {
self::$cache->delete('key');
self::assertEquals(false, self::$cache->get('key'));
}
-
+
public function testFlush() {
$this->testSetAndGet();
self::assertEquals(true, self::$cache->flush());
@@ -78,4 +78,3 @@ class TAPCCacheTest extends PHPUnit_Framework_TestCase {
}
-?>
diff --git a/tests/unit/Caching/TDirectoryCacheDependencyTest.php b/tests/unit/Caching/TDirectoryCacheDependencyTest.php
index c5c75dec..10da9b58 100644
--- a/tests/unit/Caching/TDirectoryCacheDependencyTest.php
+++ b/tests/unit/Caching/TDirectoryCacheDependencyTest.php
@@ -78,5 +78,3 @@ class TDirectoryCacheDependencyTest extends PHPUnit_Framework_TestCase
@unlink($tempFile);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/unit/Caching/TFileCacheDependencyTest.php b/tests/unit/Caching/TFileCacheDependencyTest.php
index b4bc89d3..24f2721b 100644
--- a/tests/unit/Caching/TFileCacheDependencyTest.php
+++ b/tests/unit/Caching/TFileCacheDependencyTest.php
@@ -54,5 +54,3 @@ class TFileCacheDependencyTest extends PHPUnit_Framework_TestCase
@unlink($tempFile);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/unit/Caching/TMemCacheTest.php b/tests/unit/Caching/TMemCacheTest.php
index 8c1fa934..3d0d651f 100644
--- a/tests/unit/Caching/TMemCacheTest.php
+++ b/tests/unit/Caching/TMemCacheTest.php
@@ -33,34 +33,34 @@ class TMemCacheTest extends PHPUnit_Framework_TestCase {
public function testInit() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testPrimaryCache() {
self::$cache->PrimaryCache = true;
self::assertEquals(true, self::$cache->PrimaryCache);
self::$cache->PrimaryCache = false;
self::assertEquals(false, self::$cache->PrimaryCache);
}
-
+
public function testKeyPrefix() {
self::$cache->KeyPrefix = 'prefix';
self::assertEquals('prefix', self::$cache->KeyPrefix);
}
-
+
public function testSetAndGet() {
self::$cache->set('key', 'value');
self::assertEquals('value', self::$cache->get('key'));
}
-
+
public function testAdd() {
self::$cache->add('anotherkey', 'value');
self::assertEquals('value', self::$cache->get('anotherkey'));
}
-
+
public function testDelete() {
self::$cache->delete('key');
self::assertEquals(false, self::$cache->get('key'));
}
-
+
public function testFlush() {
$this->testSetAndGet();
self::assertEquals(true, self::$cache->flush());
@@ -68,4 +68,3 @@ class TMemCacheTest extends PHPUnit_Framework_TestCase {
}
-?>
diff --git a/tests/unit/Caching/TSqliteCacheTest.php b/tests/unit/Caching/TSqliteCacheTest.php
index fd4ab1bf..b979b0ec 100644
--- a/tests/unit/Caching/TSqliteCacheTest.php
+++ b/tests/unit/Caching/TSqliteCacheTest.php
@@ -15,7 +15,7 @@ class TSqliteCacheTest extends PHPUnit_Framework_TestCase {
self::markTestSkipped('The SQLite extension is not available');
} else {
if(self::$app === null) {
-
+
$basePath = dirname(__FILE__).'/mockapp';
$runtimePath = $basePath.'/runtime';
if(!is_writable($runtimePath)) {
@@ -37,38 +37,38 @@ class TSqliteCacheTest extends PHPUnit_Framework_TestCase {
public function testInit() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testPrimaryCache() {
self::$cache->PrimaryCache = true;
self::assertEquals(true, self::$cache->PrimaryCache);
self::$cache->PrimaryCache = false;
self::assertEquals(false, self::$cache->PrimaryCache);
}
-
+
public function testKeyPrefix() {
self::$cache->KeyPrefix = 'prefix';
self::assertEquals('prefix', self::$cache->KeyPrefix);
}
-
+
public function testDbFile() {
self::assertEquals('sqlite.cache', basename(self::$cache->DbFile));
}
-
+
public function testSetAndGet() {
self::$cache->set('key', 'value');
self::assertEquals('value', self::$cache->get('key'));
}
-
+
public function testAdd() {
self::$cache->add('key', 'value');
self::assertEquals('value', self::$cache->get('key'));
}
-
+
public function testDelete() {
self::$cache->delete('key');
self::assertEquals(false, self::$cache->get('key'));
}
-
+
public function testFlush() {
$this->testAdd();
self::assertEquals(true, self::$cache->flush());
@@ -76,4 +76,3 @@ class TSqliteCacheTest extends PHPUnit_Framework_TestCase {
}
-?>
diff --git a/tests/unit/Collections/AllTests.php b/tests/unit/Collections/AllTests.php
index f290be31..3c286132 100644
--- a/tests/unit/Collections/AllTests.php
+++ b/tests/unit/Collections/AllTests.php
@@ -16,10 +16,10 @@ class Collections_AllTests {
public static function main() {
PHPUnit_TextUI_TestRunner::run(self::suite());
}
-
+
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('System.Collections');
-
+
$suite->addTestSuite('TListTest');
$suite->addTestSuite('TMapTest');
$suite->addTestSuite('TQueueTest');
@@ -27,7 +27,7 @@ class Collections_AllTests {
$suite->addTestSuite('TAttributeCollectionTest');
$suite->addTestSuite('TPagedListTest');
$suite->addTestSuite('TPagedDataSourceTest');
-
+
return $suite;
}
}
@@ -35,4 +35,3 @@ class Collections_AllTests {
if(PHPUnit_MAIN_METHOD == 'Collections_AllTests::main') {
Collections_AllTests::main();
}
-?>
diff --git a/tests/unit/Collections/TAttributeCollectionTest.php b/tests/unit/Collections/TAttributeCollectionTest.php
index 5805f2d0..f61f58b3 100644
--- a/tests/unit/Collections/TAttributeCollectionTest.php
+++ b/tests/unit/Collections/TAttributeCollectionTest.php
@@ -19,7 +19,7 @@ class TAttributeCollectionTest extends PHPUnit_Framework_TestCase {
self::assertEquals('value', $collection->Property);
self::assertEquals(true, $collection->canGetProperty('Property'));
}
-
+
public function testCanNotGetUndefinedProperty() {
$collection = new TAttributeCollection(array(), true);
self::assertEquals(false, $collection->canGetProperty('Property'));
@@ -37,7 +37,7 @@ class TAttributeCollectionTest extends PHPUnit_Framework_TestCase {
self::assertEquals('value', $collection->itemAt('Property'));
self::assertEquals(true, $collection->canSetProperty('Property'));
}
-
+
public function testCanNotSetPropertyIfReadOnly() {
$collection = new TAttributeCollection(array(), true);
try {
@@ -47,7 +47,7 @@ class TAttributeCollectionTest extends PHPUnit_Framework_TestCase {
}
self::fail('An expected TInvalidOperationException was not raised');
}
-
+
public function testGetCaseSensitive() {
$collection = new TAttributeCollection();
$collection->setCaseSensitive(false);
@@ -55,40 +55,40 @@ class TAttributeCollectionTest extends PHPUnit_Framework_TestCase {
$collection->setCaseSensitive(true);
self::assertEquals(true, $collection->getCaseSensitive());
}
-
+
public function testSetCaseSensitive() {
$collection = new TAttributeCollection();
$collection->Property = 'value';
$collection->setCaseSensitive(false);
self::assertEquals('value', $collection->itemAt('property'));
}
-
+
public function testItemAt() {
$collection = new TAttributeCollection();
$collection->Property = 'value';
self::assertEquals('value', $collection->itemAt('Property'));
}
-
+
public function testAdd() {
$collection = new TAttributeCollection();
$collection->add('Property', 'value');
self::assertEquals('value', $collection->itemAt('Property'));
}
-
+
public function testRemove() {
$collection = new TAttributeCollection();
$collection->add('Property', 'value');
$collection->remove('Property');
self::assertEquals(0, count($collection));
}
-
+
public function testContains() {
$collection = new TAttributeCollection();
self::assertEquals(false, $collection->contains('Property'));
$collection->Property = 'value';
self::assertEquals(true, $collection->contains('Property'));
}
-
+
public function testHasProperty() {
$collection = new TAttributeCollection();
self::assertEquals(false, $collection->hasProperty('Property'));
@@ -98,4 +98,3 @@ class TAttributeCollectionTest extends PHPUnit_Framework_TestCase {
}
-?>
diff --git a/tests/unit/Collections/TListTest.php b/tests/unit/Collections/TListTest.php
index 349d87ed..9d6950b9 100644
--- a/tests/unit/Collections/TListTest.php
+++ b/tests/unit/Collections/TListTest.php
@@ -8,7 +8,7 @@ class ListItem {
* @package System.Collections
*/
class TListTest extends PHPUnit_Framework_TestCase {
-
+
protected $list;
protected $item1, $item2, $item3, $item4;
@@ -21,7 +21,7 @@ class TListTest extends PHPUnit_Framework_TestCase {
$this->list->add($this->item1);
$this->list->add($this->item2);
}
-
+
public function tearDown() {
$this->list=null;
$this->item1=null;
@@ -29,7 +29,7 @@ class TListTest extends PHPUnit_Framework_TestCase {
$this->item3=null;
$this->item4=null;
}
-
+
public function testConstruct() {
$a=array(1,2,3);
$list=new TList($a);
@@ -37,19 +37,19 @@ class TListTest extends PHPUnit_Framework_TestCase {
$list2=new TList($this->list);
$this->assertEquals(2,$list2->getCount());
}
-
+
public function testGetReadOnly() {
$list = new TList(null, true);
self::assertEquals(true, $list->getReadOnly(), 'List is not read-only');
$list = new TList(null, false);
self::assertEquals(false, $list->getReadOnly(), 'List is read-only');
}
-
+
public function testGetCount() {
$this->assertEquals(2,$this->list->getCount());
$this->assertEquals(2,$this->list->Count);
}
-
+
public function testItemAt() {
$this->assertTrue($this->list->itemAt(0) === $this->item1);
$this->assertTrue($this->list->itemAt(1) === $this->item2);
@@ -59,14 +59,14 @@ class TListTest extends PHPUnit_Framework_TestCase {
} catch(TInvalidDataValueException $e) {
}
}
-
+
public function testAdd() {
$this->assertEquals(2,$this->list->add(null));
$this->assertEquals(3,$this->list->add($this->item3));
$this->assertEquals(4,$this->list->getCount());
$this->assertEquals(3,$this->list->indexOf($this->item3));
}
-
+
public function testCanNotAddWhenReadOnly() {
$list = new TList(array(), true);
try {
@@ -75,7 +75,7 @@ class TListTest extends PHPUnit_Framework_TestCase {
} catch(TInvalidOperationException $e) {
}
}
-
+
public function testInsertAt() {
$this->assertNull($this->list->insertAt(0,$this->item3));
$this->assertEquals(3,$this->list->getCount());
@@ -88,7 +88,7 @@ class TListTest extends PHPUnit_Framework_TestCase {
} catch(TInvalidDataValueException $e) {
}
}
-
+
public function testCanNotInsertAtWhenReadOnly() {
$list = new TList(array(), true);
try {
@@ -102,7 +102,7 @@ class TListTest extends PHPUnit_Framework_TestCase {
} catch(TInvalidOperationException $e) {
}
}
-
+
public function testInsertBefore() {
try {
$this->list->insertBefore($this->item4,$this->item3);
@@ -116,7 +116,7 @@ class TListTest extends PHPUnit_Framework_TestCase {
$this->assertEquals(1,$this->list->indexOf($this->item1));
$this->assertEquals(2,$this->list->indexOf($this->item2));
}
-
+
public function testCanNotInsertBeforeWhenReadOnly() {
$list = new TList(array(5), true);
try {
@@ -130,7 +130,7 @@ class TListTest extends PHPUnit_Framework_TestCase {
} catch(TInvalidOperationException $e) {
}
}
-
+
public function testInsertAfter() {
try {
$this->list->insertAfter($this->item4,$this->item3);
@@ -144,7 +144,7 @@ class TListTest extends PHPUnit_Framework_TestCase {
$this->assertEquals(1,$this->list->indexOf($this->item2));
$this->assertEquals(2,$this->list->indexOf($this->item3));
}
-
+
public function testCanNotInsertAfterWhenReadOnly() {
$list = new TList(array(5), true);
try {
@@ -158,7 +158,7 @@ class TListTest extends PHPUnit_Framework_TestCase {
} catch(TInvalidOperationException $e) {
}
}
-
+
public function testRemove() {
$this->assertEquals(0,$this->list->remove($this->item1));
$this->assertEquals(1,$this->list->getCount());
@@ -170,7 +170,7 @@ class TListTest extends PHPUnit_Framework_TestCase {
} catch(Exception $e) {
}
}
-
+
public function testCanNotRemoveWhenReadOnly() {
$list = new TList(array(1, 2, 3), true);
try {
@@ -178,7 +178,7 @@ class TListTest extends PHPUnit_Framework_TestCase {
self::fail('An expected TInvalidOperationException was not raised');
} catch(TInvalidOperationException $e) {
}
-
+
$list = new TList(array(1, 2, 3), true);
try {
$list->remove(10);
@@ -186,7 +186,7 @@ class TListTest extends PHPUnit_Framework_TestCase {
} catch(TInvalidOperationException $e) {
}
}
-
+
public function testRemoveAt() {
$this->list->add($this->item3);
$this->assertEquals($this->item2, $this->list->removeAt(1));
@@ -199,7 +199,7 @@ class TListTest extends PHPUnit_Framework_TestCase {
} catch(TInvalidDataValueException $e) {
}
}
-
+
public function testCanNotRemoveAtWhenReadOnly() {
$list = new TList(array(1, 2, 3), true);
try {
@@ -207,7 +207,7 @@ class TListTest extends PHPUnit_Framework_TestCase {
self::fail('An expected TInvalidOperationException was not raised');
} catch(TInvalidOperationException $e) {
}
-
+
$list = new TList(array(1, 2, 3), true);
try {
$list->removeAt(10);
@@ -215,14 +215,14 @@ class TListTest extends PHPUnit_Framework_TestCase {
} catch(TInvalidOperationException $e) {
}
}
-
+
public function testClear() {
$this->list->clear();
$this->assertEquals(0,$this->list->getCount());
$this->assertEquals(-1,$this->list->indexOf($this->item1));
$this->assertEquals(-1,$this->list->indexOf($this->item2));
}
-
+
public function testCanNotClearWhenReadOnly() {
$list = new TList(array(1, 2, 3), true);
try {
@@ -232,19 +232,19 @@ class TListTest extends PHPUnit_Framework_TestCase {
}
self::fail('An expected TInvalidOperationException was not raised');
}
-
+
public function testContains() {
$this->assertTrue($this->list->contains($this->item1));
$this->assertTrue($this->list->contains($this->item2));
$this->assertFalse($this->list->contains($this->item3));
}
-
+
public function testIndexOf() {
$this->assertEquals(0,$this->list->indexOf($this->item1));
$this->assertEquals(1,$this->list->indexOf($this->item2));
$this->assertEquals(-1,$this->list->indexOf($this->item3));
}
-
+
public function testCopyFrom() {
$array=array($this->item3,$this->item1);
$this->list->copyFrom($array);
@@ -255,7 +255,7 @@ class TListTest extends PHPUnit_Framework_TestCase {
} catch(TInvalidDataTypeException $e) {
}
}
-
+
public function testMergeWith() {
$array=array($this->item3,$this->item1);
$this->list->mergeWith($array);
@@ -266,12 +266,12 @@ class TListTest extends PHPUnit_Framework_TestCase {
} catch(TInvalidDataTypeException $e) {
}
}
-
+
public function testToArray() {
$array=$this->list->toArray();
$this->assertTrue(count($array)==2 && $array[0]===$this->item1 && $array[1]===$this->item2);
}
-
+
public function testArrayRead() {
$this->assertTrue($this->list[0]===$this->item1);
$this->assertTrue($this->list[1]===$this->item2);
@@ -281,7 +281,7 @@ class TListTest extends PHPUnit_Framework_TestCase {
} catch(TInvalidDataValueException $e) {
}
}
-
+
public function testGetIterator() {
$n=0;
$found=0;
@@ -295,25 +295,25 @@ class TListTest extends PHPUnit_Framework_TestCase {
}
$this->assertTrue($n==2 && $found==2);
}
-
+
public function testArrayMisc() {
$this->assertEquals($this->list->Count,count($this->list));
$this->assertTrue(isset($this->list[1]));
$this->assertFalse(isset($this->list[2]));
}
-
+
public function testOffsetSetAdd() {
$list = new TList(array(1, 2, 3));
$list->offsetSet(null, 4);
self::assertEquals(array(1, 2, 3, 4), $list->toArray());
}
-
+
public function testOffsetSetReplace() {
$list = new TList(array(1, 2, 3));
$list->offsetSet(1, 4);
self::assertEquals(array(1, 4, 3), $list->toArray());
}
-
+
public function testOffsetUnset() {
$list = new TList(array(1, 2, 3));
$list->offsetUnset(1);
@@ -321,5 +321,3 @@ class TListTest extends PHPUnit_Framework_TestCase {
}
}
-
-?> \ No newline at end of file
diff --git a/tests/unit/Collections/TMapTest.php b/tests/unit/Collections/TMapTest.php
index 0634a2a3..da198eb4 100644
--- a/tests/unit/Collections/TMapTest.php
+++ b/tests/unit/Collections/TMapTest.php
@@ -176,11 +176,10 @@ class TMapTest extends PHPUnit_Framework_TestCase {
$this->assertTrue(isset($this->map['key1']));
$this->assertFalse(isset($this->map['unknown key']));
}
-
+
public function testToArray() {
$map = new TMap(array('key' => 'value'));
self::assertEquals(array('key' => 'value'), $map->toArray());
}
}
-?>
diff --git a/tests/unit/Collections/TPagedDataSourceTest.php b/tests/unit/Collections/TPagedDataSourceTest.php
index 92f4061b..ebb8e60d 100644
--- a/tests/unit/Collections/TPagedDataSourceTest.php
+++ b/tests/unit/Collections/TPagedDataSourceTest.php
@@ -16,55 +16,54 @@ class TPagedDataSourceTest extends PHPUnit_Framework_TestCase {
public function testDataSource() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testPageSize() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testCurrentPageIndex() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testAllowPaging() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testAllowCustomPaging() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testVirtualItemCount() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testCount() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testPageCount() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testIsFirstPage() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testIsLastPage() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testFirstIndexInPage() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testDataSourceCount() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testIterator() {
throw new PHPUnit_Framework_IncompleteTestError();
}
}
-?>
diff --git a/tests/unit/Collections/TPagedListTest.php b/tests/unit/Collections/TPagedListTest.php
index 2d884736..a225db61 100644
--- a/tests/unit/Collections/TPagedListTest.php
+++ b/tests/unit/Collections/TPagedListTest.php
@@ -3,26 +3,26 @@
Prado::using('System.Collections.TPagedList');
class MyPagedList extends TPagedList {
-
+
private $_isPageIndexChanged = false;
private $_hasFetchedData = false;
-
+
public function pageIndexChanged($sender, $param) {
$this->_isPageIndexChanged = true;
}
-
+
public function fetchData($sender, $param) {
$this->_hasFetchedData = true;
}
-
+
public function isPageIndexChanged() {
return $this->_isPageIndexChanged;
}
-
+
public function hasFetchedData() {
return $this->_hasFetchedData;
}
-
+
}
/**
@@ -58,7 +58,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase {
$list->PageSize = 5;
self::assertEquals(5, $list->PageSize);
}
-
+
public function testCanNotSetInvalidPageSize() {
$list = new TPagedList();
try {
@@ -68,14 +68,14 @@ class TPagedListTest extends PHPUnit_Framework_TestCase {
}
self::fail('An expected TInvalidDataValueException was not raised');
}
-
+
public function testCurrentPageIndex() {
$list = new TPagedList(array(1, 2, 3));
$list->PageSize = 1;
$list->CurrentPageIndex = 2;
self::assertEquals(2, $list->CurrentPageIndex);
}
-
+
public function testOnPageIndexChanged() {
$list = new TPagedList(array(1, 2, 3, 4, 5));
$list->PageSize = 1;
@@ -87,7 +87,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase {
$list->onPageIndexChanged(new TPagedListPageChangedEventParameter($oldPage));
self::assertEquals(true, $myList->isPageIndexChanged());
}
-
+
public function testOnFetchData() {
$list = new TPagedList(array(1, 2, 3, 4));
$list->CustomPaging = true;
@@ -95,18 +95,18 @@ class TPagedListTest extends PHPUnit_Framework_TestCase {
$list->gotoPage(0);
$myList = new MyPagedList();
$list->attachEventHandler('OnFetchData', array($myList, 'fetchData'));
- self::assertEquals(false, $myList->hasFetchedData());
+ self::assertEquals(false, $myList->hasFetchedData());
$list->onFetchData(new TPagedListFetchDataEventParameter($list->CurrentPageIndex, $list->PageSize*$list->CurrentPageIndex, $list->PageSize));
self::assertEquals(true, $myList->hasFetchedData());
}
-
+
public function testGotoPage() {
$list = new TPagedList(array(1, 2, 3));
$list->PageSize = 1;
self::assertEquals(2, $list->gotoPage(2));
self::assertEquals(false, $list->gotoPage(4));
}
-
+
public function testNextPage() {
$list = new TPagedList(array(1, 2));
$list->PageSize = 1;
@@ -114,7 +114,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase {
self::assertEquals(1, $list->nextPage());
self::assertEquals(false, $list->nextPage());
}
-
+
public function testPreviousPage() {
$list = new TPagedList(array(1, 2));
$list->PageSize = 1;
@@ -122,7 +122,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase {
self::assertEquals(0, $list->previousPage());
self::assertEquals(false, $list->previousPage());
}
-
+
public function testVirtualCount() {
$list = new TPagedList(array(1, 2));
$list->VirtualCount = -10;
@@ -130,7 +130,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase {
$list->VirtualCount = 5;
self::assertEquals(5, $list->VirtualCount);
}
-
+
public function testPageCount() {
$list = new TPagedList(array(1, 2, 3));
$list->PageSize = 1;
@@ -141,7 +141,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase {
$list->CustomPaging = false;
self::assertEquals(3, $list->PageCount);
}
-
+
public function testIsFirstPage() {
$list = new TPagedList(array(1, 2, 3));
$list->PageSize = 1;
@@ -150,7 +150,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase {
$list->gotoPage(1);
self::assertEquals(false, $list->IsFirstPage);
}
-
+
public function testIsLastPage() {
$list = new TPagedList(array(1, 2, 3));
$list->PageSize = 1;
@@ -159,7 +159,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase {
$list->gotoPage(2);
self::assertEquals(true, $list->IsLastPage);
}
-
+
public function testGetCount() {
$list = new TPagedList(array(1, 2, 3));
$list->PageSize = 1;
@@ -167,7 +167,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase {
$list->CustomPaging = true;
self::assertEquals(3, $list->Count);
}
-
+
public function testGetIterator() {
$list = new TPagedList(array(1, 2));
$list->CustomPaging = true;
@@ -181,12 +181,12 @@ class TPagedListTest extends PHPUnit_Framework_TestCase {
$found++;
}
if($index === 1 && $item === 2) {
- $found++;
+ $found++;
}
}
self::assertTrue($n == 2 && $found == 2);
}
-
+
public function testItemAt() {
$list = new TPagedList(array(1, 2, 3));
$list->CustomPaging = true;
@@ -196,27 +196,27 @@ class TPagedListTest extends PHPUnit_Framework_TestCase {
$list->CurrentPageIndex = 0;
self::assertEquals(1, $list[0]);
}
-
+
public function testIndexOf() {
$list = new TPagedList(array(1, 2, 3));
$list->CustomPaging = true;
self::assertEquals(0, $list->indexOf(1));
self::assertEquals(-1, $list->indexOf(0));
}
-
+
public function testOffsetExists() {
$list = new TPagedList(array(1, 2, 3));
$list->CustomPaging = true;
self::assertEquals(true, isset($list[0]));
self::assertEquals(false, isset($list[4]));
}
-
+
public function testOffsetGet() {
$list = new TPagedList(array(1, 2, 3));
$list->CustomPaging = true;
self::assertEquals(2, $list[1]);
}
-
+
public function testToArray() {
$list = new TPagedList(array(1, 2, 3));
$list->CustomPaging = true;
@@ -225,4 +225,3 @@ class TPagedListTest extends PHPUnit_Framework_TestCase {
}
-?>
diff --git a/tests/unit/Collections/TPriorityMapTest.php b/tests/unit/Collections/TPriorityMapTest.php
index 7c6ed498..847e09fe 100644
--- a/tests/unit/Collections/TPriorityMapTest.php
+++ b/tests/unit/Collections/TPriorityMapTest.php
@@ -22,10 +22,10 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase {
$this->item5=new TPriorityMapTest_MapItem;
$this->map->add('key1',$this->item1);
$this->map->add('key2',$this->item2);
-
+
//Test the priority capabilities
}
-
+
public function setUpPriorities() {
$this->map->add('key3', $this->item3, 0);
$this->map->add('key4', $this->item4, 100);
@@ -45,16 +45,16 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase {
$this->assertEquals(3,$map->getCount());
$map2=new TPriorityMap($this->map);
$this->assertEquals(2,$map2->getCount());
-
+
/* Test the priority functionality of TPriorityMap */
-
+
$map3=new TPriorityMap($this->map, false, 100, -1);
$this->assertEquals(100,$map3->getDefaultPriority());
$this->assertEquals(-1,$map3->getPrecision());
}
-
+
/* Test that TPriorityMap complies with TMap */
-
+
public function testGetReadOnly() {
$map = new TPriorityMap(null, true);
@@ -202,46 +202,46 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase {
$this->assertTrue(isset($this->map['key1']));
$this->assertFalse(isset($this->map['unknown key']));
}
-
+
public function testToArray() {
$map = new TPriorityMap(array('key' => 'value'));
self::assertEquals(array('key' => 'value'), $map->toArray());
}
-
-
-
-
+
+
+
+
/* Test the priority functionality of TPriorityMap */
-
-
+
+
public function testDefaultPriorityAndPrecision() {
-
+
$this->assertEquals(10, $this->map->DefaultPriority);
-
+
$this->map->DefaultPriority = 5;
$this->assertEquals(5, $this->map->getDefaultPriority());
-
+
$this->assertEquals(8, $this->map->Precision);
-
+
$this->map->Precision = 0;
$this->assertEquals(0, $this->map->getPrecision());
-
+
;
-
+
$this->assertEquals(5, $this->map->add('key3', $this->item3));
$this->assertEquals(10, $this->map->add('key4', $this->item1, 10));
$this->assertTrue(10 == $this->map->add('key4', $this->item1, 10.01));
$this->assertTrue(100 == $this->map->add('key4', $this->item1, 100));
$this->map->Precision = 1;
$this->assertTrue(10.1 == $this->map->add('key5', $this->item1, 10.1));
-
+
$this->assertEquals(5, $this->map->getCount());
}
-
+
public function testAddWithPriorityAndPriorityOfAt() {
-
+
$this->setUpPriorities();
-
+
$this->assertEquals(5, $this->map->getCount());
$this->assertEquals(10, $this->map->priorityOf($this->item1));
$this->assertEquals(0, $this->map->priorityOf($this->item3));
@@ -249,74 +249,74 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase {
$this->assertEquals(1, $this->map->priorityOf($this->item5));
$this->assertEquals(false, $this->map->priorityOf(null));
$this->assertEquals(false, $this->map->priorityOf('foo'));
-
+
$this->assertEquals(10, $this->map->priorityAt('key1'));
$this->assertEquals(0, $this->map->priorityAt('key3'));
$this->assertEquals(100, $this->map->priorityAt('key4'));
$this->assertEquals(1, $this->map->priorityAt('key5'));
$this->assertEquals(false, $this->map->priorityAt(null));
$this->assertEquals(false, $this->map->priorityAt('foo'));
-
+
}
-
+
public function testRemoveWithPriorityAndItemsAtWithPriority() {
-
+
$this->setUpPriorities();
-
+
$this->assertEquals(5, $this->map->getCount());
$this->map->remove('key6');
$this->assertEquals(5, $this->map->getCount());
$this->map->remove('key6', null);
$this->assertEquals(5, $this->map->getCount());
-
-
+
+
// key5 is at priority 1... not the default priority defined by null... nothing should happen here
$this->map->remove('key5', null);
$this->assertEquals(5, $this->map->getCount());
-
+
// key5 is at priority 1... not 50... nothing should happen here
$this->map->remove('key5', 50);
$this->assertEquals(5, $this->map->getCount());
-
-
-
+
+
+
$this->assertEquals(array('key3'=>$this->item3), $this->map->itemsAtPriority(0));
$this->assertEquals(array('key1'=>$this->item1, 'key2'=>$this->item2), $this->map->itemsAtPriority($this->map->DefaultPriority));
-
+
$this->assertEquals($this->item2, $this->map->itemAt('key2'));
$this->assertEquals($this->item2, $this->map->itemAt('key2', 10));
$this->assertNull($this->map->itemAt('key2', 11)); //'key2' doesn't exist and priority 11... it is only at priority 10
$this->assertNull($this->map->itemAt('key2', 10.1)); //'key2' doesn't exist and priority 10.1... it is only at priority 10
-
+
$this->assertEquals($this->item4, $this->map->remove('key4'));
$this->assertEquals(4, $this->map->getCount());
-
+
$this->assertEquals($this->item5, $this->map->remove('key5'));
$this->assertEquals(3, $this->map->getCount());
}
public function testIteratorAndArrayWithPriorities() {
-
+
$this->setUpPriorities();
-
+
// This is the primary reason for a TPriorityMap
$array = $this->map->toArray();
-
+
$ordered_keys = array_keys($array);
$this->assertEquals('key3', $ordered_keys[0]);
$this->assertEquals('key5', $ordered_keys[1]);
$this->assertEquals('key1', $ordered_keys[2]);
$this->assertEquals('key2', $ordered_keys[3]);
$this->assertEquals('key4', $ordered_keys[4]);
-
+
$ordered_values = array_values($array);
$this->assertEquals($this->item3, $ordered_values[0]);
$this->assertEquals($this->item5, $ordered_values[1]);
$this->assertEquals($this->item1, $ordered_values[2]);
$this->assertEquals($this->item2, $ordered_values[3]);
$this->assertEquals($this->item4, $ordered_values[4]);
-
+
$iter = $this->map->getIterator();
-
+
$this->assertTrue($iter->valid());
$this->assertEquals('key3', $iter->key());
$this->assertEquals($this->item1, $iter->current());
@@ -341,31 +341,31 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase {
$this->assertEquals(null, $iter->key());
$this->assertEquals(null, $iter->current());
}
-
-
+
+
public function testGetPriorities() {
$this->setUpPriorities();
-
+
$priorities = $this->map->getPriorities();
-
+
$this->assertEquals(0, $priorities[0]);
$this->assertEquals(1, $priorities[1]);
$this->assertEquals(10, $priorities[2]);
$this->assertEquals(100, $priorities[3]);
$this->assertEquals(false, isset($priorities[4]));
}
-
-
+
+
public function testCopyAndMergeWithPriorities() {
$this->setUpPriorities();
-
+
$map1 = new TPriorityMap();
$map1->add('key1', $this->item1);
$map1->add('keyc', 'valuec');
$map1->copyFrom($this->map);
-
+
$this->assertEquals(5, $map1->getCount());
-
+
$array = $map1->toArray();
$ordered_keys = array_keys($array);
$this->assertEquals('key3', $ordered_keys[0]);
@@ -373,24 +373,24 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase {
$this->assertEquals('key1', $ordered_keys[2]);
$this->assertEquals('key2', $ordered_keys[3]);
$this->assertEquals('key4', $ordered_keys[4]);
-
+
$ordered_values = array_values($array);
$this->assertEquals($this->item3, $ordered_values[0]);
$this->assertEquals($this->item5, $ordered_values[1]);
$this->assertEquals($this->item1, $ordered_values[2]);
$this->assertEquals($this->item2, $ordered_values[3]);
$this->assertEquals($this->item4, $ordered_values[4]);
-
-
-
+
+
+
$map2 = new TPriorityMap();
$map2->add('startkey', 'startvalue', -1000);
$map2->add('key5', 'value5', 40);
$map2->add('endkey', 'endvalue', 1000);
$map2->mergeWith($this->map);
-
+
$this->assertEquals(7, $map2->getCount());
-
+
$array = $map2->toArray();
$ordered_keys = array_keys($array);
$this->assertEquals('startkey', $ordered_keys[0]);
@@ -400,7 +400,7 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase {
$this->assertEquals('key2', $ordered_keys[4]);
$this->assertEquals('key4', $ordered_keys[5]);
$this->assertEquals('endkey', $ordered_keys[6]);
-
+
$ordered_values = array_values($array);
$this->assertEquals('startvalue', $ordered_values[0]);
$this->assertEquals($this->item3, $ordered_values[1]);
@@ -409,81 +409,80 @@ class TPriorityMapTest extends PHPUnit_Framework_TestCase {
$this->assertEquals($this->item2, $ordered_values[4]);
$this->assertEquals($this->item4, $ordered_values[5]);
$this->assertEquals('endvalue', $ordered_values[6]);
-
+
$this->assertEquals(1, $map2->priorityAt('key5'));
$this->assertEquals(1, $map2->priorityOf($this->item5));
}
-
+
public function testSetPriorityAt() {
-
+
$this->assertEquals(10, $this->map->priorityAt('key2'));
$this->assertEquals(10, $this->map->setPriorityAt('key2', 1));
$this->assertEquals(1, $this->map->priorityAt('key2'));
$this->assertEquals(1, $this->map->setPriorityAt('key2'));
$this->assertEquals(10, $this->map->priorityAt('key2'));
}
-
+
public function testToArrayBelowPriority() {
$this->setUpPriorities();
-
+
$array = $this->map->toArrayBelowPriority(1);
$this->assertEquals(array('key3'=> $this->item3), $array);
$this->assertEquals(1, count($array));
-
+
$array = $this->map->toArrayBelowPriority(1, true);
$this->assertEquals(array('key3'=> $this->item3, 'key5'=> $this->item5), $array);
$this->assertEquals(2, count($array));
-
+
$array = $this->map->toArrayBelowPriority(2);
$this->assertEquals(array('key3'=> $this->item3, 'key5'=> $this->item5), $array);
$this->assertEquals(2, count($array));
-
+
$array = $this->map->toArrayBelowPriority(10);
$this->assertEquals(array('key3'=> $this->item3, 'key5'=> $this->item5), $array);
$this->assertEquals(2, count($array));
-
+
$array = $this->map->toArrayBelowPriority(10, true);
$this->assertEquals(array('key3'=> $this->item3, 'key5'=> $this->item5, 'key1' => $this->item1, 'key2' => $this->item2), $array);
$this->assertEquals(4, count($array));
-
+
$array = $this->map->toArrayBelowPriority(100);
$this->assertEquals(array('key3'=> $this->item3, 'key5'=> $this->item5, 'key1' => $this->item1, 'key2' => $this->item2), $array);
$this->assertEquals(4, count($array));
-
+
$array = $this->map->toArrayBelowPriority(100, true);
$this->assertEquals(array('key3'=> $this->item3, 'key5'=> $this->item5, 'key1' => $this->item1, 'key2' => $this->item2, 'key4' => $this->item4), $array);
$this->assertEquals(5, count($array));
}
-
+
public function testToArrayAbovePriority() {
$this->setUpPriorities();
-
+
$array = $this->map->toArrayAbovePriority(100, false);
$this->assertEquals(0, count($array));
-
+
$array = $this->map->toArrayAbovePriority(100, true);
$this->assertEquals(1, count($array));
$this->assertEquals(array('key4' => $this->item4), $array);
-
+
$array = $this->map->toArrayAbovePriority(11);
$this->assertEquals(array('key4' => $this->item4), $array);
$this->assertEquals(1, count($array));
-
+
$array = $this->map->toArrayAbovePriority(10, false);
$this->assertEquals(array('key4' => $this->item4), $array);
$this->assertEquals(1, count($array));
-
+
$array = $this->map->toArrayAbovePriority(10);
$this->assertEquals(array('key1' => $this->item1, 'key2' => $this->item2, 'key4' => $this->item4), $array);
$this->assertEquals(3, count($array));
-
+
$array = $this->map->toArrayAbovePriority(0);
$this->assertEquals(array('key3' => $this->item3, 'key5' => $this->item5, 'key1' => $this->item1, 'key2' => $this->item2, 'key4' => $this->item4), $array);
$this->assertEquals(5, count($array));
}
-
-
-
+
+
+
}
-?>
diff --git a/tests/unit/Collections/TQueueTest.php b/tests/unit/Collections/TQueueTest.php
index efee7cb7..da60eae3 100644
--- a/tests/unit/Collections/TQueueTest.php
+++ b/tests/unit/Collections/TQueueTest.php
@@ -31,7 +31,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase {
$queue->copyFrom($data);
self::assertEquals(array(4, 5, 6), $queue->toArray());
}
-
+
public function testCanNotCopyFromNonTraversableTypes() {
$queue = new TQueue();
$data = new stdClass();
@@ -42,7 +42,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase {
}
self::fail('An expected TInvalidDataTypeException was not raised');
}
-
+
public function testClear() {
$queue = new TQueue(array(1, 2, 3));
$queue->clear();
@@ -59,7 +59,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase {
$queue = new TQueue(array(1,2,3));
self::assertEquals(1, $queue->peek());
}
-
+
public function testCanNotPeekAnEmptyQueue() {
$queue = new TQueue();
try {
@@ -76,7 +76,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase {
self::assertEquals(1, $first);
self::assertEquals(array(2, 3), $queue->toArray());
}
-
+
public function testCanNotDequeueAnEmptyQueue() {
$queue = new TQueue();
try {
@@ -105,7 +105,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase {
$found++;
}
if($index === 1 && $item === 2) {
- $found++;
+ $found++;
}
}
self::assertTrue($n == 2 && $found == 2);
@@ -117,7 +117,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase {
$queue = new TQueue(array(1, 2, 3));
self::assertEquals(3, $queue->getCount());
}
-
+
public function testCountable() {
$queue = new TQueue();
self::assertEquals(0, count($queue));
@@ -127,4 +127,3 @@ class TQueueTest extends PHPUnit_Framework_TestCase {
}
-?>
diff --git a/tests/unit/Collections/TStackTest.php b/tests/unit/Collections/TStackTest.php
index 89a42749..80dc77c3 100644
--- a/tests/unit/Collections/TStackTest.php
+++ b/tests/unit/Collections/TStackTest.php
@@ -31,7 +31,7 @@ class TStackTest extends PHPUnit_Framework_TestCase {
$stack->copyFrom($data);
self::assertEquals(array(4, 5, 6), $stack->toArray());
}
-
+
public function testCanNotCopyFromNonTraversableTypes() {
$stack = new TStack();
$data = new stdClass();
@@ -42,7 +42,7 @@ class TStackTest extends PHPUnit_Framework_TestCase {
}
self::fail('An expected TInvalidDataTypeException was not raised');
}
-
+
public function testClear() {
$stack = new TStack(array(1, 2, 3));
$stack->clear();
@@ -59,7 +59,7 @@ class TStackTest extends PHPUnit_Framework_TestCase {
$stack = new TStack(array(1));
self::assertEquals(1, $stack->peek());
}
-
+
public function testCanNotPeekAnEmptyStack() {
$stack = new TStack();
try {
@@ -76,7 +76,7 @@ class TStackTest extends PHPUnit_Framework_TestCase {
self::assertEquals(3, $last);
self::assertEquals(array(1, 2), $stack->toArray());
}
-
+
public function testCanNotPopAnEmptyStack() {
$stack = new TStack();
try {
@@ -105,7 +105,7 @@ class TStackTest extends PHPUnit_Framework_TestCase {
$found++;
}
if($index === 1 && $item === 2) {
- $found++;
+ $found++;
}
}
self::assertTrue($n == 2 && $found == 2);
@@ -117,7 +117,7 @@ class TStackTest extends PHPUnit_Framework_TestCase {
$stack = new TStack(array(1, 2, 3));
self::assertEquals(3, $stack->getCount());
}
-
+
public function testCount() {
$stack = new TStack();
self::assertEquals(0, count($stack));
@@ -127,4 +127,3 @@ class TStackTest extends PHPUnit_Framework_TestCase {
}
-?>
diff --git a/tests/unit/Data/DataGateway/AllTests.php b/tests/unit/Data/DataGateway/AllTests.php
index f9ba1ddc..6007ae70 100644
--- a/tests/unit/Data/DataGateway/AllTests.php
+++ b/tests/unit/Data/DataGateway/AllTests.php
@@ -12,12 +12,12 @@ class Data_DataGateway_AllTests {
public static function main() {
PHPUnit_TextUI_TestRunner::run(self::suite());
}
-
+
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('System.Data.DataGateway');
-
+
$suite->addTestSuite('TSqlCriteriaTest');
-
+
return $suite;
}
}
@@ -25,4 +25,3 @@ class Data_DataGateway_AllTests {
if(PHPUnit_MAIN_METHOD == 'Data_DataGateway_AllTests::main') {
Data_DataGateway_AllTests::main();
}
-?>
diff --git a/tests/unit/Data/DataGateway/TSqlCriteriaTest.php b/tests/unit/Data/DataGateway/TSqlCriteriaTest.php
index fb9c72b2..ce22ef1d 100644
--- a/tests/unit/Data/DataGateway/TSqlCriteriaTest.php
+++ b/tests/unit/Data/DataGateway/TSqlCriteriaTest.php
@@ -17,7 +17,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase {
public function testConstruct() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testConditionWithOrderByColumnNames() {
$criteria = new TSqlCriteria();
$criteria->Condition = "SELECT * FROM table_references ORDER BY field1 ASC, field2 DESC";
@@ -27,7 +27,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase {
self::assertEquals(true, isset($criteria->OrdersBy['field2']));
self::assertEquals('DESC', $criteria->OrdersBy['field2']);
}
-
+
public function testConditionWithOrderByExpression() {
$criteria = new TSqlCriteria();
$criteria->Condition = "SELECT * FROM table_references ORDER BY RAND()";
@@ -42,7 +42,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase {
self::assertEquals("SELECT * FROM table_references", $criteria->Condition);
self::assertEquals(2, $criteria->Limit);
}
-
+
public function testConditionWithOrderByAndLimitAndOffset() {
$criteria = new TSqlCriteria();
$criteria->Condition = "SELECT * FROM table_references ORDER BY field1 ASC, field2 DESC LIMIT 3, 2";
@@ -50,7 +50,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase {
self::assertEquals(2, $criteria->Limit);
self::assertEquals(3, $criteria->Offset);
}
-
+
public function testConditionWithOrderByAndLimitAndOffsetVariant() {
$criteria = new TSqlCriteria();
$criteria->Condition = "SELECT * FROM table_references ORDER BY field1 ASC, field2 DESC LIMIT 2 OFFSET 3";
@@ -58,14 +58,14 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase {
self::assertEquals(2, $criteria->Limit);
self::assertEquals(3, $criteria->Offset);
}
-
+
public function testConditionWithLimit() {
$criteria = new TSqlCriteria();
$criteria->Condition = "SELECT * FROM table_references LIMIT 2";
self::assertEquals("SELECT * FROM table_references", $criteria->Condition);
self::assertEquals(2, $criteria->Limit);
}
-
+
public function testConditionWithLimitAndOffset() {
$criteria = new TSqlCriteria();
$criteria->Condition = "SELECT * FROM table_references LIMIT 3, 2";
@@ -73,7 +73,7 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase {
self::assertEquals(2, $criteria->Limit);
self::assertEquals(3, $criteria->Offset);
}
-
+
public function testConditionWithLimitAndOffsetVariant() {
$criteria = new TSqlCriteria();
$criteria->Condition = "SELECT * FROM table_references LIMIT 2 OFFSET 3";
@@ -85,27 +85,26 @@ class TSqlCriteriaTest extends PHPUnit_Framework_TestCase {
public function testParameters() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testIsNamedParameters() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOrdersBy() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testLimit() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOffset() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testToString() {
throw new PHPUnit_Framework_IncompleteTestError();
}
}
-?>
diff --git a/tests/unit/Data/SqlMap/AllTests.php b/tests/unit/Data/SqlMap/AllTests.php
index 3adaa29c..08870eb3 100644
--- a/tests/unit/Data/SqlMap/AllTests.php
+++ b/tests/unit/Data/SqlMap/AllTests.php
@@ -27,4 +27,3 @@ class Data_SqlMap_AllTests {
if(PHPUnit_MAIN_METHOD == 'Data_SqlMap_AllTests::main') {
Data_SqlMap_AllTests::main();
}
-?>
diff --git a/tests/unit/Data/SqlMap/DataMapper/AllTests.php b/tests/unit/Data/SqlMap/DataMapper/AllTests.php
index 47b8522f..d685d474 100644
--- a/tests/unit/Data/SqlMap/DataMapper/AllTests.php
+++ b/tests/unit/Data/SqlMap/DataMapper/AllTests.php
@@ -24,5 +24,4 @@ class Data_SqlMap_DataMapper_AllTests {
if(PHPUnit_MAIN_METHOD == 'Data_SqlMap_DataMapper_AllTests::main') {
Data_SqlMap_DataMapper_AllTests::main();
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php b/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php
index 61747c6b..3f5493c7 100644
--- a/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php
+++ b/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php
@@ -265,5 +265,3 @@ class _PropertyAccessTestHelperDynamicProperties
}
}
}
-
-?> \ No newline at end of file
diff --git a/tests/unit/Data/SqlMap/DynamicParameterTest.php b/tests/unit/Data/SqlMap/DynamicParameterTest.php
index 64f5e35c..136111db 100644
--- a/tests/unit/Data/SqlMap/DynamicParameterTest.php
+++ b/tests/unit/Data/SqlMap/DynamicParameterTest.php
@@ -105,5 +105,3 @@ class DynamicParameterTest extends PHPUnit_Framework_TestCase
}
}
-
-?> \ No newline at end of file
diff --git a/tests/unit/Data/TDbCommandTest.php b/tests/unit/Data/TDbCommandTest.php
index a75674bf..55d7d559 100644
--- a/tests/unit/Data/TDbCommandTest.php
+++ b/tests/unit/Data/TDbCommandTest.php
@@ -216,5 +216,3 @@ class TDbCommandTest extends PHPUnit_Framework_TestCase
}
}
}
-
-?> \ No newline at end of file
diff --git a/tests/unit/Data/TDbConnectionTest.php b/tests/unit/Data/TDbConnectionTest.php
index 8f6ff34f..e7e3ef74 100644
--- a/tests/unit/Data/TDbConnectionTest.php
+++ b/tests/unit/Data/TDbConnectionTest.php
@@ -121,5 +121,3 @@ class TDbConnectionTest extends PHPUnit_Framework_TestCase
$this->assertEquals(TDbNullConversionMode::NullToEmptyString,$this->_connection1->NullConversion);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/unit/Data/TDbDataReaderTest.php b/tests/unit/Data/TDbDataReaderTest.php
index 98aa0385..0595f3e2 100644
--- a/tests/unit/Data/TDbDataReaderTest.php
+++ b/tests/unit/Data/TDbDataReaderTest.php
@@ -174,5 +174,3 @@ class TDbDataReaderTest extends PHPUnit_Framework_TestCase
$this->assertEquals($name,'my name 2');
}
}
-
-?> \ No newline at end of file
diff --git a/tests/unit/Data/TDbTransactionTest.php b/tests/unit/Data/TDbTransactionTest.php
index c608bce1..a901394d 100644
--- a/tests/unit/Data/TDbTransactionTest.php
+++ b/tests/unit/Data/TDbTransactionTest.php
@@ -68,5 +68,3 @@ class TDbTransactionTest extends PHPUnit_Framework_TestCase
$this->assertEquals(count($result),2);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/unit/I18N/core/AllTests.php b/tests/unit/I18N/core/AllTests.php
index 43bbdb36..bf5fb813 100644
--- a/tests/unit/I18N/core/AllTests.php
+++ b/tests/unit/I18N/core/AllTests.php
@@ -15,16 +15,16 @@ class I18N_core_AllTests {
public static function main() {
PHPUnit_TextUI_TestRunner::run(self::suite());
}
-
+
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('System.I18N.core');
-
+
$suite->addTestSuite('CultureInfoTest');
$suite->addTestSuite('DateFormatTest');
$suite->addTestSuite('DateTimeFormatInfoTest');
$suite->addTestSuite('NumberFormatInfoTest');
$suite->addTestSuite('NumberFormatTest');
-
+
return $suite;
}
}
@@ -32,4 +32,3 @@ class I18N_core_AllTests {
if(PHPUnit_MAIN_METHOD == 'I18N_core_AllTests::main') {
I18N_core_AllTests::main();
}
-?>
diff --git a/tests/unit/I18N/core/ChoiceFormatTest.php b/tests/unit/I18N/core/ChoiceFormatTest.php
index ef397e05..2c8ab5cb 100644
--- a/tests/unit/I18N/core/ChoiceFormatTest.php
+++ b/tests/unit/I18N/core/ChoiceFormatTest.php
@@ -97,5 +97,3 @@ class ChoiceFormatTest extends PHPUnit_Framework_TestCase
}
}
}
-
-?> \ No newline at end of file
diff --git a/tests/unit/I18N/core/CultureInfoTest.php b/tests/unit/I18N/core/CultureInfoTest.php
index 6c1eda06..58c8f235 100644
--- a/tests/unit/I18N/core/CultureInfoTest.php
+++ b/tests/unit/I18N/core/CultureInfoTest.php
@@ -8,16 +8,16 @@ Prado::using('System.I18N.core.CultureInfo');
*/
class CultureInfoTest extends PHPUnit_Framework_TestCase {
protected $culture;
-
+
function setUp() {
$this->culture = CultureInfo::getInvariantCulture();
}
-
+
function testCultureName() {
$name = 'en';
-
+
$this->assertEquals($name, $this->culture->Name);
-
+
//the default/invariant culture should be neutral
$this->assertTrue($this->culture->IsNeutralCulture);
}
@@ -26,18 +26,18 @@ class CultureInfoTest extends PHPUnit_Framework_TestCase {
$allCultures = CultureInfo::getCultures();
$neutralCultures = CultureInfo::getCultures(CultureInfo::NEUTRAL);
$specificCultures = CultureInfo::getCultures(CultureInfo::SPECIFIC);
-
+
//there should be 246 cultures all together.
$this->assertEquals(count($allCultures),246);
$this->assertEquals(count($neutralCultures),76);
- $this->assertEquals(count($specificCultures),170);
+ $this->assertEquals(count($specificCultures),170);
}
function testParentCultures() {
$zh_CN = new CultureInfo('zh_CN');
$parent = $zh_CN->Parent;
$grandparent = $parent->Parent;
-
+
$this->assertEquals($zh_CN->Name, 'zh_CN');
$this->assertEquals($parent->Name, 'zh');
$this->assertEquals($grandparent->Name, 'en');
@@ -54,17 +54,17 @@ class CultureInfoTest extends PHPUnit_Framework_TestCase {
$au = array('$', 'Australian Dollar');
$this->assertEquals($au, $culture->Currencies['AUD']);
}
-
+
function testLanguages() {
$culture = new CultureInfo('fr_BE');
$this->assertEquals($culture->Languages['fr'], 'français');
}
-
+
function testScripts() {
$culture = new CultureInfo('fr');
$this->assertEquals($culture->Scripts['Armn'], 'arménien');
}
-
+
function testTimeZones() {
$culture = new CultureInfo('fi');
$zone = array(
@@ -83,5 +83,3 @@ class CultureInfoTest extends PHPUnit_Framework_TestCase {
$this->assertEquals($culture->getEnglishName(), 'iw');
}
}
-
-?> \ No newline at end of file
diff --git a/tests/unit/I18N/core/DateFormatTest.php b/tests/unit/I18N/core/DateFormatTest.php
index 8015bd74..d8350204 100644
--- a/tests/unit/I18N/core/DateFormatTest.php
+++ b/tests/unit/I18N/core/DateFormatTest.php
@@ -10,86 +10,84 @@ class DateFormatTest extends PHPUnit_Framework_TestCase {
public function testStandardPatterns() {
$dateFormatter = new DateFormat();
-
+
$time = @mktime(9, 9, 9, 9, 1, 2004);
$zone = @date('T', $time);
//var_dump(date('c',$time));
//for ShortDatePattern "M/d/yy"
$this->assertEquals('9/1/04', $dateFormatter->format($time, 'd'));
//var_dump(date('c',strtotime($dateFormatter->format($time,'d'))));
-
+
//for LongDatePattern "MMMM d, yyyy"
$wants = 'September 1, 2004';
$this->assertEquals($wants, $dateFormatter->format($time, 'D'));
//var_dump(date('c',strtotime($dateFormatter->format($time,'D'))));
-
+
//for Full date and time "MMMM d, yyyy h:mm a"
$wants = 'September 1, 2004 9:09 AM';
$this->assertEquals($wants, $dateFormatter->format($time, 'f'));
//var_dump(date('c',strtotime($dateFormatter->format($time,'f'))));
-
+
//for FullDateTimePattern "MMMM d, yyyy h:mm:ss a z"
$wants = 'September 1, 2004 9:09:09 AM '.$zone;
$this->assertEquals($wants, $dateFormatter->format($time, 'F'));
-
+
//for General "M/d/yy h:mm a"
$wants = '9/1/04 9:09 AM';
$this->assertEquals($wants, $dateFormatter->format($time, 'g'));
//var_dump(date('c',strtotime($dateFormatter->format($time,'g'))));
-
+
//for General "M/d/yy h:mm:ss a z"
$wants = '9/1/04 9:09:09 AM '.$zone;
- $this->assertEquals($wants, $dateFormatter->format($time, 'G'));
-
+ $this->assertEquals($wants, $dateFormatter->format($time, 'G'));
+
//for MonthDayPattern "MMMM dd" (invariant)
$wants = 'September 01';
$this->assertEquals($wants, $dateFormatter->format($time, 'm'));
//var_dump(date('c',strtotime($dateFormatter->format($time,'m'))));
-
+
//for RFC1123Pattern "EEE, dd MMM yyyy HH:mm:ss" (invariant)
$wants = 'Wed, 01 Sep 2004 09:09:09';
- $this->assertEquals($wants, $dateFormatter->format($time, 'r'));
+ $this->assertEquals($wants, $dateFormatter->format($time, 'r'));
//var_dump(date('c',strtotime($dateFormatter->format($time,'r'))));
-
+
//for SortableDateTimePattern "yyyy-MM-ddTHH:mm:ss" (invariant)
$wants = '2004-09-01T09:09:09';
- $this->assertEquals($wants, $dateFormatter->format($time, 's'));
+ $this->assertEquals($wants, $dateFormatter->format($time, 's'));
//var_dump(date('c',strtotime($dateFormatter->format($time,'s'))));
-
+
//for ShortTimePattern "H:mm a"
$wants = '9:09 AM';
- $this->assertEquals($wants, $dateFormatter->format($time, 't'));
+ $this->assertEquals($wants, $dateFormatter->format($time, 't'));
//(date('c',strtotime($dateFormatter->format($time,'t'))));
-
+
//for LongTimePattern "H:mm:ss a z"
$wants = '9:09:09 AM '.$zone;
- $this->assertEquals($wants, $dateFormatter->format($time, 'T'));
-
- //for UniversalSortableDateTimePattern "yyyy-MM-dd HH:mm:ss z"
+ $this->assertEquals($wants, $dateFormatter->format($time, 'T'));
+
+ //for UniversalSortableDateTimePattern "yyyy-MM-dd HH:mm:ss z"
//(invariant)
$wants = '2004-09-01 09:09:09 '.$zone;
- $this->assertEquals($wants, $dateFormatter->format($time, 'u'));
-
+ $this->assertEquals($wants, $dateFormatter->format($time, 'u'));
+
//for Full date and time "EEEE dd MMMM yyyy HH:mm:ss" (invariant)
$wants = 'Wednesday 01 September 2004 09:09:09';
- $this->assertEquals($wants, $dateFormatter->format($time, 'U'));
+ $this->assertEquals($wants, $dateFormatter->format($time, 'U'));
//var_dump(date('c',strtotime($dateFormatter->format($time,'U'))));
-
+
//for YearMonthPattern "yyyy MMMM" (invariant)
$wants = '2004 September';
- $this->assertEquals($wants, $dateFormatter->format($time, 'y'));
+ $this->assertEquals($wants, $dateFormatter->format($time, 'y'));
//var_dump(date('c',strtotime($dateFormatter->format($time,'y'))));
}
-
+
public function testCustomPatterns() {
$dateFormatter = new DateFormat();
-
+
$time = @mktime(9, 9, 9, 9, 1, 2004);
-
+
$pattern = "'Hello' EEEE, 'it should be' MMM yyyy HH:mm:ss!!!";
$wants = 'Hello Wednesday, it should be Sep 2004 09:09:09!!!';
- $this->assertEquals($wants, $dateFormatter->format($time, $pattern));
+ $this->assertEquals($wants, $dateFormatter->format($time, $pattern));
}
}
-
-?> \ No newline at end of file
diff --git a/tests/unit/I18N/core/DateTimeFormatInfoTest.php b/tests/unit/I18N/core/DateTimeFormatInfoTest.php
index 442a6b85..ac93e1c7 100644
--- a/tests/unit/I18N/core/DateTimeFormatInfoTest.php
+++ b/tests/unit/I18N/core/DateTimeFormatInfoTest.php
@@ -9,20 +9,20 @@ Prado::using('System.I18N.core.DateTimeFormatInfo');
class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase {
protected $format;
-
+
function setUp() {
$this->format = DateTimeFormatInfo::getInstance('en');
}
-
+
function testAbbreviatedDayNames() {
$names = $this->format->AbbreviatedDayNames;
$this->assertTrue(is_array($names),'Must be an array!');
$this->assertEquals(count($names),7,'Must have 7 day names');
-
+
//assuming invariant culture.
$days = array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
$this->assertEquals($names, $days);
-
+
//try to set the data
$data = array('Hel', 'wor');
$this->format->AbbreviatedDayNames = $data;
@@ -31,16 +31,16 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase {
$this->assertEquals(count($newNames),2,'Must have 2 entries');
$this->assertEquals($newNames, $data);
}
-
+
function testNarrowDayNames() {
$names = $this->format->NarrowDayNames;
$this->assertTrue(is_array($names),'Must be an array!');
$this->assertEquals(count($names),7,'Must have 7 day names');
-
+
//assuming invariant culture.
$days = array("S", "M", "T", "W", "T", "F", "S");
$this->assertEquals($names, $days);
-
+
//try to set the data
$data = array('H', 'w');
$this->format->NarrowDayNames = $data;
@@ -49,17 +49,17 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase {
$this->assertEquals(count($newNames),2,'Must have 2 entries');
$this->assertEquals($newNames, $data);
}
-
+
function testDayNames() {
$names = $this->format->DayNames;
$this->assertTrue(is_array($names),'Must be an array!');
$this->assertEquals(count($names),7,'Must have 7 day names');
-
+
//assuming invariant culture.
$days = array( "Sunday","Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday");
$this->assertEquals($names, $days);
-
+
//try to set the data
$data = array('Hello', 'world');
$this->format->DayNames = $data;
@@ -68,18 +68,18 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase {
$this->assertEquals(count($newNames),2,'Must have 2 entries');
$this->assertEquals($newNames, $data);
}
-
+
function testMonthNames() {
$names = $this->format->MonthNames;
$this->assertTrue(is_array($names),'Must be an array!');
$this->assertEquals(count($names),12,'Must have 12 month names');
-
+
//assuming invariant culture.
$days = array( "January", "February", "March", "April",
"May", "June", "July", "August", "September",
"October", "November", "December");
$this->assertEquals($names, $days);
-
+
//try to set the data
$data = array('Hello', 'world');
$this->format->MonthNames = $data;
@@ -88,17 +88,17 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase {
$this->assertEquals(count($newNames),2,'Must have 2 entries');
$this->assertEquals($newNames, $data);
}
-
+
function testNarrowMonthNames() {
$names = $this->format->NarrowMonthNames;
$this->assertTrue(is_array($names),'Must be an array!');
$this->assertEquals(count($names),12,'Must have 12 month names');
-
+
//assuming invariant culture.
$days = array( "J", "F", "M", "A", "M", "J", "J",
"A", "S", "O", "N", "D");
$this->assertEquals($names, $days);
-
+
//try to set the data
$data = array('Hello', 'world');
$this->format->NarrowMonthNames = $data;
@@ -112,13 +112,13 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase {
$names = $this->format->AbbreviatedMonthNames;
$this->assertTrue(is_array($names),'Must be an array!');
$this->assertEquals(count($names),12,'Must have 12 month names');
-
+
//assuming invariant culture.
$days = array( "Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug", "Sep",
"Oct", "Nov", "Dec");
$this->assertEquals($names, $days);
-
+
//try to set the data
$data = array('Hello', 'world');
$this->format->AbbreviatedMonthNames = $data;
@@ -134,7 +134,7 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase {
$this->assertEquals('AD', $this->format->getEra(1));
$this->assertEquals('BC', $this->format->getEra(0));
}
-
+
function testAMPMMarkers() {
$am_pm = array('AM','PM');
$data = $this->format->AMPMMarkers;
@@ -142,7 +142,7 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase {
$this->assertEquals($am_pm, $data);
$this->assertEquals('AM', $this->format->AMDesignator);
$this->assertEquals('PM', $this->format->PMDesignator);
-
+
//try to set the data
$data = array('Hello', 'world');
$this->format->AMPMMarkers = $data;
@@ -150,10 +150,10 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase {
$this->assertTrue(is_array($newNames),'Must be an array!');
$this->assertEquals(count($newNames),2,'Must have 2 entries');
$this->assertEquals($newNames, $data);
-
+
$this->format->AMDesignator = 'TTTT';
$this->assertEquals('TTTT',$this->format->AMDesignator);
-
+
$this->format->PMDesignator = 'SSS';
$this->assertEquals('SSS',$this->format->PMDesignator);
}
@@ -171,37 +171,36 @@ class DateTimeFormatInfoTest extends PHPUnit_Framework_TestCase {
'ShortDatePattern' => 'M/d/yy',
'DateTimeOrderPattern' => '{1} {0}'
);
-
+
foreach($patterns as $property => $pattern) {
$this->assertEquals($pattern, $this->format->$property);
}
-
+
$hello = 'Hello';
$world = 'world';
$expectedResult = $hello.' '.$world;
$this->assertEquals($expectedResult,
$this->format->formatDateTime($hello, $world));
}
-
+
function testInvariantInfo() {
$format = DateTimeFormatInfo::getInstance();
-
+
//the variant datetime format for medium date
//should be the follow
$pattern = 'MMM d, yyyy';
-
+
$this->assertEquals($pattern, $format->MediumDatePattern);
-
+
$invariant = $format->getInvariantInfo();
-
+
$this->assertSame($format, $invariant);
}
-
+
function testGetInstance() {
$format = DateTimeFormatInfo::getInstance('zh_CN');
-
+
$pattern = 'yyyy-M-d';
$this->assertEquals($pattern, $format->MediumDatePattern);
- }
-}
-?> \ No newline at end of file
+ }
+} \ No newline at end of file
diff --git a/tests/unit/I18N/core/NumberFormatInfoTest.php b/tests/unit/I18N/core/NumberFormatInfoTest.php
index d522144f..6243095a 100644
--- a/tests/unit/I18N/core/NumberFormatInfoTest.php
+++ b/tests/unit/I18N/core/NumberFormatInfoTest.php
@@ -8,27 +8,27 @@ Prado::using('System.I18N.core.NumberFormatInfo');
* @package System.I18N.core
*/
class NumberFormatInfoTest extends PHPUnit_Framework_TestCase {
-
+
function testCurrencyPatterns() {
$numberInfo = NumberFormatInfo::getCurrencyInstance();
-
+
//there should be 2 decimal places.
$this->assertEquals($numberInfo->DecimalDigits,2);
$this->assertEquals($numberInfo->DecimalSeparator,'.');
$this->assertEquals($numberInfo->GroupSeparator,',');
-
+
//there should be only 1 grouping of size 3
$groupsize = array(3,false);
$this->assertEquals($numberInfo->GroupSizes, $groupsize);
-
+
//the default negative pattern prefix and postfix
$negPattern = array('-¤','');
$this->assertEquals($numberInfo->NegativePattern, $negPattern);
-
+
//the default positive pattern prefix and postfix
$negPattern = array('¤','');
$this->assertEquals($numberInfo->PositivePattern, $negPattern);
-
+
//the default currency symbol
$this->assertEquals($numberInfo->CurrencySymbol, 'US$');
$this->assertEquals($numberInfo->getCurrencySymbol('JPY'), '¥');
@@ -38,51 +38,49 @@ class NumberFormatInfoTest extends PHPUnit_Framework_TestCase {
$this->assertEquals($numberInfo->PositiveSign, '+');
$this->assertEquals($numberInfo->NaNSymbol, '�');
$this->assertEquals($numberInfo->PercentSymbol, '%');
- $this->assertEquals($numberInfo->PerMilleSymbol, '‰');
+ $this->assertEquals($numberInfo->PerMilleSymbol, '‰');
}
function testPatternsSet() {
$numberInfo = NumberFormatInfo::getInstance();
-
+
$numberInfo->DecimalDigits = 0;
$this->assertEquals($numberInfo->DecimalDigits,0);
-
+
$numberInfo->DecimalSeparator = ',';
$this->assertEquals($numberInfo->DecimalSeparator,',');
-
+
$numberInfo->GroupSeparator = ' ';
$this->assertEquals($numberInfo->GroupSeparator,' ');
-
+
$numberInfo->GroupSizes = array(2,3);
$groupsize = array(2,3);
$this->assertEquals($numberInfo->GroupSizes, $groupsize);
-
+
$numberInfo->NegativePattern = array('-$$','.');
$negPattern = array('-$$','.');
$this->assertEquals($numberInfo->NegativePattern, $negPattern);
-
+
$numberInfo->PositivePattern = array('YY','.');
$negPattern = array('YY','.');
$this->assertEquals($numberInfo->PositivePattern, $negPattern);
-
+
//the default CurrencySymbol symbol
$numberInfo->CurrencySymbol = '$$$';
$this->assertEquals($numberInfo->CurrencySymbol, '$$$');
}
-
+
function testLocalizedPatterns() {
$fr = NumberFormatInfo::getInstance('fr');
$de = NumberFormatInfo::getInstance('de');
$en = NumberFormatInfo::getInstance('en_US');
-
+
$this->assertEquals($fr->DecimalSeparator, ',');
$this->assertEquals($de->DecimalSeparator, ',');
$this->assertEquals($en->DecimalSeparator, '.');
-
+
$this->assertEquals($fr->GroupSeparator, ' ');
$this->assertEquals($de->GroupSeparator, '.');
$this->assertEquals($en->GroupSeparator, ',');
}
}
-
-?> \ No newline at end of file
diff --git a/tests/unit/I18N/core/NumberFormatTest.php b/tests/unit/I18N/core/NumberFormatTest.php
index 958f05f4..ef8add77 100644
--- a/tests/unit/I18N/core/NumberFormatTest.php
+++ b/tests/unit/I18N/core/NumberFormatTest.php
@@ -14,7 +14,7 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase {
$wanted = '123,456,789.125156';
$this->assertEquals($wanted, $formatter->format($number));
-
+
//currency
$wanted = 'US$123,456,789.13';
$this->assertEquals($wanted, $formatter->format($number,'c'));
@@ -25,21 +25,21 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase {
$de = new NumberFormat('de');
$ja = new NumberFormat('ja_JP');
$it = new NumberFormat('it_IT');
-
+
$number = '123456789.125156';
-
+
//french
$wanted = '123 456 789,13 F';
$this->assertEquals($wanted, $fr->format($number,'c','FRF'));
-
+
//german
$wanted = 'DES 123.456.789,13';
$this->assertEquals($wanted, $de->format($number,'c','DES'));
-
+
//japanese
$wanted = '¥123,456,789';
$this->assertEquals($wanted, $ja->format($number,'c','JPY'));
-
+
//custom/unkown currency
$wanted = 'DLL123,456,789';
$this->assertEquals($wanted, $ja->format($number,'c','DLL'));
@@ -52,54 +52,54 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase {
function testCustomFormat() {
$formatter = new NumberFormat();
$number = '123456789.125156';
-
+
//primay and secondary grouping test
$pattern = '#,###,##.###';
$wanted = '1,234,567,89.125156';
$this->assertEquals($wanted, $formatter->format($number, $pattern));
-
+
//4 digits grouping test
$pattern = '#,####.###';
$wanted = '1,2345,6789.125156';
$this->assertEquals($wanted, $formatter->format($number, $pattern));
-
+
//custom percentage
$pattern = '#,###.00%';
$wanted = '123,456,789.13%';
$this->assertEquals($wanted, $formatter->format($number, $pattern));
}
-
+
function testPercentageFormat() {
$formatter = new NumberFormat();
$number = '0.125156';
$wanted = '12%';
$this->assertEquals($wanted, $formatter->format($number, 'p'));
}
-
+
function testQuotes() {
$formatter = new NumberFormat();
$number = '123456789.125156';
-
+
$pattern = "# o'clock";
$wanted = "123456789 o'clock";
$this->assertEquals($wanted, $formatter->format($number, $pattern));
-
+
}
-
+
function testPadding() {
$formatter = new NumberFormat();
$number = '5';
-
+
$pattern = '0000';
$wanted = '0005';
-
+
$this->assertEquals($wanted, $formatter->format($number, $pattern));
}
-
+
function testFormatWithANegativeValue() {
$formatter = new NumberFormat();
$number = "-1.2";
-
+
$wanted = "-1.2";
$this->assertEquals($wanted, $formatter->format($number));
}
@@ -110,33 +110,33 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase {
$expected = "10E";
$this->assertEquals('10E', $formatter->format($number, 'e'));
}
-
+
function testRounding()
{
$formatter = new NumberFormat();
-
+
$number = 349.999;
$pattern = '#.00';
$expected = '350.00';
-
+
$this->assertEquals($expected, $formatter->format($number, $pattern));
}
function testRounding2()
{
$formatter = new NumberFormat();
-
+
$number = 349.99;
$pattern = '#.00';
$expected = '349.99';
-
+
$this->assertEquals($expected, $formatter->format($number, $pattern));
}
function testLocalizedCurrencyFormats2() {
$it = new NumberFormat('it_IT');
-
+
$number = 12.41;
$wanted = '12,41';
$this->assertEquals($wanted, $it->format($number,'d'));
@@ -149,7 +149,7 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase {
$wanted = '10.010,23';
$this->assertEquals($wanted, $it->format($number,'d'));
- $old= setlocale(LC_ALL,"0");
+ $old= setlocale(LC_ALL,"0");
setlocale(LC_ALL,"it_IT");
$number = 12.41;
@@ -167,5 +167,3 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase {
setlocale(LC_ALL,$old);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/unit/IO/AllTests.php b/tests/unit/IO/AllTests.php
index 01bbd95d..c789169f 100644
--- a/tests/unit/IO/AllTests.php
+++ b/tests/unit/IO/AllTests.php
@@ -11,13 +11,13 @@ class IO_AllTests {
public static function main() {
PHPUnit_TextUI_TestRunner::run(self::suite());
}
-
+
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('System.IO');
-
+
$suite->addTestSuite('TTarFileExtractorTest');
$suite->addTestSuite('TTextWriterTest');
-
+
return $suite;
}
}
@@ -25,4 +25,3 @@ class IO_AllTests {
if(PHPUnit_MAIN_METHOD == 'IO_AllTests::main') {
IO_AllTests::main();
}
-?>
diff --git a/tests/unit/IO/TTarFileExtractorTest.php b/tests/unit/IO/TTarFileExtractorTest.php
index 66b66831..860560b1 100644
--- a/tests/unit/IO/TTarFileExtractorTest.php
+++ b/tests/unit/IO/TTarFileExtractorTest.php
@@ -14,10 +14,9 @@ class TTarFileExtractorTest extends PHPUnit_Framework_TestCase {
public function testDestruct() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testExtract() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/IO/TTextWriterTest.php b/tests/unit/IO/TTextWriterTest.php
index d23fec36..087812d7 100644
--- a/tests/unit/IO/TTextWriterTest.php
+++ b/tests/unit/IO/TTextWriterTest.php
@@ -20,7 +20,7 @@ class TTextWriterTest extends PHPUnit_Framework_TestCase {
$writer->write("more text\n");
self::assertEquals("some text\nmore text\n", $writer->flush());
}
-
+
public function testWriteLine() {
$writer = new TTextWriter();
$writer->writeLine('some text');
@@ -28,4 +28,3 @@ class TTextWriterTest extends PHPUnit_Framework_TestCase {
}
}
-?>
diff --git a/tests/unit/Security/AllTests.php b/tests/unit/Security/AllTests.php
index 40316719..e71307a9 100644
--- a/tests/unit/Security/AllTests.php
+++ b/tests/unit/Security/AllTests.php
@@ -14,16 +14,16 @@ class Security_AllTests {
public static function main() {
PHPUnit_TextUI_TestRunner::run(self::suite());
}
-
+
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('System.Security');
-
+
$suite->addTestSuite('TAuthManagerTest');
$suite->addTestSuite('TAuthorizationRuleTest');
$suite->addTestSuite('TSecurityManagerTest');
$suite->addTestSuite('TUserManagerTest');
$suite->addTestSuite('TUserTest');
-
+
return $suite;
}
}
@@ -31,4 +31,3 @@ class Security_AllTests {
if(PHPUnit_MAIN_METHOD == 'Security_AllTests::main') {
Security_AllTests::main();
}
-?>
diff --git a/tests/unit/Security/TAuthManagerTest.php b/tests/unit/Security/TAuthManagerTest.php
index 03244a22..3b8b9305 100644
--- a/tests/unit/Security/TAuthManagerTest.php
+++ b/tests/unit/Security/TAuthManagerTest.php
@@ -8,7 +8,7 @@ Prado::using('System.Xml.TXmlDocument');
* @package System.Security
*/
class TAuthManagerTest extends PHPUnit_Framework_TestCase {
-
+
public static $app = null;
public static $usrMgr = null;
@@ -18,7 +18,7 @@ class TAuthManagerTest extends PHPUnit_Framework_TestCase {
if(self::$app === null) {
self::$app = new TApplication(dirname(__FILE__).'/app');
}
-
+
// Make a fake user manager module
if (self::$usrMgr === null) {
self::$usrMgr=new TUserManager ();
@@ -39,26 +39,26 @@ class TAuthManagerTest extends PHPUnit_Framework_TestCase {
$authManager->init(null);
self::fail ('Expected TConfigurationException not thrown');
} catch (TConfigurationException $e) {}
-
+
$authManager->setUserManager('users');
$authManager->init (null);
self::assertEquals(self::$usrMgr, $authManager->getUserManager());
}
-
+
public function testUserManager() {
$authManager=new TAuthManager ();
$authManager->setUserManager('users');
$authManager->init(null);
self::assertEquals(self::$usrMgr, $authManager->getUserManager());
-
+
// test change
try {
$authManager->setUserManager('invalid');
self::fail ('Expected TInvalidOperationException not thrown');
} catch (TInvalidOperationException $e) {}
-
+
}
-
+
public function testLoginPage() {
$authManager=new TAuthManager ();
$authManager->setUserManager('users');
@@ -66,7 +66,7 @@ class TAuthManagerTest extends PHPUnit_Framework_TestCase {
$authManager->setLoginPage ('LoginPage');
self::assertEquals('LoginPage', $authManager->getLoginPage());
}
-
+
public function testDoAuthentication() {
throw new PHPUnit_Framework_IncompleteTestError();
// Not yet finished, Session won't start because of headers :( :(
@@ -76,41 +76,40 @@ class TAuthManagerTest extends PHPUnit_Framework_TestCase {
$authManager->init(null);
$authManager->setLoginPage ('LoginPage');
self::$app->raiseEvent ('onAuthentication', self::$app, null);
-
+
}
-
+
public function testDoAuthorization() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testLeave() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testReturnUrl() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOnAuthenticate() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOnAuthorize() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testUpdateSessionUser() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testLogin() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testLogout() {
throw new PHPUnit_Framework_IncompleteTestError();
}
}
-?>
diff --git a/tests/unit/Security/TAuthorizationRuleTest.php b/tests/unit/Security/TAuthorizationRuleTest.php
index 5d5f2d97..5bfa6c2c 100644
--- a/tests/unit/Security/TAuthorizationRuleTest.php
+++ b/tests/unit/Security/TAuthorizationRuleTest.php
@@ -16,35 +16,34 @@ class TAuthorizationRuleTest extends PHPUnit_Framework_TestCase {
public function testConstruct() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testAction() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testUsers() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testRoles() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testVerb() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGuestApplied() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testEveryoneApplied() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testIsUserAllowed() {
throw new PHPUnit_Framework_IncompleteTestError();
}
}
-?>
diff --git a/tests/unit/Security/TSecurityManagerTest.php b/tests/unit/Security/TSecurityManagerTest.php
index 09c261cf..9c319a5a 100644
--- a/tests/unit/Security/TSecurityManagerTest.php
+++ b/tests/unit/Security/TSecurityManagerTest.php
@@ -22,39 +22,39 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase {
$sec->init(null);
self::assertEquals ($sec, self::$app->getSecurityManager());
}
-
+
public function testValidationKey() {
$sec=new TSecurityManager ();
$sec->init (null);
// Random validation key
$valkey=$sec->getValidationKey ();
self::assertEquals($valkey, self::$app->getGlobalState(TSecurityManager::STATE_VALIDATION_KEY));
-
+
$sec->setValidationKey ('aKey');
self::assertEquals('aKey',$sec->getValidationKey());
-
+
try {
$sec->setValidationKey ('');
self::fail ('Expected TInvalidDataValueException not thrown');
} catch (TInvalidDataValueException $e) {}
}
-
+
public function testEncryptionKey() {
$sec=new TSecurityManager ();
$sec->init (null);
// Random encryption key
$valkey=$sec->getEncryptionKey ();
self::assertEquals($valkey, self::$app->getGlobalState(TSecurityManager::STATE_ENCRYPTION_KEY));
-
+
$sec->setEncryptionKey ('aKey');
self::assertEquals('aKey',$sec->getEncryptionKey());
-
+
try {
$sec->setEncryptionKey ('');
self::fail ('Expected TInvalidDataValueException not thrown');
} catch (TInvalidDataValueException $e) {}
}
-
+
public function testValidation() {
$sec=new TSecurityManager ();
$sec->init (null);
@@ -67,7 +67,7 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase {
self::fail ('Expected TInvalidDataValueException not thrown');
} catch (TInvalidDataValueException $e) {}
}
-
+
public function testEncryption() {
$sec=new TSecurityManager ();
$sec->init (null);
@@ -79,7 +79,7 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase {
self::assertEquals('NotExisting', $sec->getCryptAlgorithm());
}
}
-
+
public function testEncryptDecrypt() {
$sec=new TSecurityManager ();
$sec->init (null);
@@ -101,13 +101,13 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase {
self::assertEquals($plainText,$decrypted);
- // try change key
+ // try change key
$sec->setEncryptionKey ('anotherKey');
self::assertNotEquals($plainText, $sec->decrypt($encrypted));
}
}
-
-
+
+
public function testHashData() {
$sec=new TSecurityManager ();
$sec->init (null);
@@ -118,7 +118,7 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase {
self::assertEquals (54, strlen($hashed));
// The initial text should be after the initial hash
self::assertEquals ('A text to hash', substr($hashed,40));
-
+
// Same tests with MD5
$sec->setValidationKey('AnotherKey');
$sec->setValidation('MD5');
@@ -128,7 +128,7 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase {
// The initial text should be after the initial hash
self::assertEquals ('A text to hash', substr($hashed,32));
}
-
+
public function testValidateData() {
$sec=new TSecurityManager ();
$sec->init (null);
@@ -142,8 +142,7 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase {
// and a test without tampered data
self::assertFalse($sec->validateData('bad'));
}
-
+
}
-?>
diff --git a/tests/unit/Security/TUserManagerTest.php b/tests/unit/Security/TUserManagerTest.php
index edb7ea6f..91b9d0c6 100644
--- a/tests/unit/Security/TUserManagerTest.php
+++ b/tests/unit/Security/TUserManagerTest.php
@@ -6,18 +6,18 @@ Prado::using('System.Security.TUserManager');
* @package System.Security
*/
class TUserManagerTest extends PHPUnit_Framework_TestCase {
-
+
public static $app=null;
public static $config=null;
-
+
public function setUp() {
-
+
if(self::$app === null) {
self::$app = new TApplication(dirname(__FILE__).'/app');
prado::setPathofAlias('App', dirname(__FILE__));
}
-
+
if (self::$config === null) {
// Simulate a config file
self::$config=new TXmlDocument('1.0','utf8');
@@ -41,21 +41,21 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase {
$userManager->init (new TXmlDocument()); // Empty config
self::assertEquals(array('joe'=>'demo','john'=>'demo', 'test' => 'test'), $userManager->getUsers());
unlink (dirname(__FILE__).'/users.xml');
- }
+ }
}
-
+
public function testUsers() {
$userManager=new TUserManager ();
$userManager->init (self::$config);
self::assertEquals(array('joe'=>'demo','john'=>'demo', 'test' => 'test'), $userManager->getUsers());
}
-
+
public function testRoles() {
$userManager=new TUserManager ();
$userManager->init (self::$config);
self::assertEquals(array('joe'=>array ('Writer'), 'john'=>array ('Administrator','Writer'), 'test' => array ('Reader', 'User')), $userManager->getRoles());
}
-
+
public function testUserFile() {
$userManager=new TUserManager ();
try {
@@ -71,7 +71,7 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase {
self::assertEquals(dirname(__FILE__).'/users.xml', $userManager->getUserFile());
unlink (dirname(__FILE__).'/users.xml');
$userManager=null;
- }
+ }
$userManager=new TUserManager ();
$userManager->init (self::$config);
try {
@@ -79,14 +79,14 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase {
self::fail ('Exception TInvalidOperationException not thrown');
} catch (TInvalidOperationException $e) {}
}
-
+
public function testGuestName() {
$userManager=new TUserManager ();
self::assertEquals('Guest', $userManager->getGuestName());
$userManager->setGuestName('Invite');
self::assertEquals('Invite', $userManager->getGuestName());
}
-
+
public function testPasswordMode() {
$userManager=new TUserManager ();
$userManager->setPasswordMode('Clear');
@@ -99,9 +99,9 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase {
$userManager->setPasswordMode('Invalid');
self::fail ('Exception TInvalidDataValueException not thrown');
} catch (TInvalidDataValueException $e) {}
-
+
}
-
+
public function testValidateUser() {
$userManager=new TUserManager ();
$userManager->init (self::$config);
@@ -109,7 +109,7 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase {
self::assertTrue($userManager->validateUser('Joe', 'demo'));
self::assertFalse($userManager->validateUser('John', 'bad'));
}
-
+
public function testUser() {
$userManager=new TUserManager ();
$userManager->init (self::$config);
@@ -123,7 +123,7 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase {
self::assertFalse($user->getIsGuest());
self::assertNull($userManager->getUser('badUser'));
}
-
+
public function testSwitchToGuest() {
$userManager=new TUserManager ();
$userManager->init (self::$config);
@@ -134,4 +134,3 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase {
}
-?>
diff --git a/tests/unit/Security/TUserTest.php b/tests/unit/Security/TUserTest.php
index 6fa337e0..3692b97c 100644
--- a/tests/unit/Security/TUserTest.php
+++ b/tests/unit/Security/TUserTest.php
@@ -32,18 +32,18 @@ class TUserTest extends PHPUnit_Framework_TestCase {
self::assertEquals('Guest', $user->getName());
self::assertEquals(self::$mgr, $user->getManager());
}
-
+
public function testManager() {
$user = new TUser (self::$mgr);
self::assertEquals(self::$mgr, $user->getManager());
}
-
+
public function testName() {
$user = new TUser (self::$mgr);
$user->setName('joe');
self::assertEquals('joe', $user->getName());
}
-
+
public function testIsGuest() {
$user = new TUser (self::$mgr);
$user->setName('John');
@@ -54,7 +54,7 @@ class TUserTest extends PHPUnit_Framework_TestCase {
self::assertTrue($user->getIsGuest());
self::assertEquals(array(),$user->getRoles());
}
-
+
public function testRoles() {
$user=new TUser(self::$mgr);
$user->setRoles(array('Administrator','Writer'));
@@ -62,7 +62,7 @@ class TUserTest extends PHPUnit_Framework_TestCase {
$user->setRoles('Reader,User');
self::assertEquals(array('Reader','User'), $user->getRoles());
}
-
+
public function testIsInRole() {
$user=new TUser(self::$mgr);
$user->setRoles(array('Administrator','Writer'));
@@ -71,7 +71,7 @@ class TUserTest extends PHPUnit_Framework_TestCase {
self::assertTrue($user->IsInRole('Writer'));
self::assertFalse($user->isInRole('Reader'));
}
-
+
public function testSaveToString() {
$user = new TUser (self::$mgr);
$user->setName('John');
@@ -81,20 +81,20 @@ class TUserTest extends PHPUnit_Framework_TestCase {
$assumedState=array ('Name' => 'John', 'IsGuest' => false, 'Roles' => array ('Administrator', 'Writer'));
self::assertEquals(serialize($assumedState), $user->saveToString());
}
-
+
public function testLoadFromString() {
$user = new TUser (self::$mgr);
$user->setName('John');
$user->setIsGuest(false);
$user->setRoles('Administrator, Writer');
$save=$user->saveToString();
-
+
$user2 = new TUser (self::$mgr);
$user2->loadFromString($save);
-
+
self::assertEquals($user, $user2);
}
-
+
/* getState & setState are protected methods, will be tested with other tests.
public function testState() {
throw new PHPUnit_Framework_IncompleteTestError();
@@ -111,4 +111,3 @@ class TUserTest extends PHPUnit_Framework_TestCase {
}
-?>
diff --git a/tests/unit/TComponentTest.php b/tests/unit/TComponentTest.php
index 93668dc0..9a2299da 100644
--- a/tests/unit/TComponentTest.php
+++ b/tests/unit/TComponentTest.php
@@ -13,24 +13,24 @@ class NewComponent extends TComponent {
public function getAutoGlobalListen() {
return true;
- }
+ }
public function getText() {
return $this->_text;
}
-
+
public function setText($value) {
$this->_text=$value;
}
-
+
public function getReadOnlyProperty() {
return 'read only';
}
-
+
public function getJsReadOnlyJsProperty() {
return 'js read only';
}
-
+
public function getObject() {
if(!$this->_object) {
$this->_object=new NewComponent;
@@ -38,19 +38,19 @@ class NewComponent extends TComponent {
}
return $this->_object;
}
-
+
public function onMyEvent($param) {
$this->raiseEvent('OnMyEvent',$this,$param);
}
-
+
public function myEventHandler($sender,$param) {
$this->_eventHandled=true;
}
-
+
public function eventReturnValue($sender,$param) {
return $param->Return;
}
-
+
public function isEventHandled() {
return $this->_eventHandled;
}
@@ -82,14 +82,14 @@ class NewComponentNoListen extends NewComponent {
class DynamicCatchingComponent extends NewComponentNoListen implements IDynamicMethods {
public function __dycall($method, $args) {
-
+
}
}
class GlobalRaiseComponent extends NewComponent implements IDynamicMethods {
private $_callorder = array();
-
+
public function getCallOrders()
{
return $this->_callorder;
@@ -128,7 +128,7 @@ class FooClassBehavior extends TClassBehavior {
class FooFooClassBehavior extends FooClassBehavior {
public function faafaaEverMore($object, $laa, $sol) {
-
+
}
}
@@ -146,7 +146,7 @@ class FooBehavior extends TBehavior {
}
}
class FooFooBehavior extends FooBehavior {
-
+
public function faafaaEverMore($laa, $sol) {
return sqrt($laa * $laa + $sol * $sol);
}
@@ -162,11 +162,11 @@ class PreBarBehavior extends TBehavior {
class BarBehavior extends PreBarBehavior implements IInstanceCheck {
private $_instanceReturn = null;
-
+
public function moreFunction($laa, $sol) {
return pow($laa+$sol+1, 2);
}
-
+
public function isinstanceof($class, $instance=null) {
return $this->_instanceReturn;
}
@@ -200,7 +200,7 @@ class BehaviorTestBehavior extends TBehavior {
public function getReadOnly() {
return true;
}
-
+
public function onBehaviorEvent($sender, $param,$responsetype=null,$postfunction=null) {
return $this->getOwner()->raiseEvent('onBehaviorEvent',$sender,$param,$responsetype,$postfunction);
}
@@ -264,40 +264,40 @@ class dy3ClassTextReplace extends dy1ClassTextReplace {
class IntraObjectExtenderBehavior extends TBehavior {
-
+
private $lastCall = null;
private $arglist = null;
-
+
public function getLastCall() {
$v = $this->lastCall;
$this->lastCall = null;
return $v;
}
-
+
public function getLastArgumentList() {
$v = $this->arglist;
$this->arglist = null;
return $v;
}
-
-
-
+
+
+
public function dyListen($fx, $chain) {
$this->lastCall = 1;
$this->arglist = func_get_args();
-
+
return $chain->dyListen($fx); // Calls the next event, within a chain
}
public function dyUnlisten($fx, $chain) {
$this->lastCall = 2;
$this->arglist = func_get_args();
-
+
return $chain->dyUnlisten($fx);
}
public function dyPreRaiseEvent($name,$sender,$param,$responsetype,$postfunction, $chain) {
$this->lastCall = 3;
$this->arglist = func_get_args();
-
+
return $chain->dyPreRaiseEvent($name);// Calls the next event, within a chain, if parameters are left off, they are filled in with
// the original parameters passed to the dynamic event. Parameters can be passed if they are changed.
}
@@ -409,7 +409,7 @@ class TDynamicClassBehavior extends TClassBehavior implements IDynamicMethods {
* @package System
*/
class TComponentTest extends PHPUnit_Framework_TestCase {
-
+
protected $component;
public function setUp() {
@@ -424,21 +424,21 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
$this->component->unlisten();
$this->component = null;
}
-
-
+
+
public function testGetListeningToGlobalEvents() {
$this->assertEquals(true, $this->component->getListeningToGlobalEvents());
$this->component->unlisten();
$this->assertEquals(false, $this->component->getListeningToGlobalEvents());
}
-
-
+
+
public function testConstructorAutoListen() {
// the default object auto installs class behavior hooks
$this->assertEquals(1, $this->component->getEventHandlers('fxAttachClassBehavior')->getCount());
$this->assertEquals(1, $this->component->getEventHandlers('fxDetachClassBehavior')->getCount());
$this->assertTrue($this->component->getListeningToGlobalEvents());
-
+
// this object does not auto install class behavior hooks, thus not changing the global event structure.
// Creating a new instance should _not_ influence the fxAttachClassBehavior and fxDetachClassBehavior
// count.
@@ -447,655 +447,655 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
$this->assertEquals(1, $this->component->getEventHandlers('fxDetachClassBehavior')->getCount());
$this->assertEquals(1, $component_nolisten->getEventHandlers('fxAttachClassBehavior')->getCount());
$this->assertEquals(1, $component_nolisten->getEventHandlers('fxDetachClassBehavior')->getCount());
-
- // tests order of class behaviors when a parent and class have class behavior.
+
+ // tests order of class behaviors when a parent and class have class behavior.
// The child should override the parent object-oriented programming style
$this->component->attachClassBehavior('Bar', 'BarBehavior', 'NewComponentNoListen');
$this->component->attachClassBehavior('FooBar', 'FooBarBehavior', 'NewComponent');
-
+
//create new object with new class behaviors built in, defined in the two lines above
$component = new NewComponentNoListen;
-
+
$this->assertEquals(25, $component->moreFunction(2, 2));
-
+
$this->assertEquals(25, $component->Bar->moreFunction(2, 2));
$this->assertEquals(8, $component->FooBar->moreFunction(2, 2));
-
+
$component->unlisten();// unwind object and class behaviors
$this->component->detachClassBehavior('FooBar', 'NewComponent');
$this->component->detachClassBehavior('Bar', 'NewComponentNoListen');
-
+
}
-
-
+
+
public function testListenAndUnlisten() {
-
+
$component = new NewComponentNoListen();
-
+
$this->assertEquals(false, $component->getListeningToGlobalEvents());
-
+
//This is from $this->component being instanced and listening. $component is accessing the global event structure
$this->assertEquals(1, $component->getEventHandlers('fxAttachClassBehavior')->getCount());
-
+
$this->assertEquals(2, $component->listen());
-
+
$this->assertEquals(true, $component->getListeningToGlobalEvents());
-
+
//This is from $this->component being instanced and listening. $component is accessing the global event structure
$this->assertEquals(2, $component->getEventHandlers('fxAttachClassBehavior')->getCount());
-
+
$this->assertEquals(2, $component->unlisten());
-
+
$this->assertEquals(false, $component->getListeningToGlobalEvents());
-
+
//This is from $this->component being instanced and listening. $component is accessing the global event structure
$this->assertEquals(1, $component->getEventHandlers('fxAttachClassBehavior')->getCount());
}
-
-
+
+
public function testListenAndUnlistenWithDynamicEventCatching() {
-
+
$component = new DynamicCatchingComponent();
-
+
$this->assertEquals(false, $component->getListeningToGlobalEvents());
-
+
//This is from $this->component being instanced and listening. $component is accessing the global event structure
$this->assertEquals(0, $component->getEventHandlers(TComponent::GLOBAL_RAISE_EVENT_LISTENER)->getCount());
-
+
// this adds the fxAttachClassBehavior, fxDetachClassBehavior, and __dycall of the component
$this->assertEquals(3, $component->listen());
-
+
$this->assertEquals(true, $component->getListeningToGlobalEvents());
-
+
//This is from $this->component being instanced and listening. $component is accessing the global event structure
$this->assertEquals(1, $component->getEventHandlers(TComponent::GLOBAL_RAISE_EVENT_LISTENER)->getCount());
-
+
$this->assertEquals(3, $component->unlisten());
-
+
$this->assertEquals(false, $component->getListeningToGlobalEvents());
-
+
//This is from $this->component being instanced and listening. $component is accessing the global event structure
$this->assertEquals(0, $component->getEventHandlers(TComponent::GLOBAL_RAISE_EVENT_LISTENER)->getCount());
}
-
-
-
+
+
+
//Test Class behaviors
public function testAttachClassBehavior() {
-
+
// ensure that the class is listening
$this->assertEquals(1, $this->component->getEventHandlers('fxAttachClassBehavior')->getCount());
-
+
//Test that the component is not a FooClassBehavior
$this->assertNull($this->component->asa('FooClassBehavior'), "Component is already a FooClassBehavior and should not have this behavior");
-
+
//Add the FooClassBehavior
$this->component->attachClassBehavior('FooClassBehavior', new FooClassBehavior);
-
+
//Test that the existing listening component can be a FooClassBehavior
$this->assertNotNull($this->component->asa('FooClassBehavior'), "Component is does not have the FooClassBehavior and should have this behavior");
-
+
// test if the function modifies new instances of the object
$anothercomponent = new NewComponent();
-
+
//The new component should be a FooClassBehavior
$this->assertNotNull($anothercomponent->asa('FooClassBehavior'), "anothercomponent does not have the FooClassBehavior");
-
+
// test when overwriting an existing class behavior, it should throw an TInvalidOperationException
try {
$this->component->attachClassBehavior('FooClassBehavior', new BarClassBehavior);
$this->fail('TInvalidOperationException not raised when overwriting an existing behavior');
} catch(TInvalidOperationException $e) {
}
-
-
+
+
// test when overwriting an existing class behavior, it should throw an TInvalidOperationException
try {
$this->component->attachClassBehavior('FooBarBehavior', 'FooBarBehavior', 'TComponent');
$this->fail('TInvalidOperationException not raised when trying to place a behavior on the root object TComponent');
} catch(TInvalidOperationException $e) {
}
-
-
+
+
// test if the function does not modify any existing objects that are not listening
// The FooClassBehavior is already a part of the class behaviors thus the new instance gets the behavior.
$nolistencomponent = new NewComponentNoListen();
-
+
// test if the function modifies all existing objects that are listening
// Adding a behavior to the first object, the second instance should automatically get the class behavior.
// This is because the second object is listening to the global events of class behaviors
$this->component->attachClassBehavior('BarClassBehavior', new BarClassBehavior);
$this->assertNotNull($anothercomponent->asa('BarClassBehavior'), "anothercomponent is does not have the BarClassBehavior");
-
+
// The no listen object should not have the BarClassBehavior because it was added as a class behavior after the object was instanced
$this->assertNull($nolistencomponent->asa('BarClassBehavior'), "nolistencomponent has the BarClassBehavior and should not");
-
+
// But the no listen object should have the FooClassBehavior because the class behavior was installed before the object was instanced
$this->assertNotNull($nolistencomponent->asa('FooClassBehavior'), "nolistencomponent is does not have the FooClassBehavior");
-
+
//Clear out what was done during this test
$anothercomponent->unlisten();
$this->component->detachClassBehavior('FooClassBehavior');
$this->component->detachClassBehavior('BarClassBehavior');
-
+
// Test attaching of single object behaviors as class-wide behaviors
$this->component->attachClassBehavior('BarBehaviorObject', 'BarBehavior');
$this->assertTrue($this->component->asa('BarBehaviorObject') instanceof BarBehavior);
$this->assertEquals($this->component->BarBehaviorObject->Owner, $this->component);
$this->component->detachClassBehavior('BarBehaviorObject');
}
-
-
-
-
-
+
+
+
+
+
public function testDetachClassBehavior() {
// ensure that the component is listening
$this->assertEquals(1, $this->component->getEventHandlers('fxDetachClassBehavior')->getCount());
-
+
$prenolistencomponent = new NewComponentNoListen();
-
+
//Attach a class behavior
$this->component->attachClassBehavior('FooClassBehavior', new FooClassBehavior);
-
+
//Create new components that listen and don't listen to global events
$anothercomponent = new NewComponent();
$postnolistencomponent = new NewComponentNoListen();
-
+
//ensures that all the Components are properly initialized
$this->assertEquals(2, $this->component->getEventHandlers('fxDetachClassBehavior')->getCount());
$this->assertNotNull($this->component->asa('FooClassBehavior'), "Component does not have the FooClassBehavior and should have this behavior");
$this->assertNull($prenolistencomponent->asa('FooClassBehavior'), "Component has the FooClassBehavior and should _not_ have this behavior");
$this->assertNotNull($anothercomponent->asa('FooClassBehavior'), "Component does not have the FooClassBehavior and should have this behavior");
$this->assertNotNull($postnolistencomponent->asa('FooClassBehavior'), "Component does not have the FooClassBehavior and should have this behavior");
-
-
+
+
$this->component->detachClassBehavior('FooClassBehavior');
-
+
$this->assertNull($this->component->asa('FooClassBehavior'), "Component has the FooClassBehavior and should _not_ have this behavior");
$this->assertNull($prenolistencomponent->asa('FooClassBehavior'), "Component has the FooClassBehavior and should _not_ have this behavior");
$this->assertNull($anothercomponent->asa('FooClassBehavior'), "Component has the FooClassBehavior and should _not_ have this behavior");
$this->assertNotNull($postnolistencomponent->asa('FooClassBehavior'), "Component does not have the FooClassBehavior and should have this behavior");
-
-
+
+
//tear down function variables
$anothercomponent->unlisten();
}
-
+
public function testGetClassHierarchy() {
$component = new DynamicCatchingComponent;
$this->assertEquals(array('TComponent', 'NewComponent', 'NewComponentNoListen', 'DynamicCatchingComponent'), $component->getClassHierarchy());
$this->assertEquals(array('TComponent', 'NewComponent', 'NewComponentNoListen', 'DynamicCatchingComponent'), $component->getClassHierarchy(false));
$this->assertEquals(array('tcomponent', 'newcomponent', 'newcomponentnolisten', 'dynamiccatchingcomponent'), $component->getClassHierarchy(true));
}
-
-
+
+
public function testAsA() {
$anothercomponent = new NewComponent();
-
+
// ensure the component does not have the FooClassBehavior
$this->assertNull($this->component->asa('FooClassBehavior'));
$this->assertNull($this->component->asa('FooFooClassBehavior'));
$this->assertNull($this->component->asa('BarClassBehavior'));
$this->assertNull($this->component->asa('NonExistantClassBehavior'));
-
+
$this->assertNull($anothercomponent->asa('FooClassBehavior'));
$this->assertNull($anothercomponent->asa('FooFooClassBehavior'));
$this->assertNull($anothercomponent->asa('BarClassBehavior'));
$this->assertNull($anothercomponent->asa('NonExistantClassBehavior'));
-
+
// add the class behavior
$this->component->attachClassBehavior('FooClassBehavior', new FooClassBehavior);
-
+
//Check that the component has only the class behavior assigned
$this->assertNotNull($this->component->asa('FooClassBehavior'));
$this->assertNull($this->component->asa('FooFooClassBehavior'));
$this->assertNull($this->component->asa('BarClassBehavior'));
$this->assertNull($this->component->asa('NonExistantClassBehavior'));
-
+
//Check that the component has only the class behavior assigned
$this->assertNotNull($anothercomponent->asa('FooClassBehavior'));
$this->assertNull($anothercomponent->asa('FooFooClassBehavior'));
$this->assertNull($anothercomponent->asa('BarClassBehavior'));
$this->assertNull($anothercomponent->asa('NonExistantClassBehavior'));
-
+
// remove the class behavior
$this->component->detachClassBehavior('FooClassBehavior');
-
+
// Check the function doesn't have the behavior any more
$this->assertNull($this->component->asa('FooClassBehavior'));
$this->assertNull($this->component->asa('FooFooClassBehavior'));
$this->assertNull($this->component->asa('BarClassBehavior'));
$this->assertNull($this->component->asa('NonExistantClassBehavior'));
-
+
$this->assertNull($anothercomponent->asa('FooClassBehavior'));
$this->assertNull($anothercomponent->asa('FooFooClassBehavior'));
$this->assertNull($anothercomponent->asa('BarClassBehavior'));
$this->assertNull($anothercomponent->asa('NonExistantClassBehavior'));
-
-
-
-
+
+
+
+
$this->component->attachBehavior('BarBehavior', new BarBehavior);
-
+
//Check that the component has only the object behavior assigned
$this->assertNull($this->component->asa('FooBehavior'));
$this->assertNull($this->component->asa('FooFooBehavior'));
$this->assertNotNull($this->component->asa('BarBehavior'));
$this->assertNull($this->component->asa('NonExistantBehavior'));
-
+
//Check that the component has the behavior assigned
$this->assertNull($anothercomponent->asa('FooBehavior'));
$this->assertNull($anothercomponent->asa('FooFooBehavior'));
$this->assertNull($anothercomponent->asa('BarBehavior'));
$this->assertNull($anothercomponent->asa('NonExistantBehavior'));
-
+
$this->component->detachBehavior('BarBehavior');
-
+
//Check that the component has no object behaviors assigned
$this->assertNull($this->component->asa('FooBehavior'));
$this->assertNull($this->component->asa('FooFooBehavior'));
$this->assertNull($this->component->asa('BarBehavior'));
$this->assertNull($this->component->asa('NonExistantBehavior'));
-
+
//Check that the component has no behavior assigned
$this->assertNull($anothercomponent->asa('FooBehavior'));
$this->assertNull($anothercomponent->asa('FooFooBehavior'));
$this->assertNull($anothercomponent->asa('BarBehavior'));
$this->assertNull($anothercomponent->asa('NonExistantBehavior'));
-
+
$anothercomponent->unlisten();
}
-
+
public function testIsA() {
//This doesn't check the IInstanceCheck functionality, separate function
-
+
$this->assertTrue($this->component->isa('TComponent'));
$this->assertTrue($this->component->isa('NewComponent'));
$this->assertFalse($this->component->isa(new FooBehavior));
$this->assertFalse($this->component->isa('FooBehavior'));
-
+
//Ensure there is no BarBehavior
$this->assertNull($this->component->asa('FooFooBehavior'));
-
+
$this->assertFalse($this->component->isa('FooBehavior'));
$this->assertFalse($this->component->isa('FooFooBehavior'));
-
+
$this->component->attachBehavior('FooFooBehavior', new FooFooBehavior);
-
+
$this->assertNotNull($this->component->asa('FooFooBehavior'));
-
+
$this->assertTrue($this->component->isa('FooBehavior'));
$this->assertTrue($this->component->isa('FooFooBehavior'));
-
+
$this->component->disableBehaviors();
// It still has the behavior
$this->assertNotNull($this->component->asa('FooFooBehavior'));
-
+
// But it is not expressed
$this->assertFalse($this->component->isa('FooBehavior'));
$this->assertFalse($this->component->isa('FooFooBehavior'));
-
+
$this->component->enableBehaviors();
$this->assertNotNull($this->component->asa('FooFooBehavior'));
-
+
$this->assertTrue($this->component->isa('FooFooBehavior'));
-
-
-
+
+
+
$this->component->attachBehavior('FooBarBehavior', new FooBarBehavior);
-
+
$this->assertTrue($this->component->isa('FooBehavior'));
$this->assertTrue($this->component->isa('FooBarBehavior'));
-
+
$this->component->disableBehavior('FooBarBehavior');
-
+
$this->assertTrue($this->component->isa('FooBehavior'));
$this->assertFalse($this->component->isa('FooBarBehavior'));
-
+
$this->component->enableBehavior('FooBarBehavior');
$this->component->disableBehavior('FooFooBehavior');
$this->assertFalse($this->component->isa('FooBehavior'));
$this->assertFalse($this->component->isa('FooFooBehavior'));
$this->assertTrue($this->component->isa('FooBarBehavior'));
-
+
$this->component->disableBehavior('FooBarBehavior');
$this->component->disableBehavior('FooFooBehavior');
-
+
$this->assertFalse($this->component->isa('FooBehavior'));
$this->assertFalse($this->component->isa('FooFooBehavior'));
$this->assertFalse($this->component->isa('FooBarBehavior'));
-
+
$this->component->enableBehavior('FooBarBehavior');
$this->component->enableBehavior('FooFooBehavior');
-
+
$this->assertTrue($this->component->isa('FooFooBehavior'));
$this->assertTrue($this->component->isa('FooBarBehavior'));
-
-
+
+
$this->component->detachBehavior('FooFooBehavior');
$this->component->detachBehavior('FooBarBehavior');
-
+
$this->assertFalse($this->component->isa(new FooBehavior));
$this->assertFalse($this->component->isa('FooBehavior'));
$this->assertFalse($this->component->isa(new FooFooBehavior));
$this->assertFalse($this->component->isa('FooFooBehavior'));
$this->assertFalse($this->component->isa(new FooBarBehavior));
$this->assertFalse($this->component->isa('FooBarBehavior'));
-
+
}
-
+
public function testIsA_with_IInstanceCheck() {
-
+
$this->assertTrue($this->component->isa('NewComponent'));
$this->assertFalse($this->component->isa('PreBarBehavior'));
-
+
$this->component->attachBehavior('BarBehavior', $behavior = new BarBehavior);
-
+
$behavior->setInstanceReturn(null);
-
+
$this->assertTrue($this->component->isa('NewComponent'));
$this->assertTrue($this->component->isa('PreBarBehavior'));
$this->assertFalse($this->component->isa('FooBehavior'));
-
+
// This forces the iso on the BarBehavior to respond to any class with false
$behavior->setInstanceReturn(false);
$this->assertFalse($this->component->isa('PreBarBehavior'));
$this->assertFalse($this->component->isa('FooBehavior'));
-
+
//This forces the isa on the BarBehavior to respond to any class with true
$behavior->setInstanceReturn(true);
$this->assertTrue($this->component->isa('FooBehavior'));
-
-
+
+
}
-
+
public function testAttachDetachBehavior() {
-
+
try {
$this->component->faaEverMore(true, true);
$this->fail('TApplicationException not raised trying to execute a undefined class method');
} catch(TApplicationException $e) {}
-
+
$this->assertNull($this->component->asa('FooBehavior'));
$this->assertFalse($this->component->isa('FooBehavior'));
$this->assertNull($this->component->asa('BarBehavior'));
$this->assertFalse($this->component->isa('BarBehavior'));
-
+
try {
$this->component->attachBehavior('FooBehavior', new TComponent);
$this->fail('TApplicationException not raised trying to execute a undefined class method');
} catch(TInvalidDataTypeException $e) {}
-
+
$this->component->attachBehavior('FooBehavior', new FooBehavior);
-
+
$this->assertNotNull($this->component->asa('FooBehavior'));
$this->assertTrue($this->component->isa('FooBehavior'));
$this->assertNull($this->component->asa('BarBehavior'));
$this->assertFalse($this->component->isa('BarBehavior'));
-
+
try {
$this->assertTrue($this->component->faaEverMore(true, true));
} catch(TApplicationException $e) {
$this->fail('TApplicationException raised while trying to execute a behavior class method');
}
-
+
try {
$this->component->noMethodHere(true);
$this->fail('TApplicationException not raised trying to execute a undefined class method');
} catch(TApplicationException $e) {}
-
+
$this->assertTrue($this->component->disableBehavior('FooBehavior'));
-
+
//BarBehavior is not a behavior at this time
$this->assertNull($this->component->disableBehavior('BarBehavior'));
-
+
try {
$this->component->faaEverMore(true, true);
$this->fail('TApplicationException not raised trying to execute a undefined class method');
} catch(TApplicationException $e) {}
-
+
$this->assertTrue($this->component->enableBehavior('FooBehavior'));
-
+
//BarBehavior is not a behavior at this time
$this->assertNull($this->component->enableBehavior('BarBehavior'));
-
+
try {
$this->assertTrue($this->component->faaEverMore(true, true));
} catch(TApplicationException $e) {
$this->fail('TApplicationException raised while trying to execute a behavior class method');
}
-
+
$this->component->detachBehavior('FooBehavior');
-
+
$this->assertNull($this->component->asa('FooBehavior'));
$this->assertFalse($this->component->isa('FooBehavior'));
$this->assertNull($this->component->asa('BarBehavior'));
$this->assertFalse($this->component->isa('BarBehavior'));
-
+
}
-
+
public function testAttachDetachBehaviors() {
$this->assertNull($this->component->asa('FooBehavior'));
$this->assertNull($this->component->asa('BarBehavior'));
$this->assertNull($this->component->asa('FooBarBehavior'));
$this->assertNull($this->component->asa('PreBarBehavior'));
-
+
$this->component->attachBehaviors(array('FooFooBehavior' => new FooFooBehavior, 'BarBehavior' => new BarBehavior, 'PreBarBehavior' => new PreBarBehavior));
-
+
$this->assertNull($this->component->asa('FooBehavior'));
$this->assertNotNull($this->component->asa('FooFooBehavior'));
$this->assertNotNull($this->component->asa('BarBehavior'));
$this->assertNull($this->component->asa('FooBarBehavior'));
$this->assertNotNull($this->component->asa('PreBarBehavior'));
-
+
$this->assertTrue($this->component->isa('FooFooBehavior'));
$this->assertTrue($this->component->isa('FooBehavior'));
$this->assertTrue($this->component->isa('BarBehavior'));
$this->assertTrue($this->component->isa('PreBarBehavior'));
$this->assertFalse($this->component->isa('FooBarBehavior'));
-
+
$this->component->detachBehaviors(array('FooFooBehavior' => new FooFooBehavior, 'BarBehavior' => new BarBehavior));
-
+
$this->assertNull($this->component->asa('FooBehavior'));
$this->assertNull($this->component->asa('FooFooBehavior'));
$this->assertNull($this->component->asa('BarBehavior'));
$this->assertNull($this->component->asa('FooBarBehavior'));
$this->assertNotNull($this->component->asa('PreBarBehavior'));
-
+
$this->assertFalse($this->component->isa('FooFooBehavior'));
$this->assertFalse($this->component->isa('FooBehavior'));
$this->assertFalse($this->component->isa('BarBehavior'));
$this->assertFalse($this->component->isa('FooBarBehavior'));
$this->assertTrue($this->component->isa('PreBarBehavior'));
-
-
-
+
+
+
// testing if we can detachBehaviors just by the name of the behavior instead of an array of the behavior
$this->component->attachBehaviors(array('FooFooBehavior' => new FooFooBehavior, 'BarBehavior' => new BarBehavior));
-
+
$this->assertTrue($this->component->isa('FooBehavior'));
$this->assertTrue($this->component->isa('BarBehavior'));
-
+
$this->component->detachBehaviors(array('FooFooBehavior', 'BarBehavior'));
-
+
$this->assertNull($this->component->asa('FooBehavior'));
$this->assertNull($this->component->asa('FooFooBehavior'));
$this->assertNull($this->component->asa('BarBehavior'));
$this->assertNull($this->component->asa('FooBarBehavior'));
-
+
$this->assertFalse($this->component->isa('FooFooBehavior'));
$this->assertFalse($this->component->isa('FooBehavior'));
$this->assertFalse($this->component->isa('BarBehavior'));
$this->assertFalse($this->component->isa('FooBarBehavior'));
}
-
-
+
+
public function testClearBehaviors() {
-
+
$this->assertNull($this->component->asa('FooBehavior'));
$this->assertNull($this->component->asa('BarBehavior'));
$this->assertNull($this->component->asa('FooBarBehavior'));
$this->assertNull($this->component->asa('PreBarBehavior'));
-
+
$this->component->attachBehaviors(array('FooFooBehavior' => new FooFooBehavior, 'BarBehavior' => new BarBehavior, 'PreBarBehavior' => new PreBarBehavior));
-
+
$this->assertNull($this->component->asa('FooBehavior'));
$this->assertNotNull($this->component->asa('FooFooBehavior'));
$this->assertNotNull($this->component->asa('BarBehavior'));
$this->assertNull($this->component->asa('FooBarBehavior'));
$this->assertNotNull($this->component->asa('PreBarBehavior'));
-
+
$this->component->clearBehaviors();
-
+
$this->assertNull($this->component->asa('FooBehavior'));
$this->assertNull($this->component->asa('BarBehavior'));
$this->assertNull($this->component->asa('FooBarBehavior'));
$this->assertNull($this->component->asa('PreBarBehavior'));
}
-
+
public function testEnableDisableBehavior() {
-
+
$this->assertNull($this->component->enableBehavior('FooBehavior'));
$this->assertNull($this->component->disableBehavior('FooBehavior'));
-
+
try {
$this->component->faaEverMore(true, true);
$this->fail('TApplicationException not raised trying to execute a undefined class method');
} catch(TApplicationException $e) {}
-
+
$this->component->attachBehavior('FooBehavior', new FooBehavior);
-
+
$this->assertTrue($this->component->isa('FooBehavior'));
try {
$this->assertTrue($this->component->faaEverMore(true, true));
} catch(TApplicationException $e) {
$this->fail('TApplicationException raised while trying to execute a behavior class method');
}
-
+
$this->assertTrue($this->component->disableBehavior('FooBehavior'));
-
+
$this->assertFalse($this->component->isa('FooBehavior'));
-
+
try {
$this->component->faaEverMore(true, true);
$this->fail('TApplicationException not raised trying to execute a undefined class method');
} catch(TApplicationException $e) {}
-
+
$this->assertTrue($this->component->enableBehavior('FooBehavior'));
-
+
$this->assertTrue($this->component->isa('FooBehavior'));
try {
$this->assertTrue($this->component->faaEverMore(true, true));
} catch(TApplicationException $e) {
$this->fail('TApplicationException raised while trying to execute a behavior class method');
}
-
-
-
+
+
+
$this->assertNull($this->component->enableBehavior('BarClassBehavior'));
$this->assertNull($this->component->disableBehavior('BarClassBehavior'));
-
+
try {
$this->component->moreFunction(true, true);
$this->fail('TApplicationException not raised trying to execute an undefined class method');
} catch(TApplicationException $e) {}
-
+
$this->component->attachClassBehavior('BarClassBehavior', new BarClassBehavior);
-
+
$this->assertFalse($this->component->enableBehavior('BarClassBehavior'));
$this->assertFalse($this->component->disableBehavior('BarClassBehavior'));
-
+
try {
$this->assertTrue($this->component->moreFunction(true, true));
} catch(TApplicationException $e) {
$this->fail('TApplicationException raised while trying to execute a behavior class method');
}
-
+
$this->component->detachClassBehavior('BarClassBehavior');
}
-
-
+
+
public function testBehaviorFunctionCalls() {
-
+
$this->component->attachBehavior('FooBarBehavior', $behavior = new FooBarBehavior);
$this->component->attachClassBehavior('FooClassBehavior', $classbehavior = new FooClassBehavior);
-
+
// Test the Class Methods
$this->assertEquals(12, $this->component->faaEverMore(3, 4));
-
+
// Check that the called object is shifted in front of the array of a class behavior call
$this->assertEquals($this->component, $this->component->getLastClassObject());
-
-
+
+
//Test the FooBarBehavior
$this->assertEquals(27, $this->component->moreFunction(3, 3));
-
+
$this->assertTrue($this->component->disableBehavior('FooBarBehavior'));
try {
$this->assertNull($this->component->moreFunction(3, 4));
$this->fail('TApplicationException not raised trying to execute a disabled behavior');
} catch(TApplicationException $e) {}
$this->assertTrue($this->component->enableBehavior('FooBarBehavior'));
-
+
// Test the global event space, this should work and return false because no function implements these methods
$this->assertNull($this->component->fxSomeUndefinedGlobalEvent());
$this->assertNull($this->component->dySomeUndefinedIntraObjectEvent());
-
+
$this->component->detachClassBehavior('FooClassBehavior');
-
-
-
+
+
+
// test object instance behaviors implemented through class-wide behaviors
$this->component->attachClassBehavior('FooFooBehaviorAsClass', 'FooFooBehavior');
-
+
$component = new NewComponent;
-
+
$this->assertEquals(5, $this->component->faafaaEverMore(3, 4));
$this->assertEquals(10, $component->faafaaEverMore(6, 8));
-
+
$this->component->detachClassBehavior('FooFooBehaviorAsClass');
$component->unlisten();
$component = null;
-
+
try {
$this->component->faafaaEverMore(3, 4);
$this->fail('TApplicationException not raised trying to execute a disabled behavior');
} catch(TApplicationException $e) {}
-
-
-
+
+
+
// make a call to an unpatched fx and dy call so that it's passed through to the __dycall function
$dynamicComponent = new DynamicCallComponent;
-
+
$this->assertNull($dynamicComponent->fxUndefinedEvent());
$this->assertNull($dynamicComponent->dyUndefinedEvent());
-
+
//This tests the dynamic __dycall function
$this->assertEquals(1024, $dynamicComponent->dyPowerFunction(2, 10));
$this->assertEquals(5, $dynamicComponent->dyDivisionFunction(10, 2));
-
+
$this->assertEquals(2048, $dynamicComponent->fxPowerFunction(2, 10));
$this->assertEquals(10, $dynamicComponent->fxDivisionFunction(10, 2));
-
+
$dynamicComponent->unlisten();
-
+
}
-
+
public function testHasProperty() {
$this->assertTrue($this->component->hasProperty('Text'), "Component hasn't property Text");
$this->assertTrue($this->component->hasProperty('text'), "Component hasn't property text");
$this->assertFalse($this->component->hasProperty('Caption'), "Component has property Caption");
-
+
$this->assertTrue($this->component->hasProperty('ColorAttribute'), "Component hasn't property JsColorAttribute");
$this->assertTrue($this->component->hasProperty('colorattribute'), "Component hasn't property JsColorAttribute");
$this->assertFalse($this->component->canGetProperty('PastelAttribute'), "Component has property JsPastelAttribute");
-
+
$this->assertTrue($this->component->hasProperty('JSColorAttribute'), "Component hasn't property JsColorAttribute");
$this->assertTrue($this->component->hasProperty('jscolorattribute'), "Component hasn't property JsColorAttribute");
$this->assertFalse($this->component->hasProperty('jsPastelAttribute'), "Component has property JsPastelAttribute");
-
+
$this->assertFalse($this->component->hasProperty('Excitement'), "Component has property Excitement");
$this->component->attachBehavior('ExcitementPropBehavior', new BehaviorTestBehavior);
$this->assertTrue($this->component->hasProperty('Excitement'), "Component hasn't property Excitement");
@@ -1107,27 +1107,27 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
$this->assertFalse($this->component->hasProperty('Excitement'), "Component has property Excitement");
$this->component->enableBehavior('ExcitementPropBehavior');
$this->assertTrue($this->component->hasProperty('Excitement'), "Component hasn't property Excitement");
-
+
$this->component->detachBehavior('ExcitementPropBehavior');
-
+
$this->assertFalse($this->component->hasProperty('Excitement'), "Component has property Excitement");
-
+
}
public function testCanGetProperty() {
$this->assertTrue($this->component->canGetProperty('Text'));
$this->assertTrue($this->component->canGetProperty('text'));
$this->assertFalse($this->component->canGetProperty('Caption'));
-
+
$this->assertTrue($this->component->canGetProperty('ColorAttribute'));
$this->assertTrue($this->component->canGetProperty('colorattribute'));
$this->assertFalse($this->component->canGetProperty('PastelAttribute'));
-
+
$this->assertTrue($this->component->canGetProperty('JSColorAttribute'));
$this->assertTrue($this->component->canGetProperty('jscolorattribute'));
$this->assertFalse($this->component->canGetProperty('jsPastelAttribute'));
-
-
+
+
$this->assertFalse($this->component->canGetProperty('Excitement'), "Component has property Excitement");
$this->component->attachBehavior('ExcitementPropBehavior', new BehaviorTestBehavior);
$this->assertTrue($this->component->canGetProperty('Excitement'), "Component hasn't property Excitement");
@@ -1139,9 +1139,9 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
$this->assertFalse($this->component->canGetProperty('Excitement'), "Component has property Excitement");
$this->component->enableBehavior('ExcitementPropBehavior');
$this->assertTrue($this->component->canGetProperty('Excitement'), "Component hasn't property Excitement");
-
+
$this->component->detachBehavior('ExcitementPropBehavior');
-
+
$this->assertFalse($this->component->canGetProperty('Excitement'), "Component has property Excitement");
}
@@ -1149,15 +1149,15 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
$this->assertTrue($this->component->canSetProperty('Text'));
$this->assertTrue($this->component->canSetProperty('text'));
$this->assertFalse($this->component->canSetProperty('Caption'));
-
+
$this->assertTrue($this->component->canSetProperty('ColorAttribute'));
$this->assertTrue($this->component->canSetProperty('colorattribute'));
$this->assertFalse($this->component->canSetProperty('PastelAttribute'));
-
+
$this->assertTrue($this->component->canSetProperty('JSColorAttribute'));
$this->assertTrue($this->component->canSetProperty('jscolorattribute'));
$this->assertFalse($this->component->canSetProperty('jsPastelAttribute'));
-
+
$this->assertFalse($this->component->canSetProperty('Excitement'), "Component has property Excitement");
$this->component->attachBehavior('ExcitementPropBehavior', new BehaviorTestBehavior);
$this->assertTrue($this->component->canSetProperty('Excitement'), "Component hasn't property Excitement");
@@ -1169,7 +1169,7 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
$this->assertFalse($this->component->canSetProperty('Excitement'), "Component has property Excitement");
$this->component->enableBehavior('ExcitementPropBehavior');
$this->assertTrue($this->component->canSetProperty('Excitement'), "Component hasn't property Excitement");
-
+
$this->component->detachBehavior('ExcitementPropBehavior');
}
@@ -1180,55 +1180,55 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
$this->fail('exception not raised when getting undefined property');
} catch(TInvalidOperationException $e) {
}
-
+
$this->assertTrue($this->component->OnMyEvent instanceof TPriorityList);
try {
$value2=$this->component->onUndefinedEvent;
$this->fail('exception not raised when getting undefined property');
} catch(TInvalidOperationException $e) {
}
-
- //Without the function parenthesis, the function is _not_ called but the __get
+
+ //Without the function parenthesis, the function is _not_ called but the __get
// method is called and the global events (list) are accessed
$this->assertTrue($this->component->fxAttachClassBehavior instanceof TPriorityList);
$this->assertTrue($this->component->fxDetachClassBehavior instanceof TPriorityList);
-
+
// even undefined global events have a list as every object is able to access every event
$this->assertTrue($this->component->fxUndefinedEvent instanceof TPriorityList);
-
-
+
+
// Test the behaviors within the __get function
$this->component->enableBehaviors();
-
+
try {
$value2=$this->component->Excitement;
$this->fail('exception not raised when getting undefined property');
} catch(TInvalidOperationException $e) {
}
-
+
$this->component->attachBehavior('BehaviorTestBehavior', $behavior = new BehaviorTestBehavior);
$this->assertEquals('faa', $this->component->Excitement);
-
+
$this->component->disableBehaviors();
-
+
try {
$this->assertEquals('faa', $this->component->Excitement);
$this->fail('exception not raised when getting undefined property');
} catch(TInvalidOperationException $e) {
}
-
+
$this->component->enableBehaviors();
$this->assertEquals('faa', $this->component->getExcitement());
-
+
$this->component->disableBehavior('BehaviorTestBehavior');
-
+
$this->assertEquals($behavior, $this->component->BehaviorTestBehavior);
try {
$behavior = $this->component->BehaviorTestBehavior2;
$this->fail('exception not raised when getting undefined property');
} catch(TInvalidOperationException $e) {
}
-
+
try {
$this->assertEquals('faa', $this->component->Excitement);
$this->fail('exception not raised when getting undefined property');
@@ -1236,13 +1236,13 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
}
$this->component->enableBehavior('BehaviorTestBehavior');
$this->assertEquals('faa', $this->component->getExcitement());
-
-
+
+
// behaviors allow on and fx events to be passed through.
$this->assertTrue($this->component->onBehaviorEvent instanceof TPriorityList);
-
+
}
-
+
public function testSetProperty() {
$value='new value';
$this->component->Text=$value;
@@ -1253,64 +1253,64 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
$this->fail('exception not raised when setting undefined property');
} catch(TInvalidOperationException $e) {
}
-
+
// Test get only properties is a set function
try {
$this->component->ReadOnlyProperty = 'setting read only';
$this->fail('a property without a set function was set to a new value without error');
} catch(TInvalidOperationException $e) {
}
-
+
try {
$this->component->ReadOnlyJsProperty = 'jssetting read only';
$this->fail('a js property without a set function was set to a new value without error');
} catch(TInvalidOperationException $e) {
}
-
+
try {
$this->component->JsReadOnlyJsProperty = 'jssetting read only';
$this->fail('a js property without a set function was set to a new value without error');
} catch(TInvalidOperationException $e) {
}
-
+
$this->assertEquals(0, $this->component->getEventHandlers('onMyEvent')->getCount());
$this->component->onMyEvent = array($this->component,'myEventHandler');
$this->assertEquals(1, $this->component->getEventHandlers('onMyEvent')->getCount());
$this->component->onMyEvent[] = array($this->component,'Object.myEventHandler');
$this->assertEquals(2, $this->component->getEventHandlers('onMyEvent')->getCount());
-
+
$this->component->getEventHandlers('onMyEvent')->clear();
-
+
// Test the behaviors within the __get function
$this->component->enableBehaviors();
-
+
try {
$this->component->Excitement = 'laa';
$this->fail('exception not raised when getting undefined property');
} catch(TInvalidOperationException $e) {
}
-
+
$this->component->attachBehavior('BehaviorTestBehavior', $behavior1 = new BehaviorTestBehavior);
$this->component->Excitement = 'laa';
$this->assertEquals('laa', $this->component->Excitement);
$this->assertEquals('sol', $this->component->Excitement = 'sol');
-
-
+
+
$this->component->disableBehaviors();
-
+
try {
$this->component->Excitement = false;
$this->assertEquals(false, $this->component->Excitement);
$this->fail('exception not raised when getting undefined property');
} catch(TInvalidOperationException $e) {
}
-
+
$this->component->enableBehaviors();
$this->component->Excitement = 'faa';
$this->assertEquals('faa', $this->component->getExcitement());
-
+
$this->component->disableBehavior('BehaviorTestBehavior');
-
+
try {
$this->component->Excitement = false;
$this->assertEquals(false, $this->component->Excitement);
@@ -1320,82 +1320,82 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
$this->component->enableBehavior('BehaviorTestBehavior');
$this->component->Excitement = 'sol';
$this->assertEquals('sol', $this->component->Excitement);
-
-
+
+
$this->component->attachBehavior('BehaviorTestBehavior2', $behavior2 = new BehaviorTestBehavior);
-
+
$this->assertEquals('sol', $this->component->Excitement);
$this->assertEquals('faa', $behavior2->Excitement);
-
+
// this sets Excitement for both because they are not uniquely named
$this->component->Excitement = 'befaad';
-
+
$this->assertEquals('befaad', $this->component->Excitement);
$this->assertEquals('befaad', $behavior1->Excitement);
$this->assertEquals('befaad', $behavior2->Excitement);
-
-
+
+
$this->component->detachBehavior('BehaviorTestBehavior2');
-
+
// behaviors allow on and fx events to be passed through.
$this->assertTrue($this->component->BehaviorTestBehavior->onBehaviorEvent instanceof TPriorityList);
-
+
$this->assertEquals(0, $this->component->BehaviorTestBehavior->getEventHandlers('onBehaviorEvent')->getCount());
$this->component->onBehaviorEvent = array($this->component,'myEventHandler');
$this->assertEquals(1, $this->component->BehaviorTestBehavior->getEventHandlers('onBehaviorEvent')->getCount());
$this->component->onBehaviorEvent[] = array($this->component,'Object.myEventHandler');
$this->assertEquals(2, $this->component->BehaviorTestBehavior->getEventHandlers('onBehaviorEvent')->getCount());
-
+
$this->component->BehaviorTestBehavior->getEventHandlers('onBehaviorEvent')->clear();
}
-
-
+
+
public function testIsSetFunction() {
$this->assertTrue(isset($this->component->fxAttachClassBehavior));
$this->component->unlisten();
-
+
$this->assertFalse(isset($this->component->onMyEvent));
$this->assertFalse(isset($this->component->undefinedEvent));
$this->assertFalse(isset($this->component->fxAttachClassBehavior));
-
+
$this->assertFalse(isset($this->component->BehaviorTestBehavior));
$this->assertFalse(isset($this->component->onBehaviorEvent));
-
+
$this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior);
-
+
$this->assertTrue(isset($this->component->BehaviorTestBehavior));
$this->assertFalse(isset($this->component->onBehaviorEvent));
-
+
$this->component->attachEventHandler('onBehaviorEvent','foo');
$this->assertTrue(isset($this->component->onBehaviorEvent));
-
+
$this->component->attachEventHandler('onMyEvent','foo');
$this->assertTrue(isset($this->component->onMyEvent));
-
+
$this->assertTrue(isset($this->component->Excitement));
$this->component->Excitement = null;
$this->assertFalse(isset($this->component->Excitement));
$this->assertFalse(isset($this->component->UndefinedBehaviorProperty));
-
-
+
+
}
-
-
+
+
public function testUnsetFunction() {
-
+
$this->assertEquals('default', $this->component->getText());
unset($this->component->Text);
$this->assertNull($this->component->getText());
-
+
unset($this->component->UndefinedProperty);
-
+
// object events
$this->assertEquals(0, $this->component->onMyEvent->Count);
$this->component->attachEventHandler('onMyEvent','foo');
$this->assertEquals(1, $this->component->onMyEvent->Count);
unset($this->component->onMyEvent);
$this->assertEquals(0, $this->component->onMyEvent->Count);
-
+
//global events
$this->assertEquals(1, $this->component->fxAttachClassBehavior->Count);
$component = new NewComponent();
@@ -1404,22 +1404,22 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
// retain the other object event
$this->assertEquals(1, $this->component->fxAttachClassBehavior->Count);
$component->unlisten();
-
+
try {
unset($this->component->Object);
$this->fail('TInvalidOperationException not raised when unsetting get only property');
} catch(TInvalidOperationException $e) {}
-
+
$this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior);
$this->assertTrue($this->component->asa('BehaviorTestBehavior') instanceof BehaviorTestBehavior);
$this->assertFalse($this->component->asa('BehaviorTestBehavior2') instanceof BehaviorTestBehavior);
-
+
$this->assertEquals('faa', $this->component->Excitement);
unset($this->component->Excitement);
$this->assertNull($this->component->Excitement);
$this->component->Excitement = 'sol';
$this->assertEquals('sol', $this->component->Excitement);
-
+
// Test the disabling of unset within behaviors
$this->component->disableBehaviors();
unset($this->component->Excitement);
@@ -1430,60 +1430,60 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
unset($this->component->Excitement);
$this->component->enableBehavior('BehaviorTestBehavior');
$this->assertEquals('sol', $this->component->Excitement);
-
+
unset($this->component->Excitement);
$this->assertNull($this->component->Excitement);
-
+
try {
unset($this->component->ReadOnly);
$this->fail('TInvalidOperationException not raised when unsetting get only property');
} catch(TInvalidOperationException $e) {}
-
+
$this->component->onBehaviorEvent = 'foo';
$this->assertEquals(1, count($this->component->onBehaviorEvent));
$this->assertEquals(1, count($this->component->BehaviorTestBehavior->onBehaviorEvent));
unset($this->component->onBehaviorEvent);
$this->assertEquals(0, count($this->component->onBehaviorEvent));
$this->assertEquals(0, count($this->component->BehaviorTestBehavior->onBehaviorEvent));
-
+
// Remove behavior via unset
unset($this->component->BehaviorTestBehavior);
$this->assertFalse($this->component->asa('BehaviorTestBehavior') instanceof BehaviorTestBehavior);
-
+
}
public function testGetSubProperty() {
$this->assertTrue('object text'===$this->component->getSubProperty('Object.Text'));
}
-
+
public function testSetSubProperty() {
$this->component->setSubProperty('Object.Text','new object text');
$this->assertEquals('new object text',$this->component->getSubProperty('Object.Text'));
}
-
+
public function testHasEvent() {
$this->assertTrue($this->component->hasEvent('OnMyEvent'));
$this->assertTrue($this->component->hasEvent('onmyevent'));
$this->assertFalse($this->component->hasEvent('onYourEvent'));
-
+
// fx won't throw an error if any of these fx function are called on an object.
// It is a special prefix event designation that every object responds to all events.
$this->assertTrue($this->component->hasEvent('fxAttachClassBehavior'));
$this->assertTrue($this->component->hasEvent('fxattachclassbehavior'));
-
+
$this->assertTrue($this->component->hasEvent('fxNonExistantGlobalEvent'));
$this->assertTrue($this->component->hasEvent('fxnonexistantglobalevent'));
-
+
$this->assertTrue($this->component->hasEvent('dyNonExistantLocalEvent'));
$this->assertTrue($this->component->hasEvent('fxnonexistantlocalevent'));
-
-
+
+
//Test behavior events
$this->assertFalse($this->component->hasEvent('onBehaviorEvent'));
$this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior);
$this->assertTrue($this->component->hasEvent('onBehaviorEvent'));
$this->assertTrue($this->component->BehaviorTestBehavior->hasEvent('onBehaviorEvent'));
-
+
$this->component->disableBehavior('BehaviorTestBehavior');
$this->assertFalse($this->component->hasEvent('onBehaviorEvent'));
$this->component->enableBehavior('BehaviorTestBehavior');
@@ -1494,20 +1494,20 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
$this->assertFalse($this->component->hasEventHandler('OnMyEvent'));
$this->component->attachEventHandler('OnMyEvent','foo');
$this->assertTrue($this->component->hasEventHandler('OnMyEvent'));
-
+
$this->assertFalse($this->component->hasEventHandler('fxNonExistantGlobalEvent'));
$this->component->attachEventHandler('fxNonExistantGlobalEvent','foo');
$this->assertTrue($this->component->hasEventHandler('fxNonExistantGlobalEvent'));
-
+
//Test behavior events
$this->assertFalse($this->component->hasEventHandler('onBehaviorEvent'));
$this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior);
$this->assertFalse($this->component->hasEventHandler('onBehaviorEvent'));
$this->assertFalse($this->component->BehaviorTestBehavior->hasEventHandler('onBehaviorEvent'));
-
+
$this->component->attachEventHandler('onBehaviorEvent','foo');
$this->assertTrue($this->component->hasEventHandler('onBehaviorEvent'));
-
+
$this->component->disableBehavior('BehaviorTestBehavior');
$this->assertFalse($this->component->hasEvent('onBehaviorEvent'));
$this->assertFalse($this->component->hasEventHandler('onBehaviorEvent'));
@@ -1526,7 +1526,7 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
$this->fail('exception not raised when getting event handlers for undefined event');
} catch(TInvalidOperationException $e) {
}
-
+
$list=$this->component->getEventHandlers('fxRandomEvent');
$this->assertTrue(($list instanceof TPriorityList) && ($list->getCount()===0));
$this->component->attachEventHandler('fxRandomEvent','foo');
@@ -1536,9 +1536,9 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
} catch(TInvalidOperationException $e) {
$this->fail('exception raised when getting event handlers for universal global event');
}
-
-
-
+
+
+
//Test behavior events
try {
$list=$this->component->getEventHandlers('onBehaviorEvent');
@@ -1546,13 +1546,13 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
} catch(TInvalidOperationException $e) {
}
$this->assertFalse($this->component->hasEventHandler('onBehaviorEvent'));
-
+
$this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior);
$list=$this->component->getEventHandlers('onBehaviorEvent');
$this->assertTrue(($list instanceof TPriorityList) && ($list->getCount()===0));
$this->component->attachEventHandler('onBehaviorEvent','foo');
$this->assertTrue(($list instanceof TPriorityList) && ($list->getCount()===1));
-
+
$this->component->disableBehavior('BehaviorTestBehavior');
try {
$list=$this->component->getEventHandlers('onBehaviorEvent');
@@ -1561,11 +1561,11 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
}
$this->component->enableBehavior('BehaviorTestBehavior');
$this->assertTrue(($this->component->getEventHandlers('onBehaviorEvent') instanceof TPriorityList) && ($list->getCount()===1));
-
+
}
public function testAttachEventHandler() {
-
+
$this->component->attachEventHandler('OnMyEvent','foo');
$this->assertEquals(1, $this->component->getEventHandlers('OnMyEvent')->getCount());
try {
@@ -1573,7 +1573,7 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
$this->fail('exception not raised when attaching event handlers for undefined event');
} catch(TInvalidOperationException $e) {
}
-
+
//Testing the priorities of attaching events
$this->component->attachEventHandler('OnMyEvent','foopre', 5);
$this->component->attachEventHandler('OnMyEvent','foopost', 15);
@@ -1584,8 +1584,8 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
$this->assertEquals('foo', $list[1]);
$this->assertEquals('foobar', $list[2]);
$this->assertEquals('foopost', $list[3]);
-
-
+
+
//Test attaching behavior events
try {
$this->component->attachEventHandler('onBehaviorEvent','foo');
@@ -1593,9 +1593,9 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
} catch(TInvalidOperationException $e) {
}
$this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior);
-
+
$this->component->attachEventHandler('onBehaviorEvent','foo');
-
+
//Testing the priorities of attaching behavior events
$this->component->attachEventHandler('onBehaviorEvent','foopre', 5);
$this->component->attachEventHandler('onBehaviorEvent','foopost', 15);
@@ -1608,7 +1608,7 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
$this->assertEquals('foobar', $list[2]);
$this->assertEquals('foobarfoobar', $list[3]);
$this->assertEquals('foopost', $list[4]);
-
+
$this->component->disableBehavior('BehaviorTestBehavior');
try {
$this->component->attachEventHandler('onBehaviorEvent','bar');
@@ -1616,37 +1616,37 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
} catch(TInvalidOperationException $e) {
}
$this->component->enableBehavior('BehaviorTestBehavior');
-
+
}
public function testDetachEventHandler() {
-
+
$this->component->attachEventHandler('OnMyEvent','foo');
$this->assertEquals(1, $this->component->getEventHandlers('OnMyEvent')->getCount());
-
+
$this->component->attachEventHandler('OnMyEvent','foopre', 5);
$this->component->attachEventHandler('OnMyEvent','foopost', 15);
$this->component->attachEventHandler('OnMyEvent','foobar', 10);
$this->component->attachEventHandler('OnMyEvent','foobarfoobar', 10);
-
-
-
+
+
+
$this->component->detachEventHandler('OnMyEvent','foo');
$list = $this->component->getEventHandlers('OnMyEvent');
$this->assertEquals(4, $list->getCount());
-
+
$this->assertEquals('foopre', $list[0]);
$this->assertEquals('foobar', $list[1]);
$this->assertEquals('foobarfoobar', $list[2]);
$this->assertEquals('foopost', $list[3]);
-
+
$this->component->detachEventHandler('OnMyEvent','foopre', null);
$this->assertEquals(4, $list->getCount());
-
+
$this->component->detachEventHandler('OnMyEvent','foopre', 5);
$this->assertEquals(3, $list->getCount());
-
-
+
+
// Now do detaching of behavior on events
try {
$this->component->attachEventHandler('onBehaviorEvent','foo');
@@ -1654,29 +1654,29 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
} catch(TInvalidOperationException $e) {
}
$this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior);
-
+
$this->component->attachEventHandler('onBehaviorEvent','foo');
$this->assertEquals(1, $this->component->getEventHandlers('onBehaviorEvent')->getCount());
-
+
$this->component->attachEventHandler('onBehaviorEvent','foopre', 5);
$this->component->attachEventHandler('onBehaviorEvent','foopost', 15);
$this->component->attachEventHandler('onBehaviorEvent','foobar', 10);
$this->component->attachEventHandler('onBehaviorEvent','foobarfoobar', 10);
-
-
-
+
+
+
$this->component->detachEventHandler('onBehaviorEvent','foo');
$list = $this->component->getEventHandlers('onBehaviorEvent');
$this->assertEquals(4, $list->getCount());
-
+
$this->assertEquals('foopre', $list[0]);
$this->assertEquals('foobar', $list[1]);
$this->assertEquals('foobarfoobar', $list[2]);
$this->assertEquals('foopost', $list[3]);
-
+
$this->component->detachEventHandler('onBehaviorEvent','foopre', null);
$this->assertEquals(4, $list->getCount());
-
+
$this->component->detachEventHandler('onBehaviorEvent','foopre', 5);
$this->assertEquals(3, $list->getCount());
}
@@ -1693,14 +1693,14 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
$this->assertFalse($this->component->Object->isEventHandled());
$this->component->raiseEvent('OnMyEvent',$this,null);
$this->assertTrue($this->component->Object->isEventHandled());
-
+
$this->component->resetEventHandled();
$this->component->Object->resetEventHandled();
-
-
+
+
// Test a behavior on event
$this->component->attachBehavior('test', new BehaviorTestBehavior);
-
+
$this->component->attachEventHandler('onBehaviorEvent',array($this->component,'myEventHandler'));
$this->assertFalse($this->component->isEventHandled());
$this->component->raiseEvent('onBehaviorEvent',$this,null);
@@ -1709,13 +1709,13 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
$this->assertFalse($this->component->Object->isEventHandled());
$this->component->raiseEvent('onBehaviorEvent',$this,null);
$this->assertTrue($this->component->Object->isEventHandled());
-
+
//test behavior enabled/disabled events
$this->component->disableBehavior('test');
-
+
$this->component->resetEventHandled();
$this->component->Object->resetEventHandled();
-
+
try {
$this->component->attachEventHandler('onBehaviorEvent',array($this->component,'myEventHandler'));
$this->fail('exception not raised when getting event handlers for undefined event');
@@ -1726,172 +1726,172 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
$this->fail('exception not raised when getting event handlers for undefined event');
} catch(TInvalidOperationException $e) {}
$this->assertFalse($this->component->isEventHandled());
-
+
$this->component->enableBehavior('test');
-
-
-
+
+
+
//Test the return types of this function
-
+
$this->assertFalse($this->component->isEventHandled());
$this->assertFalse($this->component->Object->isEventHandled());
$this->assertEquals(array(), $this->component->onBehaviorEvent($this,$this->component));
$this->assertTrue($this->component->isEventHandled());
$this->assertTrue($this->component->Object->isEventHandled());
-
+
// This accumulates all the responses from each of the events
$arr=$this->component->onBehaviorEvent($this, $this->component, TEventResults::EVENT_RESULT_ALL);
$this->assertEquals($this, $arr[0]['sender']);
$this->assertEquals($this->component, $arr[0]['param']);
$this->assertTrue(null === $arr[0]['response']);
-
+
$this->assertEquals($this, $arr[1]['sender']);
$this->assertEquals($this->component, $arr[1]['param']);
$this->assertTrue(null === $arr[1]['response']);
-
+
$this->assertEquals(2, count($arr));
-
+
// This tests without the default filtering-out of null
$arr=$this->component->onBehaviorEvent($this, $this->component, false);
$this->assertEquals(array(null, null), $arr);
-
-
+
+
unset($this->component->onBehaviorEvent);
$this->assertEquals(0, $this->component->onBehaviorEvent->Count);
-
+
$this->component->onBehaviorEvent = array($this, 'returnValue4');
$this->component->onBehaviorEvent = array($this, 'returnValue1');
-
+
// Test the per event post processing function
$arr=$this->component->onBehaviorEvent($this, $this->component, array($this, 'postEventFunction'));
$this->assertEquals(array(exp(4), exp(1)), $arr);
$arr=$this->component->onBehaviorEvent($this, $this->component, array($this, 'postEventFunction2'));
$this->assertEquals(array(sin(4), sin(1)), $arr);
-
-
+
+
//Testing Feed-forward functionality
unset($this->component->onBehaviorEvent);
-
+
$this->component->onBehaviorEvent = array($this, 'ffValue4');
$this->component->onBehaviorEvent = array($this, 'ffValue2');
$arr=$this->component->onBehaviorEvent($this, 5, TEventResults::EVENT_RESULT_FEED_FORWARD);
$this->assertEquals(array(20, 40), $arr);
-
-
+
+
unset($this->component->onBehaviorEvent);
-
+
//Order of these events affects the response order in feed forward
$this->component->onBehaviorEvent = array($this, 'ffValue2');
$this->component->onBehaviorEvent = array($this, 'ffValue4');
$arr=$this->component->onBehaviorEvent($this, 5, TEventResults::EVENT_RESULT_FEED_FORWARD);
$this->assertEquals(array(10, 40), $arr);
}
-
+
public function returnValue1(){return 1;}
public function returnValue4(){return 4;}
public function postEventFunction($sender, $param, $caller, $response){return exp($response);}
public function postEventFunction2($sender, $param, $caller, $response){return sin($response);}
public function ffValue2($sender, $param){return $param*2;}
public function ffValue4($sender, $param){return $param*4;}
-
-
+
+
public function testGlobalEventListenerInRaiseEvent() {
//TODO Test the Global Event Listener
}
-
-
+
+
public function testIDynamicMethodsOnBehavior() {
-
+
//Add Behavior with dynamic call
$this->component->attachBehavior('TDynamicBehavior', new TDynamicBehavior);
-
+
//Check that the behavior is working as it should
$this->assertTrue($this->component->isa('TDynamicBehavior'));
$this->assertNull($this->component->getLastBehaviorDynamicMethodCalled());
-
+
// call basic behavior implemented method from object (containing behavior)
$this->assertEquals(42, $this->component->TestBehaviorMethod(6, 7));
-
+
//Test out undefined behavior/host object method
try {
$this->component->objectAndBehaviorUndefinedMethod();
$this->fail('exception not raised when evaluating an undefined method by the object and behavior');
} catch(TApplicationException $e) {
}
-
+
// calling undefined dynamic method, caught by the __dycall method in the behavior and implemented
// this behavior catches undefined dynamic event and divides param1 by param 2
$this->assertEquals(22, $this->component->dyTestDynamicBehaviorMethod(242, 11));
$this->assertEquals('dyTestDynamicBehaviorMethod', $this->component->getLastBehaviorDynamicMethodCalled());
-
+
// calling undefined dynamic method, caught by the __dycall in the behavior and ignored
$this->assertNull($this->component->dyUndefinedIntraEvent(242, 11));
$this->assertEquals('dyUndefinedIntraEvent', $this->component->getLastBehaviorDynamicMethodCalled());
-
+
//call behavior defined dynamic event
// param1 * 2 * param2
$this->assertEquals(2420, $this->component->dyTestIntraEvent(121, 10));
-
+
$this->component->detachBehavior('TDynamicBehavior');
$this->assertFalse($this->component->isa('TDynamicBehavior'));
-
-
-
+
+
+
//Add Class Behavior with dynamic call
$this->component->attachBehavior('TDynamicClassBehavior', new TDynamicClassBehavior);
-
+
//Check that the behavior is working as it should
$this->assertTrue($this->component->isa('TDynamicClassBehavior'));
$this->assertNull($this->component->getLastBehaviorDynamicMethodCalled());
-
+
// call basic behavior implemented method from object (containing behavior)
$this->assertEquals(42, $this->component->TestBehaviorMethod(6, 7));
-
+
//Test out undefined behavior/host object method
try {
$this->component->objectAndBehaviorUndefinedMethod();
$this->fail('exception not raised when evaluating an undefined method by the object and behavior');
} catch(TApplicationException $e) {
}
-
+
// calling undefined dynamic method, caught by the __dycall method in the behavior and implemented
// this behavior catches undefined dynamic event and divides param1 by param 2
$this->assertEquals(22, $this->component->dyTestDynamicClassBehaviorMethod(242, 11));
$this->assertEquals('dyTestDynamicClassBehaviorMethod', $this->component->getLastBehaviorDynamicMethodCalled());
-
+
// calling undefined dynamic method, caught by the __dycall in the behavior and ignored
$this->assertNull($this->component->dyUndefinedIntraEvent(242, 11));
$this->assertEquals('dyUndefinedIntraEvent', $this->component->getLastBehaviorDynamicMethodCalled());
-
+
//call behavior defined dynamic event
// param1 * 2 * param2
$this->assertEquals(2420, $this->component->dyTestIntraEvent(121, 10));
-
+
$this->component->detachBehavior('TDynamicClassBehavior');
$this->assertFalse($this->component->isa('TDynamicClassBehavior'));
-
+
}
-
+
// This also tests the priority of the common global raiseEvent events
public function testIDynamicMethodsOnBehaviorGlobalEvents() {
$component = new GlobalRaiseComponent();
-
+
// common function has a default priority of 10
$component->attachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER, array($component, 'commonRaiseEventListener'));
$component->attachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER, array($component, 'postglobalRaiseEventListener'), 1);
$component->attachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER, array($component, 'preglobalRaiseEventListener'), -1);
-
+
$this->assertEquals(5, $this->component->fxGlobalListener->getCount());
$this->assertEquals(1, $this->component->fxPrimaryGlobalEvent->getCount());
$this->assertEquals(1, $this->component->fxPrimaryGlobalEvent->getCount(), 'fxPrimaryGlobalEvent is not installed on test object');
-
+
// call the global event on a different object than the test object
$res = $this->component->raiseEvent('fxPrimaryGlobalEvent', $this, null, TEventResults::EVENT_RESULT_ALL);
-
+
$this->assertEquals(6, count($res));
$this->assertEquals(array('pregl', 'primary', 'postgl', 'fxGL', 'fxcall', 'com'), $component->getCallOrders());
-
+
$component->unlisten();
}
@@ -1907,10 +1907,10 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
} catch(Exception $e) {
}
}
-
-
-
-
+
+
+
+
public function testEvaluateStatements() {
$statements='$a="test string"; echo $a;';
$this->assertEquals('test string',$this->component->evaluateStatements($statements));
@@ -1921,169 +1921,167 @@ class TComponentTest extends PHPUnit_Framework_TestCase {
} catch(Exception $e) {
}
}
-
-
+
+
public function testDynamicFunctionCall() {
-
+
$this->assertEquals(' aa bb cc __ .. ++ || !! ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? '));
-
+
$this->component->attachBehavior('dy1', new dy1TextReplace);
$this->assertFalse($this->component->dy1->isCalled());
$this->assertEquals(' aa bb cc __ __ ++ || !! ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? '));
$this->assertTrue($this->component->dy1->isCalled());
-
+
$this->component->attachBehavior('dy2', new dy2TextReplace);
$this->assertFalse($this->component->dy2->isCalled());
$this->assertEquals(' aa bb cc __ __ || || !! ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? '));
$this->assertTrue($this->component->dy2->isCalled());
-
+
$this->component->attachBehavior('dy3', new dy3TextReplace);
$this->assertFalse($this->component->dy3->isCalled());
$this->assertEquals(' aa bb cc __ __ || || ?? ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? '));
$this->assertTrue($this->component->dy3->isCalled());
-
+
$this->assertEquals(' aa bb cc __ .. ++ || !! ?? ', $this->component->dyUndefinedEvent(' aa bb cc __ .. ++ || !! ?? '));
-
+
$this->assertEquals(0.25, $this->component->dyPowerFunction(2,2));
-
-
+
+
$this->component->detachBehavior('dy1');
$this->component->detachBehavior('dy2');
$this->component->detachBehavior('dy3');
-
+
//test class behaviors of dynamic events and the argument list order
-
+
$this->assertEquals(' aa bb cc __ .. ++ || !! ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? '));
-
+
$this->component->attachBehavior('dy1', new dy1ClassTextReplace);
$this->assertFalse($this->component->dy1->isCalled());
$this->assertEquals(' aa bb cc .. .. ++ || !! ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? '));
$this->assertTrue($this->component->dy1->isCalled());
-
+
$this->component->attachBehavior('dy2', new dy2ClassTextReplace);
$this->assertFalse($this->component->dy2->isCalled());
$this->assertEquals(' aa bb cc .. .. ++ ++ !! ?? ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? '));
$this->assertTrue($this->component->dy2->isCalled());
-
+
$this->component->attachBehavior('dy3', new dy3ClassTextReplace);
$this->assertFalse($this->component->dy3->isCalled());
$this->assertEquals(' aa bb cc .. .. ++ ++ !! ^_^ ', $this->component->dyTextFilter(' aa bb cc __ .. ++ || !! ?? '));
$this->assertTrue($this->component->dy3->isCalled());
-
+
$this->assertEquals(' aa bb cc __ .. ++ || !! ?? ', $this->component->dyUndefinedEvent(' aa bb cc __ .. ++ || !! ?? '));
-
+
$this->assertEquals(0.25, $this->component->dyPowerFunction(2,2));
-
-
+
+
}
-
-
-
-
+
+
+
+
public function testDynamicIntraObjectEvents() {
-
+
$this->component->attachBehavior('IntraEvents', new IntraObjectExtenderBehavior);
-
+
$this->assertNull($this->component->IntraEvents->LastCall);
-
+
//unlisten first, this object listens upon instantiation.
$this->component->unlisten();
$this->assertEquals(2, $this->component->IntraEvents->LastCall);
-
+
// ensures that IntraEvents nulls the last call variable when calling this getter
$this->assertNull($this->component->IntraEvents->LastCall);
-
+
//listen next to undo the unlisten
$this->component->listen();
$this->assertEquals(1, $this->component->IntraEvents->LastCall);
-
-
+
+
$this->assertEquals(3, $this->component->evaluateExpression('1+2'));
$this->assertEquals(7, $this->component->IntraEvents->LastCall);
-
+
$statements='$a="test string"; echo $a;';
$this->assertEquals('test string', $this->component->evaluateStatements($statements));
$this->assertEquals(8, $this->component->IntraEvents->LastCall);
-
+
$component2 = new NewComponentNoListen();
$this->assertNull($this->component->createdOnTemplate($component2));
$this->assertEquals(9, $this->component->IntraEvents->LastCall);
-
+
$this->assertNull($this->component->addParsedObject($component2));
$this->assertEquals(10, $this->component->IntraEvents->LastCall);
-
-
-
+
+
+
$behavior = new BarBehavior;
$this->assertEquals($behavior, $this->component->attachBehavior('BarBehavior', $behavior));
$this->assertEquals(11, $this->component->IntraEvents->LastCall);
-
+
$this->assertNull($this->component->disableBehaviors());
$this->assertNull($this->component->enableBehaviors());
$this->assertEquals(27, $this->component->IntraEvents->LastCall);
-
+
$this->assertTrue($this->component->disableBehavior('BarBehavior'));
$this->assertEquals(16, $this->component->IntraEvents->LastCall);
-
+
$this->assertTrue($this->component->enableBehavior('BarBehavior'));
$this->assertEquals(15, $this->component->IntraEvents->LastCall);
-
+
$this->assertEquals($behavior, $this->component->detachBehavior('BarBehavior'));
$this->assertEquals(12, $this->component->IntraEvents->LastCall);
-
-
+
+
$this->component->attachEventHandler('OnMyEvent',array($this->component,'myEventHandler'));
$this->component->raiseEvent('OnMyEvent',$this,null);
-
+
//3 + 4 + 5 + 6 = 18 (the behavior adds these together when each raiseEvent dynamic intra event is called)
$this->assertEquals(18, $this->component->IntraEvents->LastCall);
}
-
-
-
+
+
+
public function testJavascriptGetterSetter() {
-
+
$this->assertFalse(isset($this->component->ColorAttribute));
$this->assertFalse(isset($this->component->JsColorAttribute));
-
+
$this->component->ColorAttribute = "('#556677', '#abcdef', 503987)";
$this->assertEquals("('#556677', '#abcdef', 503987)", $this->component->ColorAttribute);
-
+
$this->assertTrue(isset($this->component->ColorAttribute));
$this->assertTrue(isset($this->component->JsColorAttribute));
-
+
$this->component->ColorAttribute = "new Array(1, 2, 3, 4, 5)";
$this->assertEquals("new Array(1, 2, 3, 4, 5)", $this->component->JsColorAttribute);
-
+
$this->component->JsColorAttribute = "['#112233', '#fedcba', 22009837]";
$this->assertEquals("['#112233', '#fedcba', 22009837]", $this->component->ColorAttribute);
}
-
-
+
+
public function testJavascriptIssetUnset() {
-
+
$this->component->JsColorAttribute = "['#112233', '#fedcba', 22009837]";
$this->assertEquals("['#112233', '#fedcba', 22009837]", $this->component->ColorAttribute);
-
+
unset($this->component->ColorAttribute);
-
+
$this->assertFalse(isset($this->component->ColorAttribute));
$this->assertFalse(isset($this->component->JsColorAttribute));
-
+
$this->component->JsColorAttribute = "['#112233', '#fedcba', 22009837]";
-
+
$this->assertTrue(isset($this->component->ColorAttribute));
$this->assertTrue(isset($this->component->JsColorAttribute));
-
+
unset($this->component->JsColorAttribute);
-
+
$this->assertFalse(isset($this->component->ColorAttribute));
$this->assertFalse(isset($this->component->JsColorAttribute));
-
+
}
-
-
-
-}
-?> \ No newline at end of file
+
+
+}
diff --git a/tests/unit/Util/AllTests.php b/tests/unit/Util/AllTests.php
index 8ab99a50..a6a217d7 100644
--- a/tests/unit/Util/AllTests.php
+++ b/tests/unit/Util/AllTests.php
@@ -11,13 +11,13 @@ class Util_AllTests {
public static function main() {
PHPUnit_TextUI_TestRunner::run(self::suite());
}
-
+
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('System.Util');
-
+
$suite->addTestSuite('TDateTimeStampTest');
$suite->addTestSuite('TLoggerTest');
-
+
return $suite;
}
}
@@ -25,4 +25,3 @@ class Util_AllTests {
if(PHPUnit_MAIN_METHOD == 'Util_AllTests::main') {
Util_AllTests::main();
}
-?>
diff --git a/tests/unit/Util/TDateTimeStampTest.php b/tests/unit/Util/TDateTimeStampTest.php
index 6ae4b128..37784ef3 100644
--- a/tests/unit/Util/TDateTimeStampTest.php
+++ b/tests/unit/Util/TDateTimeStampTest.php
@@ -7,7 +7,7 @@ Prado::using('System.Util.TDateTimeStamp');
* @package System.Util
*/
class TDateTimeStampTest extends PHPUnit_Framework_TestCase {
-
+
public function testGetTimeStampAndFormat() {
$s = new TDateTimeStamp;
$t = $s->getTimeStamp(0,0,0);
@@ -126,4 +126,3 @@ class TDateTimeStampTest extends PHPUnit_Framework_TestCase {
}
}
-?>
diff --git a/tests/unit/Util/TLoggerTest.php b/tests/unit/Util/TLoggerTest.php
index 49d5d316..03b36c5b 100644
--- a/tests/unit/Util/TLoggerTest.php
+++ b/tests/unit/Util/TLoggerTest.php
@@ -16,11 +16,10 @@ class TLoggerTest extends PHPUnit_Framework_TestCase {
public function testLog() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetLogs() {
throw new PHPUnit_Framework_IncompleteTestError();
}
}
-?>
diff --git a/tests/unit/Util/TSimpleDateFormatterTest.php b/tests/unit/Util/TSimpleDateFormatterTest.php
index b989fcf5..ce6f1234 100644
--- a/tests/unit/Util/TSimpleDateFormatterTest.php
+++ b/tests/unit/Util/TSimpleDateFormatterTest.php
@@ -16,49 +16,48 @@ class TSimpleDateFormatterTest extends PHPUnit_Framework_TestCase {
public function testConstruct() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testPattern() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testCharset() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testFormat() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testMonthPattern() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testDayPattern() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testYearPattern() {
$formatter = new TSimpleDateFormatter("yyyy");
self::assertEquals("2008-01-01", date('Y-m-d', $formatter->parse("2008")));
}
-
+
public function testMissingYearPattern() {
$formatter = new TSimpleDateFormatter("MM/dd");
self::assertEquals(date("Y-10-22"), date('Y-m-d', $formatter->parse("10/22")));
}
-
+
public function testDayMonthYearOrdering() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testIsValidDate() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testParse() {
throw new PHPUnit_Framework_IncompleteTestError();
}
}
-?>
diff --git a/tests/unit/Web/AllTests.php b/tests/unit/Web/AllTests.php
index f9b3b91d..ffd98978 100644
--- a/tests/unit/Web/AllTests.php
+++ b/tests/unit/Web/AllTests.php
@@ -20,10 +20,10 @@ class Web_AllTests {
public static function main() {
PHPUnit_TextUI_TestRunner::run(self::suite());
}
-
+
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('System.Web');
-
+
$suite->addTestSuite('TAssetManagerTest');
$suite->addTestSuite('TCacheHttpSessionTest');
$suite->addTestSuite('THttpCookieCollectionTest');
@@ -33,9 +33,9 @@ class Web_AllTests {
$suite->addTestSuite('THttpSessionTest');
$suite->addTestSuite('THttpUtilityTest');
$suite->addTestSuite('TUriTest');
-
+
$suite->addTest(Web_UI_AllTests::suite());
-
+
return $suite;
}
}
@@ -43,4 +43,3 @@ class Web_AllTests {
if(PHPUnit_MAIN_METHOD == 'Web_AllTests::main') {
Web_AllTests::main();
}
-?>
diff --git a/tests/unit/Web/TAssetManagerTest.php b/tests/unit/Web/TAssetManagerTest.php
index 89349a0d..13d2d6c1 100644
--- a/tests/unit/Web/TAssetManagerTest.php
+++ b/tests/unit/Web/TAssetManagerTest.php
@@ -26,26 +26,26 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase {
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3';
$_SERVER['REMOTE_HOST'] = 'localhost';
-
+
if (self::$app===null) {
self::$app=new TApplication(dirname(__FILE__).'/app');
}
-
+
if (self::$assetDir===null) self::$assetDir= dirname(__FILE__).'/assets';
- // Make asset directory if not exists
+ // Make asset directory if not exists
if (!file_exists (self::$assetDir)) {
- if (is_writable(dirname(self::$assetDir)))
+ if (is_writable(dirname(self::$assetDir)))
mkdir (self::$assetDir) ;
- else
+ else
throw new Exception ('Directory '.dirname(self::$assetDir).' is not writable');
} elseif (!is_dir (self::$assetDir)) {
throw new Exception (self::$assetDir.' exists and is not a directory');
}
// Define an alias to asset directory
prado::setPathofAlias('AssetAlias', self::$assetDir);
-
+
}
-
+
private function removeDirectory ($dir) {
// Let's be sure $dir is a directory to avoir any error. Clear the cache !
clearstatcache();
@@ -53,7 +53,7 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase {
foreach (scandir($dir) as $content) {
if ($content==='.' or $content==='..') continue; // skip . and ..
$content=$dir.'/'.$content;
- if (is_dir($content))
+ if (is_dir($content))
$this->removeDirectory ($content); // Recursivly remove directories
else
unlink ($content); // Remove file
@@ -62,21 +62,21 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase {
rmdir ($dir);
}
}
-
+
public function tearDown () {
// Make some cleaning :)
- $this->removeDirectory(self::$assetDir);
+ $this->removeDirectory(self::$assetDir);
}
-
+
public function testInit() {
-
+
$manager=new TAssetManager ();
$manager->init (null);
-
+
self::assertEquals(self::$assetDir, $manager->getBasePath());
self::assertEquals($manager, self::$app->getAssetManager());
-
+
// No, remove asset directory, and catch the exception
if (is_dir(self::$assetDir)) $this->removeDirectory (self::$assetDir);
try {
@@ -92,12 +92,12 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase {
$manager->setBasePath('invalid');
self::fail('Expected TInvalidDataValueException not thrown');
} catch (TInvalidDataValueException $e) {}
-
+
// Next, standard asset directory, should work
-
+
$manager->setBasePath ('AssetAlias');
self::assertEquals(self::$assetDir, $manager->getBasePath());
-
+
// Finally, test to change after init
$manager->init (null);
try {
@@ -111,20 +111,20 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase {
$manager=new TAssetManager ();
$manager->setBaseUrl ('/assets/');
self::assertEquals("/assets", $manager->getBaseUrl());
-
+
$manager->init (null);
try {
$manager->setBaseUrl ('/test');
self::fail ('Expected TInvalidOperationException not thrown');
} catch (TInvalidOperationException $e) {}
-
+
}
public function testPublishFilePath() {
$manager=new TAssetManager();
$manager->setBaseUrl('/');
$manager->init (null);
-
+
// Try to publish a single file
$fileToPublish=dirname(__FILE__).'/data/pradoheader.gif';
$publishedUrl = $manager->publishFilePath($fileToPublish);
@@ -132,19 +132,19 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase {
self::assertEquals($publishedFile, $manager->getPublishedPath($fileToPublish));
self::assertEquals($publishedUrl, $manager->getPublishedUrl($fileToPublish));
self::assertTrue(is_file($publishedFile));
-
+
// try to publish invalid file
try {
$manager->publishFilePath('invalid_file');
self::fail('Expected TInvalidDataValueException not thrown');
} catch (TInvalidDataValueException $e) {}
}
-
+
public function testPublishFilePathWithDirectory () {
$manager=new TAssetManager();
$manager->setBaseUrl('/');
$manager->init (null);
-
+
// Try to publish a directory
$dirToPublish=dirname(__FILE__).'/data';
$publishedUrl = $manager->publishFilePath($dirToPublish);
@@ -153,23 +153,23 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase {
self::assertEquals($publishedUrl, $manager->getPublishedUrl($dirToPublish));
self::assertTrue(is_dir($publishedDir));
self::assertTrue(is_file($publishedDir.'/pradoheader.gif'));
-
+
}
public function testPublishTarFile() {
$manager=new TAssetManager();
$manager->setBaseUrl('/');
$manager->init (null);
-
+
$tarFile=dirname(__FILE__).'/data/aTarFile.tar';
$md5File=dirname(__FILE__).'/data/aTarFile.md5';
-
+
// First, try with bad md5
try {
$manager->publishTarFile($tarFile, 'badMd5File');
self::fail('Expected TInvalidDataValueException not thrown');
} catch (TInvalidDataValueException $e) {}
-
+
// Then, try with real md5 file
$publishedUrl=$manager->publishTarFile($tarFile, $md5File);
$publishedDir=self::$assetDir.$publishedUrl;
@@ -178,5 +178,4 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase {
self::assertTrue(is_file($publishedDir.'/aTarFile.md5'));
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/TCacheHttpSessionTest.php b/tests/unit/Web/TCacheHttpSessionTest.php
index 15c2a382..8475cd37 100644
--- a/tests/unit/Web/TCacheHttpSessionTest.php
+++ b/tests/unit/Web/TCacheHttpSessionTest.php
@@ -11,14 +11,14 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase
protected $app = null;
protected static $cache = null;
protected static $session = null;
-
+
protected function setUp()
{
if(!extension_loaded('memcache'))
{
self::markTestSkipped('The memcache extension is not available');
}
- else
+ else
{
$basePath = dirname(__FILE__).'/app';
$runtimePath = $basePath.'/runtime';
@@ -33,14 +33,14 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase
$this->app->setModule('MyCache',self::$cache);
}
}
-
+
protected function tearDown()
{
$this->app = null;
$this->cache = null;
$this->session = null;
}
-
+
public function testInit()
{
$session = new TCacheHttpSession();
@@ -53,7 +53,7 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase
{
}
unset($session);
-
+
$session = new TCacheHttpSession();
try
{
@@ -66,12 +66,12 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase
{
}
unset($session);
-
+
self::$session = new TCacheHttpSession();
try
{
self::$session->setCacheModuleID('MyCache');
- self::$session->init(null);
+ self::$session->init(null);
}
catch(TConfigurationException $e)
{
@@ -79,50 +79,49 @@ class TCacheHttpSessionTest extends PHPUnit_Framework_TestCase
self::markTestSkipped('Cannot continue this test');
}
}
-
+
public function testGetCache()
{
$cache = self::$session->getCache();
$this->assertEquals(true, $cache instanceof TMemCache);
}
-
+
public function testCacheModuleID()
{
$id = 'value';
self::$session->setCacheModuleID($id);
self::assertEquals($id, self::$session->getCacheModuleID());
}
-
+
public function testKeyPrefix()
{
$id = 'value';
self::$session->setKeyPrefix($id);
self::assertEquals($id, self::$session->getKeyPrefix());
}
-
+
public function testSetAndGet()
{
self::$session['key'] = 'value';
self::assertEquals('value', self::$session['key']);
}
-
+
public function testAdd()
{
self::$session->add('anotherkey', 'value');
self::assertEquals('value', self::$session['anotherkey']);
}
-
+
public function testRemove()
{
self::$session->remove('key');
self::assertEquals(false, self::$session['key']);
}
-
+
public function testDestroyAndIsStarted()
{
$this->testSetAndGet();
self::$session->destroy();
self::assertEquals(false, self::$session->getIsStarted());
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/THttpCookieCollectionTest.php b/tests/unit/Web/THttpCookieCollectionTest.php
index 68ea8777..aa091788 100644
--- a/tests/unit/Web/THttpCookieCollectionTest.php
+++ b/tests/unit/Web/THttpCookieCollectionTest.php
@@ -28,7 +28,7 @@ class THttpCookieCollectionTest extends PHPUnit_Framework_TestCase {
$coll->removeAt(0);
self::fail('Invalid Value exception not raised');
} catch (TInvalidDataValueException $e) {}
-
+
$coll->insertAt(0, new THttpCookie('name','value'));
self::assertEquals('value',$coll->removeAt(0)->getValue());
}
@@ -46,5 +46,4 @@ class THttpCookieCollectionTest extends PHPUnit_Framework_TestCase {
self::assertEquals ('value', $coll->findCookieByName('name')->getValue());
self::assertNull ($coll->findCookieByName('invalid'));
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/THttpCookieTest.php b/tests/unit/Web/THttpCookieTest.php
index 31d8e572..206ef105 100644
--- a/tests/unit/Web/THttpCookieTest.php
+++ b/tests/unit/Web/THttpCookieTest.php
@@ -49,5 +49,4 @@ class THttpCookieTest extends PHPUnit_Framework_TestCase {
$cookie->setSecure(true);
self::assertTrue($cookie->getSecure());
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/THttpRequestTest.php b/tests/unit/Web/THttpRequestTest.php
index 1807bbe2..7f5da17d 100644
--- a/tests/unit/Web/THttpRequestTest.php
+++ b/tests/unit/Web/THttpRequestTest.php
@@ -503,5 +503,4 @@ class THttpRequestTest extends PHPUnit_Framework_TestCase {
$module->init ($config);
self::assertEquals('testService', $request->resolveRequest(array ('page', 'testService')));
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/THttpResponseTest.php b/tests/unit/Web/THttpResponseTest.php
index dadbd768..0855bf4d 100644
--- a/tests/unit/Web/THttpResponseTest.php
+++ b/tests/unit/Web/THttpResponseTest.php
@@ -7,18 +7,18 @@ Prado::using('System.Web.THttpResponse');
* @package System.Web
*/
class THttpResponseTest extends PHPUnit_Framework_TestCase {
-
+
public static $app=null;
public function setUp () {
if (self::$app===null) self::$app=new TApplication(dirname(__FILE__).'/app');
ob_start();
}
-
+
public function tearDown () {
ob_end_flush();
}
-
+
public function testInit() {
$response=new THttpResponse ();
$response->init (null);
@@ -43,7 +43,7 @@ class THttpResponseTest extends PHPUnit_Framework_TestCase {
$response->setCacheControl('invalid');
self::fail ('Expected TInvalidDataValueException not thrown');
} catch (TInvalidDataValueException $e) {}
-
+
}
public function testSetContentType() {
@@ -62,7 +62,7 @@ class THttpResponseTest extends PHPUnit_Framework_TestCase {
self::assertEquals('UTF-8', $response->getCharset());
$response->setCharset ('ISO8859-1');
self::assertEquals('ISO8859-1', $response->getCharset());
-
+
}
public function testSetBufferOutput() {
@@ -101,17 +101,17 @@ class THttpResponseTest extends PHPUnit_Framework_TestCase {
}
public function testWriteFile() {
-
+
// Don't know how to test headers :(( ...
throw new PHPUnit_Framework_IncompleteTestError();
-
+
$response=new THttpResponse ();
$response->setBufferOutput(true);
// Suppress warning with headers
$response->writeFile(dirname(__FILE__).'/data/aTarFile.md5', null, 'text/plain', array ('Pragma: public', 'Expires: 0'));
-
+
self::assertContains('4b1ecb0b243918a8bbfbb4515937be98 aTarFile.tar', ob_get_clean());
-
+
}
public function testRedirect() {
@@ -157,5 +157,4 @@ class THttpResponseTest extends PHPUnit_Framework_TestCase {
public function testCreateHtmlWriter() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/THttpSessionTest.php b/tests/unit/Web/THttpSessionTest.php
index 7de0f8a5..aca83077 100644
--- a/tests/unit/Web/THttpSessionTest.php
+++ b/tests/unit/Web/THttpSessionTest.php
@@ -110,5 +110,4 @@ class THttpSessionTest extends PHPUnit_Framework_TestCase {
public function testOffsetUnset() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/THttpUtilityTest.php b/tests/unit/Web/THttpUtilityTest.php
index 85fcf7f4..7f4e6705 100644
--- a/tests/unit/Web/THttpUtilityTest.php
+++ b/tests/unit/Web/THttpUtilityTest.php
@@ -18,5 +18,4 @@ class THttpUtilityTest extends PHPUnit_Framework_TestCase {
$html = THttpUtility::htmlDecode('&lt;tag key=&quot;value&quot;&gt;');
self::assertEquals('<tag key="value">', $html);
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/TUriTest.php b/tests/unit/Web/TUriTest.php
index a8c65b9e..b610cd1b 100644
--- a/tests/unit/Web/TUriTest.php
+++ b/tests/unit/Web/TUriTest.php
@@ -6,17 +6,17 @@ Prado::using('System.Web.THttpRequest');
* @package System.Web
*/
class TUriTest extends PHPUnit_Framework_TestCase {
-
+
const URISTR='http://login:p@ssw0rd:compl3x@www.pradosoft.com:80/demos/quickstart/index.php?page=test&param1=test2#anchor';
-
+
public function setUp () {
$this->uri=new TUri(self::URISTR);
}
-
+
public function tearDown() {
$this->uri=null;
}
-
+
public function testConstruct() {
$url="http://www.pradosoft.com/";
$uri=new TUri ($url);
@@ -27,7 +27,7 @@ class TUriTest extends PHPUnit_Framework_TestCase {
$url=new TUri($url);
self::fail ('exception not raised with an invalid URL');
} catch (TInvalidDataValueException $e) {
-
+
}
}
@@ -66,5 +66,4 @@ class TUriTest extends PHPUnit_Framework_TestCase {
public function testGetFragment() {
self::assertEquals('anchor', $this->uri->getFragment());
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/UI/ActiveControls/AllTests.php b/tests/unit/Web/UI/ActiveControls/AllTests.php
index ef2dfb91..68989996 100644
--- a/tests/unit/Web/UI/ActiveControls/AllTests.php
+++ b/tests/unit/Web/UI/ActiveControls/AllTests.php
@@ -11,11 +11,11 @@ class Web_UI_ActiveControls_AllTests {
public static function main() {
PHPUnit_TextUI_TestRunner::run(self::suite());
}
-
+
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('System.Web.UI.ActiveControls');
-
- $suite->addTestSuite('TActiveHiddenFieldTest');
+
+ $suite->addTestSuite('TActiveHiddenFieldTest');
return $suite;
}
}
@@ -23,4 +23,3 @@ class Web_UI_ActiveControls_AllTests {
if(PHPUnit_MAIN_METHOD == 'Web_UI_ActiveControls_AllTests::main') {
Web_UI_ActiveControls_AllTests::main();
}
-?>
diff --git a/tests/unit/Web/UI/ActiveControls/TActiveHiddenFieldTest.php b/tests/unit/Web/UI/ActiveControls/TActiveHiddenFieldTest.php
index 58821747..6e80bd12 100644
--- a/tests/unit/Web/UI/ActiveControls/TActiveHiddenFieldTest.php
+++ b/tests/unit/Web/UI/ActiveControls/TActiveHiddenFieldTest.php
@@ -14,5 +14,3 @@ class TActiveHiddenFieldTest extends PHPUnit_Framework_TestCase {
$this->assertEquals('Test', $field->getValue());
}
}
-
-?> \ No newline at end of file
diff --git a/tests/unit/Web/UI/AllTests.php b/tests/unit/Web/UI/AllTests.php
index 71b088e4..6885c337 100644
--- a/tests/unit/Web/UI/AllTests.php
+++ b/tests/unit/Web/UI/AllTests.php
@@ -23,10 +23,10 @@ class Web_UI_AllTests {
public static function main() {
PHPUnit_TextUI_TestRunner::run(self::suite());
}
-
+
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('System.Web.UI');
-
+
$suite->addTestSuite('TClientScriptManagerTest');
$suite->addTestSuite('TControlAdapterTest');
$suite->addTestSuite('TControlTest');
@@ -40,7 +40,7 @@ class Web_UI_AllTests {
$suite->addTestSuite('THtmlWriterTest');
$suite->addTestSuite('TPageStatePersisterTest');
$suite->addTestSuite('TSessionPageStatePersisterTest');
-
+
return $suite;
}
}
@@ -48,4 +48,3 @@ class Web_UI_AllTests {
if(PHPUnit_MAIN_METHOD == 'Web_UI_AllTests::main') {
Web_UI_AllTests::main();
}
-?>
diff --git a/tests/unit/Web/UI/TClientScriptManagerTest.php b/tests/unit/Web/UI/TClientScriptManagerTest.php
index ea360f91..efce0009 100644
--- a/tests/unit/Web/UI/TClientScriptManagerTest.php
+++ b/tests/unit/Web/UI/TClientScriptManagerTest.php
@@ -144,5 +144,4 @@ class TClientScriptManagerTest extends PHPUnit_Framework_TestCase {
throw new PHPUnit_Framework_IncompleteTestError();
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/UI/TControlAdapterTest.php b/tests/unit/Web/UI/TControlAdapterTest.php
index 2a173fd8..ff687cc8 100644
--- a/tests/unit/Web/UI/TControlAdapterTest.php
+++ b/tests/unit/Web/UI/TControlAdapterTest.php
@@ -15,46 +15,45 @@ class TControlAdapterTest extends PHPUnit_Framework_TestCase {
public function testGetControl() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetPage() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testCreateChildControls() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testLoadState() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSaveState() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOnInit() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOnLoad() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOnPreRender() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOnUnload() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testRender() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testRenderChildren() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/UI/TControlTest.php b/tests/unit/Web/UI/TControlTest.php
index 670926be..b6741167 100644
--- a/tests/unit/Web/UI/TControlTest.php
+++ b/tests/unit/Web/UI/TControlTest.php
@@ -15,266 +15,265 @@ class TControlTest extends PHPUnit_Framework_TestCase {
public function test__get() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetHasAdapter() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetAdapter() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetParent() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetNamingContainer() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetPage() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetTemplateControl() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetSourceTemplateControl() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetControlStage() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetID() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetUniqueID() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testFocus() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetClientID() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetSkinID() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetEnableTheming() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetCustomData() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetHasControls() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetControls() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetVisible() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetEnabled() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetHasAttributes() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetAttributes() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testHasAttribute() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetAttribute() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testRemoveAttribute() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetEnableViewState() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetControlState() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testTrackViewState() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetViewState() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testClearViewState() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testBindProperty() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testUnbindProperty() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testAutoBindProperty() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testDataBind() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testEnsureChildControls() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testCreateChildControls() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testFindControl() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testFindControlsByType() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testFindControlsByID() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testClearNamingContainer() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testRegisterObject() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testUnregisterObject() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testIsObjectRegistered() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetHasChildInitialized() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetHasInitialized() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetHasLoadedPostData() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetHasLoaded() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetHasPreRendered() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetRegisteredObject() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetAllowChildControls() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testAddParsedObject() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testAddedControl() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testRemovedControl() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOnInit() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOnLoad() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOnDataBinding() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOnUnload() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOnPreRender() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testBubbleEvent() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testBroadcastEvent() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testRenderControl() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testRender() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testRenderChildren() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSaveState() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testLoadState() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testApplyStyleSheetSkin() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/UI/TFormTest.php b/tests/unit/Web/UI/TFormTest.php
index 74cbdb59..7fb6d2b7 100644
--- a/tests/unit/Web/UI/TFormTest.php
+++ b/tests/unit/Web/UI/TFormTest.php
@@ -15,22 +15,21 @@ class TFormTest extends PHPUnit_Framework_TestCase {
public function testRender() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetDefaultButton() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetMethod() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetEnctype() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetName() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/UI/THtmlWriterTest.php b/tests/unit/Web/UI/THtmlWriterTest.php
index 080e2e26..cf3b27e3 100644
--- a/tests/unit/Web/UI/THtmlWriterTest.php
+++ b/tests/unit/Web/UI/THtmlWriterTest.php
@@ -31,7 +31,7 @@ class TestWriter extends TComponent implements ITextWriter
{
$this->write($str."\n");
}
-
+
// Accessors to get value of private vars during tests
public function getFlushedContent() { return $this->_flushedContent; }
public function getStr() { return $this->_str; }
@@ -77,7 +77,7 @@ class THtmlWriterTest extends PHPUnit_Framework_TestCase {
$writer->addAttribute('value','Prado & Cie');
$result=self::readAttribute($writer, '_attributes');
self::assertEquals('text',$result['type']);
- self::assertEquals(THttpUtility::htmlEncode('Prado & Cie'), $result['value']);
+ self::assertEquals(THttpUtility::htmlEncode('Prado & Cie'), $result['value']);
}
public function testRemoveAttribute() {
@@ -129,21 +129,21 @@ class THtmlWriterTest extends PHPUnit_Framework_TestCase {
$writer=new THtmlWriter(self::$output);
$writer->write('Some Text');;
self::assertEquals('Some Text', self::$output->flush());
-
+
}
public function testWriteLine() {
$writer=new THtmlWriter(self::$output);
$writer->writeLine('Some Text');;
self::assertEquals("Some Text\n", self::$output->flush());
-
+
}
public function testWriteBreak() {
$writer=new THtmlWriter(self::$output);
$writer->writeBreak();
self::assertEquals("<br/>", self::$output->flush());
-
+
}
public function testRenderBeginTag() {
@@ -163,5 +163,4 @@ class THtmlWriterTest extends PHPUnit_Framework_TestCase {
self::assertEquals('<div>Div Content</div>', self::$output->flush());
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/UI/TPageStatePersisterTest.php b/tests/unit/Web/UI/TPageStatePersisterTest.php
index 2734b142..8ee1cfc9 100644
--- a/tests/unit/Web/UI/TPageStatePersisterTest.php
+++ b/tests/unit/Web/UI/TPageStatePersisterTest.php
@@ -7,18 +7,17 @@ Prado::using('System.Web.UI.TPageStatePersister');
* @package System.Web.UI
*/
class TPageStatePersisterTest extends PHPUnit_Framework_TestCase {
-
+
public function testSetAndGetPage() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSave() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testLoad() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/UI/TPageTest.php b/tests/unit/Web/UI/TPageTest.php
index d6f689e9..c1593816 100644
--- a/tests/unit/Web/UI/TPageTest.php
+++ b/tests/unit/Web/UI/TPageTest.php
@@ -15,181 +15,172 @@ class TPageTest extends PHPUnit_Framework_TestCase {
public function testRun() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetCallbackClient() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetCallbackEventTarget() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetCallbackEventParameter() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
- public function testRegisterPostDataLoader() {
- throw new PHPUnit_Framework_IncompleteTestError();
- }
-
- public function testGetPostDataLoaders() {
- throw new PHPUnit_Framework_IncompleteTestError();
- }
-
+
public function testSetAndGetForm() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetValidators() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testValidate() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetIsValid() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetTheme() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetStyleSheetTheme() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testApplyControlSkin() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testApplyControlStyleSheet() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetClientScript() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOnPreInit() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOnInitComplete() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOnPreLoad() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOnLoadComplete() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOnPreRenderComplete() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testOnSaveStateComplete() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetIsPostBack() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetIsCallback() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSaveState() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testLoadState() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testRegisterRequiresPostData() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetPostBackEventTarget() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetPostBackEventParameter() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetIsLoadingPostData() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testEnsureRenderInForm() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testBeginFormRender() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testEndFormRender() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetFocus() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetClientSupportsJavaScript() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetHead() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetTitle() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetClientState() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetRequestClientState() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetStatePersisterClass() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetStatePersister() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetEnableStateValidation() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetEnableStateEncryption() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetPagePath() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testRegisterCachingAction() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetCachingStack() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/UI/TSessionPageStatePersisterTest.php b/tests/unit/Web/UI/TSessionPageStatePersisterTest.php
index b8758b30..9153ad42 100644
--- a/tests/unit/Web/UI/TSessionPageStatePersisterTest.php
+++ b/tests/unit/Web/UI/TSessionPageStatePersisterTest.php
@@ -7,22 +7,21 @@ Prado::using('System.Web.UI.TSessionPageStatePersister');
* @package System.Web.UI
*/
class TSessionPageStatePersisterTest extends PHPUnit_Framework_TestCase {
-
+
public function testSetAndGetPage() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetHistorySize() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSave() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testLoad() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/UI/TTemplateControlTest.php b/tests/unit/Web/UI/TTemplateControlTest.php
index 97ea8c1d..7276a2b0 100644
--- a/tests/unit/Web/UI/TTemplateControlTest.php
+++ b/tests/unit/Web/UI/TTemplateControlTest.php
@@ -15,34 +15,33 @@ class TTemplateControlTest extends PHPUnit_Framework_TestCase {
public function testGetIsSourceTemplateControl() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetTemplateDirectory() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testCreateChildControls() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testRegisterContent() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testRegisterContentPlaceHolder() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetMasterClass() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetMaster() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testInjectContent() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/UI/TTemplateManagerTest.php b/tests/unit/Web/UI/TTemplateManagerTest.php
index 46c17538..dfe452bf 100644
--- a/tests/unit/Web/UI/TTemplateManagerTest.php
+++ b/tests/unit/Web/UI/TTemplateManagerTest.php
@@ -7,18 +7,17 @@ Prado::using('System.Web.UI.TTemplateManager');
* @package System.Web.UI
*/
class TTemplateManagerTest extends PHPUnit_Framework_TestCase {
-
+
public function testInit() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetTemplateByClassName() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetTemplateByFileName() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
-}
-?> \ No newline at end of file
+
+} \ No newline at end of file
diff --git a/tests/unit/Web/UI/TTemplateTest.php b/tests/unit/Web/UI/TTemplateTest.php
index 2bb6599b..2d802094 100644
--- a/tests/unit/Web/UI/TTemplateTest.php
+++ b/tests/unit/Web/UI/TTemplateTest.php
@@ -7,42 +7,41 @@ Prado::using('System.Web.UI.TTemplateManager');
* @package System.Web.UI
*/
class TTemplateTest extends PHPUnit_Framework_TestCase {
-
+
public function testConstruct() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetTemplateFile() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetIsSourceTemplate() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetContextPath() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetDirective() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetHashCode() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetItems() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testInstantiateIn() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetIncludedFiles() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
-}
-?> \ No newline at end of file
+
+} \ No newline at end of file
diff --git a/tests/unit/Web/UI/TThemeManagerTest.php b/tests/unit/Web/UI/TThemeManagerTest.php
index 1a514d2b..028b222a 100644
--- a/tests/unit/Web/UI/TThemeManagerTest.php
+++ b/tests/unit/Web/UI/TThemeManagerTest.php
@@ -7,26 +7,25 @@ Prado::using('System.Web.UI.TThemeManager');
* @package System.Web.UI
*/
class TThemeManagerTest extends PHPUnit_Framework_TestCase {
-
+
public function testInit() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetTheme() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetAvailableThemes() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetBasePath() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testSetAndGetBaseUrl() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/UI/TThemeTest.php b/tests/unit/Web/UI/TThemeTest.php
index e7fa376d..aeeeee65 100644
--- a/tests/unit/Web/UI/TThemeTest.php
+++ b/tests/unit/Web/UI/TThemeTest.php
@@ -7,34 +7,33 @@ Prado::using('System.Web.UI.TThemeManager');
* @package System.Web.UI
*/
class TThemeTest extends PHPUnit_Framework_TestCase {
-
+
public function testConstruct() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetName() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetBaseUrl() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetBasePath() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testApplySkin() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetStyleSheetFiles() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-
+
public function testGetJavaScriptFiles() {
throw new PHPUnit_Framework_IncompleteTestError();
}
-}
-?> \ No newline at end of file
+} \ No newline at end of file
diff --git a/tests/unit/Web/UI/WebControls/AllTests.php b/tests/unit/Web/UI/WebControls/AllTests.php
index 7d0b1632..5ffa45a2 100644
--- a/tests/unit/Web/UI/WebControls/AllTests.php
+++ b/tests/unit/Web/UI/WebControls/AllTests.php
@@ -14,15 +14,15 @@ class Web_UI_WebControls_AllTests {
public static function main() {
PHPUnit_TextUI_TestRunner::run(self::suite());
}
-
+
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('System.Web.UI.WebControls');
-
+
$suite->addTestSuite('TDropDownListTest');
$suite->addTestSuite('TLabelTest');
$suite->addTestSuite('TRequiredFieldValidatorTest');
$suite->addTestSuite('TXmlTransformTest');
-
+
return $suite;
}
}
@@ -30,4 +30,3 @@ class Web_UI_WebControls_AllTests {
if(PHPUnit_MAIN_METHOD == 'Web_UI_WebControls_AllTests::main') {
Web_UI_WebControls_AllTests::main();
}
-?>
diff --git a/tests/unit/Web/UI/WebControls/TDropDownListTest.php b/tests/unit/Web/UI/WebControls/TDropDownListTest.php
index 503466fe..d27ebb9c 100644
--- a/tests/unit/Web/UI/WebControls/TDropDownListTest.php
+++ b/tests/unit/Web/UI/WebControls/TDropDownListTest.php
@@ -27,4 +27,3 @@ class TDropDownListTest extends PHPUnit_Framework_TestCase {
}
}
-?>
diff --git a/tests/unit/Web/UI/WebControls/TLabelTest.php b/tests/unit/Web/UI/WebControls/TLabelTest.php
index 0e5577d5..88d8aec8 100644
--- a/tests/unit/Web/UI/WebControls/TLabelTest.php
+++ b/tests/unit/Web/UI/WebControls/TLabelTest.php
@@ -15,5 +15,3 @@ class TLabelTest extends PHPUnit_Framework_TestCase {
$this->assertEquals('Test', $label->getText());
}
}
-
-?> \ No newline at end of file
diff --git a/tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php b/tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php
index 894c3899..43ed2c9d 100644
--- a/tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php
+++ b/tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php
@@ -19,5 +19,3 @@ class TRequiredFieldValidatorTest extends PHPUnit_Framework_TestCase {
$this->assertEquals('', $value);
}
}
-
-?> \ No newline at end of file
diff --git a/tests/unit/Web/UI/WebControls/TXmlTransformTest.php b/tests/unit/Web/UI/WebControls/TXmlTransformTest.php
index 6c6d9456..f93e9897 100644
--- a/tests/unit/Web/UI/WebControls/TXmlTransformTest.php
+++ b/tests/unit/Web/UI/WebControls/TXmlTransformTest.php
@@ -51,7 +51,7 @@ class TXmlTransformTest extends PHPUnit_Framework_TestCase {
$transform->setTransformContent($expected);
$this->assertEquals($expected, $transform->getTransformContent());
}
-
+
public function testSetTransformPathAsFile() {
$expected = $this->transformPath;
$transform = new TXmlTransform();
@@ -120,10 +120,9 @@ class TXmlTransformTest extends PHPUnit_Framework_TestCase {
$actual = $textWriter->flush();
self::assertEquals($expected, $actual);
}
-
+
public function testRenderWithBodyAsDocumentAndTransformPath() {
throw new PHPUnit_Framework_IncompleteTestError();
}
}
-?>
diff --git a/tests/unit/Xml/AllTests.php b/tests/unit/Xml/AllTests.php
index d934786b..afb4c7a8 100644
--- a/tests/unit/Xml/AllTests.php
+++ b/tests/unit/Xml/AllTests.php
@@ -12,14 +12,14 @@ class Xml_AllTests {
public static function main() {
PHPUnit_TextUI_TestRunner::run(self::suite());
}
-
+
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('System.Xml');
-
+
$suite->addTestSuite('TXmlDocumentTest');
$suite->addTestSuite('TXmlElementTest');
$suite->addTestSuite('TXmlElementListTest');
-
+
return $suite;
}
}
@@ -27,4 +27,3 @@ class Xml_AllTests {
if(PHPUnit_MAIN_METHOD == 'Xml_AllTests::main') {
Xml_AllTests::main();
}
-?>
diff --git a/tests/unit/Xml/TXmlDocumentTest.php b/tests/unit/Xml/TXmlDocumentTest.php
index 2ab95641..54e4b5aa 100644
--- a/tests/unit/Xml/TXmlDocumentTest.php
+++ b/tests/unit/Xml/TXmlDocumentTest.php
@@ -34,7 +34,7 @@ class TXmlDocumentTest extends PHPUnit_Framework_TestCase {
$xmldoc->loadFromFile('unexistentXmlFile.xml');
self::fail('Expected TIOException not thrown');
} catch (TIOException $e) {}
-
+
self::assertTrue($xmldoc->loadFromFile($file));
self::assertEquals('1.0', $xmldoc->getVersion());
self::assertEquals('UTF-8',$xmldoc->getEncoding());
@@ -61,9 +61,9 @@ class TXmlDocumentTest extends PHPUnit_Framework_TestCase {
// Result string should be :
$resultString="<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <node param=\"attribute1\"\n</root>";
self::assertEquals($xmlString, $magicString);
-
+
}
-
+
public function testSaveToFile() {
$file=dirname(__FILE__).'/data/tmp.xml';
if (!is_writable(dirname($file))) self::markTestSkipped(dirname($file).' must be writable for this test');
@@ -77,4 +77,3 @@ class TXmlDocumentTest extends PHPUnit_Framework_TestCase {
if (is_file($file)) unlink ($file);
}
}
-?>
diff --git a/tests/unit/Xml/TXmlElementListTest.php b/tests/unit/Xml/TXmlElementListTest.php
index b124dfbe..7667c64d 100644
--- a/tests/unit/Xml/TXmlElementListTest.php
+++ b/tests/unit/Xml/TXmlElementListTest.php
@@ -23,7 +23,7 @@ class TXmlElementListTest extends PHPUnit_Framework_TestCase {
$newElement=new TXmlElement('newTag');
$list->insertAt(0,$newElement);
self::assertEquals($newElement,$list->itemAt(0));
-
+
}
public function testRemoveAt() {
@@ -34,4 +34,3 @@ class TXmlElementListTest extends PHPUnit_Framework_TestCase {
self::assertEquals($newElement,$list->removeAt(0));
}
}
-?>
diff --git a/tests/unit/Xml/TXmlElementTest.php b/tests/unit/Xml/TXmlElementTest.php
index d7b86832..49cae36f 100644
--- a/tests/unit/Xml/TXmlElementTest.php
+++ b/tests/unit/Xml/TXmlElementTest.php
@@ -7,7 +7,7 @@ Prado::using('System.Xml.TXmlDocument');
*/
class TXmlElementTest extends PHPUnit_Framework_TestCase {
- public function setUp() {
+ public function setUp() {
}
public function testConstruct() {
@@ -80,4 +80,3 @@ class TXmlElementTest extends PHPUnit_Framework_TestCase {
self::assertEquals('<tag key="value">value</tag>', (string)$element);
}
}
-?>