X-Git-Url: http://git.osdn.net/view?p=pettanr%2Fpettanr.git;a=blobdiff_plain;f=public%2Fassets%2Fcommon.js;fp=public%2Fassets%2Fcommon.js;h=5f475e0e08bd877fbbc0e1d63c0ecc2ca148d32e;hp=a604d02d4dd870b4ac38e086121339bfa8e1062c;hb=cd9653c66c4883c5e9a483fc47f0ddf77ed837be;hpb=1e409caa9b7da216bcfd202bb82e3463b3304983 diff --git a/public/assets/common.js b/public/assets/common.js index a604d02d..5f475e0e 100644 --- a/public/assets/common.js +++ b/public/assets/common.js @@ -1,6 +1,6 @@ /* * pettanR common.js - * version 0.4.34 + * version 0.4.35 * * author: itozyun */ @@ -108,7 +108,7 @@ var pettanr = ( function(){ IS_DEBUG = Type.isBoolean( URL_PARAMS.debug ) ? URL_PARAMS.debug : IS_LOCAL === true, jqWindow , jqDocument , jqBody; return { - version: '0.4.33', + version: '0.4.35', init: function(){ jqWindow = $( window ); jqDocument = $( document ); @@ -965,11 +965,11 @@ pettanr.view = ( function(){ pettanr.overlay = ( function(){ var SHADOW_OPACITY = 0.5, - ELM_CONTAINER = document.getElementById( 'overlay-container' ), - jqConteiner, jqShadow, jqCloseButton,// jqBody, + ELM_CONTAINER = document.getElementById( 'overlay-container' ), currentOverlay = null, - bootParams = null, - visible = false, + bootParams = null, + visible = false, + jqConteiner, jqShadow, jqCloseButton,// jqBody, windowW, windowH; function asyncResize(){ @@ -978,7 +978,7 @@ pettanr.overlay = ( function(){ function onCloseClick( e){ pettanr.overlay.hide(); e.preventDefault(); - return false; + return false; } function onFadeInComplete(){ @@ -992,8 +992,8 @@ pettanr.overlay = ( function(){ return { init: function(){ //jqBody = pettanr.jqBody(); - jqConteiner = $( '#overlay-container'); - jqShadow = $( '#overlay-shadow'); + jqConteiner = $( '#overlay-container'); + jqShadow = $( '#overlay-shadow'); jqCloseButton = $( '#overlay-close-button').click( onCloseClick ); pettanr.key.addKeyDownEvent( pettanr.view.OVERLAY, 27, false, false, pettanr.overlay.hide ); // 27.esc @@ -1005,6 +1005,7 @@ pettanr.overlay = ( function(){ if( pettanr.view.isApplicationInstance( _overlay ) === false ) return; document.body.style.overflow = 'hidden'; + document.body.appendChild( ELM_CONTAINER ); // ie6-8 で必要、なんで、、、? this.visible = visible = true; this.currentID = _overlay.ID; @@ -2289,6 +2290,9 @@ pettanr.bind = ( function(){ var ret = document.createElement( 'div'); ret.style.cssText = 'width: auto;height: 0;padding: 0;margin: 0;display: block;visibility: hidden;float: none;position: static;'; return ret; + })(), + ELM_TITLE_ORIGN = ( function(){ + })(); /* @@ -2315,7 +2319,7 @@ pettanr.bind = ( function(){ var size = getInnerSize(); if (_size.w !== size.w || _size.h !== size.h) { // resized _size = size; // update - onResizeFunction( _size); + onResizeFunction( _size ); } setTimeout( unlock, 0); // delay unlock } @@ -2328,151 +2332,175 @@ pettanr.bind = ( function(){ } - var ElementBuilder = ( function(){ - var ELM_TITLE_ORIGN = ( function(){ - - })(), - ELM_TEXT_ORIGN = ( function(){ - var _table = document.createElement( 'table'), - _tr = document.createElement( 'tr'); - _table.appendChild( _tr); - _tr.appendChild( document.createElement( 'td')); - _table.cellspacing = '0'; - return _table; - })(); + var ElementBuilderClass = function( elmTarget, noClassnameMode ){ + var RIMG_ARRAY = [], + BALLOON_ARRAY = []; function buildComicElement(){ } - function buildPanelElement( elmTarget, json, noClassnameMode){ - var _elmPanel = document.createElement( 'div'), + function buildPanelElement( json, zoom ){ + var _elmPanel = document.createElement( 'div' ), _style = { - "border-width": typeof json.border === 'number' ? json.border + 'px' : 0, + 'border-width': typeof json.border === 'number' ? json.border + 'px' : 0, width: json.width + 'px', height: json.height + 'px' }, _cssText = [], _comicElements = json.panel_elements || [], - _comicElement, _elmImgWrap, _rImg, _rPic, _balloon, _elmBalloonWrap, _elmText; - if( noClassnameMode === true){ + _comicElement, _elmImg, _rImg, _rPic, + _balloon, _elmBalloonWrap, _elmText, _text, _speachesAttributes, _key; + if( noClassnameMode === true ){ } else { _elmPanel.className = NAMESPACE_CLASSNAME + 'panel'; } - for( var _key in _style){ - _cssText.push( _key + ':' + _style[ _key]); + for( var _key in _style ){ + _cssText.push( _key + ':' + _style[ _key ] ); } _elmPanel.style.cssText = _cssText.join( ';'); - elmTarget.appendChild( _elmPanel); + elmTarget.appendChild( _elmPanel ); - for( var i=0, l=_comicElements.length; i 0 ){ + RIMG_ARRAY.shift().destroy(); + } + while( BALLOON_ARRAY.length > 0 ){ + BALLOON_ARRAY.shift().destroy(); + } + pettanr.util.removeAllChildren( elmTarget ); + } + + this.build = function( json, zoom ){ + clean(); + + // json is Comic ? Panel ? + var panels = json.panels; + if( Type.isArray( panels ) === true ){ + // comic + for( var i=0, l=panels.length; i