diff --git a/blocks/dock.js b/blocks/dock.js index bf996b3a045..6ac8939477b 100644 --- a/blocks/dock.js +++ b/blocks/dock.js @@ -91,24 +91,32 @@ M.core_dock.init = function(Y) { } } - // Start the construction of the dock - dock = Y.Node.create('
'); - this.nodes.container = Y.Node.create('
'); - dock.append(this.nodes.container); + var dock = Y.one('#dock'); + if (!dock) { + // Start the construction of the dock + dock = Y.Node.create('
') + .append(Y.Node.create('
')); + this.nodes.body.append(dock); + } else { + dock.addClass(css.dock+'_'+this.cfg.position+'_'+this.cfg.orientation); + } + if (Y.UA.ie > 0 && Y.UA.ie < 7) { + // Adjust for IE 6 (can't handle fixed pos) + dock.setStyle('height', dock.get('winHeight')+'px'); + } + // Store the dock + this.nodes.dock = dock; + this.nodes.container = dock.one('.'+css.dockeditemcontainer); + if (Y.all('.block.dock_on_load').size() == 0) { // Nothing on the dock... hide it using CSS dock.addClass('nothingdocked'); } else { this.nodes.body.addClass(this.css.body); } - // Store the dock - this.nodes.dock = dock; + this.fire('dock:beforedraw'); - this.nodes.body.append(dock); - if (Y.UA.ie > 0 && Y.UA.ie < 7) { - // Adjust for IE 6 (can't handle fixed pos) - dock.setStyle('height', dock.get('winHeight')+'px'); - } + // Add a removeall button // Must set the image src seperatly of we get an error with XML strict headers var removeall = Y.Node.create(''+M.str.block.undockall+''); diff --git a/blocks/navigation/navigation.js b/blocks/navigation/navigation.js index 38672465672..98151fd4744 100644 --- a/blocks/navigation/navigation.js +++ b/blocks/navigation/navigation.js @@ -111,7 +111,7 @@ M.block_navigation.classes.tree = function(Y, id, properties) { for (var i in this.expansions) { var expandablenode = Y.one('#'+this.expansions[i].id); if (expandablenode) { - expandablenode.on('ajaxload|click', this.init_load_ajax, this, this.expansions[i]); + expandablenode.on('ajaxload|click', this.init_load_ajax, this, this.expansions[i]); M.block_navigation.expandablebranchcount++; } else if (M.cfg.debug) { Y.one(document.body).append(Y.Node.create('
Expandable node within navigation was missing [#'+this.expansions[i].id+']
')); diff --git a/blocks/navigation/styles.css b/blocks/navigation/styles.css index c02e2c17ffa..9da88350e28 100644 --- a/blocks/navigation/styles.css +++ b/blocks/navigation/styles.css @@ -1,12 +1,6 @@ -/** JavaScript state rules **/ -.jsenabled .block_navigation.dock_on_load, -.block_navigation .block_tree_box .requiresjs {display:none;} -.jsenabled .block_navigation .block_tree_box .requiresjs {display:inline;} - /** General display rules **/ .block_navigation .block_tree {margin:5px;padding-left:0px;overflow:visible;} -.block_navigation .block_tree li {margin:0;list-style: none;} - +.block_navigation .block_tree li {margin:3px;list-style: none;padding:0;} .block_navigation .block_tree li.item_with_icon > p {position:relative;} .block_navigation .block_tree li.item_with_icon > p img {vertical-align:middle;position:absolute;left:0;top:3px} @@ -19,10 +13,16 @@ .block_navigation .block_tree .root_node.leaf {padding-left:0px;} .block_navigation .block_tree .current_branch {font-weight:bold;} .block_navigation .block_tree .depth_1.current_branch ul {font-weight:normal;} + .jsenabled .block_navigation .block_tree .tree_item.branch {cursor:pointer;} .jsenabled .block_navigation .block_tree .tree_item.emptybranch {background-image: url([[pix:t/collapsed_empty]]);background-position: center left;background-repeat: no-repeat;} .jsenabled .block_navigation .block_tree .collapsed ul {display: none;} .jsenabled .block_navigation .block_tree .collapsed .tree_item.branch {background-image: url([[pix:t/collapsed]]);} +/** JavaScript state rules **/ +.jsenabled .block_navigation.dock_on_load, +.block_navigation .block_tree_box .requiresjs {display:none;} +.jsenabled .block_navigation .block_tree_box .requiresjs {display:inline;} + /** Internet explorer specific rules **/ .ie6 .block_navigation .block_tree .tree_item {width:100%;} \ No newline at end of file diff --git a/lib/outputlib.php b/lib/outputlib.php index 47ffd18e44a..3be88b56d2b 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -606,7 +606,7 @@ class theme_config { $urls = array(); if ($rev > -1) { - if (check_browser_version('MSIE', 5) and !check_browser_version('MSIE', 8)) { + if (check_browser_version('MSIE', 5)) { // We need to split the CSS files for IE $urls[] = new moodle_url($CFG->httpswwwroot.'/theme/styles.php', array('theme'=>$this->name,'rev'=>$rev, 'type'=>'plugins')); $urls[] = new moodle_url($CFG->httpswwwroot.'/theme/styles.php', array('theme'=>$this->name,'rev'=>$rev, 'type'=>'parents')); @@ -646,7 +646,10 @@ class theme_config { if (check_browser_version('MSIE', 5)) { // lalala, IE does not allow more than 31 linked CSS files from main document $urls[] = new moodle_url($CFG->httpswwwroot.'/theme/styles_debug.php', array('theme'=>$this->name, 'type'=>'ie', 'subtype'=>'plugins')); - $urls[] = new moodle_url($CFG->httpswwwroot.'/theme/styles_debug.php', array('theme'=>$this->name, 'type'=>'ie', 'subtype'=>'parents')); + foreach ($css['parents'] as $parent=>$sheets) { + // We need to serve parents individually otherwise we may easily exceed the style limit IE imposes (4096) + $urls[] = new moodle_url($CFG->httpswwwroot.'/theme/styles_debug.php', array('theme'=>$this->name,'type'=>'ie', 'subtype'=>'parents', 'sheet'=>$parent)); + } $urls[] = new moodle_url($CFG->httpswwwroot.'/theme/styles_debug.php', array('theme'=>$this->name, 'type'=>'ie', 'subtype'=>'theme')); } else { diff --git a/lib/outputrequirementslib.php b/lib/outputrequirementslib.php index b832086b11c..d7291e8f84b 100644 --- a/lib/outputrequirementslib.php +++ b/lib/outputrequirementslib.php @@ -860,7 +860,7 @@ class page_requirements_manager { * @return string */ protected function get_yui3lib_headcode() { - $code = $this->yui3loader->css() . $this->yui3loader->script(); + $code = $this->yui3loader->tags(); // unfortunately yui loader does not produce xhtml strict code, so let's fix it for now $code = str_replace('&', '&', $code); $code = str_replace('&', '&', $code); diff --git a/theme/base/style/pagelayout.css b/theme/base/style/pagelayout.css index b7ea5407343..a8fa4842e95 100644 --- a/theme/base/style/pagelayout.css +++ b/theme/base/style/pagelayout.css @@ -6,9 +6,9 @@ * #page * #page-header * #page-content - * | #regions + * | #region-main-box * | #region-post-box - * | #region-main + * | #region-main-wrap * | | #region-main * | | .region-content * | #region-pre @@ -28,14 +28,14 @@ ****/ body {margin:auto 0px;width:auto;} -#page {width:100%;} +#page {width:100%;position:relative;} #page-header {float:left;width:100%;} #page-content {clear:both;float:left;overflow:hidden;position:relative;width:100%;min-width:900px;} #page-content #region-main-box {float:left;left:200px;position:relative;width:200%;} #page-content #region-main-box #region-post-box {float:left;left:50%;margin-left:-400px;position:relative;width:100%;} #page-content #region-main-box #region-post-box #region-main-wrap {float:right;position:relative;right:100%;width:50%;} #page-content #region-main-box #region-post-box #region-main-wrap #region-main {margin-right:0px;margin-left:400px;overflow:hidden;} -#page-content #region-main-box #region-post-box #region-pre {float:left;left:200px;margin-left:-50%;overflow:hidden;position:relative;width:200px;} +#page-content #region-main-box #region-post-box #region-pre {float:left;left:200px;overflow:hidden;position:relative;width:200px;margin-left:-50%;} #page-content #region-main-box #region-post-box #region-post {float:left;left:0px;overflow:hidden;position:relative;width:200px;} #page-content #region-main-box .region-content {overflow:hidden;padding:10px;} #page-footer {clear:both;float:left;width:100%;} diff --git a/theme/javascript.php b/theme/javascript.php index ff02f39b2c9..6e1e11a0108 100644 --- a/theme/javascript.php +++ b/theme/javascript.php @@ -95,7 +95,7 @@ function send_cached_js($jspath) { header('Expires: '. gmdate('D, d M Y H:i:s', time() + $lifetime) .' GMT'); header('Pragma: '); header('Accept-Ranges: none'); - header('Content-Type: application/x-javascript'); + header('Content-Type: application/javascript'); if (!min_enable_zlib_compression()) { header('Content-Length: '.filesize($jspath)); } @@ -110,7 +110,7 @@ function send_uncached_js($js) { header('Expires: '. gmdate('D, d M Y H:i:s', time() + 2) .' GMT'); header('Pragma: '); header('Accept-Ranges: none'); - header('Content-Type: application/x-javascript'); + header('Content-Type: application/javascript'); header('Content-Length: '.strlen($js)); echo $js; diff --git a/theme/standard/style/blocks.css b/theme/standard/style/blocks.css index e32429f352a..ba56314ce82 100644 --- a/theme/standard/style/blocks.css +++ b/theme/standard/style/blocks.css @@ -3,7 +3,8 @@ .block .header {border-bottom:1px solid #DDD;border-color: #dddddd;} .block .header h2 {margin-top:2px;font-size:1em;} .block .header .block_action {margin:0 4px;} -.block .header .block_action img {width:11px; height:11px;} +.block .header .block_action img, +.block .header .block_action input {width:11px; height:11px;} .block .content {border-color: #dddddd;background-color:#FCFCFC;} .block .content hr {border-top-color:#999999;} .block .header .commands {font-size:0.9em;clear:both;} @@ -14,7 +15,7 @@ .block h2.header {text-align: left;margin:0;padding:4px;padding-top:0;border-bottom-width: 0;} .block .content h2 {text-align: left;margin:1.5em 0 0;padding:0;} .block .content h3 {text-align: left;} -.block .content hr {height:1px;margin-top:4px;margin-bottom:4px;border:none;border-top:1px solid;} +.block .content hr {height:1px;margin-top:4px;margin-bottom:4px;border:none;border-top:1px solid;padding:0;} .block .content .head {margin-top: 10px;} .block .header .icon.hide, .block .header .icon.edit {margin-right: 6px;} diff --git a/theme/styles_debug.php b/theme/styles_debug.php index 74b87dfdceb..88cac1d75e5 100644 --- a/theme/styles_debug.php +++ b/theme/styles_debug.php @@ -67,8 +67,21 @@ if ($type === 'ie') { } else if ($subtype === 'parents') { $sendcss = array(); - foreach ($css['parents'] as $parent=>$sheets) { - $sendcss = array_merge($sendcss, $sheets); + if (empty($sheet)) { + // If not specific parent has been specified as $sheet then build a + // collection of @import statements into this one sheet. + // We shouldn't ever actually get here, but none the less we'll deal + // with it incase we ever do. + // @import statements arn't processed until after concurrent CSS requests + // making them slightly evil. + foreach (array_keys($css['parents']) as $sheet) { + $sendcss[] = "@import url(styles_debug.php?theme=$themename&type=$type&subtype=$subtype&sheet=$sheet);"; + } + } else { + // Build up the CSS for that parent so we can serve it as one file. + foreach ($css[$subtype][$sheet] as $parent=>$css) { + $sendcss[] = $css; + } } $sendcss = implode("\n\n", $sendcss); $sendcss = str_replace("\n", "\r\n", $sendcss); diff --git a/theme/yui_combo.php b/theme/yui_combo.php index 150bbe947a7..53be0d71ab0 100644 --- a/theme/yui_combo.php +++ b/theme/yui_combo.php @@ -38,7 +38,7 @@ $parts = trim($parts, '&'); // find out what we are serving - only one type per request $content = ''; if (substr($parts, -3) === '.js') { - $mimetype = 'application/x-javascript'; + $mimetype = 'application/javascript'; } else if (substr($parts, -4) === '.css') { $mimetype = 'text/css'; } else {