X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2F05_util%2F01_XNinjaIframe.js;h=3bd2e4c5a4bb03b374a5b673440f7df4f598f41d;hb=5633b955bc9fcd998e8ecf7e8e30c311aafc588c;hp=702706dfde0c0c342219165108b38a0c4701c3c1;hpb=43b7875a2aadc07439db67724e60644f129bcc90;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/05_util/01_XNinjaIframe.js b/0.6.x/js/05_util/01_XNinjaIframe.js index 702706d..3bd2e4c 100644 --- a/0.6.x/js/05_util/01_XNinjaIframe.js +++ b/0.6.x/js/05_util/01_XNinjaIframe.js @@ -7,21 +7,40 @@ * * @alias X.Util.NinjaIframe * @class NinjaIframe 隠し iframe 機能を提供します。 - * @constructs NinjaIframe * @extends {Node} */ var X_NinjaIframe = X[ 'Util' ][ 'NinjaIframe' ] = Node[ 'inherits' ]( 'NinjaIframe', + + /** @lends NinjaIframe.prototype */ { - autoRefresh : 0, + /* autoRefresh : 0, */ + /** + * iframe の contentWindow + * @private + * @type {window} */ _iwin : null, + /** + * iframe に write する html 文字時列 + * @type {string} */ _contentHTML : '', + + /** + * iframe の name + * @private + * @type {string} */ _name : '', + + /** + * iframe への html 文字列の write が完了した + * @private + * @type {string} */ _ready : false, 'Constructor' : function( html ){ + // TODO src も設定可能に this._name = 'hidden-iframe-' + X_Timer_now(); // https://github.com/polygonplanet/Pot.js/blob/master/src/Worker.js @@ -59,6 +78,11 @@ var X_NinjaIframe = X[ 'Util' ][ 'NinjaIframe' ] = Node[ 'inherits' ]( X_ViewPort[ 'listenOnce' ]( X_EVENT_AFTER_UPDATE, this, X_Util_NinjaIframe_handleEvent ); }, + /** + * iframe 内をリフレッシュ、または内容を上書きする + * @param {string=} opt_contentHTML html文字列 + * @return {NinjaIframe} チェーンメソッド + */ 'refresh' : function( opt_contentHTML ){ var raw = this[ '_rawObject' ], idoc; @@ -82,7 +106,6 @@ var X_NinjaIframe = X[ 'Util' ][ 'NinjaIframe' ] = Node[ 'inherits' ]( if( !( X_UA[ 'IE' ] < 9 ) ){ X_Util_NinjaIframe_writeToIframe( this ); - //this._ready = true; }; return this; @@ -106,7 +129,6 @@ function X_Util_NinjaIframe_handleEvent( e ){ if( !( X_UA[ 'IE' ] < 9 ) ){ X_Util_NinjaIframe_writeToIframe( this ); - //this._ready = true; return; }; //break; これあると IE8 で駄目! @@ -116,7 +138,6 @@ function X_Util_NinjaIframe_handleEvent( e ){ // ie9- if( !this._ready ){ X_Util_NinjaIframe_writeToIframe( this ); - //this._ready = true; break; }; // onload @@ -143,7 +164,7 @@ function X_Util_NinjaIframe_writeToIframe( that ){ idoc = raw.contentDocument || that._iwin.document, html = that._contentHTML; - that._ready = true; // これを削除すると ie6,7,8 で Stack overflow at line : 0 意味不明 + that._ready = true; // これを削除すると ie6,7,8 で Stack overflow at line : 0 意味不明 'readystatechange' が繰り返し起こりループする?? delete that._contentHTML; idoc.open();