Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

nav/cms refactor, changes all over, added navigationDataSourceInterfa…

…ce.js
  • Loading branch information...
commit 7038775ffee29468ac6db3009d69dcc5055d21e9 1 parent ae10cbe
Thiago de Mello Bueno authored
View
86 modules/mop/MoPCore.js
@@ -14,7 +14,69 @@ if (!window.console ){ window.console = {};
/*
Section: Extending Mootools
+*/
+
+/*
+Class: Interfaces
+description: Interfaces provides some Interface functionality to Class (and also provides an Interface Object)
+license: MIT-style
+authors: Sebastian Wohlrab
+requires: core/1.2.4: '*'
+provides: [Class.Interfaces]
+...
+*/
+
+Class.Mutators.Interfaces = function( interfaces ) {
+ this.implement('initialize', function(){});
+ console.log( "Interfaces", interfaces );
+ return interfaces;
+};
+
+Class.Mutators.initialize = function( initialize ) {
+ return function() {
+ Array.from( this.Interfaces ).each( function( implemented ) {
+ console.log( ":::", this.Interfaces, implemented, implemented.Interface );
+ implemented.Interface.Check( this );
+ }, this );
+ return initialize.apply( this, arguments );
+ }
+}
+var Interface = function( name, members ) {
+ members.Interface = {
+ Name: name,
+ Check: function( obj ) {
+ console.log( "What?" );
+ var error = [];
+ for ( p in members ) {
+ switch( p ) {
+ case "Interface": /* reservated */ break;
+ case "Interfaces":
+ var existing = false;
+ $splat(members[p]).each(function(iNeeded) {
+ $splat(obj[p]).each(function(iExisting) {
+ if ( iNeeded.Interface.Name == iExisting.Interface.Name) existing = true;
+ });
+ });
+ if ( !existing ) {
+ error.push( p );
+ }
+ break;
+ default:
+ if ( !(p in obj) ) {
+ error.push( p );
+ }
+ break;
+ }
+ }
+ if ( error.length > 0 ) {
+ throw new Error( "[" + this.Name + "] The following Interface members are not implemented yet: " + error.join(', ') );
+ }
+ }
+ };
+ return members;
+};
+/*
Function: getSiblings
Arguments:
match - {Element} an element to get the sibling
@@ -69,7 +131,7 @@ Function.implement({
s - {String} a string
Returns: {String} argumemt string as UTF-8 string
*/
-String.implement( "encodeUTF8", function( ){
+String.implement( "encodeUTF8", function(){
return unescape( encodeURIComponent( this ) );
});
@@ -195,6 +257,7 @@ mop.util.getBaseURL = function(){
Gets urls to the application front-controller
Returns: baseURL + appention (appurl for ajax purposes)
*/
+
mop.util.getAppURL = function(){
var appURLAppendClassName = mop.util.getValueFromClassName( "appUrlAppend", $(document).getElement("body").get("class") );
var appUrlAppend;
@@ -247,6 +310,7 @@ mop.util.getUniqueId = function ( prefix ){
Note: Does this need to exist?
*/
mop.util.JSONSend = function( url, data, options ){
+ url.toURI().toAbsolute();
if( options ){
options.url = url;
}else{
@@ -464,7 +528,7 @@ mop.MoPObject = new Class({
Convenience method that calls mop.util.JSONSend;
*/
JSONSend: function( action, data, options ){
- var url = mop.util.getAppURL() + "ajax/" + this.getSubmissionController() + "/" + action + "/" + mop.objectId;
+ var url = "ajax/" + this.getSubmissionController() + "/" + action + "/" + mop.objectId;
if( options ){ options.url = url; }else{ options = { url: url }; }
new Request.JSON( options ).post( data );
},
@@ -529,9 +593,9 @@ mop.util.HistoryManager = new Class({
Implements: mop.util.Broadcaster,
locationListener: null,
- appState: new Hash(),
+ appState: {},
_instance: null,
- registeredEvents: new Hash(),
+ registeredEvents: {},
initialize: function(){
return this;
@@ -549,7 +613,7 @@ mop.util.HistoryManager = new Class({
},
init: function( eventKey, eventString ){
- this.registeredEvents.set( eventKey, eventString );
+ this.registeredEvents[ eventKey ] = eventString;
this.currentHash = this.getStrippedHash();
// console.log( "HistoryManager.init", this.currentHash );
this.storeStateFromHash();
@@ -567,7 +631,7 @@ mop.util.HistoryManager = new Class({
keyValuePair = keyValuePair.split("-");
var key = keyValuePair[0];
var value = keyValuePair[1];
- this.appState.set( key, value );
+ this.appState[ key ] = value;
key = null;
value = null;
}, this );
@@ -590,11 +654,11 @@ mop.util.HistoryManager = new Class({
},
registerEvent: function( eventKey, eventString ){
- this.registeredEvents.set( eventKey, eventString );
+ this.registeredEvents[ eventKey ] = eventString;
},
changeState: function( key, value ){
- this.appState.set( key, value );
+ this.appState[ key ] = value;
this.updateHash();
},
@@ -610,7 +674,7 @@ mop.util.HistoryManager = new Class({
},
getValue: function( key ){
- return ( this.appState.get( key ) ) ? this.appState.get( key ) : null;
+ return ( this.appState[ key ] ) ? this.appState[ key ] : null;
},
fireEvents: function(){
@@ -682,7 +746,7 @@ mop.util.LoginMonitor = new Class({
clearInterval( this.inactivityTimeout );
clearInterval( this.logoutTimeout );
this.inactivityTimeout = this.onInactivity.periodical( this.secondsOfInactivityTilPrompt, this );
- new Request.JSON( { url: mop.util.getAppURL()+"keepalive" } ).post();
+ new Request.JSON( { url:"keepalive" } ).post();
},
logout: function(){
@@ -692,7 +756,7 @@ mop.util.LoginMonitor = new Class({
delete this.status;
window.removeEvents();
this.dialogue.destroy();
- window.location = mop.util.getAppURL()+"auth/logout";
+ window.location = "auth/logout".toURI().toAbsolute();
}
});
View
26 modules/mop/MoPModules.js
@@ -3,7 +3,6 @@
mop Modules
*/
mop.modules = {};
-
/*
Class: mop.modules.Module
Base module
@@ -20,12 +19,12 @@ mop.modules.Module = new Class({
Variable: UIElements
list of this module's UIElements
*/
- UIElements: new Hash(),
+ UIElements: {},
/*
Variable: childModules
Modules loaded within this module
*/
- childModules: null, //new Hash(),
+ childModules: {},
initialize: function( anElementOrId, aMarshal, options ){
// console.log( "Constructing", this.toString(), this.childModules );
@@ -77,23 +76,18 @@ mop.modules.Module = new Class({
initModules: function( anElement ){
var descendantModules = ( anElement )? anElement.getElements(".module") : this.element.getElements(".module");
var filteredOutModules = [];
- console.log( "\tinitModules", this.toString(), anElement );
descendantModules.each( function( aDescendant ){
descendantModules.each( function( anotherDescendant ){
- console.log( this.toString(), "\tdescendantloop", aDescendant, anotherDescendant, aDescendant.contains( anotherDescendant ) );
if( aDescendant.contains( anotherDescendant ) && aDescendant != anotherDescendant ) filteredOutModules.push( anotherDescendant );
}, this );
}, this );
- console.log( this.toString(), "\t\tfilteredOutModules", filteredOutModules );
descendantModules.each( function( aDescendant ){
if( !filteredOutModules.contains( aDescendant ) ){
- if( !this.childModules ) this.childModules = new Hash();
var module = this.initModule( aDescendant );
var instanceName = module.instanceName;
- this.childModules.set( instanceName, module );
+ this.childModules[ instanceName ] = module;
}
}, this );
- console.log( "childModules", this.toString(), this.childModules );
delete filteredOutModules, descendantModules;
filteredOutModules = descendantModules = null;
},
@@ -108,16 +102,16 @@ mop.modules.Module = new Class({
*/
initModule: function( element ){
var classPath = mop.util.getValueFromClassName( "classPath", element.get( "class" ) ).split( "_" );
- console.log( "\t\tinitModule", this.toString(), element.get( "class" ), classPath );
+// console.log( "\t\tinitModule", this.toString(), element.get( "class" ), classPath );
ref = null;
classPath.each( function( node ){
ref = ( !ref )? this[node] : ref[node];
- console.log( ref, node );
+// console.log( ref, node );
});
var newModule = new ref( element, this );
return newModule;
},
-
+
/*
Function: getModuleUIElements
*/
@@ -150,7 +144,7 @@ mop.modules.Module = new Class({
UIElements.each( function( anElement ){
var UIElement = new mop.ui[ mop.util.getValueFromClassName( "ui", anElement.get( "class" ) ) ]( anElement, this, this.options );
- this.UIElements.set( UIElement.fieldName, UIElement );
+ this.UIElements[ UIElement.fieldName ] = UIElement;
}, this );
if( this.postInitUIHook ) this.postInitUIHook();
@@ -164,11 +158,11 @@ mop.modules.Module = new Class({
@TODO, this shouldnt necessarily be a part of module, but rather something more like an ModuleInstantiator interface */
destroyChildModules: function( whereToLook ){
// console.log( "destroyChildModules", this.toString(), this.childModules );
- if( !this.childModules || this.childModules.getLength() == 0 ) return;
+ if( !this.childModules || Object.getLength( this.childModules ) == 0 ) return;
var possibleTargets = ( whereToLook )? whereToLook.getElements( ".module" ) : this.element.getElements( ".module" );
- this.childModules.each( function( aModule ){
+ Object.each( this.childModules, function( aModule ){
if( possibleTargets.contains( aModule.element ) ){
var key = aModule.instanceName;
aModule.destroy();
@@ -221,7 +215,7 @@ mop.modules.Cluster = new Class({
Extends: mop.modules.Module,
initialize: function( anElementOrId, aMarshal, options ){
this.parent( anElementOrId, aMarshal, options );
-// console.log( "Cluster objectId", this.getObjectId() );
+ // console.log( "Cluster objectId", this.getObjectId() );
},
getSubmissionController: function(){
return this.marshal.getSubmissionController();
View
47 modules/mop/MoPUI.js
@@ -131,10 +131,10 @@ mop.ui.navigation.BreadCrumbTrail = new Class({
className: "BreadCrumbTrail",
- initialize: function( anElement, onBreadCrumbClickedCallback ){
+ initialize: function( anElement, onCrumbClickedCallback ){
this.element = anElement;
- this.onBreadCrumbClickedCallback = onBreadCrumbClickedCallback;
- console.log( "BreadCrumbTrail", this, this.element )
+ this.onCrumbClickedCallback = onCrumbClickedCallback;
+// console.log( "BreadCrumbTrail", this, this.element );
},
toString: function(){
@@ -151,28 +151,25 @@ mop.ui.navigation.BreadCrumbTrail = new Class({
},
addCrumb: function( obj ){
- var crumb = new Element( "a", {
- "text": obj.label,
- "events":{
- "click": this.onBreadCrumbClicked.bindWithEvent( this, obj )
- }
- });
- var listItem = new Element( "li" );
- crumb.inject( listItem );
- if( this.element.getChildren("li")[ obj.index ] ){
- listItem.replaces( this.element.getChildren("li")[ obj.index ] );
- }
+// console.log( "::::::::", obj );
+ var newCrumb = new Element( "li" ).adopt(
+ new Element( "a", { "text": obj.label, "events":{ "click": this.onCrumbClicked.bindWithEvent( this, obj ) } } )
+ );
+ var crumbs = this.element.getElements("li");
+ this.element.getElement("ul").adopt( newCrumb );
+// console.log( "addCrumb >>>>>> ", newCrumb );
},
- onBreadCrumbClicked: function( e, obj ){
- mop.util.stopEvent();
-// console.log( this.toString(), "onBreadCrumbClicked", obj );
- this.onBreadCrumbClickedCallback( obj );
+ onCrumbClicked: function( e, obj ){
+ mop.util.stopEvent( e );
+// console.log( "::::: \t onBreadCrumbClicked", obj );
+ this.onCrumbClickedCallback( obj );
},
- removeBreadCrumb: function( anIndex ){
- var crumb = this.element.getChildren( "li" )[ anIndex ];
- crumb.destroy();
+ removeCrumb: function( anIndex ){
+ console.log( "removeCrumb", anIndex );
+ var crumb = this.element.getElements( "li" )[ anIndex ];
+ if( crumb ) crumb.destroy();
},
destroy: function(){
@@ -2281,7 +2278,7 @@ mop.ui.FileElement = new Class({
},
getSubmitURL: function(){
- var url = mop.util.getAppURL() + "ajax/data/" + this.marshal.getSubmissionController() + "/" + this.action + "/" + this.marshal.getObjectId();
+ var url = "ajax/data/" + this.marshal.getSubmissionController() + "/" + this.action + "/" + this.marshal.getObjectId();
// console.log( ":::: ", this.toString(), "getSubmitURL: ", url );
return url;
},
@@ -2967,7 +2964,7 @@ mop.ui.PulldownNav = new Class({
redirect: function(){
if( this.getValue() == null || this.getValue() == "" ) return;
- var url = mop.util.getAppURL() + this.getValue();
+ var url = this.getValue();
window.location.href = url;
}
@@ -3066,7 +3063,7 @@ mop.ui.CheckBox = new Class({
if( this.showSaving ) this.showSaving();
- var url = mop.util.getAppURL() + "ajax/data/" + this.marshal.getSubmissionController() + "/" + this.action + "/" + this.marshal.getObjectId();
+ var url = "ajax/data/" + this.marshal.getSubmissionController() + "/" + this.action + "/" + this.marshal.getObjectId();
var submittedVars = { field: this.fieldName, value: val };
console.log( this.toString(), "submit", url, submittedVars );
mop.util.JSONSend( url, submittedVars, { onComplete: this.onResponse.bind( this ) } );
@@ -4018,7 +4015,7 @@ mop.ui.PaginationControls = new Class({
}else{
this.spinner.removeClass( "hidden" );
var marshalId = ( this.marshal.instanceName )? this.marshal.instanceName : this.marshal.get("id");
- var url = mop.util.getAppURL() + "ajax/data/" + marshalId + "/" + this.method + "/" + this.listId + "/" + this.currentPage;
+ var url = "ajax/data/" + marshalId + "/" + this.method + "/" + this.listId + "/" + this.currentPage;
var postData = ( this.marshal.getPaginationPostData )? this.marshal.getPaginationPostData() : null ; //getGeneratedDataQueryString() : null;
// console.log( this.toString(), "paginate uncached page >> ", url, postData );
mop.util.JSONSend( url, postData, { onComplete: this.onPagination.bind( this ) } );
View
248 modules/mop/thirdparty/mootools/mootools-more.js
@@ -1,6 +1,6 @@
// MooTools: the javascript framework.
-// Load this file's selection again by visiting: http://mootools.net/more/30f87a9a0ff4220d171856c067ba2177
-// Or build this file again with packager using: packager build More/More More/Events.Pseudos More/Class.Refactor More/Class.Binds More/Class.Occlude More/Array.Extras More/Date More/Date.Extras More/Number.Format More/Object.Extras More/String.Extras More/String.QueryString More/URI More/Hash More/Hash.Extras More/Element.Forms More/Elements.From More/Element.Event.Pseudos More/Element.Event.Pseudos.Keys More/Element.Delegation More/Element.Measure More/Element.Pin More/Element.Position More/Element.Shortcuts More/Form.Request More/Form.Request.Append More/Form.Validator More/Form.Validator.Inline More/Form.Validator.Extras More/OverText More/Fx.Elements More/Fx.Accordion More/Fx.Move More/Fx.Reveal More/Fx.Scroll More/Fx.Slide More/Fx.SmoothScroll More/Fx.Sort More/Drag More/Drag.Move More/Slider More/Sortables More/Request.Queue More/Request.Periodical More/Assets More/IframeShim More/Keyboard More/Keyboard.Extras More/Mask More/Scroller More/Tips More/Spinner More/Locale More/Locale.en-US.Date More/Locale.en-US.Form.Validator More/Locale.en-US.Number
+// Load this file's selection again by visiting: http://mootools.net/more/157527b990d94fe0ab5820a7f3852ed4
+// Or build this file again with packager using: packager build More/More More/Array.Extras More/Date.Extras More/Number.Format More/URI.Relative More/Element.Pin More/Form.Request.Append More/Form.Validator.Inline More/Form.Validator.Extras More/OverText More/Fx.Accordion More/Fx.Move More/Fx.Reveal More/Fx.SmoothScroll More/Fx.Sort More/Slider More/Sortables More/Request.Queue More/Request.Periodical More/Assets More/Keyboard.Extras More/Scroller More/Spinner
/*
---
copyrights:
@@ -10,24 +10,7 @@ licenses:
- [MIT License](http://mootools.net/license.txt)
...
*/
-MooTools.More={version:"1.3.2.1",build:"e586bcd2496e9b22acfde32e12f84d49ce09e59d"};Events.Pseudos=function(g,c,e){var b="monitorEvents:";var a=function(h){return{store:h.store?function(i,j){h.store(b+i,j);
-}:function(i,j){(h.$monitorEvents||(h.$monitorEvents={}))[i]=j;},retrieve:h.retrieve?function(i,j){return h.retrieve(b+i,j);}:function(i,j){if(!h.$monitorEvents){return j;
-}return h.$monitorEvents[i]||j;}};};var f=function(j){if(j.indexOf(":")==-1||!g){return null;}var i=Slick.parse(j).expressions[0][0],m=i.pseudos,h=m.length,k=[];
-while(h--){if(g[m[h].key]){k.push({event:i.tag,value:m[h].value,pseudo:m[h].key,original:j});}}return k.length?k:null;};var d=function(h){return Object.merge.apply(this,h.map(function(i){return g[i.pseudo].options||{};
-}));};return{addEvent:function(m,p,j){var n=f(m);if(!n){return c.call(this,m,p,j);}var k=a(this),s=k.retrieve(m,[]),h=n[0].event,t=d(n),o=p,i=t[h]||{},l=Array.slice(arguments,2),r=this,q;
-if(i.args){l.append(Array.from(i.args));}if(i.base){h=i.base;}if(i.onAdd){i.onAdd(this);}n.each(function(u){var v=o;o=function(){(i.listener||g[u.pseudo].listener).call(r,u,v,arguments,q,t);
-};});q=o.bind(this);s.include({event:p,monitor:q});k.store(m,s);c.apply(this,[m,p].concat(l));return c.apply(this,[h,q].concat(l));},removeEvent:function(l,n){var m=f(l);
-if(!m){return e.call(this,l,n);}var j=a(this),o=j.retrieve(l);if(!o){return this;}var h=m[0].event,p=d(m),i=p[h]||{},k=Array.slice(arguments,2);if(i.args){k.append(Array.from(i.args));
-}if(i.base){h=i.base;}if(i.onRemove){i.onRemove(this);}e.apply(this,[l,n].concat(k));o.each(function(q,r){if(!n||q.event==n){e.apply(this,[h,q.monitor].concat(k));
-}delete o[r];},this);j.store(l,o);return this;}};};(function(){var b={once:{listener:function(e,f,d,c){f.apply(this,d);this.removeEvent(e.event,c).removeEvent(e.original,f);
-}},throttle:{listener:function(d,e,c){if(!e._throttled){e.apply(this,c);e._throttled=setTimeout(function(){e._throttled=false;},d.value||250);}}},pause:{listener:function(d,e,c){clearTimeout(e._pause);
-e._pause=e.delay(d.value||250,this,c);}}};Events.definePseudo=function(c,d){b[c]=Type.isFunction(d)?{listener:d}:d;return this;};Events.lookupPseudo=function(c){return b[c];
-};var a=Events.prototype;Events.implement(Events.Pseudos(b,a.addEvent,a.removeEvent));["Request","Fx"].each(function(c){if(this[c]){this[c].implement(Events.prototype);
-}});})();Class.refactor=function(b,a){Object.each(a,function(e,d){var c=b.prototype[d];c=(c&&c.$origin)||c||function(){};b.implement(d,(typeof e=="function")?function(){var f=this.previous;
-this.previous=c;var g=e.apply(this,arguments);this.previous=f;return g;}:e);});return b;};Class.Mutators.Binds=function(a){if(!this.prototype.initialize){this.implement("initialize",function(){});
-}return Array.from(a).concat(this.prototype.Binds||[]);};Class.Mutators.initialize=function(a){return function(){Array.from(this.Binds).each(function(b){var c=this[b];
-if(c){this[b]=c.bind(this);}},this);return a.apply(this,arguments);};};Class.Occlude=new Class({occlude:function(c,b){b=document.id(b||this.element);var a=b.retrieve(c||this.property);
-if(a&&!this.occluded){return(this.occluded=a);}this.occluded=false;b.store(c||this.property,this);return this.occluded;}});(function(a){Array.implement({min:function(){return Math.min.apply(null,this);
+MooTools.More={version:"1.3.2.1",build:"e586bcd2496e9b22acfde32e12f84d49ce09e59d"};(function(a){Array.implement({min:function(){return Math.min.apply(null,this);
},max:function(){return Math.max.apply(null,this);},average:function(){return this.length?this.sum()/this.length:0;},sum:function(){var b=0,c=this.length;
if(c){while(c--){b+=this[c];}}return b;},unique:function(){return[].combine(this);},shuffle:function(){for(var c=this.length;c&&--c;){var b=this[c],d=Math.floor(Math.random()*(c+1));
this[c]=this[d];this[d]=b;}return this;},reduce:function(d,e){for(var c=0,b=this.length;c<b;c++){if(c in this){e=e===a?this[c]:d.call(null,e,this[c],c,this);
@@ -108,13 +91,9 @@ Locale.define("en-US","Number",{decimal:".",group:",",currency:{prefix:"$ "}});N
}while(b--){n="0"+n;}n="0."+n;}else{m=j[0].lastIndexOf(".");if(m>-1){b-=j[0].length-m-1;}while(b--){n+="0";}}}if(h!="."){n=n.replace(".",h);}if(o){m=n.lastIndexOf(h);
m=(m>-1)?m:n.length;var d=n.substring(m),g=m;while(g--){if((m-g-1)%3==0&&g!=(m-1)){d=o+d;}d=n.charAt(g)+d;}n=d;}if(l){n=l+n;}if(p){n+=p;}return n;},formatCurrency:function(){var a=Locale.get("Number.currency")||{};
if(a.scientific==null){a.scientific=false;}if(a.decimals==null){a.decimals=2;}return this.format(a);},formatPercentage:function(){var a=Locale.get("Number.percentage")||{};
-if(a.suffix==null){a.suffix="%";}if(a.decimals==null){a.decimals=2;}return this.format(a);}});(function(){var c={a:/[àáâãäåăą]/g,A:/[ÀÁÂÃÄÅĂĄ]/g,c:/[ćčç]/g,C:/[ĆČÇ]/g,d:/[ďđ]/g,D:/[ĎÐ]/g,e:/[èéêëěę]/g,E:/[ÈÉÊËĚĘ]/g,g:/[ğ]/g,G:/[Ğ]/g,i:/[ìíîï]/g,I:/[ÌÍÎÏ]/g,l:/[ĺľł]/g,L:/[ĹĽŁ]/g,n:/[ñňń]/g,N:/[ÑŇŃ]/g,o:/[òóôõöøő]/g,O:/[ÒÓÔÕÖØ]/g,r:/[řŕ]/g,R:/[ŘŔ]/g,s:/[ššş]/g,S:/[ŠŞŚ]/g,t:/[ťţ]/g,T:/[ŤŢ]/g,ue:/[ü]/g,UE:/[Ü]/g,u:/[ùúûůµ]/g,U:/[ÙÚÛŮ]/g,y:/[ÿý]/g,Y:/[ŸÝ]/g,z:/[žźż]/g,Z:/[ŽŹŻ]/g,th:/[þ]/g,TH:/[Þ]/g,dh:/[ð]/g,DH:/[Ð]/g,ss:/[ß]/g,oe:/[œ]/g,OE:/[Œ]/g,ae:/[æ]/g,AE:/[Æ]/g},b={" ":/[\xa0\u2002\u2003\u2009]/g,"*":/[\xb7]/g,"'":/[\u2018\u2019]/g,'"':/[\u201c\u201d]/g,"...":/[\u2026]/g,"-":/[\u2013]/g,"&raquo;":/[\uFFFD]/g};
-var a=function(f,h){var e=f,g;for(g in h){e=e.replace(h[g],g);}return e;};var d=function(e,g){e=e||"";var h=g?"<"+e+"(?!\\w)[^>]*>([\\s\\S]*?)</"+e+"(?!\\w)>":"</?"+e+"([^>]+)?>",f=new RegExp(h,"gi");
-return f;};String.implement({standardize:function(){return a(this,c);},repeat:function(e){return new Array(e+1).join(this);},pad:function(e,h,g){if(this.length>=e){return this;
-}var f=(h==null?" ":""+h).repeat(e-this.length).substr(0,e-this.length);if(!g||g=="right"){return this+f;}if(g=="left"){return f+this;}return f.substr(0,(f.length/2).floor())+this+f.substr(0,(f.length/2).ceil());
-},getTags:function(e,f){return this.match(d(e,f))||[];},stripTags:function(e,f){return this.replace(d(e,f),"");},tidy:function(){return a(this,b);},truncate:function(e,f,i){var h=this;
-if(f==null&&arguments.length==1){f="";}if(h.length>e){h=h.substring(0,e);if(i){var g=h.lastIndexOf(i);if(g!=-1){h=h.substr(0,g);}}if(f){h+=f;}}return h;
-}});})();String.implement({parseQueryString:function(d,a){if(d==null){d=true;}if(a==null){a=true;}var c=this.split(/[&;]/),b={};if(!c.length){return b;
+if(a.suffix==null){a.suffix="%";}if(a.decimals==null){a.decimals=2;}return this.format(a);}});Class.refactor=function(b,a){Object.each(a,function(e,d){var c=b.prototype[d];
+c=(c&&c.$origin)||c||function(){};b.implement(d,(typeof e=="function")?function(){var f=this.previous;this.previous=c;var g=e.apply(this,arguments);this.previous=f;
+return g;}:e);});return b;};String.implement({parseQueryString:function(d,a){if(d==null){d=true;}if(a==null){a=true;}var c=this.split(/[&;]/),b={};if(!c.length){return b;
}c.each(function(i){var e=i.indexOf("=")+1,g=e?i.substr(e):"",f=e?i.substr(0,e-1).match(/([^\]\[]+|(\B)(?=\]))/g):[i],h=b;if(!f){return;}if(a){g=decodeURIComponent(g);
}f.each(function(k,j){if(d){k=decodeURIComponent(k);}var l=h[k];if(j<f.length-1){h=h[k]=l||{};}else{if(typeOf(l)=="array"){l.push(g);}else{h[k]=l!=null?[l,g]:g;
}}});});return b;},cleanQueryString:function(a){return this.split("&").filter(function(e){var b=e.indexOf("="),c=b<0?"":e.substr(0,b),d=e.substr(b+1);return a?a.call(null,c,d):(d||d===0);
@@ -131,65 +110,32 @@ return d;},parseDirectory:function(d,e){d=(d.substr(0,1)=="/"?"":(e||"/"))+d;if(
}var f=c.parseQueryString();return e?f[e]:f;},setData:function(c,f,d){if(typeof c=="string"){var e=this.getData();e[arguments[0]]=arguments[1];c=e;}else{if(f){c=Object.merge(this.getData(),c);
}}return this.set(d||"query",Object.toQueryString(c));},clearData:function(c){return this.set(c||"query","");},toString:b,valueOf:b});a.regs={endSlash:/\/$/,scheme:/^(\w+):/,directoryDot:/\.\/|\.$/};
a.base=new a(Array.from(document.getElements("base[href]",true)).getLast(),{base:document.location});String.implement({toURI:function(c){return new a(this,c);
-}});})();(function(){if(this.Hash){return;}var a=this.Hash=new Type("Hash",function(b){if(typeOf(b)=="hash"){b=Object.clone(b.getClean());}for(var c in b){this[c]=b[c];
-}return this;});this.$H=function(b){return new a(b);};a.implement({forEach:function(b,c){Object.forEach(this,b,c);},getClean:function(){var c={};for(var b in this){if(this.hasOwnProperty(b)){c[b]=this[b];
-}}return c;},getLength:function(){var c=0;for(var b in this){if(this.hasOwnProperty(b)){c++;}}return c;}});a.alias("each","forEach");a.implement({has:Object.prototype.hasOwnProperty,keyOf:function(b){return Object.keyOf(this,b);
-},hasValue:function(b){return Object.contains(this,b);},extend:function(b){a.each(b||{},function(d,c){a.set(this,c,d);},this);return this;},combine:function(b){a.each(b||{},function(d,c){a.include(this,c,d);
-},this);return this;},erase:function(b){if(this.hasOwnProperty(b)){delete this[b];}return this;},get:function(b){return(this.hasOwnProperty(b))?this[b]:null;
-},set:function(b,c){if(!this[b]||this.hasOwnProperty(b)){this[b]=c;}return this;},empty:function(){a.each(this,function(c,b){delete this[b];},this);return this;
-},include:function(b,c){if(this[b]==undefined){this[b]=c;}return this;},map:function(b,c){return new a(Object.map(this,b,c));},filter:function(b,c){return new a(Object.filter(this,b,c));
-},every:function(b,c){return Object.every(this,b,c);},some:function(b,c){return Object.some(this,b,c);},getKeys:function(){return Object.keys(this);},getValues:function(){return Object.values(this);
-},toQueryString:function(b){return Object.toQueryString(this,b);}});a.alias({indexOf:"keyOf",contains:"hasValue"});})();Hash.implement({getFromPath:function(a){return Object.getFromPath(this,a);
-},cleanValues:function(a){return new Hash(Object.cleanValues(this,a));},run:function(){Object.run(arguments);}});Element.implement({tidy:function(){this.set("value",this.get("value").tidy());
-},getTextInRange:function(b,a){return this.get("value").substring(b,a);},getSelectedText:function(){if(this.setSelectionRange){return this.getTextInRange(this.getSelectionStart(),this.getSelectionEnd());
-}return document.selection.createRange().text;},getSelectedRange:function(){if(this.selectionStart!=null){return{start:this.selectionStart,end:this.selectionEnd};
-}var e={start:0,end:0};var a=this.getDocument().selection.createRange();if(!a||a.parentElement()!=this){return e;}var c=a.duplicate();if(this.type=="text"){e.start=0-c.moveStart("character",-100000);
-e.end=e.start+a.text.length;}else{var b=this.get("value");var d=b.length;c.moveToElementText(this);c.setEndPoint("StartToEnd",a);if(c.text.length){d-=b.match(/[\n\r]*$/)[0].length;
-}e.end=d-c.text.length;c.setEndPoint("StartToStart",a);e.start=d-c.text.length;}return e;},getSelectionStart:function(){return this.getSelectedRange().start;
-},getSelectionEnd:function(){return this.getSelectedRange().end;},setCaretPosition:function(a){if(a=="end"){a=this.get("value").length;}this.selectRange(a,a);
-return this;},getCaretPosition:function(){return this.getSelectedRange().start;},selectRange:function(e,a){if(this.setSelectionRange){this.focus();this.setSelectionRange(e,a);
-}else{var c=this.get("value");var d=c.substr(e,a-e).replace(/\r/g,"").length;e=c.substr(0,e).replace(/\r/g,"").length;var b=this.createTextRange();b.collapse(true);
-b.moveEnd("character",e+d);b.moveStart("character",e);b.select();}return this;},insertAtCursor:function(b,a){var d=this.getSelectedRange();var c=this.get("value");
-this.set("value",c.substring(0,d.start)+b+c.substring(d.end,c.length));if(a!==false){this.selectRange(d.start,d.start+b.length);}else{this.setCaretPosition(d.start+b.length);
-}return this;},insertAroundCursor:function(b,a){b=Object.append({before:"",defaultMiddle:"",after:""},b);var c=this.getSelectedText()||b.defaultMiddle;
-var g=this.getSelectedRange();var f=this.get("value");if(g.start==g.end){this.set("value",f.substring(0,g.start)+b.before+c+b.after+f.substring(g.end,f.length));
-this.selectRange(g.start+b.before.length,g.end+b.before.length+c.length);}else{var d=f.substring(g.start,g.end);this.set("value",f.substring(0,g.start)+b.before+d+b.after+f.substring(g.end,f.length));
-var e=g.start+b.before.length;if(a!==false){this.selectRange(e,e+d.length);}else{this.setCaretPosition(e+f.length);}}return this;}});Elements.from=function(e,d){if(d||d==null){e=e.stripScripts();
-}var b,c=e.match(/^\s*<(t[dhr]|tbody|tfoot|thead)/i);if(c){b=new Element("table");var a=c[1].toLowerCase();if(["td","th","tr"].contains(a)){b=new Element("tbody").inject(b);
-if(a!="tr"){b=new Element("tr").inject(b);}}}return(b||new Element("div")).set("html",e).getChildren();};(function(){var d={},c=["once","throttle","pause"],b=c.length;
-while(b--){d[c[b]]=Events.lookupPseudo(c[b]);}Event.definePseudo=function(e,f){d[e]=Type.isFunction(f)?{listener:f}:f;return this;};var a=Element.prototype;
-[Element,Window,Document].invoke("implement",Events.Pseudos(d,a.addEvent,a.removeEvent));})();(function(){var a="$moo:keys-pressed",b="$moo:keys-keyup";
-Event.definePseudo("keys",function(d,e,c){var g=c[0],f=[],h=this.retrieve(a,[]);f.append(d.value.replace("++",function(){f.push("+");return"";}).split("+"));
-h.include(g.key);if(f.every(function(j){return h.contains(j);})){e.apply(this,c);}this.store(a,h);if(!this.retrieve(b)){var i=function(j){(function(){h=this.retrieve(a,[]).erase(j.key);
-this.store(a,h);}).delay(0,this);};this.store(b,i).addEvent("keyup",i);}});Object.append(Event.Keys,{shift:16,control:17,alt:18,capslock:20,pageup:33,pagedown:34,end:35,home:36,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":Browser.firefox?109:189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222,"+":107});
-})();(function(){var b=!(window.attachEvent&&!window.addEventListener),f=Element.NativeEvents;f.focusin=2;f.focusout=2;var c=function(h,k,i){var j=Element.Events[h.event],l;
-if(j){l=j.condition;}return Slick.match(k,h.value)&&(!l||l.call(k,i));};var e=function(h,j,i){for(var k=j.target;k&&k!=this;k=document.id(k.parentNode)){if(k&&c(h,k,j)){return i.call(k,j,k);
-}}};var g=function(h){var i="$delegation:";return{base:"focusin",onRemove:function(j){j.retrieve(i+"forms",[]).each(function(k){k.retrieve(i+"listeners",[]).each(function(l){k.removeEvent(h,l);
-});k.eliminate(i+h+"listeners").eliminate(i+h+"originalFn");});},listener:function(r,s,q,t,v){var k=q[0],j=this.retrieve(i+"forms",[]),p=k.target,m=(p.get("tag")=="form")?p:k.target.getParent("form");
-if(!m){return;}var o=m.retrieve(i+"originalFn",[]),l=m.retrieve(i+"listeners",[]),u=this;j.include(m);this.store(i+"forms",j);if(!o.contains(s)){var n=function(w){e.call(u,r,w,s);
-};m.addEvent(h,n);o.push(s);l.push(n);m.store(i+h+"originalFn",o).store(i+h+"listeners",l);}}};};var a=function(h){return{base:"focusin",listener:function(l,m,j){var k={blur:function(){this.removeEvents(k);
-}},i=this;k[h]=function(n){e.call(i,l,n,m);};j[0].target.addEvents(k);}};};var d={mouseenter:{base:"mouseover"},mouseleave:{base:"mouseout"},focus:{base:"focus"+(b?"":"in"),args:[true]},blur:{base:b?"blur":"focusout",args:[true]}};
-if(!b){Object.append(d,{submit:g("submit"),reset:g("reset"),change:a("change"),select:a("select")});}Event.definePseudo("relay",{listener:function(i,j,h){e.call(this,i,h[0],j);
-},options:d});})();(function(){var b=function(e,d){var f=[];Object.each(d,function(g){Object.each(g,function(h){e.each(function(i){f.push(i+"-"+h+(i=="border"?"-width":""));
-});});});return f;};var c=function(f,e){var d=0;Object.each(e,function(h,g){if(g.test(f)){d=d+h.toInt();}});return d;};var a=function(d){return !!(!d||d.offsetHeight||d.offsetWidth);
-};Element.implement({measure:function(h){if(a(this)){return h.call(this);}var g=this.getParent(),e=[];while(!a(g)&&g!=document.body){e.push(g.expose());
-g=g.getParent();}var f=this.expose(),d=h.call(this);f();e.each(function(i){i();});return d;},expose:function(){if(this.getStyle("display")!="none"){return function(){};
-}var d=this.style.cssText;this.setStyles({display:"block",position:"absolute",visibility:"hidden"});return function(){this.style.cssText=d;}.bind(this);
-},getDimensions:function(d){d=Object.merge({computeSize:false},d);var i={x:0,y:0};var h=function(j,e){return(e.computeSize)?j.getComputedSize(e):j.getSize();
-};var f=this.getParent("body");if(f&&this.getStyle("display")=="none"){i=this.measure(function(){return h(this,d);});}else{if(f){try{i=h(this,d);}catch(g){}}}return Object.append(i,(i.x||i.x===0)?{width:i.x,height:i.y}:{x:i.width,y:i.height});
-},getComputedSize:function(d){d=Object.merge({styles:["padding","border"],planes:{height:["top","bottom"],width:["left","right"]},mode:"both"},d);var g={},e={width:0,height:0},f;
-if(d.mode=="vertical"){delete e.width;delete d.planes.width;}else{if(d.mode=="horizontal"){delete e.height;delete d.planes.height;}}b(d.styles,d.planes).each(function(h){g[h]=this.getStyle(h).toInt();
-},this);Object.each(d.planes,function(i,h){var k=h.capitalize(),j=this.getStyle(h);if(j=="auto"&&!f){f=this.getDimensions();}j=g[h]=(j=="auto")?f[h]:j.toInt();
-e["total"+k]=j;i.each(function(m){var l=c(m,g);e["computed"+m.capitalize()]=l;e["total"+k]+=l;});},this);return Object.append(e,g);}});})();(function(){var a=false,b=false;
-var c=function(){var d=new Element("div").setStyles({position:"fixed",top:0,right:0}).inject(document.body);a=(d.offsetTop===0);d.dispose();b=true;};Element.implement({pin:function(h,f){if(!b){c();
-}if(this.getStyle("display")=="none"){return this;}var j,k=window.getScroll(),l,e;if(h!==false){j=this.getPosition(a?document.body:this.getOffsetParent());
-if(!this.retrieve("pin:_pinned")){var g={top:j.y-k.y,left:j.x-k.x};if(a&&!f){this.setStyle("position","fixed").setStyles(g);}else{l=this.getOffsetParent();
-var i=this.getPosition(l),m=this.getStyles("left","top");if(l&&m.left=="auto"||m.top=="auto"){this.setPosition(i);}if(this.getStyle("position")=="static"){this.setStyle("position","absolute");
+}});})();URI=Class.refactor(URI,{combine:function(f,e){if(!e||f.scheme!=e.scheme||f.host!=e.host||f.port!=e.port){return this.previous.apply(this,arguments);
+}var a=f.file+(f.query?"?"+f.query:"")+(f.fragment?"#"+f.fragment:"");if(!e.directory){return(f.directory||(f.file?"":"./"))+a;}var d=e.directory.split("/"),c=f.directory.split("/"),g="",h;
+var b=0;for(h=0;h<d.length&&h<c.length&&d[h]==c[h];h++){}for(b=0;b<d.length-h-1;b++){g+="../";}for(b=h;b<c.length-1;b++){g+=c[b]+"/";}return(g||(f.file?"":"./"))+a;
+},toAbsolute:function(a){a=new URI(a);if(a){a.set("directory","").set("file","");}return this.toRelative(a);},toRelative:function(a){return this.get("value",new URI(a));
+}});(function(){var a=false,b=false;var c=function(){var d=new Element("div").setStyles({position:"fixed",top:0,right:0}).inject(document.body);a=(d.offsetTop===0);
+d.dispose();b=true;};Element.implement({pin:function(h,f){if(!b){c();}if(this.getStyle("display")=="none"){return this;}var j,k=window.getScroll(),l,e;
+if(h!==false){j=this.getPosition(a?document.body:this.getOffsetParent());if(!this.retrieve("pin:_pinned")){var g={top:j.y-k.y,left:j.x-k.x};if(a&&!f){this.setStyle("position","fixed").setStyles(g);
+}else{l=this.getOffsetParent();var i=this.getPosition(l),m=this.getStyles("left","top");if(l&&m.left=="auto"||m.top=="auto"){this.setPosition(i);}if(this.getStyle("position")=="static"){this.setStyle("position","absolute");
}i={x:m.left.toInt()-k.x,y:m.top.toInt()-k.y};e=function(){if(!this.retrieve("pin:_pinned")){return;}var n=window.getScroll();this.setStyles({left:i.x+n.x,top:i.y+n.y});
}.bind(this);this.store("pin:_scrollFixer",e);window.addEvent("scroll",e);}this.store("pin:_pinned",true);}}else{if(!this.retrieve("pin:_pinned")){return this;
}l=this.getParent();var d=(l.getComputedStyle("position")!="static"?l:l.getOffsetParent());j=this.getPosition(d);this.store("pin:_pinned",false);e=this.retrieve("pin:_scrollFixer");
if(!e){this.setStyles({position:"absolute",top:j.y+k.y,left:j.x+k.x});}else{this.store("pin:_scrollFixer",null);window.removeEvent("scroll",e);}this.removeClass("isPinned");
-}return this;},unpin:function(){return this.pin(false);},togglePin:function(){return this.pin(!this.retrieve("pin:_pinned"));}});})();(function(b){var a=Element.Position={options:{relativeTo:document.body,position:{x:"center",y:"center"},offset:{x:0,y:0}},getOptions:function(d,c){c=Object.merge({},a.options,c);
+}return this;},unpin:function(){return this.pin(false);},togglePin:function(){return this.pin(!this.retrieve("pin:_pinned"));}});})();Class.Mutators.Binds=function(a){if(!this.prototype.initialize){this.implement("initialize",function(){});
+}return Array.from(a).concat(this.prototype.Binds||[]);};Class.Mutators.initialize=function(a){return function(){Array.from(this.Binds).each(function(b){var c=this[b];
+if(c){this[b]=c.bind(this);}},this);return a.apply(this,arguments);};};Class.Occlude=new Class({occlude:function(c,b){b=document.id(b||this.element);var a=b.retrieve(c||this.property);
+if(a&&!this.occluded){return(this.occluded=a);}this.occluded=false;b.store(c||this.property,this);return this.occluded;}});(function(){var b=function(e,d){var f=[];
+Object.each(d,function(g){Object.each(g,function(h){e.each(function(i){f.push(i+"-"+h+(i=="border"?"-width":""));});});});return f;};var c=function(f,e){var d=0;
+Object.each(e,function(h,g){if(g.test(f)){d=d+h.toInt();}});return d;};var a=function(d){return !!(!d||d.offsetHeight||d.offsetWidth);};Element.implement({measure:function(h){if(a(this)){return h.call(this);
+}var g=this.getParent(),e=[];while(!a(g)&&g!=document.body){e.push(g.expose());g=g.getParent();}var f=this.expose(),d=h.call(this);f();e.each(function(i){i();
+});return d;},expose:function(){if(this.getStyle("display")!="none"){return function(){};}var d=this.style.cssText;this.setStyles({display:"block",position:"absolute",visibility:"hidden"});
+return function(){this.style.cssText=d;}.bind(this);},getDimensions:function(d){d=Object.merge({computeSize:false},d);var i={x:0,y:0};var h=function(j,e){return(e.computeSize)?j.getComputedSize(e):j.getSize();
+};var f=this.getParent("body");if(f&&this.getStyle("display")=="none"){i=this.measure(function(){return h(this,d);});}else{if(f){try{i=h(this,d);}catch(g){}}}return Object.append(i,(i.x||i.x===0)?{width:i.x,height:i.y}:{x:i.width,y:i.height});
+},getComputedSize:function(d){d=Object.merge({styles:["padding","border"],planes:{height:["top","bottom"],width:["left","right"]},mode:"both"},d);var g={},e={width:0,height:0},f;
+if(d.mode=="vertical"){delete e.width;delete d.planes.width;}else{if(d.mode=="horizontal"){delete e.height;delete d.planes.height;}}b(d.styles,d.planes).each(function(h){g[h]=this.getStyle(h).toInt();
+},this);Object.each(d.planes,function(i,h){var k=h.capitalize(),j=this.getStyle(h);if(j=="auto"&&!f){f=this.getDimensions();}j=g[h]=(j=="auto")?f[h]:j.toInt();
+e["total"+k]=j;i.each(function(m){var l=c(m,g);e["computed"+m.capitalize()]=l;e["total"+k]+=l;});},this);return Object.append(e,g);}});})();(function(b){var a=Element.Position={options:{relativeTo:document.body,position:{x:"center",y:"center"},offset:{x:0,y:0}},getOptions:function(d,c){c=Object.merge({},a.options,c);
a.setPositionOption(c);a.setEdgeOption(c);a.setOffsetOption(d,c);a.setDimensionsOption(d,c);return c;},setPositionOption:function(c){c.position=a.getCoordinateFromValue(c.position);
},setEdgeOption:function(d){var c=a.getCoordinateFromValue(d.edge);d.edge=c?c:(d.position.x=="center"&&d.position.y=="center")?{x:"center",y:"center"}:{x:"left",y:"top"};
},setOffsetOption:function(f,d){var c={x:0,y:0},g=f.measure(function(){return document.id(this.getOffsetParent());}),e=g.getScroll();if(!g||g==f.getDocument().body){return;
@@ -209,12 +155,7 @@ c.top+=d.edge.y=="bottom"?d.dimensions["margin-bottom"]:(d.edge.y!="center"?-d.d
break;}switch(f.y){case"top":e.y=0;break;case"bottom":e.y=-g.y-g.computedTop-g.computedBottom;break;default:e.y=-(Math.round(g.totalHeight/2));break;}c.x+=e.x;
c.y+=e.y;},getCoordinateFromValue:function(c){if(typeOf(c)!="string"){return c;}c=c.toLowerCase();return{x:c.test("left")?"left":(c.test("right")?"right":"center"),y:c.test(/upper|top/)?"top":(c.test("bottom")?"bottom":"center")};
}};Element.implement({position:function(d){if(d&&(d.x!=null||d.y!=null)){return(b?b.apply(this,arguments):this);}var c=this.setStyle("position","absolute").calculatePosition(d);
-return(d&&d.returnPos)?c:this.setStyles(c);},calculatePosition:function(c){return a.getPosition(this,c);}});})(Element.prototype.position);Element.implement({isDisplayed:function(){return this.getStyle("display")!="none";
-},isVisible:function(){var a=this.offsetWidth,b=this.offsetHeight;return(a==0&&b==0)?false:(a>0&&b>0)?true:this.style.display!="none";},toggle:function(){return this[this.isDisplayed()?"hide":"show"]();
-},hide:function(){var b;try{b=this.getStyle("display");}catch(a){}if(b=="none"){return this;}return this.store("element:_originalDisplay",b||"").setStyle("display","none");
-},show:function(a){if(!a&&this.isDisplayed()){return this;}a=a||this.retrieve("element:_originalDisplay")||"block";return this.setStyle("display",(a=="none")?"block":a);
-},swapClass:function(a,b){return this.removeClass(a).addClass(b);}});Document.implement({clearSelection:function(){if(window.getSelection){var a=window.getSelection();
-if(a&&a.removeAllRanges){a.removeAllRanges();}}else{if(document.selection&&document.selection.empty){try{document.selection.empty();}catch(b){}}}}});var IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:"iframeShim",src:'javascript:false;document.write("");',display:false,zIndex:null,margin:0,offset:{x:0,y:0},browsers:(Browser.ie6||(Browser.firefox&&Browser.version<3&&Browser.Platform.mac))},property:"IframeShim",initialize:function(b,a){this.element=document.id(b);
+return(d&&d.returnPos)?c:this.setStyles(c);},calculatePosition:function(c){return a.getPosition(this,c);}});})(Element.prototype.position);var IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:"iframeShim",src:'javascript:false;document.write("");',display:false,zIndex:null,margin:0,offset:{x:0,y:0},browsers:(Browser.ie6||(Browser.firefox&&Browser.version<3&&Browser.Platform.mac))},property:"IframeShim",initialize:function(b,a){this.element=document.id(b);
if(this.occlude()){return this.occluded;}this.setOptions(a);this.makeShim();return this;},makeShim:function(){if(this.options.browsers){var c=this.element.getStyle("zIndex").toInt();
if(!c){c=1;var b=this.element.getStyle("position");if(b=="static"||!b){this.element.setStyle("position","relative");}this.element.setStyle("zIndex",c);
}c=((this.options.zIndex!=null||this.options.zIndex===0)&&c>this.options.zIndex)?this.options.zIndex:c-1;if(c<0){c=1;}this.shim=new Element("iframe",{src:this.options.src,scrolling:"no",frameborder:0,styles:{zIndex:c,position:"absolute",border:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"},"class":this.options.className}).store("IframeShim",this);
@@ -254,7 +195,30 @@ if(c){c.chain(this._send.pass(b,this)).show();}else{this._send(b);}return this;}
if(this.options.useSpinner&&b){b.set("spinner",this.options.spinnerOptions);var a=this.spinner=b.get("spinner");["complete","exception","cancel"].each(function(c){this.addEvent(c,a.hide.bind(a));
},this);}}return this.spinner;}});Element.Properties.spinner={set:function(a){var b=this.retrieve("spinner");if(b){b.destroy();}return this.eliminate("spinner").store("spinner:options",a);
},get:function(){var a=this.retrieve("spinner");if(!a){a=new Spinner(this,this.retrieve("spinner:options"));this.store("spinner",a);}return a;}};Element.implement({spin:function(a){if(a){this.set("spinner",a);
-}this.get("spinner").show();return this;},unspin:function(){this.get("spinner").hide();return this;}});if(!window.Form){window.Form={};}(function(){Form.Request=new Class({Binds:["onSubmit","onFormValidate"],Implements:[Options,Events,Class.Occlude],options:{requestOptions:{evalScripts:true,useSpinner:true,emulation:false,link:"ignore"},sendButtonClicked:true,extraData:{},resetForm:true},property:"form.request",initialize:function(b,c,a){this.element=document.id(b);
+}this.get("spinner").show();return this;},unspin:function(){this.get("spinner").hide();return this;}});Events.Pseudos=function(g,c,e){var b="monitorEvents:";
+var a=function(h){return{store:h.store?function(i,j){h.store(b+i,j);}:function(i,j){(h.$monitorEvents||(h.$monitorEvents={}))[i]=j;},retrieve:h.retrieve?function(i,j){return h.retrieve(b+i,j);
+}:function(i,j){if(!h.$monitorEvents){return j;}return h.$monitorEvents[i]||j;}};};var f=function(j){if(j.indexOf(":")==-1||!g){return null;}var i=Slick.parse(j).expressions[0][0],m=i.pseudos,h=m.length,k=[];
+while(h--){if(g[m[h].key]){k.push({event:i.tag,value:m[h].value,pseudo:m[h].key,original:j});}}return k.length?k:null;};var d=function(h){return Object.merge.apply(this,h.map(function(i){return g[i.pseudo].options||{};
+}));};return{addEvent:function(m,p,j){var n=f(m);if(!n){return c.call(this,m,p,j);}var k=a(this),s=k.retrieve(m,[]),h=n[0].event,t=d(n),o=p,i=t[h]||{},l=Array.slice(arguments,2),r=this,q;
+if(i.args){l.append(Array.from(i.args));}if(i.base){h=i.base;}if(i.onAdd){i.onAdd(this);}n.each(function(u){var v=o;o=function(){(i.listener||g[u.pseudo].listener).call(r,u,v,arguments,q,t);
+};});q=o.bind(this);s.include({event:p,monitor:q});k.store(m,s);c.apply(this,[m,p].concat(l));return c.apply(this,[h,q].concat(l));},removeEvent:function(l,n){var m=f(l);
+if(!m){return e.call(this,l,n);}var j=a(this),o=j.retrieve(l);if(!o){return this;}var h=m[0].event,p=d(m),i=p[h]||{},k=Array.slice(arguments,2);if(i.args){k.append(Array.from(i.args));
+}if(i.base){h=i.base;}if(i.onRemove){i.onRemove(this);}e.apply(this,[l,n].concat(k));o.each(function(q,r){if(!n||q.event==n){e.apply(this,[h,q.monitor].concat(k));
+}delete o[r];},this);j.store(l,o);return this;}};};(function(){var b={once:{listener:function(e,f,d,c){f.apply(this,d);this.removeEvent(e.event,c).removeEvent(e.original,f);
+}},throttle:{listener:function(d,e,c){if(!e._throttled){e.apply(this,c);e._throttled=setTimeout(function(){e._throttled=false;},d.value||250);}}},pause:{listener:function(d,e,c){clearTimeout(e._pause);
+e._pause=e.delay(d.value||250,this,c);}}};Events.definePseudo=function(c,d){b[c]=Type.isFunction(d)?{listener:d}:d;return this;};Events.lookupPseudo=function(c){return b[c];
+};var a=Events.prototype;Events.implement(Events.Pseudos(b,a.addEvent,a.removeEvent));["Request","Fx"].each(function(c){if(this[c]){this[c].implement(Events.prototype);
+}});})();(function(){var d={},c=["once","throttle","pause"],b=c.length;while(b--){d[c[b]]=Events.lookupPseudo(c[b]);}Event.definePseudo=function(e,f){d[e]=Type.isFunction(f)?{listener:f}:f;
+return this;};var a=Element.prototype;[Element,Window,Document].invoke("implement",Events.Pseudos(d,a.addEvent,a.removeEvent));})();(function(){var b=!(window.attachEvent&&!window.addEventListener),f=Element.NativeEvents;
+f.focusin=2;f.focusout=2;var c=function(h,k,i){var j=Element.Events[h.event],l;if(j){l=j.condition;}return Slick.match(k,h.value)&&(!l||l.call(k,i));};
+var e=function(h,j,i){for(var k=j.target;k&&k!=this;k=document.id(k.parentNode)){if(k&&c(h,k,j)){return i.call(k,j,k);}}};var g=function(h){var i="$delegation:";
+return{base:"focusin",onRemove:function(j){j.retrieve(i+"forms",[]).each(function(k){k.retrieve(i+"listeners",[]).each(function(l){k.removeEvent(h,l);});
+k.eliminate(i+h+"listeners").eliminate(i+h+"originalFn");});},listener:function(r,s,q,t,v){var k=q[0],j=this.retrieve(i+"forms",[]),p=k.target,m=(p.get("tag")=="form")?p:k.target.getParent("form");
+if(!m){return;}var o=m.retrieve(i+"originalFn",[]),l=m.retrieve(i+"listeners",[]),u=this;j.include(m);this.store(i+"forms",j);if(!o.contains(s)){var n=function(w){e.call(u,r,w,s);
+};m.addEvent(h,n);o.push(s);l.push(n);m.store(i+h+"originalFn",o).store(i+h+"listeners",l);}}};};var a=function(h){return{base:"focusin",listener:function(l,m,j){var k={blur:function(){this.removeEvents(k);
+}},i=this;k[h]=function(n){e.call(i,l,n,m);};j[0].target.addEvents(k);}};};var d={mouseenter:{base:"mouseover"},mouseleave:{base:"mouseout"},focus:{base:"focus"+(b?"":"in"),args:[true]},blur:{base:b?"blur":"focusout",args:[true]}};
+if(!b){Object.append(d,{submit:g("submit"),reset:g("reset"),change:a("change"),select:a("select")});}Event.definePseudo("relay",{listener:function(i,j,h){e.call(this,i,h[0],j);
+},options:d});})();if(!window.Form){window.Form={};}(function(){Form.Request=new Class({Binds:["onSubmit","onFormValidate"],Implements:[Options,Events,Class.Occlude],options:{requestOptions:{evalScripts:true,useSpinner:true,emulation:false,link:"ignore"},sendButtonClicked:true,extraData:{},resetForm:true},property:"form.request",initialize:function(b,c,a){this.element=document.id(b);
if(this.occlude()){return this.occluded;}this.setOptions(a).setTarget(c).attach();},setTarget:function(a){this.target=document.id(a);if(!this.request){this.makeRequest();
}else{this.request.setOptions({update:this.target});}return this;},toElement:function(){return this.element;},makeRequest:function(){var a=this;this.request=new Request.HTML(Object.merge({update:this.target,emulation:false,spinnerTarget:this.element,method:this.element.get("method")||"post"},this.options.requestOptions)).addEvents({success:function(c,e,d,b){["complete","success"].each(function(f){a.fireEvent(f,[a.target,c,e,d,b]);
});},failure:function(){a.fireEvent("complete",arguments).fireEvent("failure",arguments);},exception:function(){a.fireEvent("failure",arguments);}});return this.attachReset();
@@ -268,7 +232,12 @@ if(!a||!this.options.sendButtonClicked){return;}this.options.extraData[a]=c.get(
this.clickedCleaner=function(){};}.bind(this);},clickedCleaner:function(){},send:function(){var b=this.element.toQueryString().trim(),a=Object.toQueryString(this.options.extraData);
if(b){b+="&"+a;}else{b=a;}this.fireEvent("send",[this.element,b.parseQueryString()]);this.request.send({data:b,url:this.options.requestOptions.url||this.element.get("action")});
this.clickedCleaner();return this;}});Element.implement("formUpdate",function(c,b){var a=this.retrieve("form.request");if(!a){a=new Form.Request(this,c,b);
-}else{if(c){a.setTarget(c);}if(b){a.setOptions(b).makeRequest();}}a.send();return this;});})();(function(){var a=function(d){var b=d.options.hideInputs;
+}else{if(c){a.setTarget(c);}if(b){a.setOptions(b).makeRequest();}}a.send();return this;});})();Element.implement({isDisplayed:function(){return this.getStyle("display")!="none";
+},isVisible:function(){var a=this.offsetWidth,b=this.offsetHeight;return(a==0&&b==0)?false:(a>0&&b>0)?true:this.style.display!="none";},toggle:function(){return this[this.isDisplayed()?"hide":"show"]();
+},hide:function(){var b;try{b=this.getStyle("display");}catch(a){}if(b=="none"){return this;}return this.store("element:_originalDisplay",b||"").setStyle("display","none");
+},show:function(a){if(!a&&this.isDisplayed()){return this;}a=a||this.retrieve("element:_originalDisplay")||"block";return this.setStyle("display",(a=="none")?"block":a);
+},swapClass:function(a,b){return this.removeClass(a).addClass(b);}});Document.implement({clearSelection:function(){if(window.getSelection){var a=window.getSelection();
+if(a&&a.removeAllRanges){a.removeAllRanges();}}else{if(document.selection&&document.selection.empty){try{document.selection.empty();}catch(b){}}}}});(function(){var a=function(d){var b=d.options.hideInputs;
if(window.OverText){var c=[null];OverText.each(function(e){c.include("."+e.options.labelClass);});if(c){b+=c.join(", ");}}return(b)?d.element.getElements(b):null;
};Fx.Reveal=new Class({Extends:Fx.Morph,options:{link:"cancel",styles:["padding","border","margin"],transitionOpacity:!Browser.ie6,mode:"vertical",display:function(){return this.element.get("tag")!="tr"?"block":"table-row";
},opacity:1,hideInputs:Browser.ie?"select, input, textarea, object, embed":null},dissolve:function(){if(!this.hiding&&!this.showing){if(this.element.getStyle("display")!="none"){this.hiding=true;
@@ -291,11 +260,33 @@ return this;},get:function(){var b=this.retrieve("reveal");if(!b){b=new Fx.Revea
Element.implement({reveal:function(b){this.get("reveal").setOptions(b).reveal();return this;},dissolve:function(b){this.get("reveal").setOptions(b).dissolve();
return this;},nix:function(b){var c=Array.link(arguments,{destroy:Type.isBoolean,options:Type.isObject});this.get("reveal").setOptions(b).dissolve().chain(function(){this[c.destroy?"destroy":"dispose"]();
}.bind(this));return this;},wink:function(){var c=Array.link(arguments,{duration:Type.isNumber,options:Type.isObject});var b=this.get("reveal").setOptions(c.options);
-b.reveal().chain(function(){(function(){b.dissolve();}).delay(c.duration||2000);});}});})();Form.Request.Append=new Class({Extends:Form.Request,options:{useReveal:true,revealOptions:{},inject:"bottom"},makeRequest:function(){this.request=new Request.HTML(Object.merge({url:this.element.get("action"),method:this.element.get("method")||"post",spinnerTarget:this.element},this.options.requestOptions,{evalScripts:false})).addEvents({success:function(b,g,f,a){var c;
+b.reveal().chain(function(){(function(){b.dissolve();}).delay(c.duration||2000);});}});})();Elements.from=function(e,d){if(d||d==null){e=e.stripScripts();
+}var b,c=e.match(/^\s*<(t[dhr]|tbody|tfoot|thead)/i);if(c){b=new Element("table");var a=c[1].toLowerCase();if(["td","th","tr"].contains(a)){b=new Element("tbody").inject(b);
+if(a!="tr"){b=new Element("tr").inject(b);}}}return(b||new Element("div")).set("html",e).getChildren();};Form.Request.Append=new Class({Extends:Form.Request,options:{useReveal:true,revealOptions:{},inject:"bottom"},makeRequest:function(){this.request=new Request.HTML(Object.merge({url:this.element.get("action"),method:this.element.get("method")||"post",spinnerTarget:this.element},this.options.requestOptions,{evalScripts:false})).addEvents({success:function(b,g,f,a){var c;
var d=Elements.from(f);if(d.length==1){c=d[0];}else{c=new Element("div",{styles:{display:"none"}}).adopt(d);}c.inject(this.target,this.options.inject);
if(this.options.requestOptions.evalScripts){Browser.exec(a);}this.fireEvent("beforeEffect",c);var e=function(){this.fireEvent("success",[c,this.target,b,g,f,a]);
}.bind(this);if(this.options.useReveal){c.set("reveal",this.options.revealOptions).get("reveal").chain(e);c.reveal();}else{e();}}.bind(this),failure:function(a){this.fireEvent("failure",a);
-}.bind(this)});this.attachReset();}});Locale.define("en-US","FormValidator",{required:"This field is required.",minLength:"Please enter at least {minLength} characters (you entered {length} characters).",maxLength:"Please enter no more than {maxLength} characters (you entered {length} characters).",integer:"Please enter an integer in this field. Numbers with decimals (e.g. 1.25) are not permitted.",numeric:'Please enter only numeric values in this field (i.e. "1" or "1.1" or "-1" or "-1.1").',digits:"Please use numbers and punctuation only in this field (for example, a phone number with dashes or dots is permitted).",alpha:"Please use only letters (a-z) within this field. No spaces or other characters are allowed.",alphanum:"Please use only letters (a-z) or numbers (0-9) in this field. No spaces or other characters are allowed.",dateSuchAs:"Please enter a valid date such as {date}",dateInFormatMDY:'Please enter a valid date such as MM/DD/YYYY (i.e. "12/31/1999")',email:'Please enter a valid email address. For example "fred@domain.com".',url:"Please enter a valid URL such as http://www.example.com.",currencyDollar:"Please enter a valid $ amount. For example $100.00 .",oneRequired:"Please enter something for at least one of these inputs.",errorPrefix:"Error: ",warningPrefix:"Warning: ",noSpace:"There can be no spaces in this input.",reqChkByNode:"No items are selected.",requiredChk:"This field is required.",reqChkByName:"Please select a {label}.",match:"This field needs to match the {matchName} field",startDate:"the start date",endDate:"the end date",currendDate:"the current date",afterDate:"The date should be the same or after {label}.",beforeDate:"The date should be the same or before {label}.",startMonth:"Please select a start month",sameMonth:"These two dates must be in the same month - you must change one or the other.",creditcard:"The credit card number entered is invalid. Please check the number and try again. {length} digits entered."});
+}.bind(this)});this.attachReset();}});(function(){var c={a:/[àáâãäåăą]/g,A:/[ÀÁÂÃÄÅĂĄ]/g,c:/[ćčç]/g,C:/[ĆČÇ]/g,d:/[ďđ]/g,D:/[ĎÐ]/g,e:/[èéêëěę]/g,E:/[ÈÉÊËĚĘ]/g,g:/[ğ]/g,G:/[Ğ]/g,i:/[ìíîï]/g,I:/[ÌÍÎÏ]/g,l:/[ĺľł]/g,L:/[ĹĽŁ]/g,n:/[ñňń]/g,N:/[ÑŇŃ]/g,o:/[òóôõöøő]/g,O:/[ÒÓÔÕÖØ]/g,r:/[řŕ]/g,R:/[ŘŔ]/g,s:/[ššş]/g,S:/[ŠŞŚ]/g,t:/[ťţ]/g,T:/[ŤŢ]/g,ue:/[ü]/g,UE:/[Ü]/g,u:/[ùúûůµ]/g,U:/[ÙÚÛŮ]/g,y:/[ÿý]/g,Y:/[ŸÝ]/g,z:/[žźż]/g,Z:/[ŽŹŻ]/g,th:/[þ]/g,TH:/[Þ]/g,dh:/[ð]/g,DH:/[Ð]/g,ss:/[ß]/g,oe:/[œ]/g,OE:/[Œ]/g,ae:/[æ]/g,AE:/[Æ]/g},b={" ":/[\xa0\u2002\u2003\u2009]/g,"*":/[\xb7]/g,"'":/[\u2018\u2019]/g,'"':/[\u201c\u201d]/g,"...":/[\u2026]/g,"-":/[\u2013]/g,"&raquo;":/[\uFFFD]/g};
+var a=function(f,h){var e=f,g;for(g in h){e=e.replace(h[g],g);}return e;};var d=function(e,g){e=e||"";var h=g?"<"+e+"(?!\\w)[^>]*>([\\s\\S]*?)</"+e+"(?!\\w)>":"</?"+e+"([^>]+)?>",f=new RegExp(h,"gi");
+return f;};String.implement({standardize:function(){return a(this,c);},repeat:function(e){return new Array(e+1).join(this);},pad:function(e,h,g){if(this.length>=e){return this;
+}var f=(h==null?" ":""+h).repeat(e-this.length).substr(0,e-this.length);if(!g||g=="right"){return this+f;}if(g=="left"){return f+this;}return f.substr(0,(f.length/2).floor())+this+f.substr(0,(f.length/2).ceil());
+},getTags:function(e,f){return this.match(d(e,f))||[];},stripTags:function(e,f){return this.replace(d(e,f),"");},tidy:function(){return a(this,b);},truncate:function(e,f,i){var h=this;
+if(f==null&&arguments.length==1){f="";}if(h.length>e){h=h.substring(0,e);if(i){var g=h.lastIndexOf(i);if(g!=-1){h=h.substr(0,g);}}if(f){h+=f;}}return h;
+}});})();Element.implement({tidy:function(){this.set("value",this.get("value").tidy());},getTextInRange:function(b,a){return this.get("value").substring(b,a);
+},getSelectedText:function(){if(this.setSelectionRange){return this.getTextInRange(this.getSelectionStart(),this.getSelectionEnd());}return document.selection.createRange().text;
+},getSelectedRange:function(){if(this.selectionStart!=null){return{start:this.selectionStart,end:this.selectionEnd};}var e={start:0,end:0};var a=this.getDocument().selection.createRange();
+if(!a||a.parentElement()!=this){return e;}var c=a.duplicate();if(this.type=="text"){e.start=0-c.moveStart("character",-100000);e.end=e.start+a.text.length;
+}else{var b=this.get("value");var d=b.length;c.moveToElementText(this);c.setEndPoint("StartToEnd",a);if(c.text.length){d-=b.match(/[\n\r]*$/)[0].length;
+}e.end=d-c.text.length;c.setEndPoint("StartToStart",a);e.start=d-c.text.length;}return e;},getSelectionStart:function(){return this.getSelectedRange().start;
+},getSelectionEnd:function(){return this.getSelectedRange().end;},setCaretPosition:function(a){if(a=="end"){a=this.get("value").length;}this.selectRange(a,a);
+return this;},getCaretPosition:function(){return this.getSelectedRange().start;},selectRange:function(e,a){if(this.setSelectionRange){this.focus();this.setSelectionRange(e,a);
+}else{var c=this.get("value");var d=c.substr(e,a-e).replace(/\r/g,"").length;e=c.substr(0,e).replace(/\r/g,"").length;var b=this.createTextRange();b.collapse(true);
+b.moveEnd("character",e+d);b.moveStart("character",e);b.select();}return this;},insertAtCursor:function(b,a){var d=this.getSelectedRange();var c=this.get("value");
+this.set("value",c.substring(0,d.start)+b+c.substring(d.end,c.length));if(a!==false){this.selectRange(d.start,d.start+b.length);}else{this.setCaretPosition(d.start+b.length);
+}return this;},insertAroundCursor:function(b,a){b=Object.append({before:"",defaultMiddle:"",after:""},b);var c=this.getSelectedText()||b.defaultMiddle;
+var g=this.getSelectedRange();var f=this.get("value");if(g.start==g.end){this.set("value",f.substring(0,g.start)+b.before+c+b.after+f.substring(g.end,f.length));
+this.selectRange(g.start+b.before.length,g.end+b.before.length+c.length);}else{var d=f.substring(g.start,g.end);this.set("value",f.substring(0,g.start)+b.before+d+b.after+f.substring(g.end,f.length));
+var e=g.start+b.before.length;if(a!==false){this.selectRange(e,e+d.length);}else{this.setCaretPosition(e+f.length);}}return this;}});Locale.define("en-US","FormValidator",{required:"This field is required.",minLength:"Please enter at least {minLength} characters (you entered {length} characters).",maxLength:"Please enter no more than {maxLength} characters (you entered {length} characters).",integer:"Please enter an integer in this field. Numbers with decimals (e.g. 1.25) are not permitted.",numeric:'Please enter only numeric values in this field (i.e. "1" or "1.1" or "-1" or "-1.1").',digits:"Please use numbers and punctuation only in this field (for example, a phone number with dashes or dots is permitted).",alpha:"Please use only letters (a-z) within this field. No spaces or other characters are allowed.",alphanum:"Please use only letters (a-z) or numbers (0-9) in this field. No spaces or other characters are allowed.",dateSuchAs:"Please enter a valid date such as {date}",dateInFormatMDY:'Please enter a valid date such as MM/DD/YYYY (i.e. "12/31/1999")',email:'Please enter a valid email address. For example "fred@domain.com".',url:"Please enter a valid URL such as http://www.example.com.",currencyDollar:"Please enter a valid $ amount. For example $100.00 .",oneRequired:"Please enter something for at least one of these inputs.",errorPrefix:"Error: ",warningPrefix:"Warning: ",noSpace:"There can be no spaces in this input.",reqChkByNode:"No items are selected.",requiredChk:"This field is required.",reqChkByName:"Please select a {label}.",match:"This field needs to match the {matchName} field",startDate:"the start date",endDate:"the end date",currendDate:"the current date",afterDate:"The date should be the same or after {label}.",beforeDate:"The date should be the same or before {label}.",startMonth:"Please select a start month",sameMonth:"These two dates must be in the same month - you must change one or the other.",creditcard:"The credit card number entered is invalid. Please check the number and try again. {length} digits entered."});
if(!window.Form){window.Form={};}var InputValidator=this.InputValidator=new Class({Implements:[Options],options:{errorMsg:"Validation failed.",test:Function.from(true)},initialize:function(b,a){this.setOptions(a);
this.className=b;},test:function(b,a){b=document.id(b);return(b)?this.options.test(b,a||this.getProps(b)):false;},getError:function(c,a){c=document.id(c);
var b=this.options.errorMsg;if(typeOf(b)=="function"){b=b(c,a||this.getProps(c));}return b;},getProps:function(a){a=document.id(a);return(a)?a.get("validatorProps"):{};
@@ -440,20 +431,7 @@ var b=Object.map(document.id(d).getPosition(this.element),function(g,f){return e
["x","y"].each(function(k){if(g.contains(k)){if(c[k]>h[k]+b[k]){i[k]=c[k]-b[k];}if(f[k]<h[k]){i[k]=f[k];}}if(i[k]==null){i[k]=h[k];}if(e&&e[k]){i[k]=i[k]+e[k];
}},this);if(i.x!=h.x||i.y!=h.y){this.start(i.x,i.y);}return this;},toElementCenter:function(e,f,h){f=f?Array.from(f):["x","y"];e=document.id(e);var i={},c=e.getPosition(this.element),d=e.getSize(),b=this.element.getScroll(),g=this.element.getSize();
["x","y"].each(function(j){if(f.contains(j)){i[j]=c[j]-(g[j]-d[j])/2;}if(i[j]==null){i[j]=b[j];}if(h&&h[j]){i[j]=i[j]+h[j];}},this);if(i.x!=b.x||i.y!=b.y){this.start(i.x,i.y);
-}return this;}});function a(b){return(/^(?:body|html)$/i).test(b.tagName);}})();Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical",wrapper:false,hideOverflow:true,resetHeight:false},initialize:function(b,a){b=this.element=this.subject=document.id(b);
-this.parent(a);a=this.options;var d=b.retrieve("wrapper"),c=b.getStyles("margin","position","overflow");if(a.hideOverflow){c=Object.append(c,{overflow:"hidden"});
-}if(a.wrapper){d=document.id(a.wrapper).setStyles(c);}if(!d){d=new Element("div",{styles:c}).wraps(b);}b.store("wrapper",d).setStyle("margin",0);if(b.getStyle("overflow")=="visible"){b.setStyle("overflow","hidden");
-}this.now=[];this.open=true;this.wrapper=d;this.addEvent("complete",function(){this.open=(d["offset"+this.layout.capitalize()]!=0);if(this.open&&this.options.resetHeight){d.setStyle("height","");
-}},true);},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight;},horizontal:function(){this.margin="margin-left";
-this.layout="width";this.offset=this.element.offsetWidth;},set:function(a){this.element.setStyle(this.margin,a[0]);this.wrapper.setStyle(this.layout,a[1]);
-return this;},compute:function(c,b,a){return[0,1].map(function(d){return Fx.compute(c[d],b[d],a);});},start:function(b,e){if(!this.check(b,e)){return this;
-}this[e||this.options.mode]();var d=this.element.getStyle(this.margin).toInt(),c=this.wrapper.getStyle(this.layout).toInt(),a=[[d,c],[0,this.offset]],g=[[d,c],[-this.offset,0]],f;
-switch(b){case"in":f=a;break;case"out":f=g;break;case"toggle":f=(c==0)?a:g;}return this.parent(f[0],f[1]);},slideIn:function(a){return this.start("in",a);
-},slideOut:function(a){return this.start("out",a);},hide:function(a){this[a||this.options.mode]();this.open=false;return this.set([-this.offset,0]);},show:function(a){this[a||this.options.mode]();
-this.open=true;return this.set([0,this.offset]);},toggle:function(a){return this.start("toggle",a);}});Element.Properties.slide={set:function(a){this.get("slide").cancel().setOptions(a);
-return this;},get:function(){var a=this.retrieve("slide");if(!a){a=new Fx.Slide(this,{link:"cancel"});this.store("slide",a);}return a;}};Element.implement({slide:function(d,e){d=d||"toggle";
-var b=this.get("slide"),a;switch(d){case"hide":b.hide(e);break;case"show":b.show(e);break;case"toggle":var c=this.retrieve("slide:flag",b.open);b[c?"slideOut":"slideIn"](e);
-this.store("slide:flag",!c);a=true;break;default:b.start(d,e);}if(!a){this.eliminate("slide:flag");}return this;}});Fx.SmoothScroll=new Class({Extends:Fx.Scroll,options:{axes:["x","y"]},initialize:function(c,d){d=d||document;
+}return this;}});function a(b){return(/^(?:body|html)$/i).test(b.tagName);}})();Fx.SmoothScroll=new Class({Extends:Fx.Scroll,options:{axes:["x","y"]},initialize:function(c,d){d=d||document;
this.doc=d.getDocument();this.parent(this.doc,c);var e=d.getWindow(),a=e.location.href.match(/^[^#]*/)[0]+"#",b=$$(this.options.links||this.doc.links);
b.each(function(g){if(g.href.indexOf(a)!=0){return;}var f=g.href.substr(a.length);if(f){this.useLink(g,f);}},this);this.addEvent("complete",function(){e.location.hash=this.anchor;
this.element.scrollTo(this.to[0],this.to[1]);},true);},useLink:function(b,a){b.addEvent("click",function(d){var c=document.id(a)||this.doc.getElement("a[name="+a+"]");
@@ -490,21 +468,7 @@ this.fireEvent("start",[this.element,a]).fireEvent("snap",this.element);}},drag:
}else{this.element[a.modifiers[c]]=this.value.now[c];}}this.fireEvent("drag",[this.element,b]);},cancel:function(a){this.document.removeEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});
if(a){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element);}},stop:function(b){var a={mousemove:this.bound.drag,mouseup:this.bound.stop};
a[this.selection]=this.bound.eventStop;this.document.removeEvents(a);if(b){this.fireEvent("complete",[this.element,b]);}}});Element.implement({makeResizable:function(a){var b=new Drag(this,Object.merge({modifiers:{x:"width",y:"height"}},a));
-this.store("resizer",b);return b.addEvent("drag",function(){this.fireEvent("resize",b);}.bind(this));}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false,precalculate:false,includeMargins:true,checkDroppables:true},initialize:function(b,a){this.parent(b,a);
-b=this.element;this.droppables=$$(this.options.droppables);this.container=document.id(this.options.container);if(this.container&&typeOf(this.container)!="element"){this.container=document.id(this.container.getDocument().body);
-}if(this.options.style){if(this.options.modifiers.x=="left"&&this.options.modifiers.y=="top"){var c=b.getOffsetParent(),d=b.getStyles("left","top");if(c&&(d.left=="auto"||d.top=="auto")){b.setPosition(b.getPosition(c));
-}}if(b.getStyle("position")=="static"){b.setStyle("position","absolute");}}this.addEvent("start",this.checkDroppables,true);this.overed=null;},start:function(a){if(this.container){this.options.limit=this.calculateLimit();
-}if(this.options.precalculate){this.positions=this.droppables.map(function(b){return b.getCoordinates();});}this.parent(a);},calculateLimit:function(){var j=this.element,e=this.container,d=document.id(j.getOffsetParent())||document.body,h=e.getCoordinates(d),c={},b={},k={},g={},m={};
-["top","right","bottom","left"].each(function(q){c[q]=j.getStyle("margin-"+q).toInt();b[q]=j.getStyle("border-"+q).toInt();k[q]=e.getStyle("margin-"+q).toInt();
-g[q]=e.getStyle("border-"+q).toInt();m[q]=d.getStyle("padding-"+q).toInt();},this);var f=j.offsetWidth+c.left+c.right,p=j.offsetHeight+c.top+c.bottom,i=0,l=0,o=h.right-g.right-f,a=h.bottom-g.bottom-p;
-if(this.options.includeMargins){i+=c.left;l+=c.top;}else{o+=c.right;a+=c.bottom;}if(j.getStyle("position")=="relative"){var n=j.getCoordinates(d);n.left-=j.getStyle("left").toInt();
-n.top-=j.getStyle("top").toInt();i-=n.left;l-=n.top;if(e.getStyle("position")!="relative"){i+=g.left;l+=g.top;}o+=c.left-n.left;a+=c.top-n.top;if(e!=d){i+=k.left+m.left;
-l+=((Browser.ie6||Browser.ie7)?0:k.top)+m.top;}}else{i-=c.left;l-=c.top;if(e!=d){i+=h.left+g.left;l+=h.top+g.top;}}return{x:[i,o],y:[l,a]};},getDroppableCoordinates:function(c){var b=c.getCoordinates();
-if(c.getStyle("position")=="fixed"){var a=window.getScroll();b.left+=a.x;b.right+=a.x;b.top+=a.y;b.bottom+=a.y;}return b;},checkDroppables:function(){var a=this.droppables.filter(function(d,c){d=this.positions?this.positions[c]:this.getDroppableCoordinates(d);
-var b=this.mouse.now;return(b.x>d.left&&b.x<d.right&&b.y<d.bottom&&b.y>d.top);},this).getLast();if(this.overed!=a){if(this.overed){this.fireEvent("leave",[this.element,this.overed]);
-}if(a){this.fireEvent("enter",[this.element,a]);}this.overed=a;}},drag:function(a){this.parent(a);if(this.options.checkDroppables&&this.droppables.length){this.checkDroppables();
-}},stop:function(a){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed,a]);this.overed=null;return this.parent(a);}});Element.implement({makeDraggable:function(a){var b=new Drag.Move(this,a);
-this.store("dragger",b);return b;}});var Slider=new Class({Implements:[Events,Options],Binds:["clickedElement","draggedKnob","scrolledElement"],options:{onTick:function(a){this.setKnobPosition(a);
+this.store("resizer",b);return b.addEvent("drag",function(){this.fireEvent("resize",b);}.bind(this));}});var Slider=new Class({Implements:[Events,Options],Binds:["clickedElement","draggedKnob","scrolledElement"],options:{onTick:function(a){this.setKnobPosition(a);
},initialStep:0,snap:false,offset:0,range:false,wheel:false,steps:100,mode:"horizontal"},initialize:function(f,a,e){this.setOptions(e);e=this.options;this.element=document.id(f);
a=this.knob=document.id(a);this.previousChange=this.previousEnd=this.step=-1;var b={},d={x:false,y:false};switch(e.mode){case"vertical":this.axis="y";this.property="top";
this.offset="offsetHeight";break;case"horizontal":this.axis="x";this.property="left";this.offset="offsetWidth";}this.setSliderDimensions();this.setRange(e.range);
@@ -526,7 +490,21 @@ this.set(this.step+(b?-1:1)*this.stepSize);a.stop();},draggedKnob:function(){var
this.step=Math.round(this.min+b*this.toStep(a));this.checkStep();},checkStep:function(){var a=this.step;if(this.previousChange!=a){this.previousChange=a;
this.fireEvent("change",a);}return this;},end:function(){var a=this.step;if(this.previousEnd!==a){this.previousEnd=a;this.fireEvent("complete",a+"");}return this;
},toStep:function(a){var b=(a+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(b-=b%this.stepSize):b;},toPosition:function(a){return(this.full*Math.abs(this.min-a))/(this.steps*this.stepSize)-this.options.offset;
-}});var Sortables=new Class({Implements:[Events,Options],options:{opacity:1,clone:false,revert:false,handle:false,dragOptions:{}},initialize:function(a,b){this.setOptions(b);
+}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false,precalculate:false,includeMargins:true,checkDroppables:true},initialize:function(b,a){this.parent(b,a);
+b=this.element;this.droppables=$$(this.options.droppables);this.container=document.id(this.options.container);if(this.container&&typeOf(this.container)!="element"){this.container=document.id(this.container.getDocument().body);
+}if(this.options.style){if(this.options.modifiers.x=="left"&&this.options.modifiers.y=="top"){var c=b.getOffsetParent(),d=b.getStyles("left","top");if(c&&(d.left=="auto"||d.top=="auto")){b.setPosition(b.getPosition(c));
+}}if(b.getStyle("position")=="static"){b.setStyle("position","absolute");}}this.addEvent("start",this.checkDroppables,true);this.overed=null;},start:function(a){if(this.container){this.options.limit=this.calculateLimit();
+}if(this.options.precalculate){this.positions=this.droppables.map(function(b){return b.getCoordinates();});}this.parent(a);},calculateLimit:function(){var j=this.element,e=this.container,d=document.id(j.getOffsetParent())||document.body,h=e.getCoordinates(d),c={},b={},k={},g={},m={};
+["top","right","bottom","left"].each(function(q){c[q]=j.getStyle("margin-"+q).toInt();b[q]=j.getStyle("border-"+q).toInt();k[q]=e.getStyle("margin-"+q).toInt();
+g[q]=e.getStyle("border-"+q).toInt();m[q]=d.getStyle("padding-"+q).toInt();},this);var f=j.offsetWidth+c.left+c.right,p=j.offsetHeight+c.top+c.bottom,i=0,l=0,o=h.right-g.right-f,a=h.bottom-g.bottom-p;
+if(this.options.includeMargins){i+=c.left;l+=c.top;}else{o+=c.right;a+=c.bottom;}if(j.getStyle("position")=="relative"){var n=j.getCoordinates(d);n.left-=j.getStyle("left").toInt();
+n.top-=j.getStyle("top").toInt();i-=n.left;l-=n.top;if(e.getStyle("position")!="relative"){i+=g.left;l+=g.top;}o+=c.left-n.left;a+=c.top-n.top;if(e!=d){i+=k.left+m.left;
+l+=((Browser.ie6||Browser.ie7)?0:k.top)+m.top;}}else{i-=c.left;l-=c.top;if(e!=d){i+=h.left+g.left;l+=h.top+g.top;}}return{x:[i,o],y:[l,a]};},getDroppableCoordinates:function(c){var b=c.getCoordinates();
+if(c.getStyle("position")=="fixed"){var a=window.getScroll();b.left+=a.x;b.right+=a.x;b.top+=a.y;b.bottom+=a.y;}return b;},checkDroppables:function(){var a=this.droppables.filter(function(d,c){d=this.positions?this.positions[c]:this.getDroppableCoordinates(d);
+var b=this.mouse.now;return(b.x>d.left&&b.x<d.right&&b.y<d.bottom&&b.y>d.top);},this).getLast();if(this.overed!=a){if(this.overed){this.fireEvent("leave",[this.element,this.overed]);
+}if(a){this.fireEvent("enter",[this.element,a]);}this.overed=a;}},drag:function(a){this.parent(a);if(this.options.checkDroppables&&this.droppables.length){this.checkDroppables();
+}},stop:function(a){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed,a]);this.overed=null;return this.parent(a);}});Element.implement({makeDraggable:function(a){var b=new Drag.Move(this,a);
+this.store("dragger",b);return b;}});var Sortables=new Class({Implements:[Events,Options],options:{opacity:1,clone:false,revert:false,handle:false,dragOptions:{}},initialize:function(a,b){this.setOptions(b);
this.elements=[];this.lists=[];this.idle=true;this.addLists($$(document.id(a)||a));if(!this.options.clone){this.options.revert=false;}if(this.options.revert){this.effect=new Fx.Morph(null,Object.merge({duration:250,link:"cancel"},this.options.revert));
}},attach:function(){this.addLists(this.lists);return this;},detach:function(){this.lists=this.removeLists(this.lists);return this;},addItems:function(){Array.flatten(arguments).each(function(a){this.elements.push(a);
var b=a.retrieve("sortables:start",function(c){this.start.call(this,c,a);}.bind(this));(this.options.handle?a.getElement(this.options.handle)||a:a).addEvent("mousedown",b);
@@ -575,7 +553,10 @@ delete a.onload;delete a.onLoad;delete a.document;if(c){b.addEvent("load",c);}re
}if(!a.parentNode){a.width=d.width;a.height=d.height;}d=d.onload=d.onabort=d.onerror=null;h.delay(1,a,a);a.fireEvent(e,a,1);};});d.src=a.src=c;if(d&&d.complete){d.onload.delay(1);
}return a.set(b);},images:function(c,b){c=Array.from(c);var d=function(){},a=0;b=Object.merge({onComplete:d,onProgress:d,onError:d,properties:{}},b);return new Elements(c.map(function(f,e){return Asset.image(f,Object.append(b.properties,{onload:function(){a++;
b.onProgress.call(this,a,e,f);if(a==c.length){b.onComplete();}},onerror:function(){a++;b.onError.call(this,a,e,f);if(a==c.length){b.onComplete();}}}));
-}));}};(function(){var a=this.Keyboard=new Class({Extends:Events,Implements:[Options],options:{defaultEventType:"keydown",active:false,manager:null,events:{},nonParsedEvents:["activate","deactivate","onactivate","ondeactivate","changed","onchanged"]},initialize:function(f){if(f&&f.manager){this._manager=f.manager;
+}));}};(function(){var a="$moo:keys-pressed",b="$moo:keys-keyup";Event.definePseudo("keys",function(d,e,c){var g=c[0],f=[],h=this.retrieve(a,[]);f.append(d.value.replace("++",function(){f.push("+");
+return"";}).split("+"));h.include(g.key);if(f.every(function(j){return h.contains(j);})){e.apply(this,c);}this.store(a,h);if(!this.retrieve(b)){var i=function(j){(function(){h=this.retrieve(a,[]).erase(j.key);
+this.store(a,h);}).delay(0,this);};this.store(b,i).addEvent("keyup",i);}});Object.append(Event.Keys,{shift:16,control:17,alt:18,capslock:20,pageup:33,pagedown:34,end:35,home:36,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":Browser.firefox?109:189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222,"+":107});
+})();(function(){var a=this.Keyboard=new Class({Extends:Events,Implements:[Options],options:{defaultEventType:"keydown",active:false,manager:null,events:{},nonParsedEvents:["activate","deactivate","onactivate","ondeactivate","changed","onchanged"]},initialize:function(f){if(f&&f.manager){this._manager=f.manager;
delete f.manager;}this.setOptions(f);this._setup();},addEvent:function(h,g,f){return this.parent(a.parse(h,this.options.defaultEventType,this.options.nonParsedEvents),g,f);
},removeEvent:function(g,f){return this.parent(a.parse(g,this.options.defaultEventType,this.options.nonParsedEvents),f);},toggleActive:function(){return this[this.isActive()?"deactivate":"activate"]();
},activate:function(f){if(f){if(f.isActive()){return this;}if(this._activeKB&&f!=this._activeKB){this.previous=this._activeKB;this.previous.fireEvent("deactivate");
@@ -609,23 +590,4 @@ return this;},attach:function(){this.listener.addEvent("mousemove",this.bound.ge
this.timer=clearInterval(this.timer);},getCoords:function(a){this.page=(this.listener.get("tag")=="body")?a.client:a.page;if(!this.timer){this.timer=this.scroll.periodical(Math.round(1000/this.options.fps),this);
}},scroll:function(){var c=this.element.getSize(),a=this.element.getScroll(),h=this.element!=this.docBody?this.element.getOffsets():{x:0,y:0},d=this.element.getScrollSize(),g={x:0,y:0},e=this.options.area.top||this.options.area,b=this.options.area.bottom||this.options.area;
for(var f in this.page){if(this.page[f]<(e+h[f])&&a[f]!=0){g[f]=(this.page[f]-e-h[f])*this.options.velocity;}else{if(this.page[f]+b>(c[f]+h[f])&&a[f]+c[f]!=d[f]){g[f]=(this.page[f]-c[f]+b-h[f])*this.options.velocity;
-}}g[f]=g[f].round();}if(g.y||g.x){this.fireEvent("change",[a.x+g.x,a.y+g.y]);}}});(function(){var a=function(c,b){return(c)?(typeOf(c)=="function"?c(b):b.get(c)):"";
-};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle("display","block");},onHide:function(){this.tip.setStyle("display","none");
-},title:"title",text:function(b){return b.get("rel")||b.get("href");},showDelay:100,hideDelay:100,className:"tip-wrap",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:false},initialize:function(){var b=Array.link(arguments,{options:Type.isObject,elements:function(c){return c!=null;
-}});this.setOptions(b.options);if(b.elements){this.attach(b.elements);}this.container=new Element("div",{"class":"tip"});},toElement:function(){if(this.tip){return this.tip;
-}this.tip=new Element("div",{"class":this.options.className,styles:{position:"absolute",top:0,left:0}}).adopt(new Element("div",{"class":"tip-top"}),this.container,new Element("div",{"class":"tip-bottom"}));
-return this.tip;},attach:function(b){$$(b).each(function(d){var f=a(this.options.title,d),e=a(this.options.text,d);d.set("title","").store("tip:native",f).retrieve("tip:title",f);
-d.retrieve("tip:text",e);this.fireEvent("attach",[d]);var c=["enter","leave"];if(!this.options.fixed){c.push("move");}c.each(function(h){var g=d.retrieve("tip:"+h);
-if(!g){g=function(i){this["element"+h.capitalize()].apply(this,[i,d]);}.bind(this);}d.store("tip:"+h,g).addEvent("mouse"+h,g);},this);},this);return this;
-},detach:function(b){$$(b).each(function(d){["enter","leave","move"].each(function(e){d.removeEvent("mouse"+e,d.retrieve("tip:"+e)).eliminate("tip:"+e);
-});this.fireEvent("detach",[d]);if(this.options.title=="title"){var c=d.retrieve("tip:native");if(c){d.set("title",c);}}},this);return this;},elementEnter:function(c,b){clearTimeout(this.timer);
-this.timer=(function(){this.container.empty();["title","text"].each(function(e){var d=b.retrieve("tip:"+e);var f=this["_"+e+"Element"]=new Element("div",{"class":"tip-"+e}).inject(this.container);
-if(d){this.fill(f,d);}},this);this.show(b);this.position((this.options.fixed)?{page:b.getPosition()}:c);}).delay(this.options.showDelay,this);},elementLeave:function(c,b){clearTimeout(this.timer);
-this.timer=this.hide.delay(this.options.hideDelay,this,b);this.fireForParent(c,b);},setTitle:function(b){if(this._titleElement){this._titleElement.empty();
-this.fill(this._titleElement,b);}return this;},setText:function(b){if(this._textElement){this._textElement.empty();this.fill(this._textElement,b);}return this;
-},fireForParent:function(c,b){b=b.getParent();if(!b||b==document.body){return;}if(b.retrieve("tip:enter")){b.fireEvent("mouseenter",c);}else{this.fireForParent(c,b);
-}},elementMove:function(c,b){this.position(c);},position:function(f){if(!this.tip){document.id(this);}var c=window.getSize(),b=window.getScroll(),g={x:this.tip.offsetWidth,y:this.tip.offsetHeight},d={x:"left",y:"top"},e={y:false,x2:false,y2:false,x:false},h={};
-for(var i in d){h[d[i]]=f.page[i]+this.options.offset[i];if(h[d[i]]<0){e[i]=true;}if((h[d[i]]+g[i]-b[i])>c[i]-this.options.windowPadding[i]){h[d[i]]=f.page[i]-this.options.offset[i]-g[i];
-e[i+"2"]=true;}}this.fireEvent("bound",e);this.tip.setStyles(h);},fill:function(b,c){if(typeof c=="string"){b.set("html",c);}else{b.adopt(c);}},show:function(b){if(!this.tip){document.id(this);
-}if(!this.tip.getParent()){this.tip.inject(document.body);}this.fireEvent("show",[this.tip,b]);},hide:function(b){if(!this.tip){document.id(this);}this.fireEvent("hide",[this.tip,b]);
-}});})();
+}}g[f]=g[f].round();}if(g.y||g.x){this.fireEvent("change",[a.x+g.x,a.y+g.y]);}}});
View
4 modules/mopcms/config/mop_cms.php
@@ -11,7 +11,9 @@
'modules/mop/thirdparty/monkeyphysics/datepicker.js',
'modules/mop/MoPCore.js',
'modules/mop/MoPUI.js',
- 'modules/mop/MoPModules.js'
+ 'modules/mop/MoPModules.js',
+ 'modules/mopcms/views/js/list.js',
+ 'modules/navigation/views/js/NavigationDataSourceInterface.js'
);
View
40 modules/mopcms/views/css/mop_cms.css
@@ -1221,4 +1221,42 @@ ul.listing li.menuItem:hover{
background: #0af;
color: #fff;
-}
+}
+
+/***************************
+* BREADCRUMBS
+****************************/
+
+.breadCrumb{
+ clear: both;
+ list-style:none;
+ font-family: "Georgia", "Times", serif;
+ margin: 0 0 0 0;
+}
+
+.breadCrumb ul li{
+ display: block;
+ float:left;
+}
+
+.breadCrumb ul li a:after{
+ content: " /";
+ font-size: 1.5em;
+ position: relative;
+ top: .125em;
+}
+
+.breadCrumb ul li a{
+ display: block;
+ width: auto;
+ color:#aaa;
+/* background:#eee; */
+ cursor: pointer;
+ text-decoration:none;
+ padding: .5em .5em 0 0;
+}
+
+.breadCrumb ul li a:hover{
+ color:#0af;
+}
+
View
329 modules/mopcms/views/js/list.js
@@ -0,0 +1,329 @@
+mop.modules.List = new Class({
+
+ /* TODO write unit tests for List*/
+
+ Extends: mop.modules.Module,
+
+ // listing properties and members, helps with maintenance and destruction.... standard practice from now on
+ sortable: null,
+ sortDirection: null,
+ instanceName: null,
+ addItemDialogue: null,
+ items: null,
+ controls: null,
+ sortableList: null,
+ scroller: null,
+ submitDelay: null,
+ oldSort: null,
+
+
+ initialize: function( anElement, aMarshal, options ){
+
+ this.parent( anElement, aMarshal, options );
+
+ delete this.items;
+ this.items = null;
+ this.items = [];
+
+ this.allowChildSort = ( this.getValueFromClassName( "allowChildSort" ) == "false" ) ? false : true;
+ this.sortDirection = this.getValueFromClassName( "sortDirection" );
+ console.log( "List allowChildSort: ", this.getValueFromClassName( "allowChildSort" ) );
+ if( this.allowChildSort ) this.makeSortable();
+ },
+
+ toString: function(){
+ return "[ object, mop.modules.List ]";
+ },
+
+ getInstanceName: function(){
+ return this.instanceName;
+ },
+
+ build: function(){
+ this.parent();
+ this.initControls();
+ this.addItemDialogue = null;
+// console.log( "build", this.toString() );
+ this.initList();
+ },
+
+ initList: function(){
+ delete this.items;
+ this.items = null;
+ this.items = [];
+ this.listing = this.element.getElement( ".listing" );
+ var children = this.listing.getChildren("li");
+ children.each( function( element ){
+ this.items.push( new mop.modules.ListItem( element, this, this.addItemDialogue ) );
+ }, this );
+ },
+
+ initControls: function(){
+ // console.log( this.element.getElement( "#" + this.instanceName+"AddItemModal" ).retrieve("Class") );
+ this.controls = this.element.getChildren( ".controls" );
+ var addItemButton = this.controls.getElement( ".addItem" ).addEvent("click", this.addItem.bindWithEvent( this ) );//this.showModal.bindWithEvent( this, $( this.instanceName+"AddItemModal" ) ) );
+ if( this.allowChildSort ){
+ var saveSort = this.controls.getElement( ".saveSort" ).addEvent("click", this.saveSort.bindWithEvent( this ) );
+ saveSort = null;
+ }
+ addItemButton = null;
+ },
+
+ addItem: function( e ){
+ if( e && e.preventDefault ){
+ e.preventDefault();
+ }else{
+ e.returnValue = false;
+ }
+
+ if( this.addItemDialogue ) this.removeModal( this.addItemDialogue );
+ this.addItemDialogue = new mop.ui.EnhancedAddItemDialogue( null, this );
+ this.addItemDialogue.showLoading( e.target.get("text") );
+
+ this.JSONSend( "addItem", null, {
+ onComplete: function( json ){
+ this.onItemAdded( json );
+ }.bind( this )
+ });
+ },
+
+ onItemAdded: function( json ){
+ var element = this.addItemDialogue.setContent( json.response, this.controls.getElement( ".addItem" ).get( "text" ) );
+ var listItem = new mop.modules.ListItem( element, this, this.addItemDialogue, { scrollContext: 'modal' } );
+ listItem.UIElements.each( function( uiInstance ){
+ uiInstance.scrollContext = "modal";
+ });
+ this.items.push( listItem );
+ mop.util.EventManager.broadcastEvent( "resize" );
+ listItem = null;
+ },
+
+ removeModal: function( aModal ){
+ if( !this.addItemDialogue ) return;
+ this.addItemDialogue = null;
+ },
+
+ insertItem: function( anElement ){
+ var where = ( this.sortDirection == "DESC" )? "top" : "bottom";
+ this.listing.grab( anElement, where );
+ if( this.allowChildSort && this.sortableList ) this.sortableList.addItems( anElement );
+
+ // reset scrollContexts
+ var listItemInstance = anElement.retrieve("Class");
+ listItemInstance.scrollContext = 'window';
+ listItemInstance.resetFileDepth();
+ listItemInstance.UIElements.each( function( uiInstance ){
+ uiInstance.scrollContext = "window";
+ });
+ anElement.tween( "opacity", 1 );
+ anElement.getElement(".itemControls" ).getElement(".delete").removeClass("hidden");
+
+ if( this.allowChildSort != null ) this.onOrderChanged();
+ listItemInstance = where = null;
+ },
+
+ onItemDeleted: function( anItem ){
+ this.items.erase( anItem );
+ anItem.destroy();
+ delete anItem;
+ anItem = null;
+
+ mop.util.EventManager.broadcastEvent( "resize" );
+ //again we should be removing from this.items
+ //this is a potential memory leak, since adding and removing many times will leave
+ //baggage around since it's not removed from this.items, now we have a class with all vars and methods deleted
+ },
+
+ makeSortable: function(){
+ if( this.allowChildSort && !this.sortableList ){
+ this.sortableList = new mop.ui.Sortable( this.listing, this, $( 'body' ) );
+ }else if( this.allowChildSort ){
+ this.sortableList.attach();
+ }
+ this.oldSort = this.serialize();
+ },
+
+ toggleSortable: function(){
+ if( this.sortableList ){ this.removeSortable( this.sortableList ); }else{ this.makeSortable(); }
+ console.log( "toggleSortable", this.sortableList );
+ },
+
+ resumeSort: function(){
+ if( this.allowChildSort && this.sortableList ) this.sortableList.attach();
+ },
+
+ suspendSort: function(){
+ if( this.allowChildSort && this.sortableList ) this.sortableList.detach();
+ },
+
+ removeSortable: function( aSortable ){
+ aSortable.detach();
+ delete aSortable;
+ aSortable = null;
+ },
+
+ onOrderChanged: function(){
+ var newOrder = this.serialize();
+ clearInterval( this.submitDelay );
+ this.submitDelay = this.submitSortOrder.periodical( 3000, this, newOrder.join(",") );
+ newOrder = null;
+ },
+
+ submitSortOrder: function( newOrder ){
+ if( this.allowChildSort && this.oldSort != newOrder ){
+ clearInterval( this.submitDelay );
+ this.submitDelay = null;
+ this.JSONSend( "saveSortOrder", { sortorder: newOrder } );
+ this.oldSort = newOrder;
+ }
+ },
+
+ serialize:function(){
+ var sortArray = [];
+ var children = this.listing.getChildren("li");
+ children.each( function ( aListing ){
+ var listItemId = aListing.get("id");
+ var listItemIdSplit = listItemId.split( "_" );
+ listItemId = listItemIdSplit[ listItemIdSplit.length - 1 ];
+ sortArray.push( listItemId );
+ });
+ console.log( this.toString(), "serialize", this.listing, sortArray );
+ return sortArray;
+
+ },
+
+ destroy: function(){
+ if(this.sortableList) this.removeSortable( this.sortableList );
+ clearInterval( this.submitDelay );
+ this.removeModal();
+
+ delete this.modal;
+ delete this.addItemDialogue;
+ delete this.controls;
+ delete this.instanceName;
+ delete this.items;
+ delete this.listing;
+ delete this.oldSort;
+ if( this.scroller ) delete this.scroller;
+ delete this.allowChildSort;
+ delete this.sortDirection;
+ delete this.submitDelay;
+
+ this.addItemDialogue = null;
+ this.controls = null;
+ this.instanceName = null;
+ this.items = null;
+ this.listing = null;
+ this.oldSort = null;
+ if( this.scroller ) this.scroller = null;
+ this.allowChildSort = null;
+ this.sortDirection = null;
+ this.submitDelay = null;
+
+ mop.util.EventManager.broadcastEvent( 'resize' );
+
+ this.parent();
+
+ }
+
+});
+
+mop.modules.ListItem = new Class({
+
+ Extends: mop.modules.Module,
+
+ Implements: [ Events, Options ],
+
+ addItemDialogue: null,
+ objectId: null,
+ scrollContext: null,
+ controls: null,
+ fadeOut: null,
+
+ initialize: function( anElement, aMarshal, addItemDialogue, options ){
+ this.element = $( anElement);
+ this.element.store( "Class", this );
+ this.marshal = aMarshal;
+ this.instanceName = this.element.get( "id" );
+ this.addItemDialogue = addItemDialogue;
+ this.objectId = this.element.get("id").split("_")[1];
+ if( options && options.scrollContext ) this.scrollContext = options.scrollContext;
+ this.build();
+ },
+
+ getObjectId: function(){ return this.objectId; },
+
+ toString: function(){ return "[ object, mop.modules.ListItem ]"; },
+
+ build: function(){
+ this.parent();
+ this.initControls();
+ },
+
+ initControls: function(){
+ this.controls = this.element.getElement(".itemControls");
+ if( this.controls.getElement(".delete") ) this.controls.getElement(".delete").addEvent( "click", this.deleteItem.bindWithEvent( this ) );
+ },
+
+ filesToTop: function(){
+ this.UIElements.each( function( uiElementInstance, indexA ){
+ if( uiElementInstance.type == "file" || uiElementInstance.type == "imageFile" ){
+ uiElementInstance.scrollContext = 'modal';
+ uiElementInstance.reposition( 'modal' );
+ }
+ }, this );
+ },
+
+ resetFileDepth: function(){
+ this.UIElements.each( function( anElement ){
+ if( anElement.type == "file" || anElement.type == "imageFile" ){
+ anElement.reposition( 'window' );
+ }
+ });
+ },
+
+ JSONSend: function( action, data, options ){
+ var url = "ajax/" + this.getSubmissionController() + "/" + action + "/" + this.getObjectId();
+ mop.util.JSONSend( url, data, options );
+ },
+
+ getSubmissionController: function(){ return this.marshal.instanceName; },
+
+ deleteItem: function( e ){
+ if( e ){
+ if( e.preventDefault ){
+ e.preventDefault();
+ }else{
+ e.returnVal = false;
+ }
+ // e.target.removeClass("delete");
+ // e.target.addClass("spinner");
+ }
+ this.JSONSend( "deleteItem" );
+ if( this.marshal.sortableList != null ) this.marshal.onOrderChanged();
+ this.fadeOut = new Fx.Morph( this.element, { duration: 300, onComplete: this.marshal.onItemDeleted.bind( this.marshal, this ) } );
+ this.fadeOut.start( { opacity: 0 } );
+ },
+
+
+ resumeSort: function(){
+ if( this.marshal.sortableList ) this.marshal.resumeSort();
+ },
+
+ suspendSort: function(){
+ if( this.marshal.sortableList ) this.marshal.suspendSort();
+ },
+
+ destroy: function(){
+ this.element.destroy();
+// console.log(this.element);
+ this.parent(); //call the superclass's destroy method
+ this.addItemDialogue = null;
+ this.controls = null;
+ this.fadeOut = null;
+ this.scrollContext = null;
+ this.objectId = null;
+ console.log(this.element);
+ }
+
+});
View
608 modules/mopcms/views/js/mop_cms.js
@@ -2,6 +2,7 @@
mop.modules.CMS = new Class({
/* Constructor: initialize */
Extends: mop.modules.Module,
+ Interfaces: [ mop.modules.navigation.NavigationDataSource ],
pageLoadCount: 0,
objectId: null,
pageContent: null,
@@ -14,90 +15,29 @@ mop.modules.CMS = new Class({
deletePageLink: null,
loadedCSS: [],
loadedJS: [],
+ toStringIdentifier: "[ object, mop.modules.CMS ]",
+
+/*
+ @TODO: Change mop.modules toString to return this.toStringIdentifier
+ @TODO: Change addNode to take an object (post?) instead of shitload of arguments
+ @TODO: Discuss callbacks and responses. Should we do stuff like -this.JSONSend( url, null, { onComplete: function(){ this.addObjectResponse.bind( this ); callback( this ); }.bind( this ); });
+ Should callback be optionally an array ( could be useful )
+ Some of the methods don't specifically need their own responses (as in callbacks are coming from elsewhere, but we should still define them here for strictness of interface no?)
+*/
initialize: function( anElement, options ){
-// console.log( "CMS INIT", this.childModules );
- console.log(":::::::", this.toString(), "initialize");
-
this.parent( anElement, null, options );
this.instanceName = this.element.get("id");
this.objectId = this.getValueFromClassName( "objectId" );
- var scripttags = $$( "script" ).each( function( aScriptTag ){
- this.loadedJS.push( aScriptTag );
- }, this );
- var scripttags = $$( "link[rel=stylesheet]" ).each( function( aStyleSheetTag ){
- this.loadedCSS.push( aStyleSheetTag );
- }, this );
+ var scripttags = $$( "script" ).each( function( aScriptTag ){ this.loadedJS.push( aScriptTag ); }, this );
+ var scripttags = $$( "link[rel=stylesheet]" ).each( function( aStyleSheetTag ){ this.loadedCSS.push( aStyleSheetTag ); }, this );
},
build: function(){
-// console.log( "::", this.toString(), "build" );
this.pageContent = $("nodeContent");
this.initModules( this.element );
},
-
- requestTier: function( parentId, callback ){
- var url = mop.util.getAppURL() + "ajax/compound/navigation/getTier/" + parentId;
- mop.util.JSONSend( url, null, { onSuccess: callback } );
- mop.util.setObjectId( parentId );
- },
-
- toString: function(){
- return "[ object, mop.modules.CMS ]";
- },
- displayNode: function( nodeId ){
- console.log( this.toString(), "displayNode", nodeId );
-// console.log( this.toString(), "loadPage", pageId );
- this.clearPage();
-// this.pageContent.spin();
- var url = mop.util.getAppURL() + "ajax/html/cms/getPage/" + nodeId;
- mop.util.JSONSend( url, null, { onSuccess: this.onNodeLoaded.bind( this ) } );
- mop.util.setObjectId( nodeId );
- },
-
- clearPage: function(){
- console.log( "clearPage" );
- this.destroyChildModules( this.pageContent );
- this.destroyUIElements();
- this.pageContent.empty();
- },
-
- /*
- Function: onNodeLoaded
- Callback to getPage, loops through supplied JSON object and attached css, html, js, in that order then looks through #pageContent and initialize modules therein....
- Arguments:
- pageJSON - Object : { css: [ "pathToCSSFile", "pathToCSSFile", ... ], js: [ "pathToJSFile", "pathToJSFile", "pathToJSFile", ... ], html: "String" }
- */
- onNodeLoaded: function( json ){
-// console.log( "ONNODELOADED!", json.response.js, this.loadedJS );
- json.response.css.each( function( styleSheetURL, index ){
- if( !this.loadedCSS.contains( styleSheetURL ) ) mop.util.loadStyleSheet( styleSheetURL );
- this.loadedCSS.push( styleSheetURL );
- }, this );
- this.scriptsLoaded = 0;
- this.currentPageLoadIndex = this.pageLoadCount++;
-// console.log( "……… onNodeLoaded", pageData.js, this.loadedJS );
- if( json.response.js.length ){
- json.response.js.each( function( urlString ){
- var isScriptLoaded = ( this.loadedJS.some( function( item ){ item.src == urlString } ) )? true : false;
- if( isScriptLoaded ) this.loadedJS.push( mop.util.loadJS( urlString, { type: "text/javascript", onload: this.onJSLoaded.bind( this, [ json.response.html, this.currentPageLoadIndex ] ) } ));
- }, this );
- }
- },
-
- onJSLoaded: function( html, pageLoadCount ){
- console.log( this.toString(), "onJSLoaded", html );
- // keeps any callbacks from previous pageloads from registering
- if( pageLoadCount != this.currentPageLoadIndex ) return;
- this.scriptsLoaded++;
- console.log( this.scriptsLoaded, this.loadedJS.length-1 );
- if( this.scriptsLoaded == this.loadedJS.length-1 ){
- this.populate( html );
- }
- },
-
-
populate: function( html ){
$("nodeContent").unspin();
this.pageContent.set( 'html', html );
@@ -116,14 +56,14 @@ mop.modules.CMS = new Class({
if( this.deletePageLink ) this.deletePageLink.addEvent( "click", this.onDeleteNodeReleased.bindWithEvent( this ) );
}
},
-
- onTitleEdited: function( response ){
- this.editSlugLink.retrieve( "Class" ).setValue( response.slug );
- },
-
- onSlugEdited: function(){
- this.titleElement.getElement( ".field-slug .ipe" ).addClass("hidden");
+
+ clearPage: function(){
+ console.log( "clearPage" );
+ this.destroyChildModules( this.pageContent );
+ this.destroyUIElements();
+ this.pageContent.empty();
},
+
toggleSlugEditField: function( e ){
// console.log( "revealSlugEditField", e );
@@ -141,428 +81,164 @@ mop.modules.CMS = new Class({
label.set( "text", "Edit slug" );
}
},
-
- renameNode: function( response, uiInstance ){
- this.childModules.get( "navigation" ).renameNode( response.value );
- },
- addObject: function( objectName, templateId, parentId, whichTier, placeHolder ){
- console.log( "addObject", this.toString(), $A( arguments ) );
- // crappy hack to add... fuckit lets do this right.
- parentId = ( parentId )? parentId : 0;
- var callBack = function( nodeData ){
- this.onObjectAdded( nodeData, parentId, whichTier, placeHolder );
- };
- new Request.JSON({
- url: mop.util.getAppURL() + "ajax/data/cms/addObject/" + parentId + "/" + templateId,
- onComplete: callBack.bind( this )
- }).post( { "title" : objectName } );
- callBack = null;
- },
+/*
+ Section: Event Handlers
+*/
- removeObject: function( parentId, callback ){
- var url = mop.util.getAppURL() + "ajax/data/cms/removeObject/" + parentId + "/";
- mop.util.JSONSend( url, null, { onComplete: callback } );
- },
-
- onObjectAdded: function( data, parentId , whichTier, placeHolder ){
-// console.log( "onObjectAdded", this, this.toString() );
- this.childModules.get( "navigation" ).onObjectAdded( data , parentId, whichTier, placeHolder );
- },
-
- getModule: function(){ return this; },
-
- /*
- Function: togglePublishedStatus
- Sends page publish toggle ajax call
- Argument: pageId {Number}
- Callback: onTogglePublish
- */
- togglePublishedStatus: function( nodeId ){
- new Request.JSON({ url: mop.util.getAppURL() + "ajax/data/cms/togglePublish/"+ nodeId }).send();
- },
-
- /*
- Function: onDeleteNodeReleased
- Event handler for delete link in pagetitle area
- Argument: event from bound link
- */
- onDeleteNodeReleased: function( e ){
- mop.util.stopEvent( e );
- this.deleteNode( mop.objectId, this.titleText );
- this.childModules.get( "navigation" ).removeNode( mop.objectId, true );
+ onTitleEdited: function( response ){
+ this.editSlugLink.retrieve( "Class" ).setValue( response.slug );
},
- /*
- Function: deleteNode
- Sends page deleting ajax call destroys current page
- Argument: pageId {Number}
- Callback: onNodeDeleted
- */
- deleteNode: function( nodeId, titleText ){
- console.log( "deleteNode", this.toString() );
- var confirmed = confirm( "Are you sure you wish to delete the node: “" + titleText + "”?\nThis cannot be undone." );
- if( confirmed ){
- var url = mop.util.getAppURL() + "ajax/data/cms/delete/"+ nodeId;
- mop.util.JSONSend( url, null, { onComplete: this.clearPage.bind( this ) })
- }
- }
-
-});
-
-
-mop.modules.List = new Class({
-
- /* TODO write unit tests for List*/
-
- Extends: mop.modules.Module,
-
- // listing properties and members, helps with maintenance and destruction.... standard practice from now on
- sortable: null,
- sortDirection: null,
- instanceName: null,
- addItemDialogue: null,
- items: null,
- controls: null,
- sortableList: null,
- scroller: null,
- submitDelay: null,
- oldSort: null,
+ // onSlugEdited: function(){
+ // this.titleElement.getElement( ".field-slug .ipe" ).addClass("hidden");
+ // },
-
- initialize: function( anElement, aMarshal, options ){
-
- this.parent( anElement, aMarshal, options );
-
- delete this.items;
- this.items = null;
- this.items = [];
-
- this.allowChildSort = ( this.getValueFromClassName( "allowChildSort" ) == "false" ) ? false : true;
- this.sortDirection = this.getValueFromClassName( "sortDirection" );
- console.log( "List allowChildSort: ", this.getValueFromClassName( "allowChildSort" ) );
- if( this.allowChildSort ) this.makeSortable();
- },
-
- toString: function(){
- return "[ object, mop.modules.List ]";
+ onJSLoaded: function( html, pageLoadCount ){
+ console.log( this.toString(), "onJSLoaded", html );
+ // keeps any callbacks from previous pageloads from registering
+ if( pageLoadCount != this.currentPageLoadIndex ) return;
+ this.scriptsLoaded++;
+ console.log( this.scriptsLoaded, this.loadedJS.length-1 );
+ if( this.scriptsLoaded == this.loadedJS.length-1 ){
+ this.populate( html );
+ }
},
- getInstanceName: function(){
- return this.instanceName;
- },
- build: function(){
- this.parent();
- this.initControls();
- this.addItemDialogue = null;
-// console.log( "build", this.toString() );
- this.initList();
- },
+/*
+ Section: Server Requests
+*/
- initList: function(){
- delete this.items;
- this.items = null;
- this.items = [];
- this.listing = this.element.getElement( ".listing" );
- var children = this.listing.getChildren("li");
- children.each( function( element ){
- this.items.push( new mop.modules.ListItem( element, this, this.addItemDialogue ) );
+ /*
+ Function: requestPage
+ Requests pageData and calls requestPageResponse on callback
+ Arguments: nodeId MoPObject Id of a page object.
+ */
+ requestPage: function( nodeId ){
+ var url = "ajax/html/cms/getPage/" + nodeId;
+ mop.util.JSONSend( url, null, { onSuccess: this.requestPageResponse.bind( this ) } );
+ mop.util.setObjectId( nodeId );
+ },
+
+ /*
+ Function: requestPageResponse
+ Callback to requestPage, loops through supplied JSON object and attached css, html, js, in that order then looks through #pageContent and initialize modules therein....
+ Arguments:
+ json - Object : { css: [ "pathToCSSFile", "pathToCSSFile", ... ], js: [ "pathToJSFile", "pathToJSFile", "pathToJSFile", ... ], html: "String" }
+ */
+ requestPageResponse: function( json ){
+ if( !json.returnValue ) console.log( this.toString(), "requestPageResponse error:", json.response.error );
+ json.response.css.each( function( styleSheetURL, index ){
+ if( !this.loadedCSS.contains( styleSheetURL ) ) mop.util.loadStyleSheet( styleSheetURL );
+ this.loadedCSS.push( styleSheetURL );
}, this );
- },
-
- initControls: function(){
- // console.log( this.element.getElement( "#" + this.instanceName+"AddItemModal" ).retrieve("Class") );
- this.controls = this.element.getChildren( ".controls" );
- var addItemButton = this.controls.getElement( ".addItem" ).addEvent("click", this.addItem.bindWithEvent( this ) );//this.showModal.bindWithEvent( this, $( this.instanceName+"AddItemModal" ) ) );
- if( this.allowChildSort ){
- var saveSort = this.controls.getElement( ".saveSort" ).addEvent("click", this.saveSort.bindWithEvent( this ) );
- saveSort = null;
- }
- addItemButton = null;
- },
-
- addItem: function( e ){
- if( e && e.preventDefault ){
- e.preventDefault();
- }else{
- e.returnValue = false;
+ this.scriptsLoaded = 0;
+ this.currentPageLoadIndex = this.pageLoadCount++;
+ if( json.response.js.length ){
+ json.response.js.each( function( urlString ){
+ if( ( this.loadedJS.some( function( item ){ item.src == urlString } ) ) ) this.loadedJS.push( mop.util.loadJS( urlString, { type: "text/javascript", onload: this.onJSLoaded.bind( this, [ json.response.html, this.currentPageLoadIndex ] ) } ) );
+ }, this );
}
-
- if( this.addItemDialogue ) this.removeModal( this.addItemDialogue );
- this.addItemDialogue = new mop.ui.EnhancedAddItemDialogue( null, this );
- this.addItemDialogue.showLoading( e.target.get("text") );
-
- this.JSONSend( "addItem", null, {
- onComplete: function( json ){
- this.onItemAdded( json );
- }.bind( this )
- });
},
- onItemAdded: function( json ){
- var element = this.addItemDialogue.setContent( json.response, this.controls.getElement( ".addItem" ).get( "text" ) );
- var listItem = new mop.modules.ListItem( element, this, this.addItemDialogue, { scrollContext: 'modal' } );
- listItem.UIElements.each( function( uiInstance ){
- uiInstance.scrollContext = "modal";
- });
- this.items.push( listItem );
- mop.util.EventManager.broadcastEvent( "resize" );
- listItem = null;
- },
-
- removeModal: function( aModal ){
- if( !this.addItemDialogue ) return;
- this.addItemDialogue = null;
- },
-
- insertItem: function( anElement ){
- var where = ( this.sortDirection == "DESC" )? "top" : "bottom";
- this.listing.grab( anElement, where );
- if( this.allowChildSort && this.sortableList ) this.sortableList.addItems( anElement );
-
- // reset scrollContexts
- var listItemInstance = anElement.retrieve("Class");
- listItemInstance.scrollContext = 'window';
- listItemInstance.resetFileDepth();
- listItemInstance.UIElements.each( function( uiInstance ){
- uiInstance.scrollContext = "window";
- });
- anElement.tween( "opacity", 1 );
- anElement.getElement(".itemControls" ).getElement(".delete").removeClass("hidden");
+/*
+ Section: mop.modules.navigation.NavigtionDelegate Interface Requests and Response
+*/
- if( this.allowChildSort != null ) this.onOrderChanged();
- listItemInstance = where = null;
- },
+ onNodeSelected: function( nodeId ){
+ console.log( this.toString(), "onNodeSelected", nodeId );
+ this.clearPage();
+ this.pageContent.spin();
+ this.requestPage( nodeId );
+ },
+
+/*
+ Section: mop.modules.navigation.NavigationDataSource Interface Requests and Response
+*/
+
+ requestTier: function( parentId, callback ){
+ var url = "ajax/compound/navigation/getTier/" + parentId;
+ this.JSONSend( url, null, { onComplete: function(){
+ this.requestTierResponse();
+ callback();
+ }.bind( this ) } );
+ mop.util.setObjectId( parentId );
+ },
- onItemDeleted: function( anItem ){
- this.items.erase( anItem );
- anItem.destroy();
- delete anItem;
- anItem = null;
-
- mop.util.EventManager.broadcastEvent( "resize" );
- //again we should be removing from this.items
- //this is a potential memory leak, since adding and removing many times will leave
- //baggage around since it's not removed from this.items, now we have a class with all vars and methods deleted
- },
-
- makeSortable: function(){
- if( this.allowChildSort && !this.sortableList ){
- this.sortableList = new mop.ui.Sortable( this.listing, this, $( 'body' ) );
- }else if( this.allowChildSort ){
- this.sortableList.attach();
- }
- this.oldSort = this.serialize();
- },
-
- toggleSortable: function(){
- if( this.sortableList ){ this.removeSortable( this.sortableList ); }else{ this.makeSortable(); }
- console.log( "toggleSortable", this.sortableList );
- },
-
- resumeSort: function(){
- if( this.allowChildSort && this.sortableList ) this.sortableList.attach();
- },
-
- suspendSort: function(){
- if( this.allowChildSort && this.sortableList ) this.sortableList.detach();
- },
-
- removeSortable: function( aSortable ){
- aSortable.detach();
- delete aSortable;
- aSortable = null;
- },
-
- onOrderChanged: function(){
- var newOrder = this.serialize();
- clearInterval( this.submitDelay );
- this.submitDelay = this.submitSortOrder.periodical( 3000, this, newOrder.join(",") );
- newOrder = null;
- },
-
- submitSortOrder: function( newOrder ){
- if( this.allowChildSort && this.oldSort != newOrder ){
- clearInterval( this.submitDelay );
- this.submitDelay = null;
- this.JSONSend( "saveSortOrder", { sortorder: newOrder } );
- this.oldSort = newOrder;
- }
- },
+ requestTierResponse: function( json ){
+ if( !json.returnValue ) console.log( this.toString(), "requestTier error:", json.response.error );
+ },
- serialize:function(){
- var sortArray = [];
- var children = this.listing.getChildren("li");
- children.each( functi