• R/O
  • HTTP
  • SSH
  • HTTPS

clientJs: コミット

クライアント側 js 開発用


コミットメタ情報

リビジョン04ac203dfb25cc7e92db1f7f9f77122841f7cb1a (tree)
日時2016-03-06 00:49:21
作者itozyun <itozyun@user...>
コミッターitozyun

ログメッセージ

Version 0.6.214, bug fixes X.KB.

変更サマリ

差分

--- a/0.6.x/js/01_core/01_X.js
+++ b/0.6.x/js/01_core/01_X.js
@@ -64,6 +64,7 @@ X[ 'emptyFunction' ] = X_emptyFunction;
6464 * このscriptはheadタグの中にあるか?
6565 * @type {boolean} */
6666 // TODO defer の場合もあるので、document.readyState を見る
67+// TODO body の有無を見ればOKではないか?
6768 // MacIE で false
6869 X[ 'inHead' ] = (function( s ){
6970 if( !s ) return false;
--- a/0.6.x/js/01_core/02_XUA.js
+++ b/0.6.x/js/01_core/02_XUA.js
@@ -10,7 +10,7 @@
1010 * @type {object}
1111 */
1212 var X_UA = X[ 'UA' ] = {},
13- X_UA_classNameForHTML = 'js-enabled ';
13+ X_UA_classNameForHTML = '';
1414
1515 (function(){
1616 var dua = navigator.userAgent,
@@ -807,9 +807,10 @@ var X_UA = X[ 'UA' ] = {},
807807 for( k in X_UA ){
808808 v = X_UA[ k ];
809809 if( v ){
810- X_UA_classNameForHTML += k + ' ';
811810 if( v !== true ){
812811 X_UA_classNameForHTML += k + v + ' ';
812+ } else {
813+ X_UA_classNameForHTML += k + ' ';
813814 };
814815 };
815816 };
--- a/0.6.x/js/01_core/21_XViewPort.js
+++ b/0.6.x/js/01_core/21_XViewPort.js
@@ -438,7 +438,7 @@ X[ 'ViewPort' ] = {
438438 * @alias X.Doc.html
439439 * @type {Node}
440440 */
441- X[ 'Doc' ][ 'html' ] = html = X_Node_html = X_elmHtml && Node( X_elmHtml )[ 'removeClass' ]( 'js-disabled' )[ 'addClass' ]( X_UA_classNameForHTML );
441+ X[ 'Doc' ][ 'html' ] = html = X_Node_html = X_elmHtml && Node( X_elmHtml )[ 'removeClass' ]( 'js-disabled' )[ 'addClass' ]( X_UA_classNameForHTML.split( '.' ).join( '_' ) );
442442 html[ '_flags' ] |= X_NodeFlags_IN_TREE;
443443
444444 /**
--- a/0.6.x/js/02_dom/03_XDomEvent.js
+++ b/0.6.x/js/02_dom/03_XDomEvent.js
@@ -42,7 +42,7 @@ if( !X_UA[ 'IE' ] || 9 <= X_UA[ 'IE' ] ){
4242 altKey, ctrlKey, metaKey, shiftKey, target, xtarget, offset, related, force,
4343 elm, i, n, time, touch, ev;
4444
45- //this._event = e;
45+ this._e = e;
4646 this[ 'type' ] = type = X_Event_RenameTo[ originalType ] || originalType;
4747
4848 switch( type ){
--- a/0.6.x/js/02_dom/10_XNodeAnime.js
+++ b/0.6.x/js/02_dom/10_XNodeAnime.js
@@ -12,7 +12,8 @@ var X_NodeAnime_QUEUE = [],
1212 /* Opera mobile で translateZ(0) が有効だと XY が 0 0 になる */
1313 /* GPUレイヤーにいる間に要素のコンテンツを変更をすると transitionend が動かなくなるっぽい Mac safari と firefox */
1414 X_NodeAnime_translateZ = X_Node_CSS_VENDER_PREFIX[ 'perspective' ] &&
15- !X_UA[ 'OperaMobile' ] && !X_UA[ 'OperaTablet' ] ? ' translateZ(0)' : '',
15+ !X_UA[ 'OperaMobile' ] && !X_UA[ 'OperaTablet' ] &&
16+ !( X_UA[ 'IE' ] === 11 ) && !( X_UA[ 'IEHost' ] === 11 ) ? ' translateZ(0)' : '',
1617
1718 /*
1819 * phase:
@@ -521,7 +522,7 @@ function X_NodeAnime_updatePosition( xnode, obj, ratio, useGPU ){
521522
522523 //console.log( 'updatePosition x:' + x + ' gpu:' + !!useGPU );
523524 if( obj.transform ){
524- if( x === x || y === y ) str += ' translate(' + ( x | 0 ) + 'px,' + ( y | 0 ) + 'px)';
525+ if( ( x === x || y === y ) && ( x !== 0 && y !== 0 ) ) str += ' translate(' + ( x | 0 ) + 'px,' + ( y | 0 ) + 'px)';
525526 if( rotate < 0 || 0 < rotate ) str += ' rotate(' + rotate + 'deg)'; // opera は rad?
526527 if( skewX < 0 || 0 < skewX ) str += ' skewX(' + skewX + 'deg)';
527528 if( skewY < 0 || 0 < skewY ) str += ' skewY(' + skewY + 'deg)';
--- a/0.6.x/js/06_net/04_XNetImage.js
+++ b/0.6.x/js/06_net/04_XNetImage.js
@@ -11,7 +11,7 @@ var X_ImgLoader_image = window[ 'Image' ] && new Image(),
1111 X_ImgLoader_isElement = !( X_UA[ 'IE' ] < 9 ) && X_Type_isHTMLElement( X_ImgLoader_image ),
1212 // http://uupaa.hatenablog.com/entry/2013/12/17/171809
1313 // お手軽に画像の読み込みをハンドリングする、今どきな方法
14- X_ImgLoader_0forError = !X_UA[ 'IE' ] || X_UA[ 'IE' ] === 11;
14+ X_ImgLoader_0forError = !X_UA[ 'IE' ] || X_UA[ 'IE' ] === 11 || X_UA[ 'IEHost' ] === 11;
1515
1616 /*
1717 * TODO
@@ -64,15 +64,17 @@ X_TEMP.X_ImgLoader_params = {
6464 },
6565
6666 reset : function(){
67- console.log( 'X.Net.Image:reset ' + this.abspath + ' timerID:' + this.timerID );
67+ //console.log( '/ X.Net.Image:reset ' + this.abspath + ' timerID:' + this.timerID );
6868
6969 this.timerID && X_Timer_remove( this.timerID );
7070 this.timerID = 0;
7171
72+ this.finish = false;
73+ this.abspath = '';
7274 //X_ImgLoader_isElement ? this[ '_rawObject' ].removeAttribute( 'src' ) : ( this[ '_rawObject' ].src = '' );
7375 this[ '_rawObject' ].src = '';
74- this.finish = false;
75- this.abspath = '';
76+
77+ //console.log( '\ X.Net.Image:reset ----------- *' );
7678 }
7779 };
7880
@@ -83,14 +85,16 @@ function X_ImgLoader_detect(){
8385
8486 if( raw && raw.complete ){
8587 this.finish = true;
86- console.log( 'X.Net.Image:detect ' + raw.width );
88+ //console.log( 'X.Net.Image:detect ' + raw.width );
8789 if( raw.width ) return;
8890 X_Timer_remove( this.timerID );
91+ //console.log( '* X.Net.Image:ERROR @detect(1) ' + this.abspath );
8992 this.timerID = this[ 'asyncDispatch' ]( X_EVENT_ERROR );
9093 } else
9194 if( this.timeout < ( this.tick += this.delay ) ){
9295 this.finish = true;
9396 X_Timer_remove( this.timerID );
97+ //console.log( '* X.Net.Image:ERROR @detect(2) ' + this.abspath );
9498 this.timerID = this[ 'asyncDispatch' ]( { type : X_EVENT_ERROR, 'timeout' : true } );
9599 };
96100 };
@@ -100,17 +104,18 @@ function X_ImgLoader_handleEvent( e ){
100104
101105 // IE11 reset() 時にここに入ってくる...
102106 if( !this.abspath ) return;
103- console.log( 'X.Net.Image:handleEvent ' + e.type );
107+ //console.log( 'X.Net.Image:handleEvent ' + e.type );
104108
105109 switch( e.type ){
106110 case 'error' :
107- //case 'abort' : // TODO ??
108111 // ie11(10,9 開発モード)で mineType 不正の場合、画像取得に成功してもエラーイベントが起こるのを無視する。
109112 if( X_ImgLoader_0forError && raw.width ) return;
110113 if( this.finish ) return;
111114 this.finish = true;
112115 this.timerID && X_Timer_remove( this.timerID );
113- this.timerID = this[ 'asyncDispatch' ]( /*e.type === 'error' ?*/ X_EVENT_ERROR /*: X_EVENT_CANCELED*/ );
116+ //console.log( '* X.Net.Image:ERROR @handle ' + this.abspath + X.Timer.now() );
117+ //console.dir( raw );
118+ this.timerID = this[ 'asyncDispatch' ]( this.timeout, X_EVENT_ERROR );
114119 break;
115120
116121 case 'load' :
@@ -123,6 +128,9 @@ function X_ImgLoader_handleEvent( e ){
123128 return;
124129 };
125130
131+ //console.log( '* X.Net.Image:LOAD @handle ' + this.abspath + X.Timer.now() );
132+ //console.dir( raw );
133+
126134 size = X_Util_Image_getActualDimension( !X_ImgLoader_isElement ? this.abspath : this );
127135 this.timerID = this[ 'asyncDispatch' ]( {
128136 'type' : X_EVENT_SUCCESS,
--- a/0.6.x/js/11_hid/01_KB.js
+++ b/0.6.x/js/11_hid/01_KB.js
@@ -92,7 +92,7 @@ var X_KB_SPECIALS = eval( // IE5- 対策
9292
9393 case 'keypress' :
9494 // keydown 側で発火しているものは再び発火しない
95- console.log( 'keypress : chrCode:' + chrCode + ' down:' + X_KB_DOWN_KEYS[ chrCode ] + ( X_KB_CANCELED[ chrCode ] ? ' Cancel!' : '' ) );
95+
9696 if( X_KB_DOWN_KEYS[ chrCode ] ){
9797 return X_KB_CANCELED[ chrCode ] ? X_CALLBACK_PREVENT_DEFAULT : cb;
9898 } else
@@ -114,7 +114,9 @@ var X_KB_SPECIALS = eval( // IE5- 対策
114114 metaKey : !!X_KB_DOWN_KEYS[ 224 ]
115115 } );
116116
117- X_KB_lastIs10Key = true;
117+ X_KB_lastIs10Key = false;
118+
119+ console.log( X_KB_lastKeyCode + 'keypress : chrCode:' + chrCode + ' down:' + X_KB_DOWN_KEYS[ chrCode ] + ( X_KB_CANCELED[ chrCode ] ? ' Cancel!' : '' ) );
118120 };
119121 return cb;
120122
@@ -141,14 +143,21 @@ var X_KB_SPECIALS = eval( // IE5- 対策
141143 if( X_KB_DOWN_KEYS[ keyCode ] ) delete X_KB_DOWN_KEYS[ keyCode ];
142144 if( X_KB_CANCELED[ keyCode ] ) delete X_KB_CANCELED[ keyCode ];
143145
144- chrCode = 0;
146+
145147 if( !special ){
146148 // keyCode から charCode を復帰する
147149 chrCode = X_KB_TRANSFOEM[ keyCode ];
148150 if( !chrCode ) return cb;
149151 delete X_KB_TRANSFOEM[ keyCode ];
152+ } else
153+ if( 42 <= special ){
154+ chrCode = special; // ie8で必要... Firefox でもテンキーの+-*/ で必要...
155+ } else {
156+ chrCode = 0;
150157 };
151-
158+
159+ console.log( keyCode + ' keyup ' + chrCode );
160+
152161 cb |= this[ 'dispatch' ]( {
153162 type : 'keyup',
154163 keyCode : keyCode,
@@ -159,7 +168,7 @@ var X_KB_SPECIALS = eval( // IE5- 対策
159168 altKey : X_KB_DOWN_KEYS[ 18 ],
160169 metaKey : X_KB_DOWN_KEYS[ 224 ]
161170 } );
162-
171+
163172 return cb;
164173
165174 case X_EVENT_VIEW_ACTIVATE :
旧リポジトリブラウザで表示