 BigApi.ObjectController.BlocRss = Class.create(BigApi.ObjectController.IBasic, { initialize:function($super, displayContainerId, options) { $super(displayContainerId); this.buildSliding()}, buildSliding:function() { var canal_header = this.mainContainer.down('.rss_canal_header'); if(canal_header) this.canal_sliding = new BigApi.Graphic.SlidingContainer(canal_header.up(), { onEvent:'click', classNames: { toggle:'rss_canal_header', toggleActive:'rss_canal_header_active', content:'rss_canal_content' } }); var canal_content = this.mainContainer.down('.rss_canal_items'); if(canal_content) { this.items_sliding = new BigApi.Graphic.SlidingContainer(canal_content, { onEvent:'click', classNames: { toggle:'rss_item_header', toggleActive:'rss_item_header_active', content:'rss_item_content' } })} }, onTemplateChanged:function() { if(this.canal_sliding) this.canal_sliding.dispose(); if(this.items_sliding) this.items_sliding.dispose(); this.buildSliding()}, dispose:function($super) { $super(); if(this.canal_sliding) this.canal_sliding.dispose(); if(this.items_sliding) this.items_sliding.dispose()} }); BigApi.ObjectController.TreeMenu = Class.create(BigApi.ObjectController.IBasic, { initialize:function($super, displayContainerId, options) { $super(displayContainerId); this._bindMenuItemsEvents(); this.addObserver(document, 'BigApiObjectTreeMenu:Action', this._onBigApiObjectTreeMenuAction.bindAsEventListener(this))}, _onBigApiObjectTreeMenuAction:function(event) { if(event.memo.controller != this) { this._onClickMenuItem(null)} }, _bindMenuItemsEvents:function() { this.currentDepthsItems = $A(); this.mainContainer.select('.menu_item').each(function(item) { var depth = this._findItemDepth(item); if (depth >= 0) { if (item.hasClassName('menu_depth' + depth + '_item_over')) { this.currentDepthsItems[depth] = item} } this.addObserver(item,'click', this._onClickMenuItem.bind(this, item))}.bind(this))}, _onClickMenuItem:function(item) { if(item) { var depth = this._findItemDepth(item); if(this.currentDepthsItems[depth]) this.currentDepthsItems[depth].removeClassName('menu_depth'+depth+'_item_over'); this.currentDepthsItems[depth] = item; item.addClassName('menu_depth'+depth+'_item_over'); document.fire('BigApiObjectTreeMenu:Action', {action:'item_selected', item:item, controller:this})} else { this.currentDepthsItems.each(function(item, depth){ item.removeClassName('menu_depth'+depth+'_item_over')}); this.currentDepthsItems = $A()} }, _findItemDepth:function(item) { var depthclass = item.classNames().grep(/menu_depth([0-9]+)_item/).first(); var depth = -1; if(depthclass) { var results =/depth([0-9]+)/.exec(depthclass); if(results) { depth = parseInt(results[1])} } return depth}, onTemplateChanged:function() { this._bindMenuItemsEvents()}, dispose:function($super) { $super()} }); BigApi.ObjectController.ContainerDocumentVisitor = Class.create(BigApi.ObjectController.IBasic, { initialize:function($super, displayContainerId, options) { $super(displayContainerId, options); this.footerWrap = this.getBodyContainer().down('.ContainerDocument_footer_wrap'); if(this.footerWrap) { this.updateFooterPos(); this.addObserver(window, 'resize', this.updateFooterPos.bind(this)); this.addObserver(document, 'BigApi.Document:ContentChanged', function(){setTimeout(this.updateFooterPos.bind(this), 500)}.bind(this))} }, updateFooterPos:function() { footerElement = this.footerWrap; var containerHeight = this.getWindowHeight(); var contentHeight= this.mainContainer.offsetHeight; var footerHeight = footerElement.getHeight(); if(!this.baseFooterYOffset) this.baseFooterYOffset = footerElement.positionedOffset()[1]; var footerTop = footerElement.style.top ? parseInt(footerElement.style.top) : 0; var footerYOffset = footerElement.positionedOffset()[1]-footerTop; if (containerHeight-(contentHeight)>=0) { footerElement.style.position='relative'; footerElement.style.top= (containerHeight-(footerYOffset+footerHeight))+'px'} else { footerElement.style.position='static'} }, getWindowHeight:function() { var windowHeight=0; if (typeof(window.innerHeight)=='number') { windowHeight=window.innerHeight} else { if (document.documentElement&& document.documentElement.clientHeight) { windowHeight = document.documentElement.clientHeight} else { if (document.body&&document.body.clientHeight) { windowHeight=document.body.clientHeight} } } return windowHeight} }); BigApi.ObjectController.TreeContextZoneVisitor = Class.create(BigApi.ObjectController.IBasic, { initialize:function($super, displayContainerId, options) { $super(displayContainerId, options); this.elements = {}; this.inputs = {}; this.contextDatas = BigApi.Context.Pool.getCurrentContextDatas(); this.elements.container = this.mainContainer.down('div'); this.addObserver(document, 'BigApi.Context:onUpdateContext', this._onUpdateContext.bindAsEventListener(this))}, _refreshContent:function() { BigApi.ObjectController.ZonesPool.unregisterZoneControllers(this.displayContainerId); new Ajax.Request('ajax/BigApiObjectTreeContextZoneVisitor', { parameters:{ displayContainerId:this.displayContainerId }, onSuccess:this._refreshContentSuccess.bind(this) })}, _refreshContentSuccess:function(transport) { var object = BigApi.Utils.ajaxJsonEval(transport); var jsFiles = []; $A(object.objects).each(function(elem) { if(elem.linkedFiles && elem.linkedFiles.css) { elem.linkedFiles.css.each(function(file) { BigApi.Loader.requireDynamicCssFile(file)})} if(elem.linkedFiles && elem.linkedFiles.js) { elem.linkedFiles.js.each(function(file) { jsFiles.push(file)})} }); this.elements.container.update(object.content); if (!BigApi.Browser.IE || BigApi.Browser.IEVersion > 6) { this.elements.container.hide(); new Effect.Appear(this.elements.container, { duration: 0.5 })} if (window.Shadowbox) { Shadowbox.clearCache(); Shadowbox.setup()} var js_sync_loader = null; var js_sync_loader = new BigApi.Loader.JsSyncLoader({onLoadedHandler:this._onJsFilesLoaded.bind(this, object)}); $A(jsFiles).each(function(file){ js_sync_loader.addFile(file)}); js_sync_loader.process()}, _onJsFilesLoaded:function(object) { $A(object.objects).each(function(elem) { if(elem.linkedJsExpr) { var result = eval(elem.linkedJsExpr)} }.bind(this)); document.fire('BigApi.Document:ContentChanged')}, dispose:function($super) { BigApi.ObjectController.ZonesPool.unregisterZoneControllers(this.displayContainerId); $super()}, _onUpdateContext:function(event) { lastParams = event.memo.lastParams; newParams = event.memo.newParams; this.contextDatas = newParams; this._refreshContent()} }); BigApi.ObjectController.ContainerPageVisitor = Class.create(BigApi.ObjectController.IBasic, { initialize:function($super, displayContainerId, options) { $super(displayContainerId); var sup_container = $$('body')[0]; if(sup_container) sup_container.addClassName(this.getTemplateClass()+'_supbody')}, dispose:function($super) { $super(); var sup_container = $$('body')[0]; if(sup_container) sup_container.removeClassName(this.getTemplateClass()+'_supbody')} }); BigApi.ObjectController.TreeMenuSliding = Class.create(BigApi.ObjectController.IBasic, { initialize:function($super, displayContainerId, options) { $super(displayContainerId, options); this._buildSliding()}, _buildSliding:function() { var header = this.mainContainer.down('.depth0_item'); if(header) this.sliding = new BigApi.Graphic.SlidingContainer(header.up(), { onEvent:'click', classNames: { toggle:'depth0_item', toggleActive:'depth0_item_over', content:'depth0_subcontent' } }); this.bindDepth1Events(); this.addObserver(document, 'BigApiObjectTreeMenu:Action', this._onBigApiObjectTreeMenuAction.bindAsEventListener(this))}, _onBigApiObjectTreeMenuAction:function(event) { if(event.memo && event.memo.controller != this) { if(this.currentDepth1Item) { this.currentDepth1Item.removeClassName('depth1_item_over')} this.sliding.closeAll()} }, bindDepth1Events:function() { this.currentDepth1Item = null; var elem = this.mainContainer.down('.depth1_item_over'); if(elem) { this.currentDepth1Item = elem} this.mainContainer.select('.depth1_item').each(function(item) { this.addObserver(item,'click', this._onClickDepth1Button.bind(this, item))}.bind(this)); this.mainContainer.select('.depth0_item').each(function(item) { this.addObserver(item,'click', this._onClickDepth0Button.bind(this, item))}.bind(this))}, _onClickDepth0Button:function(item) { if(this.currentDepth1Item) this.currentDepth1Item.removeClassName('depth1_item_over'); this.currentDepth1Item = null; document.fire('BigApiObjectTreeMenu:Action', {action:'item_selected', item:item, controller:this})}, _onClickDepth1Button:function(item) { if (item != this.currentDepth1Item) { if(this.currentDepth1Item) this.currentDepth1Item.removeClassName('depth1_item_over'); item.addClassName('depth1_item_over'); this.currentDepth1Item = item} document.fire('BigApiObjectTreeMenu:Action', {action:'item_selected', item:item, controller:this})}, onTemplateChanged:function() { if(this.sliding) this.sliding.dispose(); this._buildSliding(); this.bindDepth1Events()}, dispose:function($super) { $super(); if(this.sliding) this.sliding.dispose()} }); 