1 ( function ( $, window ) {
2 $( document ).one( "pagecreate", "#tokentextarea", function () {
3 $( "#MBTaddItemTest" ).on( "click", function () {
4 $( ":jqmData(role='tokentextarea')" ).tokentextarea( "add", "additem" );
7 $( "#MBTremoveItemTest" ).on( "click", function () {
8 $( ":jqmData(role='tokentextarea')" ).tokentextarea( "remove", 0 );
11 $( "#MBTinputTextTest" ).on( "click", function () {
12 $( ":jqmData(role='tokentextarea')" ).tokentextarea( "inputText", "Hello~~~" );
15 $( "#MBTgetInputTextTest" ).on( "click", function () {
16 var input = $( ":jqmData(role='tokentextarea')" ).tokentextarea( "inputText" );
17 window.alert( "input String : " + input );
20 $( "#MBTremoveAllItemTest" ).on( "click", function () {
21 $( ":jqmData(role='tokentextarea')" ).tokentextarea( "remove" );
22 $( ":jqmData(role='tokentextarea')" ).parents( ".ui-scrollview-view" ).parent().scrollview( "scrollTo", 0, 0 );
25 $( "#MBTgetSelectedItemTest" ).on( "click", function () {
26 var content = $( ":jqmData(role='tokentextarea')" ).tokentextarea( "select" );
27 window.alert( "Select content : " + content );
30 $( "#MBTselectItemTest" ).on( "click", function () {
31 $( ":jqmData(role='tokentextarea')" ).tokentextarea( "select", 0 );
34 $( "#MBTlengthTest" ).on( "click", function () {
35 var length = $( ":jqmData(role='tokentextarea')" ).tokentextarea( "length" );
36 window.alert( "length : " + length );
39 $( "#MBTfocusInTest" ).on( "click", function () {
40 $( ":jqmData(role='tokentextarea')" ).tokentextarea( "focusIn", 0 );
41 $( ":jqmData(role='tokentextarea')" ).parents( ".ui-scrollview-view" ).parent().scrollview( "scrollTo", 0, 0 );
44 $( "#MBTfocusOutTest" ).on( "click", function () {
45 $( ":jqmData(role='tokentextarea')" ).tokentextarea( "focusOut", 0 );
46 $( ":jqmData(role='tokentextarea')" ).parents( ".ui-scrollview-view" ).parent().scrollview( "scrollTo", 0, 0 );
49 $( "#MBTdestroyTest" ).on( "click", function () {
50 $( ":jqmData(role='tokentextarea')" ).tokentextarea( "destroy" );
54 $( document ).one( "pagecreate", "#addressbook", function () {
56 self.itemSelected = false;
58 $( "#addressbook" ).on( "mousedown", function () {
59 self.itemSelected = false;
62 $( "#addressbook" ).on( "mouseup", function () {
63 self.itemSelected = true;
66 $( "#contentList a" ).on( "click", function () {
67 if ( self.itemSelected ) {
68 var arg = $( this ).text();
69 $( ":jqmData(role='tokentextarea')" ).tokentextarea( "add", arg );
74 } ( jQuery, window ) );