From d41177b96200a02b242b8427b43f931f80dde44d Mon Sep 17 00:00:00 2001 From: Marie Guillaumet Date: Mon, 13 Aug 2012 07:49:54 +0200 Subject: [PATCH 01/19] =?UTF-8?q?Encapsulage=20de=20#grid=20dans=20une=20f?= =?UTF-8?q?onction=20anonyme=20jQuery=20pour=20=C3=A9viter=20les=20probl?= =?UTF-8?q?=C3=A8mes=20de=20compatibilit=C3=A9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/_after.js | 2 +- js/lib/hashgrid.js | 708 +++++++++++++++++++++++---------------------- 2 files changed, 356 insertions(+), 354 deletions(-) diff --git a/js/_after.js b/js/_after.js index da63028..3e09651 100644 --- a/js/_after.js +++ b/js/_after.js @@ -14,4 +14,4 @@ * Date: Mon Nov 21 21:11:03 2011 -0500 */(function(e,t){function u(e){var t=o[e]={},n,r;e=e.split(/\s+/);for(n=0,r=e.length;n=0===n})}function V(e){var t=$.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function at(e,t){return s.nodeName(e,"table")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ft(e,t){if(t.nodeType!==1||!s.hasData(e))return;var n,r,i,o=s._data(e),u=s._data(t,o),a=o.events;if(a){delete u.handle;u.events={};for(n in a)for(r=0,i=a[n].length;r0){if(n!=="border")for(;o").appendTo(t),i=r.css("display");r.remove();if(i==="none"||i===""){if(!hn){hn=n.createElement("iframe");hn.frameBorder=hn.width=hn.height=0}t.appendChild(hn);if(!pn||!hn.createElement){pn=(hn.contentWindow||hn.contentDocument).document;pn.write((n.compatMode==="CSS1Compat"?"":"")+"");pn.close()}r=pn.createElement(e);pn.body.appendChild(r);i=s.css(r,"display");t.removeChild(hn)}cn[e]=i}return cn[e]}function Nn(e){return s.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n=e.document,r=e.navigator,i=e.location,s=function(){function H(){if(i.isReady)return;try{n.documentElement.doScroll("left")}catch(e){setTimeout(H,1);return}i.ready()}var i=function(e,t){return new i.fn.init(e,t,u)},s=e.jQuery,o=e.$,u,a=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,f=/\S/,l=/^\s+/,c=/\s+$/,h=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,p=/^[\],:{}\s]*$/,d=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,v=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,m=/(?:^|:|,)(?:\s*\[)+/g,g=/(webkit)[ \/]([\w.]+)/,y=/(opera)(?:.*version)?[ \/]([\w.]+)/,b=/(msie) ([\w.]+)/,w=/(mozilla)(?:.*? rv:([\w.]+))?/,E=/-([a-z]|[0-9])/ig,S=/^-ms-/,x=function(e,t){return(t+"").toUpperCase()},T=r.userAgent,N,C,k,L=Object.prototype.toString,A=Object.prototype.hasOwnProperty,O=Array.prototype.push,M=Array.prototype.slice,_=String.prototype.trim,D=Array.prototype.indexOf,P={};i.fn=i.prototype={constructor:i,init:function(e,r,s){var o,u,f,l;if(!e)return this;if(e.nodeType){this.context=this[0]=e;this.length=1;return this}if(e==="body"&&!r&&n.body){this.context=n;this[0]=n.body;this.selector=e;this.length=1;return this}if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?o=[null,e,null]:o=a.exec(e);if(o&&(o[1]||!r)){if(o[1]){r=r instanceof i?r[0]:r;l=r?r.ownerDocument||r:n;f=h.exec(e);if(f)if(i.isPlainObject(r)){e=[n.createElement(f[1])];i.fn.attr.call(e,r,!0)}else e=[l.createElement(f[1])];else{f=i.buildFragment([o[1]],[l]);e=(f.cacheable?i.clone(f.fragment):f.fragment).childNodes}return i.merge(this,e)}u=n.getElementById(o[2]);if(u&&u.parentNode){if(u.id!==o[2])return s.find(e);this.length=1;this[0]=u}this.context=n;this.selector=e;return this}return!r||r.jquery?(r||s).find(e):this.constructor(r).find(e)}if(i.isFunction(e))return s.ready(e);if(e.selector!==t){this.selector=e.selector;this.context=e.context}return i.makeArray(e,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return M.call(this,0)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=this.constructor();i.isArray(e)?O.apply(r,e):i.merge(r,e);r.prevObject=this;r.context=this.context;t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")");return r},each:function(e,t){return i.each(this,e,t)},ready:function(e){i.bindReady();C.add(e);return this},eq:function(e){e=+e;return e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(M.apply(this,arguments),"slice",M.call(arguments).join(","))},map:function(e){return this.pushStack(i.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:O,sort:[].sort,splice:[].splice};i.fn.init.prototype=i.fn;i.extend=i.fn.extend=function(){var e,n,r,s,o,u,a=arguments[0]||{},f=1,l=arguments.length,c=!1;if(typeof a=="boolean"){c=a;a=arguments[1]||{};f=2}typeof a!="object"&&!i.isFunction(a)&&(a={});if(l===f){a=this;--f}for(;f0)return;C.fireWith(n,[i]);i.fn.trigger&&i(n).trigger("ready").off("ready")}},bindReady:function(){if(C)return;C=i.Callbacks("once memory");if(n.readyState==="complete")return setTimeout(i.ready,1);if(n.addEventListener){n.addEventListener("DOMContentLoaded",k,!1);e.addEventListener("load",i.ready,!1)}else if(n.attachEvent){n.attachEvent("onreadystatechange",k);e.attachEvent("onload",i.ready);var t=!1;try{t=e.frameElement==null}catch(r){}n.documentElement.doScroll&&t&&H()}},isFunction:function(e){return i.type(e)==="function"},isArray:Array.isArray||function(e){return i.type(e)==="array"},isWindow:function(e){return e&&typeof e=="object"&&"setInterval"in e},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):P[L.call(e)]||"object"},isPlainObject:function(e){if(!e||i.type(e)!=="object"||e.nodeType||i.isWindow(e))return!1;try{if(e.constructor&&!A.call(e,"constructor")&&!A.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||A.call(e,r)},isEmptyObject:function(e){for(var t in e)return!1;return!0},error:function(e){throw new Error(e)},parseJSON:function(t){if(typeof t!="string"||!t)return null;t=i.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(p.test(t.replace(d,"@").replace(v,"]").replace(m,"")))return(new Function("return "+t))();i.error("Invalid JSON: "+t)},parseXML:function(n){var r,s;try{if(e.DOMParser){s=new DOMParser;r=s.parseFromString(n,"text/xml")}else{r=new ActiveXObject("Microsoft.XMLDOM");r.async="false";r.loadXML(n)}}catch(o){r=t}(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&i.error("Invalid XML: "+n);return r},noop:function(){},globalEval:function(t){t&&f.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(S,"ms-").replace(E,x)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toUpperCase()===t.toUpperCase()},each:function(e,n,r){var s,o=0,u=e.length,a=u===t||i.isFunction(e);if(r){if(a){for(s in e)if(n.apply(e[s],r)===!1)break}else for(;o0&&e[0]&&e[f-1]||f===0||i.isArray(e));if(l)for(;a1?a.call(arguments,0):n;--o||f.resolveWith(f,t)}}function h(e){return function(t){i[e]=arguments.length>1?a.call(arguments,0):t;f.notifyWith(l,i)}}var t=a.call(arguments,0),n=0,r=t.length,i=new Array(r),o=r,u=r,f=r<=1&&e&&s.isFunction(e.promise)?e:s.Deferred(),l=f.promise();if(r>1){for(;n
a";r=m.getElementsByTagName("*");i=m.getElementsByTagName("a")[0];if(!r||!r.length||!i)return{};o=n.createElement("select");u=o.appendChild(n.createElement("option"));a=m.getElementsByTagName("input")[0];t={leadingWhitespace:m.firstChild.nodeType===3,tbody:!m.getElementsByTagName("tbody").length,htmlSerialize:!!m.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:i.getAttribute("href")==="/a",opacity:/^0.55/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:a.value==="on",optSelected:u.selected,getSetAttribute:m.className!=="t",enctype:!!n.createElement("form").enctype,html5Clone:n.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0};a.checked=!0;t.noCloneChecked=a.cloneNode(!0).checked;o.disabled=!0;t.optDisabled=!u.disabled;try{delete m.test}catch(y){t.deleteExpando=!1}if(!m.addEventListener&&m.attachEvent&&m.fireEvent){m.attachEvent("onclick",function(){t.noCloneEvent=!1});m.cloneNode(!0).fireEvent("onclick")}a=n.createElement("input");a.value="t";a.setAttribute("type","radio");t.radioValue=a.value==="t";a.setAttribute("checked","checked");m.appendChild(a);l=n.createDocumentFragment();l.appendChild(m.lastChild);t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked;t.appendChecked=a.checked;l.removeChild(a);l.appendChild(m);m.innerHTML="";if(e.getComputedStyle){f=n.createElement("div");f.style.width="0";f.style.marginRight="0";m.style.width="2px";m.appendChild(f);t.reliableMarginRight=(parseInt((e.getComputedStyle(f,null)||{marginRight:0}).marginRight,10)||0)===0}if(m.attachEvent)for(d in{submit:1,change:1,focusin:1}){p="on"+d;v=p in m;if(!v){m.setAttribute(p,"return;");v=typeof m[p]=="function"}t[d+"Bubbles"]=v}l.removeChild(m);l=o=u=f=m=a=null;s(function(){var e,r,i,o,u,a,f,l,h,p,d,g=n.getElementsByTagName("body")[0];if(!g)return;f=1;l="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";h="visibility:hidden;border:0;";p="style='"+l+"border:5px solid #000;padding:0;'";d="
"+""+"
";e=n.createElement("div");e.style.cssText=h+"width:0;height:0;position:static;top:0;margin-top:"+f+"px";g.insertBefore(e,g.firstChild);m=n.createElement("div");e.appendChild(m);m.innerHTML="
t
";c=m.getElementsByTagName("td");v=c[0].offsetHeight===0;c[0].style.display="";c[1].style.display="none";t.reliableHiddenOffsets=v&&c[0].offsetHeight===0;m.innerHTML="";m.style.width=m.style.paddingLeft="1px";s.boxModel=t.boxModel=m.offsetWidth===2;if(typeof m.style.zoom!="undefined"){m.style.display="inline";m.style.zoom=1;t.inlineBlockNeedsLayout=m.offsetWidth===2;m.style.display="";m.innerHTML="
";t.shrinkWrapBlocks=m.offsetWidth!==2}m.style.cssText=l+h;m.innerHTML=d;r=m.firstChild;i=r.firstChild;u=r.nextSibling.firstChild.firstChild;a={doesNotAddBorder:i.offsetTop!==5,doesAddBorderForTableAndCells:u.offsetTop===5};i.style.position="fixed";i.style.top="20px";a.fixedPosition=i.offsetTop===20||i.offsetTop===15;i.style.position=i.style.top="";r.style.overflow="hidden";r.style.position="relative";a.subtractsBorderForOverflowNotVisible=i.offsetTop===-5;a.doesNotIncludeMarginInBodyOffset=g.offsetTop!==f;g.removeChild(e);m=e=null;s.extend(t,a)});return t}();var f=/^(?:\{.*\}|\[.*\])$/,l=/([A-Z])/g;s.extend({cache:{},uuid:0,expando:"jQuery"+(s.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){e=e.nodeType?s.cache[e[s.expando]]:e[s.expando];return!!e&&!h(e)},data:function(e,n,r,i){if(!s.acceptData(e))return;var o,u,a,f=s.expando,l=typeof n=="string",c=e.nodeType,h=c?s.cache:e,p=c?e[f]:e[f]&&f,d=n==="events";if((!p||!h[p]||!d&&!i&&!h[p].data)&&l&&r===t)return;p||(c?e[f]=p=++s.uuid:p=f);if(!h[p]){h[p]={};c||(h[p].toJSON=s.noop)}if(typeof n=="object"||typeof n=="function")i?h[p]=s.extend(h[p],n):h[p].data=s.extend(h[p].data,n);o=u=h[p];if(!i){u.data||(u.data={});u=u.data}r!==t&&(u[s.camelCase(n)]=r);if(d&&!u[n])return o.events;if(l){a=u[n];a==null&&(a=u[s.camelCase(n)])}else a=u;return a},removeData:function(e,t,n){if(!s.acceptData(e))return;var r,i,o,u=s.expando,a=e.nodeType,f=a?s.cache:e,l=a?e[u]:u;if(!f[l])return;if(t){r=n?f[l]:f[l].data;if(r){if(!s.isArray(t))if(t in r)t=[t];else{t=s.camelCase(t);t in r?t=[t]:t=t.split(" ")}for(i=0,o=t.length;i-1)return!0;return!1},val:function(e){var n,r,i,o=this[0];if(!arguments.length){if(o){n=s.valHooks[o.nodeName.toLowerCase()]||s.valHooks[o.type];if(n&&"get"in n&&(r=n.get(o,"value"))!==t)return r;r=o.value;return typeof r=="string"?r.replace(m,""):r==null?"":r}return}i=s.isFunction(e);return this.each(function(r){var o=s(this),u;if(this.nodeType!==1)return;i?u=e.call(this,r,o.val()):u=e;u==null?u="":typeof u=="number"?u+="":s.isArray(u)&&(u=s.map(u,function(e){return e==null?"":e+""}));n=s.valHooks[this.nodeName.toLowerCase()]||s.valHooks[this.type];if(!n||!("set"in n)||n.set(this,u,"value")===t)this.value=u})}});s.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r,i,o=e.selectedIndex,u=[],a=e.options,f=e.type==="select-one";if(o<0)return null;n=f?o:0;r=f?o+1:a.length;for(;n=0});n.length||(e.selectedIndex=-1);return n}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(e,n,r,i){var o,u,a,f=e.nodeType;if(!e||f===3||f===8||f===2)return;if(i&&n in s.attrFn)return s(e)[n](r);if(typeof e.getAttribute=="undefined")return s.prop(e,n,r);a=f!==1||!s.isXMLDoc(e);if(a){n=n.toLowerCase();u=s.attrHooks[n]||(w.test(n)?x:S)}if(r!==t){if(r===null){s.removeAttr(e,n);return}if(u&&"set"in u&&a&&(o=u.set(e,r,n))!==t)return o;e.setAttribute(n,""+r);return r}if(u&&"get"in u&&a&&(o=u.get(e,n))!==null)return o;o=e.getAttribute(n);return o===null?t:o},removeAttr:function(e,t){var n,r,i,o,u=0;if(t&&e.nodeType===1){r=t.toLowerCase().split(v);o=r.length;for(;u=0}})});var N=/^(?:textarea|input|select)$/i,C=/^([^\.]*)?(?:\.(.+))?$/,k=/\bhover(\.\S+)?\b/,L=/^key/,A=/^(?:mouse|contextmenu)|click/,O=/^(?:focusinfocus|focusoutblur)$/,M=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,_=function(e){var t=M.exec(e);if(t){t[1]=(t[1]||"").toLowerCase();t[3]=t[3]&&new RegExp("(?:^|\\s)"+t[3]+"(?:\\s|$)")}return t},D=function(e,t){var n=e.attributes||{};return(!t[1]||e.nodeName.toLowerCase()=== t[1])&&(!t[2]||(n.id||{}).value===t[2])&&(!t[3]||t[3].test((n["class"]||{}).value))},P=function(e){return s.event.special.hover?e:e.replace(k,"mouseenter$1 mouseleave$1")};s.event={add:function(e,n,r,i,o){var u,a,f,l,c,h,p,d,v,m,g,y;if(e.nodeType===3||e.nodeType===8||!n||!r||!(u=s._data(e)))return;if(r.handler){v=r;r=v.handler}r.guid||(r.guid=s.guid++);f=u.events;f||(u.events=f={});a=u.handle;if(!a){u.handle=a=function(e){return typeof s=="undefined"||!!e&&s.event.triggered===e.type?t:s.event.dispatch.apply(a.elem,arguments)};a.elem=e}n=s.trim(P(n)).split(" ");for(l=0;l=0){u=u.slice(0,-1);l=!0}if(u.indexOf(".")>=0){a=u.split(".");u=a.shift();a.sort()}if((!i||s.event.customEvent[u])&&!s.event.global[u])return;n=typeof n=="object"?n[s.expando]?n:new s.Event(u,n):new s.Event(u);n.type=u;n.isTrigger=!0;n.exclusive=l;n.namespace=a.join(".");n.namespace_re=n.namespace?new RegExp("(^|\\.)"+a.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;d=u.indexOf(":")<0?"on"+u:"";if(!i){f=s.cache;for(c in f)f[c].events&&f[c].events[u]&&s.event.trigger(n,r,f[c].handle.elem,!0);return}n.result=t;n.target||(n.target=i);r=r!=null?s.makeArray(r):[];r.unshift(n);v=s.event.special[u]||{};if(v.trigger&&v.trigger.apply(i,r)===!1)return;g=[[i,v.bindType||u]];if(!o&&!v.noBubble&&!s.isWindow(i)){y=v.delegateType||u;h=O.test(y+u)?i:i.parentNode;p=null;for(;h;h=h.parentNode){g.push([h,y]);p=h}p&&p===i.ownerDocument&&g.push([p.defaultView||p.parentWindow||e,y])}for(c=0;ci&&a.push({elem:this,matches:r.slice(i)});for(f=0;f0?this.on(t,null,e,n):this.trigger(t)};s.attrFn&&(s.attrFn[t]=!0);L.test(t)&&(s.event.fixHooks[t]=s.event.keyHooks);A.test(t)&&(s.event.fixHooks[t]=s.event.mouseHooks)});(function(){function S(e,t,n,i,s,o){for(var u=0,a=i.length;u0){l=f;break}}f=f[e]}i[u]=l}}}var e=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,r="sizcache"+(Math.random()+"").replace(".",""),i=0,o=Object.prototype.toString,u=!1,a=!0,f=/\\/g,l=/\r\n/g,c=/\W/;[0,0].sort(function(){a=!1;return 0});var h=function(t,r,i,s){i=i||[];r=r||n;var u=r;if(r.nodeType!==1&&r.nodeType!==9)return[];if(!t||typeof t!="string")return i;var a,f,l,c,p,m,g,b,w=!0,E=h.isXML(r),S=[],x=t;do{e.exec("");a=e.exec(x);if(a){x=a[3];S.push(a[1]);if(a[2]){c=a[3];break}}}while(a);if(S.length>1&&v.exec(t))if(S.length===2&&d.relative[S[0]])f=T(S[0]+S[1],r,s);else{f=d.relative[S[0]]?[r]:h(S.shift(),r);while(S.length){t=S.shift();d.relative[t]&&(t+=S.shift());f=T(t,f,s)}}else{if(!s&&S.length>1&&r.nodeType===9&&!E&&d.match.ID.test(S[0])&&!d.match.ID.test(S[S.length-1])){p=h.find(S.shift(),r,E);r=p.expr?h.filter(p.expr,p.set)[0]:p.set[0]}if(r){p=s?{expr:S.pop(),set:y(s)}:h.find(S.pop(),S.length!==1||S[0]!=="~"&&S[0]!=="+"||!r.parentNode?r:r.parentNode,E);f=p.expr?h.filter(p.expr,p.set):p.set;S.length>0?l=y(f):w=!1;while(S.length){m=S.pop();g=m;d.relative[m]?g=S.pop():m="";g==null&&(g=r);d.relative[m](l,g,E)}}else l=S=[]}l||(l=f);l||h.error(m||t);if(o.call(l)==="[object Array]")if(!w)i.push.apply(i,l);else if(r&&r.nodeType===1)for(b=0;l[b]!=null;b++)l[b]&&(l[b]===!0||l[b].nodeType===1&&h.contains(r,l[b]))&&i.push(f[b]);else for(b=0;l[b]!=null;b++)l[b]&&l[b].nodeType===1&&i.push(f[b]);else y(l,i);if(c){h(c,u,i,s);h.uniqueSort(i)}return i};h.uniqueSort=function(e){if(w){u=a;e.sort(w);if(u)for(var t=1;t0};h.find=function(e,t,n){var r,i,s,o,u,a;if(!e)return[];for(i=0,s=d.order.length;i":function(e,t){var n,r=typeof t=="string",i=0,s=e.length;if(r&&!c.test(t)){t=t.toLowerCase();for(;i=0)?n||r.push(u):n&&(t[o]=!1));return!1},ID:function(e){return e[1].replace(f,"")},TAG:function(e,t){return e[1].replace(f,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){e[2]||h.error(e[0]);e[2]=e[2].replace(/^\+|\s*/g,"");var t=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=t[1]+(t[2]||1)-0;e[3]=t[3]-0}else e[2]&&h.error(e[0]);e[0]=i++;return e},ATTR:function(e,t,n,r,i,s){var o=e[1]=e[1].replace(f,"");!s&&d.attrMap[o]&&(e[1]=d.attrMap[o]);e[4]=(e[4]||e[5]||"").replace(f,"");e[2]==="~="&&(e[4]=" "+e[4]+" ");return e},PSEUDO:function(t,n,r,i,s){if(t[1]==="not"){if(!((e.exec(t[3])||"").length>1||/^\w/.test(t[3]))){var o=h.filter(t[3],n,r,!0^s);r||i.push.apply(i,o);return!1}t[3]=h(t[3],null,null,n)}else if(d.match.POS.test(t[0])||d.match.CHILD.test(t[0]))return!0;return t},POS:function(e){e.unshift(!0);return e}},filters:{enabled:function(e){return e.disabled===!1&&e.type!=="hidden"},disabled:function(e){return e.disabled===!0},checked:function(e){return e.checked===!0},selected:function(e){e.parentNode&&e.parentNode.selectedIndex;return e.selected===!0},parent:function(e){return!!e.firstChild},empty:function(e){return!e.firstChild},has:function(e,t,n){return!!h(n[3],e).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){var t=e.getAttribute("type"),n=e.type;return e.nodeName.toLowerCase()==="input"&&"text"===n&&(t===n||t===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(e){var t=e.nodeName.toLowerCase();return(t==="input"||t==="button")&&"submit"===e.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(e){var t=e.nodeName.toLowerCase();return(t==="input"||t==="button")&&"reset"===e.type},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&"button"===e.type||t==="button"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(e,t){return t===0},last:function(e,t,n,r){return t===r.length-1},even:function(e,t){return t%2===0},odd:function(e,t){return t%2===1},lt:function(e,t,n){return tn[3]-0},nth:function(e,t,n){return n[3]-0===t},eq:function(e,t,n){return n[3]-0===t}},filter:{PSEUDO:function(e,t,n,r){var i=t[1],s=d.filters[i];if(s)return s(e,n,t,r);if(i==="contains")return(e.textContent||e.innerText||p([e])||"").indexOf(t[3])>=0;if(i==="not"){var o=t[3];for(var u=0,a=o.length;u=0}},ID:function(e,t){return e.nodeType===1&&e.getAttribute("id")===t},TAG:function(e,t){return t==="*"&&e.nodeType===1||!!e.nodeName&&e.nodeName.toLowerCase()===t},CLASS:function(e,t){return(" "+(e.className||e.getAttribute("class"))+" ").indexOf(t)>-1},ATTR:function(e,t){var n=t[1],r=h.attr?h.attr(e,n):d.attrHandle[n]?d.attrHandle[n](e):e[n]!=null?e[n]:e.getAttribute(n),i=r+"",s=t[2],o=t[4];return r==null?s==="!=":!s&&h.attr?r!=null:s==="="?i===o:s==="*="?i.indexOf(o)>=0:s==="~="?(" "+i+" ").indexOf(o)>=0:o?s==="!="?i!==o:s==="^="?i.indexOf(o)===0:s==="$="?i.substr(i.length-o.length)===o:s==="|="?i===o||i.substr(0,o.length+1)===o+"-":!1:i&&r!==!1},POS:function(e,t,n,r){var i=t[2],s=d.setFilters[i];if(s)return s(e,n,t,r)}}},v=d.match.POS,m=function(e,t){return"\\"+(t-0+1)};for(var g in d.match){d.match[g]=new RegExp(d.match[g].source+/(?![^\[]*\])(?![^\(]*\))/.source);d.leftMatch[g]=new RegExp(/(^(?:.|\r|\n)*?)/.source+d.match[g].source.replace(/\\(\d+)/g,m))}var y=function(e,t){e=Array.prototype.slice.call(e,0);if(t){t.push.apply(t,e);return t}return e};try{Array.prototype.slice.call(n.documentElement.childNodes,0)[0].nodeType}catch(b){y=function(e,t){var n=0,r=t||[];if(o.call(e)==="[object Array]")Array.prototype.push.apply(r,e);else if(typeof e.length=="number")for(var i=e.length;n";i.insertBefore(e,i.firstChild);if(n.getElementById(r)){d.find.ID=function(e,n,r){if(typeof n.getElementById!="undefined"&&!r){var i=n.getElementById(e[1]);return i?i.id===e[1]||typeof i.getAttributeNode!="undefined"&&i.getAttributeNode("id").nodeValue===e[1]?[i]:t:[]}};d.filter.ID=function(e,t){var n=typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id");return e.nodeType===1&&n&&n.nodeValue===t}}i.removeChild(e);i=e=null})();(function(){var e=n.createElement("div");e.appendChild(n.createComment(""));e.getElementsByTagName("*").length>0&&(d.find.TAG=function(e,t){var n=t.getElementsByTagName(e[1]);if(e[1]==="*"){var r=[];for(var i=0;n[i];i++)n[i].nodeType===1&&r.push(n[i]);n=r}return n});e.innerHTML="";e.firstChild&&typeof e.firstChild.getAttribute!="undefined"&&e.firstChild.getAttribute("href")!=="#"&&(d.attrHandle.href=function(e){return e.getAttribute("href",2)});e=null})();n.querySelectorAll&&function(){var e=h,t=n.createElement("div"),r="__sizzle__";t.innerHTML="

";if(t.querySelectorAll&&t.querySelectorAll(".TEST").length===0)return;h=function(t,i,s,o){i=i||n;if(!o&&!h.isXML(i)){var u=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(t);if(u&&(i.nodeType===1||i.nodeType===9)){if(u[1])return y(i.getElementsByTagName(t),s);if(u[2]&&d.find.CLASS&&i.getElementsByClassName)return y(i.getElementsByClassName(u[2]),s)}if(i.nodeType===9){if(t==="body"&&i.body)return y([i.body],s);if(u&&u[3]){var a=i.getElementById(u[3]);if(!a||!a.parentNode)return y([],s);if(a.id===u[3])return y([a],s)}try{return y(i.querySelectorAll(t),s)}catch(f){}}else if(i.nodeType===1&&i.nodeName.toLowerCase()!=="object"){var l=i,c=i.getAttribute("id"),p=c||r,v=i.parentNode,m=/^\s*[+~]/.test(t);c?p=p.replace(/'/g,"\\$&"):i.setAttribute("id",p);m&&v&&(i=i.parentNode);try{if(!m||v)return y(i.querySelectorAll("[id='"+p+"'] "+t),s)}catch(g){}finally{c||l.removeAttribute("id")}}}return e(t,i,s,o)};for(var i in e)h[i]=e[i];t=null}();(function(){var e=n.documentElement,t=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(t){var r=!t.call(n.createElement("div"),"div"),i=!1;try{t.call(n.documentElement,"[test!='']:sizzle")}catch(s){i=!0}h.matchesSelector=function(e,n){n=n.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!h.isXML(e))try{if(i||!d.match.PSEUDO.test(n)&&!/!=/.test(n)){var s=t.call(e,n);if(s||!r||e.document&&e.document.nodeType!==11)return s}}catch(o){}return h(n,null,null,[e]).length>0}}})();(function(){var e=n.createElement("div");e.innerHTML="
";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0)return;e.lastChild.className="e";if(e.getElementsByClassName("e").length===1)return;d.order.splice(1,0,"CLASS");d.find.CLASS=function(e,t,n){if(typeof t.getElementsByClassName!="undefined"&&!n)return t.getElementsByClassName(e[1])};e=null})();n.documentElement.contains?h.contains=function(e,t){return e!==t&&(e.contains?e.contains(t):!0)}:n.documentElement.compareDocumentPosition?h.contains=function(e,t){return!!(e.compareDocumentPosition(t)&16)}:h.contains=function(){return!1};h.isXML=function(e){var t=(e?e.ownerDocument||e:0).documentElement;return t?t.nodeName!=="HTML":!1};var T=function(e,t,n){var r,i=[],s="",o=t.nodeType?[t]:t;while(r=d.match.PSEUDO.exec(e)){s+=r[0];e=e.replace(d.match.PSEUDO,"")}e=d.relative[e]?e+"*":e;for(var u=0,a=o.length;u0)for(u=o;u=0:s.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n=[],r,i,o=this[0];if(s.isArray(e)){var u=1;while(o&&o.ownerDocument&&o!==t){for(r=0;r-1:s.find.matchesSelector(o,e)){n.push(o);break}o=o.parentNode;if(!o||!o.ownerDocument||o===t||o.nodeType===11)break}}n=n.length>1?s.unique(n):n;return this.pushStack(n,"closest",e)},index:function(e){return e?typeof e=="string"?s.inArray(this[0],s(e)):s.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?s(e,t):s.makeArray(e&&e.nodeType?[e]:e),r=s.merge(this.get(),n);return this.pushStack(W(n[0])||W(r[0])?r:s.unique(r))},andSelf:function(){return this.add(this.prevObject)}});s.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return s.dir(e,"parentNode")},parentsUntil:function(e,t,n){return s.dir(e,"parentNode",n)},next:function(e){return s.nth(e,2,"nextSibling")},prev:function(e){return s.nth(e,2,"previousSibling")},nextAll:function(e){return s.dir(e,"nextSibling")},prevAll:function(e){return s.dir(e,"previousSibling")},nextUntil:function(e,t,n){return s.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return s.dir(e,"previousSibling",n)},siblings:function(e){return s.sibling(e.parentNode.firstChild,e)},children:function(e){return s.sibling(e.firstChild)},contents:function(e){return s.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:s.makeArray(e.childNodes)}},function(e,t){s.fn[e]=function(n,r){var i=s.map(this,t,n);j.test(e)||(r=n);r&&typeof r=="string"&&(i=s.filter(r,i));i=this.length>1&&!z[e]?s.unique(i):i;(this.length>1||I.test(r))&&F.test(e)&&(i=i.reverse());return this.pushStack(i,e,R.call(arguments).join(","))}});s.extend({filter:function(e,t,n){n&&(e=":not("+e+")");return t.length===1?s.find.matchesSelector(t[0],e)?[t[0]]:[]:s.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&o.nodeType!==9&&(r===t||o.nodeType!==1||!s(o).is(r))){o.nodeType===1&&i.push(o);o=o[n]}return i},nth:function(e,t,n,r){t=t||1;var i=0;for(;e;e=e[n])if(e.nodeType===1&&++i===t)break;return e},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var $="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",J=/ jQuery\d+="(?:\d+|null)"/g,K=/^\s+/,Q=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,G=/<([\w:]+)/,Y=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},ut=V(n);ot.optgroup=ot.option;ot.tbody=ot.tfoot=ot.colgroup=ot.caption=ot.thead;ot.th=ot.td;s.support.htmlSerialize||(ot._default=[1,"div
","
"]);s.fn.extend({text:function(e){return s.isFunction(e)?this.each(function(t){var n=s(this);n.text(e.call(this,t,n.text()))}):typeof e!="object"&&e!==t?this.empty().append((this[0]&&this[0].ownerDocument||n).createTextNode(e)):s.text(this)},wrapAll:function(e){if(s.isFunction(e))return this.each(function(t){s(this).wrapAll(e.call(this,t))});if(this[0]){var t=s(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]);t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return s.isFunction(e)?this.each(function(t){s(this).wrapInner(e.call(this,t))}):this.each(function(){var t=s(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=s.isFunction(e);return this.each(function(n){s(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){s.nodeName(this,"body")||s(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){this.nodeType===1&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){this.nodeType===1&&this.insertBefore(e,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=s.clean(arguments);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,s.clean(arguments));return e}}, -remove:function(e,t){for(var n=0,r;(r=this[n])!=null;n++)if(!e||s.filter(e,[r]).length){if(!t&&r.nodeType===1){s.cleanData(r.getElementsByTagName("*"));s.cleanData([r])}r.parentNode&&r.parentNode.removeChild(r)}return this},empty:function(){for(var e=0,t;(t=this[e])!=null;e++){t.nodeType===1&&s.cleanData(t.getElementsByTagName("*"));while(t.firstChild)t.removeChild(t.firstChild)}return this},clone:function(e,t){e=e==null?!1:e;t=t==null?e:t;return this.map(function(){return s.clone(this,e,t)})},html:function(e){if(e===t)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(J,""):null;if(typeof e=="string"&&!et.test(e)&&(s.support.leadingWhitespace||!K.test(e))&&!ot[(G.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Q,"<$1>");try{for(var n=0,r=this.length;n1&&c0?this.clone(!0):this).get();s(i[u])[t](f);r=r.concat(f)}return this.pushStack(r,e,i.selector)}});s.extend({clone:function(e,t,n){var r,i,o,u=s.support.html5Clone||!nt.test("<"+e.nodeName)?e.cloneNode(!0):dt(e);if((!s.support.noCloneEvent||!s.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!s.isXMLDoc(e)){lt(e,u);r=ct(e);i=ct(u);for(o=0;r[o];++o)i[o]&<(r[o],i[o])}if(t){ft(e,u);if(n){r=ct(e);i=ct(u);for(o=0;r[o];++o)ft(r[o],i[o])}}r=i=null;return u},clean:function(e,t,r,i){var o;t=t||n;typeof t.createElement=="undefined"&&(t=t.ownerDocument||t[0]&&t[0].ownerDocument||n);var u=[],a;for(var f=0,l;(l=e[f])!=null;f++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!Z.test(l))l=t.createTextNode(l);else{l=l.replace(Q,"<$1>");var c=(G.exec(l)||["",""])[1].toLowerCase(),h=ot[c]||ot._default,p=h[0],d=t.createElement("div");t===n?ut.appendChild(d):V(t).appendChild(d);d.innerHTML=h[1]+l+h[2];while(p--)d=d.lastChild;if(!s.support.tbody){var v=Y.test(l),m=c==="table"&&!v?d.firstChild&&d.firstChild.childNodes:h[1]===""&&!v?d.childNodes:[];for(a=m.length-1;a>=0;--a)s.nodeName(m[a],"tbody")&&!m[a].childNodes.length&&m[a].parentNode.removeChild(m[a])}!s.support.leadingWhitespace&&K.test(l)&&d.insertBefore(t.createTextNode(K.exec(l)[0]),d.firstChild);l=d.childNodes}var g;if(!s.support.appendChecked)if(l[0]&&typeof (g=l.length)=="number")for(a=0;a=0)return t+"px"}}});s.support.opacity||(s.cssHooks.opacity={get:function(e,t){return gt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?parseFloat(RegExp.$1)/100+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=s.isNumeric(t)?"alpha(opacity="+t*100+")":"",o=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&s.trim(o.replace(mt,""))===""){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=mt.test(o)?o.replace(mt,i):o+" "+i}});s(function(){s.support.reliableMarginRight||(s.cssHooks.marginRight={get:function(e,t){var n;s.swap(e,{display:"inline-block"},function(){t?n=Nt(e,"margin-right","marginRight"):n=e.style.marginRight});return n}})});n.defaultView&&n.defaultView.getComputedStyle&&(Ct=function(e,t){var n,r,i;t=t.replace(yt,"-$1").toLowerCase();if((r=e.ownerDocument.defaultView)&&(i=r.getComputedStyle(e,null))){n=i.getPropertyValue(t);n===""&&!s.contains(e.ownerDocument.documentElement,e)&&(n=s.style(e,t))}return n});n.documentElement.currentStyle&&(kt=function(e,t){var n,r,i,s=e.currentStyle&&e.currentStyle[t],o=e.style;s===null&&o&&(i=o[t])&&(s=i);if(!bt.test(s)&&wt.test(s)){n=o.left;r=e.runtimeStyle&&e.runtimeStyle.left;r&&(e.runtimeStyle.left=e.currentStyle.left);o.left=t==="fontSize"?"1em":s||0;s=o.pixelLeft+"px";o.left=n;r&&(e.runtimeStyle.left=r)}return s===""?"auto":s});Nt=Ct||kt;if(s.expr&&s.expr.filters){s.expr.filters.hidden=function(e){var t=e.offsetWidth,n=e.offsetHeight;return t===0&&n===0||!s.support.reliableHiddenOffsets&&(e.style&&e.style.display||s.css(e,"display"))==="none"};s.expr.filters.visible=function(e){return!s.expr.filters.hidden(e)}}var At=/%20/g,Ot=/\[\]$/,Mt=/\r?\n/g,_t=/#.*$/,Dt=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,Pt=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Ht=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Bt=/^(?:GET|HEAD)$/,jt=/^\/\//,Ft=/\?/,It=/)<[^<]*)*<\/script>/gi,qt=/^(?:select|textarea)/i,Rt=/\s+/,Ut=/([?&])_=[^&]*/,zt=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,Wt=s.fn.load,Xt={},Vt={},$t,Jt,Kt=["*/"]+["*"];try{$t=i.href}catch(Qt){$t=n.createElement("a");$t.href="";$t=$t.href}Jt=zt.exec($t.toLowerCase())||[];s.fn.extend({load:function(e,n,r){if(typeof e!="string"&&Wt)return Wt.apply(this,arguments);if(!this.length)return this;var i=e.indexOf(" ");if(i>=0){var o=e.slice(i,e.length);e=e.slice(0,i)}var u="GET";if(n)if(s.isFunction(n)){r=n;n=t}else if(typeof n=="object"){n=s.param(n,s.ajaxSettings.traditional);u="POST"}var a=this;s.ajax({url:e,type:u,dataType:"html",data:n,complete:function(e,t,n){n=e.responseText;if(e.isResolved()){e.done(function(e){n=e});a.html(o?s("
").append(n.replace(It,"")).find(o):n)}r&&a.each(r,[n,t,e])}});return this},serialize:function(){return s.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?s.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||qt.test(this.nodeName)||Pt.test(this.type))}).map(function(e,t){var n=s(this).val();return n==null?null:s.isArray(n)?s.map(n,function(e,n){return{name:t.name,value:e.replace(Mt,"\r\n")}}):{name:t.name,value:n.replace(Mt,"\r\n")}}).get()}});s.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){s.fn[t]=function(e){return this.on(t,e)}});s.each(["get","post"],function(e,n){s[n]=function(e,r,i,o){if(s.isFunction(r)){o=o||i;i=r;r=t}return s.ajax({type:n,url:e,data:r,success:i,dataType:o})}});s.extend({getScript:function(e,n){return s.get(e,t,n,"script")},getJSON:function(e,t,n){return s.get(e,t,n,"json")},ajaxSetup:function(e,t){if(t)Zt(e,s.ajaxSettings);else{t=e;e=s.ajaxSettings}Zt(e,t);return e},ajaxSettings:{url:$t,isLocal:Ht.test(Jt[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Kt},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":s.parseJSON,"text xml":s.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Gt(Xt),ajaxTransport:Gt(Vt),ajax:function(e,n){function S(e,n,c,h){if(y===2)return;y=2;m&&clearTimeout(m);v=t;p=h||"";E.readyState=e>0?4:0;var d,g,w,S=n,x=c?tn(r,E,c):t,T,N;if(e>=200&&e<300||e===304){if(r.ifModified){if(T=E.getResponseHeader("Last-Modified"))s.lastModified[l]=T;if(N=E.getResponseHeader("Etag"))s.etag[l]=N}if(e===304){S="notmodified";d=!0}else try{g=nn(r,x);S="success";d=!0}catch(C){S="parsererror";w=C}}else{w=S;if(!S||e){S="error";e<0&&(e=0)}}E.status=e;E.statusText=""+(n||S);d?u.resolveWith(i,[g,S,E]):u.rejectWith(i,[E,S,w]);E.statusCode(f);f=t;b&&o.trigger("ajax"+(d?"Success":"Error"),[E,r,d?g:w]);a.fireWith(i,[E,S]);if(b){o.trigger("ajaxComplete",[E,r]);--s.active||s.event.trigger("ajaxStop")}}if(typeof e=="object"){n=e;e=t}n=n||{};var r=s.ajaxSetup({},n),i=r.context||r,o=i!==r&&(i.nodeType||i instanceof s)?s(i):s.event,u=s.Deferred(),a=s.Callbacks("once memory"),f=r.statusCode||{},l,c={},h={},p,d,v,m,g,y=0,b,w,E={readyState:0,setRequestHeader:function(e,t){if(!y){var n=e.toLowerCase();e=h[n]=h[n]||e;c[e]=t}return this},getAllResponseHeaders:function(){return y===2?p:null},getResponseHeader:function(e){var n;if(y===2){if(!d){d={};while(n=Dt.exec(p))d[n[1].toLowerCase()]=n[2]}n=d[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){y||(r.mimeType=e);return this},abort:function(e){e=e||"abort";v&&v.abort(e);S(0,e);return this}};u.promise(E);E.success=E.done;E.error=E.fail;E.complete=a.add;E.statusCode=function(e){if(e){var t;if(y<2)for(t in e)f[t]=[f[t],e[t]];else{t=e[E.status];E.then(t,t)}}return this};r.url=((e||r.url)+"").replace(_t,"").replace(jt,Jt[1]+"//");r.dataTypes=s.trim(r.dataType||"*").toLowerCase().split(Rt);if(r.crossDomain==null){g=zt.exec(r.url.toLowerCase());r.crossDomain=!(!g||g[1]==Jt[1]&&g[2]==Jt[2]&&(g[3]||(g[1]==="http:"?80:443))==(Jt[3]||(Jt[1]==="http:"?80:443)))}r.data&&r.processData&&typeof r.data!="string"&&(r.data=s.param(r.data,r.traditional));Yt(Xt,r,n,E);if(y===2)return!1;b=r.global;r.type=r.type.toUpperCase();r.hasContent=!Bt.test(r.type);b&&s.active++===0&&s.event.trigger("ajaxStart");if(!r.hasContent){if(r.data){r.url+=(Ft.test(r.url)?"&":"?")+r.data;delete r.data}l=r.url;if(r.cache===!1){var x=s.now(),T=r.url.replace(Ut,"$1_="+x);r.url=T+(T===r.url?(Ft.test(r.url)?"&":"?")+"_="+x:"")}}(r.data&&r.hasContent&&r.contentType!==!1||n.contentType)&&E.setRequestHeader("Content-Type",r.contentType);if(r.ifModified){l=l||r.url;s.lastModified[l]&&E.setRequestHeader("If-Modified-Since",s.lastModified[l]);s.etag[l]&&E.setRequestHeader("If-None-Match",s.etag[l])}E.setRequestHeader("Accept",r.dataTypes[0]&&r.accepts[r.dataTypes[0]]?r.accepts[r.dataTypes[0]]+(r.dataTypes[0]!=="*"?", "+Kt+"; q=0.01":""):r.accepts["*"]);for(w in r.headers)E.setRequestHeader(w,r.headers[w]);if(!r.beforeSend||r.beforeSend.call(i,E,r)!==!1&&y!==2){for(w in{success:1,error:1,complete:1})E[w](r[w]);v=Yt(Vt,r,n,E);if(!v)S(-1,"No Transport");else{E.readyState=1;b&&o.trigger("ajaxSend",[E,r]);r.async&&r.timeout>0&&(m=setTimeout(function(){E.abort("timeout")},r.timeout));try{y=1;v.send(c,S)}catch(N){if(!(y<2))throw N;S(-1,N)}}return E}E.abort();return!1},param:function(e,n){var r=[],i=function(e,t){t=s.isFunction(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=s.ajaxSettings.traditional);if(s.isArray(e)||e.jquery&&!s.isPlainObject(e))s.each(e,function(){i(this.name,this.value)});else for(var o in e)en(o,e[o],n,i);return r.join("&").replace(At,"+")}});s.extend({active:0,lastModified:{},etag:{}});var rn=s.now(),sn=/(\=)\?(&|$)|\?\?/i;s.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return s.expando+"_"+rn++}});s.ajaxPrefilter("json jsonp",function(t,n,r){var i=t.contentType==="application/x-www-form-urlencoded"&&typeof t.data=="string";if(t.dataTypes[0]==="jsonp"||t.jsonp!==!1&&(sn.test(t.url)||i&&sn.test(t.data))){var o,u=t.jsonpCallback=s.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a=e[u],f=t.url,l=t.data,c="$1"+u+"$2";if(t.jsonp!==!1){f=f.replace(sn,c);if(t.url===f){i&&(l=l.replace(sn,c));t.data===l&&(f+=(/\?/.test(f)?"&":"?")+t.jsonp+"="+u)}}t.url=f;t.data=l;e[u]=function(e){o=[e]};r.always(function(){e[u]=a;o&&s.isFunction(a)&&e[u](o[0])});t.converters["script json"]=function(){o||s.error(u+" was not called");return o[0]};t.dataTypes[0]="json";return"script"}});s.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){s.globalEval(e);return e}}});s.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1);if(e.crossDomain){e.type="GET";e.global=!1}});s.ajaxTransport("script",function(e){if(e.crossDomain){var r,i=n.head||n.getElementsByTagName("head")[0]||n.documentElement;return{send:function(s,o){r=n.createElement("script");r.async="async";e.scriptCharset&&(r.charset=e.scriptCharset);r.src=e.url;r.onload=r.onreadystatechange=function(e,n){if(n||!r.readyState||/loaded|complete/.test(r.readyState)){r.onload=r.onreadystatechange=null;i&&r.parentNode&&i.removeChild(r);r=t;n||o(200,"success")}};i.insertBefore(r,i.firstChild)},abort:function(){r&&r.onload(0,1)}}}});var on=e.ActiveXObject?function(){for(var e in an)an[e](0,1)}:!1,un=0,an;s.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&fn()||ln()}:fn;(function(e){s.extend(s.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})})(s.ajaxSettings.xhr());s.support.ajax&&s.ajaxTransport(function(n){if(!n.crossDomain||s.support.cors){var r;return{send:function(i,o){var u=n.xhr(),a,f;n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async);if(n.xhrFields)for(f in n.xhrFields)u[f]=n.xhrFields[f];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType);!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(f in i)u.setRequestHeader(f,i[f])}catch(l){}u.send(n.hasContent&&n.data||null);r=function(e,i){var f,l,c,h,p;try{if(r&&(i||u.readyState===4)){r=t;if(a){u.onreadystatechange=s.noop;on&&delete an[a]}if(i)u.readyState!==4&&u.abort();else{f=u.status;c=u.getAllResponseHeaders();h={};p=u.responseXML;p&&p.documentElement&&(h.xml=p);h.text=u.responseText;try{l=u.statusText}catch(d){l=""}!f&&n.isLocal&&!n.crossDomain?f=h.text?200:404:f===1223&&(f=204)}}}catch(v){i||o(-1,v)}h&&o(f,l,h,c)};if(!n.async||u.readyState===4)r();else{a=++un;if(on){if(!an){an={};s(e).unload(on)}an[a]=r}u.onreadystatechange=r}},abort:function(){r&&r(0,1)}}}});var cn={},hn,pn,dn=/^(?:toggle|show|hide)$/,vn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,mn,gn=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],yn;s.fn.extend({show:function(e,t,n){var r,i;if(e||e===0)return this.animate(En("show",3),e,t,n);for(var o=0,u=this.length;o=a.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();a.animatedProperties[this.prop]=!0;for(t in a.animatedProperties)a.animatedProperties[t]!==!0&&(o=!1);if(o){a.overflow!=null&&!s.support.shrinkWrapBlocks&&s.each(["","X","Y"],function(e,t){u.style["overflow"+t]=a.overflow[e]});a.hide&&s(u).hide();if(a.hide||a.show)for(t in a.animatedProperties){s.style(u,t,a.orig[t]);s.removeData(u,"fxshow"+t,!0);s.removeData(u,"toggle"+t,!0)}r=a.complete;if(r){a.complete=!1;r.call(u)}}return!1}if(a.duration==Infinity)this.now=i;else{n=i-this.startTime;this.state=n/a.duration;this.pos=s.easing[a.animatedProperties[this.prop]](this.state,n,0,1,a.duration);this.now=this.start+(this.end-this.start)*this.pos}this.update();return!0}};s.extend(s.fx,{tick:function(){var e,t=s.timers,n=0;for(;n-1,l={},c={},h,p;if(f){c=i.position();h=c.top;p=c.left}else{h=parseFloat(u)||0;p=parseFloat(a)||0}s.isFunction(t)&&(t=t.call(e,n,o));t.top!=null&&(l.top=t.top-o.top+h);t.left!=null&&(l.left=t.left-o.left+p);"using"in t?t.using.call(e,l):i.css(l)}};s.fn.extend({position:function(){if(!this[0])return null;var e=this[0],t=this.offsetParent(),n=this.offset(),r=Tn.test(t[0].nodeName)?{top:0,left:0}:t.offset();n.top-=parseFloat(s.css(e,"marginTop"))||0;n.left-=parseFloat(s.css(e,"marginLeft"))||0;r.top+=parseFloat(s.css(t[0],"borderTopWidth"))||0;r.left+=parseFloat(s.css(t[0],"borderLeftWidth"))||0;return{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||n.body;while(e&&!Tn.test(e.nodeName)&&s.css(e,"position")==="static")e=e.offsetParent;return e})}});s.each(["Left","Top"],function(e,n){var r="scroll"+n;s.fn[r]=function(n){var i,o;if(n===t){i=this[0];if(!i)return null;o=Nn(i);return o?"pageXOffset"in o?o[e?"pageYOffset":"pageXOffset"]:s.support.boxModel&&o.document.documentElement[r]||o.document.body[r]:i[r]}return this.each(function(){o=Nn(this);o?o.scrollTo(e?s(o).scrollLeft():n,e?n:s(o).scrollTop()):this[r]=n})}});s.each(["Height","Width"],function(e,n){var r=n.toLowerCase();s.fn["inner"+n]=function(){var e=this[0];return e?e.style?parseFloat(s.css(e,r,"padding")):this[r]():null};s.fn["outer"+n]=function(e){var t=this[0];return t?t.style?parseFloat(s.css(t,r,e?"margin":"border")):this[r]():null};s.fn[r]=function(e){var i=this[0];if(!i)return e==null?null:this;if(s.isFunction(e))return this.each(function(t){var n=s(this);n[r](e.call(this,t,n[r]()))});if(s.isWindow(i)){var o=i.document.documentElement["client"+n],u=i.document.body;return i.document.compatMode==="CSS1Compat"&&o||u&&u["client"+n]||o}if(i.nodeType===9)return Math.max(i.documentElement["client"+n],i.body["scroll"+n],i.documentElement["scroll"+n],i.body["offset"+n],i.documentElement["offset"+n]);if(e===t){var a=s.css(i,r),f=parseFloat(a);return s.isNumeric(f)?f:a}return this.css(r,typeof e=="string"?e:e+"px")}});e.jQuery=e.$=s;typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return s})})(window);typeof jQuery=="undefined"&&alert("Hashgrid: jQuery not loaded. Make sure it's linked to your pages.");var hashgrid=function(e){function S(e){if(t.modifierKey==null)return!0;var n=!0;switch(t.modifierKey){case"ctrl":n=e.ctrlKey?e.ctrlKey:!1;break;case"alt":n=e.altKey?e.altKey:!1;break;case"shift":n=e.shiftKey?e.shiftKey:!1}return n}function x(e){var t=!1,n=e.keyCode?e.keyCode:e.which;n==13?t="enter":t=String.fromCharCode(n).toLowerCase();return t}function T(){L(t.cookiePrefix+t.id,(w?"1":"0")+"-"+d+"-"+n,1)}function N(){f.show()}function C(e){var r,i,s=e.target.tagName.toLowerCase();if(s=="input"||s=="textarea"||s=="select")return!0;i=S(e);if(!i)return!0;r=x(e);if(!r)return!0;switch(r){case t.showGridKey:if(!h){N();h=!0}else if(w){f.hide();h=!1;w=!1;T()}break;case t.holdGridKey:if(h&&!w){w=!0;T()}break;case t.foregroundKey:if(h){if(f.css("z-index")==m){f.css("z-index",v);d="B"}else{f.css("z-index",m);d="F"}T()}break;case t.jumpGridsKey:if(h&&t.numberOfGrids>1){f.removeClass(t.classPrefix+n);n++;n>t.numberOfGrids&&(n=1);f.addClass(t.classPrefix+n);N();/webkit/.test(navigator.userAgent.toLowerCase())&&M();T()}}return!0}function k(e){var n,r=S(e);if(!r)return!0;n=x(e);if(n&&n==t.showGridKey&&!w){f.hide();h=!1}return!0}function L(e,t,n){var r,i="";if(n){r=new Date;r.setTime(r.getTime()+n*24*60*60*1e3);i="; expires="+r.toGMTString()}document.cookie=e+"="+t+i+"; path=/"}function A(e){var t,n=document.cookie.split(";"),r=0,i=n.length,s=e+"=";for(;r0&&$("#"+t.id).remove();c=$("
");c.attr("id",t.id).css({display:"none","pointer-events":"none"});$("body").prepend(c);f=$("#"+t.id);f.css("z-index")=="auto"&&f.css("z-index",v);g=parseFloat($(document).height());f.height(g);f.append('
');E=f.css("top");f.css({top:"-999px",display:"block"});o=$("#"+t.id+"-horiz");u=o.outerHeight()-1;f.css({display:"none",top:E});if(u<=0)return!1;a=Math.floor(g/u);r="";for(s=a-1;s>=1;s--)r+='
';f.append(r);f.prepend($('
'));p=f.children(".vert-container");i=f.width();p.css({position:"absolute",top:0});p.append('
');r="";for(s=0;s<50;s++)r+='
';p.append(r);p.children().css({display:"inline-block"}).height(g);l=A(t.cookiePrefix+t.id);if(typeof l=="string"){b=l.split("-");b[2]=Number(b[2]);if(typeof b[2]=="number"&&!isNaN(b[2])){n=b[2].toFixed(0);f.addClass(t.classPrefix+n)}if(b[1]=="F"){d="F";f.css("z-index",m)}if(b[0]=="1"){h=!0;w=!0;N()}}else f.addClass(t.classPrefix+n);$(document).bind("keydown",C);$(document).bind("keyup",k);return{}};$(document).ready(function(){var e=new hashgrid({numberOfGrids:3})}); \ No newline at end of file +remove:function(e,t){for(var n=0,r;(r=this[n])!=null;n++)if(!e||s.filter(e,[r]).length){if(!t&&r.nodeType===1){s.cleanData(r.getElementsByTagName("*"));s.cleanData([r])}r.parentNode&&r.parentNode.removeChild(r)}return this},empty:function(){for(var e=0,t;(t=this[e])!=null;e++){t.nodeType===1&&s.cleanData(t.getElementsByTagName("*"));while(t.firstChild)t.removeChild(t.firstChild)}return this},clone:function(e,t){e=e==null?!1:e;t=t==null?e:t;return this.map(function(){return s.clone(this,e,t)})},html:function(e){if(e===t)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(J,""):null;if(typeof e=="string"&&!et.test(e)&&(s.support.leadingWhitespace||!K.test(e))&&!ot[(G.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Q,"<$1>");try{for(var n=0,r=this.length;n1&&c0?this.clone(!0):this).get();s(i[u])[t](f);r=r.concat(f)}return this.pushStack(r,e,i.selector)}});s.extend({clone:function(e,t,n){var r,i,o,u=s.support.html5Clone||!nt.test("<"+e.nodeName)?e.cloneNode(!0):dt(e);if((!s.support.noCloneEvent||!s.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!s.isXMLDoc(e)){lt(e,u);r=ct(e);i=ct(u);for(o=0;r[o];++o)i[o]&<(r[o],i[o])}if(t){ft(e,u);if(n){r=ct(e);i=ct(u);for(o=0;r[o];++o)ft(r[o],i[o])}}r=i=null;return u},clean:function(e,t,r,i){var o;t=t||n;typeof t.createElement=="undefined"&&(t=t.ownerDocument||t[0]&&t[0].ownerDocument||n);var u=[],a;for(var f=0,l;(l=e[f])!=null;f++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!Z.test(l))l=t.createTextNode(l);else{l=l.replace(Q,"<$1>");var c=(G.exec(l)||["",""])[1].toLowerCase(),h=ot[c]||ot._default,p=h[0],d=t.createElement("div");t===n?ut.appendChild(d):V(t).appendChild(d);d.innerHTML=h[1]+l+h[2];while(p--)d=d.lastChild;if(!s.support.tbody){var v=Y.test(l),m=c==="table"&&!v?d.firstChild&&d.firstChild.childNodes:h[1]==="
"&&!v?d.childNodes:[];for(a=m.length-1;a>=0;--a)s.nodeName(m[a],"tbody")&&!m[a].childNodes.length&&m[a].parentNode.removeChild(m[a])}!s.support.leadingWhitespace&&K.test(l)&&d.insertBefore(t.createTextNode(K.exec(l)[0]),d.firstChild);l=d.childNodes}var g;if(!s.support.appendChecked)if(l[0]&&typeof (g=l.length)=="number")for(a=0;a=0)return t+"px"}}});s.support.opacity||(s.cssHooks.opacity={get:function(e,t){return gt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?parseFloat(RegExp.$1)/100+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=s.isNumeric(t)?"alpha(opacity="+t*100+")":"",o=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&s.trim(o.replace(mt,""))===""){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=mt.test(o)?o.replace(mt,i):o+" "+i}});s(function(){s.support.reliableMarginRight||(s.cssHooks.marginRight={get:function(e,t){var n;s.swap(e,{display:"inline-block"},function(){t?n=Nt(e,"margin-right","marginRight"):n=e.style.marginRight});return n}})});n.defaultView&&n.defaultView.getComputedStyle&&(Ct=function(e,t){var n,r,i;t=t.replace(yt,"-$1").toLowerCase();if((r=e.ownerDocument.defaultView)&&(i=r.getComputedStyle(e,null))){n=i.getPropertyValue(t);n===""&&!s.contains(e.ownerDocument.documentElement,e)&&(n=s.style(e,t))}return n});n.documentElement.currentStyle&&(kt=function(e,t){var n,r,i,s=e.currentStyle&&e.currentStyle[t],o=e.style;s===null&&o&&(i=o[t])&&(s=i);if(!bt.test(s)&&wt.test(s)){n=o.left;r=e.runtimeStyle&&e.runtimeStyle.left;r&&(e.runtimeStyle.left=e.currentStyle.left);o.left=t==="fontSize"?"1em":s||0;s=o.pixelLeft+"px";o.left=n;r&&(e.runtimeStyle.left=r)}return s===""?"auto":s});Nt=Ct||kt;if(s.expr&&s.expr.filters){s.expr.filters.hidden=function(e){var t=e.offsetWidth,n=e.offsetHeight;return t===0&&n===0||!s.support.reliableHiddenOffsets&&(e.style&&e.style.display||s.css(e,"display"))==="none"};s.expr.filters.visible=function(e){return!s.expr.filters.hidden(e)}}var At=/%20/g,Ot=/\[\]$/,Mt=/\r?\n/g,_t=/#.*$/,Dt=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,Pt=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Ht=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Bt=/^(?:GET|HEAD)$/,jt=/^\/\//,Ft=/\?/,It=/)<[^<]*)*<\/script>/gi,qt=/^(?:select|textarea)/i,Rt=/\s+/,Ut=/([?&])_=[^&]*/,zt=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,Wt=s.fn.load,Xt={},Vt={},$t,Jt,Kt=["*/"]+["*"];try{$t=i.href}catch(Qt){$t=n.createElement("a");$t.href="";$t=$t.href}Jt=zt.exec($t.toLowerCase())||[];s.fn.extend({load:function(e,n,r){if(typeof e!="string"&&Wt)return Wt.apply(this,arguments);if(!this.length)return this;var i=e.indexOf(" ");if(i>=0){var o=e.slice(i,e.length);e=e.slice(0,i)}var u="GET";if(n)if(s.isFunction(n)){r=n;n=t}else if(typeof n=="object"){n=s.param(n,s.ajaxSettings.traditional);u="POST"}var a=this;s.ajax({url:e,type:u,dataType:"html",data:n,complete:function(e,t,n){n=e.responseText;if(e.isResolved()){e.done(function(e){n=e});a.html(o?s("
").append(n.replace(It,"")).find(o):n)}r&&a.each(r,[n,t,e])}});return this},serialize:function(){return s.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?s.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||qt.test(this.nodeName)||Pt.test(this.type))}).map(function(e,t){var n=s(this).val();return n==null?null:s.isArray(n)?s.map(n,function(e,n){return{name:t.name,value:e.replace(Mt,"\r\n")}}):{name:t.name,value:n.replace(Mt,"\r\n")}}).get()}});s.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){s.fn[t]=function(e){return this.on(t,e)}});s.each(["get","post"],function(e,n){s[n]=function(e,r,i,o){if(s.isFunction(r)){o=o||i;i=r;r=t}return s.ajax({type:n,url:e,data:r,success:i,dataType:o})}});s.extend({getScript:function(e,n){return s.get(e,t,n,"script")},getJSON:function(e,t,n){return s.get(e,t,n,"json")},ajaxSetup:function(e,t){if(t)Zt(e,s.ajaxSettings);else{t=e;e=s.ajaxSettings}Zt(e,t);return e},ajaxSettings:{url:$t,isLocal:Ht.test(Jt[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Kt},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":s.parseJSON,"text xml":s.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Gt(Xt),ajaxTransport:Gt(Vt),ajax:function(e,n){function S(e,n,c,h){if(y===2)return;y=2;m&&clearTimeout(m);v=t;p=h||"";E.readyState=e>0?4:0;var d,g,w,S=n,x=c?tn(r,E,c):t,T,N;if(e>=200&&e<300||e===304){if(r.ifModified){if(T=E.getResponseHeader("Last-Modified"))s.lastModified[l]=T;if(N=E.getResponseHeader("Etag"))s.etag[l]=N}if(e===304){S="notmodified";d=!0}else try{g=nn(r,x);S="success";d=!0}catch(C){S="parsererror";w=C}}else{w=S;if(!S||e){S="error";e<0&&(e=0)}}E.status=e;E.statusText=""+(n||S);d?u.resolveWith(i,[g,S,E]):u.rejectWith(i,[E,S,w]);E.statusCode(f);f=t;b&&o.trigger("ajax"+(d?"Success":"Error"),[E,r,d?g:w]);a.fireWith(i,[E,S]);if(b){o.trigger("ajaxComplete",[E,r]);--s.active||s.event.trigger("ajaxStop")}}if(typeof e=="object"){n=e;e=t}n=n||{};var r=s.ajaxSetup({},n),i=r.context||r,o=i!==r&&(i.nodeType||i instanceof s)?s(i):s.event,u=s.Deferred(),a=s.Callbacks("once memory"),f=r.statusCode||{},l,c={},h={},p,d,v,m,g,y=0,b,w,E={readyState:0,setRequestHeader:function(e,t){if(!y){var n=e.toLowerCase();e=h[n]=h[n]||e;c[e]=t}return this},getAllResponseHeaders:function(){return y===2?p:null},getResponseHeader:function(e){var n;if(y===2){if(!d){d={};while(n=Dt.exec(p))d[n[1].toLowerCase()]=n[2]}n=d[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){y||(r.mimeType=e);return this},abort:function(e){e=e||"abort";v&&v.abort(e);S(0,e);return this}};u.promise(E);E.success=E.done;E.error=E.fail;E.complete=a.add;E.statusCode=function(e){if(e){var t;if(y<2)for(t in e)f[t]=[f[t],e[t]];else{t=e[E.status];E.then(t,t)}}return this};r.url=((e||r.url)+"").replace(_t,"").replace(jt,Jt[1]+"//");r.dataTypes=s.trim(r.dataType||"*").toLowerCase().split(Rt);if(r.crossDomain==null){g=zt.exec(r.url.toLowerCase());r.crossDomain=!(!g||g[1]==Jt[1]&&g[2]==Jt[2]&&(g[3]||(g[1]==="http:"?80:443))==(Jt[3]||(Jt[1]==="http:"?80:443)))}r.data&&r.processData&&typeof r.data!="string"&&(r.data=s.param(r.data,r.traditional));Yt(Xt,r,n,E);if(y===2)return!1;b=r.global;r.type=r.type.toUpperCase();r.hasContent=!Bt.test(r.type);b&&s.active++===0&&s.event.trigger("ajaxStart");if(!r.hasContent){if(r.data){r.url+=(Ft.test(r.url)?"&":"?")+r.data;delete r.data}l=r.url;if(r.cache===!1){var x=s.now(),T=r.url.replace(Ut,"$1_="+x);r.url=T+(T===r.url?(Ft.test(r.url)?"&":"?")+"_="+x:"")}}(r.data&&r.hasContent&&r.contentType!==!1||n.contentType)&&E.setRequestHeader("Content-Type",r.contentType);if(r.ifModified){l=l||r.url;s.lastModified[l]&&E.setRequestHeader("If-Modified-Since",s.lastModified[l]);s.etag[l]&&E.setRequestHeader("If-None-Match",s.etag[l])}E.setRequestHeader("Accept",r.dataTypes[0]&&r.accepts[r.dataTypes[0]]?r.accepts[r.dataTypes[0]]+(r.dataTypes[0]!=="*"?", "+Kt+"; q=0.01":""):r.accepts["*"]);for(w in r.headers)E.setRequestHeader(w,r.headers[w]);if(!r.beforeSend||r.beforeSend.call(i,E,r)!==!1&&y!==2){for(w in{success:1,error:1,complete:1})E[w](r[w]);v=Yt(Vt,r,n,E);if(!v)S(-1,"No Transport");else{E.readyState=1;b&&o.trigger("ajaxSend",[E,r]);r.async&&r.timeout>0&&(m=setTimeout(function(){E.abort("timeout")},r.timeout));try{y=1;v.send(c,S)}catch(N){if(!(y<2))throw N;S(-1,N)}}return E}E.abort();return!1},param:function(e,n){var r=[],i=function(e,t){t=s.isFunction(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=s.ajaxSettings.traditional);if(s.isArray(e)||e.jquery&&!s.isPlainObject(e))s.each(e,function(){i(this.name,this.value)});else for(var o in e)en(o,e[o],n,i);return r.join("&").replace(At,"+")}});s.extend({active:0,lastModified:{},etag:{}});var rn=s.now(),sn=/(\=)\?(&|$)|\?\?/i;s.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return s.expando+"_"+rn++}});s.ajaxPrefilter("json jsonp",function(t,n,r){var i=t.contentType==="application/x-www-form-urlencoded"&&typeof t.data=="string";if(t.dataTypes[0]==="jsonp"||t.jsonp!==!1&&(sn.test(t.url)||i&&sn.test(t.data))){var o,u=t.jsonpCallback=s.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a=e[u],f=t.url,l=t.data,c="$1"+u+"$2";if(t.jsonp!==!1){f=f.replace(sn,c);if(t.url===f){i&&(l=l.replace(sn,c));t.data===l&&(f+=(/\?/.test(f)?"&":"?")+t.jsonp+"="+u)}}t.url=f;t.data=l;e[u]=function(e){o=[e]};r.always(function(){e[u]=a;o&&s.isFunction(a)&&e[u](o[0])});t.converters["script json"]=function(){o||s.error(u+" was not called");return o[0]};t.dataTypes[0]="json";return"script"}});s.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){s.globalEval(e);return e}}});s.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1);if(e.crossDomain){e.type="GET";e.global=!1}});s.ajaxTransport("script",function(e){if(e.crossDomain){var r,i=n.head||n.getElementsByTagName("head")[0]||n.documentElement;return{send:function(s,o){r=n.createElement("script");r.async="async";e.scriptCharset&&(r.charset=e.scriptCharset);r.src=e.url;r.onload=r.onreadystatechange=function(e,n){if(n||!r.readyState||/loaded|complete/.test(r.readyState)){r.onload=r.onreadystatechange=null;i&&r.parentNode&&i.removeChild(r);r=t;n||o(200,"success")}};i.insertBefore(r,i.firstChild)},abort:function(){r&&r.onload(0,1)}}}});var on=e.ActiveXObject?function(){for(var e in an)an[e](0,1)}:!1,un=0,an;s.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&fn()||ln()}:fn;(function(e){s.extend(s.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})})(s.ajaxSettings.xhr());s.support.ajax&&s.ajaxTransport(function(n){if(!n.crossDomain||s.support.cors){var r;return{send:function(i,o){var u=n.xhr(),a,f;n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async);if(n.xhrFields)for(f in n.xhrFields)u[f]=n.xhrFields[f];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType);!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(f in i)u.setRequestHeader(f,i[f])}catch(l){}u.send(n.hasContent&&n.data||null);r=function(e,i){var f,l,c,h,p;try{if(r&&(i||u.readyState===4)){r=t;if(a){u.onreadystatechange=s.noop;on&&delete an[a]}if(i)u.readyState!==4&&u.abort();else{f=u.status;c=u.getAllResponseHeaders();h={};p=u.responseXML;p&&p.documentElement&&(h.xml=p);h.text=u.responseText;try{l=u.statusText}catch(d){l=""}!f&&n.isLocal&&!n.crossDomain?f=h.text?200:404:f===1223&&(f=204)}}}catch(v){i||o(-1,v)}h&&o(f,l,h,c)};if(!n.async||u.readyState===4)r();else{a=++un;if(on){if(!an){an={};s(e).unload(on)}an[a]=r}u.onreadystatechange=r}},abort:function(){r&&r(0,1)}}}});var cn={},hn,pn,dn=/^(?:toggle|show|hide)$/,vn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,mn,gn=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],yn;s.fn.extend({show:function(e,t,n){var r,i;if(e||e===0)return this.animate(En("show",3),e,t,n);for(var o=0,u=this.length;o=a.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();a.animatedProperties[this.prop]=!0;for(t in a.animatedProperties)a.animatedProperties[t]!==!0&&(o=!1);if(o){a.overflow!=null&&!s.support.shrinkWrapBlocks&&s.each(["","X","Y"],function(e,t){u.style["overflow"+t]=a.overflow[e]});a.hide&&s(u).hide();if(a.hide||a.show)for(t in a.animatedProperties){s.style(u,t,a.orig[t]);s.removeData(u,"fxshow"+t,!0);s.removeData(u,"toggle"+t,!0)}r=a.complete;if(r){a.complete=!1;r.call(u)}}return!1}if(a.duration==Infinity)this.now=i;else{n=i-this.startTime;this.state=n/a.duration;this.pos=s.easing[a.animatedProperties[this.prop]](this.state,n,0,1,a.duration);this.now=this.start+(this.end-this.start)*this.pos}this.update();return!0}};s.extend(s.fx,{tick:function(){var e,t=s.timers,n=0;for(;n-1,l={},c={},h,p;if(f){c=i.position();h=c.top;p=c.left}else{h=parseFloat(u)||0;p=parseFloat(a)||0}s.isFunction(t)&&(t=t.call(e,n,o));t.top!=null&&(l.top=t.top-o.top+h);t.left!=null&&(l.left=t.left-o.left+p);"using"in t?t.using.call(e,l):i.css(l)}};s.fn.extend({position:function(){if(!this[0])return null;var e=this[0],t=this.offsetParent(),n=this.offset(),r=Tn.test(t[0].nodeName)?{top:0,left:0}:t.offset();n.top-=parseFloat(s.css(e,"marginTop"))||0;n.left-=parseFloat(s.css(e,"marginLeft"))||0;r.top+=parseFloat(s.css(t[0],"borderTopWidth"))||0;r.left+=parseFloat(s.css(t[0],"borderLeftWidth"))||0;return{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||n.body;while(e&&!Tn.test(e.nodeName)&&s.css(e,"position")==="static")e=e.offsetParent;return e})}});s.each(["Left","Top"],function(e,n){var r="scroll"+n;s.fn[r]=function(n){var i,o;if(n===t){i=this[0];if(!i)return null;o=Nn(i);return o?"pageXOffset"in o?o[e?"pageYOffset":"pageXOffset"]:s.support.boxModel&&o.document.documentElement[r]||o.document.body[r]:i[r]}return this.each(function(){o=Nn(this);o?o.scrollTo(e?s(o).scrollLeft():n,e?n:s(o).scrollTop()):this[r]=n})}});s.each(["Height","Width"],function(e,n){var r=n.toLowerCase();s.fn["inner"+n]=function(){var e=this[0];return e?e.style?parseFloat(s.css(e,r,"padding")):this[r]():null};s.fn["outer"+n]=function(e){var t=this[0];return t?t.style?parseFloat(s.css(t,r,e?"margin":"border")):this[r]():null};s.fn[r]=function(e){var i=this[0];if(!i)return e==null?null:this;if(s.isFunction(e))return this.each(function(t){var n=s(this);n[r](e.call(this,t,n[r]()))});if(s.isWindow(i)){var o=i.document.documentElement["client"+n],u=i.document.body;return i.document.compatMode==="CSS1Compat"&&o||u&&u["client"+n]||o}if(i.nodeType===9)return Math.max(i.documentElement["client"+n],i.body["scroll"+n],i.documentElement["scroll"+n],i.body["offset"+n],i.documentElement["offset"+n]);if(e===t){var a=s.css(i,r),f=parseFloat(a);return s.isNumeric(f)?f:a}return this.css(r,typeof e=="string"?e:e+"px")}});e.jQuery=e.$=s;typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return s})})(window);(function(e,t){typeof jQuery=="undefined"&&alert("Hashgrid: jQuery not loaded. Make sure it's linked to your pages.");var n=function(t){function x(e){if(n.modifierKey==null)return!0;var t=!0;switch(n.modifierKey){case"ctrl":t=e.ctrlKey?e.ctrlKey:!1;break;case"alt":t=e.altKey?e.altKey:!1;break;case"shift":t=e.shiftKey?e.shiftKey:!1}return t}function T(e){var t=!1,n=e.keyCode?e.keyCode:e.which;n==13?t="enter":t=String.fromCharCode(n).toLowerCase();return t}function N(){A(n.cookiePrefix+n.id,(E?"1":"0")+"-"+v+"-"+r,1)}function C(){l.show()}function k(e){var t,i,s=e.target.tagName.toLowerCase();if(s=="input"||s=="textarea"||s=="select")return!0;i=x(e);if(!i)return!0;t=T(e);if(!t)return!0;switch(t){case n.showGridKey:if(!p){C();p=!0}else if(E){l.hide();p=!1;E=!1;N()}break;case n.holdGridKey:if(p&&!E){E=!0;N()}break;case n.foregroundKey:if(p){if(l.css("z-index")==g){l.css("z-index",m);v="B"}else{l.css("z-index",g);v="F"}N()}break;case n.jumpGridsKey:if(p&&n.numberOfGrids>1){l.removeClass(n.classPrefix+r);r++;r>n.numberOfGrids&&(r=1);l.addClass(n.classPrefix+r);C();/webkit/.test(navigator.userAgent.toLowerCase())&&_();N()}}return!0}function L(e){var t,r=x(e);if(!r)return!0;t=T(e);if(t&&t==n.showGridKey&&!E){l.hide();p=!1}return!0}function A(e,t,n){var r,i="";if(n){r=new Date;r.setTime(r.getTime()+n*24*60*60*1e3);i="; expires="+r.toGMTString()}document.cookie=e+"="+t+i+"; path=/"}function O(e){var t,n=document.cookie.split(";"),r=0,i=n.length,s=e+"=";for(;r0&&e("#"+n.id).remove();h=e("
");h.attr("id",n.id).css({display:"none","pointer-events":"none"});e("body").prepend(h);l=e("#"+n.id);l.css("z-index")=="auto"&&l.css("z-index",m);y=parseFloat(e(document).height());l.height(y);l.append('
');S=l.css("top");l.css({top:"-999px",display:"block"});u=e("#"+n.id+"-horiz");a=u.outerHeight()-1;l.css({display:"none",top:S});if(a<=0)return!1;f=Math.floor(y/a);i="";for(o=f-1;o>=1;o--)i+='
';l.append(i);l.prepend(e('
'));d=l.children(".vert-container");s=l.width();d.css({position:"absolute",top:0});d.append('
');i="";for(o=0;o<50;o++)i+='
';d.append(i);d.children().css({display:"inline-block"}).height(y);c=O(n.cookiePrefix+n.id);if(typeof c=="string"){w=c.split("-");w[2]=Number(w[2]);if(typeof w[2]=="number"&&!isNaN(w[2])){r=w[2].toFixed(0);l.addClass(n.classPrefix+r)}if(w[1]=="F"){v="F";l.css("z-index",g)}if(w[0]=="1"){p=!0;E=!0;C()}}else l.addClass(n.classPrefix+r);e(document).bind("keydown",k);e(document).bind("keyup",L);return{}};e(document).ready(function(){var e=new n({numberOfGrids:3})})})(jQuery); \ No newline at end of file diff --git a/js/lib/hashgrid.js b/js/lib/hashgrid.js index db24c87..49f611c 100644 --- a/js/lib/hashgrid.js +++ b/js/lib/hashgrid.js @@ -49,380 +49,382 @@ * }); */ +;(function($, undefined){ -/** - * Make sure we have the library - * TODO: Use an adapter - */ -if (typeof jQuery == "undefined") { - alert("Hashgrid: jQuery not loaded. Make sure it's linked to your pages."); -} - - -/** - * hashgrid overlay - * @constructor - */ -var hashgrid = function(set) { - - var options = { - id: 'grid', // id for the grid container - modifierKey: null, // optional 'ctrl', 'alt' or 'shift' - showGridKey: 'g', // key to show the grid - holdGridKey: 'h', // key to hold the grid in place - foregroundKey: 'f', // key to toggle foreground/background - jumpGridsKey: 'j', // key to cycle through the grid classes - numberOfGrids: 1, // number of grid classes used - classPrefix: 'grid-', // prefix for the grid classes - cookiePrefix: 'hashgrid'// prefix for the cookie name - }, - classNumber = 1, - gridLines, - gridWidth, - i, - line, - lineHeight, - numGridLines, - overlay, - overlayCookie, - overlayEl, - overlayOn = false, - overlayVert, - overlayZState = 'B', - overlayZBackground = -1, - overlayZForeground = 9999, - pageHeight, - setKey, - state, - sticky = false, - top; - - // Apply options - if (typeof set == 'object') { - for (setKey in set) { - options[setKey] = set[setKey]; - } - } - else if (typeof set == 'string') { - options.id = set; - } - - // Remove any conflicting overlay - if ($('#' + options.id).length > 0) { - $('#' + options.id).remove(); + /** + * Make sure we have the library + * TODO: Use an adapter + */ + if (typeof jQuery == "undefined") { + alert("Hashgrid: jQuery not loaded. Make sure it's linked to your pages."); } - - // Create overlay, hidden before adding to DOM - overlayEl = $('
'); - overlayEl - .attr('id', options.id) - .css({ - display: 'none', - 'pointer-events': 'none' + + + /** + * hashgrid overlay + * @constructor + */ + var hashgrid = function(set) { + + var options = { + id: 'grid', // id for the grid container + modifierKey: null, // optional 'ctrl', 'alt' or 'shift' + showGridKey: 'g', // key to show the grid + holdGridKey: 'h', // key to hold the grid in place + foregroundKey: 'f', // key to toggle foreground/background + jumpGridsKey: 'j', // key to cycle through the grid classes + numberOfGrids: 1, // number of grid classes used + classPrefix: 'grid-', // prefix for the grid classes + cookiePrefix: 'hashgrid'// prefix for the cookie name + }, + classNumber = 1, + gridLines, + gridWidth, + i, + line, + lineHeight, + numGridLines, + overlay, + overlayCookie, + overlayEl, + overlayOn = false, + overlayVert, + overlayZState = 'B', + overlayZBackground = -1, + overlayZForeground = 9999, + pageHeight, + setKey, + state, + sticky = false, + top; + + // Apply options + if (typeof set == 'object') { + for (setKey in set) { + options[setKey] = set[setKey]; + } + } + else if (typeof set == 'string') { + options.id = set; + } + + // Remove any conflicting overlay + if ($('#' + options.id).length > 0) { + $('#' + options.id).remove(); + } + + // Create overlay, hidden before adding to DOM + overlayEl = $('
'); + overlayEl + .attr('id', options.id) + .css({ + display: 'none', + 'pointer-events': 'none' + }); + $("body").prepend(overlayEl); + overlay = $('#' + options.id); + + // Unless a custom z-index is set, ensure the overlay will be behind everything + if (overlay.css('z-index') == 'auto') overlay.css('z-index', overlayZBackground); + + // Override the default overlay height with the actual page height + pageHeight = parseFloat($(document).height()); + overlay.height(pageHeight); + + // Add the first grid line so that we can measure it + overlay.append('
'); + + // Position off-screen and display to calculate height + top = overlay.css("top"); + overlay.css({ + top: "-999px", + display: "block" }); - $("body").prepend(overlayEl); - overlay = $('#' + options.id); - - // Unless a custom z-index is set, ensure the overlay will be behind everything - if (overlay.css('z-index') == 'auto') overlay.css('z-index', overlayZBackground); - - // Override the default overlay height with the actual page height - pageHeight = parseFloat($(document).height()); - overlay.height(pageHeight); - - // Add the first grid line so that we can measure it - overlay.append('
'); - - // Position off-screen and display to calculate height - top = overlay.css("top"); - overlay.css({ - top: "-999px", - display: "block" - }); - - // Calculate the number of grid lines needed - line = $('#' + options.id + '-horiz'); - lineHeight = line.outerHeight() -1; - - // Hide and reset top - overlay.css({ - display: "none", - top: top - }); - - // Break on zero line height - if (lineHeight <= 0) { - return false; - } - - // Add the remaining grid lines - numGridLines = Math.floor(pageHeight / lineHeight); - gridLines = ''; - - for (i = numGridLines - 1; i >= 1; i--) { - gridLines += '
'; - } - overlay.append(gridLines); - - // vertical grid - overlay.prepend($('
')); - overlayVert = overlay.children('.vert-container'); - gridWidth = overlay.width(); - overlayVert.css({position: 'absolute', top: 0}); - overlayVert.append('
'); - - // 50 is an arbitrarily large number... - // can't calculate the margin width properly - gridLines = ''; - for (i = 0; i < 50; i++) { - gridLines += '
'; - } - overlayVert.append(gridLines); - overlayVert.children() - .css({ display: 'inline-block' }) - .height(pageHeight); - - // Check for saved state - overlayCookie = readCookie(options.cookiePrefix + options.id); - if (typeof overlayCookie == 'string') { - state = overlayCookie.split('-'); - state[2] = Number(state[2]); - if ((typeof state[2] == 'number') && !isNaN(state[2])) { - classNumber = state[2].toFixed(0); - overlay.addClass(options.classPrefix + classNumber); + + // Calculate the number of grid lines needed + line = $('#' + options.id + '-horiz'); + lineHeight = line.outerHeight() -1; + + // Hide and reset top + overlay.css({ + display: "none", + top: top + }); + + // Break on zero line height + if (lineHeight <= 0) { + return false; } - if (state[1] == 'F') { - overlayZState = 'F'; - overlay.css('z-index', overlayZForeground); + + // Add the remaining grid lines + numGridLines = Math.floor(pageHeight / lineHeight); + gridLines = ''; + + for (i = numGridLines - 1; i >= 1; i--) { + gridLines += '
'; } - if (state[0] == '1') { - overlayOn = true; - sticky = true; - showOverlay(); + overlay.append(gridLines); + + // vertical grid + overlay.prepend($('
')); + overlayVert = overlay.children('.vert-container'); + gridWidth = overlay.width(); + overlayVert.css({position: 'absolute', top: 0}); + overlayVert.append('
'); + + // 50 is an arbitrarily large number... + // can't calculate the margin width properly + gridLines = ''; + for (i = 0; i < 50; i++) { + gridLines += '
'; } - } - else { - overlay.addClass(options.classPrefix + classNumber); - } - - // Keyboard controls - $(document).bind('keydown', keydownHandler); - $(document).bind('keyup', keyupHandler); - - /** - * Helpers - */ - - function getModifier(e) { - if (options.modifierKey == null) return true; // Bypass by default - var m = true; - switch(options.modifierKey) { - case 'ctrl': - m = (e.ctrlKey ? e.ctrlKey : false); - break; - - case 'alt': - m = (e.altKey ? e.altKey : false); - break; - - case 'shift': - m = (e.shiftKey ? e.shiftKey : false); - break; + overlayVert.append(gridLines); + overlayVert.children() + .css({ display: 'inline-block' }) + .height(pageHeight); + + // Check for saved state + overlayCookie = readCookie(options.cookiePrefix + options.id); + if (typeof overlayCookie == 'string') { + state = overlayCookie.split('-'); + state[2] = Number(state[2]); + if ((typeof state[2] == 'number') && !isNaN(state[2])) { + classNumber = state[2].toFixed(0); + overlay.addClass(options.classPrefix + classNumber); + } + if (state[1] == 'F') { + overlayZState = 'F'; + overlay.css('z-index', overlayZForeground); + } + if (state[0] == '1') { + overlayOn = true; + sticky = true; + showOverlay(); + } } - return m; - } - - function getKey(e) { - var k = false, c = (e.keyCode ? e.keyCode : e.which); - // Handle keywords - if (c == 13) k = 'enter'; - // Handle letters - else k = String.fromCharCode(c).toLowerCase(); - return k; - } - - function saveState() { - createCookie(options.cookiePrefix + options.id, (sticky ? '1' : '0') + '-' + overlayZState + '-' + classNumber, 1); - } - - function showOverlay() { - overlay.show(); - //overlayVert.css({width: overlay.width()}); - // hide any vertical blocks that aren't at the top of the viewport - /* - overlayVert.children('.vert').each(function () { - var vCol = $(this); - vCol.css('display','inline-block'); - if (vCol.offset().top > vCol.parent().offset().top) { - vCol.hide(); + else { + overlay.addClass(options.classPrefix + classNumber); + } + + // Keyboard controls + $(document).bind('keydown', keydownHandler); + $(document).bind('keyup', keyupHandler); + + /** + * Helpers + */ + + function getModifier(e) { + if (options.modifierKey == null) return true; // Bypass by default + var m = true; + switch(options.modifierKey) { + case 'ctrl': + m = (e.ctrlKey ? e.ctrlKey : false); + break; + + case 'alt': + m = (e.altKey ? e.altKey : false); + break; + + case 'shift': + m = (e.shiftKey ? e.shiftKey : false); + break; } - }); - */ - } - - /** - * Event handlers - */ - - function keydownHandler(e) { - var k, - m, - source = e.target.tagName.toLowerCase(); - - if ((source == 'input') || (source == 'textarea') || (source == 'select')) { - return true; + return m; } - - m = getModifier(e); - if (!m) { - return true; + + function getKey(e) { + var k = false, c = (e.keyCode ? e.keyCode : e.which); + // Handle keywords + if (c == 13) k = 'enter'; + // Handle letters + else k = String.fromCharCode(c).toLowerCase(); + return k; } - - k = getKey(e); - if (!k) { - return true; + + function saveState() { + createCookie(options.cookiePrefix + options.id, (sticky ? '1' : '0') + '-' + overlayZState + '-' + classNumber, 1); } - - switch(k) { - case options.showGridKey: - if (!overlayOn) { - showOverlay(); - overlayOn = true; - } - else if (sticky) { - overlay.hide(); - overlayOn = false; - sticky = false; - saveState(); + + function showOverlay() { + overlay.show(); + //overlayVert.css({width: overlay.width()}); + // hide any vertical blocks that aren't at the top of the viewport + /* + overlayVert.children('.vert').each(function () { + var vCol = $(this); + vCol.css('display','inline-block'); + if (vCol.offset().top > vCol.parent().offset().top) { + vCol.hide(); } - break; - case options.holdGridKey: - if (overlayOn && !sticky) { - // Turn sticky overlay on - sticky = true; - saveState(); - } - break; - case options.foregroundKey: - if (overlayOn) { - // Toggle sticky overlay z-index - if (overlay.css('z-index') == overlayZForeground) { - overlay.css('z-index', overlayZBackground); - overlayZState = 'B'; + }); + */ + } + + /** + * Event handlers + */ + + function keydownHandler(e) { + var k, + m, + source = e.target.tagName.toLowerCase(); + + if ((source == 'input') || (source == 'textarea') || (source == 'select')) { + return true; + } + + m = getModifier(e); + if (!m) { + return true; + } + + k = getKey(e); + if (!k) { + return true; + } + + switch(k) { + case options.showGridKey: + if (!overlayOn) { + showOverlay(); + overlayOn = true; } - else { - overlay.css('z-index', overlayZForeground); - overlayZState = 'F'; + else if (sticky) { + overlay.hide(); + overlayOn = false; + sticky = false; + saveState(); } - saveState(); - } - break; - case options.jumpGridsKey: - if (overlayOn && (options.numberOfGrids > 1)) { - // Cycle through the available grids - overlay.removeClass(options.classPrefix + classNumber); - classNumber++; - if (classNumber > options.numberOfGrids) classNumber = 1; - overlay.addClass(options.classPrefix + classNumber); - showOverlay(); - if (/webkit/.test( navigator.userAgent.toLowerCase() )) { - forceRepaint(); + break; + case options.holdGridKey: + if (overlayOn && !sticky) { + // Turn sticky overlay on + sticky = true; + saveState(); } - saveState(); - } - break; - } - - return true; - } - - function keyupHandler(e) { - var k, - m = getModifier(e); - - if (!m) { + break; + case options.foregroundKey: + if (overlayOn) { + // Toggle sticky overlay z-index + if (overlay.css('z-index') == overlayZForeground) { + overlay.css('z-index', overlayZBackground); + overlayZState = 'B'; + } + else { + overlay.css('z-index', overlayZForeground); + overlayZState = 'F'; + } + saveState(); + } + break; + case options.jumpGridsKey: + if (overlayOn && (options.numberOfGrids > 1)) { + // Cycle through the available grids + overlay.removeClass(options.classPrefix + classNumber); + classNumber++; + if (classNumber > options.numberOfGrids) classNumber = 1; + overlay.addClass(options.classPrefix + classNumber); + showOverlay(); + if (/webkit/.test( navigator.userAgent.toLowerCase() )) { + forceRepaint(); + } + saveState(); + } + break; + } + return true; } - - k = getKey(e); - - if (k && (k == options.showGridKey) && !sticky) { - overlay.hide(); - overlayOn = false; - } - - return true; - } - - /** - * Cookie functions - * - * By Peter-Paul Koch: - * http://www.quirksmode.org/js/cookies.html - */ - function createCookie(name, value, days) { - var date, - expires = ""; - - if (days) { - date = new Date(); - date.setTime( date.getTime() + (days*24*60*60*1000) ); - expires = "; expires=" + date.toGMTString(); + + function keyupHandler(e) { + var k, + m = getModifier(e); + + if (!m) { + return true; + } + + k = getKey(e); + + if (k && (k == options.showGridKey) && !sticky) { + overlay.hide(); + overlayOn = false; + } + + return true; } - - document.cookie = name + "=" + value + expires + "; path=/"; - } - - function readCookie(name) { - var c, - ca = document.cookie.split(';'), - i = 0, - len = ca.length, - nameEQ = name + "="; - - for (; i < len; i++) { - c = ca[i]; - - while (c.charAt(0) == ' ') { - c = c.substring(1, c.length); + + /** + * Cookie functions + * + * By Peter-Paul Koch: + * http://www.quirksmode.org/js/cookies.html + */ + function createCookie(name, value, days) { + var date, + expires = ""; + + if (days) { + date = new Date(); + date.setTime( date.getTime() + (days*24*60*60*1000) ); + expires = "; expires=" + date.toGMTString(); } - - if (c.indexOf(nameEQ) == 0) { - return c.substring(nameEQ.length, c.length); + + document.cookie = name + "=" + value + expires + "; path=/"; + } + + function readCookie(name) { + var c, + ca = document.cookie.split(';'), + i = 0, + len = ca.length, + nameEQ = name + "="; + + for (; i < len; i++) { + c = ca[i]; + + while (c.charAt(0) == ' ') { + c = c.substring(1, c.length); + } + + if (c.indexOf(nameEQ) == 0) { + return c.substring(nameEQ.length, c.length); + } } + return null; } - return null; - } - - function eraseCookie(name) { - createCookie(name, "", -1); - } - + + function eraseCookie(name) { + createCookie(name, "", -1); + } + + /** + * Forces a repaint (because WebKit has issues) + * http://www.sitepoint.com/forums/showthread.php?p=4538763 + * http://www.phpied.com/the-new-game-show-will-it-reflow/ + */ + function forceRepaint() { + var ss = document.styleSheets[0]; + try { + ss.addRule('.xxxxxx', 'position: relative'); + ss.removeRule(ss.rules.length - 1); + } catch(e) {} + } + + return {}; + }; + + /** - * Forces a repaint (because WebKit has issues) - * http://www.sitepoint.com/forums/showthread.php?p=4538763 - * http://www.phpied.com/the-new-game-show-will-it-reflow/ + * You can call hashgrid from your own code, but it's loaded here as + * an example for your convenience. */ - function forceRepaint() { - var ss = document.styleSheets[0]; - try { - ss.addRule('.xxxxxx', 'position: relative'); - ss.removeRule(ss.rules.length - 1); - } catch(e) {} - } - - return {}; -}; - - -/** - * You can call hashgrid from your own code, but it's loaded here as - * an example for your convenience. - */ -$(document).ready(function() { - - var grid = new hashgrid({ - numberOfGrids: 3 + $(document).ready(function() { + + var grid = new hashgrid({ + numberOfGrids: 3 + }); + }); - -}); +})(jQuery); \ No newline at end of file From 70452266fc57ac1008427b43e635842e0d790207 Mon Sep 17 00:00:00 2001 From: Marie Guillaumet Date: Thu, 1 Nov 2012 14:27:41 +0100 Subject: [PATCH 02/19] =?UTF-8?q?Grosse=20mise=20=C3=A0=20jour=20d'automne?= =?UTF-8?q?=20:=20-=20Passage=20=C3=A0=20jQuery=201.8.2.=20-=20Mise=20?= =?UTF-8?q?=C3=A0=20jour=20de=20#grid.=20Meilleur=20d=C3=A9coupage=20des?= =?UTF-8?q?=20fichiers=20.scss=20(ceux=20pr=C3=A9fix=C3=A9s=20par=20=C2=AB?= =?UTF-8?q?=C2=A0=5F=C2=A0=C2=BB=20sont=20des=20partiels).=20-=20Am=C3=A9l?= =?UTF-8?q?ioration=20de=20l'accessibilit=C3=A9=20des=20formulaires=20sur?= =?UTF-8?q?=20la=20page=20de=20d=C3=A9mo,=20et=20validation=20HTML.=20-=20?= =?UTF-8?q?Ajout=20du=20fichier=20=5Fnormalize-modern.scss=20=C3=A0=20util?= =?UTF-8?q?iser=20dans=20les=20projets=20faisant=20l'=C3=A9conomie=20de=20?= =?UTF-8?q?IE6=20et=20IE7.=20-=20Modification=20de=20tous=20les=20commenta?= =?UTF-8?q?ires=20dans=20=5Fnormalize.css=20et=20=5Fnormalize-modern.css?= =?UTF-8?q?=20pour=20qu'ils=20ne=20soient=20pas=20conserv=C3=A9s=20pendant?= =?UTF-8?q?=20la=20compilation.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/_doc.css | 551 -- css/_styles.css | 765 -- css/doc.css | 505 ++ css/styles.css | 641 ++ inc/content/demo.php | 41 +- inc/head/dist.php | 2 +- index.php | 2 +- index.txt | 1 - js/_after.js | 20 +- js/lib/hashgrid.js | 430 - js/lib/jquery.hashgrid.js | 428 + js/lib/jquery.js | 9268 +------------------- scss/{doc-print.scss => _doc-print.scss} | 0 scss/{doc-screen.scss => _doc-screen.scss} | 0 scss/_doc.scss | 9 - scss/_footer.scss | 3 + scss/_forms.scss | 51 + scss/_global.scss | 15 + scss/_header.scss | 3 + scss/_index.scss | 53 + scss/_print.scss | 3 + scss/{styles-screen.scss => _screen.scss} | 85 +- scss/_sidebar.scss | 3 + scss/_sprites.scss | 3 + scss/_styles.scss | 10 - scss/_typo.scss | 4 + scss/{base.scss => _variables.scss} | 9 +- scss/doc.scss | 18 + scss/lib/{hashgrid.scss => _hashgrid.scss} | 22 +- scss/lib/{functions.scss => _mixins.scss} | 245 +- scss/lib/_normalize.scss | 463 + scss/lib/_normalize_modern.scss | 307 + scss/lib/normalize.scss | 549 -- scss/styles-print.scss | 0 scss/styles.scss | 25 + 35 files changed, 2755 insertions(+), 11779 deletions(-) delete mode 100644 css/_doc.css delete mode 100644 css/_styles.css create mode 100644 css/doc.css create mode 100644 css/styles.css delete mode 100644 js/lib/hashgrid.js create mode 100644 js/lib/jquery.hashgrid.js rename scss/{doc-print.scss => _doc-print.scss} (100%) rename scss/{doc-screen.scss => _doc-screen.scss} (100%) delete mode 100644 scss/_doc.scss create mode 100644 scss/_footer.scss create mode 100644 scss/_forms.scss create mode 100644 scss/_global.scss create mode 100644 scss/_header.scss create mode 100644 scss/_index.scss create mode 100644 scss/_print.scss rename scss/{styles-screen.scss => _screen.scss} (64%) create mode 100644 scss/_sidebar.scss create mode 100644 scss/_sprites.scss delete mode 100644 scss/_styles.scss create mode 100644 scss/_typo.scss rename scss/{base.scss => _variables.scss} (84%) create mode 100644 scss/doc.scss rename scss/lib/{hashgrid.scss => _hashgrid.scss} (83%) rename scss/lib/{functions.scss => _mixins.scss} (73%) create mode 100644 scss/lib/_normalize.scss create mode 100644 scss/lib/_normalize_modern.scss delete mode 100644 scss/lib/normalize.scss delete mode 100644 scss/styles-print.scss create mode 100644 scss/styles.scss diff --git a/css/_doc.css b/css/_doc.css deleted file mode 100644 index 32d2878..0000000 --- a/css/_doc.css +++ /dev/null @@ -1,551 +0,0 @@ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -.clearfix { - *zoom: 1; } - .clearfix:after { - content: ""; - display: table; - clear: both; } - -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -.hr { - border-top-style: solid; - border-top-width: 1px; - border-top-color: black; - margin-top: -1px; - margin-bottom: 1.429em; } - .hr hr { - position: absolute; - width: 1px; - height: 1px; - overflow: hidden; - left: -9999em; } - -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* normalize.css 2012-03-11T12:53 UTC - http://github.com/necolas/normalize.css */ -/* ============================================================================= - HTML5 display definitions - ========================================================================== */ -/* Corrects block display not defined in IE6/7/8/9 & FF3 */ -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -nav, -section, -summary { - display: block; } - -/* - * Corrects inline-block display not defined in IE6/7/8/9 & FF3 - */ -audio, -canvas, -video { - display: inline-block; - *display: inline; - *zoom: 1; } - -/* - * Prevents modern browsers from displaying 'audio' without controls - * Remove excess height in iOS5 devices - */ -audio:not([controls]) { - display: none; - height: 0; } - -/* - * Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4 - * Known issue: no IE6 support - */ -[hidden] { - display: none; } - -/* ============================================================================= - Base - ========================================================================== */ -/* - * 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units - * http://clagnut.com/blog/348/#c790 - * 2. Prevents iOS text size adjust after orientation change, without disabling user zoom - * www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/ - */ -html { - font-size: 100%; - /* 1 */ - -webkit-text-size-adjust: 100%; - /* 2 */ - -ms-text-size-adjust: 100%; - /* 2 */ } - html body { - font-size: 87.5%; - line-height: 1.429em; } - html html > body { - font-size: 14px; } - -/* - * Addresses font-family inconsistency between 'textarea' and other form elements. - */ -html, -button, -input, -select, -textarea { - font-family: sans-serif; } - -/* - * Addresses margins handled incorrectly in IE6/7 - */ -body { - margin: 0; } - -/* ============================================================================= - Links - ========================================================================== */ -/* - * Addresses outline displayed oddly in Chrome - */ -a:focus { - outline: thin dotted; } - -/* - * Improves readability when focused and also mouse hovered in all browsers - * people.opera.com/patrickl/experiments/keyboard/test - */ -a:hover, -a:active { - outline: 0; } - -/* ============================================================================= - Typography - ========================================================================== */ -/* - * Addresses font sizes and margins set differently in IE6/7 - * Addresses font sizes within 'section' and 'article' in FF4+, Chrome, S5 - */ -/* http://modularscale.com/scale/?px1=14&px2=12&ra1=1.5&ra2=0 */ -h1 { - margin: 0; - font-size: 1.929em; - line-height: 1.481em; - margin-bottom: 0.741em; - padding-top: 1.481em; } - -h2 { - margin: 0; - font-size: 1.5em; - line-height: 1.905em; - margin-bottom: 0.952em; - padding-top: 1.905em; } - -h3 { - margin: 0; - font-size: 1.286em; - line-height: 2.222em; - margin-bottom: 1.111em; - padding-top: 2.222em; } - -h4 { - margin: 0; - font-size: 1em; - line-height: 1.429em; - margin-bottom: 1.429em; - padding-top: 2.857em; } - -h5 { - margin: 0; - font-size: 0.857em; - line-height: 1.667em; - margin-bottom: 1.667em; - padding-top: 3.333em; } - -h6 { - margin: 0; - font-size: 0.643em; - line-height: 2.222em; - margin-bottom: 2.222em; - padding-top: 4.444em; } - -/* - * Addresses styling not present in IE7/8/9, S5, Chrome - */ -abbr[title] { - border-bottom: 1px dotted; } - -/* - * Addresses style set to 'bolder' in FF3+, S4/5, Chrome -*/ -b, -strong { - font-weight: bold; } - -blockquote { - margin: 0 80px; - margin-bottom: 1.429em; } - -/* - * Addresses styling not present in S5, Chrome - */ -dfn { - font-style: italic; } - -/* - * Addresses styling not present in IE6/7/8/9 - */ -mark { - background: #ff0; - color: #000; } - -/* - * Addresses margins set differently in IE6/7 - */ -p, -pre, -address { - margin: 0; - margin-bottom: 1.429em; } - -/* - * Corrects font family set oddly in IE6, S4/5, Chrome - * en.wikipedia.org/wiki/User:Davidgothberg/Test59 - */ -pre, -code, -kbd, -samp { - font-family: monospace, serif; - _font-family: 'courier new', monospace; } - -/* - * Improves readability of pre-formatted text in all browsers - */ -pre { - white-space: pre; - white-space: pre-wrap; - word-wrap: break-word; } - -/* - * 1. Addresses CSS quotes not supported in IE6/7 - * 2. Addresses quote property not supported in S4 - */ -/* 1 */ -q { - quotes: none; } - -/* 2 */ -q:before, -q:after { - content: ''; - content: none; } - -small { - font-size: 75%; } - -/* - * Prevents sub and sup affecting line-height in all browsers - * gist.github.com/413930 - */ -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; } - -sup { - top: -0.5em; } - -sub { - bottom: -0.25em; } - -/* ============================================================================= - Lists - ========================================================================== */ -/* - * Addresses margins set differently in IE6/7 - */ -dl, -menu, -ol, -ul { - margin: 0; - margin-bottom: 1.429em; } - -dd { - margin: 0 0 0 80px; } - -/* - * Addresses paddings set differently in IE6/7 - */ -menu, -ol, -ul { - padding: 0 0 0 80px; } - -/* - * Corrects list images handled incorrectly in IE7 - */ -/* -nav ul, -nav ol { - list-style: none; - list-style-image: none; -} -*/ -/* ============================================================================= - Embedded content - ========================================================================== */ -/* - * 1. Removes border when inside 'a' element in IE6/7/8/9, FF3 - * 2. Improves image quality when scaled in IE7 - * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/ - */ -img { - border: 0; - /* 1 */ - -ms-interpolation-mode: bicubic; - /* 2 */ } - -/* - * Corrects overflow displayed oddly in IE9 - */ -svg:not(:root) { - overflow: hidden; } - -/* ============================================================================= - Figures - ========================================================================== */ -/* - * Addresses margin not present in IE6/7/8/9, S5, O11 - */ -figure { - margin: 0; } - -/* ============================================================================= - Forms - ========================================================================== */ -/* - * Corrects margin displayed oddly in IE6/7 - */ -form { - margin: 0; } - -/* - * Define consistent border, margin, and padding - */ -fieldset { - border: 1px solid #c0c0c0; - margin: 0; - padding: 10px; - padding-top: 0.714em; - padding-bottom: 0.714em; - margin-bottom: 1.429em; } - -/* - * 1. Corrects color not being inherited in IE6/7/8/9 - * 2. Corrects text not wrapping in FF3 - * 3. Corrects alignment displayed oddly in IE6/7 - */ -legend { - border: 0; - /* 1 */ - padding: 0; - white-space: normal; - /* 2 */ - *margin-left: -7px; - /* 3 */ } - -/* - * 1. Corrects font size not being inherited in all browsers - * 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome - * 3. Improves appearance and consistency in all browsers - */ -button, -input, -select, -textarea { - font-size: 100%; - /* 1 */ - margin: 0; - /* 2 */ - vertical-align: baseline; - /* 3 */ - *vertical-align: middle; - /* 3 */ } - -/* - * Addresses FF3/4 setting line-height on 'input' using !important in the UA stylesheet - */ -button, -input { - line-height: normal; - /* 1 */ } - -/* - * 1. Improves usability and consistency of cursor style between image-type 'input' and others - * 2. Corrects inability to style clickable 'input' types in iOS - * 3. Removes inner spacing in IE7 without affecting normal text inputs - * Known issue: inner spacing remains in IE6 - */ -button, -input[type="button"], -input[type="reset"], -input[type="submit"] { - cursor: pointer; - /* 1 */ - -webkit-appearance: button; - /* 2 */ - *overflow: visible; - /* 3 */ } - -/* - * Re-set default cursor for disabled elements - */ -button[disabled], -input[disabled] { - cursor: default; } - -/* - * 1. Addresses box sizing set to content-box in IE8/9 - * 2. Removes excess padding in IE8/9 - * 3. Removes excess padding in IE7 - Known issue: excess padding remains in IE6 - */ -input[type="checkbox"], -input[type="radio"] { - box-sizing: border-box; - /* 1 */ - padding: 0; - /* 2 */ - *height: 13px; - /* 3 */ - *width: 13px; - /* 3 */ } - -/* - * 1. Addresses appearance set to searchfield in S5, Chrome - * 2. Addresses box-sizing set to border-box in S5, Chrome (include -moz to future-proof) - */ -input[type="search"] { - -webkit-appearance: textfield; - /* 1 */ - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; - /* 2 */ - box-sizing: content-box; } - -/* - * Removes inner padding and search cancel button in S5, Chrome on OS X - */ -input[type="search"]::-webkit-search-decoration, -input[type="search"]::-webkit-search-cancel-button { - -webkit-appearance: none; } - -/* - * Removes inner padding and border in FF3+ - * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/ - */ -button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; - padding: 0; } - -/* - * 1. Removes default vertical scrollbar in IE6/7/8/9 - * 2. Improves readability and alignment in all browsers - */ -textarea { - overflow: auto; - /* 1 */ - vertical-align: top; - /* 2 */ } - -/* ============================================================================= - Tables - ========================================================================== */ -/* - * Remove most spacing between table cells - */ -table { - border-collapse: collapse; - border-spacing: 0; - margin-bottom: 1.429em; } - -td, -th, -caption { - padding: 10px; - padding-top: 0.714em; - padding-bottom: 0.714em; } - -@media only screen and (max-width:1000px) { - #page.index th:nth-child(3), - #page.index td:nth-child(3), - #page.index th:nth-child(4), - #page.index td:nth-child(4), - #page.index th:nth-child(5), - #page.index td:nth-child(5), - #page.index th:nth-child(6), - #page.index td:nth-child(6), - #page.index th:nth-child(7), - #page.index td:nth-child(7), - #page.index th:nth-child(8), - #page.index td:nth-child(8), - #page.index th:nth-child(9), - #page.index td:nth-child(9), - #page.index th:nth-child(10), - #page.index td:nth-child(10), - #page.index th:nth-child(11), - #page.index td:nth-child(11), - #page.index th:nth-child(12), - #page.index td:nth-child(12) { - display: none; - background-color: red; } } - -#page.index, -#page.doc { - margin: auto; - width: 940px; } - @media only screen and (max-width:1000px) { - #page.index, - #page.doc { - width: 780px; } } - @media only screen and (max-width:840px) { - #page.index, - #page.doc { - width: auto; - margin: 0 20px; } } - #page.index img, - #page.doc img { - display: block; } - #page.index h1, - #page.doc h1 { - float: right; } - @media only screen and (max-width:840px) { - #page.index h1, - #page.doc h1 { - float: none; } } - #page.index .footnotes ol, - #page.doc .footnotes ol { - font-size: 0.714em; - line-height: 2em; - margin-bottom: 2em; } - #page.index .footnotes ol p, - #page.doc .footnotes ol p { - margin-bottom: 1em; } diff --git a/css/_styles.css b/css/_styles.css deleted file mode 100644 index ba30863..0000000 --- a/css/_styles.css +++ /dev/null @@ -1,765 +0,0 @@ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -.clearfix { - *zoom: 1; } - .clearfix:after { - content: ""; - display: table; - clear: both; } - -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -.hr { - border-top-style: solid; - border-top-width: 1px; - border-top-color: black; - margin-top: -1px; - margin-bottom: 1.429em; } - .hr hr { - position: absolute; - width: 1px; - height: 1px; - overflow: hidden; - left: -9999em; } - -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* normalize.css 2012-03-11T12:53 UTC - http://github.com/necolas/normalize.css */ -/* ============================================================================= - HTML5 display definitions - ========================================================================== */ -/* Corrects block display not defined in IE6/7/8/9 & FF3 */ -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -nav, -section, -summary { - display: block; } - -/* - * Corrects inline-block display not defined in IE6/7/8/9 & FF3 - */ -audio, -canvas, -video { - display: inline-block; - *display: inline; - *zoom: 1; } - -/* - * Prevents modern browsers from displaying 'audio' without controls - * Remove excess height in iOS5 devices - */ -audio:not([controls]) { - display: none; - height: 0; } - -/* - * Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4 - * Known issue: no IE6 support - */ -[hidden] { - display: none; } - -/* ============================================================================= - Base - ========================================================================== */ -/* - * 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units - * http://clagnut.com/blog/348/#c790 - * 2. Prevents iOS text size adjust after orientation change, without disabling user zoom - * www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/ - */ -html { - font-size: 100%; - /* 1 */ - -webkit-text-size-adjust: 100%; - /* 2 */ - -ms-text-size-adjust: 100%; - /* 2 */ } - html body { - font-size: 87.5%; - line-height: 1.429em; } - html html > body { - font-size: 14px; } - -/* - * Addresses font-family inconsistency between 'textarea' and other form elements. - */ -html, -button, -input, -select, -textarea { - font-family: sans-serif; } - -/* - * Addresses margins handled incorrectly in IE6/7 - */ -body { - margin: 0; } - -/* ============================================================================= - Links - ========================================================================== */ -/* - * Addresses outline displayed oddly in Chrome - */ -a:focus { - outline: thin dotted; } - -/* - * Improves readability when focused and also mouse hovered in all browsers - * people.opera.com/patrickl/experiments/keyboard/test - */ -a:hover, -a:active { - outline: 0; } - -/* ============================================================================= - Typography - ========================================================================== */ -/* - * Addresses font sizes and margins set differently in IE6/7 - * Addresses font sizes within 'section' and 'article' in FF4+, Chrome, S5 - */ -/* http://modularscale.com/scale/?px1=14&px2=12&ra1=1.5&ra2=0 */ -h1 { - margin: 0; - font-size: 1.929em; - line-height: 1.481em; - margin-bottom: 0.741em; - padding-top: 1.481em; } - -h2 { - margin: 0; - font-size: 1.5em; - line-height: 1.905em; - margin-bottom: 0.952em; - padding-top: 1.905em; } - -h3 { - margin: 0; - font-size: 1.286em; - line-height: 2.222em; - margin-bottom: 1.111em; - padding-top: 2.222em; } - -h4 { - margin: 0; - font-size: 1em; - line-height: 1.429em; - margin-bottom: 1.429em; - padding-top: 2.857em; } - -h5 { - margin: 0; - font-size: 0.857em; - line-height: 1.667em; - margin-bottom: 1.667em; - padding-top: 3.333em; } - -h6 { - margin: 0; - font-size: 0.643em; - line-height: 2.222em; - margin-bottom: 2.222em; - padding-top: 4.444em; } - -/* - * Addresses styling not present in IE7/8/9, S5, Chrome - */ -abbr[title] { - border-bottom: 1px dotted; } - -/* - * Addresses style set to 'bolder' in FF3+, S4/5, Chrome -*/ -b, -strong { - font-weight: bold; } - -blockquote { - margin: 0 80px; - margin-bottom: 1.429em; } - -/* - * Addresses styling not present in S5, Chrome - */ -dfn { - font-style: italic; } - -/* - * Addresses styling not present in IE6/7/8/9 - */ -mark { - background: #ff0; - color: #000; } - -/* - * Addresses margins set differently in IE6/7 - */ -p, -pre, -address { - margin: 0; - margin-bottom: 1.429em; } - -/* - * Corrects font family set oddly in IE6, S4/5, Chrome - * en.wikipedia.org/wiki/User:Davidgothberg/Test59 - */ -pre, -code, -kbd, -samp { - font-family: monospace, serif; - _font-family: 'courier new', monospace; } - -/* - * Improves readability of pre-formatted text in all browsers - */ -pre { - white-space: pre; - white-space: pre-wrap; - word-wrap: break-word; } - -/* - * 1. Addresses CSS quotes not supported in IE6/7 - * 2. Addresses quote property not supported in S4 - */ -/* 1 */ -q { - quotes: none; } - -/* 2 */ -q:before, -q:after { - content: ''; - content: none; } - -small { - font-size: 75%; } - -/* - * Prevents sub and sup affecting line-height in all browsers - * gist.github.com/413930 - */ -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; } - -sup { - top: -0.5em; } - -sub { - bottom: -0.25em; } - -/* ============================================================================= - Lists - ========================================================================== */ -/* - * Addresses margins set differently in IE6/7 - */ -dl, -menu, -ol, -ul { - margin: 0; - margin-bottom: 1.429em; } - -dd { - margin: 0 0 0 80px; } - -/* - * Addresses paddings set differently in IE6/7 - */ -menu, -ol, -ul { - padding: 0 0 0 80px; } - -/* - * Corrects list images handled incorrectly in IE7 - */ -/* -nav ul, -nav ol { - list-style: none; - list-style-image: none; -} -*/ -/* ============================================================================= - Embedded content - ========================================================================== */ -/* - * 1. Removes border when inside 'a' element in IE6/7/8/9, FF3 - * 2. Improves image quality when scaled in IE7 - * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/ - */ -img { - border: 0; - /* 1 */ - -ms-interpolation-mode: bicubic; - /* 2 */ } - -/* - * Corrects overflow displayed oddly in IE9 - */ -svg:not(:root) { - overflow: hidden; } - -/* ============================================================================= - Figures - ========================================================================== */ -/* - * Addresses margin not present in IE6/7/8/9, S5, O11 - */ -figure { - margin: 0; } - -/* ============================================================================= - Forms - ========================================================================== */ -/* - * Corrects margin displayed oddly in IE6/7 - */ -form { - margin: 0; } - -/* - * Define consistent border, margin, and padding - */ -fieldset { - border: 1px solid #c0c0c0; - margin: 0; - padding: 10px; - padding-top: 0.714em; - padding-bottom: 0.714em; - margin-bottom: 1.429em; } - -/* - * 1. Corrects color not being inherited in IE6/7/8/9 - * 2. Corrects text not wrapping in FF3 - * 3. Corrects alignment displayed oddly in IE6/7 - */ -legend { - border: 0; - /* 1 */ - padding: 0; - white-space: normal; - /* 2 */ - *margin-left: -7px; - /* 3 */ } - -/* - * 1. Corrects font size not being inherited in all browsers - * 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome - * 3. Improves appearance and consistency in all browsers - */ -button, -input, -select, -textarea { - font-size: 100%; - /* 1 */ - margin: 0; - /* 2 */ - vertical-align: baseline; - /* 3 */ - *vertical-align: middle; - /* 3 */ } - -/* - * Addresses FF3/4 setting line-height on 'input' using !important in the UA stylesheet - */ -button, -input { - line-height: normal; - /* 1 */ } - -/* - * 1. Improves usability and consistency of cursor style between image-type 'input' and others - * 2. Corrects inability to style clickable 'input' types in iOS - * 3. Removes inner spacing in IE7 without affecting normal text inputs - * Known issue: inner spacing remains in IE6 - */ -button, -input[type="button"], -input[type="reset"], -input[type="submit"] { - cursor: pointer; - /* 1 */ - -webkit-appearance: button; - /* 2 */ - *overflow: visible; - /* 3 */ } - -/* - * Re-set default cursor for disabled elements - */ -button[disabled], -input[disabled] { - cursor: default; } - -/* - * 1. Addresses box sizing set to content-box in IE8/9 - * 2. Removes excess padding in IE8/9 - * 3. Removes excess padding in IE7 - Known issue: excess padding remains in IE6 - */ -input[type="checkbox"], -input[type="radio"] { - box-sizing: border-box; - /* 1 */ - padding: 0; - /* 2 */ - *height: 13px; - /* 3 */ - *width: 13px; - /* 3 */ } - -/* - * 1. Addresses appearance set to searchfield in S5, Chrome - * 2. Addresses box-sizing set to border-box in S5, Chrome (include -moz to future-proof) - */ -input[type="search"] { - -webkit-appearance: textfield; - /* 1 */ - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; - /* 2 */ - box-sizing: content-box; } - -/* - * Removes inner padding and search cancel button in S5, Chrome on OS X - */ -input[type="search"]::-webkit-search-decoration, -input[type="search"]::-webkit-search-cancel-button { - -webkit-appearance: none; } - -/* - * Removes inner padding and border in FF3+ - * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/ - */ -button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; - padding: 0; } - -/* - * 1. Removes default vertical scrollbar in IE6/7/8/9 - * 2. Improves readability and alignment in all browsers - */ -textarea { - overflow: auto; - /* 1 */ - vertical-align: top; - /* 2 */ } - -/* ============================================================================= - Tables - ========================================================================== */ -/* - * Remove most spacing between table cells - */ -table { - border-collapse: collapse; - border-spacing: 0; - margin-bottom: 1.429em; } - -td, -th, -caption { - padding: 10px; - padding-top: 0.714em; - padding-bottom: 0.714em; } - -/** -* Grid -*/ -#grid { - /* Dimensions - same width as your grid with gutters */ - width: 940px; - overflow: hidden; - /* Grid (left-aligned) -position: absolute; -top: 0; -left: 0; -*/ - /* Grid (centered) */ - position: absolute; - top: 0; - left: 50%; - margin-left: -470px; } - @media only screen and (max-width:1000px) { - #grid { - width: 780px; - margin-left: -390px; } } - @media only screen and (max-width:840px) { - #grid { - margin-left: 0; - width: auto; - left: 20px; - right: 20px; } - #grid .vert-container { - display: none!important; } } - -/** -* Vertical grid lines -* -* Set the column width taking the borders into consideration, -* and use margins to set column gutters. -*/ -#grid div.vert { - width: 19px; - margin-right: 19px; - *display: inline!important; - border-left: 1px dotted darkgray; - border-right: 1px dotted darkgray; - position: relative; - left: -1px; } - -#grid div.vert.first-line { - margin-left: 20px; } - -#page { - background-color: #FAFAFA; } - -/** -* Horizontal grid lines, defined by your base line height -* -* Remember, the CSS properties that define the box model: -* visible height = height + borders + margins + padding -*/ -#grid div.horiz { - height: 1.429em; - padding: 0; } - -#grid div.horiz { - border-bottom-style: dotted; - border-bottom-width: 1px; - border-bottom-color: darkgray; - margin-top: -1px; - position: relative; - top: 1px; } - -/** -* Classes for multiple grids -* -* When using more than one grid, remember to set the numberOfGrids -* option in the hashgrid.js file. -*/ -#grid.grid-1 .vert { - border-color: transparent; } - -#grid.grid-2 .horiz { - border-color: transparent; } -#grid.grid-2 .vert { - border-color: transparent; } -#grid.grid-2 .vert:nth-child(3n) { - background-color: rgba(0, 128, 0, 0.25); } - -#grid.grid-3 .vert:nth-child(3n) { - background-color: rgba(0, 128, 0, 0.25); } - -#page { - margin: auto; - width: 940px; } - @media only screen and (max-width:1000px) { - #page { - width: 780px; } } - @media only screen and (max-width:840px) { - #page { - width: auto; - margin: 0 20px; } } - -img, -audio, -video, -canvas, -svg { - display: block; - max-width: 100%; - height: auto; } - -fieldset { - border: none; - padding: 0; } - fieldset legend span { - display: block; - margin-bottom: 1.429em; } - -form p, -form .p { - min-height: 2.857em; - *height: 2.857em; } - -input, -textarea { - width: 208px; - padding: 5px; - border: 1px solid #333; } - -input[type=radio], -input[type=checkbox] { - width: auto; - padding: 0; - border: 0; } - -input.radio, -input.checkbox { - width: auto; - padding: 0; - border: 0; } - -button, -select, -input[type=reset], -input[type=button], -input[type=submit] { - width: 220px; - padding: 5px; - border: 1px solid #333; } - -button, -select, -input.reset, -input.button, -input.submit { - width: 220px; - padding: 5px; - border: 1px solid #333; } - -select { - padding: 4px; } - -#page.demo nav ul { - margin: 0; - padding: 0; - list-style-type: none; - *zoom: 1; } - #page.demo nav ul:after { - content: ""; - display: table; - clear: both; } - #page.demo nav ul li, - #page.demo nav ul dt, - #page.demo nav ul dd { - margin: 0; - float: left; } -#page.demo .colleft { - *display: inline; - zoom: 1; - float: left; - margin-right: 20px; - width: 460px; - padding-right: 9px; - margin-right: 10px; - border-right: 1px solid black; - margin-bottom: 1.429em; - padding-top: 1.429em; } - * html #page.demo .colleft { - overflow-x: hidden; } -#page.demo .colright { - *display: inline; - zoom: 1; - float: left; - margin-right: 0; - width: 460px; - margin-bottom: 1.429em; - padding-top: 1.429em; } - * html #page.demo .colright { - overflow-x: hidden; } -@media only screen and (max-width:840px) { - #page.demo form { - display: none; } } -#page.demo .large { - font-size: 1.286em; - line-height: 2.222em; - margin-bottom: 2.222em; } - #page.demo .large span { - font-size: 0.778em; - line-height: 1.429em; } -#page.demo .small { - font-size: 0.714em; - line-height: 2em; - margin-bottom: 2em; } -#page.demo header { - border-bottom-style: solid; - border-bottom-width: 1px; - border-bottom-color: black; - margin-top: -1px; - position: relative; - top: 1px; - padding-top: 1.429em; - padding-bottom: 1.429em; - padding-left: 1.429em; - padding-right: 1.429em; - margin-bottom: 1.429em; - *zoom: 1; } -#page.demo section { - padding-left: 80px; - *display: inline; - zoom: 1; - float: left; - margin-right: 20px; - width: 380px; - border-style: solid; - border-width: 1px; - border-color: black; - position: relative; - margin-top: -2px; - margin-left: -2px; - top: 1px; - left: 1px; } - * html #page.demo section { - overflow-x: hidden; } - @media only screen and (max-width:1000px) { - #page.demo section { - width: auto; - float: none; - padding-left: 0; - margin-right: 0; - margin-bottom: 1.429em; } } -#page.demo article { - *display: inline; - zoom: 1; - float: left; - margin-right: 0; - width: 460px; - border-style: solid; - border-width: 1px; - border-color: black; - position: relative; - margin-top: -2px; - margin-left: -2px; - top: 1px; - left: 1px; - background-color: #000; - color: #FFF; } - * html #page.demo article { - overflow-x: hidden; } - @media only screen and (max-width:1000px) { - #page.demo article { - width: auto; - float: none; } } diff --git a/css/doc.css b/css/doc.css new file mode 100644 index 0000000..b7f18ee --- /dev/null +++ b/css/doc.css @@ -0,0 +1,505 @@ +.clearfix { + *zoom: 1; } + .clearfix:after { + content: ""; + display: table; + clear: both; } + +.hide-text, +.really-hide-text { + position: absolute; + clip: rect(1px 1px 1px 1px); + clip: rect(1px, 1px, 1px, 1px); + padding: 0; + margin: 0; + border: 0; + height: 1px; + width: 1px; + overflow: hidden; } + +.hr { + border-top-style: solid; + border-top-width: 1px; + border-top-color: black; + margin-top: -1px; + margin-bottom: 1.42857em; } + .hr hr { + position: absolute; + clip: rect(1px 1px 1px 1px); + clip: rect(1px, 1px, 1px, 1px); + padding: 0; + margin: 0; + border: 0; + height: 1px; + width: 1px; + overflow: hidden; } + +.list { + margin: 0; + padding: 0; + list-style-type: none; + *zoom: 1; } + .list:after { + content: ""; + display: table; + clear: both; } + .list li, + .list dt, + .list dd { + margin: 0; + float: left; } + +.block-link { + *zoom: 1; + display: block; + text-decoration: none; } + .block-link:after { + content: ""; + display: table; + clear: both; } + +.block-link-hover:hover .title, .block-link-hover:active .title, .block-link-hover:focus .title { + text-decoration: underline; } + +.unroll { + text-decoration: none; } + .unroll:hover, .unroll:active, .unroll:focus { + text-decoration: underline; } + +.no-roll { + text-decoration: none; } + .no-roll:hover, .no-roll:active, .no-roll:focus { + text-decoration: none; } + +.reset-button { + border: 0; + width: auto; + padding: 0; + display: block; } + +.clear-fix { + *zoom: 1; } + .clear-fix:after { + content: ""; + display: table; + clear: both; } + +.no-bottom { + margin-bottom: 0; } + +.no-padding-top { + padding-top: 0; } + +.uppercase { + text-transform: uppercase; + letter-spacing: 0.001em; } + +/* normalize.css v1.0.1 | MIT License | git.io/normalize */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section, +summary { + display: block; } + +img, +audio, +video, +canvas, +svg { + display: block; + max-width: 100%; + height: auto; } + +audio:not([controls]) { + display: none; + height: 0; } + +[hidden] { + display: none; } + +html { + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; } + html * html { + font-size: 87.5%; } + html html { + font-size: 14px; + line-height: 1.42857em; } + +html, +button, +input, +select, +textarea { + font-family: sans-serif; } + +body { + margin: 0; + font-size: 87.5%; + line-height: 1.42857em; } + +a:focus { + outline: thin dotted; } + +a:active, +a:hover { + outline: 0; } + +h1 { + margin: 0; + font-size: 1.92857em; + line-height: 1.48148em; + margin-bottom: 0.74074em; + padding-top: 0.74074em; } + +h2 { + margin: 0; + font-size: 1.5em; + line-height: 1.90476em; + margin-bottom: 0.95238em; + padding-top: 0.95238em; } + +h3 { + margin: 0; + font-size: 1.28571em; + line-height: 2.22222em; + margin-bottom: 1.11111em; + padding-top: 1.11111em; } + +h4 { + margin: 0; + font-size: 1.14286em; + line-height: 1.25em; + margin-bottom: 1.25em; + padding-top: 1.25em; } + +h5 { + margin: 0; + font-size: 1em; + line-height: 1.42857em; + margin-bottom: 1.42857em; + padding-top: 1.42857em; } + +h6 { + margin: 0; + font-size: 0.92857em; + line-height: 1.53846em; + margin-bottom: 1.53846em; + padding-top: 1.53846em; } + +abbr[title] { + border-bottom: 1px dotted; } + +b, +strong { + font-weight: bold; } + +blockquote { + margin: 0 80px; + margin-bottom: 1.42857em; } + +dfn { + font-style: italic; } + +mark { + background: #ff0; + color: #000; } + +p, +pre, +address { + margin: 0; + margin-bottom: 1.42857em; } + +code, +kbd, +pre, +samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; } + +pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; } + +q { + quotes: none; } + +q:before, +q:after { + content: ''; + content: none; } + +/* + * Addresses inconsistent and variable font size in all browsers. + */ +small { + font-size: 80%; + line-height: 0; + vertical-align: baseline; + position: relative; } + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; } + +sup { + top: -0.5em; } + +sub { + bottom: -0.25em; } + +dl, +menu, +ol, +ul { + margin: 0; + margin-bottom: 1.42857em; } + +dd { + margin: 0 0 0 80px; } + +menu, +ol, +ul { + padding: 0; } + +nav ul, +nav ol { + list-style: none; + list-style-image: none; } + +img { + border: 0; + -ms-interpolation-mode: bicubic; } + +svg:not(:root) { + overflow: hidden; } + +figure { + margin: 0; } + +form { + margin: 0; } + +fieldset { + border: 1px solid #c0c0c0; + margin: 0; + padding: 10px; + padding-top: 0.71429em; + padding-bottom: 0.71429em; + margin-bottom: 1.42857em; } + +legend { + border: 0; + padding: 0; + white-space: normal; + *margin-left: -7px; } + +button, +input, +select, +textarea { + font-size: 100%; + margin: 0; + vertical-align: baseline; + *vertical-align: middle; } + +button, +input { + line-height: normal; } + +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; + *overflow: visible; } + +button[disabled], +input[disabled] { + cursor: default; } + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + padding: 0; + *height: 13px; + *width: 13px; } + +input[type="search"] { + -webkit-appearance: textfield; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + box-sizing: content-box; } + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; } + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; } + +textarea { + overflow: auto; + vertical-align: top; } + +table { + border-collapse: collapse; + border-spacing: 0; } + +th, td { + padding-top: 0.71429em; + padding-right: 10px; + padding-bottom: 0.71429em; + padding-left: 10px; } + +/** +* Grid +*/ +#grid { + /* Dimensions - same width as your grid with gutters */ + width: 940px; + overflow: hidden; + /* Grid (left-aligned) +position: absolute; +top: 0; +left: 0; +*/ + /* Grid (centered) */ + position: absolute; + top: 0; + left: 50%; + margin-left: -470px; } + @media only screen and (max-width: 1000px) { + #grid { + width: 780px; + margin-left: -390px; } } + @media only screen and (max-width: 840px) { + #grid { + margin-left: 0; + width: auto; + left: 20px; + right: 20px; } + #grid .vert-container { + display: none!important; } } + +/** +* Vertical grid lines +* +* Set the column width taking the borders into consideration, +* and use margins to set column gutters. +*/ +#grid div.vert { + width: 59px; + margin-left: 19px; + *display: inline!important; + border-left: 1px dotted darkgray; + border-right: 1px dotted darkgray; + position: relative; } + +#grid div.vert.first-line { + margin-left: 0; + width: 58px; } + +/** +* Horizontal grid lines, defined by your base line height +* +* Remember, the CSS properties that define the box model: +* visible height = height + borders + margins + padding +*/ +#grid div.horiz { + height: 1.42857em; + padding: 0; } + +#grid div.horiz { + border-bottom-style: dotted; + border-bottom-width: 1px; + border-bottom-color: darkgrey; + margin-top: -1px; + position: relative; + top: 1px; } + +/** +* Classes for multiple grids +* +* When using more than one grid, remember to set the numberOfGrids +* option in the hashgrid.js file. +*/ +#grid.grid-1 .vert { + border-color: transparent; } + +#grid.grid-2 .horiz { + border-color: transparent; } + +@media only screen and (max-width: 1000px) { + #page.index th:nth-child(3), + #page.index td:nth-child(3), + #page.index th:nth-child(4), + #page.index td:nth-child(4), + #page.index th:nth-child(5), + #page.index td:nth-child(5), + #page.index th:nth-child(6), + #page.index td:nth-child(6), + #page.index th:nth-child(7), + #page.index td:nth-child(7), + #page.index th:nth-child(8), + #page.index td:nth-child(8), + #page.index th:nth-child(9), + #page.index td:nth-child(9), + #page.index th:nth-child(10), + #page.index td:nth-child(10), + #page.index th:nth-child(11), + #page.index td:nth-child(11), + #page.index th:nth-child(12), + #page.index td:nth-child(12) { + display: none; + background-color: red; } } + +#page.index, +#page.doc { + margin: auto; + width: 940px; } + @media only screen and (max-width: 1000px) { + #page.index, + #page.doc { + width: 780px; } } + @media only screen and (max-width: 840px) { + #page.index, + #page.doc { + width: auto; + margin: 0 20px; } } + #page.index img, + #page.doc img { + display: block; } + #page.index h1, + #page.doc h1 { + float: right; } + @media only screen and (max-width: 840px) { + #page.index h1, + #page.doc h1 { + float: none; } } + #page.index .footnotes ol, + #page.doc .footnotes ol { + font-size: 0.71429em; + line-height: 2em; + margin-bottom: 2em; } + #page.index .footnotes ol p, + #page.doc .footnotes ol p { + margin-bottom: 1em; } diff --git a/css/styles.css b/css/styles.css new file mode 100644 index 0000000..d3816cf --- /dev/null +++ b/css/styles.css @@ -0,0 +1,641 @@ +.clearfix { + *zoom: 1; } + .clearfix:after { + content: ""; + display: table; + clear: both; } + +.hide-text, +.really-hide-text { + position: absolute; + clip: rect(1px 1px 1px 1px); + clip: rect(1px, 1px, 1px, 1px); + padding: 0; + margin: 0; + border: 0; + height: 1px; + width: 1px; + overflow: hidden; } + +.hr { + border-top-style: solid; + border-top-width: 1px; + border-top-color: black; + margin-top: -1px; + margin-bottom: 1.42857em; } + .hr hr { + position: absolute; + clip: rect(1px 1px 1px 1px); + clip: rect(1px, 1px, 1px, 1px); + padding: 0; + margin: 0; + border: 0; + height: 1px; + width: 1px; + overflow: hidden; } + +.list { + margin: 0; + padding: 0; + list-style-type: none; + *zoom: 1; } + .list:after { + content: ""; + display: table; + clear: both; } + .list li, + .list dt, + .list dd { + margin: 0; + float: left; } + +.block-link { + *zoom: 1; + display: block; + text-decoration: none; } + .block-link:after { + content: ""; + display: table; + clear: both; } + +.block-link-hover:hover .title, .block-link-hover:active .title, .block-link-hover:focus .title { + text-decoration: underline; } + +.unroll { + text-decoration: none; } + .unroll:hover, .unroll:active, .unroll:focus { + text-decoration: underline; } + +.no-roll { + text-decoration: none; } + .no-roll:hover, .no-roll:active, .no-roll:focus { + text-decoration: none; } + +.reset-button { + border: 0; + width: auto; + padding: 0; + display: block; } + +.clear-fix { + *zoom: 1; } + .clear-fix:after { + content: ""; + display: table; + clear: both; } + +.no-bottom { + margin-bottom: 0; } + +.no-padding-top { + padding-top: 0; } + +.uppercase { + text-transform: uppercase; + letter-spacing: 0.001em; } + +/* normalize.css v1.0.1 | MIT License | git.io/normalize */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section, +summary { + display: block; } + +img, +audio, +video, +canvas, +svg { + display: block; + max-width: 100%; + height: auto; } + +audio:not([controls]) { + display: none; + height: 0; } + +[hidden] { + display: none; } + +html { + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; } + html * html { + font-size: 87.5%; } + html html { + font-size: 14px; + line-height: 1.42857em; } + +html, +button, +input, +select, +textarea { + font-family: sans-serif; } + +body { + margin: 0; + font-size: 87.5%; + line-height: 1.42857em; } + +a:focus { + outline: thin dotted; } + +a:active, +a:hover { + outline: 0; } + +h1 { + margin: 0; + font-size: 1.92857em; + line-height: 1.48148em; + margin-bottom: 0.74074em; + padding-top: 0.74074em; } + +h2 { + margin: 0; + font-size: 1.5em; + line-height: 1.90476em; + margin-bottom: 0.95238em; + padding-top: 0.95238em; } + +h3 { + margin: 0; + font-size: 1.28571em; + line-height: 2.22222em; + margin-bottom: 1.11111em; + padding-top: 1.11111em; } + +h4 { + margin: 0; + font-size: 1.14286em; + line-height: 1.25em; + margin-bottom: 1.25em; + padding-top: 1.25em; } + +h5 { + margin: 0; + font-size: 1em; + line-height: 1.42857em; + margin-bottom: 1.42857em; + padding-top: 1.42857em; } + +h6 { + margin: 0; + font-size: 0.92857em; + line-height: 1.53846em; + margin-bottom: 1.53846em; + padding-top: 1.53846em; } + +abbr[title] { + border-bottom: 1px dotted; } + +b, +strong { + font-weight: bold; } + +blockquote { + margin: 0 80px; + margin-bottom: 1.42857em; } + +dfn { + font-style: italic; } + +mark { + background: #ff0; + color: #000; } + +p, +pre, +address { + margin: 0; + margin-bottom: 1.42857em; } + +code, +kbd, +pre, +samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; } + +pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; } + +q { + quotes: none; } + +q:before, +q:after { + content: ''; + content: none; } + +/* + * Addresses inconsistent and variable font size in all browsers. + */ +small { + font-size: 80%; + line-height: 0; + vertical-align: baseline; + position: relative; } + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; } + +sup { + top: -0.5em; } + +sub { + bottom: -0.25em; } + +dl, +menu, +ol, +ul { + margin: 0; + margin-bottom: 1.42857em; } + +dd { + margin: 0 0 0 80px; } + +menu, +ol, +ul { + padding: 0; } + +nav ul, +nav ol { + list-style: none; + list-style-image: none; } + +img { + border: 0; + -ms-interpolation-mode: bicubic; } + +svg:not(:root) { + overflow: hidden; } + +figure { + margin: 0; } + +form { + margin: 0; } + +fieldset { + border: 1px solid #c0c0c0; + margin: 0; + padding: 10px; + padding-top: 0.71429em; + padding-bottom: 0.71429em; + margin-bottom: 1.42857em; } + +legend { + border: 0; + padding: 0; + white-space: normal; + *margin-left: -7px; } + +button, +input, +select, +textarea { + font-size: 100%; + margin: 0; + vertical-align: baseline; + *vertical-align: middle; } + +button, +input { + line-height: normal; } + +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; + *overflow: visible; } + +button[disabled], +input[disabled] { + cursor: default; } + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + padding: 0; + *height: 13px; + *width: 13px; } + +input[type="search"] { + -webkit-appearance: textfield; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + box-sizing: content-box; } + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; } + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; } + +textarea { + overflow: auto; + vertical-align: top; } + +table { + border-collapse: collapse; + border-spacing: 0; } + +th, td { + padding-top: 0.71429em; + padding-right: 10px; + padding-bottom: 0.71429em; + padding-left: 10px; } + +/** +* Grid +*/ +#grid { + /* Dimensions - same width as your grid with gutters */ + width: 940px; + overflow: hidden; + /* Grid (left-aligned) +position: absolute; +top: 0; +left: 0; +*/ + /* Grid (centered) */ + position: absolute; + top: 0; + left: 50%; + margin-left: -470px; } + @media only screen and (max-width: 1000px) { + #grid { + width: 780px; + margin-left: -390px; } } + @media only screen and (max-width: 840px) { + #grid { + margin-left: 0; + width: auto; + left: 20px; + right: 20px; } + #grid .vert-container { + display: none!important; } } + +/** +* Vertical grid lines +* +* Set the column width taking the borders into consideration, +* and use margins to set column gutters. +*/ +#grid div.vert { + width: 59px; + margin-left: 19px; + *display: inline!important; + border-left: 1px dotted darkgray; + border-right: 1px dotted darkgray; + position: relative; } + +#grid div.vert.first-line { + margin-left: 0; + width: 58px; } + +/** +* Horizontal grid lines, defined by your base line height +* +* Remember, the CSS properties that define the box model: +* visible height = height + borders + margins + padding +*/ +#grid div.horiz { + height: 1.42857em; + padding: 0; } + +#grid div.horiz { + border-bottom-style: dotted; + border-bottom-width: 1px; + border-bottom-color: darkgrey; + margin-top: -1px; + position: relative; + top: 1px; } + +/** +* Classes for multiple grids +* +* When using more than one grid, remember to set the numberOfGrids +* option in the hashgrid.js file. +*/ +#grid.grid-1 .vert { + border-color: transparent; } + +#grid.grid-2 .horiz { + border-color: transparent; } + +/********************************************/ +/* FORMULAIRES */ +/********************************************/ +form p, +form .p { + min-height: 2.85714em; } + +input, +textarea { + width: 208px; + padding: 5px; + border: 1px solid #333; } + +input[type=radio], +input[type=checkbox] { + width: auto; + padding: 0; + border: 0; } + +input.radio, +input.checkbox { + width: auto; + padding: 0; + border: 0; } + +button, +select, +input[type=reset], +input[type=button], +input[type=submit], +input.reset, +input.button, +input.submit { + width: 220px; + padding: 5px; + border: 1px solid #333; } + +select { + padding: 4px; } + +/********************************************/ +/* SPRITES */ +/********************************************/ +/********************************************/ +/* TYPOGRAPHIE */ +/********************************************/ +/********************************************/ +/* ÉLÉMENTS D'INTERFACE */ +/********************************************/ +a { + text-decoration: underline; } + a:hover, a:active, a:focus { + text-decoration: none; } + +/************************************************/ +/* HEADER */ +/************************************************/ +/************************************************/ +/* FOOTER */ +/************************************************/ +/********************************************/ +/* STYLES COMMUNS À TOUTES LES PAGES */ +/********************************************/ +#page { + margin: auto; + width: 940px; } + @media only screen and (max-width: 1000px) { + #page { + width: 780px; } } + @media only screen and (max-width: 840px) { + #page { + width: auto; + margin: 0 20px; } } + +#page.demo nav ul { + margin: 0; + padding: 0; + list-style-type: none; + *zoom: 1; } + #page.demo nav ul:after { + content: ""; + display: table; + clear: both; } + #page.demo nav ul li, + #page.demo nav ul dt, + #page.demo nav ul dd { + margin: 0; + float: left; } +#page.demo .colleft { + *display: inline; + zoom: 1; + float: left; + margin-left: 0; + width: 460px; + padding-right: 9px; + margin-right: 10px; + border-right: 1px solid black; + margin-bottom: 1.42857em; + padding-top: 1.42857em; } + * html #page.demo .colleft { + overflow-x: hidden; } +#page.demo .colright { + *display: inline; + zoom: 1; + float: left; + margin-left: 0; + width: 460px; + margin-bottom: 1.42857em; + padding-top: 1.42857em; } + * html #page.demo .colright { + overflow-x: hidden; } +@media only screen and (max-width: 840px) { + #page.demo form { + display: none; } } +#page.demo .large { + font-size: 1.28571em; + line-height: 2.22222em; + margin-bottom: 2.22222em; } + #page.demo .large span { + font-size: 0.77778em; + line-height: 1.42857em; } +#page.demo .small { + font-size: 0.71429em; + line-height: 2em; + margin-bottom: 2em; } +#page.demo header { + border-bottom-style: solid; + border-bottom-width: 1px; + border-bottom-color: black; + margin-top: -1px; + position: relative; + top: 1px; + padding-top: 1.42857em; + padding-bottom: 1.42857em; + padding-left: 1.42857em; + padding-right: 1.42857em; + margin-bottom: 1.42857em; + *zoom: 1; } +#page.demo section { + padding-left: 80px; + *display: inline; + zoom: 1; + float: left; + margin-left: 20px; + width: 380px; + border-style: solid; + border-width: 1px; + border-color: black; + position: relative; + margin-top: -2px; + margin-left: -2px; + top: 1px; + left: 1px; } + * html #page.demo section { + overflow-x: hidden; } + @media only screen and (max-width: 1000px) { + #page.demo section { + width: auto; + float: none; + padding-left: 0; + margin-right: 0; + margin-bottom: 1.42857em; } } +#page.demo article { + *display: inline; + zoom: 1; + float: left; + margin-left: 0; + width: 460px; + border-style: solid; + border-width: 1px; + border-color: black; + position: relative; + margin-top: -2px; + margin-left: -2px; + top: 1px; + left: 1px; + background-color: #000; + color: #FFF; } + * html #page.demo article { + overflow-x: hidden; } + @media only screen and (max-width: 1000px) { + #page.demo article { + width: auto; + float: none; } } + +/********************************************/ +/* SIDEBAR */ +/********************************************/ +/********************************************/ +/* PRINT */ +/********************************************/ diff --git a/inc/content/demo.php b/inc/content/demo.php index 87ccb5a..b33b1d7 100644 --- a/inc/content/demo.php +++ b/inc/content/demo.php @@ -58,10 +58,9 @@
Address: somewhere, world
-

-The a element example
-The abbr element and abbr element with title examples
-The b element example
+

The a element example

+

The abbr element and abbr element with title examples

+

The b element example
The cite element example
The code element example
The del element example
@@ -89,7 +88,6 @@

audio

-

img

@@ -98,14 +96,13 @@

svg

- +

video

-

Interactive content

@@ -253,21 +250,21 @@
Inputs as descendents of labels (form legend). This doubles up as a long legend that can test word wrapping. -

-

-

-

-

-

-

- -

-

-

-

- -

-

+

+

+

+

+

+

+

+ +

+

+

+

+ +

+

diff --git a/inc/head/dist.php b/inc/head/dist.php index 4941856..7b2ecd6 100644 --- a/inc/head/dist.php +++ b/inc/head/dist.php @@ -5,7 +5,7 @@ --> - + template diff --git a/index.php b/index.php index 9075b0e..3074d55 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ Index des maquettes - + diff --git a/index.txt b/index.txt index ad4a605..9db5e8e 100644 --- a/index.txt +++ b/index.txt @@ -10,7 +10,6 @@ _[Voir la documentation](doc/)_ Maquette | Validation HTML | IE 6 | IE 7 | IE 8 | IE 9 | Opera | Chrome | Safari | Fx | Lynx [^1] | Impression | iPhone | iPad -----------------------------------------------------------------------------|---------------------|------|------|------|------|-------|--------|--------|----|-----------|------------|--------|------ -[template](inc/?page=template) | | | | |  | | | | | | | | [Démo](inc/?page=demo) | | | | |  | | | | | | | | [^1]: L'affichage Lynx est proche de la restitution faite par un lecteur d'écran ou de ce qui est perçu par un moteur de recherche. diff --git a/js/_after.js b/js/_after.js index 3e09651..fd5baf2 100644 --- a/js/_after.js +++ b/js/_after.js @@ -1,17 +1,3 @@ -/*! - * jQuery JavaScript Library v1.7.1 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Mon Nov 21 21:11:03 2011 -0500 - */(function(e,t){function u(e){var t=o[e]={},n,r;e=e.split(/\s+/);for(n=0,r=e.length;n=0===n})}function V(e){var t=$.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function at(e,t){return s.nodeName(e,"table")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ft(e,t){if(t.nodeType!==1||!s.hasData(e))return;var n,r,i,o=s._data(e),u=s._data(t,o),a=o.events;if(a){delete u.handle;u.events={};for(n in a)for(r=0,i=a[n].length;r0){if(n!=="border")for(;o").appendTo(t),i=r.css("display");r.remove();if(i==="none"||i===""){if(!hn){hn=n.createElement("iframe");hn.frameBorder=hn.width=hn.height=0}t.appendChild(hn);if(!pn||!hn.createElement){pn=(hn.contentWindow||hn.contentDocument).document;pn.write((n.compatMode==="CSS1Compat"?"":"")+"");pn.close()}r=pn.createElement(e);pn.body.appendChild(r);i=s.css(r,"display");t.removeChild(hn)}cn[e]=i}return cn[e]}function Nn(e){return s.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n=e.document,r=e.navigator,i=e.location,s=function(){function H(){if(i.isReady)return;try{n.documentElement.doScroll("left")}catch(e){setTimeout(H,1);return}i.ready()}var i=function(e,t){return new i.fn.init(e,t,u)},s=e.jQuery,o=e.$,u,a=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,f=/\S/,l=/^\s+/,c=/\s+$/,h=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,p=/^[\],:{}\s]*$/,d=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,v=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,m=/(?:^|:|,)(?:\s*\[)+/g,g=/(webkit)[ \/]([\w.]+)/,y=/(opera)(?:.*version)?[ \/]([\w.]+)/,b=/(msie) ([\w.]+)/,w=/(mozilla)(?:.*? rv:([\w.]+))?/,E=/-([a-z]|[0-9])/ig,S=/^-ms-/,x=function(e,t){return(t+"").toUpperCase()},T=r.userAgent,N,C,k,L=Object.prototype.toString,A=Object.prototype.hasOwnProperty,O=Array.prototype.push,M=Array.prototype.slice,_=String.prototype.trim,D=Array.prototype.indexOf,P={};i.fn=i.prototype={constructor:i,init:function(e,r,s){var o,u,f,l;if(!e)return this;if(e.nodeType){this.context=this[0]=e;this.length=1;return this}if(e==="body"&&!r&&n.body){this.context=n;this[0]=n.body;this.selector=e;this.length=1;return this}if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?o=[null,e,null]:o=a.exec(e);if(o&&(o[1]||!r)){if(o[1]){r=r instanceof i?r[0]:r;l=r?r.ownerDocument||r:n;f=h.exec(e);if(f)if(i.isPlainObject(r)){e=[n.createElement(f[1])];i.fn.attr.call(e,r,!0)}else e=[l.createElement(f[1])];else{f=i.buildFragment([o[1]],[l]);e=(f.cacheable?i.clone(f.fragment):f.fragment).childNodes}return i.merge(this,e)}u=n.getElementById(o[2]);if(u&&u.parentNode){if(u.id!==o[2])return s.find(e);this.length=1;this[0]=u}this.context=n;this.selector=e;return this}return!r||r.jquery?(r||s).find(e):this.constructor(r).find(e)}if(i.isFunction(e))return s.ready(e);if(e.selector!==t){this.selector=e.selector;this.context=e.context}return i.makeArray(e,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return M.call(this,0)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=this.constructor();i.isArray(e)?O.apply(r,e):i.merge(r,e);r.prevObject=this;r.context=this.context;t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")");return r},each:function(e,t){return i.each(this,e,t)},ready:function(e){i.bindReady();C.add(e);return this},eq:function(e){e=+e;return e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(M.apply(this,arguments),"slice",M.call(arguments).join(","))},map:function(e){return this.pushStack(i.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:O,sort:[].sort,splice:[].splice};i.fn.init.prototype=i.fn;i.extend=i.fn.extend=function(){var e,n,r,s,o,u,a=arguments[0]||{},f=1,l=arguments.length,c=!1;if(typeof a=="boolean"){c=a;a=arguments[1]||{};f=2}typeof a!="object"&&!i.isFunction(a)&&(a={});if(l===f){a=this;--f}for(;f0)return;C.fireWith(n,[i]);i.fn.trigger&&i(n).trigger("ready").off("ready")}},bindReady:function(){if(C)return;C=i.Callbacks("once memory");if(n.readyState==="complete")return setTimeout(i.ready,1);if(n.addEventListener){n.addEventListener("DOMContentLoaded",k,!1);e.addEventListener("load",i.ready,!1)}else if(n.attachEvent){n.attachEvent("onreadystatechange",k);e.attachEvent("onload",i.ready);var t=!1;try{t=e.frameElement==null}catch(r){}n.documentElement.doScroll&&t&&H()}},isFunction:function(e){return i.type(e)==="function"},isArray:Array.isArray||function(e){return i.type(e)==="array"},isWindow:function(e){return e&&typeof e=="object"&&"setInterval"in e},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):P[L.call(e)]||"object"},isPlainObject:function(e){if(!e||i.type(e)!=="object"||e.nodeType||i.isWindow(e))return!1;try{if(e.constructor&&!A.call(e,"constructor")&&!A.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||A.call(e,r)},isEmptyObject:function(e){for(var t in e)return!1;return!0},error:function(e){throw new Error(e)},parseJSON:function(t){if(typeof t!="string"||!t)return null;t=i.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(p.test(t.replace(d,"@").replace(v,"]").replace(m,"")))return(new Function("return "+t))();i.error("Invalid JSON: "+t)},parseXML:function(n){var r,s;try{if(e.DOMParser){s=new DOMParser;r=s.parseFromString(n,"text/xml")}else{r=new ActiveXObject("Microsoft.XMLDOM");r.async="false";r.loadXML(n)}}catch(o){r=t}(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&i.error("Invalid XML: "+n);return r},noop:function(){},globalEval:function(t){t&&f.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(S,"ms-").replace(E,x)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toUpperCase()===t.toUpperCase()},each:function(e,n,r){var s,o=0,u=e.length,a=u===t||i.isFunction(e);if(r){if(a){for(s in e)if(n.apply(e[s],r)===!1)break}else for(;o0&&e[0]&&e[f-1]||f===0||i.isArray(e));if(l)for(;a1?a.call(arguments,0):n;--o||f.resolveWith(f,t)}}function h(e){return function(t){i[e]=arguments.length>1?a.call(arguments,0):t;f.notifyWith(l,i)}}var t=a.call(arguments,0),n=0,r=t.length,i=new Array(r),o=r,u=r,f=r<=1&&e&&s.isFunction(e.promise)?e:s.Deferred(),l=f.promise();if(r>1){for(;n
a";r=m.getElementsByTagName("*");i=m.getElementsByTagName("a")[0];if(!r||!r.length||!i)return{};o=n.createElement("select");u=o.appendChild(n.createElement("option"));a=m.getElementsByTagName("input")[0];t={leadingWhitespace:m.firstChild.nodeType===3,tbody:!m.getElementsByTagName("tbody").length,htmlSerialize:!!m.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:i.getAttribute("href")==="/a",opacity:/^0.55/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:a.value==="on",optSelected:u.selected,getSetAttribute:m.className!=="t",enctype:!!n.createElement("form").enctype,html5Clone:n.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0};a.checked=!0;t.noCloneChecked=a.cloneNode(!0).checked;o.disabled=!0;t.optDisabled=!u.disabled;try{delete m.test}catch(y){t.deleteExpando=!1}if(!m.addEventListener&&m.attachEvent&&m.fireEvent){m.attachEvent("onclick",function(){t.noCloneEvent=!1});m.cloneNode(!0).fireEvent("onclick")}a=n.createElement("input");a.value="t";a.setAttribute("type","radio");t.radioValue=a.value==="t";a.setAttribute("checked","checked");m.appendChild(a);l=n.createDocumentFragment();l.appendChild(m.lastChild);t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked;t.appendChecked=a.checked;l.removeChild(a);l.appendChild(m);m.innerHTML="";if(e.getComputedStyle){f=n.createElement("div");f.style.width="0";f.style.marginRight="0";m.style.width="2px";m.appendChild(f);t.reliableMarginRight=(parseInt((e.getComputedStyle(f,null)||{marginRight:0}).marginRight,10)||0)===0}if(m.attachEvent)for(d in{submit:1,change:1,focusin:1}){p="on"+d;v=p in m;if(!v){m.setAttribute(p,"return;");v=typeof m[p]=="function"}t[d+"Bubbles"]=v}l.removeChild(m);l=o=u=f=m=a=null;s(function(){var e,r,i,o,u,a,f,l,h,p,d,g=n.getElementsByTagName("body")[0];if(!g)return;f=1;l="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";h="visibility:hidden;border:0;";p="style='"+l+"border:5px solid #000;padding:0;'";d="
"+""+"
";e=n.createElement("div");e.style.cssText=h+"width:0;height:0;position:static;top:0;margin-top:"+f+"px";g.insertBefore(e,g.firstChild);m=n.createElement("div");e.appendChild(m);m.innerHTML="
t
";c=m.getElementsByTagName("td");v=c[0].offsetHeight===0;c[0].style.display="";c[1].style.display="none";t.reliableHiddenOffsets=v&&c[0].offsetHeight===0;m.innerHTML="";m.style.width=m.style.paddingLeft="1px";s.boxModel=t.boxModel=m.offsetWidth===2;if(typeof m.style.zoom!="undefined"){m.style.display="inline";m.style.zoom=1;t.inlineBlockNeedsLayout=m.offsetWidth===2;m.style.display="";m.innerHTML="
";t.shrinkWrapBlocks=m.offsetWidth!==2}m.style.cssText=l+h;m.innerHTML=d;r=m.firstChild;i=r.firstChild;u=r.nextSibling.firstChild.firstChild;a={doesNotAddBorder:i.offsetTop!==5,doesAddBorderForTableAndCells:u.offsetTop===5};i.style.position="fixed";i.style.top="20px";a.fixedPosition=i.offsetTop===20||i.offsetTop===15;i.style.position=i.style.top="";r.style.overflow="hidden";r.style.position="relative";a.subtractsBorderForOverflowNotVisible=i.offsetTop===-5;a.doesNotIncludeMarginInBodyOffset=g.offsetTop!==f;g.removeChild(e);m=e=null;s.extend(t,a)});return t}();var f=/^(?:\{.*\}|\[.*\])$/,l=/([A-Z])/g;s.extend({cache:{},uuid:0,expando:"jQuery"+(s.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){e=e.nodeType?s.cache[e[s.expando]]:e[s.expando];return!!e&&!h(e)},data:function(e,n,r,i){if(!s.acceptData(e))return;var o,u,a,f=s.expando,l=typeof n=="string",c=e.nodeType,h=c?s.cache:e,p=c?e[f]:e[f]&&f,d=n==="events";if((!p||!h[p]||!d&&!i&&!h[p].data)&&l&&r===t)return;p||(c?e[f]=p=++s.uuid:p=f);if(!h[p]){h[p]={};c||(h[p].toJSON=s.noop)}if(typeof n=="object"||typeof n=="function")i?h[p]=s.extend(h[p],n):h[p].data=s.extend(h[p].data,n);o=u=h[p];if(!i){u.data||(u.data={});u=u.data}r!==t&&(u[s.camelCase(n)]=r);if(d&&!u[n])return o.events;if(l){a=u[n];a==null&&(a=u[s.camelCase(n)])}else a=u;return a},removeData:function(e,t,n){if(!s.acceptData(e))return;var r,i,o,u=s.expando,a=e.nodeType,f=a?s.cache:e,l=a?e[u]:u;if(!f[l])return;if(t){r=n?f[l]:f[l].data;if(r){if(!s.isArray(t))if(t in r)t=[t];else{t=s.camelCase(t);t in r?t=[t]:t=t.split(" ")}for(i=0,o=t.length;i-1)return!0;return!1},val:function(e){var n,r,i,o=this[0];if(!arguments.length){if(o){n=s.valHooks[o.nodeName.toLowerCase()]||s.valHooks[o.type];if(n&&"get"in n&&(r=n.get(o,"value"))!==t)return r;r=o.value;return typeof r=="string"?r.replace(m,""):r==null?"":r}return}i=s.isFunction(e);return this.each(function(r){var o=s(this),u;if(this.nodeType!==1)return;i?u=e.call(this,r,o.val()):u=e;u==null?u="":typeof u=="number"?u+="":s.isArray(u)&&(u=s.map(u,function(e){return e==null?"":e+""}));n=s.valHooks[this.nodeName.toLowerCase()]||s.valHooks[this.type];if(!n||!("set"in n)||n.set(this,u,"value")===t)this.value=u})}});s.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r,i,o=e.selectedIndex,u=[],a=e.options,f=e.type==="select-one";if(o<0)return null;n=f?o:0;r=f?o+1:a.length;for(;n=0});n.length||(e.selectedIndex=-1);return n}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(e,n,r,i){var o,u,a,f=e.nodeType;if(!e||f===3||f===8||f===2)return;if(i&&n in s.attrFn)return s(e)[n](r);if(typeof e.getAttribute=="undefined")return s.prop(e,n,r);a=f!==1||!s.isXMLDoc(e);if(a){n=n.toLowerCase();u=s.attrHooks[n]||(w.test(n)?x:S)}if(r!==t){if(r===null){s.removeAttr(e,n);return}if(u&&"set"in u&&a&&(o=u.set(e,r,n))!==t)return o;e.setAttribute(n,""+r);return r}if(u&&"get"in u&&a&&(o=u.get(e,n))!==null)return o;o=e.getAttribute(n);return o===null?t:o},removeAttr:function(e,t){var n,r,i,o,u=0;if(t&&e.nodeType===1){r=t.toLowerCase().split(v);o=r.length;for(;u=0}})});var N=/^(?:textarea|input|select)$/i,C=/^([^\.]*)?(?:\.(.+))?$/,k=/\bhover(\.\S+)?\b/,L=/^key/,A=/^(?:mouse|contextmenu)|click/,O=/^(?:focusinfocus|focusoutblur)$/,M=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,_=function(e){var t=M.exec(e);if(t){t[1]=(t[1]||"").toLowerCase();t[3]=t[3]&&new RegExp("(?:^|\\s)"+t[3]+"(?:\\s|$)")}return t},D=function(e,t){var n=e.attributes||{};return(!t[1]||e.nodeName.toLowerCase()=== -t[1])&&(!t[2]||(n.id||{}).value===t[2])&&(!t[3]||t[3].test((n["class"]||{}).value))},P=function(e){return s.event.special.hover?e:e.replace(k,"mouseenter$1 mouseleave$1")};s.event={add:function(e,n,r,i,o){var u,a,f,l,c,h,p,d,v,m,g,y;if(e.nodeType===3||e.nodeType===8||!n||!r||!(u=s._data(e)))return;if(r.handler){v=r;r=v.handler}r.guid||(r.guid=s.guid++);f=u.events;f||(u.events=f={});a=u.handle;if(!a){u.handle=a=function(e){return typeof s=="undefined"||!!e&&s.event.triggered===e.type?t:s.event.dispatch.apply(a.elem,arguments)};a.elem=e}n=s.trim(P(n)).split(" ");for(l=0;l=0){u=u.slice(0,-1);l=!0}if(u.indexOf(".")>=0){a=u.split(".");u=a.shift();a.sort()}if((!i||s.event.customEvent[u])&&!s.event.global[u])return;n=typeof n=="object"?n[s.expando]?n:new s.Event(u,n):new s.Event(u);n.type=u;n.isTrigger=!0;n.exclusive=l;n.namespace=a.join(".");n.namespace_re=n.namespace?new RegExp("(^|\\.)"+a.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;d=u.indexOf(":")<0?"on"+u:"";if(!i){f=s.cache;for(c in f)f[c].events&&f[c].events[u]&&s.event.trigger(n,r,f[c].handle.elem,!0);return}n.result=t;n.target||(n.target=i);r=r!=null?s.makeArray(r):[];r.unshift(n);v=s.event.special[u]||{};if(v.trigger&&v.trigger.apply(i,r)===!1)return;g=[[i,v.bindType||u]];if(!o&&!v.noBubble&&!s.isWindow(i)){y=v.delegateType||u;h=O.test(y+u)?i:i.parentNode;p=null;for(;h;h=h.parentNode){g.push([h,y]);p=h}p&&p===i.ownerDocument&&g.push([p.defaultView||p.parentWindow||e,y])}for(c=0;ci&&a.push({elem:this,matches:r.slice(i)});for(f=0;f0?this.on(t,null,e,n):this.trigger(t)};s.attrFn&&(s.attrFn[t]=!0);L.test(t)&&(s.event.fixHooks[t]=s.event.keyHooks);A.test(t)&&(s.event.fixHooks[t]=s.event.mouseHooks)});(function(){function S(e,t,n,i,s,o){for(var u=0,a=i.length;u0){l=f;break}}f=f[e]}i[u]=l}}}var e=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,r="sizcache"+(Math.random()+"").replace(".",""),i=0,o=Object.prototype.toString,u=!1,a=!0,f=/\\/g,l=/\r\n/g,c=/\W/;[0,0].sort(function(){a=!1;return 0});var h=function(t,r,i,s){i=i||[];r=r||n;var u=r;if(r.nodeType!==1&&r.nodeType!==9)return[];if(!t||typeof t!="string")return i;var a,f,l,c,p,m,g,b,w=!0,E=h.isXML(r),S=[],x=t;do{e.exec("");a=e.exec(x);if(a){x=a[3];S.push(a[1]);if(a[2]){c=a[3];break}}}while(a);if(S.length>1&&v.exec(t))if(S.length===2&&d.relative[S[0]])f=T(S[0]+S[1],r,s);else{f=d.relative[S[0]]?[r]:h(S.shift(),r);while(S.length){t=S.shift();d.relative[t]&&(t+=S.shift());f=T(t,f,s)}}else{if(!s&&S.length>1&&r.nodeType===9&&!E&&d.match.ID.test(S[0])&&!d.match.ID.test(S[S.length-1])){p=h.find(S.shift(),r,E);r=p.expr?h.filter(p.expr,p.set)[0]:p.set[0]}if(r){p=s?{expr:S.pop(),set:y(s)}:h.find(S.pop(),S.length!==1||S[0]!=="~"&&S[0]!=="+"||!r.parentNode?r:r.parentNode,E);f=p.expr?h.filter(p.expr,p.set):p.set;S.length>0?l=y(f):w=!1;while(S.length){m=S.pop();g=m;d.relative[m]?g=S.pop():m="";g==null&&(g=r);d.relative[m](l,g,E)}}else l=S=[]}l||(l=f);l||h.error(m||t);if(o.call(l)==="[object Array]")if(!w)i.push.apply(i,l);else if(r&&r.nodeType===1)for(b=0;l[b]!=null;b++)l[b]&&(l[b]===!0||l[b].nodeType===1&&h.contains(r,l[b]))&&i.push(f[b]);else for(b=0;l[b]!=null;b++)l[b]&&l[b].nodeType===1&&i.push(f[b]);else y(l,i);if(c){h(c,u,i,s);h.uniqueSort(i)}return i};h.uniqueSort=function(e){if(w){u=a;e.sort(w);if(u)for(var t=1;t0};h.find=function(e,t,n){var r,i,s,o,u,a;if(!e)return[];for(i=0,s=d.order.length;i":function(e,t){var n,r=typeof t=="string",i=0,s=e.length;if(r&&!c.test(t)){t=t.toLowerCase();for(;i=0)?n||r.push(u):n&&(t[o]=!1));return!1},ID:function(e){return e[1].replace(f,"")},TAG:function(e,t){return e[1].replace(f,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){e[2]||h.error(e[0]);e[2]=e[2].replace(/^\+|\s*/g,"");var t=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=t[1]+(t[2]||1)-0;e[3]=t[3]-0}else e[2]&&h.error(e[0]);e[0]=i++;return e},ATTR:function(e,t,n,r,i,s){var o=e[1]=e[1].replace(f,"");!s&&d.attrMap[o]&&(e[1]=d.attrMap[o]);e[4]=(e[4]||e[5]||"").replace(f,"");e[2]==="~="&&(e[4]=" "+e[4]+" ");return e},PSEUDO:function(t,n,r,i,s){if(t[1]==="not"){if(!((e.exec(t[3])||"").length>1||/^\w/.test(t[3]))){var o=h.filter(t[3],n,r,!0^s);r||i.push.apply(i,o);return!1}t[3]=h(t[3],null,null,n)}else if(d.match.POS.test(t[0])||d.match.CHILD.test(t[0]))return!0;return t},POS:function(e){e.unshift(!0);return e}},filters:{enabled:function(e){return e.disabled===!1&&e.type!=="hidden"},disabled:function(e){return e.disabled===!0},checked:function(e){return e.checked===!0},selected:function(e){e.parentNode&&e.parentNode.selectedIndex;return e.selected===!0},parent:function(e){return!!e.firstChild},empty:function(e){return!e.firstChild},has:function(e,t,n){return!!h(n[3],e).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){var t=e.getAttribute("type"),n=e.type;return e.nodeName.toLowerCase()==="input"&&"text"===n&&(t===n||t===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(e){var t=e.nodeName.toLowerCase();return(t==="input"||t==="button")&&"submit"===e.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(e){var t=e.nodeName.toLowerCase();return(t==="input"||t==="button")&&"reset"===e.type},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&"button"===e.type||t==="button"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(e,t){return t===0},last:function(e,t,n,r){return t===r.length-1},even:function(e,t){return t%2===0},odd:function(e,t){return t%2===1},lt:function(e,t,n){return tn[3]-0},nth:function(e,t,n){return n[3]-0===t},eq:function(e,t,n){return n[3]-0===t}},filter:{PSEUDO:function(e,t,n,r){var i=t[1],s=d.filters[i];if(s)return s(e,n,t,r);if(i==="contains")return(e.textContent||e.innerText||p([e])||"").indexOf(t[3])>=0;if(i==="not"){var o=t[3];for(var u=0,a=o.length;u=0}},ID:function(e,t){return e.nodeType===1&&e.getAttribute("id")===t},TAG:function(e,t){return t==="*"&&e.nodeType===1||!!e.nodeName&&e.nodeName.toLowerCase()===t},CLASS:function(e,t){return(" "+(e.className||e.getAttribute("class"))+" ").indexOf(t)>-1},ATTR:function(e,t){var n=t[1],r=h.attr?h.attr(e,n):d.attrHandle[n]?d.attrHandle[n](e):e[n]!=null?e[n]:e.getAttribute(n),i=r+"",s=t[2],o=t[4];return r==null?s==="!=":!s&&h.attr?r!=null:s==="="?i===o:s==="*="?i.indexOf(o)>=0:s==="~="?(" "+i+" ").indexOf(o)>=0:o?s==="!="?i!==o:s==="^="?i.indexOf(o)===0:s==="$="?i.substr(i.length-o.length)===o:s==="|="?i===o||i.substr(0,o.length+1)===o+"-":!1:i&&r!==!1},POS:function(e,t,n,r){var i=t[2],s=d.setFilters[i];if(s)return s(e,n,t,r)}}},v=d.match.POS,m=function(e,t){return"\\"+(t-0+1)};for(var g in d.match){d.match[g]=new RegExp(d.match[g].source+/(?![^\[]*\])(?![^\(]*\))/.source);d.leftMatch[g]=new RegExp(/(^(?:.|\r|\n)*?)/.source+d.match[g].source.replace(/\\(\d+)/g,m))}var y=function(e,t){e=Array.prototype.slice.call(e,0);if(t){t.push.apply(t,e);return t}return e};try{Array.prototype.slice.call(n.documentElement.childNodes,0)[0].nodeType}catch(b){y=function(e,t){var n=0,r=t||[];if(o.call(e)==="[object Array]")Array.prototype.push.apply(r,e);else if(typeof e.length=="number")for(var i=e.length;n";i.insertBefore(e,i.firstChild);if(n.getElementById(r)){d.find.ID=function(e,n,r){if(typeof n.getElementById!="undefined"&&!r){var i=n.getElementById(e[1]);return i?i.id===e[1]||typeof i.getAttributeNode!="undefined"&&i.getAttributeNode("id").nodeValue===e[1]?[i]:t:[]}};d.filter.ID=function(e,t){var n=typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id");return e.nodeType===1&&n&&n.nodeValue===t}}i.removeChild(e);i=e=null})();(function(){var e=n.createElement("div");e.appendChild(n.createComment(""));e.getElementsByTagName("*").length>0&&(d.find.TAG=function(e,t){var n=t.getElementsByTagName(e[1]);if(e[1]==="*"){var r=[];for(var i=0;n[i];i++)n[i].nodeType===1&&r.push(n[i]);n=r}return n});e.innerHTML="";e.firstChild&&typeof e.firstChild.getAttribute!="undefined"&&e.firstChild.getAttribute("href")!=="#"&&(d.attrHandle.href=function(e){return e.getAttribute("href",2)});e=null})();n.querySelectorAll&&function(){var e=h,t=n.createElement("div"),r="__sizzle__";t.innerHTML="

";if(t.querySelectorAll&&t.querySelectorAll(".TEST").length===0)return;h=function(t,i,s,o){i=i||n;if(!o&&!h.isXML(i)){var u=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(t);if(u&&(i.nodeType===1||i.nodeType===9)){if(u[1])return y(i.getElementsByTagName(t),s);if(u[2]&&d.find.CLASS&&i.getElementsByClassName)return y(i.getElementsByClassName(u[2]),s)}if(i.nodeType===9){if(t==="body"&&i.body)return y([i.body],s);if(u&&u[3]){var a=i.getElementById(u[3]);if(!a||!a.parentNode)return y([],s);if(a.id===u[3])return y([a],s)}try{return y(i.querySelectorAll(t),s)}catch(f){}}else if(i.nodeType===1&&i.nodeName.toLowerCase()!=="object"){var l=i,c=i.getAttribute("id"),p=c||r,v=i.parentNode,m=/^\s*[+~]/.test(t);c?p=p.replace(/'/g,"\\$&"):i.setAttribute("id",p);m&&v&&(i=i.parentNode);try{if(!m||v)return y(i.querySelectorAll("[id='"+p+"'] "+t),s)}catch(g){}finally{c||l.removeAttribute("id")}}}return e(t,i,s,o)};for(var i in e)h[i]=e[i];t=null}();(function(){var e=n.documentElement,t=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(t){var r=!t.call(n.createElement("div"),"div"),i=!1;try{t.call(n.documentElement,"[test!='']:sizzle")}catch(s){i=!0}h.matchesSelector=function(e,n){n=n.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!h.isXML(e))try{if(i||!d.match.PSEUDO.test(n)&&!/!=/.test(n)){var s=t.call(e,n);if(s||!r||e.document&&e.document.nodeType!==11)return s}}catch(o){}return h(n,null,null,[e]).length>0}}})();(function(){var e=n.createElement("div");e.innerHTML="
";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0)return;e.lastChild.className="e";if(e.getElementsByClassName("e").length===1)return;d.order.splice(1,0,"CLASS");d.find.CLASS=function(e,t,n){if(typeof t.getElementsByClassName!="undefined"&&!n)return t.getElementsByClassName(e[1])};e=null})();n.documentElement.contains?h.contains=function(e,t){return e!==t&&(e.contains?e.contains(t):!0)}:n.documentElement.compareDocumentPosition?h.contains=function(e,t){return!!(e.compareDocumentPosition(t)&16)}:h.contains=function(){return!1};h.isXML=function(e){var t=(e?e.ownerDocument||e:0).documentElement;return t?t.nodeName!=="HTML":!1};var T=function(e,t,n){var r,i=[],s="",o=t.nodeType?[t]:t;while(r=d.match.PSEUDO.exec(e)){s+=r[0];e=e.replace(d.match.PSEUDO,"")}e=d.relative[e]?e+"*":e;for(var u=0,a=o.length;u0)for(u=o;u=0:s.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n=[],r,i,o=this[0];if(s.isArray(e)){var u=1;while(o&&o.ownerDocument&&o!==t){for(r=0;r-1:s.find.matchesSelector(o,e)){n.push(o);break}o=o.parentNode;if(!o||!o.ownerDocument||o===t||o.nodeType===11)break}}n=n.length>1?s.unique(n):n;return this.pushStack(n,"closest",e)},index:function(e){return e?typeof e=="string"?s.inArray(this[0],s(e)):s.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?s(e,t):s.makeArray(e&&e.nodeType?[e]:e),r=s.merge(this.get(),n);return this.pushStack(W(n[0])||W(r[0])?r:s.unique(r))},andSelf:function(){return this.add(this.prevObject)}});s.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return s.dir(e,"parentNode")},parentsUntil:function(e,t,n){return s.dir(e,"parentNode",n)},next:function(e){return s.nth(e,2,"nextSibling")},prev:function(e){return s.nth(e,2,"previousSibling")},nextAll:function(e){return s.dir(e,"nextSibling")},prevAll:function(e){return s.dir(e,"previousSibling")},nextUntil:function(e,t,n){return s.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return s.dir(e,"previousSibling",n)},siblings:function(e){return s.sibling(e.parentNode.firstChild,e)},children:function(e){return s.sibling(e.firstChild)},contents:function(e){return s.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:s.makeArray(e.childNodes)}},function(e,t){s.fn[e]=function(n,r){var i=s.map(this,t,n);j.test(e)||(r=n);r&&typeof r=="string"&&(i=s.filter(r,i));i=this.length>1&&!z[e]?s.unique(i):i;(this.length>1||I.test(r))&&F.test(e)&&(i=i.reverse());return this.pushStack(i,e,R.call(arguments).join(","))}});s.extend({filter:function(e,t,n){n&&(e=":not("+e+")");return t.length===1?s.find.matchesSelector(t[0],e)?[t[0]]:[]:s.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&o.nodeType!==9&&(r===t||o.nodeType!==1||!s(o).is(r))){o.nodeType===1&&i.push(o);o=o[n]}return i},nth:function(e,t,n,r){t=t||1;var i=0;for(;e;e=e[n])if(e.nodeType===1&&++i===t)break;return e},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var $="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",J=/ jQuery\d+="(?:\d+|null)"/g,K=/^\s+/,Q=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,G=/<([\w:]+)/,Y=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},ut=V(n);ot.optgroup=ot.option;ot.tbody=ot.tfoot=ot.colgroup=ot.caption=ot.thead;ot.th=ot.td;s.support.htmlSerialize||(ot._default=[1,"div
","
"]);s.fn.extend({text:function(e){return s.isFunction(e)?this.each(function(t){var n=s(this);n.text(e.call(this,t,n.text()))}):typeof e!="object"&&e!==t?this.empty().append((this[0]&&this[0].ownerDocument||n).createTextNode(e)):s.text(this)},wrapAll:function(e){if(s.isFunction(e))return this.each(function(t){s(this).wrapAll(e.call(this,t))});if(this[0]){var t=s(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]);t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return s.isFunction(e)?this.each(function(t){s(this).wrapInner(e.call(this,t))}):this.each(function(){var t=s(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=s.isFunction(e);return this.each(function(n){s(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){s.nodeName(this,"body")||s(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){this.nodeType===1&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){this.nodeType===1&&this.insertBefore(e,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=s.clean(arguments);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,s.clean(arguments));return e}}, -remove:function(e,t){for(var n=0,r;(r=this[n])!=null;n++)if(!e||s.filter(e,[r]).length){if(!t&&r.nodeType===1){s.cleanData(r.getElementsByTagName("*"));s.cleanData([r])}r.parentNode&&r.parentNode.removeChild(r)}return this},empty:function(){for(var e=0,t;(t=this[e])!=null;e++){t.nodeType===1&&s.cleanData(t.getElementsByTagName("*"));while(t.firstChild)t.removeChild(t.firstChild)}return this},clone:function(e,t){e=e==null?!1:e;t=t==null?e:t;return this.map(function(){return s.clone(this,e,t)})},html:function(e){if(e===t)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(J,""):null;if(typeof e=="string"&&!et.test(e)&&(s.support.leadingWhitespace||!K.test(e))&&!ot[(G.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Q,"<$1>");try{for(var n=0,r=this.length;n1&&c0?this.clone(!0):this).get();s(i[u])[t](f);r=r.concat(f)}return this.pushStack(r,e,i.selector)}});s.extend({clone:function(e,t,n){var r,i,o,u=s.support.html5Clone||!nt.test("<"+e.nodeName)?e.cloneNode(!0):dt(e);if((!s.support.noCloneEvent||!s.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!s.isXMLDoc(e)){lt(e,u);r=ct(e);i=ct(u);for(o=0;r[o];++o)i[o]&<(r[o],i[o])}if(t){ft(e,u);if(n){r=ct(e);i=ct(u);for(o=0;r[o];++o)ft(r[o],i[o])}}r=i=null;return u},clean:function(e,t,r,i){var o;t=t||n;typeof t.createElement=="undefined"&&(t=t.ownerDocument||t[0]&&t[0].ownerDocument||n);var u=[],a;for(var f=0,l;(l=e[f])!=null;f++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!Z.test(l))l=t.createTextNode(l);else{l=l.replace(Q,"<$1>");var c=(G.exec(l)||["",""])[1].toLowerCase(),h=ot[c]||ot._default,p=h[0],d=t.createElement("div");t===n?ut.appendChild(d):V(t).appendChild(d);d.innerHTML=h[1]+l+h[2];while(p--)d=d.lastChild;if(!s.support.tbody){var v=Y.test(l),m=c==="table"&&!v?d.firstChild&&d.firstChild.childNodes:h[1]===""&&!v?d.childNodes:[];for(a=m.length-1;a>=0;--a)s.nodeName(m[a],"tbody")&&!m[a].childNodes.length&&m[a].parentNode.removeChild(m[a])}!s.support.leadingWhitespace&&K.test(l)&&d.insertBefore(t.createTextNode(K.exec(l)[0]),d.firstChild);l=d.childNodes}var g;if(!s.support.appendChecked)if(l[0]&&typeof (g=l.length)=="number")for(a=0;a=0)return t+"px"}}});s.support.opacity||(s.cssHooks.opacity={get:function(e,t){return gt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?parseFloat(RegExp.$1)/100+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=s.isNumeric(t)?"alpha(opacity="+t*100+")":"",o=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&s.trim(o.replace(mt,""))===""){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=mt.test(o)?o.replace(mt,i):o+" "+i}});s(function(){s.support.reliableMarginRight||(s.cssHooks.marginRight={get:function(e,t){var n;s.swap(e,{display:"inline-block"},function(){t?n=Nt(e,"margin-right","marginRight"):n=e.style.marginRight});return n}})});n.defaultView&&n.defaultView.getComputedStyle&&(Ct=function(e,t){var n,r,i;t=t.replace(yt,"-$1").toLowerCase();if((r=e.ownerDocument.defaultView)&&(i=r.getComputedStyle(e,null))){n=i.getPropertyValue(t);n===""&&!s.contains(e.ownerDocument.documentElement,e)&&(n=s.style(e,t))}return n});n.documentElement.currentStyle&&(kt=function(e,t){var n,r,i,s=e.currentStyle&&e.currentStyle[t],o=e.style;s===null&&o&&(i=o[t])&&(s=i);if(!bt.test(s)&&wt.test(s)){n=o.left;r=e.runtimeStyle&&e.runtimeStyle.left;r&&(e.runtimeStyle.left=e.currentStyle.left);o.left=t==="fontSize"?"1em":s||0;s=o.pixelLeft+"px";o.left=n;r&&(e.runtimeStyle.left=r)}return s===""?"auto":s});Nt=Ct||kt;if(s.expr&&s.expr.filters){s.expr.filters.hidden=function(e){var t=e.offsetWidth,n=e.offsetHeight;return t===0&&n===0||!s.support.reliableHiddenOffsets&&(e.style&&e.style.display||s.css(e,"display"))==="none"};s.expr.filters.visible=function(e){return!s.expr.filters.hidden(e)}}var At=/%20/g,Ot=/\[\]$/,Mt=/\r?\n/g,_t=/#.*$/,Dt=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,Pt=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Ht=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Bt=/^(?:GET|HEAD)$/,jt=/^\/\//,Ft=/\?/,It=/)<[^<]*)*<\/script>/gi,qt=/^(?:select|textarea)/i,Rt=/\s+/,Ut=/([?&])_=[^&]*/,zt=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,Wt=s.fn.load,Xt={},Vt={},$t,Jt,Kt=["*/"]+["*"];try{$t=i.href}catch(Qt){$t=n.createElement("a");$t.href="";$t=$t.href}Jt=zt.exec($t.toLowerCase())||[];s.fn.extend({load:function(e,n,r){if(typeof e!="string"&&Wt)return Wt.apply(this,arguments);if(!this.length)return this;var i=e.indexOf(" ");if(i>=0){var o=e.slice(i,e.length);e=e.slice(0,i)}var u="GET";if(n)if(s.isFunction(n)){r=n;n=t}else if(typeof n=="object"){n=s.param(n,s.ajaxSettings.traditional);u="POST"}var a=this;s.ajax({url:e,type:u,dataType:"html",data:n,complete:function(e,t,n){n=e.responseText;if(e.isResolved()){e.done(function(e){n=e});a.html(o?s("
").append(n.replace(It,"")).find(o):n)}r&&a.each(r,[n,t,e])}});return this},serialize:function(){return s.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?s.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||qt.test(this.nodeName)||Pt.test(this.type))}).map(function(e,t){var n=s(this).val();return n==null?null:s.isArray(n)?s.map(n,function(e,n){return{name:t.name,value:e.replace(Mt,"\r\n")}}):{name:t.name,value:n.replace(Mt,"\r\n")}}).get()}});s.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){s.fn[t]=function(e){return this.on(t,e)}});s.each(["get","post"],function(e,n){s[n]=function(e,r,i,o){if(s.isFunction(r)){o=o||i;i=r;r=t}return s.ajax({type:n,url:e,data:r,success:i,dataType:o})}});s.extend({getScript:function(e,n){return s.get(e,t,n,"script")},getJSON:function(e,t,n){return s.get(e,t,n,"json")},ajaxSetup:function(e,t){if(t)Zt(e,s.ajaxSettings);else{t=e;e=s.ajaxSettings}Zt(e,t);return e},ajaxSettings:{url:$t,isLocal:Ht.test(Jt[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Kt},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":s.parseJSON,"text xml":s.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Gt(Xt),ajaxTransport:Gt(Vt),ajax:function(e,n){function S(e,n,c,h){if(y===2)return;y=2;m&&clearTimeout(m);v=t;p=h||"";E.readyState=e>0?4:0;var d,g,w,S=n,x=c?tn(r,E,c):t,T,N;if(e>=200&&e<300||e===304){if(r.ifModified){if(T=E.getResponseHeader("Last-Modified"))s.lastModified[l]=T;if(N=E.getResponseHeader("Etag"))s.etag[l]=N}if(e===304){S="notmodified";d=!0}else try{g=nn(r,x);S="success";d=!0}catch(C){S="parsererror";w=C}}else{w=S;if(!S||e){S="error";e<0&&(e=0)}}E.status=e;E.statusText=""+(n||S);d?u.resolveWith(i,[g,S,E]):u.rejectWith(i,[E,S,w]);E.statusCode(f);f=t;b&&o.trigger("ajax"+(d?"Success":"Error"),[E,r,d?g:w]);a.fireWith(i,[E,S]);if(b){o.trigger("ajaxComplete",[E,r]);--s.active||s.event.trigger("ajaxStop")}}if(typeof e=="object"){n=e;e=t}n=n||{};var r=s.ajaxSetup({},n),i=r.context||r,o=i!==r&&(i.nodeType||i instanceof s)?s(i):s.event,u=s.Deferred(),a=s.Callbacks("once memory"),f=r.statusCode||{},l,c={},h={},p,d,v,m,g,y=0,b,w,E={readyState:0,setRequestHeader:function(e,t){if(!y){var n=e.toLowerCase();e=h[n]=h[n]||e;c[e]=t}return this},getAllResponseHeaders:function(){return y===2?p:null},getResponseHeader:function(e){var n;if(y===2){if(!d){d={};while(n=Dt.exec(p))d[n[1].toLowerCase()]=n[2]}n=d[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){y||(r.mimeType=e);return this},abort:function(e){e=e||"abort";v&&v.abort(e);S(0,e);return this}};u.promise(E);E.success=E.done;E.error=E.fail;E.complete=a.add;E.statusCode=function(e){if(e){var t;if(y<2)for(t in e)f[t]=[f[t],e[t]];else{t=e[E.status];E.then(t,t)}}return this};r.url=((e||r.url)+"").replace(_t,"").replace(jt,Jt[1]+"//");r.dataTypes=s.trim(r.dataType||"*").toLowerCase().split(Rt);if(r.crossDomain==null){g=zt.exec(r.url.toLowerCase());r.crossDomain=!(!g||g[1]==Jt[1]&&g[2]==Jt[2]&&(g[3]||(g[1]==="http:"?80:443))==(Jt[3]||(Jt[1]==="http:"?80:443)))}r.data&&r.processData&&typeof r.data!="string"&&(r.data=s.param(r.data,r.traditional));Yt(Xt,r,n,E);if(y===2)return!1;b=r.global;r.type=r.type.toUpperCase();r.hasContent=!Bt.test(r.type);b&&s.active++===0&&s.event.trigger("ajaxStart");if(!r.hasContent){if(r.data){r.url+=(Ft.test(r.url)?"&":"?")+r.data;delete r.data}l=r.url;if(r.cache===!1){var x=s.now(),T=r.url.replace(Ut,"$1_="+x);r.url=T+(T===r.url?(Ft.test(r.url)?"&":"?")+"_="+x:"")}}(r.data&&r.hasContent&&r.contentType!==!1||n.contentType)&&E.setRequestHeader("Content-Type",r.contentType);if(r.ifModified){l=l||r.url;s.lastModified[l]&&E.setRequestHeader("If-Modified-Since",s.lastModified[l]);s.etag[l]&&E.setRequestHeader("If-None-Match",s.etag[l])}E.setRequestHeader("Accept",r.dataTypes[0]&&r.accepts[r.dataTypes[0]]?r.accepts[r.dataTypes[0]]+(r.dataTypes[0]!=="*"?", "+Kt+"; q=0.01":""):r.accepts["*"]);for(w in r.headers)E.setRequestHeader(w,r.headers[w]);if(!r.beforeSend||r.beforeSend.call(i,E,r)!==!1&&y!==2){for(w in{success:1,error:1,complete:1})E[w](r[w]);v=Yt(Vt,r,n,E);if(!v)S(-1,"No Transport");else{E.readyState=1;b&&o.trigger("ajaxSend",[E,r]);r.async&&r.timeout>0&&(m=setTimeout(function(){E.abort("timeout")},r.timeout));try{y=1;v.send(c,S)}catch(N){if(!(y<2))throw N;S(-1,N)}}return E}E.abort();return!1},param:function(e,n){var r=[],i=function(e,t){t=s.isFunction(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=s.ajaxSettings.traditional);if(s.isArray(e)||e.jquery&&!s.isPlainObject(e))s.each(e,function(){i(this.name,this.value)});else for(var o in e)en(o,e[o],n,i);return r.join("&").replace(At,"+")}});s.extend({active:0,lastModified:{},etag:{}});var rn=s.now(),sn=/(\=)\?(&|$)|\?\?/i;s.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return s.expando+"_"+rn++}});s.ajaxPrefilter("json jsonp",function(t,n,r){var i=t.contentType==="application/x-www-form-urlencoded"&&typeof t.data=="string";if(t.dataTypes[0]==="jsonp"||t.jsonp!==!1&&(sn.test(t.url)||i&&sn.test(t.data))){var o,u=t.jsonpCallback=s.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a=e[u],f=t.url,l=t.data,c="$1"+u+"$2";if(t.jsonp!==!1){f=f.replace(sn,c);if(t.url===f){i&&(l=l.replace(sn,c));t.data===l&&(f+=(/\?/.test(f)?"&":"?")+t.jsonp+"="+u)}}t.url=f;t.data=l;e[u]=function(e){o=[e]};r.always(function(){e[u]=a;o&&s.isFunction(a)&&e[u](o[0])});t.converters["script json"]=function(){o||s.error(u+" was not called");return o[0]};t.dataTypes[0]="json";return"script"}});s.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){s.globalEval(e);return e}}});s.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1);if(e.crossDomain){e.type="GET";e.global=!1}});s.ajaxTransport("script",function(e){if(e.crossDomain){var r,i=n.head||n.getElementsByTagName("head")[0]||n.documentElement;return{send:function(s,o){r=n.createElement("script");r.async="async";e.scriptCharset&&(r.charset=e.scriptCharset);r.src=e.url;r.onload=r.onreadystatechange=function(e,n){if(n||!r.readyState||/loaded|complete/.test(r.readyState)){r.onload=r.onreadystatechange=null;i&&r.parentNode&&i.removeChild(r);r=t;n||o(200,"success")}};i.insertBefore(r,i.firstChild)},abort:function(){r&&r.onload(0,1)}}}});var on=e.ActiveXObject?function(){for(var e in an)an[e](0,1)}:!1,un=0,an;s.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&fn()||ln()}:fn;(function(e){s.extend(s.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})})(s.ajaxSettings.xhr());s.support.ajax&&s.ajaxTransport(function(n){if(!n.crossDomain||s.support.cors){var r;return{send:function(i,o){var u=n.xhr(),a,f;n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async);if(n.xhrFields)for(f in n.xhrFields)u[f]=n.xhrFields[f];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType);!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(f in i)u.setRequestHeader(f,i[f])}catch(l){}u.send(n.hasContent&&n.data||null);r=function(e,i){var f,l,c,h,p;try{if(r&&(i||u.readyState===4)){r=t;if(a){u.onreadystatechange=s.noop;on&&delete an[a]}if(i)u.readyState!==4&&u.abort();else{f=u.status;c=u.getAllResponseHeaders();h={};p=u.responseXML;p&&p.documentElement&&(h.xml=p);h.text=u.responseText;try{l=u.statusText}catch(d){l=""}!f&&n.isLocal&&!n.crossDomain?f=h.text?200:404:f===1223&&(f=204)}}}catch(v){i||o(-1,v)}h&&o(f,l,h,c)};if(!n.async||u.readyState===4)r();else{a=++un;if(on){if(!an){an={};s(e).unload(on)}an[a]=r}u.onreadystatechange=r}},abort:function(){r&&r(0,1)}}}});var cn={},hn,pn,dn=/^(?:toggle|show|hide)$/,vn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,mn,gn=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],yn;s.fn.extend({show:function(e,t,n){var r,i;if(e||e===0)return this.animate(En("show",3),e,t,n);for(var o=0,u=this.length;o=a.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();a.animatedProperties[this.prop]=!0;for(t in a.animatedProperties)a.animatedProperties[t]!==!0&&(o=!1);if(o){a.overflow!=null&&!s.support.shrinkWrapBlocks&&s.each(["","X","Y"],function(e,t){u.style["overflow"+t]=a.overflow[e]});a.hide&&s(u).hide();if(a.hide||a.show)for(t in a.animatedProperties){s.style(u,t,a.orig[t]);s.removeData(u,"fxshow"+t,!0);s.removeData(u,"toggle"+t,!0)}r=a.complete;if(r){a.complete=!1;r.call(u)}}return!1}if(a.duration==Infinity)this.now=i;else{n=i-this.startTime;this.state=n/a.duration;this.pos=s.easing[a.animatedProperties[this.prop]](this.state,n,0,1,a.duration);this.now=this.start+(this.end-this.start)*this.pos}this.update();return!0}};s.extend(s.fx,{tick:function(){var e,t=s.timers,n=0;for(;n-1,l={},c={},h,p;if(f){c=i.position();h=c.top;p=c.left}else{h=parseFloat(u)||0;p=parseFloat(a)||0}s.isFunction(t)&&(t=t.call(e,n,o));t.top!=null&&(l.top=t.top-o.top+h);t.left!=null&&(l.left=t.left-o.left+p);"using"in t?t.using.call(e,l):i.css(l)}};s.fn.extend({position:function(){if(!this[0])return null;var e=this[0],t=this.offsetParent(),n=this.offset(),r=Tn.test(t[0].nodeName)?{top:0,left:0}:t.offset();n.top-=parseFloat(s.css(e,"marginTop"))||0;n.left-=parseFloat(s.css(e,"marginLeft"))||0;r.top+=parseFloat(s.css(t[0],"borderTopWidth"))||0;r.left+=parseFloat(s.css(t[0],"borderLeftWidth"))||0;return{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||n.body;while(e&&!Tn.test(e.nodeName)&&s.css(e,"position")==="static")e=e.offsetParent;return e})}});s.each(["Left","Top"],function(e,n){var r="scroll"+n;s.fn[r]=function(n){var i,o;if(n===t){i=this[0];if(!i)return null;o=Nn(i);return o?"pageXOffset"in o?o[e?"pageYOffset":"pageXOffset"]:s.support.boxModel&&o.document.documentElement[r]||o.document.body[r]:i[r]}return this.each(function(){o=Nn(this);o?o.scrollTo(e?s(o).scrollLeft():n,e?n:s(o).scrollTop()):this[r]=n})}});s.each(["Height","Width"],function(e,n){var r=n.toLowerCase();s.fn["inner"+n]=function(){var e=this[0];return e?e.style?parseFloat(s.css(e,r,"padding")):this[r]():null};s.fn["outer"+n]=function(e){var t=this[0];return t?t.style?parseFloat(s.css(t,r,e?"margin":"border")):this[r]():null};s.fn[r]=function(e){var i=this[0];if(!i)return e==null?null:this;if(s.isFunction(e))return this.each(function(t){var n=s(this);n[r](e.call(this,t,n[r]()))});if(s.isWindow(i)){var o=i.document.documentElement["client"+n],u=i.document.body;return i.document.compatMode==="CSS1Compat"&&o||u&&u["client"+n]||o}if(i.nodeType===9)return Math.max(i.documentElement["client"+n],i.body["scroll"+n],i.documentElement["scroll"+n],i.body["offset"+n],i.documentElement["offset"+n]);if(e===t){var a=s.css(i,r),f=parseFloat(a);return s.isNumeric(f)?f:a}return this.css(r,typeof e=="string"?e:e+"px")}});e.jQuery=e.$=s;typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return s})})(window);(function(e,t){typeof jQuery=="undefined"&&alert("Hashgrid: jQuery not loaded. Make sure it's linked to your pages.");var n=function(t){function x(e){if(n.modifierKey==null)return!0;var t=!0;switch(n.modifierKey){case"ctrl":t=e.ctrlKey?e.ctrlKey:!1;break;case"alt":t=e.altKey?e.altKey:!1;break;case"shift":t=e.shiftKey?e.shiftKey:!1}return t}function T(e){var t=!1,n=e.keyCode?e.keyCode:e.which;n==13?t="enter":t=String.fromCharCode(n).toLowerCase();return t}function N(){A(n.cookiePrefix+n.id,(E?"1":"0")+"-"+v+"-"+r,1)}function C(){l.show()}function k(e){var t,i,s=e.target.tagName.toLowerCase();if(s=="input"||s=="textarea"||s=="select")return!0;i=x(e);if(!i)return!0;t=T(e);if(!t)return!0;switch(t){case n.showGridKey:if(!p){C();p=!0}else if(E){l.hide();p=!1;E=!1;N()}break;case n.holdGridKey:if(p&&!E){E=!0;N()}break;case n.foregroundKey:if(p){if(l.css("z-index")==g){l.css("z-index",m);v="B"}else{l.css("z-index",g);v="F"}N()}break;case n.jumpGridsKey:if(p&&n.numberOfGrids>1){l.removeClass(n.classPrefix+r);r++;r>n.numberOfGrids&&(r=1);l.addClass(n.classPrefix+r);C();/webkit/.test(navigator.userAgent.toLowerCase())&&_();N()}}return!0}function L(e){var t,r=x(e);if(!r)return!0;t=T(e);if(t&&t==n.showGridKey&&!E){l.hide();p=!1}return!0}function A(e,t,n){var r,i="";if(n){r=new Date;r.setTime(r.getTime()+n*24*60*60*1e3);i="; expires="+r.toGMTString()}document.cookie=e+"="+t+i+"; path=/"}function O(e){var t,n=document.cookie.split(";"),r=0,i=n.length,s=e+"=";for(;r0&&e("#"+n.id).remove();h=e("
");h.attr("id",n.id).css({display:"none","pointer-events":"none"});e("body").prepend(h);l=e("#"+n.id);l.css("z-index")=="auto"&&l.css("z-index",m);y=parseFloat(e(document).height());l.height(y);l.append('
');S=l.css("top");l.css({top:"-999px",display:"block"});u=e("#"+n.id+"-horiz");a=u.outerHeight()-1;l.css({display:"none",top:S});if(a<=0)return!1;f=Math.floor(y/a);i="";for(o=f-1;o>=1;o--)i+='
';l.append(i);l.prepend(e('
'));d=l.children(".vert-container");s=l.width();d.css({position:"absolute",top:0});d.append('
');i="";for(o=0;o<50;o++)i+='
';d.append(i);d.children().css({display:"inline-block"}).height(y);c=O(n.cookiePrefix+n.id);if(typeof c=="string"){w=c.split("-");w[2]=Number(w[2]);if(typeof w[2]=="number"&&!isNaN(w[2])){r=w[2].toFixed(0);l.addClass(n.classPrefix+r)}if(w[1]=="F"){v="F";l.css("z-index",g)}if(w[0]=="1"){p=!0;E=!0;C()}}else l.addClass(n.classPrefix+r);e(document).bind("keydown",k);e(document).bind("keyup",L);return{}};e(document).ready(function(){var e=new n({numberOfGrids:3})})})(jQuery); \ No newline at end of file +/*! jQuery v1.8.2 jquery.com | jquery.org/license */(function(e,t){function n(e){var t=dt[e]={};return Y.each(e.split(tt),function(e,n){t[n]=!0}),t}function r(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(mt,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:vt.test(r)?Y.parseJSON(r):r}catch(s){}Y.data(e,n,r)}else r=t}return r}function i(e){var t;for(t in e){if(t==="data"&&Y.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function s(){return!1}function o(){return!0}function u(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function a(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function f(e,t,n){t=t||0;if(Y.isFunction(t))return Y.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return Y.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=Y.grep(e,function(e){return e.nodeType===1});if(Bt.test(t))return Y.filter(t,r,!n);t=Y.filter(t,r)}return Y.grep(e,function(e,r){return Y.inArray(e,t)>=0===n})}function l(e){var t=It.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function c(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function h(e,t){if(t.nodeType!==1||!Y.hasData(e))return;var n,r,i,s=Y._data(e),o=Y._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(R.body),n=t.css("display");t.remove();if(n==="none"||n===""){rn=R.body.appendChild(rn||Y.extend(R.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!sn||!rn.createElement)sn=(rn.contentWindow||rn.contentDocument).document,sn.write(""),sn.close();t=sn.body.appendChild(sn.createElement(e)),n=nn(t,"display"),R.body.removeChild(rn)}return dn[e]=n,n}function x(e,t,n,r){var i;if(Y.isArray(t))Y.each(t,function(t,i){n||En.test(e)?r(e,i):x(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&Y.type(t)==="object")for(i in t)x(e+"["+i+"]",t[i],n,r);else r(e,t)}function T(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(tt),u=0,a=o.length;if(Y.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,it=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,st=/^[\],:{}\s]*$/,ot=/(?:^|:|,)(?:\s*\[)+/g,ut=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,at=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,ft=/^-ms-/,lt=/-([\da-z])/gi,ct=function(e,t){return(t+"").toUpperCase()},ht=function(){R.addEventListener?(R.removeEventListener("DOMContentLoaded",ht,!1),Y.ready()):R.readyState==="complete"&&(R.detachEvent("onreadystatechange",ht),Y.ready())},pt={};Y.fn=Y.prototype={constructor:Y,init:function(e,n,r){var i,s,o,u;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?i=[null,e,null]:i=rt.exec(e);if(i&&(i[1]||!n)){if(i[1])return n=n instanceof Y?n[0]:n,u=n&&n.nodeType?n.ownerDocument||n:R,e=Y.parseHTML(i[1],u,!0),it.test(i[1])&&Y.isPlainObject(n)&&this.attr.call(e,n,!0),Y.merge(this,e);s=R.getElementById(i[2]);if(s&&s.parentNode){if(s.id!==i[2])return r.find(e);this.length=1,this[0]=s}return this.context=R,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return Y.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),Y.makeArray(e,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return $.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=Y.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return Y.each(this,e,t)},ready:function(e){return Y.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack($.apply(this,arguments),"slice",$.call(arguments).join(","))},map:function(e){return this.pushStack(Y.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:V,sort:[].sort,splice:[].splice},Y.fn.init.prototype=Y.fn,Y.extend=Y.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!Y.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;q.resolveWith(R,[Y]),Y.fn.trigger&&Y(R).trigger("ready").off("ready")},isFunction:function(e){return Y.type(e)==="function"},isArray:Array.isArray||function(e){return Y.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):pt[K.call(e)]||"object"},isPlainObject:function(e){if(!e||Y.type(e)!=="object"||e.nodeType||Y.isWindow(e))return!1;try{if(e.constructor&&!Q.call(e,"constructor")&&!Q.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||Q.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||R,(r=it.exec(e))?[t.createElement(r[1])]:(r=Y.buildFragment([e],t,n?null:[]),Y.merge([],(r.cacheable?Y.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=Y.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(st.test(t.replace(ut,"@").replace(at,"]").replace(ot,"")))return(new Function("return "+t))();Y.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&Y.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&et.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ft,"ms-").replace(lt,ct)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||Y.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||Y.isArray(e));if(f)for(;u-1)f.splice(n,1),s&&(n<=u&&u--,n<=a&&a--)}),this},has:function(e){return Y.inArray(e,f)>-1},empty:function(){return f=[],this},disable:function(){return f=l=r=t,this},disabled:function(){return!f},lock:function(){return l=t,r||h.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],f&&(!i||l)&&(s?l.push(t):c(t)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!i}};return h},Y.extend({Deferred:function(e){var t=[["resolve","done",Y.Callbacks("once memory"),"resolved"],["reject","fail",Y.Callbacks("once memory"),"rejected"],["notify","progress",Y.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return Y.Deferred(function(n){Y.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](Y.isFunction(o)?function(){var e=o.apply(this,arguments);e&&Y.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?Y.extend(e,r):r}},i={};return r.pipe=r.then,Y.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=$.call(arguments),r=n.length,i=r!==1||e&&Y.isFunction(e.promise)?r:0,s=i===1?e:Y.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?$.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
a",n=h.getElementsByTagName("*"),r=h.getElementsByTagName("a")[0],r.style.cssText="top:1px;float:left;opacity:.5";if(!n||!n.length)return{};i=R.createElement("select"),s=i.appendChild(R.createElement("option")),o=h.getElementsByTagName("input")[0],t={leadingWhitespace:h.firstChild.nodeType===3,tbody:!h.getElementsByTagName("tbody").length,htmlSerialize:!!h.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:o.value==="on",optSelected:s.selected,getSetAttribute:h.className!=="t",enctype:!!R.createElement("form").enctype,html5Clone:R.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:R.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,i.disabled=!0,t.optDisabled=!s.disabled;try{delete h.test}catch(p){t.deleteExpando=!1}!h.addEventListener&&h.attachEvent&&h.fireEvent&&(h.attachEvent("onclick",c=function(){t.noCloneEvent=!1}),h.cloneNode(!0).fireEvent("onclick"),h.detachEvent("onclick",c)),o=R.createElement("input"),o.value="t",o.setAttribute("type","radio"),t.radioValue=o.value==="t",o.setAttribute("checked","checked"),o.setAttribute("name","t"),h.appendChild(o),u=R.createDocumentFragment(),u.appendChild(h.lastChild),t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=o.checked,u.removeChild(o),u.appendChild(h);if(h.attachEvent)for(f in{submit:!0,change:!0,focusin:!0})a="on"+f,l=a in h,l||(h.setAttribute(a,"return;"),l=typeof h[a]=="function"),t[f+"Bubbles"]=l;return Y(function(){var n,r,i,s,o="padding:0;margin:0;border:0;display:block;overflow:hidden;",u=R.getElementsByTagName("body")[0];if(!u)return;n=R.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",u.insertBefore(n,u.firstChild),r=R.createElement("div"),n.appendChild(r),r.innerHTML="
t
",i=r.getElementsByTagName("td"),i[0].style.cssText="padding:0;margin:0;border:0;display:none",l=i[0].offsetHeight===0,i[0].style.display="",i[1].style.display="none",t.reliableHiddenOffsets=l&&i[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=u.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",s=R.createElement("div"),s.style.cssText=r.style.cssText=o,s.style.marginRight=s.style.width="0",r.style.width="1px",r.appendChild(s),t.reliableMarginRight=!parseFloat((e.getComputedStyle(s,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=o+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),u.removeChild(n),n=r=i=s=null}),u.removeChild(h),n=r=i=s=o=u=h=null,t}();var vt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,mt=/([A-Z])/g;Y.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(Y.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?Y.cache[e[Y.expando]]:e[Y.expando],!!e&&!i(e)},data:function(e,n,r,i){if(!Y.acceptData(e))return;var s,o,u=Y.expando,a=typeof n=="string",f=e.nodeType,l=f?Y.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=Y.deletedIds.pop()||Y.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=Y.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=Y.extend(l[c],n):l[c].data=Y.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[Y.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[Y.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!Y.acceptData(e))return;var r,s,o,u=e.nodeType,a=u?Y.cache:e,f=u?e[Y.expando]:Y.expando;if(!a[f])return;if(t){r=n?a[f]:a[f].data;if(r){Y.isArray(t)||(t in r?t=[t]:(t=Y.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(s=0,o=t.length;s1,null,!1))},removeData:function(e){return this.each(function(){Y.removeData(this,e)})}}),Y.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y._data(e,t),n&&(!r||Y.isArray(n)?r=Y._data(e,t,Y.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=Y.queue(e,t),r=n.length,i=n.shift(),s=Y._queueHooks(e,t),o=function(){Y.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y._data(e,n)||Y._data(e,n,{empty:Y.Callbacks("once memory").add(function(){Y.removeData(e,t+"queue",!0),Y.removeData(e,n,!0)})})}}),Y.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){Y.removeAttr(this,e)})},prop:function(e,t){return Y.access(this,Y.prop,e,t,arguments.length>1)},removeProp:function(e){return e=Y.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(Y.isFunction(e))return this.each(function(t){Y(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(tt);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?Y.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return Y.isFunction(e)?this.each(function(n){Y(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=Y(this),u=t,a=e.split(tt);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&Y._data(this,"__className__",this.className),this.className=this.className||e===!1?"":Y._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=Y.valHooks[s.type]||Y.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(Et,""):r==null?"":r);return}return i=Y.isFunction(e),this.each(function(r){var s,o=Y(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":Y.isArray(s)&&(s=Y.map(s,function(e){return e==null?"":e+""})),n=Y.valHooks[this.type]||Y.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),Y.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r,i,s=e.selectedIndex,o=[],u=e.options,a=e.type==="select-one";if(s<0)return null;n=a?s:0,r=a?s+1:u.length;for(;n=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&Y.isFunction(Y.fn[n]))return Y(e)[n](r);if(typeof e.getAttribute=="undefined")return Y.prop(e,n,r);u=a!==1||!Y.isXMLDoc(e),u&&(n=n.toLowerCase(),o=Y.attrHooks[n]||(Nt.test(n)?yt:gt));if(r!==t){if(r===null){Y.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(tt);for(;o=0}})});var kt=/^(?:textarea|input|select)$/i,Lt=/^([^\.]*|)(?:\.(.+)|)$/,At=/(?:^|\s)hover(\.\S+|)\b/,Ot=/^key/,Mt=/^(?:mouse|contextmenu)|click/,_t=/^(?:focusinfocus|focusoutblur)$/,Dt=function(e){return Y.event.special.hover?e:e.replace(At,"mouseenter$1 mouseleave$1")};Y.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,v,m;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=Y._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=Y.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof Y=="undefined"||!!e&&Y.event.triggered===e.type?t:Y.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=Y.trim(Dt(n)).split(" ");for(f=0;f=0&&(m=m.slice(0,-1),u=!0),m.indexOf(".")>=0&&(g=m.split("."),m=g.shift(),g.sort());if((!i||Y.event.customEvent[m])&&!Y.event.global[m])return;n=typeof n=="object"?n[Y.expando]?n:new Y.Event(m,n):new Y.Event(m),n.type=m,n.isTrigger=!0,n.exclusive=u,n.namespace=g.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,c=m.indexOf(":")<0?"on"+m:"";if(!i){o=Y.cache;for(a in o)o[a].events&&o[a].events[m]&&Y.event.trigger(n,r,o[a].handle.elem,!0);return}n.result=t,n.target||(n.target=i),r=r!=null?Y.makeArray(r):[],r.unshift(n),h=Y.event.special[m]||{};if(h.trigger&&h.trigger.apply(i,r)===!1)return;d=[[i,h.bindType||m]];if(!s&&!h.noBubble&&!Y.isWindow(i)){v=h.delegateType||m,f=_t.test(v+m)?i:i.parentNode;for(l=i;f;f=f.parentNode)d.push([f,v]),l=f;l===(i.ownerDocument||R)&&d.push([l.defaultView||l.parentWindow||e,v])}for(a=0;a=0:Y.find(c,this,null,[s]).length),u[c]&&f.push(l);f.length&&y.push({elem:s,matches:f})}p.length>d&&y.push({elem:this,matches:p.slice(d)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Ot.test(t)&&(Y.event.fixHooks[t]=Y.event.keyHooks),Mt.test(t)&&(Y.event.fixHooks[t]=Y.event.mouseHooks)}),function(e,t){function n(e,t,n,r){n=n||[],t=t||M;var i,s,o,u,a=t.nodeType;if(!e||typeof e!="string")return n;if(a!==1&&a!==9)return[];o=E(t);if(!o&&!r)if(i=nt.exec(e))if(u=i[1]){if(a===9){s=t.getElementById(u);if(!s||!s.parentNode)return n;if(s.id===u)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(u))&&S(t,s)&&s.id===u)return n.push(s),n}else{if(i[2])return B.apply(n,j.call(t.getElementsByTagName(e),0)),n;if((u=i[3])&&dt&&t.getElementsByClassName)return B.apply(n,j.call(t.getElementsByClassName(u),0)),n}return v(e.replace(G,"$1"),t,n,r,o)}function r(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function i(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function s(e){return I(function(t){return t=+t,I(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function o(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function u(e,t){var r,i,s,o,u,a,f,l=U[A][e];if(l)return t?0:l.slice(0);u=e,a=[],f=b.preFilter;while(u){if(!r||(i=Z.exec(u)))i&&(u=u.slice(i[0].length)),a.push(s=[]);r=!1;if(i=et.exec(u))s.push(r=new O(i.shift())),u=u.slice(r.length),r.type=i[0].replace(G," ");for(o in b.filter)(i=ft[o].exec(u))&&(!f[o]||(i=f[o](i,M,!0)))&&(s.push(r=new O(i.shift())),u=u.slice(r.length),r.type=o,r.matches=i);if(!r)break}return t?u.length:u?n.error(e):U(e,a).slice(0)}function a(e,t,n){var r=t.dir,i=n&&t.dir==="parentNode",s=P++;return t.first?function(t,n,s){while(t=t[r])if(i||t.nodeType===1)return e(t,n,s)}:function(t,n,o){if(!o){var u,a=D+" "+s+" ",f=a+g;while(t=t[r])if(i||t.nodeType===1){if((u=t[A])===f)return t.sizset;if(typeof u=="string"&&u.indexOf(a)===0){if(t.sizset)return t}else{t[A]=f;if(e(t,n,o))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[r])if(i||t.nodeType===1)if(e(t,n,o))return t}}function f(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function l(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1},o,!0),d=[function(e,n,r){return!s&&(r||n!==C)||((t=n).nodeType?l(e,n,r):p(e,n,r))}];for(;u1&&f(d),u>1&&e.slice(0,u-1).join("").replace(G,"$1"),n,u0,i=e.length>0,s=function(o,u,a,f,c){var h,p,d,v=[],m=0,y="0",w=o&&[],E=c!=null,S=C,x=o||i&&b.find.TAG("*",c&&u.parentNode||u),T=D+=S==null?1:Math.E;E&&(C=u!==M&&u,g=s.el);for(;(h=x[y])!=null;y++){if(i&&h){for(p=0;d=e[p];p++)if(d(h,u,a)){f.push(h);break}E&&(D=T,g=++s.el)}r&&((h=!d&&h)&&m--,o&&w.push(h))}m+=y;if(r&&y!==m){for(p=0;d=t[p];p++)d(w,v,u,a);if(o){if(m>0)while(y--)!w[y]&&!v[y]&&(v[y]=H.call(f));v=l(v)}B.apply(f,v),E&&!o&&v.length>0&&m+t.length>1&&n.uniqueSort(f)}return E&&(D=T,C=S),w};return s.el=0,r?I(s):s}function d(e,t,r,i){var s=0,o=t.length;for(;s2&&(a=o[0]).type==="ID"&&t.nodeType===9&&!i&&b.relative[o[1].type]){t=b.find.ID(a.matches[0].replace(at,""),t,i)[0];if(!t)return n;e=e.slice(o.shift().length)}for(s=ft.POS.test(e)?-1:o.length-1;s>=0;s--){a=o[s];if(b.relative[f=a.type])break;if(l=b.find[f])if(r=l(a.matches[0].replace(at,""),it.test(o[0].type)&&t.parentNode||t,i)){o.splice(s,1),e=r.length&&o.join("");if(!e)return B.apply(n,j.call(r,0)),n;break}}}return x(e,c)(r,t,i,n,it.test(e)),n}function m(){}var g,y,b,w,E,S,x,T,N,C,k=!0,L="undefined",A=("sizcache"+Math.random()).replace(".",""),O=String,M=e.document,_=M.documentElement,D=0,P=0,H=[].pop,B=[].push,j=[].slice,F=[].indexOf||function(e){var t=0,n=this.length;for(;tb.cacheLength&&delete e[t.shift()],e[n]=r},e)},R=q(),U=q(),z=q(),W="[\\x20\\t\\r\\n\\f]",X="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",V=X.replace("w","w#"),$="([*^$|!~]?=)",J="\\["+W+"*("+X+")"+W+"*(?:"+$+W+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+V+")|)|)"+W+"*\\]",K=":("+X+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+J+")|[^:]|\\\\.)*|.*))\\)|)",Q=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+W+"*((?:-\\d)?\\d*)"+W+"*\\)|)(?=[^-]|$)",G=new RegExp("^"+W+"+|((?:^|[^\\\\])(?:\\\\.)*)"+W+"+$","g"),Z=new RegExp("^"+W+"*,"+W+"*"),et=new RegExp("^"+W+"*([\\x20\\t\\r\\n\\f>+~])"+W+"*"),tt=new RegExp(K),nt=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,rt=/^:not/,it=/[\x20\t\r\n\f]*[+~]/,st=/:not\($/,ot=/h\d/i,ut=/input|select|textarea|button/i,at=/\\(?!\\)/g,ft={ID:new RegExp("^#("+X+")"),CLASS:new RegExp("^\\.("+X+")"),NAME:new RegExp("^\\[name=['\"]?("+X+")['\"]?\\]"),TAG:new RegExp("^("+X.replace("w","w*")+")"),ATTR:new RegExp("^"+J),PSEUDO:new RegExp("^"+K),POS:new RegExp(Q,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+W+"*(even|odd|(([+-]|)(\\d*)n|)"+W+"*(?:([+-]|)"+W+"*(\\d+)|))"+W+"*\\)|)","i"),needsContext:new RegExp("^"+W+"*[>+~]|"+Q,"i")},lt=function(e){var t=M.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},ct=lt(function(e){return e.appendChild(M.createComment("")),!e.getElementsByTagName("*").length}),ht=lt(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==L&&e.firstChild.getAttribute("href")==="#"}),pt=lt(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),dt=lt(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),vt=lt(function(e){e.id=A+0,e.innerHTML="
",_.insertBefore(e,_.firstChild);var t=M.getElementsByName&&M.getElementsByName(A).length===2+M.getElementsByName(A+0).length;return y=!M.getElementById(A),_.removeChild(e),t});try{j.call(_.childNodes,0)[0].nodeType}catch(mt){j=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}n.matches=function(e,t){return n(e,null,null,t)},n.matchesSelector=function(e,t){return n(t,null,null,[e]).length>0},w=n.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=w(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=w(t);return n},E=n.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},S=n.contains=_.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:_.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},n.attr=function(e,t){var n,r=E(e);return r||(t=t.toLowerCase()),(n=b.attrHandle[t])?n(e):r||pt?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},b=n.selectors={cacheLength:50,createPseudo:I,match:ft,attrHandle:ht?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:y?function(e,t,n){if(typeof t.getElementById!==L&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==L&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==L&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:ct?function(e,t){if(typeof t.getElementsByTagName!==L)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:vt&&function(e,t){if(typeof t.getElementsByName!==L)return t.getElementsByName(name)},CLASS:dt&&function(e,t,n){if(typeof t.getElementsByClassName!==L&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(at,""),e[3]=(e[4]||e[5]||"").replace(at,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||n.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&n.error(e[0]),e},PSEUDO:function(e){var t,n;if(ft.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])tt.test(t)&&(n=u(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:y?function(e){return e=e.replace(at,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace(at,""),function(t){var n=typeof t.getAttributeNode!==L&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace(at,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=R[A][e];return t||(t=R(e,new RegExp("(^|"+W+")"+e+"("+W+"|$)"))),function(e){return t.test(e.className||typeof e.getAttribute!==L&&e.getAttribute("class")||"")}},ATTR:function(e,t,r){return function(i,s){var o=n.attr(i,e);return o==null?t==="!=":t?(o+="",t==="="?o===r:t==="!="?o!==r:t==="^="?r&&o.indexOf(r)===0:t==="*="?r&&o.indexOf(r)>-1:t==="$="?r&&o.substr(o.length-r.length)===r:t==="~="?(" "+o+" ").indexOf(r)>-1:t==="|="?o===r||o.substr(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var r,i=b.pseudos[e]||b.setFilters[e.toLowerCase()]||n.error("unsupported pseudo: "+e);return i[A]?i(t):i.length>1?(r=[e,e,"",t],b.setFilters.hasOwnProperty(e.toLowerCase())?I(function(e,n){var r,s=i(e,t),o=s.length;while(o--)r=F.call(e,s[o]),e[r]=!(n[r]=s[o])}):function(e){return i(e,0,r)}):i}},pseudos:{not:I(function(e){var t=[],n=[],r=x(e.replace(G,"$1"));return r[A]?I(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:I(function(e){return function(t){return n(e,t).length>0}}),contains:I(function(e){return function(t){return(t.textContent||t.innerText||w(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!b.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return ot.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:r("radio"),checkbox:r("checkbox"),file:r("file"),password:r("password"),image:r("image"),submit:i("submit"),reset:i("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return ut.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&(!!e.type||!!e.href)},active:function(e){return e===e.ownerDocument.activeElement},first:s(function(e,t,n){return[0]}),last:s(function(e,t,n){return[t-1]}),eq:s(function(e,t,n){return[n<0?n+t:n]}),even:s(function(e,t,n){for(var r=0;r=0;)e.push(r);return e}),gt:s(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||s.push("\\["+W+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||s.push(":checked")}),lt(function(e){e.innerHTML="

",e.querySelectorAll("[test^='']").length&&s.push("[*^$]="+W+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||s.push(":enabled",":disabled")}),s=new RegExp(s.join("|")),v=function(e,n,i,o,a){if(!o&&!a&&(!s||!s.test(e))){var f,l,c=!0,h=A,p=n,d=n.nodeType===9&&e;if(n.nodeType===1&&n.nodeName.toLowerCase()!=="object"){f=u(e),(c=n.getAttribute("id"))?h=c.replace(r,"\\$&"):n.setAttribute("id",h),h="[id='"+h+"'] ",l=f.length;while(l--)f[l]=h+f[l].join("");p=it.test(e)&&n.parentNode||n,d=f.join(",")}if(d)try{return B.apply(i,j.call(p.querySelectorAll(d),0)),i}catch(v){}finally{c||n.removeAttribute("id")}}return t(e,n,i,o,a)},a&&(lt(function(t){e=a.call(t,"div");try{a.call(t,"[test!='']:sizzle"),o.push("!=",K)}catch(n){}}),o=new RegExp(o.join("|")),n.matchesSelector=function(t,r){r=r.replace(i,"='$1']");if(!E(t)&&!o.test(r)&&(!s||!s.test(r)))try{var u=a.call(t,r);if(u||e||t.document&&t.document.nodeType!==11)return u}catch(f){}return n(r,null,null,[t]).length>0})}(),b.pseudos.nth=b.pseudos.eq,b.filters=m.prototype=b.pseudos,b.setFilters=new m,n.attr=Y.attr,Y.find=n,Y.expr=n.selectors,Y.expr[":"]=Y.expr.pseudos,Y.unique=n.uniqueSort,Y.text=n.getText,Y.isXMLDoc=n.isXML,Y.contains=n.contains}(e);var Pt=/Until$/,Ht=/^(?:parents|prev(?:Until|All))/,Bt=/^.[^:#\[\.,]*$/,jt=Y.expr.match.needsContext,Ft={children:!0,contents:!0,next:!0,prev:!0};Y.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return Y(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:Y.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=jt.test(e)||typeof e!="string"?Y(e,t||this.context):0;for(;r-1:Y.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?Y.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?Y.inArray(this[0],Y(e)):Y.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?Y(e,t):Y.makeArray(e&&e.nodeType?[e]:e),r=Y.merge(this.get(),n);return this.pushStack(u(n[0])||u(r[0])?r:Y.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),Y.fn.andSelf=Y.fn.addBack,Y.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return Y.dir(e,"parentNode")},parentsUntil:function(e,t,n){return Y.dir(e,"parentNode",n)},next:function(e){return a(e,"nextSibling")},prev:function(e){return a(e,"previousSibling")},nextAll:function(e){return Y.dir(e,"nextSibling")},prevAll:function(e){return Y.dir(e,"previousSibling")},nextUntil:function(e,t,n){return Y.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return Y.dir(e,"previousSibling",n)},siblings:function(e){return Y.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return Y.sibling(e.firstChild)},contents:function(e){return Y.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:Y.merge([],e.childNodes)}},function(e,t){Y.fn[e]=function(n,r){var i=Y.map(this,t,n);return Pt.test(e)||(r=n),r&&typeof r=="string"&&(i=Y.filter(r,i)),i=this.length>1&&!Ft[e]?Y.unique(i):i,this.length>1&&Ht.test(e)&&(i=i.reverse()),this.pushStack(i,e,$.call(arguments).join(","))}}),Y.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?Y.find.matchesSelector(t[0],e)?[t[0]]:[]:Y.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!Y(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var It="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",qt=/ jQuery\d+="(?:null|\d+)"/g,Rt=/^\s+/,Ut=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,zt=/<([\w:]+)/,Wt=/]","i"),Kt=/^(?:checkbox|radio)$/,Qt=/checked\s*(?:[^=]|=\s*.checked.)/i,Gt=/\/(java|ecma)script/i,Yt=/^\s*\s*$/g,Zt={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},en=l(R),tn=en.appendChild(R.createElement("div"));Zt.optgroup=Zt.option,Zt.tbody=Zt.tfoot=Zt.colgroup=Zt.caption=Zt.thead,Zt.th=Zt.td,Y.support.htmlSerialize||(Zt._default=[1,"X
","
"]),Y.fn.extend({text:function(e){return Y.access(this,function(e){return e===t?Y.text(this):this.empty().append((this[0]&&this[0].ownerDocument||R).createTextNode(e))},null,e,arguments.length +)},wrapAll:function(e){if(Y.isFunction(e))return this.each(function(t){Y(this).wrapAll(e.call(this,t))});if(this[0]){var t=Y(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return Y.isFunction(e)?this.each(function(t){Y(this).wrapInner(e.call(this,t))}):this.each(function(){var t=Y(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=Y.isFunction(e);return this.each(function(n){Y(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){Y.nodeName(this,"body")||Y(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!u(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=Y.clean(arguments);return this.pushStack(Y.merge(e,this),"before",this.selector)}},after:function(){if(!u(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=Y.clean(arguments);return this.pushStack(Y.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||Y.filter(e,[n]).length)!t&&n.nodeType===1&&(Y.cleanData(n.getElementsByTagName("*")),Y.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&Y.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return Y.clone(this,e,t)})},html:function(e){return Y.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(qt,""):t;if(typeof e=="string"&&!Vt.test(e)&&(Y.support.htmlSerialize||!Jt.test(e))&&(Y.support.leadingWhitespace||!Rt.test(e))&&!Zt[(zt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Ut,"<$1>");try{for(;r1&&typeof f=="string"&&Qt.test(f))return this.each(function(){Y(this).domManip(e,n,r)});if(Y.isFunction(f))return this.each(function(i){var s=Y(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=Y.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&Y.nodeName(s,"tr");for(u=i.cacheable||h-1;a0?this.clone(!0):this).get(),Y(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),Y.extend({clone:function(e,t,n){var r,i,s,o;Y.support.html5Clone||Y.isXMLDoc(e)||!Jt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(tn.innerHTML=e.outerHTML,tn.removeChild(o=tn.firstChild));if((!Y.support.noCloneEvent||!Y.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!Y.isXMLDoc(e)){p(e,o),r=d(e),i=d(o);for(s=0;r[s];++s)i[s]&&p(r[s],i[s])}if(t){h(e,o);if(n){r=d(e),i=d(o);for(s=0;r[s];++s)h(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var i,s,o,u,a,f,c,h,p,d,m,g,y=t===R&&en,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=R;for(i=0;(o=e[i])!=null;i++){typeof o=="number"&&(o+="");if(!o)continue;if(typeof o=="string")if(!Xt.test(o))o=t.createTextNode(o);else{y=y||l(t),c=t.createElement("div"),y.appendChild(c),o=o.replace(Ut,"<$1>"),u=(zt.exec(o)||["",""])[1].toLowerCase(),a=Zt[u]||Zt._default,f=a[0],c.innerHTML=a[1]+o+a[2];while(f--)c=c.lastChild;if(!Y.support.tbody){h=Wt.test(o),p=u==="table"&&!h?c.firstChild&&c.firstChild.childNodes:a[1]===""&&!h?c.childNodes:[];for(s=p.length-1;s>=0;--s)Y.nodeName(p[s],"tbody")&&!p[s].childNodes.length&&p[s].parentNode.removeChild(p[s])}!Y.support.leadingWhitespace&&Rt.test(o)&&c.insertBefore(t.createTextNode(Rt.exec(o)[0]),c.firstChild),o=c.childNodes,c.parentNode.removeChild(c)}o.nodeType?b.push(o):Y.merge(b,o)}c&&(o=c=y=null);if(!Y.support.appendChecked)for(i=0;(o=b[i])!=null;i++)Y.nodeName(o,"input")?v(o):typeof o.getElementsByTagName!="undefined"&&Y.grep(o.getElementsByTagName("input"),v);if(n){m=function(e){if(!e.type||Gt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(i=0;(o=b[i])!=null;i++)if(!Y.nodeName(o,"script")||!m(o))n.appendChild(o),typeof o.getElementsByTagName!="undefined"&&(g=Y.grep(Y.merge([],o.getElementsByTagName("script")),m),b.splice.apply(b,[i+1,0].concat(g)),i+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=Y.expando,a=Y.cache,f=Y.support.deleteExpando,l=Y.event.special;for(;(i=e[o])!=null;o++)if(t||Y.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?Y.event.remove(i,s):Y.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,Y.deletedIds.push(r))}}}}),function(){var e,t;Y.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=Y.uaMatch(z.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),Y.browser=t,Y.sub=function(){function e(t,n){return new e.fn.init(t,n)}Y.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function n(n,r){return r&&r instanceof Y&&!(r instanceof e)&&(r=e(r)),Y.fn.init.call(this,n,r,t)},e.fn.init.prototype=e.fn;var t=e(R);return e}}();var nn,rn,sn,on=/alpha\([^)]*\)/i,un=/opacity=([^)]*)/,an=/^(top|right|bottom|left)$/,fn=/^(none|table(?!-c[ea]).+)/,ln=/^margin/,cn=new RegExp("^("+Z+")(.*)$","i"),hn=new RegExp("^("+Z+")(?!px)[a-z%]+$","i"),pn=new RegExp("^([-+])=("+Z+")","i"),dn={},vn={position:"absolute",visibility:"hidden",display:"block"},mn={letterSpacing:0,fontWeight:400},gn=["Top","Right","Bottom","Left"],yn=["Webkit","O","Moz","ms"],bn=Y.fn.toggle;Y.fn.extend({css:function(e,n){return Y.access(this,function(e,n,r){return r!==t?Y.style(e,n,r):Y.css(e,n)},e,n,arguments.length>1)},show:function(){return y(this,!0)},hide:function(){return y(this)},toggle:function(e,t){var n=typeof e=="boolean";return Y.isFunction(e)&&Y.isFunction(t)?bn.apply(this,arguments):this.each(function(){(n?e:g(this))?Y(this).show():Y(this).hide()})}}),Y.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=nn(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":Y.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=Y.camelCase(n),f=e.style;n=Y.cssProps[a]||(Y.cssProps[a]=m(f,a)),u=Y.cssHooks[n]||Y.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=pn.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(Y.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!Y.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=Y.camelCase(n);return n=Y.cssProps[a]||(Y.cssProps[a]=m(e.style,a)),u=Y.cssHooks[n]||Y.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=nn(e,n)),s==="normal"&&n in mn&&(s=mn[n]),r||i!==t?(o=parseFloat(s),r||Y.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?nn=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u[n],r===""&&!Y.contains(t.ownerDocument,t)&&(r=Y.style(t,n)),hn.test(r)&&ln.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:R.documentElement.currentStyle&&(nn=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),hn.test(i)&&!an.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),Y.each(["height","width"],function(e,t){Y.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&fn.test(nn(e,"display"))?Y.swap(e,vn,function(){return E(e,t,r)}):E(e,t,r)},set:function(e,n,r){return b(e,n,r?w(e,t,r,Y.support.boxSizing&&Y.css(e,"boxSizing")==="border-box"):0)}}}),Y.support.opacity||(Y.cssHooks.opacity={get:function(e,t){return un.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=Y.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&Y.trim(s.replace(on,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=on.test(s)?s.replace(on,i):s+" "+i}}),Y(function(){Y.support.reliableMarginRight||(Y.cssHooks.marginRight={get:function(e,t){return Y.swap(e,{display:"inline-block"},function(){if(t)return nn(e,"marginRight")})}}),!Y.support.pixelPosition&&Y.fn.position&&Y.each(["top","left"],function(e,t){Y.cssHooks[t]={get:function(e,n){if(n){var r=nn(e,t);return hn.test(r)?Y(e).position()[t]+"px":r}}}})}),Y.expr&&Y.expr.filters&&(Y.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!Y.support.reliableHiddenOffsets&&(e.style&&e.style.display||nn(e,"display"))==="none"},Y.expr.filters.visible=function(e){return!Y.expr.filters.hidden(e)}),Y.each({margin:"",padding:"",border:"Width"},function(e,t){Y.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+gn[r]+t]=i[r]||i[r-2]||i[0];return s}},ln.test(e)||(Y.cssHooks[e+t].set=b)});var wn=/%20/g,En=/\[\]$/,Sn=/\r?\n/g,xn=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Tn=/^(?:select|textarea)/i;Y.fn.extend({serialize:function(){return Y.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?Y.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||Tn.test(this.nodeName)||xn.test(this.type))}).map(function(e,t){var n=Y(this).val();return n==null?null:Y.isArray(n)?Y.map(n,function(e,n){return{name:t.name,value:e.replace(Sn,"\r\n")}}):{name:t.name,value:n.replace(Sn,"\r\n")}}).get()}}),Y.param=function(e,n){var r,i=[],s=function(e,t){t=Y.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=Y.ajaxSettings&&Y.ajaxSettings.traditional);if(Y.isArray(e)||e.jquery&&!Y.isPlainObject(e))Y.each(e,function(){s(this.name,this.value)});else for(r in e)x(r,e[r],n,s);return i.join("&").replace(wn,"+")};var Nn,Cn,kn=/#.*$/,Ln=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,An=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,On=/^(?:GET|HEAD)$/,Mn=/^\/\//,_n=/\?/,Dn=/)<[^<]*)*<\/script>/gi,Pn=/([?&])_=[^&]*/,Hn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Bn=Y.fn.load,jn={},Fn={},In=["*/"]+["*"];try{Cn=U.href}catch(qn){Cn=R.createElement("a"),Cn.href="",Cn=Cn.href}Nn=Hn.exec(Cn.toLowerCase())||[],Y.fn.load=function(e,n,r){if(typeof e!="string"&&Bn)return Bn.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),Y.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),Y.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?Y("
").append(e.replace(Dn,"")).find(i):e)}),this},Y.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){Y.fn[t]=function(e){return this.on(t,e)}}),Y.each(["get","post"],function(e,n){Y[n]=function(e,r,i,s){return Y.isFunction(r)&&(s=s||i,i=r,r=t),Y.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),Y.extend({getScript:function(e,n){return Y.get(e,t,n,"script")},getJSON:function(e,t,n){return Y.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?C(e,Y.ajaxSettings):(t=e,e=Y.ajaxSettings),C(e,t),e},ajaxSettings:{url:Cn,isLocal:An.test(Nn[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":In},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":Y.parseJSON,"text xml":Y.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:T(jn),ajaxTransport:T(Fn),ajax:function(e,n){function r(e,n,r,o){var f,c,y,b,E,x=n;if(w===2)return;w=2,a&&clearTimeout(a),u=t,s=o||"",S.readyState=e>0?4:0,r&&(b=k(h,S,r));if(e>=200&&e<300||e===304)h.ifModified&&(E=S.getResponseHeader("Last-Modified"),E&&(Y.lastModified[i]=E),E=S.getResponseHeader("Etag"),E&&(Y.etag[i]=E)),e===304?(x="notmodified",f=!0):(f=L(h,b),x=f.state,c=f.data,y=f.error,f=!y);else{y=x;if(!x||e)x="error",e<0&&(e=0)}S.status=e,S.statusText=(n||x)+"",f?v.resolveWith(p,[c,x,S]):v.rejectWith(p,[S,x,y]),S.statusCode(g),g=t,l&&d.trigger("ajax"+(f?"Success":"Error"),[S,h,f?c:y]),m.fireWith(p,[S,x]),l&&(d.trigger("ajaxComplete",[S,h]),--Y.active||Y.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var i,s,o,u,a,f,l,c,h=Y.ajaxSetup({},n),p=h.context||h,d=p!==h&&(p.nodeType||p instanceof Y)?Y(p):Y.event,v=Y.Deferred(),m=Y.Callbacks("once memory"),g=h.statusCode||{},y={},b={},w=0,E="canceled",S={readyState:0,setRequestHeader:function(e,t){if(!w){var n=e.toLowerCase();e=b[n]=b[n]||e,y[e]=t}return this},getAllResponseHeaders:function(){return w===2?s:null},getResponseHeader:function(e){var n;if(w===2){if(!o){o={};while(n=Ln.exec(s))o[n[1].toLowerCase()]=n[2]}n=o[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return w||(h.mimeType=e),this},abort:function(e){return e=e||E,u&&u.abort(e),r(0,e),this}};v.promise(S),S.success=S.done,S.error=S.fail,S.complete=m.add,S.statusCode=function(e){if(e){var t;if(w<2)for(t in e)g[t]=[g[t],e[t]];else t=e[S.status],S.always(t)}return this},h.url=((e||h.url)+"").replace(kn,"").replace(Mn,Nn[1]+"//"),h.dataTypes=Y.trim(h.dataType||"*").toLowerCase().split(tt),h.crossDomain==null&&(f=Hn.exec(h.url.toLowerCase())||!1,h.crossDomain=f&&f.join(":")+(f[3]?"":f[1]==="http:"?80:443)!==Nn.join(":")+(Nn[3]?"":Nn[1]==="http:"?80:443)),h.data&&h.processData&&typeof h.data!="string"&&(h.data=Y.param(h.data,h.traditional)),N(jn,h,n,S);if(w===2)return S;l=h.global,h.type=h.type.toUpperCase(),h.hasContent=!On.test(h.type),l&&Y.active++===0&&Y.event.trigger("ajaxStart");if(!h.hasContent){h.data&&(h.url+=(_n.test(h.url)?"&":"?")+h.data,delete h.data),i=h.url;if(h.cache===!1){var x=Y.now(),T=h.url.replace(Pn,"$1_="+x);h.url=T+(T===h.url?(_n.test(h.url)?"&":"?")+"_="+x:"")}}(h.data&&h.hasContent&&h.contentType!==!1||n.contentType)&&S.setRequestHeader("Content-Type",h.contentType),h.ifModified&&(i=i||h.url,Y.lastModified[i]&&S.setRequestHeader("If-Modified-Since",Y.lastModified[i]),Y.etag[i]&&S.setRequestHeader("If-None-Match",Y.etag[i])),S.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+(h.dataTypes[0]!=="*"?", "+In+"; q=0.01":""):h.accepts["*"]);for(c in h.headers)S.setRequestHeader(c,h.headers[c]);if(!h.beforeSend||h.beforeSend.call(p,S,h)!==!1&&w!==2){E="abort";for(c in{success:1,error:1,complete:1})S[c](h[c]);u=N(Fn,h,n,S);if(!u)r(-1,"No Transport");else{S.readyState=1,l&&d.trigger("ajaxSend",[S,h]),h.async&&h.timeout>0&&(a=setTimeout(function(){S.abort("timeout")},h.timeout));try{w=1,u.send(y,r)}catch(C){if(!(w<2))throw C;r(-1,C)}}return S}return S.abort()},active:0,lastModified:{},etag:{}});var Rn=[],Un=/\?/,zn=/(=)\?(?=&|$)|\?\?/,Wn=Y.now();Y.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Rn.pop()||Y.expando+"_"+Wn++;return this[e]=!0,e}}),Y.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&zn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&zn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=Y.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(zn,"$1"+s):h?n.data=a.replace(zn,"$1"+s):l&&(n.url+=(Un.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||Y.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Rn.push(s)),u&&Y.isFunction(o)&&o(u[0]),u=o=t}),"script"}),Y.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return Y.globalEval(e),e}}}),Y.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),Y.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=R.head||R.getElementsByTagName("head")[0]||R.documentElement;return{send:function(i,s){n=R.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||s(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Xn,Vn=e.ActiveXObject?function(){for(var e in Xn)Xn[e](0,1)}:!1,$n=0;Y.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&A()||O()}:A,function(e){Y.extend(Y.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(Y.ajaxSettings.xhr()),Y.support.ajax&&Y.ajaxTransport(function(n){if(!n.crossDomain||Y.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=Y.noop,Vn&&delete Xn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(e){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++$n,Vn&&(Xn||(Xn={},Y(e).unload(Vn)),Xn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var Jn,Kn,Qn=/^(?:toggle|show|hide)$/,Gn=new RegExp("^(?:([-+])=|)("+Z+")([a-z%]*)$","i"),Yn=/queueHooks$/,Zn=[H],er={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=Gn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(Y.cssNumber[e]?"":"px");if(r!=="px"&&u){u=Y.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,Y.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};Y.Animation=Y.extend(D,{tweener:function(e,t){Y.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),Y.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},Y.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=tr.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(Y.css(e,"marginTop"))||0,n.left-=parseFloat(Y.css(e,"marginLeft"))||0,r.top+=parseFloat(Y.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(Y.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||R.body;while(e&&!tr.test(e.nodeName)&&Y.css(e,"position")==="static")e=e.offsetParent;return e||R.body})}}),Y.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);Y.fn[e]=function(i){return Y.access(this,function(e,i,s){var o=F(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?Y(o).scrollLeft():s,r?s:Y(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),Y.each({Height:"height",Width:"width"},function(e,n){Y.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){Y.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return Y.access(this,function(n,r,i){var s;return Y.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?Y.css(n,r,i,u):Y.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=Y,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return Y})})(window);typeof jQuery=="undefined"&&alert("Hashgrid: jQuery not loaded. Make sure it's linked to your pages.");var hashgrid=function(e){function S(e){if(t.modifierKey==null)return!0;var n=!0;switch(t.modifierKey){case"ctrl":n=e.ctrlKey?e.ctrlKey:!1;break;case"alt":n=e.altKey?e.altKey:!1;break;case"shift":n=e.shiftKey?e.shiftKey:!1}return n}function x(e){var t=!1,n=e.keyCode?e.keyCode:e.which;n==13?t="enter":t=String.fromCharCode(n).toLowerCase();return t}function T(){L(t.cookiePrefix+t.id,(w?"1":"0")+"-"+d+"-"+n,1)}function N(){f.show()}function C(e){var r,i,s=e.target.tagName.toLowerCase();if(s=="input"||s=="textarea"||s=="select")return!0;i=S(e);if(!i)return!0;r=x(e);if(!r)return!0;switch(r){case t.showGridKey:if(!h){N();h=!0}else if(w){f.hide();h=!1;w=!1;T()}break;case t.holdGridKey:if(h&&!w){w=!0;T()}break;case t.foregroundKey:if(h){if(f.css("z-index")==m){f.css("z-index",v);d="B"}else{f.css("z-index",m);d="F"}T()}break;case t.jumpGridsKey:if(h&&t.numberOfGrids>1){f.removeClass(t.classPrefix+n);n++;n>t.numberOfGrids&&(n=1);f.addClass(t.classPrefix+n);N();/webkit/.test(navigator.userAgent.toLowerCase())&&M();T()}}return!0}function k(e){var n,r=S(e);if(!r)return!0;n=x(e);if(n&&n==t.showGridKey&&!w){f.hide();h=!1}return!0}function L(e,t,n){var r,i="";if(n){r=new Date;r.setTime(r.getTime()+n*24*60*60*1e3);i="; expires="+r.toGMTString()}document.cookie=e+"="+t+i+"; path=/"}function A(e){var t,n=document.cookie.split(";"),r=0,i=n.length,s=e+"=";for(;r0&&$("#"+t.id).remove();c=$("
");c.attr("id",t.id).css({display:"none","pointer-events":"none"});$("body").prepend(c);f=$("#"+t.id);f.css("z-index")=="auto"&&f.css("z-index",v);g=parseFloat($(document).height());f.height(g);f.append('
');E=f.css("top");f.css({top:"-999px",display:"block"});o=$("#"+t.id+"-horiz");u=o.outerHeight()-1;f.css({display:"none",top:E});if(u<=0)return!1;a=Math.floor(g/u);r="";for(s=a-1;s>=1;s--)r+='
';f.append(r);f.prepend($('
'));p=f.children(".vert-container");i=f.width();p.css({position:"absolute",top:0});p.append('
');r="";for(s=0;s<50;s++)r+='
';p.append(r);p.children().css({display:"inline-block"}).height(g);l=A(t.cookiePrefix+t.id);if(typeof l=="string"){b=l.split("-");b[2]=Number(b[2]);if(typeof b[2]=="number"&&!isNaN(b[2])){n=b[2].toFixed(0);f.addClass(t.classPrefix+n)}if(b[1]=="F"){d="F";f.css("z-index",m)}if(b[0]=="1"){h=!0;w=!0;N()}}else f.addClass(t.classPrefix+n);$(document).bind("keydown",C);$(document).bind("keyup",k);return{}};$(document).ready(function(){var e=new hashgrid({numberOfGrids:3})}); \ No newline at end of file diff --git a/js/lib/hashgrid.js b/js/lib/hashgrid.js deleted file mode 100644 index 49f611c..0000000 --- a/js/lib/hashgrid.js +++ /dev/null @@ -1,430 +0,0 @@ -/** - * hashgrid (jQuery version) - * http://github.com/dotjay/hashgrid - * Version 6, 10 Jun 2011 - * Written by Jon Gibbins at Analog, http://analog.coop/ - * - * Contibutors: - * Sean Coates, http://seancoates.com/ - * Phil Dokas, http://jetless.org/ - * Andrew Jaswa, http://andrewjaswa.com/ - */ - -/** - * @license Copyright 2011 Analog Coop Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Usage - * - * // The basic #grid setup looks like this - * var grid = new hashgrid(); - * - * // Or you can set a custom id for your grid, e.g. #mygrid - * var grid = new hashgrid("mygrid"); - * - * // But there are a whole bunch of additional options you can set - * var grid = new hashgrid({ - * id: 'mygrid', // id for the grid container - * modifierKey: 'alt', // optional 'ctrl', 'alt' or 'shift' - * showGridKey: 's', // key to show the grid - * holdGridKey: 'enter', // key to hold the grid in place - * foregroundKey: 'f', // key to toggle foreground/background - * jumpGridsKey: 'd', // key to cycle through the grid classes - * numberOfGrids: 2, // number of grid classes used - * classPrefix: 'class', // prefix for the grid classes - * cookiePrefix: 'mygrid' // prefix for the cookie name - * }); - */ - -;(function($, undefined){ - - /** - * Make sure we have the library - * TODO: Use an adapter - */ - if (typeof jQuery == "undefined") { - alert("Hashgrid: jQuery not loaded. Make sure it's linked to your pages."); - } - - - /** - * hashgrid overlay - * @constructor - */ - var hashgrid = function(set) { - - var options = { - id: 'grid', // id for the grid container - modifierKey: null, // optional 'ctrl', 'alt' or 'shift' - showGridKey: 'g', // key to show the grid - holdGridKey: 'h', // key to hold the grid in place - foregroundKey: 'f', // key to toggle foreground/background - jumpGridsKey: 'j', // key to cycle through the grid classes - numberOfGrids: 1, // number of grid classes used - classPrefix: 'grid-', // prefix for the grid classes - cookiePrefix: 'hashgrid'// prefix for the cookie name - }, - classNumber = 1, - gridLines, - gridWidth, - i, - line, - lineHeight, - numGridLines, - overlay, - overlayCookie, - overlayEl, - overlayOn = false, - overlayVert, - overlayZState = 'B', - overlayZBackground = -1, - overlayZForeground = 9999, - pageHeight, - setKey, - state, - sticky = false, - top; - - // Apply options - if (typeof set == 'object') { - for (setKey in set) { - options[setKey] = set[setKey]; - } - } - else if (typeof set == 'string') { - options.id = set; - } - - // Remove any conflicting overlay - if ($('#' + options.id).length > 0) { - $('#' + options.id).remove(); - } - - // Create overlay, hidden before adding to DOM - overlayEl = $('
'); - overlayEl - .attr('id', options.id) - .css({ - display: 'none', - 'pointer-events': 'none' - }); - $("body").prepend(overlayEl); - overlay = $('#' + options.id); - - // Unless a custom z-index is set, ensure the overlay will be behind everything - if (overlay.css('z-index') == 'auto') overlay.css('z-index', overlayZBackground); - - // Override the default overlay height with the actual page height - pageHeight = parseFloat($(document).height()); - overlay.height(pageHeight); - - // Add the first grid line so that we can measure it - overlay.append('
'); - - // Position off-screen and display to calculate height - top = overlay.css("top"); - overlay.css({ - top: "-999px", - display: "block" - }); - - // Calculate the number of grid lines needed - line = $('#' + options.id + '-horiz'); - lineHeight = line.outerHeight() -1; - - // Hide and reset top - overlay.css({ - display: "none", - top: top - }); - - // Break on zero line height - if (lineHeight <= 0) { - return false; - } - - // Add the remaining grid lines - numGridLines = Math.floor(pageHeight / lineHeight); - gridLines = ''; - - for (i = numGridLines - 1; i >= 1; i--) { - gridLines += '
'; - } - overlay.append(gridLines); - - // vertical grid - overlay.prepend($('
')); - overlayVert = overlay.children('.vert-container'); - gridWidth = overlay.width(); - overlayVert.css({position: 'absolute', top: 0}); - overlayVert.append('
'); - - // 50 is an arbitrarily large number... - // can't calculate the margin width properly - gridLines = ''; - for (i = 0; i < 50; i++) { - gridLines += '
'; - } - overlayVert.append(gridLines); - overlayVert.children() - .css({ display: 'inline-block' }) - .height(pageHeight); - - // Check for saved state - overlayCookie = readCookie(options.cookiePrefix + options.id); - if (typeof overlayCookie == 'string') { - state = overlayCookie.split('-'); - state[2] = Number(state[2]); - if ((typeof state[2] == 'number') && !isNaN(state[2])) { - classNumber = state[2].toFixed(0); - overlay.addClass(options.classPrefix + classNumber); - } - if (state[1] == 'F') { - overlayZState = 'F'; - overlay.css('z-index', overlayZForeground); - } - if (state[0] == '1') { - overlayOn = true; - sticky = true; - showOverlay(); - } - } - else { - overlay.addClass(options.classPrefix + classNumber); - } - - // Keyboard controls - $(document).bind('keydown', keydownHandler); - $(document).bind('keyup', keyupHandler); - - /** - * Helpers - */ - - function getModifier(e) { - if (options.modifierKey == null) return true; // Bypass by default - var m = true; - switch(options.modifierKey) { - case 'ctrl': - m = (e.ctrlKey ? e.ctrlKey : false); - break; - - case 'alt': - m = (e.altKey ? e.altKey : false); - break; - - case 'shift': - m = (e.shiftKey ? e.shiftKey : false); - break; - } - return m; - } - - function getKey(e) { - var k = false, c = (e.keyCode ? e.keyCode : e.which); - // Handle keywords - if (c == 13) k = 'enter'; - // Handle letters - else k = String.fromCharCode(c).toLowerCase(); - return k; - } - - function saveState() { - createCookie(options.cookiePrefix + options.id, (sticky ? '1' : '0') + '-' + overlayZState + '-' + classNumber, 1); - } - - function showOverlay() { - overlay.show(); - //overlayVert.css({width: overlay.width()}); - // hide any vertical blocks that aren't at the top of the viewport - /* - overlayVert.children('.vert').each(function () { - var vCol = $(this); - vCol.css('display','inline-block'); - if (vCol.offset().top > vCol.parent().offset().top) { - vCol.hide(); - } - }); - */ - } - - /** - * Event handlers - */ - - function keydownHandler(e) { - var k, - m, - source = e.target.tagName.toLowerCase(); - - if ((source == 'input') || (source == 'textarea') || (source == 'select')) { - return true; - } - - m = getModifier(e); - if (!m) { - return true; - } - - k = getKey(e); - if (!k) { - return true; - } - - switch(k) { - case options.showGridKey: - if (!overlayOn) { - showOverlay(); - overlayOn = true; - } - else if (sticky) { - overlay.hide(); - overlayOn = false; - sticky = false; - saveState(); - } - break; - case options.holdGridKey: - if (overlayOn && !sticky) { - // Turn sticky overlay on - sticky = true; - saveState(); - } - break; - case options.foregroundKey: - if (overlayOn) { - // Toggle sticky overlay z-index - if (overlay.css('z-index') == overlayZForeground) { - overlay.css('z-index', overlayZBackground); - overlayZState = 'B'; - } - else { - overlay.css('z-index', overlayZForeground); - overlayZState = 'F'; - } - saveState(); - } - break; - case options.jumpGridsKey: - if (overlayOn && (options.numberOfGrids > 1)) { - // Cycle through the available grids - overlay.removeClass(options.classPrefix + classNumber); - classNumber++; - if (classNumber > options.numberOfGrids) classNumber = 1; - overlay.addClass(options.classPrefix + classNumber); - showOverlay(); - if (/webkit/.test( navigator.userAgent.toLowerCase() )) { - forceRepaint(); - } - saveState(); - } - break; - } - - return true; - } - - function keyupHandler(e) { - var k, - m = getModifier(e); - - if (!m) { - return true; - } - - k = getKey(e); - - if (k && (k == options.showGridKey) && !sticky) { - overlay.hide(); - overlayOn = false; - } - - return true; - } - - /** - * Cookie functions - * - * By Peter-Paul Koch: - * http://www.quirksmode.org/js/cookies.html - */ - function createCookie(name, value, days) { - var date, - expires = ""; - - if (days) { - date = new Date(); - date.setTime( date.getTime() + (days*24*60*60*1000) ); - expires = "; expires=" + date.toGMTString(); - } - - document.cookie = name + "=" + value + expires + "; path=/"; - } - - function readCookie(name) { - var c, - ca = document.cookie.split(';'), - i = 0, - len = ca.length, - nameEQ = name + "="; - - for (; i < len; i++) { - c = ca[i]; - - while (c.charAt(0) == ' ') { - c = c.substring(1, c.length); - } - - if (c.indexOf(nameEQ) == 0) { - return c.substring(nameEQ.length, c.length); - } - } - return null; - } - - function eraseCookie(name) { - createCookie(name, "", -1); - } - - /** - * Forces a repaint (because WebKit has issues) - * http://www.sitepoint.com/forums/showthread.php?p=4538763 - * http://www.phpied.com/the-new-game-show-will-it-reflow/ - */ - function forceRepaint() { - var ss = document.styleSheets[0]; - try { - ss.addRule('.xxxxxx', 'position: relative'); - ss.removeRule(ss.rules.length - 1); - } catch(e) {} - } - - return {}; - }; - - - /** - * You can call hashgrid from your own code, but it's loaded here as - * an example for your convenience. - */ - $(document).ready(function() { - - var grid = new hashgrid({ - numberOfGrids: 3 - }); - - }); -})(jQuery); \ No newline at end of file diff --git a/js/lib/jquery.hashgrid.js b/js/lib/jquery.hashgrid.js new file mode 100644 index 0000000..db24c87 --- /dev/null +++ b/js/lib/jquery.hashgrid.js @@ -0,0 +1,428 @@ +/** + * hashgrid (jQuery version) + * http://github.com/dotjay/hashgrid + * Version 6, 10 Jun 2011 + * Written by Jon Gibbins at Analog, http://analog.coop/ + * + * Contibutors: + * Sean Coates, http://seancoates.com/ + * Phil Dokas, http://jetless.org/ + * Andrew Jaswa, http://andrewjaswa.com/ + */ + +/** + * @license Copyright 2011 Analog Coop Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Usage + * + * // The basic #grid setup looks like this + * var grid = new hashgrid(); + * + * // Or you can set a custom id for your grid, e.g. #mygrid + * var grid = new hashgrid("mygrid"); + * + * // But there are a whole bunch of additional options you can set + * var grid = new hashgrid({ + * id: 'mygrid', // id for the grid container + * modifierKey: 'alt', // optional 'ctrl', 'alt' or 'shift' + * showGridKey: 's', // key to show the grid + * holdGridKey: 'enter', // key to hold the grid in place + * foregroundKey: 'f', // key to toggle foreground/background + * jumpGridsKey: 'd', // key to cycle through the grid classes + * numberOfGrids: 2, // number of grid classes used + * classPrefix: 'class', // prefix for the grid classes + * cookiePrefix: 'mygrid' // prefix for the cookie name + * }); + */ + + +/** + * Make sure we have the library + * TODO: Use an adapter + */ +if (typeof jQuery == "undefined") { + alert("Hashgrid: jQuery not loaded. Make sure it's linked to your pages."); +} + + +/** + * hashgrid overlay + * @constructor + */ +var hashgrid = function(set) { + + var options = { + id: 'grid', // id for the grid container + modifierKey: null, // optional 'ctrl', 'alt' or 'shift' + showGridKey: 'g', // key to show the grid + holdGridKey: 'h', // key to hold the grid in place + foregroundKey: 'f', // key to toggle foreground/background + jumpGridsKey: 'j', // key to cycle through the grid classes + numberOfGrids: 1, // number of grid classes used + classPrefix: 'grid-', // prefix for the grid classes + cookiePrefix: 'hashgrid'// prefix for the cookie name + }, + classNumber = 1, + gridLines, + gridWidth, + i, + line, + lineHeight, + numGridLines, + overlay, + overlayCookie, + overlayEl, + overlayOn = false, + overlayVert, + overlayZState = 'B', + overlayZBackground = -1, + overlayZForeground = 9999, + pageHeight, + setKey, + state, + sticky = false, + top; + + // Apply options + if (typeof set == 'object') { + for (setKey in set) { + options[setKey] = set[setKey]; + } + } + else if (typeof set == 'string') { + options.id = set; + } + + // Remove any conflicting overlay + if ($('#' + options.id).length > 0) { + $('#' + options.id).remove(); + } + + // Create overlay, hidden before adding to DOM + overlayEl = $('
'); + overlayEl + .attr('id', options.id) + .css({ + display: 'none', + 'pointer-events': 'none' + }); + $("body").prepend(overlayEl); + overlay = $('#' + options.id); + + // Unless a custom z-index is set, ensure the overlay will be behind everything + if (overlay.css('z-index') == 'auto') overlay.css('z-index', overlayZBackground); + + // Override the default overlay height with the actual page height + pageHeight = parseFloat($(document).height()); + overlay.height(pageHeight); + + // Add the first grid line so that we can measure it + overlay.append('
'); + + // Position off-screen and display to calculate height + top = overlay.css("top"); + overlay.css({ + top: "-999px", + display: "block" + }); + + // Calculate the number of grid lines needed + line = $('#' + options.id + '-horiz'); + lineHeight = line.outerHeight() -1; + + // Hide and reset top + overlay.css({ + display: "none", + top: top + }); + + // Break on zero line height + if (lineHeight <= 0) { + return false; + } + + // Add the remaining grid lines + numGridLines = Math.floor(pageHeight / lineHeight); + gridLines = ''; + + for (i = numGridLines - 1; i >= 1; i--) { + gridLines += '
'; + } + overlay.append(gridLines); + + // vertical grid + overlay.prepend($('
')); + overlayVert = overlay.children('.vert-container'); + gridWidth = overlay.width(); + overlayVert.css({position: 'absolute', top: 0}); + overlayVert.append('
'); + + // 50 is an arbitrarily large number... + // can't calculate the margin width properly + gridLines = ''; + for (i = 0; i < 50; i++) { + gridLines += '
'; + } + overlayVert.append(gridLines); + overlayVert.children() + .css({ display: 'inline-block' }) + .height(pageHeight); + + // Check for saved state + overlayCookie = readCookie(options.cookiePrefix + options.id); + if (typeof overlayCookie == 'string') { + state = overlayCookie.split('-'); + state[2] = Number(state[2]); + if ((typeof state[2] == 'number') && !isNaN(state[2])) { + classNumber = state[2].toFixed(0); + overlay.addClass(options.classPrefix + classNumber); + } + if (state[1] == 'F') { + overlayZState = 'F'; + overlay.css('z-index', overlayZForeground); + } + if (state[0] == '1') { + overlayOn = true; + sticky = true; + showOverlay(); + } + } + else { + overlay.addClass(options.classPrefix + classNumber); + } + + // Keyboard controls + $(document).bind('keydown', keydownHandler); + $(document).bind('keyup', keyupHandler); + + /** + * Helpers + */ + + function getModifier(e) { + if (options.modifierKey == null) return true; // Bypass by default + var m = true; + switch(options.modifierKey) { + case 'ctrl': + m = (e.ctrlKey ? e.ctrlKey : false); + break; + + case 'alt': + m = (e.altKey ? e.altKey : false); + break; + + case 'shift': + m = (e.shiftKey ? e.shiftKey : false); + break; + } + return m; + } + + function getKey(e) { + var k = false, c = (e.keyCode ? e.keyCode : e.which); + // Handle keywords + if (c == 13) k = 'enter'; + // Handle letters + else k = String.fromCharCode(c).toLowerCase(); + return k; + } + + function saveState() { + createCookie(options.cookiePrefix + options.id, (sticky ? '1' : '0') + '-' + overlayZState + '-' + classNumber, 1); + } + + function showOverlay() { + overlay.show(); + //overlayVert.css({width: overlay.width()}); + // hide any vertical blocks that aren't at the top of the viewport + /* + overlayVert.children('.vert').each(function () { + var vCol = $(this); + vCol.css('display','inline-block'); + if (vCol.offset().top > vCol.parent().offset().top) { + vCol.hide(); + } + }); + */ + } + + /** + * Event handlers + */ + + function keydownHandler(e) { + var k, + m, + source = e.target.tagName.toLowerCase(); + + if ((source == 'input') || (source == 'textarea') || (source == 'select')) { + return true; + } + + m = getModifier(e); + if (!m) { + return true; + } + + k = getKey(e); + if (!k) { + return true; + } + + switch(k) { + case options.showGridKey: + if (!overlayOn) { + showOverlay(); + overlayOn = true; + } + else if (sticky) { + overlay.hide(); + overlayOn = false; + sticky = false; + saveState(); + } + break; + case options.holdGridKey: + if (overlayOn && !sticky) { + // Turn sticky overlay on + sticky = true; + saveState(); + } + break; + case options.foregroundKey: + if (overlayOn) { + // Toggle sticky overlay z-index + if (overlay.css('z-index') == overlayZForeground) { + overlay.css('z-index', overlayZBackground); + overlayZState = 'B'; + } + else { + overlay.css('z-index', overlayZForeground); + overlayZState = 'F'; + } + saveState(); + } + break; + case options.jumpGridsKey: + if (overlayOn && (options.numberOfGrids > 1)) { + // Cycle through the available grids + overlay.removeClass(options.classPrefix + classNumber); + classNumber++; + if (classNumber > options.numberOfGrids) classNumber = 1; + overlay.addClass(options.classPrefix + classNumber); + showOverlay(); + if (/webkit/.test( navigator.userAgent.toLowerCase() )) { + forceRepaint(); + } + saveState(); + } + break; + } + + return true; + } + + function keyupHandler(e) { + var k, + m = getModifier(e); + + if (!m) { + return true; + } + + k = getKey(e); + + if (k && (k == options.showGridKey) && !sticky) { + overlay.hide(); + overlayOn = false; + } + + return true; + } + + /** + * Cookie functions + * + * By Peter-Paul Koch: + * http://www.quirksmode.org/js/cookies.html + */ + function createCookie(name, value, days) { + var date, + expires = ""; + + if (days) { + date = new Date(); + date.setTime( date.getTime() + (days*24*60*60*1000) ); + expires = "; expires=" + date.toGMTString(); + } + + document.cookie = name + "=" + value + expires + "; path=/"; + } + + function readCookie(name) { + var c, + ca = document.cookie.split(';'), + i = 0, + len = ca.length, + nameEQ = name + "="; + + for (; i < len; i++) { + c = ca[i]; + + while (c.charAt(0) == ' ') { + c = c.substring(1, c.length); + } + + if (c.indexOf(nameEQ) == 0) { + return c.substring(nameEQ.length, c.length); + } + } + return null; + } + + function eraseCookie(name) { + createCookie(name, "", -1); + } + + /** + * Forces a repaint (because WebKit has issues) + * http://www.sitepoint.com/forums/showthread.php?p=4538763 + * http://www.phpied.com/the-new-game-show-will-it-reflow/ + */ + function forceRepaint() { + var ss = document.styleSheets[0]; + try { + ss.addRule('.xxxxxx', 'position: relative'); + ss.removeRule(ss.rules.length - 1); + } catch(e) {} + } + + return {}; +}; + + +/** + * You can call hashgrid from your own code, but it's loaded here as + * an example for your convenience. + */ +$(document).ready(function() { + + var grid = new hashgrid({ + numberOfGrids: 3 + }); + +}); diff --git a/js/lib/jquery.js b/js/lib/jquery.js index 74ce411..f65cf1d 100644 --- a/js/lib/jquery.js +++ b/js/lib/jquery.js @@ -1,9266 +1,2 @@ -/*! - * jQuery JavaScript Library v1.7.1 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Mon Nov 21 21:11:03 2011 -0500 - */ -(function( window, undefined ) { - -// Use the correct document accordingly with window argument (sandbox) -var document = window.document, - navigator = window.navigator, - location = window.location; -var jQuery = (function() { - -// Define a local copy of jQuery -var jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context, rootjQuery ); - }, - - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - - // Map over the $ in case of overwrite - _$ = window.$, - - // A central reference to the root jQuery(document) - rootjQuery, - - // A simple way to check for HTML strings or ID strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, - - // Check if a string has a non-whitespace character in it - rnotwhite = /\S/, - - // Used for trimming whitespace - trimLeft = /^\s+/, - trimRight = /\s+$/, - - // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, - - // JSON RegExp - rvalidchars = /^[\],:{}\s]*$/, - rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, - rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, - rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, - - // Useragent RegExp - rwebkit = /(webkit)[ \/]([\w.]+)/, - ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, - rmsie = /(msie) ([\w.]+)/, - rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, - - // Matches dashed string for camelizing - rdashAlpha = /-([a-z]|[0-9])/ig, - rmsPrefix = /^-ms-/, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return ( letter + "" ).toUpperCase(); - }, - - // Keep a UserAgent string for use with jQuery.browser - userAgent = navigator.userAgent, - - // For matching the engine and version of the browser - browserMatch, - - // The deferred used on DOM ready - readyList, - - // The ready event handler - DOMContentLoaded, - - // Save a reference to some core methods - toString = Object.prototype.toString, - hasOwn = Object.prototype.hasOwnProperty, - push = Array.prototype.push, - slice = Array.prototype.slice, - trim = String.prototype.trim, - indexOf = Array.prototype.indexOf, - - // [[Class]] -> type pairs - class2type = {}; - -jQuery.fn = jQuery.prototype = { - constructor: jQuery, - init: function( selector, context, rootjQuery ) { - var match, elem, ret, doc; - - // Handle $(""), $(null), or $(undefined) - if ( !selector ) { - return this; - } - - // Handle $(DOMElement) - if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - } - - // The body element only exists once, optimize finding it - if ( selector === "body" && !context && document.body ) { - this.context = document; - this[0] = document.body; - this.selector = selector; - this.length = 1; - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - // Are we dealing with HTML string or an ID? - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = quickExpr.exec( selector ); - } - - // Verify a match, and that no context was specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - doc = ( context ? context.ownerDocument || context : document ); - - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - ret = rsingleTag.exec( selector ); - - if ( ret ) { - if ( jQuery.isPlainObject( context ) ) { - selector = [ document.createElement( ret[1] ) ]; - jQuery.fn.attr.call( selector, context, true ); - - } else { - selector = [ doc.createElement( ret[1] ) ]; - } - - } else { - ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); - selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes; - } - - return jQuery.merge( this, selector ); - - // HANDLE: $("#id") - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return rootjQuery.ready( selector ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }, - - // Start with an empty selector - selector: "", - - // The current version of jQuery being used - jquery: "1.7.1", - - // The default length of a jQuery object is 0 - length: 0, - - // The number of elements contained in the matched element set - size: function() { - return this.length; - }, - - toArray: function() { - return slice.call( this, 0 ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num == null ? - - // Return a 'clean' array - this.toArray() : - - // Return just the object - ( num < 0 ? this[ this.length + num ] : this[ num ] ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems, name, selector ) { - // Build a new jQuery matched element set - var ret = this.constructor(); - - if ( jQuery.isArray( elems ) ) { - push.apply( ret, elems ); - - } else { - jQuery.merge( ret, elems ); - } - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - ret.context = this.context; - - if ( name === "find" ) { - ret.selector = this.selector + ( this.selector ? " " : "" ) + selector; - } else if ( name ) { - ret.selector = this.selector + "." + name + "(" + selector + ")"; - } - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - ready: function( fn ) { - // Attach the listeners - jQuery.bindReady(); - - // Add the callback - readyList.add( fn ); - - return this; - }, - - eq: function( i ) { - i = +i; - return i === -1 ? - this.slice( i ) : - this.slice( i, i + 1 ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ), - "slice", slice.call(arguments).join(",") ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: [].sort, - splice: [].splice -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( length === i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - noConflict: function( deep ) { - if ( window.$ === jQuery ) { - window.$ = _$; - } - - if ( deep && window.jQuery === jQuery ) { - window.jQuery = _jQuery; - } - - return jQuery; - }, - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - // Either a released hold or an DOMready/load event and not yet ready - if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready, 1 ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.fireWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger( "ready" ).off( "ready" ); - } - } - }, - - bindReady: function() { - if ( readyList ) { - return; - } - - readyList = jQuery.Callbacks( "once memory" ); - - // Catch cases where $(document).ready() is called after the - // browser event has already occurred. - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - return setTimeout( jQuery.ready, 1 ); - } - - // Mozilla, Opera and webkit nightlies currently support this event - if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", jQuery.ready, false ); - - // If IE event model is used - } else if ( document.attachEvent ) { - // ensure firing before onload, - // maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", DOMContentLoaded ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", jQuery.ready ); - - // If IE and not a frame - // continually check to see if the document is ready - var toplevel = false; - - try { - toplevel = window.frameElement == null; - } catch(e) {} - - if ( document.documentElement.doScroll && toplevel ) { - doScrollCheck(); - } - } - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - // A crude way of determining if an object is a window - isWindow: function( obj ) { - return obj && typeof obj === "object" && "setInterval" in obj; - }, - - isNumeric: function( obj ) { - return !isNaN( parseFloat(obj) ) && isFinite( obj ); - }, - - type: function( obj ) { - return obj == null ? - String( obj ) : - class2type[ toString.call(obj) ] || "object"; - }, - - isPlainObject: function( obj ) { - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - // Not own constructor property must be Object - if ( obj.constructor && - !hasOwn.call(obj, "constructor") && - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - } catch ( e ) { - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - - var key; - for ( key in obj ) {} - - return key === undefined || hasOwn.call( obj, key ); - }, - - isEmptyObject: function( obj ) { - for ( var name in obj ) { - return false; - } - return true; - }, - - error: function( msg ) { - throw new Error( msg ); - }, - - parseJSON: function( data ) { - if ( typeof data !== "string" || !data ) { - return null; - } - - // Make sure leading/trailing whitespace is removed (IE can't handle it) - data = jQuery.trim( data ); - - // Attempt to parse using the native JSON parser first - if ( window.JSON && window.JSON.parse ) { - return window.JSON.parse( data ); - } - - // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js - if ( rvalidchars.test( data.replace( rvalidescape, "@" ) - .replace( rvalidtokens, "]" ) - .replace( rvalidbraces, "")) ) { - - return ( new Function( "return " + data ) )(); - - } - jQuery.error( "Invalid JSON: " + data ); - }, - - // Cross-browser xml parsing - parseXML: function( data ) { - var xml, tmp; - try { - if ( window.DOMParser ) { // Standard - tmp = new DOMParser(); - xml = tmp.parseFromString( data , "text/xml" ); - } else { // IE - xml = new ActiveXObject( "Microsoft.XMLDOM" ); - xml.async = "false"; - xml.loadXML( data ); - } - } catch( e ) { - xml = undefined; - } - if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; - }, - - noop: function() {}, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && rnotwhite.test( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); - }, - - // args is for internal usage only - each: function( object, callback, args ) { - var name, i = 0, - length = object.length, - isObj = length === undefined || jQuery.isFunction( object ); - - if ( args ) { - if ( isObj ) { - for ( name in object ) { - if ( callback.apply( object[ name ], args ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.apply( object[ i++ ], args ) === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isObj ) { - for ( name in object ) { - if ( callback.call( object[ name ], name, object[ name ] ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { - break; - } - } - } - } - - return object; - }, - - // Use native String.trim function wherever possible - trim: trim ? - function( text ) { - return text == null ? - "" : - trim.call( text ); - } : - - // Otherwise use our own trimming functionality - function( text ) { - return text == null ? - "" : - text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); - }, - - // results is for internal usage only - makeArray: function( array, results ) { - var ret = results || []; - - if ( array != null ) { - // The window, strings (and functions) also have 'length' - // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 - var type = jQuery.type( array ); - - if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { - push.call( ret, array ); - } else { - jQuery.merge( ret, array ); - } - } - - return ret; - }, - - inArray: function( elem, array, i ) { - var len; - - if ( array ) { - if ( indexOf ) { - return indexOf.call( array, elem, i ); - } - - len = array.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - // Skip accessing in sparse arrays - if ( i in array && array[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var i = first.length, - j = 0; - - if ( typeof second.length === "number" ) { - for ( var l = second.length; j < l; j++ ) { - first[ i++ ] = second[ j ]; - } - - } else { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, inv ) { - var ret = [], retVal; - inv = !!inv; - - // Go through the array, only saving the items - // that pass the validator function - for ( var i = 0, length = elems.length; i < length; i++ ) { - retVal = !!callback( elems[ i ], i ); - if ( inv !== retVal ) { - ret.push( elems[ i ] ); - } - } - - return ret; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, key, ret = [], - i = 0, - length = elems.length, - // jquery objects are treated as arrays - isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; - - // Go through the array, translating each of the items to their - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - - // Go through every key on the object, - } else { - for ( key in elems ) { - value = callback( elems[ key ], key, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - } - - // Flatten any nested arrays - return ret.concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - if ( typeof context === "string" ) { - var tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - var args = slice.call( arguments, 2 ), - proxy = function() { - return fn.apply( context, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; - - return proxy; - }, - - // Mutifunctional method to get and set values to a collection - // The value/s can optionally be executed if it's a function - access: function( elems, key, value, exec, fn, pass ) { - var length = elems.length; - - // Setting many attributes - if ( typeof key === "object" ) { - for ( var k in key ) { - jQuery.access( elems, k, key[k], exec, fn, value ); - } - return elems; - } - - // Setting one attribute - if ( value !== undefined ) { - // Optionally, function values get executed if exec is true - exec = !pass && exec && jQuery.isFunction(value); - - for ( var i = 0; i < length; i++ ) { - fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); - } - - return elems; - } - - // Getting an attribute - return length ? fn( elems[0], key ) : undefined; - }, - - now: function() { - return ( new Date() ).getTime(); - }, - - // Use of jQuery.browser is frowned upon. - // More details: http://docs.jquery.com/Utilities/jQuery.browser - uaMatch: function( ua ) { - ua = ua.toLowerCase(); - - var match = rwebkit.exec( ua ) || - ropera.exec( ua ) || - rmsie.exec( ua ) || - ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || - []; - - return { browser: match[1] || "", version: match[2] || "0" }; - }, - - sub: function() { - function jQuerySub( selector, context ) { - return new jQuerySub.fn.init( selector, context ); - } - jQuery.extend( true, jQuerySub, this ); - jQuerySub.superclass = this; - jQuerySub.fn = jQuerySub.prototype = this(); - jQuerySub.fn.constructor = jQuerySub; - jQuerySub.sub = this.sub; - jQuerySub.fn.init = function init( selector, context ) { - if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { - context = jQuerySub( context ); - } - - return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); - }; - jQuerySub.fn.init.prototype = jQuerySub.fn; - var rootjQuerySub = jQuerySub(document); - return jQuerySub; - }, - - browser: {} -}); - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -browserMatch = jQuery.uaMatch( userAgent ); -if ( browserMatch.browser ) { - jQuery.browser[ browserMatch.browser ] = true; - jQuery.browser.version = browserMatch.version; -} - -// Deprecated, use jQuery.browser.webkit instead -if ( jQuery.browser.webkit ) { - jQuery.browser.safari = true; -} - -// IE doesn't match non-breaking spaces with \s -if ( rnotwhite.test( "\xA0" ) ) { - trimLeft = /^[\s\xA0]+/; - trimRight = /[\s\xA0]+$/; -} - -// All jQuery objects should point back to these -rootjQuery = jQuery(document); - -// Cleanup functions for the document ready method -if ( document.addEventListener ) { - DOMContentLoaded = function() { - document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - jQuery.ready(); - }; - -} else if ( document.attachEvent ) { - DOMContentLoaded = function() { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( document.readyState === "complete" ) { - document.detachEvent( "onreadystatechange", DOMContentLoaded ); - jQuery.ready(); - } - }; -} - -// The DOM ready check for Internet Explorer -function doScrollCheck() { - if ( jQuery.isReady ) { - return; - } - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch(e) { - setTimeout( doScrollCheck, 1 ); - return; - } - - // and execute any waiting functions - jQuery.ready(); -} - -return jQuery; - -})(); - - -// String to Object flags format cache -var flagsCache = {}; - -// Convert String-formatted flags into Object-formatted ones and store in cache -function createFlags( flags ) { - var object = flagsCache[ flags ] = {}, - i, length; - flags = flags.split( /\s+/ ); - for ( i = 0, length = flags.length; i < length; i++ ) { - object[ flags[i] ] = true; - } - return object; -} - -/* - * Create a callback list using the following parameters: - * - * flags: an optional list of space-separated flags that will change how - * the callback list behaves - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible flags: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( flags ) { - - // Convert flags from String-formatted to Object-formatted - // (we check in cache first) - flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {}; - - var // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = [], - // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list is currently firing - firing, - // First callback to fire (used internally by add and fireWith) - firingStart, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // Add one or several callbacks to the list - add = function( args ) { - var i, - length, - elem, - type, - actual; - for ( i = 0, length = args.length; i < length; i++ ) { - elem = args[ i ]; - type = jQuery.type( elem ); - if ( type === "array" ) { - // Inspect recursively - add( elem ); - } else if ( type === "function" ) { - // Add if not in unique mode and callback is not in - if ( !flags.unique || !self.has( elem ) ) { - list.push( elem ); - } - } - } - }, - // Fire callbacks - fire = function( context, args ) { - args = args || []; - memory = !flags.memory || [ context, args ]; - firing = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) { - memory = true; // Mark as halted - break; - } - } - firing = false; - if ( list ) { - if ( !flags.once ) { - if ( stack && stack.length ) { - memory = stack.shift(); - self.fireWith( memory[ 0 ], memory[ 1 ] ); - } - } else if ( memory === true ) { - self.disable(); - } else { - list = []; - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - var length = list.length; - add( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away, unless previous - // firing was halted (stopOnFalse) - } else if ( memory && memory !== true ) { - firingStart = length; - fire( memory[ 0 ], memory[ 1 ] ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - var args = arguments, - argIndex = 0, - argLength = args.length; - for ( ; argIndex < argLength ; argIndex++ ) { - for ( var i = 0; i < list.length; i++ ) { - if ( args[ argIndex ] === list[ i ] ) { - // Handle firingIndex and firingLength - if ( firing ) { - if ( i <= firingLength ) { - firingLength--; - if ( i <= firingIndex ) { - firingIndex--; - } - } - } - // Remove the element - list.splice( i--, 1 ); - // If we have some unicity property then - // we only need to do this once - if ( flags.unique ) { - break; - } - } - } - } - } - return this; - }, - // Control if a given callback is in the list - has: function( fn ) { - if ( list ) { - var i = 0, - length = list.length; - for ( ; i < length; i++ ) { - if ( fn === list[ i ] ) { - return true; - } - } - } - return false; - }, - // Remove all callbacks from the list - empty: function() { - list = []; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory || memory === true ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( stack ) { - if ( firing ) { - if ( !flags.once ) { - stack.push( [ context, args ] ); - } - } else if ( !( flags.once && memory ) ) { - fire( context, args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!memory; - } - }; - - return self; -}; - - - - -var // Static reference to slice - sliceDeferred = [].slice; - -jQuery.extend({ - - Deferred: function( func ) { - var doneList = jQuery.Callbacks( "once memory" ), - failList = jQuery.Callbacks( "once memory" ), - progressList = jQuery.Callbacks( "memory" ), - state = "pending", - lists = { - resolve: doneList, - reject: failList, - notify: progressList - }, - promise = { - done: doneList.add, - fail: failList.add, - progress: progressList.add, - - state: function() { - return state; - }, - - // Deprecated - isResolved: doneList.fired, - isRejected: failList.fired, - - then: function( doneCallbacks, failCallbacks, progressCallbacks ) { - deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks ); - return this; - }, - always: function() { - deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); - return this; - }, - pipe: function( fnDone, fnFail, fnProgress ) { - return jQuery.Deferred(function( newDefer ) { - jQuery.each( { - done: [ fnDone, "resolve" ], - fail: [ fnFail, "reject" ], - progress: [ fnProgress, "notify" ] - }, function( handler, data ) { - var fn = data[ 0 ], - action = data[ 1 ], - returned; - if ( jQuery.isFunction( fn ) ) { - deferred[ handler ](function() { - returned = fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify ); - } else { - newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); - } - }); - } else { - deferred[ handler ]( newDefer[ action ] ); - } - }); - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - if ( obj == null ) { - obj = promise; - } else { - for ( var key in promise ) { - obj[ key ] = promise[ key ]; - } - } - return obj; - } - }, - deferred = promise.promise({}), - key; - - for ( key in lists ) { - deferred[ key ] = lists[ key ].fire; - deferred[ key + "With" ] = lists[ key ].fireWith; - } - - // Handle state - deferred.done( function() { - state = "resolved"; - }, failList.disable, progressList.lock ).fail( function() { - state = "rejected"; - }, doneList.disable, progressList.lock ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( firstParam ) { - var args = sliceDeferred.call( arguments, 0 ), - i = 0, - length = args.length, - pValues = new Array( length ), - count = length, - pCount = length, - deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? - firstParam : - jQuery.Deferred(), - promise = deferred.promise(); - function resolveFunc( i ) { - return function( value ) { - args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; - if ( !( --count ) ) { - deferred.resolveWith( deferred, args ); - } - }; - } - function progressFunc( i ) { - return function( value ) { - pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; - deferred.notifyWith( promise, pValues ); - }; - } - if ( length > 1 ) { - for ( ; i < length; i++ ) { - if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) { - args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) ); - } else { - --count; - } - } - if ( !count ) { - deferred.resolveWith( deferred, args ); - } - } else if ( deferred !== firstParam ) { - deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); - } - return promise; - } -}); - - - - -jQuery.support = (function() { - - var support, - all, - a, - select, - opt, - input, - marginDiv, - fragment, - tds, - events, - eventName, - i, - isSupported, - div = document.createElement( "div" ), - documentElement = document.documentElement; - - // Preliminary tests - div.setAttribute("className", "t"); - div.innerHTML = "
a"; - - all = div.getElementsByTagName( "*" ); - a = div.getElementsByTagName( "a" )[ 0 ]; - - // Can't get basic test support - if ( !all || !all.length || !a ) { - return {}; - } - - // First batch of supports tests - select = document.createElement( "select" ); - opt = select.appendChild( document.createElement("option") ); - input = div.getElementsByTagName( "input" )[ 0 ]; - - support = { - // IE strips leading whitespace when .innerHTML is used - leadingWhitespace: ( div.firstChild.nodeType === 3 ), - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - tbody: !div.getElementsByTagName("tbody").length, - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - htmlSerialize: !!div.getElementsByTagName("link").length, - - // Get the style information from getAttribute - // (IE uses .cssText instead) - style: /top/.test( a.getAttribute("style") ), - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - hrefNormalized: ( a.getAttribute("href") === "/a" ), - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - opacity: /^0.55/.test( a.style.opacity ), - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - cssFloat: !!a.style.cssFloat, - - // Make sure that if no value is specified for a checkbox - // that it defaults to "on". - // (WebKit defaults to "" instead) - checkOn: ( input.value === "on" ), - - // Make sure that a selected-by-default option has a working selected property. - // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) - optSelected: opt.selected, - - // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) - getSetAttribute: div.className !== "t", - - // Tests for enctype support on a form(#6743) - enctype: !!document.createElement("form").enctype, - - // Makes sure cloning an html5 element does not cause problems - // Where outerHTML is undefined, this still works - html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>", - - // Will be defined later - submitBubbles: true, - changeBubbles: true, - focusinBubbles: false, - deleteExpando: true, - noCloneEvent: true, - inlineBlockNeedsLayout: false, - shrinkWrapBlocks: false, - reliableMarginRight: true - }; - - // Make sure checked status is properly cloned - input.checked = true; - support.noCloneChecked = input.cloneNode( true ).checked; - - // Make sure that the options inside disabled selects aren't marked as disabled - // (WebKit marks them as disabled) - select.disabled = true; - support.optDisabled = !opt.disabled; - - // Test to see if it's possible to delete an expando from an element - // Fails in Internet Explorer - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - - if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { - div.attachEvent( "onclick", function() { - // Cloning a node shouldn't copy over any - // bound event handlers (IE does this) - support.noCloneEvent = false; - }); - div.cloneNode( true ).fireEvent( "onclick" ); - } - - // Check if a radio maintains its value - // after being appended to the DOM - input = document.createElement("input"); - input.value = "t"; - input.setAttribute("type", "radio"); - support.radioValue = input.value === "t"; - - input.setAttribute("checked", "checked"); - div.appendChild( input ); - fragment = document.createDocumentFragment(); - fragment.appendChild( div.lastChild ); - - // WebKit doesn't clone checked state correctly in fragments - support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - support.appendChecked = input.checked; - - fragment.removeChild( input ); - fragment.appendChild( div ); - - div.innerHTML = ""; - - // Check if div with explicit width and no margin-right incorrectly - // gets computed margin-right based on width of container. For more - // info see bug #3333 - // Fails in WebKit before Feb 2011 nightlies - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right - if ( window.getComputedStyle ) { - marginDiv = document.createElement( "div" ); - marginDiv.style.width = "0"; - marginDiv.style.marginRight = "0"; - div.style.width = "2px"; - div.appendChild( marginDiv ); - support.reliableMarginRight = - ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; - } - - // Technique from Juriy Zaytsev - // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ - // We only care about the case where non-standard event systems - // are used, namely in IE. Short-circuiting here helps us to - // avoid an eval call (in setAttribute) which can cause CSP - // to go haywire. See: https://developer.mozilla.org/en/Security/CSP - if ( div.attachEvent ) { - for( i in { - submit: 1, - change: 1, - focusin: 1 - }) { - eventName = "on" + i; - isSupported = ( eventName in div ); - if ( !isSupported ) { - div.setAttribute( eventName, "return;" ); - isSupported = ( typeof div[ eventName ] === "function" ); - } - support[ i + "Bubbles" ] = isSupported; - } - } - - fragment.removeChild( div ); - - // Null elements to avoid leaks in IE - fragment = select = opt = marginDiv = div = input = null; - - // Run tests that need a body at doc ready - jQuery(function() { - var container, outer, inner, table, td, offsetSupport, - conMarginTop, ptlm, vb, style, html, - body = document.getElementsByTagName("body")[0]; - - if ( !body ) { - // Return for frameset docs that don't have a body - return; - } - - conMarginTop = 1; - ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;"; - vb = "visibility:hidden;border:0;"; - style = "style='" + ptlm + "border:5px solid #000;padding:0;'"; - html = "
" + - "" + - "
"; - - container = document.createElement("div"); - container.style.cssText = vb + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px"; - body.insertBefore( container, body.firstChild ); - - // Construct the test element - div = document.createElement("div"); - container.appendChild( div ); - - // Check if table cells still have offsetWidth/Height when they are set - // to display:none and there are still other visible table cells in a - // table row; if so, offsetWidth/Height are not reliable for use when - // determining if an element has been hidden directly using - // display:none (it is still safe to use offsets if a parent element is - // hidden; don safety goggles and see bug #4512 for more information). - // (only IE 8 fails this test) - div.innerHTML = "
t
"; - tds = div.getElementsByTagName( "td" ); - isSupported = ( tds[ 0 ].offsetHeight === 0 ); - - tds[ 0 ].style.display = ""; - tds[ 1 ].style.display = "none"; - - // Check if empty table cells still have offsetWidth/Height - // (IE <= 8 fail this test) - support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); - - // Figure out if the W3C box model works as expected - div.innerHTML = ""; - div.style.width = div.style.paddingLeft = "1px"; - jQuery.boxModel = support.boxModel = div.offsetWidth === 2; - - if ( typeof div.style.zoom !== "undefined" ) { - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - // (IE < 8 does this) - div.style.display = "inline"; - div.style.zoom = 1; - support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 ); - - // Check if elements with layout shrink-wrap their children - // (IE 6 does this) - div.style.display = ""; - div.innerHTML = "
"; - support.shrinkWrapBlocks = ( div.offsetWidth !== 2 ); - } - - div.style.cssText = ptlm + vb; - div.innerHTML = html; - - outer = div.firstChild; - inner = outer.firstChild; - td = outer.nextSibling.firstChild.firstChild; - - offsetSupport = { - doesNotAddBorder: ( inner.offsetTop !== 5 ), - doesAddBorderForTableAndCells: ( td.offsetTop === 5 ) - }; - - inner.style.position = "fixed"; - inner.style.top = "20px"; - - // safari subtracts parent border width here which is 5px - offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 ); - inner.style.position = inner.style.top = ""; - - outer.style.overflow = "hidden"; - outer.style.position = "relative"; - - offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 ); - offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop ); - - body.removeChild( container ); - div = container = null; - - jQuery.extend( support, offsetSupport ); - }); - - return support; -})(); - - - - -var rbrace = /^(?:\{.*\}|\[.*\])$/, - rmultiDash = /([A-Z])/g; - -jQuery.extend({ - cache: {}, - - // Please use with caution - uuid: 0, - - // Unique for each copy of jQuery on the page - // Non-digits removed to match rinlinejQuery - expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), - - // The following elements throw uncatchable exceptions if you - // attempt to add expando properties to them. - noData: { - "embed": true, - // Ban all objects except for Flash (which handle expandos) - "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", - "applet": true - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var privateCache, thisCache, ret, - internalKey = jQuery.expando, - getByName = typeof name === "string", - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey, - isEvents = name === "events"; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - elem[ internalKey ] = id = ++jQuery.uuid; - } else { - id = internalKey; - } - } - - if ( !cache[ id ] ) { - cache[ id ] = {}; - - // Avoids exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - if ( !isNode ) { - cache[ id ].toJSON = jQuery.noop; - } - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - privateCache = thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // Users should not attempt to inspect the internal events object using jQuery.data, - // it is undocumented and subject to change. But does anyone listen? No. - if ( isEvents && !thisCache[ name ] ) { - return privateCache.events; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( getByName ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; - }, - - removeData: function( elem, name, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, i, l, - - // Reference to internal data cache key - internalKey = jQuery.expando, - - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - - // See jQuery.data for more information - id = isNode ? elem[ internalKey ] : internalKey; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support array or space separated string names for data keys - if ( !jQuery.isArray( name ) ) { - - // try the string as a key before any manipulation - if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces unless a key with the spaces exists - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split( " " ); - } - } - } - - for ( i = 0, l = name.length; i < l; i++ ) { - delete thisCache[ name[i] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject(cache[ id ]) ) { - return; - } - } - - // Browsers that fail expando deletion also refuse to delete expandos on - // the window, but it will allow it on all other JS objects; other browsers - // don't care - // Ensure that `cache` is not a window object #10080 - if ( jQuery.support.deleteExpando || !cache.setInterval ) { - delete cache[ id ]; - } else { - cache[ id ] = null; - } - - // We destroyed the cache and need to eliminate the expando on the node to avoid - // false lookups in the cache for entries that no longer exist - if ( isNode ) { - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( jQuery.support.deleteExpando ) { - delete elem[ internalKey ]; - } else if ( elem.removeAttribute ) { - elem.removeAttribute( internalKey ); - } else { - elem[ internalKey ] = null; - } - } - }, - - // For internal use only. - _data: function( elem, name, data ) { - return jQuery.data( elem, name, data, true ); - }, - - // A method for determining if a DOM node can handle the data expando - acceptData: function( elem ) { - if ( elem.nodeName ) { - var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; - - if ( match ) { - return !(match === true || elem.getAttribute("classid") !== match); - } - } - - return true; - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var parts, attr, name, - data = null; - - if ( typeof key === "undefined" ) { - if ( this.length ) { - data = jQuery.data( this[0] ); - - if ( this[0].nodeType === 1 && !jQuery._data( this[0], "parsedAttrs" ) ) { - attr = this[0].attributes; - for ( var i = 0, l = attr.length; i < l; i++ ) { - name = attr[i].name; - - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.substring(5) ); - - dataAttr( this[0], name, data[ name ] ); - } - } - jQuery._data( this[0], "parsedAttrs", true ); - } - } - - return data; - - } else if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - parts = key.split("."); - parts[1] = parts[1] ? "." + parts[1] : ""; - - if ( value === undefined ) { - data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); - - // Try to fetch any internally stored data first - if ( data === undefined && this.length ) { - data = jQuery.data( this[0], key ); - data = dataAttr( this[0], key, data ); - } - - return data === undefined && parts[1] ? - this.data( parts[0] ) : - data; - - } else { - return this.each(function() { - var self = jQuery( this ), - args = [ parts[0], value ]; - - self.triggerHandler( "setData" + parts[1] + "!", args ); - jQuery.data( this, key, value ); - self.triggerHandler( "changeData" + parts[1] + "!", args ); - }); - } - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - jQuery.isNumeric( data ) ? parseFloat( data ) : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - for ( var name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} - - - - -function handleQueueMarkDefer( elem, type, src ) { - var deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - defer = jQuery._data( elem, deferDataKey ); - if ( defer && - ( src === "queue" || !jQuery._data(elem, queueDataKey) ) && - ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) { - // Give room for hard-coded callbacks to fire first - // and eventually mark/queue something else on the element - setTimeout( function() { - if ( !jQuery._data( elem, queueDataKey ) && - !jQuery._data( elem, markDataKey ) ) { - jQuery.removeData( elem, deferDataKey, true ); - defer.fire(); - } - }, 0 ); - } -} - -jQuery.extend({ - - _mark: function( elem, type ) { - if ( elem ) { - type = ( type || "fx" ) + "mark"; - jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 ); - } - }, - - _unmark: function( force, elem, type ) { - if ( force !== true ) { - type = elem; - elem = force; - force = false; - } - if ( elem ) { - type = type || "fx"; - var key = type + "mark", - count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 ); - if ( count ) { - jQuery._data( elem, key, count ); - } else { - jQuery.removeData( elem, key, true ); - handleQueueMarkDefer( elem, type, "mark" ); - } - } - }, - - queue: function( elem, type, data ) { - var q; - if ( elem ) { - type = ( type || "fx" ) + "queue"; - q = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !q || jQuery.isArray(data) ) { - q = jQuery._data( elem, type, jQuery.makeArray(data) ); - } else { - q.push( data ); - } - } - return q || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - fn = queue.shift(), - hooks = {}; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - } - - if ( fn ) { - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - jQuery._data( elem, type + ".run", hooks ); - fn.call( elem, function() { - jQuery.dequeue( elem, type ); - }, hooks ); - } - - if ( !queue.length ) { - jQuery.removeData( elem, type + "queue " + type + ".run", true ); - handleQueueMarkDefer( elem, type, "queue" ); - } - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - } - - if ( data === undefined ) { - return jQuery.queue( this[0], type ); - } - return this.each(function() { - var queue = jQuery.queue( this, type, data ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ - delay: function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = setTimeout( next, time ); - hooks.stop = function() { - clearTimeout( timeout ); - }; - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, object ) { - if ( typeof type !== "string" ) { - object = type; - type = undefined; - } - type = type || "fx"; - var defer = jQuery.Deferred(), - elements = this, - i = elements.length, - count = 1, - deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - tmp; - function resolve() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - } - while( i-- ) { - if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || - ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || - jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && - jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) { - count++; - tmp.add( resolve ); - } - } - resolve(); - return defer.promise(); - } -}); - - - - -var rclass = /[\n\t\r]/g, - rspace = /\s+/, - rreturn = /\r/g, - rtype = /^(?:button|input)$/i, - rfocusable = /^(?:button|input|object|select|textarea)$/i, - rclickable = /^a(?:rea)?$/i, - rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, - getSetAttribute = jQuery.support.getSetAttribute, - nodeHook, boolHook, fixSpecified; - -jQuery.fn.extend({ - attr: function( name, value ) { - return jQuery.access( this, name, value, true, jQuery.attr ); - }, - - removeAttr: function( name ) { - return this.each(function() { - jQuery.removeAttr( this, name ); - }); - }, - - prop: function( name, value ) { - return jQuery.access( this, name, value, true, jQuery.prop ); - }, - - removeProp: function( name ) { - name = jQuery.propFix[ name ] || name; - return this.each(function() { - // try/catch handles cases where IE balks (such as removing a property on window) - try { - this[ name ] = undefined; - delete this[ name ]; - } catch( e ) {} - }); - }, - - addClass: function( value ) { - var classNames, i, l, elem, - setClass, c, cl; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).addClass( value.call(this, j, this.className) ); - }); - } - - if ( value && typeof value === "string" ) { - classNames = value.split( rspace ); - - for ( i = 0, l = this.length; i < l; i++ ) { - elem = this[ i ]; - - if ( elem.nodeType === 1 ) { - if ( !elem.className && classNames.length === 1 ) { - elem.className = value; - - } else { - setClass = " " + elem.className + " "; - - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { - setClass += classNames[ c ] + " "; - } - } - elem.className = jQuery.trim( setClass ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classNames, i, l, elem, className, c, cl; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).removeClass( value.call(this, j, this.className) ); - }); - } - - if ( (value && typeof value === "string") || value === undefined ) { - classNames = ( value || "" ).split( rspace ); - - for ( i = 0, l = this.length; i < l; i++ ) { - elem = this[ i ]; - - if ( elem.nodeType === 1 && elem.className ) { - if ( value ) { - className = (" " + elem.className + " ").replace( rclass, " " ); - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - className = className.replace(" " + classNames[ c ] + " ", " "); - } - elem.className = jQuery.trim( className ); - - } else { - elem.className = ""; - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isBool = typeof stateVal === "boolean"; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( i ) { - jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); - }); - } - - return this.each(function() { - if ( type === "string" ) { - // toggle individual class names - var className, - i = 0, - self = jQuery( this ), - state = stateVal, - classNames = value.split( rspace ); - - while ( (className = classNames[ i++ ]) ) { - // check each className given, space seperated list - state = isBool ? state : !self.hasClass( className ); - self[ state ? "addClass" : "removeClass" ]( className ); - } - - } else if ( type === "undefined" || type === "boolean" ) { - if ( this.className ) { - // store className if set - jQuery._data( this, "__className__", this.className ); - } - - // toggle whole className - this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; - } - }); - }, - - hasClass: function( selector ) { - var className = " " + selector + " ", - i = 0, - l = this.length; - for ( ; i < l; i++ ) { - if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { - return true; - } - } - - return false; - }, - - val: function( value ) { - var hooks, ret, isFunction, - elem = this[0]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; - - if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { - return ret; - } - - ret = elem.value; - - return typeof ret === "string" ? - // handle most common string cases - ret.replace(rreturn, "") : - // handle cases where value is null/undef or number - ret == null ? "" : ret; - } - - return; - } - - isFunction = jQuery.isFunction( value ); - - return this.each(function( i ) { - var self = jQuery(this), val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call( this, i, self.val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - } else if ( typeof val === "number" ) { - val += ""; - } else if ( jQuery.isArray( val ) ) { - val = jQuery.map(val, function ( value ) { - return value == null ? "" : value + ""; - }); - } - - hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - }); - } -}); - -jQuery.extend({ - valHooks: { - option: { - get: function( elem ) { - // attributes.value is undefined in Blackberry 4.7 but - // uses .value. See #6932 - var val = elem.attributes.value; - return !val || val.specified ? elem.value : elem.text; - } - }, - select: { - get: function( elem ) { - var value, i, max, option, - index = elem.selectedIndex, - values = [], - options = elem.options, - one = elem.type === "select-one"; - - // Nothing was selected - if ( index < 0 ) { - return null; - } - - // Loop through all the selected options - i = one ? index : 0; - max = one ? index + 1 : options.length; - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Don't return options that are disabled or in a disabled optgroup - if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && - (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - // Fixes Bug #2551 -- select.val() broken in IE after form.reset() - if ( one && !values.length && options.length ) { - return jQuery( options[ index ] ).val(); - } - - return values; - }, - - set: function( elem, value ) { - var values = jQuery.makeArray( value ); - - jQuery(elem).find("option").each(function() { - this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; - }); - - if ( !values.length ) { - elem.selectedIndex = -1; - } - return values; - } - } - }, - - attrFn: { - val: true, - css: true, - html: true, - text: true, - data: true, - width: true, - height: true, - offset: true - }, - - attr: function( elem, name, value, pass ) { - var ret, hooks, notxml, - nType = elem.nodeType; - - // don't get/set attributes on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( pass && name in jQuery.attrFn ) { - return jQuery( elem )[ name ]( value ); - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - // All attributes are lowercase - // Grab necessary hook if one is defined - if ( notxml ) { - name = name.toLowerCase(); - hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); - } - - if ( value !== undefined ) { - - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - - } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - elem.setAttribute( name, "" + value ); - return value; - } - - } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - - ret = elem.getAttribute( name ); - - // Non-existent attributes return null, we normalize to undefined - return ret === null ? - undefined : - ret; - } - }, - - removeAttr: function( elem, value ) { - var propName, attrNames, name, l, - i = 0; - - if ( value && elem.nodeType === 1 ) { - attrNames = value.toLowerCase().split( rspace ); - l = attrNames.length; - - for ( ; i < l; i++ ) { - name = attrNames[ i ]; - - if ( name ) { - propName = jQuery.propFix[ name ] || name; - - // See #9699 for explanation of this approach (setting first, then removal) - jQuery.attr( elem, name, "" ); - elem.removeAttribute( getSetAttribute ? name : propName ); - - // Set corresponding property to false for boolean attributes - if ( rboolean.test( name ) && propName in elem ) { - elem[ propName ] = false; - } - } - } - } - }, - - attrHooks: { - type: { - set: function( elem, value ) { - // We can't allow the type property to be changed (since it causes problems in IE) - if ( rtype.test( elem.nodeName ) && elem.parentNode ) { - jQuery.error( "type property can't be changed" ); - } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { - // Setting the type on a radio button after the value resets the value in IE6-9 - // Reset value to it's default in case type is set after value - // This is for element creation - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - }, - // Use the value property for back compat - // Use the nodeHook for button elements in IE6/7 (#1954) - value: { - get: function( elem, name ) { - if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { - return nodeHook.get( elem, name ); - } - return name in elem ? - elem.value : - null; - }, - set: function( elem, value, name ) { - if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { - return nodeHook.set( elem, value, name ); - } - // Does not return so that setAttribute is also used - elem.value = value; - } - } - }, - - propFix: { - tabindex: "tabIndex", - readonly: "readOnly", - "for": "htmlFor", - "class": "className", - maxlength: "maxLength", - cellspacing: "cellSpacing", - cellpadding: "cellPadding", - rowspan: "rowSpan", - colspan: "colSpan", - usemap: "useMap", - frameborder: "frameBorder", - contenteditable: "contentEditable" - }, - - prop: function( elem, name, value ) { - var ret, hooks, notxml, - nType = elem.nodeType; - - // don't get/set properties on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - if ( notxml ) { - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - return ( elem[ name ] = value ); - } - - } else { - if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - return elem[ name ]; - } - } - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - var attributeNode = elem.getAttributeNode("tabindex"); - - return attributeNode && attributeNode.specified ? - parseInt( attributeNode.value, 10 ) : - rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? - 0 : - undefined; - } - } - } -}); - -// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional) -jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex; - -// Hook for boolean attributes -boolHook = { - get: function( elem, name ) { - // Align boolean attributes with corresponding properties - // Fall back to attribute presence where some booleans are not supported - var attrNode, - property = jQuery.prop( elem, name ); - return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? - name.toLowerCase() : - undefined; - }, - set: function( elem, value, name ) { - var propName; - if ( value === false ) { - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - // value is true since we know at this point it's type boolean and not false - // Set boolean attributes to the same name and set the DOM property - propName = jQuery.propFix[ name ] || name; - if ( propName in elem ) { - // Only set the IDL specifically if it already exists on the element - elem[ propName ] = true; - } - - elem.setAttribute( name, name.toLowerCase() ); - } - return name; - } -}; - -// IE6/7 do not support getting/setting some attributes with get/setAttribute -if ( !getSetAttribute ) { - - fixSpecified = { - name: true, - id: true - }; - - // Use this for any attribute in IE6/7 - // This fixes almost every IE6/7 issue - nodeHook = jQuery.valHooks.button = { - get: function( elem, name ) { - var ret; - ret = elem.getAttributeNode( name ); - return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ? - ret.nodeValue : - undefined; - }, - set: function( elem, value, name ) { - // Set the existing or create a new attribute node - var ret = elem.getAttributeNode( name ); - if ( !ret ) { - ret = document.createAttribute( name ); - elem.setAttributeNode( ret ); - } - return ( ret.nodeValue = value + "" ); - } - }; - - // Apply the nodeHook to tabindex - jQuery.attrHooks.tabindex.set = nodeHook.set; - - // Set width and height to auto instead of 0 on empty string( Bug #8150 ) - // This is for removals - jQuery.each([ "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - set: function( elem, value ) { - if ( value === "" ) { - elem.setAttribute( name, "auto" ); - return value; - } - } - }); - }); - - // Set contenteditable to false on removals(#10429) - // Setting to empty string throws an error as an invalid value - jQuery.attrHooks.contenteditable = { - get: nodeHook.get, - set: function( elem, value, name ) { - if ( value === "" ) { - value = "false"; - } - nodeHook.set( elem, value, name ); - } - }; -} - - -// Some attributes require a special call on IE -if ( !jQuery.support.hrefNormalized ) { - jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - get: function( elem ) { - var ret = elem.getAttribute( name, 2 ); - return ret === null ? undefined : ret; - } - }); - }); -} - -if ( !jQuery.support.style ) { - jQuery.attrHooks.style = { - get: function( elem ) { - // Return undefined in the case of empty string - // Normalize to lowercase since IE uppercases css property names - return elem.style.cssText.toLowerCase() || undefined; - }, - set: function( elem, value ) { - return ( elem.style.cssText = "" + value ); - } - }; -} - -// Safari mis-reports the default selected property of an option -// Accessing the parent's selectedIndex property fixes it -if ( !jQuery.support.optSelected ) { - jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { - get: function( elem ) { - var parent = elem.parentNode; - - if ( parent ) { - parent.selectedIndex; - - // Make sure that it also works with optgroups, see #5701 - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - return null; - } - }); -} - -// IE6/7 call enctype encoding -if ( !jQuery.support.enctype ) { - jQuery.propFix.enctype = "encoding"; -} - -// Radios and checkboxes getter/setter -if ( !jQuery.support.checkOn ) { - jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - get: function( elem ) { - // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified - return elem.getAttribute("value") === null ? "on" : elem.value; - } - }; - }); -} -jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { - set: function( elem, value ) { - if ( jQuery.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); - } - } - }); -}); - - - - -var rformElems = /^(?:textarea|input|select)$/i, - rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, - rhoverHack = /\bhover(\.\S+)?\b/, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, - quickParse = function( selector ) { - var quick = rquickIs.exec( selector ); - if ( quick ) { - // 0 1 2 3 - // [ _, tag, id, class ] - quick[1] = ( quick[1] || "" ).toLowerCase(); - quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" ); - } - return quick; - }, - quickIs = function( elem, m ) { - var attrs = elem.attributes || {}; - return ( - (!m[1] || elem.nodeName.toLowerCase() === m[1]) && - (!m[2] || (attrs.id || {}).value === m[2]) && - (!m[3] || m[3].test( (attrs[ "class" ] || {}).value )) - ); - }, - hoverHack = function( events ) { - return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); - }; - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - add: function( elem, types, handler, data, selector ) { - - var elemData, eventHandle, events, - t, tns, type, namespaces, handleObj, - handleObjIn, quick, handlers, special; - - // Don't attach events to noData or text/comment nodes (allow plain objects tho) - if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - events = elemData.events; - if ( !events ) { - elemData.events = events = {}; - } - eventHandle = elemData.handle; - if ( !eventHandle ) { - elemData.handle = eventHandle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : - undefined; - }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - types = jQuery.trim( hoverHack(types) ).split( " " ); - for ( t = 0; t < types.length; t++ ) { - - tns = rtypenamespace.exec( types[t] ) || []; - type = tns[1]; - namespaces = ( tns[2] || "" ).split( "." ).sort(); - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: tns[1], - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - quick: quickParse( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); - - // Init the event handler queue if we're the first - handlers = events[ type ]; - if ( !handlers ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - global: {}, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var elemData = jQuery.hasData( elem ) && jQuery._data( elem ), - t, tns, type, origType, namespaces, origCount, - j, events, special, handle, eventType, handleObj; - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = jQuery.trim( hoverHack( types || "" ) ).split(" "); - for ( t = 0; t < types.length; t++ ) { - tns = rtypenamespace.exec( types[t] ) || []; - type = origType = tns[1]; - namespaces = tns[2]; - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector? special.delegateType : special.bindType ) || type; - eventType = events[ type ] || []; - origCount = eventType.length; - namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; - - // Remove matching events - for ( j = 0; j < eventType.length; j++ ) { - handleObj = eventType[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !namespaces || namespaces.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - eventType.splice( j--, 1 ); - - if ( handleObj.selector ) { - eventType.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( eventType.length === 0 && origCount !== eventType.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - handle = elemData.handle; - if ( handle ) { - handle.elem = null; - } - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery.removeData( elem, [ "events", "handle" ], true ); - } - }, - - // Events that are safe to short-circuit if no handlers are attached. - // Native DOM events should not be added, they may have inline handlers. - customEvent: { - "getData": true, - "setData": true, - "changeData": true - }, - - trigger: function( event, data, elem, onlyHandlers ) { - // Don't do events on text and comment nodes - if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) { - return; - } - - // Event object or event type - var type = event.type || event, - namespaces = [], - cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType; - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf( "!" ) >= 0 ) { - // Exclusive events trigger only for the exact event (no namespaces) - type = type.slice(0, -1); - exclusive = true; - } - - if ( type.indexOf( "." ) >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - - if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { - // No jQuery handlers for this event type, and it can't have inline handlers - return; - } - - // Caller can pass in an Event, Object, or just an event type string - event = typeof event === "object" ? - // jQuery.Event object - event[ jQuery.expando ] ? event : - // Object literal - new jQuery.Event( type, event ) : - // Just the event type (string) - new jQuery.Event( type ); - - event.type = type; - event.isTrigger = true; - event.exclusive = exclusive; - event.namespace = namespaces.join( "." ); - event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null; - ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; - - // Handle a global trigger - if ( !elem ) { - - // TODO: Stop taunting the data cache; remove global events and always attach to document - cache = jQuery.cache; - for ( i in cache ) { - if ( cache[ i ].events && cache[ i ].events[ type ] ) { - jQuery.event.trigger( event, data, cache[ i ].handle.elem, true ); - } - } - return; - } - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data != null ? jQuery.makeArray( data ) : []; - data.unshift( event ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - eventPath = [[ elem, special.bindType || type ]]; - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; - old = null; - for ( ; cur; cur = cur.parentNode ) { - eventPath.push([ cur, bubbleType ]); - old = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( old && old === elem.ownerDocument ) { - eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); - } - } - - // Fire handlers on the event path - for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) { - - cur = eventPath[i][0]; - event.type = eventPath[i][1]; - - handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - // Note that this is a bare JS function and not a jQuery handler - handle = ontype && cur[ ontype ]; - if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) { - event.preventDefault(); - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && - !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - // IE<9 dies on focus/blur to hidden element (#1486) - if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - old = elem[ ontype ]; - - if ( old ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - elem[ type ](); - jQuery.event.triggered = undefined; - - if ( old ) { - elem[ ontype ] = old; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event || window.event ); - - var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), - delegateCount = handlers.delegateCount, - args = [].slice.call( arguments, 0 ), - run_all = !event.exclusive && !event.namespace, - handlerQueue = [], - i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Determine handlers that should run if there are delegated events - // Avoid disabled elements in IE (#6911) and non-left-click bubbling in Firefox (#3861) - if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) { - - // Pregenerate a single jQuery object for reuse with .is() - jqcur = jQuery(this); - jqcur.context = this.ownerDocument || this; - - for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { - selMatch = {}; - matches = []; - jqcur[0] = cur; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - sel = handleObj.selector; - - if ( selMatch[ sel ] === undefined ) { - selMatch[ sel ] = ( - handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel ) - ); - } - if ( selMatch[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, matches: matches }); - } - } - } - - // Add the remaining (directly-bound) handlers - if ( handlers.length > delegateCount ) { - handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) }); - } - - // Run delegates first; they may want to stop propagation beneath us - for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) { - matched = handlerQueue[ i ]; - event.currentTarget = matched.elem; - - for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) { - handleObj = matched.matches[ j ]; - - // Triggered event must either 1) be non-exclusive and have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { - - event.data = handleObj.data; - event.handleObj = handleObj; - - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); - - if ( ret !== undefined ) { - event.result = ret; - if ( ret === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - return event.result; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 *** - props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var eventDoc, doc, body, - button = original.button, - fromElement = original.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, - originalEvent = event, - fixHook = jQuery.event.fixHooks[ event.type ] || {}, - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = jQuery.Event( originalEvent ); - - for ( i = copy.length; i; ) { - prop = copy[ --i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Target should not be a text node (#504, Safari) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8) - if ( event.metaKey === undefined ) { - event.metaKey = event.ctrlKey; - } - - return fixHook.filter? fixHook.filter( event, originalEvent ) : event; - }, - - special: { - ready: { - // Make sure the ready event is setup - setup: jQuery.bindReady - }, - - load: { - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - - focus: { - delegateType: "focusin" - }, - blur: { - delegateType: "focusout" - }, - - beforeunload: { - setup: function( data, namespaces, eventHandle ) { - // We only want to do this special case on windows - if ( jQuery.isWindow( this ) ) { - this.onbeforeunload = eventHandle; - } - }, - - teardown: function( namespaces, eventHandle ) { - if ( this.onbeforeunload === eventHandle ) { - this.onbeforeunload = null; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -// Some plugins are using, but it's undocumented/deprecated and will be removed. -// The 1.7 special event interface should provide all the hooks needed now. -jQuery.event.handle = jQuery.event.dispatch; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - if ( elem.detachEvent ) { - elem.detachEvent( "on" + type, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || - src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -function returnFalse() { - return false; -} -function returnTrue() { - return true; -} - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - preventDefault: function() { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - - // if preventDefault exists run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // otherwise set the returnValue property of the original event to false (IE) - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - // if stopPropagation exists run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - // otherwise set the cancelBubble property of the original event to true (IE) - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var target = this, - related = event.relatedTarget, - handleObj = event.handleObj, - selector = handleObj.selector, - ret; - - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -}); - -// IE submit delegation -if ( !jQuery.support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !form._submit_attached ) { - jQuery.event.add( form, "submit._submit", function( event ) { - // If form was submitted by the user, bubble the event up the tree - if ( this.parentNode && !event.isTrigger ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); - } - }); - form._submit_attached = true; - } - }); - // return undefined since we don't need an event listener - }, - - teardown: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !jQuery.support.changeBubbles ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; - } - }); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed && !event.isTrigger ) { - this._just_changed = false; - jQuery.event.simulate( "change", this, event, true ); - } - }); - } - return false; - } - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); - } - }); - elem._change_attached = true; - } - }); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return rformElems.test( this.nodeName ); - } - }; -} - -// Create "bubbling" focus and blur events -if ( !jQuery.support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler while someone wants focusin/focusout - var attaches = 0, - handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - if ( attaches++ === 0 ) { - document.addEventListener( orig, handler, true ); - } - }, - teardown: function() { - if ( --attaches === 0 ) { - document.removeEventListener( orig, handler, true ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on.call( this, types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - var handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( var type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - bind: function( types, data, fn ) { - return this.on( types, null, data, fn ); - }, - unbind: function( types, fn ) { - return this.off( types, null, fn ); - }, - - live: function( types, data, fn ) { - jQuery( this.context ).on( types, this.selector, data, fn ); - return this; - }, - die: function( types, fn ) { - jQuery( this.context ).off( types, this.selector || "**", fn ); - return this; - }, - - delegate: function( selector, types, data, fn ) { - return this.on( types, selector, data, fn ); - }, - undelegate: function( selector, types, fn ) { - // ( namespace ) or ( selector, types [, fn] ) - return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn ); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - if ( this[0] ) { - return jQuery.event.trigger( type, data, this[0], true ); - } - }, - - toggle: function( fn ) { - // Save reference to arguments for access in closure - var args = arguments, - guid = fn.guid || jQuery.guid++, - i = 0, - toggler = function( event ) { - // Figure out which function to execute - var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; - jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ lastToggle ].apply( this, arguments ) || false; - }; - - // link all the functions, so any of them can unbind this click handler - toggler.guid = guid; - while ( i < args.length ) { - args[ i++ ].guid = guid; - } - - return this.click( toggler ); - }, - - hover: function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); - } -}); - -jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + - "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + - "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { - - // Handle event binding - jQuery.fn[ name ] = function( data, fn ) { - if ( fn == null ) { - fn = data; - data = null; - } - - return arguments.length > 0 ? - this.on( name, null, data, fn ) : - this.trigger( name ); - }; - - if ( jQuery.attrFn ) { - jQuery.attrFn[ name ] = true; - } - - if ( rkeyEvent.test( name ) ) { - jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; - } - - if ( rmouseEvent.test( name ) ) { - jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; - } -}); - - - -/*! - * Sizzle CSS Selector Engine - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){ - -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - expando = "sizcache" + (Math.random() + '').replace('.', ''), - done = 0, - toString = Object.prototype.toString, - hasDuplicate = false, - baseHasDuplicate = true, - rBackslash = /\\/g, - rReturn = /\r\n/g, - rNonWord = /\W/; - -// Here we check if the JavaScript engine is using some sort of -// optimization where it does not always call our comparision -// function. If that is the case, discard the hasDuplicate value. -// Thus far that includes Google Chrome. -[0, 0].sort(function() { - baseHasDuplicate = false; - return 0; -}); - -var Sizzle = function( selector, context, results, seed ) { - results = results || []; - context = context || document; - - var origContext = context; - - if ( context.nodeType !== 1 && context.nodeType !== 9 ) { - return []; - } - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - var m, set, checkSet, extra, ret, cur, pop, i, - prune = true, - contextXML = Sizzle.isXML( context ), - parts = [], - soFar = selector; - - // Reset the position of the chunker regexp (start from head) - do { - chunker.exec( "" ); - m = chunker.exec( soFar ); - - if ( m ) { - soFar = m[3]; - - parts.push( m[1] ); - - if ( m[2] ) { - extra = m[3]; - break; - } - } - } while ( m ); - - if ( parts.length > 1 && origPOS.exec( selector ) ) { - - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context, seed ); - - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); - - while ( parts.length ) { - selector = parts.shift(); - - if ( Expr.relative[ selector ] ) { - selector += parts.shift(); - } - - set = posProcess( selector, set, seed ); - } - } - - } else { - // Take a shortcut and set the context if the root selector is an ID - // (but not if it'll be faster if the inner selector is an ID) - if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && - Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { - - ret = Sizzle.find( parts.shift(), context, contextXML ); - context = ret.expr ? - Sizzle.filter( ret.expr, ret.set )[0] : - ret.set[0]; - } - - if ( context ) { - ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); - - set = ret.expr ? - Sizzle.filter( ret.expr, ret.set ) : - ret.set; - - if ( parts.length > 0 ) { - checkSet = makeArray( set ); - - } else { - prune = false; - } - - while ( parts.length ) { - cur = parts.pop(); - pop = cur; - - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } - - if ( pop == null ) { - pop = context; - } - - Expr.relative[ cur ]( checkSet, pop, contextXML ); - } - - } else { - checkSet = parts = []; - } - } - - if ( !checkSet ) { - checkSet = set; - } - - if ( !checkSet ) { - Sizzle.error( cur || selector ); - } - - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - - } else if ( context && context.nodeType === 1 ) { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - - } else { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - - } else { - makeArray( checkSet, results ); - } - - if ( extra ) { - Sizzle( extra, origContext, results, seed ); - Sizzle.uniqueSort( results ); - } - - return results; -}; - -Sizzle.uniqueSort = function( results ) { - if ( sortOrder ) { - hasDuplicate = baseHasDuplicate; - results.sort( sortOrder ); - - if ( hasDuplicate ) { - for ( var i = 1; i < results.length; i++ ) { - if ( results[i] === results[ i - 1 ] ) { - results.splice( i--, 1 ); - } - } - } - } - - return results; -}; - -Sizzle.matches = function( expr, set ) { - return Sizzle( expr, null, null, set ); -}; - -Sizzle.matchesSelector = function( node, expr ) { - return Sizzle( expr, null, null, [node] ).length > 0; -}; - -Sizzle.find = function( expr, context, isXML ) { - var set, i, len, match, type, left; - - if ( !expr ) { - return []; - } - - for ( i = 0, len = Expr.order.length; i < len; i++ ) { - type = Expr.order[i]; - - if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { - left = match[1]; - match.splice( 1, 1 ); - - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace( rBackslash, "" ); - set = Expr.find[ type ]( match, context, isXML ); - - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } - - if ( !set ) { - set = typeof context.getElementsByTagName !== "undefined" ? - context.getElementsByTagName( "*" ) : - []; - } - - return { set: set, expr: expr }; -}; - -Sizzle.filter = function( expr, set, inplace, not ) { - var match, anyFound, - type, found, item, filter, left, - i, pass, - old = expr, - result = [], - curLoop = set, - isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); - - while ( expr && set.length ) { - for ( type in Expr.filter ) { - if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { - filter = Expr.filter[ type ]; - left = match[1]; - - anyFound = false; - - match.splice(1,1); - - if ( left.substr( left.length - 1 ) === "\\" ) { - continue; - } - - if ( curLoop === result ) { - result = []; - } - - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); - - if ( !match ) { - anyFound = found = true; - - } else if ( match === true ) { - continue; - } - } - - if ( match ) { - for ( i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - pass = not ^ found; - - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - - } else { - curLoop[i] = false; - } - - } else if ( pass ) { - result.push( item ); - anyFound = true; - } - } - } - } - - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } - - expr = expr.replace( Expr.match[ type ], "" ); - - if ( !anyFound ) { - return []; - } - - break; - } - } - } - - // Improper expression - if ( expr === old ) { - if ( anyFound == null ) { - Sizzle.error( expr ); - - } else { - break; - } - } - - old = expr; - } - - return curLoop; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Utility function for retreiving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -var getText = Sizzle.getText = function( elem ) { - var i, node, - nodeType = elem.nodeType, - ret = ""; - - if ( nodeType ) { - if ( nodeType === 1 || nodeType === 9 ) { - // Use textContent || innerText for elements - if ( typeof elem.textContent === 'string' ) { - return elem.textContent; - } else if ( typeof elem.innerText === 'string' ) { - // Replace IE's carriage returns - return elem.innerText.replace( rReturn, '' ); - } else { - // Traverse it's children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - } else { - - // If no nodeType, this is expected to be an array - for ( i = 0; (node = elem[i]); i++ ) { - // Do not traverse comment nodes - if ( node.nodeType !== 8 ) { - ret += getText( node ); - } - } - } - return ret; -}; - -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - - match: { - ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ - }, - - leftMatch: {}, - - attrMap: { - "class": "className", - "for": "htmlFor" - }, - - attrHandle: { - href: function( elem ) { - return elem.getAttribute( "href" ); - }, - type: function( elem ) { - return elem.getAttribute( "type" ); - } - }, - - relative: { - "+": function(checkSet, part){ - var isPartStr = typeof part === "string", - isTag = isPartStr && !rNonWord.test( part ), - isPartStrNotTag = isPartStr && !isTag; - - if ( isTag ) { - part = part.toLowerCase(); - } - - for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { - if ( (elem = checkSet[i]) ) { - while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} - - checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? - elem || false : - elem === part; - } - } - - if ( isPartStrNotTag ) { - Sizzle.filter( part, checkSet, true ); - } - }, - - ">": function( checkSet, part ) { - var elem, - isPartStr = typeof part === "string", - i = 0, - l = checkSet.length; - - if ( isPartStr && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; - } - } - - } else { - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } - - if ( isPartStr ) { - Sizzle.filter( part, checkSet, true ); - } - } - }, - - "": function(checkSet, part, isXML){ - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); - }, - - "~": function( checkSet, part, isXML ) { - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); - } - }, - - find: { - ID: function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }, - - NAME: function( match, context ) { - if ( typeof context.getElementsByName !== "undefined" ) { - var ret = [], - results = context.getElementsByName( match[1] ); - - for ( var i = 0, l = results.length; i < l; i++ ) { - if ( results[i].getAttribute("name") === match[1] ) { - ret.push( results[i] ); - } - } - - return ret.length === 0 ? null : ret; - } - }, - - TAG: function( match, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( match[1] ); - } - } - }, - preFilter: { - CLASS: function( match, curLoop, inplace, result, not, isXML ) { - match = " " + match[1].replace( rBackslash, "" ) + " "; - - if ( isXML ) { - return match; - } - - for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { - if ( !inplace ) { - result.push( elem ); - } - - } else if ( inplace ) { - curLoop[i] = false; - } - } - } - - return false; - }, - - ID: function( match ) { - return match[1].replace( rBackslash, "" ); - }, - - TAG: function( match, curLoop ) { - return match[1].replace( rBackslash, "" ).toLowerCase(); - }, - - CHILD: function( match ) { - if ( match[1] === "nth" ) { - if ( !match[2] ) { - Sizzle.error( match[0] ); - } - - match[2] = match[2].replace(/^\+|\s*/g, ''); - - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( - match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - else if ( match[2] ) { - Sizzle.error( match[0] ); - } - - // TODO: Move to normal caching system - match[0] = done++; - - return match; - }, - - ATTR: function( match, curLoop, inplace, result, not, isXML ) { - var name = match[1] = match[1].replace( rBackslash, "" ); - - if ( !isXML && Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } - - // Handle if an un-quoted value was used - match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); - - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; - } - - return match; - }, - - PSEUDO: function( match, curLoop, inplace, result, not ) { - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { - match[3] = Sizzle(match[3], null, null, curLoop); - - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - - if ( !inplace ) { - result.push.apply( result, ret ); - } - - return false; - } - - } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { - return true; - } - - return match; - }, - - POS: function( match ) { - match.unshift( true ); - - return match; - } - }, - - filters: { - enabled: function( elem ) { - return elem.disabled === false && elem.type !== "hidden"; - }, - - disabled: function( elem ) { - return elem.disabled === true; - }, - - checked: function( elem ) { - return elem.checked === true; - }, - - selected: function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - parent: function( elem ) { - return !!elem.firstChild; - }, - - empty: function( elem ) { - return !elem.firstChild; - }, - - has: function( elem, i, match ) { - return !!Sizzle( match[3], elem ).length; - }, - - header: function( elem ) { - return (/h\d/i).test( elem.nodeName ); - }, - - text: function( elem ) { - var attr = elem.getAttribute( "type" ), type = elem.type; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) - // use getAttribute instead to test this case - return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); - }, - - radio: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; - }, - - checkbox: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; - }, - - file: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; - }, - - password: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; - }, - - submit: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "submit" === elem.type; - }, - - image: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; - }, - - reset: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "reset" === elem.type; - }, - - button: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && "button" === elem.type || name === "button"; - }, - - input: function( elem ) { - return (/input|select|textarea|button/i).test( elem.nodeName ); - }, - - focus: function( elem ) { - return elem === elem.ownerDocument.activeElement; - } - }, - setFilters: { - first: function( elem, i ) { - return i === 0; - }, - - last: function( elem, i, match, array ) { - return i === array.length - 1; - }, - - even: function( elem, i ) { - return i % 2 === 0; - }, - - odd: function( elem, i ) { - return i % 2 === 1; - }, - - lt: function( elem, i, match ) { - return i < match[3] - 0; - }, - - gt: function( elem, i, match ) { - return i > match[3] - 0; - }, - - nth: function( elem, i, match ) { - return match[3] - 0 === i; - }, - - eq: function( elem, i, match ) { - return match[3] - 0 === i; - } - }, - filter: { - PSEUDO: function( elem, match, i, array ) { - var name = match[1], - filter = Expr.filters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; - - } else if ( name === "not" ) { - var not = match[3]; - - for ( var j = 0, l = not.length; j < l; j++ ) { - if ( not[j] === elem ) { - return false; - } - } - - return true; - - } else { - Sizzle.error( name ); - } - }, - - CHILD: function( elem, match ) { - var first, last, - doneName, parent, cache, - count, diff, - type = match[1], - node = elem; - - switch ( type ) { - case "only": - case "first": - while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - if ( type === "first" ) { - return true; - } - - node = elem; - - case "last": - while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - return true; - - case "nth": - first = match[2]; - last = match[3]; - - if ( first === 1 && last === 0 ) { - return true; - } - - doneName = match[0]; - parent = elem.parentNode; - - if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) { - count = 0; - - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - node.nodeIndex = ++count; - } - } - - parent[ expando ] = doneName; - } - - diff = elem.nodeIndex - last; - - if ( first === 0 ) { - return diff === 0; - - } else { - return ( diff % first === 0 && diff / first >= 0 ); - } - } - }, - - ID: function( elem, match ) { - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - - TAG: function( elem, match ) { - return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match; - }, - - CLASS: function( elem, match ) { - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf( match ) > -1; - }, - - ATTR: function( elem, match ) { - var name = match[1], - result = Sizzle.attr ? - Sizzle.attr( elem, name ) : - Expr.attrHandle[ name ] ? - Expr.attrHandle[ name ]( elem ) : - elem[ name ] != null ? - elem[ name ] : - elem.getAttribute( name ), - value = result + "", - type = match[2], - check = match[4]; - - return result == null ? - type === "!=" : - !type && Sizzle.attr ? - result != null : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value !== check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - - POS: function( elem, match, i, array ) { - var name = match[2], - filter = Expr.setFilters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } - } - } -}; - -var origPOS = Expr.match.POS, - fescape = function(all, num){ - return "\\" + (num - 0 + 1); - }; - -for ( var type in Expr.match ) { - Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); - Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); -} - -var makeArray = function( array, results ) { - array = Array.prototype.slice.call( array, 0 ); - - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; - -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -// Also verifies that the returned array holds DOM nodes -// (which is not the case in the Blackberry browser) -try { - Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; - -// Provide a fallback method if it does not work -} catch( e ) { - makeArray = function( array, results ) { - var i = 0, - ret = results || []; - - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - - } else { - if ( typeof array.length === "number" ) { - for ( var l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - - } else { - for ( ; array[i]; i++ ) { - ret.push( array[i] ); - } - } - } - - return ret; - }; -} - -var sortOrder, siblingCheck; - -if ( document.documentElement.compareDocumentPosition ) { - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { - return a.compareDocumentPosition ? -1 : 1; - } - - return a.compareDocumentPosition(b) & 4 ? -1 : 1; - }; - -} else { - sortOrder = function( a, b ) { - // The nodes are identical, we can exit early - if ( a === b ) { - hasDuplicate = true; - return 0; - - // Fallback to using sourceIndex (in IE) if it's available on both nodes - } else if ( a.sourceIndex && b.sourceIndex ) { - return a.sourceIndex - b.sourceIndex; - } - - var al, bl, - ap = [], - bp = [], - aup = a.parentNode, - bup = b.parentNode, - cur = aup; - - // If the nodes are siblings (or identical) we can do a quick check - if ( aup === bup ) { - return siblingCheck( a, b ); - - // If no parents were found then the nodes are disconnected - } else if ( !aup ) { - return -1; - - } else if ( !bup ) { - return 1; - } - - // Otherwise they're somewhere else in the tree so we need - // to build up a full list of the parentNodes for comparison - while ( cur ) { - ap.unshift( cur ); - cur = cur.parentNode; - } - - cur = bup; - - while ( cur ) { - bp.unshift( cur ); - cur = cur.parentNode; - } - - al = ap.length; - bl = bp.length; - - // Start walking down the tree looking for a discrepancy - for ( var i = 0; i < al && i < bl; i++ ) { - if ( ap[i] !== bp[i] ) { - return siblingCheck( ap[i], bp[i] ); - } - } - - // We ended someplace up the tree so do a sibling check - return i === al ? - siblingCheck( a, bp[i], -1 ) : - siblingCheck( ap[i], b, 1 ); - }; - - siblingCheck = function( a, b, ret ) { - if ( a === b ) { - return ret; - } - - var cur = a.nextSibling; - - while ( cur ) { - if ( cur === b ) { - return -1; - } - - cur = cur.nextSibling; - } - - return 1; - }; -} - -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -(function(){ - // We're going to inject a fake input element with a specified name - var form = document.createElement("div"), - id = "script" + (new Date()).getTime(), - root = document.documentElement; - - form.innerHTML = ""; - - // Inject it into the root element, check its status, and remove it quickly - root.insertBefore( form, root.firstChild ); - - // The workaround has to do additional checks after a getElementById - // Which slows things down for other browsers (hence the branching) - if ( document.getElementById( id ) ) { - Expr.find.ID = function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - - return m ? - m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? - [m] : - undefined : - []; - } - }; - - Expr.filter.ID = function( elem, match ) { - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - - return elem.nodeType === 1 && node && node.nodeValue === match; - }; - } - - root.removeChild( form ); - - // release memory in IE - root = form = null; -})(); - -(function(){ - // Check to see if the browser returns only elements - // when doing getElementsByTagName("*") - - // Create a fake element - var div = document.createElement("div"); - div.appendChild( document.createComment("") ); - - // Make sure no comments are found - if ( div.getElementsByTagName("*").length > 0 ) { - Expr.find.TAG = function( match, context ) { - var results = context.getElementsByTagName( match[1] ); - - // Filter out possible comments - if ( match[1] === "*" ) { - var tmp = []; - - for ( var i = 0; results[i]; i++ ) { - if ( results[i].nodeType === 1 ) { - tmp.push( results[i] ); - } - } - - results = tmp; - } - - return results; - }; - } - - // Check to see if an attribute returns normalized href attributes - div.innerHTML = ""; - - if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && - div.firstChild.getAttribute("href") !== "#" ) { - - Expr.attrHandle.href = function( elem ) { - return elem.getAttribute( "href", 2 ); - }; - } - - // release memory in IE - div = null; -})(); - -if ( document.querySelectorAll ) { - (function(){ - var oldSizzle = Sizzle, - div = document.createElement("div"), - id = "__sizzle__"; - - div.innerHTML = "

"; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function( query, context, extra, seed ) { - context = context || document; - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && !Sizzle.isXML(context) ) { - // See if we find a selector to speed up - var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - - if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { - // Speed-up: Sizzle("TAG") - if ( match[1] ) { - return makeArray( context.getElementsByTagName( query ), extra ); - - // Speed-up: Sizzle(".CLASS") - } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { - return makeArray( context.getElementsByClassName( match[2] ), extra ); - } - } - - if ( context.nodeType === 9 ) { - // Speed-up: Sizzle("body") - // The body element only exists once, optimize finding it - if ( query === "body" && context.body ) { - return makeArray( [ context.body ], extra ); - - // Speed-up: Sizzle("#ID") - } else if ( match && match[3] ) { - var elem = context.getElementById( match[3] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id === match[3] ) { - return makeArray( [ elem ], extra ); - } - - } else { - return makeArray( [], extra ); - } - } - - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(qsaError) {} - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - var oldContext = context, - old = context.getAttribute( "id" ), - nid = old || id, - hasParent = context.parentNode, - relativeHierarchySelector = /^\s*[+~]/.test( query ); - - if ( !old ) { - context.setAttribute( "id", nid ); - } else { - nid = nid.replace( /'/g, "\\$&" ); - } - if ( relativeHierarchySelector && hasParent ) { - context = context.parentNode; - } - - try { - if ( !relativeHierarchySelector || hasParent ) { - return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); - } - - } catch(pseudoError) { - } finally { - if ( !old ) { - oldContext.removeAttribute( "id" ); - } - } - } - } - - return oldSizzle(query, context, extra, seed); - }; - - for ( var prop in oldSizzle ) { - Sizzle[ prop ] = oldSizzle[ prop ]; - } - - // release memory in IE - div = null; - })(); -} - -(function(){ - var html = document.documentElement, - matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; - - if ( matches ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9 fails this) - var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), - pseudoWorks = false; - - try { - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( document.documentElement, "[test!='']:sizzle" ); - - } catch( pseudoError ) { - pseudoWorks = true; - } - - Sizzle.matchesSelector = function( node, expr ) { - // Make sure that attribute selectors are quoted - expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); - - if ( !Sizzle.isXML( node ) ) { - try { - if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { - var ret = matches.call( node, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || !disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9, so check for that - node.document && node.document.nodeType !== 11 ) { - return ret; - } - } - } catch(e) {} - } - - return Sizzle(expr, null, null, [node]).length > 0; - }; - } -})(); - -(function(){ - var div = document.createElement("div"); - - div.innerHTML = "
"; - - // Opera can't find a second classname (in 9.6) - // Also, make sure that getElementsByClassName actually exists - if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { - return; - } - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - if ( div.getElementsByClassName("e").length === 1 ) { - return; - } - - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function( match, context, isXML ) { - if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { - return context.getElementsByClassName(match[1]); - } - }; - - // release memory in IE - div = null; -})(); - -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem[ expando ] === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 && !isXML ){ - elem[ expando ] = doneName; - elem.sizset = i; - } - - if ( elem.nodeName.toLowerCase() === cur ) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem[ expando ] === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 ) { - if ( !isXML ) { - elem[ expando ] = doneName; - elem.sizset = i; - } - - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } - - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -if ( document.documentElement.contains ) { - Sizzle.contains = function( a, b ) { - return a !== b && (a.contains ? a.contains(b) : true); - }; - -} else if ( document.documentElement.compareDocumentPosition ) { - Sizzle.contains = function( a, b ) { - return !!(a.compareDocumentPosition(b) & 16); - }; - -} else { - Sizzle.contains = function() { - return false; - }; -} - -Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; - - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -var posProcess = function( selector, context, seed ) { - var match, - tmpSet = [], - later = "", - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet, seed ); - } - - return Sizzle.filter( later, tmpSet ); -}; - -// EXPOSE -// Override sizzle attribute retrieval -Sizzle.attr = jQuery.attr; -Sizzle.selectors.attrMap = {}; -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.filters; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - -})(); - - -var runtil = /Until$/, - rparentsprev = /^(?:parents|prevUntil|prevAll)/, - // Note: This RegExp should be improved, or likely pulled from Sizzle - rmultiselector = /,/, - isSimple = /^.[^:#\[\.,]*$/, - slice = Array.prototype.slice, - POS = jQuery.expr.match.POS, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend({ - find: function( selector ) { - var self = this, - i, l; - - if ( typeof selector !== "string" ) { - return jQuery( selector ).filter(function() { - for ( i = 0, l = self.length; i < l; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }); - } - - var ret = this.pushStack( "", "find", selector ), - length, n, r; - - for ( i = 0, l = this.length; i < l; i++ ) { - length = ret.length; - jQuery.find( selector, this[i], ret ); - - if ( i > 0 ) { - // Make sure that the results are unique - for ( n = length; n < ret.length; n++ ) { - for ( r = 0; r < length; r++ ) { - if ( ret[r] === ret[n] ) { - ret.splice(n--, 1); - break; - } - } - } - } - } - - return ret; - }, - - has: function( target ) { - var targets = jQuery( target ); - return this.filter(function() { - for ( var i = 0, l = targets.length; i < l; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - not: function( selector ) { - return this.pushStack( winnow(this, selector, false), "not", selector); - }, - - filter: function( selector ) { - return this.pushStack( winnow(this, selector, true), "filter", selector ); - }, - - is: function( selector ) { - return !!selector && ( - typeof selector === "string" ? - // If this is a positional selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - POS.test( selector ) ? - jQuery( selector, this.context ).index( this[0] ) >= 0 : - jQuery.filter( selector, this ).length > 0 : - this.filter( selector ).length > 0 ); - }, - - closest: function( selectors, context ) { - var ret = [], i, l, cur = this[0]; - - // Array (deprecated as of jQuery 1.7) - if ( jQuery.isArray( selectors ) ) { - var level = 1; - - while ( cur && cur.ownerDocument && cur !== context ) { - for ( i = 0; i < selectors.length; i++ ) { - - if ( jQuery( cur ).is( selectors[ i ] ) ) { - ret.push({ selector: selectors[ i ], elem: cur, level: level }); - } - } - - cur = cur.parentNode; - level++; - } - - return ret; - } - - // String - var pos = POS.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( i = 0, l = this.length; i < l; i++ ) { - cur = this[i]; - - while ( cur ) { - if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { - ret.push( cur ); - break; - - } else { - cur = cur.parentNode; - if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { - break; - } - } - } - } - - ret = ret.length > 1 ? jQuery.unique( ret ) : ret; - - return this.pushStack( ret, "closest", selectors ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - var set = typeof selector === "string" ? - jQuery( selector, context ) : - jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), - all = jQuery.merge( this.get(), set ); - - return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? - all : - jQuery.unique( all ) ); - }, - - andSelf: function() { - return this.add( this.prevObject ); - } -}); - -// A painfully simple check to see if an element is disconnected -// from a document (should be improved, where feasible). -function isDisconnected( node ) { - return !node || !node.parentNode || node.parentNode.nodeType === 11; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return jQuery.nth( elem, 2, "nextSibling" ); - }, - prev: function( elem ) { - return jQuery.nth( elem, 2, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( elem.parentNode.firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.makeArray( elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( !runtil.test( name ) ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; - - if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - - return this.pushStack( ret, name, slice.call( arguments ).join(",") ); - }; -}); - -jQuery.extend({ - filter: function( expr, elems, not ) { - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 ? - jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : - jQuery.find.matches(expr, elems); - }, - - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - nth: function( cur, result, dir, elem ) { - result = result || 1; - var num = 0; - - for ( ; cur; cur = cur[dir] ) { - if ( cur.nodeType === 1 && ++num === result ) { - break; - } - } - - return cur; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, keep ) { - - // Can't pass null or undefined to indexOf in Firefox 4 - // Set to 0 to skip string check - qualifier = qualifier || 0; - - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep(elements, function( elem, i ) { - var retVal = !!qualifier.call( elem, i, elem ); - return retVal === keep; - }); - - } else if ( qualifier.nodeType ) { - return jQuery.grep(elements, function( elem, i ) { - return ( elem === qualifier ) === keep; - }); - - } else if ( typeof qualifier === "string" ) { - var filtered = jQuery.grep(elements, function( elem ) { - return elem.nodeType === 1; - }); - - if ( isSimple.test( qualifier ) ) { - return jQuery.filter(qualifier, filtered, !keep); - } else { - qualifier = jQuery.filter( qualifier, filtered ); - } - } - - return jQuery.grep(elements, function( elem, i ) { - return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; - }); -} - - - - -function createSafeFragment( document ) { - var list = nodeNames.split( "|" ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} - -var nodeNames = "abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|" + - "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", - rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, - rtagName = /<([\w:]+)/, - rtbody = /", "" ], - legend: [ 1, "
", "
" ], - thead: [ 1, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - col: [ 2, "", "
" ], - area: [ 1, "", "" ], - _default: [ 0, "", "" ] - }, - safeFragment = createSafeFragment( document ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// IE can't serialize and + + + + + + + + + diff --git a/inc/_footer/dist.php b/inc/_footer/dist.php new file mode 100755 index 0000000..5c03aa7 --- /dev/null +++ b/inc/_footer/dist.php @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/inc/_head/dist.php b/inc/_head/dist.php new file mode 100755 index 0000000..46701d0 --- /dev/null +++ b/inc/_head/dist.php @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + diff --git a/inc/_header/dist.php b/inc/_header/dist.php new file mode 100755 index 0000000..f62d940 --- /dev/null +++ b/inc/_header/dist.php @@ -0,0 +1,6 @@ + +
+
+

Header

+
+
\ No newline at end of file diff --git a/inc/z-index.php b/inc/_html.php old mode 100644 new mode 100755 similarity index 50% rename from inc/z-index.php rename to inc/_html.php index 75c7c0b..28bb7f3 --- a/inc/z-index.php +++ b/inc/_html.php @@ -1,6 +1,6 @@ - - + + \ No newline at end of file diff --git a/inc/_page/dist.php b/inc/_page/dist.php new file mode 100755 index 0000000..1643ca2 --- /dev/null +++ b/inc/_page/dist.php @@ -0,0 +1,6 @@ + +
+ + + +
\ No newline at end of file diff --git a/inc/_title/dist.php b/inc/_title/dist.php new file mode 100755 index 0000000..43d6b67 --- /dev/null +++ b/inc/_title/dist.php @@ -0,0 +1 @@ +<?php echo Z::getPageName();?> diff --git a/inc/content/demo.php b/inc/content/demo.php deleted file mode 100644 index b33b1d7..0000000 --- a/inc/content/demo.php +++ /dev/null @@ -1,341 +0,0 @@ - -

Heading 1

-

Heading 2

-

Heading 3

-

Heading 4

-
Heading 5
-
Heading 6
- -
-
-

col left

-
-
-

col right

-
-
- -
-
-

Heading 1 (in section)

-

Heading 2 (in section)

-

Heading 3 (in section)

-

Heading 4 (in section)

-
Heading 5 (in section)
-
Heading 6 (in section)
-
- -
-

Heading 1 (in article)

-

Heading 2 (in article)

-

Heading 3 (in article)

-

Heading 4 (in article)

-
Heading 5 (in article)
-
Heading 6 (in article)
-
-
- -
-
-

Heading 1 (in hgroup)

-

Heading 2 (in hgroup)

-
- -
- -

Text-level semantics

- - - -

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et m. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et m. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et m.

-

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et m. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et m. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et m.

- -
Address: somewhere, world
- -

The a element example

-

The abbr element and abbr element with title examples

-

The b element example
-The cite element example
-The code element example
-The del element example
-The dfn element and dfn element with title examples
-The em element example
-The i element example
- -The ins element example
-The kbd element example
-The mark element example
-The q element inside a q element example
-The s element example
-The samp element example
-The small element example
-The span element example
-The strong element example
-The sub element example
-The sup element example
-The var element example
-The u element example -

- -

Embedded content

- -

audio

- - - -

img

- - - - -

svg

- - - - - -

video

- - - -

Interactive content

- -

details / summary

-
- More info -

Additional information

-
    -
  • Point 1
  • -
  • Point 2
  • -
-
- -

Grouping content

- -

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et m.

- -

pre

- -
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et me.
- -
<html>
-	<head>
-		<title></title>
-	</head>
-	<body>
-		<div class="main"><div>
-	</body>
-</html>
- -

blockquote

- -
-

Some sort of famous witty quote marked up with a <blockquote> and a child <p> element.

-
- -
Even better philosophical quote marked up with just a <blockquote> element.
- -

ordered list

- -
    -
  1. list item 1
  2. -
  3. list item 1 -
      -
    1. list item 2
    2. -
    3. list item 2 -
        -
      1. list item 3
      2. -
      3. list item 3
      4. -
      -
    4. -
    5. list item 2
    6. -
    7. list item 2
    8. -
    -
  4. -
  5. list item 1
  6. -
  7. list item 1
  8. -
- -

unordered list

- -
    -
  • list item 1
  • -
  • list item 1 -
      -
    • list item 2
    • -
    • list item 2 -
        -
      • list item 3
      • -
      • list item 3
      • -
      -
    • -
    • list item 2
    • -
    • list item 2
    • -
    -
  • -
  • list item 1
  • -
  • list item 1
  • -
- -

description list

- -
-
Description name
-
Description value
-
Description name
-
Description value
-
Description value
-
Description name
-
Description name
-
Description value
-
- -

figure

- -
- -
Figcaption content
-
- -

Tabular data

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Jimi Hendrix - albums
AlbumYearPrice
AlbumYearPrice
Are You Experienced1967$10.00
Axis: Bold as Love1967$12.00
Electric Ladyland1968$10.00
Band of Gypsys1970$12.00
- -

Forms

- - -
- Inputs as descendents of labels (form legend). This doubles up as a long legend that can test word wrapping. -

-

-

-

-

-

-

- -

-

-

-

- -

-

-
- -
- Inputs as siblings of labels -

-

-

-

-

-

-

-

- -

-

-

-

- -

-

-
- -
- Clickable inputs and buttons -

-

-

-

-

- - -

-

-

-

-
- -
- box-sizing tests - -
-
-
- -
-
-
- -
- -
-
- -
- -
-
-
-
-
- -
-
-
-
-
-
-
-
- - -
-
- \ No newline at end of file diff --git a/inc/content/dist.php b/inc/content/dist.php old mode 100644 new mode 100755 index 7e004bf..a36af69 --- a/inc/content/dist.php +++ b/inc/content/dist.php @@ -1 +1,6 @@ - \ No newline at end of file +
+
+

404

+
+
+ diff --git a/inc/footer/dist.php b/inc/footer/dist.php deleted file mode 100644 index c48793c..0000000 --- a/inc/footer/dist.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/inc/head/dist.php b/inc/head/dist.php deleted file mode 100644 index 7b2ecd6..0000000 --- a/inc/head/dist.php +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - template - \ No newline at end of file diff --git a/inc/header/dist.php b/inc/header/dist.php deleted file mode 100644 index 616f64d..0000000 --- a/inc/header/dist.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/inc/index.php b/inc/index.php old mode 100644 new mode 100755 index 0c11519..c4d9b73 --- a/inc/index.php +++ b/inc/index.php @@ -1,26 +1,6 @@ diff --git a/inc/main/dist.php b/inc/main/dist.php deleted file mode 100644 index 156351a..0000000 --- a/inc/main/dist.php +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/inc/page/dist.php b/inc/page/dist.php deleted file mode 100644 index 937487e..0000000 --- a/inc/page/dist.php +++ /dev/null @@ -1,6 +0,0 @@ - -
- - - -
\ No newline at end of file diff --git a/inc/readme.md b/inc/readme.md new file mode 100755 index 0000000..4b82889 --- /dev/null +++ b/inc/readme.md @@ -0,0 +1,64 @@ +Dans ce repertoire se trouvent le code HTML des pages découpé en templates. + +--- + +Z est un système de templates en PHP qui effectue principalement des imports de code. +Il permet ne ne pas avoir à répéter inutilement des morceaux de HTML pour en faciliter la maintenance. + +C'est un projet crée par Cédric Morin, core-développeur de SPIP, qui n'a pas vocation est être très compliqué, mais qui répond très bien à notre demande. +[Il a été présenté lors de la session 2010 de Paris Web.](http://www.yterium.net/Un-framework-HTML-est-il-possible) + +--- + +Quelques règles simples définissent son fonctionnement : + + - Chaque sous-répertoire (dans `inc`) représente un morceau de page. + - La version affichée par défaut de ce morceau de page est `dist.php`. + - Les variantes portent des noms différents (`foo.php`) qui se référent au nom de la page appelée (`?page=foo`). + - Les répertoires autorisés sont définis dans `z-config.php`. + +--- + +Cette structure est proposée par défaut : + + _html + _head + _title + _body + _page + _header + content + _footer + +Mais elle peut bien sûr être modifiée en fonction des contraintes du projet. +Les tirets devant les morceaux `html`, `head` et `body` ne sont là que pour mettre en évidence ses blocs essentiels aux pages HTML. + +--- + +Le fichier `dist.php` étant appelé par défaut, le corps de page par défaut est bien souvent équivalent au contenu de la page 404. + +--- + +Une fonction de Z nommée `getPageName` permet de récupérer le nom de la page courante. Ce nom peut être alors utilisé comme une classe permettant d'identifier précisement les pages. +C'est ce qui est fait dans le répertoire `page` où on trouve : `
`qui côté CSS se traduira donc par un : `.page-foo`. + +--- + +Ce travail de factorisation est avant tout destiné aux intégrateurs, il n'est pas forcément repris côté développement. + +Pour faciliter ce travail de reprise, il été convenu que chaque morceau de page était débuté par un commentaire HTML précisant le nom du répertoire courant (`` par exemple). + +Ainsi il est facile en parcourant la source du fichier HTML généré de localiser dans quel répertoire se trouve le code initial. + +--- + +Pour préserver au mieux les identations sur le code généré, il est conseillé de ne pas indenter devant les includes et de finaliser les morceaux de code par un dernier retour chariot. + +--- + +Z permet également de réaliser des appels de morceaux de page directement à l'aide d'un paramètre supplémentaire dans l'url : `&zajax=footer`. + +Il est alors assez facile de simuler des comportements AJAX où : + + - sans JS, un lien de type `?page=foo` permet de garantir un fonctionnement par défaut ; + - avec JS, le lien est modifié pour `?page=foo&zajax=bar` et permet un chargement limité uniquement au morceau de page correspondant. \ No newline at end of file diff --git a/inc/z-ajax.php b/inc/z-ajax.php old mode 100644 new mode 100755 index 3d54eb7..d69658e --- a/inc/z-ajax.php +++ b/inc/z-ajax.php @@ -1,4 +1,4 @@ \ No newline at end of file diff --git a/inc/z-config.php b/inc/z-config.php new file mode 100755 index 0000000..22ae4e7 --- /dev/null +++ b/inc/z-config.php @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/inc/z-error.php b/inc/z-error.php old mode 100644 new mode 100755 index 5bc3301..082704e --- a/inc/z-error.php +++ b/inc/z-error.php @@ -1,3 +1,3 @@ \ No newline at end of file diff --git a/index.md b/index.md new file mode 100755 index 0000000..84355f0 --- /dev/null +++ b/index.md @@ -0,0 +1,108 @@ +[![Clever-garden](doc/img/clever-garden.png)](http://www.clever-age.com/) +========================================================================= + +Projet +------ + +_[Voir la documentation](doc/)_ + +### Conformité et affichage {#conformite} + +Maquette | Validation HTML | IE 8 | IE 9 | IE 10 | Opera | Chrome | Safari | Fx | Lynx [^1] | Impression | iPhone | iPad +-----------------------------------------------------------------------------|---------------------|------|------|-------|-------|--------|--------|-----|-----------|------------|--------|------ +[404](inc/?page=error) | | |  |  | | | | | | | | +[Démo](inc/?page=demo) | | |  |  | | | | | | | | + +### Respect des bonnes pratiques [^2] {#bps} + +Les bonnes pratiques ne sont pas forcément toutes à valider. Elles servent plutôt à donner une vision globale sur le travail et éventuellement à dégager des axes d'améliorations. +Il est par contre intéressant de savoir justifier chaque bonne pratique non-validée dans le cadre du projet. + +#### Niveau 1 + +Thématique | Description   | Fiche | Validité +------------------------|--------------------------------------------------------------------------------------------------------|---------------------------------------------------------|---------- +Alternatives | Chaque image est dotée d'une alternative textuelle appropriée | [BP 1](http://checklists.opquast.com/11/criteria/500/) | +Code | Le code source de chaque page débute par un déclaration de type de document | [BP 2](http://checklists.opquast.com/11/criteria/501/) | +Code | Le contenu de chaque page est organisé selon une structure de titres et sous-titres hiérarchisée | [BP 3](http://checklists.opquast.com/11/criteria/502/) | +Code | Le site n'impose pas de redirection ou de rafraichissement automatique côté client | [BP 4](http://checklists.opquast.com/11/criteria/503/) | +Code | Les styles ne sont pas utilisés pour générer du contenu | [BP 5](http://checklists.opquast.com/11/criteria/504/) | +Fichiers et multimédia | Les sons et vidéos sont déclenchés par l'utilisateur. | [BP 31](http://checklists.opquast.com/11/criteria/530/) | +Fichiers et multimédia | Les animations, sons et clignotements peuvent être mis en pause | [BP 34](http://checklists.opquast.com/11/criteria/533/) | +Formulaires | Chaque champ de formulaire est associé dans le code source à une étiquette qui lui est propre | [BP 35](http://checklists.opquast.com/11/criteria/534/) | +Formulaires | L'étiquette de chaque champ de formulaire indique si la saisie est obligatoire | [BP 39](http://checklists.opquast.com/11/criteria/538/) | +Hyperliens | Chaque lien est doté d'un intitulé dans le code source | [BP 41](http://checklists.opquast.com/11/criteria/540/) | +Hyperliens | Le soulignement est réservé aux hyperliens. | [BP 42](http://checklists.opquast.com/11/criteria/541/) | +Hyperliens | Les hyperliens sont visuellement différenciés du reste du contenu. | [BP 43](http://checklists.opquast.com/11/criteria/542/) | +Internationalisation | Le code source de chaque page indique la langue principale du contenu | [BP 49](http://checklists.opquast.com/11/criteria/548/) | +Navigation | Le site n'emploie pas la technique des jeux de cadres | [BP 52](http://checklists.opquast.com/11/criteria/551/) | +Navigation | Le focus clavier n'est ni supprimé ni masqué | [BP 58](http://checklists.opquast.com/11/criteria/557/) | +Serveur et Performances | Les entêtes envoyés par le serveur contiennent les informations relatives au jeu de caractères employé | [BP 75](http://checklists.opquast.com/11/criteria/574/) | + +#### Niveau 2 + +Thématique | Description   | Fiche | Validité +------------------------|--------------------------------------------------------------------------------------------------------|---------------------------------------------------------|---------- +Alternatives | Les objets inclus sont dotés d'une alternative appropriée | [BP 86](http://checklists.opquast.com/11/criteria/585/) | +Code | Le contenu ne comporte pas de tableaux imbriqués | [BP 88](http://checklists.opquast.com/11/criteria/587/) | +Code | Le codage de caractères utilisé est UTF-8 | [BP 89](http://checklists.opquast.com/11/criteria/588/) | +Code | Les mots ne comportent ni espaces ni balisage interne. | [BP 91](http://checklists.opquast.com/11/criteria/590/) | +Code | Les éléments visuellement présentés sous forme de liste sont balisés de façon appropriée | [BP 97](http://checklists.opquast.com/11/criteria/596/) | +Code | Le code source de chaque page contient une metadonnée qui définit le jeu de caractères | [BP 100](http://checklists.opquast.com/11/criteria/599/)| +Fichiers et multimédia | Les vignettes ne sont pas des images de taille supérieure redimensionnées côté client. | [BP 114](http://checklists.opquast.com/11/criteria/613/)| +Hyperliens | Le survol ou l'activation des hyperliens ne modifie pas la mise en page | [BP 121](http://checklists.opquast.com/11/criteria/620/)| +Hyperliens | Le site n'applique pas le même style aux liens visités et non visités | [BP 124](http://checklists.opquast.com/11/criteria/623/)| +Identification | Le code source de chaque page contient une metadonnée qui en décrit le contenu | [BP 126](http://checklists.opquast.com/11/criteria/625/)| +Identification | Le code source des pages contient un appel valide à un icône de favori | [BP 128](http://checklists.opquast.com/11/criteria/627/)| +Navigation | Les icônes de navigation sont accompagnées d'une légende explicite | [BP 131](http://checklists.opquast.com/11/criteria/630/)| +Navigation | Chaque page contient des liens d'accès rapide placés au début du code source | [BP 132](http://checklists.opquast.com/11/criteria/631/)| +Navigation | La navigation au clavier s'effectue dans un ordre prévisible | [BP 134](http://checklists.opquast.com/11/criteria/633/)| +Navigation | Les nouvelles fenêtres dimensionnées et les fenêtres modales sont dotées d'un bouton de fermeture | [BP 135](http://checklists.opquast.com/11/criteria/634/)| +Navigation | Les blocs de navigation de même nature sont affichés au même emplacement sur toutes les pages | [BP 136](http://checklists.opquast.com/11/criteria/635/)| +Navigation | Un contenu qui doit être restitué dans un lecteur d'écran ne lui est pas dissimulé | [BP 139](http://checklists.opquast.com/11/criteria/638/)| +Présentation | Le site propose au moins une feuille de style dédiée à l'impression | [BP 140](http://checklists.opquast.com/11/criteria/639/)| +Présentation | La taille des polices destinées à l'affichage écran est exprimée en taille variable | [BP 142](http://checklists.opquast.com/11/criteria/641/)| +Tableaux | Les titres des tableaux de données sont renseignés | [BP 147](http://checklists.opquast.com/11/criteria/646/)| +Tableaux | La linéarisation des tableaux utilisés pour la mise en page ne nuit pas à la compréhension des contenus| [BP 152](http://checklists.opquast.com/11/criteria/651/)| + +#### Niveau 3 + +Thématique | Description   | Fiche | Validité +------------------------|--------------------------------------------------------------------------------------------------------|---------------------------------------------------------|---------- +Code | Les styles en ligne sont utilisés de manière appropriée | [BP 156](http://checklists.opquast.com/11/criteria/655/)| +Code | Le code source de chaque page ne comporte pas d'erreur | [BP 157](http://checklists.opquast.com/11/criteria/656/)| +Code | Le code source de chaque page ne contient pas d'éléments ou d'attributs de présentation | [BP 158](http://checklists.opquast.com/11/criteria/657/)| +Code | Les dimensions réelles des images sont indiquées dans le code source. | [BP 159](http://checklists.opquast.com/11/criteria/658/)| +Code | L'accès aux contenus et services est possible sans le support des scripts | [BP 161](http://checklists.opquast.com/11/criteria/660/)| +Code | Le code source des pages est valide au regard de la grammaire choisie | [BP 162](http://checklists.opquast.com/11/criteria/661/)| +Code | Le code source de chaque page ne contient pas d'éléments détournés à des fins de présentation | [BP 164](http://checklists.opquast.com/11/criteria/663/)| +Contenus | Une metadonnée indique l'URL de référence des contenus proposés sous plusieurs formes | [BP 170](http://checklists.opquast.com/11/criteria/669/)| +Fichiers et multimédia | Le déroulement des animations ne bloque pas la navigation ou l'accès aux contenus | [BP 177](http://checklists.opquast.com/11/criteria/676/)| +Formulaires | Les champs de formulaire qui nécessitent une information commune sont regroupés sous une même légende | [BP 183](http://checklists.opquast.com/11/criteria/682/)| +Formulaires | Les listes d'options de formulaires sont présentées dans un ordre identifiable | [BP 185](http://checklists.opquast.com/11/criteria/684/)| +Internationalisation | Le sens de lecture du contenu est indiqué lorsqu'il diffère de celui par défaut | [BP 196](http://checklists.opquast.com/11/criteria/695/)| +Présentation | Le site propose une ou plusieurs feuilles de style dédiées aux terminaux mobiles | [BP 206](http://checklists.opquast.com/11/criteria/705/)| +Présentation | Les phrases ou ensembles de mots mis en images ne sont pas divisés | [BP 207](http://checklists.opquast.com/11/criteria/706/)| +Présentation | Le contenu textuel reste lisible avec une taille de caractère augmentée d'un facteur 2 | [BP 209](http://checklists.opquast.com/11/criteria/708/)| +Présentation | Les mises en majuscules à des fins décoratives sont effectuées à l'aide des styles | [BP 210](http://checklists.opquast.com/11/criteria/709/)| +Serveur et Performances | Les appels aux scripts sont placés après le contenu | [BP 213](http://checklists.opquast.com/11/criteria/712/)| +Serveur et Performances | Les fonctions de scripts sont placés dans des fichiers externes. | [BP 215](http://checklists.opquast.com/11/criteria/714/)| +Serveur et Performances | Les scripts sont minifiés | [BP 216](http://checklists.opquast.com/11/criteria/715/)| +Serveur et Performances | Les informations de style sont minifiées | [BP 217](http://checklists.opquast.com/11/criteria/716/)| + +[^1]: L'affichage Lynx est proche de la restitution faite par un lecteur d'écran ou de ce qui est perçu par un moteur de recherche. +[^2]: Extrait des [bonnes pratiques OPQUAST pour l'intégration XHTML/CSS](http://checklists.opquast.com/opquastv2?q=int%C3%A9gration+xhtml%2Fcss) + +*[BP]: Bonne Pratique +*[vs]: Versus +*[IE]: Internet Explorer +*[Fx]: Firefox +*[JS]: JavaScript +*[etc]: Et cætera +*[NOK]: Non OK +*[N/A]: Non applicable +*[v.]: version +*[CSS]: +*[HTML]: +*[XHTML]: +*[OPQUAST]: \ No newline at end of file diff --git a/index.php b/index.php old mode 100644 new mode 100755 index 3074d55..a4dc75e --- a/index.php +++ b/index.php @@ -1,22 +1,22 @@ - - - Index des maquettes - - - - -
+ + + Index des maquettes + + + + +
-
- +
+ \ No newline at end of file diff --git a/index.txt b/index.txt deleted file mode 100644 index 9db5e8e..0000000 --- a/index.txt +++ /dev/null @@ -1,29 +0,0 @@ -[![Clever-garden](doc/img/clever-garden.png)](http://www.clever-age.com/) -========================================================================= - -template --------- - -_[Voir la documentation](doc/)_ - -### Conformité et affichage {#conformite} - -Maquette | Validation HTML | IE 6 | IE 7 | IE 8 | IE 9 | Opera | Chrome | Safari | Fx | Lynx [^1] | Impression | iPhone | iPad ------------------------------------------------------------------------------|---------------------|------|------|------|------|-------|--------|--------|----|-----------|------------|--------|------ -[Démo](inc/?page=demo) | | | | |  | | | | | | | | - -[^1]: L'affichage Lynx est proche de la restitution faite par un lecteur d'écran ou de ce qui est perçu par un moteur de recherche. - -*[BP]: Bonne Pratique -*[vs]: Versus -*[IE]: Internet Explorer -*[Fx]: Firefox -*[JS]: JavaScript -*[etc]: Et cætera -*[NOK]: Non OK -*[N/A]: Non applicable -*[v.]: version -*[CSS]: -*[HTML]: -*[XHTML]: -*[OPQUAST]: \ No newline at end of file diff --git a/js/_after.js b/js/_after.js deleted file mode 100644 index 0b0eaf8..0000000 --- a/js/_after.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! jQuery v1.8.2 jquery.com | jquery.org/license */(function(e,t){function n(e){var t=dt[e]={};return Y.each(e.split(tt),function(e,n){t[n]=!0}),t}function r(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(mt,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:vt.test(r)?Y.parseJSON(r):r}catch(s){}Y.data(e,n,r)}else r=t}return r}function i(e){var t;for(t in e){if(t==="data"&&Y.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function s(){return!1}function o(){return!0}function u(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function a(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function f(e,t,n){t=t||0;if(Y.isFunction(t))return Y.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return Y.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=Y.grep(e,function(e){return e.nodeType===1});if(Bt.test(t))return Y.filter(t,r,!n);t=Y.filter(t,r)}return Y.grep(e,function(e,r){return Y.inArray(e,t)>=0===n})}function l(e){var t=It.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function c(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function h(e,t){if(t.nodeType!==1||!Y.hasData(e))return;var n,r,i,s=Y._data(e),o=Y._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(R.body),n=t.css("display");t.remove();if(n==="none"||n===""){rn=R.body.appendChild(rn||Y.extend(R.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!sn||!rn.createElement)sn=(rn.contentWindow||rn.contentDocument).document,sn.write(""),sn.close();t=sn.body.appendChild(sn.createElement(e)),n=nn(t,"display"),R.body.removeChild(rn)}return dn[e]=n,n}function x(e,t,n,r){var i;if(Y.isArray(t))Y.each(t,function(t,i){n||En.test(e)?r(e,i):x(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&Y.type(t)==="object")for(i in t)x(e+"["+i+"]",t[i],n,r);else r(e,t)}function T(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(tt),u=0,a=o.length;if(Y.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,it=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,st=/^[\],:{}\s]*$/,ot=/(?:^|:|,)(?:\s*\[)+/g,ut=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,at=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,ft=/^-ms-/,lt=/-([\da-z])/gi,ct=function(e,t){return(t+"").toUpperCase()},ht=function(){R.addEventListener?(R.removeEventListener("DOMContentLoaded",ht,!1),Y.ready()):R.readyState==="complete"&&(R.detachEvent("onreadystatechange",ht),Y.ready())},pt={};Y.fn=Y.prototype={constructor:Y,init:function(e,n,r){var i,s,o,u;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?i=[null,e,null]:i=rt.exec(e);if(i&&(i[1]||!n)){if(i[1])return n=n instanceof Y?n[0]:n,u=n&&n.nodeType?n.ownerDocument||n:R,e=Y.parseHTML(i[1],u,!0),it.test(i[1])&&Y.isPlainObject(n)&&this.attr.call(e,n,!0),Y.merge(this,e);s=R.getElementById(i[2]);if(s&&s.parentNode){if(s.id!==i[2])return r.find(e);this.length=1,this[0]=s}return this.context=R,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return Y.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),Y.makeArray(e,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return $.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=Y.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return Y.each(this,e,t)},ready:function(e){return Y.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack($.apply(this,arguments),"slice",$.call(arguments).join(","))},map:function(e){return this.pushStack(Y.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:V,sort:[].sort,splice:[].splice},Y.fn.init.prototype=Y.fn,Y.extend=Y.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!Y.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;q.resolveWith(R,[Y]),Y.fn.trigger&&Y(R).trigger("ready").off("ready")},isFunction:function(e){return Y.type(e)==="function"},isArray:Array.isArray||function(e){return Y.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):pt[K.call(e)]||"object"},isPlainObject:function(e){if(!e||Y.type(e)!=="object"||e.nodeType||Y.isWindow(e))return!1;try{if(e.constructor&&!Q.call(e,"constructor")&&!Q.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||Q.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||R,(r=it.exec(e))?[t.createElement(r[1])]:(r=Y.buildFragment([e],t,n?null:[]),Y.merge([],(r.cacheable?Y.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=Y.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(st.test(t.replace(ut,"@").replace(at,"]").replace(ot,"")))return(new Function("return "+t))();Y.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&Y.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&et.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ft,"ms-").replace(lt,ct)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||Y.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||Y.isArray(e));if(f)for(;u-1)f.splice(n,1),s&&(n<=u&&u--,n<=a&&a--)}),this},has:function(e){return Y.inArray(e,f)>-1},empty:function(){return f=[],this},disable:function(){return f=l=r=t,this},disabled:function(){return!f},lock:function(){return l=t,r||h.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],f&&(!i||l)&&(s?l.push(t):c(t)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!i}};return h},Y.extend({Deferred:function(e){var t=[["resolve","done",Y.Callbacks("once memory"),"resolved"],["reject","fail",Y.Callbacks("once memory"),"rejected"],["notify","progress",Y.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return Y.Deferred(function(n){Y.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](Y.isFunction(o)?function(){var e=o.apply(this,arguments);e&&Y.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?Y.extend(e,r):r}},i={};return r.pipe=r.then,Y.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=$.call(arguments),r=n.length,i=r!==1||e&&Y.isFunction(e.promise)?r:0,s=i===1?e:Y.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?$.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
a",n=h.getElementsByTagName("*"),r=h.getElementsByTagName("a")[0],r.style.cssText="top:1px;float:left;opacity:.5";if(!n||!n.length)return{};i=R.createElement("select"),s=i.appendChild(R.createElement("option")),o=h.getElementsByTagName("input")[0],t={leadingWhitespace:h.firstChild.nodeType===3,tbody:!h.getElementsByTagName("tbody").length,htmlSerialize:!!h.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:o.value==="on",optSelected:s.selected,getSetAttribute:h.className!=="t",enctype:!!R.createElement("form").enctype,html5Clone:R.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:R.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,i.disabled=!0,t.optDisabled=!s.disabled;try{delete h.test}catch(p){t.deleteExpando=!1}!h.addEventListener&&h.attachEvent&&h.fireEvent&&(h.attachEvent("onclick",c=function(){t.noCloneEvent=!1}),h.cloneNode(!0).fireEvent("onclick"),h.detachEvent("onclick",c)),o=R.createElement("input"),o.value="t",o.setAttribute("type","radio"),t.radioValue=o.value==="t",o.setAttribute("checked","checked"),o.setAttribute("name","t"),h.appendChild(o),u=R.createDocumentFragment(),u.appendChild(h.lastChild),t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=o.checked,u.removeChild(o),u.appendChild(h);if(h.attachEvent)for(f in{submit:!0,change:!0,focusin:!0})a="on"+f,l=a in h,l||(h.setAttribute(a,"return;"),l=typeof h[a]=="function"),t[f+"Bubbles"]=l;return Y(function(){var n,r,i,s,o="padding:0;margin:0;border:0;display:block;overflow:hidden;",u=R.getElementsByTagName("body")[0];if(!u)return;n=R.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",u.insertBefore(n,u.firstChild),r=R.createElement("div"),n.appendChild(r),r.innerHTML="
t
",i=r.getElementsByTagName("td"),i[0].style.cssText="padding:0;margin:0;border:0;display:none",l=i[0].offsetHeight===0,i[0].style.display="",i[1].style.display="none",t.reliableHiddenOffsets=l&&i[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=u.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",s=R.createElement("div"),s.style.cssText=r.style.cssText=o,s.style.marginRight=s.style.width="0",r.style.width="1px",r.appendChild(s),t.reliableMarginRight=!parseFloat((e.getComputedStyle(s,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=o+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),u.removeChild(n),n=r=i=s=null}),u.removeChild(h),n=r=i=s=o=u=h=null,t}();var vt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,mt=/([A-Z])/g;Y.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(Y.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?Y.cache[e[Y.expando]]:e[Y.expando],!!e&&!i(e)},data:function(e,n,r,i){if(!Y.acceptData(e))return;var s,o,u=Y.expando,a=typeof n=="string",f=e.nodeType,l=f?Y.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=Y.deletedIds.pop()||Y.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=Y.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=Y.extend(l[c],n):l[c].data=Y.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[Y.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[Y.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!Y.acceptData(e))return;var r,s,o,u=e.nodeType,a=u?Y.cache:e,f=u?e[Y.expando]:Y.expando;if(!a[f])return;if(t){r=n?a[f]:a[f].data;if(r){Y.isArray(t)||(t in r?t=[t]:(t=Y.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(s=0,o=t.length;s1,null,!1))},removeData:function(e){return this.each(function(){Y.removeData(this,e)})}}),Y.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y._data(e,t),n&&(!r||Y.isArray(n)?r=Y._data(e,t,Y.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=Y.queue(e,t),r=n.length,i=n.shift(),s=Y._queueHooks(e,t),o=function(){Y.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y._data(e,n)||Y._data(e,n,{empty:Y.Callbacks("once memory").add(function(){Y.removeData(e,t+"queue",!0),Y.removeData(e,n,!0)})})}}),Y.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){Y.removeAttr(this,e)})},prop:function(e,t){return Y.access(this,Y.prop,e,t,arguments.length>1)},removeProp:function(e){return e=Y.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(Y.isFunction(e))return this.each(function(t){Y(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(tt);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?Y.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return Y.isFunction(e)?this.each(function(n){Y(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=Y(this),u=t,a=e.split(tt);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&Y._data(this,"__className__",this.className),this.className=this.className||e===!1?"":Y._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=Y.valHooks[s.type]||Y.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(Et,""):r==null?"":r);return}return i=Y.isFunction(e),this.each(function(r){var s,o=Y(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":Y.isArray(s)&&(s=Y.map(s,function(e){return e==null?"":e+""})),n=Y.valHooks[this.type]||Y.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),Y.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r,i,s=e.selectedIndex,o=[],u=e.options,a=e.type==="select-one";if(s<0)return null;n=a?s:0,r=a?s+1:u.length;for(;n=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&Y.isFunction(Y.fn[n]))return Y(e)[n](r);if(typeof e.getAttribute=="undefined")return Y.prop(e,n,r);u=a!==1||!Y.isXMLDoc(e),u&&(n=n.toLowerCase(),o=Y.attrHooks[n]||(Nt.test(n)?yt:gt));if(r!==t){if(r===null){Y.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(tt);for(;o=0}})});var kt=/^(?:textarea|input|select)$/i,Lt=/^([^\.]*|)(?:\.(.+)|)$/,At=/(?:^|\s)hover(\.\S+|)\b/,Ot=/^key/,Mt=/^(?:mouse|contextmenu)|click/,_t=/^(?:focusinfocus|focusoutblur)$/,Dt=function(e){return Y.event.special.hover?e:e.replace(At,"mouseenter$1 mouseleave$1")};Y.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,v,m;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=Y._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=Y.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof Y=="undefined"||!!e&&Y.event.triggered===e.type?t:Y.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=Y.trim(Dt(n)).split(" ");for(f=0;f=0&&(m=m.slice(0,-1),u=!0),m.indexOf(".")>=0&&(g=m.split("."),m=g.shift(),g.sort());if((!i||Y.event.customEvent[m])&&!Y.event.global[m])return;n=typeof n=="object"?n[Y.expando]?n:new Y.Event(m,n):new Y.Event(m),n.type=m,n.isTrigger=!0,n.exclusive=u,n.namespace=g.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,c=m.indexOf(":")<0?"on"+m:"";if(!i){o=Y.cache;for(a in o)o[a].events&&o[a].events[m]&&Y.event.trigger(n,r,o[a].handle.elem,!0);return}n.result=t,n.target||(n.target=i),r=r!=null?Y.makeArray(r):[],r.unshift(n),h=Y.event.special[m]||{};if(h.trigger&&h.trigger.apply(i,r)===!1)return;d=[[i,h.bindType||m]];if(!s&&!h.noBubble&&!Y.isWindow(i)){v=h.delegateType||m,f=_t.test(v+m)?i:i.parentNode;for(l=i;f;f=f.parentNode)d.push([f,v]),l=f;l===(i.ownerDocument||R)&&d.push([l.defaultView||l.parentWindow||e,v])}for(a=0;a=0:Y.find(c,this,null,[s]).length),u[c]&&f.push(l);f.length&&y.push({elem:s,matches:f})}p.length>d&&y.push({elem:this,matches:p.slice(d)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Ot.test(t)&&(Y.event.fixHooks[t]=Y.event.keyHooks),Mt.test(t)&&(Y.event.fixHooks[t]=Y.event.mouseHooks)}),function(e,t){function n(e,t,n,r){n=n||[],t=t||M;var i,s,o,u,a=t.nodeType;if(!e||typeof e!="string")return n;if(a!==1&&a!==9)return[];o=E(t);if(!o&&!r)if(i=nt.exec(e))if(u=i[1]){if(a===9){s=t.getElementById(u);if(!s||!s.parentNode)return n;if(s.id===u)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(u))&&S(t,s)&&s.id===u)return n.push(s),n}else{if(i[2])return B.apply(n,j.call(t.getElementsByTagName(e),0)),n;if((u=i[3])&&dt&&t.getElementsByClassName)return B.apply(n,j.call(t.getElementsByClassName(u),0)),n}return v(e.replace(G,"$1"),t,n,r,o)}function r(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function i(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function s(e){return I(function(t){return t=+t,I(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function o(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function u(e,t){var r,i,s,o,u,a,f,l=U[A][e];if(l)return t?0:l.slice(0);u=e,a=[],f=b.preFilter;while(u){if(!r||(i=Z.exec(u)))i&&(u=u.slice(i[0].length)),a.push(s=[]);r=!1;if(i=et.exec(u))s.push(r=new O(i.shift())),u=u.slice(r.length),r.type=i[0].replace(G," ");for(o in b.filter)(i=ft[o].exec(u))&&(!f[o]||(i=f[o](i,M,!0)))&&(s.push(r=new O(i.shift())),u=u.slice(r.length),r.type=o,r.matches=i);if(!r)break}return t?u.length:u?n.error(e):U(e,a).slice(0)}function a(e,t,n){var r=t.dir,i=n&&t.dir==="parentNode",s=P++;return t.first?function(t,n,s){while(t=t[r])if(i||t.nodeType===1)return e(t,n,s)}:function(t,n,o){if(!o){var u,a=D+" "+s+" ",f=a+g;while(t=t[r])if(i||t.nodeType===1){if((u=t[A])===f)return t.sizset;if(typeof u=="string"&&u.indexOf(a)===0){if(t.sizset)return t}else{t[A]=f;if(e(t,n,o))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[r])if(i||t.nodeType===1)if(e(t,n,o))return t}}function f(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function l(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1},o,!0),d=[function(e,n,r){return!s&&(r||n!==C)||((t=n).nodeType?l(e,n,r):p(e,n,r))}];for(;u1&&f(d),u>1&&e.slice(0,u-1).join("").replace(G,"$1"),n,u0,i=e.length>0,s=function(o,u,a,f,c){var h,p,d,v=[],m=0,y="0",w=o&&[],E=c!=null,S=C,x=o||i&&b.find.TAG("*",c&&u.parentNode||u),T=D+=S==null?1:Math.E;E&&(C=u!==M&&u,g=s.el);for(;(h=x[y])!=null;y++){if(i&&h){for(p=0;d=e[p];p++)if(d(h,u,a)){f.push(h);break}E&&(D=T,g=++s.el)}r&&((h=!d&&h)&&m--,o&&w.push(h))}m+=y;if(r&&y!==m){for(p=0;d=t[p];p++)d(w,v,u,a);if(o){if(m>0)while(y--)!w[y]&&!v[y]&&(v[y]=H.call(f));v=l(v)}B.apply(f,v),E&&!o&&v.length>0&&m+t.length>1&&n.uniqueSort(f)}return E&&(D=T,C=S),w};return s.el=0,r?I(s):s}function d(e,t,r,i){var s=0,o=t.length;for(;s2&&(a=o[0]).type==="ID"&&t.nodeType===9&&!i&&b.relative[o[1].type]){t=b.find.ID(a.matches[0].replace(at,""),t,i)[0];if(!t)return n;e=e.slice(o.shift().length)}for(s=ft.POS.test(e)?-1:o.length-1;s>=0;s--){a=o[s];if(b.relative[f=a.type])break;if(l=b.find[f])if(r=l(a.matches[0].replace(at,""),it.test(o[0].type)&&t.parentNode||t,i)){o.splice(s,1),e=r.length&&o.join("");if(!e)return B.apply(n,j.call(r,0)),n;break}}}return x(e,c)(r,t,i,n,it.test(e)),n}function m(){}var g,y,b,w,E,S,x,T,N,C,k=!0,L="undefined",A=("sizcache"+Math.random()).replace(".",""),O=String,M=e.document,_=M.documentElement,D=0,P=0,H=[].pop,B=[].push,j=[].slice,F=[].indexOf||function(e){var t=0,n=this.length;for(;tb.cacheLength&&delete e[t.shift()],e[n]=r},e)},R=q(),U=q(),z=q(),W="[\\x20\\t\\r\\n\\f]",X="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",V=X.replace("w","w#"),$="([*^$|!~]?=)",J="\\["+W+"*("+X+")"+W+"*(?:"+$+W+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+V+")|)|)"+W+"*\\]",K=":("+X+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+J+")|[^:]|\\\\.)*|.*))\\)|)",Q=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+W+"*((?:-\\d)?\\d*)"+W+"*\\)|)(?=[^-]|$)",G=new RegExp("^"+W+"+|((?:^|[^\\\\])(?:\\\\.)*)"+W+"+$","g"),Z=new RegExp("^"+W+"*,"+W+"*"),et=new RegExp("^"+W+"*([\\x20\\t\\r\\n\\f>+~])"+W+"*"),tt=new RegExp(K),nt=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,rt=/^:not/,it=/[\x20\t\r\n\f]*[+~]/,st=/:not\($/,ot=/h\d/i,ut=/input|select|textarea|button/i,at=/\\(?!\\)/g,ft={ID:new RegExp("^#("+X+")"),CLASS:new RegExp("^\\.("+X+")"),NAME:new RegExp("^\\[name=['\"]?("+X+")['\"]?\\]"),TAG:new RegExp("^("+X.replace("w","w*")+")"),ATTR:new RegExp("^"+J),PSEUDO:new RegExp("^"+K),POS:new RegExp(Q,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+W+"*(even|odd|(([+-]|)(\\d*)n|)"+W+"*(?:([+-]|)"+W+"*(\\d+)|))"+W+"*\\)|)","i"),needsContext:new RegExp("^"+W+"*[>+~]|"+Q,"i")},lt=function(e){var t=M.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},ct=lt(function(e){return e.appendChild(M.createComment("")),!e.getElementsByTagName("*").length}),ht=lt(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==L&&e.firstChild.getAttribute("href")==="#"}),pt=lt(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),dt=lt(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),vt=lt(function(e){e.id=A+0,e.innerHTML="
",_.insertBefore(e,_.firstChild);var t=M.getElementsByName&&M.getElementsByName(A).length===2+M.getElementsByName(A+0).length;return y=!M.getElementById(A),_.removeChild(e),t});try{j.call(_.childNodes,0)[0].nodeType}catch(mt){j=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}n.matches=function(e,t){return n(e,null,null,t)},n.matchesSelector=function(e,t){return n(t,null,null,[e]).length>0},w=n.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=w(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=w(t);return n},E=n.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},S=n.contains=_.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:_.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},n.attr=function(e,t){var n,r=E(e);return r||(t=t.toLowerCase()),(n=b.attrHandle[t])?n(e):r||pt?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},b=n.selectors={cacheLength:50,createPseudo:I,match:ft,attrHandle:ht?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:y?function(e,t,n){if(typeof t.getElementById!==L&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==L&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==L&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:ct?function(e,t){if(typeof t.getElementsByTagName!==L)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:vt&&function(e,t){if(typeof t.getElementsByName!==L)return t.getElementsByName(name)},CLASS:dt&&function(e,t,n){if(typeof t.getElementsByClassName!==L&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(at,""),e[3]=(e[4]||e[5]||"").replace(at,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||n.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&n.error(e[0]),e},PSEUDO:function(e){var t,n;if(ft.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])tt.test(t)&&(n=u(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:y?function(e){return e=e.replace(at,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace(at,""),function(t){var n=typeof t.getAttributeNode!==L&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace(at,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=R[A][e];return t||(t=R(e,new RegExp("(^|"+W+")"+e+"("+W+"|$)"))),function(e){return t.test(e.className||typeof e.getAttribute!==L&&e.getAttribute("class")||"")}},ATTR:function(e,t,r){return function(i,s){var o=n.attr(i,e);return o==null?t==="!=":t?(o+="",t==="="?o===r:t==="!="?o!==r:t==="^="?r&&o.indexOf(r)===0:t==="*="?r&&o.indexOf(r)>-1:t==="$="?r&&o.substr(o.length-r.length)===r:t==="~="?(" "+o+" ").indexOf(r)>-1:t==="|="?o===r||o.substr(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var r,i=b.pseudos[e]||b.setFilters[e.toLowerCase()]||n.error("unsupported pseudo: "+e);return i[A]?i(t):i.length>1?(r=[e,e,"",t],b.setFilters.hasOwnProperty(e.toLowerCase())?I(function(e,n){var r,s=i(e,t),o=s.length;while(o--)r=F.call(e,s[o]),e[r]=!(n[r]=s[o])}):function(e){return i(e,0,r)}):i}},pseudos:{not:I(function(e){var t=[],n=[],r=x(e.replace(G,"$1"));return r[A]?I(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:I(function(e){return function(t){return n(e,t).length>0}}),contains:I(function(e){return function(t){return(t.textContent||t.innerText||w(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!b.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return ot.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:r("radio"),checkbox:r("checkbox"),file:r("file"),password:r("password"),image:r("image"),submit:i("submit"),reset:i("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return ut.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&(!!e.type||!!e.href)},active:function(e){return e===e.ownerDocument.activeElement},first:s(function(e,t,n){return[0]}),last:s(function(e,t,n){return[t-1]}),eq:s(function(e,t,n){return[n<0?n+t:n]}),even:s(function(e,t,n){for(var r=0;r=0;)e.push(r);return e}),gt:s(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||s.push("\\["+W+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||s.push(":checked")}),lt(function(e){e.innerHTML="

",e.querySelectorAll("[test^='']").length&&s.push("[*^$]="+W+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||s.push(":enabled",":disabled")}),s=new RegExp(s.join("|")),v=function(e,n,i,o,a){if(!o&&!a&&(!s||!s.test(e))){var f,l,c=!0,h=A,p=n,d=n.nodeType===9&&e;if(n.nodeType===1&&n.nodeName.toLowerCase()!=="object"){f=u(e),(c=n.getAttribute("id"))?h=c.replace(r,"\\$&"):n.setAttribute("id",h),h="[id='"+h+"'] ",l=f.length;while(l--)f[l]=h+f[l].join("");p=it.test(e)&&n.parentNode||n,d=f.join(",")}if(d)try{return B.apply(i,j.call(p.querySelectorAll(d),0)),i}catch(v){}finally{c||n.removeAttribute("id")}}return t(e,n,i,o,a)},a&&(lt(function(t){e=a.call(t,"div");try{a.call(t,"[test!='']:sizzle"),o.push("!=",K)}catch(n){}}),o=new RegExp(o.join("|")),n.matchesSelector=function(t,r){r=r.replace(i,"='$1']");if(!E(t)&&!o.test(r)&&(!s||!s.test(r)))try{var u=a.call(t,r);if(u||e||t.document&&t.document.nodeType!==11)return u}catch(f){}return n(r,null,null,[t]).length>0})}(),b.pseudos.nth=b.pseudos.eq,b.filters=m.prototype=b.pseudos,b.setFilters=new m,n.attr=Y.attr,Y.find=n,Y.expr=n.selectors,Y.expr[":"]=Y.expr.pseudos,Y.unique=n.uniqueSort,Y.text=n.getText,Y.isXMLDoc=n.isXML,Y.contains=n.contains}(e);var Pt=/Until$/,Ht=/^(?:parents|prev(?:Until|All))/,Bt=/^.[^:#\[\.,]*$/,jt=Y.expr.match.needsContext,Ft={children:!0,contents:!0,next:!0,prev:!0};Y.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return Y(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:Y.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=jt.test(e)||typeof e!="string"?Y(e,t||this.context):0;for(;r-1:Y.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?Y.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?Y.inArray(this[0],Y(e)):Y.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?Y(e,t):Y.makeArray(e&&e.nodeType?[e]:e),r=Y.merge(this.get(),n);return this.pushStack(u(n[0])||u(r[0])?r:Y.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),Y.fn.andSelf=Y.fn.addBack,Y.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return Y.dir(e,"parentNode")},parentsUntil:function(e,t,n){return Y.dir(e,"parentNode",n)},next:function(e){return a(e,"nextSibling")},prev:function(e){return a(e,"previousSibling")},nextAll:function(e){return Y.dir(e,"nextSibling")},prevAll:function(e){return Y.dir(e,"previousSibling")},nextUntil:function(e,t,n){return Y.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return Y.dir(e,"previousSibling",n)},siblings:function(e){return Y.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return Y.sibling(e.firstChild)},contents:function(e){return Y.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:Y.merge([],e.childNodes)}},function(e,t){Y.fn[e]=function(n,r){var i=Y.map(this,t,n);return Pt.test(e)||(r=n),r&&typeof r=="string"&&(i=Y.filter(r,i)),i=this.length>1&&!Ft[e]?Y.unique(i):i,this.length>1&&Ht.test(e)&&(i=i.reverse()),this.pushStack(i,e,$.call(arguments).join(","))}}),Y.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?Y.find.matchesSelector(t[0],e)?[t[0]]:[]:Y.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!Y(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var It="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",qt=/ jQuery\d+="(?:null|\d+)"/g,Rt=/^\s+/,Ut=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,zt=/<([\w:]+)/,Wt=/]","i"),Kt=/^(?:checkbox|radio)$/,Qt=/checked\s*(?:[^=]|=\s*.checked.)/i,Gt=/\/(java|ecma)script/i,Yt=/^\s*\s*$/g,Zt={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},en=l(R),tn=en.appendChild(R.createElement("div"));Zt.optgroup=Zt.option,Zt.tbody=Zt.tfoot=Zt.colgroup=Zt.caption=Zt.thead,Zt.th=Zt.td,Y.support.htmlSerialize||(Zt._default=[1,"X
","
"]),Y.fn.extend({text:function(e){return Y.access(this,function(e){return e===t?Y.text(this):this.empty().append((this[0]&&this[0].ownerDocument||R).createTextNode(e))},null,e,arguments.length -)},wrapAll:function(e){if(Y.isFunction(e))return this.each(function(t){Y(this).wrapAll(e.call(this,t))});if(this[0]){var t=Y(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return Y.isFunction(e)?this.each(function(t){Y(this).wrapInner(e.call(this,t))}):this.each(function(){var t=Y(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=Y.isFunction(e);return this.each(function(n){Y(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){Y.nodeName(this,"body")||Y(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!u(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=Y.clean(arguments);return this.pushStack(Y.merge(e,this),"before",this.selector)}},after:function(){if(!u(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=Y.clean(arguments);return this.pushStack(Y.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||Y.filter(e,[n]).length)!t&&n.nodeType===1&&(Y.cleanData(n.getElementsByTagName("*")),Y.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&Y.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return Y.clone(this,e,t)})},html:function(e){return Y.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(qt,""):t;if(typeof e=="string"&&!Vt.test(e)&&(Y.support.htmlSerialize||!Jt.test(e))&&(Y.support.leadingWhitespace||!Rt.test(e))&&!Zt[(zt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Ut,"<$1>");try{for(;r1&&typeof f=="string"&&Qt.test(f))return this.each(function(){Y(this).domManip(e,n,r)});if(Y.isFunction(f))return this.each(function(i){var s=Y(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=Y.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&Y.nodeName(s,"tr");for(u=i.cacheable||h-1;a0?this.clone(!0):this).get(),Y(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),Y.extend({clone:function(e,t,n){var r,i,s,o;Y.support.html5Clone||Y.isXMLDoc(e)||!Jt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(tn.innerHTML=e.outerHTML,tn.removeChild(o=tn.firstChild));if((!Y.support.noCloneEvent||!Y.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!Y.isXMLDoc(e)){p(e,o),r=d(e),i=d(o);for(s=0;r[s];++s)i[s]&&p(r[s],i[s])}if(t){h(e,o);if(n){r=d(e),i=d(o);for(s=0;r[s];++s)h(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var i,s,o,u,a,f,c,h,p,d,m,g,y=t===R&&en,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=R;for(i=0;(o=e[i])!=null;i++){typeof o=="number"&&(o+="");if(!o)continue;if(typeof o=="string")if(!Xt.test(o))o=t.createTextNode(o);else{y=y||l(t),c=t.createElement("div"),y.appendChild(c),o=o.replace(Ut,"<$1>"),u=(zt.exec(o)||["",""])[1].toLowerCase(),a=Zt[u]||Zt._default,f=a[0],c.innerHTML=a[1]+o+a[2];while(f--)c=c.lastChild;if(!Y.support.tbody){h=Wt.test(o),p=u==="table"&&!h?c.firstChild&&c.firstChild.childNodes:a[1]===""&&!h?c.childNodes:[];for(s=p.length-1;s>=0;--s)Y.nodeName(p[s],"tbody")&&!p[s].childNodes.length&&p[s].parentNode.removeChild(p[s])}!Y.support.leadingWhitespace&&Rt.test(o)&&c.insertBefore(t.createTextNode(Rt.exec(o)[0]),c.firstChild),o=c.childNodes,c.parentNode.removeChild(c)}o.nodeType?b.push(o):Y.merge(b,o)}c&&(o=c=y=null);if(!Y.support.appendChecked)for(i=0;(o=b[i])!=null;i++)Y.nodeName(o,"input")?v(o):typeof o.getElementsByTagName!="undefined"&&Y.grep(o.getElementsByTagName("input"),v);if(n){m=function(e){if(!e.type||Gt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(i=0;(o=b[i])!=null;i++)if(!Y.nodeName(o,"script")||!m(o))n.appendChild(o),typeof o.getElementsByTagName!="undefined"&&(g=Y.grep(Y.merge([],o.getElementsByTagName("script")),m),b.splice.apply(b,[i+1,0].concat(g)),i+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=Y.expando,a=Y.cache,f=Y.support.deleteExpando,l=Y.event.special;for(;(i=e[o])!=null;o++)if(t||Y.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?Y.event.remove(i,s):Y.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,Y.deletedIds.push(r))}}}}),function(){var e,t;Y.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=Y.uaMatch(z.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),Y.browser=t,Y.sub=function(){function e(t,n){return new e.fn.init(t,n)}Y.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function n(n,r){return r&&r instanceof Y&&!(r instanceof e)&&(r=e(r)),Y.fn.init.call(this,n,r,t)},e.fn.init.prototype=e.fn;var t=e(R);return e}}();var nn,rn,sn,on=/alpha\([^)]*\)/i,un=/opacity=([^)]*)/,an=/^(top|right|bottom|left)$/,fn=/^(none|table(?!-c[ea]).+)/,ln=/^margin/,cn=new RegExp("^("+Z+")(.*)$","i"),hn=new RegExp("^("+Z+")(?!px)[a-z%]+$","i"),pn=new RegExp("^([-+])=("+Z+")","i"),dn={},vn={position:"absolute",visibility:"hidden",display:"block"},mn={letterSpacing:0,fontWeight:400},gn=["Top","Right","Bottom","Left"],yn=["Webkit","O","Moz","ms"],bn=Y.fn.toggle;Y.fn.extend({css:function(e,n){return Y.access(this,function(e,n,r){return r!==t?Y.style(e,n,r):Y.css(e,n)},e,n,arguments.length>1)},show:function(){return y(this,!0)},hide:function(){return y(this)},toggle:function(e,t){var n=typeof e=="boolean";return Y.isFunction(e)&&Y.isFunction(t)?bn.apply(this,arguments):this.each(function(){(n?e:g(this))?Y(this).show():Y(this).hide()})}}),Y.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=nn(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":Y.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=Y.camelCase(n),f=e.style;n=Y.cssProps[a]||(Y.cssProps[a]=m(f,a)),u=Y.cssHooks[n]||Y.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=pn.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(Y.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!Y.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=Y.camelCase(n);return n=Y.cssProps[a]||(Y.cssProps[a]=m(e.style,a)),u=Y.cssHooks[n]||Y.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=nn(e,n)),s==="normal"&&n in mn&&(s=mn[n]),r||i!==t?(o=parseFloat(s),r||Y.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?nn=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u[n],r===""&&!Y.contains(t.ownerDocument,t)&&(r=Y.style(t,n)),hn.test(r)&&ln.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:R.documentElement.currentStyle&&(nn=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),hn.test(i)&&!an.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),Y.each(["height","width"],function(e,t){Y.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&fn.test(nn(e,"display"))?Y.swap(e,vn,function(){return E(e,t,r)}):E(e,t,r)},set:function(e,n,r){return b(e,n,r?w(e,t,r,Y.support.boxSizing&&Y.css(e,"boxSizing")==="border-box"):0)}}}),Y.support.opacity||(Y.cssHooks.opacity={get:function(e,t){return un.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=Y.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&Y.trim(s.replace(on,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=on.test(s)?s.replace(on,i):s+" "+i}}),Y(function(){Y.support.reliableMarginRight||(Y.cssHooks.marginRight={get:function(e,t){return Y.swap(e,{display:"inline-block"},function(){if(t)return nn(e,"marginRight")})}}),!Y.support.pixelPosition&&Y.fn.position&&Y.each(["top","left"],function(e,t){Y.cssHooks[t]={get:function(e,n){if(n){var r=nn(e,t);return hn.test(r)?Y(e).position()[t]+"px":r}}}})}),Y.expr&&Y.expr.filters&&(Y.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!Y.support.reliableHiddenOffsets&&(e.style&&e.style.display||nn(e,"display"))==="none"},Y.expr.filters.visible=function(e){return!Y.expr.filters.hidden(e)}),Y.each({margin:"",padding:"",border:"Width"},function(e,t){Y.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+gn[r]+t]=i[r]||i[r-2]||i[0];return s}},ln.test(e)||(Y.cssHooks[e+t].set=b)});var wn=/%20/g,En=/\[\]$/,Sn=/\r?\n/g,xn=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Tn=/^(?:select|textarea)/i;Y.fn.extend({serialize:function(){return Y.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?Y.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||Tn.test(this.nodeName)||xn.test(this.type))}).map(function(e,t){var n=Y(this).val();return n==null?null:Y.isArray(n)?Y.map(n,function(e,n){return{name:t.name,value:e.replace(Sn,"\r\n")}}):{name:t.name,value:n.replace(Sn,"\r\n")}}).get()}}),Y.param=function(e,n){var r,i=[],s=function(e,t){t=Y.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=Y.ajaxSettings&&Y.ajaxSettings.traditional);if(Y.isArray(e)||e.jquery&&!Y.isPlainObject(e))Y.each(e,function(){s(this.name,this.value)});else for(r in e)x(r,e[r],n,s);return i.join("&").replace(wn,"+")};var Nn,Cn,kn=/#.*$/,Ln=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,An=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,On=/^(?:GET|HEAD)$/,Mn=/^\/\//,_n=/\?/,Dn=/)<[^<]*)*<\/script>/gi,Pn=/([?&])_=[^&]*/,Hn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Bn=Y.fn.load,jn={},Fn={},In=["*/"]+["*"];try{Cn=U.href}catch(qn){Cn=R.createElement("a"),Cn.href="",Cn=Cn.href}Nn=Hn.exec(Cn.toLowerCase())||[],Y.fn.load=function(e,n,r){if(typeof e!="string"&&Bn)return Bn.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),Y.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),Y.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?Y("
").append(e.replace(Dn,"")).find(i):e)}),this},Y.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){Y.fn[t]=function(e){return this.on(t,e)}}),Y.each(["get","post"],function(e,n){Y[n]=function(e,r,i,s){return Y.isFunction(r)&&(s=s||i,i=r,r=t),Y.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),Y.extend({getScript:function(e,n){return Y.get(e,t,n,"script")},getJSON:function(e,t,n){return Y.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?C(e,Y.ajaxSettings):(t=e,e=Y.ajaxSettings),C(e,t),e},ajaxSettings:{url:Cn,isLocal:An.test(Nn[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":In},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":Y.parseJSON,"text xml":Y.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:T(jn),ajaxTransport:T(Fn),ajax:function(e,n){function r(e,n,r,o){var f,c,y,b,E,x=n;if(w===2)return;w=2,a&&clearTimeout(a),u=t,s=o||"",S.readyState=e>0?4:0,r&&(b=k(h,S,r));if(e>=200&&e<300||e===304)h.ifModified&&(E=S.getResponseHeader("Last-Modified"),E&&(Y.lastModified[i]=E),E=S.getResponseHeader("Etag"),E&&(Y.etag[i]=E)),e===304?(x="notmodified",f=!0):(f=L(h,b),x=f.state,c=f.data,y=f.error,f=!y);else{y=x;if(!x||e)x="error",e<0&&(e=0)}S.status=e,S.statusText=(n||x)+"",f?v.resolveWith(p,[c,x,S]):v.rejectWith(p,[S,x,y]),S.statusCode(g),g=t,l&&d.trigger("ajax"+(f?"Success":"Error"),[S,h,f?c:y]),m.fireWith(p,[S,x]),l&&(d.trigger("ajaxComplete",[S,h]),--Y.active||Y.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var i,s,o,u,a,f,l,c,h=Y.ajaxSetup({},n),p=h.context||h,d=p!==h&&(p.nodeType||p instanceof Y)?Y(p):Y.event,v=Y.Deferred(),m=Y.Callbacks("once memory"),g=h.statusCode||{},y={},b={},w=0,E="canceled",S={readyState:0,setRequestHeader:function(e,t){if(!w){var n=e.toLowerCase();e=b[n]=b[n]||e,y[e]=t}return this},getAllResponseHeaders:function(){return w===2?s:null},getResponseHeader:function(e){var n;if(w===2){if(!o){o={};while(n=Ln.exec(s))o[n[1].toLowerCase()]=n[2]}n=o[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return w||(h.mimeType=e),this},abort:function(e){return e=e||E,u&&u.abort(e),r(0,e),this}};v.promise(S),S.success=S.done,S.error=S.fail,S.complete=m.add,S.statusCode=function(e){if(e){var t;if(w<2)for(t in e)g[t]=[g[t],e[t]];else t=e[S.status],S.always(t)}return this},h.url=((e||h.url)+"").replace(kn,"").replace(Mn,Nn[1]+"//"),h.dataTypes=Y.trim(h.dataType||"*").toLowerCase().split(tt),h.crossDomain==null&&(f=Hn.exec(h.url.toLowerCase())||!1,h.crossDomain=f&&f.join(":")+(f[3]?"":f[1]==="http:"?80:443)!==Nn.join(":")+(Nn[3]?"":Nn[1]==="http:"?80:443)),h.data&&h.processData&&typeof h.data!="string"&&(h.data=Y.param(h.data,h.traditional)),N(jn,h,n,S);if(w===2)return S;l=h.global,h.type=h.type.toUpperCase(),h.hasContent=!On.test(h.type),l&&Y.active++===0&&Y.event.trigger("ajaxStart");if(!h.hasContent){h.data&&(h.url+=(_n.test(h.url)?"&":"?")+h.data,delete h.data),i=h.url;if(h.cache===!1){var x=Y.now(),T=h.url.replace(Pn,"$1_="+x);h.url=T+(T===h.url?(_n.test(h.url)?"&":"?")+"_="+x:"")}}(h.data&&h.hasContent&&h.contentType!==!1||n.contentType)&&S.setRequestHeader("Content-Type",h.contentType),h.ifModified&&(i=i||h.url,Y.lastModified[i]&&S.setRequestHeader("If-Modified-Since",Y.lastModified[i]),Y.etag[i]&&S.setRequestHeader("If-None-Match",Y.etag[i])),S.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+(h.dataTypes[0]!=="*"?", "+In+"; q=0.01":""):h.accepts["*"]);for(c in h.headers)S.setRequestHeader(c,h.headers[c]);if(!h.beforeSend||h.beforeSend.call(p,S,h)!==!1&&w!==2){E="abort";for(c in{success:1,error:1,complete:1})S[c](h[c]);u=N(Fn,h,n,S);if(!u)r(-1,"No Transport");else{S.readyState=1,l&&d.trigger("ajaxSend",[S,h]),h.async&&h.timeout>0&&(a=setTimeout(function(){S.abort("timeout")},h.timeout));try{w=1,u.send(y,r)}catch(C){if(!(w<2))throw C;r(-1,C)}}return S}return S.abort()},active:0,lastModified:{},etag:{}});var Rn=[],Un=/\?/,zn=/(=)\?(?=&|$)|\?\?/,Wn=Y.now();Y.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Rn.pop()||Y.expando+"_"+Wn++;return this[e]=!0,e}}),Y.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&zn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&zn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=Y.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(zn,"$1"+s):h?n.data=a.replace(zn,"$1"+s):l&&(n.url+=(Un.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||Y.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Rn.push(s)),u&&Y.isFunction(o)&&o(u[0]),u=o=t}),"script"}),Y.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return Y.globalEval(e),e}}}),Y.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),Y.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=R.head||R.getElementsByTagName("head")[0]||R.documentElement;return{send:function(i,s){n=R.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||s(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Xn,Vn=e.ActiveXObject?function(){for(var e in Xn)Xn[e](0,1)}:!1,$n=0;Y.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&A()||O()}:A,function(e){Y.extend(Y.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(Y.ajaxSettings.xhr()),Y.support.ajax&&Y.ajaxTransport(function(n){if(!n.crossDomain||Y.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=Y.noop,Vn&&delete Xn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(e){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++$n,Vn&&(Xn||(Xn={},Y(e).unload(Vn)),Xn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var Jn,Kn,Qn=/^(?:toggle|show|hide)$/,Gn=new RegExp("^(?:([-+])=|)("+Z+")([a-z%]*)$","i"),Yn=/queueHooks$/,Zn=[H],er={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=Gn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(Y.cssNumber[e]?"":"px");if(r!=="px"&&u){u=Y.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,Y.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};Y.Animation=Y.extend(D,{tweener:function(e,t){Y.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),Y.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},Y.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=tr.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(Y.css(e,"marginTop"))||0,n.left-=parseFloat(Y.css(e,"marginLeft"))||0,r.top+=parseFloat(Y.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(Y.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||R.body;while(e&&!tr.test(e.nodeName)&&Y.css(e,"position")==="static")e=e.offsetParent;return e||R.body})}}),Y.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);Y.fn[e]=function(i){return Y.access(this,function(e,i,s){var o=F(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?Y(o).scrollLeft():s,r?s:Y(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),Y.each({Height:"height",Width:"width"},function(e,n){Y.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){Y.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return Y.access(this,function(n,r,i){var s;return Y.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?Y.css(n,r,i,u):Y.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=Y,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return Y})})(window);(function(e,t){typeof jQuery=="undefined"&&alert("Hashgrid: jQuery not loaded. Make sure it's linked to your pages.");var n=function(t){function x(e){if(n.modifierKey==null)return!0;var t=!0;switch(n.modifierKey){case"ctrl":t=e.ctrlKey?e.ctrlKey:!1;break;case"alt":t=e.altKey?e.altKey:!1;break;case"shift":t=e.shiftKey?e.shiftKey:!1}return t}function T(e){var t=!1,n=e.keyCode?e.keyCode:e.which;n==13?t="enter":t=String.fromCharCode(n).toLowerCase();return t}function N(){A(n.cookiePrefix+n.id,(E?"1":"0")+"-"+v+"-"+r,1)}function C(){l.show()}function k(e){var t,i,s=e.target.tagName.toLowerCase();if(s=="input"||s=="textarea"||s=="select")return!0;i=x(e);if(!i)return!0;t=T(e);if(!t)return!0;switch(t){case n.showGridKey:if(!p){C();p=!0}else if(E){l.hide();p=!1;E=!1;N()}break;case n.holdGridKey:if(p&&!E){E=!0;N()}break;case n.foregroundKey:if(p){if(l.css("z-index")==g){l.css("z-index",m);v="B"}else{l.css("z-index",g);v="F"}N()}break;case n.jumpGridsKey:if(p&&n.numberOfGrids>1){l.removeClass(n.classPrefix+r);r++;r>n.numberOfGrids&&(r=1);l.addClass(n.classPrefix+r);C();/webkit/.test(navigator.userAgent.toLowerCase())&&_();N()}}return!0}function L(e){var t,r=x(e);if(!r)return!0;t=T(e);if(t&&t==n.showGridKey&&!E){l.hide();p=!1}return!0}function A(e,t,n){var r,i="";if(n){r=new Date;r.setTime(r.getTime()+n*24*60*60*1e3);i="; expires="+r.toGMTString()}document.cookie=e+"="+t+i+"; path=/"}function O(e){var t,n=document.cookie.split(";"),r=0,i=n.length,s=e+"=";for(;r0&&e("#"+n.id).remove();h=e("
");h.attr("id",n.id).css({display:"none","pointer-events":"none"});e("body").prepend(h);l=e("#"+n.id);l.css("z-index")=="auto"&&l.css("z-index",m);y=parseFloat(e(document).height());l.height(y);l.append('
');S=l.css("top");l.css({top:"-999px",display:"block"});u=e("#"+n.id+"-horiz");a=u.outerHeight()-1;l.css({display:"none",top:S});if(a<=0)return!1;f=Math.floor(y/a);i="";for(o=f-1;o>=1;o--)i+='
';l.append(i);l.prepend(e('
'));d=l.children(".vert-container");s=l.width();d.css({position:"absolute",top:0});d.append('
');i="";for(o=0;o<50;o++)i+='
';d.append(i);d.children().css({display:"inline-block"}).height(y);c=O(n.cookiePrefix+n.id);if(typeof c=="string"){w=c.split("-");w[2]=Number(w[2]);if(typeof w[2]=="number"&&!isNaN(w[2])){r=w[2].toFixed(0);l.addClass(n.classPrefix+r)}if(w[1]=="F"){v="F";l.css("z-index",g)}if(w[0]=="1"){p=!0;E=!0;C()}}else l.addClass(n.classPrefix+r);e(document).bind("keydown",k);e(document).bind("keyup",L);return{}};e(document).ready(function(){var e=new n({numberOfGrids:3})})})(jQuery); \ No newline at end of file diff --git a/js/_before.js b/js/_before.js deleted file mode 100644 index 5273e24..0000000 --- a/js/_before.js +++ /dev/null @@ -1 +0,0 @@ -var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS"},searchString:function(e){for(var t=0;t 0) -{ - classes += " flash"; -} -*/ -if(htmlclass) -{ - htmlclass = htmlclass.replace('no-js',''); -} -html.setAttribute(addclass, htmlclass + classes); \ No newline at end of file diff --git a/js/lib/browserdetect.js b/js/lib/browserdetect.js deleted file mode 100644 index 7da0faa..0000000 --- a/js/lib/browserdetect.js +++ /dev/null @@ -1,117 +0,0 @@ -var BrowserDetect = { - init: function () { - this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; - this.version = this.searchVersion(navigator.userAgent) - || this.searchVersion(navigator.appVersion) - || "an unknown version"; - this.OS = this.searchString(this.dataOS) || "an unknown OS"; - }, - searchString: function (data) { - for (var i=0;i 0) { - $('#' + options.id).remove(); - } - - // Create overlay, hidden before adding to DOM - overlayEl = $('
'); - overlayEl - .attr('id', options.id) - .css({ - display: 'none', - 'pointer-events': 'none' - }); - $("body").prepend(overlayEl); - overlay = $('#' + options.id); - - // Unless a custom z-index is set, ensure the overlay will be behind everything - if (overlay.css('z-index') == 'auto') overlay.css('z-index', overlayZBackground); - - // Override the default overlay height with the actual page height - pageHeight = parseFloat($(document).height()); - overlay.height(pageHeight); - - // Add the first grid line so that we can measure it - overlay.append('
'); - - // Position off-screen and display to calculate height - top = overlay.css("top"); - overlay.css({ - top: "-999px", - display: "block" - }); - - // Calculate the number of grid lines needed - line = $('#' + options.id + '-horiz'); - lineHeight = line.outerHeight() -1; - - // Hide and reset top - overlay.css({ - display: "none", - top: top - }); - - // Break on zero line height - if (lineHeight <= 0) { - return false; - } - - // Add the remaining grid lines - numGridLines = Math.floor(pageHeight / lineHeight); - gridLines = ''; - - for (i = numGridLines - 1; i >= 1; i--) { - gridLines += '
'; - } - overlay.append(gridLines); - - // vertical grid - overlay.prepend($('
')); - overlayVert = overlay.children('.vert-container'); - gridWidth = overlay.width(); - overlayVert.css({position: 'absolute', top: 0}); - overlayVert.append('
'); - - // 50 is an arbitrarily large number... - // can't calculate the margin width properly - gridLines = ''; - for (i = 0; i < 50; i++) { - gridLines += '
'; - } - overlayVert.append(gridLines); - overlayVert.children() - .css({ display: 'inline-block' }) - .height(pageHeight); - - // Check for saved state - overlayCookie = readCookie(options.cookiePrefix + options.id); - if (typeof overlayCookie == 'string') { - state = overlayCookie.split('-'); - state[2] = Number(state[2]); - if ((typeof state[2] == 'number') && !isNaN(state[2])) { - classNumber = state[2].toFixed(0); - overlay.addClass(options.classPrefix + classNumber); - } - if (state[1] == 'F') { - overlayZState = 'F'; - overlay.css('z-index', overlayZForeground); - } - if (state[0] == '1') { - overlayOn = true; - sticky = true; - showOverlay(); - } - } - else { - overlay.addClass(options.classPrefix + classNumber); - } - - // Keyboard controls - $(document).bind('keydown', keydownHandler); - $(document).bind('keyup', keyupHandler); - - /* - * Helpers - */ - - function getModifier(e) { - if (options.modifierKey == null) return true; // Bypass by default - var m = true; - switch(options.modifierKey) { - case 'ctrl': - m = (e.ctrlKey ? e.ctrlKey : false); - break; - - case 'alt': - m = (e.altKey ? e.altKey : false); - break; - - case 'shift': - m = (e.shiftKey ? e.shiftKey : false); - break; - } - return m; - } - - function getKey(e) { - var k = false, c = (e.keyCode ? e.keyCode : e.which); - // Handle keywords - if (c == 13) k = 'enter'; - // Handle letters - else k = String.fromCharCode(c).toLowerCase(); - return k; - } - - function saveState() { - createCookie(options.cookiePrefix + options.id, (sticky ? '1' : '0') + '-' + overlayZState + '-' + classNumber, 1); - } - - function showOverlay() { - overlay.show(); - //overlayVert.css({width: overlay.width()}); - // hide any vertical blocks that aren't at the top of the viewport - /* - overlayVert.children('.vert').each(function () { - var vCol = $(this); - vCol.css('display','inline-block'); - if (vCol.offset().top > vCol.parent().offset().top) { - vCol.hide(); - } - }); - */ - } - - /* - * Event handlers - */ - - function keydownHandler(e) { - var k, - m, - source = e.target.tagName.toLowerCase(); - - if ((source == 'input') || (source == 'textarea') || (source == 'select')) { - return true; - } - - m = getModifier(e); - if (!m) { - return true; - } - - k = getKey(e); - if (!k) { - return true; - } - - switch(k) { - case options.showGridKey: - if (!overlayOn) { - showOverlay(); - overlayOn = true; - } - else if (sticky) { - overlay.hide(); - overlayOn = false; - sticky = false; - saveState(); - } - break; - case options.holdGridKey: - if (overlayOn && !sticky) { - // Turn sticky overlay on - sticky = true; - saveState(); - } - break; - case options.foregroundKey: - if (overlayOn) { - // Toggle sticky overlay z-index - if (overlay.css('z-index') == overlayZForeground) { - overlay.css('z-index', overlayZBackground); - overlayZState = 'B'; - } - else { - overlay.css('z-index', overlayZForeground); - overlayZState = 'F'; - } - saveState(); - } - break; - case options.jumpGridsKey: - if (overlayOn && (options.numberOfGrids > 1)) { - // Cycle through the available grids - overlay.removeClass(options.classPrefix + classNumber); - classNumber++; - if (classNumber > options.numberOfGrids) classNumber = 1; - overlay.addClass(options.classPrefix + classNumber); - showOverlay(); - if (/webkit/.test( navigator.userAgent.toLowerCase() )) { - forceRepaint(); - } - saveState(); - } - break; - } - - return true; - } - - function keyupHandler(e) { - var k, - m = getModifier(e); - - if (!m) { - return true; - } - - k = getKey(e); - - if (k && (k == options.showGridKey) && !sticky) { - overlay.hide(); - overlayOn = false; - } - - return true; - } - - /* - * Cookie functions - * - * By Peter-Paul Koch: - * http://www.quirksmode.org/js/cookies.html - */ - function createCookie(name, value, days) { - var date, - expires = ""; - - if (days) { - date = new Date(); - date.setTime( date.getTime() + (days*24*60*60*1000) ); - expires = "; expires=" + date.toGMTString(); - } - - document.cookie = name + "=" + value + expires + "; path=/"; - } - - function readCookie(name) { - var c, - ca = document.cookie.split(';'), - i = 0, - len = ca.length, - nameEQ = name + "="; - - for (; i < len; i++) { - c = ca[i]; - - while (c.charAt(0) == ' ') { - c = c.substring(1, c.length); - } - - if (c.indexOf(nameEQ) == 0) { - return c.substring(nameEQ.length, c.length); - } - } - return null; - } - - function eraseCookie(name) { - createCookie(name, "", -1); - } - - /* - * Forces a repaint (because WebKit has issues) - * http://www.sitepoint.com/forums/showthread.php?p=4538763 - * http://www.phpied.com/the-new-game-show-will-it-reflow/ - */ - function forceRepaint() { - var ss = document.styleSheets[0]; - try { - ss.addRule('.xxxxxx', 'position: relative'); - ss.removeRule(ss.rules.length - 1); - } catch(e) {} - } - - return {}; - }; - - - /* - * You can call hashgrid from your own code, but it's loaded here as - * an example for your convenience. - */ - $(document).ready(function() { - - var grid = new hashgrid({ - numberOfGrids: 3 - }); - - }); - -})(jQuery); \ No newline at end of file diff --git a/js/lib/jquery.js b/js/lib/jquery.js deleted file mode 100644 index f65cf1d..0000000 --- a/js/lib/jquery.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v1.8.2 jquery.com | jquery.org/license */ -(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write(""),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return a!=null?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b
a",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="
t
",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="
",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||p.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c=0)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function bg(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;be.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML="";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="
",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!e.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},header:function(a){return T.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="

",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML="",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b0)for(e=d;e=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*\s*$/g,bz={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X
","
"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1>");try{for(;d1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]===""&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/)<[^<]*)*<\/script>/gi,cs=/([?&])_=[^&]*/,ct=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,cu=p.fn.load,cv={},cw={},cx=["*/"]+["*"];try{ck=f.href}catch(cy){ck=e.createElement("a"),ck.href="",ck=ck.href}cj=ct.exec(ck.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&cu)return cu.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):c&&typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("
").append(a.replace(cr,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cB(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cB(a,b),a},ajaxSettings:{url:ck,isLocal:cn.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cx},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cz(cv),ajaxTransport:cz(cw),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cC(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cD(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=(c||y)+"",k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cm.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(cl,"").replace(cp,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=ct.exec(l.url.toLowerCase())||!1,l.crossDomain=i&&i.join(":")+(i[3]?"":i[1]==="http:"?80:443)!==cj.join(":")+(cj[3]?"":cj[1]==="http:"?80:443)),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cA(cv,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!co.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cq.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cs,"$1_="+z);l.url=A+(A===l.url?(cq.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cx+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cA(cw,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cE=[],cF=/\?/,cG=/(=)\?(?=&|$)|\?\?/,cH=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cE.pop()||p.expando+"_"+cH++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cG.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cG.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cG,"$1"+f):m?c.data=i.replace(cG,"$1"+f):k&&(c.url+=(cF.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cE.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cI,cJ=a.ActiveXObject?function(){for(var a in cI)cI[a](0,1)}:!1,cK=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cL()||cM()}:cL,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cJ&&delete cI[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cK,cJ&&(cI||(cI={},p(a).unload(cJ)),cI[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cN,cO,cP=/^(?:toggle|show|hide)$/,cQ=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cR=/queueHooks$/,cS=[cY],cT={"*":[function(a,b){var c,d,e=this.createTween(a,b),f=cQ.exec(b),g=e.cur(),h=+g||0,i=1,j=20;if(f){c=+f[2],d=f[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&h){h=p.css(e.elem,a,!0)||c||1;do i=i||".5",h=h/i,p.style(e.elem,a,h+d);while(i!==(i=e.cur()/g)&&i!==1&&--j)}e.unit=d,e.start=h,e.end=f[1]?h+(f[1]+1)*c:c}return e}]};p.Animation=p.extend(cW,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c_.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c_.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=da(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window); \ No newline at end of file diff --git a/js/lib/modernizr.js b/js/lib/modernizr.js deleted file mode 100644 index c1a6a9a..0000000 --- a/js/lib/modernizr.js +++ /dev/null @@ -1,1265 +0,0 @@ -/*! - * Modernizr v2.5.3 - * www.modernizr.com - * - * Copyright (c) Faruk Ates, Paul Irish, Alex Sexton - * Available under the BSD and MIT licenses: www.modernizr.com/license/ - */ - -/* - * Modernizr tests which native CSS3 and HTML5 features are available in - * the current UA and makes the results available to you in two ways: - * as properties on a global Modernizr object, and as classes on the - * element. This information allows you to progressively enhance - * your pages with a granular level of control over the experience. - * - * Modernizr has an optional (not included) conditional resource loader - * called Modernizr.load(), based on Yepnope.js (yepnopejs.com). - * To get a build that includes Modernizr.load(), as well as choosing - * which tests to include, go to www.modernizr.com/download/ - * - * Authors Faruk Ates, Paul Irish, Alex Sexton - * Contributors Ryan Seddon, Ben Alman - */ - -window.Modernizr = (function( window, document, undefined ) { - - var version = '2.5.3', - - Modernizr = {}, - - // option for enabling the HTML classes to be added - enableClasses = true, - - docElement = document.documentElement, - - /** - * Create our "modernizr" element that we do most feature tests on. - */ - mod = 'modernizr', - modElem = document.createElement(mod), - mStyle = modElem.style, - - /** - * Create the input element for various Web Forms feature tests. - */ - inputElem = document.createElement('input'), - - smile = ':)', - - toString = {}.toString, - - // List of property values to set for css tests. See ticket #21 - prefixes = ' -webkit- -moz- -o- -ms- '.split(' '), - - // Following spec is to expose vendor-specific style properties as: - // elem.style.WebkitBorderRadius - // and the following would be incorrect: - // elem.style.webkitBorderRadius - - // Webkit ghosts their properties in lowercase but Opera & Moz do not. - // Microsoft uses a lowercase `ms` instead of the correct `Ms` in IE8+ - // erik.eae.net/archives/2008/03/10/21.48.10/ - - // More here: github.com/Modernizr/Modernizr/issues/issue/21 - omPrefixes = 'Webkit Moz O ms', - - cssomPrefixes = omPrefixes.split(' '), - - domPrefixes = omPrefixes.toLowerCase().split(' '), - - ns = {'svg': 'http://www.w3.org/2000/svg'}, - - tests = {}, - inputs = {}, - attrs = {}, - - classes = [], - - slice = classes.slice, - - featureName, // used in testing loop - - - // Inject element with style element and some CSS rules - injectElementWithStyles = function( rule, callback, nodes, testnames ) { - - var style, ret, node, - div = document.createElement('div'), - // After page load injecting a fake body doesn't work so check if body exists - body = document.body, - // IE6 and 7 won't return offsetWidth or offsetHeight unless it's in the body element, so we fake it. - fakeBody = body ? body : document.createElement('body'); - - if ( parseInt(nodes, 10) ) { - // In order not to give false positives we create a node for each test - // This also allows the method to scale for unspecified uses - while ( nodes-- ) { - node = document.createElement('div'); - node.id = testnames ? testnames[nodes] : mod + (nodes + 1); - div.appendChild(node); - } - } - - // '].join(''); - div.id = mod; - // IE6 will false positive on some tests due to the style element inside the test div somehow interfering offsetHeight, so insert it into body or fakebody. - // Opera will act all quirky when injecting elements in documentElement when page is served as xml, needs fakebody too. #270 - fakeBody.innerHTML += style; - fakeBody.appendChild(div); - if(!body){ - //avoid crashing IE8, if background image is used - fakeBody.style.background = ""; - docElement.appendChild(fakeBody); - } - - ret = callback(div, rule); - // If this is done after page load we don't want to remove the body so check if body exists - !body ? fakeBody.parentNode.removeChild(fakeBody) : div.parentNode.removeChild(div); - - return !!ret; - - }, - - - // adapted from matchMedia polyfill - // by Scott Jehl and Paul Irish - // gist.github.com/786768 - testMediaQuery = function( mq ) { - - var matchMedia = window.matchMedia || window.msMatchMedia; - if ( matchMedia ) { - return matchMedia(mq).matches; - } - - var bool; - - injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function( node ) { - bool = (window.getComputedStyle ? - getComputedStyle(node, null) : - node.currentStyle)['position'] == 'absolute'; - }); - - return bool; - - }, - - - /** - * isEventSupported determines if a given element supports the given event - * function from yura.thinkweb2.com/isEventSupported/ - */ - isEventSupported = (function() { - - var TAGNAMES = { - 'select': 'input', 'change': 'input', - 'submit': 'form', 'reset': 'form', - 'error': 'img', 'load': 'img', 'abort': 'img' - }; - - function isEventSupported( eventName, element ) { - - element = element || document.createElement(TAGNAMES[eventName] || 'div'); - eventName = 'on' + eventName; - - // When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize", whereas `in` "catches" those - var isSupported = eventName in element; - - if ( !isSupported ) { - // If it has no `setAttribute` (i.e. doesn't implement Node interface), try generic element - if ( !element.setAttribute ) { - element = document.createElement('div'); - } - if ( element.setAttribute && element.removeAttribute ) { - element.setAttribute(eventName, ''); - isSupported = is(element[eventName], 'function'); - - // If property was created, "remove it" (by setting value to `undefined`) - if ( !is(element[eventName], 'undefined') ) { - element[eventName] = undefined; - } - element.removeAttribute(eventName); - } - } - - element = null; - return isSupported; - } - return isEventSupported; - })(); - - // hasOwnProperty shim by kangax needed for Safari 2.0 support - var _hasOwnProperty = ({}).hasOwnProperty, hasOwnProperty; - if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) { - hasOwnProperty = function (object, property) { - return _hasOwnProperty.call(object, property); - }; - } - else { - hasOwnProperty = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */ - return ((property in object) && is(object.constructor.prototype[property], 'undefined')); - }; - } - - // Taken from ES5-shim https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js - // ES-5 15.3.4.5 - // http://es5.github.com/#x15.3.4.5 - - if (!Function.prototype.bind) { - - Function.prototype.bind = function bind(that) { - - var target = this; - - if (typeof target != "function") { - throw new TypeError(); - } - - var args = slice.call(arguments, 1), - bound = function () { - - if (this instanceof bound) { - - var F = function(){}; - F.prototype = target.prototype; - var self = new F; - - var result = target.apply( - self, - args.concat(slice.call(arguments)) - ); - if (Object(result) === result) { - return result; - } - return self; - - } else { - - return target.apply( - that, - args.concat(slice.call(arguments)) - ); - - } - - }; - - return bound; - }; - } - - /** - * setCss applies given styles to the Modernizr DOM node. - */ - function setCss( str ) { - mStyle.cssText = str; - } - - /** - * setCssAll extrapolates all vendor-specific css strings. - */ - function setCssAll( str1, str2 ) { - return setCss(prefixes.join(str1 + ';') + ( str2 || '' )); - } - - /** - * is returns a boolean for if typeof obj is exactly type. - */ - function is( obj, type ) { - return typeof obj === type; - } - - /** - * contains returns a boolean for if substr is found within str. - */ - function contains( str, substr ) { - return !!~('' + str).indexOf(substr); - } - - /** - * testProps is a generic CSS / DOM property test; if a browser supports - * a certain property, it won't return undefined for it. - * A supported CSS property returns empty string when its not yet set. - */ - function testProps( props, prefixed ) { - for ( var i in props ) { - if ( mStyle[ props[i] ] !== undefined ) { - return prefixed == 'pfx' ? props[i] : true; - } - } - return false; - } - - /** - * testDOMProps is a generic DOM property test; if a browser supports - * a certain property, it won't return undefined for it. - */ - function testDOMProps( props, obj, elem ) { - for ( var i in props ) { - var item = obj[props[i]]; - if ( item !== undefined) { - - // return the property name as a string - if (elem === false) return props[i]; - - // let's bind a function - if (is(item, 'function')){ - // default to autobind unless override - return item.bind(elem || obj); - } - - // return the unbound function or obj or value - return item; - } - } - return false; - } - - /** - * testPropsAll tests a list of DOM properties we want to check against. - * We specify literally ALL possible (known and/or likely) properties on - * the element including the non-vendor prefixed one, for forward- - * compatibility. - */ - function testPropsAll( prop, prefixed, elem ) { - - var ucProp = prop.charAt(0).toUpperCase() + prop.substr(1), - props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' '); - - // did they call .prefixed('boxSizing') or are we just testing a prop? - if(is(prefixed, "string") || is(prefixed, "undefined")) { - return testProps(props, prefixed); - - // otherwise, they called .prefixed('requestAnimationFrame', window[, elem]) - } else { - props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' '); - return testDOMProps(props, prefixed, elem); - } - } - - /** - * testBundle tests a list of CSS features that require element and style injection. - * By bundling them together we can reduce the need to touch the DOM multiple times. - */ - /*>>testBundle*/ - var testBundle = (function( styles, tests ) { - var style = styles.join(''), - len = tests.length; - - injectElementWithStyles(style, function( node, rule ) { - var style = document.styleSheets[document.styleSheets.length - 1], - // IE8 will bork if you create a custom build that excludes both fontface and generatedcontent tests. - // So we check for cssRules and that there is a rule available - // More here: github.com/Modernizr/Modernizr/issues/288 & github.com/Modernizr/Modernizr/issues/293 - cssText = style ? (style.cssRules && style.cssRules[0] ? style.cssRules[0].cssText : style.cssText || '') : '', - children = node.childNodes, hash = {}; - - while ( len-- ) { - hash[children[len].id] = children[len]; - } - - /*>>touch*/ Modernizr['touch'] = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch || (hash['touch'] && hash['touch'].offsetTop) === 9; /*>>touch*/ - /*>>csstransforms3d*/ Modernizr['csstransforms3d'] = (hash['csstransforms3d'] && hash['csstransforms3d'].offsetLeft) === 9 && hash['csstransforms3d'].offsetHeight === 3; /*>>csstransforms3d*/ - /*>>generatedcontent*/Modernizr['generatedcontent'] = (hash['generatedcontent'] && hash['generatedcontent'].offsetHeight) >= 1; /*>>generatedcontent*/ - /*>>fontface*/ Modernizr['fontface'] = /src/i.test(cssText) && - cssText.indexOf(rule.split(' ')[0]) === 0; /*>>fontface*/ - }, len, tests); - - })([ - // Pass in styles to be injected into document - /*>>fontface*/ '@font-face {font-family:"font";src:url("https://")}' /*>>fontface*/ - - /*>>touch*/ ,['@media (',prefixes.join('touch-enabled),('),mod,')', - '{#touch{top:9px;position:absolute}}'].join('') /*>>touch*/ - - /*>>csstransforms3d*/ ,['@media (',prefixes.join('transform-3d),('),mod,')', - '{#csstransforms3d{left:9px;position:absolute;height:3px;}}'].join('')/*>>csstransforms3d*/ - - /*>>generatedcontent*/,['#generatedcontent:after{content:"',smile,'";visibility:hidden}'].join('') /*>>generatedcontent*/ - ], - [ - /*>>fontface*/ 'fontface' /*>>fontface*/ - /*>>touch*/ ,'touch' /*>>touch*/ - /*>>csstransforms3d*/ ,'csstransforms3d' /*>>csstransforms3d*/ - /*>>generatedcontent*/,'generatedcontent' /*>>generatedcontent*/ - - ]);/*>>testBundle*/ - - - /** - * Tests - * ----- - */ - - // The *new* flexbox - // dev.w3.org/csswg/css3-flexbox - - tests['flexbox'] = function() { - return testPropsAll('flexOrder'); - }; - - // The *old* flexbox - // www.w3.org/TR/2009/WD-css3-flexbox-20090723/ - - tests['flexbox-legacy'] = function() { - return testPropsAll('boxDirection'); - }; - - // On the S60 and BB Storm, getContext exists, but always returns undefined - // so we actually have to call getContext() to verify - // github.com/Modernizr/Modernizr/issues/issue/97/ - - tests['canvas'] = function() { - var elem = document.createElement('canvas'); - return !!(elem.getContext && elem.getContext('2d')); - }; - - tests['canvastext'] = function() { - return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function')); - }; - - // this test initiates a new webgl context. - // webk.it/70117 is tracking a legit feature detect proposal - - tests['webgl'] = function() { - try { - var canvas = document.createElement('canvas'), - ret; - ret = !!(window.WebGLRenderingContext && (canvas.getContext('experimental-webgl') || canvas.getContext('webgl'))); - canvas = undefined; - } catch (e){ - ret = false; - } - return ret; - }; - - /* - * The Modernizr.touch test only indicates if the browser supports - * touch events, which does not necessarily reflect a touchscreen - * device, as evidenced by tablets running Windows 7 or, alas, - * the Palm Pre / WebOS (touch) phones. - * - * Additionally, Chrome (desktop) used to lie about its support on this, - * but that has since been rectified: crbug.com/36415 - * - * We also test for Firefox 4 Multitouch Support. - * - * For more info, see: modernizr.github.com/Modernizr/touch.html - */ - - tests['touch'] = function() { - return Modernizr['touch']; - }; - - /** - * geolocation tests for the new Geolocation API specification. - * This test is a standards compliant-only test; for more complete - * testing, including a Google Gears fallback, please see: - * code.google.com/p/geo-location-javascript/ - * or view a fallback solution using google's geo API: - * gist.github.com/366184 - */ - tests['geolocation'] = function() { - return !!navigator.geolocation; - }; - - // Per 1.6: - // This used to be Modernizr.crosswindowmessaging but the longer - // name has been deprecated in favor of a shorter and property-matching one. - // The old API is still available in 1.6, but as of 2.0 will throw a warning, - // and in the first release thereafter disappear entirely. - tests['postmessage'] = function() { - return !!window.postMessage; - }; - - - // Chrome incognito mode used to throw an exception when using openDatabase - // It doesn't anymore. - tests['websqldatabase'] = function() { - return !!window.openDatabase; - }; - - // Vendors had inconsistent prefixing with the experimental Indexed DB: - // - Webkit's implementation is accessible through webkitIndexedDB - // - Firefox shipped moz_indexedDB before FF4b9, but since then has been mozIndexedDB - // For speed, we don't test the legacy (and beta-only) indexedDB - tests['indexedDB'] = function() { - return !!testPropsAll("indexedDB",window); - }; - - // documentMode logic from YUI to filter out IE8 Compat Mode - // which false positives. - tests['hashchange'] = function() { - return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7); - }; - - // Per 1.6: - // This used to be Modernizr.historymanagement but the longer - // name has been deprecated in favor of a shorter and property-matching one. - // The old API is still available in 1.6, but as of 2.0 will throw a warning, - // and in the first release thereafter disappear entirely. - tests['history'] = function() { - return !!(window.history && history.pushState); - }; - - tests['draganddrop'] = function() { - var div = document.createElement('div'); - return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div); - }; - - // FIXME: Once FF10 is sunsetted, we can drop prefixed MozWebSocket - // bugzil.la/695635 - tests['websockets'] = function() { - for ( var i = -1, len = cssomPrefixes.length; ++i < len; ){ - if ( window[cssomPrefixes[i] + 'WebSocket'] ){ - return true; - } - } - return 'WebSocket' in window; - }; - - - // css-tricks.com/rgba-browser-support/ - tests['rgba'] = function() { - // Set an rgba() color and check the returned value - - setCss('background-color:rgba(150,255,150,.5)'); - - return contains(mStyle.backgroundColor, 'rgba'); - }; - - tests['hsla'] = function() { - // Same as rgba(), in fact, browsers re-map hsla() to rgba() internally, - // except IE9 who retains it as hsla - - setCss('background-color:hsla(120,40%,100%,.5)'); - - return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla'); - }; - - tests['multiplebgs'] = function() { - // Setting multiple images AND a color on the background shorthand property - // and then querying the style.background property value for the number of - // occurrences of "url(" is a reliable method for detecting ACTUAL support for this! - - setCss('background:url(https://),url(https://),red url(https://)'); - - // If the UA supports multiple backgrounds, there should be three occurrences - // of the string "url(" in the return value for elemStyle.background - - return /(url\s*\(.*?){3}/.test(mStyle.background); - }; - - - // In testing support for a given CSS property, it's legit to test: - // `elem.style[styleName] !== undefined` - // If the property is supported it will return an empty string, - // if unsupported it will return undefined. - - // We'll take advantage of this quick test and skip setting a style - // on our modernizr element, but instead just testing undefined vs - // empty string. - - - tests['backgroundsize'] = function() { - return testPropsAll('backgroundSize'); - }; - - tests['borderimage'] = function() { - return testPropsAll('borderImage'); - }; - - - // Super comprehensive table about all the unique implementations of - // border-radius: muddledramblings.com/table-of-css3-border-radius-compliance - - tests['borderradius'] = function() { - return testPropsAll('borderRadius'); - }; - - // WebOS unfortunately false positives on this test. - tests['boxshadow'] = function() { - return testPropsAll('boxShadow'); - }; - - // FF3.0 will false positive on this test - tests['textshadow'] = function() { - return document.createElement('div').style.textShadow === ''; - }; - - - tests['opacity'] = function() { - // Browsers that actually have CSS Opacity implemented have done so - // according to spec, which means their return values are within the - // range of [0.0,1.0] - including the leading zero. - - setCssAll('opacity:.55'); - - // The non-literal . in this regex is intentional: - // German Chrome returns this value as 0,55 - // github.com/Modernizr/Modernizr/issues/#issue/59/comment/516632 - return /^0.55$/.test(mStyle.opacity); - }; - - - // Note, Android < 4 will pass this test, but can only animate - // a single property at a time - // daneden.me/2011/12/putting-up-with-androids-bullshit/ - tests['cssanimations'] = function() { - return testPropsAll('animationName'); - }; - - - tests['csscolumns'] = function() { - return testPropsAll('columnCount'); - }; - - - tests['cssgradients'] = function() { - /** - * For CSS Gradients syntax, please see: - * webkit.org/blog/175/introducing-css-gradients/ - * developer.mozilla.org/en/CSS/-moz-linear-gradient - * developer.mozilla.org/en/CSS/-moz-radial-gradient - * dev.w3.org/csswg/css3-images/#gradients- - */ - - var str1 = 'background-image:', - str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));', - str3 = 'linear-gradient(left top,#9f9, white);'; - - setCss( - // legacy webkit syntax (FIXME: remove when syntax not in use anymore) - (str1 + '-webkit- '.split(' ').join(str2 + str1) - // standard syntax // trailing 'background-image:' - + prefixes.join(str3 + str1)).slice(0, -str1.length) - ); - - return contains(mStyle.backgroundImage, 'gradient'); - }; - - - tests['cssreflections'] = function() { - return testPropsAll('boxReflect'); - }; - - - tests['csstransforms'] = function() { - return !!testPropsAll('transform'); - }; - - - tests['csstransforms3d'] = function() { - - var ret = !!testPropsAll('perspective'); - - // Webkit's 3D transforms are passed off to the browser's own graphics renderer. - // It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in - // some conditions. As a result, Webkit typically recognizes the syntax but - // will sometimes throw a false positive, thus we must do a more thorough check: - if ( ret && 'webkitPerspective' in docElement.style ) { - - // Webkit allows this media query to succeed only if the feature is enabled. - // `@media (transform-3d),(-o-transform-3d),(-moz-transform-3d),(-ms-transform-3d),(-webkit-transform-3d),(modernizr){ ... }` - ret = Modernizr['csstransforms3d']; - } - return ret; - }; - - - tests['csstransitions'] = function() { - return testPropsAll('transition'); - }; - - - /*>>fontface*/ - // @font-face detection routine by Diego Perini - // javascript.nwbox.com/CSSSupport/ - - // false positives in WebOS: github.com/Modernizr/Modernizr/issues/342 - tests['fontface'] = function() { - return Modernizr['fontface']; - }; - /*>>fontface*/ - - // CSS generated content detection - tests['generatedcontent'] = function() { - return Modernizr['generatedcontent']; - }; - - - - // These tests evaluate support of the video/audio elements, as well as - // testing what types of content they support. - // - // We're using the Boolean constructor here, so that we can extend the value - // e.g. Modernizr.video // true - // Modernizr.video.ogg // 'probably' - // - // Codec values from : github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845 - // thx to NielsLeenheer and zcorpan - - // Note: in some older browsers, "no" was a return value instead of empty string. - // It was live in FF3.5.0 and 3.5.1, but fixed in 3.5.2 - // It was also live in Safari 4.0.0 - 4.0.4, but fixed in 4.0.5 - - tests['video'] = function() { - var elem = document.createElement('video'), - bool = false; - - // IE9 Running on Windows Server SKU can cause an exception to be thrown, bug #224 - try { - if ( bool = !!elem.canPlayType ) { - bool = new Boolean(bool); - bool.ogg = elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,''); - - bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,''); - - bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,''); - } - - } catch(e) { } - - return bool; - }; - - tests['audio'] = function() { - var elem = document.createElement('audio'), - bool = false; - - try { - if ( bool = !!elem.canPlayType ) { - bool = new Boolean(bool); - bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,''); - bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,''); - - // Mimetypes accepted: - // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements - // bit.ly/iphoneoscodecs - bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,''); - bool.m4a = ( elem.canPlayType('audio/x-m4a;') || - elem.canPlayType('audio/aac;')) .replace(/^no$/,''); - } - } catch(e) { } - - return bool; - }; - - - // In FF4, if disabled, window.localStorage should === null. - - // Normally, we could not test that directly and need to do a - // `('localStorage' in window) && ` test first because otherwise Firefox will - // throw bugzil.la/365772 if cookies are disabled - - // Also in iOS5 Private Browsing mode, attepting to use localStorage.setItem - // will throw the exception: - // QUOTA_EXCEEDED_ERRROR DOM Exception 22. - // Peculiarly, getItem and removeItem calls do not throw. - - // Because we are forced to try/catch this, we'll go aggressive. - - // Just FWIW: IE8 Compat mode supports these features completely: - // www.quirksmode.org/dom/html5.html - // But IE8 doesn't support either with local files - - tests['localstorage'] = function() { - try { - localStorage.setItem(mod, mod); - localStorage.removeItem(mod); - return true; - } catch(e) { - return false; - } - }; - - tests['sessionstorage'] = function() { - try { - sessionStorage.setItem(mod, mod); - sessionStorage.removeItem(mod); - return true; - } catch(e) { - return false; - } - }; - - - tests['webworkers'] = function() { - return !!window.Worker; - }; - - - tests['applicationcache'] = function() { - return !!window.applicationCache; - }; - - - // Thanks to Erik Dahlstrom - tests['svg'] = function() { - return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect; - }; - - // specifically for SVG inline in HTML, not within XHTML - // test page: paulirish.com/demo/inline-svg - tests['inlinesvg'] = function() { - var div = document.createElement('div'); - div.innerHTML = ''; - return (div.firstChild && div.firstChild.namespaceURI) == ns.svg; - }; - - // SVG SMIL animation - tests['smil'] = function() { - return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate'))); - }; - - // This test is only for clip paths in SVG proper, not clip paths on HTML content - // demo: srufaculty.sru.edu/david.dailey/svg/newstuff/clipPath4.svg - - // However read the comments to dig into applying SVG clippaths to HTML content here: - // github.com/Modernizr/Modernizr/issues/213#issuecomment-1149491 - tests['svgclippaths'] = function() { - return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath'))); - }; - - // input features and input types go directly onto the ret object, bypassing the tests loop. - // Hold this guy to execute in a moment. - function webforms() { - // Run through HTML5's new input attributes to see if the UA understands any. - // We're using f which is the element created early on - // Mike Taylr has created a comprehensive resource for testing these attributes - // when applied to all input types: - // miketaylr.com/code/input-type-attr.html - // spec: www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary - - // Only input placeholder is tested while textarea's placeholder is not. - // Currently Safari 4 and Opera 11 have support only for the input placeholder - // Both tests are available in feature-detects/forms-placeholder.js - Modernizr['input'] = (function( props ) { - for ( var i = 0, len = props.length; i < len; i++ ) { - attrs[ props[i] ] = !!(props[i] in inputElem); - } - if (attrs.list){ - // safari false positive's on datalist: webk.it/74252 - // see also github.com/Modernizr/Modernizr/issues/146 - attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement); - } - return attrs; - })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' ')); - - // Run through HTML5's new input types to see if the UA understands any. - // This is put behind the tests runloop because it doesn't return a - // true/false like all the other tests; instead, it returns an object - // containing each input type with its corresponding true/false value - - // Big thanks to @miketaylr for the html5 forms expertise. miketaylr.com/ - Modernizr['inputtypes'] = (function(props) { - - for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) { - - inputElem.setAttribute('type', inputElemType = props[i]); - bool = inputElem.type !== 'text'; - - // We first check to see if the type we give it sticks.. - // If the type does, we feed it a textual value, which shouldn't be valid. - // If the value doesn't stick, we know there's input sanitization which infers a custom UI - if ( bool ) { - - inputElem.value = smile; - inputElem.style.cssText = 'position:absolute;visibility:hidden;'; - - if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) { - - docElement.appendChild(inputElem); - defaultView = document.defaultView; - - // Safari 2-4 allows the smiley as a value, despite making a slider - bool = defaultView.getComputedStyle && - defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' && - // Mobile android web browser has false positive, so must - // check the height to see if the widget is actually there. - (inputElem.offsetHeight !== 0); - - docElement.removeChild(inputElem); - - } else if ( /^(search|tel)$/.test(inputElemType) ){ - // Spec doesnt define any special parsing or detectable UI - // behaviors so we pass these through as true - - // Interestingly, opera fails the earlier test, so it doesn't - // even make it here. - - } else if ( /^(url|email)$/.test(inputElemType) ) { - // Real url and email support comes with prebaked validation. - bool = inputElem.checkValidity && inputElem.checkValidity() === false; - - } else if ( /^color$/.test(inputElemType) ) { - // chuck into DOM and force reflow for Opera bug in 11.00 - // github.com/Modernizr/Modernizr/issues#issue/159 - docElement.appendChild(inputElem); - docElement.offsetWidth; - bool = inputElem.value != smile; - docElement.removeChild(inputElem); - - } else { - // If the upgraded input compontent rejects the :) text, we got a winner - bool = inputElem.value != smile; - } - } - - inputs[ props[i] ] = !!bool; - } - return inputs; - })('search tel url email datetime date month week time datetime-local number range color'.split(' ')); - } - - - // End of test definitions - // ----------------------- - - - - // Run through all tests and detect their support in the current UA. - // todo: hypothetically we could be doing an array of tests and use a basic loop here. - for ( var feature in tests ) { - if ( hasOwnProperty(tests, feature) ) { - // run the test, throw the return value into the Modernizr, - // then based on that boolean, define an appropriate className - // and push it into an array of classes we'll join later. - featureName = feature.toLowerCase(); - Modernizr[featureName] = tests[feature](); - - classes.push((Modernizr[featureName] ? '' : 'no-') + featureName); - } - } - - // input tests need to run. - Modernizr.input || webforms(); - - - /** - * addTest allows the user to define their own feature tests - * the result will be added onto the Modernizr object, - * as well as an appropriate className set on the html element - * - * @param feature - String naming the feature - * @param test - Function returning true if feature is supported, false if not - */ - Modernizr.addTest = function ( feature, test ) { - if ( typeof feature == 'object' ) { - for ( var key in feature ) { - if ( hasOwnProperty( feature, key ) ) { - Modernizr.addTest( key, feature[ key ] ); - } - } - } else { - - feature = feature.toLowerCase(); - - if ( Modernizr[feature] !== undefined ) { - // we're going to quit if you're trying to overwrite an existing test - // if we were to allow it, we'd do this: - // var re = new RegExp("\\b(no-)?" + feature + "\\b"); - // docElement.className = docElement.className.replace( re, '' ); - // but, no rly, stuff 'em. - return Modernizr; - } - - test = typeof test == 'function' ? test() : test; - - docElement.className += ' ' + (test ? '' : 'no-') + feature; - Modernizr[feature] = test; - - } - - return Modernizr; // allow chaining. - }; - - - // Reset modElem.cssText to nothing to reduce memory footprint. - setCss(''); - modElem = inputElem = null; - - //>>BEGIN IEPP - // Enable HTML 5 elements for styling in IE & add HTML5 css - /*! HTML5 Shiv v3.4 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed */ - ;(function(window, document) { - - /** Preset options */ - var options = window.html5 || {}; - - /** Used to skip problem elements */ - var reSkip = /^<|^(?:button|form|map|select|textarea)$/i; - - /** Detect whether the browser supports default html5 styles */ - var supportsHtml5Styles; - - /** Detect whether the browser supports unknown elements */ - var supportsUnknownElements; - - (function() { - var a = document.createElement('a'); - - a.innerHTML = ''; - - //if the hidden property is implemented we can assume, that the browser supports HTML5 Styles - supportsHtml5Styles = ('hidden' in a); - supportsUnknownElements = a.childNodes.length == 1 || (function() { - // assign a false positive if unable to shiv - try { - (document.createElement)('a'); - } catch(e) { - return true; - } - var frag = document.createDocumentFragment(); - return ( - typeof frag.cloneNode == 'undefined' || - typeof frag.createDocumentFragment == 'undefined' || - typeof frag.createElement == 'undefined' - ); - }()); - - }()); - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a style sheet with the given CSS text and adds it to the document. - * @private - * @param {Document} ownerDocument The document. - * @param {String} cssText The CSS text. - * @returns {StyleSheet} The style element. - */ - function addStyleSheet(ownerDocument, cssText) { - var p = ownerDocument.createElement('p'), - parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; - - p.innerHTML = 'x'; - return parent.insertBefore(p.lastChild, parent.firstChild); - } - - /** - * Returns the value of `html5.elements` as an array. - * @private - * @returns {Array} An array of shived element node names. - */ - function getElements() { - var elements = html5.elements; - return typeof elements == 'string' ? elements.split(' ') : elements; - } - - /** - * Shivs the `createElement` and `createDocumentFragment` methods of the document. - * @private - * @param {Document|DocumentFragment} ownerDocument The document. - */ - function shivMethods(ownerDocument) { - var cache = {}, - docCreateElement = ownerDocument.createElement, - docCreateFragment = ownerDocument.createDocumentFragment, - frag = docCreateFragment(); - - ownerDocument.createElement = function(nodeName) { - // Avoid adding some elements to fragments in IE < 9 because - // * Attributes like `name` or `type` cannot be set/changed once an element - // is inserted into a document/fragment - // * Link elements with `src` attributes that are inaccessible, as with - // a 403 response, will cause the tab/window to crash - // * Script elements appended to fragments will execute when their `src` - // or `text` property is set - var node = (cache[nodeName] || (cache[nodeName] = docCreateElement(nodeName))).cloneNode(); - return html5.shivMethods && node.canHaveChildren && !reSkip.test(nodeName) ? frag.appendChild(node) : node; - }; - - ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' + - 'var n=f.cloneNode(),c=n.createElement;' + - 'h.shivMethods&&(' + - // unroll the `createElement` calls - getElements().join().replace(/\w+/g, function(nodeName) { - cache[nodeName] = docCreateElement(nodeName); - frag.createElement(nodeName); - return 'c("' + nodeName + '")'; - }) + - ');return n}' - )(html5, frag); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Shivs the given document. - * @memberOf html5 - * @param {Document} ownerDocument The document to shiv. - * @returns {Document} The shived document. - */ - function shivDocument(ownerDocument) { - var shived; - if (ownerDocument.documentShived) { - return ownerDocument; - } - if (html5.shivCSS && !supportsHtml5Styles) { - shived = !!addStyleSheet(ownerDocument, - // corrects block display not defined in IE6/7/8/9 - 'article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}' + - // corrects audio display not defined in IE6/7/8/9 - 'audio{display:none}' + - // corrects canvas and video display not defined in IE6/7/8/9 - 'canvas,video{display:inline-block;*display:inline;*zoom:1}' + - // corrects 'hidden' attribute and audio[controls] display not present in IE7/8/9 - '[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}' + - // adds styling not present in IE6/7/8/9 - 'mark{background:#FF0;color:#000}' - ); - } - if (!supportsUnknownElements) { - shived = !shivMethods(ownerDocument); - } - if (shived) { - ownerDocument.documentShived = shived; - } - return ownerDocument; - } - - /*--------------------------------------------------------------------------*/ - - /** - * The `html5` object is exposed so that more elements can be shived and - * existing shiving can be detected on iframes. - * @type Object - * @example - * - * // options can be changed before the script is included - * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false }; - */ - var html5 = { - - /** - * An array or space separated string of node names of the elements to shiv. - * @memberOf html5 - * @type Array|String - */ - 'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video', - - /** - * A flag to indicate that the HTML5 style sheet should be inserted. - * @memberOf html5 - * @type Boolean - */ - 'shivCSS': !(options.shivCSS === false), - - /** - * A flag to indicate that the document's `createElement` and `createDocumentFragment` - * methods should be overwritten. - * @memberOf html5 - * @type Boolean - */ - 'shivMethods': !(options.shivMethods === false), - - /** - * A string to describe the type of `html5` object ("default" or "default print"). - * @memberOf html5 - * @type String - */ - 'type': 'default', - - // shivs the document according to the specified `html5` object options - 'shivDocument': shivDocument - }; - - /*--------------------------------------------------------------------------*/ - - // expose html5 - window.html5 = html5; - - // shiv the document - shivDocument(document); - - }(this, document)); - - //>>END IEPP - - // Assign private properties to the return object with prefix - Modernizr._version = version; - - // expose these for the plugin API. Look in the source for how to join() them against your input - Modernizr._prefixes = prefixes; - Modernizr._domPrefixes = domPrefixes; - Modernizr._cssomPrefixes = cssomPrefixes; - - // Modernizr.mq tests a given media query, live against the current state of the window - // A few important notes: - // * If a browser does not support media queries at all (eg. oldIE) the mq() will always return false - // * A max-width or orientation query will be evaluated against the current state, which may change later. - // * You must specify values. Eg. If you are testing support for the min-width media query use: - // Modernizr.mq('(min-width:0)') - // usage: - // Modernizr.mq('only screen and (max-width:768)') - Modernizr.mq = testMediaQuery; - - // Modernizr.hasEvent() detects support for a given event, with an optional element to test on - // Modernizr.hasEvent('gesturestart', elem) - Modernizr.hasEvent = isEventSupported; - - // Modernizr.testProp() investigates whether a given style property is recognized - // Note that the property names must be provided in the camelCase variant. - // Modernizr.testProp('pointerEvents') - Modernizr.testProp = function(prop){ - return testProps([prop]); - }; - - // Modernizr.testAllProps() investigates whether a given style property, - // or any of its vendor-prefixed variants, is recognized - // Note that the property names must be provided in the camelCase variant. - // Modernizr.testAllProps('boxSizing') - Modernizr.testAllProps = testPropsAll; - - - - // Modernizr.testStyles() allows you to add custom styles to the document and test an element afterwards - // Modernizr.testStyles('#modernizr { position:absolute }', function(elem, rule){ ... }) - Modernizr.testStyles = injectElementWithStyles; - - - // Modernizr.prefixed() returns the prefixed or nonprefixed property name variant of your input - // Modernizr.prefixed('boxSizing') // 'MozBoxSizing' - - // Properties must be passed as dom-style camelcase, rather than `box-sizing` hypentated style. - // Return values will also be the camelCase variant, if you need to translate that to hypenated style use: - // - // str.replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-'); - - // If you're trying to ascertain which transition end event to bind to, you might do something like... - // - // var transEndEventNames = { - // 'WebkitTransition' : 'webkitTransitionEnd', - // 'MozTransition' : 'transitionend', - // 'OTransition' : 'oTransitionEnd', - // 'msTransition' : 'MsTransitionEnd', - // 'transition' : 'transitionend' - // }, - // transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ]; - - Modernizr.prefixed = function(prop, obj, elem){ - if(!obj) { - return testPropsAll(prop, 'pfx'); - } else { - // Testing DOM property e.g. Modernizr.prefixed('requestAnimationFrame', window) // 'mozRequestAnimationFrame' - return testPropsAll(prop, obj, elem); - } - }; - - - - // Remove "no-js" class from element, if it exists: - docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') + - - // Add the new classes to the element. - (enableClasses ? ' js ' + classes.join(' ') : ''); - - return Modernizr; - -})(this, this.document); diff --git a/outline-marie.sublime-project b/outline-marie.sublime-project new file mode 100644 index 0000000..463646f --- /dev/null +++ b/outline-marie.sublime-project @@ -0,0 +1,8 @@ +{ + "folders": + [ + { + "path": "/Users/marieguillaumet/Sites/outline-marie" + } + ] +} diff --git a/outline-marie.sublime-workspace b/outline-marie.sublime-workspace new file mode 100644 index 0000000..6f46e18 --- /dev/null +++ b/outline-marie.sublime-workspace @@ -0,0 +1,352 @@ +{ + "auto_complete": + { + "selected_items": + [ + [ + "list-s", + "list-style-position" + ], + [ + "list-st", + "list-style-position" + ], + [ + "inline", + "inline-block" + ], + [ + "back", + "background-color" + ] + ] + }, + "buffers": + [ + ], + "build_system": "", + "command_palette": + { + "height": 360.0, + "selected_items": + [ + [ + "", + "Toggle Comment" + ] + ], + "width": 276.0 + }, + "console": + { + "height": 0.0 + }, + "distraction_free": + { + "menu_visible": true, + "show_minimap": false, + "show_open_files": false, + "show_tabs": false, + "side_bar_visible": false, + "status_bar_visible": false + }, + "file_history": + [ + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/ui/common.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/_styles.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/_index.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/index.txt", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/base/5-functions.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/ui/oldtabs.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/ui/buttons.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/blocks/feedback.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/common/screen.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/common/sidebar.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/_print.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/common/print.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/common/header.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/common/footer.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/blocks/b-m_switch.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/blocks/b-login-question.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/blocks/b-callback.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/lib/hashgrid.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/modules/easylist.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/pages/accueil.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/pages/campagnes-comm.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/pages/doc.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/pages/fiche.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/pages/rcp.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/ui/forms.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/ui/img.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/ui/tabs.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/ui/titles.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/ui/tools.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/inc/head/dist.php", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/inc/b-login-question/dist.php", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/lib/colorbox.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/js/behaviours.js", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/base/8-printing.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/base/7-hacks.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/base/6-fancy-type.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/base/4-grid.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/base/3-forms.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/base/2-typography.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/base/1-reset.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/inc/assistance/dist.php", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/inc/index.php", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/inc/indemnites/dist.php", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/inc/content/fiche.php", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/js/jquery.ui.custom.min.js", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/inc/index-page.php", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/inc/content/ui-elements.php", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/blocks/foresight.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/inc/content/questions-juridiques.php", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/inc/sidebar-prestation/dist.php", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/inc/sidebar/dist.php", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/inc/content/qj-resultats.php", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/less/base/0-config.less", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/inc/en-bref/dist.php", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/maquettes/inc/login-question/dist.php" + ], + "find": + { + "height": 37.0 + }, + "find_in_files": + { + "height": 0.0, + "where_history": + [ + "*.less", + "" + ] + }, + "find_state": + { + "case_sensitive": false, + "find_history": + [ + ".cadre", + "callback-controler", + "table", + ".tab", + "block", + "h2", + "margin-b", + "h1", + ".feature", + "feature", + "h1", + "10pt", + "p", + ".foresight", + ".primary-feature", + ".block", + ".very-special-link", + ".btn;", + ".block;", + ".btn", + ".block", + ".special-title-sidebar", + "block", + ".bloc", + ".block", + ".sprites-common", + ".arrow-bottom", + ".arrow-bottom;", + ".arrow-bottom", + "arrow", + "bottom-arr", + ".btn", + ".border", + "@fs", + ".btn", + "fadeout", + ".box-shadow(2px 2px 1px fadeout(#404d4c, 85%));", + ".btn", + ".btn(", + ".btn()", + ".btn", + ".features", + ".fiche", + "rcp", + "recp", + "colorbox", + "opensans", + "open sans", + "colorbox", + "colobro", + ".sprites-sidebar", + ".sprites-sidebar();", + "alert", + "console", + "id=\"question-form\"", + "jMyControler", + "function", + "jCancelBtn", + "jLoginQuestion", + "login-question", + "assistance", + "tab-6", + "", + ".Reset", + ".reset", + ".Reset", + "sprites-sidebar", + ".sprites-sidebar();", + "intro", + "div.intro", + ".fiche #top-banner div.intro", + ".b-m_switch", + "two-cols", + ".sidebar", + "step-title-1", + ".campagnes-comm", + ".step-title-2", + "foresight-td-deco-2", + "foresight-tr-first", + "foresight-macsf", + ".foresight-th", + "E5E4E1", + "required=\"true\"", + "required=", + "js-tooltip", + "arrêt", + ".step-title-content", + ".js-tooltip", + ".foresight-expenses", + "js-tooltip", + "foresight-content", + ".btn.picture", + "invalid-message", + ".invalid-message", + ".foresight-form", + " foresight-height", + "in-3", + "foresight-td-in-3", + "foresight-th-last", + "foresight-th-first", + "foresight-th-last", + "error-bottom", + "error-bott", + "-import", + "foresight-table", + "#FBF9F6`", + "", + "@color-macsf-dark-grey", + "%;\n" + ], + "reverse": false, + "show_context": true, + "use_buffer2": true, + "whole_word": false, + "wrap": true + }, + "groups": + [ + { + "sheets": + [ + ] + } + ], + "incremental_find": + { + "height": 0.0 + }, + "input": + { + "height": 33.0 + }, + "layout": + { + "cells": + [ + [ + 0, + 0, + 1, + 1 + ] + ], + "cols": + [ + 0.0, + 1.0 + ], + "rows": + [ + 0.0, + 1.0 + ] + }, + "menu_visible": true, + "replace": + { + "height": 66.0 + }, + "save_all_on_build": true, + "select_file": + { + "height": 0.0, + "selected_items": + [ + [ + "function", + "wp-includes/functions.php" + ] + ], + "width": 0.0 + }, + "select_project": + { + "height": 500.0, + "selected_items": + [ + [ + "cfmt", + "/Users/marieguillaumet/Sites/MACSF_nouvelle_charte/macsf.sublime-project" + ] + ], + "width": 380.0 + }, + "show_minimap": true, + "show_open_files": false, + "show_tabs": true, + "side_bar_visible": true, + "side_bar_width": 344.0, + "status_bar_visible": true +} diff --git a/php/lib/Z.php b/php/lib/Z.php old mode 100644 new mode 100755 index d837952..0f74670 --- a/php/lib/Z.php +++ b/php/lib/Z.php @@ -16,235 +16,235 @@ * @author cedric */ class Z { - protected static $version="1.1.1"; - protected static $default="dist"; - - // default block list - // body is not allowed as block name - protected static $blocks = array('content','header','nav','aside','footer','head'); - protected static $path=array(); - protected static $ext = ".php"; - protected static $pageName = null; - protected static $ajaxBlock = null; - protected static $error = ""; - - /** - * Constructor - * - * @param array $blocks - * list of blocks. If none given default is array('content','header','nav','aside','footer','head') - * - * @param array $path - * list of dir path. Automaticaly append path of this file to find page/ajax/error files - * - * @param string $extension - * optional extension for file finding. Default is 'php'. - * If different, you need to provide page/ajax/error files with suitable extension - * - */ - public function Z($blocks=array(),$path=array(),$extension = "php"){ - if ($blocks) - Z::setBlocks($blocks); - Z::setPath($path); - Z::$ext = ".".trim(ltrim($extension,'.')); - } - - /** - * Entry point, to get page file to include, given page name - * and optionnal ajax block requested - * - * @param string $name - * @param string $ajaxBlock - * @return string - */ - public static function getPageFile($name, $ajaxBlock = null) { - if (Z::$pageName) - return Z::returnError("Error : currently processing page ".Z::$pageName.". Can't process page $name"); - Z::$pageName = $name; - - if ($ajaxBlock) { - if (in_array($ajaxBlock, Z::$blocks)) { - Z::$ajaxBlock = $ajaxBlock; - } - else { - return Z::returnError('

Le bloc AJAX « '.$ajaxBlock.' » n’est pas autorisé.

'); - } - return Z::findInPath("z-ajax". Z::$ext); - } - - return Z::findInPath("z-index". Z::$ext); - } - - /** - * Method used for block inclusion in page.php and body.php - * - * @param string $block - * block name. If none given, ajaxblock is assumed. Error if none set. - * can be a block name solely, current page assumed - * or can be block/pagename - * @return string - */ - public static function getFile($block=null) { - $pageName = Z::$pageName; - $block = explode("/",$block); - if (count($block)==2) - $pageName = end($block); - $block = reset($block); - - if (!$pageName) - return Z::returnError("Error : not currently processing any page, pagename must be defined"); - if (!$block AND !($block = Z::$ajaxBlock)) - return Z::returnError("Error : no block defined"); - - if ($block == 'body') { - // if dedicated body-pagename for this pagename, - // use it instead of general body structure - if ($f = Z::findInPath("body-$pageName".Z::$ext,false)) - return $f; - // else return general body structure - return Z::findInPath("body".Z::$ext); - } - - if (!in_array($block, Z::$blocks)) - return Z::returnError('

Le bloc « '.$block.' » n’est pas autorisé.

'); - - // try to find block for current page - if ($f = Z::findInPath("$block/$pageName".Z::$ext,false)) - return $f; - - // if not found and content block then 404 content - if ($block==reset(Z::$blocks)) - return Z::findInPath("$block/dist".Z::$ext); - - return Z::findInPath("$block/".Z::$default.Z::$ext); - } - - /** - * Retrieve Error message - * @return string - */ - public static function getError() { - return Z::$error; - } - - /** - * Return error filename, that will display current error message - * @param string $message - * @return string - */ - protected static function returnError($message){ - Z::$error = $message; - return Z::findInPath("z-error".Z::$ext); - } - - /** - * Get name of the page beeing processed - * @return string - */ - public static function getPageName() { return Z::$pageName; } - - - /** - * Set blocks list - * First block is content block that drives page construction - * order of others blocks has no effect - * - * 'head' is allways append to blocks if not listed - * - * @param array $blocks - * array('content','header','aside',footer'); - * @return void - */ - public static function setBlocks($blocks){ - if (!is_array($blocks)) - return false; - Z::$blocks = array(); - while($b = array_shift($blocks)){ - $b = trim(rtrim($b,'/')); - # / not allowed in block names. Explode to take first segment - $b = explode('/',$b); - $b = reset($b); - // body is not allowed as block name - if ($b!=='body') - Z::$blocks[] = $b; - } - if (!in_array('head', Z::$blocks)) - Z::$blocks[] = 'head'; - } - - - - /** - * Find file in path ! - * @param string $file - * @return string - */ - protected static function findInPath($file, $display_error=true){ - foreach(Z::$path as $p) { - if (file_exists($f = $p . $file)) - return $f; - } - return $display_error?Z::returnError('

Le fichier « '.$file.' » n’a pas été trouvé.

'):''; - } - - /** - * Get path used for block file search - * First path in array has the highest priority - * - * @return array - */ - public static function getPath(){ return Z::$path; } - - /** - * Set path list for block file search - * Return current path after setting - * - * @param array/string $path - * @return array - */ - public static function setPath($path){ - Z::$path = array(); - Z::prependPath(dirname(__FILE__)); - return Z::prependPath($path); - } - - /** - * Prepend path dirs to current path - * Return current path after setting - * - * @param array/string $path - * @return array - */ - public static function prependPath($path){ - if (is_array($path)) - while($p = array_pop($path)) - Z::prependPath($p); - else { - $path = trim(rtrim($path,'/')); - if (is_dir($path)) - array_unshift (Z::$path,"$path/"); - } - return Z::$path; - } - - /** - * Append path dirs to current path - * Return current path after setting - * - * @param array/string $path - * @return array - */ - public static function appendPath($path){ - if (is_array($path)) - while($p = array_shift($path)) - Z::appendPath($p); - else { - $path = trim(rtrim($path,'/')); - if (is_dir($path)) - array_push (Z::$path,"$path/"); - } - return Z::$path; - } + protected static $version="1.1.1"; + protected static $default="dist"; + + // default block list + // body is not allowed as block name + protected static $blocks = array('content','header','nav','aside','footer','head'); + protected static $path=array(); + protected static $ext = ".php"; + protected static $pageName = null; + protected static $ajaxBlock = null; + protected static $error = ""; + + /** + * Constructor + * + * @param array $blocks + * list of blocks. If none given default is array('content','header','nav','aside','footer','head') + * + * @param array $path + * list of dir path. Automaticaly append path of this file to find page/ajax/error files + * + * @param string $extension + * optional extension for file finding. Default is 'php'. + * If different, you need to provide page/ajax/error files with suitable extension + * + */ + public function Z($blocks=array(),$path=array(),$extension = "php"){ + if ($blocks) + Z::setBlocks($blocks); + Z::setPath($path); + Z::$ext = ".".trim(ltrim($extension,'.')); + } + + /** + * Entry point, to get page file to include, given page name + * and optionnal ajax block requested + * + * @param string $name + * @param string $ajaxBlock + * @return string + */ + public static function getPageFile($name, $ajaxBlock = null) { + if (Z::$pageName) + return Z::returnError("Error : currently processing page ".Z::$pageName.". Can't process page $name"); + Z::$pageName = $name; + + if ($ajaxBlock) { + if (in_array($ajaxBlock, Z::$blocks)) { + Z::$ajaxBlock = $ajaxBlock; + } + else { + return Z::returnError('

Le bloc AJAX « '.$ajaxBlock.' » n’est pas autorisé.

'); + } + return Z::findInPath("z-ajax". Z::$ext); + } + + return Z::findInPath("_html". Z::$ext); + } + + /** + * Method used for block inclusion in page.php and body.php + * + * @param string $block + * block name. If none given, ajaxblock is assumed. Error if none set. + * can be a block name solely, current page assumed + * or can be block/pagename + * @return string + */ + public static function getFile($block=null) { + $pageName = Z::$pageName; + $block = explode("/",$block); + if (count($block)==2) + $pageName = end($block); + $block = reset($block); + echo "\n".''."\n"; + if (!$pageName) + return Z::returnError("

Erreur : aucune page n’est actuellement demandée, le nom de la page doit être définit.

"); + if (!$block AND !($block = Z::$ajaxBlock)) + return Z::returnError("Erreur : aucun bloc n’est défini."); + + if ($block == 'body') { + // if dedicated body-pagename for this pagename, + // use it instead of general body structure + if ($f = Z::findInPath("body-$pageName".Z::$ext,false)) + return $f; + // else return general body structure + return Z::findInPath("body".Z::$ext); + } + + if (!in_array($block, Z::$blocks)) + return Z::returnError('

Le bloc « '.$block.' » n’est pas autorisé.

'); + + // try to find block for current page + if ($f = Z::findInPath("$block/$pageName".Z::$ext,false)) + return $f; + + // if not found and content block then 404 content + if ($block==reset(Z::$blocks)) + return Z::findInPath("$block/dist".Z::$ext); + + return Z::findInPath("$block/".Z::$default.Z::$ext); + } + + /** + * Retrieve Error message + * @return string + */ + public static function getError() { + return Z::$error; + } + + /** + * Return error filename, that will display current error message + * @param string $message + * @return string + */ + protected static function returnError($message){ + Z::$error = $message; + return Z::findInPath("z-error".Z::$ext); + } + + /** + * Get name of the page beeing processed + * @return string + */ + public static function getPageName() { return Z::$pageName; } + + + /** + * Set blocks list + * First block is content block that drives page construction + * order of others blocks has no effect + * + * 'head' is allways append to blocks if not listed + * + * @param array $blocks + * array('content','header','aside',footer'); + * @return void + */ + public static function setBlocks($blocks){ + if (!is_array($blocks)) + return false; + Z::$blocks = array(); + while($b = array_shift($blocks)){ + $b = trim(rtrim($b,'/')); + # / not allowed in block names. Explode to take first segment + $b = explode('/',$b); + $b = reset($b); + // body is not allowed as block name + if ($b!=='body') + Z::$blocks[] = $b; + } + if (!in_array('head', Z::$blocks)) + Z::$blocks[] = 'head'; + } + + + + /** + * Find file in path ! + * @param string $file + * @return string + */ + protected static function findInPath($file, $display_error=true){ + foreach(Z::$path as $p) { + if (file_exists($f = $p . $file)) + return $f; + } + return $display_error?Z::returnError('

Le fichier « '.$file.' » n’a pas été trouvé.

'):''; + } + + /** + * Get path used for block file search + * First path in array has the highest priority + * + * @return array + */ + public static function getPath(){ return Z::$path; } + + /** + * Set path list for block file search + * Return current path after setting + * + * @param array/string $path + * @return array + */ + public static function setPath($path){ + Z::$path = array(); + Z::prependPath(dirname(__FILE__)); + return Z::prependPath($path); + } + + /** + * Prepend path dirs to current path + * Return current path after setting + * + * @param array/string $path + * @return array + */ + public static function prependPath($path){ + if (is_array($path)) + while($p = array_pop($path)) + Z::prependPath($p); + else { + $path = trim(rtrim($path,'/')); + if (is_dir($path)) + array_unshift (Z::$path,"$path/"); + } + return Z::$path; + } + + /** + * Append path dirs to current path + * Return current path after setting + * + * @param array/string $path + * @return array + */ + public static function appendPath($path){ + if (is_array($path)) + while($p = array_shift($path)) + Z::appendPath($p); + else { + $path = trim(rtrim($path,'/')); + if (is_dir($path)) + array_push (Z::$path,"$path/"); + } + return Z::$path; + } } ?> \ No newline at end of file diff --git a/php/lib/i18n.php b/php/lib/i18n.php new file mode 100755 index 0000000..e821d42 --- /dev/null +++ b/php/lib/i18n.php @@ -0,0 +1,81 @@ + + */ + +/** + * Usage + * ----- + * + * This lib uses a JSON config file named 'i18n.json' at the project's root. + * The config file cnotains a simple object, that contains : + * - the configuration : `config` + * - the different translations : `translations` + * It uses a simple convention : each localizable string is used as key and + * is associated w/ an object within each key is a locale as in the following + * example : + * + * "translations": { + * "Bonjour": { + * "fr": "Salutations", + * "en": "Hi Buddy!" + * } + * } + * + * We use a JSON object because it'll less verbose to maintain and contribute + * during the dev time than a PHP array. Either, we prefer to use the + * localizable string as the root key because when you're working on a project + * and you need to add a new string to localize, it's more simple to add it at + * a unique point and then fill the desired translations than to add it in the + * arrays, one for each locale. + * + * To localize a string in your layouts, simply use the given `_t` function and + * pass the string to localize to it. It will render the localized string if + * available, or `[[given string]]` as fallback. + * + * To change the displayed locale, add the GET parameter `lang` to your URL w/ + * the desired locale (e.g. ?lang=en). + */ + +/** + * Load the configuration + */ +$i18n_json = file_get_contents('../json/i18n.json'); +$i18n = json_decode($i18n_json, true); + +/** + * Set the lang + */ +$i18n_lang = isset($_GET['lang'])? $_GET['lang'] : $i18n['config']['default']; + +/** + * The translate `_t` function + * + * @param string $string the string to localize + * @param string $lang a lang-code to bypass the default lang (optionnal) + * @return string the localized string + */ +function _t ($string, $lang = null) { + // Load translations + $t = $GLOBALS['i18n']['translations']; + $l = ''.$string.''; + + // Choose the lang to use + $lang = is_null($lang)? $GLOBALS['i18n_lang'] : $lang; + + // Try to find the string subject in the table + if (!array_key_exists($string, $t)) + return $l; + + // Try to find the lang for the string subject + if (!array_key_exists($lang, $t[$string])) + return $l; + + // Finaly, return the translation + return $l = $t[$string][$lang]; +} + diff --git a/php/lib/markdown.php b/php/lib/markdown.php old mode 100644 new mode 100755 index 49b16b4..c3fcf7a --- a/php/lib/markdown.php +++ b/php/lib/markdown.php @@ -53,15 +53,15 @@ function Markdown($text) { # # Initialize the parser and return the result of its transform method. # - # Setup static parser variable. - static $parser; - if (!isset($parser)) { - $parser_class = MARKDOWN_PARSER_CLASS; - $parser = new $parser_class; - } - - # Transform text using parser. - return $parser->transform($text); + # Setup static parser variable. + static $parser; + if (!isset($parser)) { + $parser_class = MARKDOWN_PARSER_CLASS; + $parser = new $parser_class; + } + + # Transform text using parser. + return $parser->transform($text); } @@ -77,109 +77,109 @@ function Markdown($text) { */ if (isset($wp_version)) { - # More details about how it works here: - # - - # Post content and excerpts - # - Remove WordPress paragraph generator. - # - Run Markdown on excerpt, then remove all tags. - # - Add paragraph tag around the excerpt, but remove it for the excerpt rss. - if (MARKDOWN_WP_POSTS) { - remove_filter('the_content', 'wpautop'); + # More details about how it works here: + # + + # Post content and excerpts + # - Remove WordPress paragraph generator. + # - Run Markdown on excerpt, then remove all tags. + # - Add paragraph tag around the excerpt, but remove it for the excerpt rss. + if (MARKDOWN_WP_POSTS) { + remove_filter('the_content', 'wpautop'); remove_filter('the_content_rss', 'wpautop'); - remove_filter('the_excerpt', 'wpautop'); - add_filter('the_content', 'mdwp_MarkdownPost', 6); + remove_filter('the_excerpt', 'wpautop'); + add_filter('the_content', 'mdwp_MarkdownPost', 6); add_filter('the_content_rss', 'mdwp_MarkdownPost', 6); - add_filter('get_the_excerpt', 'mdwp_MarkdownPost', 6); - add_filter('get_the_excerpt', 'trim', 7); - add_filter('the_excerpt', 'mdwp_add_p'); - add_filter('the_excerpt_rss', 'mdwp_strip_p'); - - remove_filter('content_save_pre', 'balanceTags', 50); - remove_filter('excerpt_save_pre', 'balanceTags', 50); - add_filter('the_content', 'balanceTags', 50); - add_filter('get_the_excerpt', 'balanceTags', 9); - } - - # Add a footnote id prefix to posts when inside a loop. - function mdwp_MarkdownPost($text) { - static $parser; - if (!$parser) { - $parser_class = MARKDOWN_PARSER_CLASS; - $parser = new $parser_class; - } - if (is_single() || is_page() || is_feed()) { - $parser->fn_id_prefix = ""; - } else { - $parser->fn_id_prefix = get_the_ID() . "."; - } - return $parser->transform($text); - } - - # Comments - # - Remove WordPress paragraph generator. - # - Remove WordPress auto-link generator. - # - Scramble important tags before passing them to the kses filter. - # - Run Markdown on excerpt then remove paragraph tags. - if (MARKDOWN_WP_COMMENTS) { - remove_filter('comment_text', 'wpautop', 30); - remove_filter('comment_text', 'make_clickable'); - add_filter('pre_comment_content', 'Markdown', 6); - add_filter('pre_comment_content', 'mdwp_hide_tags', 8); - add_filter('pre_comment_content', 'mdwp_show_tags', 12); - add_filter('get_comment_text', 'Markdown', 6); - add_filter('get_comment_excerpt', 'Markdown', 6); - add_filter('get_comment_excerpt', 'mdwp_strip_p', 7); - - global $mdwp_hidden_tags, $mdwp_placeholders; - $mdwp_hidden_tags = explode(' ', - '

 
  • '); - $mdwp_placeholders = explode(' ', str_rot13( - 'pEj07ZbbBZ U1kqgh4w4p pre2zmeN6K QTi31t9pre ol0MP1jzJR '. - 'ML5IjmbRol ulANi1NsGY J7zRLJqPul liA8ctl16T K9nhooUHli')); - } - - function mdwp_add_p($text) { - if (!preg_match('{^$|^<(p|ul|ol|dl|pre|blockquote)>}i', $text)) { - $text = '

    '.$text.'

    '; - $text = preg_replace('{\n{2,}}', "

    \n\n

    ", $text); - } - return $text; - } - - function mdwp_strip_p($t) { return preg_replace('{}i', '', $t); } - - function mdwp_hide_tags($text) { - global $mdwp_hidden_tags, $mdwp_placeholders; - return str_replace($mdwp_hidden_tags, $mdwp_placeholders, $text); - } - function mdwp_show_tags($text) { - global $mdwp_hidden_tags, $mdwp_placeholders; - return str_replace($mdwp_placeholders, $mdwp_hidden_tags, $text); - } + add_filter('get_the_excerpt', 'mdwp_MarkdownPost', 6); + add_filter('get_the_excerpt', 'trim', 7); + add_filter('the_excerpt', 'mdwp_add_p'); + add_filter('the_excerpt_rss', 'mdwp_strip_p'); + + remove_filter('content_save_pre', 'balanceTags', 50); + remove_filter('excerpt_save_pre', 'balanceTags', 50); + add_filter('the_content', 'balanceTags', 50); + add_filter('get_the_excerpt', 'balanceTags', 9); + } + + # Add a footnote id prefix to posts when inside a loop. + function mdwp_MarkdownPost($text) { + static $parser; + if (!$parser) { + $parser_class = MARKDOWN_PARSER_CLASS; + $parser = new $parser_class; + } + if (is_single() || is_page() || is_feed()) { + $parser->fn_id_prefix = ""; + } else { + $parser->fn_id_prefix = get_the_ID() . "."; + } + return $parser->transform($text); + } + + # Comments + # - Remove WordPress paragraph generator. + # - Remove WordPress auto-link generator. + # - Scramble important tags before passing them to the kses filter. + # - Run Markdown on excerpt then remove paragraph tags. + if (MARKDOWN_WP_COMMENTS) { + remove_filter('comment_text', 'wpautop', 30); + remove_filter('comment_text', 'make_clickable'); + add_filter('pre_comment_content', 'Markdown', 6); + add_filter('pre_comment_content', 'mdwp_hide_tags', 8); + add_filter('pre_comment_content', 'mdwp_show_tags', 12); + add_filter('get_comment_text', 'Markdown', 6); + add_filter('get_comment_excerpt', 'Markdown', 6); + add_filter('get_comment_excerpt', 'mdwp_strip_p', 7); + + global $mdwp_hidden_tags, $mdwp_placeholders; + $mdwp_hidden_tags = explode(' ', + '

     
  • '); + $mdwp_placeholders = explode(' ', str_rot13( + 'pEj07ZbbBZ U1kqgh4w4p pre2zmeN6K QTi31t9pre ol0MP1jzJR '. + 'ML5IjmbRol ulANi1NsGY J7zRLJqPul liA8ctl16T K9nhooUHli')); + } + + function mdwp_add_p($text) { + if (!preg_match('{^$|^<(p|ul|ol|dl|pre|blockquote)>}i', $text)) { + $text = '

    '.$text.'

    '; + $text = preg_replace('{\n{2,}}', "

    \n\n

    ", $text); + } + return $text; + } + + function mdwp_strip_p($t) { return preg_replace('{}i', '', $t); } + + function mdwp_hide_tags($text) { + global $mdwp_hidden_tags, $mdwp_placeholders; + return str_replace($mdwp_hidden_tags, $mdwp_placeholders, $text); + } + function mdwp_show_tags($text) { + global $mdwp_hidden_tags, $mdwp_placeholders; + return str_replace($mdwp_placeholders, $mdwp_hidden_tags, $text); + } } ### bBlog Plugin Info ### function identify_modifier_markdown() { - return array( - 'name' => 'markdown', - 'type' => 'modifier', - 'nicename' => 'PHP Markdown Extra', - 'description' => 'A text-to-HTML conversion tool for web writers', - 'authors' => 'Michel Fortin and John Gruber', - 'licence' => 'GPL', - 'version' => MARKDOWNEXTRA_VERSION, - 'help' => 'Markdown syntax allows you to write using an easy-to-read, easy-to-write plain text format. Based on the original Perl version by John Gruber. More...', - ); + return array( + 'name' => 'markdown', + 'type' => 'modifier', + 'nicename' => 'PHP Markdown Extra', + 'description' => 'A text-to-HTML conversion tool for web writers', + 'authors' => 'Michel Fortin and John Gruber', + 'licence' => 'GPL', + 'version' => MARKDOWNEXTRA_VERSION, + 'help' => 'Markdown syntax allows you to write using an easy-to-read, easy-to-write plain text format. Based on the original Perl version by John Gruber. More...', + ); } ### Smarty Modifier Interface ### function smarty_modifier_markdown($text) { - return Markdown($text); + return Markdown($text); } @@ -188,22 +188,22 @@ function smarty_modifier_markdown($text) { # Rename this file to "classTextile.php" and it can replace Textile everywhere. if (strcasecmp(substr(__FILE__, -16), "classTextile.php") == 0) { - # Try to include PHP SmartyPants. Should be in the same directory. - @include_once 'smartypants.php'; - # Fake Textile class. It calls Markdown instead. - class Textile { - function TextileThis($text, $lite='', $encode='') { - if ($lite == '' && $encode == '') $text = Markdown($text); - if (function_exists('SmartyPants')) $text = SmartyPants($text); - return $text; - } - # Fake restricted version: restrictions are not supported for now. - function TextileRestricted($text, $lite='', $noimage='') { - return $this->TextileThis($text, $lite); - } - # Workaround to ensure compatibility with TextPattern 4.0.3. - function blockLite($text) { return $text; } - } + # Try to include PHP SmartyPants. Should be in the same directory. + @include_once 'smartypants.php'; + # Fake Textile class. It calls Markdown instead. + class Textile { + function TextileThis($text, $lite='', $encode='') { + if ($lite == '' && $encode == '') $text = Markdown($text); + if (function_exists('SmartyPants')) $text = SmartyPants($text); + return $text; + } + # Fake restricted version: restrictions are not supported for now. + function TextileRestricted($text, $lite='', $noimage='') { + return $this->TextileThis($text, $lite); + } + # Workaround to ensure compatibility with TextPattern 4.0.3. + function blockLite($text) { return $text; } + } } @@ -214,1458 +214,1458 @@ function blockLite($text) { return $text; } class Markdown_Parser { - # Regex to match balanced [brackets]. - # Needed to insert a maximum bracked depth while converting to PHP. - var $nested_brackets_depth = 6; - var $nested_brackets_re; - - var $nested_url_parenthesis_depth = 4; - var $nested_url_parenthesis_re; - - # Table of hash values for escaped characters: - var $escape_chars = '\`*_{}[]()>#+-.!'; - var $escape_chars_re; - - # Change to ">" for HTML output. - var $empty_element_suffix = MARKDOWN_EMPTY_ELEMENT_SUFFIX; - var $tab_width = MARKDOWN_TAB_WIDTH; - - # Change to `true` to disallow markup or entities. - var $no_markup = false; - var $no_entities = false; - - # Predefined urls and titles for reference links and images. - var $predef_urls = array(); - var $predef_titles = array(); - - - function Markdown_Parser() { - # - # Constructor function. Initialize appropriate member variables. - # - $this->_initDetab(); - $this->prepareItalicsAndBold(); - - $this->nested_brackets_re = - str_repeat('(?>[^\[\]]+|\[', $this->nested_brackets_depth). - str_repeat('\])*', $this->nested_brackets_depth); - - $this->nested_url_parenthesis_re = - str_repeat('(?>[^()\s]+|\(', $this->nested_url_parenthesis_depth). - str_repeat('(?>\)))*', $this->nested_url_parenthesis_depth); - - $this->escape_chars_re = '['.preg_quote($this->escape_chars).']'; - - # Sort document, block, and span gamut in ascendent priority order. - asort($this->document_gamut); - asort($this->block_gamut); - asort($this->span_gamut); - } - - - # Internal hashes used during transformation. - var $urls = array(); - var $titles = array(); - var $html_hashes = array(); - - # Status flag to avoid invalid nesting. - var $in_anchor = false; - - - function setup() { - # - # Called before the transformation process starts to setup parser - # states. - # - # Clear global hashes. - $this->urls = $this->predef_urls; - $this->titles = $this->predef_titles; - $this->html_hashes = array(); - - $in_anchor = false; - } - - function teardown() { - # - # Called after the transformation process to clear any variable - # which may be taking up memory unnecessarly. - # - $this->urls = array(); - $this->titles = array(); - $this->html_hashes = array(); - } - - - function transform($text) { - # - # Main function. Performs some preprocessing on the input text - # and pass it through the document gamut. - # - $this->setup(); - - # Remove UTF-8 BOM and marker character in input, if present. - $text = preg_replace('{^\xEF\xBB\xBF|\x1A}', '', $text); - - # Standardize line endings: - # DOS to Unix and Mac to Unix - $text = preg_replace('{\r\n?}', "\n", $text); - - # Make sure $text ends with a couple of newlines: - $text .= "\n\n"; - - # Convert all tabs to spaces. - $text = $this->detab($text); - - # Turn block-level HTML blocks into hash entries - $text = $this->hashHTMLBlocks($text); - - # Strip any lines consisting only of spaces and tabs. - # This makes subsequent regexen easier to write, because we can - # match consecutive blank lines with /\n+/ instead of something - # contorted like /[ ]*\n+/ . - $text = preg_replace('/^[ ]+$/m', '', $text); - - # Run document gamut methods. - foreach ($this->document_gamut as $method => $priority) { - $text = $this->$method($text); - } - - $this->teardown(); - - return $text . "\n"; - } - - var $document_gamut = array( - # Strip link definitions, store in hashes. - "stripLinkDefinitions" => 20, - - "runBasicBlockGamut" => 30, - ); - - - function stripLinkDefinitions($text) { - # - # Strips link definitions from text, stores the URLs and titles in - # hash references. - # - $less_than_tab = $this->tab_width - 1; - - # Link defs are in the form: ^[id]: url "optional title" - $text = preg_replace_callback('{ - ^[ ]{0,'.$less_than_tab.'}\[(.+)\][ ]?: # id = $1 - [ ]* - \n? # maybe *one* newline - [ ]* - (?: - <(.+?)> # url = $2 - | - (\S+?) # url = $3 - ) - [ ]* - \n? # maybe one newline - [ ]* - (?: - (?<=\s) # lookbehind for whitespace - ["(] - (.*?) # title = $4 - [")] - [ ]* - )? # title is optional - (?:\n+|\Z) - }xm', - array(&$this, '_stripLinkDefinitions_callback'), - $text); - return $text; - } - function _stripLinkDefinitions_callback($matches) { - $link_id = strtolower($matches[1]); - $url = $matches[2] == '' ? $matches[3] : $matches[2]; - $this->urls[$link_id] = $url; - $this->titles[$link_id] =& $matches[4]; - return ''; # String that will replace the block - } - - - function hashHTMLBlocks($text) { - if ($this->no_markup) return $text; - - $less_than_tab = $this->tab_width - 1; - - # Hashify HTML blocks: - # We only want to do this for block-level HTML tags, such as headers, - # lists, and tables. That's because we still want to wrap

    s around - # "paragraphs" that are wrapped in non-block-level tags, such as anchors, - # phrase emphasis, and spans. The list of tags we're looking for is - # hard-coded: - # - # * List "a" is made of tags which can be both inline or block-level. - # These will be treated block-level when the start tag is alone on - # its line, otherwise they're not matched here and will be taken as - # inline later. - # * List "b" is made of tags which are always block-level; - # - $block_tags_a_re = 'ins|del'; - $block_tags_b_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|'. - 'script|noscript|form|fieldset|iframe|math'; - - # Regular expression for the content of a block tag. - $nested_tags_level = 4; - $attr = ' - (?> # optional tag attributes - \s # starts with whitespace - (?> - [^>"/]+ # text outside quotes - | - /+(?!>) # slash not followed by ">" - | - "[^"]*" # text inside double quotes (tolerate ">") - | - \'[^\']*\' # text inside single quotes (tolerate ">") - )* - )? - '; - $content = - str_repeat(' - (?> - [^<]+ # content without tag - | - <\2 # nested opening tag - '.$attr.' # attributes - (?> - /> - | - >', $nested_tags_level). # end of opening tag - '.*?'. # last level nested tag content - str_repeat(' - # closing nested tag - ) - | - <(?!/\2\s*> # other tags with a different name - ) - )*', - $nested_tags_level); - $content2 = str_replace('\2', '\3', $content); - - # First, look for nested blocks, e.g.: - #

    - #
    - # tags for inner block must be indented. - #
    - #
    - # - # The outermost tags must start at the left margin for this to match, and - # the inner nested divs must be indented. - # We need to do this before the next, more liberal match, because the next - # match will start at the first `
    ` and stop at the first `
    `. - $text = preg_replace_callback('{(?> - (?> - (?<=\n\n) # Starting after a blank line - | # or - \A\n? # the beginning of the doc - ) - ( # save in $1 - - # Match from `\n` to `\n`, handling nested tags - # in between. - - [ ]{0,'.$less_than_tab.'} - <('.$block_tags_b_re.')# start tag = $2 - '.$attr.'> # attributes followed by > and \n - '.$content.' # content, support nesting - # the matching end tag - [ ]* # trailing spaces/tabs - (?=\n+|\Z) # followed by a newline or end of document - - | # Special version for tags of group a. - - [ ]{0,'.$less_than_tab.'} - <('.$block_tags_a_re.')# start tag = $3 - '.$attr.'>[ ]*\n # attributes followed by > - '.$content2.' # content, support nesting - # the matching end tag - [ ]* # trailing spaces/tabs - (?=\n+|\Z) # followed by a newline or end of document - - | # Special case just for
    . It was easier to make a special - # case than to make the other regex more complicated. - - [ ]{0,'.$less_than_tab.'} - <(hr) # start tag = $2 - '.$attr.' # attributes - /?> # the matching end tag - [ ]* - (?=\n{2,}|\Z) # followed by a blank line or end of document - - | # Special case for standalone HTML comments: - - [ ]{0,'.$less_than_tab.'} - (?s: - - ) - [ ]* - (?=\n{2,}|\Z) # followed by a blank line or end of document - - | # PHP and ASP-style processor instructions ( - ) - [ ]* - (?=\n{2,}|\Z) # followed by a blank line or end of document - - ) - )}Sxmi', - array(&$this, '_hashHTMLBlocks_callback'), - $text); - - return $text; - } - function _hashHTMLBlocks_callback($matches) { - $text = $matches[1]; - $key = $this->hashBlock($text); - return "\n\n$key\n\n"; - } - - - function hashPart($text, $boundary = 'X') { - # - # Called whenever a tag must be hashed when a function insert an atomic - # element in the text stream. Passing $text to through this function gives - # a unique text-token which will be reverted back when calling unhash. - # - # The $boundary argument specify what character should be used to surround - # the token. By convension, "B" is used for block elements that needs not - # to be wrapped into paragraph tags at the end, ":" is used for elements - # that are word separators and "X" is used in the general case. - # - # Swap back any tag hash found in $text so we do not have to `unhash` - # multiple times at the end. - $text = $this->unhash($text); - - # Then hash the block. - static $i = 0; - $key = "$boundary\x1A" . ++$i . $boundary; - $this->html_hashes[$key] = $text; - return $key; # String that will replace the tag. - } - - - function hashBlock($text) { - # - # Shortcut function for hashPart with block-level boundaries. - # - return $this->hashPart($text, 'B'); - } - - - var $block_gamut = array( - # - # These are all the transformations that form block-level - # tags like paragraphs, headers, and list items. - # - "doHeaders" => 10, - "doHorizontalRules" => 20, - - "doLists" => 40, - "doCodeBlocks" => 50, - "doBlockQuotes" => 60, - ); - - function runBlockGamut($text) { - # - # Run block gamut tranformations. - # - # We need to escape raw HTML in Markdown source before doing anything - # else. This need to be done for each block, and not only at the - # begining in the Markdown function since hashed blocks can be part of - # list items and could have been indented. Indented blocks would have - # been seen as a code block in a previous pass of hashHTMLBlocks. - $text = $this->hashHTMLBlocks($text); - - return $this->runBasicBlockGamut($text); - } - - function runBasicBlockGamut($text) { - # - # Run block gamut tranformations, without hashing HTML blocks. This is - # useful when HTML blocks are known to be already hashed, like in the first - # whole-document pass. - # - foreach ($this->block_gamut as $method => $priority) { - $text = $this->$method($text); - } - - # Finally form paragraph and restore hashed blocks. - $text = $this->formParagraphs($text); - - return $text; - } - - - function doHorizontalRules($text) { - # Do Horizontal Rules: - return preg_replace( - '{ - ^[ ]{0,3} # Leading space - ([-*_]) # $1: First marker - (?> # Repeated marker group - [ ]{0,2} # Zero, one, or two spaces. - \1 # Marker character - ){2,} # Group repeated at least twice - [ ]* # Tailing spaces - $ # End of line. - }mx', - "\n".$this->hashBlock("empty_element_suffix")."\n", - $text); - } - - - var $span_gamut = array( - # - # These are all the transformations that occur *within* block-level - # tags like paragraphs, headers, and list items. - # - # Process character escapes, code spans, and inline HTML - # in one shot. - "parseSpan" => -30, - - # Process anchor and image tags. Images must come first, - # because ![foo][f] looks like an anchor. - "doImages" => 10, - "doAnchors" => 20, - - # Make links out of things like `` - # Must come after doAnchors, because you can use < and > - # delimiters in inline links like [this](). - "doAutoLinks" => 30, - "encodeAmpsAndAngles" => 40, - - "doItalicsAndBold" => 50, - "doHardBreaks" => 60, - ); - - function runSpanGamut($text) { - # - # Run span gamut tranformations. - # - foreach ($this->span_gamut as $method => $priority) { - $text = $this->$method($text); - } - - return $text; - } - - - function doHardBreaks($text) { - # Do hard breaks: - return preg_replace_callback('/ {2,}\n/', - array(&$this, '_doHardBreaks_callback'), $text); - } - function _doHardBreaks_callback($matches) { - return $this->hashPart("empty_element_suffix\n"); - } - - - function doAnchors($text) { - # - # Turn Markdown link shortcuts into XHTML tags. - # - if ($this->in_anchor) return $text; - $this->in_anchor = true; - - # - # First, handle reference-style links: [link text] [id] - # - $text = preg_replace_callback('{ - ( # wrap whole match in $1 - \[ - ('.$this->nested_brackets_re.') # link text = $2 - \] - - [ ]? # one optional space - (?:\n[ ]*)? # one optional newline followed by spaces - - \[ - (.*?) # id = $3 - \] - ) - }xs', - array(&$this, '_doAnchors_reference_callback'), $text); - - # - # Next, inline-style links: [link text](url "optional title") - # - $text = preg_replace_callback('{ - ( # wrap whole match in $1 - \[ - ('.$this->nested_brackets_re.') # link text = $2 - \] - \( # literal paren - [ \n]* - (?: - <(.+?)> # href = $3 - | - ('.$this->nested_url_parenthesis_re.') # href = $4 - ) - [ \n]* - ( # $5 - ([\'"]) # quote char = $6 - (.*?) # Title = $7 - \6 # matching quote - [ \n]* # ignore any spaces/tabs between closing quote and ) - )? # title is optional - \) - ) - }xs', - array(&$this, '_doAnchors_inline_callback'), $text); - - # - # Last, handle reference-style shortcuts: [link text] - # These must come last in case you've also got [link text][1] - # or [link text](/foo) - # - $text = preg_replace_callback('{ - ( # wrap whole match in $1 - \[ - ([^\[\]]+) # link text = $2; can\'t contain [ or ] - \] - ) - }xs', - array(&$this, '_doAnchors_reference_callback'), $text); - - $this->in_anchor = false; - return $text; - } - function _doAnchors_reference_callback($matches) { - $whole_match = $matches[1]; - $link_text = $matches[2]; - $link_id =& $matches[3]; - - if ($link_id == "") { - # for shortcut links like [this][] or [this]. - $link_id = $link_text; - } - - # lower-case and turn embedded newlines into spaces - $link_id = strtolower($link_id); - $link_id = preg_replace('{[ ]?\n}', ' ', $link_id); - - if (isset($this->urls[$link_id])) { - $url = $this->urls[$link_id]; - $url = $this->encodeAttribute($url); - - $result = "titles[$link_id] ) ) { - $title = $this->titles[$link_id]; - $title = $this->encodeAttribute($title); - $result .= " title=\"$title\""; - } - - $link_text = $this->runSpanGamut($link_text); - $result .= ">$link_text"; - $result = $this->hashPart($result); - } - else { - $result = $whole_match; - } - return $result; - } - function _doAnchors_inline_callback($matches) { - $whole_match = $matches[1]; - $link_text = $this->runSpanGamut($matches[2]); - $url = $matches[3] == '' ? $matches[4] : $matches[3]; - $title =& $matches[7]; - - $url = $this->encodeAttribute($url); - - $result = "encodeAttribute($title); - $result .= " title=\"$title\""; - } - - $link_text = $this->runSpanGamut($link_text); - $result .= ">$link_text"; - - return $this->hashPart($result); - } - - - function doImages($text) { - # - # Turn Markdown image shortcuts into tags. - # - # - # First, handle reference-style labeled images: ![alt text][id] - # - $text = preg_replace_callback('{ - ( # wrap whole match in $1 - !\[ - ('.$this->nested_brackets_re.') # alt text = $2 - \] - - [ ]? # one optional space - (?:\n[ ]*)? # one optional newline followed by spaces - - \[ - (.*?) # id = $3 - \] - - ) - }xs', - array(&$this, '_doImages_reference_callback'), $text); - - # - # Next, handle inline images: ![alt text](url "optional title") - # Don't forget: encode * and _ - # - $text = preg_replace_callback('{ - ( # wrap whole match in $1 - !\[ - ('.$this->nested_brackets_re.') # alt text = $2 - \] - \s? # One optional whitespace character - \( # literal paren - [ \n]* - (?: - <(\S*)> # src url = $3 - | - ('.$this->nested_url_parenthesis_re.') # src url = $4 - ) - [ \n]* - ( # $5 - ([\'"]) # quote char = $6 - (.*?) # title = $7 - \6 # matching quote - [ \n]* - )? # title is optional - \) - ) - }xs', - array(&$this, '_doImages_inline_callback'), $text); - - return $text; - } - function _doImages_reference_callback($matches) { - $whole_match = $matches[1]; - $alt_text = $matches[2]; - $link_id = strtolower($matches[3]); - - if ($link_id == "") { - $link_id = strtolower($alt_text); # for shortcut links like ![this][]. - } - - $alt_text = $this->encodeAttribute($alt_text); - if (isset($this->urls[$link_id])) { - $url = $this->encodeAttribute($this->urls[$link_id]); - $result = "\"$alt_text\"";titles[$link_id])) { - $title = $this->titles[$link_id]; - $title = $this->encodeAttribute($title); - $result .= " title=\"$title\""; - } - $result .= $this->empty_element_suffix; - $result = $this->hashPart($result); - } - else { - # If there's no such link ID, leave intact: - $result = $whole_match; - } - - return $result; - } - function _doImages_inline_callback($matches) { - $whole_match = $matches[1]; - $alt_text = $matches[2]; - $url = $matches[3] == '' ? $matches[4] : $matches[3]; - $title =& $matches[7]; - - $alt_text = $this->encodeAttribute($alt_text); - $url = $this->encodeAttribute($url); - $result = "\"$alt_text\"";encodeAttribute($title); - $result .= " title=\"$title\""; # $title already quoted - } - $result .= $this->empty_element_suffix; - - return $this->hashPart($result); - } - - - function doHeaders($text) { - # Setext-style headers: - # Header 1 - # ======== - # - # Header 2 - # -------- - # - $text = preg_replace_callback('{ ^(.+?)[ ]*\n(=+|-+)[ ]*\n+ }mx', - array(&$this, '_doHeaders_callback_setext'), $text); - - # atx-style headers: - # # Header 1 - # ## Header 2 - # ## Header 2 with closing hashes ## - # ... - # ###### Header 6 - # - $text = preg_replace_callback('{ - ^(\#{1,6}) # $1 = string of #\'s - [ ]* - (.+?) # $2 = Header text - [ ]* - \#* # optional closing #\'s (not counted) - \n+ - }xm', - array(&$this, '_doHeaders_callback_atx'), $text); - - return $text; - } - function _doHeaders_callback_setext($matches) { - # Terrible hack to check we haven't found an empty list item. - if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1])) - return $matches[0]; - - $level = $matches[2]{0} == '=' ? 1 : 2; - $block = "".$this->runSpanGamut($matches[1]).""; - return "\n" . $this->hashBlock($block) . "\n\n"; - } - function _doHeaders_callback_atx($matches) { - $level = strlen($matches[1]); - $block = "".$this->runSpanGamut($matches[2]).""; - return "\n" . $this->hashBlock($block) . "\n\n"; - } - - - function doLists($text) { - # - # Form HTML ordered (numbered) and unordered (bulleted) lists. - # - $less_than_tab = $this->tab_width - 1; - - # Re-usable patterns to match list item bullets and number markers: - $marker_ul_re = '[*+-]'; - $marker_ol_re = '\d+[.]'; - $marker_any_re = "(?:$marker_ul_re|$marker_ol_re)"; - - $markers_relist = array( - $marker_ul_re => $marker_ol_re, - $marker_ol_re => $marker_ul_re, - ); - - foreach ($markers_relist as $marker_re => $other_marker_re) { - # Re-usable pattern to match any entirel ul or ol list: - $whole_list_re = ' - ( # $1 = whole list - ( # $2 - ([ ]{0,'.$less_than_tab.'}) # $3 = number of spaces - ('.$marker_re.') # $4 = first list item marker - [ ]+ - ) - (?s:.+?) - ( # $5 - \z - | - \n{2,} - (?=\S) - (?! # Negative lookahead for another list item marker - [ ]* - '.$marker_re.'[ ]+ - ) - | - (?= # Lookahead for another kind of list - \n - \3 # Must have the same indentation - '.$other_marker_re.'[ ]+ - ) - ) - ) - '; // mx - - # We use a different prefix before nested lists than top-level lists. - # See extended comment in _ProcessListItems(). - - if ($this->list_level) { - $text = preg_replace_callback('{ - ^ - '.$whole_list_re.' - }mx', - array(&$this, '_doLists_callback'), $text); - } - else { - $text = preg_replace_callback('{ - (?:(?<=\n)\n|\A\n?) # Must eat the newline - '.$whole_list_re.' - }mx', - array(&$this, '_doLists_callback'), $text); - } - } - - return $text; - } - function _doLists_callback($matches) { - # Re-usable patterns to match list item bullets and number markers: - $marker_ul_re = '[*+-]'; - $marker_ol_re = '\d+[.]'; - $marker_any_re = "(?:$marker_ul_re|$marker_ol_re)"; - - $list = $matches[1]; - $list_type = preg_match("/$marker_ul_re/", $matches[4]) ? "ul" : "ol"; - - $marker_any_re = ( $list_type == "ul" ? $marker_ul_re : $marker_ol_re ); - - $list .= "\n"; - $result = $this->processListItems($list, $marker_any_re); - - $result = $this->hashBlock("<$list_type>\n" . $result . ""); - return "\n". $result ."\n\n"; - } - - var $list_level = 0; - - function processListItems($list_str, $marker_any_re) { - # - # Process the contents of a single ordered or unordered list, splitting it - # into individual list items. - # - # The $this->list_level global keeps track of when we're inside a list. - # Each time we enter a list, we increment it; when we leave a list, - # we decrement. If it's zero, we're not in a list anymore. - # - # We do this because when we're not inside a list, we want to treat - # something like this: - # - # I recommend upgrading to version - # 8. Oops, now this line is treated - # as a sub-list. - # - # As a single paragraph, despite the fact that the second line starts - # with a digit-period-space sequence. - # - # Whereas when we're inside a list (or sub-list), that line will be - # treated as the start of a sub-list. What a kludge, huh? This is - # an aspect of Markdown's syntax that's hard to parse perfectly - # without resorting to mind-reading. Perhaps the solution is to - # change the syntax rules such that sub-lists must start with a - # starting cardinal number; e.g. "1." or "a.". - - $this->list_level++; - - # trim trailing blank lines: - $list_str = preg_replace("/\n{2,}\\z/", "\n", $list_str); - - $list_str = preg_replace_callback('{ - (\n)? # leading line = $1 - (^[ ]*) # leading whitespace = $2 - ('.$marker_any_re.' # list marker and space = $3 - (?:[ ]+|(?=\n)) # space only required if item is not empty - ) - ((?s:.*?)) # list item text = $4 - (?:(\n+(?=\n))|\n) # tailing blank line = $5 - (?= \n* (\z | \2 ('.$marker_any_re.') (?:[ ]+|(?=\n)))) - }xm', - array(&$this, '_processListItems_callback'), $list_str); - - $this->list_level--; - return $list_str; - } - function _processListItems_callback($matches) { - $item = $matches[4]; - $leading_line =& $matches[1]; - $leading_space =& $matches[2]; - $marker_space = $matches[3]; - $tailing_blank_line =& $matches[5]; - - if ($leading_line || $tailing_blank_line || - preg_match('/\n{2,}/', $item)) - { - # Replace marker with the appropriate whitespace indentation - $item = $leading_space . str_repeat(' ', strlen($marker_space)) . $item; - $item = $this->runBlockGamut($this->outdent($item)."\n"); - } - else { - # Recursion for sub-lists: - $item = $this->doLists($this->outdent($item)); - $item = preg_replace('/\n+$/', '', $item); - $item = $this->runSpanGamut($item); - } - - return "
  • " . $item . "
  • \n"; - } - - - function doCodeBlocks($text) { - # - # Process Markdown `
    ` blocks.
    -	#
    -		$text = preg_replace_callback('{
    -				(?:\n\n|\A\n?)
    -				(	            # $1 = the code block -- one or more lines, starting with a space/tab
    -				  (?>
    -					[ ]{'.$this->tab_width.'}  # Lines must start with a tab or a tab-width of spaces
    -					.*\n+
    -				  )+
    -				)
    -				((?=^[ ]{0,'.$this->tab_width.'}\S)|\Z)	# Lookahead for non-space at line-start, or end of doc
    -			}xm',
    -			array(&$this, '_doCodeBlocks_callback'), $text);
    -
    -		return $text;
    -	}
    -	function _doCodeBlocks_callback($matches) {
    -		$codeblock = $matches[1];
    -
    -		$codeblock = $this->outdent($codeblock);
    -		$codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES);
    -
    -		# trim leading newlines and trailing newlines
    -		$codeblock = preg_replace('/\A\n+|\n+\z/', '', $codeblock);
    -
    -		$codeblock = "
    $codeblock\n
    "; - return "\n\n".$this->hashBlock($codeblock)."\n\n"; - } - - - function makeCodeSpan($code) { - # - # Create a code span markup for $code. Called from handleSpanToken. - # - $code = htmlspecialchars(trim($code), ENT_NOQUOTES); - return $this->hashPart("$code"); - } - - - var $em_relist = array( - '' => '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(?em_relist as $em => $em_re) { - foreach ($this->strong_relist as $strong => $strong_re) { - # Construct list of allowed token expressions. - $token_relist = array(); - if (isset($this->em_strong_relist["$em$strong"])) { - $token_relist[] = $this->em_strong_relist["$em$strong"]; - } - $token_relist[] = $em_re; - $token_relist[] = $strong_re; - - # Construct master expression from list. - $token_re = '{('. implode('|', $token_relist) .')}'; - $this->em_strong_prepared_relist["$em$strong"] = $token_re; - } - } - } - - function doItalicsAndBold($text) { - $token_stack = array(''); - $text_stack = array(''); - $em = ''; - $strong = ''; - $tree_char_em = false; - - while (1) { - # - # Get prepared regular expression for seraching emphasis tokens - # in current context. - # - $token_re = $this->em_strong_prepared_relist["$em$strong"]; - - # - # Each loop iteration search for the next emphasis token. - # Each token is then passed to handleSpanToken. - # - $parts = preg_split($token_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE); - $text_stack[0] .= $parts[0]; - $token =& $parts[1]; - $text =& $parts[2]; - - if (empty($token)) { - # Reached end of text span: empty stack without emitting. - # any more emphasis. - while ($token_stack[0]) { - $text_stack[1] .= array_shift($token_stack); - $text_stack[0] .= array_shift($text_stack); - } - break; - } - - $token_len = strlen($token); - if ($tree_char_em) { - # Reached closing marker while inside a three-char emphasis. - if ($token_len == 3) { - # Three-char closing marker, close em and strong. - array_shift($token_stack); - $span = array_shift($text_stack); - $span = $this->runSpanGamut($span); - $span = "$span"; - $text_stack[0] .= $this->hashPart($span); - $em = ''; - $strong = ''; - } else { - # Other closing marker: close one em or strong and - # change current token state to match the other - $token_stack[0] = str_repeat($token{0}, 3-$token_len); - $tag = $token_len == 2 ? "strong" : "em"; - $span = $text_stack[0]; - $span = $this->runSpanGamut($span); - $span = "<$tag>$span"; - $text_stack[0] = $this->hashPart($span); - $$tag = ''; # $$tag stands for $em or $strong - } - $tree_char_em = false; - } else if ($token_len == 3) { - if ($em) { - # Reached closing marker for both em and strong. - # Closing strong marker: - for ($i = 0; $i < 2; ++$i) { - $shifted_token = array_shift($token_stack); - $tag = strlen($shifted_token) == 2 ? "strong" : "em"; - $span = array_shift($text_stack); - $span = $this->runSpanGamut($span); - $span = "<$tag>$span"; - $text_stack[0] .= $this->hashPart($span); - $$tag = ''; # $$tag stands for $em or $strong - } - } else { - # Reached opening three-char emphasis marker. Push on token - # stack; will be handled by the special condition above. - $em = $token{0}; - $strong = "$em$em"; - array_unshift($token_stack, $token); - array_unshift($text_stack, ''); - $tree_char_em = true; - } - } else if ($token_len == 2) { - if ($strong) { - # Unwind any dangling emphasis marker: - if (strlen($token_stack[0]) == 1) { - $text_stack[1] .= array_shift($token_stack); - $text_stack[0] .= array_shift($text_stack); - } - # Closing strong marker: - array_shift($token_stack); - $span = array_shift($text_stack); - $span = $this->runSpanGamut($span); - $span = "$span"; - $text_stack[0] .= $this->hashPart($span); - $strong = ''; - } else { - array_unshift($token_stack, $token); - array_unshift($text_stack, ''); - $strong = $token; - } - } else { - # Here $token_len == 1 - if ($em) { - if (strlen($token_stack[0]) == 1) { - # Closing emphasis marker: - array_shift($token_stack); - $span = array_shift($text_stack); - $span = $this->runSpanGamut($span); - $span = "$span"; - $text_stack[0] .= $this->hashPart($span); - $em = ''; - } else { - $text_stack[0] .= $token; - } - } else { - array_unshift($token_stack, $token); - array_unshift($text_stack, ''); - $em = $token; - } - } - } - return $text_stack[0]; - } - - - function doBlockQuotes($text) { - $text = preg_replace_callback('/ - ( # Wrap whole match in $1 - (?> - ^[ ]*>[ ]? # ">" at the start of a line - .+\n # rest of the first line - (.+\n)* # subsequent consecutive lines - \n* # blanks - )+ - ) - /xm', - array(&$this, '_doBlockQuotes_callback'), $text); - - return $text; - } - function _doBlockQuotes_callback($matches) { - $bq = $matches[1]; - # trim one level of quoting - trim whitespace-only lines - $bq = preg_replace('/^[ ]*>[ ]?|^[ ]+$/m', '', $bq); - $bq = $this->runBlockGamut($bq); # recurse - - $bq = preg_replace('/^/m', " ", $bq); - # These leading spaces cause problem with
     content, 
    -		# so we need to fix that:
    -		$bq = preg_replace_callback('{(\s*
    .+?
    )}sx', - array(&$this, '_doBlockQuotes_callback2'), $bq); - - return "\n". $this->hashBlock("
    \n$bq\n
    ")."\n\n"; - } - function _doBlockQuotes_callback2($matches) { - $pre = $matches[1]; - $pre = preg_replace('/^ /m', '', $pre); - return $pre; - } - - - function formParagraphs($text) { - # - # Params: - # $text - string to process with html

    tags - # - # Strip leading and trailing lines: - $text = preg_replace('/\A\n+|\n+\z/', '', $text); - - $grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY); - - # - # Wrap

    tags and unhashify HTML blocks - # - foreach ($grafs as $key => $value) { - if (!preg_match('/^B\x1A[0-9]+B$/', $value)) { - # Is a paragraph. - $value = $this->runSpanGamut($value); - $value = preg_replace('/^([ ]*)/', "

    ", $value); - $value .= "

    "; - $grafs[$key] = $this->unhash($value); - } - else { - # Is a block. - # Modify elements of @grafs in-place... - $graf = $value; - $block = $this->html_hashes[$graf]; - $graf = $block; -// if (preg_match('{ -// \A -// ( # $1 =
    tag -//
    ]* -// \b -// markdown\s*=\s* ([\'"]) # $2 = attr quote char -// 1 -// \2 -// [^>]* -// > -// ) -// ( # $3 = contents -// .* -// ) -// (
    ) # $4 = closing tag -// \z -// }xs', $block, $matches)) -// { -// list(, $div_open, , $div_content, $div_close) = $matches; + # Regex to match balanced [brackets]. + # Needed to insert a maximum bracked depth while converting to PHP. + var $nested_brackets_depth = 6; + var $nested_brackets_re; + + var $nested_url_parenthesis_depth = 4; + var $nested_url_parenthesis_re; + + # Table of hash values for escaped characters: + var $escape_chars = '\`*_{}[]()>#+-.!'; + var $escape_chars_re; + + # Change to ">" for HTML output. + var $empty_element_suffix = MARKDOWN_EMPTY_ELEMENT_SUFFIX; + var $tab_width = MARKDOWN_TAB_WIDTH; + + # Change to `true` to disallow markup or entities. + var $no_markup = false; + var $no_entities = false; + + # Predefined urls and titles for reference links and images. + var $predef_urls = array(); + var $predef_titles = array(); + + + function Markdown_Parser() { + # + # Constructor function. Initialize appropriate member variables. + # + $this->_initDetab(); + $this->prepareItalicsAndBold(); + + $this->nested_brackets_re = + str_repeat('(?>[^\[\]]+|\[', $this->nested_brackets_depth). + str_repeat('\])*', $this->nested_brackets_depth); + + $this->nested_url_parenthesis_re = + str_repeat('(?>[^()\s]+|\(', $this->nested_url_parenthesis_depth). + str_repeat('(?>\)))*', $this->nested_url_parenthesis_depth); + + $this->escape_chars_re = '['.preg_quote($this->escape_chars).']'; + + # Sort document, block, and span gamut in ascendent priority order. + asort($this->document_gamut); + asort($this->block_gamut); + asort($this->span_gamut); + } + + + # Internal hashes used during transformation. + var $urls = array(); + var $titles = array(); + var $html_hashes = array(); + + # Status flag to avoid invalid nesting. + var $in_anchor = false; + + + function setup() { + # + # Called before the transformation process starts to setup parser + # states. + # + # Clear global hashes. + $this->urls = $this->predef_urls; + $this->titles = $this->predef_titles; + $this->html_hashes = array(); + + $in_anchor = false; + } + + function teardown() { + # + # Called after the transformation process to clear any variable + # which may be taking up memory unnecessarly. + # + $this->urls = array(); + $this->titles = array(); + $this->html_hashes = array(); + } + + + function transform($text) { + # + # Main function. Performs some preprocessing on the input text + # and pass it through the document gamut. + # + $this->setup(); + + # Remove UTF-8 BOM and marker character in input, if present. + $text = preg_replace('{^\xEF\xBB\xBF|\x1A}', '', $text); + + # Standardize line endings: + # DOS to Unix and Mac to Unix + $text = preg_replace('{\r\n?}', "\n", $text); + + # Make sure $text ends with a couple of newlines: + $text .= "\n\n"; + + # Convert all tabs to spaces. + $text = $this->detab($text); + + # Turn block-level HTML blocks into hash entries + $text = $this->hashHTMLBlocks($text); + + # Strip any lines consisting only of spaces and tabs. + # This makes subsequent regexen easier to write, because we can + # match consecutive blank lines with /\n+/ instead of something + # contorted like /[ ]*\n+/ . + $text = preg_replace('/^[ ]+$/m', '', $text); + + # Run document gamut methods. + foreach ($this->document_gamut as $method => $priority) { + $text = $this->$method($text); + } + + $this->teardown(); + + return $text . "\n"; + } + + var $document_gamut = array( + # Strip link definitions, store in hashes. + "stripLinkDefinitions" => 20, + + "runBasicBlockGamut" => 30, + ); + + + function stripLinkDefinitions($text) { + # + # Strips link definitions from text, stores the URLs and titles in + # hash references. + # + $less_than_tab = $this->tab_width - 1; + + # Link defs are in the form: ^[id]: url "optional title" + $text = preg_replace_callback('{ + ^[ ]{0,'.$less_than_tab.'}\[(.+)\][ ]?: # id = $1 + [ ]* + \n? # maybe *one* newline + [ ]* + (?: + <(.+?)> # url = $2 + | + (\S+?) # url = $3 + ) + [ ]* + \n? # maybe one newline + [ ]* + (?: + (?<=\s) # lookbehind for whitespace + ["(] + (.*?) # title = $4 + [")] + [ ]* + )? # title is optional + (?:\n+|\Z) + }xm', + array(&$this, '_stripLinkDefinitions_callback'), + $text); + return $text; + } + function _stripLinkDefinitions_callback($matches) { + $link_id = strtolower($matches[1]); + $url = $matches[2] == '' ? $matches[3] : $matches[2]; + $this->urls[$link_id] = $url; + $this->titles[$link_id] =& $matches[4]; + return ''; # String that will replace the block + } + + + function hashHTMLBlocks($text) { + if ($this->no_markup) return $text; + + $less_than_tab = $this->tab_width - 1; + + # Hashify HTML blocks: + # We only want to do this for block-level HTML tags, such as headers, + # lists, and tables. That's because we still want to wrap

    s around + # "paragraphs" that are wrapped in non-block-level tags, such as anchors, + # phrase emphasis, and spans. The list of tags we're looking for is + # hard-coded: + # + # * List "a" is made of tags which can be both inline or block-level. + # These will be treated block-level when the start tag is alone on + # its line, otherwise they're not matched here and will be taken as + # inline later. + # * List "b" is made of tags which are always block-level; + # + $block_tags_a_re = 'ins|del'; + $block_tags_b_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|'. + 'script|noscript|form|fieldset|iframe|math'; + + # Regular expression for the content of a block tag. + $nested_tags_level = 4; + $attr = ' + (?> # optional tag attributes + \s # starts with whitespace + (?> + [^>"/]+ # text outside quotes + | + /+(?!>) # slash not followed by ">" + | + "[^"]*" # text inside double quotes (tolerate ">") + | + \'[^\']*\' # text inside single quotes (tolerate ">") + )* + )? + '; + $content = + str_repeat(' + (?> + [^<]+ # content without tag + | + <\2 # nested opening tag + '.$attr.' # attributes + (?> + /> + | + >', $nested_tags_level). # end of opening tag + '.*?'. # last level nested tag content + str_repeat(' + # closing nested tag + ) + | + <(?!/\2\s*> # other tags with a different name + ) + )*', + $nested_tags_level); + $content2 = str_replace('\2', '\3', $content); + + # First, look for nested blocks, e.g.: + #

    + #
    + # tags for inner block must be indented. + #
    + #
    + # + # The outermost tags must start at the left margin for this to match, and + # the inner nested divs must be indented. + # We need to do this before the next, more liberal match, because the next + # match will start at the first `
    ` and stop at the first `
    `. + $text = preg_replace_callback('{(?> + (?> + (?<=\n\n) # Starting after a blank line + | # or + \A\n? # the beginning of the doc + ) + ( # save in $1 + + # Match from `\n` to `\n`, handling nested tags + # in between. + + [ ]{0,'.$less_than_tab.'} + <('.$block_tags_b_re.')# start tag = $2 + '.$attr.'> # attributes followed by > and \n + '.$content.' # content, support nesting + # the matching end tag + [ ]* # trailing spaces/tabs + (?=\n+|\Z) # followed by a newline or end of document + + | # Special version for tags of group a. + + [ ]{0,'.$less_than_tab.'} + <('.$block_tags_a_re.')# start tag = $3 + '.$attr.'>[ ]*\n # attributes followed by > + '.$content2.' # content, support nesting + # the matching end tag + [ ]* # trailing spaces/tabs + (?=\n+|\Z) # followed by a newline or end of document + + | # Special case just for
    . It was easier to make a special + # case than to make the other regex more complicated. + + [ ]{0,'.$less_than_tab.'} + <(hr) # start tag = $2 + '.$attr.' # attributes + /?> # the matching end tag + [ ]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + + | # Special case for standalone HTML comments: + + [ ]{0,'.$less_than_tab.'} + (?s: + + ) + [ ]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + + | # PHP and ASP-style processor instructions ( + ) + [ ]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + + ) + )}Sxmi', + array(&$this, '_hashHTMLBlocks_callback'), + $text); + + return $text; + } + function _hashHTMLBlocks_callback($matches) { + $text = $matches[1]; + $key = $this->hashBlock($text); + return "\n\n$key\n\n"; + } + + + function hashPart($text, $boundary = 'X') { + # + # Called whenever a tag must be hashed when a function insert an atomic + # element in the text stream. Passing $text to through this function gives + # a unique text-token which will be reverted back when calling unhash. + # + # The $boundary argument specify what character should be used to surround + # the token. By convension, "B" is used for block elements that needs not + # to be wrapped into paragraph tags at the end, ":" is used for elements + # that are word separators and "X" is used in the general case. + # + # Swap back any tag hash found in $text so we do not have to `unhash` + # multiple times at the end. + $text = $this->unhash($text); + + # Then hash the block. + static $i = 0; + $key = "$boundary\x1A" . ++$i . $boundary; + $this->html_hashes[$key] = $text; + return $key; # String that will replace the tag. + } + + + function hashBlock($text) { + # + # Shortcut function for hashPart with block-level boundaries. + # + return $this->hashPart($text, 'B'); + } + + + var $block_gamut = array( + # + # These are all the transformations that form block-level + # tags like paragraphs, headers, and list items. + # + "doHeaders" => 10, + "doHorizontalRules" => 20, + + "doLists" => 40, + "doCodeBlocks" => 50, + "doBlockQuotes" => 60, + ); + + function runBlockGamut($text) { + # + # Run block gamut tranformations. + # + # We need to escape raw HTML in Markdown source before doing anything + # else. This need to be done for each block, and not only at the + # begining in the Markdown function since hashed blocks can be part of + # list items and could have been indented. Indented blocks would have + # been seen as a code block in a previous pass of hashHTMLBlocks. + $text = $this->hashHTMLBlocks($text); + + return $this->runBasicBlockGamut($text); + } + + function runBasicBlockGamut($text) { + # + # Run block gamut tranformations, without hashing HTML blocks. This is + # useful when HTML blocks are known to be already hashed, like in the first + # whole-document pass. + # + foreach ($this->block_gamut as $method => $priority) { + $text = $this->$method($text); + } + + # Finally form paragraph and restore hashed blocks. + $text = $this->formParagraphs($text); + + return $text; + } + + + function doHorizontalRules($text) { + # Do Horizontal Rules: + return preg_replace( + '{ + ^[ ]{0,3} # Leading space + ([-*_]) # $1: First marker + (?> # Repeated marker group + [ ]{0,2} # Zero, one, or two spaces. + \1 # Marker character + ){2,} # Group repeated at least twice + [ ]* # Tailing spaces + $ # End of line. + }mx', + "\n".$this->hashBlock("empty_element_suffix")."\n", + $text); + } + + + var $span_gamut = array( + # + # These are all the transformations that occur *within* block-level + # tags like paragraphs, headers, and list items. + # + # Process character escapes, code spans, and inline HTML + # in one shot. + "parseSpan" => -30, + + # Process anchor and image tags. Images must come first, + # because ![foo][f] looks like an anchor. + "doImages" => 10, + "doAnchors" => 20, + + # Make links out of things like `` + # Must come after doAnchors, because you can use < and > + # delimiters in inline links like [this](). + "doAutoLinks" => 30, + "encodeAmpsAndAngles" => 40, + + "doItalicsAndBold" => 50, + "doHardBreaks" => 60, + ); + + function runSpanGamut($text) { + # + # Run span gamut tranformations. + # + foreach ($this->span_gamut as $method => $priority) { + $text = $this->$method($text); + } + + return $text; + } + + + function doHardBreaks($text) { + # Do hard breaks: + return preg_replace_callback('/ {2,}\n/', + array(&$this, '_doHardBreaks_callback'), $text); + } + function _doHardBreaks_callback($matches) { + return $this->hashPart("empty_element_suffix\n"); + } + + + function doAnchors($text) { + # + # Turn Markdown link shortcuts into XHTML tags. + # + if ($this->in_anchor) return $text; + $this->in_anchor = true; + + # + # First, handle reference-style links: [link text] [id] + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ('.$this->nested_brackets_re.') # link text = $2 + \] + + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + + \[ + (.*?) # id = $3 + \] + ) + }xs', + array(&$this, '_doAnchors_reference_callback'), $text); + + # + # Next, inline-style links: [link text](url "optional title") + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ('.$this->nested_brackets_re.') # link text = $2 + \] + \( # literal paren + [ \n]* + (?: + <(.+?)> # href = $3 + | + ('.$this->nested_url_parenthesis_re.') # href = $4 + ) + [ \n]* + ( # $5 + ([\'"]) # quote char = $6 + (.*?) # Title = $7 + \6 # matching quote + [ \n]* # ignore any spaces/tabs between closing quote and ) + )? # title is optional + \) + ) + }xs', + array(&$this, '_doAnchors_inline_callback'), $text); + + # + # Last, handle reference-style shortcuts: [link text] + # These must come last in case you've also got [link text][1] + # or [link text](/foo) + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ([^\[\]]+) # link text = $2; can\'t contain [ or ] + \] + ) + }xs', + array(&$this, '_doAnchors_reference_callback'), $text); + + $this->in_anchor = false; + return $text; + } + function _doAnchors_reference_callback($matches) { + $whole_match = $matches[1]; + $link_text = $matches[2]; + $link_id =& $matches[3]; + + if ($link_id == "") { + # for shortcut links like [this][] or [this]. + $link_id = $link_text; + } + + # lower-case and turn embedded newlines into spaces + $link_id = strtolower($link_id); + $link_id = preg_replace('{[ ]?\n}', ' ', $link_id); + + if (isset($this->urls[$link_id])) { + $url = $this->urls[$link_id]; + $url = $this->encodeAttribute($url); + + $result = "titles[$link_id] ) ) { + $title = $this->titles[$link_id]; + $title = $this->encodeAttribute($title); + $result .= " title=\"$title\""; + } + + $link_text = $this->runSpanGamut($link_text); + $result .= ">$link_text"; + $result = $this->hashPart($result); + } + else { + $result = $whole_match; + } + return $result; + } + function _doAnchors_inline_callback($matches) { + $whole_match = $matches[1]; + $link_text = $this->runSpanGamut($matches[2]); + $url = $matches[3] == '' ? $matches[4] : $matches[3]; + $title =& $matches[7]; + + $url = $this->encodeAttribute($url); + + $result = "encodeAttribute($title); + $result .= " title=\"$title\""; + } + + $link_text = $this->runSpanGamut($link_text); + $result .= ">$link_text"; + + return $this->hashPart($result); + } + + + function doImages($text) { + # + # Turn Markdown image shortcuts into tags. + # + # + # First, handle reference-style labeled images: ![alt text][id] + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + !\[ + ('.$this->nested_brackets_re.') # alt text = $2 + \] + + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + + \[ + (.*?) # id = $3 + \] + + ) + }xs', + array(&$this, '_doImages_reference_callback'), $text); + + # + # Next, handle inline images: ![alt text](url "optional title") + # Don't forget: encode * and _ + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + !\[ + ('.$this->nested_brackets_re.') # alt text = $2 + \] + \s? # One optional whitespace character + \( # literal paren + [ \n]* + (?: + <(\S*)> # src url = $3 + | + ('.$this->nested_url_parenthesis_re.') # src url = $4 + ) + [ \n]* + ( # $5 + ([\'"]) # quote char = $6 + (.*?) # title = $7 + \6 # matching quote + [ \n]* + )? # title is optional + \) + ) + }xs', + array(&$this, '_doImages_inline_callback'), $text); + + return $text; + } + function _doImages_reference_callback($matches) { + $whole_match = $matches[1]; + $alt_text = $matches[2]; + $link_id = strtolower($matches[3]); + + if ($link_id == "") { + $link_id = strtolower($alt_text); # for shortcut links like ![this][]. + } + + $alt_text = $this->encodeAttribute($alt_text); + if (isset($this->urls[$link_id])) { + $url = $this->encodeAttribute($this->urls[$link_id]); + $result = "\"$alt_text\"";titles[$link_id])) { + $title = $this->titles[$link_id]; + $title = $this->encodeAttribute($title); + $result .= " title=\"$title\""; + } + $result .= $this->empty_element_suffix; + $result = $this->hashPart($result); + } + else { + # If there's no such link ID, leave intact: + $result = $whole_match; + } + + return $result; + } + function _doImages_inline_callback($matches) { + $whole_match = $matches[1]; + $alt_text = $matches[2]; + $url = $matches[3] == '' ? $matches[4] : $matches[3]; + $title =& $matches[7]; + + $alt_text = $this->encodeAttribute($alt_text); + $url = $this->encodeAttribute($url); + $result = "\"$alt_text\"";encodeAttribute($title); + $result .= " title=\"$title\""; # $title already quoted + } + $result .= $this->empty_element_suffix; + + return $this->hashPart($result); + } + + + function doHeaders($text) { + # Setext-style headers: + # Header 1 + # ======== + # + # Header 2 + # -------- + # + $text = preg_replace_callback('{ ^(.+?)[ ]*\n(=+|-+)[ ]*\n+ }mx', + array(&$this, '_doHeaders_callback_setext'), $text); + + # atx-style headers: + # # Header 1 + # ## Header 2 + # ## Header 2 with closing hashes ## + # ... + # ###### Header 6 + # + $text = preg_replace_callback('{ + ^(\#{1,6}) # $1 = string of #\'s + [ ]* + (.+?) # $2 = Header text + [ ]* + \#* # optional closing #\'s (not counted) + \n+ + }xm', + array(&$this, '_doHeaders_callback_atx'), $text); + + return $text; + } + function _doHeaders_callback_setext($matches) { + # Terrible hack to check we haven't found an empty list item. + if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1])) + return $matches[0]; + + $level = $matches[2]{0} == '=' ? 1 : 2; + $block = "".$this->runSpanGamut($matches[1]).""; + return "\n" . $this->hashBlock($block) . "\n\n"; + } + function _doHeaders_callback_atx($matches) { + $level = strlen($matches[1]); + $block = "".$this->runSpanGamut($matches[2]).""; + return "\n" . $this->hashBlock($block) . "\n\n"; + } + + + function doLists($text) { + # + # Form HTML ordered (numbered) and unordered (bulleted) lists. + # + $less_than_tab = $this->tab_width - 1; + + # Re-usable patterns to match list item bullets and number markers: + $marker_ul_re = '[*+-]'; + $marker_ol_re = '\d+[.]'; + $marker_any_re = "(?:$marker_ul_re|$marker_ol_re)"; + + $markers_relist = array( + $marker_ul_re => $marker_ol_re, + $marker_ol_re => $marker_ul_re, + ); + + foreach ($markers_relist as $marker_re => $other_marker_re) { + # Re-usable pattern to match any entirel ul or ol list: + $whole_list_re = ' + ( # $1 = whole list + ( # $2 + ([ ]{0,'.$less_than_tab.'}) # $3 = number of spaces + ('.$marker_re.') # $4 = first list item marker + [ ]+ + ) + (?s:.+?) + ( # $5 + \z + | + \n{2,} + (?=\S) + (?! # Negative lookahead for another list item marker + [ ]* + '.$marker_re.'[ ]+ + ) + | + (?= # Lookahead for another kind of list + \n + \3 # Must have the same indentation + '.$other_marker_re.'[ ]+ + ) + ) + ) + '; // mx + + # We use a different prefix before nested lists than top-level lists. + # See extended comment in _ProcessListItems(). + + if ($this->list_level) { + $text = preg_replace_callback('{ + ^ + '.$whole_list_re.' + }mx', + array(&$this, '_doLists_callback'), $text); + } + else { + $text = preg_replace_callback('{ + (?:(?<=\n)\n|\A\n?) # Must eat the newline + '.$whole_list_re.' + }mx', + array(&$this, '_doLists_callback'), $text); + } + } + + return $text; + } + function _doLists_callback($matches) { + # Re-usable patterns to match list item bullets and number markers: + $marker_ul_re = '[*+-]'; + $marker_ol_re = '\d+[.]'; + $marker_any_re = "(?:$marker_ul_re|$marker_ol_re)"; + + $list = $matches[1]; + $list_type = preg_match("/$marker_ul_re/", $matches[4]) ? "ul" : "ol"; + + $marker_any_re = ( $list_type == "ul" ? $marker_ul_re : $marker_ol_re ); + + $list .= "\n"; + $result = $this->processListItems($list, $marker_any_re); + + $result = $this->hashBlock("<$list_type>\n" . $result . ""); + return "\n". $result ."\n\n"; + } + + var $list_level = 0; + + function processListItems($list_str, $marker_any_re) { + # + # Process the contents of a single ordered or unordered list, splitting it + # into individual list items. + # + # The $this->list_level global keeps track of when we're inside a list. + # Each time we enter a list, we increment it; when we leave a list, + # we decrement. If it's zero, we're not in a list anymore. + # + # We do this because when we're not inside a list, we want to treat + # something like this: + # + # I recommend upgrading to version + # 8. Oops, now this line is treated + # as a sub-list. + # + # As a single paragraph, despite the fact that the second line starts + # with a digit-period-space sequence. + # + # Whereas when we're inside a list (or sub-list), that line will be + # treated as the start of a sub-list. What a kludge, huh? This is + # an aspect of Markdown's syntax that's hard to parse perfectly + # without resorting to mind-reading. Perhaps the solution is to + # change the syntax rules such that sub-lists must start with a + # starting cardinal number; e.g. "1." or "a.". + + $this->list_level++; + + # trim trailing blank lines: + $list_str = preg_replace("/\n{2,}\\z/", "\n", $list_str); + + $list_str = preg_replace_callback('{ + (\n)? # leading line = $1 + (^[ ]*) # leading whitespace = $2 + ('.$marker_any_re.' # list marker and space = $3 + (?:[ ]+|(?=\n)) # space only required if item is not empty + ) + ((?s:.*?)) # list item text = $4 + (?:(\n+(?=\n))|\n) # tailing blank line = $5 + (?= \n* (\z | \2 ('.$marker_any_re.') (?:[ ]+|(?=\n)))) + }xm', + array(&$this, '_processListItems_callback'), $list_str); + + $this->list_level--; + return $list_str; + } + function _processListItems_callback($matches) { + $item = $matches[4]; + $leading_line =& $matches[1]; + $leading_space =& $matches[2]; + $marker_space = $matches[3]; + $tailing_blank_line =& $matches[5]; + + if ($leading_line || $tailing_blank_line || + preg_match('/\n{2,}/', $item)) + { + # Replace marker with the appropriate whitespace indentation + $item = $leading_space . str_repeat(' ', strlen($marker_space)) . $item; + $item = $this->runBlockGamut($this->outdent($item)."\n"); + } + else { + # Recursion for sub-lists: + $item = $this->doLists($this->outdent($item)); + $item = preg_replace('/\n+$/', '', $item); + $item = $this->runSpanGamut($item); + } + + return "
  • " . $item . "
  • \n"; + } + + + function doCodeBlocks($text) { + # + # Process Markdown `
    ` blocks.
    +    #
    +        $text = preg_replace_callback('{
    +                (?:\n\n|\A\n?)
    +                (                # $1 = the code block -- one or more lines, starting with a space/tab
    +                  (?>
    +                    [ ]{'.$this->tab_width.'}  # Lines must start with a tab or a tab-width of spaces
    +                    .*\n+
    +                  )+
    +                )
    +                ((?=^[ ]{0,'.$this->tab_width.'}\S)|\Z)    # Lookahead for non-space at line-start, or end of doc
    +            }xm',
    +            array(&$this, '_doCodeBlocks_callback'), $text);
    +
    +        return $text;
    +    }
    +    function _doCodeBlocks_callback($matches) {
    +        $codeblock = $matches[1];
    +
    +        $codeblock = $this->outdent($codeblock);
    +        $codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES);
    +
    +        # trim leading newlines and trailing newlines
    +        $codeblock = preg_replace('/\A\n+|\n+\z/', '', $codeblock);
    +
    +        $codeblock = "
    $codeblock\n
    "; + return "\n\n".$this->hashBlock($codeblock)."\n\n"; + } + + + function makeCodeSpan($code) { + # + # Create a code span markup for $code. Called from handleSpanToken. + # + $code = htmlspecialchars(trim($code), ENT_NOQUOTES); + return $this->hashPart("$code"); + } + + + var $em_relist = array( + '' => '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(?em_relist as $em => $em_re) { + foreach ($this->strong_relist as $strong => $strong_re) { + # Construct list of allowed token expressions. + $token_relist = array(); + if (isset($this->em_strong_relist["$em$strong"])) { + $token_relist[] = $this->em_strong_relist["$em$strong"]; + } + $token_relist[] = $em_re; + $token_relist[] = $strong_re; + + # Construct master expression from list. + $token_re = '{('. implode('|', $token_relist) .')}'; + $this->em_strong_prepared_relist["$em$strong"] = $token_re; + } + } + } + + function doItalicsAndBold($text) { + $token_stack = array(''); + $text_stack = array(''); + $em = ''; + $strong = ''; + $tree_char_em = false; + + while (1) { + # + # Get prepared regular expression for seraching emphasis tokens + # in current context. + # + $token_re = $this->em_strong_prepared_relist["$em$strong"]; + + # + # Each loop iteration search for the next emphasis token. + # Each token is then passed to handleSpanToken. + # + $parts = preg_split($token_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE); + $text_stack[0] .= $parts[0]; + $token =& $parts[1]; + $text =& $parts[2]; + + if (empty($token)) { + # Reached end of text span: empty stack without emitting. + # any more emphasis. + while ($token_stack[0]) { + $text_stack[1] .= array_shift($token_stack); + $text_stack[0] .= array_shift($text_stack); + } + break; + } + + $token_len = strlen($token); + if ($tree_char_em) { + # Reached closing marker while inside a three-char emphasis. + if ($token_len == 3) { + # Three-char closing marker, close em and strong. + array_shift($token_stack); + $span = array_shift($text_stack); + $span = $this->runSpanGamut($span); + $span = "$span"; + $text_stack[0] .= $this->hashPart($span); + $em = ''; + $strong = ''; + } else { + # Other closing marker: close one em or strong and + # change current token state to match the other + $token_stack[0] = str_repeat($token{0}, 3-$token_len); + $tag = $token_len == 2 ? "strong" : "em"; + $span = $text_stack[0]; + $span = $this->runSpanGamut($span); + $span = "<$tag>$span"; + $text_stack[0] = $this->hashPart($span); + $$tag = ''; # $$tag stands for $em or $strong + } + $tree_char_em = false; + } else if ($token_len == 3) { + if ($em) { + # Reached closing marker for both em and strong. + # Closing strong marker: + for ($i = 0; $i < 2; ++$i) { + $shifted_token = array_shift($token_stack); + $tag = strlen($shifted_token) == 2 ? "strong" : "em"; + $span = array_shift($text_stack); + $span = $this->runSpanGamut($span); + $span = "<$tag>$span"; + $text_stack[0] .= $this->hashPart($span); + $$tag = ''; # $$tag stands for $em or $strong + } + } else { + # Reached opening three-char emphasis marker. Push on token + # stack; will be handled by the special condition above. + $em = $token{0}; + $strong = "$em$em"; + array_unshift($token_stack, $token); + array_unshift($text_stack, ''); + $tree_char_em = true; + } + } else if ($token_len == 2) { + if ($strong) { + # Unwind any dangling emphasis marker: + if (strlen($token_stack[0]) == 1) { + $text_stack[1] .= array_shift($token_stack); + $text_stack[0] .= array_shift($text_stack); + } + # Closing strong marker: + array_shift($token_stack); + $span = array_shift($text_stack); + $span = $this->runSpanGamut($span); + $span = "$span"; + $text_stack[0] .= $this->hashPart($span); + $strong = ''; + } else { + array_unshift($token_stack, $token); + array_unshift($text_stack, ''); + $strong = $token; + } + } else { + # Here $token_len == 1 + if ($em) { + if (strlen($token_stack[0]) == 1) { + # Closing emphasis marker: + array_shift($token_stack); + $span = array_shift($text_stack); + $span = $this->runSpanGamut($span); + $span = "$span"; + $text_stack[0] .= $this->hashPart($span); + $em = ''; + } else { + $text_stack[0] .= $token; + } + } else { + array_unshift($token_stack, $token); + array_unshift($text_stack, ''); + $em = $token; + } + } + } + return $text_stack[0]; + } + + + function doBlockQuotes($text) { + $text = preg_replace_callback('/ + ( # Wrap whole match in $1 + (?> + ^[ ]*>[ ]? # ">" at the start of a line + .+\n # rest of the first line + (.+\n)* # subsequent consecutive lines + \n* # blanks + )+ + ) + /xm', + array(&$this, '_doBlockQuotes_callback'), $text); + + return $text; + } + function _doBlockQuotes_callback($matches) { + $bq = $matches[1]; + # trim one level of quoting - trim whitespace-only lines + $bq = preg_replace('/^[ ]*>[ ]?|^[ ]+$/m', '', $bq); + $bq = $this->runBlockGamut($bq); # recurse + + $bq = preg_replace('/^/m', " ", $bq); + # These leading spaces cause problem with
     content, 
    +        # so we need to fix that:
    +        $bq = preg_replace_callback('{(\s*
    .+?
    )}sx', + array(&$this, '_doBlockQuotes_callback2'), $bq); + + return "\n". $this->hashBlock("
    \n$bq\n
    ")."\n\n"; + } + function _doBlockQuotes_callback2($matches) { + $pre = $matches[1]; + $pre = preg_replace('/^ /m', '', $pre); + return $pre; + } + + + function formParagraphs($text) { + # + # Params: + # $text - string to process with html

    tags + # + # Strip leading and trailing lines: + $text = preg_replace('/\A\n+|\n+\z/', '', $text); + + $grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY); + + # + # Wrap

    tags and unhashify HTML blocks + # + foreach ($grafs as $key => $value) { + if (!preg_match('/^B\x1A[0-9]+B$/', $value)) { + # Is a paragraph. + $value = $this->runSpanGamut($value); + $value = preg_replace('/^([ ]*)/', "

    ", $value); + $value .= "

    "; + $grafs[$key] = $this->unhash($value); + } + else { + # Is a block. + # Modify elements of @grafs in-place... + $graf = $value; + $block = $this->html_hashes[$graf]; + $graf = $block; +// if (preg_match('{ +// \A +// ( # $1 =
    tag +//
    ]* +// \b +// markdown\s*=\s* ([\'"]) # $2 = attr quote char +// 1 +// \2 +// [^>]* +// > +// ) +// ( # $3 = contents +// .* +// ) +// (
    ) # $4 = closing tag +// \z +// }xs', $block, $matches)) +// { +// list(, $div_open, , $div_content, $div_close) = $matches; // -// # We can't call Markdown(), because that resets the hash; -// # that initialization code should be pulled into its own sub, though. -// $div_content = $this->hashHTMLBlocks($div_content); -// -// # Run document gamut methods on the content. -// foreach ($this->document_gamut as $method => $priority) { -// $div_content = $this->$method($div_content); -// } +// # We can't call Markdown(), because that resets the hash; +// # that initialization code should be pulled into its own sub, though. +// $div_content = $this->hashHTMLBlocks($div_content); +// +// # Run document gamut methods on the content. +// foreach ($this->document_gamut as $method => $priority) { +// $div_content = $this->$method($div_content); +// } // -// $div_open = preg_replace( -// '{\smarkdown\s*=\s*([\'"]).+?\1}', '', $div_open); +// $div_open = preg_replace( +// '{\smarkdown\s*=\s*([\'"]).+?\1}', '', $div_open); // -// $graf = $div_open . "\n" . $div_content . "\n" . $div_close; -// } - $grafs[$key] = $graf; - } - } - - return implode("\n\n", $grafs); - } - - - function encodeAttribute($text) { - # - # Encode text for a double-quoted HTML attribute. This function - # is *not* suitable for attributes enclosed in single quotes. - # - $text = $this->encodeAmpsAndAngles($text); - $text = str_replace('"', '"', $text); - return $text; - } - - - function encodeAmpsAndAngles($text) { - # - # Smart processing for ampersands and angle brackets that need to - # be encoded. Valid character entities are left alone unless the - # no-entities mode is set. - # - if ($this->no_entities) { - $text = str_replace('&', '&', $text); - } else { - # Ampersand-encoding based entirely on Nat Irons's Amputator - # MT plugin: - $text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/', - '&', $text);; - } - # Encode remaining <'s - $text = str_replace('<', '<', $text); - - return $text; - } - - - function doAutoLinks($text) { - $text = preg_replace_callback('{<((https?|ftp|dict):[^\'">\s]+)>}i', - array(&$this, '_doAutoLinks_url_callback'), $text); - - # Email addresses: - $text = preg_replace_callback('{ - < - (?:mailto:)? - ( - (?: - [-!#$%&\'*+/=?^_`.{|}~\w\x80-\xFF]+ - | - ".*?" - ) - \@ - (?: - [-a-z0-9\x80-\xFF]+(\.[-a-z0-9\x80-\xFF]+)*\.[a-z]+ - | - \[[\d.a-fA-F:]+\] # IPv4 & IPv6 - ) - ) - > - }xi', - array(&$this, '_doAutoLinks_email_callback'), $text); - - return $text; - } - function _doAutoLinks_url_callback($matches) { - $url = $this->encodeAttribute($matches[1]); - $link = "$url"; - return $this->hashPart($link); - } - function _doAutoLinks_email_callback($matches) { - $address = $matches[1]; - $link = $this->encodeEmailAddress($address); - return $this->hashPart($link); - } - - - function encodeEmailAddress($addr) { - # - # Input: an email address, e.g. "foo@example.com" - # - # Output: the email address as a mailto link, with each character - # of the address encoded as either a decimal or hex entity, in - # the hopes of foiling most address harvesting spam bots. E.g.: - # - #

    foo@exampl - # e.com

    - # - # Based by a filter by Matthew Wickline, posted to BBEdit-Talk. - # With some optimizations by Milian Wolff. - # - $addr = "mailto:" . $addr; - $chars = preg_split('/(? $char) { - $ord = ord($char); - # Ignore non-ascii chars. - if ($ord < 128) { - $r = ($seed * (1 + $key)) % 100; # Pseudo-random function. - # roughly 10% raw, 45% hex, 45% dec - # '@' *must* be encoded. I insist. - if ($r > 90 && $char != '@') /* do nothing */; - else if ($r < 45) $chars[$key] = '&#x'.dechex($ord).';'; - else $chars[$key] = '&#'.$ord.';'; - } - } - - $addr = implode('', $chars); - $text = implode('', array_slice($chars, 7)); # text without `mailto:` - $addr = "$text"; - - return $addr; - } - - - function parseSpan($str) { - # - # Take the string $str and parse it into tokens, hashing embeded HTML, - # escaped characters and handling code spans. - # - $output = ''; - - $span_re = '{ - ( - \\\\'.$this->escape_chars_re.' - | - (?no_markup ? '' : ' - | - # comment - | - <\?.*?\?> | <%.*?%> # processing instruction - | - <[/!$]?[-a-zA-Z0-9:_]+ # regular tags - (?> - \s - (?>[^"\'>]+|"[^"]*"|\'[^\']*\')* - )? - > - ').' - ) - }xs'; - - while (1) { - # - # Each loop iteration seach for either the next tag, the next - # openning code span marker, or the next escaped character. - # Each token is then passed to handleSpanToken. - # - $parts = preg_split($span_re, $str, 2, PREG_SPLIT_DELIM_CAPTURE); - - # Create token from text preceding tag. - if ($parts[0] != "") { - $output .= $parts[0]; - } - - # Check if we reach the end. - if (isset($parts[1])) { - $output .= $this->handleSpanToken($parts[1], $parts[2]); - $str = $parts[2]; - } - else { - break; - } - } - - return $output; - } - - - function handleSpanToken($token, &$str) { - # - # Handle $token provided by parseSpan by determining its nature and - # returning the corresponding value that should replace it. - # - switch ($token{0}) { - case "\\": - return $this->hashPart("&#". ord($token{1}). ";"); - case "`": - # Search for end marker in remaining text. - if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)$/sm', - $str, $matches)) - { - $str = $matches[2]; - $codespan = $this->makeCodeSpan($matches[1]); - return $this->hashPart($codespan); - } - return $token; // return as text since no ending marker found. - default: - return $this->hashPart($token); - } - } - - - function outdent($text) { - # - # Remove one level of line-leading tabs or spaces - # - return preg_replace('/^(\t|[ ]{1,'.$this->tab_width.'})/m', '', $text); - } - - - # String length function for detab. `_initDetab` will create a function to - # hanlde UTF-8 if the default function does not exist. - var $utf8_strlen = 'mb_strlen'; - - function detab($text) { - # - # Replace tabs with the appropriate amount of space. - # - # For each line we separate the line in blocks delemited by - # tab characters. Then we reconstruct every line by adding the - # appropriate number of space between each blocks. - - $text = preg_replace_callback('/^.*\t.*$/m', - array(&$this, '_detab_callback'), $text); - - return $text; - } - function _detab_callback($matches) { - $line = $matches[0]; - $strlen = $this->utf8_strlen; # strlen function for UTF-8. - - # Split in blocks. - $blocks = explode("\t", $line); - # Add each blocks to the line. - $line = $blocks[0]; - unset($blocks[0]); # Do not add first block twice. - foreach ($blocks as $block) { - # Calculate amount of space, insert spaces, insert block. - $amount = $this->tab_width - - $strlen($line, 'UTF-8') % $this->tab_width; - $line .= str_repeat(" ", $amount) . $block; - } - return $line; - } - function _initDetab() { - # - # Check for the availability of the function in the `utf8_strlen` property - # (initially `mb_strlen`). If the function is not available, create a - # function that will loosely count the number of UTF-8 characters with a - # regular expression. - # - if (function_exists($this->utf8_strlen)) return; - $this->utf8_strlen = create_function('$text', 'return preg_match_all( - "/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/", - $text, $m);'); - } - - - function unhash($text) { - # - # Swap back in all the tags hashed by _HashHTMLBlocks. - # - return preg_replace_callback('/(.)\x1A[0-9]+\1/', - array(&$this, '_unhash_callback'), $text); - } - function _unhash_callback($matches) { - return $this->html_hashes[$matches[0]]; - } +// $graf = $div_open . "\n" . $div_content . "\n" . $div_close; +// } + $grafs[$key] = $graf; + } + } + + return implode("\n\n", $grafs); + } + + + function encodeAttribute($text) { + # + # Encode text for a double-quoted HTML attribute. This function + # is *not* suitable for attributes enclosed in single quotes. + # + $text = $this->encodeAmpsAndAngles($text); + $text = str_replace('"', '"', $text); + return $text; + } + + + function encodeAmpsAndAngles($text) { + # + # Smart processing for ampersands and angle brackets that need to + # be encoded. Valid character entities are left alone unless the + # no-entities mode is set. + # + if ($this->no_entities) { + $text = str_replace('&', '&', $text); + } else { + # Ampersand-encoding based entirely on Nat Irons's Amputator + # MT plugin: + $text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/', + '&', $text);; + } + # Encode remaining <'s + $text = str_replace('<', '<', $text); + + return $text; + } + + + function doAutoLinks($text) { + $text = preg_replace_callback('{<((https?|ftp|dict):[^\'">\s]+)>}i', + array(&$this, '_doAutoLinks_url_callback'), $text); + + # Email addresses: + $text = preg_replace_callback('{ + < + (?:mailto:)? + ( + (?: + [-!#$%&\'*+/=?^_`.{|}~\w\x80-\xFF]+ + | + ".*?" + ) + \@ + (?: + [-a-z0-9\x80-\xFF]+(\.[-a-z0-9\x80-\xFF]+)*\.[a-z]+ + | + \[[\d.a-fA-F:]+\] # IPv4 & IPv6 + ) + ) + > + }xi', + array(&$this, '_doAutoLinks_email_callback'), $text); + + return $text; + } + function _doAutoLinks_url_callback($matches) { + $url = $this->encodeAttribute($matches[1]); + $link = "$url"; + return $this->hashPart($link); + } + function _doAutoLinks_email_callback($matches) { + $address = $matches[1]; + $link = $this->encodeEmailAddress($address); + return $this->hashPart($link); + } + + + function encodeEmailAddress($addr) { + # + # Input: an email address, e.g. "foo@example.com" + # + # Output: the email address as a mailto link, with each character + # of the address encoded as either a decimal or hex entity, in + # the hopes of foiling most address harvesting spam bots. E.g.: + # + #

    foo@exampl + # e.com

    + # + # Based by a filter by Matthew Wickline, posted to BBEdit-Talk. + # With some optimizations by Milian Wolff. + # + $addr = "mailto:" . $addr; + $chars = preg_split('/(? $char) { + $ord = ord($char); + # Ignore non-ascii chars. + if ($ord < 128) { + $r = ($seed * (1 + $key)) % 100; # Pseudo-random function. + # roughly 10% raw, 45% hex, 45% dec + # '@' *must* be encoded. I insist. + if ($r > 90 && $char != '@') /* do nothing */; + else if ($r < 45) $chars[$key] = '&#x'.dechex($ord).';'; + else $chars[$key] = '&#'.$ord.';'; + } + } + + $addr = implode('', $chars); + $text = implode('', array_slice($chars, 7)); # text without `mailto:` + $addr = "$text"; + + return $addr; + } + + + function parseSpan($str) { + # + # Take the string $str and parse it into tokens, hashing embeded HTML, + # escaped characters and handling code spans. + # + $output = ''; + + $span_re = '{ + ( + \\\\'.$this->escape_chars_re.' + | + (?no_markup ? '' : ' + | + # comment + | + <\?.*?\?> | <%.*?%> # processing instruction + | + <[/!$]?[-a-zA-Z0-9:_]+ # regular tags + (?> + \s + (?>[^"\'>]+|"[^"]*"|\'[^\']*\')* + )? + > + ').' + ) + }xs'; + + while (1) { + # + # Each loop iteration seach for either the next tag, the next + # openning code span marker, or the next escaped character. + # Each token is then passed to handleSpanToken. + # + $parts = preg_split($span_re, $str, 2, PREG_SPLIT_DELIM_CAPTURE); + + # Create token from text preceding tag. + if ($parts[0] != "") { + $output .= $parts[0]; + } + + # Check if we reach the end. + if (isset($parts[1])) { + $output .= $this->handleSpanToken($parts[1], $parts[2]); + $str = $parts[2]; + } + else { + break; + } + } + + return $output; + } + + + function handleSpanToken($token, &$str) { + # + # Handle $token provided by parseSpan by determining its nature and + # returning the corresponding value that should replace it. + # + switch ($token{0}) { + case "\\": + return $this->hashPart("&#". ord($token{1}). ";"); + case "`": + # Search for end marker in remaining text. + if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)$/sm', + $str, $matches)) + { + $str = $matches[2]; + $codespan = $this->makeCodeSpan($matches[1]); + return $this->hashPart($codespan); + } + return $token; // return as text since no ending marker found. + default: + return $this->hashPart($token); + } + } + + + function outdent($text) { + # + # Remove one level of line-leading tabs or spaces + # + return preg_replace('/^(\t|[ ]{1,'.$this->tab_width.'})/m', '', $text); + } + + + # String length function for detab. `_initDetab` will create a function to + # hanlde UTF-8 if the default function does not exist. + var $utf8_strlen = 'mb_strlen'; + + function detab($text) { + # + # Replace tabs with the appropriate amount of space. + # + # For each line we separate the line in blocks delemited by + # tab characters. Then we reconstruct every line by adding the + # appropriate number of space between each blocks. + + $text = preg_replace_callback('/^.*\t.*$/m', + array(&$this, '_detab_callback'), $text); + + return $text; + } + function _detab_callback($matches) { + $line = $matches[0]; + $strlen = $this->utf8_strlen; # strlen function for UTF-8. + + # Split in blocks. + $blocks = explode("\t", $line); + # Add each blocks to the line. + $line = $blocks[0]; + unset($blocks[0]); # Do not add first block twice. + foreach ($blocks as $block) { + # Calculate amount of space, insert spaces, insert block. + $amount = $this->tab_width - + $strlen($line, 'UTF-8') % $this->tab_width; + $line .= str_repeat(" ", $amount) . $block; + } + return $line; + } + function _initDetab() { + # + # Check for the availability of the function in the `utf8_strlen` property + # (initially `mb_strlen`). If the function is not available, create a + # function that will loosely count the number of UTF-8 characters with a + # regular expression. + # + if (function_exists($this->utf8_strlen)) return; + $this->utf8_strlen = create_function('$text', 'return preg_match_all( + "/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/", + $text, $m);'); + } + + + function unhash($text) { + # + # Swap back in all the tags hashed by _HashHTMLBlocks. + # + return preg_replace_callback('/(.)\x1A[0-9]+\1/', + array(&$this, '_unhash_callback'), $text); + } + function _unhash_callback($matches) { + return $this->html_hashes[$matches[0]]; + } } @@ -1676,1169 +1676,1169 @@ function _unhash_callback($matches) { class MarkdownExtra_Parser extends Markdown_Parser { - # Prefix for footnote ids. - var $fn_id_prefix = ""; - - # Optional title attribute for footnote links and backlinks. - var $fn_link_title = MARKDOWN_FN_LINK_TITLE; - var $fn_backlink_title = MARKDOWN_FN_BACKLINK_TITLE; - - # Optional class attribute for footnote links and backlinks. - var $fn_link_class = MARKDOWN_FN_LINK_CLASS; - var $fn_backlink_class = MARKDOWN_FN_BACKLINK_CLASS; - - # Predefined abbreviations. - var $predef_abbr = array(); - - - function MarkdownExtra_Parser() { - # - # Constructor function. Initialize the parser object. - # - # Add extra escapable characters before parent constructor - # initialize the table. - $this->escape_chars .= ':|'; - - # Insert extra document, block, and span transformations. - # Parent constructor will do the sorting. - $this->document_gamut += array( - "doFencedCodeBlocks" => 5, - "stripFootnotes" => 15, - "stripAbbreviations" => 25, - "appendFootnotes" => 50, - ); - $this->block_gamut += array( - "doFencedCodeBlocks" => 5, - "doTables" => 15, - "doDefLists" => 45, - ); - $this->span_gamut += array( - "doFootnotes" => 5, - "doAbbreviations" => 70, - ); - - parent::Markdown_Parser(); - } - - - # Extra variables used during extra transformations. - var $footnotes = array(); - var $footnotes_ordered = array(); - var $abbr_desciptions = array(); - var $abbr_word_re = ''; - - # Give the current footnote number. - var $footnote_counter = 1; - - - function setup() { - # - # Setting up Extra-specific variables. - # - parent::setup(); - - $this->footnotes = array(); - $this->footnotes_ordered = array(); - $this->abbr_desciptions = array(); - $this->abbr_word_re = ''; - $this->footnote_counter = 1; - - foreach ($this->predef_abbr as $abbr_word => $abbr_desc) { - if ($this->abbr_word_re) - $this->abbr_word_re .= '|'; - $this->abbr_word_re .= preg_quote($abbr_word); - $this->abbr_desciptions[$abbr_word] = trim($abbr_desc); - } - } - - function teardown() { - # - # Clearing Extra-specific variables. - # - $this->footnotes = array(); - $this->footnotes_ordered = array(); - $this->abbr_desciptions = array(); - $this->abbr_word_re = ''; - - parent::teardown(); - } - - - ### HTML Block Parser ### - - # Tags that are always treated as block tags: - var $block_tags_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|form|fieldset|iframe|hr|legend'; - - # Tags treated as block tags only if the opening tag is alone on it's line: - var $context_block_tags_re = 'script|noscript|math|ins|del'; - - # Tags where markdown="1" default to span mode: - var $contain_span_tags_re = 'p|h[1-6]|li|dd|dt|td|th|legend|address'; - - # Tags which must not have their contents modified, no matter where - # they appear: - var $clean_tags_re = 'script|math'; - - # Tags that do not need to be closed. - var $auto_close_tags_re = 'hr|img'; - - - function hashHTMLBlocks($text) { - # - # Hashify HTML Blocks and "clean tags". - # - # We only want to do this for block-level HTML tags, such as headers, - # lists, and tables. That's because we still want to wrap

    s around - # "paragraphs" that are wrapped in non-block-level tags, such as anchors, - # phrase emphasis, and spans. The list of tags we're looking for is - # hard-coded. - # - # This works by calling _HashHTMLBlocks_InMarkdown, which then calls - # _HashHTMLBlocks_InHTML when it encounter block tags. When the markdown="1" - # attribute is found whitin a tag, _HashHTMLBlocks_InHTML calls back - # _HashHTMLBlocks_InMarkdown to handle the Markdown syntax within the tag. - # These two functions are calling each other. It's recursive! - # - # - # Call the HTML-in-Markdown hasher. - # - list($text, ) = $this->_hashHTMLBlocks_inMarkdown($text); - - return $text; - } - function _hashHTMLBlocks_inMarkdown($text, $indent = 0, - $enclosing_tag_re = '', $span = false) - { - # - # Parse markdown text, calling _HashHTMLBlocks_InHTML for block tags. - # - # * $indent is the number of space to be ignored when checking for code - # blocks. This is important because if we don't take the indent into - # account, something like this (which looks right) won't work as expected: - # - #

    - #
    - # Hello World. <-- Is this a Markdown code block or text? - #
    <-- Is this a Markdown code block or a real tag? - #
    - # - # If you don't like this, just don't indent the tag on which - # you apply the markdown="1" attribute. - # - # * If $enclosing_tag_re is not empty, stops at the first unmatched closing - # tag with that name. Nested tags supported. - # - # * If $span is true, text inside must treated as span. So any double - # newline will be replaced by a single newline so that it does not create - # paragraphs. - # - # Returns an array of that form: ( processed text , remaining text ) - # - if ($text === '') return array('', ''); - - # Regex to check for the presense of newlines around a block tag. - $newline_before_re = '/(?:^\n?|\n\n)*$/'; - $newline_after_re = - '{ - ^ # Start of text following the tag. - (?>[ ]*)? # Optional comment. - [ ]*\n # Must be followed by newline. - }xs'; - - # Regex to match any tag. - $block_tag_re = - '{ - ( # $2: Capture hole tag. - # Tag name. - '.$this->block_tags_re.' | - '.$this->context_block_tags_re.' | - '.$this->clean_tags_re.' | - (?!\s)'.$enclosing_tag_re.' - ) - (?: - (?=[\s"\'/a-zA-Z0-9]) # Allowed characters after tag name. - (?> - ".*?" | # Double quotes (can contain `>`) - \'.*?\' | # Single quotes (can contain `>`) - .+? # Anything but quotes and `>`. - )*? - )? - > # End of tag. - | - # HTML Comment - | - <\?.*?\?> | <%.*?%> # Processing instruction - | - # CData Block - | - # Code span marker - `+ - '. ( !$span ? ' # If not in span. - | - # Indented code block - (?: ^[ ]*\n | ^ | \n[ ]*\n ) - [ ]{'.($indent+4).'}[^\n]* \n - (?> - (?: [ ]{'.($indent+4).'}[^\n]* | [ ]* ) \n - )* - | - # Fenced code block marker - (?> ^ | \n ) - [ ]{'.($indent).'}~~~+[ ]*\n - ' : '' ). ' # End (if not is span). - ) - }xs'; - - - $depth = 0; # Current depth inside the tag tree. - $parsed = ""; # Parsed text that will be returned. - - # - # Loop through every tag until we find the closing tag of the parent - # or loop until reaching the end of text if no parent tag specified. - # - do { - # - # Split the text using the first $tag_match pattern found. - # Text before pattern will be first in the array, text after - # pattern will be at the end, and between will be any catches made - # by the pattern. - # - $parts = preg_split($block_tag_re, $text, 2, - PREG_SPLIT_DELIM_CAPTURE); - - # If in Markdown span mode, add a empty-string span-level hash - # after each newline to prevent triggering any block element. - if ($span) { - $void = $this->hashPart("", ':'); - $newline = "$void\n"; - $parts[0] = $void . str_replace("\n", $newline, $parts[0]) . $void; - } - - $parsed .= $parts[0]; # Text before current tag. - - # If end of $text has been reached. Stop loop. - if (count($parts) < 3) { - $text = ""; - break; - } - - $tag = $parts[1]; # Tag to handle. - $text = $parts[2]; # Remaining text after current tag. - $tag_re = preg_quote($tag); # For use in a regular expression. - - # - # Check for: Code span marker - # - if ($tag{0} == "`") { - # Find corresponding end marker. - $tag_re = preg_quote($tag); - if (preg_match('{^(?>.+?|\n(?!\n))*?(?.*\n)+?'.$tag_re.' *\n}', $text, - $matches)) - { - # End marker found: pass text unchanged until marker. - $parsed .= $tag . $matches[0]; - $text = substr($text, strlen($matches[0])); - } - else { - # No end marker: just skip it. - $parsed .= $tag; - } - } - # - # Check for: Opening Block level tag or - # Opening Context Block tag (like ins and del) - # used as a block tag (tag is alone on it's line). - # - else if (preg_match('{^<(?:'.$this->block_tags_re.')\b}', $tag) || - ( preg_match('{^<(?:'.$this->context_block_tags_re.')\b}', $tag) && - preg_match($newline_before_re, $parsed) && - preg_match($newline_after_re, $text) ) - ) - { - # Need to parse tag and following text using the HTML parser. - list($block_text, $text) = - $this->_hashHTMLBlocks_inHTML($tag . $text, "hashBlock", true); - - # Make sure it stays outside of any paragraph by adding newlines. - $parsed .= "\n\n$block_text\n\n"; - } - # - # Check for: Clean tag (like script, math) - # HTML Comments, processing instructions. - # - else if (preg_match('{^<(?:'.$this->clean_tags_re.')\b}', $tag) || - $tag{1} == '!' || $tag{1} == '?') - { - # Need to parse tag and following text using the HTML parser. - # (don't check for markdown attribute) - list($block_text, $text) = - $this->_hashHTMLBlocks_inHTML($tag . $text, "hashClean", false); - - $parsed .= $block_text; - } - # - # Check for: Tag with same name as enclosing tag. - # - else if ($enclosing_tag_re !== '' && - # Same name as enclosing tag. - preg_match('{^= 0); - - return array($parsed, $text); - } - function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) { - # - # Parse HTML, calling _HashHTMLBlocks_InMarkdown for block tags. - # - # * Calls $hash_method to convert any blocks. - # * Stops when the first opening tag closes. - # * $md_attr indicate if the use of the `markdown="1"` attribute is allowed. - # (it is not inside clean tags) - # - # Returns an array of that form: ( processed text , remaining text ) - # - if ($text === '') return array('', ''); - - # Regex to match `markdown` attribute inside of a tag. - $markdown_attr_re = ' - { - \s* # Eat whitespace before the `markdown` attribute - markdown - \s*=\s* - (?> - (["\']) # $1: quote delimiter - (.*?) # $2: attribute value - \1 # matching delimiter - | - ([^\s>]*) # $3: unquoted attribute value - ) - () # $4: make $3 always defined (avoid warnings) - }xs'; - - # Regex to match any tag. - $tag_re = '{ - ( # $2: Capture hole tag. - - ".*?" | # Double quotes (can contain `>`) - \'.*?\' | # Single quotes (can contain `>`) - .+? # Anything but quotes and `>`. - )*? - )? - > # End of tag. - | - # HTML Comment - | - <\?.*?\?> | <%.*?%> # Processing instruction - | - # CData Block - ) - }xs'; - - $original_text = $text; # Save original text in case of faliure. - - $depth = 0; # Current depth inside the tag tree. - $block_text = ""; # Temporary text holder for current text. - $parsed = ""; # Parsed text that will be returned. - - # - # Get the name of the starting tag. - # (This pattern makes $base_tag_name_re safe without quoting.) - # - if (preg_match('/^<([\w:$]*)\b/', $text, $matches)) - $base_tag_name_re = $matches[1]; - - # - # Loop through every tag until we find the corresponding closing tag. - # - do { - # - # Split the text using the first $tag_match pattern found. - # Text before pattern will be first in the array, text after - # pattern will be at the end, and between will be any catches made - # by the pattern. - # - $parts = preg_split($tag_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE); - - if (count($parts) < 3) { - # - # End of $text reached with unbalenced tag(s). - # In that case, we return original text unchanged and pass the - # first character as filtered to prevent an infinite loop in the - # parent function. - # - return array($original_text{0}, substr($original_text, 1)); - } - - $block_text .= $parts[0]; # Text before current tag. - $tag = $parts[1]; # Tag to handle. - $text = $parts[2]; # Remaining text after current tag. - - # - # Check for: Auto-close tag (like
    ) - # Comments and Processing Instructions. - # - if (preg_match('{^auto_close_tags_re.')\b}', $tag) || - $tag{1} == '!' || $tag{1} == '?') - { - # Just add the tag to the block as if it was text. - $block_text .= $tag; - } - else { - # - # Increase/decrease nested tag count. Only do so if - # the tag's name match base tag's. - # - if (preg_match('{^mode = $attr_m[2] . $attr_m[3]; - $span_mode = $this->mode == 'span' || $this->mode != 'block' && - preg_match('{^<(?:'.$this->contain_span_tags_re.')\b}', $tag); - - # Calculate indent before tag. - if (preg_match('/(?:^|\n)( *?)(?! ).*?$/', $block_text, $matches)) { - $strlen = $this->utf8_strlen; - $indent = $strlen($matches[1], 'UTF-8'); - } else { - $indent = 0; - } - - # End preceding block with this tag. - $block_text .= $tag; - $parsed .= $this->$hash_method($block_text); - - # Get enclosing tag name for the ParseMarkdown function. - # (This pattern makes $tag_name_re safe without quoting.) - preg_match('/^<([\w:$]*)\b/', $tag, $matches); - $tag_name_re = $matches[1]; - - # Parse the content using the HTML-in-Markdown parser. - list ($block_text, $text) - = $this->_hashHTMLBlocks_inMarkdown($text, $indent, - $tag_name_re, $span_mode); - - # Outdent markdown text. - if ($indent > 0) { - $block_text = preg_replace("/^[ ]{1,$indent}/m", "", - $block_text); - } - - # Append tag content to parsed text. - if (!$span_mode) $parsed .= "\n\n$block_text\n\n"; - else $parsed .= "$block_text"; - - # Start over a new block. - $block_text = ""; - } - else $block_text .= $tag; - } - - } while ($depth > 0); - - # - # Hash last block text that wasn't processed inside the loop. - # - $parsed .= $this->$hash_method($block_text); - - return array($parsed, $text); - } - - - function hashClean($text) { - # - # Called whenever a tag must be hashed when a function insert a "clean" tag - # in $text, it pass through this function and is automaticaly escaped, - # blocking invalid nested overlap. - # - return $this->hashPart($text, 'C'); - } - - - function doHeaders($text) { - # - # Redefined to add id attribute support. - # - # Setext-style headers: - # Header 1 {#header1} - # ======== - # - # Header 2 {#header2} - # -------- - # - $text = preg_replace_callback( - '{ - (^.+?) # $1: Header text - (?:[ ]+\{\#([-_:a-zA-Z0-9]+)\})? # $2: Id attribute - [ ]*\n(=+|-+)[ ]*\n+ # $3: Header footer - }mx', - array(&$this, '_doHeaders_callback_setext'), $text); - - # atx-style headers: - # # Header 1 {#header1} - # ## Header 2 {#header2} - # ## Header 2 with closing hashes ## {#header3} - # ... - # ###### Header 6 {#header2} - # - $text = preg_replace_callback('{ - ^(\#{1,6}) # $1 = string of #\'s - [ ]* - (.+?) # $2 = Header text - [ ]* - \#* # optional closing #\'s (not counted) - (?:[ ]+\{\#([-_:a-zA-Z0-9]+)\})? # id attribute - [ ]* - \n+ - }xm', - array(&$this, '_doHeaders_callback_atx'), $text); - - return $text; - } - function _doHeaders_attr($attr) { - if (empty($attr)) return ""; - return " id=\"$attr\""; - } - function _doHeaders_callback_setext($matches) { - if ($matches[3] == '-' && preg_match('{^- }', $matches[1])) - return $matches[0]; - $level = $matches[3]{0} == '=' ? 1 : 2; - $attr = $this->_doHeaders_attr($id =& $matches[2]); - $block = "".$this->runSpanGamut($matches[1]).""; - return "\n" . $this->hashBlock($block) . "\n\n"; - } - function _doHeaders_callback_atx($matches) { - $level = strlen($matches[1]); - $attr = $this->_doHeaders_attr($id =& $matches[3]); - $block = "".$this->runSpanGamut($matches[2]).""; - return "\n" . $this->hashBlock($block) . "\n\n"; - } - - - function doTables($text) { - # - # Form HTML tables. - # - $less_than_tab = $this->tab_width - 1; - # - # Find tables with leading pipe. - # - # | Header 1 | Header 2 - # | -------- | -------- - # | Cell 1 | Cell 2 - # | Cell 3 | Cell 4 - # - $text = preg_replace_callback(' - { - ^ # Start of a line - [ ]{0,'.$less_than_tab.'} # Allowed whitespace. - [|] # Optional leading pipe (present) - (.+) \n # $1: Header row (at least one pipe) - - [ ]{0,'.$less_than_tab.'} # Allowed whitespace. - [|] ([ ]*[-:]+[-| :]*) \n # $2: Header underline - - ( # $3: Cells - (?> - [ ]* # Allowed whitespace. - [|] .* \n # Row content. - )* - ) - (?=\n|\Z) # Stop at final double newline. - }xm', - array(&$this, '_doTable_leadingPipe_callback'), $text); - - # - # Find tables without leading pipe. - # - # Header 1 | Header 2 - # -------- | -------- - # Cell 1 | Cell 2 - # Cell 3 | Cell 4 - # - $text = preg_replace_callback(' - { - ^ # Start of a line - [ ]{0,'.$less_than_tab.'} # Allowed whitespace. - (\S.*[|].*) \n # $1: Header row (at least one pipe) - - [ ]{0,'.$less_than_tab.'} # Allowed whitespace. - ([-:]+[ ]*[|][-| :]*) \n # $2: Header underline - - ( # $3: Cells - (?> - .* [|] .* \n # Row content - )* - ) - (?=\n|\Z) # Stop at final double newline. - }xm', - array(&$this, '_DoTable_callback'), $text); - - return $text; - } - function _doTable_leadingPipe_callback($matches) { - $head = $matches[1]; - $underline = $matches[2]; - $content = $matches[3]; - - # Remove leading pipe for each row. - $content = preg_replace('/^ *[|]/m', '', $content); - - return $this->_doTable_callback(array($matches[0], $head, $underline, $content)); - } - function _doTable_callback($matches) { - $head = $matches[1]; - $underline = $matches[2]; - $content = $matches[3]; - - # Remove any tailing pipes for each line. - $head = preg_replace('/[|] *$/m', '', $head); - $underline = preg_replace('/[|] *$/m', '', $underline); - $content = preg_replace('/[|] *$/m', '', $content); - - # Reading alignement from header underline. - $separators = preg_split('/ *[|] */', $underline); - foreach ($separators as $n => $s) { - if (preg_match('/^ *-+: *$/', $s)) $attr[$n] = ' align="right"'; - else if (preg_match('/^ *:-+: *$/', $s))$attr[$n] = ' align="center"'; - else if (preg_match('/^ *:-+ *$/', $s)) $attr[$n] = ' align="left"'; - else $attr[$n] = ''; - } - - # Parsing span elements, including code spans, character escapes, - # and inline HTML tags, so that pipes inside those gets ignored. - $head = $this->parseSpan($head); - $headers = preg_split('/ *[|] */', $head); - $col_count = count($headers); - - # Write column headers. - $text = "
    \n"; - $text .= "\n"; - $text .= "\n"; - foreach ($headers as $n => $header) - $text .= " ".$this->runSpanGamut(trim($header))."\n"; - $text .= "\n"; - $text .= "\n"; - - # Split content by row. - $rows = explode("\n", trim($content, "\n")); - - $text .= "\n"; - foreach ($rows as $row) { - # Parsing span elements, including code spans, character escapes, - # and inline HTML tags, so that pipes inside those gets ignored. - $row = $this->parseSpan($row); - - # Split row by cell. - $row_cells = preg_split('/ *[|] */', $row, $col_count); - $row_cells = array_pad($row_cells, $col_count, ''); - - $text .= "\n"; - foreach ($row_cells as $n => $cell) - $text .= " ".$this->runSpanGamut(trim($cell))."\n"; - $text .= "\n"; - } - $text .= "\n"; - $text .= "
    "; - - return $this->hashBlock($text) . "\n"; - } - - - function doDefLists($text) { - # - # Form HTML definition lists. - # - $less_than_tab = $this->tab_width - 1; - - # Re-usable pattern to match any entire dl list: - $whole_list_re = '(?> - ( # $1 = whole list - ( # $2 - [ ]{0,'.$less_than_tab.'} - ((?>.*\S.*\n)+) # $3 = defined term - \n? - [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition - ) - (?s:.+?) - ( # $4 - \z - | - \n{2,} - (?=\S) - (?! # Negative lookahead for another term - [ ]{0,'.$less_than_tab.'} - (?: \S.*\n )+? # defined term - \n? - [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition - ) - (?! # Negative lookahead for another definition - [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition - ) - ) - ) - )'; // mx - - $text = preg_replace_callback('{ - (?>\A\n?|(?<=\n\n)) - '.$whole_list_re.' - }mx', - array(&$this, '_doDefLists_callback'), $text); - - return $text; - } - function _doDefLists_callback($matches) { - # Re-usable patterns to match list item bullets and number markers: - $list = $matches[1]; - - # Turn double returns into triple returns, so that we can make a - # paragraph for the last item in a list, if necessary: - $result = trim($this->processDefListItems($list)); - $result = "
    \n" . $result . "\n
    "; - return $this->hashBlock($result) . "\n\n"; - } - - - function processDefListItems($list_str) { - # - # Process the contents of a single definition list, splitting it - # into individual term and definition list items. - # - $less_than_tab = $this->tab_width - 1; - - # trim trailing blank lines: - $list_str = preg_replace("/\n{2,}\\z/", "\n", $list_str); - - # Process definition terms. - $list_str = preg_replace_callback('{ - (?>\A\n?|\n\n+) # leading line - ( # definition terms = $1 - [ ]{0,'.$less_than_tab.'} # leading whitespace - (?![:][ ]|[ ]) # negative lookahead for a definition - # mark (colon) or more whitespace. - (?> \S.* \n)+? # actual term (not whitespace). - ) - (?=\n?[ ]{0,3}:[ ]) # lookahead for following line feed - # with a definition mark. - }xm', - array(&$this, '_processDefListItems_callback_dt'), $list_str); - - # Process actual definitions. - $list_str = preg_replace_callback('{ - \n(\n+)? # leading line = $1 - ( # marker space = $2 - [ ]{0,'.$less_than_tab.'} # whitespace before colon - [:][ ]+ # definition mark (colon) - ) - ((?s:.+?)) # definition text = $3 - (?= \n+ # stop at next definition mark, - (?: # next term or end of text - [ ]{0,'.$less_than_tab.'} [:][ ] | -
    | \z - ) - ) - }xm', - array(&$this, '_processDefListItems_callback_dd'), $list_str); - - return $list_str; - } - function _processDefListItems_callback_dt($matches) { - $terms = explode("\n", trim($matches[1])); - $text = ''; - foreach ($terms as $term) { - $term = $this->runSpanGamut(trim($term)); - $text .= "\n
    " . $term . "
    "; - } - return $text . "\n"; - } - function _processDefListItems_callback_dd($matches) { - $leading_line = $matches[1]; - $marker_space = $matches[2]; - $def = $matches[3]; - - if ($leading_line || preg_match('/\n{2,}/', $def)) { - # Replace marker with the appropriate whitespace indentation - $def = str_repeat(' ', strlen($marker_space)) . $def; - $def = $this->runBlockGamut($this->outdent($def . "\n\n")); - $def = "\n". $def ."\n"; - } - else { - $def = rtrim($def); - $def = $this->runSpanGamut($this->outdent($def)); - } - - return "\n
    " . $def . "
    \n"; - } - - - function doFencedCodeBlocks($text) { - # - # Adding the fenced code block syntax to regular Markdown: - # - # ~~~ - # Code block - # ~~~ - # - $less_than_tab = $this->tab_width; - - $text = preg_replace_callback('{ - (?:\n|\A) - # 1: Opening marker - ( - ~{3,} # Marker: three tilde or more. - ) - [ ]* \n # Whitespace and newline following marker. - - # 2: Content - ( - (?> - (?!\1 [ ]* \n) # Not a closing marker. - .*\n+ - )+ - ) - - # Closing marker. - \1 [ ]* \n - }xm', - array(&$this, '_doFencedCodeBlocks_callback'), $text); - - return $text; - } - function _doFencedCodeBlocks_callback($matches) { - $codeblock = $matches[2]; - $codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES); - $codeblock = preg_replace_callback('/^\n+/', - array(&$this, '_doFencedCodeBlocks_newlines'), $codeblock); - $codeblock = "
    $codeblock
    "; - return "\n\n".$this->hashBlock($codeblock)."\n\n"; - } - function _doFencedCodeBlocks_newlines($matches) { - return str_repeat("empty_element_suffix", - strlen($matches[0])); - } - - - # - # Redefining emphasis markers so that emphasis by underscore does not - # work in the middle of a word. - # - var $em_relist = array( - '' => '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? tags - # - # Strip leading and trailing lines: - $text = preg_replace('/\A\n+|\n+\z/', '', $text); - - $grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY); - - # - # Wrap

    tags and unhashify HTML blocks - # - foreach ($grafs as $key => $value) { - $value = trim($this->runSpanGamut($value)); - - # Check if this should be enclosed in a paragraph. - # Clean tag hashes & block tag hashes are left alone. - $is_p = !preg_match('/^B\x1A[0-9]+B|^C\x1A[0-9]+C$/', $value); - - if ($is_p) { - $value = "

    $value

    "; - } - $grafs[$key] = $value; - } - - # Join grafs in one text, then unhash HTML tags. - $text = implode("\n\n", $grafs); - - # Finish by removing any tag hashes still present in $text. - $text = $this->unhash($text); - - return $text; - } - - - ### Footnotes - - function stripFootnotes($text) { - # - # Strips link definitions from text, stores the URLs and titles in - # hash references. - # - $less_than_tab = $this->tab_width - 1; - - # Link defs are in the form: [^id]: url "optional title" - $text = preg_replace_callback('{ - ^[ ]{0,'.$less_than_tab.'}\[\^(.+?)\][ ]?: # note_id = $1 - [ ]* - \n? # maybe *one* newline - ( # text = $2 (no blank lines allowed) - (?: - .+ # actual text - | - \n # newlines but - (?!\[\^.+?\]:\s)# negative lookahead for footnote marker. - (?!\n+[ ]{0,3}\S)# ensure line is not blank and followed - # by non-indented content - )* - ) - }xm', - array(&$this, '_stripFootnotes_callback'), - $text); - return $text; - } - function _stripFootnotes_callback($matches) { - $note_id = $this->fn_id_prefix . $matches[1]; - $this->footnotes[$note_id] = $this->outdent($matches[2]); - return ''; # String that will replace the block - } - - - function doFootnotes($text) { - # - # Replace footnote references in $text [^id] with a special text-token - # which will be replaced by the actual footnote marker in appendFootnotes. - # - if (!$this->in_anchor) { - $text = preg_replace('{\[\^(.+?)\]}', "F\x1Afn:\\1\x1A:", $text); - } - return $text; - } - - - function appendFootnotes($text) { - # - # Append footnote list to text. - # - $text = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}', - array(&$this, '_appendFootnotes_callback'), $text); - - if (!empty($this->footnotes_ordered)) { - $text .= "\n\n"; - $text .= "
    \n"; - $text .= "
    empty_element_suffix ."
    \n"; - $text .= "
      \n\n"; - - $attr = ""; - if ($this->fn_backlink_class != "") { - $class = $this->fn_backlink_class; - $class = $this->encodeAttribute($class); - $attr .= " class=\"$class\""; - } - if ($this->fn_backlink_title != "") { - $title = $this->fn_backlink_title; - $title = $this->encodeAttribute($title); - $attr .= " title=\"$title\""; - } - $num = 0; - - while (!empty($this->footnotes_ordered)) { - $footnote = reset($this->footnotes_ordered); - $note_id = key($this->footnotes_ordered); - unset($this->footnotes_ordered[$note_id]); - - $footnote .= "\n"; # Need to append newline before parsing. - $footnote = $this->runBlockGamut("$footnote\n"); - $footnote = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}', - array(&$this, '_appendFootnotes_callback'), $footnote); - - $attr = str_replace("%%", ++$num, $attr); - $note_id = $this->encodeAttribute($note_id); - - # Add backlink to last paragraph; create new paragraph if needed. - $backlink = ""; - if (preg_match('{

      $}', $footnote)) { - $footnote = substr($footnote, 0, -4) . " $backlink

      "; - } else { - $footnote .= "\n\n

      $backlink

      "; - } - - $text .= "
    1. \n"; - $text .= $footnote . "\n"; - $text .= "
    2. \n\n"; - } - - $text .= "
    \n"; - $text .= "
    "; - } - return $text; - } - function _appendFootnotes_callback($matches) { - $node_id = $this->fn_id_prefix . $matches[1]; - - # Create footnote marker only if it has a corresponding footnote *and* - # the footnote hasn't been used by another marker. - if (isset($this->footnotes[$node_id])) { - # Transfert footnote content to the ordered list. - $this->footnotes_ordered[$node_id] = $this->footnotes[$node_id]; - unset($this->footnotes[$node_id]); - - $num = $this->footnote_counter++; - $attr = ""; - if ($this->fn_link_class != "") { - $class = $this->fn_link_class; - $class = $this->encodeAttribute($class); - $attr .= " class=\"$class\""; - } - if ($this->fn_link_title != "") { - $title = $this->fn_link_title; - $title = $this->encodeAttribute($title); - $attr .= " title=\"$title\""; - } - - $attr = str_replace("%%", $num, $attr); - $node_id = $this->encodeAttribute($node_id); - - return - "". - "$num". - ""; - } - - return "[^".$matches[1]."]"; - } - - - ### Abbreviations ### - - function stripAbbreviations($text) { - # - # Strips abbreviations from text, stores titles in hash references. - # - $less_than_tab = $this->tab_width - 1; - - # Link defs are in the form: [id]*: url "optional title" - $text = preg_replace_callback('{ - ^[ ]{0,'.$less_than_tab.'}\*\[(.+?)\][ ]?: # abbr_id = $1 - (.*) # text = $2 (no blank lines allowed) - }xm', - array(&$this, '_stripAbbreviations_callback'), - $text); - return $text; - } - function _stripAbbreviations_callback($matches) { - $abbr_word = $matches[1]; - $abbr_desc = $matches[2]; - if ($this->abbr_word_re) - $this->abbr_word_re .= '|'; - $this->abbr_word_re .= preg_quote($abbr_word); - $this->abbr_desciptions[$abbr_word] = trim($abbr_desc); - return ''; # String that will replace the block - } - - - function doAbbreviations($text) { - # - # Find defined abbreviations in text and wrap them in elements. - # - if ($this->abbr_word_re) { - // cannot use the /x modifier because abbr_word_re may - // contain significant spaces: - $text = preg_replace_callback('{'. - '(?abbr_word_re.')'. - '(?![\w\x1A])'. - '}', - array(&$this, '_doAbbreviations_callback'), $text); - } - return $text; - } - function _doAbbreviations_callback($matches) { - $abbr = $matches[0]; - if (isset($this->abbr_desciptions[$abbr])) { - $desc = $this->abbr_desciptions[$abbr]; - if (empty($desc)) { - return $this->hashPart("$abbr"); - } else { - $desc = $this->encodeAttribute($desc); - return $this->hashPart("$abbr"); - } - } else { - return $matches[0]; - } - } + # Prefix for footnote ids. + var $fn_id_prefix = ""; + + # Optional title attribute for footnote links and backlinks. + var $fn_link_title = MARKDOWN_FN_LINK_TITLE; + var $fn_backlink_title = MARKDOWN_FN_BACKLINK_TITLE; + + # Optional class attribute for footnote links and backlinks. + var $fn_link_class = MARKDOWN_FN_LINK_CLASS; + var $fn_backlink_class = MARKDOWN_FN_BACKLINK_CLASS; + + # Predefined abbreviations. + var $predef_abbr = array(); + + + function MarkdownExtra_Parser() { + # + # Constructor function. Initialize the parser object. + # + # Add extra escapable characters before parent constructor + # initialize the table. + $this->escape_chars .= ':|'; + + # Insert extra document, block, and span transformations. + # Parent constructor will do the sorting. + $this->document_gamut += array( + "doFencedCodeBlocks" => 5, + "stripFootnotes" => 15, + "stripAbbreviations" => 25, + "appendFootnotes" => 50, + ); + $this->block_gamut += array( + "doFencedCodeBlocks" => 5, + "doTables" => 15, + "doDefLists" => 45, + ); + $this->span_gamut += array( + "doFootnotes" => 5, + "doAbbreviations" => 70, + ); + + parent::Markdown_Parser(); + } + + + # Extra variables used during extra transformations. + var $footnotes = array(); + var $footnotes_ordered = array(); + var $abbr_desciptions = array(); + var $abbr_word_re = ''; + + # Give the current footnote number. + var $footnote_counter = 1; + + + function setup() { + # + # Setting up Extra-specific variables. + # + parent::setup(); + + $this->footnotes = array(); + $this->footnotes_ordered = array(); + $this->abbr_desciptions = array(); + $this->abbr_word_re = ''; + $this->footnote_counter = 1; + + foreach ($this->predef_abbr as $abbr_word => $abbr_desc) { + if ($this->abbr_word_re) + $this->abbr_word_re .= '|'; + $this->abbr_word_re .= preg_quote($abbr_word); + $this->abbr_desciptions[$abbr_word] = trim($abbr_desc); + } + } + + function teardown() { + # + # Clearing Extra-specific variables. + # + $this->footnotes = array(); + $this->footnotes_ordered = array(); + $this->abbr_desciptions = array(); + $this->abbr_word_re = ''; + + parent::teardown(); + } + + + ### HTML Block Parser ### + + # Tags that are always treated as block tags: + var $block_tags_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|form|fieldset|iframe|hr|legend'; + + # Tags treated as block tags only if the opening tag is alone on it's line: + var $context_block_tags_re = 'script|noscript|math|ins|del'; + + # Tags where markdown="1" default to span mode: + var $contain_span_tags_re = 'p|h[1-6]|li|dd|dt|td|th|legend|address'; + + # Tags which must not have their contents modified, no matter where + # they appear: + var $clean_tags_re = 'script|math'; + + # Tags that do not need to be closed. + var $auto_close_tags_re = 'hr|img'; + + + function hashHTMLBlocks($text) { + # + # Hashify HTML Blocks and "clean tags". + # + # We only want to do this for block-level HTML tags, such as headers, + # lists, and tables. That's because we still want to wrap

    s around + # "paragraphs" that are wrapped in non-block-level tags, such as anchors, + # phrase emphasis, and spans. The list of tags we're looking for is + # hard-coded. + # + # This works by calling _HashHTMLBlocks_InMarkdown, which then calls + # _HashHTMLBlocks_InHTML when it encounter block tags. When the markdown="1" + # attribute is found whitin a tag, _HashHTMLBlocks_InHTML calls back + # _HashHTMLBlocks_InMarkdown to handle the Markdown syntax within the tag. + # These two functions are calling each other. It's recursive! + # + # + # Call the HTML-in-Markdown hasher. + # + list($text, ) = $this->_hashHTMLBlocks_inMarkdown($text); + + return $text; + } + function _hashHTMLBlocks_inMarkdown($text, $indent = 0, + $enclosing_tag_re = '', $span = false) + { + # + # Parse markdown text, calling _HashHTMLBlocks_InHTML for block tags. + # + # * $indent is the number of space to be ignored when checking for code + # blocks. This is important because if we don't take the indent into + # account, something like this (which looks right) won't work as expected: + # + #

    + #
    + # Hello World. <-- Is this a Markdown code block or text? + #
    <-- Is this a Markdown code block or a real tag? + #
    + # + # If you don't like this, just don't indent the tag on which + # you apply the markdown="1" attribute. + # + # * If $enclosing_tag_re is not empty, stops at the first unmatched closing + # tag with that name. Nested tags supported. + # + # * If $span is true, text inside must treated as span. So any double + # newline will be replaced by a single newline so that it does not create + # paragraphs. + # + # Returns an array of that form: ( processed text , remaining text ) + # + if ($text === '') return array('', ''); + + # Regex to check for the presense of newlines around a block tag. + $newline_before_re = '/(?:^\n?|\n\n)*$/'; + $newline_after_re = + '{ + ^ # Start of text following the tag. + (?>[ ]*)? # Optional comment. + [ ]*\n # Must be followed by newline. + }xs'; + + # Regex to match any tag. + $block_tag_re = + '{ + ( # $2: Capture hole tag. + # Tag name. + '.$this->block_tags_re.' | + '.$this->context_block_tags_re.' | + '.$this->clean_tags_re.' | + (?!\s)'.$enclosing_tag_re.' + ) + (?: + (?=[\s"\'/a-zA-Z0-9]) # Allowed characters after tag name. + (?> + ".*?" | # Double quotes (can contain `>`) + \'.*?\' | # Single quotes (can contain `>`) + .+? # Anything but quotes and `>`. + )*? + )? + > # End of tag. + | + # HTML Comment + | + <\?.*?\?> | <%.*?%> # Processing instruction + | + # CData Block + | + # Code span marker + `+ + '. ( !$span ? ' # If not in span. + | + # Indented code block + (?: ^[ ]*\n | ^ | \n[ ]*\n ) + [ ]{'.($indent+4).'}[^\n]* \n + (?> + (?: [ ]{'.($indent+4).'}[^\n]* | [ ]* ) \n + )* + | + # Fenced code block marker + (?> ^ | \n ) + [ ]{'.($indent).'}~~~+[ ]*\n + ' : '' ). ' # End (if not is span). + ) + }xs'; + + + $depth = 0; # Current depth inside the tag tree. + $parsed = ""; # Parsed text that will be returned. + + # + # Loop through every tag until we find the closing tag of the parent + # or loop until reaching the end of text if no parent tag specified. + # + do { + # + # Split the text using the first $tag_match pattern found. + # Text before pattern will be first in the array, text after + # pattern will be at the end, and between will be any catches made + # by the pattern. + # + $parts = preg_split($block_tag_re, $text, 2, + PREG_SPLIT_DELIM_CAPTURE); + + # If in Markdown span mode, add a empty-string span-level hash + # after each newline to prevent triggering any block element. + if ($span) { + $void = $this->hashPart("", ':'); + $newline = "$void\n"; + $parts[0] = $void . str_replace("\n", $newline, $parts[0]) . $void; + } + + $parsed .= $parts[0]; # Text before current tag. + + # If end of $text has been reached. Stop loop. + if (count($parts) < 3) { + $text = ""; + break; + } + + $tag = $parts[1]; # Tag to handle. + $text = $parts[2]; # Remaining text after current tag. + $tag_re = preg_quote($tag); # For use in a regular expression. + + # + # Check for: Code span marker + # + if ($tag{0} == "`") { + # Find corresponding end marker. + $tag_re = preg_quote($tag); + if (preg_match('{^(?>.+?|\n(?!\n))*?(?.*\n)+?'.$tag_re.' *\n}', $text, + $matches)) + { + # End marker found: pass text unchanged until marker. + $parsed .= $tag . $matches[0]; + $text = substr($text, strlen($matches[0])); + } + else { + # No end marker: just skip it. + $parsed .= $tag; + } + } + # + # Check for: Opening Block level tag or + # Opening Context Block tag (like ins and del) + # used as a block tag (tag is alone on it's line). + # + else if (preg_match('{^<(?:'.$this->block_tags_re.')\b}', $tag) || + ( preg_match('{^<(?:'.$this->context_block_tags_re.')\b}', $tag) && + preg_match($newline_before_re, $parsed) && + preg_match($newline_after_re, $text) ) + ) + { + # Need to parse tag and following text using the HTML parser. + list($block_text, $text) = + $this->_hashHTMLBlocks_inHTML($tag . $text, "hashBlock", true); + + # Make sure it stays outside of any paragraph by adding newlines. + $parsed .= "\n\n$block_text\n\n"; + } + # + # Check for: Clean tag (like script, math) + # HTML Comments, processing instructions. + # + else if (preg_match('{^<(?:'.$this->clean_tags_re.')\b}', $tag) || + $tag{1} == '!' || $tag{1} == '?') + { + # Need to parse tag and following text using the HTML parser. + # (don't check for markdown attribute) + list($block_text, $text) = + $this->_hashHTMLBlocks_inHTML($tag . $text, "hashClean", false); + + $parsed .= $block_text; + } + # + # Check for: Tag with same name as enclosing tag. + # + else if ($enclosing_tag_re !== '' && + # Same name as enclosing tag. + preg_match('{^= 0); + + return array($parsed, $text); + } + function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) { + # + # Parse HTML, calling _HashHTMLBlocks_InMarkdown for block tags. + # + # * Calls $hash_method to convert any blocks. + # * Stops when the first opening tag closes. + # * $md_attr indicate if the use of the `markdown="1"` attribute is allowed. + # (it is not inside clean tags) + # + # Returns an array of that form: ( processed text , remaining text ) + # + if ($text === '') return array('', ''); + + # Regex to match `markdown` attribute inside of a tag. + $markdown_attr_re = ' + { + \s* # Eat whitespace before the `markdown` attribute + markdown + \s*=\s* + (?> + (["\']) # $1: quote delimiter + (.*?) # $2: attribute value + \1 # matching delimiter + | + ([^\s>]*) # $3: unquoted attribute value + ) + () # $4: make $3 always defined (avoid warnings) + }xs'; + + # Regex to match any tag. + $tag_re = '{ + ( # $2: Capture hole tag. + + ".*?" | # Double quotes (can contain `>`) + \'.*?\' | # Single quotes (can contain `>`) + .+? # Anything but quotes and `>`. + )*? + )? + > # End of tag. + | + # HTML Comment + | + <\?.*?\?> | <%.*?%> # Processing instruction + | + # CData Block + ) + }xs'; + + $original_text = $text; # Save original text in case of faliure. + + $depth = 0; # Current depth inside the tag tree. + $block_text = ""; # Temporary text holder for current text. + $parsed = ""; # Parsed text that will be returned. + + # + # Get the name of the starting tag. + # (This pattern makes $base_tag_name_re safe without quoting.) + # + if (preg_match('/^<([\w:$]*)\b/', $text, $matches)) + $base_tag_name_re = $matches[1]; + + # + # Loop through every tag until we find the corresponding closing tag. + # + do { + # + # Split the text using the first $tag_match pattern found. + # Text before pattern will be first in the array, text after + # pattern will be at the end, and between will be any catches made + # by the pattern. + # + $parts = preg_split($tag_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE); + + if (count($parts) < 3) { + # + # End of $text reached with unbalenced tag(s). + # In that case, we return original text unchanged and pass the + # first character as filtered to prevent an infinite loop in the + # parent function. + # + return array($original_text{0}, substr($original_text, 1)); + } + + $block_text .= $parts[0]; # Text before current tag. + $tag = $parts[1]; # Tag to handle. + $text = $parts[2]; # Remaining text after current tag. + + # + # Check for: Auto-close tag (like
    ) + # Comments and Processing Instructions. + # + if (preg_match('{^auto_close_tags_re.')\b}', $tag) || + $tag{1} == '!' || $tag{1} == '?') + { + # Just add the tag to the block as if it was text. + $block_text .= $tag; + } + else { + # + # Increase/decrease nested tag count. Only do so if + # the tag's name match base tag's. + # + if (preg_match('{^mode = $attr_m[2] . $attr_m[3]; + $span_mode = $this->mode == 'span' || $this->mode != 'block' && + preg_match('{^<(?:'.$this->contain_span_tags_re.')\b}', $tag); + + # Calculate indent before tag. + if (preg_match('/(?:^|\n)( *?)(?! ).*?$/', $block_text, $matches)) { + $strlen = $this->utf8_strlen; + $indent = $strlen($matches[1], 'UTF-8'); + } else { + $indent = 0; + } + + # End preceding block with this tag. + $block_text .= $tag; + $parsed .= $this->$hash_method($block_text); + + # Get enclosing tag name for the ParseMarkdown function. + # (This pattern makes $tag_name_re safe without quoting.) + preg_match('/^<([\w:$]*)\b/', $tag, $matches); + $tag_name_re = $matches[1]; + + # Parse the content using the HTML-in-Markdown parser. + list ($block_text, $text) + = $this->_hashHTMLBlocks_inMarkdown($text, $indent, + $tag_name_re, $span_mode); + + # Outdent markdown text. + if ($indent > 0) { + $block_text = preg_replace("/^[ ]{1,$indent}/m", "", + $block_text); + } + + # Append tag content to parsed text. + if (!$span_mode) $parsed .= "\n\n$block_text\n\n"; + else $parsed .= "$block_text"; + + # Start over a new block. + $block_text = ""; + } + else $block_text .= $tag; + } + + } while ($depth > 0); + + # + # Hash last block text that wasn't processed inside the loop. + # + $parsed .= $this->$hash_method($block_text); + + return array($parsed, $text); + } + + + function hashClean($text) { + # + # Called whenever a tag must be hashed when a function insert a "clean" tag + # in $text, it pass through this function and is automaticaly escaped, + # blocking invalid nested overlap. + # + return $this->hashPart($text, 'C'); + } + + + function doHeaders($text) { + # + # Redefined to add id attribute support. + # + # Setext-style headers: + # Header 1 {#header1} + # ======== + # + # Header 2 {#header2} + # -------- + # + $text = preg_replace_callback( + '{ + (^.+?) # $1: Header text + (?:[ ]+\{\#([-_:a-zA-Z0-9]+)\})? # $2: Id attribute + [ ]*\n(=+|-+)[ ]*\n+ # $3: Header footer + }mx', + array(&$this, '_doHeaders_callback_setext'), $text); + + # atx-style headers: + # # Header 1 {#header1} + # ## Header 2 {#header2} + # ## Header 2 with closing hashes ## {#header3} + # ... + # ###### Header 6 {#header2} + # + $text = preg_replace_callback('{ + ^(\#{1,6}) # $1 = string of #\'s + [ ]* + (.+?) # $2 = Header text + [ ]* + \#* # optional closing #\'s (not counted) + (?:[ ]+\{\#([-_:a-zA-Z0-9]+)\})? # id attribute + [ ]* + \n+ + }xm', + array(&$this, '_doHeaders_callback_atx'), $text); + + return $text; + } + function _doHeaders_attr($attr) { + if (empty($attr)) return ""; + return " id=\"$attr\""; + } + function _doHeaders_callback_setext($matches) { + if ($matches[3] == '-' && preg_match('{^- }', $matches[1])) + return $matches[0]; + $level = $matches[3]{0} == '=' ? 1 : 2; + $attr = $this->_doHeaders_attr($id =& $matches[2]); + $block = "".$this->runSpanGamut($matches[1]).""; + return "\n" . $this->hashBlock($block) . "\n\n"; + } + function _doHeaders_callback_atx($matches) { + $level = strlen($matches[1]); + $attr = $this->_doHeaders_attr($id =& $matches[3]); + $block = "".$this->runSpanGamut($matches[2]).""; + return "\n" . $this->hashBlock($block) . "\n\n"; + } + + + function doTables($text) { + # + # Form HTML tables. + # + $less_than_tab = $this->tab_width - 1; + # + # Find tables with leading pipe. + # + # | Header 1 | Header 2 + # | -------- | -------- + # | Cell 1 | Cell 2 + # | Cell 3 | Cell 4 + # + $text = preg_replace_callback(' + { + ^ # Start of a line + [ ]{0,'.$less_than_tab.'} # Allowed whitespace. + [|] # Optional leading pipe (present) + (.+) \n # $1: Header row (at least one pipe) + + [ ]{0,'.$less_than_tab.'} # Allowed whitespace. + [|] ([ ]*[-:]+[-| :]*) \n # $2: Header underline + + ( # $3: Cells + (?> + [ ]* # Allowed whitespace. + [|] .* \n # Row content. + )* + ) + (?=\n|\Z) # Stop at final double newline. + }xm', + array(&$this, '_doTable_leadingPipe_callback'), $text); + + # + # Find tables without leading pipe. + # + # Header 1 | Header 2 + # -------- | -------- + # Cell 1 | Cell 2 + # Cell 3 | Cell 4 + # + $text = preg_replace_callback(' + { + ^ # Start of a line + [ ]{0,'.$less_than_tab.'} # Allowed whitespace. + (\S.*[|].*) \n # $1: Header row (at least one pipe) + + [ ]{0,'.$less_than_tab.'} # Allowed whitespace. + ([-:]+[ ]*[|][-| :]*) \n # $2: Header underline + + ( # $3: Cells + (?> + .* [|] .* \n # Row content + )* + ) + (?=\n|\Z) # Stop at final double newline. + }xm', + array(&$this, '_DoTable_callback'), $text); + + return $text; + } + function _doTable_leadingPipe_callback($matches) { + $head = $matches[1]; + $underline = $matches[2]; + $content = $matches[3]; + + # Remove leading pipe for each row. + $content = preg_replace('/^ *[|]/m', '', $content); + + return $this->_doTable_callback(array($matches[0], $head, $underline, $content)); + } + function _doTable_callback($matches) { + $head = $matches[1]; + $underline = $matches[2]; + $content = $matches[3]; + + # Remove any tailing pipes for each line. + $head = preg_replace('/[|] *$/m', '', $head); + $underline = preg_replace('/[|] *$/m', '', $underline); + $content = preg_replace('/[|] *$/m', '', $content); + + # Reading alignement from header underline. + $separators = preg_split('/ *[|] */', $underline); + foreach ($separators as $n => $s) { + if (preg_match('/^ *-+: *$/', $s)) $attr[$n] = ' align="right"'; + else if (preg_match('/^ *:-+: *$/', $s))$attr[$n] = ' align="center"'; + else if (preg_match('/^ *:-+ *$/', $s)) $attr[$n] = ' align="left"'; + else $attr[$n] = ''; + } + + # Parsing span elements, including code spans, character escapes, + # and inline HTML tags, so that pipes inside those gets ignored. + $head = $this->parseSpan($head); + $headers = preg_split('/ *[|] */', $head); + $col_count = count($headers); + + # Write column headers. + $text = "\n"; + $text .= "\n"; + $text .= "\n"; + foreach ($headers as $n => $header) + $text .= " ".$this->runSpanGamut(trim($header))."\n"; + $text .= "\n"; + $text .= "\n"; + + # Split content by row. + $rows = explode("\n", trim($content, "\n")); + + $text .= "\n"; + foreach ($rows as $row) { + # Parsing span elements, including code spans, character escapes, + # and inline HTML tags, so that pipes inside those gets ignored. + $row = $this->parseSpan($row); + + # Split row by cell. + $row_cells = preg_split('/ *[|] */', $row, $col_count); + $row_cells = array_pad($row_cells, $col_count, ''); + + $text .= "\n"; + foreach ($row_cells as $n => $cell) + $text .= " ".$this->runSpanGamut(trim($cell))."\n"; + $text .= "\n"; + } + $text .= "\n"; + $text .= "
    "; + + return $this->hashBlock($text) . "\n"; + } + + + function doDefLists($text) { + # + # Form HTML definition lists. + # + $less_than_tab = $this->tab_width - 1; + + # Re-usable pattern to match any entire dl list: + $whole_list_re = '(?> + ( # $1 = whole list + ( # $2 + [ ]{0,'.$less_than_tab.'} + ((?>.*\S.*\n)+) # $3 = defined term + \n? + [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition + ) + (?s:.+?) + ( # $4 + \z + | + \n{2,} + (?=\S) + (?! # Negative lookahead for another term + [ ]{0,'.$less_than_tab.'} + (?: \S.*\n )+? # defined term + \n? + [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition + ) + (?! # Negative lookahead for another definition + [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition + ) + ) + ) + )'; // mx + + $text = preg_replace_callback('{ + (?>\A\n?|(?<=\n\n)) + '.$whole_list_re.' + }mx', + array(&$this, '_doDefLists_callback'), $text); + + return $text; + } + function _doDefLists_callback($matches) { + # Re-usable patterns to match list item bullets and number markers: + $list = $matches[1]; + + # Turn double returns into triple returns, so that we can make a + # paragraph for the last item in a list, if necessary: + $result = trim($this->processDefListItems($list)); + $result = "
    \n" . $result . "\n
    "; + return $this->hashBlock($result) . "\n\n"; + } + + + function processDefListItems($list_str) { + # + # Process the contents of a single definition list, splitting it + # into individual term and definition list items. + # + $less_than_tab = $this->tab_width - 1; + + # trim trailing blank lines: + $list_str = preg_replace("/\n{2,}\\z/", "\n", $list_str); + + # Process definition terms. + $list_str = preg_replace_callback('{ + (?>\A\n?|\n\n+) # leading line + ( # definition terms = $1 + [ ]{0,'.$less_than_tab.'} # leading whitespace + (?![:][ ]|[ ]) # negative lookahead for a definition + # mark (colon) or more whitespace. + (?> \S.* \n)+? # actual term (not whitespace). + ) + (?=\n?[ ]{0,3}:[ ]) # lookahead for following line feed + # with a definition mark. + }xm', + array(&$this, '_processDefListItems_callback_dt'), $list_str); + + # Process actual definitions. + $list_str = preg_replace_callback('{ + \n(\n+)? # leading line = $1 + ( # marker space = $2 + [ ]{0,'.$less_than_tab.'} # whitespace before colon + [:][ ]+ # definition mark (colon) + ) + ((?s:.+?)) # definition text = $3 + (?= \n+ # stop at next definition mark, + (?: # next term or end of text + [ ]{0,'.$less_than_tab.'} [:][ ] | +
    | \z + ) + ) + }xm', + array(&$this, '_processDefListItems_callback_dd'), $list_str); + + return $list_str; + } + function _processDefListItems_callback_dt($matches) { + $terms = explode("\n", trim($matches[1])); + $text = ''; + foreach ($terms as $term) { + $term = $this->runSpanGamut(trim($term)); + $text .= "\n
    " . $term . "
    "; + } + return $text . "\n"; + } + function _processDefListItems_callback_dd($matches) { + $leading_line = $matches[1]; + $marker_space = $matches[2]; + $def = $matches[3]; + + if ($leading_line || preg_match('/\n{2,}/', $def)) { + # Replace marker with the appropriate whitespace indentation + $def = str_repeat(' ', strlen($marker_space)) . $def; + $def = $this->runBlockGamut($this->outdent($def . "\n\n")); + $def = "\n". $def ."\n"; + } + else { + $def = rtrim($def); + $def = $this->runSpanGamut($this->outdent($def)); + } + + return "\n
    " . $def . "
    \n"; + } + + + function doFencedCodeBlocks($text) { + # + # Adding the fenced code block syntax to regular Markdown: + # + # ~~~ + # Code block + # ~~~ + # + $less_than_tab = $this->tab_width; + + $text = preg_replace_callback('{ + (?:\n|\A) + # 1: Opening marker + ( + ~{3,} # Marker: three tilde or more. + ) + [ ]* \n # Whitespace and newline following marker. + + # 2: Content + ( + (?> + (?!\1 [ ]* \n) # Not a closing marker. + .*\n+ + )+ + ) + + # Closing marker. + \1 [ ]* \n + }xm', + array(&$this, '_doFencedCodeBlocks_callback'), $text); + + return $text; + } + function _doFencedCodeBlocks_callback($matches) { + $codeblock = $matches[2]; + $codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES); + $codeblock = preg_replace_callback('/^\n+/', + array(&$this, '_doFencedCodeBlocks_newlines'), $codeblock); + $codeblock = "
    $codeblock
    "; + return "\n\n".$this->hashBlock($codeblock)."\n\n"; + } + function _doFencedCodeBlocks_newlines($matches) { + return str_repeat("empty_element_suffix", + strlen($matches[0])); + } + + + # + # Redefining emphasis markers so that emphasis by underscore does not + # work in the middle of a word. + # + var $em_relist = array( + '' => '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? tags + # + # Strip leading and trailing lines: + $text = preg_replace('/\A\n+|\n+\z/', '', $text); + + $grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY); + + # + # Wrap

    tags and unhashify HTML blocks + # + foreach ($grafs as $key => $value) { + $value = trim($this->runSpanGamut($value)); + + # Check if this should be enclosed in a paragraph. + # Clean tag hashes & block tag hashes are left alone. + $is_p = !preg_match('/^B\x1A[0-9]+B|^C\x1A[0-9]+C$/', $value); + + if ($is_p) { + $value = "

    $value

    "; + } + $grafs[$key] = $value; + } + + # Join grafs in one text, then unhash HTML tags. + $text = implode("\n\n", $grafs); + + # Finish by removing any tag hashes still present in $text. + $text = $this->unhash($text); + + return $text; + } + + + ### Footnotes + + function stripFootnotes($text) { + # + # Strips link definitions from text, stores the URLs and titles in + # hash references. + # + $less_than_tab = $this->tab_width - 1; + + # Link defs are in the form: [^id]: url "optional title" + $text = preg_replace_callback('{ + ^[ ]{0,'.$less_than_tab.'}\[\^(.+?)\][ ]?: # note_id = $1 + [ ]* + \n? # maybe *one* newline + ( # text = $2 (no blank lines allowed) + (?: + .+ # actual text + | + \n # newlines but + (?!\[\^.+?\]:\s)# negative lookahead for footnote marker. + (?!\n+[ ]{0,3}\S)# ensure line is not blank and followed + # by non-indented content + )* + ) + }xm', + array(&$this, '_stripFootnotes_callback'), + $text); + return $text; + } + function _stripFootnotes_callback($matches) { + $note_id = $this->fn_id_prefix . $matches[1]; + $this->footnotes[$note_id] = $this->outdent($matches[2]); + return ''; # String that will replace the block + } + + + function doFootnotes($text) { + # + # Replace footnote references in $text [^id] with a special text-token + # which will be replaced by the actual footnote marker in appendFootnotes. + # + if (!$this->in_anchor) { + $text = preg_replace('{\[\^(.+?)\]}', "F\x1Afn:\\1\x1A:", $text); + } + return $text; + } + + + function appendFootnotes($text) { + # + # Append footnote list to text. + # + $text = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}', + array(&$this, '_appendFootnotes_callback'), $text); + + if (!empty($this->footnotes_ordered)) { + $text .= "\n\n"; +// $text .= "
    \n"; +// $text .= "
    empty_element_suffix ."
    \n"; + $text .= "
      \n\n"; + + $attr = ""; + if ($this->fn_backlink_class != "") { + $class = $this->fn_backlink_class; + $class = $this->encodeAttribute($class); + $attr .= " class=\"$class\""; + } + if ($this->fn_backlink_title != "") { + $title = $this->fn_backlink_title; + $title = $this->encodeAttribute($title); + $attr .= " title=\"$title\""; + } + $num = 0; + + while (!empty($this->footnotes_ordered)) { + $footnote = reset($this->footnotes_ordered); + $note_id = key($this->footnotes_ordered); + unset($this->footnotes_ordered[$note_id]); + + $footnote .= "\n"; # Need to append newline before parsing. + $footnote = $this->runBlockGamut("$footnote\n"); + $footnote = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}', + array(&$this, '_appendFootnotes_callback'), $footnote); + + $attr = str_replace("%%", ++$num, $attr); + $note_id = $this->encodeAttribute($note_id); + + # Add backlink to last paragraph; create new paragraph if needed. + $backlink = ""; + if (preg_match('{

      $}', $footnote)) { + $footnote = substr($footnote, 0, -4) . " $backlink

      "; + } else { + $footnote .= "\n\n

      $backlink

      "; + } + + $text .= "
    1. \n"; + $text .= $footnote . "\n"; + $text .= "
    2. \n\n"; + } + + $text .= "
    \n"; +// $text .= "
    "; + } + return $text; + } + function _appendFootnotes_callback($matches) { + $node_id = $this->fn_id_prefix . $matches[1]; + + # Create footnote marker only if it has a corresponding footnote *and* + # the footnote hasn't been used by another marker. + if (isset($this->footnotes[$node_id])) { + # Transfert footnote content to the ordered list. + $this->footnotes_ordered[$node_id] = $this->footnotes[$node_id]; + unset($this->footnotes[$node_id]); + + $num = $this->footnote_counter++; + $attr = ""; + if ($this->fn_link_class != "") { + $class = $this->fn_link_class; + $class = $this->encodeAttribute($class); + $attr .= " class=\"$class\""; + } + if ($this->fn_link_title != "") { + $title = $this->fn_link_title; + $title = $this->encodeAttribute($title); + $attr .= " title=\"$title\""; + } + + $attr = str_replace("%%", $num, $attr); + $node_id = $this->encodeAttribute($node_id); + + return + "". + "$num". + ""; + } + + return "[^".$matches[1]."]"; + } + + + ### Abbreviations ### + + function stripAbbreviations($text) { + # + # Strips abbreviations from text, stores titles in hash references. + # + $less_than_tab = $this->tab_width - 1; + + # Link defs are in the form: [id]*: url "optional title" + $text = preg_replace_callback('{ + ^[ ]{0,'.$less_than_tab.'}\*\[(.+?)\][ ]?: # abbr_id = $1 + (.*) # text = $2 (no blank lines allowed) + }xm', + array(&$this, '_stripAbbreviations_callback'), + $text); + return $text; + } + function _stripAbbreviations_callback($matches) { + $abbr_word = $matches[1]; + $abbr_desc = $matches[2]; + if ($this->abbr_word_re) + $this->abbr_word_re .= '|'; + $this->abbr_word_re .= preg_quote($abbr_word); + $this->abbr_desciptions[$abbr_word] = trim($abbr_desc); + return ''; # String that will replace the block + } + + + function doAbbreviations($text) { + # + # Find defined abbreviations in text and wrap them in elements. + # + if ($this->abbr_word_re) { + // cannot use the /x modifier because abbr_word_re may + // contain significant spaces: + $text = preg_replace_callback('{'. + '(?abbr_word_re.')'. + '(?![\w\x1A])'. + '}', + array(&$this, '_doAbbreviations_callback'), $text); + } + return $text; + } + function _doAbbreviations_callback($matches) { + $abbr = $matches[0]; + if (isset($this->abbr_desciptions[$abbr])) { + $desc = $this->abbr_desciptions[$abbr]; + if (empty($desc)) { + return $this->hashPart("$abbr"); + } else { + $desc = $this->encodeAttribute($desc); + return $this->hashPart("$abbr"); + } + } else { + return $matches[0]; + } + } } @@ -2905,16 +2905,16 @@ function _doAbbreviations_callback($matches) { modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. -* Neither the name "Markdown" nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. +* Neither the name "Markdown" nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited diff --git a/php/lib/readme.md b/php/lib/readme.md new file mode 100755 index 0000000..c009155 --- /dev/null +++ b/php/lib/readme.md @@ -0,0 +1,8 @@ +Dans ce répertoire on trouve des bibliothèques de fonctions PHP : + + - `markdown.php` : le convertisseur de syntaxe type wiki vers HTML. + - `smartypants.php` : un gestionnaire de micro-typographie qui travaille sur les fichiers markdown. + - `Z.php` : le système de _templates_ qui gère le HTML. + - `i18n.php` : une bibliothèque pour gérer facilement les i18n. + +À noter que ces bibliothèques ont toutes été légèrement modifiées pour des besoin de configuration ou de traduction en français. \ No newline at end of file diff --git a/php/lib/smartypants.php b/php/lib/smartypants.php old mode 100644 new mode 100755 index fa0a78d..f5dbd8e --- a/php/lib/smartypants.php +++ b/php/lib/smartypants.php @@ -67,42 +67,42 @@ function SmartyPants($text, $attr = SMARTYPANTS_ATTR) { # # Initialize the parser and return the result of its transform method. # - # Setup static parser array. - static $parser = array(); - if (!isset($parser[$attr])) { - $parser_class = SMARTYPANTS_PARSER_CLASS; - $parser[$attr] = new $parser_class($attr); - } - - # Transform text using parser. - return $parser[$attr]->transform($text); + # Setup static parser array. + static $parser = array(); + if (!isset($parser[$attr])) { + $parser_class = SMARTYPANTS_PARSER_CLASS; + $parser[$attr] = new $parser_class($attr); + } + + # Transform text using parser. + return $parser[$attr]->transform($text); } function SmartQuotes($text, $attr = 1) { - switch ($attr) { - case 0: return $text; - case 2: $attr = 'qb'; break; - default: $attr = 'q'; break; - } - return SmartyPants($text, $attr); + switch ($attr) { + case 0: return $text; + case 2: $attr = 'qb'; break; + default: $attr = 'q'; break; + } + return SmartyPants($text, $attr); } function SmartDashes($text, $attr = 1) { - switch ($attr) { - case 0: return $text; - case 2: $attr = 'D'; break; - case 3: $attr = 'i'; break; - default: $attr = 'd'; break; - } - return SmartyPants($text, $attr); + switch ($attr) { + case 0: return $text; + case 2: $attr = 'D'; break; + case 3: $attr = 'i'; break; + default: $attr = 'd'; break; + } + return SmartyPants($text, $attr); } function SmartEllipsis($text, $attr = 1) { - switch ($attr) { - case 0: return $text; - default: $attr = 'e'; break; - } - return SmartyPants($text, $attr); + switch ($attr) { + case 0: return $text; + default: $attr = 'e'; break; + } + return SmartyPants($text, $attr); } @@ -118,31 +118,31 @@ function SmartEllipsis($text, $attr = 1) { */ if (isset($wp_version)) { - # Remove default Texturize filter that would conflict with SmartyPants. - remove_filter('category_description', 'wptexturize'); - remove_filter('list_cats', 'wptexturize'); - remove_filter('comment_author', 'wptexturize'); - remove_filter('comment_text', 'wptexturize'); - remove_filter('single_post_title', 'wptexturize'); - remove_filter('the_title', 'wptexturize'); - remove_filter('the_content', 'wptexturize'); - remove_filter('the_excerpt', 'wptexturize'); - # Add SmartyPants filter with priority 10 (same as Texturize). - add_filter('category_description', 'SmartyPants', 10); - add_filter('list_cats', 'SmartyPants', 10); - add_filter('comment_author', 'SmartyPants', 10); - add_filter('comment_text', 'SmartyPants', 10); - add_filter('single_post_title', 'SmartyPants', 10); - add_filter('the_title', 'SmartyPants', 10); - add_filter('the_content', 'SmartyPants', 10); - add_filter('the_excerpt', 'SmartyPants', 10); + # Remove default Texturize filter that would conflict with SmartyPants. + remove_filter('category_description', 'wptexturize'); + remove_filter('list_cats', 'wptexturize'); + remove_filter('comment_author', 'wptexturize'); + remove_filter('comment_text', 'wptexturize'); + remove_filter('single_post_title', 'wptexturize'); + remove_filter('the_title', 'wptexturize'); + remove_filter('the_content', 'wptexturize'); + remove_filter('the_excerpt', 'wptexturize'); + # Add SmartyPants filter with priority 10 (same as Texturize). + add_filter('category_description', 'SmartyPants', 10); + add_filter('list_cats', 'SmartyPants', 10); + add_filter('comment_author', 'SmartyPants', 10); + add_filter('comment_text', 'SmartyPants', 10); + add_filter('single_post_title', 'SmartyPants', 10); + add_filter('the_title', 'SmartyPants', 10); + add_filter('the_content', 'SmartyPants', 10); + add_filter('the_excerpt', 'SmartyPants', 10); } ### Smarty Modifier Interface ### function smarty_modifier_smartypants($text, $attr = NULL) { - return SmartyPants($text, $attr); + return SmartyPants($text, $attr); } @@ -153,443 +153,443 @@ function smarty_modifier_smartypants($text, $attr = NULL) { class SmartyPants_Parser { - # Options to specify which transformations to make: - var $do_nothing = 0; - var $do_quotes = 0; - var $do_backticks = 0; - var $do_dashes = 0; - var $do_ellipses = 0; - var $do_stupefy = 0; - var $convert_quot = 0; # should we translate " entities into normal quotes? - - function SmartyPants_Parser($attr = SMARTYPANTS_ATTR) { - # - # Initialize a SmartyPants_Parser with certain attributes. - # - # Parser attributes: - # 0 : do nothing - # 1 : set all - # 2 : set all, using old school en- and em- dash shortcuts - # 3 : set all, using inverted old school en and em- dash shortcuts - # - # q : quotes - # b : backtick quotes (``double'' only) - # B : backtick quotes (``double'' and `single') - # d : dashes - # D : old school dashes - # i : inverted old school dashes - # e : ellipses - # w : convert " entities to " for Dreamweaver users - # - if ($attr == "0") { - $this->do_nothing = 1; - } - else if ($attr == "1") { - # Do everything, turn all options on. - $this->do_quotes = 1; - $this->do_backticks = 1; - $this->do_dashes = 1; - $this->do_ellipses = 1; - } - else if ($attr == "2") { - # Do everything, turn all options on, use old school dash shorthand. - $this->do_quotes = 1; - $this->do_backticks = 1; - $this->do_dashes = 2; - $this->do_ellipses = 1; - } - else if ($attr == "3") { - # Do everything, turn all options on, use inverted old school dash shorthand. - $this->do_quotes = 1; - $this->do_backticks = 1; - $this->do_dashes = 3; - $this->do_ellipses = 1; - } - else if ($attr == "-1") { - # Special "stupefy" mode. - $this->do_stupefy = 1; - } - else { - $chars = preg_split('//', $attr); - foreach ($chars as $c){ - if ($c == "q") { $this->do_quotes = 1; } - else if ($c == "b") { $this->do_backticks = 1; } - else if ($c == "B") { $this->do_backticks = 2; } - else if ($c == "d") { $this->do_dashes = 1; } - else if ($c == "D") { $this->do_dashes = 2; } - else if ($c == "i") { $this->do_dashes = 3; } - else if ($c == "e") { $this->do_ellipses = 1; } - else if ($c == "w") { $this->convert_quot = 1; } - else { - # Unknown attribute option, ignore. - } - } - } - } - - function transform($text) { - - if ($this->do_nothing) { - return $text; - } - - $tokens = $this->tokenizeHTML($text); - $result = ''; - $in_pre = 0; # Keep track of when we're inside
     or  tags.
    -
    -		$prev_token_last_char = ""; # This is a cheat, used to get some context
    -									# for one-character tokens that consist of 
    -									# just a quote char. What we do is remember
    -									# the last character of the previous text
    -									# token, to use as context to curl single-
    -									# character quote tokens correctly.
    -
    -		foreach ($tokens as $cur_token) {
    -			if ($cur_token[0] == "tag") {
    -				# Don't mess with quotes inside tags.
    -				$result .= $cur_token[1];
    -				if (preg_match('@<(/?)(?:'.SMARTYPANTS_TAGS_TO_SKIP.')[\s>]@', $cur_token[1], $matches)) {
    -					$in_pre = isset($matches[1]) && $matches[1] == '/' ? 0 : 1;
    -				}
    -			} else {
    -				$t = $cur_token[1];
    -				$last_char = substr($t, -1); # Remember last char of this token before processing.
    -				if (! $in_pre) {
    -					$t = $this->educate($t, $prev_token_last_char);
    -				}
    -				$prev_token_last_char = $last_char;
    -				$result .= $t;
    -			}
    -		}
    -
    -		return $result;
    -	}
    -
    -
    -	function educate($t, $prev_token_last_char) {
    -		$t = $this->processEscapes($t);
    -
    -		if ($this->convert_quot) {
    -			$t = preg_replace('/"/', '"', $t);
    -		}
    -
    -		if ($this->do_dashes) {
    -			if ($this->do_dashes == 1) $t = $this->educateDashes($t);
    -			if ($this->do_dashes == 2) $t = $this->educateDashesOldSchool($t);
    -			if ($this->do_dashes == 3) $t = $this->educateDashesOldSchoolInverted($t);
    -		}
    -
    -		if ($this->do_ellipses) $t = $this->educateEllipses($t);
    -
    -		# Note: backticks need to be processed before quotes.
    -		if ($this->do_backticks) {
    -			$t = $this->educateBackticks($t);
    -			if ($this->do_backticks == 2) $t = $this->educateSingleBackticks($t);
    -		}
    -
    -		if ($this->do_quotes) {
    -			if ($t == "'") {
    -				# Special case: single-character ' token
    -				if (preg_match('/\S/', $prev_token_last_char)) {
    -					$t = "’";
    -				}
    -				else {
    -					$t = "‘";
    -				}
    -			}
    -			else if ($t == '"') {
    -				# Special case: single-character " token
    -				if (preg_match('/\S/', $prev_token_last_char)) {
    -					$t = "”";
    -				}
    -				else {
    -					$t = "“";
    -				}
    -			}
    -			else {
    -				# Normal case:
    -				$t = $this->educateQuotes($t);
    -			}
    -		}
    -
    -		if ($this->do_stupefy) $t = $this->stupefyEntities($t);
    -		
    -		return $t;
    -	}
    -
    -
    -	function educateQuotes($_) {
    -	#
    -	#   Parameter:  String.
    -	#
    -	#   Returns:    The string, with "educated" curly quote HTML entities.
    -	#
    -	#   Example input:  "Isn't this fun?"
    -	#   Example output: “Isn’t this fun?”
    -	#
    -		# Make our own "punctuation" character class, because the POSIX-style
    -		# [:PUNCT:] is only available in Perl 5.6 or later:
    -		$punct_class = "[!\"#\\$\\%'()*+,-.\\/:;<=>?\\@\\[\\\\\]\\^_`{|}~]";
    -
    -		# Special case if the very first character is a quote
    -		# followed by punctuation at a non-word-break. Close the quotes by brute force:
    -		$_ = preg_replace(
    -			array("/^'(?=$punct_class\\B)/", "/^\"(?=$punct_class\\B)/"),
    -			array('’',                 '”'), $_);
    -
    -
    -		# Special case for double sets of quotes, e.g.:
    -		#   

    He said, "'Quoted' words in a larger quote."

    - $_ = preg_replace( - array("/\"'(?=\w)/", "/'\"(?=\w)/"), - array('“‘', '‘“'), $_); - - # Special case for decade abbreviations (the '80s): - $_ = preg_replace("/'(?=\\d{2}s)/", '’', $_); - - $close_class = '[^\ \t\r\n\[\{\(\-]'; - $dec_dashes = '&\#8211;|&\#8212;'; - - # Get most opening single quotes: - $_ = preg_replace("{ - ( - \\s | # a whitespace char, or -   | # a non-breaking space entity, or - -- | # dashes, or - &[mn]dash; | # named dash entities - $dec_dashes | # or decimal entities - &\\#x201[34]; # or hex - ) - ' # the quote - (?=\\w) # followed by a word character - }x", '\1‘', $_); - # Single closing quotes: - $_ = preg_replace("{ - ($close_class)? - ' - (?(1)| # If $1 captured, then do nothing; - (?=\\s | s\\b) # otherwise, positive lookahead for a whitespace - ) # char or an 's' at a word ending position. This - # is a special case to handle something like: - # \"Custer's Last Stand.\" - }xi", '\1’', $_); - - # Any remaining single quotes should be opening ones: - $_ = str_replace("'", '‘', $_); - - - # Get most opening double quotes: - $_ = preg_replace("{ - ( - \\s | # a whitespace char, or -   | # a non-breaking space entity, or - -- | # dashes, or - &[mn]dash; | # named dash entities - $dec_dashes | # or decimal entities - &\\#x201[34]; # or hex - ) - \" # the quote - (?=\\w) # followed by a word character - }x", '\1“', $_); - - # Double closing quotes: - $_ = preg_replace("{ - ($close_class)? - \" - (?(1)|(?=\\s)) # If $1 captured, then do nothing; - # if not, then make sure the next char is whitespace. - }x", '\1”', $_); - - # Any remaining quotes should be opening ones. - $_ = str_replace('"', '“', $_); - - return $_; - } - - - function educateBackticks($_) { - # - # Parameter: String. - # Returns: The string, with ``backticks'' -style double quotes - # translated into HTML curly quote entities. - # - # Example input: ``Isn't this fun?'' - # Example output: “Isn't this fun?” - # - - $_ = str_replace(array("``", "''",), - array('“', '”'), $_); - return $_; - } - - - function educateSingleBackticks($_) { - # - # Parameter: String. - # Returns: The string, with `backticks' -style single quotes - # translated into HTML curly quote entities. - # - # Example input: `Isn't this fun?' - # Example output: ‘Isn’t this fun?’ - # - - $_ = str_replace(array("`", "'",), - array('‘', '’'), $_); - return $_; - } - - - function educateDashes($_) { - # - # Parameter: String. - # - # Returns: The string, with each instance of "--" translated to - # an em-dash HTML entity. - # - - $_ = str_replace('--', '—', $_); - return $_; - } - - - function educateDashesOldSchool($_) { - # - # Parameter: String. - # - # Returns: The string, with each instance of "--" translated to - # an en-dash HTML entity, and each "---" translated to - # an em-dash HTML entity. - # - - # em en - $_ = str_replace(array("---", "--",), - array('—', '–'), $_); - return $_; - } - - - function educateDashesOldSchoolInverted($_) { - # - # Parameter: String. - # - # Returns: The string, with each instance of "--" translated to - # an em-dash HTML entity, and each "---" translated to - # an en-dash HTML entity. Two reasons why: First, unlike the - # en- and em-dash syntax supported by - # EducateDashesOldSchool(), it's compatible with existing - # entries written before SmartyPants 1.1, back when "--" was - # only used for em-dashes. Second, em-dashes are more - # common than en-dashes, and so it sort of makes sense that - # the shortcut should be shorter to type. (Thanks to Aaron - # Swartz for the idea.) - # - - # en em - $_ = str_replace(array("---", "--",), - array('–', '—'), $_); - return $_; - } - - - function educateEllipses($_) { - # - # Parameter: String. - # Returns: The string, with each instance of "..." translated to - # an ellipsis HTML entity. Also converts the case where - # there are spaces between the dots. - # - # Example input: Huh...? - # Example output: Huh…? - # - - $_ = str_replace(array("...", ". . .",), '…', $_); - return $_; - } - - - function stupefyEntities($_) { - # - # Parameter: String. - # Returns: The string, with each SmartyPants HTML entity translated to - # its ASCII counterpart. - # - # Example input: “Hello — world.” - # Example output: "Hello -- world." - # - - # en-dash em-dash - $_ = str_replace(array('–', '—'), - array('-', '--'), $_); - - # single quote open close - $_ = str_replace(array('‘', '’'), "'", $_); - - # double quote open close - $_ = str_replace(array('“', '”'), '"', $_); - - $_ = str_replace('…', '...', $_); # ellipsis - - return $_; - } - - - function processEscapes($_) { - # - # Parameter: String. - # Returns: The string, with after processing the following backslash - # escape sequences. This is useful if you want to force a "dumb" - # quote or other character to appear. - # - # Escape Value - # ------ ----- - # \\ \ - # \" " - # \' ' - # \. . - # \- - - # \` ` - # - $_ = str_replace( - array('\\\\', '\"', "\'", '\.', '\-', '\`'), - array('\', '"', ''', '.', '-', '`'), $_); - - return $_; - } - - - function tokenizeHTML($str) { - # - # Parameter: String containing HTML markup. - # Returns: An array of the tokens comprising the input - # string. Each token is either a tag (possibly with nested, - # tags contained therein, such as , or a - # run of text between tags. Each element of the array is a - # two-element array; the first is either 'tag' or 'text'; - # the second is the actual value. - # - # - # Regular expression derived from the _tokenize() subroutine in - # Brad Choate's MTRegex plugin. - # - # - $index = 0; - $tokens = array(); - - $match = '(?s:)|'. # comment - '(?s:<\?.*?\?>)|'. # processing instruction - # regular tags - '(?:<[/!$]?[-a-zA-Z0-9:]+\b(?>[^"\'>]+|"[^"]*"|\'[^\']*\')*>)'; - - $parts = preg_split("{($match)}", $str, -1, PREG_SPLIT_DELIM_CAPTURE); - - foreach ($parts as $part) { - if (++$index % 2 && $part != '') - $tokens[] = array('text', $part); - else - $tokens[] = array('tag', $part); - } - return $tokens; - } + # Options to specify which transformations to make: + var $do_nothing = 0; + var $do_quotes = 0; + var $do_backticks = 0; + var $do_dashes = 0; + var $do_ellipses = 0; + var $do_stupefy = 0; + var $convert_quot = 0; # should we translate " entities into normal quotes? + + function SmartyPants_Parser($attr = SMARTYPANTS_ATTR) { + # + # Initialize a SmartyPants_Parser with certain attributes. + # + # Parser attributes: + # 0 : do nothing + # 1 : set all + # 2 : set all, using old school en- and em- dash shortcuts + # 3 : set all, using inverted old school en and em- dash shortcuts + # + # q : quotes + # b : backtick quotes (``double'' only) + # B : backtick quotes (``double'' and `single') + # d : dashes + # D : old school dashes + # i : inverted old school dashes + # e : ellipses + # w : convert " entities to " for Dreamweaver users + # + if ($attr == "0") { + $this->do_nothing = 1; + } + else if ($attr == "1") { + # Do everything, turn all options on. + $this->do_quotes = 1; + $this->do_backticks = 1; + $this->do_dashes = 1; + $this->do_ellipses = 1; + } + else if ($attr == "2") { + # Do everything, turn all options on, use old school dash shorthand. + $this->do_quotes = 1; + $this->do_backticks = 1; + $this->do_dashes = 2; + $this->do_ellipses = 1; + } + else if ($attr == "3") { + # Do everything, turn all options on, use inverted old school dash shorthand. + $this->do_quotes = 1; + $this->do_backticks = 1; + $this->do_dashes = 3; + $this->do_ellipses = 1; + } + else if ($attr == "-1") { + # Special "stupefy" mode. + $this->do_stupefy = 1; + } + else { + $chars = preg_split('//', $attr); + foreach ($chars as $c){ + if ($c == "q") { $this->do_quotes = 1; } + else if ($c == "b") { $this->do_backticks = 1; } + else if ($c == "B") { $this->do_backticks = 2; } + else if ($c == "d") { $this->do_dashes = 1; } + else if ($c == "D") { $this->do_dashes = 2; } + else if ($c == "i") { $this->do_dashes = 3; } + else if ($c == "e") { $this->do_ellipses = 1; } + else if ($c == "w") { $this->convert_quot = 1; } + else { + # Unknown attribute option, ignore. + } + } + } + } + + function transform($text) { + + if ($this->do_nothing) { + return $text; + } + + $tokens = $this->tokenizeHTML($text); + $result = ''; + $in_pre = 0; # Keep track of when we're inside
     or  tags.
    +
    +        $prev_token_last_char = ""; # This is a cheat, used to get some context
    +                                    # for one-character tokens that consist of 
    +                                    # just a quote char. What we do is remember
    +                                    # the last character of the previous text
    +                                    # token, to use as context to curl single-
    +                                    # character quote tokens correctly.
    +
    +        foreach ($tokens as $cur_token) {
    +            if ($cur_token[0] == "tag") {
    +                # Don't mess with quotes inside tags.
    +                $result .= $cur_token[1];
    +                if (preg_match('@<(/?)(?:'.SMARTYPANTS_TAGS_TO_SKIP.')[\s>]@', $cur_token[1], $matches)) {
    +                    $in_pre = isset($matches[1]) && $matches[1] == '/' ? 0 : 1;
    +                }
    +            } else {
    +                $t = $cur_token[1];
    +                $last_char = substr($t, -1); # Remember last char of this token before processing.
    +                if (! $in_pre) {
    +                    $t = $this->educate($t, $prev_token_last_char);
    +                }
    +                $prev_token_last_char = $last_char;
    +                $result .= $t;
    +            }
    +        }
    +
    +        return $result;
    +    }
    +
    +
    +    function educate($t, $prev_token_last_char) {
    +        $t = $this->processEscapes($t);
    +
    +        if ($this->convert_quot) {
    +            $t = preg_replace('/"/', '"', $t);
    +        }
    +
    +        if ($this->do_dashes) {
    +            if ($this->do_dashes == 1) $t = $this->educateDashes($t);
    +            if ($this->do_dashes == 2) $t = $this->educateDashesOldSchool($t);
    +            if ($this->do_dashes == 3) $t = $this->educateDashesOldSchoolInverted($t);
    +        }
    +
    +        if ($this->do_ellipses) $t = $this->educateEllipses($t);
    +
    +        # Note: backticks need to be processed before quotes.
    +        if ($this->do_backticks) {
    +            $t = $this->educateBackticks($t);
    +            if ($this->do_backticks == 2) $t = $this->educateSingleBackticks($t);
    +        }
    +
    +        if ($this->do_quotes) {
    +            if ($t == "'") {
    +                # Special case: single-character ' token
    +                if (preg_match('/\S/', $prev_token_last_char)) {
    +                    $t = "’";
    +                }
    +                else {
    +                    $t = "‘";
    +                }
    +            }
    +            else if ($t == '"') {
    +                # Special case: single-character " token
    +                if (preg_match('/\S/', $prev_token_last_char)) {
    +                    $t = "”";
    +                }
    +                else {
    +                    $t = "“";
    +                }
    +            }
    +            else {
    +                # Normal case:
    +                $t = $this->educateQuotes($t);
    +            }
    +        }
    +
    +        if ($this->do_stupefy) $t = $this->stupefyEntities($t);
    +        
    +        return $t;
    +    }
    +
    +
    +    function educateQuotes($_) {
    +    #
    +    #   Parameter:  String.
    +    #
    +    #   Returns:    The string, with "educated" curly quote HTML entities.
    +    #
    +    #   Example input:  "Isn't this fun?"
    +    #   Example output: “Isn’t this fun?”
    +    #
    +        # Make our own "punctuation" character class, because the POSIX-style
    +        # [:PUNCT:] is only available in Perl 5.6 or later:
    +        $punct_class = "[!\"#\\$\\%'()*+,-.\\/:;<=>?\\@\\[\\\\\]\\^_`{|}~]";
    +
    +        # Special case if the very first character is a quote
    +        # followed by punctuation at a non-word-break. Close the quotes by brute force:
    +        $_ = preg_replace(
    +            array("/^'(?=$punct_class\\B)/", "/^\"(?=$punct_class\\B)/"),
    +            array('’',                 '”'), $_);
    +
    +
    +        # Special case for double sets of quotes, e.g.:
    +        #   

    He said, "'Quoted' words in a larger quote."

    + $_ = preg_replace( + array("/\"'(?=\w)/", "/'\"(?=\w)/"), + array('“‘', '‘“'), $_); + + # Special case for decade abbreviations (the '80s): + $_ = preg_replace("/'(?=\\d{2}s)/", '’', $_); + + $close_class = '[^\ \t\r\n\[\{\(\-]'; + $dec_dashes = '&\#8211;|&\#8212;'; + + # Get most opening single quotes: + $_ = preg_replace("{ + ( + \\s | # a whitespace char, or +   | # a non-breaking space entity, or + -- | # dashes, or + &[mn]dash; | # named dash entities + $dec_dashes | # or decimal entities + &\\#x201[34]; # or hex + ) + ' # the quote + (?=\\w) # followed by a word character + }x", '\1‘', $_); + # Single closing quotes: + $_ = preg_replace("{ + ($close_class)? + ' + (?(1)| # If $1 captured, then do nothing; + (?=\\s | s\\b) # otherwise, positive lookahead for a whitespace + ) # char or an 's' at a word ending position. This + # is a special case to handle something like: + # \"Custer's Last Stand.\" + }xi", '\1’', $_); + + # Any remaining single quotes should be opening ones: + $_ = str_replace("'", '‘', $_); + + + # Get most opening double quotes: + $_ = preg_replace("{ + ( + \\s | # a whitespace char, or +   | # a non-breaking space entity, or + -- | # dashes, or + &[mn]dash; | # named dash entities + $dec_dashes | # or decimal entities + &\\#x201[34]; # or hex + ) + \" # the quote + (?=\\w) # followed by a word character + }x", '\1“', $_); + + # Double closing quotes: + $_ = preg_replace("{ + ($close_class)? + \" + (?(1)|(?=\\s)) # If $1 captured, then do nothing; + # if not, then make sure the next char is whitespace. + }x", '\1”', $_); + + # Any remaining quotes should be opening ones. + $_ = str_replace('"', '“', $_); + + return $_; + } + + + function educateBackticks($_) { + # + # Parameter: String. + # Returns: The string, with ``backticks'' -style double quotes + # translated into HTML curly quote entities. + # + # Example input: ``Isn't this fun?'' + # Example output: “Isn't this fun?” + # + + $_ = str_replace(array("``", "''",), + array('“', '”'), $_); + return $_; + } + + + function educateSingleBackticks($_) { + # + # Parameter: String. + # Returns: The string, with `backticks' -style single quotes + # translated into HTML curly quote entities. + # + # Example input: `Isn't this fun?' + # Example output: ‘Isn’t this fun?’ + # + + $_ = str_replace(array("`", "'",), + array('‘', '’'), $_); + return $_; + } + + + function educateDashes($_) { + # + # Parameter: String. + # + # Returns: The string, with each instance of "--" translated to + # an em-dash HTML entity. + # + + $_ = str_replace('--', '—', $_); + return $_; + } + + + function educateDashesOldSchool($_) { + # + # Parameter: String. + # + # Returns: The string, with each instance of "--" translated to + # an en-dash HTML entity, and each "---" translated to + # an em-dash HTML entity. + # + + # em en + $_ = str_replace(array("---", "--",), + array('—', '–'), $_); + return $_; + } + + + function educateDashesOldSchoolInverted($_) { + # + # Parameter: String. + # + # Returns: The string, with each instance of "--" translated to + # an em-dash HTML entity, and each "---" translated to + # an en-dash HTML entity. Two reasons why: First, unlike the + # en- and em-dash syntax supported by + # EducateDashesOldSchool(), it's compatible with existing + # entries written before SmartyPants 1.1, back when "--" was + # only used for em-dashes. Second, em-dashes are more + # common than en-dashes, and so it sort of makes sense that + # the shortcut should be shorter to type. (Thanks to Aaron + # Swartz for the idea.) + # + + # en em + $_ = str_replace(array("---", "--",), + array('–', '—'), $_); + return $_; + } + + + function educateEllipses($_) { + # + # Parameter: String. + # Returns: The string, with each instance of "..." translated to + # an ellipsis HTML entity. Also converts the case where + # there are spaces between the dots. + # + # Example input: Huh...? + # Example output: Huh…? + # + + $_ = str_replace(array("...", ". . .",), '…', $_); + return $_; + } + + + function stupefyEntities($_) { + # + # Parameter: String. + # Returns: The string, with each SmartyPants HTML entity translated to + # its ASCII counterpart. + # + # Example input: “Hello — world.” + # Example output: "Hello -- world." + # + + # en-dash em-dash + $_ = str_replace(array('–', '—'), + array('-', '--'), $_); + + # single quote open close + $_ = str_replace(array('‘', '’'), "'", $_); + + # double quote open close + $_ = str_replace(array('“', '”'), '"', $_); + + $_ = str_replace('…', '...', $_); # ellipsis + + return $_; + } + + + function processEscapes($_) { + # + # Parameter: String. + # Returns: The string, with after processing the following backslash + # escape sequences. This is useful if you want to force a "dumb" + # quote or other character to appear. + # + # Escape Value + # ------ ----- + # \\ \ + # \" " + # \' ' + # \. . + # \- - + # \` ` + # + $_ = str_replace( + array('\\\\', '\"', "\'", '\.', '\-', '\`'), + array('\', '"', ''', '.', '-', '`'), $_); + + return $_; + } + + + function tokenizeHTML($str) { + # + # Parameter: String containing HTML markup. + # Returns: An array of the tokens comprising the input + # string. Each token is either a tag (possibly with nested, + # tags contained therein, such as
    , or a + # run of text between tags. Each element of the array is a + # two-element array; the first is either 'tag' or 'text'; + # the second is the actual value. + # + # + # Regular expression derived from the _tokenize() subroutine in + # Brad Choate's MTRegex plugin. + # + # + $index = 0; + $tokens = array(); + + $match = '(?s:)|'. # comment + '(?s:<\?.*?\?>)|'. # processing instruction + # regular tags + '(?:<[/!$]?[-a-zA-Z0-9:]+\b(?>[^"\'>]+|"[^"]*"|\'[^\']*\')*>)'; + + $parts = preg_split("{($match)}", $str, -1, PREG_SPLIT_DELIM_CAPTURE); + + foreach ($parts as $part) { + if (++$index % 2 && $part != '') + $tokens[] = array('text', $part); + else + $tokens[] = array('tag', $part); + } + return $tokens; + } } @@ -599,506 +599,506 @@ function tokenizeHTML($str) { # class SmartyPantsTypographer_Parser extends SmartyPants_Parser { - # Options to specify which transformations to make: - var $do_comma_quotes = 0; - var $do_guillemets = 0; - var $do_space_emdash = 0; - var $do_space_endash = 0; - var $do_space_colon = 0; - var $do_space_semicolon = 0; - var $do_space_marks = 0; - var $do_space_frenchquote = 0; - var $do_space_thousand = 0; - var $do_space_unit = 0; - - # Smart quote characters: - var $smart_doublequote_open = SMARTYPANTS_SMART_DOUBLEQUOTE_OPEN; - var $smart_doublequote_close = SMARTYPANTS_SMART_DOUBLEQUOTE_CLOSE; - var $smart_singlequote_open = '‘'; - var $smart_singlequote_close = '’'; # Also apostrophe. - - # Space characters for different places: - var $space_emdash = SMARTYPANTS_SPACE_EMDASH; - var $space_endash = SMARTYPANTS_SPACE_ENDASH; - var $space_colon = SMARTYPANTS_SPACE_COLON; - var $space_semicolon = SMARTYPANTS_SPACE_SEMICOLON; - var $space_marks = SMARTYPANTS_SPACE_MARKS; - var $space_frenchquote = SMARTYPANTS_SPACE_FRENCHQUOTE; - var $space_thousand = SMARTYPANTS_SPACE_THOUSAND; - var $space_unit = SMARTYPANTS_SPACE_UNIT; - - # Expression of a space (breakable or not): - var $space = '(?: | | |�*160;|�*[aA]0;)'; - - - - function SmartyPantsTypographer_Parser($attr = SMARTYPANTS_ATTR) { - # - # Initialize a SmartyPantsTypographer_Parser with certain attributes. - # - # Parser attributes: - # 0 : do nothing - # 1 : set all, except dash spacing - # 2 : set all, except dash spacing, using old school en- and em- dash shortcuts - # 3 : set all, except dash spacing, using inverted old school en and em- dash shortcuts - # - # Punctuation: - # q -> quotes - # b -> backtick quotes (``double'' only) - # B -> backtick quotes (``double'' and `single') - # c -> comma quotes (,,double`` only) - # g -> guillemets (<> only) - # d -> dashes - # D -> old school dashes - # i -> inverted old school dashes - # e -> ellipses - # w -> convert " entities to " for Dreamweaver users - # - # Spacing: - # : -> colon spacing +- - # ; -> semicolon spacing +- - # m -> question and exclamation marks spacing +- - # h -> em-dash spacing +- - # H -> en-dash spacing +- - # f -> french quote spacing +- - # t -> thousand separator spacing - - # u -> unit spacing +- - # (you can add a plus sign after some of these options denoted by + to - # add the space when it is not already present, or you can add a minus - # sign to completly remove any space present) - # - # Initialize inherited SmartyPants parser. - parent::SmartyPants_Parser($attr); - - if ($attr == "1" || $attr == "2" || $attr == "3") { - # Do everything, turn all options on. - $this->do_comma_quotes = 1; - $this->do_guillemets = 1; - $this->do_space_emdash = 1; - $this->do_space_endash = 1; - $this->do_space_colon = 1; - $this->do_space_semicolon = 1; - $this->do_space_marks = 1; - $this->do_space_frenchquote = 1; - $this->do_space_thousand = 1; - $this->do_space_unit = 1; - } - else if ($attr == "-1") { - # Special "stupefy" mode. - $this->do_stupefy = 1; - } - else { - $chars = preg_split('//', $attr); - foreach ($chars as $c){ - if ($c == "c") { $current =& $this->do_comma_quotes; } - else if ($c == "g") { $current =& $this->do_guillemets; } - else if ($c == ":") { $current =& $this->do_space_colon; } - else if ($c == ";") { $current =& $this->do_space_semicolon; } - else if ($c == "m") { $current =& $this->do_space_marks; } - else if ($c == "h") { $current =& $this->do_space_emdash; } - else if ($c == "H") { $current =& $this->do_space_endash; } - else if ($c == "f") { $current =& $this->do_space_frenchquote; } - else if ($c == "t") { $current =& $this->do_space_thousand; } - else if ($c == "u") { $current =& $this->do_space_unit; } - else if ($c == "+") { - $current = 2; - unset($current); - } - else if ($c == "-") { - $current = -1; - unset($current); - } - else { - # Unknown attribute option, ignore. - } - $current = 1; - } - } - } - - - function educate($t, $prev_token_last_char) { - $t = parent::educate($t, $prev_token_last_char); - - if ($this->do_comma_quotes) $t = $this->educateCommaQuotes($t); - if ($this->do_guillemets) $t = $this->educateGuillemets($t); - - if ($this->do_space_emdash) $t = $this->spaceEmDash($t); - if ($this->do_space_endash) $t = $this->spaceEnDash($t); - if ($this->do_space_colon) $t = $this->spaceColon($t); - if ($this->do_space_semicolon) $t = $this->spaceSemicolon($t); - if ($this->do_space_marks) $t = $this->spaceMarks($t); - if ($this->do_space_frenchquote) $t = $this->spaceFrenchQuotes($t); - if ($this->do_space_thousand) $t = $this->spaceThousandSeparator($t); - if ($this->do_space_unit) $t = $this->spaceUnit($t); - - return $t; - } - - - function educateQuotes($_) { - # - # Parameter: String. - # - # Returns: The string, with "educated" curly quote HTML entities. - # - # Example input: "Isn't this fun?" - # Example output: “Isn’t this fun?” - # - $dq_open = $this->smart_doublequote_open; - $dq_close = $this->smart_doublequote_close; - $sq_open = $this->smart_singlequote_open; - $sq_close = $this->smart_singlequote_close; - - # Make our own "punctuation" character class, because the POSIX-style - # [:PUNCT:] is only available in Perl 5.6 or later: - $punct_class = "[!\"#\\$\\%'()*+,-.\\/:;<=>?\\@\\[\\\\\]\\^_`{|}~]"; - - # Special case if the very first character is a quote - # followed by punctuation at a non-word-break. Close the quotes by brute force: - $_ = preg_replace( - array("/^'(?=$punct_class\\B)/", "/^\"(?=$punct_class\\B)/"), - array($sq_close, $dq_close), $_); - - # Special case for double sets of quotes, e.g.: - #

    He said, "'Quoted' words in a larger quote."

    - $_ = preg_replace( - array("/\"'(?=\w)/", "/'\"(?=\w)/"), - array($dq_open.$sq_open, $sq_open.$dq_open), $_); - - # Special case for decade abbreviations (the '80s): - $_ = preg_replace("/'(?=\\d{2}s)/", $sq_close, $_); - - $close_class = '[^\ \t\r\n\[\{\(\-]'; - $dec_dashes = '&\#8211;|&\#8212;'; - - # Get most opening single quotes: - $_ = preg_replace("{ - ( - \\s | # a whitespace char, or -   | # a non-breaking space entity, or - -- | # dashes, or - &[mn]dash; | # named dash entities - $dec_dashes | # or decimal entities - &\\#x201[34]; # or hex - ) - ' # the quote - (?=\\w) # followed by a word character - }x", '\1'.$sq_open, $_); - # Single closing quotes: - $_ = preg_replace("{ - ($close_class)? - ' - (?(1)| # If $1 captured, then do nothing; - (?=\\s | s\\b) # otherwise, positive lookahead for a whitespace - ) # char or an 's' at a word ending position. This - # is a special case to handle something like: - # \"Custer's Last Stand.\" - }xi", '\1'.$sq_close, $_); - - # Any remaining single quotes should be opening ones: - $_ = str_replace("'", $sq_open, $_); - - - # Get most opening double quotes: - $_ = preg_replace("{ - ( - \\s | # a whitespace char, or -   | # a non-breaking space entity, or - -- | # dashes, or - &[mn]dash; | # named dash entities - $dec_dashes | # or decimal entities - &\\#x201[34]; # or hex - ) - \" # the quote - (?=\\w) # followed by a word character - }x", '\1'.$dq_open, $_); - - # Double closing quotes: - $_ = preg_replace("{ - ($close_class)? - \" - (?(1)|(?=\\s)) # If $1 captured, then do nothing; - # if not, then make sure the next char is whitespace. - }x", '\1'.$dq_close, $_); - - # Any remaining quotes should be opening ones. - $_ = str_replace('"', $dq_open, $_); - - return $_; - } - - - function educateCommaQuotes($_) { - # - # Parameter: String. - # Returns: The string, with ,,comma,, -style double quotes - # translated into HTML curly quote entities. - # - # Example input: ,,Isn't this fun?,, - # Example output: „Isn't this fun?„ - # - # Note: this is meant to be used alongside with backtick quotes; there is - # no language that use only lower quotations alone mark like in the example. - # - $_ = str_replace(",,", '„', $_); - return $_; - } - - - function educateGuillemets($_) { - # - # Parameter: String. - # Returns: The string, with << guillemets >> -style quotes - # translated into HTML guillemets entities. - # - # Example input: << Isn't this fun? >> - # Example output: „ Isn't this fun? „ - # - $_ = preg_replace("/(?:<|<){2}/", '«', $_); - $_ = preg_replace("/(?:>|>){2}/", '»', $_); - return $_; - } - - - function spaceFrenchQuotes($_) { - # - # Parameters: String, replacement character, and forcing flag. - # Returns: The string, with appropriates spaces replaced - # inside french-style quotes, only french quotes. - # - # Example input: Quotes in « French », »German« and »Finnish» style. - # Example output: Quotes in «_French_», »German« and »Finnish» style. - # - $opt = ( $this->do_space_frenchquote == 2 ? '?' : '' ); - $chr = ( $this->do_space_frenchquote != -1 ? $this->space_frenchquote : '' ); - - # Characters allowed immediatly outside quotes. - $outside_char = $this->space . '|\s|[.,:;!?\[\](){}|@*~=+-]|¡|¿'; - - $_ = preg_replace( - "/(^|$outside_char)(«|«|›|‹)$this->space$opt/", - "\\1\\2$chr", $_); - $_ = preg_replace( - "/$this->space$opt(»|»|‹|›)($outside_char|$)/", - "$chr\\1\\2", $_); - return $_; - } - - - function spaceColon($_) { - # - # Parameters: String, replacement character, and forcing flag. - # Returns: The string, with appropriates spaces replaced - # before colons. - # - # Example input: Ingredients : fun. - # Example output: Ingredients_: fun. - # - $opt = ( $this->do_space_colon == 2 ? '?' : '' ); - $chr = ( $this->do_space_colon != -1 ? $this->space_colon : '' ); - - $_ = preg_replace("/$this->space$opt(:)(\\s|$)/m", - "$chr\\1\\2", $_); - return $_; - } - - - function spaceSemicolon($_) { - # - # Parameters: String, replacement character, and forcing flag. - # Returns: The string, with appropriates spaces replaced - # before semicolons. - # - # Example input: There he goes ; there she goes. - # Example output: There he goes_; there she goes. - # - $opt = ( $this->do_space_semicolon == 2 ? '?' : '' ); - $chr = ( $this->do_space_semicolon != -1 ? $this->space_semicolon : '' ); - - $_ = preg_replace("/$this->space(;)(?=\\s|$)/m", - " \\1", $_); - $_ = preg_replace("/((?:^|\\s)(?>[^&;\\s]+|&#?[a-zA-Z0-9]+;)*)". - " $opt(;)(?=\\s|$)/m", - "\\1$chr\\2", $_); - return $_; - } - - - function spaceMarks($_) { - # - # Parameters: String, replacement character, and forcing flag. - # Returns: The string, with appropriates spaces replaced - # around question and exclamation marks. - # - # Example input: ¡ Holà ! What ? - # Example output: ¡_Holà_! What_? - # - $opt = ( $this->do_space_marks == 2 ? '?' : '' ); - $chr = ( $this->do_space_marks != -1 ? $this->space_marks : '' ); - - // Regular marks. - $_ = preg_replace("/$this->space$opt([?!]+)/", "$chr\\1", $_); - - // Inverted marks. - $imarks = "(?:¡|¡|¡|&#x[Aa]1;|¿|¿|¿|&#x[Bb][Ff];)"; - $_ = preg_replace("/($imarks+)$this->space$opt/", "\\1$chr", $_); - - return $_; - } - - - function spaceEmDash($_) { - # - # Parameters: String, two replacement characters separated by a hyphen (`-`), - # and forcing flag. - # - # Returns: The string, with appropriates spaces replaced - # around dashes. - # - # Example input: Then — without any plan — the fun happend. - # Example output: Then_—_without any plan_—_the fun happend. - # - $opt = ( $this->do_space_emdash == 2 ? '?' : '' ); - $chr = ( $this->do_space_emdash != -1 ? $this->space_emdash : '' ); - $_ = preg_replace("/$this->space$opt(—|—)$this->space$opt/", - "$chr\\1$chr", $_); - return $_; - } - - - function spaceEnDash($_) { - # - # Parameters: String, two replacement characters separated by a hyphen (`-`), - # and forcing flag. - # - # Returns: The string, with appropriates spaces replaced - # around dashes. - # - # Example input: Then — without any plan — the fun happend. - # Example output: Then_—_without any plan_—_the fun happend. - # - $opt = ( $this->do_space_endash == 2 ? '?' : '' ); - $chr = ( $this->do_space_endash != -1 ? $this->space_endash : '' ); - $_ = preg_replace("/$this->space$opt(–|–)$this->space$opt/", - "$chr\\1$chr", $_); - return $_; - } - - - function spaceThousandSeparator($_) { - # - # Parameters: String, replacement character, and forcing flag. - # Returns: The string, with appropriates spaces replaced - # inside numbers (thousand separator in french). - # - # Example input: Il y a 10 000 insectes amusants dans ton jardin. - # Example output: Il y a 10_000 insectes amusants dans ton jardin. - # - $chr = ( $this->do_space_thousand != -1 ? $this->space_thousand : '' ); - $_ = preg_replace('/([0-9]) ([0-9])/', "\\1$chr\\2", $_); - return $_; - } - - - var $units = ' - ### Metric units (with prefixes) - (?: - p | - µ | µ | &\#0*181; | &\#[xX]0*[Bb]5; | - [mcdhkMGT] - )? - (?: - [mgstAKNJWCVFSTHBL]|mol|cd|rad|Hz|Pa|Wb|lm|lx|Bq|Gy|Sv|kat| - Ω | Ohm | Ω | &\#0*937; | &\#[xX]0*3[Aa]9; - )| - ### Computers units (KB, Kb, TB, Kbps) - [kKMGT]?(?:[oBb]|[oBb]ps|flops)| - ### Money - ¢ | ¢ | &\#0*162; | &\#[xX]0*[Aa]2; | - M?(?: - £ | £ | &\#0*163; | &\#[xX]0*[Aa]3; | - ¥ | ¥ | &\#0*165; | &\#[xX]0*[Aa]5; | - € | € | &\#0*8364; | &\#[xX]0*20[Aa][Cc]; | - $ - )| - ### Other units - (?: ° | ° | &\#0*176; | &\#[xX]0*[Bb]0; ) [CF]? | - %|pt|pi|M?px|em|en|gal|lb|[NSEOW]|[NS][EOW]|ha|mbar - '; //x - - function spaceUnit($_) { - # - # Parameters: String, replacement character, and forcing flag. - # Returns: The string, with appropriates spaces replaced - # before unit symbols. - # - # Example input: Get 3 mol of fun for 3 $. - # Example output: Get 3_mol of fun for 3_$. - # - $opt = ( $this->do_space_unit == 2 ? '?' : '' ); - $chr = ( $this->do_space_unit != -1 ? $this->space_unit : '' ); - - $_ = preg_replace('/ - (?:([0-9])[ ]'.$opt.') # Number followed by space. - ('.$this->units.') # Unit. - (?![a-zA-Z0-9]) # Negative lookahead for other unit characters. - /x', - "\\1$chr\\2", $_); - - return $_; - } - - - function spaceAbbr($_) { - # - # Parameters: String, replacement character, and forcing flag. - # Returns: The string, with appropriates spaces replaced - # around abbreviations. - # - # Example input: Fun i.e. something pleasant. - # Example output: Fun i.e._something pleasant. - # - $opt = ( $this->do_space_abbr == 2 ? '?' : '' ); - - $_ = preg_replace("/(^|\s)($this->abbr_after) $opt/m", - "\\1\\2$this->space_abbr", $_); - $_ = preg_replace("/( )$opt($this->abbr_sp_before)(?![a-zA-Z'])/m", - "\\1$this->space_abbr\\2", $_); - return $_; - } - - - function stupefyEntities($_) { - # - # Adding angle quotes and lower quotes to SmartyPants's stupefy mode. - # - $_ = parent::stupefyEntities($_); - - $_ = str_replace(array('„', '«', '»'), '"', $_); - - return $_; - } - - - function processEscapes($_) { - # - # Adding a few more escapes to SmartyPants's escapes: - # - # Escape Value - # ------ ----- - # \, , - # \< < - # \> > - # - $_ = parent::processEscapes($_); - - $_ = str_replace( - array('\,', '\<', '\>', '\<', '\>'), - array(',', '<', '>', '<', '>'), $_); - - return $_; - } + # Options to specify which transformations to make: + var $do_comma_quotes = 0; + var $do_guillemets = 0; + var $do_space_emdash = 0; + var $do_space_endash = 0; + var $do_space_colon = 0; + var $do_space_semicolon = 0; + var $do_space_marks = 0; + var $do_space_frenchquote = 0; + var $do_space_thousand = 0; + var $do_space_unit = 0; + + # Smart quote characters: + var $smart_doublequote_open = SMARTYPANTS_SMART_DOUBLEQUOTE_OPEN; + var $smart_doublequote_close = SMARTYPANTS_SMART_DOUBLEQUOTE_CLOSE; + var $smart_singlequote_open = '‘'; + var $smart_singlequote_close = '’'; # Also apostrophe. + + # Space characters for different places: + var $space_emdash = SMARTYPANTS_SPACE_EMDASH; + var $space_endash = SMARTYPANTS_SPACE_ENDASH; + var $space_colon = SMARTYPANTS_SPACE_COLON; + var $space_semicolon = SMARTYPANTS_SPACE_SEMICOLON; + var $space_marks = SMARTYPANTS_SPACE_MARKS; + var $space_frenchquote = SMARTYPANTS_SPACE_FRENCHQUOTE; + var $space_thousand = SMARTYPANTS_SPACE_THOUSAND; + var $space_unit = SMARTYPANTS_SPACE_UNIT; + + # Expression of a space (breakable or not): + var $space = '(?: | | |�*160;|�*[aA]0;)'; + + + + function SmartyPantsTypographer_Parser($attr = SMARTYPANTS_ATTR) { + # + # Initialize a SmartyPantsTypographer_Parser with certain attributes. + # + # Parser attributes: + # 0 : do nothing + # 1 : set all, except dash spacing + # 2 : set all, except dash spacing, using old school en- and em- dash shortcuts + # 3 : set all, except dash spacing, using inverted old school en and em- dash shortcuts + # + # Punctuation: + # q -> quotes + # b -> backtick quotes (``double'' only) + # B -> backtick quotes (``double'' and `single') + # c -> comma quotes (,,double`` only) + # g -> guillemets (<> only) + # d -> dashes + # D -> old school dashes + # i -> inverted old school dashes + # e -> ellipses + # w -> convert " entities to " for Dreamweaver users + # + # Spacing: + # : -> colon spacing +- + # ; -> semicolon spacing +- + # m -> question and exclamation marks spacing +- + # h -> em-dash spacing +- + # H -> en-dash spacing +- + # f -> french quote spacing +- + # t -> thousand separator spacing - + # u -> unit spacing +- + # (you can add a plus sign after some of these options denoted by + to + # add the space when it is not already present, or you can add a minus + # sign to completly remove any space present) + # + # Initialize inherited SmartyPants parser. + parent::SmartyPants_Parser($attr); + + if ($attr == "1" || $attr == "2" || $attr == "3") { + # Do everything, turn all options on. + $this->do_comma_quotes = 1; + $this->do_guillemets = 1; + $this->do_space_emdash = 1; + $this->do_space_endash = 1; + $this->do_space_colon = 1; + $this->do_space_semicolon = 1; + $this->do_space_marks = 1; + $this->do_space_frenchquote = 1; + $this->do_space_thousand = 1; + $this->do_space_unit = 1; + } + else if ($attr == "-1") { + # Special "stupefy" mode. + $this->do_stupefy = 1; + } + else { + $chars = preg_split('//', $attr); + foreach ($chars as $c){ + if ($c == "c") { $current =& $this->do_comma_quotes; } + else if ($c == "g") { $current =& $this->do_guillemets; } + else if ($c == ":") { $current =& $this->do_space_colon; } + else if ($c == ";") { $current =& $this->do_space_semicolon; } + else if ($c == "m") { $current =& $this->do_space_marks; } + else if ($c == "h") { $current =& $this->do_space_emdash; } + else if ($c == "H") { $current =& $this->do_space_endash; } + else if ($c == "f") { $current =& $this->do_space_frenchquote; } + else if ($c == "t") { $current =& $this->do_space_thousand; } + else if ($c == "u") { $current =& $this->do_space_unit; } + else if ($c == "+") { + $current = 2; + unset($current); + } + else if ($c == "-") { + $current = -1; + unset($current); + } + else { + # Unknown attribute option, ignore. + } + $current = 1; + } + } + } + + + function educate($t, $prev_token_last_char) { + $t = parent::educate($t, $prev_token_last_char); + + if ($this->do_comma_quotes) $t = $this->educateCommaQuotes($t); + if ($this->do_guillemets) $t = $this->educateGuillemets($t); + + if ($this->do_space_emdash) $t = $this->spaceEmDash($t); + if ($this->do_space_endash) $t = $this->spaceEnDash($t); + if ($this->do_space_colon) $t = $this->spaceColon($t); + if ($this->do_space_semicolon) $t = $this->spaceSemicolon($t); + if ($this->do_space_marks) $t = $this->spaceMarks($t); + if ($this->do_space_frenchquote) $t = $this->spaceFrenchQuotes($t); + if ($this->do_space_thousand) $t = $this->spaceThousandSeparator($t); + if ($this->do_space_unit) $t = $this->spaceUnit($t); + + return $t; + } + + + function educateQuotes($_) { + # + # Parameter: String. + # + # Returns: The string, with "educated" curly quote HTML entities. + # + # Example input: "Isn't this fun?" + # Example output: “Isn’t this fun?” + # + $dq_open = $this->smart_doublequote_open; + $dq_close = $this->smart_doublequote_close; + $sq_open = $this->smart_singlequote_open; + $sq_close = $this->smart_singlequote_close; + + # Make our own "punctuation" character class, because the POSIX-style + # [:PUNCT:] is only available in Perl 5.6 or later: + $punct_class = "[!\"#\\$\\%'()*+,-.\\/:;<=>?\\@\\[\\\\\]\\^_`{|}~]"; + + # Special case if the very first character is a quote + # followed by punctuation at a non-word-break. Close the quotes by brute force: + $_ = preg_replace( + array("/^'(?=$punct_class\\B)/", "/^\"(?=$punct_class\\B)/"), + array($sq_close, $dq_close), $_); + + # Special case for double sets of quotes, e.g.: + #

    He said, "'Quoted' words in a larger quote."

    + $_ = preg_replace( + array("/\"'(?=\w)/", "/'\"(?=\w)/"), + array($dq_open.$sq_open, $sq_open.$dq_open), $_); + + # Special case for decade abbreviations (the '80s): + $_ = preg_replace("/'(?=\\d{2}s)/", $sq_close, $_); + + $close_class = '[^\ \t\r\n\[\{\(\-]'; + $dec_dashes = '&\#8211;|&\#8212;'; + + # Get most opening single quotes: + $_ = preg_replace("{ + ( + \\s | # a whitespace char, or +   | # a non-breaking space entity, or + -- | # dashes, or + &[mn]dash; | # named dash entities + $dec_dashes | # or decimal entities + &\\#x201[34]; # or hex + ) + ' # the quote + (?=\\w) # followed by a word character + }x", '\1'.$sq_open, $_); + # Single closing quotes: + $_ = preg_replace("{ + ($close_class)? + ' + (?(1)| # If $1 captured, then do nothing; + (?=\\s | s\\b) # otherwise, positive lookahead for a whitespace + ) # char or an 's' at a word ending position. This + # is a special case to handle something like: + # \"Custer's Last Stand.\" + }xi", '\1'.$sq_close, $_); + + # Any remaining single quotes should be opening ones: + $_ = str_replace("'", $sq_open, $_); + + + # Get most opening double quotes: + $_ = preg_replace("{ + ( + \\s | # a whitespace char, or +   | # a non-breaking space entity, or + -- | # dashes, or + &[mn]dash; | # named dash entities + $dec_dashes | # or decimal entities + &\\#x201[34]; # or hex + ) + \" # the quote + (?=\\w) # followed by a word character + }x", '\1'.$dq_open, $_); + + # Double closing quotes: + $_ = preg_replace("{ + ($close_class)? + \" + (?(1)|(?=\\s)) # If $1 captured, then do nothing; + # if not, then make sure the next char is whitespace. + }x", '\1'.$dq_close, $_); + + # Any remaining quotes should be opening ones. + $_ = str_replace('"', $dq_open, $_); + + return $_; + } + + + function educateCommaQuotes($_) { + # + # Parameter: String. + # Returns: The string, with ,,comma,, -style double quotes + # translated into HTML curly quote entities. + # + # Example input: ,,Isn't this fun?,, + # Example output: „Isn't this fun?„ + # + # Note: this is meant to be used alongside with backtick quotes; there is + # no language that use only lower quotations alone mark like in the example. + # + $_ = str_replace(",,", '„', $_); + return $_; + } + + + function educateGuillemets($_) { + # + # Parameter: String. + # Returns: The string, with << guillemets >> -style quotes + # translated into HTML guillemets entities. + # + # Example input: << Isn't this fun? >> + # Example output: „ Isn't this fun? „ + # + $_ = preg_replace("/(?:<|<){2}/", '«', $_); + $_ = preg_replace("/(?:>|>){2}/", '»', $_); + return $_; + } + + + function spaceFrenchQuotes($_) { + # + # Parameters: String, replacement character, and forcing flag. + # Returns: The string, with appropriates spaces replaced + # inside french-style quotes, only french quotes. + # + # Example input: Quotes in « French », »German« and »Finnish» style. + # Example output: Quotes in «_French_», »German« and »Finnish» style. + # + $opt = ( $this->do_space_frenchquote == 2 ? '?' : '' ); + $chr = ( $this->do_space_frenchquote != -1 ? $this->space_frenchquote : '' ); + + # Characters allowed immediatly outside quotes. + $outside_char = $this->space . '|\s|[.,:;!?\[\](){}|@*~=+-]|¡|¿'; + + $_ = preg_replace( + "/(^|$outside_char)(«|«|›|‹)$this->space$opt/", + "\\1\\2$chr", $_); + $_ = preg_replace( + "/$this->space$opt(»|»|‹|›)($outside_char|$)/", + "$chr\\1\\2", $_); + return $_; + } + + + function spaceColon($_) { + # + # Parameters: String, replacement character, and forcing flag. + # Returns: The string, with appropriates spaces replaced + # before colons. + # + # Example input: Ingredients : fun. + # Example output: Ingredients_: fun. + # + $opt = ( $this->do_space_colon == 2 ? '?' : '' ); + $chr = ( $this->do_space_colon != -1 ? $this->space_colon : '' ); + + $_ = preg_replace("/$this->space$opt(:)(\\s|$)/m", + "$chr\\1\\2", $_); + return $_; + } + + + function spaceSemicolon($_) { + # + # Parameters: String, replacement character, and forcing flag. + # Returns: The string, with appropriates spaces replaced + # before semicolons. + # + # Example input: There he goes ; there she goes. + # Example output: There he goes_; there she goes. + # + $opt = ( $this->do_space_semicolon == 2 ? '?' : '' ); + $chr = ( $this->do_space_semicolon != -1 ? $this->space_semicolon : '' ); + + $_ = preg_replace("/$this->space(;)(?=\\s|$)/m", + " \\1", $_); + $_ = preg_replace("/((?:^|\\s)(?>[^&;\\s]+|&#?[a-zA-Z0-9]+;)*)". + " $opt(;)(?=\\s|$)/m", + "\\1$chr\\2", $_); + return $_; + } + + + function spaceMarks($_) { + # + # Parameters: String, replacement character, and forcing flag. + # Returns: The string, with appropriates spaces replaced + # around question and exclamation marks. + # + # Example input: ¡ Holà ! What ? + # Example output: ¡_Holà_! What_? + # + $opt = ( $this->do_space_marks == 2 ? '?' : '' ); + $chr = ( $this->do_space_marks != -1 ? $this->space_marks : '' ); + + // Regular marks. + $_ = preg_replace("/$this->space$opt([?!]+)/", "$chr\\1", $_); + + // Inverted marks. + $imarks = "(?:¡|¡|¡|&#x[Aa]1;|¿|¿|¿|&#x[Bb][Ff];)"; + $_ = preg_replace("/($imarks+)$this->space$opt/", "\\1$chr", $_); + + return $_; + } + + + function spaceEmDash($_) { + # + # Parameters: String, two replacement characters separated by a hyphen (`-`), + # and forcing flag. + # + # Returns: The string, with appropriates spaces replaced + # around dashes. + # + # Example input: Then — without any plan — the fun happend. + # Example output: Then_—_without any plan_—_the fun happend. + # + $opt = ( $this->do_space_emdash == 2 ? '?' : '' ); + $chr = ( $this->do_space_emdash != -1 ? $this->space_emdash : '' ); + $_ = preg_replace("/$this->space$opt(—|—)$this->space$opt/", + "$chr\\1$chr", $_); + return $_; + } + + + function spaceEnDash($_) { + # + # Parameters: String, two replacement characters separated by a hyphen (`-`), + # and forcing flag. + # + # Returns: The string, with appropriates spaces replaced + # around dashes. + # + # Example input: Then — without any plan — the fun happend. + # Example output: Then_—_without any plan_—_the fun happend. + # + $opt = ( $this->do_space_endash == 2 ? '?' : '' ); + $chr = ( $this->do_space_endash != -1 ? $this->space_endash : '' ); + $_ = preg_replace("/$this->space$opt(–|–)$this->space$opt/", + "$chr\\1$chr", $_); + return $_; + } + + + function spaceThousandSeparator($_) { + # + # Parameters: String, replacement character, and forcing flag. + # Returns: The string, with appropriates spaces replaced + # inside numbers (thousand separator in french). + # + # Example input: Il y a 10 000 insectes amusants dans ton jardin. + # Example output: Il y a 10_000 insectes amusants dans ton jardin. + # + $chr = ( $this->do_space_thousand != -1 ? $this->space_thousand : '' ); + $_ = preg_replace('/([0-9]) ([0-9])/', "\\1$chr\\2", $_); + return $_; + } + + + var $units = ' + ### Metric units (with prefixes) + (?: + p | + µ | µ | &\#0*181; | &\#[xX]0*[Bb]5; | + [mcdhkMGT] + )? + (?: + [mgstAKNJWCVFSTHBL]|mol|cd|rad|Hz|Pa|Wb|lm|lx|Bq|Gy|Sv|kat| + Ω | Ohm | Ω | &\#0*937; | &\#[xX]0*3[Aa]9; + )| + ### Computers units (KB, Kb, TB, Kbps) + [kKMGT]?(?:[oBb]|[oBb]ps|flops)| + ### Money + ¢ | ¢ | &\#0*162; | &\#[xX]0*[Aa]2; | + M?(?: + £ | £ | &\#0*163; | &\#[xX]0*[Aa]3; | + ¥ | ¥ | &\#0*165; | &\#[xX]0*[Aa]5; | + € | € | &\#0*8364; | &\#[xX]0*20[Aa][Cc]; | + $ + )| + ### Other units + (?: ° | ° | &\#0*176; | &\#[xX]0*[Bb]0; ) [CF]? | + %|pt|pi|M?px|em|en|gal|lb|[NSEOW]|[NS][EOW]|ha|mbar + '; //x + + function spaceUnit($_) { + # + # Parameters: String, replacement character, and forcing flag. + # Returns: The string, with appropriates spaces replaced + # before unit symbols. + # + # Example input: Get 3 mol of fun for 3 $. + # Example output: Get 3_mol of fun for 3_$. + # + $opt = ( $this->do_space_unit == 2 ? '?' : '' ); + $chr = ( $this->do_space_unit != -1 ? $this->space_unit : '' ); + + $_ = preg_replace('/ + (?:([0-9])[ ]'.$opt.') # Number followed by space. + ('.$this->units.') # Unit. + (?![a-zA-Z0-9]) # Negative lookahead for other unit characters. + /x', + "\\1$chr\\2", $_); + + return $_; + } + + + function spaceAbbr($_) { + # + # Parameters: String, replacement character, and forcing flag. + # Returns: The string, with appropriates spaces replaced + # around abbreviations. + # + # Example input: Fun i.e. something pleasant. + # Example output: Fun i.e._something pleasant. + # + $opt = ( $this->do_space_abbr == 2 ? '?' : '' ); + + $_ = preg_replace("/(^|\s)($this->abbr_after) $opt/m", + "\\1\\2$this->space_abbr", $_); + $_ = preg_replace("/( )$opt($this->abbr_sp_before)(?![a-zA-Z'])/m", + "\\1$this->space_abbr\\2", $_); + return $_; + } + + + function stupefyEntities($_) { + # + # Adding angle quotes and lower quotes to SmartyPants's stupefy mode. + # + $_ = parent::stupefyEntities($_); + + $_ = str_replace(array('„', '«', '»'), '"', $_); + + return $_; + } + + + function processEscapes($_) { + # + # Adding a few more escapes to SmartyPants's escapes: + # + # Escape Value + # ------ ----- + # \, , + # \< < + # \> > + # + $_ = parent::processEscapes($_); + + $_ = str_replace( + array('\,', '\<', '\>', '\<', '\>'), + array(',', '<', '>', '<', '>'), $_); + + return $_; + } } @@ -1132,7 +1132,7 @@ function processEscapes($_) { One situation in which quotes will get curled the wrong way is when apostrophes are used at the start of leading contractions. For example: - 'Twas the night before Christmas. + 'Twas the night before Christmas. In the case above, SmartyPants will turn the apostrophe into an opening single-quote, when in fact it should be a closing one. I don't think @@ -1157,16 +1157,16 @@ function processEscapes($_) { Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. -* Neither the name "SmartyPants" nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. +* Neither the name "SmartyPants" nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the diff --git a/php/readme.md b/php/readme.md new file mode 100755 index 0000000..41694f5 --- /dev/null +++ b/php/readme.md @@ -0,0 +1 @@ +Dans ce répertoire on trouve les fichiers PHP du projet, et plus particulièrement dans `lib` des bibliothèques de fonctions. \ No newline at end of file diff --git a/readme.md b/readme.md old mode 100644 new mode 100755 index b723054..3d5840b --- a/readme.md +++ b/readme.md @@ -1,13 +1,63 @@ # outline -[#grid](https://github.com/dotjay/hashgrid) + [Compass](https://github.com/chriseppstein/compass) + [Z](https://github.com/Cerdic/Z) + [Normalize](https://github.com/necolas/normalize.css) - Outline compile quelques bons outils pour fournir un _template_ de travail modulaire aux intégrateurs chez [Clever Garden](http://www.clever-age.com/societe/nos-entites/clever-garden.html). -Il propose par exemple : +--- + +Nous essayons de **capitaliser** un maximum sur nos techniques de travail côté intégration ; +ce qui passe par une mutualisation d'un certain nombre de choses et la mise en place d'outils génériques. + +Cependant, les contextes projets sont variés ; et les intégrateurs ont également des façons de travailler différentes. + +De nombreuses sites proposent des initiatives équivalentes ([Boilerplate](http://html5boilerplate.com/), [Bootstrap](http://twitter.github.com/bootstrap/) etc.) +mais il semblait plus logique de construire un outil adapté à nos besoins plutôt que de devoir adapter nos projets à un certain nombres de contraintes imposées. + +Il nous fallait donc des outils puissants mais aussi très **flexibles**, sans pour autant réinventer la roue. + +C'est avec cet objectif en vue qu'une base de travail à été mise en place sur l'ensemble des projets qui passent entre nos mains. +Elle est est composée d'un ensemble d'outils existants, soigneusement choisis et évolue au fil du temps +(en fonction des évolutions de nos métiers et des retours d'expérience de tout le monde). + +--- + +À ce jour la bibliothèque comprend : + + - une arborescence pour permettre d'organiser ses fichiers de manière logique ; + - un système de gabarits pour ne pas avoir à répéter inutilement des morceaux de HTML ; + - un préprocesseur CSS pour automatiser au mieux les opérations récurrentes ; + - des utilitaires CSS qui proposent déjà une factorisation sur les techniques les plus employées ; + - un système de grille verticale pour améliorer la cohérence graphique et faciliter la conception ; + - un système de grille horizontal pour garantir une bonne lisibilité ; + - un outil pour contrôler la grille car c'est un sujet complexe à mettre en place ; + - une normalisation des styles pour assurer une base homogène inter-navigateurs ; + - la possibilité de produire des images génériques pour mimer au mieux les futures contributions ; + - un système de traductions pour facilement tester la flexibilité de nos intégrations ; + - une détection des navigateurs pour offrir une solution de repli lorsque les méthodes classiques ont échouées ; + - des utilitaires JS pour là encore répondre aux demandes les plus courantes ; + - la possibilité de simuler des composants Flash, pour s'assurer de leur bonne mise en action ; + - une page de tests pour s'assurer du bon rendu des polices ; + - une page de suivi du travail effectué et de son niveau de qualité pour informer le chef de projet ou le client ; + - une page de documentation pour expliciter les choix faits et les structures réalisées ; + - et sans doute d’autres choses plus ou moins importantes que j'oublie. + +--- + +Ce qui se traduit techniquement par tout un tas de choses : + + - [Z](https://github.com/Cerdic/Z) ; + - [SASS](http://sass-lang.com/) ; + - [Compass](http://compass-style.org/) ; + - [normalize.css](http://necolas.github.com/normalize.css/) ; + - [#grid](http://hashgrid.com/) ; + - [Dummy Image](http://dummyimage.com/) ; + - [Browser detect](http://www.quirksmode.org/js/detect.html) ; + - [jQuery](http://jquery.com/) ; + - [Modernizr](http://modernizr.com/) ; + - [Markdown extra](http://michelf.ca/projets/php-markdown/extra/) ; + - [Web Font Specimen](http://wfs.typographisme.net/) ; + - [OPQUAST](https://checklists.opquast.com/fr/opquastv2?q=int%C3%A9gration+xhtml/css) ; + - ... + +--- - - de travailler avec une grille verticale configurable ; - - de respecter facilement un rythme vertical (lui aussi configurable) ; - - de suivre et de documenter le projet ; - - de limiter les codes redondants au niveau HTML ; - - etc. \ No newline at end of file +Tout ceci est hébergé ici-même et manque encore un peu de documentation. Mais nous y travaillons ! \ No newline at end of file diff --git a/robots.md b/robots.md new file mode 100755 index 0000000..7fcef47 --- /dev/null +++ b/robots.md @@ -0,0 +1,10 @@ +`robots.txt` permet de définir des règles d'indexation pour les moteurs de recherche (attention ses règles sont publiques et ne sont pas toujours respectées). + +C'est également dans ce fichier qu'on déclare le `sitemap.xml` du site. + +--- + +`humans.txt` est le pendant de robots.txt dans lequel on peut renseigner des informations telles que les technologies ou les logiciels employées, ou encore les participants au projet. C'est un espace libre. + + - http://www.robotstxt.org/ + - http://www.humanstxt.org/ \ No newline at end of file diff --git a/robots.txt b/robots.txt new file mode 100755 index 0000000..4466ff2 --- /dev/null +++ b/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +# Disallow: / + +# Sitemap: http://.../sitemap.xml \ No newline at end of file diff --git a/scss/_core.scss b/scss/_core.scss new file mode 100755 index 0000000..f98c94c --- /dev/null +++ b/scss/_core.scss @@ -0,0 +1,7 @@ +/** --- @section CORE --- */ + +@import "core/config"; +@import "core/mixins"; +@import "core/mq"; + + \ No newline at end of file diff --git a/scss/_doc-screen.scss b/scss/_doc-screen.scss deleted file mode 100644 index 0f73519..0000000 --- a/scss/_doc-screen.scss +++ /dev/null @@ -1,74 +0,0 @@ -#page.index -{ - @media only screen and (max-width:1000px) // 940px - { - th:nth-child(3), // IE6 - td:nth-child(3), - th:nth-child(4), // IE7 - td:nth-child(4), - th:nth-child(5), // IE8 - td:nth-child(5), - th:nth-child(6), // IE9 - td:nth-child(6), - th:nth-child(7), // Opera - td:nth-child(7), - th:nth-child(8), // Chrome - td:nth-child(8), - th:nth-child(9), // Safari - td:nth-child(9), - th:nth-child(10), // Fx - td:nth-child(10), - th:nth-child(11), // Lynx - td:nth-child(11), - th:nth-child(12), // Impression - td:nth-child(12) - { - @include hide; - background-color: red; - } - } -} -#page.index, -#page.doc -{ - margin: auto; - width: $blueprint-container-size-screen; - - @media only screen and (max-width:1000px) // 940px - { - width: $blueprint-container-size-tablet; - } - @media only screen and (max-width:840px) // 780px - { - width: auto; - margin: 0 $blueprint-grid-margin; - } - - img - { - display: block; - } - h1 - { - float: right; - - @media only screen and (max-width:840px) // 780px - { - float: none; - } - } - .footnotes - { - ol - { - $fs: 10px; - - @include bloc($fs); - - p - { - @include margin-bottom(0.5, $fs); - } - } - } -} \ No newline at end of file diff --git a/scss/_doc.scss b/scss/_doc.scss new file mode 100755 index 0000000..f7d4481 --- /dev/null +++ b/scss/_doc.scss @@ -0,0 +1,4 @@ +/** --- @section DOC --- */ + +@import "doc/print"; +@import "doc/screen"; \ No newline at end of file diff --git a/scss/_footer.scss b/scss/_footer.scss deleted file mode 100644 index 8266a15..0000000 --- a/scss/_footer.scss +++ /dev/null @@ -1,3 +0,0 @@ -/************************************************/ -/* FOOTER */ -/************************************************/ diff --git a/scss/_forms.scss b/scss/_forms.scss deleted file mode 100644 index a8a3f41..0000000 --- a/scss/_forms.scss +++ /dev/null @@ -1,51 +0,0 @@ -/********************************************/ -/* FORMULAIRES */ -/********************************************/ - -form -{ - p, - .p - { - @include min-height(2); - } -} - -input, -textarea -{ - width: 208px; - padding: 5px; - border: 1px solid #333; -} -input[type=radio], -input[type=checkbox] -{ - width: auto; - padding: 0; - border: 0; -} -input.radio, -input.checkbox -{ - width: auto; - padding: 0; - border: 0; -} -button, -select, -input[type=reset], -input[type=button], -input[type=submit], -input.reset, -input.button, -input.submit -{ - width: 220px; - padding: 5px; - border: 1px solid #333; -} -select -{ - padding: 4px; -} \ No newline at end of file diff --git a/scss/_global.scss b/scss/_global.scss deleted file mode 100644 index 59b0136..0000000 --- a/scss/_global.scss +++ /dev/null @@ -1,15 +0,0 @@ -/********************************************/ -/* ÉLÉMENTS D'INTERFACE */ -/********************************************/ - -a -{ - text-decoration: underline; - - &:hover, - &:active, - &:focus - { - text-decoration: none; - } -} \ No newline at end of file diff --git a/scss/_header.scss b/scss/_header.scss deleted file mode 100644 index 3e4683c..0000000 --- a/scss/_header.scss +++ /dev/null @@ -1,3 +0,0 @@ -/************************************************/ -/* HEADER */ -/************************************************/ diff --git a/scss/_libs.scss b/scss/_libs.scss new file mode 100755 index 0000000..f2b54f6 --- /dev/null +++ b/scss/_libs.scss @@ -0,0 +1,5 @@ +/** --- @section LIBS --- */ + +@import "libs/bourbon"; +@import "libs/compass"; +@import "libs/normalize"; \ No newline at end of file diff --git a/scss/_plugins.scss b/scss/_plugins.scss new file mode 100755 index 0000000..da4ad11 --- /dev/null +++ b/scss/_plugins.scss @@ -0,0 +1,4 @@ +/** --- @section JS PLUGINS --- */ + +@import "plugins/hashgrid"; // remove when producing + \ No newline at end of file diff --git a/scss/_print.scss b/scss/_print.scss deleted file mode 100644 index dbae784..0000000 --- a/scss/_print.scss +++ /dev/null @@ -1,3 +0,0 @@ -/********************************************/ -/* PRINT */ -/********************************************/ \ No newline at end of file diff --git a/scss/_project.scss b/scss/_project.scss new file mode 100755 index 0000000..e854d32 --- /dev/null +++ b/scss/_project.scss @@ -0,0 +1,5 @@ +/** --- @section PROJECT --- */ + +@import "project/ui"; +@import "project/layout"; +@import "project/pages"; \ No newline at end of file diff --git a/scss/_screen.scss b/scss/_screen.scss deleted file mode 100644 index 7bce63a..0000000 --- a/scss/_screen.scss +++ /dev/null @@ -1,103 +0,0 @@ -/********************************************/ -/* STYLES COMMUNS À TOUTES LES PAGES */ -/********************************************/ -#page -{ - margin: auto; - width: $blueprint-container-size-screen; - - @media only screen and (max-width:1000px) // 940px - { - width: $blueprint-container-size-tablet; - } - @media only screen and (max-width:840px) // 780px - { - width: auto; - margin: 0 $blueprint-grid-margin; - } -} -#page.demo -{ - nav - { - ul - { - @include list; - } - } - .colleft - { - @include column($blueprint-grid-columns-screen / 2, true); - @include border-gutter; - @include margin-bottom; - @include padding-top; - } - .colright - { - @include column($blueprint-grid-columns-screen / 2, true); - @include margin-bottom; - @include padding-top; - } - form - { - @media only screen and (max-width:840px) // 780px - { - @include hide; - } - } - .large - { - $fs1: 18px; - - @include bloc($fs1); - - span - { - $fs2: 14px; - - @include font-size($fs2, lines-for-font-size($fs2), $fs1); - } - } - .small - { - $fs1: 10px; - - @include font-size($fs1); - @include margin-bottom(1, $fs1); - } - header - { - @include border-bottom; - @include padding; - @include margin-bottom; - @include has-layout; - } - section - { - @include prepend(1); - @include column($blueprint-grid-columns-screen / 2 - 1); - @include border; - - @media only screen and (max-width:1000px) // 940px - { - width: auto; - float: none; - padding-left: 0; - margin-right: 0; - @include margin-bottom(1); - } - } - article - { - @include column($blueprint-grid-columns-screen / 2, true); - @include border; - background-color: #000; - color: #FFF; - - @media only screen and (max-width:1000px) // 940px - { - width: auto; - float: none; - } - } -} \ No newline at end of file diff --git a/scss/_sidebar.scss b/scss/_sidebar.scss deleted file mode 100644 index c713516..0000000 --- a/scss/_sidebar.scss +++ /dev/null @@ -1,3 +0,0 @@ -/********************************************/ -/* SIDEBAR */ -/********************************************/ diff --git a/scss/_sprites.scss b/scss/_sprites.scss deleted file mode 100644 index eb5261f..0000000 --- a/scss/_sprites.scss +++ /dev/null @@ -1,3 +0,0 @@ -/********************************************/ -/* SPRITES */ -/********************************************/ \ No newline at end of file diff --git a/scss/_typo.scss b/scss/_typo.scss deleted file mode 100644 index f257b82..0000000 --- a/scss/_typo.scss +++ /dev/null @@ -1,4 +0,0 @@ -/********************************************/ -/* TYPOGRAPHIE */ -/********************************************/ - diff --git a/scss/_variables.scss b/scss/_variables.scss deleted file mode 100644 index c0d129e..0000000 --- a/scss/_variables.scss +++ /dev/null @@ -1,24 +0,0 @@ -$default-rhythm-border-color: #000; - -$base-font-size: 14px; -$base-line-height: 20px; - -$blueprint-grid-width: 60px; -$blueprint-grid-margin: 20px; - -$blueprint-grid-columns-screen: 12; -$blueprint-grid-columns-tablet: 10; -$blueprint-grid-columns-mobile: 1; - -$blueprint-grid-outer-width : $blueprint-grid-width + $blueprint-grid-margin; - -$blueprint-container-size-screen : $blueprint-grid-outer-width * $blueprint-grid-columns-screen - $blueprint-grid-margin; -$blueprint-container-size-tablet : $blueprint-grid-outer-width * $blueprint-grid-columns-tablet - $blueprint-grid-margin; -$blueprint-container-size-mobile : $blueprint-grid-outer-width * $blueprint-grid-columns-mobile - $blueprint-grid-margin; - - -// Couleurs - - -// Divers -$margin: $blueprint-grid-margin; \ No newline at end of file diff --git a/scss/core/_config.scss b/scss/core/_config.scss new file mode 100755 index 0000000..9d3bc68 --- /dev/null +++ b/scss/core/_config.scss @@ -0,0 +1,58 @@ +/** --- @section PROJECT CONFIG --- */ + +$base-line-height: 20px !default; +$base-font-size: round($base-line-height / 3 * 2) !default; + +$column-width: 60px !default; +$gutter-width: 20px !default; +$grid-padding: $gutter-width !default; + +$rythm-unit: 'em' !default; + $grid-unit: 'em' !default; + +$browser-font-size: 16px !default; // Necessary for media queries + +/** RWD breakpints */ + +$columns-S: 8 !default; +$columns-M: 12 !default; +$columns-L: 16 !default; + + +// Name your breakpoints in a way that creates a ubiquitous language +// across team members. It will improve communication between +// stakeholders, designers, developers, and testers. +$mq-breakpoints: ( + (mobile 300px) + (tablet 600px) + (desktop 1024px) + (wide 1400px) +) !default; + + +// Define the breakpoint from the $mq-breakpoints list that should +// be used as the target width when outputting a static stylesheet +// (i.e. when $mq-responsive is set to 'false'). +$mq-static-breakpoint: desktop !default; + + +// To enable support for browsers that do not support @media queries, +// (IE <= 8, Firefox <= 3, Opera <= 9) set $mq-responsive to false +// Create a separate stylesheet served exclusively to these browsers, +// meaning @media queries will be rasterized, relying on the cascade itself +$mq-responsive: true !default; + + +/** Shortcuts */ + +$l: $base-line-height !default; // line-height +$m: $gutter-width !default; // margin +$fs: $base-font-size !default; // font-size + +/** IE compatibility */ + +$lte-ie8: false !default; + +$legacy-support-for-ie: false !default; // Disable Compass compatibility for both IE6 and IE7 +//$legacy-support-for-ie6: false !default; // Disable Compass compatibility for IE6 only +//$legacy-support-for-ie7: false !default; // Disable Compass compatibility for IE7 only \ No newline at end of file diff --git a/scss/core/_mixins.scss b/scss/core/_mixins.scss new file mode 100755 index 0000000..cdac784 --- /dev/null +++ b/scss/core/_mixins.scss @@ -0,0 +1,568 @@ +/** --- @section CUSTOM MIXINS --- */ + +@if $rythm-unit == 'px' +{ + @if $grid-unit == 'em' + { + @warn "$grid-unit is set to 'em' and $rythm-unit is set to 'px' : doesn't work."; + + $grid-unit: 'px'; + } + + $relative-font-sizing: false; + $font-unit: $base-font-size; +} + +@function outline-unit($to, $from: $base-font-size) +{ + @if $grid-unit == 'px' + { + @return $to; + } + @else if $grid-unit == 'em' + { + @return $font-unit * $to / $from; + } +} + +/* -------------------------------------------------------------------------- */ + +/** @subsection EM calculator */ +/** @author https://gist.github.com/ijy/1441967 */ + +@function em($target, $context: $base-font-size) +{ + @if $target == 0 { @return 0 } + @return 1em * $target / $context; +} + +/* -------------------------------------------------------------------------- */ + +// @mixin mq($value, $fallback: false, $min-max: max, $width-height: width) +// { +// @if ($fallback == true) +// { +// @content; + +// body:before +// { +// content: $fallback; +// } +// } +// @else +// { +// @if $value == 0px or $value == '' or $value == 0 or $value == null +// { +// @content; + + +// body:before +// { +// content: $fallback; +// } +// } + +// @else +// { +// // We need the media queries to use the browser font size, and NOT the project's font-size. Thus unit($value, $browser-font-size) +// @media only screen and (#{$min-max}-#{$width-height}: outline-unit($value, $browser-font-size)) +// { +// @content; + +// body:before +// { +// content: $fallback; +// } +// } +// } +// } +// } + +@mixin orientation($orientation: landscape) +{ + @media (orientation : $orientation) + { + @content; + } +} + + +@mixin lte-ie8 +{ + @if $lte-ie8 + { + @content; + } +} + +/* -------------------------------------------------------------------------- */ + +@mixin container($total-columns: $columns-M) +{ + $total-width: (($column-width + $gutter-width) * $total-columns) - $gutter-width; + + width: outline-unit($total-width); + margin-right: auto; + margin-left: auto; + padding-right: outline-unit($grid-padding); + padding-left: outline-unit($grid-padding); + @include clearfix; +} + +@mixin column($width:auto, $from: $base-font-size) +{ + @if $rythm-unit == 'px' + { + $from: $base-font-size; + } + + float: left; + width: outline-unit($width, $from); + margin-right: outline-unit($gutter-width, $from); + @include box-sizing(content-box); +} +@mixin last() +{ + margin-right: 0!important; +} +@mixin first() +{ + margin-left: 0!important; +} +@mixin span($level:1, $from: $base-font-size) +{ + @include column(($level * $column-width) + (($level - 1) * $gutter-width), $from); +} +@mixin prepend($level:1, $from: $base-font-size) +{ + padding-left: outline-unit(($level * $column-width) + ($level * $gutter-width), $from); +} +@mixin append($level:1, $from: $base-font-size) +{ + padding-right: outline-unit(($level * $column-width) + ($level * $gutter-width), $from); +} + +/* -------------------------------------------------------------------------- */ + +$fs: $base-font-size; + +@mixin apply-side-rhythm-border($side, $width: 1px, $border-style: $default-rhythm-border-style, $border-color: #000) +{ + border-#{$side}: + { + style: $border-style; + width: $width; + color: $border-color; + }; + @if $side == top + { + margin-top: $width * -1; + } + @if $side == left + { + margin-left: $width * -1; + } + @if $side == bottom + { + margin-top: $width * -1; + position: relative; + top: $width; + } + @if $side == right + { + margin-left: $width * -1; + position: relative; + left: $width; + } +} + +//------------------------------------------------------------------------------ + +@mixin position($side, $lines: 1, $font-size: $base-font-size) +{ + @if $rythm-unit == 'px' + { + $font-size: $base-font-size; + } + + #{$side}: (1em * ($base-line-height / $font-size)) * $lines; +} + +@mixin position-top($lines: 1, $font-size: $base-font-size) +{ + @include position(top, $lines, $font-size: $base-font-size); +} +@mixin position-left($lines: 1, $font-size: $base-font-size) +{ + @include position(left, $lines: 1, $font-size: $base-font-size); +} +@mixin position-bottom($lines: 1, $font-size: $base-font-size) +{ + @include position(bottom, $lines: 1, $font-size: $base-font-size); +} +@mixin position-right($lines: 1, $font-size: $base-font-size) +{ + @include position(right, $lines: 1, $font-size: $base-font-size); +} + +//------------------------------------------------------------------------------ + +@mixin rhythm-borders ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: #000) +{ + border: + { + style: $border-style; + width: $width; + color: $border-color; + }; + + position: relative; + margin-top: $width * -2; + margin-left: $width * -2; + top: $width; + left: $width; +} + +//------------------------------------------------------------------------------ + +@mixin trailing-border ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: #000) +{ + @include apply-side-rhythm-border(bottom, $width, $border-style, $border-color); +} +@mixin leading-border ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: #000) +{ + @include apply-side-rhythm-border(top, $width, $border-style, $border-color); +} + +//------------------------------------------------------------------------------ + +@mixin horizontal-borders($width: 1px, $border-style: $default-rhythm-border-style, $border-color: #000) +{ + @include leading-border( $width, $border-style, $border-color); + @include trailing-border( $width, $border-style, $border-color); + margin-top: $width * -2; +} +@mixin vertical-borders($width: 1px, $border-style: $default-rhythm-border-style, $border-color: #000) +{ + @include apply-side-rhythm-border( left, $width, $border-style, $border-color); + @include apply-side-rhythm-border( right, $width, $border-style, $border-color); + margin-left: $width * -2; +} +@mixin h-borders ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: #000) +{ + @include horizontal-borders( $width, $border-style, $border-color); +} +@mixin v-borders ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: #000) +{ + @include vertical-borders( $width, $border-style, $border-color); +} + +//------------------------------------------------------------------------------ + +@mixin border ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: #000) +{ + @include rhythm-borders( $width, $border-style, $border-color); +} +@mixin border-top ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: #000) +{ + @include leading-border( $width, $border-style, $border-color); +} +@mixin border-bottom ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: #000) +{ + @include trailing-border( $width, $border-style, $border-color); +} +@mixin border-left ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: #000) +{ + @include apply-side-rhythm-border( left, $width, $border-style, $border-color); +} +@mixin border-right ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: #000) +{ + @include apply-side-rhythm-border( right, $width, $border-style, $border-color); +} + +//------------------------------------------------------------------------------ + +@mixin margin-top($lines: 1, $font-size: $base-font-size) +{ + @include leader($lines, $font-size, margin); + + @if $rythm-unit == 'px' + { + $font-size: $base-font-size; + } +} +@mixin margin-bottom($lines: 1, $font-size: $base-font-size) +{ + @if $rythm-unit == 'px' + { + $font-size: $base-font-size; + } + + @include trailer($lines, $font-size, margin); +} +@mixin margin-left($lines: 1, $font-size: $base-font-size) +{ + @if $rythm-unit == 'px' + { + $font-size: $base-font-size; + } + + margin-left: rhythm($lines, $font-size); +} +@mixin margin-right($lines: 1, $font-size: $base-font-size) +{ + @if $rythm-unit == 'px' + { + $font-size: $base-font-size; + } + + margin-right: rhythm($lines, $font-size); +} + +//------------------------------------------------------------------------------ + +@mixin padding-top($lines: 1, $font-size: $base-font-size) +{ + @if $rythm-unit == 'px' + { + $font-size: $base-font-size; + } + + @include leader($lines, $font-size, padding); +} +@mixin padding-bottom($lines: 1, $font-size: $base-font-size) +{ + @if $rythm-unit == 'px' + { + $font-size: $base-font-size; + } + + @include trailer($lines, $font-size, padding); +} +@mixin padding-left($lines: 1, $font-size: $base-font-size) +{ + @if $rythm-unit == 'px' + { + $font-size: $base-font-size; + } + + padding-left: rhythm($lines, $font-size); +} +@mixin padding-right($lines: 1, $font-size: $base-font-size) +{ + @if $rythm-unit == 'px' + { + $font-size: $base-font-size; + } + + padding-right: rhythm($lines, $font-size); +} + +//------------------------------------------------------------------------------ + +@mixin padding($lines: 1, $font-size: $base-font-size) +{ + @if $rythm-unit == 'px' + { + $font-size: $base-font-size; + } + + @include leader($lines, $font-size, padding); + @include trailer($lines, $font-size, padding); + padding-left: rhythm($lines, $font-size); + padding-right: rhythm($lines, $font-size); +} +@mixin margin($lines: 1, $font-size: $base-font-size) +{ + @if $rythm-unit == 'px' + { + $font-size: $base-font-size; + } + + @include leader($lines, $font-size, margin); + @include trailer($lines, $font-size, margin); + margin-left: rhythm($lines, $font-size); + margin-right: rhythm($lines, $font-size); +} + +//------------------------------------------------------------------------------ + +@mixin max-height($lines: 1, $font-size: $base-font-size) +{ + @if $rythm-unit == 'px' + { + $font-size: $base-font-size; + } + + max-height: rhythm($lines, $font-size); +} +@mixin min-height($lines: 1, $font-size: $base-font-size) +{ + @if $rythm-unit == 'px' + { + $font-size: $base-font-size; + } + + min-height: rhythm($lines, $font-size); + *height: rhythm($lines, $font-size); +} +@mixin height($lines: 1, $font-size: $base-font-size) +{ + @if $rythm-unit == 'px' + { + $font-size: $base-font-size; + } + + height: rhythm($lines, $font-size); +} +@mixin line-height($lines: 1, $font-size: $base-font-size) +{ + @if $rythm-unit == 'px' + { + $font-size: $base-font-size; + } + + line-height: rhythm($lines, $font-size); +} + +//------------------------------------------------------------------------------ + +@mixin clearfix +{ + @include pie-clearfix; +} + + +//------------------------------------------------------------------------------ + +@mixin roll +{ + text-decoration: none; + + &:hover, + &:focus + { + text-decoration: underline; + } +} + + +@mixin resize($direction: vertical) +{ + -webkit-resize: $direction; + -moz-resize: $direction; + -ms-resize: $direction; + -o-resize: $direction; + resize: $direction; +} + +//------------------------------------------------------------------------------ + +@mixin font-size($to-size, $lines: lines-for-font-size($to-size), $from-size: $base-font-size) +{ + @include adjust-font-size-to($to-size, $lines, $from-size); +} +@mixin block($to-size, $lines: lines-for-font-size($to-size), $from-size: $base-font-size) +{ + @include font-size($to-size, $lines, $from-size); + @include margin-bottom(1, $to-size); +} + +//------------------------------------------------------------------------------ + +// afficher / masquer / cacher + +@mixin show($type: block) // en paramètre optionnel, le `display` peut-être précisé (`table-cell`, `inline-block`…) +{ + display: $type; +} +@mixin hide +{ + display: none; +} + +/** + * Hide an element but keep it accessible to screen readers + * @author http://developer.yahoo.com/blogs/ydn/clip-hidden-content-better-accessibility-53456.html + */ +@mixin mask() +{ + position: absolute; + clip: rect(1px 1px 1px 1px); // IE6, IE7 + clip: rect(1px, 1px, 1px, 1px); + padding:0; + margin: 0; + border:0; + width: 1px !important; + height: 1px; + overflow: hidden; +} +@mixin unmask() +{ + position: relative; + clip: auto; + width: auto; + height: auto; + overflow: visible; +} + +//------------------------------------------------------------------------------ + +// pour réaliser des listes horizontales + +@mixin list($rtl: false) +{ + @include horizontal-list-container; + + li, + dt, + dd + { + @include horizontal-list-item(0, left); + + white-space: normal; + } +} + + +//------------------------------------------------------------------------------ + +@mixin opacity($opacity) { + opacity: $opacity; +} + +//------------------------------------------------------------------------------ + +@mixin retina-image($filename, $extension: png, $retina-filename: null, $asset-pipeline: true) +{ + @if $asset-pipeline { + background-image: image_url($filename + "." + $extension); + } + @else { + background-image: url($filename + "." + $extension); + } + + @include hidpi { + + @if $asset-pipeline { + @if $retina-filename { + background-image: image_url($retina-filename + "." + $extension); + } + @else { + background-image: image_url($filename + "@2x" + "." + $extension); + } + } + + @else { + @if $retina-filename { + background-image: url($retina-filename + "." + $extension); + } + @else { + background-image: url($filename + "@2x" + "." + $extension); + } + } + + background-size: image-width($filename + "." + $extension) image-height($filename + "." + $extension); + + } +} diff --git a/scss/core/_mq.scss b/scss/core/_mq.scss new file mode 100644 index 0000000..5fce67c --- /dev/null +++ b/scss/core/_mq.scss @@ -0,0 +1,132 @@ +/** https://github.com/guardian/sass-mq */ + +@function mq-px2em($px, $base-font-size: 16px) { + @if (unitless($px)) { + @warn "Assuming #{$px} to be in pixels, attempting to convert it into pixels for you"; + @return mq-px2em($px + 0px); // That may fail. + } @else if (unit($px) == em) { + @return $px; + } + @return ($px / $base-font-size) * 1em; +} + +@function mq-retrieve-breakpoint-width($name) { + @each $breakpoint in $mq-breakpoints { + $breakpoint-name: nth($breakpoint, 1); + $breakpoint-width: nth($breakpoint, 2); + + @if $name == $breakpoint-name { + @return $breakpoint-width; + } + } + @return 'Breakpoint #{$name} does not exist'; +} + + + +// Media Query mixin +// Usage: +// .element { + +// // mobile to desktop => will be compiled in styles-lte-ie8.scss +// @include mq($from: mobile) { +// color: red; +// } + +// // Ignored by styles-lte-ie8.scss +// @include mq($to: tablet) { +// color: blue; +// } + +// // Ignored by styles-lte-ie8.scss +// @include mq(mobile, tablet) { +// color: green; +// } + +// // Ignored by styles-lte-ie8.scss +// @include mq($from: tablet, $and: '(orientation: landscape)') { +// color: teal; +// } + +// // Ignored by styles-lte-ie8.scss +// @include mq($from: wide) { +// color: cyan; +// } + +// // Compiled in styles-lte-ie8.scss +// @include mq($to: wide) { +// color: yellow; +// } + +// // Compiled in styles-lte-ie8.scss +// @include mq(desktop) { +// color: hotpink; +// } +// } + + +@mixin mq($from: false, $to: false, $and: false) { + + // Initialize variables + $min-width: 0; + $max-width: 0; + $mediaQuery: ''; + + // From: this breakpoint (inclusive) + @if $from { + @if type-of($from) == number { + $min-width: mq-px2em($from); + } @else { + $min-width: mq-px2em(mq-retrieve-breakpoint-width($from)); + } + } + + // To: that breakpoint (exclusive) + @if $to { + @if type-of($to) == number { + $max-width: mq-px2em($to); + } @else { + $max-width: mq-px2em(mq-retrieve-breakpoint-width($to)) - .01em; + } + } + + // Responsive support is disabled, rasterize the output outside @media blocks + // The browser will rely on the cascade itself. + @if ($mq-responsive == false) { + $static-breakpoint-width: mq-retrieve-breakpoint-width($mq-static-breakpoint); + @if type-of($static-breakpoint-width) == number { + $target-width: mq-px2em($static-breakpoint-width); + // Output only rules that start at or span our target width + @if ($and == false and ($min-width <= $target-width) and (($to == false) or ($max-width >= $target-width))) { + @content; + } + } @else { + // Throw a warning if $mq-static-breakpoint is not in the $mq-breakpoints list + @warn "No static styles will be output: #{$static-breakpoint-width}"; + } + } + + // Responsive support is enabled, output rules inside @media queries + @else { + @if $min-width != 0 { $mediaQuery: '#{$mediaQuery} and (min-width: #{$min-width})'; } + @if $max-width != 0 { $mediaQuery: '#{$mediaQuery} and (max-width: #{$max-width})'; } + @if $and { $mediaQuery: '#{$mediaQuery} and #{$and}'; } + + $mediaQuery: unquote(#{$mediaQuery}); + + @media all #{$mediaQuery} { + @content; + } + } +} + +// Add a breakpoint +// Usage: $mq-breakpoints: mq-add-breakpoint(tvscreen, 1920px); +// Credit goes to Sam Richard (author of the `respond-to()` mixin) +@function mq-add-breakpoint($name, $breakpoint) { + $breakpoint: $name $breakpoint; + $output: append($mq-breakpoints, $breakpoint, 'space'); + @return $output; +} + + diff --git a/scss/doc.scss b/scss/doc.scss deleted file mode 100644 index 081d42e..0000000 --- a/scss/doc.scss +++ /dev/null @@ -1,18 +0,0 @@ - // Lib Compass + Blueprint - @import "compass" ; - @import "blueprint"; - - // Outils - @import "_variables"; - @import "lib/_mixins"; - @import "lib/_normalize"; - @import "lib/_hashgrid" ; - - // Styles généraux - @import "_doc-screen"; - - // Modules et pages - - - // Styles print - @import "_doc-print"; \ No newline at end of file diff --git a/scss/doc/_print.scss b/scss/doc/_print.scss new file mode 100755 index 0000000..4e9fc23 --- /dev/null +++ b/scss/doc/_print.scss @@ -0,0 +1 @@ +/** --- @section DOCUMENTATION PRINT STYLES --- */ \ No newline at end of file diff --git a/scss/doc/_screen.scss b/scss/doc/_screen.scss new file mode 100755 index 0000000..ebf0582 --- /dev/null +++ b/scss/doc/_screen.scss @@ -0,0 +1,56 @@ +/** --- @section DOCUMENTATION SCREEN STYLES --- */ + +body +{ + background-color: white; +} +.page-index, +.doc +{ + @include container; + + img + { + max-width: 100%; + } + h1, + h2, + h3, + h4 + { + padding-top: 0; + } + + $fs-table: 14px; + + table + { + @include block($fs-table); + width: 100%; + } + td, + th + { + text-align: left; + padding-left: em($m/2,$fs-table); + border: 1px solid #333; + + @include padding-top (.5,$fs-table); + @include padding-bottom(.5,$fs-table); + } + th + { + white-space: nowrap; + } + #footnotes + { + $fs: 11px; + + @include block($fs); + + p + { + margin-bottom: 0; + } + } +} \ No newline at end of file diff --git a/scss/lib/_hashgrid.scss b/scss/lib/_hashgrid.scss deleted file mode 100644 index ce2bb0b..0000000 --- a/scss/lib/_hashgrid.scss +++ /dev/null @@ -1,111 +0,0 @@ -/** -* Grid -*/ -#grid{ - - /* Dimensions - same width as your grid with gutters */ - width: $blueprint-container-size-screen; - overflow: hidden; - - /* Grid (left-aligned) -position: absolute; -top: 0; -left: 0; -*/ - - /* Grid (centered) */ - position: absolute; - top: 0; - left: 50%; - margin-left: $blueprint-container-size-screen / -2; - - @media only screen and (max-width:1000px) // 940px - { - width: $blueprint-container-size-tablet; - margin-left: $blueprint-container-size-tablet / -2; - } - @media only screen and (max-width:840px) // 780px - { - margin-left: 0; - width: auto; - - left: $blueprint-grid-margin; - right: $blueprint-grid-margin; - - .vert-container - { - display: none!important; - } - } - -} - -/** -* Vertical grid lines -* -* Set the column width taking the borders into consideration, -* and use margins to set column gutters. -*/ -#grid div.vert{ - - width: $blueprint-grid-width - 1px; - margin-left: $blueprint-grid-margin - 1px; - *display: inline!important; // ie6 - border-left: 1px dotted darkgray; - border-right: 1px dotted darkgray; - position: relative; -} - -#grid div.vert.first-line{ - - margin-left: 0; - width: $blueprint-grid-width - 2px; -} - -/** -* Horizontal grid lines, defined by your base line height -* -* Remember, the CSS properties that define the box model: -* visible height = height + borders + margins + padding -*/ -#grid div.horiz -{ - height: rhythm(); - padding: 0; -} -#grid div.horiz -{ - @include trailing-border(1px, dotted, darkgray); -} - -/** -* Classes for multiple grids -* -* When using more than one grid, remember to set the numberOfGrids -* option in the hashgrid.js file. -*/ -#grid.grid-1 -{ - .vert - { - border-color: transparent; - } -} -#grid.grid-2 -{ - .horiz - { - border-color: transparent; - } -// .vert -// { -// background-color: fade-out(green, 0.75); -// } -} -//#grid.grid-3 -//{ -// .vert -// { -// background-color: fade-out(green, 0.75); -// } -//} \ No newline at end of file diff --git a/scss/lib/_mixins.scss b/scss/lib/_mixins.scss deleted file mode 100644 index a339055..0000000 --- a/scss/lib/_mixins.scss +++ /dev/null @@ -1,457 +0,0 @@ -@mixin float($side: left) -{ - *display: inline; - zoom: 1; - float: unquote($side); -} - -@mixin apply-side-rhythm-border($side, $width: 1px, $border-style: $default-rhythm-border-style, $border-color: $default-rhythm-border-color) -{ - border-#{$side}: - { - style: $border-style; - width: $width; - color: $border-color; - }; - @if $side == top - { - margin-top: $width * -1; - } - @if $side == left - { - margin-left: $width * -1; - } - @if $side == bottom - { - margin-top: $width * -1; - position: relative; - top: $width; - } - @if $side == right - { - margin-left: $width * -1; - position: relative; - left: $width; - } -} -// -@mixin position($side, $lines: 1, $font-size: $base-font-size) -{ - $side: rhythm($lines, $font-size); -} -@mixin position-top($lines: 1, $font-size: $base-font-size) -{ - @include position(top, $lines: 1, $font-size: $base-font-size); -} -@mixin position-left($lines: 1, $font-size: $base-font-size) -{ - @include position(left, $lines: 1, $font-size: $base-font-size); -} -@mixin position-bottom($lines: 1, $font-size: $base-font-size) -{ - @include position(bottom, $lines: 1, $font-size: $base-font-size); -} -@mixin position-right($lines: 1, $font-size: $base-font-size) -{ - @include position(right, $lines: 1, $font-size: $base-font-size); -} -// -@mixin rhythm-borders ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: $default-rhythm-border-color) -{ - border: - { - style: $border-style; - width: $width; - color: $border-color; - }; - position: relative; - margin-top: $width * -2; - margin-left: $width * -2; - top: $width; - left: $width; -} -// -@mixin trailing-border ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: $default-rhythm-border-color) -{ - @include apply-side-rhythm-border(bottom, $width, $border-style, $border-color); -} -@mixin leading-border ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: $default-rhythm-border-color) -{ - @include apply-side-rhythm-border(top, $width, $border-style, $border-color); -} -// -@mixin horizontal-borders($width: 1px, $border-style: $default-rhythm-border-style, $border-color: $default-rhythm-border-color) -{ - @include leading-border( $width, $border-style, $border-color); - @include trailing-border( $width, $border-style, $border-color); - margin-top: $width * -2; -} -@mixin vertical-borders($width: 1px, $border-style: $default-rhythm-border-style, $border-color: $default-rhythm-border-color) -{ - @include apply-side-rhythm-border( left, $width, $border-style, $border-color); - @include apply-side-rhythm-border( right, $width, $border-style, $border-color); - margin-left: $width * -2; -} -@mixin h-borders ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: $default-rhythm-border-color) -{ - @include horizontal-borders( $width, $border-style, $border-color); -} -@mixin v-borders ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: $default-rhythm-border-color) -{ - @include vertical-borders( $width, $border-style, $border-color); -} -// -@mixin border ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: $default-rhythm-border-color) -{ - @include rhythm-borders( $width, $border-style, $border-color); -} -@mixin border-top ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: $default-rhythm-border-color) -{ - @include leading-border( $width, $border-style, $border-color); -} -@mixin border-bottom ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: $default-rhythm-border-color) -{ - @include trailing-border( $width, $border-style, $border-color); -} -@mixin border-left ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: $default-rhythm-border-color) -{ - @include apply-side-rhythm-border( left, $width, $border-style, $border-color); -} -@mixin border-right ($width: 1px, $border-style: $default-rhythm-border-style, $border-color: $default-rhythm-border-color) -{ - @include apply-side-rhythm-border( right, $width, $border-style, $border-color); -} -// -@mixin margin-top($lines: 1, $font-size: $base-font-size) -{ - @include leader($lines, $font-size, margin); -} -@mixin margin-bottom($lines: 1, $font-size: $base-font-size) -{ - @include trailer($lines, $font-size, margin); -} -@mixin margin-left($lines: 1, $font-size: $base-font-size) -{ - margin-left: rhythm($lines, $font-size); -} -@mixin margin-right($lines: 1, $font-size: $base-font-size) -{ - margin-right: rhythm($lines, $font-size); -} -// -@mixin padding-top($lines: 1, $font-size: $base-font-size) -{ - @include leader($lines, $font-size, padding); -} -@mixin padding-bottom($lines: 1, $font-size: $base-font-size) -{ - @include trailer($lines, $font-size, padding); -} -@mixin padding-left($lines: 1, $font-size: $base-font-size) -{ - padding-left: rhythm($lines, $font-size); -} -@mixin padding-right($lines: 1, $font-size: $base-font-size) -{ - padding-right: rhythm($lines, $font-size); -} -// -@mixin padding($lines: 1, $font-size: $base-font-size) -{ - @include leader($lines, $font-size, padding); - @include trailer($lines, $font-size, padding); - padding-left: rhythm($lines, $font-size); - padding-right: rhythm($lines, $font-size); -} -@mixin margin($lines: 1, $font-size: $base-font-size) -{ - @include leader($lines, $font-size, margin); - @include trailer($lines, $font-size, margin); - margin-left: rhythm($lines, $font-size); - margin-right: rhythm($lines, $font-size); -} -// -@mixin max-height($lines: 1, $font-size: $base-font-size) -{ - max-height: rhythm($lines, $font-size); -} -@mixin min-height($lines: 1, $font-size: $base-font-size) -{ - min-height: rhythm($lines, $font-size); -// *height: rhythm($lines, $font-size); -} -@mixin height($lines: 1, $font-size: $base-font-size) -{ - height: rhythm($lines, $font-size); -} -// -@mixin clearfix -{ - @include pie-clearfix; -} -.clearfix -{ - @include clearfix; -} -// -@mixin top($lines: 1, $font-size: $base-font-size) -{ - top: rhythm($lines, $font-size); -} -@mixin bottom($lines: 1, $font-size: $base-font-size) -{ - bottom: rhythm($lines, $font-size); -} -// -@mixin font-size($to-size, $lines: lines-for-font-size($to-size), $from-size: $base-font-size) -{ - @include adjust-font-size-to($to-size, $lines, $from-size); -} -@mixin bloc($to-size, $lines: lines-for-font-size($to-size), $from-size: $base-font-size) -{ - @include font-size($to-size, $lines, $from-size); - @include margin-bottom($lines, $to-size); -} -// -@mixin show($type: block) -{ - display: $type; -} -@mixin hide -{ - display: none; -} - -// Cacher un élément, mais le laisser accessible aux synthèses d'écran -// cf.http://yaccessibilityblog.com/library/css-clip-hidden-content.html -@mixin mask() -{ - position: absolute; - clip: rect(1px 1px 1px 1px); // IE6, IE7 - clip: rect(1px, 1px, 1px, 1px); - padding:0; - margin: 0; - border:0; - height: 1px; - width: 1px; - overflow: hidden; -} -@mixin unmask() -{ - position: relative; - width: auto; - height: auto; - clip: auto; -} - -// -// Blocs séparés par des bordures -// -@mixin border-gutter($border-color: black, $border-width: 1px, $border-style: solid) -{ - padding-right: $blueprint-grid-margin / 2 - $border-width; - margin-right: $blueprint-grid-margin / 2; - border-right: #{$border-width} #{$border-style} #{$border-color}; -} -@mixin border-column($border-color: black, $border-width: 1px, $border-style: solid) -{ - padding-right: ($blueprint-grid-width / 2) + ($blueprint-grid-margin / 2) + ($blueprint-grid-margin / 2 - $border-width); - margin-right: ($blueprint-grid-width / 2) + ($blueprint-grid-margin / 2) + ($blueprint-grid-margin / 2); - border-right: #{$border-width} #{$border-style} #{$border-color}; -} - -// -// HR -// -@mixin hr -{ - @include border-top(1px, solid, black); - @include margin-bottom(1); - - hr - { - @include mask; - } -} -.hr -{ - @include hr; -} -// -@mixin list -{ - margin: 0; - padding: 0; - list-style-type: none; - @include clearfix; - - li, - dt, - dd - { - margin: 0; - float: left; - } -} -// -@mixin column-base($first: false) -{ - @include float-left; - - @if $first - { - margin-left: 0; - } - @else - { - margin-left: $blueprint-grid-margin; - } - * html & - { - overflow-x: hidden; - } -} - -.list -{ - @include list; -} - -// -// Liens « block », qui englobent d'autres éléments de type block -// -.block-link -{ - @include clearfix; - display: block; - text-decoration: none; -} - -// -// Hover des liens de type « block » : on souligne l'élément .title qu'ils contiennent -// -.block-link-hover -{ - &:hover, - &:active, - &:focus - { - .title - { - text-decoration: underline - } - } -} - -// -// Liens pas soulignés, qui deviennent soulignés au :hover -// -.unroll -{ - text-decoration: none; - - &:hover, - &:active, - &:focus - { - text-decoration: underline; - } -} - -// -// Liens pas soulignés, qui deviennent soulignés au :hover -// -.no-roll -{ - text-decoration: none; - - &:hover, - &:active, - &:focus - { - text-decoration: none; - } -} - -// -// Boutons réinitialisés -// -.reset-button -{ - border: 0; - width: auto; - padding: 0; - display: block; -} - -// -// Clearfix, à utiliser avec @extend pour ne pas surcharger la CSS -// -.clear-fix -{ - @include clearfix; -} - -// -// Pas de margin-bottom, à utiliser avec @extend pour ne pas surcharger la CSS -// -.no-margin-bottom -{ - margin-bottom: 0; -} -// -// Pas de padding-bottom, à utiliser avec @extend pour ne pas surcharger la CSS -// -.no-padding-bottom -{ - margin-bottom: 0; -} - -// -// Pas de margin-bottom ni de padding-bottom, à utiliser avec @extend pour ne pas surcharger la CSS -// -.no-bottom -{ - margin-bottom: 0; - padding-bottom: 0; -} - -// -// Pas de margin-top, à utiliser avec @extend pour ne pas surcharger la CSS -// -.no-margin-top -{ - margin-top: 0; -} -// -// Pas de padding-top, à utiliser avec @extend pour ne pas surcharger la CSS -// -.no-padding-top -{ - padding-top: 0; -} -// -// Pas de margin-top ni de padding-top, à utiliser avec @extend pour ne pas surcharger la CSS -// -.no-top -{ - margin-top: 0; - padding-top: 0; -} - -// -// Majuscules, à utiliser avec @extend pour ne pas surcharger la CSS -// -.uppercase -{ - text-transform: uppercase; - letter-spacing: 0.001em; -} - -// -// Cacher pour de vrai (y compris aux synthèses vocales) -// -.off -{ - display: none; -} \ No newline at end of file diff --git a/scss/lib/_normalize-modern.scss b/scss/lib/_normalize-modern.scss deleted file mode 100644 index 68fd25a..0000000 --- a/scss/lib/_normalize-modern.scss +++ /dev/null @@ -1,377 +0,0 @@ -/*! normalize.css v2.0.1 | MIT License | git.io/normalize */ - -// ========================================================================== -// HTML5 display definitions -// ========================================================================== - -// Corrects `block` display not defined in IE 8/9. -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -nav, -section, -summary -{ - display: block; -} - -// Corrects `inline-block` display not defined in IE 8/9. -audio, -canvas, -video -{ - display: inline-block; -} - -// Prevents modern browsers from displaying `audio` without controls. -// Remove excess height in iOS 5 devices. -audio:not([controls]) -{ - display: none; - height: 0; -} - -// Addresses styling for `hidden` attribute not present in IE 8/9. -[hidden] -{ - display: none; -} - -// ========================================================================== -// Base -// ========================================================================== - -// 1. Sets default font family to sans-serif. -// 2. Prevents iOS text size adjust after orientation change, without disabling user zoom. -html -{ - font-family: sans-serif; // 1 - -webkit-text-size-adjust: 100%; // 2 - -ms-text-size-adjust: 100%; // 2 - @include establish-baseline(); -} - -// Removes default margin. -body -{ - margin: 0; - font-size: ($base-font-size/1px) * 6.25%; - line-height: ($base-line-height / $base-font-size) * 1em; -} - -// ========================================================================== -// Links -// ========================================================================== - -// Addresses `outline` inconsistency between Chrome and other browsers. -a:focus -{ - outline: thin dotted; -} - -// Improves readability when focused and also mouse hovered in all browsers. -a:active, -a:hover -{ - outline: 0; -} - -// ========================================================================== -// Typography -// ========================================================================== - -// Addresses `h1` font sizes within `section` and `article` in Firefox 4+, Safari 5, and Chrome. -// Addresses font sizes and margins set differently in IE 6/7. -// Addresses font sizes within `section` and `article` in Firefox 4+, Safari 5, and Chrome. -// http://modularscale.com/scale/?px1=14&px2=12&ra1=1.5&ra2=0 -h1 -{ - $fs1: 27px; - margin: 0; - @include adjust-font-size-to($fs1); - @include margin-bottom(1, $fs1); - @include padding-top(1, $fs1); -} -h2 -{ - $fs1: 21px; - margin: 0; - @include adjust-font-size-to($fs1); - @include margin-bottom(1, $fs1); - @include padding-top(1, $fs1); -} -h3 -{ - $fs1: 18px; - margin: 0; - @include adjust-font-size-to($fs1); - @include margin-bottom(1, $fs1); - @include padding-top(1, $fs1); -} -h4 -{ - $fs1: 16px; - margin: 0; - @include adjust-font-size-to($fs1); - @include margin-bottom(1, $fs1); - @include padding-top(1, $fs1); -} -h5 -{ - $fs1: 14px; - margin: 0; - @include adjust-font-size-to($fs1); - @include margin-bottom(1, $fs1); - @include padding-top(1, $fs1); -} -h6 -{ - $fs1: 13px; - margin: 0; - @include adjust-font-size-to($fs1); - @include margin-bottom(1, $fs1); - @include padding-top(1, $fs1); -} - -// Addresses styling not present in IE 8/9, Safari 5, and Chrome. -abbr[title] -{ - border-bottom: 1px dotted; -} - -// Addresses style set to `bolder` in Firefox 4+, Safari 5, and Chrome. -b, -strong -{ - font-weight: bold; -} - -// Addresses styling not present in Safari 5 and Chrome. -dfn -{ - font-style: italic; -} - -// Addresses styling not present in IE 8/9. -mark -{ - background: #ff0; - color: #000; -} - -// Corrects font family set oddly in Safari 5 and Chrome. -code, -kbd, -pre, -samp -{ - font-family: monospace, serif; - font-size: 1em; -} - -// Improves readability of pre-formatted text in all browsers. -pre -{ - white-space: pre; - white-space: pre-wrap; - word-wrap: break-word; -} - -// Sets consistent quote types. -q -{ - quotes: "\201C" "\201D" "\2018" "\2019"; -} - -// Addresses inconsistent and variable font size in all browsers. -small -{ - font-size: 80%; -} - -// Prevents `sub` and `sup` affecting `line-height` in all browsers. -sub, -sup -{ - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} -sup -{ - top: -0.5em; -} -sub -{ - bottom: -0.25em; -} -// ========================================================================== -// Lists -// ========================================================================== - -dl, -menu, -ol, -ul, -p -{ - margin: 0; - @include margin-bottom; -} -dd -{ - margin: 0 0 0 $blueprint-grid-outer-width; -} -menu, -ol, -ul -{ - padding: 0 0 0 $margin; -} - -// ========================================================================== -// Embedded content -// ========================================================================== - -// Removes border when inside `a` element in IE 8/9. -img -{ - border: 0; -} - -// Corrects overflow displayed oddly in IE 9. -svg:not(:root) -{ - overflow: hidden; -} - -// ========================================================================== -// Figures -// ========================================================================== - -// Addresses margin not present in IE 8/9 and Safari 5. -figure -{ - margin: 0; -} - -// ========================================================================== -// Forms -// ========================================================================== - -// Define consistent border, margin, and padding. -fieldset -{ - border: 1px solid #c0c0c0; - margin: 0; - padding: 10px; - @include padding-top( 0.5); - @include padding-bottom(0.5); - @include margin-bottom( 1); -} - -// 1. Corrects color not being inherited in IE 8/9. -// 2. Remove padding so people aren't caught out if they zero out fieldsets. -legend -{ - border: 0; // 1 - padding: 0; // 2 -} - -// 1. Corrects font family not being inherited in all browsers. -// 2. Corrects font size not being inherited in all browsers. -// 3. Addresses margins set differently in Firefox 4+, Safari 5, and Chrome -button, -input, -select, -textarea -{ - font-family: inherit; // 1 - font-size: 100%; // 2 - margin: 0; // 3 -} - -// Addresses Firefox 4+ setting `line-height` on `input` using `!important` in the UA stylesheet. -button, -input -{ - line-height: normal; -} - -// 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` and `video` controls. -// 2. Corrects inability to style clickable `input` types in iOS. -// 3. Improves usability and consistency of cursor style between image-type `input` and others. -button, -html input[type="button"], // 1 -input[type="reset"], -input[type="submit"] -{ - -webkit-appearance: button; // 2 - cursor: pointer; // 3 -} - -// Re-set default cursor for disabled elements. -button[disabled], -input[disabled] -{ - cursor: default; -} - -// 1. Addresses box sizing set to `content-box` in IE 8/9. -// 2. Removes excess padding in IE 8/9. -input[type="checkbox"], -input[type="radio"] -{ - box-sizing: border-box; // 1 - padding: 0; // 2 -} - -// 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome. -// 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome (include `-moz` to future-proof). -input[type="search"] -{ - -webkit-appearance: textfield; // 1 - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; // 2 - box-sizing: content-box; -} - -// Removes inner padding and search cancel button in Safari 5 and Chrome on OS X. -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration -{ - -webkit-appearance: none; -} - -// Removes inner padding and border in Firefox 4+. -button::-moz-focus-inner, -input::-moz-focus-inner -{ - border: 0; - padding: 0; -} - -// 1. Removes default vertical scrollbar in IE 8/9. -// 2. Improves readability and alignment in all browsers. -textarea -{ - overflow: auto; // 1 - vertical-align: top; // 2 -} - -// ========================================================================== -// Tables -// ========================================================================== - -// Remove most spacing between table cells. -table -{ - border-collapse: collapse; - border-spacing: 0; -} diff --git a/scss/lib/_normalize.scss b/scss/lib/_normalize.scss deleted file mode 100644 index 97a714b..0000000 --- a/scss/lib/_normalize.scss +++ /dev/null @@ -1,463 +0,0 @@ -/*! normalize.css v1.0.1 | MIT License | git.io/normalize */ - -// ========================================================================== -// HTML5 display definitions -// ========================================================================== - -//Corrects `block` display not defined in IE 6/7/8/9 and Firefox 3. -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -nav, -section, -summary -{ - display: block; -} - -// Corrects `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. -//audio, -//canvas, -//video -//{ -// display: inline-block; -// *display: inline; -// *zoom: 1; -//} - -img, -audio, -video, -canvas, -svg -{ - display: block; - max-width: 100%; - height: auto; -} - -// Prevents modern browsers from displaying `audio` without controls. -// Remove excess height in iOS 5 devices. -audio:not([controls]) -{ - display: none; - height: 0; -} - -// Addresses styling for `hidden` attribute not present in IE 7/8/9, Firefox 3, and Safari 4. -// Known issue: no IE 6 support. -[hidden] -{ - display: none; -} - -// ========================================================================== -// Base -// ========================================================================== - -// 1. Corrects text resizing oddly in IE 6/7 when body `font-size` is set using `em` units. -// 2. Prevents iOS text size adjust after orientation change, without disabling user zoom. -html -{ - font-size: 100%; // 1 - -webkit-text-size-adjust: 100%; // 2 - -ms-text-size-adjust: 100%; // 2 - @include establish-baseline(); -} - -// Addresses `font-family` inconsistency between `textarea` and other form elements. -html, -button, -input, -select, -textarea -{ - font-family: sans-serif; -} - -// Addresses margins handled incorrectly in IE 6/7. -body -{ - margin: 0; - font-size: ($base-font-size/1px) * 6.25%; - line-height: ($base-line-height / $base-font-size) * 1em; -} - -// ========================================================================== -// Links -// ========================================================================== - -// Addresses `outline` inconsistency between Chrome and other browsers. -a:focus -{ - outline: thin dotted; -} -// Improves readability when focused and also mouse hovered in all browsers. -a:active, -a:hover -{ - outline: 0; -} - -// ========================================================================== -// Typography -// ========================================================================== - -// Addresses font sizes and margins set differently in IE 6/7. -// Addresses font sizes within `section` and `article` in Firefox 4+, Safari 5, and Chrome. -// http://modularscale.com/scale/?px1=14&px2=12&ra1=1.5&ra2=0 -h1 -{ - $fs1: 27px; - margin: 0; - @include adjust-font-size-to($fs1); - @include margin-bottom(1, $fs1); - @include padding-top(1, $fs1); -} -h2 -{ - $fs1: 21px; - margin: 0; - @include adjust-font-size-to($fs1); - @include margin-bottom(1, $fs1); - @include padding-top(1, $fs1); -} -h3 -{ - $fs1: 18px; - margin: 0; - @include adjust-font-size-to($fs1); - @include margin-bottom(1, $fs1); - @include padding-top(1, $fs1); -} -h4 -{ - $fs1: 16px; - margin: 0; - @include adjust-font-size-to($fs1); - @include margin-bottom(1, $fs1); - @include padding-top(1, $fs1); -} -h5 -{ - $fs1: 14px; - margin: 0; - @include adjust-font-size-to($fs1); - @include margin-bottom(1, $fs1); - @include padding-top(1, $fs1); -} -h6 -{ - $fs1: 13px; - margin: 0; - @include adjust-font-size-to($fs1); - @include margin-bottom(1, $fs1); - @include padding-top(1, $fs1); -} -//Addresses styling not present in IE 7/8/9, Safari 5, and Chrome. -abbr[title] -{ - border-bottom: 1px dotted; -} - -// Addresses style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome. -b, -strong -{ - font-weight: bold; -} -blockquote -{ - margin: 0 $blueprint-grid-outer-width; - @include trailer; -} - -// Addresses styling not present in Safari 5 and Chrome. -dfn -{ - font-style: italic; -} - -// Addresses styling not present in IE 6/7/8/9. -mark -{ - background: #ff0; - color: #000; -} - -// Addresses margins set differently in IE 6/7. -p, -pre, -address -{ - margin: 0; - @include margin-bottom(); -} - -// Corrects font family set oddly in IE 6, Safari 4/5, and Chrome. -code, -kbd, -pre, -samp -{ - font-family: monospace, serif; - _font-family: 'courier new', monospace; - font-size: 1em; -} - -// Improves readability of pre-formatted text in all browsers. -pre -{ - white-space: pre; - white-space: pre-wrap; - word-wrap: break-word; -} - -// Addresses CSS quotes not supported in IE 6/7. -q -{ - quotes: none; -} - -// Addresses `quotes` property not supported in Safari 4. -q:before, -q:after -{ - content: ''; - content: none; -} - -/* - * Addresses inconsistent and variable font size in all browsers. - */ - -small { - font-size: 80%; - line-height: 0; - vertical-align: baseline; - position: relative; -} - -// Prevents `sub` and `sup` affecting `line-height` in all browsers. -sub, -sup -{ - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} -sup -{ - top: -0.5em; -} -sub -{ - bottom: -0.25em; -} - -// ========================================================================== -// Lists -// ========================================================================== - -// Addresses margins set differently in IE 6/7. -dl, -menu, -ol, -ul -{ - margin: 0; - @include margin-bottom; -} -dd -{ - margin: 0 0 0 $blueprint-grid-outer-width; -} - -// Addresses paddings set differently in IE 6/7. -menu, -ol, -ul -{ - padding: 0 0 0 $margin; -} - -// Corrects list images handled incorrectly in IE 7. -nav ul, -nav ol -{ - list-style: none; - list-style-image: none; -} - -// ========================================================================== -// Embedded content -// ========================================================================== - -// 1. Removes border when inside `a` element in IE 6/7/8/9 and Firefox 3. -// 2. Improves image quality when scaled in IE 7. -img -{ - border: 0; // 1 - -ms-interpolation-mode: bicubic; // 2 -} - -// Corrects overflow displayed oddly in IE 9. -svg:not(:root) -{ - overflow: hidden; -} - -// ========================================================================== -// Figures -// ========================================================================== - -// Addresses margin not present in IE 6/7/8/9, Safari 5, and Opera 11. -figure -{ - margin: 0; -} - -// ========================================================================== -// Forms -// ========================================================================== - -// Corrects margin displayed oddly in IE 6/7. -form -{ - margin: 0; -} - -// Define consistent border, margin, and padding. -fieldset -{ - border: 1px solid #c0c0c0; - margin: 0; - padding: 10px; - @include padding-top( 0.5); - @include padding-bottom(0.5); - @include margin-bottom( 1); -} - -// 1. Corrects color not being inherited in IE 6/7/8/9. -// 2. Corrects text not wrapping in Firefox 3. -// 3. Corrects alignment displayed oddly in IE 6/7. -legend -{ - border: 0; // 1 - padding: 0; - white-space: normal; // 2 - *margin-left: -7px; // 3 -} - -// 1. Corrects font size not being inherited in all browsers. -// 2. Addresses margins set differently in IE 6/7, Firefox 3+, Safari 5, and Chrome. -// 3. Improves appearance and consistency in all browsers. -button, -input, -select, -textarea -{ - font-size: 100%; // 1 - margin: 0; // 2 - vertical-align: baseline; // 3 - *vertical-align: middle; // 3 -} - -// Addresses Firefox 3+ setting `line-height` on `input` using `!important` in the UA stylesheet. -button, -input -{ - line-height: normal; -} - -// 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` and `video` controls. -// 2. Corrects inability to style clickable `input` types in iOS. -// 3. Improves usability and consistency of cursor style between image-type `input` and others. -// 4. Removes inner spacing in IE 7 without affecting normal text inputs. -// Known issue: inner spacing remains in IE 6. -button, -html input[type="button"], //1 -input[type="reset"], -input[type="submit"] -{ - -webkit-appearance: button; //2 - cursor: pointer; // 3 - *overflow: visible; // 4 -} - -// Re-set default cursor for disabled elements. -button[disabled], -input[disabled] -{ - cursor: default; -} - -// 1. Addresses box sizing set to content-box in IE 8/9. -// 2. Removes excess padding in IE 8/9. -// 3. Removes excess padding in IE 7. -// Known issue: excess padding remains in IE 6. -input[type="checkbox"], -input[type="radio"] -{ - box-sizing: border-box; // 1 - padding: 0; // 2 - *height: 13px; // 3 - *width: 13px; // 3 -} - -// 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome. -// 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome include `-moz` to future-proof). -input[type="search"] -{ - -webkit-appearance: textfield; /// 1 - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; // 2 - box-sizing: content-box; -} - -// Removes inner padding and search cancel button in Safari 5 and Chrome on OS X. -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration -{ - -webkit-appearance: none; -} - -// Removes inner padding and border in Firefox 3+. -button::-moz-focus-inner, -input::-moz-focus-inner -{ - border: 0; - padding: 0; -} - -// 1. Removes default vertical scrollbar in IE 6/7/8/9. -// 2. Improves readability and alignment in all browsers. -textarea -{ - overflow: auto; // 1 - vertical-align: top; // 2 -} - -// ========================================================================== -// Tables -// ========================================================================== - -// Remove most spacing between table cells. -table -{ - border-collapse: collapse; - border-spacing: 0; -} -th, td -{ - @include padding-top(.5); - padding-right: $margin/2; - @include padding-bottom(.5); - padding-left: $margin/2; -} \ No newline at end of file diff --git a/scss/libs/_bourbon.scss b/scss/libs/_bourbon.scss new file mode 100755 index 0000000..f393df2 --- /dev/null +++ b/scss/libs/_bourbon.scss @@ -0,0 +1,63 @@ +// Custom Helpers + +// @import "bourbon/helpers/deprecated-webkit-gradient"; +// @import "bourbon/helpers/gradient-positions-parser"; +// @import "bourbon/helpers/linear-positions-parser"; +// @import "bourbon/helpers/radial-arg-parser"; +// @import "bourbon/helpers/radial-positions-parser"; +// @import "bourbon/helpers/render-gradients"; +// @import "bourbon/helpers/shape-size-stripper"; + +// Custom Functions + +// @import "bourbon/functions/compact"; +// @import "bourbon/functions/flex-grid"; +// @import "bourbon/functions/grid-width"; +// @import "bourbon/functions/linear-gradient"; + @import "bourbon/functions/modular-scale"; +// @import "bourbon/functions/px-to-em"; +// @import "bourbon/functions/radial-gradient"; +// @import "bourbon/functions/tint-shade"; +// @import "bourbon/functions/transition-property-name"; + +// CSS3 Mixins + + @import "bourbon/css3/animation"; +// @import "bourbon/css3/appearance"; +// @import "bourbon/css3/backface-visibility"; +// @import "bourbon/css3/background"; +// @import "bourbon/css3/background-image"; +// @import "bourbon/css3/border-image"; +// @import "bourbon/css3/border-radius"; +// @import "bourbon/css3/box-sizing"; +// @import "bourbon/css3/columns"; +// @import "bourbon/css3/flex-box"; +// @import "bourbon/css3/font-face"; + @import "bourbon/css3/hidpi-media-query"; +// @import "bourbon/css3/image-rendering"; +// @import "bourbon/css3/inline-block"; + @import "bourbon/css3/keyframes"; +// @import "bourbon/css3/linear-gradient"; +// @import "bourbon/css3/perspective"; +// @import "bourbon/css3/radial-gradient"; +// @import "bourbon/css3/transform"; +// @import "bourbon/css3/transition"; +// @import "bourbon/css3/user-select"; + @import "bourbon/css3/placeholder"; + +// Addons & other mixins + +// @import "bourbon/addons/button"; +// @import "bourbon/addons/clearfix"; + @import "bourbon/addons/font-family"; +// @import "bourbon/addons/hide-text"; +// @import "bourbon/addons/html5-input-types"; +// @import "bourbon/addons/position"; + @import "bourbon/addons/prefixer"; + @import "bourbon/addons/retina-image"; +// @import "bourbon/addons/size"; + @import "bourbon/addons/timing-functions"; + @import "bourbon/addons/triangle"; + +// Soon to be deprecated Mixins +// @import "bourbon/bourbon-deprecated-upcoming"; diff --git a/scss/libs/_compass.scss b/scss/libs/_compass.scss new file mode 100755 index 0000000..9b741c0 --- /dev/null +++ b/scss/libs/_compass.scss @@ -0,0 +1,3 @@ +@import "compass/utilities"; +@import "compass/typography"; +@import "compass/css3"; diff --git a/scss/libs/_normalize.scss b/scss/libs/_normalize.scss new file mode 100755 index 0000000..9565c45 --- /dev/null +++ b/scss/libs/_normalize.scss @@ -0,0 +1,529 @@ +/** --- @section LIBS/NORMALIZE --- */ + +/*! normalize.css v1.1.2 | MIT License | git.io/normalize */ + +/* ========================================================================== + HTML5 display definitions + ========================================================================== */ + +/** + * Correct `block` display not defined in IE 6/7/8/9 and Firefox 3. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} + +/** + * Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. + */ + +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address styling not present in IE 7/8/9, Firefox 3, and Safari 4. + * Known issue: no IE 6 support. + */ + +[hidden] { + display: none; +} + +/* ========================================================================== + Base + ========================================================================== */ + +/** + * 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using + * `em` units. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +html { + font-size: 100%; /* 1 */ + -ms-text-size-adjust: 100%; /* 2 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/** + * Address `font-family` inconsistency between `textarea` and other form + * elements. + */ + +html, +button, +input, +select, +textarea { + font-family: sans-serif; +} + +/** + * Address margins handled incorrectly in IE 6/7. + */ + +body { + margin: 0; +} + +/* ========================================================================== + Links + ========================================================================== */ + +/** + * Address `outline` inconsistency between Chrome and other browsers. + */ + +a:focus { + outline: thin dotted; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ + +a:active, +a:hover { + outline: 0; +} + +/* ========================================================================== + Typography + ========================================================================== */ + +/** + * Address font sizes and margins set differently in IE 6/7. + * Address font sizes within `section` and `article` in Firefox 4+, Safari 5, + * and Chrome. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +h2 { + font-size: 1.5em; + margin: 0.83em 0; +} + +h3 { + font-size: 1.17em; + margin: 1em 0; +} + +h4 { + font-size: 1em; + margin: 1.33em 0; +} + +h5 { + font-size: 0.83em; + margin: 1.67em 0; +} + +h6 { + font-size: 0.67em; + margin: 2.33em 0; +} + +/** + * Address styling not present in IE 7/8/9, Safari 5, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +blockquote { + margin: 1em 40px; +} + +/** + * Address styling not present in Safari 5 and Chrome. + */ + +dfn { + font-style: italic; +} + +/** + * Address differences between Firefox and other browsers. + * Known issue: no IE 6/7 normalization. + */ + +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Address styling not present in IE 6/7/8/9. + */ + +mark { + background: #ff0; + color: #000; +} + +/** + * Address margins set differently in IE 6/7. + */ + +p, +pre { + margin: 1em 0; +} + +/** + * Correct font family set oddly in IE 6, Safari 4/5, and Chrome. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; +} + +/** + * Improve readability of pre-formatted text in all browsers. + */ + +pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} + +/** + * Address CSS quotes not supported in IE 6/7. + */ + +q { + quotes: none; +} + +/** + * Address `quotes` property not supported in Safari 4. + */ + +q:before, +q:after { + content: ''; + content: none; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* ========================================================================== + Lists + ========================================================================== */ + +/** + * Address margins set differently in IE 6/7. + */ + +dl, +menu, +ol, +ul { + margin: 1em 0; +} + +dd { + margin: 0 0 0 40px; +} + +/** + * Address paddings set differently in IE 6/7. + */ + +menu, +ol, +ul { + padding: 0 0 0 40px; +} + +/** + * Correct list images handled incorrectly in IE 7. + */ + +nav ul, +nav ol { + list-style: none; + list-style-image: none; +} + +/* ========================================================================== + Embedded content + ========================================================================== */ + +/** + * 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3. + * 2. Improve image quality when scaled in IE 7. + */ + +img { + border: 0; /* 1 */ + -ms-interpolation-mode: bicubic; /* 2 */ +} + +/** + * Correct overflow displayed oddly in IE 9. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* ========================================================================== + Figures + ========================================================================== */ + +/** + * Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11. + */ + +figure { + margin: 0; +} + +/* ========================================================================== + Forms + ========================================================================== */ + +/** + * Correct margin displayed oddly in IE 6/7. + */ + +form { + margin: 0; +} + +/** + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct color not being inherited in IE 6/7/8/9. + * 2. Correct text not wrapping in Firefox 3. + * 3. Correct alignment displayed oddly in IE 6/7. + */ + +legend { + border: 0; /* 1 */ + padding: 0; + white-space: normal; /* 2 */ + *margin-left: -7px; /* 3 */ +} + +/** + * 1. Correct font size not being inherited in all browsers. + * 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5, + * and Chrome. + * 3. Improve appearance and consistency in all browsers. + */ + +button, +input, +select, +textarea { + font-size: 100%; /* 1 */ + margin: 0; /* 2 */ + vertical-align: baseline; /* 3 */ + *vertical-align: middle; /* 3 */ +} + +/** + * Address Firefox 3+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +button, +input { + line-height: normal; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+. + * Correct `select` style inheritance in Firefox 4+ and Opera. + */ + +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + * 4. Remove inner spacing in IE 7 without affecting normal text inputs. + * Known issue: inner spacing remains in IE 6. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ + *overflow: visible; /* 4 */ +} + +/** + * Re-set default cursor for disabled elements. + */ + +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * 1. Address box sizing set to content-box in IE 8/9. + * 2. Remove excess padding in IE 8/9. + * 3. Remove excess padding in IE 7. + * Known issue: excess padding remains in IE 6. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ + *height: 13px; /* 3 */ + *width: 13px; /* 3 */ +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari 5 and Chrome + * on OS X. + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Remove inner padding and border in Firefox 3+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * 1. Remove default vertical scrollbar in IE 6/7/8/9. + * 2. Improve readability and alignment in all browsers. + */ + +textarea { + overflow: auto; /* 1 */ + vertical-align: top; /* 2 */ +} + +/* ========================================================================== + Tables + ========================================================================== */ + +/** + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} \ No newline at end of file diff --git a/scss/libs/bourbon/_bourbon-deprecated-upcoming.scss b/scss/libs/bourbon/_bourbon-deprecated-upcoming.scss new file mode 100755 index 0000000..5332496 --- /dev/null +++ b/scss/libs/bourbon/_bourbon-deprecated-upcoming.scss @@ -0,0 +1,13 @@ +//************************************************************************// +// These mixins/functions are deprecated +// They will be removed in the next MAJOR version release +//************************************************************************// +@mixin box-shadow ($shadows...) { + @include prefixer(box-shadow, $shadows, spec); + @warn "box-shadow is deprecated and will be removed in the next major version release"; +} + +@mixin background-size ($lengths...) { + @include prefixer(background-size, $lengths, spec); + @warn "background-size is deprecated and will be removed in the next major version release"; +} diff --git a/scss/libs/bourbon/addons/_button.scss b/scss/libs/bourbon/addons/_button.scss new file mode 100755 index 0000000..3ae393c --- /dev/null +++ b/scss/libs/bourbon/addons/_button.scss @@ -0,0 +1,273 @@ +@mixin button ($style: simple, $base-color: #4294f0) { + + @if type-of($style) == color { + $base-color: $style; + $style: simple; + } + + // Grayscale button + @if $base-color == grayscale($base-color) { + @if $style == simple { + @include simple($base-color, $grayscale: true); + } + + @else if $style == shiny { + @include shiny($base-color, $grayscale: true); + } + + @else if $style == pill { + @include pill($base-color, $grayscale: true); + } + } + + // Colored button + @else { + @if $style == simple { + @include simple($base-color); + } + + @else if $style == shiny { + @include shiny($base-color); + } + + @else if $style == pill { + @include pill($base-color); + } + } + + &:disabled { + opacity: 0.5; + cursor: not-allowed; + } +} + + +// Simple Button +//************************************************************************// +@mixin simple($base-color, $grayscale: false) { + $color: hsl(0, 0, 100%); + $border: adjust-color($base-color, $saturation: 9%, $lightness: -14%); + $inset-shadow: adjust-color($base-color, $saturation: -8%, $lightness: 15%); + $stop-gradient: adjust-color($base-color, $saturation: 9%, $lightness: -11%); + $text-shadow: adjust-color($base-color, $saturation: 15%, $lightness: -18%); + + @if lightness($base-color) > 70% { + $color: hsl(0, 0, 20%); + $text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%); + } + + @if $grayscale == true { + $border: grayscale($border); + $inset-shadow: grayscale($inset-shadow); + $stop-gradient: grayscale($stop-gradient); + $text-shadow: grayscale($text-shadow); + } + + border: 1px solid $border; + border-radius: 3px; + box-shadow: inset 0 1px 0 0 $inset-shadow; + color: $color; + display: inline-block; + font-size: 11px; + font-weight: bold; + @include linear-gradient ($base-color, $stop-gradient); + padding: 7px 18px; + text-decoration: none; + text-shadow: 0 1px 0 $text-shadow; + background-clip: padding-box; + + &:hover:not(:disabled) { + $base-color-hover: adjust-color($base-color, $saturation: -4%, $lightness: -5%); + $inset-shadow-hover: adjust-color($base-color, $saturation: -7%, $lightness: 5%); + $stop-gradient-hover: adjust-color($base-color, $saturation: 8%, $lightness: -14%); + + @if $grayscale == true { + $base-color-hover: grayscale($base-color-hover); + $inset-shadow-hover: grayscale($inset-shadow-hover); + $stop-gradient-hover: grayscale($stop-gradient-hover); + } + + box-shadow: inset 0 1px 0 0 $inset-shadow-hover; + cursor: pointer; + @include linear-gradient ($base-color-hover, $stop-gradient-hover); + } + + &:active:not(:disabled) { + $border-active: adjust-color($base-color, $saturation: 9%, $lightness: -14%); + $inset-shadow-active: adjust-color($base-color, $saturation: 7%, $lightness: -17%); + + @if $grayscale == true { + $border-active: grayscale($border-active); + $inset-shadow-active: grayscale($inset-shadow-active); + } + + border: 1px solid $border-active; + box-shadow: inset 0 0 8px 4px $inset-shadow-active, inset 0 0 8px 4px $inset-shadow-active, 0 1px 1px 0 #eee; + } +} + + +// Shiny Button +//************************************************************************// +@mixin shiny($base-color, $grayscale: false) { + $color: hsl(0, 0, 100%); + $border: adjust-color($base-color, $red: -117, $green: -111, $blue: -81); + $border-bottom: adjust-color($base-color, $red: -126, $green: -127, $blue: -122); + $fourth-stop: adjust-color($base-color, $red: -79, $green: -70, $blue: -46); + $inset-shadow: adjust-color($base-color, $red: 37, $green: 29, $blue: 12); + $second-stop: adjust-color($base-color, $red: -56, $green: -50, $blue: -33); + $text-shadow: adjust-color($base-color, $red: -140, $green: -141, $blue: -114); + $third-stop: adjust-color($base-color, $red: -86, $green: -75, $blue: -48); + + @if lightness($base-color) > 70% { + $color: hsl(0, 0, 20%); + $text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%); + } + + @if $grayscale == true { + $border: grayscale($border); + $border-bottom: grayscale($border-bottom); + $fourth-stop: grayscale($fourth-stop); + $inset-shadow: grayscale($inset-shadow); + $second-stop: grayscale($second-stop); + $text-shadow: grayscale($text-shadow); + $third-stop: grayscale($third-stop); + } + + border: 1px solid $border; + border-bottom: 1px solid $border-bottom; + border-radius: 5px; + box-shadow: inset 0 1px 0 0 $inset-shadow; + color: $color; + display: inline-block; + font-size: 14px; + font-weight: bold; + @include linear-gradient(top, $base-color 0%, $second-stop 50%, $third-stop 50%, $fourth-stop 100%); + padding: 8px 20px; + text-align: center; + text-decoration: none; + text-shadow: 0 -1px 1px $text-shadow; + + &:hover:not(:disabled) { + $first-stop-hover: adjust-color($base-color, $red: -13, $green: -15, $blue: -18); + $second-stop-hover: adjust-color($base-color, $red: -66, $green: -62, $blue: -51); + $third-stop-hover: adjust-color($base-color, $red: -93, $green: -85, $blue: -66); + $fourth-stop-hover: adjust-color($base-color, $red: -86, $green: -80, $blue: -63); + + @if $grayscale == true { + $first-stop-hover: grayscale($first-stop-hover); + $second-stop-hover: grayscale($second-stop-hover); + $third-stop-hover: grayscale($third-stop-hover); + $fourth-stop-hover: grayscale($fourth-stop-hover); + } + + cursor: pointer; + @include linear-gradient(top, $first-stop-hover 0%, + $second-stop-hover 50%, + $third-stop-hover 50%, + $fourth-stop-hover 100%); + } + + &:active:not(:disabled) { + $inset-shadow-active: adjust-color($base-color, $red: -111, $green: -116, $blue: -122); + + @if $grayscale == true { + $inset-shadow-active: grayscale($inset-shadow-active); + } + + box-shadow: inset 0 0 20px 0 $inset-shadow-active, 0 1px 0 #fff; + } +} + + +// Pill Button +//************************************************************************// +@mixin pill($base-color, $grayscale: false) { + $color: hsl(0, 0, 100%); + $border-bottom: adjust-color($base-color, $hue: 8, $saturation: -11%, $lightness: -26%); + $border-sides: adjust-color($base-color, $hue: 4, $saturation: -21%, $lightness: -21%); + $border-top: adjust-color($base-color, $hue: -1, $saturation: -30%, $lightness: -15%); + $inset-shadow: adjust-color($base-color, $hue: -1, $saturation: -1%, $lightness: 7%); + $stop-gradient: adjust-color($base-color, $hue: 8, $saturation: 14%, $lightness: -10%); + $text-shadow: adjust-color($base-color, $hue: 5, $saturation: -19%, $lightness: -15%); + + @if lightness($base-color) > 70% { + $color: hsl(0, 0, 20%); + $text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%); + } + + @if $grayscale == true { + $border-bottom: grayscale($border-bottom); + $border-sides: grayscale($border-sides); + $border-top: grayscale($border-top); + $inset-shadow: grayscale($inset-shadow); + $stop-gradient: grayscale($stop-gradient); + $text-shadow: grayscale($text-shadow); + } + + border: 1px solid $border-top; + border-color: $border-top $border-sides $border-bottom; + border-radius: 16px; + box-shadow: inset 0 1px 0 0 $inset-shadow, 0 1px 2px 0 #b3b3b3; + color: $color; + display: inline-block; + font-size: 11px; + font-weight: normal; + line-height: 1; + @include linear-gradient ($base-color, $stop-gradient); + padding: 5px 16px; + text-align: center; + text-decoration: none; + text-shadow: 0 -1px 1px $text-shadow; + background-clip: padding-box; + + &:hover:not(:disabled) { + $base-color-hover: adjust-color($base-color, $lightness: -4.5%); + $border-bottom: adjust-color($base-color, $hue: 8, $saturation: 13.5%, $lightness: -32%); + $border-sides: adjust-color($base-color, $hue: 4, $saturation: -2%, $lightness: -27%); + $border-top: adjust-color($base-color, $hue: -1, $saturation: -17%, $lightness: -21%); + $inset-shadow-hover: adjust-color($base-color, $saturation: -1%, $lightness: 3%); + $stop-gradient-hover: adjust-color($base-color, $hue: 8, $saturation: -4%, $lightness: -15.5%); + $text-shadow-hover: adjust-color($base-color, $hue: 5, $saturation: -5%, $lightness: -22%); + + @if $grayscale == true { + $base-color-hover: grayscale($base-color-hover); + $border-bottom: grayscale($border-bottom); + $border-sides: grayscale($border-sides); + $border-top: grayscale($border-top); + $inset-shadow-hover: grayscale($inset-shadow-hover); + $stop-gradient-hover: grayscale($stop-gradient-hover); + $text-shadow-hover: grayscale($text-shadow-hover); + } + + border: 1px solid $border-top; + border-color: $border-top $border-sides $border-bottom; + box-shadow: inset 0 1px 0 0 $inset-shadow-hover; + cursor: pointer; + @include linear-gradient ($base-color-hover, $stop-gradient-hover); + text-shadow: 0 -1px 1px $text-shadow-hover; + background-clip: padding-box; + } + + &:active:not(:disabled) { + $active-color: adjust-color($base-color, $hue: 4, $saturation: -12%, $lightness: -10%); + $border-active: adjust-color($base-color, $hue: 6, $saturation: -2.5%, $lightness: -30%); + $border-bottom-active: adjust-color($base-color, $hue: 11, $saturation: 6%, $lightness: -31%); + $inset-shadow-active: adjust-color($base-color, $hue: 9, $saturation: 2%, $lightness: -21.5%); + $text-shadow-active: adjust-color($base-color, $hue: 5, $saturation: -12%, $lightness: -21.5%); + + @if $grayscale == true { + $active-color: grayscale($active-color); + $border-active: grayscale($border-active); + $border-bottom-active: grayscale($border-bottom-active); + $inset-shadow-active: grayscale($inset-shadow-active); + $text-shadow-active: grayscale($text-shadow-active); + } + + background: $active-color; + border: 1px solid $border-active; + border-bottom: 1px solid $border-bottom-active; + box-shadow: inset 0 0 6px 3px $inset-shadow-active, 0 1px 0 0 #fff; + text-shadow: 0 -1px 1px $text-shadow-active; + } +} diff --git a/scss/libs/bourbon/addons/_clearfix.scss b/scss/libs/bourbon/addons/_clearfix.scss new file mode 100755 index 0000000..ca9903c --- /dev/null +++ b/scss/libs/bourbon/addons/_clearfix.scss @@ -0,0 +1,29 @@ +// Micro clearfix provides an easy way to contain floats without adding additional markup +// +// Example usage: +// +// // Contain all floats within .wrapper +// .wrapper { +// @include clearfix; +// .content, +// .sidebar { +// float : left; +// } +// } + +@mixin clearfix { + *zoom: 1; + + &:before, + &:after { + content: " "; + display: table; + } + + &:after { + clear: both; + } +} + +// Acknowledgements +// Micro clearfix: [Nicolas Gallagher](http://nicolasgallagher.com/micro-clearfix-hack/) diff --git a/scss/libs/bourbon/addons/_font-family.scss b/scss/libs/bourbon/addons/_font-family.scss new file mode 100755 index 0000000..df8a80d --- /dev/null +++ b/scss/libs/bourbon/addons/_font-family.scss @@ -0,0 +1,5 @@ +$georgia: Georgia, Cambria, "Times New Roman", Times, serif; +$helvetica: "Helvetica Neue", Helvetica, Arial, sans-serif; +$lucida-grande: "Lucida Grande", Tahoma, Verdana, Arial, sans-serif; +$monospace: "Bitstream Vera Sans Mono", Consolas, Courier, monospace; +$verdana: Verdana, Geneva, sans-serif; diff --git a/scss/libs/bourbon/addons/_hide-text.scss b/scss/libs/bourbon/addons/_hide-text.scss new file mode 100755 index 0000000..68d4bf8 --- /dev/null +++ b/scss/libs/bourbon/addons/_hide-text.scss @@ -0,0 +1,5 @@ +@mixin hide-text { + color: transparent; + font: 0/0 a; + text-shadow: none; +} diff --git a/scss/libs/bourbon/addons/_html5-input-types.scss b/scss/libs/bourbon/addons/_html5-input-types.scss new file mode 100755 index 0000000..b184382 --- /dev/null +++ b/scss/libs/bourbon/addons/_html5-input-types.scss @@ -0,0 +1,56 @@ +//************************************************************************// +// Generate a variable ($all-text-inputs) with a list of all html5 +// input types that have a text-based input, excluding textarea. +// http://diveintohtml5.org/forms.html +//************************************************************************// +$inputs-list: 'input[type="email"]', + 'input[type="number"]', + 'input[type="password"]', + 'input[type="search"]', + 'input[type="tel"]', + 'input[type="text"]', + 'input[type="url"]', + + // Webkit & Gecko may change the display of these in the future + 'input[type="color"]', + 'input[type="date"]', + 'input[type="datetime"]', + 'input[type="datetime-local"]', + 'input[type="month"]', + 'input[type="time"]', + 'input[type="week"]'; + +$unquoted-inputs-list: (); +@each $input-type in $inputs-list { + $unquoted-inputs-list: append($unquoted-inputs-list, unquote($input-type), comma); +} + +$all-text-inputs: $unquoted-inputs-list; + + +// Hover Pseudo-class +//************************************************************************// +$all-text-inputs-hover: (); +@each $input-type in $unquoted-inputs-list { + $input-type-hover: $input-type + ":hover"; + $all-text-inputs-hover: append($all-text-inputs-hover, $input-type-hover, comma); +} + +// Focus Pseudo-class +//************************************************************************// +$all-text-inputs-focus: (); +@each $input-type in $unquoted-inputs-list { + $input-type-focus: $input-type + ":focus"; + $all-text-inputs-focus: append($all-text-inputs-focus, $input-type-focus, comma); +} + +// You must use interpolation on the variable: +// #{$all-text-inputs} +// #{$all-text-inputs-hover} +// #{$all-text-inputs-focus} + +// Example +//************************************************************************// +// #{$all-text-inputs}, textarea { +// border: 1px solid red; +// } diff --git a/scss/libs/bourbon/addons/_position.scss b/scss/libs/bourbon/addons/_position.scss new file mode 100755 index 0000000..faad1ca --- /dev/null +++ b/scss/libs/bourbon/addons/_position.scss @@ -0,0 +1,42 @@ +@mixin position ($position: relative, $coordinates: 0 0 0 0) { + + @if type-of($position) == list { + $coordinates: $position; + $position: relative; + } + + $top: nth($coordinates, 1); + $right: nth($coordinates, 2); + $bottom: nth($coordinates, 3); + $left: nth($coordinates, 4); + + position: $position; + + @if $top == auto { + top: $top; + } + @else if not(unitless($top)) { + top: $top; + } + + @if $right == auto { + right: $right; + } + @else if not(unitless($right)) { + right: $right; + } + + @if $bottom == auto { + bottom: $bottom; + } + @else if not(unitless($bottom)) { + bottom: $bottom; + } + + @if $left == auto { + left: $left; + } + @else if not(unitless($left)) { + left: $left; + } +} diff --git a/scss/libs/bourbon/addons/_prefixer.scss b/scss/libs/bourbon/addons/_prefixer.scss new file mode 100755 index 0000000..6bfd23a --- /dev/null +++ b/scss/libs/bourbon/addons/_prefixer.scss @@ -0,0 +1,49 @@ +//************************************************************************// +// Example: @include prefixer(border-radius, $radii, webkit ms spec); +//************************************************************************// +$prefix-for-webkit: true !default; +$prefix-for-mozilla: true !default; +$prefix-for-microsoft: true !default; +$prefix-for-opera: true !default; +$prefix-for-spec: true !default; // required for keyframe mixin + +@mixin prefixer ($property, $value, $prefixes) { + @each $prefix in $prefixes { + @if $prefix == webkit { + @if $prefix-for-webkit { + -webkit-#{$property}: $value; + } + } + @else if $prefix == moz { + @if $prefix-for-mozilla { + -moz-#{$property}: $value; + } + } + @else if $prefix == ms { + @if $prefix-for-microsoft { + -ms-#{$property}: $value; + } + } + @else if $prefix == o { + @if $prefix-for-opera { + -o-#{$property}: $value; + } + } + @else if $prefix == spec { + @if $prefix-for-spec { + #{$property}: $value; + } + } + @else { + @warn "Unrecognized prefix: #{$prefix}"; + } + } +} + +@mixin disable-prefix-for-all() { + $prefix-for-webkit: false; + $prefix-for-mozilla: false; + $prefix-for-microsoft: false; + $prefix-for-opera: false; + $prefix-for-spec: false; +} diff --git a/scss/libs/bourbon/addons/_retina-image.scss b/scss/libs/bourbon/addons/_retina-image.scss new file mode 100755 index 0000000..ed30071 --- /dev/null +++ b/scss/libs/bourbon/addons/_retina-image.scss @@ -0,0 +1,32 @@ +@mixin retina-image($filename, $background-size, $extension: png, $retina-filename: null, $asset-pipeline: false) { + @if $asset-pipeline { + background-image: image_url($filename + "." + $extension); + } + @else { + background-image: url($filename + "." + $extension); + } + + @include hidpi { + + @if $asset-pipeline { + @if $retina-filename { + background-image: image_url($retina-filename + "." + $extension); + } + @else { + background-image: image_url($filename + "@2x" + "." + $extension); + } + } + + @else { + @if $retina-filename { + background-image: url($retina-filename + "." + $extension); + } + @else { + background-image: url($filename + "@2x" + "." + $extension); + } + } + + background-size: $background-size; + + } +} diff --git a/scss/libs/bourbon/addons/_size.scss b/scss/libs/bourbon/addons/_size.scss new file mode 100755 index 0000000..342e41b --- /dev/null +++ b/scss/libs/bourbon/addons/_size.scss @@ -0,0 +1,44 @@ +@mixin size($size) { + @if length($size) == 1 { + @if $size == auto { + width: $size; + height: $size; + } + + @else if unitless($size) { + width: $size + px; + height: $size + px; + } + + @else if not(unitless($size)) { + width: $size; + height: $size; + } + } + + // Width x Height + @if length($size) == 2 { + $width: nth($size, 1); + $height: nth($size, 2); + + @if $width == auto { + width: $width; + } + @else if not(unitless($width)) { + width: $width; + } + @else if unitless($width) { + width: $width + px; + } + + @if $height == auto { + height: $height; + } + @else if not(unitless($height)) { + height: $height; + } + @else if unitless($height) { + height: $height + px; + } + } +} diff --git a/scss/libs/bourbon/addons/_timing-functions.scss b/scss/libs/bourbon/addons/_timing-functions.scss new file mode 100755 index 0000000..51b2410 --- /dev/null +++ b/scss/libs/bourbon/addons/_timing-functions.scss @@ -0,0 +1,32 @@ +// CSS cubic-bezier timing functions. Timing functions courtesy of jquery.easie (github.com/jaukia/easie) +// Timing functions are the same as demo'ed here: http://jqueryui.com/demos/effect/easing.html + +// EASE IN +$ease-in-quad: cubic-bezier(0.550, 0.085, 0.680, 0.530); +$ease-in-cubic: cubic-bezier(0.550, 0.055, 0.675, 0.190); +$ease-in-quart: cubic-bezier(0.895, 0.030, 0.685, 0.220); +$ease-in-quint: cubic-bezier(0.755, 0.050, 0.855, 0.060); +$ease-in-sine: cubic-bezier(0.470, 0.000, 0.745, 0.715); +$ease-in-expo: cubic-bezier(0.950, 0.050, 0.795, 0.035); +$ease-in-circ: cubic-bezier(0.600, 0.040, 0.980, 0.335); +$ease-in-back: cubic-bezier(0.600, -0.280, 0.735, 0.045); + +// EASE OUT +$ease-out-quad: cubic-bezier(0.250, 0.460, 0.450, 0.940); +$ease-out-cubic: cubic-bezier(0.215, 0.610, 0.355, 1.000); +$ease-out-quart: cubic-bezier(0.165, 0.840, 0.440, 1.000); +$ease-out-quint: cubic-bezier(0.230, 1.000, 0.320, 1.000); +$ease-out-sine: cubic-bezier(0.390, 0.575, 0.565, 1.000); +$ease-out-expo: cubic-bezier(0.190, 1.000, 0.220, 1.000); +$ease-out-circ: cubic-bezier(0.075, 0.820, 0.165, 1.000); +$ease-out-back: cubic-bezier(0.175, 0.885, 0.320, 1.275); + +// EASE IN OUT +$ease-in-out-quad: cubic-bezier(0.455, 0.030, 0.515, 0.955); +$ease-in-out-cubic: cubic-bezier(0.645, 0.045, 0.355, 1.000); +$ease-in-out-quart: cubic-bezier(0.770, 0.000, 0.175, 1.000); +$ease-in-out-quint: cubic-bezier(0.860, 0.000, 0.070, 1.000); +$ease-in-out-sine: cubic-bezier(0.445, 0.050, 0.550, 0.950); +$ease-in-out-expo: cubic-bezier(1.000, 0.000, 0.000, 1.000); +$ease-in-out-circ: cubic-bezier(0.785, 0.135, 0.150, 0.860); +$ease-in-out-back: cubic-bezier(0.680, -0.550, 0.265, 1.550); diff --git a/scss/libs/bourbon/addons/_triangle.scss b/scss/libs/bourbon/addons/_triangle.scss new file mode 100755 index 0000000..0e02aca --- /dev/null +++ b/scss/libs/bourbon/addons/_triangle.scss @@ -0,0 +1,45 @@ +@mixin triangle ($size, $color, $direction) { + height: 0; + width: 0; + + @if ($direction == up) or ($direction == down) or ($direction == right) or ($direction == left) { + border-color: transparent; + border-style: solid; + border-width: $size / 2; + + @if $direction == up { + border-bottom-color: $color; + + } @else if $direction == right { + border-left-color: $color; + + } @else if $direction == down { + border-top-color: $color; + + } @else if $direction == left { + border-right-color: $color; + } + } + + @else if ($direction == up-right) or ($direction == up-left) { + border-top: $size solid $color; + + @if $direction == up-right { + border-left: $size solid transparent; + + } @else if $direction == up-left { + border-right: $size solid transparent; + } + } + + @else if ($direction == down-right) or ($direction == down-left) { + border-bottom: $size solid $color; + + @if $direction == down-right { + border-left: $size solid transparent; + + } @else if $direction == down-left { + border-right: $size solid transparent; + } + } +} diff --git a/scss/libs/bourbon/css3/_animation.scss b/scss/libs/bourbon/css3/_animation.scss new file mode 100755 index 0000000..08c3dbf --- /dev/null +++ b/scss/libs/bourbon/css3/_animation.scss @@ -0,0 +1,52 @@ +// http://www.w3.org/TR/css3-animations/#the-animation-name-property- +// Each of these mixins support comma separated lists of values, which allows different transitions for individual properties to be described in a single style rule. Each value in the list corresponds to the value at that same position in the other properties. + +// Official animation shorthand property. +@mixin animation ($animations...) { + @include prefixer(animation, $animations, webkit moz spec); +} + +// Individual Animation Properties +@mixin animation-name ($names...) { + @include prefixer(animation-name, $names, webkit moz spec); +} + + +@mixin animation-duration ($times...) { + @include prefixer(animation-duration, $times, webkit moz spec); +} + + +@mixin animation-timing-function ($motions...) { +// ease | linear | ease-in | ease-out | ease-in-out + @include prefixer(animation-timing-function, $motions, webkit moz spec); +} + + +@mixin animation-iteration-count ($values...) { +// infinite | + @include prefixer(animation-iteration-count, $values, webkit moz spec); +} + + +@mixin animation-direction ($directions...) { +// normal | alternate + @include prefixer(animation-direction, $directions, webkit moz spec); +} + + +@mixin animation-play-state ($states...) { +// running | paused + @include prefixer(animation-play-state, $states, webkit moz spec); +} + + +@mixin animation-delay ($times...) { + @include prefixer(animation-delay, $times, webkit moz spec); +} + + +@mixin animation-fill-mode ($modes...) { +// none | forwards | backwards | both + @include prefixer(animation-fill-mode, $modes, webkit moz spec); +} diff --git a/scss/libs/bourbon/css3/_appearance.scss b/scss/libs/bourbon/css3/_appearance.scss new file mode 100755 index 0000000..3eb16e4 --- /dev/null +++ b/scss/libs/bourbon/css3/_appearance.scss @@ -0,0 +1,3 @@ +@mixin appearance ($value) { + @include prefixer(appearance, $value, webkit moz ms o spec); +} diff --git a/scss/libs/bourbon/css3/_backface-visibility.scss b/scss/libs/bourbon/css3/_backface-visibility.scss new file mode 100755 index 0000000..1161fe6 --- /dev/null +++ b/scss/libs/bourbon/css3/_backface-visibility.scss @@ -0,0 +1,6 @@ +//************************************************************************// +// Backface-visibility mixin +//************************************************************************// +@mixin backface-visibility($visibility) { + @include prefixer(backface-visibility, $visibility, webkit spec); +} diff --git a/scss/libs/bourbon/css3/_background-image.scss b/scss/libs/bourbon/css3/_background-image.scss new file mode 100755 index 0000000..17016b9 --- /dev/null +++ b/scss/libs/bourbon/css3/_background-image.scss @@ -0,0 +1,48 @@ +//************************************************************************// +// Background-image property for adding multiple background images with +// gradients, or for stringing multiple gradients together. +//************************************************************************// + +@mixin background-image($images...) { + background-image: _add-prefix($images, webkit); + background-image: _add-prefix($images); +} + +@function _add-prefix($images, $vendor: false) { + $images-prefixed: (); + $gradient-positions: false; + @for $i from 1 through length($images) { + $type: type-of(nth($images, $i)); // Get type of variable - List or String + + // If variable is a list - Gradient + @if $type == list { + $gradient-type: nth(nth($images, $i), 1); // linear or radial + $gradient-pos: null; + $gradient-args: null; + + @if ($gradient-type == linear) or ($gradient-type == radial) { + $gradient-pos: nth(nth($images, $i), 2); // Get gradient position + $gradient-args: nth(nth($images, $i), 3); // Get actual gradient (red, blue) + } + @else { + $gradient-args: nth(nth($images, $i), 2); // Get actual gradient (red, blue) + } + + $gradient-positions: _gradient-positions-parser($gradient-type, $gradient-pos); + $gradient: _render-gradients($gradient-positions, $gradient-args, $gradient-type, $vendor); + $images-prefixed: append($images-prefixed, $gradient, comma); + } + // If variable is a string - Image + @else if $type == string { + $images-prefixed: join($images-prefixed, nth($images, $i), comma); + } + } + @return $images-prefixed; +} + +//Examples: + //@include background-image(linear-gradient(top, orange, red)); + //@include background-image(radial-gradient(50% 50%, cover circle, orange, red)); + //@include background-image(url("/images/a.png"), linear-gradient(orange, red)); + //@include background-image(url("image.png"), linear-gradient(orange, red), url("image.png")); + //@include background-image(linear-gradient(hsla(0, 100%, 100%, 0.25) 0%, hsla(0, 100%, 100%, 0.08) 50%, transparent 50%), linear-gradient(orange, red)); diff --git a/scss/libs/bourbon/css3/_background.scss b/scss/libs/bourbon/css3/_background.scss new file mode 100755 index 0000000..766d5d3 --- /dev/null +++ b/scss/libs/bourbon/css3/_background.scss @@ -0,0 +1,103 @@ +//************************************************************************// +// Background property for adding multiple backgrounds using shorthand +// notation. +//************************************************************************// + +@mixin background( + $background-1 , $background-2: false, + $background-3: false, $background-4: false, + $background-5: false, $background-6: false, + $background-7: false, $background-8: false, + $background-9: false, $background-10: false, + $fallback: false +) { + $backgrounds: compact($background-1, $background-2, + $background-3, $background-4, + $background-5, $background-6, + $background-7, $background-8, + $background-9, $background-10); + + $fallback-color: false; + @if (type-of($fallback) == color) or ($fallback == "transparent") { + $fallback-color: $fallback; + } + @else { + $fallback-color: _extract-background-color($backgrounds); + } + + @if $fallback-color { + background-color: $fallback-color; + } + background: _background-add-prefix($backgrounds, webkit); + background: _background-add-prefix($backgrounds); +} + +@function _extract-background-color($backgrounds) { + $final-bg-layer: nth($backgrounds, length($backgrounds)); + @if type-of($final-bg-layer) == list { + @for $i from 1 through length($final-bg-layer) { + $value: nth($final-bg-layer, $i); + @if type-of($value) == color { + @return $value; + } + } + } + @return false; +} + +@function _background-add-prefix($backgrounds, $vendor: false) { + $backgrounds-prefixed: (); + + @for $i from 1 through length($backgrounds) { + $shorthand: nth($backgrounds, $i); // Get member for current index + $type: type-of($shorthand); // Get type of variable - List (gradient) or String (image) + + // If shorthand is a list (gradient) + @if $type == list { + $first-member: nth($shorthand, 1); // Get first member of shorthand + + // Linear Gradient + @if index(linear radial, nth($first-member, 1)) { + $gradient-type: nth($first-member, 1); // linear || radial + $gradient-args: false; + $gradient-positions: false; + $shorthand-start: false; + @if type-of($first-member) == list { // Linear gradient plus additional shorthand values - lg(red,orange)repeat,... + $gradient-positions: nth($first-member, 2); + $gradient-args: nth($first-member, 3); + $shorthand-start: 2; + } + @else { // Linear gradient only - lg(red,orange),... + $gradient-positions: nth($shorthand, 2); + $gradient-args: nth($shorthand, 3); // Get gradient (red, blue) + } + + $gradient-positions: _gradient-positions-parser($gradient-type, $gradient-positions); + $gradient: _render-gradients($gradient-positions, $gradient-args, $gradient-type, $vendor); + + // Append any additional shorthand args to gradient + @if $shorthand-start { + @for $j from $shorthand-start through length($shorthand) { + $gradient: join($gradient, nth($shorthand, $j), space); + } + } + $backgrounds-prefixed: append($backgrounds-prefixed, $gradient, comma); + } + // Image with additional properties + @else { + $backgrounds-prefixed: append($backgrounds-prefixed, $shorthand, comma); + } + } + // If shorthand is a simple string (color or image) + @else if $type == string { + $backgrounds-prefixed: join($backgrounds-prefixed, $shorthand, comma); + } + } + @return $backgrounds-prefixed; +} + +//Examples: + //@include background(linear-gradient(top, orange, red)); + //@include background(radial-gradient(circle at 40% 40%, orange, red)); + //@include background(url("/images/a.png") no-repeat, linear-gradient(orange, red)); + //@include background(url("image.png") center center, linear-gradient(orange, red), url("image.png")); diff --git a/scss/libs/bourbon/css3/_border-image.scss b/scss/libs/bourbon/css3/_border-image.scss new file mode 100755 index 0000000..1fff212 --- /dev/null +++ b/scss/libs/bourbon/css3/_border-image.scss @@ -0,0 +1,55 @@ +@mixin border-image($images) { + -webkit-border-image: _border-add-prefix($images, webkit); + -moz-border-image: _border-add-prefix($images, moz); + -o-border-image: _border-add-prefix($images, o); + border-image: _border-add-prefix($images); +} + +@function _border-add-prefix($images, $vendor: false) { + $border-image: null; + $images-type: type-of(nth($images, 1)); + $first-var: nth(nth($images, 1), 1); // Get type of Gradient (Linear || radial) + + // If input is a gradient + @if $images-type == string { + @if ($first-var == "linear") or ($first-var == "radial") { + $gradient-type: nth($images, 1); // Get type of gradient (linear || radial) + $gradient-pos: nth($images, 2); // Get gradient position + $gradient-args: nth($images, 3); // Get actual gradient (red, blue) + $gradient-positions: _gradient-positions-parser($gradient-type, $gradient-pos); + $border-image: _render-gradients($gradient-positions, $gradient-args, $gradient-type, $vendor); + } + // If input is a URL + @else { + $border-image: $images; + } + } + // If input is gradient or url + additional args + @else if $images-type == list { + $type: type-of(nth($images, 1)); // Get type of variable - List or String + + // If variable is a list - Gradient + @if $type == list { + $gradient: nth($images, 1); + $gradient-type: nth($gradient, 1); // Get type of gradient (linear || radial) + $gradient-pos: nth($gradient, 2); // Get gradient position + $gradient-args: nth($gradient, 3); // Get actual gradient (red, blue) + $gradient-positions: _gradient-positions-parser($gradient-type, $gradient-pos); + $border-image: _render-gradients($gradient-positions, $gradient-args, $gradient-type, $vendor); + + @for $i from 2 through length($images) { + $border-image: append($border-image, nth($images, $i)); + } + } + } + @return $border-image; +} + +//Examples: +// @include border-image(url("image.png")); +// @include border-image(url("image.png") 20 stretch); +// @include border-image(linear-gradient(45deg, orange, yellow)); +// @include border-image(linear-gradient(45deg, orange, yellow) stretch); +// @include border-image(linear-gradient(45deg, orange, yellow) 20 30 40 50 stretch round); +// @include border-image(radial-gradient(top, cover, orange, yellow, orange)); + diff --git a/scss/libs/bourbon/css3/_border-radius.scss b/scss/libs/bourbon/css3/_border-radius.scss new file mode 100755 index 0000000..7c17190 --- /dev/null +++ b/scss/libs/bourbon/css3/_border-radius.scss @@ -0,0 +1,22 @@ +//************************************************************************// +// Shorthand Border-radius mixins +//************************************************************************// +@mixin border-top-radius($radii) { + @include prefixer(border-top-left-radius, $radii, spec); + @include prefixer(border-top-right-radius, $radii, spec); +} + +@mixin border-bottom-radius($radii) { + @include prefixer(border-bottom-left-radius, $radii, spec); + @include prefixer(border-bottom-right-radius, $radii, spec); +} + +@mixin border-left-radius($radii) { + @include prefixer(border-top-left-radius, $radii, spec); + @include prefixer(border-bottom-left-radius, $radii, spec); +} + +@mixin border-right-radius($radii) { + @include prefixer(border-top-right-radius, $radii, spec); + @include prefixer(border-bottom-right-radius, $radii, spec); +} diff --git a/scss/libs/bourbon/css3/_box-sizing.scss b/scss/libs/bourbon/css3/_box-sizing.scss new file mode 100755 index 0000000..f07e1d4 --- /dev/null +++ b/scss/libs/bourbon/css3/_box-sizing.scss @@ -0,0 +1,4 @@ +@mixin box-sizing ($box) { +// content-box | border-box | inherit + @include prefixer(box-sizing, $box, webkit moz spec); +} diff --git a/scss/libs/bourbon/css3/_columns.scss b/scss/libs/bourbon/css3/_columns.scss new file mode 100755 index 0000000..42274a4 --- /dev/null +++ b/scss/libs/bourbon/css3/_columns.scss @@ -0,0 +1,47 @@ +@mixin columns($arg: auto) { +// || + @include prefixer(columns, $arg, webkit moz spec); +} + +@mixin column-count($int: auto) { +// auto || integer + @include prefixer(column-count, $int, webkit moz spec); +} + +@mixin column-gap($length: normal) { +// normal || length + @include prefixer(column-gap, $length, webkit moz spec); +} + +@mixin column-fill($arg: auto) { +// auto || length + @include prefixer(columns-fill, $arg, webkit moz spec); +} + +@mixin column-rule($arg) { +// || || + @include prefixer(column-rule, $arg, webkit moz spec); +} + +@mixin column-rule-color($color) { + @include prefixer(column-rule-color, $color, webkit moz spec); +} + +@mixin column-rule-style($style: none) { +// none | hidden | dashed | dotted | double | groove | inset | inset | outset | ridge | solid + @include prefixer(column-rule-style, $style, webkit moz spec); +} + +@mixin column-rule-width ($width: none) { + @include prefixer(column-rule-width, $width, webkit moz spec); +} + +@mixin column-span($arg: none) { +// none || all + @include prefixer(column-span, $arg, webkit moz spec); +} + +@mixin column-width($length: auto) { +// auto || length + @include prefixer(column-width, $length, webkit moz spec); +} diff --git a/scss/libs/bourbon/css3/_flex-box.scss b/scss/libs/bourbon/css3/_flex-box.scss new file mode 100755 index 0000000..3e741e6 --- /dev/null +++ b/scss/libs/bourbon/css3/_flex-box.scss @@ -0,0 +1,52 @@ +// CSS3 Flexible Box Model and property defaults + +// Custom shorthand notation for flexbox +@mixin box($orient: inline-axis, $pack: start, $align: stretch) { + @include display-box; + @include box-orient($orient); + @include box-pack($pack); + @include box-align($align); +} + +@mixin display-box { + display: -webkit-box; + display: -moz-box; + display: box; +} + +@mixin box-orient($orient: inline-axis) { +// horizontal|vertical|inline-axis|block-axis|inherit + @include prefixer(box-orient, $orient, webkit moz spec); +} + +@mixin box-pack($pack: start) { +// start|end|center|justify + @include prefixer(box-pack, $pack, webkit moz spec); +} + +@mixin box-align($align: stretch) { +// start|end|center|baseline|stretch + @include prefixer(box-align, $align, webkit moz spec); +} + +@mixin box-direction($direction: normal) { +// normal|reverse|inherit + @include prefixer(box-direction, $direction, webkit moz spec); +} + +@mixin box-lines($lines: single) { +// single|multiple + @include prefixer(box-lines, $lines, webkit moz spec); +} + +@mixin box-ordinal-group($int: 1) { + @include prefixer(box-ordinal-group, $int, webkit moz spec); +} + +@mixin box-flex($value: 0.0) { + @include prefixer(box-flex, $value, webkit moz spec); +} + +@mixin box-flex-group($int: 1) { + @include prefixer(box-flex-group, $int, webkit moz spec); +} diff --git a/scss/libs/bourbon/css3/_font-face.scss b/scss/libs/bourbon/css3/_font-face.scss new file mode 100755 index 0000000..029ee8f --- /dev/null +++ b/scss/libs/bourbon/css3/_font-face.scss @@ -0,0 +1,23 @@ +// Order of the includes matters, and it is: normal, bold, italic, bold+italic. + +@mixin font-face($font-family, $file-path, $weight: normal, $style: normal, $asset-pipeline: false ) { + @font-face { + font-family: $font-family; + font-weight: $weight; + font-style: $style; + + @if $asset-pipeline == true { + src: font-url('#{$file-path}.eot'); + src: font-url('#{$file-path}.eot?#iefix') format('embedded-opentype'), + font-url('#{$file-path}.woff') format('woff'), + font-url('#{$file-path}.ttf') format('truetype'), + font-url('#{$file-path}.svg##{$font-family}') format('svg'); + } @else { + src: url('#{$file-path}.eot'); + src: url('#{$file-path}.eot?#iefix') format('embedded-opentype'), + url('#{$file-path}.woff') format('woff'), + url('#{$file-path}.ttf') format('truetype'), + url('#{$file-path}.svg##{$font-family}') format('svg'); + } + } +} diff --git a/scss/libs/bourbon/css3/_hidpi-media-query.scss b/scss/libs/bourbon/css3/_hidpi-media-query.scss new file mode 100755 index 0000000..111e400 --- /dev/null +++ b/scss/libs/bourbon/css3/_hidpi-media-query.scss @@ -0,0 +1,10 @@ +// HiDPI mixin. Default value set to 1.3 to target Google Nexus 7 (http://bjango.com/articles/min-device-pixel-ratio/) +@mixin hidpi($ratio: 1.3) { + @media only screen and (-webkit-min-device-pixel-ratio: $ratio), + only screen and (min--moz-device-pixel-ratio: $ratio), + only screen and (-o-min-device-pixel-ratio: #{$ratio}/1), + only screen and (min-resolution: #{round($ratio*96)}dpi), + only screen and (min-resolution: #{$ratio}dppx) { + @content; + } +} diff --git a/scss/libs/bourbon/css3/_image-rendering.scss b/scss/libs/bourbon/css3/_image-rendering.scss new file mode 100755 index 0000000..abc7ee1 --- /dev/null +++ b/scss/libs/bourbon/css3/_image-rendering.scss @@ -0,0 +1,13 @@ +@mixin image-rendering ($mode:optimizeQuality) { + + @if ($mode == optimize-contrast) { + image-rendering: -moz-crisp-edges; + image-rendering: -o-crisp-edges; + image-rendering: -webkit-optimize-contrast; + image-rendering: optimize-contrast; + } + + @else { + image-rendering: $mode; + } +} diff --git a/scss/libs/bourbon/css3/_inline-block.scss b/scss/libs/bourbon/css3/_inline-block.scss new file mode 100755 index 0000000..3272a00 --- /dev/null +++ b/scss/libs/bourbon/css3/_inline-block.scss @@ -0,0 +1,8 @@ +// Legacy support for inline-block in IE7 (maybe IE6) +@mixin inline-block { + display: inline-block; + vertical-align: baseline; + zoom: 1; + *display: inline; + *vertical-align: auto; +} diff --git a/scss/libs/bourbon/css3/_keyframes.scss b/scss/libs/bourbon/css3/_keyframes.scss new file mode 100755 index 0000000..dca61f2 --- /dev/null +++ b/scss/libs/bourbon/css3/_keyframes.scss @@ -0,0 +1,43 @@ +// Adds keyframes blocks for supported prefixes, removing redundant prefixes in the block's content +@mixin keyframes($name) { + $original-prefix-for-webkit: $prefix-for-webkit; + $original-prefix-for-mozilla: $prefix-for-mozilla; + $original-prefix-for-microsoft: $prefix-for-microsoft; + $original-prefix-for-opera: $prefix-for-opera; + $original-prefix-for-spec: $prefix-for-spec; + + @if $original-prefix-for-webkit { + @include disable-prefix-for-all(); + $prefix-for-webkit: true; + @-webkit-keyframes #{$name} { + @content; + } + } + @if $original-prefix-for-mozilla { + @include disable-prefix-for-all(); + $prefix-for-mozilla: true; + @-moz-keyframes #{$name} { + @content; + } + } + @if $original-prefix-for-opera { + @include disable-prefix-for-all(); + $prefix-for-opera: true; + @-o-keyframes #{$name} { + @content; + } + } + @if $original-prefix-for-spec { + @include disable-prefix-for-all(); + $prefix-for-spec: true; + @keyframes #{$name} { + @content; + } + } + + $prefix-for-webkit: $original-prefix-for-webkit; + $prefix-for-mozilla: $original-prefix-for-mozilla; + $prefix-for-microsoft: $original-prefix-for-microsoft; + $prefix-for-opera: $original-prefix-for-opera; + $prefix-for-spec: $original-prefix-for-spec; +} diff --git a/scss/libs/bourbon/css3/_linear-gradient.scss b/scss/libs/bourbon/css3/_linear-gradient.scss new file mode 100755 index 0000000..d5b687b --- /dev/null +++ b/scss/libs/bourbon/css3/_linear-gradient.scss @@ -0,0 +1,41 @@ +@mixin linear-gradient($pos, $G1, $G2: false, + $G3: false, $G4: false, + $G5: false, $G6: false, + $G7: false, $G8: false, + $G9: false, $G10: false, + $deprecated-pos1: left top, + $deprecated-pos2: left bottom, + $fallback: false) { + // Detect what type of value exists in $pos + $pos-type: type-of(nth($pos, 1)); + $pos-spec: null; + $pos-degree: null; + + // If $pos is missing from mixin, reassign vars and add default position + @if ($pos-type == color) or (nth($pos, 1) == "transparent") { + $G10: $G9; $G9: $G8; $G8: $G7; $G7: $G6; $G6: $G5; + $G5: $G4; $G4: $G3; $G3: $G2; $G2: $G1; $G1: $pos; + $pos: null; + } + + @if $pos { + $positions: _linear-positions-parser($pos); + $pos-degree: nth($positions, 1); + $pos-spec: nth($positions, 2); + } + + $full: compact($G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10); + + // Set $G1 as the default fallback color + $fallback-color: nth($G1, 1); + + // If $fallback is a color use that color as the fallback color + @if (type-of($fallback) == color) or ($fallback == "transparent") { + $fallback-color: $fallback; + } + + background-color: $fallback-color; + background-image: _deprecated-webkit-gradient(linear, $deprecated-pos1, $deprecated-pos2, $full); // Safari <= 5.0 + background-image: -webkit-linear-gradient($pos-degree $full); // Safari 5.1+, Chrome + background-image: unquote("linear-gradient(#{$pos-spec}#{$full})"); +} diff --git a/scss/libs/bourbon/css3/_perspective.scss b/scss/libs/bourbon/css3/_perspective.scss new file mode 100755 index 0000000..0e4deb8 --- /dev/null +++ b/scss/libs/bourbon/css3/_perspective.scss @@ -0,0 +1,8 @@ +@mixin perspective($depth: none) { + // none | + @include prefixer(perspective, $depth, webkit moz spec); +} + +@mixin perspective-origin($value: 50% 50%) { + @include prefixer(perspective-origin, $value, webkit moz spec); +} diff --git a/scss/libs/bourbon/css3/_placeholder.scss b/scss/libs/bourbon/css3/_placeholder.scss new file mode 100755 index 0000000..22fd92b --- /dev/null +++ b/scss/libs/bourbon/css3/_placeholder.scss @@ -0,0 +1,29 @@ +$placeholders: '-webkit-input-placeholder', + '-moz-placeholder', + '-ms-input-placeholder'; + +@mixin placeholder { + @each $placeholder in $placeholders { + @if $placeholder == "-webkit-input-placeholder" { + &::#{$placeholder} { + @content; + } + } + @else if $placeholder == "-moz-placeholder" { + // FF 18- + &:#{$placeholder} { + @content; + } + + // FF 19+ + &::#{$placeholder} { + @content; + } + } + @else { + &:#{$placeholder} { + @content; + } + } + } +} diff --git a/scss/libs/bourbon/css3/_radial-gradient.scss b/scss/libs/bourbon/css3/_radial-gradient.scss new file mode 100755 index 0000000..e87b45a --- /dev/null +++ b/scss/libs/bourbon/css3/_radial-gradient.scss @@ -0,0 +1,44 @@ +// Requires Sass 3.1+ +@mixin radial-gradient($G1, $G2, + $G3: false, $G4: false, + $G5: false, $G6: false, + $G7: false, $G8: false, + $G9: false, $G10: false, + $pos: null, + $shape-size: null, + $deprecated-pos1: center center, + $deprecated-pos2: center center, + $deprecated-radius1: 0, + $deprecated-radius2: 460, + $fallback: false) { + + $data: _radial-arg-parser($G1, $G2, $pos, $shape-size); + $G1: nth($data, 1); + $G2: nth($data, 2); + $pos: nth($data, 3); + $shape-size: nth($data, 4); + + $full: compact($G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10); + + // Strip deprecated cover/contain for spec + $shape-size-spec: _shape-size-stripper($shape-size); + + // Set $G1 as the default fallback color + $first-color: nth($full, 1); + $fallback-color: nth($first-color, 1); + + @if (type-of($fallback) == color) or ($fallback == "transparent") { + $fallback-color: $fallback; + } + + // Add Commas and spaces + $shape-size: if($shape-size, '#{$shape-size}, ', null); + $pos: if($pos, '#{$pos}, ', null); + $pos-spec: if($pos, 'at #{$pos}', null); + $shape-size-spec: if(($shape-size-spec != ' ') and ($pos == null), '#{$shape-size-spec}, ', '#{$shape-size-spec} '); + + background-color: $fallback-color; + background-image: _deprecated-webkit-gradient(radial, $deprecated-pos1, $deprecated-pos2, $full, $deprecated-radius1, $deprecated-radius2); // Safari <= 5.0 && IOS 4 + background-image: -webkit-radial-gradient(unquote(#{$pos}#{$shape-size}#{$full})); + background-image: unquote("radial-gradient(#{$shape-size-spec}#{$pos-spec}#{$full})"); +} diff --git a/scss/libs/bourbon/css3/_transform.scss b/scss/libs/bourbon/css3/_transform.scss new file mode 100755 index 0000000..8cc3596 --- /dev/null +++ b/scss/libs/bourbon/css3/_transform.scss @@ -0,0 +1,15 @@ +@mixin transform($property: none) { +// none | + @include prefixer(transform, $property, webkit moz ms o spec); +} + +@mixin transform-origin($axes: 50%) { +// x-axis - left | center | right | length | % +// y-axis - top | center | bottom | length | % +// z-axis - length + @include prefixer(transform-origin, $axes, webkit moz ms o spec); +} + +@mixin transform-style ($style: flat) { + @include prefixer(transform-style, $style, webkit moz ms o spec); +} diff --git a/scss/libs/bourbon/css3/_transition.scss b/scss/libs/bourbon/css3/_transition.scss new file mode 100755 index 0000000..180cde6 --- /dev/null +++ b/scss/libs/bourbon/css3/_transition.scss @@ -0,0 +1,34 @@ +// Shorthand mixin. Supports multiple parentheses-deliminated values for each variable. +// Example: @include transition (all, 2.0s, ease-in-out); +// @include transition ((opacity, width), (1.0s, 2.0s), ease-in, (0, 2s)); +// @include transition ($property:(opacity, width), $delay: (1.5s, 2.5s)); + +@mixin transition ($properties...) { + @if length($properties) >= 1 { + @include prefixer(transition, $properties, webkit moz spec); + } + + @else { + $properties: all 0.15s ease-out 0; + @include prefixer(transition, $properties, webkit moz spec); + } +} + +@mixin transition-property ($properties...) { + -webkit-transition-property: transition-property-names($properties, 'webkit'); + -moz-transition-property: transition-property-names($properties, 'moz'); + transition-property: transition-property-names($properties, false); +} + +@mixin transition-duration ($times...) { + @include prefixer(transition-duration, $times, webkit moz spec); +} + +@mixin transition-timing-function ($motions...) { +// ease | linear | ease-in | ease-out | ease-in-out | cubic-bezier() + @include prefixer(transition-timing-function, $motions, webkit moz spec); +} + +@mixin transition-delay ($times...) { + @include prefixer(transition-delay, $times, webkit moz spec); +} diff --git a/scss/libs/bourbon/css3/_user-select.scss b/scss/libs/bourbon/css3/_user-select.scss new file mode 100755 index 0000000..1380aa8 --- /dev/null +++ b/scss/libs/bourbon/css3/_user-select.scss @@ -0,0 +1,3 @@ +@mixin user-select($arg: none) { + @include prefixer(user-select, $arg, webkit moz ms spec); +} diff --git a/scss/libs/bourbon/functions/_compact.scss b/scss/libs/bourbon/functions/_compact.scss new file mode 100755 index 0000000..871500e --- /dev/null +++ b/scss/libs/bourbon/functions/_compact.scss @@ -0,0 +1,11 @@ +// Remove `false` values from a list + +@function compact($vars...) { + $list: (); + @each $var in $vars { + @if $var { + $list: append($list, $var, comma); + } + } + @return $list; +} diff --git a/scss/libs/bourbon/functions/_flex-grid.scss b/scss/libs/bourbon/functions/_flex-grid.scss new file mode 100755 index 0000000..3bbd866 --- /dev/null +++ b/scss/libs/bourbon/functions/_flex-grid.scss @@ -0,0 +1,39 @@ +// Flexible grid +@function flex-grid($columns, $container-columns: $fg-max-columns) { + $width: $columns * $fg-column + ($columns - 1) * $fg-gutter; + $container-width: $container-columns * $fg-column + ($container-columns - 1) * $fg-gutter; + @return percentage($width / $container-width); +} + +// Flexible gutter +@function flex-gutter($container-columns: $fg-max-columns, $gutter: $fg-gutter) { + $container-width: $container-columns * $fg-column + ($container-columns - 1) * $fg-gutter; + @return percentage($gutter / $container-width); +} + +// The $fg-column, $fg-gutter and $fg-max-columns variables must be defined in your base stylesheet to properly use the flex-grid function. +// This function takes the fluid grid equation (target / context = result) and uses columns to help define each. +// +// The calculation presumes that your column structure will be missing the last gutter: +// +// -- column -- gutter -- column -- gutter -- column +// +// $fg-column: 60px; // Column Width +// $fg-gutter: 25px; // Gutter Width +// $fg-max-columns: 12; // Total Columns For Main Container +// +// div { +// width: flex-grid(4); // returns (315px / 995px) = 31.65829%; +// margin-left: flex-gutter(); // returns (25px / 995px) = 2.51256%; +// +// p { +// width: flex-grid(2, 4); // returns (145px / 315px) = 46.031746%; +// float: left; +// margin: flex-gutter(4); // returns (25px / 315px) = 7.936508%; +// } +// +// blockquote { +// float: left; +// width: flex-grid(2, 4); // returns (145px / 315px) = 46.031746%; +// } +// } \ No newline at end of file diff --git a/scss/libs/bourbon/functions/_grid-width.scss b/scss/libs/bourbon/functions/_grid-width.scss new file mode 100755 index 0000000..8e63d83 --- /dev/null +++ b/scss/libs/bourbon/functions/_grid-width.scss @@ -0,0 +1,13 @@ +@function grid-width($n) { + @return $n * $gw-column + ($n - 1) * $gw-gutter; +} + +// The $gw-column and $gw-gutter variables must be defined in your base stylesheet to properly use the grid-width function. +// +// $gw-column: 100px; // Column Width +// $gw-gutter: 40px; // Gutter Width +// +// div { +// width: grid-width(4); // returns 520px; +// margin-left: $gw-gutter; // returns 40px; +// } diff --git a/scss/libs/bourbon/functions/_linear-gradient.scss b/scss/libs/bourbon/functions/_linear-gradient.scss new file mode 100755 index 0000000..c8454d8 --- /dev/null +++ b/scss/libs/bourbon/functions/_linear-gradient.scss @@ -0,0 +1,13 @@ +@function linear-gradient($pos, $gradients...) { + $type: linear; + $pos-type: type-of(nth($pos, 1)); + + // if $pos doesn't exist, fix $gradient + @if ($pos-type == color) or (nth($pos, 1) == "transparent") { + $gradients: zip($pos $gradients); + $pos: false; + } + + $type-gradient: $type, $pos, $gradients; + @return $type-gradient; +} diff --git a/scss/libs/bourbon/functions/_modular-scale.scss b/scss/libs/bourbon/functions/_modular-scale.scss new file mode 100755 index 0000000..dddccb5 --- /dev/null +++ b/scss/libs/bourbon/functions/_modular-scale.scss @@ -0,0 +1,40 @@ +@function modular-scale($value, $increment, $ratio) { + @if $increment > 0 { + @for $i from 1 through $increment { + $value: ($value * $ratio); + } + } + + @if $increment < 0 { + $increment: abs($increment); + @for $i from 1 through $increment { + $value: ($value / $ratio); + } + } + + @return $value; +} + +// div { +// Increment Up GR with positive value +// font-size: modular-scale(14px, 1, 1.618); // returns: 22.652px +// +// Increment Down GR with negative value +// font-size: modular-scale(14px, -1, 1.618); // returns: 8.653px +// +// Can be used with ceil(round up) or floor(round down) +// font-size: floor( modular-scale(14px, 1, 1.618) ); // returns: 22px +// font-size: ceil( modular-scale(14px, 1, 1.618) ); // returns: 23px +// } +// +// modularscale.com + +@function golden-ratio($value, $increment) { + @return modular-scale($value, $increment, 1.618) +} + +// div { +// font-size: golden-ratio(14px, 1); // returns: 22.652px +// } +// +// goldenratiocalculator.com diff --git a/scss/libs/bourbon/functions/_px-to-em.scss b/scss/libs/bourbon/functions/_px-to-em.scss new file mode 100755 index 0000000..2eb1031 --- /dev/null +++ b/scss/libs/bourbon/functions/_px-to-em.scss @@ -0,0 +1,8 @@ +// Convert pixels to ems +// eg. for a relational value of 12px write em(12) when the parent is 16px +// if the parent is another value say 24px write em(12, 24) + +@function em($pxval, $base: 16) { + @return ($pxval / $base) * 1em; +} + diff --git a/scss/libs/bourbon/functions/_radial-gradient.scss b/scss/libs/bourbon/functions/_radial-gradient.scss new file mode 100755 index 0000000..7558406 --- /dev/null +++ b/scss/libs/bourbon/functions/_radial-gradient.scss @@ -0,0 +1,23 @@ +// This function is required and used by the background-image mixin. +@function radial-gradient($G1, $G2, + $G3: false, $G4: false, + $G5: false, $G6: false, + $G7: false, $G8: false, + $G9: false, $G10: false, + $pos: null, + $shape-size: null) { + + $data: _radial-arg-parser($G1, $G2, $pos, $shape-size); + $G1: nth($data, 1); + $G2: nth($data, 2); + $pos: nth($data, 3); + $shape-size: nth($data, 4); + + $type: radial; + $gradient: compact($G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10); + + $type-gradient: $type, $shape-size $pos, $gradient; + @return $type-gradient; +} + + diff --git a/scss/libs/bourbon/functions/_tint-shade.scss b/scss/libs/bourbon/functions/_tint-shade.scss new file mode 100755 index 0000000..f717200 --- /dev/null +++ b/scss/libs/bourbon/functions/_tint-shade.scss @@ -0,0 +1,9 @@ +// Add percentage of white to a color +@function tint($color, $percent){ + @return mix(white, $color, $percent); +} + +// Add percentage of black to a color +@function shade($color, $percent){ + @return mix(black, $color, $percent); +} diff --git a/scss/libs/bourbon/functions/_transition-property-name.scss b/scss/libs/bourbon/functions/_transition-property-name.scss new file mode 100755 index 0000000..8838c51 --- /dev/null +++ b/scss/libs/bourbon/functions/_transition-property-name.scss @@ -0,0 +1,22 @@ +// Return vendor-prefixed property names if appropriate +// Example: transition-property-names((transform, color, background), moz) -> -moz-transform, color, background +//************************************************************************// +@function transition-property-names($props, $vendor: false) { + $new-props: (); + + @each $prop in $props { + $new-props: append($new-props, transition-property-name($prop, $vendor), comma); + } + + @return $new-props; +} + +@function transition-property-name($prop, $vendor: false) { + // put other properties that need to be prefixed here aswell + @if $vendor and $prop == transform { + @return unquote('-'+$vendor+'-'+$prop); + } + @else { + @return $prop; + } +} \ No newline at end of file diff --git a/scss/libs/bourbon/helpers/_deprecated-webkit-gradient.scss b/scss/libs/bourbon/helpers/_deprecated-webkit-gradient.scss new file mode 100755 index 0000000..cd17e28 --- /dev/null +++ b/scss/libs/bourbon/helpers/_deprecated-webkit-gradient.scss @@ -0,0 +1,39 @@ +// Render Deprecated Webkit Gradient - Linear || Radial +//************************************************************************// +@function _deprecated-webkit-gradient($type, + $deprecated-pos1, $deprecated-pos2, + $full, + $deprecated-radius1: false, $deprecated-radius2: false) { + $gradient-list: (); + $gradient: false; + $full-length: length($full); + $percentage: false; + $gradient-type: $type; + + @for $i from 1 through $full-length { + $gradient: nth($full, $i); + + @if length($gradient) == 2 { + $color-stop: color-stop(nth($gradient, 2), nth($gradient, 1)); + $gradient-list: join($gradient-list, $color-stop, comma); + } + @else if $gradient != null { + @if $i == $full-length { + $percentage: 100%; + } + @else { + $percentage: ($i - 1) * (100 / ($full-length - 1)) + "%"; + } + $color-stop: color-stop(unquote($percentage), $gradient); + $gradient-list: join($gradient-list, $color-stop, comma); + } + } + + @if $type == radial { + $gradient: -webkit-gradient(radial, $deprecated-pos1, $deprecated-radius1, $deprecated-pos2, $deprecated-radius2, $gradient-list); + } + @else if $type == linear { + $gradient: -webkit-gradient(linear, $deprecated-pos1, $deprecated-pos2, $gradient-list); + } + @return $gradient; +} diff --git a/scss/libs/bourbon/helpers/_gradient-positions-parser.scss b/scss/libs/bourbon/helpers/_gradient-positions-parser.scss new file mode 100755 index 0000000..07d30b6 --- /dev/null +++ b/scss/libs/bourbon/helpers/_gradient-positions-parser.scss @@ -0,0 +1,13 @@ +@function _gradient-positions-parser($gradient-type, $gradient-positions) { + @if $gradient-positions + and ($gradient-type == linear) + and (type-of($gradient-positions) != color) { + $gradient-positions: _linear-positions-parser($gradient-positions); + } + @else if $gradient-positions + and ($gradient-type == radial) + and (type-of($gradient-positions) != color) { + $gradient-positions: _radial-positions-parser($gradient-positions); + } + @return $gradient-positions; +} diff --git a/scss/libs/bourbon/helpers/_linear-positions-parser.scss b/scss/libs/bourbon/helpers/_linear-positions-parser.scss new file mode 100755 index 0000000..d26383e --- /dev/null +++ b/scss/libs/bourbon/helpers/_linear-positions-parser.scss @@ -0,0 +1,61 @@ +@function _linear-positions-parser($pos) { + $type: type-of(nth($pos, 1)); + $spec: null; + $degree: null; + $side: null; + $corner: null; + $length: length($pos); + // Parse Side and corner positions + @if ($length > 1) { + @if nth($pos, 1) == "to" { // Newer syntax + $side: nth($pos, 2); + + @if $length == 2 { // eg. to top + // Swap for backwards compatability + $degree: _position-flipper(nth($pos, 2)); + } + @else if $length == 3 { // eg. to top left + $corner: nth($pos, 3); + } + } + @else if $length == 2 { // Older syntax ("top left") + $side: _position-flipper(nth($pos, 1)); + $corner: _position-flipper(nth($pos, 2)); + } + + @if ("#{$side} #{$corner}" == "left top") or ("#{$side} #{$corner}" == "top left") { + $degree: _position-flipper(#{$side}) _position-flipper(#{$corner}); + } + @else if ("#{$side} #{$corner}" == "right top") or ("#{$side} #{$corner}" == "top right") { + $degree: _position-flipper(#{$side}) _position-flipper(#{$corner}); + } + @else if ("#{$side} #{$corner}" == "right bottom") or ("#{$side} #{$corner}" == "bottom right") { + $degree: _position-flipper(#{$side}) _position-flipper(#{$corner}); + } + @else if ("#{$side} #{$corner}" == "left bottom") or ("#{$side} #{$corner}" == "bottom left") { + $degree: _position-flipper(#{$side}) _position-flipper(#{$corner}); + } + $spec: to $side $corner; + } + @else if $length == 1 { + // Swap for backwards compatability + @if $type == string { + $degree: $pos; + $spec: to _position-flipper($pos); + } + @else { + $degree: -270 - $pos; //rotate the gradient opposite from spec + $spec: $pos; + } + } + $degree: unquote($degree + ","); + $spec: unquote($spec + ","); + @return $degree $spec; +} + +@function _position-flipper($pos) { + @return if($pos == left, right, null) + if($pos == right, left, null) + if($pos == top, bottom, null) + if($pos == bottom, top, null); +} diff --git a/scss/libs/bourbon/helpers/_radial-arg-parser.scss b/scss/libs/bourbon/helpers/_radial-arg-parser.scss new file mode 100755 index 0000000..3466695 --- /dev/null +++ b/scss/libs/bourbon/helpers/_radial-arg-parser.scss @@ -0,0 +1,69 @@ +@function _radial-arg-parser($G1, $G2, $pos, $shape-size) { + @each $value in $G1, $G2 { + $first-val: nth($value, 1); + $pos-type: type-of($first-val); + $spec-at-index: null; + + // Determine if spec was passed to mixin + @if type-of($value) == list { + $spec-at-index: if(index($value, at), index($value, at), false); + } + @if $spec-at-index { + @if $spec-at-index > 1 { + @for $i from 1 through ($spec-at-index - 1) { + $shape-size: $shape-size nth($value, $i); + } + @for $i from ($spec-at-index + 1) through length($value) { + $pos: $pos nth($value, $i); + } + } + @else if $spec-at-index == 1 { + @for $i from ($spec-at-index + 1) through length($value) { + $pos: $pos nth($value, $i); + } + } + $G1: false; + } + + // If not spec calculate correct values + @else { + @if ($pos-type != color) or ($first-val != "transparent") { + @if ($pos-type == number) + or ($first-val == "center") + or ($first-val == "top") + or ($first-val == "right") + or ($first-val == "bottom") + or ($first-val == "left") { + + $pos: $value; + + @if $pos == $G1 { + $G1: false; + } + } + + @else if + ($first-val == "ellipse") + or ($first-val == "circle") + or ($first-val == "closest-side") + or ($first-val == "closest-corner") + or ($first-val == "farthest-side") + or ($first-val == "farthest-corner") + or ($first-val == "contain") + or ($first-val == "cover") { + + $shape-size: $value; + + @if $value == $G1 { + $G1: false; + } + + @else if $value == $G2 { + $G2: false; + } + } + } + } + } + @return $G1, $G2, $pos, $shape-size; +} diff --git a/scss/libs/bourbon/helpers/_radial-positions-parser.scss b/scss/libs/bourbon/helpers/_radial-positions-parser.scss new file mode 100755 index 0000000..6a5b477 --- /dev/null +++ b/scss/libs/bourbon/helpers/_radial-positions-parser.scss @@ -0,0 +1,18 @@ +@function _radial-positions-parser($gradient-pos) { + $shape-size: nth($gradient-pos, 1); + $pos: nth($gradient-pos, 2); + $shape-size-spec: _shape-size-stripper($shape-size); + + $pre-spec: unquote(if($pos, "#{$pos}, ", null)) + unquote(if($shape-size, "#{$shape-size},", null)); + $pos-spec: if($pos, "at #{$pos}", null); + + $spec: "#{$shape-size-spec} #{$pos-spec}"; + + // Add comma + @if ($spec != ' ') { + $spec: "#{$spec}," + } + + @return $pre-spec $spec; +} diff --git a/scss/libs/bourbon/helpers/_render-gradients.scss b/scss/libs/bourbon/helpers/_render-gradients.scss new file mode 100755 index 0000000..5765676 --- /dev/null +++ b/scss/libs/bourbon/helpers/_render-gradients.scss @@ -0,0 +1,26 @@ +// User for linear and radial gradients within background-image or border-image properties + +@function _render-gradients($gradient-positions, $gradients, $gradient-type, $vendor: false) { + $pre-spec: null; + $spec: null; + $vendor-gradients: null; + @if $gradient-type == linear { + @if $gradient-positions { + $pre-spec: nth($gradient-positions, 1); + $spec: nth($gradient-positions, 2); + } + } + @else if $gradient-type == radial { + $pre-spec: nth($gradient-positions, 1); + $spec: nth($gradient-positions, 2); + } + + @if $vendor { + $vendor-gradients: -#{$vendor}-#{$gradient-type}-gradient(#{$pre-spec} $gradients); + } + @else if $vendor == false { + $vendor-gradients: "#{$gradient-type}-gradient(#{$spec} #{$gradients})"; + $vendor-gradients: unquote($vendor-gradients); + } + @return $vendor-gradients; +} diff --git a/scss/libs/bourbon/helpers/_shape-size-stripper.scss b/scss/libs/bourbon/helpers/_shape-size-stripper.scss new file mode 100755 index 0000000..ee5eda4 --- /dev/null +++ b/scss/libs/bourbon/helpers/_shape-size-stripper.scss @@ -0,0 +1,10 @@ +@function _shape-size-stripper($shape-size) { + $shape-size-spec: null; + @each $value in $shape-size { + @if ($value == "cover") or ($value == "contain") { + $value: null; + } + $shape-size-spec: "#{$shape-size-spec} #{$value}"; + } + @return $shape-size-spec; +} diff --git a/scss/libs/compass/_css3.scss b/scss/libs/compass/_css3.scss new file mode 100755 index 0000000..a4aaf73 --- /dev/null +++ b/scss/libs/compass/_css3.scss @@ -0,0 +1,20 @@ +@import "css3/border-radius"; +@import "css3/inline-block"; +@import "css3/opacity"; +@import "css3/box-shadow"; +@import "css3/text-shadow"; +@import "css3/columns"; +@import "css3/box-sizing"; +@import "css3/box"; +@import "css3/images"; +@import "css3/background-clip"; +@import "css3/background-origin"; +@import "css3/background-size"; +@import "css3/font-face"; +@import "css3/transform"; +@import "css3/transition"; +@import "css3/appearance"; +@import "css3/regions"; +@import "css3/hyphenation"; +@import "css3/filter"; +@import "css3/user-interface"; diff --git a/scss/libs/compass/_layout.scss b/scss/libs/compass/_layout.scss new file mode 100755 index 0000000..55bf9ee --- /dev/null +++ b/scss/libs/compass/_layout.scss @@ -0,0 +1,3 @@ +@import "layout/grid-background"; +@import "layout/sticky-footer"; +@import "layout/stretching"; diff --git a/scss/libs/compass/_plugins.scss b/scss/libs/compass/_plugins.scss new file mode 100755 index 0000000..108e925 --- /dev/null +++ b/scss/libs/compass/_plugins.scss @@ -0,0 +1 @@ +@import "plugins/susy"; \ No newline at end of file diff --git a/scss/libs/compass/_reset-legacy.scss b/scss/libs/compass/_reset-legacy.scss new file mode 100755 index 0000000..f11f07a --- /dev/null +++ b/scss/libs/compass/_reset-legacy.scss @@ -0,0 +1,3 @@ +@import "reset/utilities-legacy"; + +@include global-reset; diff --git a/scss/libs/compass/_reset.scss b/scss/libs/compass/_reset.scss new file mode 100755 index 0000000..e181dd7 --- /dev/null +++ b/scss/libs/compass/_reset.scss @@ -0,0 +1,3 @@ +@import "reset/utilities"; + +@include global-reset; diff --git a/scss/libs/compass/_support.scss b/scss/libs/compass/_support.scss new file mode 100755 index 0000000..37b6e17 --- /dev/null +++ b/scss/libs/compass/_support.scss @@ -0,0 +1,40 @@ +// Usually compass hacks apply to both ie6 & 7 -- set this to false to disable support for both. +$legacy-support-for-ie: true !default; + +// Setting this to false will result in smaller output, but no support for ie6 hacks +$legacy-support-for-ie6: $legacy-support-for-ie !default; + +// Setting this to false will result in smaller output, but no support for ie7 hacks +$legacy-support-for-ie7: $legacy-support-for-ie !default; + +// Setting this to false will result in smaller output, but no support for legacy ie8 hacks +$legacy-support-for-ie8: $legacy-support-for-ie !default; + +// @private +// The user can simply set $legacy-support-for-ie and 6, 7, and 8 will be set accordingly, +// But in case the user set each of those explicitly, we need to sync the value of +// this combined variable. +$legacy-support-for-ie: $legacy-support-for-ie6 or $legacy-support-for-ie7 or $legacy-support-for-ie8; + +// Whether to output legacy support for mozilla. +// Usually this means hacks to support Firefox 3.6 or earlier. +$legacy-support-for-mozilla: true; + +// Support for mozilla in experimental css3 properties (-moz). +$experimental-support-for-mozilla : true !default; +// Support for webkit in experimental css3 properties (-webkit). +$experimental-support-for-webkit : true !default; +// Support for webkit's original (non-standard) gradient syntax. +$support-for-original-webkit-gradients : true !default; +// Support for opera in experimental css3 properties (-o). +$experimental-support-for-opera : true !default; +// Support for microsoft in experimental css3 properties (-ms). +$experimental-support-for-microsoft : true !default; +// Support for khtml in experimental css3 properties (-khtml). +$experimental-support-for-khtml : false !default; +// Support for svg in experimental css3 properties. +// Setting this to true might add significant size to your +// generated stylesheets. +$experimental-support-for-svg : false !default; +// Support for CSS PIE in experimental css3 properties (-pie). +$experimental-support-for-pie : false !default; diff --git a/scss/libs/compass/_typography.scss b/scss/libs/compass/_typography.scss new file mode 100755 index 0000000..4d9cb5d --- /dev/null +++ b/scss/libs/compass/_typography.scss @@ -0,0 +1,4 @@ +@import "typography/links"; +@import "typography/lists"; +@import "typography/text"; +@import "typography/vertical_rhythm"; diff --git a/scss/libs/compass/_utilities.scss b/scss/libs/compass/_utilities.scss new file mode 100755 index 0000000..e5e3182 --- /dev/null +++ b/scss/libs/compass/_utilities.scss @@ -0,0 +1,9 @@ +@import "utilities/color"; +@import "utilities/general"; +@import "utilities/sprites"; +@import "utilities/tables"; + +// deprecated +// @import "typography/links"; +// @import "typography/lists"; +// @import "typography/text"; diff --git a/scss/libs/compass/css3/_appearance.scss b/scss/libs/compass/css3/_appearance.scss new file mode 100755 index 0000000..c6e6533 --- /dev/null +++ b/scss/libs/compass/css3/_appearance.scss @@ -0,0 +1,17 @@ +@import "shared"; + +// Change the appearance for Mozilla, Webkit and possibly the future. +// The appearance property is currently not present in any newer CSS specification. +// +// There is no official list of accepted values, but you might check these source: +// +// * [Mozilla](https://developer.mozilla.org/en/CSS/-moz-appearance) +// * [Webkit](http://code.google.com/p/webkit-mirror/source/browse/Source/WebCore/css/CSSValueKeywords.in?spec=svnf1aea559dcd025a8946aa7da6e4e8306f5c1b604&r=63c7d1af44430b314233fea342c3ddb2a052e365) +// (search for 'appearance' within the page) + +@mixin appearance($ap) { + $ap: unquote($ap); + @include experimental(appearance, $ap, + -moz, -webkit, not -o, not -ms, not -khtml, official + ); +} diff --git a/scss/libs/compass/css3/_background-clip.scss b/scss/libs/compass/css3/_background-clip.scss new file mode 100755 index 0000000..6ce473f --- /dev/null +++ b/scss/libs/compass/css3/_background-clip.scss @@ -0,0 +1,43 @@ +@import "shared"; + +// The default value is `padding-box` -- the box model used by modern browsers. +// +// If you wish to do so, you can override the default constant with `border-box` +// +// To override to the default border-box model, use this code: +// $default-background-clip: border-box + +$default-background-clip: padding-box !default; + +// Clip the background (image and color) at the edge of the padding or border. +// +// Legal Values: +// +// * padding-box +// * border-box +// * text + +@mixin background-clip($clip: $default-background-clip) { + // webkit and mozilla use the deprecated short [border | padding] + $clip: unquote($clip); + $deprecated: $clip; + @if $clip == padding-box { $deprecated: padding; } + @if $clip == border-box { $deprecated: border; } + // Support for webkit and mozilla's use of the deprecated short form + @include experimental(background-clip, $deprecated, + -moz, + -webkit, + not -o, + not -ms, + not -khtml, + not official + ); + @include experimental(background-clip, $clip, + not -moz, + not -webkit, + not -o, + not -ms, + -khtml, + official + ); +} diff --git a/scss/libs/compass/css3/_background-origin.scss b/scss/libs/compass/css3/_background-origin.scss new file mode 100755 index 0000000..bc8eaa8 --- /dev/null +++ b/scss/libs/compass/css3/_background-origin.scss @@ -0,0 +1,42 @@ +// Override `$default-background-origin` to change the default. + +@import "shared"; + +$default-background-origin: content-box !default; + +// Position the background off the edge of the padding, border or content +// +// * Possible values: +// * `padding-box` +// * `border-box` +// * `content-box` +// * browser defaults to `padding-box` +// * mixin defaults to `content-box` + + +@mixin background-origin($origin: $default-background-origin) { + $origin: unquote($origin); + // webkit and mozilla use the deprecated short [border | padding | content] + $deprecated: $origin; + @if $origin == padding-box { $deprecated: padding; } + @if $origin == border-box { $deprecated: border; } + @if $origin == content-box { $deprecated: content; } + + // Support for webkit and mozilla's use of the deprecated short form + @include experimental(background-origin, $deprecated, + -moz, + -webkit, + not -o, + not -ms, + not -khtml, + not official + ); + @include experimental(background-origin, $origin, + not -moz, + not -webkit, + -o, + -ms, + -khtml, + official + ); +} diff --git a/scss/libs/compass/css3/_background-size.scss b/scss/libs/compass/css3/_background-size.scss new file mode 100755 index 0000000..9d36447 --- /dev/null +++ b/scss/libs/compass/css3/_background-size.scss @@ -0,0 +1,26 @@ +@import "shared"; + +// override to change the default +$default-background-size: 100% auto !default; + +// Set the size of background images using px, width and height, or percentages. +// Currently supported in: Opera, Gecko, Webkit. +// +// * percentages are relative to the background-origin (default = padding-box) +// * mixin defaults to: `$default-background-size` +@mixin background-size( + $size-1: $default-background-size, + $size-2: false, + $size-3: false, + $size-4: false, + $size-5: false, + $size-6: false, + $size-7: false, + $size-8: false, + $size-9: false, + $size-10: false +) { + $size-1: if(type-of($size-1) == string, unquote($size-1), $size-1); + $sizes: compact($size-1, $size-2, $size-3, $size-4, $size-5, $size-6, $size-7, $size-8, $size-9, $size-10); + @include experimental(background-size, $sizes, -moz, -webkit, -o, not -ms, not -khtml); +} diff --git a/scss/libs/compass/css3/_border-radius.scss b/scss/libs/compass/css3/_border-radius.scss new file mode 100755 index 0000000..2da9022 --- /dev/null +++ b/scss/libs/compass/css3/_border-radius.scss @@ -0,0 +1,130 @@ +@import "shared"; + +$default-border-radius: 5px !default; + +// Round all corners by a specific amount, defaults to value of `$default-border-radius`. +// +// When two values are passed, the first is the horizontal radius +// and the second is the vertical radius. +// +// Note: webkit does not support shorthand syntax for several corners at once. +// So in the case where you pass several values only the first will be passed to webkit. +// +// Examples: +// +// .simple { @include border-radius(4px, 4px); } +// .compound { @include border-radius(2px 5px, 3px 6px); } +// .crazy { @include border-radius(1px 3px 5px 7px, 2px 4px 6px 8px)} +// +// Which generates: +// +// .simple { +// -webkit-border-radius: 4px 4px; +// -moz-border-radius: 4px / 4px; +// -khtml-border-radius: 4px / 4px; +// border-radius: 4px / 4px; } +// +// .compound { +// -webkit-border-radius: 2px 3px; +// -moz-border-radius: 2px 5px / 3px 6px; +// -khtml-border-radius: 2px 5px / 3px 6px; +// border-radius: 2px 5px / 3px 6px; } +// +// .crazy { +// -webkit-border-radius: 1px 2px; +// -moz-border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px; +// -khtml-border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px; +// border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px; } + +@mixin border-radius($radius: $default-border-radius, $vertical-radius: false) { + + @if $vertical-radius { + // Webkit doesn't understand the official shorthand syntax for specifying + // a vertical radius unless so in case there's several we only take the first. + @include experimental(border-radius, first-value-of($radius) first-value-of($vertical-radius), + not -moz, + -webkit, + not -o, + not -ms, + not -khtml, + not official + ); + @include experimental("border-radius", $radius unquote("/") $vertical-radius, + -moz, + not -webkit, + not -o, + not -ms, + -khtml, + official + ); + } + @else { + @include experimental(border-radius, $radius); + } +} + +// Round radius at position by amount. +// +// * legal values for `$vert`: `top`, `bottom` +// * legal values for `$horz`: `left`, `right` + +@mixin border-corner-radius($vert, $horz, $radius: $default-border-radius) { + // Support for mozilla's syntax for specifying a corner + @include experimental("border-radius-#{$vert}#{$horz}", $radius, + -moz, + not -webkit, + not -o, + not -ms, + not -khtml, + not official + ); + @include experimental("border-#{$vert}-#{$horz}-radius", $radius, + not -moz, + -webkit, + not -o, + not -ms, + -khtml, + official + ); + +} + +// Round top-left corner only + +@mixin border-top-left-radius($radius: $default-border-radius) { + @include border-corner-radius(top, left, $radius); } + +// Round top-right corner only + +@mixin border-top-right-radius($radius: $default-border-radius) { + @include border-corner-radius(top, right, $radius); } + +// Round bottom-left corner only + +@mixin border-bottom-left-radius($radius: $default-border-radius) { + @include border-corner-radius(bottom, left, $radius); } + +// Round bottom-right corner only + +@mixin border-bottom-right-radius($radius: $default-border-radius) { + @include border-corner-radius(bottom, right, $radius); } + +// Round both top corners by amount +@mixin border-top-radius($radius: $default-border-radius) { + @include border-top-left-radius($radius); + @include border-top-right-radius($radius); } + +// Round both right corners by amount +@mixin border-right-radius($radius: $default-border-radius) { + @include border-top-right-radius($radius); + @include border-bottom-right-radius($radius); } + +// Round both bottom corners by amount +@mixin border-bottom-radius($radius: $default-border-radius) { + @include border-bottom-left-radius($radius); + @include border-bottom-right-radius($radius); } + +// Round both left corners by amount +@mixin border-left-radius($radius: $default-border-radius) { + @include border-top-left-radius($radius); + @include border-bottom-left-radius($radius); } diff --git a/scss/libs/compass/css3/_box-shadow.scss b/scss/libs/compass/css3/_box-shadow.scss new file mode 100755 index 0000000..ea47dc9 --- /dev/null +++ b/scss/libs/compass/css3/_box-shadow.scss @@ -0,0 +1,76 @@ +// @doc off +// These defaults make the arguments optional for this mixin +// If you like, set different defaults before importing. +// @doc on + +@import "shared"; + + +// The default color for box shadows +$default-box-shadow-color: #333333 !default; + +// The default horizontal offset. Positive is to the right. +$default-box-shadow-h-offset: 0px !default; + +// The default vertical offset. Positive is down. +$default-box-shadow-v-offset: 0px !default; + +// The default blur length. +$default-box-shadow-blur: 5px !default; + +// The default spread length. +$default-box-shadow-spread : false !default; + +// The default shadow inset: inset or false (for standard shadow). +$default-box-shadow-inset : false !default; + +// Provides cross-browser for Webkit, Gecko, and CSS3 box shadows when one or more box +// shadows are needed. +// Each shadow argument should adhere to the standard css3 syntax for the +// box-shadow property. +@mixin box-shadow( + $shadow-1 : default, + $shadow-2 : false, + $shadow-3 : false, + $shadow-4 : false, + $shadow-5 : false, + $shadow-6 : false, + $shadow-7 : false, + $shadow-8 : false, + $shadow-9 : false, + $shadow-10: false +) { + @if $shadow-1 == default { + $shadow-1 : -compass-space-list(compact(if($default-box-shadow-inset, inset, false), $default-box-shadow-h-offset, $default-box-shadow-v-offset, $default-box-shadow-blur, $default-box-shadow-spread, $default-box-shadow-color)); + } + $shadow : compact($shadow-1, $shadow-2, $shadow-3, $shadow-4, $shadow-5, $shadow-6, $shadow-7, $shadow-8, $shadow-9, $shadow-10); + @include experimental(box-shadow, $shadow, + -moz, -webkit, not -o, not -ms, not -khtml, official + ); +} + +// Provides a single cross-browser CSS box shadow for Webkit, Gecko, and CSS3. +// Includes default arguments for color, horizontal offset, vertical offset, blur length, spread length, and inset. +@mixin single-box-shadow( + $color : $default-box-shadow-color, + $hoff : $default-box-shadow-h-offset, + $voff : $default-box-shadow-v-offset, + $blur : $default-box-shadow-blur, + $spread : $default-box-shadow-spread, + $inset : $default-box-shadow-inset +) { + @if not ($inset == true or $inset == false or $inset == inset) { + @warn "$inset expected to be true or the inset keyword. Got #{$inset} instead. Using: inset"; + } + + @if $color == none { + @include box-shadow(none); + } @else { + $full : $hoff $voff; + @if $blur { $full: $full $blur; } + @if $spread { $full: $full $spread; } + @if $color { $full: $full $color; } + @if $inset { $full: inset $full; } + @include box-shadow($full); + } +} diff --git a/scss/libs/compass/css3/_box-sizing.scss b/scss/libs/compass/css3/_box-sizing.scss new file mode 100755 index 0000000..93ff8ac --- /dev/null +++ b/scss/libs/compass/css3/_box-sizing.scss @@ -0,0 +1,13 @@ +@import "shared"; + +// Change the box model for Mozilla, Webkit, IE8 and the future +// +// @param $bs +// [ content-box | border-box ] + +@mixin box-sizing($bs) { + $bs: unquote($bs); + @include experimental(box-sizing, $bs, + -moz, -webkit, not -o, not -ms, not -khtml, official + ); +} diff --git a/scss/libs/compass/css3/_box.scss b/scss/libs/compass/css3/_box.scss new file mode 100755 index 0000000..2abeef3 --- /dev/null +++ b/scss/libs/compass/css3/_box.scss @@ -0,0 +1,111 @@ +@import "shared"; + +// display:box; must be used for any of the other flexbox mixins to work properly +@mixin display-box { + @include experimental-value(display, box, + -moz, -webkit, not -o, -ms, not -khtml, official + ); +} + +// Default box orientation, assuming that the user wants something less block-like +$default-box-orient: horizontal !default; + +// Box orientation [ horizontal | vertical | inline-axis | block-axis | inherit ] +@mixin box-orient( + $orientation: $default-box-orient +) { + $orientation : unquote($orientation); + @include experimental(box-orient, $orientation, + -moz, -webkit, not -o, -ms, not -khtml, official + ); +} + +// Default box-align +$default-box-align: stretch !default; + +// Box align [ start | end | center | baseline | stretch ] +@mixin box-align( + $alignment: $default-box-align +) { + $alignment : unquote($alignment); + @include experimental(box-align, $alignment, + -moz, -webkit, not -o, -ms, not -khtml, official + ); +} + +// Default box flex +$default-box-flex: 0 !default; + +// mixin which takes an int argument for box flex. Apply this to the children inside the box. +// +// For example: "div.display-box > div.child-box" would get the box flex mixin. +@mixin box-flex( + $flex: $default-box-flex +) { + @include experimental(box-flex, $flex, + -moz, -webkit, not -o, -ms, not -khtml, official + ); +} + +// Default flex group +$default-box-flex-group: 1 !default; + +// mixin which takes an int argument for flexible grouping +@mixin box-flex-group( + $group: $default-box-flex-group +) { + @include experimental(box-flex-group, $group, + -moz, -webkit, not -o, -ms, not -khtml, official + ); +} + +// default for ordinal group +$default-box-ordinal-group: 1 !default; + +// mixin which takes an int argument for ordinal grouping and rearranging the order +@mixin box-ordinal-group( + $group: $default-box-ordinal-group +) { + @include experimental(box-ordinal-group, $group, + -moz, -webkit, not -o, -ms, not -khtml, official + ); +} + +// Box direction default value +$default-box-direction: normal !default; + +// mixin for box-direction [ normal | reverse | inherit ] +@mixin box-direction( + $direction: $default-box-direction +) { + $direction: unquote($direction); + @include experimental(box-direction, $direction, + -moz, -webkit, not -o, -ms, not -khtml, official + ); +} + +// default for box lines +$default-box-lines: single !default; + +// mixin for box lines [ single | multiple ] +@mixin box-lines( + $lines: $default-box-lines +) { + $lines: unquote($lines); + @include experimental(box-lines, $lines, + -moz, -webkit, not -o, -ms, not -khtml, official + ); +} + +// default for box pack +$default-box-pack: start !default; + +// mixin for box pack [ start | end | center | justify ] +@mixin box-pack( + $pack: $default-box-pack +) { + $pack: unquote($pack); + @include experimental(box-pack, $pack, + -moz, -webkit, not -o, -ms, not -khtml, official + ); +} diff --git a/scss/libs/compass/css3/_columns.scss b/scss/libs/compass/css3/_columns.scss new file mode 100755 index 0000000..fa204d3 --- /dev/null +++ b/scss/libs/compass/css3/_columns.scss @@ -0,0 +1,157 @@ +@import "shared"; + +// Specify the shorthand `columns` property. +// +// Example: +// +// @include columns(20em 2) +@mixin columns($width-and-count) { + @include experimental(columns, $width-and-count, + -moz, -webkit, -o, -ms, not -khtml, official + ); +} + +// Specify the number of columns +@mixin column-count($count) { + @include experimental(column-count, $count, + -moz, -webkit, -o, -ms, not -khtml, official + ); +} + +// Specify the gap between columns e.g. `20px` +@mixin column-gap($width) { + @include experimental(column-gap, $width, + -moz, -webkit, -o, -ms, not -khtml, official + ); +} + +// Specify the width of columns e.g. `100px` +@mixin column-width($width) { + @include experimental(column-width, $width, + -moz, -webkit, -o, -ms, not -khtml, official + ); +} + +// Specify how many columns an element should span across. +// +// * legal values are 1, all +@mixin column-span($columns) { + @include experimental(column-span, $columns, + -moz, -webkit, -o, -ms, not -khtml, official + ); +} + +// Specify the width of the rule between columns e.g. `1px` +@mixin column-rule-width($width) { + @include experimental(column-rule-width, $width, + -moz, -webkit, -o, -ms, not -khtml, official + ); +} + +// Specify the style of the rule between columns e.g. `dotted`. +// This works like border-style. +@mixin column-rule-style($style) { + @include experimental(column-rule-style, unquote($style), + -moz, -webkit, -o, -ms, not -khtml, official + ); +} + +// Specify the color of the rule between columns e.g. `blue`. +// This works like border-color. +@mixin column-rule-color($color) { + @include experimental(column-rule-color, $color, + -moz, -webkit, -o, -ms, not -khtml, official + ); +} + +// Mixin encompassing all column rule properties +// For example: +// +// @include column-rule(1px, solid, #c00) +// +// Or the values can be space separated: +// +// @include column-rule(1px solid #c00) +@mixin column-rule($width, $style: false, $color: false) { + $full : -compass-space-list(compact($width, $style, $color)); + @include experimental(column-rule, $full, + -moz, -webkit, -o, -ms, not -khtml, official + ); +} + +// Mixin for setting column-break-before +// +// * legal values are auto, always, avoid, left, right, page, column, avoid-page, avoid-column +// +// Example: +// h2.before {@include column-break-before(always);} +// +// Which generates: +// +// h2.before { +// -webkit-column-break-before: always; +// column-break-before: always;} +@mixin column-break-before($value: auto){ + @include experimental(column-break-before, $value, not -moz, -webkit, not -o, not -ms, not -khtml, official ); +} + +// Mixin for setting column-break-after +// +// * legal values are auto, always, avoid, left, right, page, column, avoid-page, avoid-column +// +// Example: +// h2.after {@include column-break-after(always); } +// +// Which generates: +// +// h2.after { +// -webkit-column-break-after: always; +// column-break-after: always; } +@mixin column-break-after($value: auto){ + @include experimental(column-break-after, $value, not -moz, -webkit, not -o, not -ms, not -khtml, official ); +} + +// Mixin for setting column-break-inside +// +// * legal values are auto, avoid, avoid-page, avoid-column +// +// Example: +// h2.inside {@include column-break-inside();} +// Which generates: +// +// h2.inside { +// -webkit-column-break-inside: auto; +// column-break-inside: auto;} +@mixin column-break-inside($value: auto){ + @include experimental(column-break-inside, $value, not -moz, -webkit, not -o, not -ms, not -khtml, official ); +} + +// All-purpose mixin for setting column breaks. +// +// * legal values for $type : before, after, inside +// * legal values for '$value' are dependent on $type +// * when $type = before, legal values are auto, always, avoid, left, right, page, column, avoid-page, avoid-column +// * when $type = after, legal values are auto, always, avoid, left, right, page, column, avoid-page, avoid-column +// * when $type = inside, legal values are auto, avoid, avoid-page, avoid-column +// +// Examples: +// h2.before {@include column-break(before, always);} +// h2.after {@include column-break(after, always); } +// h2.inside {@include column-break(inside); } +// +// Which generates: +// h2.before { +// -webkit-column-break-before: always; +// column-break-before: always;} +// +// h2.after { +// -webkit-column-break-after: always; +// column-break-after: always; } +// +// h2.inside { +// -webkit-column-break-inside: auto; +// column-break-inside: auto;} + +@mixin column-break($type: before, $value: auto){ + @include experimental("column-break-#{$type}", $value, not -moz, -webkit, not -o, not -ms, not -khtml, official ); +} \ No newline at end of file diff --git a/scss/libs/compass/css3/_filter.scss b/scss/libs/compass/css3/_filter.scss new file mode 100755 index 0000000..cd6eb19 --- /dev/null +++ b/scss/libs/compass/css3/_filter.scss @@ -0,0 +1,23 @@ +@import "shared"; + +// Provides cross-browser support for the upcoming (?) css3 filter property. +// +// Each filter argument should adhere to the standard css3 syntax for the +// filter property. +@mixin filter ( + $filter-1, + $filter-2 : false, + $filter-3 : false, + $filter-4 : false, + $filter-5 : false, + $filter-6 : false, + $filter-7 : false, + $filter-8 : false, + $filter-9 : false, + $filter-10: false +) { + $filter : compact($filter-1, $filter-2, $filter-3, $filter-4, $filter-5, $filter-6, $filter-7, $filter-8, $filter-9, $filter-10); + @include experimental(filter, $filter, + -moz, -webkit, not -o, not -ms, not -khtml, official + ); +} diff --git a/scss/libs/compass/css3/_font-face.scss b/scss/libs/compass/css3/_font-face.scss new file mode 100755 index 0000000..bd3db34 --- /dev/null +++ b/scss/libs/compass/css3/_font-face.scss @@ -0,0 +1,48 @@ +@import "shared"; + +// Cross-browser support for @font-face. Supports IE, Gecko, Webkit, Opera. +// +// * $name is required, arbitrary, and what you will use in font stacks. +// * $font-files is required using font-files('relative/location', 'format'). +// for best results use this order: woff, opentype/truetype, svg +// * $eot is required by IE, and is a relative location of the eot file. +// * $weight shows if the font is bold, defaults to normal +// * $style defaults to normal, might be also italic +// * For android 2.2 Compatiblity, please ensure that your web page has +// a meta viewport tag. +// * To support iOS < 4.2, an SVG file must be provided +// +// If you need to generate other formats check out the Font Squirrel +// [font generator](http://www.fontsquirrel.com/fontface/generator) +// + +// In order to refer to a specific style of the font in your stylesheets as +// e.g. "font-style: italic;", you may add a couple of @font-face includes +// containing the respective font files for each style and specying +// respective the $style parameter. + +// Order of the includes matters, and it is: normal, bold, italic, bold+italic. + +@mixin font-face( + $name, + $font-files, + $eot: false, + $weight: false, + $style: false +) { + $iefont: unquote("#{$eot}?#iefix"); + @font-face { + font-family: quote($name); + @if $eot { + src: font-url($eot); + $font-files: font-url($iefont) unquote("format('eot')"), $font-files; + } + src: $font-files; + @if $weight { + font-weight: $weight; + } + @if $style { + font-style: $style; + } + } +} diff --git a/scss/libs/compass/css3/_hyphenation.scss b/scss/libs/compass/css3/_hyphenation.scss new file mode 100755 index 0000000..a4f5808 --- /dev/null +++ b/scss/libs/compass/css3/_hyphenation.scss @@ -0,0 +1,77 @@ +@import "shared"; + +// Mixins to support specific CSS Text Level 3 elements +// +// +// +// Mixin for word-break properties +// http://www.w3.org/css3-text/#word-break +// * legal values for $type : normal, keep-all, break-all +// +// Example: +// p.wordBreak {@include word-break(break-all);} +// +// Which generates: +// p.wordBreak { +// -ms-word-break: break-all; +// word-break: break-all; +// word-break: break-word;} +// +@mixin word-break($value: normal){ + @if $value == break-all { + //Most browsers handle the break-all case the same... + @include experimental(word-break, $value, + not -moz, not -webkit, not -o, -ms, not -khtml, official + ); + //Webkit handles break-all differently... as break-word + @include experimental(word-break, break-word, + not -moz, not -webkit, not -o, not -ms, not -khtml, official + ); + } + @else { + @include experimental(word-break, $value, + not -moz, not -webkit, not -o, -ms, not -khtml, official + ); + } +} + +// Mixin for the hyphens property +// +// W3C specification: http://www.w3.org/TR/css3-text/#hyphens +// * legal values for $type : auto, manual, none +// +// Example: +// p { +// @include hyphens(auto);} +// Which generates: +// p { +// -moz-hyphens: auto; +// -webkit-hyphens: auto; +// hyphens: auto;} +// +@mixin hyphens($value: auto){ + @include experimental(hyphens, $value, + -moz, -webkit, not -o, not -ms, not -khtml, official + ); +} + +// Mixin for x-browser hyphenation based on @auchenberg's post: +// Removes the need for the HTML tag +// http://blog.kenneth.io/blog/2012/03/04/word-wrapping-hypernation-using-css/ +// +// Example: +// div {@include hyphenation;} +// +// Which generates: +// div { +// -ms-word-break: break-all; +// word-break: break-all; +// word-break: break-word; +// -moz-hyphens: auto; +// -webkit-hyphens: auto; +// hyphens: auto;} +// +@mixin hyphenation{ + @include word-break(break-all); + @include hyphens; +} diff --git a/scss/libs/compass/css3/_images.scss b/scss/libs/compass/css3/_images.scss new file mode 100755 index 0000000..e241776 --- /dev/null +++ b/scss/libs/compass/css3/_images.scss @@ -0,0 +1,132 @@ +@import "shared"; +@import "compass/utilities/general/hacks"; + +// Background property support for vendor prefixing within values. +@mixin background( + $background-1, + $background-2: false, + $background-3: false, + $background-4: false, + $background-5: false, + $background-6: false, + $background-7: false, + $background-8: false, + $background-9: false, + $background-10: false +) { + $backgrounds: compact($background-1, $background-2, $background-3, $background-4, $background-5, + $background-6, $background-7, $background-8, $background-9, $background-10); + $mult-bgs: -compass-list-size($backgrounds) > 1; + $add-pie-bg: prefixed(-pie, $backgrounds) or $mult-bgs; + @if $experimental-support-for-svg and prefixed(-svg, $backgrounds) { background: -svg($backgrounds); } + @if $support-for-original-webkit-gradients and prefixed(-owg, $backgrounds) { background: -owg($backgrounds); } + @if $experimental-support-for-webkit and prefixed(-webkit, $backgrounds) { background: -webkit($backgrounds); } + @if $experimental-support-for-mozilla and prefixed(-moz, $backgrounds) { background: -moz($backgrounds); } + @if $experimental-support-for-opera and prefixed(-o, $backgrounds) { background: -o($backgrounds); } + @if $experimental-support-for-pie and $add-pie-bg { -pie-background: -pie($backgrounds); } + background: $backgrounds ; +} + +@mixin background-with-css2-fallback( + $background-1, + $background-2: false, + $background-3: false, + $background-4: false, + $background-5: false, + $background-6: false, + $background-7: false, + $background-8: false, + $background-9: false, + $background-10: false +) { + $backgrounds: compact($background-1, $background-2, $background-3, $background-4, $background-5, + $background-6, $background-7, $background-8, $background-9, $background-10); + $mult-bgs: -compass-list-size($backgrounds) > 1; + $simple-background: if($mult-bgs or prefixed(-css2, $backgrounds), -css2(-compass-nth($backgrounds, last)), false); + @if not blank($simple-background) { background: $simple-background; } + @include background($background-1, $background-2, $background-3, $background-4, $background-5, + $background-6, $background-7, $background-8, $background-9, $background-10); +} + + +// Background image property support for vendor prefixing within values. +@mixin background-image( + $image-1, + $image-2: false, + $image-3: false, + $image-4: false, + $image-5: false, + $image-6: false, + $image-7: false, + $image-8: false, + $image-9: false, + $image-10: false +) { + $images: compact($image-1, $image-2, $image-3, $image-4, $image-5, $image-6, $image-7, $image-8, $image-9, $image-10); + $add-pie-bg: prefixed(-pie, $images) or -compass-list-size($images) > 1; + + @if $experimental-support-for-svg and prefixed(-svg, $images) { background-image: -svg($images); background-size: 100%; } + @if $support-for-original-webkit-gradients and prefixed(-owg, $images) { background-image: -owg($images); } + @if $experimental-support-for-webkit and prefixed(-webkit, $images) { background-image: -webkit($images); } + @if $experimental-support-for-mozilla and prefixed(-moz, $images) { background-image: -moz($images); } + @if $experimental-support-for-opera and prefixed(-o, $images) { background-image: -o($images); } + @if $experimental-support-for-pie and $add-pie-bg { @warn "PIE does not support background-image. Use @include background(#{$images}) instead." } + background-image: $images ; +} + +// Emit a IE-Specific filters that renders a simple linear gradient. +// For use in IE 6 - 8. Best practice would have you apply this via a +// conditional IE stylesheet, but if you must, you should place this before +// any background-image properties that you have specified. +// +// For the `$orientation` parameter, you can pass `vertical` or `horizontal`. +@mixin filter-gradient($start-color, $end-color, $orientation: vertical) { + @include has-layout; + $gradient-type: if($orientation == vertical, 0, 1); + @if $legacy-support-for-ie6 or $legacy-support-for-ie7 or $legacy-support-for-ie8 { + filter: progid:DXImageTransform.Microsoft.gradient(gradientType=#{$gradient-type}, startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}'); + } +} + + +// Border image property support for vendor prefixing properties and values. +@mixin border-image($value) { + @if $experimental-support-for-mozilla { -moz-border-image: -moz(reject(-compass-list($value), fill)); } + @if $support-for-original-webkit-gradients { -webkit-border-image: -owg(reject(-compass-list($value), fill)); } + @if $experimental-support-for-webkit { -webkit-border-image: -webkit(reject(-compass-list($value), fill)); } + @if $experimental-support-for-opera { -o-border-image: -o(reject(-compass-list($value), fill)); } + @if $experimental-support-for-svg { border-image: -svg(reject(-compass-list($value), fill)); } + border-image: $value; +} + +// List style image property support for vendor prefixing within values. +@mixin list-style-image($image) { + @if $experimental-support-for-mozilla and prefixed(-moz, $image) { list-style-image: -moz($image); } + @if $support-for-original-webkit-gradients and prefixed(-owg, $image) { list-style-image: -owg($image); } + @if $experimental-support-for-webkit and prefixed(-webkit, $image) { list-style-image: -webkit($image); } + @if $experimental-support-for-opera and prefixed(-o, $image) { list-style-image: -o($image); } + @if $experimental-support-for-svg and prefixed(-svg, $image) { list-style-image: -svg($image); } + list-style-image: $image ; +} + +// List style property support for vendor prefixing within values. +@mixin list-style($value) { + $value: -compass-list($value); + @if $experimental-support-for-mozilla and prefixed(-moz, $value) { list-style-image: -moz($value); } + @if $support-for-original-webkit-gradients and prefixed(-owg, $value) { list-style-image: -owg($value); } + @if $experimental-support-for-webkit and prefixed(-webkit, $value) { list-style-image: -webkit($value); } + @if $experimental-support-for-opera and prefixed(-o, $value) { list-style-image: -o($value); } + @if $experimental-support-for-svg and prefixed(-svg, $value) { list-style-image: -svg($value); } + list-style-image: $value ; +} + +// content property support for vendor prefixing within values. +@mixin content($value) { + $value: -compass-list($value); + @if $experimental-support-for-mozilla and prefixed(-moz, $value) { content: -moz($value); } + @if $support-for-original-webkit-gradients and prefixed(-owg, $value) { content: -owg($value); } + @if $experimental-support-for-webkit and prefixed(-webkit, $value) { content: -webkit($value); } + @if $experimental-support-for-opera and prefixed(-o, $value) { content: -o($value); } + @if $experimental-support-for-svg and prefixed(-svg, $value) { content: -svg($value); } + content: $value ; +} diff --git a/scss/libs/compass/css3/_inline-block.scss b/scss/libs/compass/css3/_inline-block.scss new file mode 100755 index 0000000..75519b1 --- /dev/null +++ b/scss/libs/compass/css3/_inline-block.scss @@ -0,0 +1,22 @@ +@import "shared"; + +// Set `$inline-block-alignment` to `none` or `false` to disable the output +// of a vertical-align property in the inline-block mixin. +// Or set it to a legal value for `vertical-align` to change the default. +$inline-block-alignment: middle !default; + +// Provides a cross-browser method to implement `display: inline-block;` +@mixin inline-block($alignment: $inline-block-alignment) { + @if $legacy-support-for-mozilla { + display: -moz-inline-stack; + } + display: inline-block; + @if $alignment and $alignment != none { + vertical-align: $alignment; + } + @if $legacy-support-for-ie { + *vertical-align: auto; + zoom: 1; + *display: inline; + } +} diff --git a/scss/libs/compass/css3/_opacity.scss b/scss/libs/compass/css3/_opacity.scss new file mode 100755 index 0000000..fc497ff --- /dev/null +++ b/scss/libs/compass/css3/_opacity.scss @@ -0,0 +1,19 @@ +@import "shared"; + +// Provides cross-browser CSS opacity. Takes a number between 0 and 1 as the argument, e.g. 0.5 for 50% opacity. +// +// @param $opacity +// A number between 0 and 1, where 0 is transparent and 1 is opaque. + +@mixin opacity($opacity) { + @if $legacy-support-for-ie6 or $legacy-support-for-ie7 or $legacy-support-for-ie8 { + filter: unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=#{round($opacity * 100)})"); + } + opacity: $opacity; +} + +// Make an element completely transparent. +@mixin transparent { @include opacity(0); } + +// Make an element completely opaque. +@mixin opaque { @include opacity(1); } diff --git a/scss/libs/compass/css3/_pie.scss b/scss/libs/compass/css3/_pie.scss new file mode 100755 index 0000000..81e2e51 --- /dev/null +++ b/scss/libs/compass/css3/_pie.scss @@ -0,0 +1,73 @@ +$experimental-support-for-pie: true; + +// It is recommended that you use Sass's @extend directive to apply the behavior +// to your PIE elements. To assist you, Compass provides this variable. +// When set, it will cause the `@include pie` mixin to extend this class. +// The class name you provide should **not** include the `.`. +$pie-base-class: false !default; + +// The default approach to using PIE. +// Can be one of: +// +// * relative (default) +// * z-index +// * none +$pie-default-approach: relative !default; + +// The location of your PIE behavior file +// This should be root-relative to your web server +// relative assets don't work. It is recommended that +// you set this yourself. +$pie-behavior: stylesheet-url("PIE.htc") !default; + +// When using the z-index approach, the +// first ancestor of the PIE element at +// or before the container's opaque background +// should have a z-index set as well to ensure +// propert z-index stacking. +// +// The `$position` argument must be some non-static +// value (absolute, relative, etc.) +@mixin pie-container($z-index: 0, $position: relative) { + z-index: $z-index; + position: $position; +} + +// PIE elements must have this behavior attached to them. +// IE is broken -- it doesn't think of behavior urls as +// relative to the stylesheet. It considers them relative +// to the webpage. As a result, you cannot reliably use +// compass's relative_assets with PIE. +// +// * `$approach` - one of: relative, z-index, or none +// * `$z-index` - when using the z-index approach, this +// is the z-index that is applied. +@mixin pie-element( + $approach: $pie-default-approach, + $z-index: 0 +) { + behavior: $pie-behavior; + @if $approach == relative { + position: relative; + } + @else if $approach == z-index { + z-index: $z-index; + } +} + +// a smart mixin that knows to extend or include pie-element according +// to your stylesheet's configuration variables. +@mixin pie($base-class: $pie-base-class) { + @if $base-class { + @extend .#{$base-class}; + } + @else { + @include pie-element; + } +} + +// Watch `$n` levels of ancestors for changes to their class attribute +// So that cascading styles will work correctly on the PIE element. +@mixin pie-watch-ancestors($n) { + -pie-watch-ancestors: $n; +} \ No newline at end of file diff --git a/scss/libs/compass/css3/_regions.scss b/scss/libs/compass/css3/_regions.scss new file mode 100755 index 0000000..9b2f27c --- /dev/null +++ b/scss/libs/compass/css3/_regions.scss @@ -0,0 +1,22 @@ +@import "shared"; + +// Webkit, IE10 and future support for [CSS Regions](http://dev.w3.org/csswg/css3-regions/) +// +// $target is a value you use to link two regions of your css. Give the source of your content the flow-into property, and give your target container the flow-from property. +// +// For a visual explanation, see the diagrams at Chris Coyier's +// [CSS-Tricks](http://css-tricks.com/content-folding/) + +@mixin flow-into($target) { + $target: unquote($target); + @include experimental(flow-into, $target, + not -moz, -webkit, not -o, -ms, not -khtml, not official + ); +} + +@mixin flow-from($target) { + $target: unquote($target); + @include experimental(flow-from, $target, + not -moz, -webkit, not -o, -ms, not -khtml, not official + ); +} \ No newline at end of file diff --git a/scss/libs/compass/css3/_shared.scss b/scss/libs/compass/css3/_shared.scss new file mode 100755 index 0000000..1f55cb5 --- /dev/null +++ b/scss/libs/compass/css3/_shared.scss @@ -0,0 +1,38 @@ +@import "compass/support"; + +// This mixin provides basic support for CSS3 properties and +// their corresponding experimental CSS2 properties when +// the implementations are identical except for the property +// prefix. +@mixin experimental($property, $value, + $moz : $experimental-support-for-mozilla, + $webkit : $experimental-support-for-webkit, + $o : $experimental-support-for-opera, + $ms : $experimental-support-for-microsoft, + $khtml : $experimental-support-for-khtml, + $official : true +) { + @if $webkit and $experimental-support-for-webkit { -webkit-#{$property} : $value; } + @if $khtml and $experimental-support-for-khtml { -khtml-#{$property} : $value; } + @if $moz and $experimental-support-for-mozilla { -moz-#{$property} : $value; } + @if $ms and $experimental-support-for-microsoft { -ms-#{$property} : $value; } + @if $o and $experimental-support-for-opera { -o-#{$property} : $value; } + @if $official { #{$property} : $value; } +} + +// Same as experimental(), but for cases when the property is the same and the value is vendorized +@mixin experimental-value($property, $value, + $moz : $experimental-support-for-mozilla, + $webkit : $experimental-support-for-webkit, + $o : $experimental-support-for-opera, + $ms : $experimental-support-for-microsoft, + $khtml : $experimental-support-for-khtml, + $official : true +) { + @if $webkit and $experimental-support-for-webkit { #{$property} : -webkit-#{$value}; } + @if $khtml and $experimental-support-for-khtml { #{$property} : -khtml-#{$value}; } + @if $moz and $experimental-support-for-mozilla { #{$property} : -moz-#{$value}; } + @if $ms and $experimental-support-for-microsoft { #{$property} : -ms-#{$value}; } + @if $o and $experimental-support-for-opera { #{$property} : -o-#{$value}; } + @if $official { #{$property} : #{$value}; } +} diff --git a/scss/libs/compass/css3/_text-shadow.scss b/scss/libs/compass/css3/_text-shadow.scss new file mode 100755 index 0000000..eab7636 --- /dev/null +++ b/scss/libs/compass/css3/_text-shadow.scss @@ -0,0 +1,87 @@ +@import "shared"; + +// These defaults make the arguments optional for this mixin +// If you like, set different defaults in your project + +$default-text-shadow-color: #aaa !default; +$default-text-shadow-h-offset: 0px !default; +$default-text-shadow-v-offset: 0px !default; +$default-text-shadow-blur: 1px !default; +$default-text-shadow-spread: false !default; + +// Provides cross-browser text shadows when one or more shadows are needed. +// Each shadow argument should adhere to the standard css3 syntax for the +// text-shadow property. +// +// Note: if any shadow has a spread parameter, this will cause the mixin +// to emit the shadow declaration twice, first without the spread, +// then with the spread included. This allows you to progressively +// enhance the browsers that do support the spread parameter. +@mixin text-shadow( + $shadow-1 : default, + $shadow-2 : false, + $shadow-3 : false, + $shadow-4 : false, + $shadow-5 : false, + $shadow-6 : false, + $shadow-7 : false, + $shadow-8 : false, + $shadow-9 : false, + $shadow-10: false +) { + @if $shadow-1 == default { + $shadow-1: compact($default-text-shadow-h-offset $default-text-shadow-v-offset $default-text-shadow-blur $default-text-shadow-spread $default-text-shadow-color); + } + $shadows-without-spread: join((),(),comma); + $shadows: join((),(),comma); + $has-spread: false; + @each $shadow in compact($shadow-1, $shadow-2, $shadow-3, $shadow-4, $shadow-5, + $shadow-6, $shadow-7, $shadow-8, $shadow-9, $shadow-10) { + @if length($shadow) > 4 { + $has-spread: true; + $shadows-without-spread: append($shadows-without-spread, nth($shadow,1) nth($shadow,2) nth($shadow,3) nth($shadow,5)); + $shadows: append($shadows, $shadow); + } else { + $shadows-without-spread: append($shadows-without-spread, $shadow); + $shadows: append($shadows, $shadow); + } + } + @if $has-spread { + text-shadow: $shadows-without-spread; + } + text-shadow: $shadows; +} + +// Provides a single cross-browser CSS text shadow. +// +// Provides sensible defaults for the color, horizontal offset, vertical offset, blur, and spread +// according to the configuration defaults above. +@mixin single-text-shadow( + $hoff: false, + $voff: false, + $blur: false, + $spread: false, + $color: false +) { + // A lot of people think the color comes first. It doesn't. + @if type-of($hoff) == color { + $temp-color: $hoff; + $hoff: $voff; + $voff: $blur; + $blur: $spread; + $spread: $color; + $color: $temp-color; + } + // Can't rely on default assignment with multiple supported argument orders. + $hoff: if($hoff, $hoff, $default-text-shadow-h-offset); + $voff: if($voff, $voff, $default-text-shadow-v-offset); + $blur: if($blur, $blur, $default-text-shadow-blur ); + $spread: if($spread, $spread, $default-text-shadow-spread ); + $color: if($color, $color, $default-text-shadow-color ); + // We don't need experimental support for this property. + @if $color == none or $hoff == none { + @include text-shadow(none); + } @else { + @include text-shadow(compact($hoff $voff $blur $spread $color)); + } +} diff --git a/scss/libs/compass/css3/_transform-legacy.scss b/scss/libs/compass/css3/_transform-legacy.scss new file mode 100755 index 0000000..ac661da --- /dev/null +++ b/scss/libs/compass/css3/_transform-legacy.scss @@ -0,0 +1,87 @@ +@import "shared"; + +@warn "This version of the transform module has been deprecated and will be removed."; + +// CSS Transform and Transform-Origin + +// Apply a transform sent as a complete string. + +@mixin apply-transform($transform) { + @include experimental(transform, $transform, + -moz, -webkit, -o, not -ms, not -khtml, official + ); +} + +// Apply a transform-origin sent as a complete string. + +@mixin apply-origin($origin) { + @include experimental(transform-origin, $origin, + -moz, -webkit, -o, not -ms, not -khtml, official + ); +} + +// transform-origin requires x and y coordinates +// +// * only applies the coordinates if they are there so that it can be called by scale, rotate and skew safely + +@mixin transform-origin($originx: 50%, $originy: 50%) { + @if $originx or $originy { + @if $originy { + @include apply-origin($originx or 50% $originy); + } @else { + @include apply-origin($originx); + } + } +} + +// A full transform mixin with everything you could want +// +// * including origin adjustments if you want them +// * scale, rotate and skew require units of degrees(deg) +// * scale takes a multiplier, rotate and skew take degrees + +@mixin transform( + $scale: 1, + $rotate: 0deg, + $transx: 0, + $transy: 0, + $skewx: 0deg, + $skewy: 0deg, + $originx: false, + $originy: false +) { + $transform : scale($scale) rotate($rotate) translate($transx, $transy) skew($skewx, $skewy); + @include apply-transform($transform); + @include transform-origin($originx, $originy); +} + +// Transform Partials +// +// These work well on their own, but they don't add to each other, they override. +// Use them with extra origin args, or along side +transform-origin + +// Adjust only the scale, with optional origin coordinates + +@mixin scale($scale: 1.25, $originx: false, $originy: false) { + @include apply-transform(scale($scale)); + @include transform-origin($originx, $originy); +} + +// Adjust only the rotation, with optional origin coordinates + +@mixin rotate($rotate: 45deg, $originx: false, $originy: false) { + @include apply-transform(rotate($rotate)); + @include transform-origin($originx, $originy); +} + +// Adjust only the translation + +@mixin translate($transx: 0, $transy: 0) { + @include apply-transform(translate($transx, $transy)); +} + +// Adjust only the skew, with optional origin coordinates +@mixin skew($skewx: 0deg, $skewy: 0deg, $originx: false, $originy: false) { + @include apply-transform(skew($skewx, $skewy)); + @include transform-origin($originx, $originy); +} diff --git a/scss/libs/compass/css3/_transform.scss b/scss/libs/compass/css3/_transform.scss new file mode 100755 index 0000000..ecd50b7 --- /dev/null +++ b/scss/libs/compass/css3/_transform.scss @@ -0,0 +1,598 @@ +@import "shared"; + +// @doc off +// Note ---------------------------------------------------------------------- +// Safari, Chrome, and Firefox all support 3D transforms. However, +// only in the most recent builds. You should also provide fallback 2d support for +// Opera and IE. IE10 is slated to have 3d enabled, but is currently unreleased. +// To make that easy, all 2D transforms include an browser-targeting toggle ($only3d) +// to switch between the two support lists. The toggle defaults to 'false' (2D), +// and also accepts 'true' (3D). Currently the lists are as follows: +// 2D: Mozilla, Webkit, Opera, Official +// 3D: Webkit, Firefox. + +// Available Transforms ------------------------------------------------------ +// - Scale (2d and 3d) +// - Rotate (2d and 3d) +// - Translate (2d and 3d) +// - Skew (2d only) + +// Transform Parameters ------------------------------------------------------ +// - Transform Origin (2d and 3d) +// - Perspective (3d) +// - Perspective Origin (3d) +// - Transform Style (3d) +// - Backface Visibility (3d) + +// Mixins -------------------------------------------------------------------- +// transform-origin +// - shortcuts: transform-origin2d, transform-origin3d +// - helpers: apply-origin +// transform +// - shortcuts: transform2d, transform3d +// - helpers: simple-transform, create-transform +// perspective +// - helpers: perspective-origin +// transform-style +// backface-visibility +// scale +// - shortcuts: scaleX, scaleY, scaleZ, scale3d +// rotate +// - shortcuts: rotateX, rotateY, rotate3d +// translate +// - shortcuts: translateX, translateY, translateZ, translate3d +// skew +// - shortcuts: skewX, skewY + +// Defaults ------------------------------------------------------------------ +// @doc on + +// The default x-origin for transforms +$default-origin-x : 50% !default; +// The default y-origin for transforms +$default-origin-y : 50% !default; +// The default z-origin for transforms +$default-origin-z : 50% !default; + + +// The default x-multiplier for scaling +$default-scale-x : 1.25 !default; +// The default y-multiplier for scaling +$default-scale-y : $default-scale-x !default; +// The default z-multiplier for scaling +$default-scale-z : $default-scale-x !default; + + +// The default angle for rotations +$default-rotate : 45deg !default; + + +// The default x-vector for the axis of 3d rotations +$default-vector-x : 1 !default; +// The default y-vector for the axis of 3d rotations +$default-vector-y : 1 !default; +// The default z-vector for the axis of 3d rotations +$default-vector-z : 1 !default; + + +// The default x-length for translations +$default-translate-x : 1em !default; +// The default y-length for translations +$default-translate-y : $default-translate-x !default; +// The default z-length for translations +$default-translate-z : $default-translate-x !default; + + +// The default x-angle for skewing +$default-skew-x : 5deg !default; +// The default y-angle for skewing +$default-skew-y : 5deg !default; + + +// **Transform-origin** +// Transform-origin sent as a complete string +// +// @include apply-origin( origin [, 3D-only ] ) +// +// where 'origin' is a space separated list containing 1-3 (x/y/z) coordinates +// in percentages, absolute (px, cm, in, em etc..) or relative +// (left, top, right, bottom, center) units +// +// @param only3d Set this to true to only apply this +// mixin where browsers have 3D support. +@mixin apply-origin($origin, $only3d) { + $only3d: $only3d or -compass-list-size(-compass-list($origin)) > 2; + @if $only3d { + @include experimental(transform-origin, $origin, + -moz, -webkit, -o, -ms, not -khtml, official + ); + } @else { + @include experimental(transform-origin, $origin, + -moz, -webkit, -o, -ms, not -khtml, official + ); + } +} + +// Transform-origin sent as individual arguments: +// +// @include transform-origin( [ origin-x, origin-y, origin-z, 3D-only ] ) +// +// where the 3 'origin-' arguments represent x/y/z coordinates. +// +// **NOTE:** setting z coordinates triggers 3D support list, leave false for 2D support +@mixin transform-origin( + $origin-x: $default-origin-x, + $origin-y: $default-origin-y, + $origin-z: false, + $only3d: if($origin-z, true, false) +) { + $origin: unquote(''); + @if $origin-x or $origin-y or $origin-z { + @if $origin-x { $origin: $origin-x; } @else { $origin: 50%; } + @if $origin-y { $origin: $origin $origin-y; } @else { @if $origin-z { $origin: $origin 50%; }} + @if $origin-z { $origin: $origin $origin-z; } + @include apply-origin($origin, $only3d); + } +} + + +// Transform sent as a complete string: +// +// @include transform( transforms [, 3D-only ] ) +// +// where 'transforms' is a space separated list of all the transforms to be applied. +@mixin transform( + $transform, + $only3d: false +) { + @if $only3d { + @include experimental(transform, $transform, + -moz, -webkit, -o, -ms, not -khtml, official + ); + } @else { + @include experimental(transform, $transform, + -moz, -webkit, -o, -ms, not -khtml, official + ); + } +} + +// Shortcut to target all browsers with 2D transform support +@mixin transform2d($trans) { + @include transform($trans, false); +} + +// Shortcut to target only browsers with 3D transform support +@mixin transform3d($trans) { + @include transform($trans, true); +} + +// @doc off +// 3D Parameters ------------------------------------------------------------- +// @doc on + +// Set the perspective of 3D transforms on the children of an element: +// +// @include perspective( perspective ) +// +// where 'perspective' is a unitless number representing the depth of the +// z-axis. The higher the perspective, the more exaggerated the foreshortening. +// values from 500 to 1000 are more-or-less "normal" - a good starting-point. +@mixin perspective($p) { + @include experimental(perspective, $p, + -moz, -webkit, -o, -ms, not -khtml, official + ); +} + +// Set the origin position for the perspective +// +// @include perspective-origin(origin-x [origin-y]) +// +// where the two arguments represent x/y coordinates +@mixin perspective-origin($origin: 50%) { + @include experimental(perspective-origin, $origin, + -moz, -webkit, -o, -ms, not -khtml, official + ); +} + +// Determine whether a 3D objects children also live in the given 3D space +// +// @include transform-style( [ style ] ) +// +// where `style` can be either `flat` or `preserve-3d`. +// Browsers default to `flat`, mixin defaults to `preserve-3d`. +@mixin transform-style($style: preserve-3d) { + @include experimental(transform-style, $style, + -moz, -webkit, -o, -ms, not -khtml, official + ); +} + +// Determine the visibility of an element when it's back is turned +// +// @include backface-visibility( [ visibility ] ) +// +// where `visibility` can be either `visible` or `hidden`. +// Browsers default to visible, mixin defaults to hidden +@mixin backface-visibility($visibility: hidden) { + @include experimental(backface-visibility, $visibility, + -moz, -webkit, -o, -ms, not -khtml, official + ); +} + +// @doc off +// Transform Partials -------------------------------------------------------- +// These work well on their own, but they don't add to each other, they override. +// Use along with transform parameter mixins to adjust origin, perspective and style +// --------------------------------------------------------------------------- + + +// Scale --------------------------------------------------------------------- +// @doc on + +// Scale an object along the x and y axis: +// +// @include scale( [ scale-x, scale-y, perspective, 3D-only ] ) +// +// where the 'scale-' arguments are unitless multipliers of the x and y dimensions +// and perspective, which works the same as the stand-alone perspective property/mixin +// but applies to the individual element (multiplied with any parent perspective) +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin scale( + $scale-x: $default-scale-x, + $scale-y: $scale-x, + $perspective: false, + $only3d: false +) { + $trans: scale($scale-x, $scale-y); + @if $perspective { $trans: perspective($perspective) $trans; } + @include transform($trans, $only3d); +} + +// Scale an object along the x axis +// @include scaleX( [ scale-x, perspective, 3D-only ] ) +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin scaleX( + $scale: $default-scale-x, + $perspective: false, + $only3d: false +) { + $trans: scaleX($scale); + @if $perspective { $trans: perspective($perspective) $trans; } + @include transform($trans, $only3d); +} + +// Scale an object along the y axis +// @include scaleY( [ scale-y, perspective, 3D-only ] ) +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin scaleY( + $scale: $default-scale-y, + $perspective: false, + $only3d: false +) { + $trans: scaleY($scale); + @if $perspective { $trans: perspective($perspective) $trans; } + @include transform($trans, $only3d); +} + +// Scale an object along the z axis +// @include scaleZ( [ scale-z, perspective ] ) +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin scaleZ( + $scale: $default-scale-z, + $perspective: false +) { + $trans: scaleZ($scale); + @if $perspective { $trans: perspective($perspective) $trans; } + @include transform3d($trans); +} + +// Scale and object along all three axis +// @include scale3d( [ scale-x, scale-y, scale-z, perspective ] ) +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin scale3d( + $scale-x: $default-scale-x, + $scale-y: $default-scale-y, + $scale-z: $default-scale-z, + $perspective: false +) { + $trans: scale3d($scale-x, $scale-y, $scale-z); + @if $perspective { $trans: perspective($perspective) $trans; } + @include transform3d($trans); +} + +// @doc off +// Rotate -------------------------------------------------------------------- +// @doc on + +// Rotate an object around the z axis (2D) +// @include rotate( [ rotation, perspective, 3D-only ] ) +// where 'rotation' is an angle set in degrees (deg) or radian (rad) units +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin rotate( + $rotate: $default-rotate, + $perspective: false, + $only3d: false +) { + $trans: rotate($rotate); + @if $perspective { $trans: perspective($perspective) $trans; } + @include transform($trans, $only3d); +} + +// A longcut for 'rotate' in case you forget that 'z' is implied +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin rotateZ( + $rotate: $default-rotate, + $perspective: false, + $only3d: false +) { + @include rotate($rotate, $perspective, $only3d); +} + +// Rotate an object around the x axis (3D) +// @include rotateX( [ rotation, perspective ] ) +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin rotateX( + $rotate: $default-rotate, + $perspective: false +) { + $trans: rotateX($rotate); + @if $perspective { $trans: perspective($perspective) $trans; } + @include transform3d($trans); +} + +// Rotate an object around the y axis (3D) +// @include rotate( [ rotation, perspective ] ) +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin rotateY( + $rotate: $default-rotate, + $perspective: false +) { + $trans: rotateY($rotate); + @if $perspective { $trans: perspective($perspective) $trans; } + @include transform3d($trans); +} + +// Rotate an object around an arbitrary axis (3D) +// @include rotate( [ vector-x, vector-y, vector-z, rotation, perspective ] ) +// where the 'vector-' arguments accept unitless numbers. +// These numbers are not important on their own, but in relation to one another +// creating an axis from your transform-origin, along the axis of Xx = Yy = Zz. +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin rotate3d( + $vector-x: $default-vector-x, + $vector-y: $default-vector-y, + $vector-z: $default-vector-z, + $rotate: $default-rotate, + $perspective: false +) { + $trans: rotate3d($vector-x, $vector-y, $vector-z, $rotate); + @if $perspective { $trans: perspective($perspective) $trans; } + @include transform3d($trans); +} + +// @doc off +// Translate ----------------------------------------------------------------- +// @doc on + +// Move an object along the x or y axis (2D) +// @include translate( [ translate-x, translate-y, perspective, 3D-only ] ) +// where the 'translate-' arguments accept any distance in percentages or absolute (px, cm, in, em etc..) units. +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin translate( + $translate-x: $default-translate-x, + $translate-y: $default-translate-y, + $perspective: false, + $only3d: false +) { + $trans: translate($translate-x, $translate-y); + @if $perspective { $trans: perspective($perspective) $trans; } + @include transform($trans, $only3d); +} + +// Move an object along the x axis (2D) +// @include translate( [ translate-x, perspective, 3D-only ] ) +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin translateX( + $trans-x: $default-translate-x, + $perspective: false, + $only3d: false +) { + $trans: translateX($trans-x); + @if $perspective { $trans: perspective($perspective) $trans; } + @include transform($trans, $only3d); +} + +// Move an object along the y axis (2D) +// @include translate( [ translate-y, perspective, 3D-only ] ) +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin translateY( + $trans-y: $default-translate-y, + $perspective: false, + $only3d: false +) { + $trans: translateY($trans-y); + @if $perspective { $trans: perspective($perspective) $trans; } + @include transform($trans, $only3d); +} + +// Move an object along the z axis (3D) +// @include translate( [ translate-z, perspective ] ) +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin translateZ( + $trans-z: $default-translate-z, + $perspective: false +) { + $trans: translateZ($trans-z); + @if $perspective { $trans: perspective($perspective) $trans; } + @include transform3d($trans); +} + +// Move an object along the x, y and z axis (3D) +// @include translate( [ translate-x, translate-y, translate-z, perspective ] ) +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin translate3d( + $translate-x: $default-translate-x, + $translate-y: $default-translate-y, + $translate-z: $default-translate-z, + $perspective: false +) { + $trans: translate3d($translate-x, $translate-y, $translate-z); + @if $perspective { $trans: perspective($perspective) $trans; } + @include transform3d($trans); +} + +// @doc off +// Skew ---------------------------------------------------------------------- +// @doc on + +// Skew an element: +// +// @include skew( [ skew-x, skew-y, 3D-only ] ) +// +// where the 'skew-' arguments accept css angles in degrees (deg) or radian (rad) units. +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin skew( + $skew-x: $default-skew-x, + $skew-y: $default-skew-y, + $only3d: false +) { + $trans: skew($skew-x, $skew-y); + @include transform($trans, $only3d); +} + +// Skew an element along the x axiz +// +// @include skew( [ skew-x, 3D-only ] ) +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin skewX( + $skew-x: $default-skew-x, + $only3d: false +) { + $trans: skewX($skew-x); + @include transform($trans, $only3d); +} + +// Skew an element along the y axis +// +// @include skew( [ skew-y, 3D-only ] ) +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin skewY( + $skew-y: $default-skew-y, + $only3d: false +) { + $trans: skewY($skew-y); + @include transform($trans, $only3d); +} + + +// Full transform mixins +// For settings any combination of transforms as arguments +// These are complex and not highly recommended for daily use. They are mainly +// here for backward-compatibility purposes. +// +// * they include origin adjustments +// * scale takes a multiplier (unitless), rotate and skew take degrees (deg) +// +// **Note** This mixin cannot be combined with other transform mixins. +@mixin create-transform( + $perspective: false, + $scale-x: false, + $scale-y: false, + $scale-z: false, + $rotate-x: false, + $rotate-y: false, + $rotate-z: false, + $rotate3d: false, + $trans-x: false, + $trans-y: false, + $trans-z: false, + $skew-x: false, + $skew-y: false, + $origin-x: false, + $origin-y: false, + $origin-z: false, + $only3d: false +) { + $trans: unquote(""); + + // perspective + @if $perspective { $trans: perspective($perspective) ; } + + // scale + @if $scale-x and $scale-y { + @if $scale-z { $trans: $trans scale3d($scale-x, $scale-y, $scale-z); } + @else { $trans: $trans scale($scale-x, $scale-y); } + } @else { + @if $scale-x { $trans: $trans scaleX($scale-x); } + @if $scale-y { $trans: $trans scaleY($scale-y); } + @if $scale-z { $trans: $trans scaleZ($scale-z); } + } + + // rotate + @if $rotate-x { $trans: $trans rotateX($rotate-x); } + @if $rotate-y { $trans: $trans rotateY($rotate-y); } + @if $rotate-z { $trans: $trans rotateZ($rotate-z); } + @if $rotate3d { $trans: $trans rotate3d($rotate3d); } + + // translate + @if $trans-x and $trans-y { + @if $trans-z { $trans: $trans translate3d($trans-x, $trans-y, $trans-z); } + @else { $trans: $trans translate($trans-x, $trans-y); } + } @else { + @if $trans-x { $trans: $trans translateX($trans-x); } + @if $trans-y { $trans: $trans translateY($trans-y); } + @if $trans-z { $trans: $trans translateZ($trans-z); } + } + + // skew + @if $skew-x and $skew-y { $trans: $trans skew($skew-x, $skew-y); } + @else { + @if $skew-x { $trans: $trans skewX($skew-x); } + @if $skew-y { $trans: $trans skewY($skew-y); } + } + + // apply it! + @include transform($trans, $only3d); + @include transform-origin($origin-x, $origin-y, $origin-z, $only3d); +} + + +// A simplified set of options +// backwards-compatible with the previous version of the 'transform' mixin +@mixin simple-transform( + $scale: false, + $rotate: false, + $trans-x: false, + $trans-y: false, + $skew-x: false, + $skew-y: false, + $origin-x: false, + $origin-y: false +) { + @include create-transform( + false, + $scale, $scale, false, + false, false, $rotate, false, + $trans-x, $trans-y, false, + $skew-x, $skew-y, + $origin-x, $origin-y, false, + false + ); +} diff --git a/scss/libs/compass/css3/_transition.scss b/scss/libs/compass/css3/_transition.scss new file mode 100755 index 0000000..4c4cb8c --- /dev/null +++ b/scss/libs/compass/css3/_transition.scss @@ -0,0 +1,221 @@ +@import "shared"; + +// CSS Transitions +// Currently only works in Webkit. +// +// * expected in CSS3, FireFox 3.6/7 and Opera Presto 2.3 +// * We'll be prepared. +// +// Including this submodule sets following defaults for the mixins: +// +// $default-transition-property : all +// $default-transition-duration : 1s +// $default-transition-function : false +// $default-transition-delay : false +// +// Override them if you like. Timing-function and delay are set to false for browser defaults (ease, 0s). + +$default-transition-property: all !default; + +$default-transition-duration: 1s !default; + +$default-transition-function: false !default; + +$default-transition-delay: false !default; + +$transitionable-prefixed-values: transform, transform-origin !default; + +// One or more properties to transition +// +// * for multiple, use a comma-delimited list +// * also accepts "all" or "none" + +@mixin transition-property($property-1: $default-transition-property, + $property-2 : false, + $property-3 : false, + $property-4 : false, + $property-5 : false, + $property-6 : false, + $property-7 : false, + $property-8 : false, + $property-9 : false, + $property-10: false +) { + @if type-of($property-1) == string { $property-1: unquote($property-1); } + $properties: compact($property-1, $property-2, $property-3, $property-4, $property-5, $property-6, $property-7, $property-8, $property-9, $property-10); + @if $experimental-support-for-webkit { -webkit-transition-property : prefixed-for-transition(-webkit, $properties); } + @if $experimental-support-for-mozilla { -moz-transition-property : prefixed-for-transition(-moz, $properties); } + @if $experimental-support-for-opera { -o-transition-property : prefixed-for-transition(-o, $properties); } + transition-property : $properties; +} + +// One or more durations in seconds +// +// * for multiple, use a comma-delimited list +// * these durations will affect the properties in the same list position + +@mixin transition-duration($duration-1: $default-transition-duration, + $duration-2 : false, + $duration-3 : false, + $duration-4 : false, + $duration-5 : false, + $duration-6 : false, + $duration-7 : false, + $duration-8 : false, + $duration-9 : false, + $duration-10: false +) { + @if type-of($duration-1) == string { $duration-1: unquote($duration-1); } + $durations: compact($duration-1, $duration-2, $duration-3, $duration-4, $duration-5, $duration-6, $duration-7, $duration-8, $duration-9, $duration-10); + @include experimental(transition-duration, $durations, + -moz, -webkit, -o, not -ms, not -khtml, official + ); +} + +// One or more timing functions +// +// * [ ease | linear | ease-in | ease-out | ease-in-out | cubic-bezier(x1, y1, x2, y2)] +// * For multiple, use a comma-delimited list +// * These functions will effect the properties in the same list position + +@mixin transition-timing-function($function-1: $default-transition-function, + $function-2 : false, + $function-3 : false, + $function-4 : false, + $function-5 : false, + $function-6 : false, + $function-7 : false, + $function-8 : false, + $function-9 : false, + $function-10: false +) { + $function-1: unquote($function-1); + $functions: compact($function-1, $function-2, $function-3, $function-4, $function-5, $function-6, $function-7, $function-8, $function-9, $function-10); + @include experimental(transition-timing-function, $functions, + -moz, -webkit, -o, not -ms, not -khtml, official + ); +} + +// One or more transition-delays in seconds +// +// * for multiple, use a comma-delimited list +// * these delays will effect the properties in the same list position + +@mixin transition-delay($delay-1: $default-transition-delay, + $delay-2 : false, + $delay-3 : false, + $delay-4 : false, + $delay-5 : false, + $delay-6 : false, + $delay-7 : false, + $delay-8 : false, + $delay-9 : false, + $delay-10: false +) { + @if type-of($delay-1) == string { $delay-1: unquote($delay-1); } + $delays: compact($delay-1, $delay-2, $delay-3, $delay-4, $delay-5, $delay-6, $delay-7, $delay-8, $delay-9, $delay-10); + @include experimental(transition-delay, $delays, + -moz, -webkit, -o, not -ms, not -khtml, official + ); +} + +// Transition all-in-one shorthand + +@mixin single-transition( + $property: $default-transition-property, + $duration: $default-transition-duration, + $function: $default-transition-function, + $delay: $default-transition-delay +) { + @include transition(compact($property $duration $function $delay)); +} + +@mixin transition( + $transition-1 : default, + $transition-2 : false, + $transition-3 : false, + $transition-4 : false, + $transition-5 : false, + $transition-6 : false, + $transition-7 : false, + $transition-8 : false, + $transition-9 : false, + $transition-10: false +) { + @if $transition-1 == default { + $transition-1 : compact($default-transition-property $default-transition-duration $default-transition-function $default-transition-delay); + } + $transitions: false; + @if type-of($transition-1) == list and type-of(nth($transition-1,1)) == list { + $transitions: join($transition-1, compact($transition-2, $transition-3, $transition-4, $transition-5, $transition-6, $transition-7, $transition-8, $transition-9, $transition-10), comma); + } @else { + $transitions : compact($transition-1, $transition-2, $transition-3, $transition-4, $transition-5, $transition-6, $transition-7, $transition-8, $transition-9, $transition-10); + } + $delays: comma-list(); + $has-delays: false; + $webkit-value: comma-list(); + $moz-value: comma-list(); + $o-value: comma-list(); + + // This block can be made considerably simpler at the point in time that + // we no longer need to deal with the differences in how delays are treated. + @each $transition in $transitions { + // Extract the values from the list + // (this would be cleaner if nth took a 3rd argument to provide a default value). + $property: nth($transition, 1); + $duration: false; + $timing-function: false; + $delay: false; + @if length($transition) > 1 { $duration: nth($transition, 2); } + @if length($transition) > 2 { $timing-function: nth($transition, 3); } + @if length($transition) > 3 { $delay: nth($transition, 4); $has-delays: true; } + + // If a delay is provided without a timing function + @if is-time($timing-function) and not $delay { $delay: $timing-function; $timing-function: false; $has-delays: true; } + + // Keep a list of delays in case one is specified + $delays: append($delays, if($delay, $delay, 0s)); + + $webkit-value: append($webkit-value, compact(prefixed-for-transition(-webkit, $property) $duration $timing-function)); + $moz-value: append( $moz-value, compact(prefixed-for-transition( -moz, $property) $duration $timing-function $delay)); + $o-value: append( $o-value, compact(prefixed-for-transition( -o, $property) $duration $timing-function $delay)); + } + + @if $experimental-support-for-webkit { -webkit-transition : $webkit-value; + // old webkit doesn't support the delay parameter in the shorthand so we progressively enhance it. + @if $has-delays { -webkit-transition-delay : $delays; } } + @if $experimental-support-for-mozilla { -moz-transition : $moz-value; } + @if $experimental-support-for-opera { -o-transition : $o-value; } + transition : $transitions; +} + +// coerce a list to be comma delimited or make a new, empty comma delimited list. +@function comma-list($list: ()) { + @return join((), $list, comma); +} + +// Returns `$property` with the given prefix if it is found in `$transitionable-prefixed-values`. +@function prefixed-for-transition($prefix, $property) { + @if type-of($property) == list { + $new-list: comma-list(); + @each $v in $property { + $new-list: append($new-list, prefixed-for-transition($prefix, $v)); + } + @return $new-list; + } @else { + @if index($transitionable-prefixed-values, $property) { + @return #{$prefix}-#{$property}; + } @else { + @return $property; + } + } +} + +// Checks if the value given is a unit of time. +@function is-time($value) { + @if type-of($value) == number { + @return not not index(s ms, unit($value)); + } @else { + @return false; + } +} diff --git a/scss/libs/compass/css3/_user-interface.scss b/scss/libs/compass/css3/_user-interface.scss new file mode 100755 index 0000000..e78b2fe --- /dev/null +++ b/scss/libs/compass/css3/_user-interface.scss @@ -0,0 +1,17 @@ +// User Interface ------------------------------------------------------------ +// This file can be expanded to handle all the user interface properties as +// they become available in browsers: +// http://www.w3.org/TR/2000/WD-css3-userint-20000216 +@import "shared"; + + +// This property controls the selection model and granularity of an element. +// +// @param $select +// [ none | text | toggle | element | elements | all | inherit ] +@mixin user-select($select) { + $select: unquote($select); + @include experimental(user-select, $select, + -moz, -webkit, not -o, not -ms, -khtml, official + ); +} diff --git a/scss/libs/compass/layout/_grid-background.scss b/scss/libs/compass/layout/_grid-background.scss new file mode 100755 index 0000000..e7e7306 --- /dev/null +++ b/scss/libs/compass/layout/_grid-background.scss @@ -0,0 +1,178 @@ +@import "compass/css3/images"; +@import "compass/css3/background-size"; + +// Set the color of your columns +$grid-background-column-color : rgba(100, 100, 225, 0.25) !default; +// Set the color of your gutters +$grid-background-gutter-color : rgba(0, 0, 0, 0) !default; + +// Set the total number of columns in your grid +$grid-background-total-columns : 24 !default; +// Set the width of your columns +$grid-background-column-width : 30px !default; +// Set the width of your gutters +$grid-background-gutter-width : 10px !default; +// Set the offset, if your columns are padded in from the container edge +$grid-background-offset : 0px !default; + +// Set the color of your baseline +$grid-background-baseline-color : rgba(0, 0, 0, 0.5) !default; +// Set the height of your baseline grid +$grid-background-baseline-height : 1.5em !default; + +// toggle your columns grids on and off +$show-column-grid-backgrounds : true !default; +// toggle your vertical grids on and off +$show-baseline-grid-backgrounds : true !default; +// toggle all your grids on and off +$show-grid-backgrounds : true !default; + +// optionally force your grid-image to remain fluid +// no matter what units you used to declared your grid. +$grid-background-force-fluid : false !default; + + +// Create the gradient needed for baseline grids +@function get-baseline-gradient( + $color : $grid-background-baseline-color +) { + $gradient: linear-gradient(bottom, $color 5%, rgba($color,0) 5%); + @return $gradient; +} + +// Create the color-stops needed for horizontal grids +@function build-grid-background( + $total : $grid-background-total-columns, + $column : $grid-background-column-width, + $gutter : $grid-background-gutter-width, + $offset : $grid-background-offset, + $column-color : $grid-background-column-color, + $gutter-color : $grid-background-gutter-color +) { + $grid: compact(); + $grid: append($grid, $gutter-color $offset, comma); + @for $i from 0 to $total { + + // $a represents the start of this column, initially equal to the offset + $a: $offset; + @if $i > 0 { $a: $a + (($column + $gutter) * $i); } + + // $g represents the start of this gutter, equal to $a plus one column-width + $g: $a + $column; + + // $z represents the end of a gutter, equal to $g plus one gutter-width + $z: $g + $gutter; + + @if (unit($a) == "%") and ($i == ($total - 1)) { + $z: 100%; + } + + // and we add this column/gutter pair to our grid + $grid: join($grid, ($column-color $a, $column-color $g, $gutter-color $g, $gutter-color $z)); + } + + @return $grid; +} + +// Return the gradient needed for horizontal grids +@function get-column-gradient( + $total : $grid-background-total-columns, + $column : $grid-background-column-width, + $gutter : $grid-background-gutter-width, + $offset : $grid-background-offset, + $column-color : $grid-background-column-color, + $gutter-color : $grid-background-gutter-color, + $force-fluid : $grid-background-force-fluid +) { + $grid: unquote(""); + + // don't force fluid grids when they are already fluid. + @if unit($column) == "%" { $force-fluid: false; } + + @if $force-fluid { + $grid: get-column-fluid-grid($total,$column,$gutter,$offset,$column-color,$gutter-color); + } @else { + $grid: build-grid-background($total,$column,$gutter,$offset,$column-color,$gutter-color); + } + + // return the horizontal grid as a gradient + $gradient: linear-gradient(left, $grid); + @return $gradient; +} + +// Convert a grid from fixed units into percentages. +@function get-column-fluid-grid( + $total : $grid-background-total-columns, + $column : $grid-background-column-width, + $gutter : $grid-background-gutter-width, + $offset : $grid-background-offset, + $column-color : $grid-background-column-color, + $gutter-color : $grid-background-gutter-color +) { + $context: ($column * $total) + ($gutter * ($total - 1) + ($offset * 2)); + $offset: $offset / $context * 100%; + $column: $column / $context * 100%; + $gutter: $gutter / $context * 100%; + + // return the horizontal grid as a set of color-stops + $grid: build-grid-background($total,$column,$gutter,$offset,$column-color,$gutter-color); + @return $grid; +} + + +// Add just the baseline grid to an element's background +@mixin baseline-grid-background( + $baseline : $grid-background-baseline-height, + $color : $grid-background-baseline-color +) { + @if $show-grid-backgrounds and $show-baseline-grid-backgrounds { + @include background-image(get-baseline-gradient($color)); + @include background-size(100% $baseline); + background-position: left top; + } +} + +// Add just the horizontal grid to an element's background +@mixin column-grid-background( + $total : $grid-background-total-columns, + $column : $grid-background-column-width, + $gutter : $grid-background-gutter-width, + $offset : $grid-background-offset, + $column-color : $grid-background-column-color, + $gutter-color : $grid-background-gutter-color, + $force-fluid : $grid-background-force-fluid +) { + @if $show-grid-backgrounds and $show-column-grid-backgrounds { + @include background-image( + get-column-gradient($total,$column,$gutter,$offset,$column-color,$gutter-color, $force-fluid) + ); + background-position: left top; + } +} + +// Add both horizontal and baseline grids to an element's background +@mixin grid-background( + $total : $grid-background-total-columns, + $column : $grid-background-column-width, + $gutter : $grid-background-gutter-width, + $baseline : $grid-background-baseline-height, + $offset : $grid-background-offset, + $column-color : $grid-background-column-color, + $gutter-color : $grid-background-gutter-color, + $baseline-color : $grid-background-baseline-color, + $force-fluid : $grid-background-force-fluid +) { + @if $show-grid-backgrounds { + @if $show-baseline-grid-backgrounds and $show-column-grid-backgrounds { + @include background-image( + get-baseline-gradient($baseline-color), + get-column-gradient($total,$column,$gutter,$offset,$column-color,$gutter-color, $force-fluid) + ); + @include background-size(100% $baseline, auto); + background-position: left top; + } @else { + @include baseline-grid-background($baseline, $baseline-color); + @include column-grid-background($total,$column,$gutter,$offset,$column-color,$gutter-color, $force-fluid); + } + } +} diff --git a/scss/libs/compass/layout/_sticky-footer.scss b/scss/libs/compass/layout/_sticky-footer.scss new file mode 100755 index 0000000..055f641 --- /dev/null +++ b/scss/libs/compass/layout/_sticky-footer.scss @@ -0,0 +1,23 @@ +// Based on a [blog post by Ryan Fait](http://ryanfait.com/resources/footer-stick-to-bottom-of-page/). +// +// Must be mixed into the top level of your stylesheet. +// +// Footer element must be outside of root wrapper element. +// +// Footer must be a fixed height. + +@mixin sticky-footer($footer-height, $root-selector: unquote("#root"), $root-footer-selector: unquote("#root_footer"), $footer-selector: unquote("#footer")) { + html, body { + height: 100%; } + #{$root-selector} { + clear: both; + min-height: 100%; + height: auto !important; + height: 100%; + margin-bottom: -$footer-height; + #{$root-footer-selector} { + height: $footer-height; } } + #{$footer-selector} { + clear: both; + position: relative; + height: $footer-height; } } diff --git a/scss/libs/compass/layout/_stretching.scss b/scss/libs/compass/layout/_stretching.scss new file mode 100755 index 0000000..c123e3d --- /dev/null +++ b/scss/libs/compass/layout/_stretching.scss @@ -0,0 +1,24 @@ + +// stretch element height to specified top and bottom position + +@mixin stretch-y($offset-top:0, $offset-bottom:0) { + @include stretch($offset-top, false, $offset-bottom, false); +} + + +// stretch element width to specified left and right position + +@mixin stretch-x($offset-left:0, $offset-right:0) { + @include stretch(false, $offset-right, false, $offset-left); +} + + +// shorthand to stretch element height and width + +@mixin stretch($offset-top:0, $offset-right:0, $offset-bottom:0, $offset-left:0) { + position: absolute; + @if $offset-top { top: $offset-top; } + @if $offset-bottom { bottom: $offset-bottom; } + @if $offset-left { left: $offset-left; } + @if $offset-right { right: $offset-right; } +} \ No newline at end of file diff --git a/scss/libs/compass/reset/_utilities-legacy.scss b/scss/libs/compass/reset/_utilities-legacy.scss new file mode 100755 index 0000000..8273ca3 --- /dev/null +++ b/scss/libs/compass/reset/_utilities-legacy.scss @@ -0,0 +1,135 @@ +// Based on [Eric Meyer's reset](http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/) +// Global reset rules. +// For more specific resets, use the reset mixins provided below +// +// *Please Note*: tables still need `cellspacing="0"` in the markup. +@mixin global-reset { + html, body, div, span, applet, object, iframe, + h1, h2, h3, h4, h5, h6, p, blockquote, pre, + a, abbr, acronym, address, big, cite, code, + del, dfn, em, font, img, ins, kbd, q, s, samp, + small, strike, strong, sub, sup, tt, var, + dl, dt, dd, ol, ul, li, + fieldset, form, label, legend, + table, caption, tbody, tfoot, thead, tr, th, td { + @include reset-box-model; + @include reset-font; } + body { + @include reset-body; } + ol, ul { + @include reset-list-style; } + table { + @include reset-table; } + caption, th, td { + @include reset-table-cell; } + q, blockquote { + @include reset-quotation; } + a img { + @include reset-image-anchor-border; } } + +// Reset all elements within some selector scope. To reset the selector itself, +// mixin the appropriate reset mixin for that element type as well. This could be +// useful if you want to style a part of your page in a dramatically different way. +// +// *Please Note*: tables still need `cellspacing="0"` in the markup. +@mixin nested-reset { + div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, + pre, a, abbr, acronym, address, code, del, dfn, em, img, + dl, dt, dd, ol, ul, li, fieldset, form, label, legend, caption, tbody, tfoot, thead, tr { + @include reset-box-model; + @include reset-font; } + table { + @include reset-table; } + caption, th, td { + @include reset-table-cell; } + q, blockquote { + @include reset-quotation; } + a img { + @include reset-image-anchor-border; } } + +// Reset the box model measurements. +@mixin reset-box-model { + margin: 0; + padding: 0; + border: 0; + outline: 0; } + +// Reset the font and vertical alignment. +@mixin reset-font { + font: { + weight: inherit; + style: inherit; + size: 100%; + family: inherit; }; + vertical-align: baseline; } + +// Resets the outline when focus. +// For accessibility you need to apply some styling in its place. +@mixin reset-focus { + outline: 0; } + +// Reset a body element. +@mixin reset-body { + line-height: 1; + color: black; + background: white; } + +// Reset the list style of an element. +@mixin reset-list-style { + list-style: none; } + +// Reset a table +@mixin reset-table { + border-collapse: separate; + border-spacing: 0; + vertical-align: middle; } + +// Reset a table cell (`th`, `td`) +@mixin reset-table-cell { + text-align: left; + font-weight: normal; + vertical-align: middle; } + +// Reset a quotation (`q`, `blockquote`) +@mixin reset-quotation { + quotes: "" ""; + &:before, &:after { + content: ""; } } + +// Resets the border. +@mixin reset-image-anchor-border { + border: none; } + +// Unrecognized elements are displayed inline. +// This reset provides a basic reset for html5 elements +// so they are rendered correctly in browsers that don't recognize them +// and reset in browsers that have default styles for them. +@mixin reset-html5 { + #{elements-of-type(html5-block)} { + @include reset-box-model; + display: block; } } + +// Resets the display of inline and block elements to their default display +// according to their tag type. Elements that have a default display that varies across +// versions of html or browser are not handled here, but this covers the 90% use case. +// Usage Example: +// +// // Turn off the display for both of these classes +// .unregistered-only, .registered-only +// display: none +// // Now turn only one of them back on depending on some other context. +// body.registered +// +reset-display(".registered-only") +// body.unregistered +// +reset-display(".unregistered-only") +@mixin reset-display($selector: "", $important: false) { + #{append-selector(elements-of-type("inline"), $selector)} { + @if $important { + display: inline !important; } + @else { + display: inline; } } + #{append-selector(elements-of-type("block"), $selector)} { + @if $important { + display: block !important; } + @else { + display: block; } } } diff --git a/scss/libs/compass/reset/_utilities.scss b/scss/libs/compass/reset/_utilities.scss new file mode 100755 index 0000000..d173f3e --- /dev/null +++ b/scss/libs/compass/reset/_utilities.scss @@ -0,0 +1,142 @@ +// Based on [Eric Meyer's reset 2.0](http://meyerweb.com/eric/tools/css/reset/index.html) +// Global reset rules. +// For more specific resets, use the reset mixins provided below +@mixin global-reset { + html, body, div, span, applet, object, iframe, + h1, h2, h3, h4, h5, h6, p, blockquote, pre, + a, abbr, acronym, address, big, cite, code, + del, dfn, em, img, ins, kbd, q, s, samp, + small, strike, strong, sub, sup, tt, var, + b, u, i, center, + dl, dt, dd, ol, ul, li, + fieldset, form, label, legend, + table, caption, tbody, tfoot, thead, tr, th, td, + article, aside, canvas, details, embed, + figure, figcaption, footer, header, hgroup, + menu, nav, output, ruby, section, summary, + time, mark, audio, video { + @include reset-box-model; + @include reset-font; } + // Unlike Eric's original reset, we reset the html element to be compatible + // with the vertical rhythm mixins. + html { + @include reset-body; } + ol, ul { + @include reset-list-style; } + table { + @include reset-table; } + caption, th, td { + @include reset-table-cell; } + q, blockquote { + @include reset-quotation; } + a img { + @include reset-image-anchor-border; } + @include reset-html5; } + +// Reset all elements within some selector scope. To reset the selector itself, +// mixin the appropriate reset mixin for that element type as well. This could be +// useful if you want to style a part of your page in a dramatically different way. +@mixin nested-reset { + div, span, applet, object, iframe, + h1, h2, h3, h4, h5, h6, p, blockquote, pre, + a, abbr, acronym, address, big, cite, code, + del, dfn, em, img, ins, kbd, q, s, samp, + small, strike, strong, sub, sup, tt, var, + b, u, i, center, + dl, dt, dd, ol, ul, li, + fieldset, form, label, legend, + table, caption, tbody, tfoot, thead, tr, th, td, + article, aside, canvas, details, embed, + figure, figcaption, footer, header, hgroup, + menu, nav, output, ruby, section, summary, + time, mark, audio, video { + @include reset-box-model; + @include reset-font; } + table { + @include reset-table; } + caption, th, td { + @include reset-table-cell; } + q, blockquote { + @include reset-quotation; } + a img { + @include reset-image-anchor-border; } } + +// Reset the box model measurements. +@mixin reset-box-model { + margin: 0; + padding: 0; + border: 0; } + +// Reset the font and vertical alignment. +@mixin reset-font { + font: inherit; + font-size: 100%; + vertical-align: baseline; } + +// Resets the outline when focus. +// For accessibility you need to apply some styling in its place. +@mixin reset-focus { + outline: 0; } + +// Reset a body element. +@mixin reset-body { + line-height: 1; } + +// Reset the list style of an element. +@mixin reset-list-style { + list-style: none; } + +// Reset a table +@mixin reset-table { + border-collapse: collapse; + border-spacing: 0; } + +// Reset a table cell (`th`, `td`) +@mixin reset-table-cell { + text-align: left; + font-weight: normal; + vertical-align: middle; } + +// Reset a quotation (`q`, `blockquote`) +@mixin reset-quotation { + quotes: none; + &:before, &:after { + content: ""; + content: none; } } + +// Resets the border. +@mixin reset-image-anchor-border { + border: none; } + +// Unrecognized elements are displayed inline. +// This reset provides a basic reset for block html5 elements +// so they are rendered correctly in browsers that don't recognize them +// and reset in browsers that have default styles for them. +@mixin reset-html5 { + #{elements-of-type(html5-block)} { + display: block; } } + +// Resets the display of inline and block elements to their default display +// according to their tag type. Elements that have a default display that varies across +// versions of html or browser are not handled here, but this covers the 90% use case. +// Usage Example: +// +// // Turn off the display for both of these classes +// .unregistered-only, .registered-only +// display: none +// // Now turn only one of them back on depending on some other context. +// body.registered +// +reset-display(".registered-only") +// body.unregistered +// +reset-display(".unregistered-only") +@mixin reset-display($selector: "", $important: false) { + #{append-selector(elements-of-type("inline"), $selector)} { + @if $important { + display: inline !important; } + @else { + display: inline; } } + #{append-selector(elements-of-type("block"), $selector)} { + @if $important { + display: block !important; } + @else { + display: block; } } } diff --git a/scss/libs/compass/typography/_links.scss b/scss/libs/compass/typography/_links.scss new file mode 100755 index 0000000..735000e --- /dev/null +++ b/scss/libs/compass/typography/_links.scss @@ -0,0 +1,3 @@ +@import "links/hover-link"; +@import "links/link-colors"; +@import "links/unstyled-link"; diff --git a/scss/libs/compass/typography/_lists.scss b/scss/libs/compass/typography/_lists.scss new file mode 100755 index 0000000..3365f30 --- /dev/null +++ b/scss/libs/compass/typography/_lists.scss @@ -0,0 +1,4 @@ +@import "lists/horizontal-list"; +@import "lists/inline-list"; +@import "lists/inline-block-list"; +@import "lists/bullets"; diff --git a/scss/libs/compass/typography/_text.scss b/scss/libs/compass/typography/_text.scss new file mode 100755 index 0000000..885f729 --- /dev/null +++ b/scss/libs/compass/typography/_text.scss @@ -0,0 +1,4 @@ +@import "text/ellipsis"; +@import "text/nowrap"; +@import "text/replacement"; +@import "text/force-wrap"; diff --git a/scss/libs/compass/typography/_vertical_rhythm.scss b/scss/libs/compass/typography/_vertical_rhythm.scss new file mode 100755 index 0000000..999d1fb --- /dev/null +++ b/scss/libs/compass/typography/_vertical_rhythm.scss @@ -0,0 +1,221 @@ +@import "compass/layout/grid-background"; + +// The base font size. +$base-font-size: 16px !default; + +// The base line height determines the basic unit of vertical rhythm. +$base-line-height: 24px !default; + +// Set the default border style for rhythm borders. +$default-rhythm-border-style: solid !default; + +// The default font size in all browsers. +$browser-default-font-size: 16px; + +// Set to false if you want to use absolute pixels in sizing your typography. +$relative-font-sizing: true !default; + +// Allows the `adjust-font-size-to` mixin and the `lines-for-font-size` function +// to round the line height to the nearest half line height instead of the +// nearest integral line height to avoid large spacing between lines. +$round-to-nearest-half-line: false !default; + +// Ensure there is at least this many pixels +// of vertical padding above and below the text. +$min-line-padding: 2px !default; + +// $base-font-size but in your output unit of choice. +// Defaults to 1em when `$relative-font-sizing` is true. +$font-unit: if($relative-font-sizing, 1em, $base-font-size) !default; + +// The basic unit of font rhythm. +$base-rhythm-unit: $base-line-height / $base-font-size * $font-unit; + +// The leader is the amount of whitespace in a line. +// It might be useful in your calculations. +$base-leader: ($base-line-height - $base-font-size) * $font-unit / $base-font-size; + +// The half-leader is the amount of whitespace above and below a line. +// It might be useful in your calculations. +$base-half-leader: $base-leader / 2; + +// True if a number has a relative unit. +@function relative-unit($number) { + @return unit($number) == "%" or unit($number) == "em" or unit($number) == "rem" +} + +// True if a number has an absolute unit. +@function absolute-unit($number) { + @return not (relative-unit($number) or unitless($number)); +} + +@if $relative-font-sizing and not relative-unit($font-unit) { + @warn "$relative-font-sizing is true but $font-unit is set to #{$font-unit} which is not a relative unit."; +} + +// Establishes a font baseline for the given font-size. +@mixin establish-baseline($font-size: $base-font-size) { + // IE 6 refuses to resize fonts set in pixels and it weirdly resizes fonts + // whose root is set in ems. So we set the root font size in percentages of + // the default font size. + * html { + font-size: 100% * ($font-size / $browser-default-font-size); + } + html { + font-size: $font-size; + @include adjust-leading-to(1, if($relative-font-sizing, $font-size, $base-font-size)); + } +} + +// Resets the line-height to 1 vertical rhythm unit. +// Does not work on elements whose font-size is different from $base-font-size. +// +// @deprecated This mixin will be removed in the next release. +// Please use the `adjust-leading-to` mixin instead. +@mixin reset-baseline { + @include adjust-leading-to(1, if($relative-font-sizing, $base-font-size, $base-font-size)); +} + +// Show a background image that can be used to debug your alignments. +// Include the $img argument if you would rather use your own image than the +// Compass default gradient image. +@mixin debug-vertical-alignment($img: false) { + @if $img { + background: image-url($img); + } @else { + @include baseline-grid-background($base-rhythm-unit); + } +} + +// Adjust a block to have a different font size and line height to maintain the +// rhythm. $lines specifies how many multiples of the baseline rhythm each line +// of this font should use up. It does not have to be an integer, but it +// defaults to the smallest integer that is large enough to fit the font. +// Use $from-size to adjust from a font-size other than the base font-size. +@mixin adjust-font-size-to($to-size, $lines: lines-for-font-size($to-size), $from-size: $base-font-size) { + @if not $relative-font-sizing and $from-size != $base-font-size { + @warn "$relative-font-sizing is false but a relative font size was passed to adjust-font-size-to"; + } + font-size: $font-unit * $to-size / $from-size; + @include adjust-leading-to($lines, if($relative-font-sizing, $to-size, $base-font-size)); +} + +// Adjust a block to have different line height to maintain the rhythm. +// $lines specifies how many multiples of the baseline rhythm each line of this +// font should use up. It does not have to be an integer, but it defaults to the +// smallest integer that is large enough to fit the font. +@mixin adjust-leading-to($lines, $font-size: $base-font-size) { + line-height: rhythm($lines, $font-size); +} + +// Calculate rhythm units. +@function rhythm( + $lines: 1, + $font-size: $base-font-size, + $offset: 0 +) { + @if not $relative-font-sizing and $font-size != $base-font-size { + @warn "$relative-font-sizing is false but a relative font size was passed to the rhythm function"; + } + $rhythm: $font-unit * ($lines * $base-line-height - $offset) / $font-size; + // Round the pixels down to nearest integer. + @if unit($rhythm) == px { + $rhythm: floor($rhythm); + } + @return $rhythm; +} + +// Calculate the minimum multiple of rhythm units needed to contain the font-size. +@function lines-for-font-size($font-size) { + $lines: if($round-to-nearest-half-line, + ceil(2 * $font-size / $base-line-height) / 2, + ceil($font-size / $base-line-height)); + @if $lines * $base-line-height - $font-size < $min-line-padding * 2 { + $lines: $lines + if($round-to-nearest-half-line, 0.5, 1); + } + @return $lines; +} + +// Apply leading whitespace. The $property can be margin or padding. +@mixin leader($lines: 1, $font-size: $base-font-size, $property: margin) { + #{$property}-top: rhythm($lines, $font-size); +} + +// Apply leading whitespace as padding. +@mixin padding-leader($lines: 1, $font-size: $base-font-size) { + padding-top: rhythm($lines, $font-size); +} + +// Apply leading whitespace as margin. +@mixin margin-leader($lines: 1, $font-size: $base-font-size) { + margin-top: rhythm($lines, $font-size); +} + +// Apply trailing whitespace. The $property can be margin or padding. +@mixin trailer($lines: 1, $font-size: $base-font-size, $property: margin) { + #{$property}-bottom: rhythm($lines, $font-size); +} + +// Apply trailing whitespace as padding. +@mixin padding-trailer($lines: 1, $font-size: $base-font-size) { + padding-bottom: rhythm($lines, $font-size); +} + +// Apply trailing whitespace as margin. +@mixin margin-trailer($lines: 1, $font-size: $base-font-size) { + margin-bottom: rhythm($lines, $font-size); +} + +// Shorthand mixin to apply whitespace for top and bottom margins and padding. +@mixin rhythm($leader: 0, $padding-leader: 0, $padding-trailer: 0, $trailer: 0, $font-size: $base-font-size) { + @include leader($leader, $font-size); + @include padding-leader($padding-leader, $font-size); + @include padding-trailer($padding-trailer, $font-size); + @include trailer($trailer, $font-size); +} + +// Apply a border and whitespace to any side without destroying the vertical +// rhythm. The whitespace must be greater than the width of the border. +@mixin apply-side-rhythm-border($side, $width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) { + @if not $relative-font-sizing and $font-size != $base-font-size { + @warn "$relative-font-sizing is false but a relative font size was passed to apply-side-rhythm-border"; + } + border-#{$side}: { + style: $border-style; + width: $font-unit * $width / $font-size; + }; + padding-#{$side}: rhythm($lines, $font-size, $offset: $width); +} + +// Apply borders and whitespace equally to all sides. +@mixin rhythm-borders($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) { + @if not $relative-font-sizing and $font-size != $base-font-size { + @warn "$relative-font-sizing is false but a relative font size was passed to rhythm-borders"; + } + border: { + style: $border-style; + width: $font-unit * $width / $font-size; + }; + padding: rhythm($lines, $font-size, $offset: $width); +} + +// Apply a leading border. +@mixin leading-border($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) { + @include apply-side-rhythm-border(top, $width, $lines, $font-size, $border-style); +} + +// Apply a trailing border. +@mixin trailing-border($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) { + @include apply-side-rhythm-border(bottom, $width, $lines, $font-size, $border-style); +} + +// Apply both leading and trailing borders. +@mixin horizontal-borders($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) { + @include leading-border($width, $lines, $font-size, $border-style); + @include trailing-border($width, $lines, $font-size, $border-style); +} + +// Alias for `horizontal-borders` mixin. +@mixin h-borders($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) { + @include horizontal-borders($width, $lines, $font-size, $border-style); +} diff --git a/scss/libs/compass/typography/links/_hover-link.scss b/scss/libs/compass/typography/links/_hover-link.scss new file mode 100755 index 0000000..8c72bc1 --- /dev/null +++ b/scss/libs/compass/typography/links/_hover-link.scss @@ -0,0 +1,5 @@ +// a link that only has an underline when you hover over it +@mixin hover-link { + text-decoration: none; + &:hover { + text-decoration: underline; } } diff --git a/scss/libs/compass/typography/links/_link-colors.scss b/scss/libs/compass/typography/links/_link-colors.scss new file mode 100755 index 0000000..5d641f7 --- /dev/null +++ b/scss/libs/compass/typography/links/_link-colors.scss @@ -0,0 +1,28 @@ +// Set all the colors for a link with one mixin call. +// Order of arguments is: +// +// 1. normal +// 2. hover +// 3. active +// 4. visited +// 5. focus +// +// Those states not specified will inherit. +// Mixin to an anchor link like so: +// a +// +link-colors(#00c, #0cc, #c0c, #ccc, #cc0) + +@mixin link-colors($normal, $hover: false, $active: false, $visited: false, $focus: false) { + color: $normal; + @if $visited { + &:visited { + color: $visited; } } + @if $focus { + &:focus { + color: $focus; } } + @if $hover { + &:hover { + color: $hover; } } + @if $active { + &:active { + color: $active; } } } diff --git a/scss/libs/compass/typography/links/_unstyled-link.scss b/scss/libs/compass/typography/links/_unstyled-link.scss new file mode 100755 index 0000000..e39c2d6 --- /dev/null +++ b/scss/libs/compass/typography/links/_unstyled-link.scss @@ -0,0 +1,7 @@ +// A link that looks and acts like the text it is contained within +@mixin unstyled-link { + color: inherit; + text-decoration: inherit; + cursor: inherit; + &:active, &:focus { + outline: none; } } diff --git a/scss/libs/compass/typography/lists/_bullets.scss b/scss/libs/compass/typography/lists/_bullets.scss new file mode 100755 index 0000000..958eefc --- /dev/null +++ b/scss/libs/compass/typography/lists/_bullets.scss @@ -0,0 +1,34 @@ +// Turn off the bullet for an element of a list +@mixin no-bullet { + list-style-image : none; + list-style-type : none; + margin-left : 0; +} + +// turns off the bullets for an entire list +@mixin no-bullets { + list-style: none; + li { @include no-bullet; } +} + +// Make a list(ul/ol) have an image bullet. +// +// The mixin should be used like this for an icon that is 5x7: +// +// ul.pretty +// +pretty-bullets("my-icon.png", 5px, 7px) +// +// Additionally, if the image dimensions are not provided, +// The image dimensions will be extracted from the image itself. +// +// ul.pretty +// +pretty-bullets("my-icon.png") +// +@mixin pretty-bullets($bullet-icon, $width: image-width($bullet-icon), $height: image-height($bullet-icon), $line-height: 18px, $padding: 14px) { + margin-left: 0; + li { + padding-left: $padding; + background: image-url($bullet-icon) no-repeat ($padding - $width) / 2 ($line-height - $height) / 2; + list-style-type: none; + } +} diff --git a/scss/libs/compass/typography/lists/_horizontal-list.scss b/scss/libs/compass/typography/lists/_horizontal-list.scss new file mode 100755 index 0000000..159b659 --- /dev/null +++ b/scss/libs/compass/typography/lists/_horizontal-list.scss @@ -0,0 +1,61 @@ +// Horizontal list layout module. +// +// Easy mode using simple descendant li selectors: +// +// ul.nav +// +horizontal-list +// +// Advanced mode: +// If you need to target the list items using a different selector then use +// +horizontal-list-container on your ul/ol and +horizontal-list-item on your li. +// This may help when working on layouts involving nested lists. For example: +// +// ul.nav +// +horizontal-list-container +// > li +// +horizontal-list-item + +@import "bullets"; +@import "compass/utilities/general/clearfix"; +@import "compass/utilities/general/reset"; +@import "compass/utilities/general/float"; + +// Can be mixed into any selector that target a ul or ol that is meant +// to have a horizontal layout. Used to implement +horizontal-list. +@mixin horizontal-list-container { + @include reset-box-model; + @include clearfix; } + +// Can be mixed into any li selector that is meant to participate in a horizontal layout. +// Used to implement +horizontal-list. +// +// :last-child is not fully supported +// see http://www.quirksmode.org/css/contents.html#t29 for the support matrix +// +// IE8 ignores rules that are included on the same line as :last-child +// see http://www.richardscarrott.co.uk/posts/view/ie8-last-child-bug for details +// +// Setting `$padding` to `false` disables the padding between list elements +@mixin horizontal-list-item($padding: 4px, $direction: left) { + @include no-bullet; + white-space: nowrap; + @include float($direction); + @if $padding { + padding: { + left: $padding; + right: $padding; + } + &:first-child, &.first { padding-#{$direction}: 0; } + &:last-child { padding-#{opposite-position($direction)}: 0; } + &.last { padding-#{opposite-position($direction)}: 0; } + } +} + +// A list(ol,ul) that is layed out such that the elements are floated left and won't wrap. +// This is not an inline list. +// +// Setting `$padding` to `false` disables the padding between list elements +@mixin horizontal-list($padding: 4px, $direction: left) { + @include horizontal-list-container; + li { + @include horizontal-list-item($padding, $direction); } } diff --git a/scss/libs/compass/typography/lists/_inline-block-list.scss b/scss/libs/compass/typography/lists/_inline-block-list.scss new file mode 100755 index 0000000..7c698c9 --- /dev/null +++ b/scss/libs/compass/typography/lists/_inline-block-list.scss @@ -0,0 +1,50 @@ +// Inline-Block list layout module. +// +// Easy mode using simple descendant li selectors: +// +// ul.nav { +// @import inline-block-list; +// } +// +// Advanced mode: +// If you need to target the list items using a different selector then use +// `@include inline-block-list-container` on your ul/ol and +// `@include inline-block-list-item` on your li. This may help when working +// on layouts involving nested lists. For example: +// +// ul.nav { +// @include inline-block-list-container; +// > li { +// @include inline-block-list-item; +// } +// } + +@import "bullets"; +@import "horizontal-list"; +@import "compass/utilities/general/float"; +@import "compass/css3/inline-block"; + +// Can be mixed into any selector that target a ul or ol that is meant +// to have an inline-block layout. Used to implement `inline-block-list`. +@mixin inline-block-list-container { + @include horizontal-list-container; } + +// Can be mixed into any li selector that is meant to participate in a horizontal layout. +// Used to implement `inline-block-list`. +@mixin inline-block-list-item($padding: false) { + @include no-bullet; + @include inline-block; + white-space: nowrap; + @if $padding { + padding: { + left: $padding; + right: $padding; + }; + } +} + +// A list(ol,ul) that is layed out such that the elements are inline-block and won't wrap. +@mixin inline-block-list($padding: false) { + @include inline-block-list-container; + li { + @include inline-block-list-item($padding); } } diff --git a/scss/libs/compass/typography/lists/_inline-list.scss b/scss/libs/compass/typography/lists/_inline-list.scss new file mode 100755 index 0000000..caff6fd --- /dev/null +++ b/scss/libs/compass/typography/lists/_inline-list.scss @@ -0,0 +1,44 @@ +// makes a list inline. + +@mixin inline-list { + list-style-type: none; + &, & li { + margin: 0px; + padding: 0px; + display: inline; + } +} + +// makes an inline list delimited with the passed string. +// Defaults to making a comma-separated list. +// +// Please make note of the browser support issues before using this mixin: +// +// use of `content` and `:after` is not fully supported in all browsers. +// See quirksmode for the [support matrix](http://www.quirksmode.org/css/contents.html#t15) +// +// `:last-child` is not fully supported. +// see quirksmode for the [support matrix](http://www.quirksmode.org/css/contents.html#t29). +// +// IE8 ignores rules that are included on the same line as :last-child +// see http://www.richardscarrott.co.uk/posts/view/ie8-last-child-bug for details + +@mixin delimited-list($separator: ", ") { + @include inline-list; + li { + &:after { content: $separator; } + &:last-child { + &:after { content: ""; } + } + &.last { + &:after { content: ""; } + } + } +} + +// See [delimited-list](#mixin-delimited-list) +// @deprecated +@mixin comma-delimited-list { + @warn "comma-delimited-list is deprecated. Please use delimited-list instead."; + @include delimited-list; +} diff --git a/scss/libs/compass/typography/text/_ellipsis.scss b/scss/libs/compass/typography/text/_ellipsis.scss new file mode 100755 index 0000000..3b3db25 --- /dev/null +++ b/scss/libs/compass/typography/text/_ellipsis.scss @@ -0,0 +1,25 @@ +@import "compass/css3/shared"; + +// To get full firefox support, you must install the ellipsis pattern: +// +// compass install compass/ellipsis +$use-mozilla-ellipsis-binding: false !default; + +// This technique, by [Justin Maxwell](http://code404.com/), was originally +// published [here](http://mattsnider.com/css/css-string-truncation-with-ellipsis/). +// Firefox implementation by [Rikkert Koppes](http://www.rikkertkoppes.com/thoughts/2008/6/). +@mixin ellipsis($no-wrap: true) { + @if $no-wrap { white-space: nowrap; } + overflow: hidden; + @include experimental(text-overflow, ellipsis, + not -moz, + not -webkit, + -o, + -ms, + not -khtml, + official + ); + @if $experimental-support-for-mozilla and $use-mozilla-ellipsis-binding { + -moz-binding: stylesheet-url(unquote("xml/ellipsis.xml#ellipsis")); + } +} diff --git a/scss/libs/compass/typography/text/_force-wrap.scss b/scss/libs/compass/typography/text/_force-wrap.scss new file mode 100755 index 0000000..8a14e8f --- /dev/null +++ b/scss/libs/compass/typography/text/_force-wrap.scss @@ -0,0 +1,12 @@ +// Prevent long urls and text from breaking layouts +// [originally from perishablepress.com](http://perishablepress.com/press/2010/06/01/wrapping-content/) +@mixin force-wrap { + white-space: pre; // CSS 2.0 + white-space: pre-wrap; // CSS 2.1 + white-space: pre-line; // CSS 3.0 + white-space: -pre-wrap; // Opera 4-6 + white-space: -o-pre-wrap; // Opera 7 + white-space: -moz-pre-wrap; // Mozilla + white-space: -hp-pre-wrap; // HP Printers + word-wrap: break-word; // IE 5+ +} diff --git a/scss/libs/compass/typography/text/_nowrap.scss b/scss/libs/compass/typography/text/_nowrap.scss new file mode 100755 index 0000000..1613dd6 --- /dev/null +++ b/scss/libs/compass/typography/text/_nowrap.scss @@ -0,0 +1,2 @@ +// When remembering whether or not there's a hyphen in white-space is too hard +@mixin nowrap { white-space: nowrap; } diff --git a/scss/libs/compass/typography/text/_replacement.scss b/scss/libs/compass/typography/text/_replacement.scss new file mode 100755 index 0000000..703571b --- /dev/null +++ b/scss/libs/compass/typography/text/_replacement.scss @@ -0,0 +1,68 @@ +// Indicates the direction you prefer to move your text +// when hiding it. +// +// `left` is more robust, especially in older browsers. +// `right` seems have better runtime performance. +$hide-text-direction: left !default; + +// Hides html text and replaces it with an image. +// If you use this on an inline element, you will need to change the display to block or inline-block. +// Also, if the size of the image differs significantly from the font size, you'll need to set the width and/or height. +// +// Parameters: +// +// * `img` -- the relative path from the project image directory to the image, or a url literal. +// * `x` -- the x position of the background image. +// * `y` -- the y position of the background image. +@mixin replace-text($img, $x: 50%, $y: 50%) { + @include hide-text; + background: { + @if is-url($img) { + image: $img; + } @else { + image: image-url($img); + } + repeat: no-repeat; + position: $x $y; + }; +} + +// Like the `replace-text` mixin, but also sets the width +// and height of the element according the dimensions of the image. +// +// If you set `$inline` to true, then an inline image (data uri) will be used. +@mixin replace-text-with-dimensions($img, $x: 50%, $y: 50%, $inline: false) { + @include replace-text(if($inline, inline-image($img), $img), $x, $y); + width: image-width($img); + height: image-height($img); +} + +// Hides text in an element so you can see the background. +// +// The direction indicates how the text should be moved out of view. +// +// See `$hide-text-direction` for more information and to set this globally +// for your application. +@mixin hide-text($direction: $hide-text-direction) { + @if $direction == left { + $approximate-em-value: 12px / 1em; + $wider-than-any-screen: -9999em; + text-indent: $wider-than-any-screen * $approximate-em-value; + overflow: hidden; + text-align: left; + } @else { + // slightly wider than the box prevents issues with inline-block elements + text-indent: 110%; + white-space: nowrap; + overflow: hidden; + } +} + +// Hides text in an element by squishing the text into oblivion. +// Use this if you need to hide text contained in an inline element +// but still have it read by a screen reader. +@mixin squish-text { + font: 0/0 serif; + text-shadow: none; + color: transparent; +} diff --git a/scss/libs/compass/utilities/_color.scss b/scss/libs/compass/utilities/_color.scss new file mode 100755 index 0000000..0cc7fd1 --- /dev/null +++ b/scss/libs/compass/utilities/_color.scss @@ -0,0 +1 @@ +@import "color/contrast"; \ No newline at end of file diff --git a/scss/libs/compass/utilities/_general.scss b/scss/libs/compass/utilities/_general.scss new file mode 100755 index 0000000..047e636 --- /dev/null +++ b/scss/libs/compass/utilities/_general.scss @@ -0,0 +1,6 @@ +@import "general/reset"; +@import "general/clearfix"; +@import "general/float"; +@import "general/tag-cloud"; +@import "general/hacks"; +@import "general/min"; diff --git a/scss/libs/compass/utilities/_links.scss b/scss/libs/compass/utilities/_links.scss new file mode 100755 index 0000000..e0e3251 --- /dev/null +++ b/scss/libs/compass/utilities/_links.scss @@ -0,0 +1,5 @@ +@warn "This import is deprecated. Use 'compass/typography/links' instead."; + +@import "../typography/links/hover-link"; +@import "../typography/links/link-colors"; +@import "../typography/links/unstyled-link"; diff --git a/scss/libs/compass/utilities/_lists.scss b/scss/libs/compass/utilities/_lists.scss new file mode 100755 index 0000000..4833ee1 --- /dev/null +++ b/scss/libs/compass/utilities/_lists.scss @@ -0,0 +1,6 @@ +@warn "This import is deprecated. Use 'compass/typography/lists' instead."; + +@import "../typography/lists/horizontal-list"; +@import "../typography/lists/inline-list"; +@import "../typography/lists/inline-block-list"; +@import "../typography/lists/bullets"; diff --git a/scss/libs/compass/utilities/_print.scss b/scss/libs/compass/utilities/_print.scss new file mode 100755 index 0000000..4771e08 --- /dev/null +++ b/scss/libs/compass/utilities/_print.scss @@ -0,0 +1,17 @@ +// Classes that are useful for controlling what gets printed. +// You must mix `+print-utilities` into your print stylesheet +// and `+print-utilities(screen)` into your screen stylesheet. +// Note: these aren't semantic. +@mixin print-utilities($media: print) { + @if $media == print { + .noprint, .no-print { display: none; } + #{elements-of-type(block)} { + &.print-only { display: block; } + } + #{elements-of-type(inline)} { + &.print-only { display: inline; } + } + } @else { + .print-only { display: none; } + } +} diff --git a/scss/libs/compass/utilities/_sprites.scss b/scss/libs/compass/utilities/_sprites.scss new file mode 100755 index 0000000..0066804 --- /dev/null +++ b/scss/libs/compass/utilities/_sprites.scss @@ -0,0 +1,2 @@ +@import "sprites/base"; +@import "sprites/sprite-img"; diff --git a/scss/libs/compass/utilities/_tables.scss b/scss/libs/compass/utilities/_tables.scss new file mode 100755 index 0000000..4af1d51 --- /dev/null +++ b/scss/libs/compass/utilities/_tables.scss @@ -0,0 +1,3 @@ +@import "tables/alternating-rows-and-columns"; +@import "tables/borders"; +@import "tables/scaffolding"; diff --git a/scss/libs/compass/utilities/_text.scss b/scss/libs/compass/utilities/_text.scss new file mode 100755 index 0000000..bb73c25 --- /dev/null +++ b/scss/libs/compass/utilities/_text.scss @@ -0,0 +1,5 @@ +@warn "This import is deprecated. Use 'compass/typography/text' instead."; + +@import "../typography/text/ellipsis"; +@import "../typography/text/nowrap"; +@import "../typography/text/replacement"; diff --git a/scss/libs/compass/utilities/color/_contrast.scss b/scss/libs/compass/utilities/color/_contrast.scss new file mode 100755 index 0000000..fc73905 --- /dev/null +++ b/scss/libs/compass/utilities/color/_contrast.scss @@ -0,0 +1,28 @@ +$contrasted-dark-default: #000 !default; +$contrasted-light-default: #fff !default; +$contrasted-lightness-threshold: 30% !default; + +// Returns the `$light` color when the `$color` is dark +// and the `$dark` color when the `$color` is light. +// The `$threshold` is a percent between `0%` and `100%` and it determines +// when the lightness of `$color` changes from "dark" to "light". +@function contrast-color( + $color, + $dark: $contrasted-dark-default, + $light: $contrasted-light-default, + $threshold: $contrasted-lightness-threshold +) { + @return if(lightness($color) < $threshold, $light, $dark) +} + +// Sets the specified background color and calculates a dark or light contrasted text color. +// The arguments are passed through to the [contrast-color function](#function-contrast-color). +@mixin contrasted( + $background-color, + $dark: $contrasted-dark-default, + $light: $contrasted-light-default, + $threshold: $contrasted-lightness-threshold +) { + background-color: $background-color; + color: contrast-color($background-color, $dark, $light, $threshold); +} \ No newline at end of file diff --git a/scss/libs/compass/utilities/general/_clearfix.scss b/scss/libs/compass/utilities/general/_clearfix.scss new file mode 100755 index 0000000..73f9254 --- /dev/null +++ b/scss/libs/compass/utilities/general/_clearfix.scss @@ -0,0 +1,44 @@ +// @doc off +// Extends the bottom of the element to enclose any floats it contains. +// @doc on + +@import "hacks"; + +// This basic method is preferred for the usual case, when positioned +// content will not show outside the bounds of the container. +// +// Recommendations include using this in conjunction with a width. +// Credit: [quirksmode.org](http://www.quirksmode.org/blog/archives/2005/03/clearing_floats.html) +@mixin clearfix { + overflow: hidden; + @include has-layout; +} + +// This older method from Position Is Everything called +// [Easy Clearing](http://www.positioniseverything.net/easyclearing.html) +// has the advantage of allowing positioned elements to hang +// outside the bounds of the container at the expense of more tricky CSS. +@mixin legacy-pie-clearfix { + &:after { + content : "\0020"; + display : block; + height : 0; + clear : both; + overflow : hidden; + visibility : hidden; + } + @include has-layout; +} + +// This is an updated version of the PIE clearfix method that reduces the amount of CSS output. +// If you need to support Firefox before 3.5 you need to use `legacy-pie-clearfix` instead. +// +// Adapted from: [A new micro clearfix hack](http://nicolasgallagher.com/micro-clearfix-hack/) +@mixin pie-clearfix { + &:after { + content: ""; + display: table; + clear: both; + } + @include has-layout; +} diff --git a/scss/libs/compass/utilities/general/_float.scss b/scss/libs/compass/utilities/general/_float.scss new file mode 100755 index 0000000..914f184 --- /dev/null +++ b/scss/libs/compass/utilities/general/_float.scss @@ -0,0 +1,30 @@ +// Implementation of float:left with fix for the +// [double-margin bug in IE5/6](http://www.positioniseverything.net/explorer/doubled-margin.html) +@mixin float-left { + @include float(left); } + +// Implementation of float:right with fix for the +// [double-margin bug in IE5/6](http://www.positioniseverything.net/explorer/doubled-margin.html) +@mixin float-right { + @include float(right); } + +// Direction independent float mixin that fixes the +// [double-margin bug in IE5/6](http://www.positioniseverything.net/explorer/doubled-margin.html) +@mixin float($side: left) { + display: inline; + float: unquote($side); } + +// Resets floated elements back to their default of `float: none` and defaults +// to `display: block` unless you pass `inline` as an argument +// +// Usage Example: +// +// body.homepage +// #footer li +// +float-left +// body.signup +// #footer li +// +reset-float +@mixin reset-float($display: block) { + float: none; + display: $display; } \ No newline at end of file diff --git a/scss/libs/compass/utilities/general/_hacks.scss b/scss/libs/compass/utilities/general/_hacks.scss new file mode 100755 index 0000000..d5a6bae --- /dev/null +++ b/scss/libs/compass/utilities/general/_hacks.scss @@ -0,0 +1,46 @@ +@import "compass/support"; + +// The `zoom` approach generates less CSS but does not validate. +// Set this to `block` to use the display-property to hack the +// element to gain layout. +$default-has-layout-approach: zoom !default; + +// This mixin causes an element matching the selector +// to gain the "hasLayout" property in internet explorer. +// More information on [hasLayout](http://reference.sitepoint.com/css/haslayout). +@mixin has-layout($approach: $default-has-layout-approach) { + @if $legacy-support-for-ie { + @if $approach == zoom { + @include has-layout-zoom; + } @else if $approach == block { + @include has-layout-block; + } @else { + @warn "Unknown has-layout approach: #{$approach}"; + @include has-layout-zoom; + } + } +} + +@mixin has-layout-zoom { + @if $legacy-support-for-ie6 or $legacy-support-for-ie7 { + *zoom: 1; + } +} + +@mixin has-layout-block { + @if $legacy-support-for-ie { + // This makes ie6 get layout + display: inline-block; + // and this puts it back to block + & { display: block; } + } +} + +// A hack to supply IE6 (and below) with a different property value. +// [Read more](http://www.cssportal.com/css-hacks/#in_css-important). +@mixin bang-hack($property, $value, $ie6-value) { + @if $legacy-support-for-ie6 { + #{$property}: #{$value} !important; + #{$property}: #{$ie6-value}; + } +} diff --git a/scss/libs/compass/utilities/general/_min.scss b/scss/libs/compass/utilities/general/_min.scss new file mode 100755 index 0000000..99a676b --- /dev/null +++ b/scss/libs/compass/utilities/general/_min.scss @@ -0,0 +1,16 @@ +@import "hacks"; + +//** +// Cross browser min-height mixin. +@mixin min-height($value) { + @include hacked-minimum(height, $value); } + +//** +// Cross browser min-width mixin. +@mixin min-width($value) { + @include hacked-minimum(width, $value); } + +// @private This mixin is not meant to be used directly. +@mixin hacked-minimum($property, $value) { + min-#{$property}: $value; + @include bang-hack($property, auto, $value); } diff --git a/scss/libs/compass/utilities/general/_reset.scss b/scss/libs/compass/utilities/general/_reset.scss new file mode 100755 index 0000000..f5f6487 --- /dev/null +++ b/scss/libs/compass/utilities/general/_reset.scss @@ -0,0 +1,2 @@ +// This module has moved. +@import "compass/reset/utilities"; \ No newline at end of file diff --git a/scss/libs/compass/utilities/general/_tabs.scss b/scss/libs/compass/utilities/general/_tabs.scss new file mode 100755 index 0000000..8b13789 --- /dev/null +++ b/scss/libs/compass/utilities/general/_tabs.scss @@ -0,0 +1 @@ + diff --git a/scss/libs/compass/utilities/general/_tag-cloud.scss b/scss/libs/compass/utilities/general/_tag-cloud.scss new file mode 100755 index 0000000..7ccae05 --- /dev/null +++ b/scss/libs/compass/utilities/general/_tag-cloud.scss @@ -0,0 +1,18 @@ +// Emits styles for a tag cloud +@mixin tag-cloud($base-size: 1em) { + font-size: $base-size; + line-height: 1.2 * $base-size; + .xxs, .xs, .s, .l, .xl, .xxl { + line-height: 1.2 * $base-size; } + .xxs { + font-size: $base-size / 2; } + .xs { + font-size: 2 * $base-size / 3; } + .s { + font-size: 3 * $base-size / 4; } + .l { + font-size: 4 * $base-size / 3; } + .xl { + font-size: 3 * $base-size / 2; } + .xxl { + font-size: 2 * $base-size; } } diff --git a/scss/libs/compass/utilities/links/_hover-link.scss b/scss/libs/compass/utilities/links/_hover-link.scss new file mode 100755 index 0000000..843459f --- /dev/null +++ b/scss/libs/compass/utilities/links/_hover-link.scss @@ -0,0 +1,3 @@ +@warn "This import is deprecated. Use 'compass/typography/links/hover-link' instead."; + +@import "../../typography/links/hover-link"; diff --git a/scss/libs/compass/utilities/links/_link-colors.scss b/scss/libs/compass/utilities/links/_link-colors.scss new file mode 100755 index 0000000..fac9438 --- /dev/null +++ b/scss/libs/compass/utilities/links/_link-colors.scss @@ -0,0 +1,3 @@ +@warn "This import is deprecated. Use 'compass/typography/links/link-colors' instead."; + +@import "../../typography/links/link-colors"; diff --git a/scss/libs/compass/utilities/links/_unstyled-link.scss b/scss/libs/compass/utilities/links/_unstyled-link.scss new file mode 100755 index 0000000..1c48f46 --- /dev/null +++ b/scss/libs/compass/utilities/links/_unstyled-link.scss @@ -0,0 +1,3 @@ +@warn "This import is deprecated. Use 'compass/typography/links/unstyled-link' instead."; + +@import "../../typography/links/unstyled-link"; diff --git a/scss/libs/compass/utilities/lists/_bullets.scss b/scss/libs/compass/utilities/lists/_bullets.scss new file mode 100755 index 0000000..796e1cd --- /dev/null +++ b/scss/libs/compass/utilities/lists/_bullets.scss @@ -0,0 +1,3 @@ +@warn "This import is deprecated. Use 'compass/typography/lists/bullets' instead."; + +@import "../../typography/lists/bullets"; diff --git a/scss/libs/compass/utilities/lists/_horizontal-list.scss b/scss/libs/compass/utilities/lists/_horizontal-list.scss new file mode 100755 index 0000000..38ae85c --- /dev/null +++ b/scss/libs/compass/utilities/lists/_horizontal-list.scss @@ -0,0 +1,3 @@ +@warn "This import is deprecated. Use 'compass/typography/lists/horizontal-list' instead."; + +@import "../../typography/lists/horizontal-list"; diff --git a/scss/libs/compass/utilities/lists/_inline-block-list.scss b/scss/libs/compass/utilities/lists/_inline-block-list.scss new file mode 100755 index 0000000..5d4a129 --- /dev/null +++ b/scss/libs/compass/utilities/lists/_inline-block-list.scss @@ -0,0 +1,3 @@ +@warn "This import is deprecated. Use 'compass/typography/lists/inline-block-list' instead."; + +@import "../../typography/lists/inline-block-list"; diff --git a/scss/libs/compass/utilities/lists/_inline-list.scss b/scss/libs/compass/utilities/lists/_inline-list.scss new file mode 100755 index 0000000..fb1dfeb --- /dev/null +++ b/scss/libs/compass/utilities/lists/_inline-list.scss @@ -0,0 +1,3 @@ +@warn "This import is deprecated. Use 'compass/typography/lists/inline-list' instead."; + +@import "../../typography/lists/inline-list"; diff --git a/scss/libs/compass/utilities/sprites/_base.scss b/scss/libs/compass/utilities/sprites/_base.scss new file mode 100755 index 0000000..1b268a8 --- /dev/null +++ b/scss/libs/compass/utilities/sprites/_base.scss @@ -0,0 +1,66 @@ +// Determines those states for which you want to enable magic sprite selectors +$sprite-selectors: hover, target, active !default; + +// Set the width and height of an element to the original +// dimensions of an image before it was included in the sprite. +@mixin sprite-dimensions($map, $sprite) { + height: image-height(sprite-file($map, $sprite)); + width: image-width(sprite-file($map, $sprite)); +} + +// Set the background position of the given sprite `$map` to display the +// sprite of the given `$sprite` name. You can move the image relative to its +// natural position by passing `$offset-x` and `$offset-y`. +@mixin sprite-background-position($map, $sprite, $offset-x: 0, $offset-y: 0) { + background-position: sprite-position($map, $sprite, $offset-x, $offset-y); +} + + +// Determines if you want to include magic selectors in your sprites +$disable-magic-sprite-selectors:false !default; + +// Include the position and (optionally) dimensions of this `$sprite` +// in the given sprite `$map`. The sprite url should come from either a base +// class or you can specify the `sprite-url` explicitly like this: +// +// background: $map no-repeat; +@mixin sprite($map, $sprite, $dimensions: false, $offset-x: 0, $offset-y: 0) { + @include sprite-background-position($map, $sprite, $offset-x, $offset-y); + @if $dimensions { + @include sprite-dimensions($map, $sprite); + } + @if not $disable-magic-sprite-selectors { + @include sprite-selectors($map, $sprite, $sprite, $offset-x, $offset-y); + } +} + +// Include the selectors for the `$sprite` given the `$map` and the +// `$full-sprite-name` +// @private +@mixin sprite-selectors($map, $sprite-name, $full-sprite-name, $offset-x: 0, $offset-y: 0) { + @each $selector in $sprite-selectors { + @if sprite_has_selector($map, $sprite-name, $selector) { + &:#{$selector}, &.#{$full-sprite-name}_#{$selector}, &.#{$full-sprite-name}-#{$selector} { + @include sprite-background-position($map, "#{$sprite-name}_#{$selector}", $offset-x, $offset-y); + } + } + } +} + +// Generates a class for each space separated name in `$sprite-names`. +// The class will be of the form .-. +// +// If a base class is provided, then each class will extend it. +// +// If `$dimensions` is `true`, the sprite dimensions will specified. +@mixin sprites($map, $sprite-names, $base-class: false, $dimensions: false, $prefix: sprite-map-name($map), $offset-x: 0, $offset-y: 0) { + @each $sprite-name in $sprite-names { + @if sprite_does_not_have_parent($map, $sprite-name) { + $full-sprite-name: "#{$prefix}-#{$sprite-name}"; + .#{$full-sprite-name} { + @if $base-class { @extend #{$base-class}; } + @include sprite($map, $sprite-name, $dimensions, $offset-x, $offset-y); + } + } + } +} \ No newline at end of file diff --git a/scss/libs/compass/utilities/sprites/_sprite-img.scss b/scss/libs/compass/utilities/sprites/_sprite-img.scss new file mode 100755 index 0000000..ff90c00 --- /dev/null +++ b/scss/libs/compass/utilities/sprites/_sprite-img.scss @@ -0,0 +1,79 @@ +// @doc off +// Example 1: +// +// a.twitter +// +sprite-img("icons-32.png", 1) +// a.facebook +// +sprite-img("icons-32png", 2) +// +// Example 2: +// +// a +// +sprite-background("icons-32.png") +// a.twitter +// +sprite-column(1) +// a.facebook +// +sprite-row(2) +// @doc on + +$sprite-default-size: 32px !default; + +$sprite-default-margin: 0px !default; + +$sprite-image-default-width: $sprite-default-size !default; + +$sprite-image-default-height: $sprite-default-size !default; + +// Sets all the rules for a sprite from a given sprite image to show just one of the sprites. +// To reduce duplication use a sprite-bg mixin for common properties and a sprite-select mixin for positioning. +@mixin sprite-img($img, $col, $row: 1, $width: $sprite-image-default-width, $height: $sprite-image-default-height, $margin: $sprite-default-margin) { + @include sprite-background($img, $width, $height); + @include sprite-position($col, $row, $width, $height, $margin); +} + +// Sets rules common for all sprites, assumes you want a square, but allows a rectangular region. +@mixin sprite-background($img, $width: $sprite-default-size, $height: $width) { + @include sprite-background-rectangle($img, $width, $height); +} + +// Sets rules common for all sprites, assumes a rectangular region. +@mixin sprite-background-rectangle($img, $width: $sprite-image-default-width, $height: $sprite-image-default-height) { + background: image-url($img) no-repeat; + width: $width; + height: $height; + overflow: hidden; +} + +// Allows horizontal sprite positioning optimized for a single row of sprites. +@mixin sprite-column($col, $width: $sprite-image-default-width, $margin: $sprite-default-margin) { + @include sprite-position($col, 1, $width, 0px, $margin); +} + +// Allows vertical sprite positioning optimized for a single column of sprites. +@mixin sprite-row($row, $height: $sprite-image-default-height, $margin: $sprite-default-margin) { + @include sprite-position(1, $row, 0px, $height, $margin); +} + +// Allows vertical and horizontal sprite positioning from a grid of equal dimensioned sprites. +@mixin sprite-position($col, $row: 1, $width: $sprite-image-default-width, $height: $sprite-image-default-height, $margin: $sprite-default-margin) { + $x: ($col - 1) * -$width - ($col - 1) * $margin; + $y: ($row - 1) * -$height - ($row - 1) * $margin; + background-position: $x $y; +} + + + +// Similar to 'sprite-replace-text-with-dimensions' but does not autmaticly set the demensions +@mixin sprite-replace-text ($map, $sprite, $dimensions: false, $offset-x: 0, $offset-y: 0) { + @include hide-text; + @include sprite($map, $sprite, $dimensions, $offset-x, $offset-y); + background-image: $map; + background-repeat: no-repeat; +} + +// Similar to 'replace-text-with-dimensions' but with sprites +// To use, create your sprite and then pass it in the `$map` param +// The name of the image in the sprite folder should be `$img-name` +@mixin sprite-replace-text-with-dimensions ($map, $sprite, $offset-x: 0, $offset-y: 0){ + @include sprite-replace-text ($map, $sprite, true, $offset-x, $offset-y); +} \ No newline at end of file diff --git a/scss/libs/compass/utilities/tables/_alternating-rows-and-columns.scss b/scss/libs/compass/utilities/tables/_alternating-rows-and-columns.scss new file mode 100755 index 0000000..4da78e2 --- /dev/null +++ b/scss/libs/compass/utilities/tables/_alternating-rows-and-columns.scss @@ -0,0 +1,22 @@ +@mixin alternating-rows-and-columns($even-row-color, $odd-row-color, $dark-intersection, $header-color: white, $footer-color: white) { + th { + background-color: $header-color; + &.even, &:nth-child(2n) { + background-color: $header-color - $dark-intersection; } } + tr { + &.odd, &:nth-child(2n+1) { + td { + background-color: $odd-row-color; + &.even, &:nth-child(2n) { + background-color: $odd-row-color - $dark-intersection; } } } + } + tr.even { + td { + background-color: $even-row-color; + &.even, &:nth-child(2n) { + background-color: $even-row-color - $dark-intersection; } } } + tfoot { + th, td { + background-color: $footer-color; + &.even, &:nth-child(2n) { + background-color: $footer-color - $dark-intersection; } } } } diff --git a/scss/libs/compass/utilities/tables/_borders.scss b/scss/libs/compass/utilities/tables/_borders.scss new file mode 100755 index 0000000..120896d --- /dev/null +++ b/scss/libs/compass/utilities/tables/_borders.scss @@ -0,0 +1,33 @@ +@mixin outer-table-borders($width: 2px, $color: black) { + border: $width solid $color; + thead { + th { + border-bottom: $width solid $color; } } + tfoot { + th, td { + border-top: $width solid $color; } } + th { + &:first-child { + border-right: $width solid $color; } } } + +@mixin inner-table-borders($width: 2px, $color: black) { + th, td { + border: { + right: $width solid $color; + bottom: $width solid $color; + left-width: 0px; + top-width: 0px; }; + &:last-child, + &.last { + border-right-width: 0px; } } + +// IE8 ignores rules that are included on the same line as :last-child +// see http://www.richardscarrott.co.uk/posts/view/ie8-last-child-bug for details + + tbody, tfoot { + tr:last-child { + th, td { + border-bottom-width: 0px; } } + tr.last { + th, td { + border-bottom-width: 0px; } } } } diff --git a/scss/libs/compass/utilities/tables/_scaffolding.scss b/scss/libs/compass/utilities/tables/_scaffolding.scss new file mode 100755 index 0000000..cc19d04 --- /dev/null +++ b/scss/libs/compass/utilities/tables/_scaffolding.scss @@ -0,0 +1,9 @@ +@mixin table-scaffolding { + th { + text-align: center; + font-weight: bold; } + td, + th { + padding: 2px; + &.numeric { + text-align: right; } } } diff --git a/scss/libs/compass/utilities/text/_ellipsis.scss b/scss/libs/compass/utilities/text/_ellipsis.scss new file mode 100755 index 0000000..b172754 --- /dev/null +++ b/scss/libs/compass/utilities/text/_ellipsis.scss @@ -0,0 +1,3 @@ +@warn "This import is deprecated. Use 'compass/typography/text/ellipsis' instead."; + +@import "../../typography/text/ellipsis"; diff --git a/scss/libs/compass/utilities/text/_nowrap.scss b/scss/libs/compass/utilities/text/_nowrap.scss new file mode 100755 index 0000000..ca4a22f --- /dev/null +++ b/scss/libs/compass/utilities/text/_nowrap.scss @@ -0,0 +1,3 @@ +@warn "This import is deprecated. Use 'compass/typography/text/nowrap' instead."; + +@import "../../typography/text/nowrap"; diff --git a/scss/libs/compass/utilities/text/_replacement.scss b/scss/libs/compass/utilities/text/_replacement.scss new file mode 100755 index 0000000..809c6a8 --- /dev/null +++ b/scss/libs/compass/utilities/text/_replacement.scss @@ -0,0 +1,3 @@ +@warn "This import is deprecated. Use 'compass/typography/text/replacement' instead."; + +@import "../../typography/text/replacement"; diff --git a/scss/plugins/_hashgrid.scss b/scss/plugins/_hashgrid.scss new file mode 100755 index 0000000..44f38b8 --- /dev/null +++ b/scss/plugins/_hashgrid.scss @@ -0,0 +1,78 @@ +/** --- @section PLUGINS/#GRID --- */ + +#grid +{ + overflow: hidden; + position: absolute; + left: 0; + right: 0; + top: 0; + + @include mq(desktop) + { + @include container($columns-M); + } + + // Wide screens + @include mq($from: wide) + { + @include container($columns-L); + } + + // Tablet + @include mq($to: desktop) + { + @include container($columns-S); + } + + // Mobile + @include mq($to: tablet) + { + width: auto; + } + + .vert-container + { + left: outline-unit($grid-padding); + right: outline-unit($grid-padding); + } + .vert + { + width: outline-unit($column-width); + margin-left: outline-unit($gutter-width); + background-color: $grid-background-column-color; + margin-right: 0!important; + + &.first-child + { + margin-left: 0; + } + + @include mq($to: tablet) + { + &.first-child + { + width: 100%; + } + } + } + .horiz + { + @include height(1,$browser-font-size); + @include background-image(linear-gradient(transparent 95%, $grid-background-column-color 95%)); // on passe par un dégradé pour éviter de devoir calculer avec les hauteurs de bordures + } + &.grid-1 + { + .vert + { + background-color: transparent; // pas de grille verticale affichée + } + } + &.grid-2 + { + .horiz + { + background-image: none; // pas de grille horizontale affichée + } + } +} diff --git a/scss/print.scss b/scss/print.scss new file mode 100755 index 0000000..25adc93 --- /dev/null +++ b/scss/print.scss @@ -0,0 +1,6 @@ +/** --- @section PRINT CSS --- */ + +@import "libs"; +@import "core"; +@import "project/ui/font-face"; +@import "project/print/print"; \ No newline at end of file diff --git a/scss/project/_layout.scss b/scss/project/_layout.scss new file mode 100755 index 0000000..70f7b49 --- /dev/null +++ b/scss/project/_layout.scss @@ -0,0 +1,5 @@ +/** --- @section LAYOUT --- */ + +@import "layout/header"; +@import "layout/content"; +@import "layout/footer"; \ No newline at end of file diff --git a/scss/project/_pages.scss b/scss/project/_pages.scss new file mode 100755 index 0000000..7156907 --- /dev/null +++ b/scss/project/_pages.scss @@ -0,0 +1,3 @@ +/** --- @section PAGES --- */ + +//@import "pages/home"; \ No newline at end of file diff --git a/scss/project/_ui.scss b/scss/project/_ui.scss new file mode 100755 index 0000000..6f28339 --- /dev/null +++ b/scss/project/_ui.scss @@ -0,0 +1,6 @@ +/** --- @section UI ELEMENTS --- */ + +@import "ui/font-face"; +@import "ui/sprites"; +@import "ui/forms"; +@import "ui/generic"; \ No newline at end of file diff --git a/scss/project/layout/_content.scss b/scss/project/layout/_content.scss new file mode 100755 index 0000000..12c88df --- /dev/null +++ b/scss/project/layout/_content.scss @@ -0,0 +1,6 @@ +/** --- @section LAYOUT/CONTENT --- */ + +.l-content +{ + @include container; +} \ No newline at end of file diff --git a/scss/project/layout/_footer.scss b/scss/project/layout/_footer.scss new file mode 100755 index 0000000..4c25401 --- /dev/null +++ b/scss/project/layout/_footer.scss @@ -0,0 +1,2 @@ +/** --- @section LAYOUT/FOOTER --- */ + diff --git a/scss/project/layout/_header.scss b/scss/project/layout/_header.scss new file mode 100755 index 0000000..8d213cc --- /dev/null +++ b/scss/project/layout/_header.scss @@ -0,0 +1 @@ +/** --- @section LAYOUT/HEADER --- */ diff --git a/scss/project/print/_print.scss b/scss/project/print/_print.scss new file mode 100644 index 0000000..d490887 --- /dev/null +++ b/scss/project/print/_print.scss @@ -0,0 +1 @@ +/** --- @section PRINT --- */ \ No newline at end of file diff --git a/scss/project/ui/_font-face.scss b/scss/project/ui/_font-face.scss new file mode 100755 index 0000000..78511ee --- /dev/null +++ b/scss/project/ui/_font-face.scss @@ -0,0 +1,21 @@ +/** --- @section UI/FONT-FACE --- */ + +/* +@font-face +{ + font-family: 'exemple'; + + src: url('../font/exemple.eot'); + src: url('../font/exemple.eot?#iefix') format('embedded-opentype'), + url('../font/exemple.woff') format('woff'), + url('../font/exemple.ttf') format('truetype'); + + font-weight: normal; + font-style: normal; +} +@mixin exemple +{ + font-family: 'exemple', + sans-serif; +} +*/ \ No newline at end of file diff --git a/scss/project/ui/_forms.scss b/scss/project/ui/_forms.scss new file mode 100755 index 0000000..a51def1 --- /dev/null +++ b/scss/project/ui/_forms.scss @@ -0,0 +1 @@ +/** --- @section UI/FORMS --- */ diff --git a/scss/project/ui/_generic.scss b/scss/project/ui/_generic.scss new file mode 100755 index 0000000..cd5c03a --- /dev/null +++ b/scss/project/ui/_generic.scss @@ -0,0 +1,202 @@ +/** --- @section GENERIC STYLES --- */ + +body +{ + $scale: 5/4; + $fsh6: 10px; + $fsh5: round(modular-scale($fsh6, 1, $scale)); + $fsh4: round(modular-scale($fsh5, 1, $scale)); + $fsh3: round(modular-scale($fsh4, 1, $scale)); + $fsh2: round(modular-scale($fsh3, 1, $scale)); + $fsh1: round(modular-scale($fsh2, 1, $scale)); + + font-size: ($base-font-size/1px) * 6.25%; + line-height: ($base-line-height / $base-font-size) * 1em; + + h6 + { + margin: 0; + @include adjust-font-size-to($fsh6); + @include margin-bottom(1, $fsh6); + @include padding-top(2, $fsh6); + } + h5 + { + margin: 0; + @include adjust-font-size-to($fsh5); + @include margin-bottom(1, $fsh5); + @include padding-top(2, $fsh5); + } + h4 + { + margin: 0; + @include adjust-font-size-to($fsh4); + @include margin-bottom(1, $fsh4); + @include padding-top(2, $fsh4); + } + h3 + { + margin: 0; + @include adjust-font-size-to($fsh3); + @include margin-bottom(1, $fsh3); + @include padding-top(2, $fsh3); + } + h2 + { + margin: 0; + @include adjust-font-size-to($fsh2); + @include margin-bottom(1, $fsh2); + @include padding-top(2, $fsh2); + } + h1 + { + margin: 0; + @include adjust-font-size-to($fsh1); + @include margin-bottom(1, $fsh1); + @include padding-top(2, $fsh1); + } + + h1 + h2, + h2 + h3, + h3 + h4, + h4 + h5, + h5 + h6 + { + padding-top: 0; + } +} +b, +strong +{ + font-weight: bold; +} +blockquote +{ + margin: 0 $column-width + $gutter-width; + @include trailer; +} +p, +pre, +address +{ + margin: 0; + @include margin-bottom; +} +dl, +menu, +ol, +ul +{ + margin: 0; + @include margin-bottom; +} +dd +{ + margin: 0 0 0 $column-width + $gutter-width; +} +menu, +ol, +ul +{ + padding: 0 0 0 $column-width + $gutter-width; +} +fieldset +{ + margin: 0; + padding: 10px; + @include padding-top( 0.5); + @include padding-bottom(0.5); + @include margin-bottom( 1); +} +table +{ + @include margin-bottom; +} + +td, +th, +caption +{ + padding: 10px; + @include padding-top( 0.5); + @include padding-bottom(0.5); +} +html +{ + overflow-y: scroll; +} +img, +audio, +video, +canvas, +svg, +object, +table +{ + display: block; + max-width: 100%; + height: auto; +} +table +{ + display: table; +} +small +{ + line-height: 0; +} +.hr +{ + @include border-top(1px, solid, black); + @include margin-bottom(1); + + hr + { + @include mask; + } +} +ul, +ol +{ + ol, + ul + { + margin-bottom: 0; + } +} +code, +kbd, +samp +{ + .not-ie & + { + line-height: 0; + } +} + +.clearfix +{ + @include clearfix; +} + +.roll // ce mixin peut être appelé depuis le HTML via une classe +{ + @include roll; +} + +.hide // ce mixin peut être appelé depuis le HTML via une classe +{ + @include hide; +} +.mask // ce mixin peut être appelé depuis le HTML via une classe +{ + @include mask; +} +.unmask // ce mixin peut être appelé depuis le HTML via une classe +{ + @include unmask; +} +.list // ce mixin peut être appelé depuis le HTML via une classe +{ + @include list; +} \ No newline at end of file diff --git a/scss/project/ui/_sprites.scss b/scss/project/ui/_sprites.scss new file mode 100755 index 0000000..286f3f7 --- /dev/null +++ b/scss/project/ui/_sprites.scss @@ -0,0 +1,19 @@ +/** --- @section UI/SPRITES --- */ + +/* +$exemple-layout: vertical; +$exemple-spacing: 32px; +@import 'bg/exemple/*.png'; + +@include all-exemple-sprites; +*/ + +/* +appels : + +@include exemple-sprite(image); +@include exemple-sprite(image, $offset-x:100%); +*/ + +//@import 'bg/demo_mires/*.png'; +//@include all-demo_mires-sprites; \ No newline at end of file diff --git a/scss/styles-doc.scss b/scss/styles-doc.scss new file mode 100755 index 0000000..9891737 --- /dev/null +++ b/scss/styles-doc.scss @@ -0,0 +1,5 @@ +/** --- @section DOC CSS --- */ + +@import "libs"; +@import "core"; +@import "doc"; \ No newline at end of file diff --git a/scss/styles-lte-ie8.scss b/scss/styles-lte-ie8.scss new file mode 100755 index 0000000..03e1a5b --- /dev/null +++ b/scss/styles-lte-ie8.scss @@ -0,0 +1,9 @@ +/** --- @section IE<9 CSS --- */ + +$lte-ie8: true; +$mq-responsive: false; + +@import "libs"; +@import "core"; +@import "plugins"; +@import "project"; \ No newline at end of file diff --git a/scss/styles.scss b/scss/styles.scss old mode 100644 new mode 100755 index f4bbd30..049c1ab --- a/scss/styles.scss +++ b/scss/styles.scss @@ -1,25 +1,7 @@ - // Lib Compass + Blueprint - @import "compass" ; - @import "blueprint"; - - // Outils - @import "_variables"; - @import "lib/_mixins"; - @import "lib/_normalize"; - @import "lib/_hashgrid" ; +/** --- @section SCREEN STYLES --- */ +/** NB: styles for Internet Explorer 8 and below are generated through styles-lte-ie8.scss */ - // Styles généraux - @import "_forms"; - @import "_sprites"; - @import "_typo"; - @import "_global"; - @import "_header"; - @import "_footer"; - @import "_screen"; - @import "_sidebar"; - - // Modules et pages - - - // Styles print - @import "_print" ; \ No newline at end of file +@import "libs"; +@import "core"; +@import "plugins"; +@import "project"; \ No newline at end of file diff --git a/scss/_doc-print.scss b/sitemap.xml old mode 100644 new mode 100755 similarity index 100% rename from scss/_doc-print.scss rename to sitemap.xml diff --git a/swf/demo.swf b/swf/demo.swf deleted file mode 100644 index 509bb0ffcee04bf9e77036c72ecfd82f00de2fa2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 888 zcmV-;1Bd)WS5pZ$1pokeoPAW?a@tl9K6~`DNc^Of0C27;vH;qF`g9n!s z=(N)rYRPZ}>R>^{u{-Wn?)npSY|#awpnoZ1+P(ik&czx4GE1*wp=nsRwR=tL=&Ja+V0g zjrVM28W8o6zB_UUUZm4}dC;gm?h%*>hVd*qoUENRh(7weN&lgSgFmL*}b&T6d_hk7f8ui=p4n0ka`LLAkX%k7 zD-gMENXEKRG)l$|fSY$?qg zwN{)}=bB?I#R=)k@4coBqB50aJ-R(Ji?8#47GD?Mb@O|9BKF Date: Thu, 12 Dec 2013 18:26:13 +0100 Subject: [PATCH 10/19] =?UTF-8?q?Suite=20de=20l=E2=80=99epic=20winter=20co?= =?UTF-8?q?mmit=20of=20doom,=20avec=20les=20retours=20de=20Vincent=20:=20-?= =?UTF-8?q?=20Cr=C3=A9ation=20d'un=20dossier=20/scss/partials=20dans=20leq?= =?UTF-8?q?uel=20on=20range=20tous=20les=20fichiers=20SCSS=20qui=20n'ont?= =?UTF-8?q?=20pas=20vocartion=20=C3=A0=20=C3=AAtre=20compil=C3=A9s=20direc?= =?UTF-8?q?tement=20;=20-=20Modification=20du=20mixin=20@column()=20situ?= =?UTF-8?q?=C3=A9=20dans=20=5Fmixins.scss=20pour=20g=C3=A9rer=20le=20displ?= =?UTF-8?q?ay:=20inline=20si=20la=20compatibilit=C3=A9=20IE6=20est=20activ?= =?UTF-8?q?=C3=A9e=20;=20-=20On=20appelle=20d=C3=A9sormais=20toujours=20?= =?UTF-8?q?=5Fconfig.scss=20*avant*=20les=20libs=20(Compass=20notamment),?= =?UTF-8?q?=20pour=20que=20la=20variable=20$legacy-support-for-ie=20soit?= =?UTF-8?q?=20juste.=20Autrement,=20Compass=20la=20reset=20=C3=A0=20true?= =?UTF-8?q?=20alors=20qu=E2=80=99on=20ne=20le=20veut=20pas=20forc=C3=A9men?= =?UTF-8?q?t=20;=20-=20R=C3=A9tablissement=20des=20commentaires=20conditio?= =?UTF-8?q?nnels=20pour=20IE6=20et=207=20sur=20le=20body=20(=C3=A7a=20peut?= =?UTF-8?q?=20=E2=80=93=20h=C3=A9las=20=E2=80=93=20encore=20servir)=20;=20?= =?UTF-8?q?-=20Suppression=20des=20commentaires=20type=20=20au=20d=C3=A9but=20de=20chaque=20include=20PHP=20car?= =?UTF-8?q?=20c'est=20g=C3=A9r=C3=A9=20automatiquement=20;=20-=20R=C3=A9ta?= =?UTF-8?q?blissement=20du=20contenu=20du=20dossier=20/swf=20qui=20peut=20?= =?UTF-8?q?servir=20pour=20les=20d=C3=A9mos=20diverses=20;=20-=20Remplacem?= =?UTF-8?q?ent=20des=20breakpoints=20=C2=AB=20desktop=20=C2=BB,=20=C2=AB?= =?UTF-8?q?=20mobile=20=C2=BB,=20=C2=AB=20tablet=20=C2=BB=20et=20=C2=AB=20?= =?UTF-8?q?wide=20=C2=BB=20par=20=C2=AB=20L=C2=A0=C2=BB,=20=C2=AB=20S?= =?UTF-8?q?=C2=A0=C2=BB,=20=C2=AB=20M=C2=A0=C2=BB=20et=20=C2=AB=20XL=C2=A0?= =?UTF-8?q?=C2=BB.=20NB=20:=20cela=20peut=20=C3=AAtre=20chang=C3=A9=20?= =?UTF-8?q?=C3=A0=20chaque=20nouveau=20projet=20(papa-bear,=20anyone=3F)?= =?UTF-8?q?=20;=20-=20R=C3=A9tablissement=20des=20fichiers=20=5Fcolorbox.s?= =?UTF-8?q?css=20et=20=5Fflexslider.scss=20dans=20/plugins,=20mais=20ils?= =?UTF-8?q?=20ne=20sont=20pas=20appel=C3=A9s=20par=20d=C3=A9faut=20dans=20?= =?UTF-8?q?=5Fplugins.scss=20;=20-=20R=C3=A9tablissement=20du=20fichier=20?= =?UTF-8?q?index.php=20dans=20/inc/content.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/css/print.css | 541 +++++++++- assets/css/styles-doc.css | 586 ++++++++++- assets/css/styles-lte-ie8.css | 866 +++++++++++++++- assets/css/styles.css | 944 +++++++++++++++++- assets/swf/demo.jpg | Bin 0 -> 1252 bytes assets/swf/demo.swf | Bin 0 -> 888 bytes config.rb | 4 +- inc/_body/dist.php | 2 + inc/_footer/dist.php | 1 - inc/_page/dist.php | 1 - inc/content/index.php | 6 + index.md | 8 +- scss/{core => partials}/_config.scss | 11 +- scss/{ => partials}/_core.scss | 1 - scss/{ => partials}/_doc.scss | 0 scss/{ => partials}/_libs.scss | 0 scss/{ => partials}/_plugins.scss | 0 scss/{ => partials}/_project.scss | 0 scss/{ => partials}/core/_mixins.scss | 6 + scss/{ => partials}/core/_mq.scss | 0 scss/{ => partials}/doc/_print.scss | 0 scss/{ => partials}/doc/_screen.scss | 0 scss/{ => partials}/libs/_bourbon.scss | 0 scss/{ => partials}/libs/_compass.scss | 0 scss/{ => partials}/libs/_normalize.scss | 0 .../bourbon/_bourbon-deprecated-upcoming.scss | 0 .../libs/bourbon/addons/_button.scss | 0 .../libs/bourbon/addons/_clearfix.scss | 0 .../libs/bourbon/addons/_font-family.scss | 0 .../libs/bourbon/addons/_hide-text.scss | 0 .../bourbon/addons/_html5-input-types.scss | 0 .../libs/bourbon/addons/_position.scss | 0 .../libs/bourbon/addons/_prefixer.scss | 0 .../libs/bourbon/addons/_retina-image.scss | 0 .../libs/bourbon/addons/_size.scss | 0 .../bourbon/addons/_timing-functions.scss | 0 .../libs/bourbon/addons/_triangle.scss | 0 .../libs/bourbon/css3/_animation.scss | 0 .../libs/bourbon/css3/_appearance.scss | 0 .../bourbon/css3/_backface-visibility.scss | 0 .../libs/bourbon/css3/_background-image.scss | 0 .../libs/bourbon/css3/_background.scss | 0 .../libs/bourbon/css3/_border-image.scss | 0 .../libs/bourbon/css3/_border-radius.scss | 0 .../libs/bourbon/css3/_box-sizing.scss | 0 .../libs/bourbon/css3/_columns.scss | 0 .../libs/bourbon/css3/_flex-box.scss | 0 .../libs/bourbon/css3/_font-face.scss | 0 .../libs/bourbon/css3/_hidpi-media-query.scss | 0 .../libs/bourbon/css3/_image-rendering.scss | 0 .../libs/bourbon/css3/_inline-block.scss | 0 .../libs/bourbon/css3/_keyframes.scss | 0 .../libs/bourbon/css3/_linear-gradient.scss | 0 .../libs/bourbon/css3/_perspective.scss | 0 .../libs/bourbon/css3/_placeholder.scss | 0 .../libs/bourbon/css3/_radial-gradient.scss | 0 .../libs/bourbon/css3/_transform.scss | 0 .../libs/bourbon/css3/_transition.scss | 0 .../libs/bourbon/css3/_user-select.scss | 0 .../libs/bourbon/functions/_compact.scss | 0 .../libs/bourbon/functions/_flex-grid.scss | 0 .../libs/bourbon/functions/_grid-width.scss | 0 .../bourbon/functions/_linear-gradient.scss | 0 .../bourbon/functions/_modular-scale.scss | 0 .../libs/bourbon/functions/_px-to-em.scss | 0 .../bourbon/functions/_radial-gradient.scss | 0 .../libs/bourbon/functions/_tint-shade.scss | 0 .../functions/_transition-property-name.scss | 0 .../helpers/_deprecated-webkit-gradient.scss | 0 .../helpers/_gradient-positions-parser.scss | 0 .../helpers/_linear-positions-parser.scss | 0 .../bourbon/helpers/_radial-arg-parser.scss | 0 .../helpers/_radial-positions-parser.scss | 0 .../bourbon/helpers/_render-gradients.scss | 0 .../bourbon/helpers/_shape-size-stripper.scss | 0 scss/{ => partials}/libs/compass/_css3.scss | 0 scss/{ => partials}/libs/compass/_layout.scss | 0 .../{ => partials}/libs/compass/_plugins.scss | 0 .../libs/compass/_reset-legacy.scss | 0 scss/{ => partials}/libs/compass/_reset.scss | 0 .../{ => partials}/libs/compass/_support.scss | 0 .../libs/compass/_typography.scss | 0 .../libs/compass/_utilities.scss | 0 .../libs/compass/css3/_appearance.scss | 0 .../libs/compass/css3/_background-clip.scss | 0 .../libs/compass/css3/_background-origin.scss | 0 .../libs/compass/css3/_background-size.scss | 0 .../libs/compass/css3/_border-radius.scss | 0 .../libs/compass/css3/_box-shadow.scss | 0 .../libs/compass/css3/_box-sizing.scss | 0 .../libs/compass/css3/_box.scss | 0 .../libs/compass/css3/_columns.scss | 0 .../libs/compass/css3/_filter.scss | 0 .../libs/compass/css3/_font-face.scss | 0 .../libs/compass/css3/_hyphenation.scss | 0 .../libs/compass/css3/_images.scss | 0 .../libs/compass/css3/_inline-block.scss | 0 .../libs/compass/css3/_opacity.scss | 0 .../libs/compass/css3/_pie.scss | 0 .../libs/compass/css3/_regions.scss | 0 .../libs/compass/css3/_shared.scss | 0 .../libs/compass/css3/_text-shadow.scss | 0 .../libs/compass/css3/_transform-legacy.scss | 0 .../libs/compass/css3/_transform.scss | 0 .../libs/compass/css3/_transition.scss | 0 .../libs/compass/css3/_user-interface.scss | 0 .../libs/compass/layout/_grid-background.scss | 0 .../libs/compass/layout/_sticky-footer.scss | 0 .../libs/compass/layout/_stretching.scss | 0 .../libs/compass/reset/_utilities-legacy.scss | 0 .../libs/compass/reset/_utilities.scss | 0 .../libs/compass/typography/_links.scss | 0 .../libs/compass/typography/_lists.scss | 0 .../libs/compass/typography/_text.scss | 0 .../compass/typography/_vertical_rhythm.scss | 0 .../compass/typography/links/_hover-link.scss | 0 .../typography/links/_link-colors.scss | 0 .../typography/links/_unstyled-link.scss | 0 .../compass/typography/lists/_bullets.scss | 0 .../typography/lists/_horizontal-list.scss | 0 .../typography/lists/_inline-block-list.scss | 0 .../typography/lists/_inline-list.scss | 0 .../compass/typography/text/_ellipsis.scss | 0 .../compass/typography/text/_force-wrap.scss | 0 .../libs/compass/typography/text/_nowrap.scss | 0 .../compass/typography/text/_replacement.scss | 0 .../libs/compass/utilities/_color.scss | 0 .../libs/compass/utilities/_general.scss | 0 .../libs/compass/utilities/_links.scss | 0 .../libs/compass/utilities/_lists.scss | 0 .../libs/compass/utilities/_print.scss | 0 .../libs/compass/utilities/_sprites.scss | 0 .../libs/compass/utilities/_tables.scss | 0 .../libs/compass/utilities/_text.scss | 0 .../compass/utilities/color/_contrast.scss | 0 .../compass/utilities/general/_clearfix.scss | 0 .../compass/utilities/general/_float.scss | 0 .../compass/utilities/general/_hacks.scss | 0 .../libs/compass/utilities/general/_min.scss | 0 .../compass/utilities/general/_reset.scss | 0 .../libs/compass/utilities/general/_tabs.scss | 0 .../compass/utilities/general/_tag-cloud.scss | 0 .../compass/utilities/links/_hover-link.scss | 0 .../compass/utilities/links/_link-colors.scss | 0 .../utilities/links/_unstyled-link.scss | 0 .../compass/utilities/lists/_bullets.scss | 0 .../utilities/lists/_horizontal-list.scss | 0 .../utilities/lists/_inline-block-list.scss | 0 .../compass/utilities/lists/_inline-list.scss | 0 .../libs/compass/utilities/sprites/_base.scss | 0 .../utilities/sprites/_sprite-img.scss | 0 .../tables/_alternating-rows-and-columns.scss | 0 .../compass/utilities/tables/_borders.scss | 0 .../utilities/tables/_scaffolding.scss | 0 .../compass/utilities/text/_ellipsis.scss | 0 .../libs/compass/utilities/text/_nowrap.scss | 0 .../compass/utilities/text/_replacement.scss | 0 scss/partials/plugins/_colorbox.scss | 96 ++ scss/partials/plugins/_flexslider.scss | 58 ++ scss/{ => partials}/plugins/_hashgrid.scss | 12 +- scss/{ => partials}/project/_layout.scss | 0 scss/{ => partials}/project/_pages.scss | 0 scss/{ => partials}/project/_ui.scss | 0 scss/partials/project/layout/_content.scss | 28 + .../project/layout/_footer.scss | 0 .../project/layout/_header.scss | 0 scss/{ => partials}/project/print/_print.scss | 0 .../{ => partials}/project/ui/_font-face.scss | 0 scss/{ => partials}/project/ui/_forms.scss | 0 scss/{ => partials}/project/ui/_generic.scss | 2 +- scss/{ => partials}/project/ui/_sprites.scss | 0 scss/print.scss | 10 +- scss/project/layout/_content.scss | 6 - scss/styles-doc.scss | 8 +- scss/styles-lte-ie8.scss | 10 +- scss/styles.scss | 10 +- 176 files changed, 3172 insertions(+), 45 deletions(-) create mode 100755 assets/swf/demo.jpg create mode 100755 assets/swf/demo.swf create mode 100755 inc/content/index.php rename scss/{core => partials}/_config.scss (89%) rename scss/{ => partials}/_core.scss (77%) rename scss/{ => partials}/_doc.scss (100%) rename scss/{ => partials}/_libs.scss (100%) rename scss/{ => partials}/_plugins.scss (100%) rename scss/{ => partials}/_project.scss (100%) rename scss/{ => partials}/core/_mixins.scss (98%) rename scss/{ => partials}/core/_mq.scss (100%) rename scss/{ => partials}/doc/_print.scss (100%) rename scss/{ => partials}/doc/_screen.scss (100%) rename scss/{ => partials}/libs/_bourbon.scss (100%) rename scss/{ => partials}/libs/_compass.scss (100%) rename scss/{ => partials}/libs/_normalize.scss (100%) rename scss/{ => partials}/libs/bourbon/_bourbon-deprecated-upcoming.scss (100%) rename scss/{ => partials}/libs/bourbon/addons/_button.scss (100%) rename scss/{ => partials}/libs/bourbon/addons/_clearfix.scss (100%) rename scss/{ => partials}/libs/bourbon/addons/_font-family.scss (100%) rename scss/{ => partials}/libs/bourbon/addons/_hide-text.scss (100%) rename scss/{ => partials}/libs/bourbon/addons/_html5-input-types.scss (100%) rename scss/{ => partials}/libs/bourbon/addons/_position.scss (100%) rename scss/{ => partials}/libs/bourbon/addons/_prefixer.scss (100%) rename scss/{ => partials}/libs/bourbon/addons/_retina-image.scss (100%) rename scss/{ => partials}/libs/bourbon/addons/_size.scss (100%) rename scss/{ => partials}/libs/bourbon/addons/_timing-functions.scss (100%) rename scss/{ => partials}/libs/bourbon/addons/_triangle.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_animation.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_appearance.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_backface-visibility.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_background-image.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_background.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_border-image.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_border-radius.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_box-sizing.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_columns.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_flex-box.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_font-face.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_hidpi-media-query.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_image-rendering.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_inline-block.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_keyframes.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_linear-gradient.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_perspective.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_placeholder.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_radial-gradient.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_transform.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_transition.scss (100%) rename scss/{ => partials}/libs/bourbon/css3/_user-select.scss (100%) rename scss/{ => partials}/libs/bourbon/functions/_compact.scss (100%) rename scss/{ => partials}/libs/bourbon/functions/_flex-grid.scss (100%) rename scss/{ => partials}/libs/bourbon/functions/_grid-width.scss (100%) rename scss/{ => partials}/libs/bourbon/functions/_linear-gradient.scss (100%) rename scss/{ => partials}/libs/bourbon/functions/_modular-scale.scss (100%) rename scss/{ => partials}/libs/bourbon/functions/_px-to-em.scss (100%) rename scss/{ => partials}/libs/bourbon/functions/_radial-gradient.scss (100%) rename scss/{ => partials}/libs/bourbon/functions/_tint-shade.scss (100%) rename scss/{ => partials}/libs/bourbon/functions/_transition-property-name.scss (100%) rename scss/{ => partials}/libs/bourbon/helpers/_deprecated-webkit-gradient.scss (100%) rename scss/{ => partials}/libs/bourbon/helpers/_gradient-positions-parser.scss (100%) rename scss/{ => partials}/libs/bourbon/helpers/_linear-positions-parser.scss (100%) rename scss/{ => partials}/libs/bourbon/helpers/_radial-arg-parser.scss (100%) rename scss/{ => partials}/libs/bourbon/helpers/_radial-positions-parser.scss (100%) rename scss/{ => partials}/libs/bourbon/helpers/_render-gradients.scss (100%) rename scss/{ => partials}/libs/bourbon/helpers/_shape-size-stripper.scss (100%) rename scss/{ => partials}/libs/compass/_css3.scss (100%) rename scss/{ => partials}/libs/compass/_layout.scss (100%) rename scss/{ => partials}/libs/compass/_plugins.scss (100%) rename scss/{ => partials}/libs/compass/_reset-legacy.scss (100%) rename scss/{ => partials}/libs/compass/_reset.scss (100%) rename scss/{ => partials}/libs/compass/_support.scss (100%) rename scss/{ => partials}/libs/compass/_typography.scss (100%) rename scss/{ => partials}/libs/compass/_utilities.scss (100%) rename scss/{ => partials}/libs/compass/css3/_appearance.scss (100%) rename scss/{ => partials}/libs/compass/css3/_background-clip.scss (100%) rename scss/{ => partials}/libs/compass/css3/_background-origin.scss (100%) rename scss/{ => partials}/libs/compass/css3/_background-size.scss (100%) rename scss/{ => partials}/libs/compass/css3/_border-radius.scss (100%) rename scss/{ => partials}/libs/compass/css3/_box-shadow.scss (100%) rename scss/{ => partials}/libs/compass/css3/_box-sizing.scss (100%) rename scss/{ => partials}/libs/compass/css3/_box.scss (100%) rename scss/{ => partials}/libs/compass/css3/_columns.scss (100%) rename scss/{ => partials}/libs/compass/css3/_filter.scss (100%) rename scss/{ => partials}/libs/compass/css3/_font-face.scss (100%) rename scss/{ => partials}/libs/compass/css3/_hyphenation.scss (100%) rename scss/{ => partials}/libs/compass/css3/_images.scss (100%) rename scss/{ => partials}/libs/compass/css3/_inline-block.scss (100%) rename scss/{ => partials}/libs/compass/css3/_opacity.scss (100%) rename scss/{ => partials}/libs/compass/css3/_pie.scss (100%) rename scss/{ => partials}/libs/compass/css3/_regions.scss (100%) rename scss/{ => partials}/libs/compass/css3/_shared.scss (100%) rename scss/{ => partials}/libs/compass/css3/_text-shadow.scss (100%) rename scss/{ => partials}/libs/compass/css3/_transform-legacy.scss (100%) rename scss/{ => partials}/libs/compass/css3/_transform.scss (100%) rename scss/{ => partials}/libs/compass/css3/_transition.scss (100%) rename scss/{ => partials}/libs/compass/css3/_user-interface.scss (100%) rename scss/{ => partials}/libs/compass/layout/_grid-background.scss (100%) rename scss/{ => partials}/libs/compass/layout/_sticky-footer.scss (100%) rename scss/{ => partials}/libs/compass/layout/_stretching.scss (100%) rename scss/{ => partials}/libs/compass/reset/_utilities-legacy.scss (100%) rename scss/{ => partials}/libs/compass/reset/_utilities.scss (100%) rename scss/{ => partials}/libs/compass/typography/_links.scss (100%) rename scss/{ => partials}/libs/compass/typography/_lists.scss (100%) rename scss/{ => partials}/libs/compass/typography/_text.scss (100%) rename scss/{ => partials}/libs/compass/typography/_vertical_rhythm.scss (100%) rename scss/{ => partials}/libs/compass/typography/links/_hover-link.scss (100%) rename scss/{ => partials}/libs/compass/typography/links/_link-colors.scss (100%) rename scss/{ => partials}/libs/compass/typography/links/_unstyled-link.scss (100%) rename scss/{ => partials}/libs/compass/typography/lists/_bullets.scss (100%) rename scss/{ => partials}/libs/compass/typography/lists/_horizontal-list.scss (100%) rename scss/{ => partials}/libs/compass/typography/lists/_inline-block-list.scss (100%) rename scss/{ => partials}/libs/compass/typography/lists/_inline-list.scss (100%) rename scss/{ => partials}/libs/compass/typography/text/_ellipsis.scss (100%) rename scss/{ => partials}/libs/compass/typography/text/_force-wrap.scss (100%) rename scss/{ => partials}/libs/compass/typography/text/_nowrap.scss (100%) rename scss/{ => partials}/libs/compass/typography/text/_replacement.scss (100%) rename scss/{ => partials}/libs/compass/utilities/_color.scss (100%) rename scss/{ => partials}/libs/compass/utilities/_general.scss (100%) rename scss/{ => partials}/libs/compass/utilities/_links.scss (100%) rename scss/{ => partials}/libs/compass/utilities/_lists.scss (100%) rename scss/{ => partials}/libs/compass/utilities/_print.scss (100%) rename scss/{ => partials}/libs/compass/utilities/_sprites.scss (100%) rename scss/{ => partials}/libs/compass/utilities/_tables.scss (100%) rename scss/{ => partials}/libs/compass/utilities/_text.scss (100%) rename scss/{ => partials}/libs/compass/utilities/color/_contrast.scss (100%) rename scss/{ => partials}/libs/compass/utilities/general/_clearfix.scss (100%) rename scss/{ => partials}/libs/compass/utilities/general/_float.scss (100%) rename scss/{ => partials}/libs/compass/utilities/general/_hacks.scss (100%) rename scss/{ => partials}/libs/compass/utilities/general/_min.scss (100%) rename scss/{ => partials}/libs/compass/utilities/general/_reset.scss (100%) rename scss/{ => partials}/libs/compass/utilities/general/_tabs.scss (100%) rename scss/{ => partials}/libs/compass/utilities/general/_tag-cloud.scss (100%) rename scss/{ => partials}/libs/compass/utilities/links/_hover-link.scss (100%) rename scss/{ => partials}/libs/compass/utilities/links/_link-colors.scss (100%) rename scss/{ => partials}/libs/compass/utilities/links/_unstyled-link.scss (100%) rename scss/{ => partials}/libs/compass/utilities/lists/_bullets.scss (100%) rename scss/{ => partials}/libs/compass/utilities/lists/_horizontal-list.scss (100%) rename scss/{ => partials}/libs/compass/utilities/lists/_inline-block-list.scss (100%) rename scss/{ => partials}/libs/compass/utilities/lists/_inline-list.scss (100%) rename scss/{ => partials}/libs/compass/utilities/sprites/_base.scss (100%) rename scss/{ => partials}/libs/compass/utilities/sprites/_sprite-img.scss (100%) rename scss/{ => partials}/libs/compass/utilities/tables/_alternating-rows-and-columns.scss (100%) rename scss/{ => partials}/libs/compass/utilities/tables/_borders.scss (100%) rename scss/{ => partials}/libs/compass/utilities/tables/_scaffolding.scss (100%) rename scss/{ => partials}/libs/compass/utilities/text/_ellipsis.scss (100%) rename scss/{ => partials}/libs/compass/utilities/text/_nowrap.scss (100%) rename scss/{ => partials}/libs/compass/utilities/text/_replacement.scss (100%) create mode 100755 scss/partials/plugins/_colorbox.scss create mode 100755 scss/partials/plugins/_flexslider.scss rename scss/{ => partials}/plugins/_hashgrid.scss (89%) rename scss/{ => partials}/project/_layout.scss (100%) rename scss/{ => partials}/project/_pages.scss (100%) rename scss/{ => partials}/project/_ui.scss (100%) create mode 100755 scss/partials/project/layout/_content.scss rename scss/{ => partials}/project/layout/_footer.scss (100%) rename scss/{ => partials}/project/layout/_header.scss (100%) rename scss/{ => partials}/project/print/_print.scss (100%) rename scss/{ => partials}/project/ui/_font-face.scss (100%) rename scss/{ => partials}/project/ui/_forms.scss (100%) rename scss/{ => partials}/project/ui/_generic.scss (99%) rename scss/{ => partials}/project/ui/_sprites.scss (100%) delete mode 100755 scss/project/layout/_content.scss diff --git a/assets/css/print.css b/assets/css/print.css index fe50819..300de12 100644 --- a/assets/css/print.css +++ b/assets/css/print.css @@ -1 +1,540 @@ -/* normalize.css v1.1.2 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-size:100%;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}html,button,input,select,textarea{font-family:sans-serif}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:0.67em 0}h2{font-size:1.5em;margin:0.83em 0}h3{font-size:1.17em;margin:1em 0}h4{font-size:1em;margin:1.33em 0}h5{font-size:0.83em;margin:1.67em 0}h6{font-size:0.67em;margin:2.33em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}blockquote{margin:1em 40px}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}p,pre{margin:1em 0}code,kbd,pre,samp{font-family:monospace, serif;_font-family:'courier new', monospace;font-size:1em}pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word}q{quotes:none}q:before,q:after{content:'';content:none}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}dl,menu,ol,ul{margin:1em 0}dd{margin:0 0 0 40px}menu,ol,ul{padding:0 0 0 40px}nav ul,nav ol{list-style:none;list-style-image:none}img{border:0;-ms-interpolation-mode:bicubic}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0;white-space:normal;*margin-left:-7px}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;*overflow:visible}button[disabled],html input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*height:13px;*width:13px}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0} +/** --- @section PRINT CSS --- */ +/** --- @section PROJECT CONFIG --- */ +/** RWD breakpints */ +/** Shortcuts */ +/** IE compatibility */ +/** --- @section LIBS --- */ +/** --- @section LIBS/NORMALIZE --- */ +/* normalize.css v1.1.2 | MIT License | git.io/normalize */ +/* ========================================================================== + HTML5 display definitions + ========================================================================== */ +/** + * Correct `block` display not defined in IE 6/7/8/9 and Firefox 3. + */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} + +/** + * Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. + */ +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address styling not present in IE 7/8/9, Firefox 3, and Safari 4. + * Known issue: no IE 6 support. + */ +[hidden] { + display: none; +} + +/* ========================================================================== + Base + ========================================================================== */ +/** + * 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using + * `em` units. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ +html { + font-size: 100%; + /* 1 */ + -ms-text-size-adjust: 100%; + /* 2 */ + -webkit-text-size-adjust: 100%; + /* 2 */ +} + +/** + * Address `font-family` inconsistency between `textarea` and other form + * elements. + */ +html, +button, +input, +select, +textarea { + font-family: sans-serif; +} + +/** + * Address margins handled incorrectly in IE 6/7. + */ +body { + margin: 0; +} + +/* ========================================================================== + Links + ========================================================================== */ +/** + * Address `outline` inconsistency between Chrome and other browsers. + */ +a:focus { + outline: thin dotted; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ +a:active, +a:hover { + outline: 0; +} + +/* ========================================================================== + Typography + ========================================================================== */ +/** + * Address font sizes and margins set differently in IE 6/7. + * Address font sizes within `section` and `article` in Firefox 4+, Safari 5, + * and Chrome. + */ +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +h2 { + font-size: 1.5em; + margin: 0.83em 0; +} + +h3 { + font-size: 1.17em; + margin: 1em 0; +} + +h4 { + font-size: 1em; + margin: 1.33em 0; +} + +h5 { + font-size: 0.83em; + margin: 1.67em 0; +} + +h6 { + font-size: 0.67em; + margin: 2.33em 0; +} + +/** + * Address styling not present in IE 7/8/9, Safari 5, and Chrome. + */ +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome. + */ +b, +strong { + font-weight: bold; +} + +blockquote { + margin: 1em 40px; +} + +/** + * Address styling not present in Safari 5 and Chrome. + */ +dfn { + font-style: italic; +} + +/** + * Address differences between Firefox and other browsers. + * Known issue: no IE 6/7 normalization. + */ +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Address styling not present in IE 6/7/8/9. + */ +mark { + background: #ff0; + color: #000; +} + +/** + * Address margins set differently in IE 6/7. + */ +p, +pre { + margin: 1em 0; +} + +/** + * Correct font family set oddly in IE 6, Safari 4/5, and Chrome. + */ +code, +kbd, +pre, +samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; +} + +/** + * Improve readability of pre-formatted text in all browsers. + */ +pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} + +/** + * Address CSS quotes not supported in IE 6/7. + */ +q { + quotes: none; +} + +/** + * Address `quotes` property not supported in Safari 4. + */ +q:before, +q:after { + content: ''; + content: none; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* ========================================================================== + Lists + ========================================================================== */ +/** + * Address margins set differently in IE 6/7. + */ +dl, +menu, +ol, +ul { + margin: 1em 0; +} + +dd { + margin: 0 0 0 40px; +} + +/** + * Address paddings set differently in IE 6/7. + */ +menu, +ol, +ul { + padding: 0 0 0 40px; +} + +/** + * Correct list images handled incorrectly in IE 7. + */ +nav ul, +nav ol { + list-style: none; + list-style-image: none; +} + +/* ========================================================================== + Embedded content + ========================================================================== */ +/** + * 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3. + * 2. Improve image quality when scaled in IE 7. + */ +img { + border: 0; + /* 1 */ + -ms-interpolation-mode: bicubic; + /* 2 */ +} + +/** + * Correct overflow displayed oddly in IE 9. + */ +svg:not(:root) { + overflow: hidden; +} + +/* ========================================================================== + Figures + ========================================================================== */ +/** + * Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11. + */ +figure { + margin: 0; +} + +/* ========================================================================== + Forms + ========================================================================== */ +/** + * Correct margin displayed oddly in IE 6/7. + */ +form { + margin: 0; +} + +/** + * Define consistent border, margin, and padding. + */ +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct color not being inherited in IE 6/7/8/9. + * 2. Correct text not wrapping in Firefox 3. + * 3. Correct alignment displayed oddly in IE 6/7. + */ +legend { + border: 0; + /* 1 */ + padding: 0; + white-space: normal; + /* 2 */ + *margin-left: -7px; + /* 3 */ +} + +/** + * 1. Correct font size not being inherited in all browsers. + * 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5, + * and Chrome. + * 3. Improve appearance and consistency in all browsers. + */ +button, +input, +select, +textarea { + font-size: 100%; + /* 1 */ + margin: 0; + /* 2 */ + vertical-align: baseline; + /* 3 */ + *vertical-align: middle; + /* 3 */ +} + +/** + * Address Firefox 3+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ +button, +input { + line-height: normal; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+. + * Correct `select` style inheritance in Firefox 4+ and Opera. + */ +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + * 4. Remove inner spacing in IE 7 without affecting normal text inputs. + * Known issue: inner spacing remains in IE 6. + */ +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + /* 2 */ + cursor: pointer; + /* 3 */ + *overflow: visible; + /* 4 */ +} + +/** + * Re-set default cursor for disabled elements. + */ +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * 1. Address box sizing set to content-box in IE 8/9. + * 2. Remove excess padding in IE 8/9. + * 3. Remove excess padding in IE 7. + * Known issue: excess padding remains in IE 6. + */ +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ + *height: 13px; + /* 3 */ + *width: 13px; + /* 3 */ +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome + * (include `-moz` to future-proof). + */ +input[type="search"] { + -webkit-appearance: textfield; + /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari 5 and Chrome + * on OS X. + */ +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Remove inner padding and border in Firefox 3+. + */ +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * 1. Remove default vertical scrollbar in IE 6/7/8/9. + * 2. Improve readability and alignment in all browsers. + */ +textarea { + overflow: auto; + /* 1 */ + vertical-align: top; + /* 2 */ +} + +/* ========================================================================== + Tables + ========================================================================== */ +/** + * Remove most spacing between table cells. + */ +table { + border-collapse: collapse; + border-spacing: 0; +} + +/** --- @section CORE --- */ +/** --- @section CUSTOM MIXINS --- */ +/* -------------------------------------------------------------------------- */ +/** @subsection EM calculator */ +/** @author https://gist.github.com/ijy/1441967 */ +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ +/** + * Hide an element but keep it accessible to screen readers + * @author http://developer.yahoo.com/blogs/ydn/clip-hidden-content-better-accessibility-53456.html + */ +/** https://github.com/guardian/sass-mq */ +/** --- @section UI/FONT-FACE --- */ +/* +@font-face +{ + font-family: 'exemple'; + + src: url('../font/exemple.eot'); + src: url('../font/exemple.eot?#iefix') format('embedded-opentype'), + url('../font/exemple.woff') format('woff'), + url('../font/exemple.ttf') format('truetype'); + + font-weight: normal; + font-style: normal; +} +@mixin exemple +{ + font-family: 'exemple', + sans-serif; +} +*/ +/** --- @section PRINT --- */ diff --git a/assets/css/styles-doc.css b/assets/css/styles-doc.css index 4acbf2b..7aaeae0 100644 --- a/assets/css/styles-doc.css +++ b/assets/css/styles-doc.css @@ -1 +1,585 @@ -/* normalize.css v1.1.2 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-size:100%;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}html,button,input,select,textarea{font-family:sans-serif}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:0.67em 0}h2{font-size:1.5em;margin:0.83em 0}h3{font-size:1.17em;margin:1em 0}h4{font-size:1em;margin:1.33em 0}h5{font-size:0.83em;margin:1.67em 0}h6{font-size:0.67em;margin:2.33em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}blockquote{margin:1em 40px}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}p,pre{margin:1em 0}code,kbd,pre,samp{font-family:monospace, serif;_font-family:'courier new', monospace;font-size:1em}pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word}q{quotes:none}q:before,q:after{content:'';content:none}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}dl,menu,ol,ul{margin:1em 0}dd{margin:0 0 0 40px}menu,ol,ul{padding:0 0 0 40px}nav ul,nav ol{list-style:none;list-style-image:none}img{border:0;-ms-interpolation-mode:bicubic}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0;white-space:normal;*margin-left:-7px}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;*overflow:visible}button[disabled],html input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*height:13px;*width:13px}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}body{background-color:white}.page-index,.doc{width:58.75em;margin-right:auto;margin-left:auto;padding-right:1.25em;padding-left:1.25em;*zoom:1}.page-index:after,.doc:after{content:"";display:table;clear:both}.page-index img,.doc img{max-width:100%}.page-index h1,.page-index h2,.page-index h3,.page-index h4,.doc h1,.doc h2,.doc h3,.doc h4{padding-top:0}.page-index table,.doc table{font-size:0.875em;line-height:1.71428571em;margin-bottom:1.71428571em;width:100%}.page-index td,.page-index th,.doc td,.doc th{text-align:left;padding-left:0.71428571em;border:1px solid #333;padding-top:0.85714286em;padding-bottom:0.85714286em}.page-index th,.doc th{white-space:nowrap}.page-index #footnotes,.doc #footnotes{font-size:0.6875em;line-height:2.18181818em;margin-bottom:2.18181818em}.page-index #footnotes p,.doc #footnotes p{margin-bottom:0} +/** --- @section DOC CSS --- */ +/** --- @section PROJECT CONFIG --- */ +/** RWD breakpints */ +/** Shortcuts */ +/** IE compatibility */ +/** --- @section LIBS --- */ +/** --- @section LIBS/NORMALIZE --- */ +/* normalize.css v1.1.2 | MIT License | git.io/normalize */ +/* ========================================================================== + HTML5 display definitions + ========================================================================== */ +/** + * Correct `block` display not defined in IE 6/7/8/9 and Firefox 3. + */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} + +/** + * Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. + */ +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address styling not present in IE 7/8/9, Firefox 3, and Safari 4. + * Known issue: no IE 6 support. + */ +[hidden] { + display: none; +} + +/* ========================================================================== + Base + ========================================================================== */ +/** + * 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using + * `em` units. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ +html { + font-size: 100%; + /* 1 */ + -ms-text-size-adjust: 100%; + /* 2 */ + -webkit-text-size-adjust: 100%; + /* 2 */ +} + +/** + * Address `font-family` inconsistency between `textarea` and other form + * elements. + */ +html, +button, +input, +select, +textarea { + font-family: sans-serif; +} + +/** + * Address margins handled incorrectly in IE 6/7. + */ +body { + margin: 0; +} + +/* ========================================================================== + Links + ========================================================================== */ +/** + * Address `outline` inconsistency between Chrome and other browsers. + */ +a:focus { + outline: thin dotted; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ +a:active, +a:hover { + outline: 0; +} + +/* ========================================================================== + Typography + ========================================================================== */ +/** + * Address font sizes and margins set differently in IE 6/7. + * Address font sizes within `section` and `article` in Firefox 4+, Safari 5, + * and Chrome. + */ +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +h2 { + font-size: 1.5em; + margin: 0.83em 0; +} + +h3 { + font-size: 1.17em; + margin: 1em 0; +} + +h4 { + font-size: 1em; + margin: 1.33em 0; +} + +h5 { + font-size: 0.83em; + margin: 1.67em 0; +} + +h6 { + font-size: 0.67em; + margin: 2.33em 0; +} + +/** + * Address styling not present in IE 7/8/9, Safari 5, and Chrome. + */ +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome. + */ +b, +strong { + font-weight: bold; +} + +blockquote { + margin: 1em 40px; +} + +/** + * Address styling not present in Safari 5 and Chrome. + */ +dfn { + font-style: italic; +} + +/** + * Address differences between Firefox and other browsers. + * Known issue: no IE 6/7 normalization. + */ +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Address styling not present in IE 6/7/8/9. + */ +mark { + background: #ff0; + color: #000; +} + +/** + * Address margins set differently in IE 6/7. + */ +p, +pre { + margin: 1em 0; +} + +/** + * Correct font family set oddly in IE 6, Safari 4/5, and Chrome. + */ +code, +kbd, +pre, +samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; +} + +/** + * Improve readability of pre-formatted text in all browsers. + */ +pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} + +/** + * Address CSS quotes not supported in IE 6/7. + */ +q { + quotes: none; +} + +/** + * Address `quotes` property not supported in Safari 4. + */ +q:before, +q:after { + content: ''; + content: none; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* ========================================================================== + Lists + ========================================================================== */ +/** + * Address margins set differently in IE 6/7. + */ +dl, +menu, +ol, +ul { + margin: 1em 0; +} + +dd { + margin: 0 0 0 40px; +} + +/** + * Address paddings set differently in IE 6/7. + */ +menu, +ol, +ul { + padding: 0 0 0 40px; +} + +/** + * Correct list images handled incorrectly in IE 7. + */ +nav ul, +nav ol { + list-style: none; + list-style-image: none; +} + +/* ========================================================================== + Embedded content + ========================================================================== */ +/** + * 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3. + * 2. Improve image quality when scaled in IE 7. + */ +img { + border: 0; + /* 1 */ + -ms-interpolation-mode: bicubic; + /* 2 */ +} + +/** + * Correct overflow displayed oddly in IE 9. + */ +svg:not(:root) { + overflow: hidden; +} + +/* ========================================================================== + Figures + ========================================================================== */ +/** + * Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11. + */ +figure { + margin: 0; +} + +/* ========================================================================== + Forms + ========================================================================== */ +/** + * Correct margin displayed oddly in IE 6/7. + */ +form { + margin: 0; +} + +/** + * Define consistent border, margin, and padding. + */ +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct color not being inherited in IE 6/7/8/9. + * 2. Correct text not wrapping in Firefox 3. + * 3. Correct alignment displayed oddly in IE 6/7. + */ +legend { + border: 0; + /* 1 */ + padding: 0; + white-space: normal; + /* 2 */ + *margin-left: -7px; + /* 3 */ +} + +/** + * 1. Correct font size not being inherited in all browsers. + * 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5, + * and Chrome. + * 3. Improve appearance and consistency in all browsers. + */ +button, +input, +select, +textarea { + font-size: 100%; + /* 1 */ + margin: 0; + /* 2 */ + vertical-align: baseline; + /* 3 */ + *vertical-align: middle; + /* 3 */ +} + +/** + * Address Firefox 3+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ +button, +input { + line-height: normal; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+. + * Correct `select` style inheritance in Firefox 4+ and Opera. + */ +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + * 4. Remove inner spacing in IE 7 without affecting normal text inputs. + * Known issue: inner spacing remains in IE 6. + */ +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + /* 2 */ + cursor: pointer; + /* 3 */ + *overflow: visible; + /* 4 */ +} + +/** + * Re-set default cursor for disabled elements. + */ +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * 1. Address box sizing set to content-box in IE 8/9. + * 2. Remove excess padding in IE 8/9. + * 3. Remove excess padding in IE 7. + * Known issue: excess padding remains in IE 6. + */ +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ + *height: 13px; + /* 3 */ + *width: 13px; + /* 3 */ +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome + * (include `-moz` to future-proof). + */ +input[type="search"] { + -webkit-appearance: textfield; + /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari 5 and Chrome + * on OS X. + */ +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Remove inner padding and border in Firefox 3+. + */ +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * 1. Remove default vertical scrollbar in IE 6/7/8/9. + * 2. Improve readability and alignment in all browsers. + */ +textarea { + overflow: auto; + /* 1 */ + vertical-align: top; + /* 2 */ +} + +/* ========================================================================== + Tables + ========================================================================== */ +/** + * Remove most spacing between table cells. + */ +table { + border-collapse: collapse; + border-spacing: 0; +} + +/** --- @section CORE --- */ +/** --- @section CUSTOM MIXINS --- */ +/* -------------------------------------------------------------------------- */ +/** @subsection EM calculator */ +/** @author https://gist.github.com/ijy/1441967 */ +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ +/** + * Hide an element but keep it accessible to screen readers + * @author http://developer.yahoo.com/blogs/ydn/clip-hidden-content-better-accessibility-53456.html + */ +/** https://github.com/guardian/sass-mq */ +/** --- @section DOC --- */ +/** --- @section DOCUMENTATION PRINT STYLES --- */ +/** --- @section DOCUMENTATION SCREEN STYLES --- */ +body { + background-color: white; +} + +.page-index, +.doc { + width: 72.30769231em; + margin-right: auto; + margin-left: auto; + padding-right: 1.53846154em; + padding-left: 1.53846154em; +} +.page-index:after, +.doc:after { + content: ""; + display: table; + clear: both; +} +.page-index img, +.doc img { + max-width: 100%; +} +.page-index h1, +.page-index h2, +.page-index h3, +.page-index h4, +.doc h1, +.doc h2, +.doc h3, +.doc h4 { + padding-top: 0; +} +.page-index table, +.doc table { + font-size: 1.07692308em; + line-height: 1.42857143em; + margin-bottom: 1.42857143em; + width: 100%; +} +.page-index td, +.page-index th, +.doc td, +.doc th { + text-align: left; + padding-left: 0.71428571em; + border: 1px solid #333; + padding-top: 0.71428571em; + padding-bottom: 0.71428571em; +} +.page-index th, +.doc th { + white-space: nowrap; +} +.page-index #footnotes, +.doc #footnotes { + font-size: 0.84615385em; + line-height: 1.81818182em; + margin-bottom: 1.81818182em; +} +.page-index #footnotes p, +.doc #footnotes p { + margin-bottom: 0; +} diff --git a/assets/css/styles-lte-ie8.css b/assets/css/styles-lte-ie8.css index 1b82b8f..9bd3b7b 100644 --- a/assets/css/styles-lte-ie8.css +++ b/assets/css/styles-lte-ie8.css @@ -1 +1,865 @@ -/* normalize.css v1.1.2 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-size:100%;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}html,button,input,select,textarea{font-family:sans-serif}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:0.67em 0}h2{font-size:1.5em;margin:0.83em 0}h3{font-size:1.17em;margin:1em 0}h4{font-size:1em;margin:1.33em 0}h5{font-size:0.83em;margin:1.67em 0}h6{font-size:0.67em;margin:2.33em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}blockquote{margin:1em 40px}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}p,pre{margin:1em 0}code,kbd,pre,samp{font-family:monospace, serif;_font-family:'courier new', monospace;font-size:1em}pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word}q{quotes:none}q:before,q:after{content:'';content:none}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}dl,menu,ol,ul{margin:1em 0}dd{margin:0 0 0 40px}menu,ol,ul{padding:0 0 0 40px}nav ul,nav ol{list-style:none;list-style-image:none}img{border:0;-ms-interpolation-mode:bicubic}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0;white-space:normal;*margin-left:-7px}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;*overflow:visible}button[disabled],html input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*height:13px;*width:13px}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}#grid{overflow:hidden;position:absolute;left:0;right:0;top:0;width:58.75em;margin-right:auto;margin-left:auto;padding-right:1.25em;padding-left:1.25em;*zoom:1}#grid:after{content:"";display:table;clear:both}#grid .vert-container{left:1.25em;right:1.25em}#grid .vert{width:3.75em;margin-left:1.25em;background-color:rgba(100,100,225,0.25);margin-right:0 !important}#grid .vert.first-child{margin-left:0}#grid .horiz{height:1.5em;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(95%, transparent), color-stop(95%, rgba(100,100,225,0.25)));background-image:-webkit-linear-gradient(transparent 95%,rgba(100,100,225,0.25) 95%);background-image:-moz-linear-gradient(transparent 95%,rgba(100,100,225,0.25) 95%);background-image:-o-linear-gradient(transparent 95%,rgba(100,100,225,0.25) 95%);background-image:linear-gradient(transparent 95%,rgba(100,100,225,0.25) 95%)}#grid.grid-1 .vert{background-color:transparent}#grid.grid-2 .horiz{background-image:none}body{font-size:100%;line-height:1.5em}body h6{margin:0;font-size:0.625em;line-height:2.4em;margin-bottom:2.4em;padding-top:4.8em}body h5{margin:0;font-size:0.8125em;line-height:1.84615385em;margin-bottom:1.84615385em;padding-top:3.69230769em}body h4{margin:0;font-size:1em;line-height:1.5em;margin-bottom:1.5em;padding-top:3em}body h3{margin:0;font-size:1.25em;line-height:1.2em;margin-bottom:1.2em;padding-top:2.4em}body h2{margin:0;font-size:1.5625em;line-height:1.92em;margin-bottom:0.96em;padding-top:1.92em}body h1{margin:0;font-size:1.9375em;line-height:1.5483871em;margin-bottom:0.77419355em;padding-top:1.5483871em}body h1+h2,body h2+h3,body h3+h4,body h4+h5,body h5+h6{padding-top:0}b,strong{font-weight:bold}blockquote{margin:0 80px;margin-bottom:1.5em}p,pre,address{margin:0;margin-bottom:1.5em}dl,menu,ol,ul{margin:0;margin-bottom:1.5em}dd{margin:0 0 0 80px}menu,ol,ul{padding:0 0 0 80px}fieldset{margin:0;padding:10px;padding-top:0.75em;padding-bottom:0.75em;margin-bottom:1.5em}table{margin-bottom:1.5em}td,th,caption{padding:10px;padding-top:0.75em;padding-bottom:0.75em}html{overflow-y:scroll}img,audio,video,canvas,svg,object,table{display:block;max-width:100%;height:auto}table{display:table}small{line-height:0}.hr{border-top-style:solid;border-top-width:1px;border-top-color:#000;margin-top:-1px;margin-bottom:1.5em}.hr hr{position:absolute;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0;margin:0;border:0;width:1px !important;height:1px;overflow:hidden}ul ol,ul ul,ol ol,ol ul{margin-bottom:0}.not-ie code,.not-ie kbd,.not-ie samp{line-height:0}.clearfix{*zoom:1}.clearfix:after{content:"";display:table;clear:both}.roll{text-decoration:none}.roll:hover,.roll:focus{text-decoration:underline}.hide{display:none}.mask{position:absolute;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0;margin:0;border:0;width:1px !important;height:1px;overflow:hidden}.unmask{position:relative;clip:auto;width:auto;height:auto;overflow:visible}.list{margin:0;padding:0;border:0;*zoom:1}.list:after{content:"";display:table;clear:both}.list li,.list dt,.list dd{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:0;padding-right:0;white-space:normal}.list li:first-child,.list li.first,.list dt:first-child,.list dt.first,.list dd:first-child,.list dd.first{padding-left:0}.list li:last-child,.list dt:last-child,.list dd:last-child{padding-right:0}.list li.last,.list dt.last,.list dd.last{padding-right:0}.l-content{width:58.75em;margin-right:auto;margin-left:auto;padding-right:1.25em;padding-left:1.25em;*zoom:1}.l-content:after{content:"";display:table;clear:both} +/** --- @section IE<9 CSS --- */ +/** --- @section PROJECT CONFIG --- */ +/** RWD breakpints */ +/** Shortcuts */ +/** IE compatibility */ +/** --- @section LIBS --- */ +/** --- @section LIBS/NORMALIZE --- */ +/* normalize.css v1.1.2 | MIT License | git.io/normalize */ +/* ========================================================================== + HTML5 display definitions + ========================================================================== */ +/** + * Correct `block` display not defined in IE 6/7/8/9 and Firefox 3. + */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} + +/** + * Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. + */ +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address styling not present in IE 7/8/9, Firefox 3, and Safari 4. + * Known issue: no IE 6 support. + */ +[hidden] { + display: none; +} + +/* ========================================================================== + Base + ========================================================================== */ +/** + * 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using + * `em` units. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ +html { + font-size: 100%; + /* 1 */ + -ms-text-size-adjust: 100%; + /* 2 */ + -webkit-text-size-adjust: 100%; + /* 2 */ +} + +/** + * Address `font-family` inconsistency between `textarea` and other form + * elements. + */ +html, +button, +input, +select, +textarea { + font-family: sans-serif; +} + +/** + * Address margins handled incorrectly in IE 6/7. + */ +body { + margin: 0; +} + +/* ========================================================================== + Links + ========================================================================== */ +/** + * Address `outline` inconsistency between Chrome and other browsers. + */ +a:focus { + outline: thin dotted; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ +a:active, +a:hover { + outline: 0; +} + +/* ========================================================================== + Typography + ========================================================================== */ +/** + * Address font sizes and margins set differently in IE 6/7. + * Address font sizes within `section` and `article` in Firefox 4+, Safari 5, + * and Chrome. + */ +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +h2 { + font-size: 1.5em; + margin: 0.83em 0; +} + +h3 { + font-size: 1.17em; + margin: 1em 0; +} + +h4 { + font-size: 1em; + margin: 1.33em 0; +} + +h5 { + font-size: 0.83em; + margin: 1.67em 0; +} + +h6 { + font-size: 0.67em; + margin: 2.33em 0; +} + +/** + * Address styling not present in IE 7/8/9, Safari 5, and Chrome. + */ +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome. + */ +b, +strong { + font-weight: bold; +} + +blockquote { + margin: 1em 40px; +} + +/** + * Address styling not present in Safari 5 and Chrome. + */ +dfn { + font-style: italic; +} + +/** + * Address differences between Firefox and other browsers. + * Known issue: no IE 6/7 normalization. + */ +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Address styling not present in IE 6/7/8/9. + */ +mark { + background: #ff0; + color: #000; +} + +/** + * Address margins set differently in IE 6/7. + */ +p, +pre { + margin: 1em 0; +} + +/** + * Correct font family set oddly in IE 6, Safari 4/5, and Chrome. + */ +code, +kbd, +pre, +samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; +} + +/** + * Improve readability of pre-formatted text in all browsers. + */ +pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} + +/** + * Address CSS quotes not supported in IE 6/7. + */ +q { + quotes: none; +} + +/** + * Address `quotes` property not supported in Safari 4. + */ +q:before, +q:after { + content: ''; + content: none; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* ========================================================================== + Lists + ========================================================================== */ +/** + * Address margins set differently in IE 6/7. + */ +dl, +menu, +ol, +ul { + margin: 1em 0; +} + +dd { + margin: 0 0 0 40px; +} + +/** + * Address paddings set differently in IE 6/7. + */ +menu, +ol, +ul { + padding: 0 0 0 40px; +} + +/** + * Correct list images handled incorrectly in IE 7. + */ +nav ul, +nav ol { + list-style: none; + list-style-image: none; +} + +/* ========================================================================== + Embedded content + ========================================================================== */ +/** + * 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3. + * 2. Improve image quality when scaled in IE 7. + */ +img { + border: 0; + /* 1 */ + -ms-interpolation-mode: bicubic; + /* 2 */ +} + +/** + * Correct overflow displayed oddly in IE 9. + */ +svg:not(:root) { + overflow: hidden; +} + +/* ========================================================================== + Figures + ========================================================================== */ +/** + * Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11. + */ +figure { + margin: 0; +} + +/* ========================================================================== + Forms + ========================================================================== */ +/** + * Correct margin displayed oddly in IE 6/7. + */ +form { + margin: 0; +} + +/** + * Define consistent border, margin, and padding. + */ +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct color not being inherited in IE 6/7/8/9. + * 2. Correct text not wrapping in Firefox 3. + * 3. Correct alignment displayed oddly in IE 6/7. + */ +legend { + border: 0; + /* 1 */ + padding: 0; + white-space: normal; + /* 2 */ + *margin-left: -7px; + /* 3 */ +} + +/** + * 1. Correct font size not being inherited in all browsers. + * 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5, + * and Chrome. + * 3. Improve appearance and consistency in all browsers. + */ +button, +input, +select, +textarea { + font-size: 100%; + /* 1 */ + margin: 0; + /* 2 */ + vertical-align: baseline; + /* 3 */ + *vertical-align: middle; + /* 3 */ +} + +/** + * Address Firefox 3+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ +button, +input { + line-height: normal; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+. + * Correct `select` style inheritance in Firefox 4+ and Opera. + */ +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + * 4. Remove inner spacing in IE 7 without affecting normal text inputs. + * Known issue: inner spacing remains in IE 6. + */ +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + /* 2 */ + cursor: pointer; + /* 3 */ + *overflow: visible; + /* 4 */ +} + +/** + * Re-set default cursor for disabled elements. + */ +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * 1. Address box sizing set to content-box in IE 8/9. + * 2. Remove excess padding in IE 8/9. + * 3. Remove excess padding in IE 7. + * Known issue: excess padding remains in IE 6. + */ +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ + *height: 13px; + /* 3 */ + *width: 13px; + /* 3 */ +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome + * (include `-moz` to future-proof). + */ +input[type="search"] { + -webkit-appearance: textfield; + /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari 5 and Chrome + * on OS X. + */ +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Remove inner padding and border in Firefox 3+. + */ +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * 1. Remove default vertical scrollbar in IE 6/7/8/9. + * 2. Improve readability and alignment in all browsers. + */ +textarea { + overflow: auto; + /* 1 */ + vertical-align: top; + /* 2 */ +} + +/* ========================================================================== + Tables + ========================================================================== */ +/** + * Remove most spacing between table cells. + */ +table { + border-collapse: collapse; + border-spacing: 0; +} + +/** --- @section CORE --- */ +/** --- @section CUSTOM MIXINS --- */ +/* -------------------------------------------------------------------------- */ +/** @subsection EM calculator */ +/** @author https://gist.github.com/ijy/1441967 */ +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ +/** + * Hide an element but keep it accessible to screen readers + * @author http://developer.yahoo.com/blogs/ydn/clip-hidden-content-better-accessibility-53456.html + */ +/** https://github.com/guardian/sass-mq */ +/** --- @section JS PLUGINS --- */ +/** --- @section PLUGINS/#GRID --- */ +#grid { + overflow: hidden; + position: absolute; + left: 0; + right: 0; + top: 0; + width: 72.30769231em; + margin-right: auto; + margin-left: auto; + padding-right: 1.53846154em; + padding-left: 1.53846154em; +} +#grid:after { + content: ""; + display: table; + clear: both; +} +#grid .vert-container { + left: 1.53846154em; + right: 1.53846154em; +} +#grid .vert { + width: 4.61538462em; + margin-left: 1.53846154em; + background-color: rgba(100, 100, 225, 0.25); + margin-right: 0 !important; +} +#grid .vert.first-child { + margin-left: 0; +} +#grid .horiz { + height: 1.25em; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(95%, transparent), color-stop(95%, rgba(100, 100, 225, 0.25))); + background-image: -webkit-linear-gradient(transparent 95%, rgba(100, 100, 225, 0.25) 95%); + background-image: -moz-linear-gradient(transparent 95%, rgba(100, 100, 225, 0.25) 95%); + background-image: -o-linear-gradient(transparent 95%, rgba(100, 100, 225, 0.25) 95%); + background-image: linear-gradient(transparent 95%, rgba(100, 100, 225, 0.25) 95%); +} +#grid.grid-1 .vert { + background-color: transparent; +} +#grid.grid-2 .horiz { + background-image: none; +} + +/** --- @section PROJECT --- */ +/** --- @section UI ELEMENTS --- */ +/** --- @section UI/FONT-FACE --- */ +/* +@font-face +{ + font-family: 'exemple'; + + src: url('../font/exemple.eot'); + src: url('../font/exemple.eot?#iefix') format('embedded-opentype'), + url('../font/exemple.woff') format('woff'), + url('../font/exemple.ttf') format('truetype'); + + font-weight: normal; + font-style: normal; +} +@mixin exemple +{ + font-family: 'exemple', + sans-serif; +} +*/ +/** --- @section UI/SPRITES --- */ + /* +$exemple-layout: vertical; +$exemple-spacing: 32px; +@import 'bg/exemple/*.png'; + +@include all-exemple-sprites; +*/ +/* +appels : + +@include exemple-sprite(image); +@include exemple-sprite(image, $offset-x:100%); +*/ +/** --- @section UI/FORMS --- */ +/** --- @section GENERIC STYLES --- */ +body { + font-size: 81.25%; + line-height: 1.53846154em; +} +body h6 { + margin: 0; + font-size: 0.76923077em; + line-height: 2em; + margin-bottom: 2em; + padding-top: 4em; +} +body h5 { + margin: 0; + font-size: 1em; + line-height: 1.53846154em; + margin-bottom: 1.53846154em; + padding-top: 3.07692308em; +} +body h4 { + margin: 0; + font-size: 1.23076923em; + line-height: 1.25em; + margin-bottom: 1.25em; + padding-top: 2.5em; +} +body h3 { + margin: 0; + font-size: 1.53846154em; + line-height: 2em; + margin-bottom: 1em; + padding-top: 2em; +} +body h2 { + margin: 0; + font-size: 1.92307692em; + line-height: 1.6em; + margin-bottom: 0.8em; + padding-top: 1.6em; +} +body h1 { + margin: 0; + font-size: 2.38461538em; + line-height: 1.29032258em; + margin-bottom: 0.64516129em; + padding-top: 1.29032258em; +} +body h1 + h2, +body h2 + h3, +body h3 + h4, +body h4 + h5, +body h5 + h6 { + padding-top: 0; +} + +b, +strong { + font-weight: bold; +} + +blockquote { + margin: 0 80px; + margin-bottom: 1.53846154em; +} + +p, +pre, +address { + margin: 0; + margin-bottom: 1.53846154em; +} + +dl, +menu, +ol, +ul { + margin: 0; + margin-bottom: 1.53846154em; +} + +dd { + margin: 0 0 0 80px; +} + +menu, +ol, +ul { + padding: 0 0 0 80px; +} + +fieldset { + margin: 0; + padding: 10px; + padding-top: 0.76923077em; + padding-bottom: 0.76923077em; + margin-bottom: 1.53846154em; +} + +table { + margin-bottom: 1.53846154em; +} + +td, +th, +caption { + padding: 10px; + padding-top: 0.76923077em; + padding-bottom: 0.76923077em; +} + +html { + overflow-y: scroll; +} + +img, +audio, +video, +canvas, +svg, +object, +table { + display: block; + max-width: 100%; + height: auto; +} + +table { + display: table; +} + +small { + line-height: 0; +} + +.hr { + border-top-style: solid; + border-top-width: 1px; + border-top-color: black; + margin-top: -1px; + margin-bottom: 1.53846154em; +} +.hr hr { + position: absolute; + clip: rect(1px 1px 1px 1px); + clip: rect(1px, 1px, 1px, 1px); + padding: 0; + margin: 0; + border: 0; + width: 1px !important; + height: 1px; + overflow: hidden; +} + +ul ol, +ul ul, +ol ol, +ol ul { + margin-bottom: 0; +} + +.not-ie code, .not-ie +kbd, .not-ie +samp { + line-height: 0; +} + +.clearfix:after { + content: ""; + display: table; + clear: both; +} + +.roll { + text-decoration: none; +} +.roll:hover, .roll:focus { + text-decoration: underline; +} + +.hide { + display: none; +} + +.mask { + position: absolute; + clip: rect(1px 1px 1px 1px); + clip: rect(1px, 1px, 1px, 1px); + padding: 0; + margin: 0; + border: 0; + width: 1px !important; + height: 1px; + overflow: hidden; +} + +.unmask { + position: relative; + clip: auto; + width: auto; + height: auto; + overflow: visible; +} + +.list { + margin: 0; + padding: 0; + border: 0; +} +.list:after { + content: ""; + display: table; + clear: both; +} +.list li, +.list dt, +.list dd { + list-style-image: none; + list-style-type: none; + margin-left: 0; + white-space: nowrap; + display: inline; + float: left; + padding-left: 0; + padding-right: 0; + white-space: normal; +} +.list li:first-child, .list li.first, +.list dt:first-child, +.list dt.first, +.list dd:first-child, +.list dd.first { + padding-left: 0; +} +.list li:last-child, +.list dt:last-child, +.list dd:last-child { + padding-right: 0; +} +.list li.last, +.list dt.last, +.list dd.last { + padding-right: 0; +} + +/** --- @section LAYOUT --- */ +/** --- @section LAYOUT/HEADER --- */ +/** --- @section LAYOUT/CONTENT --- */ +.l-content { + width: 72.30769231em; + margin-right: auto; + margin-left: auto; + padding-right: 1.53846154em; + padding-left: 1.53846154em; +} +.l-content:after { + content: ""; + display: table; + clear: both; +} + +/** --- @section LAYOUT/FOOTER --- */ +/** --- @section PAGES --- */ diff --git a/assets/css/styles.css b/assets/css/styles.css index ffc0c05..fde71c2 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -1 +1,943 @@ -/* normalize.css v1.1.2 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-size:100%;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}html,button,input,select,textarea{font-family:sans-serif}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:0.67em 0}h2{font-size:1.5em;margin:0.83em 0}h3{font-size:1.17em;margin:1em 0}h4{font-size:1em;margin:1.33em 0}h5{font-size:0.83em;margin:1.67em 0}h6{font-size:0.67em;margin:2.33em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}blockquote{margin:1em 40px}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}p,pre{margin:1em 0}code,kbd,pre,samp{font-family:monospace, serif;_font-family:'courier new', monospace;font-size:1em}pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word}q{quotes:none}q:before,q:after{content:'';content:none}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}dl,menu,ol,ul{margin:1em 0}dd{margin:0 0 0 40px}menu,ol,ul{padding:0 0 0 40px}nav ul,nav ol{list-style:none;list-style-image:none}img{border:0;-ms-interpolation-mode:bicubic}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0;white-space:normal;*margin-left:-7px}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;*overflow:visible}button[disabled],html input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*height:13px;*width:13px}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}#grid{overflow:hidden;position:absolute;left:0;right:0;top:0}@media all and (min-width: 64em){#grid{width:58.75em;margin-right:auto;margin-left:auto;padding-right:1.25em;padding-left:1.25em;*zoom:1}#grid:after{content:"";display:table;clear:both}}@media all and (min-width: 87.5em){#grid{width:78.75em;margin-right:auto;margin-left:auto;padding-right:1.25em;padding-left:1.25em;*zoom:1}#grid:after{content:"";display:table;clear:both}}@media all and (max-width: 63.99em){#grid{width:38.75em;margin-right:auto;margin-left:auto;padding-right:1.25em;padding-left:1.25em;*zoom:1}#grid:after{content:"";display:table;clear:both}}@media all and (max-width: 37.49em){#grid{width:auto}}#grid .vert-container{left:1.25em;right:1.25em}#grid .vert{width:3.75em;margin-left:1.25em;background-color:rgba(100,100,225,0.25);margin-right:0 !important}#grid .vert.first-child{margin-left:0}@media all and (max-width: 37.49em){#grid .vert.first-child{width:100%}}#grid .horiz{height:1.5em;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(95%, transparent), color-stop(95%, rgba(100,100,225,0.25)));background-image:-webkit-linear-gradient(transparent 95%,rgba(100,100,225,0.25) 95%);background-image:-moz-linear-gradient(transparent 95%,rgba(100,100,225,0.25) 95%);background-image:-o-linear-gradient(transparent 95%,rgba(100,100,225,0.25) 95%);background-image:linear-gradient(transparent 95%,rgba(100,100,225,0.25) 95%)}#grid.grid-1 .vert{background-color:transparent}#grid.grid-2 .horiz{background-image:none}body{font-size:100%;line-height:1.5em}body h6{margin:0;font-size:0.625em;line-height:2.4em;margin-bottom:2.4em;padding-top:4.8em}body h5{margin:0;font-size:0.8125em;line-height:1.84615385em;margin-bottom:1.84615385em;padding-top:3.69230769em}body h4{margin:0;font-size:1em;line-height:1.5em;margin-bottom:1.5em;padding-top:3em}body h3{margin:0;font-size:1.25em;line-height:1.2em;margin-bottom:1.2em;padding-top:2.4em}body h2{margin:0;font-size:1.5625em;line-height:1.92em;margin-bottom:0.96em;padding-top:1.92em}body h1{margin:0;font-size:1.9375em;line-height:1.5483871em;margin-bottom:0.77419355em;padding-top:1.5483871em}body h1+h2,body h2+h3,body h3+h4,body h4+h5,body h5+h6{padding-top:0}b,strong{font-weight:bold}blockquote{margin:0 80px;margin-bottom:1.5em}p,pre,address{margin:0;margin-bottom:1.5em}dl,menu,ol,ul{margin:0;margin-bottom:1.5em}dd{margin:0 0 0 80px}menu,ol,ul{padding:0 0 0 80px}fieldset{margin:0;padding:10px;padding-top:0.75em;padding-bottom:0.75em;margin-bottom:1.5em}table{margin-bottom:1.5em}td,th,caption{padding:10px;padding-top:0.75em;padding-bottom:0.75em}html{overflow-y:scroll}img,audio,video,canvas,svg,object,table{display:block;max-width:100%;height:auto}table{display:table}small{line-height:0}.hr{border-top-style:solid;border-top-width:1px;border-top-color:#000;margin-top:-1px;margin-bottom:1.5em}.hr hr{position:absolute;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0;margin:0;border:0;width:1px !important;height:1px;overflow:hidden}ul ol,ul ul,ol ol,ol ul{margin-bottom:0}.not-ie code,.not-ie kbd,.not-ie samp{line-height:0}.clearfix{*zoom:1}.clearfix:after{content:"";display:table;clear:both}.roll{text-decoration:none}.roll:hover,.roll:focus{text-decoration:underline}.hide{display:none}.mask{position:absolute;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0;margin:0;border:0;width:1px !important;height:1px;overflow:hidden}.unmask{position:relative;clip:auto;width:auto;height:auto;overflow:visible}.list{margin:0;padding:0;border:0;*zoom:1}.list:after{content:"";display:table;clear:both}.list li,.list dt,.list dd{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:0;padding-right:0;white-space:normal}.list li:first-child,.list li.first,.list dt:first-child,.list dt.first,.list dd:first-child,.list dd.first{padding-left:0}.list li:last-child,.list dt:last-child,.list dd:last-child{padding-right:0}.list li.last,.list dt.last,.list dd.last{padding-right:0}.l-content{width:58.75em;margin-right:auto;margin-left:auto;padding-right:1.25em;padding-left:1.25em;*zoom:1}.l-content:after{content:"";display:table;clear:both} +/** --- @section SCREEN STYLES --- */ +/** NB: styles for Internet Explorer 8 and below are generated through styles-lte-ie8.scss */ +/** --- @section PROJECT CONFIG --- */ +/** RWD breakpints */ +/** Shortcuts */ +/** IE compatibility */ +/** --- @section LIBS --- */ +/** --- @section LIBS/NORMALIZE --- */ +/* normalize.css v1.1.2 | MIT License | git.io/normalize */ +/* ========================================================================== + HTML5 display definitions + ========================================================================== */ +/** + * Correct `block` display not defined in IE 6/7/8/9 and Firefox 3. + */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} + +/** + * Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. + */ +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address styling not present in IE 7/8/9, Firefox 3, and Safari 4. + * Known issue: no IE 6 support. + */ +[hidden] { + display: none; +} + +/* ========================================================================== + Base + ========================================================================== */ +/** + * 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using + * `em` units. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ +html { + font-size: 100%; + /* 1 */ + -ms-text-size-adjust: 100%; + /* 2 */ + -webkit-text-size-adjust: 100%; + /* 2 */ +} + +/** + * Address `font-family` inconsistency between `textarea` and other form + * elements. + */ +html, +button, +input, +select, +textarea { + font-family: sans-serif; +} + +/** + * Address margins handled incorrectly in IE 6/7. + */ +body { + margin: 0; +} + +/* ========================================================================== + Links + ========================================================================== */ +/** + * Address `outline` inconsistency between Chrome and other browsers. + */ +a:focus { + outline: thin dotted; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ +a:active, +a:hover { + outline: 0; +} + +/* ========================================================================== + Typography + ========================================================================== */ +/** + * Address font sizes and margins set differently in IE 6/7. + * Address font sizes within `section` and `article` in Firefox 4+, Safari 5, + * and Chrome. + */ +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +h2 { + font-size: 1.5em; + margin: 0.83em 0; +} + +h3 { + font-size: 1.17em; + margin: 1em 0; +} + +h4 { + font-size: 1em; + margin: 1.33em 0; +} + +h5 { + font-size: 0.83em; + margin: 1.67em 0; +} + +h6 { + font-size: 0.67em; + margin: 2.33em 0; +} + +/** + * Address styling not present in IE 7/8/9, Safari 5, and Chrome. + */ +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome. + */ +b, +strong { + font-weight: bold; +} + +blockquote { + margin: 1em 40px; +} + +/** + * Address styling not present in Safari 5 and Chrome. + */ +dfn { + font-style: italic; +} + +/** + * Address differences between Firefox and other browsers. + * Known issue: no IE 6/7 normalization. + */ +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Address styling not present in IE 6/7/8/9. + */ +mark { + background: #ff0; + color: #000; +} + +/** + * Address margins set differently in IE 6/7. + */ +p, +pre { + margin: 1em 0; +} + +/** + * Correct font family set oddly in IE 6, Safari 4/5, and Chrome. + */ +code, +kbd, +pre, +samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; +} + +/** + * Improve readability of pre-formatted text in all browsers. + */ +pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} + +/** + * Address CSS quotes not supported in IE 6/7. + */ +q { + quotes: none; +} + +/** + * Address `quotes` property not supported in Safari 4. + */ +q:before, +q:after { + content: ''; + content: none; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* ========================================================================== + Lists + ========================================================================== */ +/** + * Address margins set differently in IE 6/7. + */ +dl, +menu, +ol, +ul { + margin: 1em 0; +} + +dd { + margin: 0 0 0 40px; +} + +/** + * Address paddings set differently in IE 6/7. + */ +menu, +ol, +ul { + padding: 0 0 0 40px; +} + +/** + * Correct list images handled incorrectly in IE 7. + */ +nav ul, +nav ol { + list-style: none; + list-style-image: none; +} + +/* ========================================================================== + Embedded content + ========================================================================== */ +/** + * 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3. + * 2. Improve image quality when scaled in IE 7. + */ +img { + border: 0; + /* 1 */ + -ms-interpolation-mode: bicubic; + /* 2 */ +} + +/** + * Correct overflow displayed oddly in IE 9. + */ +svg:not(:root) { + overflow: hidden; +} + +/* ========================================================================== + Figures + ========================================================================== */ +/** + * Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11. + */ +figure { + margin: 0; +} + +/* ========================================================================== + Forms + ========================================================================== */ +/** + * Correct margin displayed oddly in IE 6/7. + */ +form { + margin: 0; +} + +/** + * Define consistent border, margin, and padding. + */ +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct color not being inherited in IE 6/7/8/9. + * 2. Correct text not wrapping in Firefox 3. + * 3. Correct alignment displayed oddly in IE 6/7. + */ +legend { + border: 0; + /* 1 */ + padding: 0; + white-space: normal; + /* 2 */ + *margin-left: -7px; + /* 3 */ +} + +/** + * 1. Correct font size not being inherited in all browsers. + * 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5, + * and Chrome. + * 3. Improve appearance and consistency in all browsers. + */ +button, +input, +select, +textarea { + font-size: 100%; + /* 1 */ + margin: 0; + /* 2 */ + vertical-align: baseline; + /* 3 */ + *vertical-align: middle; + /* 3 */ +} + +/** + * Address Firefox 3+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ +button, +input { + line-height: normal; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+. + * Correct `select` style inheritance in Firefox 4+ and Opera. + */ +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + * 4. Remove inner spacing in IE 7 without affecting normal text inputs. + * Known issue: inner spacing remains in IE 6. + */ +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + /* 2 */ + cursor: pointer; + /* 3 */ + *overflow: visible; + /* 4 */ +} + +/** + * Re-set default cursor for disabled elements. + */ +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * 1. Address box sizing set to content-box in IE 8/9. + * 2. Remove excess padding in IE 8/9. + * 3. Remove excess padding in IE 7. + * Known issue: excess padding remains in IE 6. + */ +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ + *height: 13px; + /* 3 */ + *width: 13px; + /* 3 */ +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome + * (include `-moz` to future-proof). + */ +input[type="search"] { + -webkit-appearance: textfield; + /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari 5 and Chrome + * on OS X. + */ +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Remove inner padding and border in Firefox 3+. + */ +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * 1. Remove default vertical scrollbar in IE 6/7/8/9. + * 2. Improve readability and alignment in all browsers. + */ +textarea { + overflow: auto; + /* 1 */ + vertical-align: top; + /* 2 */ +} + +/* ========================================================================== + Tables + ========================================================================== */ +/** + * Remove most spacing between table cells. + */ +table { + border-collapse: collapse; + border-spacing: 0; +} + +/** --- @section CORE --- */ +/** --- @section CUSTOM MIXINS --- */ +/* -------------------------------------------------------------------------- */ +/** @subsection EM calculator */ +/** @author https://gist.github.com/ijy/1441967 */ +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ +/** + * Hide an element but keep it accessible to screen readers + * @author http://developer.yahoo.com/blogs/ydn/clip-hidden-content-better-accessibility-53456.html + */ +/** https://github.com/guardian/sass-mq */ +/** --- @section JS PLUGINS --- */ +/** --- @section PLUGINS/#GRID --- */ +#grid { + overflow: hidden; + position: absolute; + left: 0; + right: 0; + top: 0; +} +@media all and (min-width: 64em) { + #grid { + width: 72.30769231em; + margin-right: auto; + margin-left: auto; + padding-right: 1.53846154em; + padding-left: 1.53846154em; + } + #grid:after { + content: ""; + display: table; + clear: both; + } +} +@media all and (min-width: 87.5em) { + #grid { + width: 96.92307692em; + margin-right: auto; + margin-left: auto; + padding-right: 1.53846154em; + padding-left: 1.53846154em; + } + #grid:after { + content: ""; + display: table; + clear: both; + } +} +@media all and (min-width: 41.25em) and (max-width: 63.99em) { + #grid { + width: 47.69230769em; + margin-right: auto; + margin-left: auto; + padding-right: 1.53846154em; + padding-left: 1.53846154em; + } + #grid:after { + content: ""; + display: table; + clear: both; + } +} +@media all and (max-width: 41.24em) { + #grid { + width: auto; + } +} +#grid .vert-container { + left: 1.53846154em; + right: 1.53846154em; +} +#grid .vert { + width: 4.61538462em; + margin-left: 1.53846154em; + background-color: rgba(100, 100, 225, 0.25); + margin-right: 0 !important; +} +#grid .vert.first-child { + margin-left: 0; +} +@media all and (max-width: 41.24em) { + #grid .vert.first-child { + width: 100%; + } +} +#grid .horiz { + height: 1.25em; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(95%, transparent), color-stop(95%, rgba(100, 100, 225, 0.25))); + background-image: -webkit-linear-gradient(transparent 95%, rgba(100, 100, 225, 0.25) 95%); + background-image: -moz-linear-gradient(transparent 95%, rgba(100, 100, 225, 0.25) 95%); + background-image: -o-linear-gradient(transparent 95%, rgba(100, 100, 225, 0.25) 95%); + background-image: linear-gradient(transparent 95%, rgba(100, 100, 225, 0.25) 95%); +} +#grid.grid-1 .vert { + background-color: transparent; +} +#grid.grid-2 .horiz { + background-image: none; +} + +/** --- @section PROJECT --- */ +/** --- @section UI ELEMENTS --- */ +/** --- @section UI/FONT-FACE --- */ +/* +@font-face +{ + font-family: 'exemple'; + + src: url('../font/exemple.eot'); + src: url('../font/exemple.eot?#iefix') format('embedded-opentype'), + url('../font/exemple.woff') format('woff'), + url('../font/exemple.ttf') format('truetype'); + + font-weight: normal; + font-style: normal; +} +@mixin exemple +{ + font-family: 'exemple', + sans-serif; +} +*/ +/** --- @section UI/SPRITES --- */ + /* +$exemple-layout: vertical; +$exemple-spacing: 32px; +@import 'bg/exemple/*.png'; + +@include all-exemple-sprites; +*/ +/* +appels : + +@include exemple-sprite(image); +@include exemple-sprite(image, $offset-x:100%); +*/ +/** --- @section UI/FORMS --- */ +/** --- @section GENERIC STYLES --- */ +body { + font-size: 81.25%; + line-height: 1.53846154em; +} +body h6 { + margin: 0; + font-size: 0.76923077em; + line-height: 2em; + margin-bottom: 2em; + padding-top: 4em; +} +body h5 { + margin: 0; + font-size: 1em; + line-height: 1.53846154em; + margin-bottom: 1.53846154em; + padding-top: 3.07692308em; +} +body h4 { + margin: 0; + font-size: 1.23076923em; + line-height: 1.25em; + margin-bottom: 1.25em; + padding-top: 2.5em; +} +body h3 { + margin: 0; + font-size: 1.53846154em; + line-height: 2em; + margin-bottom: 1em; + padding-top: 2em; +} +body h2 { + margin: 0; + font-size: 1.92307692em; + line-height: 1.6em; + margin-bottom: 0.8em; + padding-top: 1.6em; +} +body h1 { + margin: 0; + font-size: 2.38461538em; + line-height: 1.29032258em; + margin-bottom: 0.64516129em; + padding-top: 1.29032258em; +} +body h1 + h2, +body h2 + h3, +body h3 + h4, +body h4 + h5, +body h5 + h6 { + padding-top: 0; +} + +b, +strong { + font-weight: bold; +} + +blockquote { + margin: 0 80px; + margin-bottom: 1.53846154em; +} + +p, +pre, +address { + margin: 0; + margin-bottom: 1.53846154em; +} + +dl, +menu, +ol, +ul { + margin: 0; + margin-bottom: 1.53846154em; +} + +dd { + margin: 0 0 0 80px; +} + +menu, +ol, +ul { + padding: 0 0 0 80px; +} + +fieldset { + margin: 0; + padding: 10px; + padding-top: 0.76923077em; + padding-bottom: 0.76923077em; + margin-bottom: 1.53846154em; +} + +table { + margin-bottom: 1.53846154em; +} + +td, +th, +caption { + padding: 10px; + padding-top: 0.76923077em; + padding-bottom: 0.76923077em; +} + +html { + overflow-y: scroll; +} + +img, +audio, +video, +canvas, +svg, +object, +table { + display: block; + max-width: 100%; + height: auto; +} + +table { + display: table; +} + +small { + line-height: 0; +} + +.hr { + border-top-style: solid; + border-top-width: 1px; + border-top-color: black; + margin-top: -1px; + margin-bottom: 1.53846154em; +} +.hr hr { + position: absolute; + clip: rect(1px 1px 1px 1px); + clip: rect(1px, 1px, 1px, 1px); + padding: 0; + margin: 0; + border: 0; + width: 1px !important; + height: 1px; + overflow: hidden; +} + +ul ol, +ul ul, +ol ol, +ol ul { + margin-bottom: 0; +} + +.not-ie code, .not-ie +kbd, .not-ie +samp { + line-height: 0; +} + +.clearfix:after { + content: ""; + display: table; + clear: both; +} + +.roll { + text-decoration: none; +} +.roll:hover, .roll:focus { + text-decoration: underline; +} + +.hide { + display: none; +} + +.mask { + position: absolute; + clip: rect(1px 1px 1px 1px); + clip: rect(1px, 1px, 1px, 1px); + padding: 0; + margin: 0; + border: 0; + width: 1px !important; + height: 1px; + overflow: hidden; +} + +.unmask { + position: relative; + clip: auto; + width: auto; + height: auto; + overflow: visible; +} + +.list { + margin: 0; + padding: 0; + border: 0; +} +.list:after { + content: ""; + display: table; + clear: both; +} +.list li, +.list dt, +.list dd { + list-style-image: none; + list-style-type: none; + margin-left: 0; + white-space: nowrap; + display: inline; + float: left; + padding-left: 0; + padding-right: 0; + white-space: normal; +} +.list li:first-child, .list li.first, +.list dt:first-child, +.list dt.first, +.list dd:first-child, +.list dd.first { + padding-left: 0; +} +.list li:last-child, +.list dt:last-child, +.list dd:last-child { + padding-right: 0; +} +.list li.last, +.list dt.last, +.list dd.last { + padding-right: 0; +} + +/** --- @section LAYOUT --- */ +/** --- @section LAYOUT/HEADER --- */ +/** --- @section LAYOUT/CONTENT --- */ +@media all and (min-width: 64em) { + .l-content { + width: 72.30769231em; + margin-right: auto; + margin-left: auto; + padding-right: 1.53846154em; + padding-left: 1.53846154em; + } + .l-content:after { + content: ""; + display: table; + clear: both; + } +} +@media all and (min-width: 87.5em) { + .l-content { + width: 96.92307692em; + margin-right: auto; + margin-left: auto; + padding-right: 1.53846154em; + padding-left: 1.53846154em; + } + .l-content:after { + content: ""; + display: table; + clear: both; + } +} +@media all and (min-width: 41.25em) and (max-width: 63.99em) { + .l-content { + width: 47.69230769em; + margin-right: auto; + margin-left: auto; + padding-right: 1.53846154em; + padding-left: 1.53846154em; + } + .l-content:after { + content: ""; + display: table; + clear: both; + } +} +@media all and (max-width: 41.24em) { + .l-content { + width: auto; + } +} + +/** --- @section LAYOUT/FOOTER --- */ +/** --- @section PAGES --- */ diff --git a/assets/swf/demo.jpg b/assets/swf/demo.jpg new file mode 100755 index 0000000000000000000000000000000000000000..9adc59aa5be5d0fc87c29a58af814939b57b4ea1 GIT binary patch literal 1252 zcmcgr&2F1O5MF9*6U%XmltYgza%rm?47N!?p^*)-YE@KG5~;ls*u=gLG~YKfyWeJ?vup5ZKlM)m7!IET4lFJE0eEZT zjxPWMSQ;JxkX@IWBSIowlEOrEJbZ#g7Y9=6M3OAFB(S@eMvgm11fHNXKQx42A3h4u z_YC26*KXO7iAMg5%NQM9zB+a<$FAlHd(Yu+s;5B|AmYF@I1dv&HH3m(r+yxm1X!ey zu_5&Gs_>0{08Jbt*cIDNwXIMU4+IRwYY z7@yBi@nD1rPDVI_=8*~?+m7ppdEiNbux))9Cd3I{G_(wXa)`d~>563zc6tL#)2zNM z?<>7t$LuRwZ)aQXcLwd=9BW~B5}=UGvECB9zY?2^A&6*Y3&s9h0 zZggcUEd8rxmMvGgN~KzEZ=_Nt=)-$hqrS8e^Of0C27;vH;qF`g9n!s z=(N)rYRPZ}>R>^{u{-Wn?)npSY|#awpnoZ1+P(ik&czx4GE1*wp=nsRwR=tL=&Ja+V0g zjrVM28W8o6zB_UUUZm4}dC;gm?h%*>hVd*qoUENRh(7weN&lgSgFmL*}b&T6d_hk7f8ui=p4n0ka`LLAkX%k7 zD-gMENXEKRG)l$|fSY$?qg zwN{)}=bB?I#R=)k@4coBqB50aJ-R(Ji?8#47GD?Mb@O|9BKF + + diff --git a/inc/_footer/dist.php b/inc/_footer/dist.php index 5c03aa7..54d3016 100755 --- a/inc/_footer/dist.php +++ b/inc/_footer/dist.php @@ -1,4 +1,3 @@ -