diff options
author | Youmin Ha <youmin.ha@samsung.com> | 2013-04-16 13:53:03 +0900 |
---|---|---|
committer | Youmin Ha <youmin.ha@samsung.com> | 2013-04-16 13:53:03 +0900 |
commit | 6b6cb9b6e1ab63f39cc4bfb28597053b3e5c09f0 (patch) | |
tree | 269dbc7ef0204c77c25953bc622350f0de51395e | |
parent | 197ab7bff99490509bbbf9b4b129badf97110d48 (diff) | |
parent | d54e7e91132799352f4353a8a1e960deb631cbfd (diff) | |
download | web-ui-fw-6b6cb9b6e1ab63f39cc4bfb28597053b3e5c09f0.tar.gz web-ui-fw-6b6cb9b6e1ab63f39cc4bfb28597053b3e5c09f0.tar.bz2 web-ui-fw-6b6cb9b6e1ab63f39cc4bfb28597053b3e5c09f0.zip |
Merge branch 'master' into tizen_2.1
Conflicts:
demos/tizen-winsets/widgets/popupwindow/popupwindow.js
76 files changed, 3356 insertions, 328 deletions
@@ -1,5 +1,7 @@ This software is licensed under the MIT license (as defined -by the OSI at http://www.opensource.org/licenses/mit-license.php) +by the OSI at http://www.opensource.org/licenses/mit-license.php), except for +following files: + * src/js/jquery.mobile.tizen.pinch.js. **************************************************************************** Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. @@ -24,6 +26,218 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************** +The following files are licensed under Flora license. + * src/js/jquery.mobile.tizen.pinch.js. +**************************************************************************** +Flora License + +Version 1.0, May, 2012 + +http://floralicense.org/license/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, +and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by +the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and +all other entities that control, are controlled by, or are +under common control with that entity. For the purposes of +this definition, "control" means (i) the power, direct or indirect, +to cause the direction or management of such entity, +whether by contract or otherwise, or (ii) ownership of fifty percent (50%) +or more of the outstanding shares, or (iii) beneficial ownership of +such entity. + +"You" (or "Your") shall mean an individual or Legal Entity +exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation source, +and configuration files. + +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but +not limited to compiled object code, generated documentation, +and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, +made available under the License, as indicated by a copyright notice +that is included in or attached to the work (an example is provided +in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, +that is based on (or derived from) the Work and for which the editorial +revisions, annotations, elaborations, or other modifications represent, +as a whole, an original work of authorship. For the purposes of this License, +Derivative Works shall not include works that remain separable from, +or merely link (or bind by name) to the interfaces of, the Work and +Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original +version of the Work and any modifications or additions to that Work or +Derivative Works thereof, that is intentionally submitted to Licensor +for inclusion in the Work by the copyright owner or by an individual or +Legal Entity authorized to submit on behalf of the copyright owner. +For the purposes of this definition, "submitted" means any form of +electronic, verbal, or written communication sent to the Licensor or +its representatives, including but not limited to communication on +electronic mailing lists, source code control systems, and issue +tracking systems that are managed by, or on behalf of, the Licensor +for the purpose of discussing and improving the Work, but excluding +communication that is conspicuously marked or otherwise designated +in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity +on behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +"Tizen Certified Platform" shall mean a software platform that complies +with the standards set forth in the Compatibility Definition Document +and passes the Compatibility Test Suite as defined from time to time +by the Tizen Technical Steering Group and certified by the Tizen +Association or its designated agent. + +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the +Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except as stated in this section) patent license to make, have made, +use, offer to sell, sell, import, and otherwise transfer the Work +solely as incorporated into a Tizen Certified Platform, where such +license applies only to those patent claims licensable by such +Contributor that are necessarily infringed by their Contribution(s) +alone or by combination of their Contribution(s) with the Work solely +as incorporated into a Tizen Certified Platform to which such +Contribution(s) was submitted. If You institute patent litigation +against any entity (including a cross-claim or counterclaim +in a lawsuit) alleging that the Work or a Contribution incorporated +within the Work constitutes direct or contributory patent infringement, +then any patent licenses granted to You under this License for that +Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the +Work or Derivative Works thereof pursuant to the copyright license +above, in any medium, with or without modifications, and in Source or +Object form, provided that You meet the following conditions: + + 1. You must give any other recipients of the Work or Derivative Works + a copy of this License; and + 2. You must cause any modified files to carry prominent notices stating + that You changed the files; and + 3. You must retain, in the Source form of any Derivative Works that + You distribute, all copyright, patent, trademark, and attribution + notices from the Source form of the Work, excluding those notices + that do not pertain to any part of the Derivative Works; and + 4. If the Work includes a "NOTICE" text file as part of its distribution, + then any Derivative Works that You distribute must include a readable + copy of the attribution notices contained within such NOTICE file, + excluding those notices that do not pertain to any part of + the Derivative Works, in at least one of the following places: + within a NOTICE text file distributed as part of the Derivative Works; + within the Source form or documentation, if provided along with the + Derivative Works; or, within a display generated by the Derivative Works, + if and wherever such third-party notices normally appear. + The contents of the NOTICE file are for informational purposes only + and do not modify the License. + +You may add Your own attribution notices within Derivative Works +that You distribute, alongside or as an addendum to the NOTICE text +from the Work, provided that such additional attribution notices +cannot be construed as modifying the License. You may add Your own +copyright statement to Your modifications and may provide additional or +different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works +as a whole, provided Your use, reproduction, and distribution of +the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work +by You to the Licensor shall be under the terms and conditions of +this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify +the terms of any separate license agreement you may have executed +with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the +origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or +agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied, including, without limitation, any warranties or conditions +of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +PARTICULAR PURPOSE. You are solely responsible for determining the +appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, +unless required by applicable law (such as deliberate and grossly +negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, +incidental, or consequential damages of any character arising as a +result of this License or out of the use or inability to use the +Work (including but not limited to damages for loss of goodwill, +work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses), even if such Contributor +has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing +the Work or Derivative Works thereof, You may choose to offer, +and charge a fee for, acceptance of support, warranty, indemnity, +or other liability obligations and/or rights consistent with this +License. However, in accepting such obligations, You may act only +on Your own behalf and on Your sole responsibility, not on behalf +of any other Contributor, and only if You agree to indemnify, +defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason +of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Flora License to your work + +To apply the Flora License to your work, attach the following +boilerplate notice, with the fields enclosed by brackets "[]" +replaced with your own identifying information. (Don't include +the brackets!) The text should be enclosed in the appropriate +comment syntax for the file format. We also recommend that a +file or class name and description of purpose be included on the +same "printed page" as the copyright notice for easier +identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Flora License, Version 1.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.tizenopensource.org/license + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +**************************************************************************** + + + This software incorporates software from other sources, including: widgets/jquery.mobile.groupindex/ diff --git a/demos/tizen-winsets/widgets/fastscroll.html b/demos/tizen-winsets/widgets/fastscroll.html index 55de45e7..cbf67954 100644 --- a/demos/tizen-winsets/widgets/fastscroll.html +++ b/demos/tizen-winsets/widgets/fastscroll.html @@ -53,6 +53,8 @@ <li data-role="list-divider">O</li> <li>Organza</li> <li>Orlando</li> + <li data-role="list-divider">1</li> + <li>1st Store</li> </ul> </div><!-- content --> <div data-role="footer"> diff --git a/demos/tizen-winsets/widgets/gallery.html b/demos/tizen-winsets/widgets/gallery.html index 9c02acc0..512f435f 100644 --- a/demos/tizen-winsets/widgets/gallery.html +++ b/demos/tizen-winsets/widgets/gallery.html @@ -27,8 +27,8 @@ <div data-role="footer" data-position ="fixed"> <div data-role="tabbar"> <ul> - <li id="gallery-add"><a href="#">Add</a></li> - <li id="gallery-del"><a href="#">Delete</a></li> + <li id="gallery-add"><a href="#">ADD</a></li> + <li id="gallery-del"><a href="#">DELETE</a></li> </ul> </div><!-- /navbar --> </div> diff --git a/demos/tizen-winsets/widgets/naviframe/naviframe_footer_more_button.html b/demos/tizen-winsets/widgets/naviframe/naviframe_footer_more_button.html index ea7ab851..1a4c8ea6 100644 --- a/demos/tizen-winsets/widgets/naviframe/naviframe_footer_more_button.html +++ b/demos/tizen-winsets/widgets/naviframe/naviframe_footer_more_button.html @@ -26,8 +26,8 @@ <p>Footer more sample</p> </div> <div data-role="footer"> - <div data-role="button" data-inline="true" data-style="round">Button1</div> - <div data-role="button" data-inline="true" data-style="round">Button2</div> + <div data-role="button" data-inline="true" data-style="round">BUTTON1</div> + <div data-role="button" data-inline="true" data-style="round">BUTTON2</div> <a href="#pop_js" data-role="button" data-icon="naviframe-more" data-transition="slidedownfade" data-rel="popup"></a> diff --git a/demos/tizen-winsets/widgets/naviframe/naviframe_title_text_1_btn.html b/demos/tizen-winsets/widgets/naviframe/naviframe_title_text_1_btn.html index 3a72d6df..68c18df6 100644 --- a/demos/tizen-winsets/widgets/naviframe/naviframe_title_text_1_btn.html +++ b/demos/tizen-winsets/widgets/naviframe/naviframe_title_text_1_btn.html @@ -20,7 +20,7 @@ <div data-role="page" data-add-back-btn="true"> <div data-role="header" data-position="fixed"> <h1>TITLE 1 BUTTON</h1> - <a data-icon="naviframe-plus"></a> + <div data-role="button" data-icon="home" class="naviframe-button"></div> </div> <div data-role="content"> <p>Title text Button 01 sample</p> diff --git a/demos/tizen-winsets/widgets/naviframe/naviframe_title_text_2_btn.html b/demos/tizen-winsets/widgets/naviframe/naviframe_title_text_2_btn.html index d62b1285..ef9e1a46 100644 --- a/demos/tizen-winsets/widgets/naviframe/naviframe_title_text_2_btn.html +++ b/demos/tizen-winsets/widgets/naviframe/naviframe_title_text_2_btn.html @@ -20,8 +20,8 @@ <div data-role="page" data-add-back-btn="true"> <div data-role="header" data-position="fixed"> <h1>TITLE 2 BUTTONS </h1> - <a data-icon="naviframe-cancel"></a> - <a data-icon="naviframe-edit"></a> + <div data-role="button" data-icon="naviframe-cancel" class="naviframe-button"></div> + <div data-role="button" data-icon="naviframe-edit" class="naviframe-button"></div> </div> <div data-role="content"> <p>Title text Button 02 sample</p> diff --git a/demos/tizen-winsets/widgets/naviframe/naviframe_title_text_multiline_src_2_btn.html b/demos/tizen-winsets/widgets/naviframe/naviframe_title_text_multiline_src_2_btn.html index d79d029f..53d1ddca 100644 --- a/demos/tizen-winsets/widgets/naviframe/naviframe_title_text_multiline_src_2_btn.html +++ b/demos/tizen-winsets/widgets/naviframe/naviframe_title_text_multiline_src_2_btn.html @@ -23,8 +23,8 @@ <img src="icon-tizen.png"/> <h1>TITLE DEMO</h1> <span class="ui-title-text-sub">TITLE IMAGE MULTILINE 2 BUTTONS</span> - <a data-icon="naviframe-edit"></a> - <a data-icon="naviframe-more"></a> + <div data-role="button" data-icon="naviframe-edit" class="naviframe-button"></div> + <div data-role="button" data-icon="naviframe-more" class="naviframe-button"></div> </div> <div data-role="content"> <p>Image Title text Multiline Button 02 sample</p> diff --git a/demos/tizen-winsets/widgets/popupwindow/popup.html b/demos/tizen-winsets/widgets/popupwindow/popup.html index 27acf9a0..9ea596fb 100644 --- a/demos/tizen-winsets/widgets/popupwindow/popup.html +++ b/demos/tizen-winsets/widgets/popupwindow/popup.html @@ -25,9 +25,6 @@ </div> <div class="content" data-role="content"> <ul data-role="listview" data-icon="1line-textonly"> - <li data-role="list-divider">APP SAMPLES</li> - <li><a href="#center_social_style1" data-inline="true" data-rel="popup" data-position-to="window">Social Magazine style1</a></li> - <li><a href="#center_social_style2" data-inline="true" data-rel="popup" data-position-to="window">Social Magazine style2</a></li> <li data-role="list-divider">NORMAL SAMPLES</li> <li><a href="#center_info" data-inline="true" data-rel="popup" data-position-to="window">Center info popup</a></li> <li><a href="#center_title" data-inline="true" data-rel="popup" data-position-to="window">Center title popup</a></li> @@ -42,51 +39,10 @@ <li><a href="#center_liststyle_1btn" data-inline="true" data-rel="popup" data-position-to="window">Center_list style 1 button popup</a></li> <li><a href="#center_liststyle_2btn" data-inline="true" data-rel="popup" data-position-to="window">Center_list style 2 button popup</a></li> <li><a href="#center_liststyle_3btn" data-inline="true" data-rel="popup" data-position-to="window">Center_list style 3 button popup</a></li> - <li><a href="#textbox_popup" data-inline="true" data-rel="popup" data-position-to="window">Popup has textbox</a></li> + <li id="go_textbox_popup"><a href="#textbox_popup" data-inline="true" data-rel="popup" data-position-to="window">Popup has textbox</a></li> <li><a href="#positionWindow" data-rel="popup" data-position-to="window">Position</a></li> </ul> - <!-- Social Magazine font popup --> - <div id="center_social_style1" data-role="popup" class="center_title_2btn"> - <div class="ui-popup-title"> - <h1>Font Size</h1> - </div> - <div class="ui-popup-scroller-bg" data-scroll="y" style="height:auto"> - <ul data-role="listview"> - <li class="ui-li-has-radio" id="text_fontSmall"> - <input type="radio" name="radio-choice-1" id="fontSmall" value="choice-1"/> - <label for="choice-1">text_Small</label> - </li> - <li class="ui-li-has-radio" id="text_fontMedium"> - <input type="radio" name="radio-choice-1" id="fontMedium" value="choice-2"/> - <label for="choice-2">text_Medium</label> - </li> - <li class="ui-li-has-radio" id="text_fontLarge"> - <input type="radio" name="radio-choice-1" id="fontLarge" value="choice-3"/> - <label for="choice-3">text_Large</label> - </li> - </ul> - </div> - <div class="ui-popup-button-bg"> - <a data-role="button" data-rel="back" data-inline="true">OK</a> - <a data-role="button" data-rel="back" data-inline="true">Cancel</a> - </div> - </div> - - <!-- Social Magazine ime popup --> - <div id="center_social_style2" data-role="popup" class="center_title_2btn"> - <div class="ui-popup-title"> - <h1>Create new category<h1> - </div> - <div class="ui-popup-text"> - <input type="text" id="newCategoryPopupInput" name="newCategoryName" size="20" /> - </div> - <div class="ui-popup-button-bg"> - <a data-role="button" data-rel="back" data-inline="true">OK</a> - <a data-role="button" data-rel="back" data-inline="true">Cancel</a> - </div> - </div> - <!-- Center info Popup --> <div id="center_info" data-role="popup" class="center_info"> <div class="ui-popup-text"> <p> @@ -313,6 +269,12 @@ </div> </div> + <div id="textbox_popup_landscape" data-role="popup" class="center_info"> + <div class="ui-popup-text"> <p> + Not enough area. disable scrollview to use entry popup in landscape mode. + </p></div> + </div> + <div data-role="popup" id="positionWindow"> <p>I am positioned to the window.</p> </div> diff --git a/demos/tizen-winsets/widgets/popupwindow/popupwindow.js b/demos/tizen-winsets/widgets/popupwindow/popupwindow.js index 65232ceb..16f93dd1 100644 --- a/demos/tizen-winsets/widgets/popupwindow/popupwindow.js +++ b/demos/tizen-winsets/widgets/popupwindow/popupwindow.js @@ -2,7 +2,27 @@ $( document ).one( "pageinit", "#popupwindow-demo", function () { $("#btn_textbox_popup_cancel").on("vclick", function ( ev ) { $("#textbox_popup").find("input").val(""); $("#textbox_popup").popup("close"); + return false; }); }); +function onSuccessPopupCallback ( ori ) { + if ( ori.status === "PORTRAIT_PRIMARY" || ori.status === "PORTRAIT_SECONDARY" ) { + $("#textbox_popup_landscape").popup("close"); + $("#go_textbox_popup a").attr("href", "#textbox_popup"); + } + else if ( ori.status === "LANDSCAPE_PRIMARY" || ori.status === "LANDSCAPE_SECONDARY" ) { + $("#textbox_popup").popup("close"); + $("#go_textbox_popup a").attr("href", "#textbox_popup_landscape"); + } + +} + +function onErrorPopupCallback ( error ) { + console.error( "An error occurred " + error.message ); +} + +if ( $.tizen.__tizen__.util.isMobileBrowser() ) { + tizen.systeminfo.addPropertyValueChangeListener( "DEVICE_ORIENTATION", onSuccessPopupCallback, onErrorPopupCallback ); +} diff --git a/demos/tizen-winsets/widgets/scrollview_x.html b/demos/tizen-winsets/widgets/scrollview_x.html index 0140dd49..41634363 100644 --- a/demos/tizen-winsets/widgets/scrollview_x.html +++ b/demos/tizen-winsets/widgets/scrollview_x.html @@ -20,8 +20,8 @@ </div> </div> <p>Horizontal Scroll #2: set the width of view</p> - <div data-scroll="x"> - <div class="ui-scrollview-view" style="width:1185px"> + <div data-scroll="x" style="width:250px; white-space:nowrap;"> + <div class="ui-scrollview-view" style="width:1200px;"> <img src="./test/01.jpg" height="70px"> <img src="./test/02.jpg" height="70px"> <img src="./test/03.jpg" height="70px"> diff --git a/demos/tizen-winsets/widgets/tabbar/tabbar_footer.html b/demos/tizen-winsets/widgets/tabbar/tabbar_footer.html index e3184877..67adb1dc 100644 --- a/demos/tizen-winsets/widgets/tabbar/tabbar_footer.html +++ b/demos/tizen-winsets/widgets/tabbar/tabbar_footer.html @@ -28,9 +28,9 @@ <div data-role="footer"> <div data-role="tabbar"> <ul> - <li><a href="#"class="ui-btn-active">Menu</a></li> - <li><a href="#">Save</a></li> - <li><a href="#">Share</a></li> + <li><a href="#"class="ui-btn-active">MENU</a></li> + <li><a href="#">SAVE</a></li> + <li><a href="#">SHARE</a></li> </ul> </div> </div> diff --git a/demos/tizen-winsets/widgets/tabbar/tabbar_footer_more.html b/demos/tizen-winsets/widgets/tabbar/tabbar_footer_more.html index 374eb59a..69fb63ba 100644 --- a/demos/tizen-winsets/widgets/tabbar/tabbar_footer_more.html +++ b/demos/tizen-winsets/widgets/tabbar/tabbar_footer_more.html @@ -41,9 +41,9 @@ </div> <div data-role="tabbar"> <ul> - <li><a href="#"class="ui-btn-active">Menu</a></li> - <li><a href="#">Save</a></li> - <li><a href="#">Share</a></li> + <li><a href="#"class="ui-btn-active">MENU</a></li> + <li><a href="#">SAVE</a></li> + <li><a href="#">SHARE</a></li> </ul> </div> diff --git a/demos/tizen-winsets/widgets/tabbar/tabbar_footer_segment.html b/demos/tizen-winsets/widgets/tabbar/tabbar_footer_segment.html index 993778a4..871cb7ab 100644 --- a/demos/tizen-winsets/widgets/tabbar/tabbar_footer_segment.html +++ b/demos/tizen-winsets/widgets/tabbar/tabbar_footer_segment.html @@ -27,9 +27,9 @@ <div data-role="footer"> <div data-role="controlgroup" data-type="horizontal"> - <a href="#" data-role="button">Yes</a> - <a href="#" data-role="button">No</a> - <a href="#" data-role="button">Maybe</a> + <a href="#" data-role="button">YES</a> + <a href="#" data-role="button">NO</a> + <a href="#" data-role="button">MAYBE</a> </div> </div> </div> diff --git a/demos/tizen-winsets/widgets/tabbar/tabbar_footer_segment_more.html b/demos/tizen-winsets/widgets/tabbar/tabbar_footer_segment_more.html index 7bbe8ed5..34be34dd 100644 --- a/demos/tizen-winsets/widgets/tabbar/tabbar_footer_segment_more.html +++ b/demos/tizen-winsets/widgets/tabbar/tabbar_footer_segment_more.html @@ -40,8 +40,8 @@ </div> <div data-role="controlgroup" data-type="horizontal"> - <a href="#" data-role="button">Back</a> - <a href="#" data-role="button">Next</a> + <a href="#" data-role="button">BACK</a> + <a href="#" data-role="button">NEXT</a> </div> </div> </div> diff --git a/demos/tizen-winsets/widgets/tabbar/tabbar_persist.html b/demos/tizen-winsets/widgets/tabbar/tabbar_persist.html index b625ca9e..e93a2226 100644 --- a/demos/tizen-winsets/widgets/tabbar/tabbar_persist.html +++ b/demos/tizen-winsets/widgets/tabbar/tabbar_persist.html @@ -22,8 +22,8 @@ <div data-role="tabbar" data-id="persist_header" > <ul> <li><a href="#tabbar_persist_a" class="ui-btn-active ui-state-persist">Menu</a></li> - <li><a href="#tabbar_persist_b" >Save</a></li> - <li><a href="#tabbar_persist_c" >Next</a></li> + <li><a href="./tabbar_persist_b.html" >Save</a></li> + <li><a href="./tabbar_persist_c.html" >Next</a></li> </ul> </div><!-- /tabbar --> </div> @@ -36,42 +36,5 @@ </div> </div> - <div data-role="page" id="tabbar_persist_b" data-add-back-btn="true"> - <div data-role="header" data-position="fixed"> - <div data-role="tabbar" data-id="persist_header" > - <ul> - <li><a href="#tabbar_persist_a" >Menu</a></li> - <li><a href="#tabbar_persist_b" class="ui-btn-active ui-state-persist">Save</a></li> - <li><a href="#tabbar_persist_c" >Next</a></li> - </ul> - </div><!-- /tabbar --> - </div> - - <div data-role="content"> - <p>page b</p> - </div> - - <div data-role="footer"> - </div> - </div> - - <div data-role="page" id="tabbar_persist_c" data-add-back-btn="true"> - <div data-role="header" data-position="fixed"> - <div data-role="tabbar" data-id="persist_header" > - <ul> - <li><a href="#tabbar_persist_a" >Menu</a></li> - <li><a href="#tabbar_persist_b" >Save</a></li> - <li><a href="#tabbar_persist_c" class="ui-btn-active ui-state-persist">Next</a></li> - </ul> - </div><!-- /tabbar --> - </div> - - <div data-role="content"> - <p>page c</p> - </div> - - <div data-role="footer"> - </div> - </div> </body> </html> diff --git a/demos/tizen-winsets/widgets/tabbar/tabbar_persist_b.html b/demos/tizen-winsets/widgets/tabbar/tabbar_persist_b.html new file mode 100644 index 00000000..25cbd5af --- /dev/null +++ b/demos/tizen-winsets/widgets/tabbar/tabbar_persist_b.html @@ -0,0 +1,42 @@ +<!DOCTYPE html> +<html> +<head> + <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8" > + <script src="../../tizen-web-ui-fw/latest/js/jquery.min.js"></script> + <script src="../../configure.js"></script> + <script src="../../tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script> + <script src="../../tizen-web-ui-fw/latest/js/tizen-web-ui-fw.min.js" + data-framework-theme="tizen-white" + data-framework-viewport-width="device-width"> + </script> + <script src="../../main.js"></script> + <title>Tizen UI - Tabbar</title> + <!-- for compatibility test --> + <meta name="apple-mobile-web-app-capable" content="yes" /> + <meta name="apple-mobile-web-app-status-bar-style" content="black" /> + <link rel="apple-touch-icon" href="../../icon-tizen.png" /> +</head> + <body> + + + <div data-role="page" id="tabbar_persist_b" data-add-back-btn="true"> + <div data-role="header" data-position="fixed"> + <div data-role="tabbar" data-id="persist_header" > + <ul> + <li><a href="./tabbar_persist.html" >Menu</a></li> + <li><a href="#tabbar_persist_b" class="ui-btn-active ui-state-persist">Save</a></li> + <li><a href="./tabbar_persist_c.html" >Next</a></li> + </ul> + </div><!-- /tabbar --> + </div> + + <div data-role="content"> + <p>page b</p> + </div> + + <div data-role="footer"> + </div> + </div> + </body> +</html> + diff --git a/demos/tizen-winsets/widgets/tabbar/tabbar_persist_c.html b/demos/tizen-winsets/widgets/tabbar/tabbar_persist_c.html new file mode 100644 index 00000000..9ca6a7bc --- /dev/null +++ b/demos/tizen-winsets/widgets/tabbar/tabbar_persist_c.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<html> +<head> + <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8" > + <script src="../../tizen-web-ui-fw/latest/js/jquery.min.js"></script> + <script src="../../configure.js"></script> + <script src="../../tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script> + <script src="../../tizen-web-ui-fw/latest/js/tizen-web-ui-fw.min.js" + data-framework-theme="tizen-white" + data-framework-viewport-width="device-width"> + </script> + <script src="../../main.js"></script> + <title>Tizen UI - Tabbar</title> + <!-- for compatibility test --> + <meta name="apple-mobile-web-app-capable" content="yes" /> + <meta name="apple-mobile-web-app-status-bar-style" content="black" /> + <link rel="apple-touch-icon" href="../../icon-tizen.png" /> +</head> + <body> + + + +<div data-role="page" id="tabbar_persist_c" data-add-back-btn="true"> + <div data-role="header" data-position="fixed"> + <div data-role="tabbar" data-id="persist_header" > + <ul> + <li><a href="./tabbar_persist.html" >Menu</a></li> + <li><a href="./tabbar_persist_b.html" >Save</a></li> + <li><a href="#tabbar_persist_c" class="ui-btn-active ui-state-persist">Next</a></li> + </ul> + </div><!-- /tabbar --> + </div> + + <div data-role="content"> + <p>page c</p> + </div> + + <div data-role="footer"> + </div> + </div> + </body> +</html> + diff --git a/libs/js/qunit/qunit.css b/libs/js/qunit/qunit.css new file mode 100644 index 00000000..fcb435f6 --- /dev/null +++ b/libs/js/qunit/qunit.css @@ -0,0 +1,236 @@ +/** + * QUnit v1.9.0 - A JavaScript Unit Testing Framework + * + * http://docs.jquery.com/QUnit + * + * Copyright (c) 2012 John Resig, Jörn Zaefferer + * Dual licensed under the MIT (MIT-LICENSE.txt) + * or GPL (GPL-LICENSE.txt) licenses. + */ + +/** Font Family and Sizes */ + +#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { + font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; +} + +#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } +#qunit-tests { font-size: smaller; } + + +/** Resets */ + +#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult { + margin: 0; + padding: 0; +} + + +/** Header */ + +#qunit-header { + padding: 0.5em 0 0.5em 1em; + + color: #8699a4; + background-color: #0d3349; + + font-size: 1.5em; + line-height: 1em; + font-weight: normal; + + border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + -webkit-border-top-right-radius: 5px; + -webkit-border-top-left-radius: 5px; +} + +#qunit-header a { + text-decoration: none; + color: #c2ccd1; +} + +#qunit-header a:hover, +#qunit-header a:focus { + color: #fff; +} + +#qunit-testrunner-toolbar label { + display: inline-block; + padding: 0 .5em 0 .1em; +} + +#qunit-banner { + height: 5px; +} + +#qunit-testrunner-toolbar { + padding: 0.5em 0 0.5em 2em; + color: #5E740B; + background-color: #eee; +} + +#qunit-userAgent { + padding: 0.5em 0 0.5em 2.5em; + background-color: #2b81af; + color: #fff; + text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; +} + + +/** Tests: Pass/Fail */ + +#qunit-tests { + list-style-position: inside; +} + +#qunit-tests li { + padding: 0.4em 0.5em 0.4em 2.5em; + border-bottom: 1px solid #fff; + list-style-position: inside; +} + +#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running { + display: none; +} + +#qunit-tests li strong { + cursor: pointer; +} + +#qunit-tests li a { + padding: 0.5em; + color: #c2ccd1; + text-decoration: none; +} +#qunit-tests li a:hover, +#qunit-tests li a:focus { + color: #000; +} + +#qunit-tests ol { + margin-top: 0.5em; + padding: 0.5em; + + background-color: #fff; + + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} + +#qunit-tests table { + border-collapse: collapse; + margin-top: .2em; +} + +#qunit-tests th { + text-align: right; + vertical-align: top; + padding: 0 .5em 0 0; +} + +#qunit-tests td { + vertical-align: top; +} + +#qunit-tests pre { + margin: 0; + white-space: pre-wrap; + word-wrap: break-word; +} + +#qunit-tests del { + background-color: #e0f2be; + color: #374e0c; + text-decoration: none; +} + +#qunit-tests ins { + background-color: #ffcaca; + color: #500; + text-decoration: none; +} + +/*** Test Counts */ + +#qunit-tests b.counts { color: black; } +#qunit-tests b.passed { color: #5E740B; } +#qunit-tests b.failed { color: #710909; } + +#qunit-tests li li { + padding: 5px; + background-color: #fff; + border-bottom: none; + list-style-position: inside; +} + +/*** Passing Styles */ + +#qunit-tests li li.pass { + color: #3c510c; + background-color: #fff; + border-left: 10px solid #C6E746; +} + +#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } +#qunit-tests .pass .test-name { color: #366097; } + +#qunit-tests .pass .test-actual, +#qunit-tests .pass .test-expected { color: #999999; } + +#qunit-banner.qunit-pass { background-color: #C6E746; } + +/*** Failing Styles */ + +#qunit-tests li li.fail { + color: #710909; + background-color: #fff; + border-left: 10px solid #EE5757; + white-space: pre; +} + +#qunit-tests > li:last-child { + border-radius: 0 0 5px 5px; + -moz-border-radius: 0 0 5px 5px; + -webkit-border-bottom-right-radius: 5px; + -webkit-border-bottom-left-radius: 5px; +} + +#qunit-tests .fail { color: #000000; background-color: #EE5757; } +#qunit-tests .fail .test-name, +#qunit-tests .fail .module-name { color: #000000; } + +#qunit-tests .fail .test-actual { color: #EE5757; } +#qunit-tests .fail .test-expected { color: green; } + +#qunit-banner.qunit-fail { background-color: #EE5757; } + + +/** Result */ + +#qunit-testresult { + padding: 0.5em 0.5em 0.5em 2.5em; + + color: #2b81af; + background-color: #D2E0E6; + + border-bottom: 1px solid white; +} +#qunit-testresult .module-name { + font-weight: bold; +} + +/** Fixture */ + +#qunit-fixture { + position: absolute; + top: -10000px; + left: -10000px; + width: 1000px; + height: 1000px; +} + +[data-nstest-role='page'], [data-nstest-role='dialog'] { + position: absolute !important; + top: -10000px !important; +}
\ No newline at end of file diff --git a/libs/js/qunit/qunit.js b/libs/js/qunit/qunit.js new file mode 100644 index 00000000..73b8d13e --- /dev/null +++ b/libs/js/qunit/qunit.js @@ -0,0 +1,1931 @@ +/** + * QUnit v1.9.0 - A JavaScript Unit Testing Framework + * + * http://docs.jquery.com/QUnit + * + * Copyright (c) 2012 John Resig, Jörn Zaefferer + * Dual licensed under the MIT (MIT-LICENSE.txt) + * or GPL (GPL-LICENSE.txt) licenses. + */ + +(function( window ) { + +var QUnit, + config, + onErrorFnPrev, + testId = 0, + fileName = (sourceFromStacktrace( 0 ) || "" ).replace(/(:\d+)+\)?/, "").replace(/.+\//, ""), + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty, + defined = { + setTimeout: typeof window.setTimeout !== "undefined", + sessionStorage: (function() { + var x = "qunit-test-string"; + try { + sessionStorage.setItem( x, x ); + sessionStorage.removeItem( x ); + return true; + } catch( e ) { + return false; + } + }()) +}; + +function Test( settings ) { + extend( this, settings ); + this.assertions = []; + this.testNumber = ++Test.count; +} + +Test.count = 0; + +Test.prototype = { + init: function() { + var a, b, li, + tests = id( "qunit-tests" ); + + if ( tests ) { + b = document.createElement( "strong" ); + b.innerHTML = this.name; + + // `a` initialized at top of scope + a = document.createElement( "a" ); + a.innerHTML = "Rerun"; + a.href = QUnit.url({ testNumber: this.testNumber }); + + li = document.createElement( "li" ); + li.appendChild( b ); + li.appendChild( a ); + li.className = "running"; + li.id = this.id = "qunit-test-output" + testId++; + + tests.appendChild( li ); + } + }, + setup: function() { + if ( this.module !== config.previousModule ) { + if ( config.previousModule ) { + runLoggingCallbacks( "moduleDone", QUnit, { + name: config.previousModule, + failed: config.moduleStats.bad, + passed: config.moduleStats.all - config.moduleStats.bad, + total: config.moduleStats.all + }); + } + config.previousModule = this.module; + config.moduleStats = { all: 0, bad: 0 }; + runLoggingCallbacks( "moduleStart", QUnit, { + name: this.module + }); + } else if ( config.autorun ) { + runLoggingCallbacks( "moduleStart", QUnit, { + name: this.module + }); + } + + config.current = this; + + this.testEnvironment = extend({ + setup: function() {}, + teardown: function() {} + }, this.moduleTestEnvironment ); + + runLoggingCallbacks( "testStart", QUnit, { + name: this.testName, + module: this.module + }); + + // allow utility functions to access the current test environment + // TODO why?? + QUnit.current_testEnvironment = this.testEnvironment; + + if ( !config.pollution ) { + saveGlobal(); + } + if ( config.notrycatch ) { + this.testEnvironment.setup.call( this.testEnvironment ); + return; + } + try { + this.testEnvironment.setup.call( this.testEnvironment ); + } catch( e ) { + QUnit.pushFailure( "Setup failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) ); + } + }, + run: function() { + config.current = this; + + var running = id( "qunit-testresult" ); + + if ( running ) { + running.innerHTML = "Running: <br/>" + this.name; + } + + if ( this.async ) { + QUnit.stop(); + } + + if ( config.notrycatch ) { + this.callback.call( this.testEnvironment, QUnit.assert ); + return; + } + + try { + this.callback.call( this.testEnvironment, QUnit.assert ); + } catch( e ) { + QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + " " + this.stack + ": " + e.message, extractStacktrace( e, 0 ) ); + // else next test will carry the responsibility + saveGlobal(); + + // Restart the tests if they're blocking + if ( config.blocking ) { + QUnit.start(); + } + } + }, + teardown: function() { + config.current = this; + if ( config.notrycatch ) { + this.testEnvironment.teardown.call( this.testEnvironment ); + return; + } else { + try { + this.testEnvironment.teardown.call( this.testEnvironment ); + } catch( e ) { + QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) ); + } + } + checkPollution(); + }, + finish: function() { + config.current = this; + if ( config.requireExpects && this.expected == null ) { + QUnit.pushFailure( "Expected number of assertions to be defined, but expect() was not called.", this.stack ); + } else if ( this.expected != null && this.expected != this.assertions.length ) { + QUnit.pushFailure( "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run", this.stack ); + } else if ( this.expected == null && !this.assertions.length ) { + QUnit.pushFailure( "Expected at least one assertion, but none were run - call expect(0) to accept zero assertions.", this.stack ); + } + + var assertion, a, b, i, li, ol, + test = this, + good = 0, + bad = 0, + tests = id( "qunit-tests" ); + + config.stats.all += this.assertions.length; + config.moduleStats.all += this.assertions.length; + + if ( tests ) { + ol = document.createElement( "ol" ); + + for ( i = 0; i < this.assertions.length; i++ ) { + assertion = this.assertions[i]; + + li = document.createElement( "li" ); + li.className = assertion.result ? "pass" : "fail"; + li.innerHTML = assertion.message || ( assertion.result ? "okay" : "failed" ); + ol.appendChild( li ); + + if ( assertion.result ) { + good++; + } else { + bad++; + config.stats.bad++; + config.moduleStats.bad++; + } + } + + // store result when possible + if ( QUnit.config.reorder && defined.sessionStorage ) { + if ( bad ) { + sessionStorage.setItem( "qunit-test-" + this.module + "-" + this.testName, bad ); + } else { + sessionStorage.removeItem( "qunit-test-" + this.module + "-" + this.testName ); + } + } + + if ( bad === 0 ) { + ol.style.display = "none"; + } + + // `b` initialized at top of scope + b = document.createElement( "strong" ); + b.innerHTML = this.name + " <b class='counts'>(<b class='failed'>" + bad + "</b>, <b class='passed'>" + good + "</b>, " + this.assertions.length + ")</b>"; + + addEvent(b, "click", function() { + var next = b.nextSibling.nextSibling, + display = next.style.display; + next.style.display = display === "none" ? "block" : "none"; + }); + + addEvent(b, "dblclick", function( e ) { + var target = e && e.target ? e.target : window.event.srcElement; + if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) { + target = target.parentNode; + } + if ( window.location && target.nodeName.toLowerCase() === "strong" ) { + window.location = QUnit.url({ testNumber: test.testNumber }); + } + }); + + // `li` initialized at top of scope + li = id( this.id ); + li.className = bad ? "fail" : "pass"; + li.removeChild( li.firstChild ); + a = li.firstChild; + li.appendChild( b ); + li.appendChild ( a ); + li.appendChild( ol ); + + } else { + for ( i = 0; i < this.assertions.length; i++ ) { + if ( !this.assertions[i].result ) { + bad++; + config.stats.bad++; + config.moduleStats.bad++; + } + } + } + + runLoggingCallbacks( "testDone", QUnit, { + name: this.testName, + module: this.module, + failed: bad, + passed: this.assertions.length - bad, + total: this.assertions.length + }); + + QUnit.reset(); + + config.current = undefined; + }, + + queue: function() { + var bad, + test = this; + + synchronize(function() { + test.init(); + }); + function run() { + // each of these can by async + synchronize(function() { + test.setup(); + }); + synchronize(function() { + test.run(); + }); + synchronize(function() { + test.teardown(); + }); + synchronize(function() { + test.finish(); + }); + } + + // `bad` initialized at top of scope + // defer when previous test run passed, if storage is available + bad = QUnit.config.reorder && defined.sessionStorage && + +sessionStorage.getItem( "qunit-test-" + this.module + "-" + this.testName ); + + if ( bad ) { + run(); + } else { + synchronize( run, true ); + } + } +}; + +// Root QUnit object. +// `QUnit` initialized at top of scope +QUnit = { + + // call on start of module test to prepend name to all tests + module: function( name, testEnvironment ) { + config.currentModule = name; + config.currentModuleTestEnviroment = testEnvironment; + }, + + asyncTest: function( testName, expected, callback ) { + if ( arguments.length === 2 ) { + callback = expected; + expected = null; + } + + QUnit.test( testName, expected, callback, true ); + }, + + test: function( testName, expected, callback, async ) { + var test, + name = "<span class='test-name'>" + escapeInnerText( testName ) + "</span>"; + + if ( arguments.length === 2 ) { + callback = expected; + expected = null; + } + + if ( config.currentModule ) { + name = "<span class='module-name'>" + config.currentModule + "</span>: " + name; + } + + test = new Test({ + name: name, + testName: testName, + expected: expected, + async: async, + callback: callback, + module: config.currentModule, + moduleTestEnvironment: config.currentModuleTestEnviroment, + stack: sourceFromStacktrace( 2 ) + }); + + if ( !validTest( test ) ) { + return; + } + + test.queue(); + }, + + // Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through. + expect: function( asserts ) { + config.current.expected = asserts; + }, + + start: function( count ) { + config.semaphore -= count || 1; + // don't start until equal number of stop-calls + if ( config.semaphore > 0 ) { + return; + } + // ignore if start is called more often then stop + if ( config.semaphore < 0 ) { + config.semaphore = 0; + } + // A slight delay, to avoid any current callbacks + if ( defined.setTimeout ) { + window.setTimeout(function() { + if ( config.semaphore > 0 ) { + return; + } + if ( config.timeout ) { + clearTimeout( config.timeout ); + } + + config.blocking = false; + process( true ); + }, 13); + } else { + config.blocking = false; + process( true ); + } + }, + + stop: function( count ) { + config.semaphore += count || 1; + config.blocking = true; + + if ( config.testTimeout && defined.setTimeout ) { + clearTimeout( config.timeout ); + config.timeout = window.setTimeout(function() { + QUnit.ok( false, "Test timed out" ); + config.semaphore = 1; + QUnit.start(); + }, config.testTimeout ); + } + } +}; + +// Asssert helpers +// All of these must call either QUnit.push() or manually do: +// - runLoggingCallbacks( "log", .. ); +// - config.current.assertions.push({ .. }); +QUnit.assert = { + /** + * Asserts rough true-ish result. + * @name ok + * @function + * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" ); + */ + ok: function( result, msg ) { + if ( !config.current ) { + throw new Error( "ok() assertion outside test context, was " + sourceFromStacktrace(2) ); + } + result = !!result; + + var source, + details = { + result: result, + message: msg + }; + + msg = escapeInnerText( msg || (result ? "okay" : "failed" ) ); + msg = "<span class='test-message'>" + msg + "</span>"; + + if ( !result ) { + source = sourceFromStacktrace( 2 ); + if ( source ) { + details.source = source; + msg += "<table><tr class='test-source'><th>Source: </th><td><pre>" + escapeInnerText( source ) + "</pre></td></tr></table>"; + } + } + runLoggingCallbacks( "log", QUnit, details ); + config.current.assertions.push({ + result: result, + message: msg + }); + }, + + /** + * Assert that the first two arguments are equal, with an optional message. + * Prints out both actual and expected values. + * @name equal + * @function + * @example equal( format( "Received {0} bytes.", 2), "Received 2 bytes.", "format() replaces {0} with next argument" ); + */ + equal: function( actual, expected, message ) { + QUnit.push( expected == actual, actual, expected, message ); + }, + + /** + * @name notEqual + * @function + */ + notEqual: function( actual, expected, message ) { + QUnit.push( expected != actual, actual, expected, message ); + }, + + /** + * @name deepEqual + * @function + */ + deepEqual: function( actual, expected, message ) { + QUnit.push( QUnit.equiv(actual, expected), actual, expected, message ); + }, + + /** + * @name notDeepEqual + * @function + */ + notDeepEqual: function( actual, expected, message ) { + QUnit.push( !QUnit.equiv(actual, expected), actual, expected, message ); + }, + + /** + * @name strictEqual + * @function + */ + strictEqual: function( actual, expected, message ) { + QUnit.push( expected === actual, actual, expected, message ); + }, + + /** + * @name notStrictEqual + * @function + */ + notStrictEqual: function( actual, expected, message ) { + QUnit.push( expected !== actual, actual, expected, message ); + }, + + throws: function( block, expected, message ) { + var actual, + ok = false; + + // 'expected' is optional + if ( typeof expected === "string" ) { + message = expected; + expected = null; + } + + config.current.ignoreGlobalErrors = true; + try { + block.call( config.current.testEnvironment ); + } catch (e) { + actual = e; + } + config.current.ignoreGlobalErrors = false; + + if ( actual ) { + // we don't want to validate thrown error + if ( !expected ) { + ok = true; + // expected is a regexp + } else if ( QUnit.objectType( expected ) === "regexp" ) { + ok = expected.test( actual ); + // expected is a constructor + } else if ( actual instanceof expected ) { + ok = true; + // expected is a validation function which returns true is validation passed + } else if ( expected.call( {}, actual ) === true ) { + ok = true; + } + + QUnit.push( ok, actual, null, message ); + } else { + QUnit.pushFailure( message, null, 'No exception was thrown.' ); + } + } +}; + +/** + * @deprecate since 1.8.0 + * Kept assertion helpers in root for backwards compatibility + */ +extend( QUnit, QUnit.assert ); + +/** + * @deprecated since 1.9.0 + * Kept global "raises()" for backwards compatibility + */ +QUnit.raises = QUnit.assert.throws; + +/** + * @deprecated since 1.0.0, replaced with error pushes since 1.3.0 + * Kept to avoid TypeErrors for undefined methods. + */ +QUnit.equals = function() { + QUnit.push( false, false, false, "QUnit.equals has been deprecated since 2009 (e88049a0), use QUnit.equal instead" ); +}; +QUnit.same = function() { + QUnit.push( false, false, false, "QUnit.same has been deprecated since 2009 (e88049a0), use QUnit.deepEqual instead" ); +}; + +// We want access to the constructor's prototype +(function() { + function F() {} + F.prototype = QUnit; + QUnit = new F(); + // Make F QUnit's constructor so that we can add to the prototype later + QUnit.constructor = F; +}()); + +/** + * Config object: Maintain internal state + * Later exposed as QUnit.config + * `config` initialized at top of scope + */ +config = { + // The queue of tests to run + queue: [], + + // block until document ready + blocking: true, + + // when enabled, show only failing tests + // gets persisted through sessionStorage and can be changed in UI via checkbox + hidepassed: false, + + // by default, run previously failed tests first + // very useful in combination with "Hide passed tests" checked + reorder: true, + + // by default, modify document.title when suite is done + altertitle: true, + + // when enabled, all tests must call expect() + requireExpects: false, + + // add checkboxes that are persisted in the query-string + // when enabled, the id is set to `true` as a `QUnit.config` property + urlConfig: [ + { + id: "noglobals", + label: "Check for Globals", + tooltip: "Enabling this will test if any test introduces new properties on the `window` object. Stored as query-strings." + }, + { + id: "notrycatch", + label: "No try-catch", + tooltip: "Enabling this will run tests outside of a try-catch block. Makes debugging exceptions in IE reasonable. Stored as query-strings." + } + ], + + // logging callback queues + begin: [], + done: [], + log: [], + testStart: [], + testDone: [], + moduleStart: [], + moduleDone: [] +}; + +// Initialize more QUnit.config and QUnit.urlParams +(function() { + var i, + location = window.location || { search: "", protocol: "file:" }, + params = location.search.slice( 1 ).split( "&" ), + length = params.length, + urlParams = {}, + current; + + if ( params[ 0 ] ) { + for ( i = 0; i < length; i++ ) { + current = params[ i ].split( "=" ); + current[ 0 ] = decodeURIComponent( current[ 0 ] ); + // allow just a key to turn on a flag, e.g., test.html?noglobals + current[ 1 ] = current[ 1 ] ? decodeURIComponent( current[ 1 ] ) : true; + urlParams[ current[ 0 ] ] = current[ 1 ]; + } + } + + QUnit.urlParams = urlParams; + + // String search anywhere in moduleName+testName + config.filter = urlParams.filter; + + // Exact match of the module name + config.module = urlParams.module; + + config.testNumber = parseInt( urlParams.testNumber, 10 ) || null; + + // Figure out if we're running the tests from a server or not + QUnit.isLocal = location.protocol === "file:"; +}()); + +// Export global variables, unless an 'exports' object exists, +// in that case we assume we're in CommonJS (dealt with on the bottom of the script) +if ( typeof exports === "undefined" ) { + extend( window, QUnit ); + + // Expose QUnit object + window.QUnit = QUnit; +} + +// Extend QUnit object, +// these after set here because they should not be exposed as global functions +extend( QUnit, { + config: config, + + // Initialize the configuration options + init: function() { + extend( config, { + stats: { all: 0, bad: 0 }, + moduleStats: { all: 0, bad: 0 }, + started: +new Date(), + updateRate: 1000, + blocking: false, + autostart: true, + autorun: false, + filter: "", + queue: [], + semaphore: 0 + }); + + var tests, banner, result, + qunit = id( "qunit" ); + + if ( qunit ) { + qunit.innerHTML = + "<h1 id='qunit-header'>" + escapeInnerText( document.title ) + "</h1>" + + "<h2 id='qunit-banner'></h2>" + + "<div id='qunit-testrunner-toolbar'></div>" + + "<h2 id='qunit-userAgent'></h2>" + + "<ol id='qunit-tests'></ol>"; + } + + tests = id( "qunit-tests" ); + banner = id( "qunit-banner" ); + result = id( "qunit-testresult" ); + + if ( tests ) { + tests.innerHTML = ""; + } + + if ( banner ) { + banner.className = ""; + } + + if ( result ) { + result.parentNode.removeChild( result ); + } + + if ( tests ) { + result = document.createElement( "p" ); + result.id = "qunit-testresult"; + result.className = "result"; + tests.parentNode.insertBefore( result, tests ); + result.innerHTML = "Running...<br/> "; + } + }, + + // Resets the test setup. Useful for tests that modify the DOM. + // If jQuery is available, uses jQuery's html(), otherwise just innerHTML. + reset: function() { + var fixture; + + if ( window.jQuery ) { + jQuery( "#qunit-fixture" ).html( config.fixture ); + } else { + fixture = id( "qunit-fixture" ); + if ( fixture ) { + fixture.innerHTML = config.fixture; + } + } + }, + + // Trigger an event on an element. + // @example triggerEvent( document.body, "click" ); + triggerEvent: function( elem, type, event ) { + if ( document.createEvent ) { + event = document.createEvent( "MouseEvents" ); + event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView, + 0, 0, 0, 0, 0, false, false, false, false, 0, null); + + elem.dispatchEvent( event ); + } else if ( elem.fireEvent ) { + elem.fireEvent( "on" + type ); + } + }, + + // Safe object type checking + is: function( type, obj ) { + return QUnit.objectType( obj ) == type; + }, + + objectType: function( obj ) { + if ( typeof obj === "undefined" ) { + return "undefined"; + // consider: typeof null === object + } + if ( obj === null ) { + return "null"; + } + + var type = toString.call( obj ).match(/^\[object\s(.*)\]$/)[1] || ""; + + switch ( type ) { + case "Number": + if ( isNaN(obj) ) { + return "nan"; + } + return "number"; + case "String": + case "Boolean": + case "Array": + case "Date": + case "RegExp": + case "Function": + return type.toLowerCase(); + } + if ( typeof obj === "object" ) { + return "object"; + } + return undefined; + }, + + push: function( result, actual, expected, message ) { + if ( !config.current ) { + throw new Error( "assertion outside test context, was " + sourceFromStacktrace() ); + } + + var output, source, + details = { + result: result, + message: message, + actual: actual, + expected: expected + }; + + message = escapeInnerText( message ) || ( result ? "okay" : "failed" ); + message = "<span class='test-message'>" + message + "</span>"; + output = message; + + if ( !result ) { + expected = escapeInnerText( QUnit.jsDump.parse(expected) ); + actual = escapeInnerText( QUnit.jsDump.parse(actual) ); + output += "<table><tr class='test-expected'><th>Expected: </th><td><pre>" + expected + "</pre></td></tr>"; + + if ( actual != expected ) { + output += "<tr class='test-actual'><th>Result: </th><td><pre>" + actual + "</pre></td></tr>"; + output += "<tr class='test-diff'><th>Diff: </th><td><pre>" + QUnit.diff( expected, actual ) + "</pre></td></tr>"; + } + + source = sourceFromStacktrace(); + + if ( source ) { + details.source = source; + output += "<tr class='test-source'><th>Source: </th><td><pre>" + escapeInnerText( source ) + "</pre></td></tr>"; + } + + output += "</table>"; + } + + runLoggingCallbacks( "log", QUnit, details ); + + config.current.assertions.push({ + result: !!result, + message: output + }); + }, + + pushFailure: function( message, source, actual ) { + if ( !config.current ) { + throw new Error( "pushFailure() assertion outside test context, was " + sourceFromStacktrace(2) ); + } + + var output, + details = { + result: false, + message: message + }; + + message = escapeInnerText( message ) || "error"; + message = "<span class='test-message'>" + message + "</span>"; + output = message; + + output += "<table>"; + + if ( actual ) { + output += "<tr class='test-actual'><th>Result: </th><td><pre>" + escapeInnerText( actual ) + "</pre></td></tr>"; + } + + if ( source ) { + details.source = source; + output += "<tr class='test-source'><th>Source: </th><td><pre>" + escapeInnerText( source ) + "</pre></td></tr>"; + } + + output += "</table>"; + + runLoggingCallbacks( "log", QUnit, details ); + + config.current.assertions.push({ + result: false, + message: output + }); + }, + + url: function( params ) { + params = extend( extend( {}, QUnit.urlParams ), params ); + var key, + querystring = "?"; + + for ( key in params ) { + if ( !hasOwn.call( params, key ) ) { + continue; + } + querystring += encodeURIComponent( key ) + "=" + + encodeURIComponent( params[ key ] ) + "&"; + } + return window.location.pathname + querystring.slice( 0, -1 ); + }, + + extend: extend, + id: id, + addEvent: addEvent + // load, equiv, jsDump, diff: Attached later +}); + +/** + * @deprecated: Created for backwards compatibility with test runner that set the hook function + * into QUnit.{hook}, instead of invoking it and passing the hook function. + * QUnit.constructor is set to the empty F() above so that we can add to it's prototype here. + * Doing this allows us to tell if the following methods have been overwritten on the actual + * QUnit object. + */ +extend( QUnit.constructor.prototype, { + + // Logging callbacks; all receive a single argument with the listed properties + // run test/logs.html for any related changes + begin: registerLoggingCallback( "begin" ), + + // done: { failed, passed, total, runtime } + done: registerLoggingCallback( "done" ), + + // log: { result, actual, expected, message } + log: registerLoggingCallback( "log" ), + + // testStart: { name } + testStart: registerLoggingCallback( "testStart" ), + + // testDone: { name, failed, passed, total } + testDone: registerLoggingCallback( "testDone" ), + + // moduleStart: { name } + moduleStart: registerLoggingCallback( "moduleStart" ), + + // moduleDone: { name, failed, passed, total } + moduleDone: registerLoggingCallback( "moduleDone" ) +}); + +if ( typeof document === "undefined" || document.readyState === "complete" ) { + config.autorun = true; +} + +QUnit.load = function() { + runLoggingCallbacks( "begin", QUnit, {} ); + + // Initialize the config, saving the execution queue + var banner, filter, i, label, len, main, ol, toolbar, userAgent, val, urlConfigCheckboxes, + urlConfigHtml = "", + oldconfig = extend( {}, config ); + + QUnit.init(); + extend(config, oldconfig); + + config.blocking = false; + + len = config.urlConfig.length; + + for ( i = 0; i < len; i++ ) { + val = config.urlConfig[i]; + if ( typeof val === "string" ) { + val = { + id: val, + label: val, + tooltip: "[no tooltip available]" + }; + } + config[ val.id ] = QUnit.urlParams[ val.id ]; + urlConfigHtml += "<input id='qunit-urlconfig-" + val.id + "' name='" + val.id + "' type='checkbox'" + ( config[ val.id ] ? " checked='checked'" : "" ) + " title='" + val.tooltip + "'><label for='qunit-urlconfig-" + val.id + "' title='" + val.tooltip + "'>" + val.label + "</label>"; + } + + // `userAgent` initialized at top of scope + userAgent = id( "qunit-userAgent" ); + if ( userAgent ) { + userAgent.innerHTML = navigator.userAgent; + } + + // `banner` initialized at top of scope + banner = id( "qunit-header" ); + if ( banner ) { + banner.innerHTML = "<a href='" + QUnit.url({ filter: undefined, module: undefined, testNumber: undefined }) + "'>" + banner.innerHTML + "</a> "; + } + + // `toolbar` initialized at top of scope + toolbar = id( "qunit-testrunner-toolbar" ); + if ( toolbar ) { + // `filter` initialized at top of scope + filter = document.createElement( "input" ); + filter.type = "checkbox"; + filter.id = "qunit-filter-pass"; + + addEvent( filter, "click", function() { + var tmp, + ol = document.getElementById( "qunit-tests" ); + + if ( filter.checked ) { + ol.className = ol.className + " hidepass"; + } else { + tmp = " " + ol.className.replace( /[\n\t\r]/g, " " ) + " "; + ol.className = tmp.replace( / hidepass /, " " ); + } + if ( defined.sessionStorage ) { + if (filter.checked) { + sessionStorage.setItem( "qunit-filter-passed-tests", "true" ); + } else { + sessionStorage.removeItem( "qunit-filter-passed-tests" ); + } + } + }); + + if ( config.hidepassed || defined.sessionStorage && sessionStorage.getItem( "qunit-filter-passed-tests" ) ) { + filter.checked = true; + // `ol` initialized at top of scope + ol = document.getElementById( "qunit-tests" ); + ol.className = ol.className + " hidepass"; + } + toolbar.appendChild( filter ); + + // `label` initialized at top of scope + label = document.createElement( "label" ); + label.setAttribute( "for", "qunit-filter-pass" ); + label.setAttribute( "title", "Only show tests and assertons that fail. Stored in sessionStorage." ); + label.innerHTML = "Hide passed tests"; + toolbar.appendChild( label ); + + urlConfigCheckboxes = document.createElement( 'span' ); + urlConfigCheckboxes.innerHTML = urlConfigHtml; + addEvent( urlConfigCheckboxes, "change", function( event ) { + var params = {}; + params[ event.target.name ] = event.target.checked ? true : undefined; + window.location = QUnit.url( params ); + }); + toolbar.appendChild( urlConfigCheckboxes ); + } + + // `main` initialized at top of scope + main = id( "qunit-fixture" ); + if ( main ) { + config.fixture = main.innerHTML; + } + + if ( config.autostart ) { + QUnit.start(); + } +}; + +addEvent( window, "load", QUnit.load ); + +// `onErrorFnPrev` initialized at top of scope +// Preserve other handlers +onErrorFnPrev = window.onerror; + +// Cover uncaught exceptions +// Returning true will surpress the default browser handler, +// returning false will let it run. +window.onerror = function ( error, filePath, linerNr ) { + var ret = false; + if ( onErrorFnPrev ) { + ret = onErrorFnPrev( error, filePath, linerNr ); + } + + // Treat return value as window.onerror itself does, + // Only do our handling if not surpressed. + if ( ret !== true ) { + if ( QUnit.config.current ) { + if ( QUnit.config.current.ignoreGlobalErrors ) { + return true; + } + QUnit.pushFailure( error, filePath + ":" + linerNr ); + } else { + QUnit.test( "global failure", function() { + QUnit.pushFailure( error, filePath + ":" + linerNr ); + }); + } + return false; + } + + return ret; +}; + +function done() { + config.autorun = true; + + // Log the last module results + if ( config.currentModule ) { + runLoggingCallbacks( "moduleDone", QUnit, { + name: config.currentModule, + failed: config.moduleStats.bad, + passed: config.moduleStats.all - config.moduleStats.bad, + total: config.moduleStats.all + }); + } + + var i, key, + banner = id( "qunit-banner" ), + tests = id( "qunit-tests" ), + runtime = +new Date() - config.started, + passed = config.stats.all - config.stats.bad, + html = [ + "Tests completed in ", + runtime, + " milliseconds.<br/>", + "<span class='passed'>", + passed, + "</span> tests of <span class='total'>", + config.stats.all, + "</span> passed, <span class='failed'>", + config.stats.bad, + "</span> failed." + ].join( "" ); + + if ( banner ) { + banner.className = ( config.stats.bad ? "qunit-fail" : "qunit-pass" ); + } + + if ( tests ) { + id( "qunit-testresult" ).innerHTML = html; + } + + if ( config.altertitle && typeof document !== "undefined" && document.title ) { + // show ✖ for good, ✔ for bad suite result in title + // use escape sequences in case file gets loaded with non-utf-8-charset + document.title = [ + ( config.stats.bad ? "\u2716" : "\u2714" ), + document.title.replace( /^[\u2714\u2716] /i, "" ) + ].join( " " ); + } + + // clear own sessionStorage items if all tests passed + if ( config.reorder && defined.sessionStorage && config.stats.bad === 0 ) { + // `key` & `i` initialized at top of scope + for ( i = 0; i < sessionStorage.length; i++ ) { + key = sessionStorage.key( i++ ); + if ( key.indexOf( "qunit-test-" ) === 0 ) { + sessionStorage.removeItem( key ); + } + } + } + + runLoggingCallbacks( "done", QUnit, { + failed: config.stats.bad, + passed: passed, + total: config.stats.all, + runtime: runtime + }); +} + +/** @return Boolean: true if this test should be ran */ +function validTest( test ) { + var include, + filter = config.filter && config.filter.toLowerCase(), + module = config.module && config.module.toLowerCase(), + fullName = (test.module + ": " + test.testName).toLowerCase(); + + if ( config.testNumber ) { + return test.testNumber === config.testNumber; + } + + if ( module && ( !test.module || test.module.toLowerCase() !== module ) ) { + return false; + } + + if ( !filter ) { + return true; + } + + include = filter.charAt( 0 ) !== "!"; + if ( !include ) { + filter = filter.slice( 1 ); + } + + // If the filter matches, we need to honour include + if ( fullName.indexOf( filter ) !== -1 ) { + return include; + } + + // Otherwise, do the opposite + return !include; +} + +// so far supports only Firefox, Chrome and Opera (buggy), Safari (for real exceptions) +// Later Safari and IE10 are supposed to support error.stack as well +// See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack +function extractStacktrace( e, offset ) { + offset = offset === undefined ? 3 : offset; + + var stack, include, i, regex; + + if ( e.stacktrace ) { + // Opera + return e.stacktrace.split( "\n" )[ offset + 3 ]; + } else if ( e.stack ) { + // Firefox, Chrome + stack = e.stack.split( "\n" ); + if (/^error$/i.test( stack[0] ) ) { + stack.shift(); + } + if ( fileName ) { + include = []; + for ( i = offset; i < stack.length; i++ ) { + if ( stack[ i ].indexOf( fileName ) != -1 ) { + break; + } + include.push( stack[ i ] ); + } + if ( include.length ) { + return include.join( "\n" ); + } + } + return stack[ offset ]; + } else if ( e.sourceURL ) { + // Safari, PhantomJS + // hopefully one day Safari provides actual stacktraces + // exclude useless self-reference for generated Error objects + if ( /qunit.js$/.test( e.sourceURL ) ) { + return; + } + // for actual exceptions, this is useful + return e.sourceURL + ":" + e.line; + } +} +function sourceFromStacktrace( offset ) { + try { + throw new Error(); + } catch ( e ) { + return extractStacktrace( e, offset ); + } +} + +function escapeInnerText( s ) { + if ( !s ) { + return ""; + } + s = s + ""; + return s.replace( /[\&<>]/g, function( s ) { + switch( s ) { + case "&": return "&"; + case "<": return "<"; + case ">": return ">"; + default: return s; + } + }); +} + +function synchronize( callback, last ) { + config.queue.push( callback ); + + if ( config.autorun && !config.blocking ) { + process( last ); + } +} + +function process( last ) { + function next() { + process( last ); + } + var start = new Date().getTime(); + config.depth = config.depth ? config.depth + 1 : 1; + + while ( config.queue.length && !config.blocking ) { + if ( !defined.setTimeout || config.updateRate <= 0 || ( ( new Date().getTime() - start ) < config.updateRate ) ) { + config.queue.shift()(); + } else { + window.setTimeout( next, 13 ); + break; + } + } + config.depth--; + if ( last && !config.blocking && !config.queue.length && config.depth === 0 ) { + done(); + } +} + +function saveGlobal() { + config.pollution = []; + + if ( config.noglobals ) { + for ( var key in window ) { + // in Opera sometimes DOM element ids show up here, ignore them + if ( !hasOwn.call( window, key ) || /^qunit-test-output/.test( key ) ) { + continue; + } + config.pollution.push( key ); + } + } +} + +function checkPollution( name ) { + var newGlobals, + deletedGlobals, + old = config.pollution; + + saveGlobal(); + + newGlobals = diff( config.pollution, old ); + if ( newGlobals.length > 0 ) { + QUnit.pushFailure( "Introduced global variable(s): " + newGlobals.join(", ") ); + } + + deletedGlobals = diff( old, config.pollution ); + if ( deletedGlobals.length > 0 ) { + QUnit.pushFailure( "Deleted global variable(s): " + deletedGlobals.join(", ") ); + } +} + +// returns a new Array with the elements that are in a but not in b +function diff( a, b ) { + var i, j, + result = a.slice(); + + for ( i = 0; i < result.length; i++ ) { + for ( j = 0; j < b.length; j++ ) { + if ( result[i] === b[j] ) { + result.splice( i, 1 ); + i--; + break; + } + } + } + return result; +} + +function extend( a, b ) { + for ( var prop in b ) { + if ( b[ prop ] === undefined ) { + delete a[ prop ]; + + // Avoid "Member not found" error in IE8 caused by setting window.constructor + } else if ( prop !== "constructor" || a !== window ) { + a[ prop ] = b[ prop ]; + } + } + + return a; +} + +function addEvent( elem, type, fn ) { + if ( elem.addEventListener ) { + elem.addEventListener( type, fn, false ); + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, fn ); + } else { + fn(); + } +} + +function id( name ) { + return !!( typeof document !== "undefined" && document && document.getElementById ) && + document.getElementById( name ); +} + +function registerLoggingCallback( key ) { + return function( callback ) { + config[key].push( callback ); + }; +} + +// Supports deprecated method of completely overwriting logging callbacks +function runLoggingCallbacks( key, scope, args ) { + var i, callbacks; + if ( QUnit.hasOwnProperty( key ) ) { + QUnit[ key ].call(scope, args ); + } else { + callbacks = config[ key ]; + for ( i = 0; i < callbacks.length; i++ ) { + callbacks[ i ].call( scope, args ); + } + } +} + +// Test for equality any JavaScript type. +// Author: Philippe Rathé <prathe@gmail.com> +QUnit.equiv = (function() { + + // Call the o related callback with the given arguments. + function bindCallbacks( o, callbacks, args ) { + var prop = QUnit.objectType( o ); + if ( prop ) { + if ( QUnit.objectType( callbacks[ prop ] ) === "function" ) { + return callbacks[ prop ].apply( callbacks, args ); + } else { + return callbacks[ prop ]; // or undefined + } + } + } + + // the real equiv function + var innerEquiv, + // stack to decide between skip/abort functions + callers = [], + // stack to avoiding loops from circular referencing + parents = [], + + getProto = Object.getPrototypeOf || function ( obj ) { + return obj.__proto__; + }, + callbacks = (function () { + + // for string, boolean, number and null + function useStrictEquality( b, a ) { + if ( b instanceof a.constructor || a instanceof b.constructor ) { + // to catch short annotaion VS 'new' annotation of a + // declaration + // e.g. var i = 1; + // var j = new Number(1); + return a == b; + } else { + return a === b; + } + } + + return { + "string": useStrictEquality, + "boolean": useStrictEquality, + "number": useStrictEquality, + "null": useStrictEquality, + "undefined": useStrictEquality, + + "nan": function( b ) { + return isNaN( b ); + }, + + "date": function( b, a ) { + return QUnit.objectType( b ) === "date" && a.valueOf() === b.valueOf(); + }, + + "regexp": function( b, a ) { + return QUnit.objectType( b ) === "regexp" && + // the regex itself + a.source === b.source && + // and its modifers + a.global === b.global && + // (gmi) ... + a.ignoreCase === b.ignoreCase && + a.multiline === b.multiline; + }, + + // - skip when the property is a method of an instance (OOP) + // - abort otherwise, + // initial === would have catch identical references anyway + "function": function() { + var caller = callers[callers.length - 1]; + return caller !== Object && typeof caller !== "undefined"; + }, + + "array": function( b, a ) { + var i, j, len, loop; + + // b could be an object literal here + if ( QUnit.objectType( b ) !== "array" ) { + return false; + } + + len = a.length; + if ( len !== b.length ) { + // safe and faster + return false; + } + + // track reference to avoid circular references + parents.push( a ); + for ( i = 0; i < len; i++ ) { + loop = false; + for ( j = 0; j < parents.length; j++ ) { + if ( parents[j] === a[i] ) { + loop = true;// dont rewalk array + } + } + if ( !loop && !innerEquiv(a[i], b[i]) ) { + parents.pop(); + return false; + } + } + parents.pop(); + return true; + }, + + "object": function( b, a ) { + var i, j, loop, + // Default to true + eq = true, + aProperties = [], + bProperties = []; + + // comparing constructors is more strict than using + // instanceof + if ( a.constructor !== b.constructor ) { + // Allow objects with no prototype to be equivalent to + // objects with Object as their constructor. + if ( !(( getProto(a) === null && getProto(b) === Object.prototype ) || + ( getProto(b) === null && getProto(a) === Object.prototype ) ) ) { + return false; + } + } + + // stack constructor before traversing properties + callers.push( a.constructor ); + // track reference to avoid circular references + parents.push( a ); + + for ( i in a ) { // be strict: don't ensures hasOwnProperty + // and go deep + loop = false; + for ( j = 0; j < parents.length; j++ ) { + if ( parents[j] === a[i] ) { + // don't go down the same path twice + loop = true; + } + } + aProperties.push(i); // collect a's properties + + if (!loop && !innerEquiv( a[i], b[i] ) ) { + eq = false; + break; + } + } + + callers.pop(); // unstack, we are done + parents.pop(); + + for ( i in b ) { + bProperties.push( i ); // collect b's properties + } + + // Ensures identical properties name + return eq && innerEquiv( aProperties.sort(), bProperties.sort() ); + } + }; + }()); + + innerEquiv = function() { // can take multiple arguments + var args = [].slice.apply( arguments ); + if ( args.length < 2 ) { + return true; // end transition + } + + return (function( a, b ) { + if ( a === b ) { + return true; // catch the most you can + } else if ( a === null || b === null || typeof a === "undefined" || + typeof b === "undefined" || + QUnit.objectType(a) !== QUnit.objectType(b) ) { + return false; // don't lose time with error prone cases + } else { + return bindCallbacks(a, callbacks, [ b, a ]); + } + + // apply transition with (1..n) arguments + }( args[0], args[1] ) && arguments.callee.apply( this, args.splice(1, args.length - 1 )) ); + }; + + return innerEquiv; +}()); + +/** + * jsDump Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | + * http://flesler.blogspot.com Licensed under BSD + * (http://www.opensource.org/licenses/bsd-license.php) Date: 5/15/2008 + * + * @projectDescription Advanced and extensible data dumping for Javascript. + * @version 1.0.0 + * @author Ariel Flesler + * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html} + */ +QUnit.jsDump = (function() { + function quote( str ) { + return '"' + str.toString().replace( /"/g, '\\"' ) + '"'; + } + function literal( o ) { + return o + ""; + } + function join( pre, arr, post ) { + var s = jsDump.separator(), + base = jsDump.indent(), + inner = jsDump.indent(1); + if ( arr.join ) { + arr = arr.join( "," + s + inner ); + } + if ( !arr ) { + return pre + post; + } + return [ pre, inner + arr, base + post ].join(s); + } + function array( arr, stack ) { + var i = arr.length, ret = new Array(i); + this.up(); + while ( i-- ) { + ret[i] = this.parse( arr[i] , undefined , stack); + } + this.down(); + return join( "[", ret, "]" ); + } + + var reName = /^function (\w+)/, + jsDump = { + parse: function( obj, type, stack ) { //type is used mostly internally, you can fix a (custom)type in advance + stack = stack || [ ]; + var inStack, res, + parser = this.parsers[ type || this.typeOf(obj) ]; + + type = typeof parser; + inStack = inArray( obj, stack ); + + if ( inStack != -1 ) { + return "recursion(" + (inStack - stack.length) + ")"; + } + //else + if ( type == "function" ) { + stack.push( obj ); + res = parser.call( this, obj, stack ); + stack.pop(); + return res; + } + // else + return ( type == "string" ) ? parser : this.parsers.error; + }, + typeOf: function( obj ) { + var type; + if ( obj === null ) { + type = "null"; + } else if ( typeof obj === "undefined" ) { + type = "undefined"; + } else if ( QUnit.is( "regexp", obj) ) { + type = "regexp"; + } else if ( QUnit.is( "date", obj) ) { + type = "date"; + } else if ( QUnit.is( "function", obj) ) { + type = "function"; + } else if ( typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined" ) { + type = "window"; + } else if ( obj.nodeType === 9 ) { + type = "document"; + } else if ( obj.nodeType ) { + type = "node"; + } else if ( + // native arrays + toString.call( obj ) === "[object Array]" || + // NodeList objects + ( typeof obj.length === "number" && typeof obj.item !== "undefined" && ( obj.length ? obj.item(0) === obj[0] : ( obj.item( 0 ) === null && typeof obj[0] === "undefined" ) ) ) + ) { + type = "array"; + } else { + type = typeof obj; + } + return type; + }, + separator: function() { + return this.multiline ? this.HTML ? "<br />" : "\n" : this.HTML ? " " : " "; + }, + indent: function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing + if ( !this.multiline ) { + return ""; + } + var chr = this.indentChar; + if ( this.HTML ) { + chr = chr.replace( /\t/g, " " ).replace( / /g, " " ); + } + return new Array( this._depth_ + (extra||0) ).join(chr); + }, + up: function( a ) { + this._depth_ += a || 1; + }, + down: function( a ) { + this._depth_ -= a || 1; + }, + setParser: function( name, parser ) { + this.parsers[name] = parser; + }, + // The next 3 are exposed so you can use them + quote: quote, + literal: literal, + join: join, + // + _depth_: 1, + // This is the list of parsers, to modify them, use jsDump.setParser + parsers: { + window: "[Window]", + document: "[Document]", + error: "[ERROR]", //when no parser is found, shouldn"t happen + unknown: "[Unknown]", + "null": "null", + "undefined": "undefined", + "function": function( fn ) { + var ret = "function", + name = "name" in fn ? fn.name : (reName.exec(fn) || [])[1];//functions never have name in IE + + if ( name ) { + ret += " " + name; + } + ret += "( "; + + ret = [ ret, QUnit.jsDump.parse( fn, "functionArgs" ), "){" ].join( "" ); + return join( ret, QUnit.jsDump.parse(fn,"functionCode" ), "}" ); + }, + array: array, + nodelist: array, + "arguments": array, + object: function( map, stack ) { + var ret = [ ], keys, key, val, i; + QUnit.jsDump.up(); + if ( Object.keys ) { + keys = Object.keys( map ); + } else { + keys = []; + for ( key in map ) { + keys.push( key ); + } + } + keys.sort(); + for ( i = 0; i < keys.length; i++ ) { + key = keys[ i ]; + val = map[ key ]; + ret.push( QUnit.jsDump.parse( key, "key" ) + ": " + QUnit.jsDump.parse( val, undefined, stack ) ); + } + QUnit.jsDump.down(); + return join( "{", ret, "}" ); + }, + node: function( node ) { + var a, val, + open = QUnit.jsDump.HTML ? "<" : "<", + close = QUnit.jsDump.HTML ? ">" : ">", + tag = node.nodeName.toLowerCase(), + ret = open + tag; + + for ( a in QUnit.jsDump.DOMAttrs ) { + val = node[ QUnit.jsDump.DOMAttrs[a] ]; + if ( val ) { + ret += " " + a + "=" + QUnit.jsDump.parse( val, "attribute" ); + } + } + return ret + close + open + "/" + tag + close; + }, + functionArgs: function( fn ) {//function calls it internally, it's the arguments part of the function + var args, + l = fn.length; + + if ( !l ) { + return ""; + } + + args = new Array(l); + while ( l-- ) { + args[l] = String.fromCharCode(97+l);//97 is 'a' + } + return " " + args.join( ", " ) + " "; + }, + key: quote, //object calls it internally, the key part of an item in a map + functionCode: "[code]", //function calls it internally, it's the content of the function + attribute: quote, //node calls it internally, it's an html attribute value + string: quote, + date: quote, + regexp: literal, //regex + number: literal, + "boolean": literal + }, + DOMAttrs: { + //attributes to dump from nodes, name=>realName + id: "id", + name: "name", + "class": "className" + }, + HTML: false,//if true, entities are escaped ( <, >, \t, space and \n ) + indentChar: " ",//indentation unit + multiline: true //if true, items in a collection, are separated by a \n, else just a space. + }; + + return jsDump; +}()); + +// from Sizzle.js +function getText( elems ) { + var i, elem, + ret = ""; + + for ( i = 0; elems[i]; i++ ) { + elem = elems[i]; + + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; + + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += getText( elem.childNodes ); + } + } + + return ret; +} + +// from jquery.js +function inArray( elem, array ) { + if ( array.indexOf ) { + return array.indexOf( elem ); + } + + for ( var i = 0, length = array.length; i < length; i++ ) { + if ( array[ i ] === elem ) { + return i; + } + } + + return -1; +} + +/* + * Javascript Diff Algorithm + * By John Resig (http://ejohn.org/) + * Modified by Chu Alan "sprite" + * + * Released under the MIT license. + * + * More Info: + * http://ejohn.org/projects/javascript-diff-algorithm/ + * + * Usage: QUnit.diff(expected, actual) + * + * QUnit.diff( "the quick brown fox jumped over", "the quick fox jumps over" ) == "the quick <del>brown </del> fox <del>jumped </del><ins>jumps </ins> over" + */ +QUnit.diff = (function() { + function diff( o, n ) { + var i, + ns = {}, + os = {}; + + for ( i = 0; i < n.length; i++ ) { + if ( ns[ n[i] ] == null ) { + ns[ n[i] ] = { + rows: [], + o: null + }; + } + ns[ n[i] ].rows.push( i ); + } + + for ( i = 0; i < o.length; i++ ) { + if ( os[ o[i] ] == null ) { + os[ o[i] ] = { + rows: [], + n: null + }; + } + os[ o[i] ].rows.push( i ); + } + + for ( i in ns ) { + if ( !hasOwn.call( ns, i ) ) { + continue; + } + if ( ns[i].rows.length == 1 && typeof os[i] != "undefined" && os[i].rows.length == 1 ) { + n[ ns[i].rows[0] ] = { + text: n[ ns[i].rows[0] ], + row: os[i].rows[0] + }; + o[ os[i].rows[0] ] = { + text: o[ os[i].rows[0] ], + row: ns[i].rows[0] + }; + } + } + + for ( i = 0; i < n.length - 1; i++ ) { + if ( n[i].text != null && n[ i + 1 ].text == null && n[i].row + 1 < o.length && o[ n[i].row + 1 ].text == null && + n[ i + 1 ] == o[ n[i].row + 1 ] ) { + + n[ i + 1 ] = { + text: n[ i + 1 ], + row: n[i].row + 1 + }; + o[ n[i].row + 1 ] = { + text: o[ n[i].row + 1 ], + row: i + 1 + }; + } + } + + for ( i = n.length - 1; i > 0; i-- ) { + if ( n[i].text != null && n[ i - 1 ].text == null && n[i].row > 0 && o[ n[i].row - 1 ].text == null && + n[ i - 1 ] == o[ n[i].row - 1 ]) { + + n[ i - 1 ] = { + text: n[ i - 1 ], + row: n[i].row - 1 + }; + o[ n[i].row - 1 ] = { + text: o[ n[i].row - 1 ], + row: i - 1 + }; + } + } + + return { + o: o, + n: n + }; + } + + return function( o, n ) { + o = o.replace( /\s+$/, "" ); + n = n.replace( /\s+$/, "" ); + + var i, pre, + str = "", + out = diff( o === "" ? [] : o.split(/\s+/), n === "" ? [] : n.split(/\s+/) ), + oSpace = o.match(/\s+/g), + nSpace = n.match(/\s+/g); + + if ( oSpace == null ) { + oSpace = [ " " ]; + } + else { + oSpace.push( " " ); + } + + if ( nSpace == null ) { + nSpace = [ " " ]; + } + else { + nSpace.push( " " ); + } + + if ( out.n.length === 0 ) { + for ( i = 0; i < out.o.length; i++ ) { + str += "<del>" + out.o[i] + oSpace[i] + "</del>"; + } + } + else { + if ( out.n[0].text == null ) { + for ( n = 0; n < out.o.length && out.o[n].text == null; n++ ) { + str += "<del>" + out.o[n] + oSpace[n] + "</del>"; + } + } + + for ( i = 0; i < out.n.length; i++ ) { + if (out.n[i].text == null) { + str += "<ins>" + out.n[i] + nSpace[i] + "</ins>"; + } + else { + // `pre` initialized at top of scope + pre = ""; + + for ( n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++ ) { + pre += "<del>" + out.o[n] + oSpace[n] + "</del>"; + } + str += " " + out.n[i].text + nSpace[i] + pre; + } + } + } + + return str; + }; +}()); + +// for CommonJS enviroments, export everything +if ( typeof exports !== "undefined" ) { + extend(exports, QUnit); +} + +// get at whatever the global object is, like window in browsers +}( (function() {return this;}.call()) )); diff --git a/libs/patch/0043-JQM-add-default-header-s-button-style.patch b/libs/patch/0043-JQM-add-default-header-s-button-style.patch new file mode 100644 index 00000000..87085539 --- /dev/null +++ b/libs/patch/0043-JQM-add-default-header-s-button-style.patch @@ -0,0 +1,26 @@ +From f26f427a175fce4893bba829db2061d2dfa14cb0 Mon Sep 17 00:00:00 2001 +From: Jinhyuk Jun <jinhyuk.jun@samsung.com> +Date: Sat, 13 Apr 2013 13:33:21 +0900 +Subject: [PATCH] JQM add default header's button style + +Change-Id: Iffcc090fb16f464c4fa970ac9d1ff447fda993ed +--- + .../js/widgets/page.sections.js | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js b/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js +index 134a059..1ea6479 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js +@@ -54,7 +54,7 @@ $.mobile.$document.bind( "pagecreate", function( e ) { + + if ( role === "header") { + // Right,left buttons +- $headeranchors = $this.children( "a, button" ); ++ $headeranchors = $this.children( "a, div.naviframe-button, a.naviframe-button, button" ); + leftbtn = $headeranchors.hasClass( "ui-btn-left" ); + rightbtn = $headeranchors.hasClass( "ui-btn-right" ); + +-- +1.7.9.5 + diff --git a/packaging/web-ui-fw.spec b/packaging/web-ui-fw.spec index 71e3d46b..823884ad 100644 --- a/packaging/web-ui-fw.spec +++ b/packaging/web-ui-fw.spec @@ -1,5 +1,5 @@ Name: web-ui-fw -Version: 0.2.23 +Version: 0.2.24 Release: 0 Summary: Tizen Web UI Framework Library Group: Development/Other @@ -97,6 +97,38 @@ Summary: Tizen Web UI Framework Demo Application: tizen winset demo ############################### %changelog +* Tue Apr 16 2013 Youmin Ha <youmin.ha@samsung.com> 0.2.24 + - SegmentControl: 2-buttons display issue (N_SE-34200) + - Naviframe : remove unnecessary img positioning(N_SE-33969) + - Gallery: jslint error fix + - TizenWinset : remove landscape SIP on mode + - Tizen Black Theme png file changed + - Gallery: Images showing bug has been fixed + - Scrollview : change horizontal scrollview demo(N_SE-33997) + - Tizenwinset: added return false in popup sample + - Naviframe : support data-role="button" in header + - Additional UnitTC: tizen winset unit tc bugs have been fixed + - Checkbox : remove favorite button's display:block(N_SE-33896) + - UnitTC: QUnit path has been changed. Priority, function type check function has been added + - Tizen-winset : Footer changed from lower case to upper case. + - Slider: enhance performance fix + - UnitTC: Addtional unit tc ref path has been fixed + - virtualgrid: apply overscrolling images to the style of widget + - Tabbar : Change overscroll image(left/right) + - ensurens: optimizations + - ensurens: qunit tests + - Tokentextarea: Fix block size error + - Fastscroll: Add a feature to fade out Fastscroll widget. + - Fastscroll: Add a user interaction at the omitted items. + - ImageLoader: Performance fix: apply lazy loading for canvas element + - Tests: Add tests for $.imageloader + - SegmentControl: 2-buttons display issue (N_SE-34200) + - virtuallist: fix width resizing trigger + - Timepicker: timepicker is closed when orientationchange event fired + - TizenWinset : Tabbar-persist issue.(N_SE-33996) + - Add Flora license + - collapsible: Fix collapsible list animation bug + * Wed Apr 10 2013 Youmin Ha <youmin.ha@samsung.com> 0.2.23 - Naviframe : modify SIP down button's position - Core: Performance fix for disableSelection and enableSelection @@ -168,21 +200,6 @@ Summary: Tizen Web UI Framework Demo Application: tizen winset demo - Naviframe : fix header's back button position - TizenWinset : move locale info to another file -* Fri Mar 29 2013 Youmin Ha <youmin.ha@samsung.com> 0.2.20 - - JQM Navigation : remove page min-height - - Pagelayout : add refresh to pagelayout - - Tokentextarea: Changes 'remove' tests to asyncTest - - Popup: input tag alignment has been fixed - - Tokentextarea: add/remove events are deprecated. - - Contextpopup: Support horizontal list - - Select: icon z-index has been deleted - - Tizenwinset: ui widget order has been changed - - Tool: make web app template disable context menu by default - - Tizen-winset: change tips for using listview - - Loader: calculate font size with mobile width - - Naviframe : fix header's back button position - - TizenWinset : move locale info to another file - * Fri Mar 22 2013 Youmin Ha <youmin.ha@samsung.com> 0.2.19 - Tizen-winset: Support accessibility for tizen-winset - Orientation : add orientataionchange to tizen-winset diff --git a/src/js/jquery.mobile.tizen.clrlib.js b/src/js/jquery.mobile.tizen.clrlib.js index 1f8eb2ca..3c349d4f 100644 --- a/src/js/jquery.mobile.tizen.clrlib.js +++ b/src/js/jquery.mobile.tizen.clrlib.js @@ -3,7 +3,7 @@ //>>label: Color library //>>group: Tizen:Core -define( [ ], function ( ) { +define( [ 'util/ensurens' ], function ( ) { //>>excludeEnd("jqmBuildExclude"); ensureNS("jQuery.mobile.tizen.clrlib"); diff --git a/src/js/jquery.mobile.tizen.loadprototype.js b/src/js/jquery.mobile.tizen.loadprototype.js index b14b860e..7fad4b00 100644 --- a/src/js/jquery.mobile.tizen.loadprototype.js +++ b/src/js/jquery.mobile.tizen.loadprototype.js @@ -3,7 +3,7 @@ //>>label: Widget prototype loader //>>group: Tizen:Core -define( [ ], function ( ) { +define( [ 'util/ensurens' ], function ( ) { //>>excludeEnd("jqmBuildExclude"); (function($, undefined) { diff --git a/src/js/jquery.mobile.tizen.pinch.js b/src/js/jquery.mobile.tizen.pinch.js index 78b52610..ecc2be20 100644 --- a/src/js/jquery.mobile.tizen.pinch.js +++ b/src/js/jquery.mobile.tizen.pinch.js @@ -7,27 +7,212 @@ define( [ 'jquery.mobile.core' ], function ( ) { //>>excludeEnd("jqmBuildExclude"); /* *************************************************************************** - * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. - * - * 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. - * *************************************************************************** - * + Flora License + + Version 1.0, May, 2012 + + http://floralicense.org/license/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and + all other entities that control, are controlled by, or are + under common control with that entity. For the purposes of + this definition, "control" means (i) the power, direct or indirect, + to cause the direction or management of such entity, + whether by contract or otherwise, or (ii) ownership of fifty percent (50%) + or more of the outstanding shares, or (iii) beneficial ownership of + such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation source, + and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or Object form, + made available under the License, as indicated by a copyright notice + that is included in or attached to the work (an example is provided + in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object form, + that is based on (or derived from) the Work and for which the editorial + revisions, annotations, elaborations, or other modifications represent, + as a whole, an original work of authorship. For the purposes of this License, + Derivative Works shall not include works that remain separable from, + or merely link (or bind by name) to the interfaces of, the Work and + Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including the original + version of the Work and any modifications or additions to that Work or + Derivative Works thereof, that is intentionally submitted to Licensor + for inclusion in the Work by the copyright owner or by an individual or + Legal Entity authorized to submit on behalf of the copyright owner. + For the purposes of this definition, "submitted" means any form of + electronic, verbal, or written communication sent to the Licensor or + its representatives, including but not limited to communication on + electronic mailing lists, source code control systems, and issue + tracking systems that are managed by, or on behalf of, the Licensor + for the purpose of discussing and improving the Work, but excluding + communication that is conspicuously marked or otherwise designated + in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + "Tizen Certified Platform" shall mean a software platform that complies + with the standards set forth in the Compatibility Definition Document + and passes the Compatibility Test Suite as defined from time to time + by the Tizen Technical Steering Group and certified by the Tizen + Association or its designated agent. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work + solely as incorporated into a Tizen Certified Platform, where such + license applies only to those patent claims licensable by such + Contributor that are necessarily infringed by their Contribution(s) + alone or by combination of their Contribution(s) with the Work solely + as incorporated into a Tizen Certified Platform to which such + Contribution(s) was submitted. If You institute patent litigation + against any entity (including a cross-claim or counterclaim + in a lawsuit) alleging that the Work or a Contribution incorporated + within the Work constitutes direct or contributory patent infringement, + then any patent licenses granted to You under this License for that + Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof pursuant to the copyright license + above, in any medium, with or without modifications, and in Source or + Object form, provided that You meet the following conditions: + + 1. You must give any other recipients of the Work or Derivative Works + a copy of this License; and + 2. You must cause any modified files to carry prominent notices stating + that You changed the files; and + 3. You must retain, in the Source form of any Derivative Works that + You distribute, all copyright, patent, trademark, and attribution + notices from the Source form of the Work, excluding those notices + that do not pertain to any part of the Derivative Works; and + 4. If the Work includes a "NOTICE" text file as part of its distribution, + then any Derivative Works that You distribute must include a readable + copy of the attribution notices contained within such NOTICE file, + excluding those notices that do not pertain to any part of + the Derivative Works, in at least one of the following places: + within a NOTICE text file distributed as part of the Derivative Works; + within the Source form or documentation, if provided along with the + Derivative Works; or, within a display generated by the Derivative Works, + if and wherever such third-party notices normally appear. + The contents of the NOTICE file are for informational purposes only + and do not modify the License. + + You may add Your own attribution notices within Derivative Works + that You distribute, alongside or as an addendum to the NOTICE text + from the Work, provided that such additional attribution notices + cannot be construed as modifying the License. You may add Your own + copyright statement to Your modifications and may provide additional or + different license terms and conditions for use, reproduction, or + distribution of Your modifications, or for any such Derivative Works + as a whole, provided Your use, reproduction, and distribution of + the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Flora License to your work + + To apply the Flora License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Flora License, Version 1.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.tizenopensource.org/license + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + * Author: Minkyu Kang <mk7.kang@samsung.com> */ diff --git a/src/js/util/ensurens.js b/src/js/util/ensurens.js index 71c8c83b..ad8e0a12 100644 --- a/src/js/util/ensurens.js +++ b/src/js/util/ensurens.js @@ -37,15 +37,25 @@ define( [ ], function ( ) { // Ensure that the given namespace is defined. If not, define it to be an empty object. // This is kinda like the mkdir -p command. -function ensureNS(ns) { - var nsAr = ns.split("."), - nsSoFar = ""; - - for (var Nix in nsAr) { - nsSoFar = nsSoFar + (Nix > 0 ? "." : "") + nsAr[Nix]; - eval (nsSoFar + " = " + nsSoFar + " || {};"); - } -} +var ensureNS = (function () { + var internalCache = {}; + return function ensureNS (ns) { // name just for debugging purposes + var nsArr = ns.split(".").reverse(), + nsSoFar = "", + buffer = "", + leaf = "", + l = nsArr.length; + while(--l >= 0) { + leaf = nsArr[l]; + nsSoFar = nsSoFar + (nsSoFar.length > 0 ? "." : "") + leaf; + if (!internalCache[nsSoFar]) { + internalCache[nsSoFar] = true; + buffer += "!window." + nsSoFar + ' && (window.' + nsSoFar + " = {});\n"; + } + } + buffer.length && (new Function(buffer))(); + }; +})(); //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); } ); diff --git a/src/js/widgets/components/imageloader.js b/src/js/widgets/components/imageloader.js index 44f0514b..e45c99bb 100644 --- a/src/js/widgets/components/imageloader.js +++ b/src/js/widgets/components/imageloader.js @@ -33,8 +33,15 @@ define( [ ], function ( ) { */
( function ( $, window, document, undefined ) {
- var _canvas = document.createElement( 'canvas' ),
+ var _canvas, _context;
+
+ function initCanvas() {
+ if (_context) {
+ return;
+ }
+ _canvas = document.createElement( 'canvas' );
_context = _canvas.getContext( '2d' );
+ }
function fileSystemErrorMessage( e ) {
var FileError = window.FileError,
@@ -93,6 +100,7 @@ define( [ ], function ( ) { function getThumbnail( img, thumbwidth, thumbheight, fit ) {
var dimensions, url;
+ initCanvas();
_canvas.width = thumbwidth;
_canvas.height = thumbheight;
dimensions = resize( img.width, img.height, thumbwidth, thumbheight, fit );
diff --git a/src/js/widgets/jquery.mobile.tizen.datetimepicker.js b/src/js/widgets/jquery.mobile.tizen.datetimepicker.js index 41b704d4..e4c9de72 100644 --- a/src/js/widgets/jquery.mobile.tizen.datetimepicker.js +++ b/src/js/widgets/jquery.mobile.tizen.datetimepicker.js @@ -135,6 +135,8 @@ define( [ 'jquery.mobile.tizen.widgetex', 'jquery.mobile.tizen.popupwindow', 'jq initSelector: "input[type='date'], input[type='datetime'], input[type='time'], :jqmData(role='datetimepicker')" }, + container : null, + _calendar: function () { return window.Globalize.culture().calendars.standard; }, @@ -553,8 +555,30 @@ define( [ 'jquery.mobile.tizen.widgetex', 'jquery.mobile.tizen.popupwindow', 'jq this.ui.bind('vclick', function ( e ) { obj._showDataSelector( obj, this, e.target ); }); - }, + $.extend( this, { + _globalHandlers: [ + { + src: $( window ), + handler: { + orientationchange: $.proxy( this, "_orientationHandler" ) + } + } + ] + }); + + $.each( this._globalHandlers, function( idx, value ) { + value.src.bind( value.handler ); + }); + }, + _orientationHandler: function() { + var self = this; + if( self._popup_open ) { + self._popup_open = false; + self.container.popupwindow( 'close' ); + } + return false; + }, _populateDataSelector: function ( field, pat ) { var values, numItems, @@ -731,6 +755,7 @@ define( [ 'jquery.mobile.tizen.widgetex', 'jquery.mobile.tizen.popupwindow', 'jq target.offset().left + ( target.width() / 2 ) + newLeft - window.pageXOffset , target.offset().top + target.height() - window.pageYOffset ); + this.container = $ctx; this._popup_open = true; $div.bind('popupafterclose', function ( e ) { diff --git a/src/js/widgets/jquery.mobile.tizen.fastscroll.js b/src/js/widgets/jquery.mobile.tizen.fastscroll.js index f1e3db37..a8e89b0d 100644 --- a/src/js/widgets/jquery.mobile.tizen.fastscroll.js +++ b/src/js/widgets/jquery.mobile.tizen.fastscroll.js @@ -102,6 +102,11 @@ define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) { _primaryLanguage: null, _secondLanguage: null, + _dividerMap: {}, + _defaultTime: 500, + _defaultDuration: 500, + _timer: null, + _isFadeOut: false, _create: function () { var $el = this.element, @@ -159,6 +164,10 @@ define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) { var coords = $.mobile.tizen.targetRelativeCoordsFromEvent( e ), shortcutsListOffset = self.shortcutsList.offset(); + if ( self._isFadeOut === true ) { + return; + } + // If the element is a list item, get coordinates relative to the shortcuts list if ( e.target.tagName.toLowerCase() === "li" ) { coords.x += $( e.target ).offset().left - shortcutsListOffset.left; @@ -183,15 +192,34 @@ define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) { l = listItem.offset().left - shortcutsListOffset.left, t = listItem.offset().top - shortcutsListOffset.top, r = l + Math.abs(listItem.outerWidth( true ) ), - b = t + Math.abs(listItem.outerHeight( true ) ); + b = t + Math.abs(listItem.outerHeight( true ) ), + unit, + baseTop, + baseBottom, + omitSet, + i; if ( coords.x >= l && coords.x <= r && coords.y >= t && coords.y <= b ) { - self._hitItem( listItem ); + if ( listItem.text() !== "." ) { + self._hitItem( listItem ); + } else { + omitSet = listItem.data( "omitSet" ); + unit = ( b - t ) / omitSet.length; + for ( i = 0; i < omitSet.length; i++ ) { + baseTop = t + ( i * unit ); + baseBottom = baseTop + unit; + if ( coords.y >= baseTop && coords.y <= baseBottom ) { + self._hitOmitItem( listItem, omitSet.charAt( i ) ); + } + } + } return false; } return true; } ); + self._setTimer( false ); + e.preventDefault(); e.stopPropagation(); } ) @@ -202,6 +230,7 @@ define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) { $( ".ui-fastscroll-hover-first-item" ).removeClass( "ui-fastscroll-hover-first-item" ); $( ".ui-fastscroll-hover-up" ).removeClass( "ui-fastscroll-hover-up" ); $( ".ui-fastscroll-hover-down" ).removeClass( "ui-fastscroll-hover-down" ); + self._setTimer( true ); } ); if ( page && !( page.is( ':visible' ) ) ) { @@ -218,27 +247,63 @@ define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) { $( window ).unbind( ".fastscroll" ).bind( "resize.fastscroll", function ( e ) { self.refresh(); } ); + + self.scrollview.bind( "scrollstart", function ( e ) { + self._setTimer( false ); + }).bind( "scrollstop", function ( e ) { + self._setTimer( true ); + }); }, - _hitItem: function ( listItem ) { + _hitOmitItem: function ( listItem, text ) { var self = this, - $popup = self.scrollview.find( '.ui-fastscroll-popup' ); + $popup = self.scrollview.find( '.ui-fastscroll-popup' ), + divider = self._dividerMap[ text ]; - if ( typeof listItem.data( 'divider' ) !== "undefined" ) { - self.jumpToDivider( $( listItem.data( 'divider' ) ) ); + if ( typeof divider !== "undefined" ) { + self.jumpToDivider( $( divider ) ); + } + + $popup.text( text ) + .css( { marginLeft: -( $popup.width() / 2 ), + marginTop: -( $popup.height() / 2 ), + padding: $popup.css( "paddingTop" ) } ) + .width( $popup.height() ) + .show(); + + $( listItem ).addClass( "ui-fastscroll-hover" ); + if ( listItem.index() === 0 ) { + $( listItem ).addClass( "ui-fastscroll-hover-first-item" ); + } + if ( listItem.index() > 0 ) { + $( listItem ).siblings().eq( listItem.index() - 1 ).addClass( "ui-fastscroll-hover-up" ); } + $( listItem ).siblings().eq( listItem.index() ).addClass( "ui-fastscroll-hover-down" ); + }, - if ( listItem.text() !== "." ) { - $popup.text( listItem.text() ) - .css( { marginLeft: -( $popup.width() / 2 ), - marginTop: -( $popup.height() / 2 ), - padding: $popup.css( "paddingTop" ) } ) - .width( $popup.height() ) - .show(); + _hitItem: function ( listItem ) { + var self = this, + $popup = self.scrollview.find( '.ui-fastscroll-popup' ), + text = listItem.text(), + divider; + + if ( text === "#" ) { + divider = self._dividerMap.number; } else { - $popup.hide(); + divider = self._dividerMap[ text ]; + } + + if ( typeof divider !== "undefined" ) { + self.jumpToDivider( $( divider ) ); } + $popup.text( text ) + .css( { marginLeft: -( $popup.width() / 2 ), + marginTop: -( $popup.height() / 2 ), + padding: $popup.css( "paddingTop" ) } ) + .width( $popup.height() ) + .show(); + $( listItem ).addClass( "ui-fastscroll-hover" ); if ( listItem.index() === 0 ) { $( listItem ).addClass( "ui-fastscroll-hover-first-item" ); @@ -254,13 +319,17 @@ define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) { $popup = self.scrollview.find( '.ui-fastscroll-popup' ); listItem.focusin( function ( e ) { + self.shortcutsList.attr( "aria-hidden", false ); self._hitItem( listItem ); + self._setTimer( false ); }).focusout( function ( e ) { + self.shortcutsList.attr( "aria-hidden", true ); $popup.hide(); $( ".ui-fastscroll-hover" ).removeClass( "ui-fastscroll-hover" ); $( ".ui-fastscroll-hover-first-item" ).removeClass( "ui-fastscroll-hover-first-item" ); $( ".ui-fastscroll-hover-up" ).removeClass( "ui-fastscroll-hover-up" ); $( ".ui-fastscroll-hover-down" ).removeClass( "ui-fastscroll-hover-down" ); + self._setTimer( true ); }); }, @@ -336,11 +405,78 @@ define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) { return omitInfo; }, + _createDividerMap: function () { + var self = this, + primaryCharacterSet = self._primaryLanguage ? self._primaryLanguage.replace( /,/g, "" ) : null, + secondCharacterSet = self._secondLanguage ? self._secondLanguage.replace( /,/g, "" ) : null, + numberSet = "0123456789", + dividers = self.element.find( '.ui-li-divider' ), + map = {}, + matchToDivider, + makeCharacterSet, + indexChar, + i; + + matchToDivider = function ( index, divider ) { + if ( $( divider ).text() === indexChar ) { + map[ indexChar ] = divider; + } + }; + + makeCharacterSet = function ( index, divider ) { + primaryCharacterSet += $( divider ).text(); + }; + + if ( primaryCharacterSet === null ) { + primaryCharacterSet = ""; + dividers.each( makeCharacterSet ); + } + + for ( i = 0; i < primaryCharacterSet.length; i++ ) { + indexChar = primaryCharacterSet.charAt( i ); + dividers.each( matchToDivider ); + } + + if ( secondCharacterSet !== null ) { + for ( i = 0; i < secondCharacterSet.length; i++ ) { + indexChar = secondCharacterSet.charAt( i ); + dividers.each( matchToDivider ); + } + } + + dividers.each( function ( index, divider ) { + if ( numberSet.search( $( divider ).text() ) !== -1 ) { + map.number = divider; + return false; + } + }); + + self._dividerMap = map; + }, + + _setTimer: function ( start ) { + var self = this; + + if ( start === true ) { + self._timer = setTimeout( function () { + self._isFadeOut = true; + self.shortcutsContainer.fadeOut( self._defaultDuration, function () { + self._isFadeOut = false; + }); + }, self._defaultTime ); + } else { + if ( self._timer !== null ) { + clearTimeout( self._timer ); + } + self.shortcutsContainer.show(); + } + }, + indexString: function ( indexAlphabet ) { var self = this, characterSet = []; - if ( typeof indexAlphabet === " undefined" ) { + if ( typeof indexAlphabet === "undefined" ) { return self._primaryLanguage + ":" + self._secondLanguage; } @@ -358,7 +494,9 @@ define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) { contentHeight = self._contentHeight(), shapItem = $( '<li tabindex="0" aria-label="double to move Number list"><span aria-hidden="true">#</span><span aria-label="Number"/></li>' ), omitIndex = 0, - matchToDivider, + makeCharacterSet, + makeOmitSet, + itemHandler, containerHeight, shortcutsItems, shortcutItem, @@ -380,15 +518,32 @@ define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) { size, i; - matchToDivider = function ( index, divider ) { - if ( $( divider ).text() === indexChar ) { - shortcutItem.data( 'divider', divider ) - .bind( 'vclick', function ( e ) { - $( divider ).next().focus(); - } ); + makeCharacterSet = function ( index, divider ) { + primaryCharacterSet += $( divider ).text(); + }; + + makeOmitSet = function ( index, length ) { + var count, + omitSet = ""; + + for ( count = 0; count < length; count++ ) { + omitSet += primaryCharacterSet[ index + count ]; } + + return omitSet; }; + itemHandler = function ( e ) { + var text = $( this ).text(), + matchDivider = self._dividerMap[ text ]; + + if ( typeof matchDivider !== "undefined" ) { + $( matchDivider ).next().focus(); + } + }; + + self._createDividerMap(); + self.shortcutsList.find( 'li' ).remove(); // get all the dividers from the list and turn them into shortcuts @@ -411,63 +566,58 @@ define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) { self.shortcutsList.append( shapItem ); self._focusItem( shapItem ); - if ( primaryCharacterSet !== null ) { - padding = parseInt( shapItem.css( "padding" ), 10 ); - minHeight = shapItem.height() + ( padding * 2 ); - maxNumOfItems = parseInt( ( contentHeight / minHeight ) - 1, 10 ); - numOfItems = primaryCharacterSet.length; + if ( primaryCharacterSet === null ) { + primaryCharacterSet = ""; + dividers.each( makeCharacterSet ); + } - maxNumOfItems = secondCharacterSet ? maxNumOfItems - 2 : maxNumOfItems; + padding = parseInt( shapItem.css( "padding" ), 10 ); + minHeight = shapItem.height() + ( padding * 2 ); + maxNumOfItems = parseInt( ( contentHeight / minHeight ) - 1, 10 ); + numOfItems = primaryCharacterSet.length; - if ( maxNumOfItems < 3 ) { - shapItem.remove(); - return; - } + maxNumOfItems = secondCharacterSet ? maxNumOfItems - 2 : maxNumOfItems; - omitInfo = self._omit( numOfItems, maxNumOfItems ); + if ( maxNumOfItems < 3 ) { + shapItem.remove(); + return; + } - for ( i = 0; i < primaryCharacterSet.length; i++ ) { - indexChar = primaryCharacterSet.charAt( i ); - shortcutItem = $( '<li tabindex="0" aria-label="double to move ' + indexChar + ' list">' + indexChar + '</li>' ); + omitInfo = self._omit( numOfItems, maxNumOfItems ); - self._focusItem( shortcutItem ); - dividers.each( matchToDivider ); + for ( i = 0; i < primaryCharacterSet.length; i++ ) { + indexChar = primaryCharacterSet.charAt( i ); + shortcutItem = $( '<li tabindex="0" aria-label="double to move ' + indexChar + ' list">' + indexChar + '</li>' ); - if ( typeof omitInfo !== "undefined" && omitInfo[ omitIndex ] > 1 ) { - shortcutItem = $( '<li>.</li>' ); - i += omitInfo[ omitIndex ] - 1; - } + self._focusItem( shortcutItem ); - shapItem.before( shortcutItem ); - omitIndex++; + if ( typeof omitInfo !== "undefined" && omitInfo[ omitIndex ] > 1 ) { + shortcutItem = $( '<li>.</li>' ); + shortcutItem.data( "omitSet", makeOmitSet( i, omitInfo[ omitIndex ] ) ); + i += omitInfo[ omitIndex ] - 1; + } else { + shortcutItem.bind( 'vclick', itemHandler ); } - if ( secondCharacterSet !== null ) { - lastIndex = secondCharacterSet.length - 1; - seconds = []; - - seconds.push( secondCharacterSet.charAt( 0 ) ); - seconds.push( secondCharacterSet.charAt( lastIndex ) ); + shapItem.before( shortcutItem ); + omitIndex++; + } - for ( i = 0; i < seconds.length; i++ ) { - indexChar = seconds[ i ]; - shortcutItem = $( '<li tabindex="0" aria-label="double to move ' + indexChar + ' list">' + indexChar + '</li>' ); + if ( secondCharacterSet !== null ) { + lastIndex = secondCharacterSet.length - 1; + seconds = []; - self._focusItem( shortcutItem ); - dividers.each( matchToDivider ); + seconds.push( secondCharacterSet.charAt( 0 ) ); + seconds.push( secondCharacterSet.charAt( lastIndex ) ); - shapItem.before( shortcutItem ); - } - } - } else { - dividers.each( function ( index, divider ) { - indexChar = $( divider ).text(); + for ( i = 0; i < seconds.length; i++ ) { + indexChar = seconds[ i ]; shortcutItem = $( '<li tabindex="0" aria-label="double to move ' + indexChar + ' list">' + indexChar + '</li>' ); - shortcutItem.data( 'divider', divider ); self._focusItem( shortcutItem ); + shortcutItem.bind( 'vclick', itemHandler ); shapItem.before( shortcutItem ); - } ); + } } containerHeight = self.shortcutsContainer.outerHeight(); @@ -497,6 +647,9 @@ define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) { // make the scrollview clip tall enough to show the whole of the shortcutslist minClipHeight = shortcutsTop + self.shortcutsContainer.outerHeight() + 'px'; self.scrollview.css( 'min-height', minClipHeight ); + + self._setTimer( false ); + self._setTimer( true ); } } ); diff --git a/src/js/widgets/jquery.mobile.tizen.gallery.js b/src/js/widgets/jquery.mobile.tizen.gallery.js index c03fceed..3e86feaf 100644 --- a/src/js/widgets/jquery.mobile.tizen.gallery.js +++ b/src/js/widgets/jquery.mobile.tizen.gallery.js @@ -216,6 +216,7 @@ define( [ ], function ( ) { processing = function () { self._resize( index ); self._align( index, obj ); + }, loading = function () { if ( self.images[index] === undefined ) { @@ -247,6 +248,7 @@ define( [ ], function ( ) { } obj.css( "display", "block" ); + obj.css( "visibility", "hidden" ); obj.append( this.images[index] ); loading(); }, @@ -301,7 +303,7 @@ define( [ ], function ( ) { coord_x = _x - this.org_x; - this._moveLeft( this.cur_img , coord_x + 'px'); + this._moveLeft( this.cur_img , coord_x + 'px' ); if ( this.next_img.length ) { this._moveLeft( this.next_img , coord_x + this.window_width + 'px' ); } @@ -455,7 +457,8 @@ define( [ ], function ( ) { }, _setTranslateposition : function ( $ele, value ) { var translate, - cssArray = null; + cssArray = null, + self = this; if ( $.support.cssTransform3d ) { translate = "translate3d(" + value + ", 0px, 0px)"; @@ -471,10 +474,28 @@ define( [ ], function ( ) { $ele.css(cssArray); return $ele; }, - _moveLeft : function ( $ele , value , duration) { + _hidePrevNext : function() { + var self = this; + + if( self.next_img ) { + self.next_img.css( "visibility", "hidden" ); + } + if( self.prev_img ) { + self.prev_img.css( "visibility", "hidden" ); + } + + }, + _hideCur : function() { + var self = this; + if( self.cur_img ) { + self.cur_img.css( "visibility", "hidden" ); + } + }, + _moveLeft : function ( $ele , value , duration ) { var translate, transition = "", - cssArray = null; + cssArray = null, + self = this; if ( $.support.cssTransform3d ) { translate = "translate3d(" + value + ", 0px, 0px)"; @@ -491,6 +512,14 @@ define( [ ], function ( ) { "transform": translate}; if( transition !== "" ) { cssArray["-webkit-transition"] = transition ; + if( value == "0px" ) { + $ele.one( 'webkitTransitionEnd', self._hidePrevNext ); + } else { + $ele.one( 'webkitTransitionEnd', self._hideCur ); + } + } + if( value == "0px" ) { + $ele.css( "visibility", "visible" ); } $ele.css(cssArray); @@ -511,6 +540,7 @@ define( [ ], function ( ) { this._attach( this.index, this.cur_img ); this._attach( this.index + 1, this.next_img ); + this.cur_img.css( 'visibility', 'visible' ); if ( this.prev_img.length ) { this._setTranslateposition( this.prev_img, -this.window_width + 'px'); } diff --git a/src/js/widgets/jquery.mobile.tizen.slider.js b/src/js/widgets/jquery.mobile.tizen.slider.js index cd50023f..d8f548d3 100644 --- a/src/js/widgets/jquery.mobile.tizen.slider.js +++ b/src/js/widgets/jquery.mobile.tizen.slider.js @@ -428,8 +428,14 @@ define( [ '../jquery.mobile.tizen.core' ], function ( ) { // initialise sliders with our own slider $( document ).bind( "pagecreate create", function ( e ) { var jqmSliderInitSelector = $.data( window, "jqmSliderInitSelector" ); - $( e.target ).find(jqmSliderInitSelector).not('select').tizenslider(); - $( e.target ).find(jqmSliderInitSelector).filter('select').slider(); + $( e.target ).find(jqmSliderInitSelector).each(function () { + var $this = $( this ); + if ( $this.is("select") ) { + $this.slider(); + } else { + $this.tizenslider(); + } + }); }); }( jQuery, this )); diff --git a/src/js/widgets/jquery.mobile.tizen.tokentextarea.js b/src/js/widgets/jquery.mobile.tizen.tokentextarea.js index 63d632e7..5664459f 100644 --- a/src/js/widgets/jquery.mobile.tizen.tokentextarea.js +++ b/src/js/widgets/jquery.mobile.tizen.tokentextarea.js @@ -309,8 +309,7 @@ define( [ '../jquery.mobile.tizen.core' ], function ( ) { $view = self.element, option = self.options, inputbox = $view.find( ".ui-tokentextarea-input" ), - moreBlock = $view.find( ".ui-tokentextarea-link-base" ), - isSeparator = false; + moreBlock = $view.find( ".ui-tokentextarea-link-base" ); // delegate a event to HTMLDivElement(each block). $view.delegate( "div", "click", function ( event ) { @@ -335,7 +334,8 @@ define( [ '../jquery.mobile.tizen.core' ], function ( ) { var keyValue = event.keyCode, valueString = $( inputbox ).val(), valueStrings = [], - index; + index, + isSeparator = false; if ( keyValue === 8 ) { if ( valueString.length === 0 ) { @@ -378,7 +378,7 @@ define( [ '../jquery.mobile.tizen.core' ], function ( ) { if ( $view.innerWidth() === 0 ) { return ; } - self._modifyInputBoxWidth(); + self.refresh(); $( inputbox ).removeClass( "ui-tokentextarea-input-invisible" ).addClass( "ui-tokentextarea-input-visible" ); }); @@ -757,9 +757,11 @@ define( [ '../jquery.mobile.tizen.core' ], function ( ) { refresh : function () { var self = this, - $view = this.element; + viewWidth = this.element.innerWidth(); - self._viewWidth = $view.innerWidth(); + if ( viewWidth && self._viewWidth !== viewWidth ) { + self._viewWidth = viewWidth; + } self._resizeBlocks(); self._modifyInputBoxWidth(); }, diff --git a/src/js/widgets/jquery.mobile.tizen.virtuallistview.js b/src/js/widgets/jquery.mobile.tizen.virtuallistview.js index 392603fe..cd320dea 100644 --- a/src/js/widgets/jquery.mobile.tizen.virtuallistview.js +++ b/src/js/widgets/jquery.mobile.tizen.virtuallistview.js @@ -249,9 +249,11 @@ define( [ '../jquery.mobile.tizen.core', '../jquery.mobile.tizen.scrollview' ], $( o.id ).height( t._numItemData * t._line_h ); }, + // Resize each listitem's width _resize: function ( event ) { - var o, + var o, // 'ul' t = this, + li, padding, margin; @@ -260,13 +262,14 @@ define( [ '../jquery.mobile.tizen.core', '../jquery.mobile.tizen.scrollview' ], } else { o = event; } + li = $( o ).children( o.childSelector ) - t._container_w = $( o.id ).innerWidth(); + t._container_w = $( o ).width(); - padding = parseInt( $( o.id + o.childSelector ).css( "padding-left" ), 10 ) - + parseInt( $( o.id + o.childSelector ).css( "padding-right" ), 10 ); + padding = parseInt( li.css( "padding-left" ), 10 ) + + parseInt( li.css( "padding-right" ), 10 ); - $( o.id + o.childSelector ).each( function (index) { + li.each( function ( index, obj ) { margin = parseInt( $( this ).css( "margin-left" ), 10 ) + parseInt( $( this ).css( "margin-right" ), 10 ); $( this ).css( "width", t._container_w - padding - margin ); @@ -536,8 +539,8 @@ define( [ '../jquery.mobile.tizen.core', '../jquery.mobile.tizen.scrollview' ], // Bind _scrollmove() at 'scrollstart.virtuallist' event $( document ).bind( "scrollstart.virtuallist scrollstop.vrituallist", t, t._scrollmove ); - // Bind _resize() at 'resize.virtuallist' - $( window ).bind( "resize.virtuallist", t._resize ); + // Bind _resize() + $( window ).on( "throttledresize", $( o.id ), t._resize ); // when ul is a childselector, assume that this is also a swipelist, // and run swipelist constructor @@ -688,7 +691,7 @@ define( [ '../jquery.mobile.tizen.core', '../jquery.mobile.tizen.scrollview' ], $( document ).unbind( "scrollstop" ); - $( window ).unbind( "resize.virtuallist" ); + $( window ).off( "throttledresize", this._resize ); $( o.id ).empty(); diff --git a/src/themes/tizen/common/jquery.mobile.button.less b/src/themes/tizen/common/jquery.mobile.button.less index 0bf1c2f0..4f60202c 100644 --- a/src/themes/tizen/common/jquery.mobile.button.less +++ b/src/themes/tizen/common/jquery.mobile.button.less @@ -105,6 +105,10 @@ box-shadow: none; } +.ui-header .naviframe-button.ui-btn.ui-btn-box-s.ui-btn-down-s { + background : @color_bar_btn_press; +} + .ui-btn-icon-top .ui-btn-inner.ui-btn-hastxt, .ui-li .ui-btn-icon-top .ui-btn-inner.ui-btn-hastxt { padding-top: 52 * @unit_base; diff --git a/src/themes/tizen/common/jquery.mobile.controlgroup.less b/src/themes/tizen/common/jquery.mobile.controlgroup.less index 13c52bfa..5d335008 100644 --- a/src/themes/tizen/common/jquery.mobile.controlgroup.less +++ b/src/themes/tizen/common/jquery.mobile.controlgroup.less @@ -121,6 +121,7 @@ fieldset.ui-controlgroup { } label { + width : 100%; > span.ui-btn-inner { padding-top : 3 * @unit_base; padding-bottom : 3 * @unit_base; diff --git a/src/themes/tizen/common/jquery.mobile.forms.checkboxradio.less b/src/themes/tizen/common/jquery.mobile.forms.checkboxradio.less index ac87f751..45dc946f 100644 --- a/src/themes/tizen/common/jquery.mobile.forms.checkboxradio.less +++ b/src/themes/tizen/common/jquery.mobile.forms.checkboxradio.less @@ -85,7 +85,6 @@ } .ui-btn.ui-btn-icon-left { - display: block; .ui-btn-inner { display: inline-block; line-height: @checkbox-radio-all-height; diff --git a/src/themes/tizen/common/jquery.mobile.theme.less b/src/themes/tizen/common/jquery.mobile.theme.less index 491f72e2..3de99670 100644 --- a/src/themes/tizen/common/jquery.mobile.theme.less +++ b/src/themes/tizen/common/jquery.mobile.theme.less @@ -69,7 +69,8 @@ } /* header button position : need to press area more... */ - >.ui-btn { + >.ui-btn, + >.naviframe-button.ui-btn { .ui-btn-inner.ui-btn-icon-only { .LESSbox-boxsizing( border-box ); height : 100%; @@ -79,13 +80,21 @@ } } - >.ui-btn:not(.ui-btn-icon-notext) { + >.naviframe-button.ui-btn { + .ui-btn-inner .ui-icon { + margin-top : 0px; + } + } + + >.ui-btn:not(.ui-btn-icon-notext), + >.naviframe-button.ui-btn:not(.ui-btn-icon-notext) { .ui-btn-inner.ui-btn-icon-only { padding-left : 0px; } } - >.ui-btn:not(.ui-btn-icon_only) { + >.ui-btn:not(.ui-btn-icon_only), + >.naviframe-button.ui-btn:not(.ui-btn-icon_only) { width : 53 * @unit_base; height : 18 * @unit_base; top : auto; @@ -104,10 +113,12 @@ } img { + position : absolute; display: inline-block; height: 16 * @unit_base; width: 16 * @unit_base; margin-left: 8 * @unit_base; + margin-top : 24 * @unit_base; } .ui-title-text-sub { @@ -124,7 +135,8 @@ } } - > .ui-btn{ + > .ui-btn, + > .naviframe-button.ui-btn { position : absolute; top : 16 * @unit_base; margin-top : 0px; @@ -144,7 +156,8 @@ top: 8 * @unit_base; } - > .ui-btn.ui-btn-icon_only { + > .ui-btn.ui-btn-icon_only, + > .naviframe-button.ui-btn.ui-btn-icon_only { -o-border-radius : 0px; -ms-border-radius : 0px; -moz-border-radius : 0px; @@ -160,35 +173,50 @@ right : 56 * @unit_base; } - > .ui-btn:not(.ui-btn-icon_only):nth-child(2) { + > .ui-btn:not(.ui-btn-icon_only):nth-child(2), + > .naviframe-button.ui-btn:not(.ui-btn-icon_only):nth-child(2) { right : 7 * @unit_base; } - > .ui-btn:not(.ui-btn-icon_only):nth-child(3) { + > .ui-btn:not(.ui-btn-icon_only):nth-child(3), + > .naviframe-button.ui-btn:not(.ui-btn-icon_only):nth-child(3) { right : 62 * @unit_base; } - > img + h1 + .ui-btn:not(.ui-btn-icon_only):nth-child(3) { + > img + h1 { + padding-left : 24 * @unit_base; + } + + > img + h1 + .ui-btn:not(.ui-btn-icon_only):nth-child(3), + > img + h1 + .naviframe-button.ui-btn:not(.ui-btn-icon_only):nth-child(3) { right : 7 * @unit_base; } - > img + h1 + .ui-btn:not(.ui-btn-icon_only):nth-child(3) + .ui-btn:not(.ui-btn-icon_only) { + > img + h1 + .ui-btn:not(.ui-btn-icon_only):nth-child(3) + .ui-btn:not(.ui-btn-icon_only), + > img + h1 + .naviframe-button.ui-btn:not(.ui-btn-icon_only):nth-child(3) + .naviframe-button.ui-btn:not(.ui-btn-icon_only) { right : 62 * @unit_base; } - > img + h1 + span.ui-title-text-sub + .ui-btn:not(.ui-btn-icon_only):nth-child(4) { + > img + h1 + span.ui-title-text-sub + .ui-btn:not(.ui-btn-icon_only):nth-child(4), + > img + h1 + span.ui-title-text-sub + .naviframe-button.ui-btn:not(.ui-btn-icon_only):nth-child(4) { right : 7 * @unit_base; } - > img + h1 + span.ui-title-text-sub + .ui-btn:not(.ui-btn-icon_only):nth-child(4) + .ui-btn:not(.ui-btn-icon_only) { + > img + h1 + span.ui-title-text-sub + .ui-btn:not(.ui-btn-icon_only):nth-child(4) + .ui-btn:not(.ui-btn-icon_only), + > img + h1 + span.ui-title-text-sub + .naviframe-button.ui-btn:not(.ui-btn-icon_only):nth-child(4) + .naviframe-button.ui-btn:not(.ui-btn-icon_only) { right : 62 * @unit_base; } + > .ui-btn.ui-btn-down-s { background : @color_bar_btn_press; color : @color_bar_title_button_text_press; } &.ui-title-multiline { + img { + margin-top : 14 * @unit_base; + } + .ui-title { min-height : 24 * @unit_base; max-height : 24 * @unit_base; /* temporary UX strange */ diff --git a/src/themes/tizen/common/jquery.mobile.tizen.tabbar.less b/src/themes/tizen/common/jquery.mobile.tizen.tabbar.less index 69119f09..5e7390d6 100644 --- a/src/themes/tizen/common/jquery.mobile.tizen.tabbar.less +++ b/src/themes/tizen/common/jquery.mobile.tizen.tabbar.less @@ -238,21 +238,19 @@ position : absolute; top : 0px; - width : 10 * @unit_base; + width : 81 * @unit_base; height : 55 * @unit_base; - background : -webkit-linear-gradient(left, rgba(0, 0, 155, 1) 0%,rgba(246,248,239,1) 100%); + + background-repeat: no-repeat; + background-size: 100% 100%; } .ui-tabbar-divider-left { left : 0px; - border-top-right-radius : 10 * @unit_base; - border-bottom-right-radius : 10 * @unit_base; - background : -webkit-linear-gradient(left, rgba(153, 153, 153, 1) 0%,rgba(246,248,239,1) 100%); + background-image: url(images/00_effect_title_tab_bounce_left.png); } .ui-tabbar-divider-right { right : 0px; - border-top-left-radius : 10 * @unit_base; - border-bottom-left-radius : 10 * @unit_base; - background : -webkit-linear-gradient(right, rgba(153, 153, 153, 1) 0%,rgba(246,248,239,1) 100%); + background-image: url(images/00_effect_title_tab_bounce_right.png); } diff --git a/src/themes/tizen/common/jquery.mobile.tizen.virtualgridview.less b/src/themes/tizen/common/jquery.mobile.tizen.virtualgridview.less index b18bf905..51d25967 100644 --- a/src/themes/tizen/common/jquery.mobile.tizen.virtualgridview.less +++ b/src/themes/tizen/common/jquery.mobile.tizen.virtualgridview.less @@ -37,14 +37,12 @@ display : block; left : 0; top : 0; - width : 10 * @unit_base; + width : 56%; height : 100%; opacity : 0; - background : -webkit-gradient(linear, - right top, - left top, - color-stop(0, rgba(128,128,128,0)), - color-stop(1, rgba(128,128,128,1))); + background-repeat : no-repeat; + -webkit-background-size: 100% 100%; + background-image: url(./images/00_grid_overscrolling_left.png); pointer-events : none; } @@ -53,14 +51,12 @@ display : block; right : 0; bottom : 0; - width : 10 * @unit_base; + width : 56%; height : 100%; opacity : 0; - background : -webkit-gradient(linear, - right top, - left top, - color-stop(0, rgba(128,128,128,1)), - color-stop(1, rgba(128,128,128,0))); + background-repeat : no-repeat; + -webkit-background-size: 100% 100%; + background-image: url(./images/00_grid_overscrolling_right.png); pointer-events : none; } @@ -69,13 +65,11 @@ display : block; top : 0; width : 100%; - height : 10 * @unit_base; + height : 32%; opacity : 0; - background : -webkit-gradient(linear, - left bottom, - left top, - color-stop(0, rgba(128,128,128,0)), - color-stop(1, rgba(128,128,128,1))); + background-repeat : no-repeat; + -webkit-background-size: 100% 100%; + background-image: url(./images/00_grid_overscrolling_top.png); pointer-events : none; } @@ -84,13 +78,11 @@ display : block; bottom : 0; width : 100%; - height : 10 * @unit_base; + height : 32%; opacity : 0; - background : -webkit-gradient(linear, - left bottom, - left top, - color-stop(0, rgba(128,128,128,1)), - color-stop(1, rgba(128,128,128,0))); + background-repeat : no-repeat; + -webkit-background-size: 100% 100%; + background-image: url(./images/00_grid_overscrolling_bottom.png); pointer-events : none; } diff --git a/src/themes/tizen/tizen-black/images/00_grid_overscrolling_bottom.png b/src/themes/tizen/tizen-black/images/00_grid_overscrolling_bottom.png Binary files differnew file mode 100755 index 00000000..773488a4 --- /dev/null +++ b/src/themes/tizen/tizen-black/images/00_grid_overscrolling_bottom.png diff --git a/src/themes/tizen/tizen-black/images/00_grid_overscrolling_left.png b/src/themes/tizen/tizen-black/images/00_grid_overscrolling_left.png Binary files differnew file mode 100755 index 00000000..77a8dc53 --- /dev/null +++ b/src/themes/tizen/tizen-black/images/00_grid_overscrolling_left.png diff --git a/src/themes/tizen/tizen-black/images/00_grid_overscrolling_right.png b/src/themes/tizen/tizen-black/images/00_grid_overscrolling_right.png Binary files differnew file mode 100755 index 00000000..6831d706 --- /dev/null +++ b/src/themes/tizen/tizen-black/images/00_grid_overscrolling_right.png diff --git a/src/themes/tizen/tizen-black/images/00_grid_overscrolling_top.png b/src/themes/tizen/tizen-black/images/00_grid_overscrolling_top.png Binary files differnew file mode 100755 index 00000000..0ddf4ecb --- /dev/null +++ b/src/themes/tizen/tizen-black/images/00_grid_overscrolling_top.png diff --git a/src/themes/tizen/tizen-black/images/controls/button/00_button_check.png b/src/themes/tizen/tizen-black/images/controls/button/00_button_check.png Binary files differindex 16558142..58be917b 100755 --- a/src/themes/tizen/tizen-black/images/controls/button/00_button_check.png +++ b/src/themes/tizen/tizen-black/images/controls/button/00_button_check.png diff --git a/src/themes/tizen/tizen-black/images/controls/button/00_button_check_press.png b/src/themes/tizen/tizen-black/images/controls/button/00_button_check_press.png Binary files differindex a4908553..00d2995c 100755 --- a/src/themes/tizen/tizen-black/images/controls/button/00_button_check_press.png +++ b/src/themes/tizen/tizen-black/images/controls/button/00_button_check_press.png diff --git a/src/themes/tizen/tizen-black/images/controls/button/00_button_gear.png b/src/themes/tizen/tizen-black/images/controls/button/00_button_gear.png Binary files differindex 667c28aa..2b252a05 100755 --- a/src/themes/tizen/tizen-black/images/controls/button/00_button_gear.png +++ b/src/themes/tizen/tizen-black/images/controls/button/00_button_gear.png diff --git a/src/themes/tizen/tizen-black/images/controls/button/00_button_gear_press.png b/src/themes/tizen/tizen-black/images/controls/button/00_button_gear_press.png Binary files differindex ec8a716d..14b42291 100755 --- a/src/themes/tizen/tizen-black/images/controls/button/00_button_gear_press.png +++ b/src/themes/tizen/tizen-black/images/controls/button/00_button_gear_press.png diff --git a/src/themes/tizen/tizen-black/images/controls/button/00_button_grid.png b/src/themes/tizen/tizen-black/images/controls/button/00_button_grid.png Binary files differindex 5fc5342d..208c55c6 100755 --- a/src/themes/tizen/tizen-black/images/controls/button/00_button_grid.png +++ b/src/themes/tizen/tizen-black/images/controls/button/00_button_grid.png diff --git a/src/themes/tizen/tizen-black/images/controls/button/00_button_grid_press.png b/src/themes/tizen/tizen-black/images/controls/button/00_button_grid_press.png Binary files differindex 88e51aa4..c18aa10b 100755 --- a/src/themes/tizen/tizen-black/images/controls/button/00_button_grid_press.png +++ b/src/themes/tizen/tizen-black/images/controls/button/00_button_grid_press.png diff --git a/src/themes/tizen/tizen-black/images/controls/button/00_button_search.png b/src/themes/tizen/tizen-black/images/controls/button/00_button_search.png Binary files differindex 01c10818..e3b0450c 100755 --- a/src/themes/tizen/tizen-black/images/controls/button/00_button_search.png +++ b/src/themes/tizen/tizen-black/images/controls/button/00_button_search.png diff --git a/src/themes/tizen/tizen-black/images/controls/button/00_button_search_press.png b/src/themes/tizen/tizen-black/images/controls/button/00_button_search_press.png Binary files differindex aeb2a5be..be475de1 100755 --- a/src/themes/tizen/tizen-black/images/controls/button/00_button_search_press.png +++ b/src/themes/tizen/tizen-black/images/controls/button/00_button_search_press.png diff --git a/src/themes/tizen/tizen-white/images/00_effect_title_tab_bounce_left.png b/src/themes/tizen/tizen-white/images/00_effect_title_tab_bounce_left.png Binary files differnew file mode 100644 index 00000000..8eca760f --- /dev/null +++ b/src/themes/tizen/tizen-white/images/00_effect_title_tab_bounce_left.png diff --git a/src/themes/tizen/tizen-white/images/00_effect_title_tab_bounce_right.png b/src/themes/tizen/tizen-white/images/00_effect_title_tab_bounce_right.png Binary files differnew file mode 100644 index 00000000..9af8c07d --- /dev/null +++ b/src/themes/tizen/tizen-white/images/00_effect_title_tab_bounce_right.png diff --git a/src/themes/tizen/tizen-white/images/00_grid_overscrolling_bottom.png b/src/themes/tizen/tizen-white/images/00_grid_overscrolling_bottom.png Binary files differnew file mode 100755 index 00000000..773488a4 --- /dev/null +++ b/src/themes/tizen/tizen-white/images/00_grid_overscrolling_bottom.png diff --git a/src/themes/tizen/tizen-white/images/00_grid_overscrolling_left.png b/src/themes/tizen/tizen-white/images/00_grid_overscrolling_left.png Binary files differnew file mode 100755 index 00000000..77a8dc53 --- /dev/null +++ b/src/themes/tizen/tizen-white/images/00_grid_overscrolling_left.png diff --git a/src/themes/tizen/tizen-white/images/00_grid_overscrolling_right.png b/src/themes/tizen/tizen-white/images/00_grid_overscrolling_right.png Binary files differnew file mode 100755 index 00000000..6831d706 --- /dev/null +++ b/src/themes/tizen/tizen-white/images/00_grid_overscrolling_right.png diff --git a/src/themes/tizen/tizen-white/images/00_grid_overscrolling_top.png b/src/themes/tizen/tizen-white/images/00_grid_overscrolling_top.png Binary files differnew file mode 100755 index 00000000..0ddf4ecb --- /dev/null +++ b/src/themes/tizen/tizen-white/images/00_grid_overscrolling_top.png diff --git a/src/themes/tizen/tizen-white/images/00_splite_handler_h.png b/src/themes/tizen/tizen-white/images/00_splite_handler_h.png Binary files differnew file mode 100644 index 00000000..f6f2c97a --- /dev/null +++ b/src/themes/tizen/tizen-white/images/00_splite_handler_h.png diff --git a/src/themes/tizen/tizen-white/images/00_splite_handler_v.png b/src/themes/tizen/tizen-white/images/00_splite_handler_v.png Binary files differnew file mode 100644 index 00000000..d0cf6bb2 --- /dev/null +++ b/src/themes/tizen/tizen-white/images/00_splite_handler_v.png diff --git a/src/themes/tizen/tizen-white/theme.js b/src/themes/tizen/tizen-white/theme.js index 1a404657..394ebc02 100644 --- a/src/themes/tizen/tizen-white/theme.js +++ b/src/themes/tizen/tizen-white/theme.js @@ -45,13 +45,25 @@ $( function ( o ) { return h; } - if ( isCollapse ) { + if ( isCollapse ) { // collapse! + // remember current height $( c ).data( 'max-height', _getHeight( self ) ); - } else { - if ( ! $( c ).data( 'max-height' ) ) { - $( c ).data( 'max-height', document.body.clientHeight ); + $( self ).parentsUntil( '.ui-page', '.ui-collapsible' ).each( function( idx, el ) { + var content = $( el ).children('.ui-collapsible-content')[0]; + $( content ).data( 'max-height', _getHeight( el ) ); + } ); + + } else { // expand! + h = $( c ).data( 'max-height' ); + if ( !h ) { + h = document.body.clientHeight; + $( c ).data( 'max-height', h ); } - $( c ).css( 'max-height', $( c ).data( 'max-height' ) ); + $( c ).css( 'max-height', h ); + $( self ).parentsUntil( '.ui-page', '.ui-collapsible' ).each( function( idx, el ) { + var content = $( el ).children('.ui-collapsible-content')[0]; + $( content ).css( 'max-height', _getHeight( el ) ); + } ); } }; } ( $.mobile.collapsible.prototype.options ) ); diff --git a/tests/additional-unit-tests/button/button-tests.js b/tests/additional-unit-tests/button/button-tests.js index 5a53ddb6..9f4c02e3 100755 --- a/tests/additional-unit-tests/button/button-tests.js +++ b/tests/additional-unit-tests/button/button-tests.js @@ -10,7 +10,7 @@ $("#checkboxpage").live ("pageinit", function ( event ) { module ("button") ; - var unit_button = function ( widget, type ) { + var unit_button = function ( widget, type, text ) { var buttonClassPrefix = "ui-btn", buttonText = type, icon, @@ -33,7 +33,11 @@ $("#checkboxpage").live ("pageinit", function ( event ) { // Text Trim, CausejQueryMobile ( JQM ) 1.1 forced to add -"\u00a0"in buttonIcon ( ButtonMarkup ) // JQM 1.1 buttonMarkup code : // - if ( buttonIcon ) buttonIcon.appendChild ( document.createTextNode ("\u00a0") ) ; - equal ( widget.text ( ).trim ( ) , buttonText , "Button Text") ; + if ( buttonText == "") { + equal ( widget.text ( ).trim ( ) , text , "Button Text icon only") ; + } else { + equal ( widget.text ( ).trim ( ) , buttonText , "Button Text"); + } icon = widget.jqmData ("icon") ; if ( icon !== undefined ) { ok ( widget.children ( ).children ( ).hasClass ("ui-icon-" + icon ) , "Style - Button Icon") ; @@ -121,15 +125,15 @@ $("#checkboxpage").live ("pageinit", function ( event ) { } ) ; test ("Button - Inline, Only Icon ( Reveal )", function ( ) { - unit_button ( $("#button-4") , "Non Text Button") ; + unit_button ( $("#button-4") , "Non Text Button", "reveal") ; } ) ; test ("Button - Inline, Only Icon ( Send ) , circle", function ( ) { - unit_button ( $("#button-5") , "Non Text Button") ; + unit_button ( $("#button-5") , "Non Text Button", "send") ; } ) ; test ("Button - Inline, Only Icon ( Favorite ) , nobackground", function ( ) { - unit_button ( $("#button-6") , "Non Text Button") ; + unit_button ( $("#button-6") , "Non Text Button", "favorite") ; } ) ; test ("Button", function ( ) { @@ -187,7 +191,7 @@ $("#checkboxpage").live ("pageinit", function ( event ) { markup = '<div data-role = "button" id = "button-4">Non Text Button Dynamic</div>'; $('#checkboxpage').find (":jqmData(role=contents)").append ( markup ) ; $('#checkboxpage').find (":jqmData(role=contents)").trigger ('create') ; - unit_button ( $("#button-4") , "Non Text Button Dynamic") ; + unit_button ( $("#button-4") , "Non Text Button Dynamic", "reveal") ; } ) ; @@ -199,7 +203,7 @@ $("#checkboxpage").live ("pageinit", function ( event ) { markup = '<div data-role = "button" id = "button-5">Non Text Button Dynamic</div>'; $('#checkboxpage').find (":jqmData(role=contents)").append ( markup ) ; $('#checkboxpage').find (":jqmData(role=contents)").trigger ('create') ; - unit_button ( $("#button-5") , "Non Text Button Dynamic") ; + unit_button ( $("#button-5") , "Non Text Button Dynamic", "send") ; } ) ; @@ -211,7 +215,7 @@ $("#checkboxpage").live ("pageinit", function ( event ) { markup = '<div data-role = "button" id = "button-6">Non Text Button Dynamic</div>'; $('#checkboxpage').find (":jqmData(role=contents)").append ( markup ) ; $('#checkboxpage').find (":jqmData(role=contents)").trigger ('create') ; - unit_button ( $("#button-6") , "Non Text Button Dynamic") ; + unit_button ( $("#button-6") , "Non Text Button Dynamic", "favorite") ; } ) ; diff --git a/tests/additional-unit-tests/button/index.html b/tests/additional-unit-tests/button/index.html index b23593ed..beeb468b 100755 --- a/tests/additional-unit-tests/button/index.html +++ b/tests/additional-unit-tests/button/index.html @@ -10,7 +10,7 @@ <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" /> - <script src="../../../libs/js/jquery-mobile-1.1.0/tests/jquery.testHelper.js"></script> + <script src="../../../libs/js/jquery-mobile-1.2.0/tests/jquery.testHelper.js"></script> <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script> <script src="button-tests.js"></script> <title>Button</title> diff --git a/tests/additional-unit-tests/check/index.html b/tests/additional-unit-tests/check/index.html index 284169bf..7a1cd124 100755 --- a/tests/additional-unit-tests/check/index.html +++ b/tests/additional-unit-tests/check/index.html @@ -9,7 +9,7 @@ </script> <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" /> - <script src="../../../libs/js/jquery-mobile-1.1.0/tests/jquery.testHelper.js"></script> + <script src="../../../libs/js/jquery-mobile-1.2.0/tests/jquery.testHelper.js"></script> <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script> <script src="check-tests.js"></script> diff --git a/tests/additional-unit-tests/collapsible/collapsible-tests.js b/tests/additional-unit-tests/collapsible/collapsible-tests.js index b6a17efb..45fe526d 100755 --- a/tests/additional-unit-tests/collapsible/collapsible-tests.js +++ b/tests/additional-unit-tests/collapsible/collapsible-tests.js @@ -16,8 +16,8 @@ equal( widget.hasClass('ui-collapsible'), true, "Markup check") ; /* Check Option */ - equal( obj_collapse.options.expandCueText, " click to expand contents", "Collapsed test -> expandCueText"); - equal( obj_collapse.options.collapseCueText, " click to collapse contents", "Collapsed test -> collapseCueText"); + equal( obj_collapse.options.expandCueText, " Expandable list, tap to open list", "Collapsed test -> expandCueText"); + equal( obj_collapse.options.collapseCueText, " Expandable list, tap to close list", "Collapsed test -> collapseCueText"); equal( obj_collapse.options.collapsed, true, "Collapsed test -> collapsed"); equal( obj_collapse.options.heading, "h1,h2,h3,h4,h5,h6,legend,li", "Collapsed test -> heading"); equal( obj_collapse.options.theme, 's', "Collapsed test -> theme"); diff --git a/tests/additional-unit-tests/datetimepicker/index.html b/tests/additional-unit-tests/datetimepicker/index.html index f56a9164..eb1ee17e 100755 --- a/tests/additional-unit-tests/datetimepicker/index.html +++ b/tests/additional-unit-tests/datetimepicker/index.html @@ -10,7 +10,7 @@ <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" /> - <script src="../../../libs/js/jquery-mobile-1.1.0/tests/jquery.testHelper.js"></script> + <script src="../../../libs/js/jquery-mobile-1.2.0/tests/jquery.testHelper.js"></script> <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script> <script src="datetimepicker-tests.js"></script> diff --git a/tests/additional-unit-tests/dayselector/index.html b/tests/additional-unit-tests/dayselector/index.html index 57c3d355..3ff6b154 100755 --- a/tests/additional-unit-tests/dayselector/index.html +++ b/tests/additional-unit-tests/dayselector/index.html @@ -10,9 +10,9 @@ data-framework-viewport-scale=false> </script> - <script src="../../../libs/js/jquery-mobile-1.1.0/tests/jquery.testHelper.js"></script> - <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.1.0/external/qunit.css" /> - <script src="../../../libs/js/jquery-mobile-1.1.0/external/qunit.js"></script> + <script src="../../../libs/js/jquery-mobile-1.2.0/tests/jquery.testHelper.js"></script> + <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" /> + <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script> <script src="dayselector-tests.js"></script> </head> <body> diff --git a/tests/additional-unit-tests/gallery3d/index.html b/tests/additional-unit-tests/gallery3d/index.html index 7935a4b6..7a2bc42d 100755 --- a/tests/additional-unit-tests/gallery3d/index.html +++ b/tests/additional-unit-tests/gallery3d/index.html @@ -8,9 +8,9 @@ data-framework-viewport-scale=false> </script> - <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.1.0/external/qunit.css" /> + <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" /> - <script src="../../../libs/js/jquery-mobile-1.1.0/external/qunit.js"></script> + <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script> <script src="gallery3d-tests.js"></script> <title>Galley3d</title> diff --git a/tests/additional-unit-tests/loader/index.html b/tests/additional-unit-tests/loader/index.html index b3d5825d..96f7cbdb 100755 --- a/tests/additional-unit-tests/loader/index.html +++ b/tests/additional-unit-tests/loader/index.html @@ -8,11 +8,11 @@ <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.js"></script> <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js" data-framework-theme="tizen-white"></script> - <script src="../../../libs/js/jquery-mobile-1.1.0/tests/unit/jquery.setNameSpace.js"></script> - <script src="../../../libs/js/jquery-mobile-1.1.0/tests/jquery.testHelper.js"></script> - <script src="../../../libs/js/jquery-mobile-1.1.0/external/qunit.js"></script> + <script src="../../../libs/js/jquery-mobile-1.2.0/tests/unit/jquery.setNameSpace.js"></script> + <script src="../../../libs/js/jquery-mobile-1.2.0/tests/jquery.testHelper.js"></script> + <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script> - <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.1.0/external/qunit.css"/> + <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css"/> <script src="loader-tests.js"></script> </head> diff --git a/tests/additional-unit-tests/slider/index.html b/tests/additional-unit-tests/slider/index.html index fac80d65..459e558a 100755 --- a/tests/additional-unit-tests/slider/index.html +++ b/tests/additional-unit-tests/slider/index.html @@ -9,7 +9,6 @@ </script> <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" /> - <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script> <script src="slider-tests.js"></script> @@ -17,7 +16,6 @@ </head> <body> - <h1 id="qunit-header">Slider</h1> <h2 id="qunit-banner"></h2> <div id="qunit-testrunner-toolbar"></div> @@ -25,25 +23,15 @@ <ol id="qunit-tests"></ol> <div id="qunit-fixture"> - <div data-role="page" id="sliderpage1"> <div data-role="header" data-position="fixed"> <h1>Slider</h1> </div> <div data-role="content"> <input id="slider0" data-popup="false" type="range" name="slider" value="50" min="0" max="100"></input> - </div> - </div> - - <div data-role="page" id="sliderpage2"> - <div data-role="header" data-position="fixed"> - <h1>Slider</h1> - </div> - <div data-role="content"> <input id="slider1" data-popup="false" type="range" name="slider" value="5" min="0" max="10" data-icon="volume"></input> </div> </div> </div> - </body> </html> diff --git a/tests/additional-unit-tests/slider/slider-tests.js b/tests/additional-unit-tests/slider/slider-tests.js index fc1c582f..05dc1304 100755 --- a/tests/additional-unit-tests/slider/slider-tests.js +++ b/tests/additional-unit-tests/slider/slider-tests.js @@ -43,12 +43,13 @@ $( document ).ready( function ( ) { equal( handle.attr("aria-valuemin" ), widget.attr("min" ), "Paramter : min" ); equal( handle.attr("aria-valuemax" ), widget.attr("max" ), "Paramter : max" ); - equal( parseInt( handle.css("left") ), handle_left( widget, slider ), "Handle Location: Default" ); + ok( Math.abs(parseInt( handle.css("left") ) - handle_left( widget, slider ) ) <= 1, "Handle Location: Default" ); /* Check APIs */ widget.val( random_move( widget.attr("min" ), widget.attr("max" ) ) ); widget.trigger("change" ); - equal( parseInt( handle.css("left") ), handle_left( widget, slider ), "Handle Location: Moved" ); + ok( Math.abs(parseInt( handle.css("left") ) - handle_left( widget, slider ) ) <= 1, "Handle Location: Moved" ); + if ( widget.jqmData('popup') == true ) { popup = slider.find(".ui-slider-handle-press" ); ok( popup, "Popup present" ); @@ -68,14 +69,15 @@ $( document ).ready( function ( ) { }; + $('#sliderpage1').page( ) ; + test( "normal slider", function ( ) { - $('#sliderpage1').page( ) ; unit_slider( $("#slider0" ) ); } ); test( "icon slider", function ( ) { - $('#sliderpage2').page( ) ; unit_slider( $("#slider1" ) ); } ); + } ); diff --git a/tests/unit-tests/ensurens/ensurens-tests.js b/tests/unit-tests/ensurens/ensurens-tests.js new file mode 100644 index 00000000..af003937 --- /dev/null +++ b/tests/unit-tests/ensurens/ensurens-tests.js @@ -0,0 +1,34 @@ +/* + * Unit Test: EnsureNS + * + * Krzysztof Antoszek <k.antoszek@samsung.com> + */ + + +$(document).ready(function () { + module("ensureNS"); + test("ensureNS test", function () { + var obj = { + "prop1": true, + "prop2": 1 + }; + + // # TEST 1 + equal(!!(window.ensure && window.ensure.tests && window.ensure.tests.leaf1), false); + + ensureNS('window.ensure.tests.leaf1'); + + // # TEST 2 + equal(!!(window.ensure && window.ensure.tests && window.ensure.tests.leaf1), true); + + window.ensure.tests.leaf1 = obj; + + ensureNS('window.ensure.tests.leaf1.leaf2'); + + // # TEST 3 + equal(typeof window.ensure.tests.leaf1.leaf2, "object"); + + // # TEST 4 + deepEqual(window.ensure.tests.leaf1, obj); + }); +});
\ No newline at end of file diff --git a/tests/unit-tests/ensurens/index.html b/tests/unit-tests/ensurens/index.html new file mode 100644 index 00000000..4958c844 --- /dev/null +++ b/tests/unit-tests/ensurens/index.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html> + <head> + <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script> + <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script> + <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js" + data-framework-theme="tizen-white"> + </script> + <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" /> + <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script> + <script src="../../../demos/tizen-winsets/widgets/list/virtuallist-db-demo.js"></script> + <script src="ensurens-tests.js"></script> + <title>ensureNS</title> + </head> + + <body> + <h1 id="qunit-header">Extendablelist</h1> + <h2 id="qunit-banner"></h2> + <div id="qunit-testrunner-toolbar"></div> + <h2 id="qunit-userAgent"></h2> + <ol id="qunit-tests"></ol> + + <div id="qunit-fixture"></div> + </body> +</html> diff --git a/tests/unit-tests/fastscroll/fastscroll-tests.js b/tests/unit-tests/fastscroll/fastscroll-tests.js index 7e0bc53c..2fad2b05 100644 --- a/tests/unit-tests/fastscroll/fastscroll-tests.js +++ b/tests/unit-tests/fastscroll/fastscroll-tests.js @@ -10,7 +10,8 @@ var unit_fastscroll = function ( list ) { var widget, shortcut, - divider; + divider, + indexString = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z:ㄱ,ㄴ,ㄷ,ㄹ,ㅁ,ㅂ,ㅅ,ㅇ,ㅈ,ㅊ,ㅋ,ㅌ,ㅍ,ㅎ" ; widget = list.parentsUntil(".ui-content").parent().find(".ui-fastscroll"); @@ -24,6 +25,10 @@ for ( i = 0; i < divider.length; i++ ) { equal( $( divider[i] ).text(), $( shortcut[i] ).text(), "Shortcut"); } + + /* indexString */ + list.fastscroll( "indexString", indexString ); + equal( list.fastscroll( "indexString" ), indexString, "indexString" ); }; test( "shortcut", function () { diff --git a/tests/unit-tests/imageloader/imageloader-tests.js b/tests/unit-tests/imageloader/imageloader-tests.js new file mode 100644 index 00000000..3fb5a924 --- /dev/null +++ b/tests/unit-tests/imageloader/imageloader-tests.js @@ -0,0 +1,28 @@ +$( document ).ready( function () { + var url = "test.png?" + Date.now(); + module("Imageloader"); + + + asyncTest( "Thumbnail is not in storage", 1, function () { + $.imageloader.getThumbnail(url, function ( result ) { + strictEqual(result, "NOT_FOUND_ERR", "Thumbnail is not found, correct error."); + start(); + }); + }); + + asyncTest( "Set thumbnail", 2, function () { + $.imageloader.setThumbnail( url, function ( result ) { + strictEqual( typeof result, "string", "Result is returned" ); + strictEqual( result.substr(0, 22), "data:image/png;base64,", "Returned result is png data string" ); + start(); + }); + }); + + asyncTest( "Remove thumbnail", 1, function () { + $.imageloader.removeThumbnail( url ); + $.imageloader.getThumbnail(url, function ( result ) { + strictEqual(result, "NOT_FOUND_ERR", "Thumbnail is not found, correct error."); + start(); + }); + }); +});
\ No newline at end of file diff --git a/tests/unit-tests/imageloader/index.html b/tests/unit-tests/imageloader/index.html new file mode 100644 index 00000000..0a77ddda --- /dev/null +++ b/tests/unit-tests/imageloader/index.html @@ -0,0 +1,28 @@ + +<!DOCTYPE html> +<html> +<head> + <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script> + <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script> + <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js" + data-framework-theme="tizen-white" + data-framework-viewport-scale=false> + </script> + <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" /> + <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script> + <script src="imageloader-tests.js"></script> + <title>ImageLoader</title> +</head> + +<body> + +<h1 id="qunit-header">Core</h1> +<h2 id="qunit-banner"></h2> +<div id="qunit-testrunner-toolbar"></div> +<h2 id="qunit-userAgent"></h2> +<ol id="qunit-tests"></ol> + +<div id="qunit-fixture"></div> + +</body> +</html> diff --git a/tests/unit-tests/imageloader/test.png b/tests/unit-tests/imageloader/test.png Binary files differnew file mode 100644 index 00000000..b63d9027 --- /dev/null +++ b/tests/unit-tests/imageloader/test.png diff --git a/tests/unit-tests/tests.js b/tests/unit-tests/tests.js index 1f174c5f..af645898 100755 --- a/tests/unit-tests/tests.js +++ b/tests/unit-tests/tests.js @@ -1,6 +1,7 @@ var TESTS = { "testPages":[ // Put your test here + "ensurens", "button", "core", "check", @@ -10,6 +11,7 @@ var TESTS = { "handler", "gallery", "gallery3d", + "imageloader", "multimediaview", "navigationbar", "notification", |