Merged from 1.9 ::
authorurs_hunkler <urs_hunkler>
Tue, 12 Feb 2008 21:29:16 +0000 (21:29 +0000)
committerurs_hunkler <urs_hunkler>
Tue, 12 Feb 2008 21:29:16 +0000 (21:29 +0000)
MDL-13444 :: removed the jQuery library and use direct JavaScript instead. That's much faster.
MDL-12078 :: Changed them calles from themewww to httpsthemwww (MDL-12078). MDL-13421 :: corrected left padding in admin block

theme/custom_corners/footer.html
theme/custom_corners/header.html
theme/custom_corners/js/CSSClass.js [new file with mode: 0644]
theme/custom_corners/js/CSSClass_min.js [new file with mode: 0644]
theme/custom_corners/js/js.php [new file with mode: 0644]
theme/custom_corners/meta.php
theme/custom_corners/styles_ie6.css
theme/custom_corners/user_styles.css

index 5fc82ffaa4295a0f13d6b30d5290c7986b5a6b32..cce3af0ec7be2886d58b0884c863e4fa4863bcd3 100644 (file)
@@ -34,9 +34,7 @@ if (!$inpopup) {
 </div> <!-- end page div -->
 <script type="text/javascript">
 /* <![CDATA[ */
-    $(document).ready(function() {
-        script.init();
-    });
+    script.init();
 /* ]]> */
 </script>
 </body>
index 048b32d96cfd92f7c8ae7049a5b881bce76b19c6..c8c311f8c2a18535719e28ded4e34b217b0cd87c 100644 (file)
@@ -4,13 +4,12 @@
     <?php echo $meta ?>
     <meta name="keywords" content="moodle, <?php echo $title ?> " />
     <title><?php echo $title ?></title>
-    <link rel="shortcut icon" href="<?php echo $CFG->themewww .'/'. current_theme() ?>/favicon.ico" />
+    <link rel="shortcut icon" href="<?php echo $CFG->httpsthemewww .'/'. current_theme() ?>/favicon.ico" />
 
-    <?php include($CFG->themedir.'/custom_corners/ui/chameleon.php'); ?>
-    <?php include("$CFG->javascript"); ?>
-    <?php include($CFG->themedir.'/custom_corners/js/jquery.php'); ?>
-
-    <?php
+    <?php 
+        include($CFG->themedir.'/custom_corners/ui/chameleon.php');
+        include("$CFG->javascript");
+        include($CFG->themedir.'/custom_corners/js/js.php');
         
         // check if page is opened within a popup window
         if (function_exists('is_in_popup')) {
         
         //replace classlist with new one
         $bodytags = str_replace($classes[0], 'class="'.implode(' ', $classlist).'"', $bodytags);
-        
-
-//        $infooutput = '<div id="infocontent">&nbsp;</div>';
-        
     ?>
 </head>
 
diff --git a/theme/custom_corners/js/CSSClass.js b/theme/custom_corners/js/CSSClass.js
new file mode 100644 (file)
index 0000000..1f60ad8
--- /dev/null
@@ -0,0 +1,42 @@
+/**
+ * CSSClass.js: utilities for manipulating the CSS class of an HTML element.
+ * 
+ * This module defines a single global symbol named CSSClass.  This object
+ * contains utility functions for working with the class attribute (className
+ * property) of HTML elements.  All functions take two arguments: the element
+ * e being tested or manipulated and the CSS class c that is to be tested,
+ * added, or removed.  If element e is a string, it is taken as an element
+ * id and passed to document.getElementById().
+ */
+var CSSClass = {};  // Create our namespace object
+
+// Return true if element e is a member of the class c; false otherwise
+CSSClass.is = function(e, c) {
+    if (typeof e == "string") e = document.getElementById(e); // element id
+
+    // Before doing a regexp search, optimize for a couple of common cases.
+    var classes = e.className;
+    if (!classes) return false;    // Not a member of any classes
+    if (classes == c) return true; // Member of just this one class
+
+    // Otherwise, use a regular expression to search for c as a word by itself
+    // \b in a regular expression requires a match at a word boundary.
+    return e.className.search("\\b" + c + "\\b") != -1;
+};
+
+// Add class c to the className of element e if it is not already there.
+CSSClass.add = function(e, c) {
+    if (typeof e == "string") e = document.getElementById(e); // element id
+    if (CSSClass.is(e, c)) return; // If already a member, do nothing
+    if (e.className) c = " " + c;  // Whitespace separator, if needed
+    e.className += c;              // Append the new class to the end
+};
+
+// Remove all occurrences (if any) of class c from the className of element e
+CSSClass.remove = function(e, c) {
+    if (typeof e == "string") e = document.getElementById(e); // element id
+    // Search the className for all occurrences of c and replace with "".
+    // \s* matches any number of whitespace characters.
+    // "g" makes the regular expression match any number of occurrences
+    e.className = e.className.replace(new RegExp("\\b"+ c+"\\b\\s*", "g"), "");
+};
\ No newline at end of file
diff --git a/theme/custom_corners/js/CSSClass_min.js b/theme/custom_corners/js/CSSClass_min.js
new file mode 100644 (file)
index 0000000..652a00b
--- /dev/null
@@ -0,0 +1,2 @@
+
+var CSSClass={};CSSClass.is=function(e,c){if(typeof e=="string")e=document.getElementById(e);var classes=e.className;if(!classes)return false;if(classes==c)return true;return e.className.search("\\b"+c+"\\b")!=-1;};CSSClass.add=function(e,c){if(typeof e=="string")e=document.getElementById(e);if(CSSClass.is(e,c))return;if(e.className)c=" "+c;e.className+=c;};CSSClass.remove=function(e,c){if(typeof e=="string")e=document.getElementById(e);e.className=e.className.replace(new RegExp("\\b"+c+"\\b\\s*","g"),"");};
\ No newline at end of file
diff --git a/theme/custom_corners/js/js.php b/theme/custom_corners/js/js.php
new file mode 100644 (file)
index 0000000..e1fc893
--- /dev/null
@@ -0,0 +1,45 @@
+<script src="<?php echo $CFG->httpsthemewww ?>/custom_corners/js/CSSClass_min.js" type="text/javascript"></script>
+
+<script type="text/javascript" charset="utf-8">
+/* <![CDATA[ */
+    var script = {
+        
+        corrections: function () {
+            if (top.user) {
+                top.document.getElementsByTagName('frameset')[0].rows = "117,30%,0,200";
+            }
+            
+            // check for layouttabel and add haslayouttable class to body
+            var tagname = 'nolayouttable';
+            if (document.getElementById('middle-column')) {
+                var lc = document.getElementById('left-column');
+                var rc = document.getElementById('right-column');
+                if ( lc && rc ) {
+                    tagname = 'haslayouttable rightandleftcolumn';
+                } else if (lc) {
+                    tagname = 'haslayouttable onlyleftcolumn';
+                } else if (rc) {
+                    tagname = 'haslayouttable onlyrightcolumn';
+                } else {
+                    tagname = 'haslayouttable onlymiddlecolumn';
+                }
+            }
+            
+            function setbodytag (tagname) {
+                var bd = document.getElementsByTagName('body')[0];
+                if (bd) {
+                    CSSClass.add(bd, tagname);
+                } else {
+                    setTimeout(function() { setbodytag(tagname) }, 30);
+                }
+            }
+            
+            setTimeout(function() { setbodytag(tagname) }, 30);
+        },
+        
+        init: function() {
+            script.corrections();
+        }
+    };
+/* ]]> */
+</script>
\ No newline at end of file
index 6ab875d56a59d3b4629434ffeae13d63fc4a39e7..7c94e3f00bd8d464950778365ccc171120ea126b 100644 (file)
@@ -1,5 +1,5 @@
 <!--[if IE 7]>
-    <link rel="stylesheet" type="text/css" href="<?php echo $CFG->themewww ?>/custom_corners/styles_ie7.css" />
+    <link rel="stylesheet" type="text/css" href="<?php echo $CFG->httpsthemewww ?>/custom_corners/styles_ie7.css" />
     
        <script type="text/javascript">
        /* <![CDATA[ */
@@ -8,7 +8,7 @@
        </script>
 <![endif]-->
 <!--[if IE 6]>
-    <link rel="stylesheet" type="text/css" href="<?php echo $CFG->themewww ?>/custom_corners/styles_ie6.css" />
+    <link rel="stylesheet" type="text/css" href="<?php echo $CFG->httpsthemewww ?>/custom_corners/styles_ie6.css" />
     
        <script type="text/javascript">
        /* <![CDATA[ */
index d0bf7d3ac894d138d1887de099c00dc8c6e575f6..a1c62bddf76aef9fcc6954bed96e470c4bb22a06 100644 (file)
@@ -50,6 +50,9 @@ div.sideblock ul.list li {
   padding-left: 18px;
   margin-left: 19px;
 }
+div.block_admin div.column.c0 {
+  margin-left: -18px;
+}
 #notes-index #content-i3,
 #mod-chat-view #content-i3 {
   padding-bottom: 15px;
index 3809faac473f7c275a68ac46fae6d33160b680e2..3b5ce98d79592d2643dd1c8ce2502bb836b715d6 100644 (file)
@@ -1,18 +1,3 @@
-div#infowrapper {
-  position: fixed;
-  overflow: auto;
-  top: 1px;
-  left: 25%;
-  right: 25%;
-  width: 450px;
-  padding: 3px;
-  opacity: 0.9;
-  color: #000;
-  background-color: #ffffcc;
-  z-index: 200;
-  border: 2px solid #FF0;
-  min-height: 2px;
-}
 body {
   font-size: 100%;
   color: #333333;
@@ -429,9 +414,15 @@ body#admin-roles-manage td.generalboxcontent table td {
   padding-left: 0.5em;
   padding-right: 0.5em;
 }
-body#admin-roles-override td.cell.c1 {\r  padding-top: 0.5em;\r}
-body#admin-roles-assign td.cell.c3 {\r  padding-top: 0.5em;\r}
-body#admin-roles-assign td.cell.c1 {\r  padding-top: 0.5em;\r}
+body#admin-roles-override td.cell.c1 {
+  padding-top: 0.5em;
+}
+body#admin-roles-assign td.cell.c3 {
+  padding-top: 0.5em;
+}
+body#admin-roles-assign td.cell.c1 {
+  padding-top: 0.5em;
+}
 body#admin-roles-override td.capcurrent {
   background-color: #eeeeee;
   border: 1px solid #cccccc;