Comparing version 0.3.6 to 0.3.7
{ | ||
"name": "mofron", | ||
"version": "0.3.6", | ||
"version": "0.3.7", | ||
"description": "front-end framework for javascript", | ||
@@ -5,0 +5,0 @@ "main": "./dist/mofron.js", |
@@ -255,4 +255,4 @@ /** | ||
return this.getStyleTgt().style(_key); | ||
} else if ( (null !== _key) && | ||
(null !== _val) ) { | ||
} else if ( (null !== _key) && | ||
(undefined !== _val) ) { | ||
/* setter */ | ||
@@ -365,2 +365,17 @@ this.getStyleTgt().style(_key, _val); | ||
setEffect (eff, flg) { | ||
try { | ||
var _eff = (undefined === eff) ? null : eff; | ||
var _flg = (undefined === flg) ? true : flg; | ||
if (null === _eff) { | ||
throw new Error('invalid parameter'); | ||
} | ||
_eff.setTarget(this); | ||
_eff.effect(_flg); | ||
} catch (e) { | ||
console.error(e.stack); | ||
throw e; | ||
} | ||
} | ||
/** | ||
@@ -503,5 +518,5 @@ * theme setter / getter | ||
if (null != _eff) { | ||
_eff.setTarget(this); | ||
_eff.speed(0.5); | ||
_eff.setVisible(true); | ||
_eff.effect(_flg); | ||
this.setEffect(_eff, _flg); | ||
} else { | ||
@@ -508,0 +523,0 @@ if (true === _flg) { |
@@ -7,12 +7,9 @@ /** | ||
constructor (tgt,spd) { | ||
constructor (prm) { | ||
try { | ||
this.target = null; | ||
if ( (undefined !== tgt) && (null !== tgt) ) { | ||
this.setTarget(tgt); | ||
} | ||
this.speed = null; | ||
this.setSpeed((spd === undefined) ? 0.5 : spd); | ||
this.v_flg = false; | ||
this.exec = false; | ||
this.param = (undefined === prm) ? null : prm; | ||
this.target = null; | ||
this.m_speed = 0; | ||
this.v_flg = false; | ||
this.exec = false; | ||
this.callback = new Array(null,null); | ||
@@ -52,16 +49,16 @@ } catch (e) { | ||
var _flg = (flg === undefined) ? true : flg; | ||
if (false === this.target.isRendered()) { | ||
throw new Error('target is not ready'); | ||
} | ||
if (0 === this.speed) { | ||
if (0 === this.speed()) { | ||
this.effect_func(_flg,this.target.vdom()); | ||
} else { | ||
if (false === this.target.isRendered()) { | ||
throw new Error('target is not ready'); | ||
} | ||
if (false === this.exec) { | ||
this.exec = true; | ||
this.target.vdom().style('-webkit-transition', ((1000 * this.speed) - 200) + 'ms all linear 0s'); | ||
this.target.vdom().style('-moz-transition' , 'all ' + ((1000 * this.speed) - 200) + 'ms'); | ||
this.target.vdom().style('-ms-transition' , 'all ' + ((1000 * this.speed) - 200) + 'ms'); | ||
this.target.vdom().style('-o-transition' , 'all ' + ((1000 * this.speed) - 200) + 'ms'); | ||
this.target.vdom().style('transtion' , ((1000 * this.speed) - 200) + 'ms all linear 0s'); | ||
this.target.vdom().style('-webkit-transition', ((1000 * this.speed()) - 200) + 'ms all linear 0s'); | ||
this.target.vdom().style('-moz-transition' , 'all ' + ((1000 * this.speed()) - 200) + 'ms'); | ||
this.target.vdom().style('-ms-transition' , 'all ' + ((1000 * this.speed()) - 200) + 'ms'); | ||
this.target.vdom().style('-o-transition' , 'all ' + ((1000 * this.speed()) - 200) + 'ms'); | ||
this.target.vdom().style('transtion' , ((1000 * this.speed()) - 200) + 'ms all linear 0s'); | ||
} | ||
@@ -80,3 +77,3 @@ | ||
this.callback[0], | ||
(1000 * this.speed), | ||
(1000 * this.speed()), | ||
this.callback[1] | ||
@@ -91,3 +88,3 @@ ); | ||
effect_func (flg, vd) { | ||
effectConts (flg, vd) { | ||
try { | ||
@@ -101,4 +98,7 @@ | ||
setSpeed (spd) { | ||
speed (spd) { | ||
try { | ||
if (undefined === spd) { | ||
return this.m_speed; | ||
} | ||
if ('number' != (typeof spd)) { | ||
@@ -108,5 +108,5 @@ throw new Error('invalid parameter'); | ||
if (spd < 0.5) { | ||
this.speed = 0; | ||
this.m_speed = 0; | ||
} else { | ||
this.speed = spd; | ||
this.m_speed = spd; | ||
} | ||
@@ -113,0 +113,0 @@ } catch (e) { |
@@ -86,3 +86,3 @@ /** | ||
*/ | ||
eventFunc () { | ||
eventConts () { | ||
try { | ||
@@ -89,0 +89,0 @@ console.warn('not implement'); |
@@ -11,3 +11,2 @@ /** | ||
this.exec_cnt = 0; | ||
this.m_name = 'Layout'; | ||
} catch (e) { | ||
@@ -50,3 +49,3 @@ console.error(e.stack); | ||
layoutFunc (idx, tgt) { | ||
layoutConts (idx, tgt) { | ||
try { | ||
@@ -59,15 +58,2 @@ console.warn('layout is not implements'); | ||
} | ||
name (nm) { | ||
try { | ||
var _nm = (undefined === nm) ? null : nm; | ||
if (null === _nm) { | ||
return this.m_name; | ||
} | ||
this.m_name = _nm; | ||
} catch (e) { | ||
console.error(e.stack); | ||
throw e; | ||
} | ||
} | ||
} |
@@ -19,25 +19,2 @@ /** | ||
init (disp) { | ||
try { | ||
var _disp = (disp === undefined) ? true : disp; | ||
this.initTemplate(this.param); | ||
this.base.init(false); | ||
if (true === _disp) { | ||
this.setVisible(true); | ||
} | ||
} catch (e) { | ||
console.error(e.stack); | ||
throw e; | ||
} | ||
} | ||
initTemplate (prm) { | ||
try { | ||
} catch (e) { | ||
console.error(e.stack); | ||
throw e; | ||
} | ||
} | ||
title (val) { | ||
@@ -72,6 +49,5 @@ try { | ||
setVisible (flg, eff) { | ||
initTmplConts (prm) { | ||
try { | ||
var _eff = (eff === undefined) ? new mofron.effect.Fade() : eff; | ||
this.base.setVisible (true, _eff); | ||
console.log('not implements'); | ||
} catch (e) { | ||
@@ -82,2 +58,18 @@ console.error(e.stack); | ||
} | ||
visible (flg, eff) { | ||
try { | ||
if ((undefined === flg) && (undefined === eff)) { | ||
return this.base.visible(); | ||
} | ||
var _eff = (eff === undefined) ? null : eff; | ||
if (false === this.base.isRendered()) { | ||
this.initTmplConts (this.param); | ||
} | ||
this.base.visible(true, _eff); | ||
} catch (e) { | ||
console.error(e.stack); | ||
throw e; | ||
} | ||
} | ||
} |
@@ -48,2 +48,5 @@ /** | ||
for (var idx in thm_cnt[cnt_key]) { | ||
if (null === thm_cnt[cnt_key][parseInt(idx)]) { | ||
continue; | ||
} | ||
this.set(cnt_key, thm_cnt[cnt_key][idx], parseInt(idx)); | ||
@@ -210,9 +213,15 @@ } | ||
if (_idx === this.conts[_key].length) { | ||
this.conts[_key].push(_val); | ||
} else if (_idx < this.conts[_key].length) { | ||
this.conts[_key][_idx] = val; | ||
} else { | ||
throw new Error('invalid parameter'); | ||
var loop = 0; | ||
for (;loop < 10; loop++) { | ||
if (_idx === this.conts[_key].length) { | ||
this.conts[_key].push(_val); | ||
return; | ||
} else if (_idx < this.conts[_key].length) { | ||
this.conts[_key][_idx] = val; | ||
return; | ||
} else { | ||
this.conts[_key].push(null); | ||
} | ||
} | ||
throw new Error('invalid parameter'); | ||
} catch (e) { | ||
@@ -219,0 +228,0 @@ console.error(e.stack); |
@@ -21,8 +21,26 @@ /** | ||
try { | ||
var _r = (r === undefined) ? null : r; | ||
var _g = (g === undefined) ? null : g; | ||
var _b = (b === undefined) ? null : b; | ||
var _a = (a === undefined) ? 1 : a; | ||
if ( (null === _r) && (null === _g) && (null === _b) ) { | ||
} else if ( (null !== _r) && (null !== _g) && (null !== _b) ) { | ||
if ( ('number' !== typeof _r) || | ||
('number' !== typeof _g) || | ||
('number' !== typeof _b) ) { | ||
throw new Error('invalid parameter'); | ||
} | ||
} else { | ||
throw new Error('invalid parameter'); | ||
} | ||
this.name = 'Color'; | ||
this.red = (r === undefined) ? null : r; | ||
this.green = (g === undefined) ? null : g; | ||
this.blue = (b === undefined) ? null : b; | ||
this.alpha = (a === undefined) ? 1 : a; | ||
this.red = _r; | ||
this.green = _g; | ||
this.blue = _b; | ||
if ('number' !== typeof _a) { | ||
throw new Error('invalid parameter'); | ||
} | ||
this.alpha = _a; | ||
} catch (e) { | ||
@@ -29,0 +47,0 @@ console.error(e.stack); |
@@ -395,2 +395,39 @@ /** | ||
mofron.util.getColorObj = function (sty) { | ||
try { | ||
if ('none' === sty) { | ||
return new mofron.util.Color(); | ||
} | ||
var color = null; | ||
if (-1 !== sty.indexOf('rgba(') ) { | ||
color = sty.substring(5); | ||
} else if (-1 !== sty.indexOf('rgb(')) { | ||
color = sty.substring(4); | ||
} else { | ||
return null; | ||
} | ||
color = color.substring(0,color.length-1); | ||
color = color.split(','); | ||
if (3 === color.length) { | ||
return new mofron.util.Color( | ||
parseInt(color[0]), | ||
parseInt(color[1]), | ||
parseInt(color[2]) | ||
); | ||
} else if (4 === color.length) { | ||
return new mofron.util.Color( | ||
parseInt(color[0]), | ||
parseInt(color[1]), | ||
parseInt(color[2]), | ||
parseInt(color[3]) | ||
); | ||
} else { | ||
return null; | ||
} | ||
} catch (e) { | ||
console.error(e.stack); | ||
throw new Error(); | ||
} | ||
} | ||
mofron.util.getStyleConts = function (sel,cnt) { | ||
@@ -397,0 +434,0 @@ try { |
Sorry, the diff of this file is too big to display
184261
5367