1 ( function ( $, window ) {
2 $( document ).ready( function () {
3 $( "#MBTaddItemTest" ).click( function () {
4 $( ":jqmData(role='tokentextarea')" ).tokentextarea( "add", "additem" );
7 $( "#MBTremoveItemTest" ).click( function () {
8 $( ":jqmData(role='tokentextarea')" ).tokentextarea( "remove", 0 );
11 $( "#MBTinputTextTest" ).click( function () {
12 $( ":jqmData(role='tokentextarea')" ).tokentextarea( "inputText", "Hello~~~" );
15 $( "#MBTgetInputTextTest" ).click( function () {
16 var input = $( ":jqmData(role='tokentextarea')" ).tokentextarea( "inputText" );
17 window.alert( "input String : " + input );
20 $( "#MBTremoveAllItemTest" ).click( function () {
21 $( ":jqmData(role='tokentextarea')" ).tokentextarea( "remove" );
22 $( ":jqmData(role='tokentextarea')" ).parents( ".ui-scrollview-view" ).parent().scrollview( "scrollTo", 0, 0 );
25 $( "#MBTgetSelectedItemTest" ).click( function () {
26 var content = $( ":jqmData(role='tokentextarea')" ).tokentextarea( "select" );
27 window.alert( "Select content : " + content );
30 $( "#MBTselectItemTest" ).click( function () {
31 $( ":jqmData(role='tokentextarea')" ).tokentextarea( "select", 0 );
34 $( "#MBTlengthTest" ).click( function () {
35 var length = $( ":jqmData(role='tokentextarea')" ).tokentextarea( "length" );
36 window.alert( "length : " + length );
39 $( "#MBTfocusInTest" ).click( function () {
40 $( ":jqmData(role='tokentextarea')" ).tokentextarea( "focusIn", 0 );
43 $( "#MBTfocusOutTest" ).click( function () {
44 $( ":jqmData(role='tokentextarea')" ).tokentextarea( "focusOut", 0 );
47 $( "#MBTdestroyTest" ).click( function () {
48 $( ":jqmData(role='tokentextarea')" ).tokentextarea( "destroy" );
51 $( "#contentList a" ).click( function () {
52 var arg = $( this ).text();
53 $( ":jqmData(role='tokentextarea')" ).tokentextarea( "add", arg );
56 $( "#cancelBtn" ).click( function () {
57 $.mobile.changePage( "#tokentextarea", {
58 transition: "reverse slide",
64 } ( jQuery, window ) );