Skip to content
Browse files

gallery-2011.05.18-19-11 tribis gallery-split-desktop

  • Loading branch information...
1 parent 839e94d commit 0f3ff5ed50d4766e2bd2fac0379fcc239fad4be4 YUI Builder committed May 18, 2011
Showing with 45 additions and 45 deletions.
  1. +45 −45 src/gallery-split-desktop/js/split-desktop.js
View
90 src/gallery-split-desktop/js/split-desktop.js
@@ -16,10 +16,10 @@ var PX = 'px',
E_INIT = 'init',
E_START = 'start',
E_END = 'end',
- E_CROWN = 'Crown',
- E_NE = 'NE',
- E_NW = 'NW',
- E_CROWN = 'Crown',
+ E_CROWN = 'Crown',
+ E_NE = 'NE',
+ E_NW = 'NW',
+ E_CROWN = 'Crown',
PAGE_DEF_WIDTH = 960,
NW_MIN_WIDTH = 150,
DEF_MAIN_HEIGHT = 700,
@@ -55,9 +55,9 @@ var PX = 'px',
BORDERS_COLOR_CONF = 'bordersColor',
DRAG_HERE_IMG_CONF = 'dragHereImg',
PATH_TO_IMAGES_CONF = 'pathToImages',
- BORDER_PIX_CONF = 'borderPixImg',
- HANDLE_IMG_CONF = 'handleImg',
- DRAG_HERE_LEFT_CONF = 'dragHereLeft',
+ BORDER_PIX_CONF = 'borderPixImg',
+ HANDLE_IMG_CONF = 'handleImg',
+ DRAG_HERE_LEFT_CONF = 'dragHereLeft',
DRAG_HERE_TOP_CONF = 'dragHereTop',
MAIN_HEIGHT_CONF = 'mainHeight',
CROWN_HEIGHT_CONF = 'crownHeight',
@@ -70,9 +70,9 @@ var PX = 'px',
IS_CLOSE_NW_CONF = 'isCloseNW',
IS_CLOSE_NE_CONF = 'isCloseNE',
/*
- default provided here, updated if PREFIX is customized.
- Corresponding nodes are fetched after configuration based on updated selector
- */
+default provided here, updated if PREFIX is customized.
+Corresponding nodes are fetched after configuration based on updated selector
+*/
RESIZER_SELECTOR = POUND + DEF_PREFIX + FULL_DESKTOP.ne,
SECONDARY_SELECTOR = POUND + DEF_PREFIX + FULL_DESKTOP.nwbody,
MAIN_SELECTOR = POUND + DEF_PREFIX + FULL_DESKTOP.main,
@@ -191,13 +191,13 @@ var PX = 'px',
closeNEWidth: {
value: 30,
validator: '_validateCloseNeWidth'
- },
+ },
isCloseCrown: {
value: false
- },
+ },
isCloseNW: {
value: false
- },
+ },
isCloseNE: {
value: false
}
@@ -221,8 +221,8 @@ var PX = 'px',
switch (i) {
case PAGE_WIDTH_CONF:
PAGE_DEF_WIDTH = this.get(i);
- var ne = PAGE_DEF_WIDTH - NW_MIN_WIDTH;/* */
- var m = PAGE_DEF_WIDTH + 21;
+ var ne = PAGE_DEF_WIDTH - NW_MIN_WIDTH;/* */
+ var m = PAGE_DEF_WIDTH + 21;
/* nw div is always 150 and comes auto from page_wrapper - ne */
Y.log('initializer is updating ' + i + ' with: ' + config[i] + PX, 'info', SplitDesktop.NAME);
Y.one(POUND + DEF_PREFIX + FULL_DESKTOP.wrapper).setStyle('width', PAGE_DEF_WIDTH);
@@ -242,10 +242,10 @@ var PX = 'px',
case BORDER_PIX_CONF:
case HANDLE_IMG_CONF:
/**
- If base url is on CDN we will either have inside Y.config a property of 'gallery' or alternatively fullpath.
- In case we have gallery => assume CDN (Y.Env.cdn is the base url)
- In case we have fullpath => assume js file is inside root of package basedir (Y.config.fullpath ) is the baseurl
- */
+If base url is on CDN we will either have inside Y.config a property of 'gallery' or alternatively fullpath.
+In case we have gallery => assume CDN (Y.Env.cdn is the base url)
+In case we have fullpath => assume js file is inside root of package basedir (Y.config.fullpath ) is the baseurl
+*/
Y.log('initializer is updating ' + i + ' with: ' + config[i], 'info', SplitDesktop.NAME);
DRAG_HERE_IMG_URL = this.get(PATH_TO_IMAGES_CONF) + this.get(DRAG_HERE_IMG_CONF);
Y.one(POUND + DEF_PREFIX + FULL_DESKTOP.main).setStyle(BACKGROUNDIMAGE, 'url("' + DRAG_HERE_IMG_URL + '")');
@@ -342,28 +342,28 @@ var PX = 'px',
switch (POUND + e.currentTarget.get('id')){
case SECONDARY_SELECTOR:
if(!this.get("isDragging")){
- this.fire(E_ENTER + E_NW);
- }
+ this.fire(E_ENTER + E_NW);
+ }
break;
case RESIZER_SELECTOR:
if(!this.get("isDragging")){
- this.fire(E_ENTER + E_NE);
+ this.fire(E_ENTER + E_NE);
}
break;
case MAIN_SELECTOR:
if(!this.get("isDragging")){
- this.fire(E_ENTER + E_MAIN);
+ this.fire(E_ENTER + E_MAIN);
}
- break;
+ break;
}
};
this._out = function (e) {
return;
};
- Y.one(WRAPPER_SELECTOR).delegate("hover", this._over, this._out, ".sdt-active", this);
- },
+ Y.one(WRAPPER_SELECTOR).delegate("hover", this._over, this._out, ".sdt-active", this);
+ },
renderUI : function () {
@@ -391,9 +391,9 @@ var PX = 'px',
},
/**
- * @protected
- *
- */
+* @protected
+*
+*/
_onDragStart : function (e) {
/* remove background from main */
@@ -422,7 +422,7 @@ var PX = 'px',
deltaH = parseInt(e.info.offset[1], 10);
totW = w - deltaW;
- totH = h + deltaH;
+ totH = h + deltaH;
/* ne closed when resizer width is page width - padding - close value */
if(!cutOffNwClosed){
@@ -435,9 +435,9 @@ var PX = 'px',
cutOffCrownClosed = this.get(CLOSE_CROWN_CONF);
}
- this._isPaneClosed(IS_CLOSE_NW_CONF, E_NW, cutOffNwClosed, totW, true);
- this._isPaneClosed(IS_CLOSE_NE_CONF, E_NE, cutOffNeClosed, totW, false);
- this._isPaneClosed(IS_CLOSE_CROWN_CONF, E_CROWN, cutOffCrownClosed, totH, false);
+ this._isPaneClosed(IS_CLOSE_NW_CONF, E_NW, cutOffNwClosed, totW, true);
+ this._isPaneClosed(IS_CLOSE_NE_CONF, E_NE, cutOffNeClosed, totW, false);
+ this._isPaneClosed(IS_CLOSE_CROWN_CONF, E_CROWN, cutOffCrownClosed, totH, false);
resizerNode.setStyle(WIDTH, totW);
resizerNode.setStyle(HEIGHT, totH);
@@ -446,11 +446,11 @@ var PX = 'px',
},
_onDragEnd : function (e) {
- /*
- reposition to 00 pos in resizer window
- the window width might have changed from the drag:start due to scrollbars,
- hence the current x y is not necessarily at the bottom left corner of the window
- */
+ /*
+reposition to 00 pos in resizer window
+the window width might have changed from the drag:start due to scrollbars,
+hence the current x y is not necessarily at the bottom left corner of the window
+*/
this.fire(E_DRAG + E_END);
this.set(ISDRAGGING_CONF, false);
this._repositionHandle();
@@ -465,7 +465,7 @@ var PX = 'px',
if(Y.config.modules[GALLERYSPLITDESKTOP].gallery){
/* source is on CDN */
Y.log("Baseurl is on CDN for this module");
- return Y.Env.base + Y.config.modules[GALLERYSPLITDESKTOP].gallery + '/build/';
+ return Y.Env.base + Y.config.modules[GALLERYSPLITDESKTOP].gallery + '/build/gallery-split-desktop/';
}else if(Y.config.modules[GALLERYSPLITDESKTOP].fullpath){
//extract root, assets relative to root
@@ -481,7 +481,7 @@ var PX = 'px',
}else if(Y.config.gallery){
/* source is general gallery url */
Y.log("Baseurl is on CDN", 'info', SplitDesktop.NAME);
- return Y.Env.base + Y.config.gallery + '/build/';
+ return Y.Env.base + Y.config.gallery + '/build/gallery-split-desktop/';
}else if(Y.config.fullpath){
//extract root, assets relative to root
@@ -512,14 +512,14 @@ var PX = 'px',
},
_validateCloseNWWidth : function (val) {
- return (val >= 0 && val <= parseInt(this.get(PAGE_WIDTH_CONF).replace(PX, ''), 10) / 4);
+ return (val >= 0 && val <= parseInt(this.get(PAGE_WIDTH_CONF).replace(PX, ''), 10) / 4);
},
_validateCloseNEWidth : function (val) {
- return (val >= 0 && val <= parseInt(this.get(PAGE_WIDTH_CONF).replace(PX, ''), 10) / 4);
+ return (val >= 0 && val <= parseInt(this.get(PAGE_WIDTH_CONF).replace(PX, ''), 10) / 4);
},
- _isPaneClosed : function (confName, eventType, cutOffVal, actualVal, direction) {
+ _isPaneClosed : function (confName, eventType, cutOffVal, actualVal, direction) {
/* close/open events for NW */
/* NW behaves in opposite direction: use false */
if(!this.get(confName)){
@@ -532,8 +532,8 @@ var PX = 'px',
if(this._evalLimits(cutOffVal > actualVal, direction)){
this.set(confName, false);
this.fire(E_OPEN + eventType);
- Y.log('Firing ' + E_OPEN + eventType, 'info', SplitDesktop.NAME);
- }
+ Y.log('Firing ' + E_OPEN + eventType, 'info', SplitDesktop.NAME);
+ }
}
},
_evalLimits : function (operation, bit){

0 comments on commit 0f3ff5e

Please sign in to comment.
Something went wrong with that request. Please try again.