[geeklog-cvs] geeklog: Denim: consolidated the scripts

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Tue May 8 10:21:11 EDT 2012


changeset 8687:07a91462ec52
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/07a91462ec52
user: dengen
date: Tue May 08 23:18:21 2012 +0900
description:
Denim: consolidated the scripts

diffstat:

 public_html/layout/denim/javascript/app.js         |  160 ---------------------
 public_html/layout/denim/javascript/script.js      |    8 +
 public_html/layout/denim/javascript/tabs.js        |   29 ---
 public_html/layout/denim/javascript/tinynav.min.js |    3 -
 4 files changed, 8 insertions(+), 192 deletions(-)

diffs (236 lines):

diff -r 46deb48d3da4 -r 07a91462ec52 public_html/layout/denim/javascript/app.js
--- a/public_html/layout/denim/javascript/app.js	Tue May 08 23:14:54 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-/* 
-* Skeleton V1.0.3
-* Copyright 2011, Dave Gamache
-* www.getskeleton.com
-* Free to use under the MIT license.
-* http://www.opensource.org/licenses/mit-license.php
-* 7/17/2011
-* un-jQuerified by Eric Kever
-*/	
-
-(function(){
-	var Skeleton = {
-		getElementsByClassName : function(context, cls){
-			if(context.getElementsByClassName){
-				return context.getElementsByClassName(cls);
-			}
-			
-			var ele = context.getElementsByTagName("*"),
-				ret = [],
-				current,
-				classes;
-			
-			for(var i = 0, j = ele.length; i < j; i++){
-				current = ele[i];
-				classes = (current.getAttribute("className") || current.className).split(" ");
-				for(var k = 0, l = classes.length; k < l; k++){
-					if(classes[k] === cls){
-						ret.push(current);
-						break;
-					}
-				}
-			}
-			
-			return ret;
-		},
-		
-		filterTags : function(list, tags){
-			var exists = false;
-			
-			for(var i = 0, j = list.length; i < j; i++){
-				for(var k = 0, l = tags.length; k < l; k++){
-					if(list[i].tagName === tags[k]){
-						exists = true;
-						break;
-					}
-				}
-				if(exists === true){
-					list.splice(i, 1);
-				}
-			}
-			
-			return list;
-		},
-		
-		addClass : function(element, name){
-			var classes = (element.getAttribute("className") || element.className).split(" "),
-				exists = false;
-			
-			for(i = 0, j = classes.length; i < j; i++){
-				if(classes[i] === name){
-					exists = true;
-					break;
-				}
-			}
-			if(!exists){
-				classes.push(name);
-				element.className = classes.join(" ");
-			}
-		},
-		
-		removeClass : function(element, name){
-			var classes = (element.getAttribute("className") || element.className).split(" "),
-				exists = false;
-			
-			for(var i = 0, j = classes.length; i < j; i++){
-				if(classes[i] === name){
-					exists = true;
-					break;
-				}
-			}
-			if(exists){
-				classes.splice(i, 1);
-				element.className = classes.join(" ");
-			}
-		},
-		
-		swapClass : function(element, from, to){
-			Skeleton.removeClass(element, from);
-			Skeleton.addClass(element, to);
-		},
-		
-		addListener : function(element, on, fn, last){
-			last = (last || false);
-			var BH;
-			
-			if(window.addEventListener){  //AddEventListener takes precedence here
-				BH = "addEventListener";
-			}else if(window.attachEvent){
-				BH = "attachEvent";
-				on = "on" + on;
-			}
-			
-			element[BH](on, function(e){
-				var event = e || window.event;
-				return fn.call(element, event);  //Force it to call the handler in the proper context (IE 7 & 8 do not)
-			}, last);
-		},
-		
-		doFancyExpensiveTabThings : function(){
-			var tabs = Skeleton.filterTags(Skeleton.getElementsByClassName(document, "tabs"), ["ul"]);
-			
-			for(var i = 0, j = tabs.length; i < j; i++){
-				(function(){  //This is necessary to isolate each individual tab set in its own scope
-					var tabNum = i,
-						tabList = tabs[tabNum].getElementsByTagName("li");
-					
-					for(var k = 0, l = tabList.length; k < l; k++){
-						Skeleton.addClass(document.getElementById(tabList[k].getElementsByTagName("a")[0].href.substr(tabList[k].getElementsByTagName("a")[0].href.indexOf("#") + 1)), "hidden");
-						
-						Skeleton.addListener(tabList[k].getElementsByTagName("a")[0], "click", function(e){
-							var contentLocation = this.href.substr(this.href.indexOf("#")),
-								contentElement,
-								siblings;
-							
-							if(contentLocation.charAt(0) === "#"){
-								if(e.preventDefault){
-									e.preventDefault();
-								}else{
-									e.returnValue = false;
-									e.cancelBubble = true;
-								}
-								
-								for(var m = 0; m < k; m++){
-									Skeleton.removeClass(tabList[m].getElementsByTagName("a")[0], "active");
-								}
-								
-								Skeleton.addClass(this, "active");
-								
-								contentElement = document.getElementById(contentLocation.substr(1));
-								Skeleton.swapClass(contentElement, "hidden", "active");
-								
-								siblings = contentElement.parentNode.getElementsByTagName("li");
-								for(var m = 0, n = siblings.length; m < n; m++){
-									if(siblings[m] !== contentElement){
-										Skeleton.swapClass(siblings[m], "active", "hidden");
-									}
-								}
-							}
-							return false;
-						});
-					}
-				})();
-			}
-		}
-	};
-	
-	window.Skeleton = Skeleton;
-})();
-
-Skeleton.addListener(window, "load", Skeleton.doFancyExpensiveTabThings);
\ No newline at end of file
diff -r 46deb48d3da4 -r 07a91462ec52 public_html/layout/denim/javascript/script.js
--- a/public_html/layout/denim/javascript/script.js	Tue May 08 23:14:54 2012 +0900
+++ b/public_html/layout/denim/javascript/script.js	Tue May 08 23:18:21 2012 +0900
@@ -1,3 +1,4 @@
+
 function FixHTML(leftblocksID, centerblocksID, rightblocksID) {
     var ua = navigator.userAgent.toLowerCase();
     var is_old_ie = (ua.indexOf("msie") != -1) && (ua.indexOf("msie 8") == -1) &&
@@ -23,6 +24,7 @@
     document.body.setAttribute(classattr, classValue);
 }
 
+
 function delconfirm() {
   return (confirm("Delete this?")) ? true : false;
 }
@@ -31,6 +33,12 @@
   return (confirm("Send this?")) ? true : false;
 }
 
+
+/*! http://tinynav.viljamis.com v1.03 by @viljamis */
+(function(a,i,g){a.fn.tinyNav=function(j){var c=a.extend({active:"selected",header:!1},j);return this.each(function(){g++;var h=a(this),d="tinynav"+g,e=".l_"+d,b=a("<select/>").addClass("tinynav "+d);if(h.is("ul,ol")){c.header&&b.append(a("<option/>").text("Navigation"));var f='<option value="">Jump to...</option>';h.addClass("l_"+d).find("a").each(function(){f+='<option value="'+a(this).attr("href")+'">'+a(this).text()+"</option>"});b.append(f);c.header||b.find(":eq("+a(e+" li").index(a(e+" li."+c.active))+")").attr("selected",!0);
+b.change(function(){i.location.href=a(this).val()});a(e).after(b)}})}})(jQuery,this,0);
+
+
 $(function() {
   $('#navigation_ul').tinyNav({
     active: 'selected'
diff -r 46deb48d3da4 -r 07a91462ec52 public_html/layout/denim/javascript/tabs.js
--- a/public_html/layout/denim/javascript/tabs.js	Tue May 08 23:14:54 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Skeleton V1.1
-* Copyright 2011, Dave Gamache
-* www.getskeleton.com
-* Free to use under the MIT license.
-* http://www.opensource.org/licenses/mit-license.php
-* 8/17/2011
-*/
-
-
-$('body').on('click', 'ul.tabs > li > a', function(e) {
-
-    //Get Location of tab's content
-    var contentLocation = $(this).attr('href');
-
-    //Let go if not a hashed one
-    if(contentLocation.charAt(0)=="#") {
-
-        e.preventDefault();
-
-        //Make Tab Active
-        $(this).parent().siblings().children('a').removeClass('active');
-        $(this).addClass('active');
-
-        //Show Tab Content & add active class
-        $(contentLocation).show().addClass('active').siblings().hide().removeClass('active');
-
-    }
-});
\ No newline at end of file
diff -r 46deb48d3da4 -r 07a91462ec52 public_html/layout/denim/javascript/tinynav.min.js
--- a/public_html/layout/denim/javascript/tinynav.min.js	Tue May 08 23:14:54 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-/*! http://tinynav.viljamis.com v1.03 by @viljamis */
-(function(a,i,g){a.fn.tinyNav=function(j){var c=a.extend({active:"selected",header:!1},j);return this.each(function(){g++;var h=a(this),d="tinynav"+g,e=".l_"+d,b=a("<select/>").addClass("tinynav "+d);if(h.is("ul,ol")){c.header&&b.append(a("<option/>").text("Navigation"));var f='<option value="">Jump to...</option>';h.addClass("l_"+d).find("a").each(function(){f+='<option value="'+a(this).attr("href")+'">'+a(this).text()+"</option>"});b.append(f);c.header||b.find(":eq("+a(e+" li").index(a(e+" li."+c.active))+")").attr("selected",!0);
-b.change(function(){i.location.href=a(this).val()});a(e).after(b)}})}})(jQuery,this,0);
\ No newline at end of file



More information about the geeklog-cvs mailing list