Delete Archive folder in assets and useless files in lib

This commit is contained in:
chris committed 2013-10-31 14:13:24 +08:00
1 parent 68e12fd737
commit 778f7c7863
1075 files changed
-49691

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 KiB

-84
View File
@@ -1,84 +0,0 @@
Naming convention:
1 - The file names can only be changed inside themes, javascripts and images.
2 - File names must not contain spaces, spaces must be replace by underscores
3 - CSS files can only have the extensions ".css" or ".scss"
4 - Javascript files must have the extension ".js"
5 - Image files can have any extension
Package content:
My_design.zip
- info.json
- layout.html
- default.css
- themes
- blue.css
- red.css
- javascripts
- one.js
- two.js
- images
- pic.jpg
- pic_1.png
- pic_2.jpg
- README
"info.json" file:
Content:
{
"title": "your_title",
"author": "your_author",
"intro": "your_intro"
}
Title: it's the title of your design as it's going to appeared in your website, it can contain spaces
Author: it's the name of the creator of the design
Intro: it's introduction that can contain more details about your design
"layout.html" file:
This HTML file can contain 3 types of elements: headers, blocks and footers.
Each element defining a header, a block or a footer must be a <div>.
Furthermore, each of those <div> must include an <layout_part> as follow:
<div ID="div_1" class="header">
<r:layout_part ID="div_1" class="header" name="header_1">
// Your code here
</r:layout_part>
</div>
Attributes convention:
- each pair of <div> and <layout_part> tags, must have the same ID and class.
- the <r:layout_part> tag as one more attribute: "name", it must contain the type of the element followed by the number of the element (if you have 2 header elements, you will have "header_1" and "header_2"
Javascripts and stylsheets:
The links to your javascript files and stylesheet files must be encapsulated respectively in <r:javascripts></r:javascripts> and <stylesheets></stylesheets> tags.
"strucutre.css" file:
The stylesheet file contains the structure of the page, it reference elements by their ID.
In this file, you can set structural attributes like "width", "height", "position"…
Themes:
Themes are stylesheet files that modify the visual aspects of the page.
The themes folder must contain at least one file named "default.css" that will be the default theme.
Themes stylesheets reference elements by class.
They can set attributes like "color", "background-image", "border"…
Javascripts:
This folder contains the javascript files used by the design.
Images:
This folder contains the images used by the design.
They can have the extensions ".jpg", ".png"...
-2
View File
@@ -1,2 +0,0 @@
/* This stylesheet file contains the structure of the page, it reference elements by their ID.
In this file, you can set structural attributes like "width", "height", "position"… */
Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 985 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1011 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 992 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 995 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

-5
View File
@@ -1,5 +0,0 @@
{
"title": "Fraisier",
"author": "Paul",
"intro": "Strawberry cake"
}
-13
View File
@@ -1,13 +0,0 @@
/**
* DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML <IMG/>.
* Author: Drew Diller
* Email: drew.diller@gmail.com
* URL: http://www.dillerdesign.com/experiment/DD_belatedPNG/
* Version: 0.0.8a
* Licensed under the MIT License: http://dillerdesign.com/experiment/DD_belatedPNG/#license
*
* Example usage:
* DD_belatedPNG.fix('.png_bg'); // argument is a CSS selector
* DD_belatedPNG.fixPng( someNode ); // argument is an HTMLDomElement
**/
var DD_belatedPNG={ns:"DD_belatedPNG",imgSize:{},delay:10,nodesFixed:0,createVmlNameSpace:function(){if(document.namespaces&&!document.namespaces[this.ns]){document.namespaces.add(this.ns,"urn:schemas-microsoft-com:vml")}},createVmlStyleSheet:function(){var b,a;b=document.createElement("style");b.setAttribute("media","screen");document.documentElement.firstChild.insertBefore(b,document.documentElement.firstChild.firstChild);if(b.styleSheet){b=b.styleSheet;b.addRule(this.ns+"\\:*","{behavior:url(#default#VML)}");b.addRule(this.ns+"\\:shape","position:absolute;");b.addRule("img."+this.ns+"_sizeFinder","behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;");this.screenStyleSheet=b;a=document.createElement("style");a.setAttribute("media","print");document.documentElement.firstChild.insertBefore(a,document.documentElement.firstChild.firstChild);a=a.styleSheet;a.addRule(this.ns+"\\:*","{display: none !important;}");a.addRule("img."+this.ns+"_sizeFinder","{display: none !important;}")}},readPropertyChange:function(){var b,c,a;b=event.srcElement;if(!b.vmlInitiated){return}if(event.propertyName.search("background")!=-1||event.propertyName.search("border")!=-1){DD_belatedPNG.applyVML(b)}if(event.propertyName=="style.display"){c=(b.currentStyle.display=="none")?"none":"block";for(a in b.vml){if(b.vml.hasOwnProperty(a)){b.vml[a].shape.style.display=c}}}if(event.propertyName.search("filter")!=-1){DD_belatedPNG.vmlOpacity(b)}},vmlOpacity:function(b){if(b.currentStyle.filter.search("lpha")!=-1){var a=b.currentStyle.filter;a=parseInt(a.substring(a.lastIndexOf("=")+1,a.lastIndexOf(")")),10)/100;b.vml.color.shape.style.filter=b.currentStyle.filter;b.vml.image.fill.opacity=a}},handlePseudoHover:function(a){setTimeout(function(){DD_belatedPNG.applyVML(a)},1)},fix:function(a){if(this.screenStyleSheet){var c,b;c=a.split(",");for(b=0;b<c.length;b++){this.screenStyleSheet.addRule(c[b],"behavior:expression(DD_belatedPNG.fixPng(this))")}}},applyVML:function(a){a.runtimeStyle.cssText="";this.vmlFill(a);this.vmlOffsets(a);this.vmlOpacity(a);if(a.isImg){this.copyImageBorders(a)}},attachHandlers:function(i){var d,c,g,e,b,f;d=this;c={resize:"vmlOffsets",move:"vmlOffsets"};if(i.nodeName=="A"){e={mouseleave:"handlePseudoHover",mouseenter:"handlePseudoHover",focus:"handlePseudoHover",blur:"handlePseudoHover"};for(b in e){if(e.hasOwnProperty(b)){c[b]=e[b]}}}for(f in c){if(c.hasOwnProperty(f)){g=function(){d[c[f]](i)};i.attachEvent("on"+f,g)}}i.attachEvent("onpropertychange",this.readPropertyChange)},giveLayout:function(a){a.style.zoom=1;if(a.currentStyle.position=="static"){a.style.position="relative"}},copyImageBorders:function(b){var c,a;c={borderStyle:true,borderWidth:true,borderColor:true};for(a in c){if(c.hasOwnProperty(a)){b.vml.color.shape.style[a]=b.currentStyle[a]}}},vmlFill:function(e){if(!e.currentStyle){return}else{var d,f,g,b,a,c;d=e.currentStyle}for(b in e.vml){if(e.vml.hasOwnProperty(b)){e.vml[b].shape.style.zIndex=d.zIndex}}e.runtimeStyle.backgroundColor="";e.runtimeStyle.backgroundImage="";f=true;if(d.backgroundImage!="none"||e.isImg){if(!e.isImg){e.vmlBg=d.backgroundImage;e.vmlBg=e.vmlBg.substr(5,e.vmlBg.lastIndexOf('")')-5)}else{e.vmlBg=e.src}g=this;if(!g.imgSize[e.vmlBg]){a=document.createElement("img");g.imgSize[e.vmlBg]=a;a.className=g.ns+"_sizeFinder";a.runtimeStyle.cssText="behavior:none; position:absolute; left:-10000px; top:-10000px; border:none; margin:0; padding:0;";c=function(){this.width=this.offsetWidth;this.height=this.offsetHeight;g.vmlOffsets(e)};a.attachEvent("onload",c);a.src=e.vmlBg;a.removeAttribute("width");a.removeAttribute("height");document.body.insertBefore(a,document.body.firstChild)}e.vml.image.fill.src=e.vmlBg;f=false}e.vml.image.fill.on=!f;e.vml.image.fill.color="none";e.vml.color.shape.style.backgroundColor=d.backgroundColor;e.runtimeStyle.backgroundImage="none";e.runtimeStyle.backgroundColor="transparent"},vmlOffsets:function(d){var h,n,a,e,g,m,f,l,j,i,k;h=d.currentStyle;n={W:d.clientWidth+1,H:d.clientHeight+1,w:this.imgSize[d.vmlBg].width,h:this.imgSize[d.vmlBg].height,L:d.offsetLeft,T:d.offsetTop,bLW:d.clientLeft,bTW:d.clientTop};a=(n.L+n.bLW==1)?1:0;e=function(b,p,q,c,s,u){b.coordsize=c+","+s;b.coordorigin=u+","+u;b.path="m0,0l"+c+",0l"+c+","+s+"l0,"+s+" xe";b.style.width=c+"px";b.style.height=s+"px";b.style.left=p+"px";b.style.top=q+"px"};e(d.vml.color.shape,(n.L+(d.isImg?0:n.bLW)),(n.T+(d.isImg?0:n.bTW)),(n.W-1),(n.H-1),0);e(d.vml.image.shape,(n.L+n.bLW),(n.T+n.bTW),(n.W),(n.H),1);g={X:0,Y:0};if(d.isImg){g.X=parseInt(h.paddingLeft,10)+1;g.Y=parseInt(h.paddingTop,10)+1}else{for(j in g){if(g.hasOwnProperty(j)){this.figurePercentage(g,n,j,h["backgroundPosition"+j])}}}d.vml.image.fill.position=(g.X/n.W)+","+(g.Y/n.H);m=h.backgroundRepeat;f={T:1,R:n.W+a,B:n.H,L:1+a};l={X:{b1:"L",b2:"R",d:"W"},Y:{b1:"T",b2:"B",d:"H"}};if(m!="repeat"||d.isImg){i={T:(g.Y),R:(g.X+n.w),B:(g.Y+n.h),L:(g.X)};if(m.search("repeat-")!=-1){k=m.split("repeat-")[1].toUpperCase();i[l[Line truncated
-18
View File
@@ -1,18 +0,0 @@
/*!
* jQuery JavaScript Library v1.6.2
* 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: Thu Jun 30 14:16:56 2011 -0400
*/
(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bZ(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bY(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bC.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)bY(a+"["+e+"]",b[e],c,d);else d(a,b)}function bX(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bR,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bX(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bX(a,c,d,e,"*",g));return l}function bW(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bN),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bA(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bv:bw;if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function bg(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function W(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(R.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+"."Line truncated
shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,N(a.origType,a.selector),f.extend({},a,{handler:M,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,N(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?E:D):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=E;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=E;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=E,this.stopPropagation()},isDefaultPrevented:D,isPropagationStopped:D,isImmediatePropagationStopped:D};var F=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))},G=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?G:F,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?G:F)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&f(b).closest("form").length&&K("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&K("submit",this,arguLine truncated
)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1></$2>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bl(k[i]);else bl(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||bd.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bn=/alpha\([^)]*\)/i,bo=/opacity=([^)]*)/,bp=/([A-Z]|^ms)/g,bq=/^-?\d+(?:px)?$/i,br=/^-?\d/,bs=/^[+\-]=/,bt=/[^+\-\.\de]+/g,bu={position:"absolute",visibility:"hidden",display:"block"},bv=["Left","Right"],bw=["Top","Bottom"],bx,by,bz;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bx(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d;if(h==="number"&&isNaN(d)||d==null)return;h==="string"&&bs.test(d)&&(d=+d.replace(bt,"")+parseFloat(f.css(a,c)),h="number"),h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bx)return bx(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bA(a,b,d);f.swap(a,bu,function(){e=bA(a,b,d)});return e}},set:function(a,b){if(!bq.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===Line truncated
-3
View File
@@ -1,3 +0,0 @@
Access to this directory is available only to you.
The directory cannot be accessed via any web or system services, so you can
store any private information here.
-40
View File
@@ -1,40 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>RulingSite</title>
<r:stylesheets>
<!-- your stylesheets here -->
</r:stylesheets>
<r:javascripts>
<!-- your javascripts here -->
</r:javascripts>
</head>
<body>
<!-- example -->
<div id="header_top" class="header">
This is the first level of header
<r:content name='content_2'>
</r:content>
</div>
<div id="header_bottom" class="header">
This is the second level of header
</div>
<div id="main_content" class="content">
<r:content name='content_1' main='true'/>
<r:content name='content_3'/>
<r:content name='content_4'/>
</div>
<div id="footer" class="footer">
This is the footer
</div>
<!-- END example -->
</body>
</html>
-43
View File
@@ -1,43 +0,0 @@
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 {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
-2
View File
@@ -1,2 +0,0 @@
/* This stylesheet file contains the visual aspect of the page, it reference elements by their class.
In this file, you can set visual attributes like "color", "background-color", "border"… */
-1
View File
@@ -1 +0,0 @@
/* Some css */
-54
View File
@@ -1,54 +0,0 @@
/* This stylesheet file contains the visual aspect of the page, it reference elements by their class.
In this file, you can set visual attributes like "color", "background-color", "border"… */
#nav {
height: 35px;
background: url("../images/nav_bar_bg.png") repeat-x scroll left center transparent;
border-radius: 3px 3px 3px 3px;
box-shadow: 0 0 5px #45433E;
margin: 0 0 20px;
padding: 0;
display:block;
float:none;
overflow:visible;
width:100%;
background-color:transparent;
}
#nav:before {
visibility:hidden;
}
#nav li {
height: 39px;
color: #FFFFFF;
display: inline;
float: left;
line-height: 39px;
margin: -2px 15px 0;
padding: 0 30px;
text-align: center;
text-shadow: 0 -1px 0 #4F200D;
}
#main_content {
background-color: #BCAD94;
border-radius: 3px 3px 3px 3px;
box-shadow: 0 0 5px #33322C;
float: none;
height: 300px;
margin: 0 0 20px;
padding: 15px 20px;
width: 940px;
}
#content_title {
border-left: 4px solid #B6300C;
color: #f0f0f0;
font-size: 18px;
height: 20px;
line-height: 18px;
margin: 0 0 5px;
padding: 0 0 0 4px;
text-shadow: 0 -1px 0 #826f4f;
}
#footer {
clear: both;
margin: 0;
padding: 0 0 10px;
}
-184
View File
@@ -1,184 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>RulingSite</title>
<link rel="stylesheet" type="text/css" href="themes/ini.css" media="all" style=""/>
<link rel="stylesheet" type="text/css" href="themes/comp.css" media="all" style=""/>
<link rel="stylesheet" type="text/css" href="default.css" media="all" style=""/>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="javascript/jquery.tinyscrollbar.min.js"></script>
<script type="text/javascript" src="javascript/rc.js"></script>
<script type="text/javascript" src="javascript/ccu.js"></script>
</head>
<body>
<div id="wrapper">
<div id="header" class="header">
<h1 id="logo" class="ini_heading"><a href="">國立政治大學</a><span>National Chengchi University</span></h1>
<div id="nav" class="header_nav">
<ul class="nav_1">
<li><a href="#" class="nav1">在校學生</a></li><span class="line">&nbsp;|&nbsp;</span>
<li><a href="#" class="nav2">校友</a></li><span class="line">&nbsp;|&nbsp;</span>
<li><a href="#" class="nav3">教職員工</a></li><span class="line">&nbsp;|&nbsp;</span>
<li><a href="#" class="nav4">訪客</a></li>
</ul>
<ul class="nav_2">
<li><a href="#">網站地圖</a></li><span class="line">&nbsp;|&nbsp;</span>
<li><a href="#">iNCCU 愛政大</a></li><span class="line">&nbsp;|&nbsp;</span>
<li>
<a href="#" class="mail">郵件信箱</a>
<ul class="nav_menu2">
<li class="mail">郵件信箱</li>
<li><a href="">教職員生</a></li>
<li><a href="">校友</a></li>
</ul>
</li>
</ul>
</div>
<nav id="nav2" class="site_menu menu">
<ul class="nav ini_list page_menu" level='1' id='nav' class='nav ini_list' home='true' li_class='nav' li_incremental='true'>
<li><a href=""><span>關於政大</span></a></li>
<li>
<a href=""><span>學術單位</span></a>
<span class="dot"></span>
<ul class="site_menu2 page_menu" level='2' id='navi' li_class='navi'>
<li><a href=""><span>文學院</span></a></li>
<li><a href=""><span>理學院</span></a></li>
<li><a href=""><span>社會科學學院</span></a></li>
<li><a href=""><span>法學院</span></a></li>
<li><a href=""><span>商學院</span></a></li>
<li><a href=""><span>外國語文學院</span></a></li>
<li><a href=""><span>傳播學院</span></a></li>
<li><a href=""><span>國際事務學院</span></a></li>
<li><a href=""><span>教育學院</span></a></li>
</ul>
</li>
<li>
<a href=""><span>研究單位</span></a>
<span class="dot"></span>
<ul class="site_menu2 ini_list">
<li><a href=""><span>國際關係研究中心</span></a></li>
<li><a href=""><span>選舉研究中心</span></a></li>
<li><a href=""><span>第三部門研究中心</span></a></li>
<li><a href=""><span>創新與創造力研究中心</span></a></li>
<li><a href=""><span>台灣研究中心</span></a></li>
<li><a href=""><span>中國大陸研究中心</span></a></li>
<li><a href=""><span>人文研究中心</span></a></li>
<li><a href=""><span>心智、大腦與學習研究中心</span></a></li>
<li><a href=""><span>原住民族研究中心</span></a></li>
<li><a href=""><span>附屬研究中心</span></a></li>
</ul>
</li>
<li>
<a href=""><span>行政組織</span></a>
<span class="dot"></span>
<ul class="site_menu2">
<li><a href=""><span>教務處</span></a></li>
<li><a href=""><span>學生事務處</span></a></li>
<li><a href=""><span>總務處</span></a></li>
<li><a href=""><span>研究發展處</span></a></li>
<li><a href=""><span>國際合作事務處</span></a></li>
<li><a href=""><span>秘書處</span></a></li>
<li><a href=""><span>會計室</span></a></li>
<li><a href=""><span>人事室</span></a></li>
<li><a href=""><span>圖書館</span></a></li>
<li><a href=""><span>體育室</span></a></li>
<li><a href=""><span>公共行政及企業管理教育中心</span></a></li>
<li><a href=""><span>社會科學資料中心</span></a></li>
<li><a href=""><span>電子計算機中心</span></a></li>
<li><a href=""><span>附設公務人員教育中心</span></a></li>
<li><a href=""><span>教學發展中心</span></a></li>
<li><a href=""><span>華語文教學中心</span></a></li>
<li><a href=""><span>創新育成中心</span></a></li>
<li><a href=""><span>附設實驗國民小學</span></a></li>
<li><a href=""><span>附屬高級中學</span></a></li>
<li><a href=""><span>性別平等教育委員會</span></a></li>
</ul>
</li>
<li><a href=""><span>招生入學</span></a></li>
<li>
<a href=""><span>資訊服務</span></a>
<ul class="site_menu2">
<li><a href=""><span>校務系統</span></a></li>
<li><a href=""><span>校園授權軟體</span></a></li>
<li><a href=""><span>校園網路</span></a></li>
<li><a href=""><span>校園資訊服務</span></a></li>
<li><a href=""><span>教學軟硬體資源</span></a></li>
</ul>
</li>
<li><a href=""><span>聯絡我們</span></a></li>
</ul>
</nav>
<div id="banner_box">
<div id="banner" name='content_1' class="banner page_content">
</div>
</div>
</div>
<div id="main_content" class="content">
<div class="content2">
<div class="topic_news">
<div class="topic_news2">
<div class="main_content page_content" name='content_2'>
</div>
<div class="news_content page_content" name='content_2' main='true'>
</div>
<div class="sidebar page_content" name='content_7'>
</div>
</div>
</div>
<div class="clear"></div>
<div class="post_panel">
<div class="post_panel2">
<div class="announcements page_content" name='content_3'>
</div>
<div class="events page_content" name='content_4'>
</div>
</div>
</div>
<div class="clear"></div>
<div class="links_panel">
<div class="links_panel2">
<div class="adbanner1 page_content" name='content_5'>
</div>
<div class="quicklinks page_content" name='content_6'>
</div>
</div>
</div>
</div>
</div>
<div id="footer" class="footer">
<div class="copyright">
<p>
本網站著作權屬於國立政治大學,請詳見使用規則。
</p>
<p>
總機電話:02-29393091<br/>
傳真:02-29379611<br/>
地址:11605 台北市文山區指南路二段64號<br/>
</p>
</div>
<div class="notice">
校園安全緊急通報&nbsp;|&nbsp;著作權&nbsp;|&nbsp;個人資料保護宣告&nbsp;|&nbsp;資訊安全宣告&nbsp;|&nbsp;聯絡我們
</div>
<div class="ruling">
<a href="">
<img src="images/ruling.png" alt="Rulingdigital" name="ruling_pic" id="ruling_pic" class="ruling_pic page_image" />
</a>
</div>
</div>
</div>
</body>
</html>
-45
View File
@@ -1,45 +0,0 @@
module ParserBackEnd
include ParserCommon
require 'nokogiri'
# c.define_tag 'language_bar' do
# @site.in_use_locales.map{ |locale|
# lang = I18nVariable.first(:conditions => {:key => locale})[locale]
# if I18n.locale.to_s.eql?(locale)
# lang
# else
# "<a href='?locale=#{locale}'>#{lang}</a>"
# end
# }.join(' | ')
# end
# c.define_tag 'link' do |tag|
# item = Item.first(:conditions => { :path => tag.attr['name'] })
# ret = ''
# ret << "<a href='"
# ret << eval("admin_#{item.class.to_s.downcase}_path(item.id)")
# ret << "' class='nav'>"
# ret << item.i18n_variable[I18n.locale]
# ret << "</a>"
# end
def parse_page_edit_noko(page)
body = Nokogiri::HTML(page.design.layout.body)
parse_menu_edit(body, page, true)
public_r_tags = parse_contents_edit(body, page, true)
parse_images_edit(body, page)
parse_footer_edit(body, page)
parse_sub_menu_edit(body, page)
parse_breadcrumb_edit(body, page)
parse_counter_edit(body)
public_r_tags.each do |tag|
send("parse_#{tag}s_edit", body, page, true)
end
body.to_html
end
def self.included(base)
base.send :helper_method, :parse_page_edit_noko if base.respond_to? :helper_method
end
end
-338
View File
@@ -1,338 +0,0 @@
module ParserCommon
include ActionView::Helpers::TagHelper
include ActionView::Helpers::FrontHelper
# include ActionView::Helpers::UrlHelper
def menu_level(page, current_page, current, menu, edit = false)
res = ''
if page.visible_children.size > 0
res << "<ul class='"
res << menu.values["class_#{current}"] rescue nil
res << "'>"
i = nil
i = 1 if menu.values["li_incremental_#{current}"]
children = current == 1 ? page.visible_children : page.visible_children
children.each do |child|
res << menu_li(child, current_page, current, menu, i, edit)
i += 1 if i
end
if menu.values['home'] && current == 1
res << menu_li(page, current_page, current, menu, i, edit)
end
res << "</ul>"
end
res
end
def menu_li(page, current_page, current, menu, i, edit)
res = "<li class='"
res << menu.values["li_class_#{current}"] rescue nil
res << "_#{i}" if i
res << " active" if (current_page.id.eql?(page.id) || current_page.descendant_of?(page))
res << "'>"
root = ""
res << "<a href='#{edit ? root + admin_page_path(page.id) : (page.class.to_s.eql?('Page') ? root + page.path : page.url)}'><span>#{page.title}</span></a>"
if page.visible_children.size > 0 && current < menu.levels
res << "<span class='dot'></span>"
res << menu_level(page, current_page, current + 1, menu, edit)
end unless (page.root? rescue nil)
res << "</li>"
end
# ad_banners
def parse_ad_banners_edit(body = nil, page = nil, edit=nil)
body.css('ad_banner').each do |banner|
res = ''
ad_banner = AdBanner.find(banner["id"]) rescue nil
if ad_banner
res << "<div style='position:relative'>"
res << "<ul id='banner_nav' class='clear banner_nav-#{ad_banner.title.dehumanize}'></ul>"
res << "<div id='slideshow-#{ad_banner.title.dehumanize}' class='orbit-cycle-slideshow' data-cycle-timeout=#{ad_banner.timeout_millisecond} data-cycle-fx='#{ad_banner.ad_fx}' data-cycle-pager='.banner_nav_#{ad_banner.title.dehumanize}' data-cycle-pager-template='<li><a href=\"#\"></a></li>' data-cycle-pager-active-class='activeSlide' data-cycle-random='true' style='z-index: 0'>"
ad_banner.ad_images.can_display.each do |ad_image|
link = ad_image_link(ad_image)
res << "<img src=#{ad_image.file} "
res << "alt=#{ad_image.title} "
res << "link_open=#{ad_image.link_open} "
res << "link_url=#{link} "
res << "height=#{ad_banner.height} "
res << "width=#{ad_banner.width} "
res << "style='display:none; #{'cursor:pointer;' if link}'"
res << "/>"
end
res << "</div>"
res << "</div>"
res << "<script>"
res << "$(function(){"
res << "if($('#slideshow-#{ad_banner.title.dehumanize} img').length > 1){"
res << "var a = [];"
ad_banner.ad_images.can_display.each do |image|
res << "a.push('#{image.file.url}');"
end
res << "$.preload(a, 2, function(){"
res << "$('.orbit-cycle-slideshow').cycle();"
res << "});"
res << "}"
res << "else{"
res << "$('#slideshow-#{ad_banner.title.dehumanize} img').show()"
res << "}"
res << "});"
res << "</script>"
end
fragment = Nokogiri::HTML::DocumentFragment.new(body, res)
banner.swap(fragment)
end
end
# page_images
def parse_images_edit(body, page, edit=nil)
body.css('.page_image').each do |page_image|
# image = page.custom_images.detect{|image| image.name.eql?(tag.attr['name']) }
# image = page.design.custom_images.detect{|image| image.name.eql?(tag.attr['name']) } unless image
image = page.design.images.detect{|image| image.name.eql?(File.basename(page_image['src'])) } unless image
if image
res = "<img src=#{image.file.url} "
page_image.attributes.each do |l|
res << "#{l[0]}='#{l[1]}' "
end
res << '>'
end
fragment = Nokogiri::HTML::DocumentFragment.new(body, res)
page_image.swap(fragment)
end
end
# page_menu
def parse_menu_edit(body, page, edit=nil)
page_menu = body.css('.page_menu').first
home = get_homepage
menu = page.design.layout.menu
fragment = Nokogiri::HTML::DocumentFragment.new(body, menu_level(home, page, 1, menu, edit))
page_menu.swap(fragment)
end
# sub_menus
def parse_sub_menus_edit(body = nil, page = nil, edit=nil)
body.css('sub_menu').each do |sub_menu|
menu_page = Page.find(sub_menu['id']) rescue nil
res = ''
if menu_page && menu_page.visible_children.size > 0
res << "<div class='category_list'>"
res << "<h3 class='h3'>#{menu_page.title}</h3>"
res << "<ul class='list'>"
menu_page.visible_children.each do |child|
res << "<li class='#{page.id.eql?(child.id) ? 'active' : nil}'>"
root = ""
res << "<a href='#{edit ? root + admin_page_path(child.id) : (child.class.to_s.eql?('Page') ? root + child.path : child.url)}'>#{child.title}</a>"
res << "</li>"
end
res << "</ul>"
res << "</h3>"
res << "</div>"
end
fragment = Nokogiri::HTML::DocumentFragment.new(body, res)
sub_menu.swap(fragment)
end
end
# breadcrumb
def parse_breadcrumbs_edit(body = nil, page = nil, edit=nil)
body.css('breadcrumb').each do |breadcrumb|
ancestors = Page.find(page.id).ancestors_and_self rescue nil
ancestors = nil if ancestors.size == 1
res = ''
if ancestors
res << "<ul class='breadcrumb'>"
ancestors.each_with_index do |node, i|
last = i == ancestors.size-1
res << "<li class=#{'active' if last}>"
if last
res << node.title
else
res << "<a herf='/#{node.path}'>#{node.title}</a>"
res << "<span class='divider'>/</span>"
end
res << "</li>"
end
res << "</ul>"
end
fragment = Nokogiri::HTML::DocumentFragment.new(body, res)
breadcrumb.swap(fragment)
end
end
# tag_cloud
def parse_tag_clouds_edit(body = nil, page = nil, edit=nil)
body.css('tag_cloud').each do |tag_cloud|
module_app = ModuleApp.find(tag_cloud["id"]) rescue nil
res = ''
if module_app
res << "<div class='tag_cloud'>"
res << "<h3 class='h3'>#{t(:tag_cloud)}</h3>"
res << "<div class='cloud'>"
module_app.sorted_tags_for_cloud.each do |tag|
# res << link_to(tag[0].name, ('/' + {:tag_id => tag[0].id, :category_id => params[:category_id]}.to_param), :class => "#{tag[1]} #{tag[0].id.to_s.eql?(params[:tag_id]) ? 'active' : nil} ")
res << "<span class='#{tag[1]} #{tag[0].id.to_s.eql?(params[:tag_id]) ? 'active' : nil}'>"
res << tag[0].name
res << "</span>"
end
res << "</div>"
res << "</div>"
end
fragment = Nokogiri::HTML::DocumentFragment.new(body, res)
tag_cloud.swap(fragment)
end
end
# page_footer
def parse_footer_edit(body, page)
page_footer = body.css('.page_footer').first
if page_footer
res = "<div id='#{page_footer['id']}', class='#{page_footer['class']}'>"
res << @site.footer rescue nil
res << "</div>"
fragment = Nokogiri::HTML::DocumentFragment.new(body ,res)
page_footer.swap(fragment) rescue nil
else
''
end
end
# page_sub_menu
def parse_sub_menu_edit(body, page)
page_sub_menu = body.css('.page_sub_menu').first
if page_sub_menu
res = "<div id='#{page_sub_menu['id']}', class='#{page_sub_menu['class']}'>"
res << @site.sub_menu rescue nil
res << "</div>"
fragment = Nokogiri::HTML::DocumentFragment.new(body ,res)
page_sub_menu.swap(fragment) rescue nil
else
''
end
end
def parse_breadcrumb_edit(body, page)
page_breadcrumb = body.css('.page_breadcrumb').first
if page_breadcrumb
res = "<div id='#{page_breadcrumb['id']}', class='#{page_breadcrumb['class']}'>"
res << @site.breadcrumb rescue nil
res << "</div>"
fragment = Nokogiri::HTML::DocumentFragment.new(body ,res)
page_breadcrumb.swap(fragment) rescue nil
else
''
end
end
# sitemap
def parse_sitemaps_edit(body = nil, page = nil, edit=nil)
sitemap = body.css('sitemap').first
url = front_show_sitemap_path
options = "?inner=true"
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div class='dymanic_load' path='#{url + options}'></div>")
sitemap.swap(fragment)
end
# terms_of_use
def parse_terms_of_uses_edit(body = nil, page = nil, edit=nil)
terms_of_use = body.css('terms_of_use').first
url = front_show_terms_of_use_path
options = "?inner=true"
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div class='dymanic_load' path='#{url + options}'></div>")
terms_of_use.swap(fragment)
end
# page_contents
def parse_contents_edit(body, page, edit=nil)
public_r_tags = []
url = ''
body.css('.page_content').each do |content|
ret = ''
category = params[:category_id].blank? ? page[:category] : params[:category_id]
tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id]
if (content["main"] == "true" && !page.module_app.nil?)
if page.app_frontend_url == 'default_widget'
url = "/panel/orbit_app/widget/#{page.frontend_style}?inner=true"
else
url = "/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}"
end
ret << "<div id='appfrontend' class='dymanic_load' path='#{url}"
ret << "/#{params[:id]}" if params[:id] && !params[:id].eql?(page.id.to_s)
categories_str=category.collect{|t| "category_id[]=#{t}"}.join('&')
tags_str=tag.collect{|t| "tag_id[]=#{t}"}.join('&')
categories_str = "&#{categories_str}" unless categories_str.blank?
tags_str = "&#{tags_str}" unless tags_str.blank?
ret << "?inner=true&page_id=#{page.id}#{categories_str}#{tags_str}&preview=#{params[:preview]}&page_main=#{params[:page_main]}&search_query=#{params[:search_query]}&clicked_field_name=#{params[:clicked_field_name]}&name=#{params[:name]}&item_type=page"
ret << "'></div>"
else
part = page.page_parts.detect{ |p| p.name.to_s == content['name'].to_s } rescue nil
part_title = part.title rescue nil
if edit
ret << "<div class='editable'>" if part
ret << "<div class='edit_link'>"
ret << " <a href='#{edit_admin_page_part_path(part.id)}' class='nav'>#{t(:edit)}</a>" if part
ret << '</div>'
end
case part.kind
when 'text'
ret << part.content rescue ''
when 'module_widget'
url = case part.widget_path
when 'default_widget'
"/panel/orbit_app/widget/#{part.widget_style}?inner=true"
else
# raise ModuleAppError,"PagePart can't find ModuleApp" if part.module_app.nil?
"/panel/#{part.module_app.key}/widget/#{part.widget_path}?inner=true" rescue ''
end
categories_str=(!part[:category].blank? ? part[:category] : category).collect{|t| "category_id[]=#{t}"}.join('&')
tags_str=(!part[:tag].blank? ? part[:tag] : tag).collect{|t| "tag_id[]=#{t}"}.join('&')
categories_str = "&#{categories_str}" unless categories_str.blank?
tags_str = "&#{tags_str}" unless tags_str.blank?
options = "&part_id=#{part.id}#{categories_str}#{tags_str}&page=#{params[:page]}&search_query=#{params[:search_query]}&clicked_field_name=#{params[:clicked_field_name]}&part_title=#{Rack::Utils.escape(part_title).gsub("+", "%20") rescue nil}&item_type=page_part"
ret << "<div class='dymanic_load widget' path='#{url + options}'></div>"
when 'public_r_tag'
ret << "<r:#{part.public_r_tag} id='#{part.public_r_tag_object_id}'/>"
public_r_tags << part.public_r_tag
else
''
end if part
end
scope = "<#{content.name}"
content.attributes.each_pair do |key, value|
scope << " #{key}='#{value}'"
end
scope << ">#{ret}</#{content.name}>"
fragment = Nokogiri::HTML::DocumentFragment.new(body, scope)
content.swap(fragment)
end
public_r_tags.uniq
end
# page_counter
def parse_counter_edit(body = nil)
body.css('.page_counter').each do |counter|
res = ''
case counter['option']
when 'all'
res << display_visitors.to_s
when 'today'
res << display_visitors_today.to_s
when 'this_week'
res << display_visitors_this_week.to_s
when 'this_month'
res << display_visitors_this_month.to_s
when 'this_year'
res << display_visitors_this_year.to_s
end
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div id='#{counter['id']}' class='#{counter['class']}'>#{res}</div>")
counter.swap(fragment)
end
end
end
-7
View File
@@ -1,7 +0,0 @@
# encoding: utf-8
require 'mongo'
db = Mongo::Connection.new("localhost", 27017).db(ARGV[0])
p db["tags"].remove(:_type => {:$ne => 'Tag'})
-11
View File
@@ -1,11 +0,0 @@
# encoding: utf-8
namespace :app_auth do
task :build => :environment do
end
end
-19
View File
@@ -1,19 +0,0 @@
# encoding: utf-8
namespace :items do
task :tree_changes => :environment do
Item.all.each do |item|
item.position -= 1
item.parent_ids = ancestors(item)
item.rename(:full_name, :path)
item.save
end
end
def ancestors(item)
node, nodes = item, []
nodes << node = node.parent while !node.parent.blank? rescue nil
nodes.reverse
end
end
-103
View File
@@ -1,103 +0,0 @@
namespace :nccu do
task :copy_news_object_auth_to_all_of_news_cate => :environment do
# users = user_data.collect do |login_uid|
# nccu_id = get_nccu_id_from_mid_site(login_uid)
# resource = nccu_id.nil? ? nil : (User.first(conditions:{ nccu_ldap_uid: nccu_id }))
# end
nbc = NewsBulletinCategory.first({conditions: "administration"})
users_ary = Array.new(ObjectAuth.first({conditions:{title: "submit",obj_authable_type: "NewsBulletinCategory",obj_authable_id: nbc.id}}).privilege_user_ids)
to_nbcs = NewsBulletinCategory.where(:key.ne=> 'administration')
to_nbcs.each do |cate|
oa = ObjectAuth.first({conditions:{title: "submit",obj_authable_type: "NewsBulletinCategory",obj_authable_id: cate.id}})
oa.privilege_user_ids = users_ary
oa.save
end
end
task :apply_180_news_cate_auth_to_171 => :environment do
ldap_id_data = [3603,100212, 8151, 3471, 145232, 133380, 133222, 127983, 127977, 127692, 123617, 123566, 58483, 48234, 29237, 9253, 8948, 8703, 8251, 7336, 7242, 7220, 6912, 6603, 6459, 5475, 3643, 3641, 3559, 3310, 3248, 2672, 2531, 1633, 1521, 1516, 145571, 20610, 123604, 100211, 39571, 29479, 8013, 6968, 5868, 5724, 5401, 4369, 3573, 3377, 2918, 2822, 2309, 2134, 1731, 1527]
users_ary = Array.new(User.where(:nccu_ldap_uid.in => ldap_id_data ))
NewsBulletinCategory.all.each do |cate|
oa = ObjectAuth.first({conditions:{title: "submit",obj_authable_type: "NewsBulletinCategory",obj_authable_id: cate.id}})
oa.privilege_users = users_ary
oa.save
end
end
task :remove_3603 => :environment do
user_email = 'tu65@nccu.edu.tw'
user = User.first({conditions:{email: user_email}})
NewsBulletinCategory.all.each do |cate|
oa = ObjectAuth.first({conditions:{title: "submit",obj_authable_type: "NewsBulletinCategory",obj_authable_id: cate.id}})
oa.privilege_users.delete_if{|t| t == user}
oa.save
end
key = 'Announcement'
bc = BulletinCategory.first({conditions:{key: key}})
oa = ObjectAuth.first({conditions:{title: "submit",obj_authable_type: "BulletinCategory",obj_authable_id: bc.id}})
oa.privilege_users.delete_if{|t| t == user}
oa.save
end
task :add_nccu_account_1008 => :environment do
a = ['yjlin3@nccu.edu.tw','liwen@nccu.edu.tw','yhc@nccu.edu.tw','kenliu@nccu.edu.tw','cfc@nccu.edu.tw','jasper@nccu.edu.tw','donghe@nccu.edu.tw','frees712@nccu.edu.tw','jeanch@nccu.edu.tw','posty@nccu.edu.tw','yiting@nccu.edu.tw','frank997@nccu.edu.tw']
users_ary = User.any_in(email: a)
NewsBulletinCategory.all.each do |cate|
oa = ObjectAuth.first({conditions:{title: "submit",obj_authable_type: "NewsBulletinCategory",obj_authable_id: cate.id}})
oa.privilege_users = oa.privilege_users + users_ary
oa.save
end
key = 'Announcement'
bc = BulletinCategory.first({conditions:{key: key}})
oa = ObjectAuth.first({conditions:{title: "submit",obj_authable_type: "BulletinCategory",obj_authable_id: bc.id}})
oa.privilege_users = oa.privilege_users + users_ary
oa.save
end
task :add_nccu_account_1009 => :environment do
a = ["blannytg@nccu.edu.tw","yucca@nccu.edu.tw","fish14@nccu.edu.tw","amanda13@nccu.edu.tw"]
users_ary = User.any_in(email: a)
NewsBulletinCategory.all.each do |cate|
oa = ObjectAuth.first({conditions:{title: "submit",obj_authable_type: "NewsBulletinCategory",obj_authable_id: cate.id}})
oa.privilege_users = oa.privilege_users + users_ary
oa.save
end
a=["annieayu@nccu.edu.tw","blannytg@nccu.edu.tw","yucca@nccu.edu.tw","amanda13@nccu.edu.tw"]
users_ary = User.any_in(email: a)
key = 'Announcement'
bc = BulletinCategory.first({conditions:{key: key}})
oa = ObjectAuth.first({conditions:{title: "submit",obj_authable_type: "BulletinCategory",obj_authable_id: bc.id}})
oa.privilege_users = oa.privilege_users + users_ary
oa.save
end
task :add_nccu_account_1016 => :environment do
a = ["waynedd@nccu.edu.tw","sfchang@nccu.edu.tw","kyokolin@nccu.edu.tw","sfaylin@nccu.edu.tw","jinyulin@nccu.edu.tw"]
users_ary = User.any_in(email: a)
NewsBulletinCategory.all.each do |cate|
oa = ObjectAuth.first({conditions:{title: "submit",obj_authable_type: "NewsBulletinCategory",obj_authable_id: cate.id}})
oa.privilege_users = oa.privilege_users + users_ary
oa.save
end
users_ary = User.any_in(email: a)
key = 'Announcement'
bc = BulletinCategory.first({conditions:{key: key}})
oa = ObjectAuth.first({conditions:{title: "submit",obj_authable_type: "BulletinCategory",obj_authable_id: bc.id}})
oa.privilege_users = oa.privilege_users + users_ary
oa.save
end
task :consolidate_object_auth => :environment do
ObjectAuth.all.each{|t| t.save}
end
end
-13
View File
@@ -1,13 +0,0 @@
# encoding: utf-8
namespace :nokogiri do
task :layout => :environment do
l = Design.first(:conditions => {:title => 'CCU'}).layout
l.layout_parts.destroy rescue nil
l.menu.destroy rescue nil
l.design.save
l = Design.first(:conditions => {:title => 'CCU'}).layout
l.file = File.open("#{Rails.root}/lib/noko/layout.html")
l.design.save
end
end
-11
View File
@@ -1,11 +0,0 @@
# encoding: utf-8
namespace :add_content do
task :build => :environment do
ModuleApp.new.from_json(File.open("#{Rails.root}/vendor/built_in_modules/page_content/page_content.json").read).save
end
end
-66
View File
@@ -1,66 +0,0 @@
# encoding: utf-8
namespace :pages do
task :build => :environment do
Item.destroy_all
var_10 = I18nVariable.create!( :document_class => 'Home', :key => 'home', :en => 'Homepage', :zh_tw => '首頁')
var_13 = I18nVariable.create!( :document_class => 'PagePart', :key => 'main_content', :en => 'This is the homepage', :zh_tw => '這是首頁', :parent_id => var_10.id )
design = Design.new(:title => "Fraisier", :author => "Paul", :intro => "Strawberry cake")
design.build_css_default(:file => File.open("#{Rails.root}/lib/fraisier/default.css"))
# image = design.images.build(:file => File.open("#{Rails.root}/lib/fraisier/img/buttons.gif"))
#
# js = design.javascripts.build(:file => File.open("#{Rails.root}/lib/fraisier/inettuts.js"))
#
theme = design.themes.build(:file => File.open("#{Rails.root}/lib/fraisier/themes/default.css"))
theme_1 = design.themes.build(:file => File.open("#{Rails.root}/lib/fraisier/themes/red.css"))
design.build_layout
design.layout.file = File.open("#{Rails.root}/lib/fraisier/layout.html")
design.layout.save
theme.save
theme_1.save
# image.save
# js.save
design.save
design_1 = Design.new(:title => "Bob", :author => "Me", :intro => "Moran")
design_1.build_css_default(:file => File.open("#{Rails.root}/lib/fraisier/default.css"))
# image = design.images.build(:file => File.open("#{Rails.root}/lib/fraisier/img/buttons.gif"))
#
# js = design.javascripts.build(:file => File.open("#{Rails.root}/lib/fraisier/inettuts.js"))
#
theme = design_1.themes.build(:file => File.open("#{Rails.root}/lib/fraisier/themes/default.css"))
theme_1 = design_1.themes.build(:file => File.open("#{Rails.root}/lib/fraisier/themes/red.css"))
design_1.build_layout
design_1.layout.file = File.open("#{Rails.root}/lib/fraisier/layout.html")
design_1.layout.save
theme.save
theme_1.save
# image.save
# js.save
design_1.save
home = Page.create!( :i18n_variable_id => var_10.id, :design_id => design_1.id, :name => 'home', :is_published => true, :theme_id => theme.id )
home.page_parts.create!( :name => 'content_1', :content => File.open("#{Rails.root}/lib/template/home.page").read, :kind => 'text', :i18n_variable_id => var_13.id )
end
end
-29
View File
@@ -1,29 +0,0 @@
# encoding: utf-8
namespace :user do
task :build => :environment do
User.all(conditions: {email: /nor/}).destroy_all
username_list = %w{nor1 nor2 nor3 nor4 nor5 nor6 nor7}
userfirstname_list_en = %w{ UserOne UserTwo Thre For Fiv Six Sen }
userlastname_list_en = %w{ Aa Bb Cc Dd Ee Ff Gg }
userfirstname_list_ct = %w{ 一一 二二 三三 四四 五五 六六 七七 }
userlastname_list_ct = %w{ 陳 林 吳 李 鄭 方 王 }
first_name_field = AttributeField.first(conditions: {key: "first_name"})
last_name_field = AttributeField.first(conditions: {key: "last_name"})
major_field = AttributeField.first(conditions: {key: "major"})
department_field = AttributeField.first(conditions: {key: "department"})
stud_role = Role.first(conditions: {key: 'student'})
username_list.each_with_index do |username,index|
user = User.create( :email => "#{username}@rulingcom.com", :password => 'password', :password_confirmation => 'password', :admin => false ,:role_id => stud_role.id,:sub_role_ids => [stud_role.sub_roles[Random.rand(stud_role.sub_roles.count-1)].id])
AttributeValue.create( :user_id => user.id, :attribute_field_id => first_name_field.id, :key => 'first_name', :en => userfirstname_list_en[index], :zh_tw => userfirstname_list_ct[index] )
AttributeValue.create( :user_id => user.id, :attribute_field_id => last_name_field.id, :key => 'last_name', :en => userlastname_list_en[index], :zh_tw => userlastname_list_ct[index] )
AttributeValue.create( :user_id => user.id, :attribute_field_id => major_field.id, :key => 'major', :en => 'Information management', :zh_tw => '信息化管理' )
AttributeValue.create( :user_id => user.id, :attribute_field_id => department_field.id, :key => 'department', :en => 'Computer Science', :zh_tw => '計算機科學' )
end
end
end
-52
View File
@@ -1,52 +0,0 @@
# encoding: utf-8
namespace :web_link_url do
task :web_link_url_i18n => :environment do
puts 'start'
@weblinks = WebLink.all
@weblinks.each do |wl|
if wl.url.nil?
@wlurl = wl.url_translations
wl.url_translations = {}
wl.url_translations["zh_tw"] = @wlurl
wl.url_translations["en"] = @wlurl
wl.save
else
puts 'no data'
end
end
puts 'end'
puts @weblinks.count
end
task :web_link_url_i18n_test => :environment do
@test = WebLink.find("50aca25583e75204c00009f4")
@testurl = @test.url_translations
@test.url_translations = {}
@test.url_translations["zh_tw"] = @testurl
@test.url_translations["en"] = @testurl
@test.save
end
end
-8
View File
@@ -1,8 +0,0 @@
<r:multi_lang>
<r:lang name='en'>
<p>This is about</p>
</r:lang>
<r:lang name='zh_tw'>
<p>這是關於</p>
</r:lang>
</r:multi_lang>
-8
View File
@@ -1,8 +0,0 @@
<r:multi_lang>
<r:lang name='en'>
<p>Footer</p>
</r:lang>
<r:lang name='zh_tw'>
<p>頁腳</p>
</r:lang>
</r:multi_lang>
-2
View File
@@ -1,2 +0,0 @@
<r:ad_banner name='banner_1'>
</r:ad_banner>
-5
View File
@@ -1,5 +0,0 @@
<ul>
<li><r:link name='home' /></li>
<li><r:link name='about' /></li>
<li><r:link name='google' /></li>
</ul>
-23
View File
@@ -1,23 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>RulingSite</title>
</head>
<body>
<r:layout_part name='header'>
<r:language_bar />
<r:snippet name='nav' />
</r:layout_part>
<r:layout_part name="main_content" editable="true">
</r:layout_part>
<r:layout_part name="footer">
<r:snippet name='footer' />
</r:layout_part>
</body>
</html>