This commit is contained in:
parent
3480b7898a
commit
4549e8e610
6 changed files with 69 additions and 1 deletions
|
@ -155,3 +155,15 @@ webapp/web/js/detect.js
|
||||||
# PROBLEM? perhaps from www.dannyg.com, but what are the license restrictions?
|
# PROBLEM? perhaps from www.dannyg.com, but what are the license restrictions?
|
||||||
webapp/web/toggle.js
|
webapp/web/toggle.js
|
||||||
webapp/web/js/toggle.js
|
webapp/web/js/toggle.js
|
||||||
|
|
||||||
|
|
||||||
|
# Script for enabling new HTML5 semantic markup in IE browsers.
|
||||||
|
# remysharp.com/2009/01/07/html5-enabling-script/
|
||||||
|
webapp/web/js/html5.js
|
||||||
|
|
||||||
|
# selectivizr is a JavaScript utility that emulates CSS3 pseudo-classes and attribute selectors in Internet Explorer 6-8. selectivizr.com
|
||||||
|
webapp/web/js/selectivizr.js
|
||||||
|
|
||||||
|
# Supersleight jQuery Plugin for Transparent PNGs in IE6. allinthehead.com/retro/338/supersleight-jquery-plugin
|
||||||
|
webapp/web/js/supersleight.js
|
||||||
|
webapp/web/js/supersleightUtils.js
|
||||||
|
|
|
@ -353,6 +353,8 @@ public class FreemarkerHttpServlet extends VitroHttpServlet {
|
||||||
|
|
||||||
map.put("themeDir", themeDir);
|
map.put("themeDir", themeDir);
|
||||||
|
|
||||||
|
map.put("themeDir", themeDir);
|
||||||
|
|
||||||
map.put("stylesheets", getStylesheetList(themeDir));
|
map.put("stylesheets", getStylesheetList(themeDir));
|
||||||
map.put("scripts", getScriptList(themeDir));
|
map.put("scripts", getScriptList(themeDir));
|
||||||
map.put("headScripts", getScriptList(themeDir));
|
map.put("headScripts", getScriptList(themeDir));
|
||||||
|
@ -385,8 +387,8 @@ public class FreemarkerHttpServlet extends VitroHttpServlet {
|
||||||
urls.put("login", urlBuilder.getPortalUrl(Route.LOGIN));
|
urls.put("login", urlBuilder.getPortalUrl(Route.LOGIN));
|
||||||
urls.put("logout", urlBuilder.getLogoutUrl());
|
urls.put("logout", urlBuilder.getLogoutUrl());
|
||||||
urls.put("siteAdmin", urlBuilder.getPortalUrl(Route.LOGIN));
|
urls.put("siteAdmin", urlBuilder.getPortalUrl(Route.LOGIN));
|
||||||
|
|
||||||
urls.put("siteIcons", urlBuilder.getPortalUrl(themeDir + "/site_icons"));
|
urls.put("siteIcons", urlBuilder.getPortalUrl(themeDir + "/site_icons"));
|
||||||
|
urls.put("themeImages", urlBuilder.getPortalUrl(themeDir + "/images"));
|
||||||
urls.put("images", urlBuilder.getUrl("/images"));
|
urls.put("images", urlBuilder.getUrl("/images"));
|
||||||
|
|
||||||
return urls;
|
return urls;
|
||||||
|
|
5
webapp/web/js/html5.js
Normal file
5
webapp/web/js/html5.js
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
// html5shiv MIT @rem remysharp.com/html5-enabling-script
|
||||||
|
// iepp v1.5.1 MIT @jon_neal iecss.com/print-protector
|
||||||
|
/*@cc_on(function(p,e){var q=e.createElement("div");q.innerHTML="<z>i</z>";q.childNodes.length!==1&&function(){function r(a,b){if(g[a])g[a].styleSheet.cssText+=b;else{var c=s[l],d=e[j]("style");d.media=a;c.insertBefore(d,c[l]);g[a]=d;r(a,b)}}function t(a,b){for(var c=new RegExp("\\b("+m+")\\b(?!.*[;}])","gi"),d=function(k){return".iepp_"+k},h=-1;++h<a.length;){b=a[h].media||b;t(a[h].imports,b);r(b,a[h].cssText.replace(c,d))}}for(var s=e.documentElement,i=e.createDocumentFragment(),g={},m="abbr article aside audio canvas details figcaption figure footer header hgroup mark meter nav output progress section summary time video".replace(/ /g, '|'),
|
||||||
|
n=m.split("|"),f=[],o=-1,l="firstChild",j="createElement";++o<n.length;){e[j](n[o]);i[j](n[o])}i=i.appendChild(e[j]("div"));p.attachEvent("onbeforeprint",function(){for(var a,b=e.getElementsByTagName("*"),c,d,h=new RegExp("^"+m+"$","i"),k=-1;++k<b.length;)if((a=b[k])&&(d=a.nodeName.match(h))){c=new RegExp("^\\s*<"+d+"(.*)\\/"+d+">\\s*$","i");i.innerHTML=a.outerHTML.replace(/\r|\n/g," ").replace(c,a.currentStyle.display=="block"?"<div$1/div>":"<span$1/span>");c=i.childNodes[0];c.className+=" iepp_"+
|
||||||
|
d;c=f[f.length]=[a,c];a.parentNode.replaceChild(c[1],c[0])}t(e.styleSheets,"all")});p.attachEvent("onafterprint",function(){for(var a=-1,b;++a<f.length;)f[a][1].parentNode.replaceChild(f[a][0],f[a][1]);for(b in g)s[l].removeChild(g[b]);g={};f=[]})}()})(this,document);@*/
|
5
webapp/web/js/selectivizr.js
Executable file
5
webapp/web/js/selectivizr.js
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
/*
|
||||||
|
selectivizr v1.0.0 - (c) Keith Clark, freely distributable under the terms of the MIT license.
|
||||||
|
selectivizr.com
|
||||||
|
*/
|
||||||
|
(function(x){function K(a){return a.replace(L,o).replace(M,function(b,e,c){b=c.split(",");c=0;for(var g=b.length;c<g;c++){var j=N(b[c].replace(O,o).replace(P,o))+t,f=[];b[c]=j.replace(Q,function(d,k,l,i,h){if(k){if(f.length>0){d=f;var u;h=j.substring(0,h).replace(R,n);if(h==n||h.charAt(h.length-1)==t)h+="*";try{u=v(h)}catch(da){}if(u){h=0;for(l=u.length;h<l;h++){i=u[h];for(var y=i.className,z=0,S=d.length;z<S;z++){var q=d[z];if(!RegExp("(^|\\s)"+q.className+"(\\s|$)").test(i.className))if(q.b&&(q.b===true||q.b(i)===true))y=A(y,q.className,true)}i.className=y}}f=[]}return k}else{if(k=l?T(l):!B||B.test(i)?{className:C(i),b:true}:null){f.push(k);return"."+k.className}return d}})}return e+b.join(",")})}function T(a){var b=true,e=C(a.slice(1)),c=a.substring(0,5)==":not(",g,j;if(c)a=a.slice(5,-1);var f=a.indexOf("(");if(f>-1)a=a.substring(0,f);if(a.charAt(0)==":")switch(a.slice(1)){case "root":b=function(d){return c?d!=D:d==D};break;case "target":if(p==8){b=function(d){function k(){var l=location.hash,i=l.slice(1);return c?l==""||d.id!=i:l!=""&&d.id==i}x.attachEvent("onhashchange",function(){r(d,e,k())});return k()};break}return false;case "checked":b=function(d){U.test(d.type)&&d.attachEvent("onpropertychange",function(){event.propertyName=="checked"&&r(d,e,d.checked!==c)});return d.checked!==c};break;case "disabled":c=!c;case "enabled":b=function(d){if(V.test(d.tagName)){d.attachEvent("onpropertychange",function(){event.propertyName=="$disabled"&&r(d,e,d.a===c)});w.push(d);d.a=d.disabled;return d.disabled===c}return a==":enabled"?c:!c};break;case "focus":g="focus";j="blur";case "hover":if(!g){g="mouseenter";j="mouseleave"}b=function(d){d.attachEvent("on"+(c?j:g),function(){r(d,e,true)});d.attachEvent("on"+(c?g:j),function(){r(d,e,false)});return c};break;default:if(!W.test(a))return false;break}return{className:e,b:b}}function C(a){return E+"-"+(p==6&&X?Y++:a.replace(Z,function(b){return b.charCodeAt(0)}))}function N(a){return a.replace(F,o).replace($,t)}function r(a,b,e){var c=a.className;b=A(c,b,e);if(b!=c){a.className=b;a.parentNode.className+=n}}function A(a,b,e){var c=RegExp("(^|\\s)"+b+"(\\s|$)"),g=c.test(a);return e?g?a:a+t+b:g?a.replace(c,o).replace(F,o):a}function G(a,b){if(/^https?:\/\//i.test(a))return b.substring(0,b.indexOf("/",8))==a.substring(0,a.indexOf("/",8))?a:null;if(a.charAt(0)=="/")return b.substring(0,b.indexOf("/",8))+a;var e=b.split("?")[0];if(a.charAt(0)!="?"&&e.charAt(e.length-1)!="/")e=e.substring(0,e.lastIndexOf("/")+1);return e+a}function H(a){if(a){s.open("GET",a,false);s.send();return(s.status==200?s.responseText:n).replace(aa,n).replace(ba,function(b,e,c){return H(G(c,a))})}return n}function ca(){var a,b;a=m.getElementsByTagName("BASE");for(var e=a.length>0?a[0].href:m.location.href,c=0;c<m.styleSheets.length;c++){b=m.styleSheets[c];if(b.href!=n)if(a=G(b.href,e))b.cssText=K(H(a))}w.length>0&&setInterval(function(){for(var g=0,j=w.length;g<j;g++){var f=w[g];if(f.disabled!==f.a)if(f.disabled){f.disabled=false;f.a=true;f.disabled=true}else f.a=f.disabled}},250)}if(!/*@cc_on!@*/true){var m=document,D=m.documentElement,s=function(){if(x.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){return null}}(),p=/MSIE ([\d])/.exec(navigator.userAgent)[1];if(!(m.compatMode!="CSS1Compat"||p<6||p>8||!s)){var I={NW:"*.Dom.select",DOMAssistant:"*.$",Prototype:"$$",YAHOO:"*.util.Selector.query",MooTools:"$$",Sizzle:"*",jQuery:"*",dojo:"*.query"},v,w=[],Y=0,X=true,E="slvzr",J=E+"DOMReady",aa=/(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)\s*/g,ba=/@import\s*url\(\s*(["'])?(.*?)\1\s*\)[\w\W]*?;/g,W=/^:(empty|(first|last|only|nth(-last)?)-(child|of-type))$/,L=/:(:first-(?:line|letter))/g,M=/(^|})\s*([^\{]*?[\[:][^{]+)/g,Q=/([ +~>])|(:[a-z-]+(?:\(.*?\)+)?)|(\[.*?\])/g,R=/(:not\()?:(hover|enabled|disabled|focus|checked|target|active|visited|first-line|first-letter)\)?/g,Z=/[^\w-]/g,V=/^(INPUT|SELECT|TEXTAREA|BUTTON)$/,U=/^(checkbox|radio)$/,B=p==8?/[\$\^]=(['"])\1/:p==7?/[\$\^*]=(['"])\1/:null,O=/([(\[+~])\s+/g,P=/\s+([)\]+~])/g,$=/\s+/g,F=/^\s*((?:[\S\s]*\S)?)\s*$/,n="",t=" ",o="$1";m.write("<script id="+J+" defer src='//:'><\/script>");m.getElementById(J).onreadystatechange=function(){if(this.readyState=="complete"){a:{var a;for(var b in I)if(x[b]&&(a=eval(I[b].replace("*",b)))){v=a;break a}v=false}if(v){ca();this.parentNode.removeChild(this)}}}}}})(this);
|
41
webapp/web/js/supersleight.js
Normal file
41
webapp/web/js/supersleight.js
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
//Fix Transparent PNGs in IE6
|
||||||
|
jQuery.fn.supersleight = function(settings) {
|
||||||
|
settings = jQuery.extend({
|
||||||
|
imgs: true,
|
||||||
|
backgrounds: true,
|
||||||
|
shim: 'x.gif',
|
||||||
|
apply_positioning: true
|
||||||
|
}, settings);
|
||||||
|
|
||||||
|
return this.each(function(){
|
||||||
|
if (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) < 7 && parseInt(jQuery.browser.version, 10) > 4) {
|
||||||
|
jQuery(this).find('*').andSelf().each(function(i,obj) {
|
||||||
|
var self = jQuery(obj);
|
||||||
|
// background pngs
|
||||||
|
if (settings.backgrounds && self.css('background-image').match(/\.png/i) !== null) {
|
||||||
|
var bg = self.css('background-image');
|
||||||
|
var src = bg.substring(5,bg.length-2);
|
||||||
|
var mode = (self.css('background-repeat') == 'no-repeat' ? 'crop' : 'scale');
|
||||||
|
var styles = {
|
||||||
|
'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + mode + "')",
|
||||||
|
'background-image': 'url('+settings.shim+')'
|
||||||
|
};
|
||||||
|
self.css(styles);
|
||||||
|
};
|
||||||
|
// image elements
|
||||||
|
if (settings.imgs && self.is('img[src$=png]')){
|
||||||
|
var styles = {
|
||||||
|
'width': self.width() + 'px',
|
||||||
|
'height': self.height() + 'px',
|
||||||
|
'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + self.attr('src') + "', sizingMethod='scale')"
|
||||||
|
};
|
||||||
|
self.css(styles).attr('src', settings.shim);
|
||||||
|
};
|
||||||
|
// apply position to 'active' elements
|
||||||
|
if (settings.apply_positioning && self.is('a, input') && (self.css('position') === '' || self.css('position') == 'static')){
|
||||||
|
self.css('position', 'relative');
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
3
webapp/web/js/supersleightUtils.js
Normal file
3
webapp/web/js/supersleightUtils.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||||
|
//Fix Transparent PNGs in IE6
|
||||||
|
$('body').supersleight();
|
Loading…
Add table
Reference in a new issue