• R/O
  • HTTP
  • SSH
  • HTTPS

clientJs: コミット

クライアント側 js 開発用


コミットメタ情報

リビジョン103125546e3e8e3c480b6673e0a12ef818981d48 (tree)
日時2016-02-10 16:54:46
作者itozyun <itozyun@user...>
コミッターitozyun

ログメッセージ

Version 0.6.210, add Android browser PC mode detection, forget to commit X.UIPages.

変更サマリ

差分

--- /dev/null
+++ b/0.6.x/js/22_uipage/01_Page.js
@@ -0,0 +1,125 @@
1+var XUI_PAGES = {},
2+ XUI_Page_prev = [],
3+ XUI_Page_current,
4+ XUI_Page_new,
5+ XUI_Page_isBack,
6+ XUI_Page_direction;
7+
8+X.UI.Page = X_EventDispatcher[ 'inherits' ](
9+ 'Page',
10+ X_Class.NONE,
11+ {
12+ 'Constructor' : function( title, uid ){
13+ var args = X_Array_copy( arguments );
14+
15+ if( !XUI_PAGES[ uid ] ){
16+ args.splice( 0, 2 );
17+ XUI_PAGES[ uid ] = {
18+ page : this,
19+ title : title,
20+ uid : uid,
21+ uinodes : args
22+ };
23+ };
24+ },
25+
26+ 'show' : function( direction ){
27+ var size;
28+
29+ if( XUI_Page_current !== this ){
30+ XUI_Page_new = this;
31+ XUI_Page_direction = direction;
32+
33+ if( XUI_Page_current ){
34+ if( XUI_Page_current[ 'dispatch' ]( XUI_Event.PAGE_HIDE_BEFORE ) & X_CALLBACK_PREVENT_DEFAULT ){
35+ return false;
36+ };
37+ XUI_Page_current[ 'dispatch' ]( XUI_Event.PAGE_HIDE );
38+
39+ console.log( 'スライドアウト開始' );
40+
41+ // slideOut
42+ XUI_rootData.xnode
43+ [ 'animate' ]( {
44+ 'from' : { x : 0 },
45+ 'to' : { x : X[ 'ViewPort' ][ 'getSize' ]()[ 0 ] * -.05 * direction, opacity : 0 },
46+ 'duration' : 333,
47+ 'easing' : 'circular',
48+ 'lazyRelease' : 0 })
49+ [ 'listenOnce' ]( X_EVENT_ANIME_END, XUI_Page_onSlideOut );
50+ } else {
51+ XUI_Page_onSlideOut();
52+ };
53+ };
54+ }
55+ }
56+);
57+
58+X.UI.Page[ 'move' ] = XUI_Page_move;
59+X.UI.Page[ 'back' ] = XUI_Page_back;
60+
61+function XUI_Page_move( uid ){
62+ for( var k in XUI_PAGES ){
63+ if( XUI_PAGES[ k ].uid === uid ){
64+ return XUI_PAGES[ k ].page[ 'show' ]( 1 );
65+ };
66+ };
67+};
68+
69+function XUI_Page_back(){
70+ var last = XUI_Page_prev[ XUI_Page_prev.length - 1 ];
71+
72+ for( var k in XUI_PAGES ){
73+ if( XUI_PAGES[ k ].page === last ){
74+ XUI_Page_isBack = true;
75+ XUI_Page_prev.pop();
76+ return XUI_PAGES[ k ].page[ 'show' ]( -1 );
77+ };
78+ };
79+};
80+
81+function XUI_Page_onSlideOut(){
82+ var k, uinodes;
83+
84+ if( XUI_Page_current ){
85+ XUI_rootData.removeAt( 0, 9999 );
86+ if( !XUI_Page_isBack ){
87+ XUI_Page_prev.push( XUI_Page_current );
88+ };
89+ };
90+
91+ XUI_Page_isBack = false;
92+ XUI_Page_current = XUI_Page_new;
93+
94+ for( k in XUI_PAGES ){
95+ if( XUI_PAGES[ k ].page === XUI_Page_new ){
96+ uinodes = XUI_PAGES[ k ].uinodes;
97+ };
98+ };
99+
100+
101+
102+ if( !XUI_rootData ){
103+ X.UI.Root.apply( 1, uinodes ).attr( { opacity : 0 } );
104+ } else {
105+ XUI_rootData.User.add.apply( XUI_rootData.User, uinodes );
106+ };
107+
108+ XUI_rootData[ 'listenOnce' ]( XUI_Event.LAYOUT_COMPLETE, XUI_Page_startSlideIn );
109+ //if( XUI_rootData.phase < 4 ){
110+
111+ //} else {
112+ // XUI_Page_startSlideIn();
113+ //};
114+ console.log( 'スライドアウト完了' );
115+};
116+
117+function XUI_Page_startSlideIn(){
118+ console.log( 'スライドイン開始' );
119+ XUI_rootData.xnode[ 'animate' ]( {
120+ 'from' : { x : X[ 'ViewPort' ][ 'getSize' ]()[ 0 ] * .05 * XUI_Page_direction, opacity : 0 },
121+ 'to' : { x : 0, opacity : 1 },
122+ 'duration' : 333,
123+ 'easing' : 'circular',
124+ 'lazyRelease' : 0 });
125+};
旧リポジトリブラウザで表示