Permalink
Browse files

navi refactor

  • Loading branch information...
1 parent a1ab56c commit 1ca436b2fbaa6803695c297faad0adbabcb818a3 Thiago de Mello Bueno committed May 3, 2011
View
@@ -7,26 +7,13 @@ if( Browser.Engine.trident4 ) window.location.href = $(document).getElement("hea
Class.Mutators.toString = Class.Mutators.valueOf = $arguments(0);
/*
- Function: buildConsoleObject
- Quick hack to prevent browsers w/o a console, or firebug from generating errors when console functions are called. Gets called immediately
+Quick hack to prevent browsers w/o a console, or firebug from generating errors when console functions are called.
+Builds an empty console object with proper members if none is present.
*/
-function buildConsoleObject(){
- if (!window.console ){
- var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
- window.console = {};
- for (var i = 0; i < names.length; ++i){
- window.console[names[i]] = function() {};
- }
- names = null;
- }else if( Browser.Engine.webkit ){
- var names = [ "debug", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
- for (var i = 0; i < names.length; ++i){
- window.console[names[i]] = function() {};
- }
- names = null;
- }
+var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
+if (!window.console ){ window.console = {};
+ for (var i = 0; i < names.length; ++i) window.console[names[i]] = function() {};
}
-buildConsoleObject();
/*
Section: Extending Mootools
@@ -51,9 +38,9 @@ Element.implement({
Note: calls getSiblings, returns first element of collection
*/
Element.implement({
- getSibling: function(match,nocache) {
- return this.getSiblings(match,nocache)[0];
- }
+ getSibling: function(match,nocache) {
+ return this.getSiblings(match,nocache)[0];
+ }
});
/*
@@ -215,7 +202,7 @@ mop.util.getAppURL = function(){
Returns: {String} value
*/
mop.util.getValueFromClassName = function( key, aClassName ){
- if(!aClassName) return;
+ if(!aClassName) return false;
var classNames = aClassName.split( " " );
var result = null;
classNames.each( function( className ){
@@ -475,7 +462,6 @@ mop.MoPObject = new Class({
destroy: function(){
this.element.destroy();
this.element.eliminate( "Class" );
- delete this.element, this.elementClass;
this.element = this.elementClass = this.marshal = null
}
@@ -535,7 +521,6 @@ mop.util.HistoryManager = new Class({
locationListener: null,
appState: new Hash(),
_instance: null,
- appState: new Hash(),
registeredEvents: new Hash(),
initialize: function(){
@@ -647,8 +632,6 @@ mop.util.LoginMonitor = new Class({
if( loginTimeOutClassName != undefined ){
this.secondsOfInactivityTilPrompt = Number( loginTimeOutClassName ) * 1000;
- }else{
- this.secondsOfInactivityTilPrompt;
}
this.inactivityTimeout = this.onInactivity.periodical( this.secondsOfInactivityTilPrompt, this );
@@ -677,7 +660,7 @@ mop.util.LoginMonitor = new Class({
this.secondsIdle ++;
var secondsLeft = this.secondsTilLogout*.001 - this.secondsIdle;
- if( secondsLeft == 0 ){ this.logout() };
+ if( secondsLeft == 0 ){ this.logout() }
var minutesLeft = Math.floor( secondsLeft/60 );
secondsLeft = secondsLeft - ( minutesLeft * 60 );
this.dialogue.setContent( this.inactivityMessage.substitute( { inactiveMins: this.secondsOfInactivityTilPrompt/this.millisecondsInAMinute, minutes: minutesLeft, seconds: secondsLeft } ) );
@@ -745,22 +728,22 @@ mop.util.MD5 = function (string) {
function FF(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
- };
+ }
function GG(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
- };
+ }
function HH(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
- };
+ }
function II(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
- };
+ }
function ConvertToWordArray(string) {
var lWordCount;
@@ -783,8 +766,8 @@ mop.util.MD5 = function (string) {
lWordArray[lNumberOfWords-2] = lMessageLength<<3;
lWordArray[lNumberOfWords-1] = lMessageLength>>>29;
return lWordArray;
- };
-
+ }
+
function WordToHex(lValue) {
var WordToHexValue="",WordToHexValue_temp="",lByte,lCount;
for (lCount = 0;lCount<=3;lCount++) {
@@ -793,7 +776,7 @@ mop.util.MD5 = function (string) {
WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);
}
return WordToHexValue;
- };
+ }
function Utf8Encode(string) {
string = string.replace(/\r\n/g,"\n");
@@ -817,9 +800,8 @@ mop.util.MD5 = function (string) {
}
}
-
return utftext;
- };
+ }
var x=Array();
var k,AA,BB,CC,DD,a,b,c,d;
@@ -1,29 +1,13 @@
-/* *** GLOBAL ( NON CMS ) *** */
-
-/* reset.css */
-html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;}
-table {border-collapse:separate;border-spacing:0;}
-caption, th, td {text-align:left;font-weight:normal;}
-blockquote:before, blockquote:after, q:before, q:after {content:"";}
-blockquote, q {quotes:"" "";}
-a img {border:none;}
-
-html, body{
-
-}
-/* typography.css */
body {
color:#222;
background:#fff;
font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;
- font-size:75%;
+ font-size: .875em;
line-height: 18px;
padding-bottom:6em;
}
-h1, h2, h3, h4{
- font-weight:normal;color:#121212;
-}
+h1, h2, h3, h4, h5{ font-weight:normal;color:#121212; }
h1,
.h1{
@@ -176,7 +160,7 @@ blockquote {
font-style:italic;
}
-strong {font-weight:bold;}
+/*strong {font-weight:bold;}
em, dfn {font-style:italic;}
dfn {font-weight:bold;}
sup, sub {line-height:0;}
@@ -195,8 +179,8 @@ dl dt {font-weight:bold;}
dd {margin-left:1.5em;}
caption {
- background:#eee;
- padding: .75em;
+ background:#eee;
+ padding: .75em;
}
.small {font-size:.8em;margin-bottom:1.875em;line-height:1.875em;}
@@ -210,21 +194,24 @@ caption {
.first {margin-left:0;padding-left:0;}
.last {margin-right:0;padding-right:0;}
.top {margin-top:0;padding-top:0;}
-.bottom {margin-bottom:0;padding-bottom:0;}
+.bottom {margin-bottom:0;padding-bottom:0;}*/
#container {
- width: 900px;
- height: 100%;
+/* width: 900px;
+*/ height: 100%;
margin:0 auto;
}
-.block{ display: block; }
-.clear { clear:both; }
.floatLeft{ float: left; }
.floatRight{ float:right; }
-.clearLeft{ clear: left; }
-.clearRight{ clear: right; }
+.clearFix:after {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+}
legend {font-weight:bold;font-size:.8em;}
.error, .notice, .success {
@@ -26,7 +26,13 @@ mop.modules.CMS = new Class({
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 ]";
},
@@ -38,6 +44,7 @@ mop.modules.CMS = new Class({
this.pageContent.spin();
var url = mop.util.getAppURL() + "ajax/html/cms/getPage/" + pageId;
mop.util.JSONSend( url, null, { onSuccess: this.onPageLoaded.bind( this ) } );
+ console.log( "loadPage", url );
mop.util.setObjectId( pageId );
},
@@ -54,9 +61,9 @@ mop.modules.CMS = new Class({
Arguments:
pageJSON - Object : { css: [ "pathToCSSFile", "pathToCSSFile", ... ], js: [ "pathToJSFile", "pathToJSFile", "pathToJSFile", ... ], html: "String" }
*/
- onPageLoaded: function( pageJSON ){
-
- var pageData = new Hash( pageJSON.response );
+ onPageLoaded: function( response ){
+ console.log( ">>> ", response );
+ var pageData = response.response;
pageData.css.each( function( styleSheetURL, index ){
if( !this.loadedCSS.contains( styleSheetURL ) ) mop.util.loadStyleSheet( styleSheetURL );
this.loadedCSS.push( styleSheetURL );
@@ -11,9 +11,20 @@
<base href="<?=Kohana::config('config.site_protocol');?>://<?=$_SERVER['HTTP_HOST'];?><?=Kohana::config('config.site_domain');?>" />
- <?=$stylesheet;?>
<?=$javascript;?>
-
+
+ <?=$stylesheet;?>
+
+ <!--[if IE]>
+ <style type="text/css">
+ .clearfix {
+ zoom: 1; /* triggers hasLayout */
+ } /* Only IE can see inside the conditional comment
+ and read this CSS rule. Don't ever use a normal HTML
+ comment inside the CC or it will close prematurely. */
+ </style>
+ <![endif]-->
+
</head>
<body class=" loginTimeOut-<?=Kohana::config('mop.loginTimeOut');?>">
<div id="container" class="container_12">
Oops, something went wrong.

0 comments on commit 1ca436b

Please sign in to comment.