191351cd2b0f6bea8cad75b52609ff315d96f4d1
[platform/framework/web/web-ui-fw.git] / demos / tizen-winsets / widgets / tokentextarea-demo.js
1 ( function ( $, window ) {\r
2         $( document ).ready( function () {\r
3                 $( "#MBTaddItemTest" ).click( function () {\r
4                         $( ":jqmData(role='tokentextarea')" ).tokentextarea( "add", "additem" );\r
5                 });\r
6 \r
7                 $( "#MBTremoveItemTest" ).click( function () {\r
8                         $( ":jqmData(role='tokentextarea')" ).tokentextarea( "remove", 0 );\r
9                 });\r
10 \r
11                 $( "#MBTinputTextTest" ).click( function () {\r
12                         $( ":jqmData(role='tokentextarea')" ).tokentextarea( "inputText", "Hello~~~" );\r
13                 });\r
14 \r
15                 $( "#MBTgetInputTextTest" ).click( function () {\r
16                         var input = $( ":jqmData(role='tokentextarea')" ).tokentextarea( "inputText" );\r
17                         window.alert( "input String : " + input );\r
18                 });\r
19 \r
20                 $( "#MBTremoveAllItemTest" ).click( function () {\r
21                         $( ":jqmData(role='tokentextarea')" ).tokentextarea( "remove" );\r
22                         $( ":jqmData(role='tokentextarea')" ).parents( ".ui-scrollview-view" ).parent().scrollview( "scrollTo", 0, 0 );\r
23                 });\r
24 \r
25                 $( "#MBTgetSelectedItemTest" ).click( function () {\r
26                         var content = $( ":jqmData(role='tokentextarea')" ).tokentextarea( "select" );\r
27                         window.alert( "Select content : " + content );\r
28                 });\r
29 \r
30                 $( "#MBTselectItemTest" ).click( function () {\r
31                         $( ":jqmData(role='tokentextarea')" ).tokentextarea( "select", 0 );\r
32                 });\r
33 \r
34                 $( "#MBTlengthTest" ).click( function () {\r
35                         var length = $( ":jqmData(role='tokentextarea')" ).tokentextarea( "length" );\r
36                         window.alert( "length : " + length );\r
37                 });\r
38 \r
39                 $( "#MBTfocusInTest" ).click( function () {\r
40                         $( ":jqmData(role='tokentextarea')" ).tokentextarea( "focusIn", 0 );\r
41                 });\r
42 \r
43                 $( "#MBTfocusOutTest" ).click( function () {\r
44                         $( ":jqmData(role='tokentextarea')" ).tokentextarea( "focusOut", 0 );\r
45                 });\r
46 \r
47                 $( "#MBTdestroyTest" ).click( function () {\r
48                         $( ":jqmData(role='tokentextarea')" ).tokentextarea( "destroy" );\r
49                 });\r
50 \r
51                 $( "#contentList a" ).click( function () {\r
52                         var arg = $( this ).text();\r
53                         $( ":jqmData(role='tokentextarea')" ).tokentextarea( "add", arg );\r
54                 });\r
55 \r
56                 $( "#cancelBtn" ).click( function () {\r
57                         $.mobile.changePage( "#tokentextarea", {\r
58                                 transition: "reverse slide",\r
59                                 reverse: false,\r
60                                 changeHash: false\r
61                         } );\r
62                 });\r
63         });\r
64 } ( jQuery, window ) );\r