Initial Commit
BIN
Media/Images/loading.gif
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
Media/Images/menu-wrapper.jpg
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Media/Images/page-fullwidth.jpg
Normal file
|
After Width: | Height: | Size: 980 B |
BIN
Media/Images/page.jpg
Normal file
|
After Width: | Height: | Size: 536 B |
BIN
Media/Images/pagebottom.jpg
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
Media/Images/pagetop-fullwidth.jpg
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
Media/Images/pagetop.jpg
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
Media/Images/post.jpg
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
Media/Images/sidebar.jpg
Normal file
|
After Width: | Height: | Size: 415 B |
60
Media/impromptu.css
Normal file
@@ -0,0 +1,60 @@
|
||||
.jqifade{
|
||||
position: absolute;
|
||||
background-color: #000000;
|
||||
}
|
||||
div.jqi{
|
||||
width: 300px;
|
||||
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||
position: absolute;
|
||||
background-color: #ffffff;
|
||||
font-size: 11px;
|
||||
text-align: left;
|
||||
border: solid 1px #eeeeee;
|
||||
border-radius: 10px;
|
||||
-moz-border-radius: 10px;
|
||||
-webkit-border-radius: 10px;
|
||||
padding: 7px;
|
||||
}
|
||||
div.jqi label {
|
||||
width: 100px;
|
||||
}
|
||||
div.jqi .jqicontainer{
|
||||
font-weight: bold;
|
||||
}
|
||||
div.jqi .jqiclose{
|
||||
position: absolute;
|
||||
top: 4px; right: -2px;
|
||||
width: 18px;
|
||||
cursor: default;
|
||||
color: #bbbbbb;
|
||||
font-weight: bold;
|
||||
}
|
||||
div.jqi .jqimessage{
|
||||
padding: 10px;
|
||||
line-height: 20px;
|
||||
color: #444444;
|
||||
}
|
||||
div.jqi .jqibuttons{
|
||||
text-align: right;
|
||||
padding: 5px 0 5px 0;
|
||||
border: solid 1px #eeeeee;
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
div.jqi button{
|
||||
padding: 3px 10px;
|
||||
margin: 0 10px;
|
||||
background-color: #2F6073;
|
||||
border: solid 2px #0F6059;
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
}
|
||||
div.jqi button:hover{
|
||||
background-color: #728A8C;
|
||||
}
|
||||
div.jqi button.jqidefaultbutton{
|
||||
background-color: #00312D;
|
||||
}
|
||||
.jqiwarning .jqi .jqibuttons{
|
||||
background-color: #eeeeee;
|
||||
}
|
||||
78
Media/index.js
Normal file
@@ -0,0 +1,78 @@
|
||||
$(document).ready(function(){
|
||||
rules.init();
|
||||
|
||||
$('#save-as').click(function(){
|
||||
$.prompt({
|
||||
state0: {
|
||||
html: '<label for="filename-prompt">Save As :</label> <input type="text" id="filename-prompt" value=".htaccess"/>',
|
||||
focus: 1,
|
||||
buttons: {Save: true, Cancel: false},
|
||||
submit: function(value) {
|
||||
if (value == true) {
|
||||
var val = $('#filename-prompt').val();
|
||||
if (val == '') {
|
||||
$('#filename-prompt').css("border","solid #ff0000 1px");
|
||||
return false;
|
||||
}
|
||||
window.location = 'download.php?filename='+encodeURI(val);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
show: 'fadeIn',
|
||||
opacity: '0.7',
|
||||
loaded: function() {
|
||||
$('#filename-prompt').keydown(function(event){
|
||||
switch (event.keyCode) {
|
||||
case 13:
|
||||
$('#jqi_state0_buttonSave').click();
|
||||
break;
|
||||
case 27:
|
||||
jQuery.prompt.close();
|
||||
break;
|
||||
}
|
||||
}).focus();
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#delete').click(function(){
|
||||
return confirm('Delete Rules? This will also delete our saved copy (if any)');
|
||||
});
|
||||
|
||||
$('#save').click(function(){
|
||||
$.post($(this).attr('href'), {}, function(){
|
||||
rules.reloadRules();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#field-rule-select').change(function(){
|
||||
var val = $(this).val();
|
||||
if (val == '')
|
||||
return;
|
||||
$('#form-add-rule').submit();
|
||||
$(this).val('');
|
||||
});
|
||||
|
||||
});
|
||||
var ajaxes_running = 0;
|
||||
function do_ajax(method, params, callback)
|
||||
{
|
||||
ajaxes_running++;
|
||||
$('#loading').show();
|
||||
$.ajax('ajax.php?action='+method,{
|
||||
cache : false,
|
||||
data : params,
|
||||
type : 'post',
|
||||
success : callback,
|
||||
complete : function(){
|
||||
ajaxes_running--;
|
||||
if (ajaxes_running == 0)
|
||||
$('#loading').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
13
Media/jquery-impromptu.3.2.min.js
vendored
Normal file
4
Media/jquery.min.js
vendored
Normal file
112
Media/nicEdit.js
Normal file
@@ -0,0 +1,112 @@
|
||||
/* NicEdit - Micro Inline WYSIWYG
|
||||
* Copyright 2007-2008 Brian Kirchoff
|
||||
*
|
||||
* NicEdit is distributed under the terms of the MIT license
|
||||
* For more information visit http://nicedit.com/
|
||||
* Do not remove this copyright message
|
||||
*/
|
||||
var bkExtend=function(){var A=arguments;if(A.length==1){A=[this,A[0]]}for(var B in A[1]){A[0][B]=A[1][B]}return A[0]};function bkClass(){}bkClass.prototype.construct=function(){};bkClass.extend=function(C){var A=function(){if(arguments[0]!==bkClass){return this.construct.apply(this,arguments)}};var B=new this(bkClass);bkExtend(B,C);A.prototype=B;A.extend=this.extend;return A};var bkElement=bkClass.extend({construct:function(B,A){if(typeof (B)=="string"){B=(A||document).createElement(B)}B=$BK(B);return B},appendTo:function(A){A.appendChild(this);return this},appendBefore:function(A){A.parentNode.insertBefore(this,A);return this},addEvent:function(B,A){bkLib.addEvent(this,B,A);return this},setContent:function(A){this.innerHTML=A;return this},pos:function(){var C=curtop=0;var B=obj=this;if(obj.offsetParent){do{C+=obj.offsetLeft;curtop+=obj.offsetTop}while(obj=obj.offsetParent)}var A=(!window.opera)?parseInt(this.getStyle("border-width")||this.style.border)||0:0;return[C+A,curtop+A+this.offsetHeight]},noSelect:function(){bkLib.noSelect(this);return this},parentTag:function(A){var B=this;do{if(B&&B.nodeName&&B.nodeName.toUpperCase()==A){return B}B=B.parentNode}while(B);return false},hasClass:function(A){return this.className.match(new RegExp("(\\s|^)nicEdit-"+A+"(\\s|$)"))},addClass:function(A){if(!this.hasClass(A)){this.className+=" nicEdit-"+A}return this},removeClass:function(A){if(this.hasClass(A)){this.className=this.className.replace(new RegExp("(\\s|^)nicEdit-"+A+"(\\s|$)")," ")}return this},setStyle:function(A){var B=this.style;for(var C in A){switch(C){case"float":B.cssFloat=B.styleFloat=A[C];break;case"opacity":B.opacity=A[C];B.filter="alpha(opacity="+Math.round(A[C]*100)+")";break;case"className":this.className=A[C];break;default:B[C]=A[C]}}return this},getStyle:function(A,C){var B=(!C)?document.defaultView:C;if(this.nodeType==1){return(B&&B.getComputedStyle)?B.getComputedStyle(this,null).getPropertyValue(A):this.currentStyle[bkLib.camelize(A)]}},remove:function(){this.parentNode.removeChild(this);return this},setAttributes:function(A){for(var B in A){this[B]=A[B]}return this}});var bkLib={isMSIE:(navigator.appVersion.indexOf("MSIE")!=-1),addEvent:function(C,B,A){(C.addEventListener)?C.addEventListener(B,A,false):C.attachEvent("on"+B,A)},toArray:function(C){var B=C.length,A=new Array(B);while(B--){A[B]=C[B]}return A},noSelect:function(B){if(B.setAttribute&&B.nodeName.toLowerCase()!="input"&&B.nodeName.toLowerCase()!="textarea"){B.setAttribute("unselectable","on")}for(var A=0;A<B.childNodes.length;A++){bkLib.noSelect(B.childNodes[A])}},camelize:function(A){return A.replace(/\-(.)/g,function(B,C){return C.toUpperCase()})},inArray:function(A,B){return(bkLib.search(A,B)!=null)},search:function(A,C){for(var B=0;B<A.length;B++){if(A[B]==C){return B}}return null},cancelEvent:function(A){A=A||window.event;if(A.preventDefault&&A.stopPropagation){A.preventDefault();A.stopPropagation()}return false},domLoad:[],domLoaded:function(){if(arguments.callee.done){return }arguments.callee.done=true;for(i=0;i<bkLib.domLoad.length;i++){bkLib.domLoad[i]()}},onDomLoaded:function(A){this.domLoad.push(A);if(document.addEventListener){document.addEventListener("DOMContentLoaded",bkLib.domLoaded,null)}else{if(bkLib.isMSIE){document.write("<style>.nicEdit-main p { margin: 0; }</style><script id=__ie_onload defer "+((location.protocol=="https:")?"src='javascript:void(0)'":"src=//0")+"><\/script>");$BK("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){bkLib.domLoaded()}}}}window.onload=bkLib.domLoaded}};function $BK(A){if(typeof (A)=="string"){A=document.getElementById(A)}return(A&&!A.appendTo)?bkExtend(A,bkElement.prototype):A}var bkEvent={addEvent:function(A,B){if(B){this.eventList=this.eventList||{};this.eventList[A]=this.eventList[A]||[];this.eventList[A].push(B)}return this},fireEvent:function(){var A=bkLib.toArray(arguments),C=A.shift();if(this.eventList&&this.eventList[C]){for(var B=0;B<this.eventList[C].length;B++){this.eventList[C][B].apply(this,A)}}}};function __(A){return A}Function.prototype.closure=function(){var A=this,B=bkLib.toArray(arguments),C=B.shift();return function(){if(typeof (bkLib)!="undefined"){return A.apply(C,B.concat(bkLib.toArray(arguments)))}}};Function.prototype.closureListener=function(){var A=this,C=bkLib.toArray(arguments),B=C.shift();return function(E){E=E||window.event;if(E.target){var D=E.target}else{var D=E.srcElement}return A.apply(B,[E,D].concat(C))}};
|
||||
|
||||
|
||||
|
||||
var nicEditorConfig = bkClass.extend({
|
||||
buttons : {
|
||||
'bold' : {name : __('Click to Bold'), command : 'Bold', tags : ['B','STRONG'], css : {'font-weight' : 'bold'}, key : 'b'},
|
||||
'italic' : {name : __('Click to Italic'), command : 'Italic', tags : ['EM','I'], css : {'font-style' : 'italic'}, key : 'i'},
|
||||
'underline' : {name : __('Click to Underline'), command : 'Underline', tags : ['U'], css : {'text-decoration' : 'underline'}, key : 'u'},
|
||||
'left' : {name : __('Left Align'), command : 'justifyleft', noActive : true},
|
||||
'center' : {name : __('Center Align'), command : 'justifycenter', noActive : true},
|
||||
'right' : {name : __('Right Align'), command : 'justifyright', noActive : true},
|
||||
'justify' : {name : __('Justify Align'), command : 'justifyfull', noActive : true},
|
||||
'ol' : {name : __('Insert Ordered List'), command : 'insertorderedlist', tags : ['OL']},
|
||||
'ul' : {name : __('Insert Unordered List'), command : 'insertunorderedlist', tags : ['UL']},
|
||||
'subscript' : {name : __('Click to Subscript'), command : 'subscript', tags : ['SUB']},
|
||||
'superscript' : {name : __('Click to Superscript'), command : 'superscript', tags : ['SUP']},
|
||||
'strikethrough' : {name : __('Click to Strike Through'), command : 'strikeThrough', css : {'text-decoration' : 'line-through'}},
|
||||
'removeformat' : {name : __('Remove Formatting'), command : 'removeformat', noActive : true},
|
||||
'indent' : {name : __('Indent Text'), command : 'indent', noActive : true},
|
||||
'outdent' : {name : __('Remove Indent'), command : 'outdent', noActive : true},
|
||||
'hr' : {name : __('Horizontal Rule'), command : 'insertHorizontalRule', noActive : true}
|
||||
},
|
||||
iconsPath : '../nicEditorIcons.gif',
|
||||
buttonList : ['save','bold','italic','underline','left','center','right','justify','ol','ul','fontSize','fontFamily','fontFormat','indent','outdent','image','upload','link','unlink','forecolor','bgcolor'],
|
||||
iconList : {"xhtml":1,"bgcolor":2,"forecolor":3,"bold":4,"center":5,"hr":6,"indent":7,"italic":8,"justify":9,"left":10,"ol":11,"outdent":12,"removeformat":13,"right":14,"save":25,"strikethrough":16,"subscript":17,"superscript":18,"ul":19,"underline":20,"image":21,"link":22,"unlink":23,"close":24,"arrow":26}
|
||||
|
||||
});
|
||||
;
|
||||
var nicEditors={nicPlugins:[],editors:[],registerPlugin:function(B,A){this.nicPlugins.push({p:B,o:A})},allTextAreas:function(C){var A=document.getElementsByTagName("textarea");for(var B=0;B<A.length;B++){nicEditors.editors.push(new nicEditor(C).panelInstance(A[B]))}return nicEditors.editors},findEditor:function(C){var B=nicEditors.editors;for(var A=0;A<B.length;A++){if(B[A].instanceById(C)){return B[A].instanceById(C)}}}};var nicEditor=bkClass.extend({construct:function(C){this.options=new nicEditorConfig();bkExtend(this.options,C);this.nicInstances=new Array();this.loadedPlugins=new Array();var A=nicEditors.nicPlugins;for(var B=0;B<A.length;B++){this.loadedPlugins.push(new A[B].p(this,A[B].o))}nicEditors.editors.push(this);bkLib.addEvent(document.body,"mousedown",this.selectCheck.closureListener(this))},panelInstance:function(B,C){B=this.checkReplace($BK(B));var A=new bkElement("DIV").setStyle({width:(parseInt(B.getStyle("width"))||B.clientWidth)+"px"}).appendBefore(B);this.setPanel(A);return this.addInstance(B,C)},checkReplace:function(B){var A=nicEditors.findEditor(B);if(A){A.removeInstance(B);A.removePanel()}return B},addInstance:function(B,C){B=this.checkReplace($BK(B));if(B.contentEditable||!!window.opera){var A=new nicEditorInstance(B,C,this)}else{var A=new nicEditorIFrameInstance(B,C,this)}this.nicInstances.push(A);return this},removeInstance:function(C){C=$BK(C);var B=this.nicInstances;for(var A=0;A<B.length;A++){if(B[A].e==C){B[A].remove();this.nicInstances.splice(A,1)}}},removePanel:function(A){if(this.nicPanel){this.nicPanel.remove();this.nicPanel=null}},instanceById:function(C){C=$BK(C);var B=this.nicInstances;for(var A=0;A<B.length;A++){if(B[A].e==C){return B[A]}}},setPanel:function(A){this.nicPanel=new nicEditorPanel($BK(A),this.options,this);this.fireEvent("panel",this.nicPanel);return this},nicCommand:function(B,A){if(this.selectedInstance){this.selectedInstance.nicCommand(B,A)}},getIcon:function(D,A){var C=this.options.iconList[D];var B=(A.iconFiles)?A.iconFiles[D]:"";return{backgroundImage:"url('"+((C)?this.options.iconsPath:B)+"')",backgroundPosition:((C)?((C-1)*-18):0)+"px 0px"}},selectCheck:function(C,A){var B=false;do{if(A.className&&A.className.indexOf("nicEdit")!=-1){return false}}while(A=A.parentNode);this.fireEvent("blur",this.selectedInstance,A);this.lastSelectedInstance=this.selectedInstance;this.selectedInstance=null;return false}});nicEditor=nicEditor.extend(bkEvent);
|
||||
var nicEditorInstance=bkClass.extend({isSelected:false,construct:function(G,D,C){this.ne=C;this.elm=this.e=G;this.options=D||{};newX=parseInt(G.getStyle("width"))||G.clientWidth;newY=parseInt(G.getStyle("height"))||G.clientHeight;this.initialHeight=newY-8;var H=(G.nodeName.toLowerCase()=="textarea");if(H||this.options.hasPanel){var B=(bkLib.isMSIE&&!((typeof document.body.style.maxHeight!="undefined")&&document.compatMode=="CSS1Compat"));var E={width:newX+"px",border:"1px solid #ccc",borderTop:0,overflowY:"auto",overflowX:"hidden"};E[(B)?"height":"maxHeight"]=(this.ne.options.maxHeight)?this.ne.options.maxHeight+"px":null;this.editorContain=new bkElement("DIV").setStyle(E).appendBefore(G);var A=new bkElement("DIV").setStyle({width:(newX-8)+"px",margin:"4px",minHeight:newY+"px"}).addClass("main").appendTo(this.editorContain);G.setStyle({display:"none"});A.innerHTML=G.innerHTML;if(H){A.setContent(G.value);this.copyElm=G;var F=G.parentTag("FORM");if(F){bkLib.addEvent(F,"submit",this.saveContent.closure(this))}}A.setStyle((B)?{height:newY+"px"}:{overflow:"hidden"});this.elm=A}this.ne.addEvent("blur",this.blur.closure(this));this.init();this.blur()},init:function(){this.elm.setAttribute("contentEditable","true");if(this.getContent()==""){this.setContent("<br />")}this.instanceDoc=document.defaultView;this.elm.addEvent("mousedown",this.selected.closureListener(this)).addEvent("keypress",this.keyDown.closureListener(this)).addEvent("focus",this.selected.closure(this)).addEvent("blur",this.blur.closure(this)).addEvent("keyup",this.selected.closure(this));this.ne.fireEvent("add",this)},remove:function(){this.saveContent();if(this.copyElm||this.options.hasPanel){this.editorContain.remove();this.e.setStyle({display:"block"});this.ne.removePanel()}this.disable();this.ne.fireEvent("remove",this)},disable:function(){this.elm.setAttribute("contentEditable","false")},getSel:function(){return(window.getSelection)?window.getSelection():document.selection},getRng:function(){var A=this.getSel();if(!A||A.rangeCount===0){return }return(A.rangeCount>0)?A.getRangeAt(0):A.createRange()},selRng:function(A,B){if(window.getSelection){B.removeAllRanges();B.addRange(A)}else{A.select()}},selElm:function(){var C=this.getRng();if(!C){return }if(C.startContainer){var D=C.startContainer;if(C.cloneContents().childNodes.length==1){for(var B=0;B<D.childNodes.length;B++){var A=D.childNodes[B].ownerDocument.createRange();A.selectNode(D.childNodes[B]);if(C.compareBoundaryPoints(Range.START_TO_START,A)!=1&&C.compareBoundaryPoints(Range.END_TO_END,A)!=-1){return $BK(D.childNodes[B])}}}return $BK(D)}else{return $BK((this.getSel().type=="Control")?C.item(0):C.parentElement())}},saveRng:function(){this.savedRange=this.getRng();this.savedSel=this.getSel()},restoreRng:function(){if(this.savedRange){this.selRng(this.savedRange,this.savedSel)}},keyDown:function(B,A){if(B.ctrlKey){this.ne.fireEvent("key",this,B)}},selected:function(C,A){if(!A&&!(A=this.selElm)){A=this.selElm()}if(!C.ctrlKey){var B=this.ne.selectedInstance;if(B!=this){if(B){this.ne.fireEvent("blur",B,A)}this.ne.selectedInstance=this;this.ne.fireEvent("focus",B,A)}this.ne.fireEvent("selected",B,A);this.isFocused=true;this.elm.addClass("selected")}return false},blur:function(){this.isFocused=false;this.elm.removeClass("selected")},saveContent:function(){if(this.copyElm||this.options.hasPanel){this.ne.fireEvent("save",this);(this.copyElm)?this.copyElm.value=this.getContent():this.e.innerHTML=this.getContent()}},getElm:function(){return this.elm},getContent:function(){this.content=this.getElm().innerHTML;this.ne.fireEvent("get",this);return this.content},setContent:function(A){this.content=A;this.ne.fireEvent("set",this);this.elm.innerHTML=this.content},nicCommand:function(B,A){document.execCommand(B,false,A)}});
|
||||
var nicEditorIFrameInstance=nicEditorInstance.extend({savedStyles:[],init:function(){var B=this.elm.innerHTML.replace(/^\s+|\s+$/g,"");this.elm.innerHTML="";(!B)?B="<br />":B;this.initialContent=B;this.elmFrame=new bkElement("iframe").setAttributes({src:"javascript:;",frameBorder:0,allowTransparency:"true",scrolling:"no"}).setStyle({height:"100px",width:"100%"}).addClass("frame").appendTo(this.elm);if(this.copyElm){this.elmFrame.setStyle({width:(this.elm.offsetWidth-4)+"px"})}var A=["font-size","font-family","font-weight","color"];for(itm in A){this.savedStyles[bkLib.camelize(itm)]=this.elm.getStyle(itm)}setTimeout(this.initFrame.closure(this),50)},disable:function(){this.elm.innerHTML=this.getContent()},initFrame:function(){var B=$BK(this.elmFrame.contentWindow.document);B.designMode="on";B.open();var A=this.ne.options.externalCSS;B.write("<html><head>"+((A)?'<link href="'+A+'" rel="stylesheet" type="text/css" />':"")+'</head><body id="nicEditContent" style="margin: 0 !important; background-color: transparent !important;">'+this.initialContent+"</body></html>");B.close();this.frameDoc=B;this.frameWin=$BK(this.elmFrame.contentWindow);this.frameContent=$BK(this.frameWin.document.body).setStyle(this.savedStyles);this.instanceDoc=this.frameWin.document.defaultView;this.heightUpdate();this.frameDoc.addEvent("mousedown",this.selected.closureListener(this)).addEvent("keyup",this.heightUpdate.closureListener(this)).addEvent("keydown",this.keyDown.closureListener(this)).addEvent("keyup",this.selected.closure(this));this.ne.fireEvent("add",this)},getElm:function(){return this.frameContent},setContent:function(A){this.content=A;this.ne.fireEvent("set",this);this.frameContent.innerHTML=this.content;this.heightUpdate()},getSel:function(){return(this.frameWin)?this.frameWin.getSelection():this.frameDoc.selection},heightUpdate:function(){this.elmFrame.style.height=Math.max(this.frameContent.offsetHeight,this.initialHeight)+"px"},nicCommand:function(B,A){this.frameDoc.execCommand(B,false,A);setTimeout(this.heightUpdate.closure(this),100)}});
|
||||
var nicEditorPanel=bkClass.extend({construct:function(E,B,A){this.elm=E;this.options=B;this.ne=A;this.panelButtons=new Array();this.buttonList=bkExtend([],this.ne.options.buttonList);this.panelContain=new bkElement("DIV").setStyle({overflow:"hidden",width:"100%",border:"1px solid #cccccc",backgroundColor:"#efefef"}).addClass("panelContain");this.panelElm=new bkElement("DIV").setStyle({margin:"2px",marginTop:"0px",zoom:1,overflow:"hidden"}).addClass("panel").appendTo(this.panelContain);this.panelContain.appendTo(E);var C=this.ne.options;var D=C.buttons;for(button in D){this.addButton(button,C,true)}this.reorder();E.noSelect()},addButton:function(buttonName,options,noOrder){var button=options.buttons[buttonName];var type=(button.type)?eval("(typeof("+button.type+') == "undefined") ? null : '+button.type+";"):nicEditorButton;var hasButton=bkLib.inArray(this.buttonList,buttonName);if(type&&(hasButton||this.ne.options.fullPanel)){this.panelButtons.push(new type(this.panelElm,buttonName,options,this.ne));if(!hasButton){this.buttonList.push(buttonName)}}},findButton:function(B){for(var A=0;A<this.panelButtons.length;A++){if(this.panelButtons[A].name==B){return this.panelButtons[A]}}},reorder:function(){var C=this.buttonList;for(var B=0;B<C.length;B++){var A=this.findButton(C[B]);if(A){this.panelElm.appendChild(A.margin)}}},remove:function(){this.elm.remove()}});
|
||||
var nicEditorButton=bkClass.extend({construct:function(D,A,C,B){this.options=C.buttons[A];this.name=A;this.ne=B;this.elm=D;this.margin=new bkElement("DIV").setStyle({"float":"left",marginTop:"2px"}).appendTo(D);this.contain=new bkElement("DIV").setStyle({width:"20px",height:"20px"}).addClass("buttonContain").appendTo(this.margin);this.border=new bkElement("DIV").setStyle({backgroundColor:"#efefef",border:"1px solid #efefef"}).appendTo(this.contain);this.button=new bkElement("DIV").setStyle({width:"18px",height:"18px",overflow:"hidden",zoom:1,cursor:"pointer"}).addClass("button").setStyle(this.ne.getIcon(A,C)).appendTo(this.border);this.button.addEvent("mouseover",this.hoverOn.closure(this)).addEvent("mouseout",this.hoverOff.closure(this)).addEvent("mousedown",this.mouseClick.closure(this)).noSelect();if(!window.opera){this.button.onmousedown=this.button.onclick=bkLib.cancelEvent}B.addEvent("selected",this.enable.closure(this)).addEvent("blur",this.disable.closure(this)).addEvent("key",this.key.closure(this));this.disable();this.init()},init:function(){},hide:function(){this.contain.setStyle({display:"none"})},updateState:function(){if(this.isDisabled){this.setBg()}else{if(this.isHover){this.setBg("hover")}else{if(this.isActive){this.setBg("active")}else{this.setBg()}}}},setBg:function(A){switch(A){case"hover":var B={border:"1px solid #666",backgroundColor:"#ddd"};break;case"active":var B={border:"1px solid #666",backgroundColor:"#ccc"};break;default:var B={border:"1px solid #efefef",backgroundColor:"#efefef"}}this.border.setStyle(B).addClass("button-"+A)},checkNodes:function(A){var B=A;do{if(this.options.tags&&bkLib.inArray(this.options.tags,B.nodeName)){this.activate();return true}}while(B=B.parentNode&&B.className!="nicEdit");B=$BK(A);while(B.nodeType==3){B=$BK(B.parentNode)}if(this.options.css){for(itm in this.options.css){if(B.getStyle(itm,this.ne.selectedInstance.instanceDoc)==this.options.css[itm]){this.activate();return true}}}this.deactivate();return false},activate:function(){if(!this.isDisabled){this.isActive=true;this.updateState();this.ne.fireEvent("buttonActivate",this)}},deactivate:function(){this.isActive=false;this.updateState();if(!this.isDisabled){this.ne.fireEvent("buttonDeactivate",this)}},enable:function(A,B){this.isDisabled=false;this.contain.setStyle({opacity:1}).addClass("buttonEnabled");this.updateState();this.checkNodes(B)},disable:function(A,B){this.isDisabled=true;this.contain.setStyle({opacity:0.6}).removeClass("buttonEnabled");this.updateState()},toggleActive:function(){(this.isActive)?this.deactivate():this.activate()},hoverOn:function(){if(!this.isDisabled){this.isHover=true;this.updateState();this.ne.fireEvent("buttonOver",this)}},hoverOff:function(){this.isHover=false;this.updateState();this.ne.fireEvent("buttonOut",this)},mouseClick:function(){if(this.options.command){this.ne.nicCommand(this.options.command,this.options.commandArgs);if(!this.options.noActive){this.toggleActive()}}this.ne.fireEvent("buttonClick",this)},key:function(A,B){if(this.options.key&&B.ctrlKey&&String.fromCharCode(B.keyCode||B.charCode).toLowerCase()==this.options.key){this.mouseClick();if(B.preventDefault){B.preventDefault()}}}});
|
||||
var nicPlugin=bkClass.extend({construct:function(B,A){this.options=A;this.ne=B;this.ne.addEvent("panel",this.loadPanel.closure(this));this.init()},loadPanel:function(C){var B=this.options.buttons;for(var A in B){C.addButton(A,this.options)}C.reorder()},init:function(){}});
|
||||
|
||||
|
||||
var nicPaneOptions = { };
|
||||
|
||||
var nicEditorPane=bkClass.extend({construct:function(D,C,B,A){this.ne=C;this.elm=D;this.pos=D.pos();this.contain=new bkElement("div").setStyle({zIndex:"99999",overflow:"hidden",position:"absolute",left:this.pos[0]+"px",top:this.pos[1]+"px"});this.pane=new bkElement("div").setStyle({fontSize:"12px",border:"1px solid #ccc",overflow:"hidden",padding:"4px",textAlign:"left",backgroundColor:"#ffffc9"}).addClass("pane").setStyle(B).appendTo(this.contain);if(A&&!A.options.noClose){this.close=new bkElement("div").setStyle({"float":"right",height:"16px",width:"16px",cursor:"pointer"}).setStyle(this.ne.getIcon("close",nicPaneOptions)).addEvent("mousedown",A.removePane.closure(this)).appendTo(this.pane)}this.contain.noSelect().appendTo(document.body);this.position();this.init()},init:function(){},position:function(){if(this.ne.nicPanel){var B=this.ne.nicPanel.elm;var A=B.pos();var C=A[0]+parseInt(B.getStyle("width"))-(parseInt(this.pane.getStyle("width"))+8);if(C<this.pos[0]){this.contain.setStyle({left:C+"px"})}}},toggle:function(){this.isVisible=!this.isVisible;this.contain.setStyle({display:((this.isVisible)?"block":"none")})},remove:function(){if(this.contain){this.contain.remove();this.contain=null}},append:function(A){A.appendTo(this.pane)},setContent:function(A){this.pane.setContent(A)}});
|
||||
|
||||
var nicEditorAdvancedButton=nicEditorButton.extend({init:function(){this.ne.addEvent("selected",this.removePane.closure(this)).addEvent("blur",this.removePane.closure(this))},mouseClick:function(){if(!this.isDisabled){if(this.pane&&this.pane.pane){this.removePane()}else{this.pane=new nicEditorPane(this.contain,this.ne,{width:(this.width||"270px"),backgroundColor:"#fff"},this);this.addPane();this.ne.selectedInstance.saveRng()}}},addForm:function(C,G){this.form=new bkElement("form").addEvent("submit",this.submit.closureListener(this));this.pane.append(this.form);this.inputs={};for(itm in C){var D=C[itm];var F="";if(G){F=G.getAttribute(itm)}if(!F){F=D.value||""}var A=C[itm].type;if(A=="title"){new bkElement("div").setContent(D.txt).setStyle({fontSize:"14px",fontWeight:"bold",padding:"0px",margin:"2px 0"}).appendTo(this.form)}else{var B=new bkElement("div").setStyle({overflow:"hidden",clear:"both"}).appendTo(this.form);if(D.txt){new bkElement("label").setAttributes({"for":itm}).setContent(D.txt).setStyle({margin:"2px 4px",fontSize:"13px",width:"50px",lineHeight:"20px",textAlign:"right","float":"left"}).appendTo(B)}switch(A){case"text":this.inputs[itm]=new bkElement("input").setAttributes({id:itm,value:F,type:"text"}).setStyle({margin:"2px 0",fontSize:"13px","float":"left",height:"20px",border:"1px solid #ccc",overflow:"hidden"}).setStyle(D.style).appendTo(B);break;case"select":this.inputs[itm]=new bkElement("select").setAttributes({id:itm}).setStyle({border:"1px solid #ccc","float":"left",margin:"2px 0"}).appendTo(B);for(opt in D.options){var E=new bkElement("option").setAttributes({value:opt,selected:(opt==F)?"selected":""}).setContent(D.options[opt]).appendTo(this.inputs[itm])}break;case"content":this.inputs[itm]=new bkElement("textarea").setAttributes({id:itm}).setStyle({border:"1px solid #ccc","float":"left"}).setStyle(D.style).appendTo(B);this.inputs[itm].value=F}}}new bkElement("input").setAttributes({type:"submit"}).setStyle({backgroundColor:"#efefef",border:"1px solid #ccc",margin:"3px 0","float":"left",clear:"both"}).appendTo(this.form);this.form.onsubmit=bkLib.cancelEvent},submit:function(){},findElm:function(B,A,E){var D=this.ne.selectedInstance.getElm().getElementsByTagName(B);for(var C=0;C<D.length;C++){if(D[C].getAttribute(A)==E){return $BK(D[C])}}},removePane:function(){if(this.pane){this.pane.remove();this.pane=null;this.ne.selectedInstance.restoreRng()}}});
|
||||
|
||||
var nicButtonTips=bkClass.extend({construct:function(A){this.ne=A;A.addEvent("buttonOver",this.show.closure(this)).addEvent("buttonOut",this.hide.closure(this))},show:function(A){this.timer=setTimeout(this.create.closure(this,A),400)},create:function(A){this.timer=null;if(!this.pane){this.pane=new nicEditorPane(A.button,this.ne,{fontSize:"12px",marginTop:"5px"});this.pane.setContent(A.options.name)}},hide:function(A){if(this.timer){clearTimeout(this.timer)}if(this.pane){this.pane=this.pane.remove()}}});nicEditors.registerPlugin(nicButtonTips);
|
||||
|
||||
|
||||
var nicSelectOptions = {
|
||||
buttons : {
|
||||
'fontSize' : {name : __('Select Font Size'), type : 'nicEditorFontSizeSelect', command : 'fontsize'},
|
||||
'fontFamily' : {name : __('Select Font Family'), type : 'nicEditorFontFamilySelect', command : 'fontname'},
|
||||
'fontFormat' : {name : __('Select Font Format'), type : 'nicEditorFontFormatSelect', command : 'formatBlock'}
|
||||
}
|
||||
};
|
||||
|
||||
var nicEditorSelect=bkClass.extend({construct:function(D,A,C,B){this.options=C.buttons[A];this.elm=D;this.ne=B;this.name=A;this.selOptions=new Array();this.margin=new bkElement("div").setStyle({"float":"left",margin:"2px 1px 0 1px"}).appendTo(this.elm);this.contain=new bkElement("div").setStyle({width:"90px",height:"20px",cursor:"pointer",overflow:"hidden"}).addClass("selectContain").addEvent("click",this.toggle.closure(this)).appendTo(this.margin);this.items=new bkElement("div").setStyle({overflow:"hidden",zoom:1,border:"1px solid #ccc",paddingLeft:"3px",backgroundColor:"#fff"}).appendTo(this.contain);this.control=new bkElement("div").setStyle({overflow:"hidden","float":"right",height:"18px",width:"16px"}).addClass("selectControl").setStyle(this.ne.getIcon("arrow",C)).appendTo(this.items);this.txt=new bkElement("div").setStyle({overflow:"hidden","float":"left",width:"66px",height:"14px",marginTop:"1px",fontFamily:"sans-serif",textAlign:"center",fontSize:"12px"}).addClass("selectTxt").appendTo(this.items);if(!window.opera){this.contain.onmousedown=this.control.onmousedown=this.txt.onmousedown=bkLib.cancelEvent}this.margin.noSelect();this.ne.addEvent("selected",this.enable.closure(this)).addEvent("blur",this.disable.closure(this));this.disable();this.init()},disable:function(){this.isDisabled=true;this.close();this.contain.setStyle({opacity:0.6})},enable:function(A){this.isDisabled=false;this.close();this.contain.setStyle({opacity:1})},setDisplay:function(A){this.txt.setContent(A)},toggle:function(){if(!this.isDisabled){(this.pane)?this.close():this.open()}},open:function(){this.pane=new nicEditorPane(this.items,this.ne,{width:"88px",padding:"0px",borderTop:0,borderLeft:"1px solid #ccc",borderRight:"1px solid #ccc",borderBottom:"0px",backgroundColor:"#fff"});for(var C=0;C<this.selOptions.length;C++){var B=this.selOptions[C];var A=new bkElement("div").setStyle({overflow:"hidden",borderBottom:"1px solid #ccc",width:"88px",textAlign:"left",overflow:"hidden",cursor:"pointer"});var D=new bkElement("div").setStyle({padding:"0px 4px"}).setContent(B[1]).appendTo(A).noSelect();D.addEvent("click",this.update.closure(this,B[0])).addEvent("mouseover",this.over.closure(this,D)).addEvent("mouseout",this.out.closure(this,D)).setAttributes("id",B[0]);this.pane.append(A);if(!window.opera){D.onmousedown=bkLib.cancelEvent}}},close:function(){if(this.pane){this.pane=this.pane.remove()}},over:function(A){A.setStyle({backgroundColor:"#ccc"})},out:function(A){A.setStyle({backgroundColor:"#fff"})},add:function(B,A){this.selOptions.push(new Array(B,A))},update:function(A){this.ne.nicCommand(this.options.command,A);this.close()}});var nicEditorFontSizeSelect=nicEditorSelect.extend({sel:{1:"1 (8pt)",2:"2 (10pt)",3:"3 (12pt)",4:"4 (14pt)",5:"5 (18pt)",6:"6 (24pt)"},init:function(){this.setDisplay("Font Size...");for(itm in this.sel){this.add(itm,'<font size="'+itm+'">'+this.sel[itm]+"</font>")}}});var nicEditorFontFamilySelect=nicEditorSelect.extend({sel:{arial:"Arial","comic sans ms":"Comic Sans","courier new":"Courier New",georgia:"Georgia",helvetica:"Helvetica",impact:"Impact","times new roman":"Times","trebuchet ms":"Trebuchet",verdana:"Verdana"},init:function(){this.setDisplay("Font Family...");for(itm in this.sel){this.add(itm,'<font face="'+itm+'">'+this.sel[itm]+"</font>")}}});var nicEditorFontFormatSelect=nicEditorSelect.extend({sel:{p:"Paragraph",pre:"Pre",h6:"Heading 6",h5:"Heading 5",h4:"Heading 4",h3:"Heading 3",h2:"Heading 2",h1:"Heading 1"},init:function(){this.setDisplay("Font Format...");for(itm in this.sel){var A=itm.toUpperCase();this.add("<"+A+">","<"+itm+' style="padding: 0px; margin: 0px;">'+this.sel[itm]+"</"+A+">")}}});nicEditors.registerPlugin(nicPlugin,nicSelectOptions);
|
||||
|
||||
|
||||
var nicLinkOptions = {
|
||||
buttons : {
|
||||
'link' : {name : 'Add Link', type : 'nicLinkButton', tags : ['A']},
|
||||
'unlink' : {name : 'Remove Link', command : 'unlink', noActive : true}
|
||||
}
|
||||
};
|
||||
|
||||
var nicLinkButton=nicEditorAdvancedButton.extend({addPane:function(){this.ln=this.ne.selectedInstance.selElm().parentTag("A");this.addForm({"":{type:"title",txt:"Add/Edit Link"},href:{type:"text",txt:"URL",value:"http://",style:{width:"150px"}},title:{type:"text",txt:"Title"},target:{type:"select",txt:"Open In",options:{"":"Current Window",_blank:"New Window"},style:{width:"100px"}}},this.ln)},submit:function(C){var A=this.inputs.href.value;if(A=="http://"||A==""){alert("You must enter a URL to Create a Link");return false}this.removePane();if(!this.ln){var B="javascript:nicTemp();";this.ne.nicCommand("createlink",B);this.ln=this.findElm("A","href",B)}if(this.ln){this.ln.setAttributes({href:this.inputs.href.value,title:this.inputs.title.value,target:this.inputs.target.options[this.inputs.target.selectedIndex].value})}}});nicEditors.registerPlugin(nicPlugin,nicLinkOptions);
|
||||
|
||||
|
||||
var nicColorOptions = {
|
||||
buttons : {
|
||||
'forecolor' : {name : __('Change Text Color'), type : 'nicEditorColorButton', noClose : true},
|
||||
'bgcolor' : {name : __('Change Background Color'), type : 'nicEditorBgColorButton', noClose : true}
|
||||
}
|
||||
};
|
||||
|
||||
var nicEditorColorButton=nicEditorAdvancedButton.extend({addPane:function(){var D={0:"00",1:"33",2:"66",3:"99",4:"CC",5:"FF"};var H=new bkElement("DIV").setStyle({width:"270px"});for(var A in D){for(var F in D){for(var E in D){var I="#"+D[A]+D[E]+D[F];var C=new bkElement("DIV").setStyle({cursor:"pointer",height:"15px","float":"left"}).appendTo(H);var G=new bkElement("DIV").setStyle({border:"2px solid "+I}).appendTo(C);var B=new bkElement("DIV").setStyle({backgroundColor:I,overflow:"hidden",width:"11px",height:"11px"}).addEvent("click",this.colorSelect.closure(this,I)).addEvent("mouseover",this.on.closure(this,G)).addEvent("mouseout",this.off.closure(this,G,I)).appendTo(G);if(!window.opera){C.onmousedown=B.onmousedown=bkLib.cancelEvent}}}}this.pane.append(H.noSelect())},colorSelect:function(A){this.ne.nicCommand("foreColor",A);this.removePane()},on:function(A){A.setStyle({border:"2px solid #000"})},off:function(A,B){A.setStyle({border:"2px solid "+B})}});var nicEditorBgColorButton=nicEditorColorButton.extend({colorSelect:function(A){this.ne.nicCommand("hiliteColor",A);this.removePane()}});nicEditors.registerPlugin(nicPlugin,nicColorOptions);
|
||||
|
||||
|
||||
var nicImageOptions = {
|
||||
buttons : {
|
||||
'image' : {name : 'Add Image', type : 'nicImageButton', tags : ['IMG']}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var nicImageButton=nicEditorAdvancedButton.extend({addPane:function(){this.im=this.ne.selectedInstance.selElm().parentTag("IMG");this.addForm({"":{type:"title",txt:"Add/Edit Image"},src:{type:"text",txt:"URL",value:"http://",style:{width:"150px"}},alt:{type:"text",txt:"Alt Text",style:{width:"100px"}},align:{type:"select",txt:"Align",options:{none:"Default",left:"Left",right:"Right"}}},this.im)},submit:function(B){var C=this.inputs.src.value;if(C==""||C=="http://"){alert("You must enter a Image URL to insert");return false}this.removePane();if(!this.im){var A="javascript:nicImTemp();";this.ne.nicCommand("insertImage",A);this.im=this.findElm("IMG","src",A)}if(this.im){this.im.setAttributes({src:this.inputs.src.value,alt:this.inputs.alt.value,align:this.inputs.align.value})}}});nicEditors.registerPlugin(nicPlugin,nicImageOptions);
|
||||
|
||||
|
||||
var nicSaveOptions = {
|
||||
buttons : {
|
||||
'save' : {name : __('Save this content'), type : 'nicEditorSaveButton'}
|
||||
}
|
||||
};
|
||||
|
||||
var nicEditorSaveButton=nicEditorButton.extend({init:function(){if(!this.ne.options.onSave){this.margin.setStyle({display:"none"})}},mouseClick:function(){var B=this.ne.options.onSave;var A=this.ne.selectedInstance;B(A.getContent(),A.elm.id,A)}});nicEditors.registerPlugin(nicPlugin,nicSaveOptions);
|
||||
|
||||
|
||||
var nicCodeOptions = {
|
||||
buttons : {
|
||||
'xhtml' : {name : 'Edit HTML', type : 'nicCodeButton'}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var nicCodeButton=nicEditorAdvancedButton.extend({width:"350px",addPane:function(){this.addForm({"":{type:"title",txt:"Edit HTML"},code:{type:"content",value:this.ne.selectedInstance.getContent(),style:{width:"340px",height:"200px"}}})},submit:function(B){var A=this.inputs.code.value;this.ne.selectedInstance.setContent(A);this.removePane()}});nicEditors.registerPlugin(nicPlugin,nicCodeOptions);
|
||||
|
||||
BIN
Media/nicEditorIcons.gif
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
146
Media/rules.js
Normal file
@@ -0,0 +1,146 @@
|
||||
|
||||
var rules = {
|
||||
init: function() {
|
||||
var self = this;
|
||||
this.reloadRules();
|
||||
$('#form-add-rule').submit(function(){
|
||||
do_ajax('add', {type:$('#field-rule-select').val()}, function(data) {
|
||||
if (typeof data.error !== 'undefined')
|
||||
alert(data.error);
|
||||
else
|
||||
self.editRule(data.id);
|
||||
self.reloadRules();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
},
|
||||
|
||||
showListing: function() {
|
||||
do_ajax('listing', {}, function(data) {
|
||||
var lines = data.split(/\r?\n|\r/).length + 2;
|
||||
$('#listing-code').show();
|
||||
$('#preview-code').hide();
|
||||
$('#listing-code textarea').html(data).attr('rows', lines);
|
||||
});
|
||||
},
|
||||
|
||||
hideListing: function() {
|
||||
$('#listing-code').hide();
|
||||
$('#preview-code').show();
|
||||
},
|
||||
|
||||
reloadRules: function() {
|
||||
var self = this;
|
||||
do_ajax('rules', {}, function(data) {
|
||||
$('#preview-code').html(data);
|
||||
$('.action-delete').click(function(){
|
||||
return confirm('Delete?');
|
||||
});
|
||||
$('#rule-list').disableSelection().sortable({
|
||||
stop: function() {
|
||||
self.updateOrder();
|
||||
}
|
||||
});
|
||||
$('.rule-actions').hover(function(){
|
||||
$('#rule-list').sortable( "option", "disabled", true );
|
||||
}, function(){
|
||||
$('#rule-list').sortable( "option", "disabled", false );
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
updateOrder: function(e, ui) {
|
||||
var self = this;
|
||||
$('#rule-list').sortable( "option", "disabled", true );
|
||||
$('.rule-actions').remove();
|
||||
var newOrder = [];
|
||||
$('#rule-list .rule').each(function(){
|
||||
newOrder.push($(this).data('rule-id'));
|
||||
});
|
||||
do_ajax('updateOrder', {order: newOrder}, function(data) {
|
||||
self.reloadRules();
|
||||
});
|
||||
},
|
||||
|
||||
editRule: function(id){
|
||||
var self = this;
|
||||
do_ajax('edit', {id: id}, function(data) {
|
||||
$('#rule-edit').html(data);
|
||||
self.prepareForm();
|
||||
$('.tooltip').tooltipster({
|
||||
position: 'top-right'
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
prepareForm: function(){
|
||||
var self = this;
|
||||
|
||||
$('#rule-edit .type-text').keyup(function(){
|
||||
var lines = $(this).val().split(/\r?\n|\r/).length;
|
||||
if (lines < 2)
|
||||
lines = 2;
|
||||
$(this).attr('rows', lines);
|
||||
}).keyup();
|
||||
$('#rule-edit .type-dualtext').keyup(function(){
|
||||
var textareas = $('.type-dualtext[name="'+$(this).attr('name')+'"]');
|
||||
|
||||
var lines = 2;
|
||||
|
||||
textareas.each(function(){
|
||||
var ta_lines = $(this).val().split(/\r?\n|\r/).length;
|
||||
if (ta_lines > lines)
|
||||
lines = ta_lines;
|
||||
});
|
||||
if (lines < 2)
|
||||
lines = 2;
|
||||
|
||||
$('.type-dualtext[name="'+$(this).attr('name')+'"]').attr('rows', lines);
|
||||
}).keyup();
|
||||
},
|
||||
|
||||
|
||||
cancelRuleEdit : function() {
|
||||
$('#rule-edit').html('');
|
||||
},
|
||||
|
||||
completeRuleEdit: function() {
|
||||
var self = this;
|
||||
var params = {};
|
||||
$('#rule-edit form input.multi').each(function(){
|
||||
params[$(this).attr('name')] = [];
|
||||
});
|
||||
$('#rule-edit form input[type!="submit"][type!="checkbox"], #rule-edit form textarea, #rule-edit form input:checked[type="checkbox"]').each(function(){
|
||||
var elem = $(this);
|
||||
var name = elem.attr('name');
|
||||
if (/^.*\[\]$/i.test(name)) {
|
||||
if (params[name])
|
||||
params[name].push(elem.val());
|
||||
else
|
||||
params[name] = [elem.val()];
|
||||
}
|
||||
else
|
||||
params[name] = elem.val();
|
||||
});
|
||||
do_ajax('save', params, function(data) {
|
||||
if (typeof data.error === 'undefined')
|
||||
{
|
||||
self.reloadRules();
|
||||
$('#rule-edit').html('');
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(data.error);
|
||||
}
|
||||
});
|
||||
return false;
|
||||
},
|
||||
|
||||
deleteRule: function(id) {
|
||||
var self = this;
|
||||
this.cancelRuleEdit();
|
||||
do_ajax('delete', {id: id}, function() {
|
||||
self.reloadRules();
|
||||
});
|
||||
}
|
||||
};
|
||||
692
Media/style.css
Normal file
@@ -0,0 +1,692 @@
|
||||
/* http://meyerweb.com/eric/tools/css/reset/
|
||||
v2.0 | 20110126
|
||||
License: none (public domain)
|
||||
*/
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/* End Reset */
|
||||
|
||||
/* Template Styling */
|
||||
|
||||
|
||||
html, body {
|
||||
margin-left: 1px;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Telex','Verdana', sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: #061110;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 14px;
|
||||
color: #181B20;
|
||||
}
|
||||
|
||||
h1, h2, h3 {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
text-transform: uppercase;
|
||||
font-family: 'Oswald', sans-serif;
|
||||
font-weight: normal;
|
||||
color: #0F6059;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 2.4em;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.6em;
|
||||
}
|
||||
|
||||
pre {
|
||||
font-family: 'Bitstream Vera Sans Mono',monospace;
|
||||
letter-spacing: -1px;
|
||||
}
|
||||
|
||||
p, ul, ol {
|
||||
margin-top: 0;
|
||||
line-height: 180%;
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #14786E;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
img.border {
|
||||
border: 6px solid #EEE7DF;
|
||||
}
|
||||
|
||||
img.alignleft {
|
||||
float: left;
|
||||
margin-right: 25px;
|
||||
}
|
||||
|
||||
img.alignright {
|
||||
float: right;
|
||||
}
|
||||
|
||||
img.aligncenter {
|
||||
margin: 0px auto;
|
||||
}
|
||||
|
||||
#wrapper {
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
|
||||
#header-wrapper {
|
||||
height: 167px;
|
||||
}
|
||||
|
||||
#header {
|
||||
width: 960px;
|
||||
height: 167px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* Logo */
|
||||
|
||||
#logo {
|
||||
width: 980px;
|
||||
margin: 0px auto;
|
||||
padding: 40px 0px 0px 0px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
#logo h1, #logo p {
|
||||
display: block;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#logo h1 {
|
||||
margin: 0px;
|
||||
letter-spacing: -1px;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
font-size: 54px;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
#logo h1 a {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
#logo p {
|
||||
margin-top: -10px;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
font-family: 'Arvo', serif;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
#logo a {
|
||||
border: none;
|
||||
background: none;
|
||||
text-decoration: none;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
/* Search */
|
||||
|
||||
#search {
|
||||
float: right;
|
||||
width: 280px;
|
||||
height: 100px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#search form {
|
||||
height: 41px;
|
||||
margin: 0;
|
||||
padding: 60px 0 0 30px;
|
||||
}
|
||||
|
||||
#search fieldset {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#search-text {
|
||||
width: 195px;
|
||||
padding: 6px 10px;
|
||||
border: none;
|
||||
background: #FFFFFF;
|
||||
text-transform: lowercase;
|
||||
font: normal 11px Arial, Helvetica, sans-serif;
|
||||
color: #7F7F81;
|
||||
}
|
||||
|
||||
#search-submit {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Menu */
|
||||
|
||||
#menu-wrapper {
|
||||
height: 60px;
|
||||
background: url(Images/menu-wrapper.jpg) no-repeat center top;
|
||||
}
|
||||
|
||||
#menu {
|
||||
width: 940px;
|
||||
height: 58px;
|
||||
margin: 0px auto;
|
||||
padding: 0px 20px 0px 20px;
|
||||
}
|
||||
|
||||
#menu ul {
|
||||
margin: 0;
|
||||
padding: 0px 0px 0px 0px;
|
||||
list-style: none;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
#menu li {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#menu a {
|
||||
display: block;
|
||||
float: left;
|
||||
height: 56px;
|
||||
margin: 0px;
|
||||
padding: 0px 30px 0px 30px;
|
||||
line-height: 56px;
|
||||
letter-spacing: 1px;
|
||||
text-decoration: none;
|
||||
text-transform: uppercase;
|
||||
font-family: 'Oswald', sans-serif;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
color: #B5B5B5;
|
||||
border: none;
|
||||
}
|
||||
|
||||
|
||||
#menu a:hover {
|
||||
text-decoration: none;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
/* Page */
|
||||
|
||||
#page {
|
||||
background: url(Images/page.jpg) repeat-y center top;
|
||||
}
|
||||
#page.fullwidth {
|
||||
background: url(Images/page-fullwidth.jpg) repeat-y center top;
|
||||
}
|
||||
|
||||
#page-bgtop {
|
||||
background: url(Images/pagetop.jpg) no-repeat center top;
|
||||
}
|
||||
#page-bgtop.fullwidth {
|
||||
background: url(Images/pagetop-fullwidth.jpg) no-repeat center top;
|
||||
}
|
||||
|
||||
#page-bgbtm {
|
||||
overflow: hidden;
|
||||
width: 960px;
|
||||
margin: 0px auto;
|
||||
background: url(Images/pagebottom.jpg) no-repeat center bottom;
|
||||
}
|
||||
|
||||
#page-content {
|
||||
overflow: hidden;
|
||||
width: 960px;
|
||||
margin: 0px auto;
|
||||
min-height: 450px;
|
||||
}
|
||||
|
||||
/* Content */
|
||||
|
||||
#content, #content-fullwidth {
|
||||
float: left;
|
||||
width: 635px;
|
||||
padding: 10px 0px 0px 10px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#content-fullwidth {
|
||||
width: 950px;
|
||||
}
|
||||
|
||||
.post {
|
||||
clear: both;
|
||||
padding: 30px 40px;
|
||||
background: url(Images/post.jpg) no-repeat left top;
|
||||
}
|
||||
|
||||
.post .title {
|
||||
padding-top: 10px;
|
||||
letter-spacing: -2px;
|
||||
}
|
||||
|
||||
.post .title a {
|
||||
color: #0F6059;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.post .meta {
|
||||
padding-bottom: 10px;
|
||||
text-align: left;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.post .meta a {
|
||||
}
|
||||
|
||||
.post .entry {
|
||||
text-align: justify;
|
||||
margin-bottom: 25px;
|
||||
padding: 10px 0px 0px 0px;
|
||||
}
|
||||
|
||||
.links {
|
||||
display: block;
|
||||
width: 96px;
|
||||
padding: 2px 0px 2px 0px;
|
||||
background: #A53602;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
font-size: 10px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
/* Sidebar */
|
||||
|
||||
#sidebar {
|
||||
float: right;
|
||||
width: 305px;
|
||||
padding: 0px 0px 0px 0px;
|
||||
}
|
||||
|
||||
#sidebar ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#sidebar li {
|
||||
margin: 0;
|
||||
padding: 40px 30px 20px 30px;
|
||||
background: url(images/sidebar.jpg) no-repeat left top;
|
||||
}
|
||||
|
||||
#sidebar li ul {
|
||||
padding-bottom: 30px;
|
||||
background: none;
|
||||
}
|
||||
|
||||
#sidebar li li {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
line-height: 35px;
|
||||
background: none;
|
||||
}
|
||||
|
||||
#sidebar li li span {
|
||||
display: block;
|
||||
margin-top: -20px;
|
||||
padding: 0;
|
||||
font-size: 11px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
#sidebar li li a {
|
||||
color: #181B20;
|
||||
}
|
||||
|
||||
#sidebar h2 {
|
||||
height: 38px;
|
||||
margin-bottom: 20px;
|
||||
letter-spacing: -1px;
|
||||
font-size: 24px;
|
||||
color: #0F6059;
|
||||
}
|
||||
|
||||
#sidebar p {
|
||||
margin: 0 0px;
|
||||
padding: 0px 20px 20px 20px;
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
#sidebar a {
|
||||
border: none;
|
||||
}
|
||||
|
||||
#sidebar a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
|
||||
/* Footer */
|
||||
|
||||
#footer {
|
||||
width: 960px;
|
||||
height: 55px;
|
||||
margin: 0px auto 40px auto;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
#footer p {
|
||||
margin: 0;
|
||||
padding-top: 18px;
|
||||
line-height: normal;
|
||||
text-align: center;
|
||||
color: #576475;
|
||||
}
|
||||
|
||||
#footer a {
|
||||
color: #576475;
|
||||
text-decoration: underline;
|
||||
}
|
||||
#footer a:hover {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
/* Menu Selected Item Styling */
|
||||
|
||||
#page-builder .page-builder a {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
#page-test .page-test a {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
/* End Template Styling */
|
||||
|
||||
label {
|
||||
display: inline-block;
|
||||
width: 200px;
|
||||
vertical-align: top;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
clear: both;
|
||||
float:left;
|
||||
padding-top: 4px;
|
||||
}
|
||||
form {
|
||||
}
|
||||
input, select {
|
||||
}
|
||||
input, select, textarea {
|
||||
float: left;
|
||||
}
|
||||
.ajaxForm input.type-string {
|
||||
width: 240px;
|
||||
}
|
||||
textarea {
|
||||
|
||||
}
|
||||
input.button {
|
||||
padding: 5px 10px 5px 10px;
|
||||
border: #0F6059 solid 2px;
|
||||
border-radius: 7px;
|
||||
background: #00312D;
|
||||
color: #FFFFFF;
|
||||
cursor: pointer;
|
||||
margin: 2px;
|
||||
}
|
||||
input.button:hover {
|
||||
background: #0F6059;
|
||||
}
|
||||
fieldset {
|
||||
display:inline-block;
|
||||
vertical-align: top;
|
||||
}
|
||||
fieldset legend {
|
||||
font-weight: bold;
|
||||
}
|
||||
table td {
|
||||
padding: 0 10px
|
||||
}
|
||||
h1 a {
|
||||
text-decoration: none;
|
||||
}
|
||||
pre {
|
||||
margin: 0;
|
||||
padding: 5px 0;
|
||||
}
|
||||
img {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.error .message {
|
||||
font-weight: bold;
|
||||
}
|
||||
.error {
|
||||
color: darkred;
|
||||
}
|
||||
.message {
|
||||
color: darkgreen;
|
||||
}
|
||||
|
||||
.jqicontainer label, .jqicontainer input {
|
||||
float: none;
|
||||
}
|
||||
|
||||
/*
|
||||
Stuff
|
||||
*/
|
||||
|
||||
#js-notice {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
color: darkred;
|
||||
padding: 20px;
|
||||
}
|
||||
#loading {
|
||||
left: 48%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
#donate {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
display: inline-block;
|
||||
margin: 20px;
|
||||
}
|
||||
#donate form {
|
||||
text-align: center;
|
||||
}
|
||||
#donate input.image {
|
||||
display: inline;
|
||||
float: none;
|
||||
}
|
||||
|
||||
/*
|
||||
Creator
|
||||
*/
|
||||
#design, #preview {
|
||||
position: relative;
|
||||
width: 48%;
|
||||
padding: 0 5px;
|
||||
}
|
||||
#design {
|
||||
float: left;
|
||||
}
|
||||
#preview {
|
||||
float: right;
|
||||
}
|
||||
.actions {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
padding: 8px 10px 0 0;
|
||||
}
|
||||
#rule-edit {
|
||||
margin: 10px 0;
|
||||
position: relative;
|
||||
}
|
||||
#rule-edit-form {
|
||||
margin: 10px 0;
|
||||
}
|
||||
#listing-code textarea {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
#listing-code-close {
|
||||
float: right;
|
||||
}
|
||||
#preview-code {
|
||||
overflow: auto;
|
||||
}
|
||||
#button-cancel {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/*
|
||||
Rules
|
||||
*/
|
||||
|
||||
.rule {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
cursor: move;
|
||||
}
|
||||
.rule.even {
|
||||
background-color: #f9f6f6;
|
||||
}
|
||||
.rule.odd {
|
||||
background-color: #efefef;
|
||||
}
|
||||
|
||||
.rule pre {
|
||||
min-height: 30px;
|
||||
}
|
||||
|
||||
.rule-actions {
|
||||
display:none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
padding: 5px 5px 0 0;
|
||||
}
|
||||
|
||||
.rule:hover .rule-actions {
|
||||
display:block;
|
||||
}
|
||||
.type-text {
|
||||
width: 240px;
|
||||
white-space: nowrap;
|
||||
overflow:auto;
|
||||
}
|
||||
.type-dualtext {
|
||||
width: 46%;
|
||||
white-space: nowrap;
|
||||
overflow:auto;
|
||||
}
|
||||
|
||||
/*
|
||||
Actions
|
||||
*/
|
||||
|
||||
.actions {
|
||||
|
||||
}
|
||||
.actions a {
|
||||
padding: 5px 10px 5px 10px;
|
||||
border: #0F6059 solid 2px;
|
||||
border-radius: 15px;
|
||||
background: #00312D;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.actions a:hover {
|
||||
text-decoration: none;
|
||||
background: #0F6059;
|
||||
}
|
||||
|
||||
.actions a.first {
|
||||
border-radius: 15px 0 0 15px;
|
||||
}
|
||||
.actions a.middle {
|
||||
border-radius: 0;
|
||||
border-left: 0;
|
||||
}
|
||||
.actions a.last {
|
||||
border-radius: 0 15px 15px 0;
|
||||
border-left: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Admin
|
||||
*/
|
||||
|
||||
#login-form {
|
||||
}
|
||||
#error {
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
text-align: center;
|
||||
color: darkred;
|
||||
}
|
||||
21
Media/tooltipster-1.2/css/themes/tooltipster-chocolate.css
Normal file
@@ -0,0 +1,21 @@
|
||||
/* Copy and paste this into your tooltipster.css file. Don't forget to refer to it in your Tooltipster settings (tooltipClass: '.tooltipster-chocolate') */
|
||||
|
||||
.tooltipster-chocolate {
|
||||
background-color: #7f5d3c;
|
||||
border: 2px solid #5c3d1f;
|
||||
color: #fafaeb;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
position: absolute;
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
text-align: center;
|
||||
z-index: 9999999;
|
||||
pointer-events: none;
|
||||
width: auto;
|
||||
overflow: visible;
|
||||
}
|
||||
.tooltipster-chocolate .tooltip-arrow {
|
||||
text-shadow: 0px 2px 0px #654728, 1px 1px 0px #654728, -1px 1px 0px #654728;
|
||||
}
|
||||
22
Media/tooltipster-1.2/css/themes/tooltipster-clean-cut.css
Normal file
@@ -0,0 +1,22 @@
|
||||
/* Copy and paste this into your tooltipster.css file. Don't forget to refer to it in your Tooltipster settings (tooltipClass: '.tooltipster-clean-cut') */
|
||||
|
||||
.tooltipster-clean-cut {
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid #dadada;
|
||||
box-shadow: inset 0px 1px 0px #fff;
|
||||
color: #595959;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
position: absolute;
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
text-align: center;
|
||||
z-index: 9999999;
|
||||
pointer-events: none;
|
||||
width: auto;
|
||||
overflow: visible;
|
||||
}
|
||||
.tooltipster-clean-cut .tooltip-arrow {
|
||||
text-shadow: 0px 2px 0px #dadada, 0px 1px 0px #dadada;
|
||||
}
|
||||
29
Media/tooltipster-1.2/css/themes/tooltipster-smoke.css
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
“Smoke” - ‘cause I’m a Tony Stewart (#14) fan!
|
||||
By Kevin Traas <kevin@tra.as> - Sep 13, 2012
|
||||
|
||||
Copy and paste this into your tooltipster.css file. Don't forget to refer to it in your Tooltipster settings (tooltipClass: '.tooltipster-chocolate')
|
||||
*/
|
||||
.tooltipster-smoke {
|
||||
background-color: #111;
|
||||
border: 2px solid black;
|
||||
border-radius: 6px;
|
||||
box-shadow: 5px 5px 7px #444;
|
||||
opacity: 0.7;
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=70);
|
||||
color: white;
|
||||
font-family: Arial, sans-serif;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
position: absolute;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
z-index: 9999999;
|
||||
pointer-events: none;
|
||||
width: auto;
|
||||
overflow: visible;
|
||||
}
|
||||
.tooltipster-smoke .tooltip-arrow {
|
||||
text-shadow: 5px 5px 7px #444;
|
||||
}
|
||||
96
Media/tooltipster-1.2/css/tooltipster.css
Normal file
@@ -0,0 +1,96 @@
|
||||
/* This is the default styling for all Tooltipsters: */
|
||||
.tooltip-message {
|
||||
background: #000; /* <- for IE */
|
||||
background: rgba(0,0,0,0.9);
|
||||
color: #fff;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
position: absolute;
|
||||
padding: 10px;
|
||||
border-radius: 2px;
|
||||
text-align: center;
|
||||
z-index: 9999999;
|
||||
pointer-events: none;
|
||||
width: auto;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/* When you want to create a second class for your Tooltipster messages, copy (or modify) this template and add your style to it. Don't forget to refer to it in your Tooltipster settings (tooltipClass: '.my-custom-theme') */
|
||||
.my-custom-theme {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
z-index: 9999999;
|
||||
pointer-events: none;
|
||||
width: auto;
|
||||
/* Start styling here... */
|
||||
}
|
||||
|
||||
/* Add a slight border radius to all images inside the Tooltipsters */
|
||||
.tooltip-message img {
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
/* These next classes handle the styles for the little arrow attached to the tooltip. If you need to change the color of the arrow to match a custom Tooltipster theme, set it in your Tooltipster settings (arrowColor: '#yourcolor') */
|
||||
.tooltip-arrow {
|
||||
display: block;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
width: 100%;
|
||||
height: 5px;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
z-index: -1;
|
||||
}
|
||||
.tooltip-arrow-top {
|
||||
bottom: -3px;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
.tooltip-arrow-top-right {
|
||||
bottom: -3px;
|
||||
margin-left: -10px;
|
||||
text-align: right;
|
||||
}
|
||||
.tooltip-arrow-top-left {
|
||||
bottom: -3px;
|
||||
margin-left: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
.tooltip-arrow-bottom {
|
||||
top: -10px;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
.tooltip-arrow-bottom-right {
|
||||
top: -10px;
|
||||
margin-left: -10px;
|
||||
text-align: right;
|
||||
}
|
||||
.tooltip-arrow-bottom-left {
|
||||
top: -10px;
|
||||
margin-left: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
.tooltip-arrow-left {
|
||||
top: 0px;
|
||||
right: -18px;
|
||||
margin: 0 auto;
|
||||
text-align: right;
|
||||
}
|
||||
.tooltip-arrow-right {
|
||||
top: 0px;
|
||||
left: -8px;
|
||||
margin: 0 auto;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
/* Some styling to enable the slide animation */
|
||||
.tooltip-slide {
|
||||
height: 0px;
|
||||
position: absolute;
|
||||
width: auto;
|
||||
z-index: 9999999;
|
||||
overflow: hidden;
|
||||
}
|
||||
389
Media/tooltipster-1.2/js/jquery.tooltipster.js
Normal file
@@ -0,0 +1,389 @@
|
||||
/*
|
||||
|
||||
Tooltipster 1.2 | 9/15/12
|
||||
A rockin' custom tooltip jQuery plugin
|
||||
|
||||
Developed by: Caleb Jacob - calebjacob.com
|
||||
Copyright (C) 2012 Caleb Jacob
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
(function( $ ) {
|
||||
|
||||
$.fn.tooltipster = function( options ) {
|
||||
|
||||
// Default settings merged with custom options
|
||||
var settings = $.extend({
|
||||
animation: 'fade',
|
||||
arrow: true,
|
||||
arrowColor: '',
|
||||
delay: 200,
|
||||
fixedWidth: 0,
|
||||
followMouse: false,
|
||||
offsetX: 0,
|
||||
offsetY: 0,
|
||||
overrideText: '',
|
||||
position: 'top',
|
||||
speed: 100,
|
||||
timer: 0,
|
||||
tooltipTheme: '.tooltip-message'
|
||||
}, options);
|
||||
|
||||
// A function we'll use to animate out (hide) our tooltips
|
||||
function animateOut(tooltipToKill) {
|
||||
|
||||
if(settings.animation == 'slide') {
|
||||
|
||||
$(tooltipToKill).slideUp(settings.speed, function() {
|
||||
$(tooltipToKill).remove();
|
||||
$("body").css("overflow-x", "auto");
|
||||
});
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
$(tooltipToKill).fadeOut(settings.speed, function() {
|
||||
$(tooltipToKill).remove();
|
||||
$("body").css("overflow-x", "auto");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return this.hover(function() {
|
||||
|
||||
// If there's still a tooltip open, close it before initiating the next tooltip
|
||||
if ($(settings.tooltipTheme).not('.tooltip-kill').length == 1) {
|
||||
animateOut($(settings.tooltipTheme).not('.tooltip-kill'));
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').addClass('tooltip-kill');
|
||||
}
|
||||
|
||||
// Disable horizontal scrollbar to keep overflowing tooltips from creating one
|
||||
$("body").css("overflow-x", "hidden");
|
||||
|
||||
// Get tooltip text from the title attr
|
||||
var tooltip_text = $(this).attr('title');
|
||||
|
||||
// Set the title attr blank to keep the default tooltip text from popping up (removeAttr doesn't work for IE). We'll also create data to refer back to when adding the tooltip attr back later
|
||||
$(this).attr('title', '');
|
||||
$(this).data('title', tooltip_text);
|
||||
|
||||
|
||||
// If a text override has been set, use that instead for the tooltip text
|
||||
if($.trim(settings.overrideText).length > 0) {
|
||||
var tooltip_text = settings.overrideText;
|
||||
}
|
||||
|
||||
// If a fixed width has been set, set the tooltip to that width
|
||||
if(settings.fixedWidth > 0) {
|
||||
var fixedWidth = ' style="width:'+ settings.fixedWidth +'px;"';
|
||||
}
|
||||
else {
|
||||
var fixedWidth = '';
|
||||
}
|
||||
|
||||
// Remove the title attribute to keep the default tooltip from popping up and append the base HTML for the tooltip
|
||||
$('<div class="'+ settings.tooltipTheme.replace('.','') +'"'+ fixedWidth +'><div class="tooltip-message-content">'+tooltip_text+'</div></div>').appendTo('body').hide();
|
||||
|
||||
// If the tooltip doesn't follow the mouse, determine the placement
|
||||
if (settings.followMouse == false) {
|
||||
|
||||
// Find global variables to determine placement
|
||||
var window_width = $(window).width();
|
||||
var container_width = $(this).outerWidth(false);
|
||||
var container_height = $(this).outerHeight(false);
|
||||
var tooltip_width = $(settings.tooltipTheme).not('.tooltip-kill').outerWidth(false);
|
||||
var tooltip_height = $(settings.tooltipTheme).not('.tooltip-kill').outerHeight(false);
|
||||
var offset = $(this).offset();
|
||||
|
||||
// Hardcoding the width and removing the padding fixed an issue with the tooltip width collapsing when the window size is small
|
||||
if(settings.fixedWidth == 0) {
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').css({
|
||||
'width': tooltip_width + 'px',
|
||||
'padding-left': '0px',
|
||||
'padding-right': '0px'
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// A function to detect if the tooltip is going off the screen. If so, reposition the crap out of it!
|
||||
function dont_go_off_screen() {
|
||||
|
||||
var window_left = $(window).scrollLeft();
|
||||
|
||||
// If the tooltip goes off the left side of the screen, line it up with the left side of the window
|
||||
if((my_left - window_left) < 0) {
|
||||
var arrow_reposition = my_left - window_left;
|
||||
my_left = window_left;
|
||||
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').data('arrow-reposition', arrow_reposition);
|
||||
}
|
||||
|
||||
// If the tooltip goes off the right of the screen, line it up with the right side of the window
|
||||
if (((my_left + tooltip_width) - window_left) > window_width) {
|
||||
var arrow_reposition = my_left - ((window_width + window_left) - tooltip_width);
|
||||
my_left = (window_width + window_left) - tooltip_width;
|
||||
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').data('arrow-reposition', arrow_reposition);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(settings.position == 'top') {
|
||||
var left_difference = (offset.left + tooltip_width) - (offset.left + $(this).outerWidth(false));
|
||||
var my_left = (offset.left + settings.offsetX) - (left_difference / 2);
|
||||
var my_top = (offset.top - tooltip_height) - settings.offsetY - 10;
|
||||
dont_go_off_screen();
|
||||
|
||||
if((offset.top - tooltip_height - settings.offsetY - 11) < 0) {
|
||||
var my_top = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(settings.position == 'top-left') {
|
||||
var my_left = offset.left + settings.offsetX;
|
||||
var my_top = (offset.top - tooltip_height) - settings.offsetY - 10;
|
||||
dont_go_off_screen();
|
||||
}
|
||||
|
||||
if(settings.position == 'top-right') {
|
||||
var my_left = (offset.left + container_width + settings.offsetX) - tooltip_width;
|
||||
var my_top = (offset.top - tooltip_height) - settings.offsetY - 10;
|
||||
dont_go_off_screen();
|
||||
}
|
||||
|
||||
if(settings.position == 'bottom') {
|
||||
var left_difference = (offset.left + tooltip_width + settings.offsetX) - (offset.left + $(this).outerWidth(false));
|
||||
var my_left = offset.left - (left_difference / 2);
|
||||
var my_top = (offset.top + container_height) + settings.offsetY + 10;
|
||||
dont_go_off_screen();
|
||||
}
|
||||
|
||||
if(settings.position == 'bottom-left') {
|
||||
var my_left = offset.left + settings.offsetX;
|
||||
var my_top = (offset.top + container_height) + settings.offsetY + 10;
|
||||
dont_go_off_screen();
|
||||
}
|
||||
|
||||
if(settings.position == 'bottom-right') {
|
||||
var my_left = (offset.left + container_width + settings.offsetX) - tooltip_width;
|
||||
var my_top = (offset.top + container_height) + settings.offsetY + 10;
|
||||
dont_go_off_screen();
|
||||
}
|
||||
|
||||
if(settings.position == 'left') {
|
||||
var my_left = offset.left - settings.offsetX - tooltip_width - 10;
|
||||
var my_left_mirror = offset.left + settings.offsetX + container_width + 10;
|
||||
var top_difference = (offset.top + tooltip_height + settings.offsetY) - (offset.top + $(this).outerHeight(false));
|
||||
var my_top = offset.top - (top_difference / 2);
|
||||
|
||||
// If the tooltip goes off boths sides of the page
|
||||
if((my_left < 0) && ((my_left_mirror + tooltip_width) > window_width)) {
|
||||
my_left = my_left + tooltip_width;
|
||||
}
|
||||
|
||||
// If it only goes off one side, flip it to the other side
|
||||
if(my_left < 0) {
|
||||
var my_left = offset.left + settings.offsetX + container_width + 10;
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').data('arrow-reposition', 'left');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(settings.position == 'right') {
|
||||
var my_left = offset.left + settings.offsetX + container_width + 10;
|
||||
var my_left_mirror = offset.left - settings.offsetX - tooltip_width - 10;
|
||||
var top_difference = (offset.top + tooltip_height + settings.offsetY) - (offset.top + $(this).outerHeight(false));
|
||||
var my_top = offset.top - (top_difference / 2);
|
||||
|
||||
// If the tooltip goes off boths sides of the page
|
||||
if(((my_left + tooltip_width) > window_width) && (my_left_mirror < 0)) {
|
||||
my_left = window_width - tooltip_width;
|
||||
}
|
||||
|
||||
// If it only goes off one side, flip it to the other side
|
||||
if((my_left + tooltip_width) > window_width) {
|
||||
my_left = offset.left - settings.offsetX - tooltip_width - 10;
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').data('arrow-reposition', 'right');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Find variables to determine placement if set to mouse
|
||||
if (settings.followMouse == true) {
|
||||
|
||||
var tooltip_width = $(settings.tooltipTheme).not('.tooltip-kill').outerWidth(false);
|
||||
var tooltip_height = $(settings.tooltipTheme).not('.tooltip-kill').outerHeight(false);
|
||||
var tooltip_content = $(settings.tooltipTheme).not('.tooltip-kill').find('.tooltip-message-content').html();
|
||||
|
||||
|
||||
$(this).mousemove(function(e){
|
||||
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').find('.tooltip-message-content').html('').html(tooltip_content);
|
||||
var tooltip_height = $(settings.tooltipTheme).not('.tooltip-kill').outerHeight(false);
|
||||
|
||||
if(settings.position == 'top') {
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').css({
|
||||
'left': ((e.pageX - 1) - (tooltip_width / 2) + settings.offsetX) + 'px',
|
||||
'top': ((e.pageY - tooltip_height - 2) - settings.offsetY - 10) + 'px'
|
||||
});
|
||||
}
|
||||
|
||||
if(settings.position == 'top-right') {
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').css({
|
||||
'left': e.pageX - 8 + settings.offsetX + 'px',
|
||||
'top': ((e.pageY - tooltip_height - 2) - settings.offsetY - 10) + 'px'
|
||||
});
|
||||
}
|
||||
|
||||
if(settings.position == 'top-left') {
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').css({
|
||||
'left': (e.pageX - tooltip_width + settings.offsetX) + 7 + 'px',
|
||||
'top': ((e.pageY - tooltip_height - 2) - settings.offsetY - 10) + 'px'
|
||||
});
|
||||
}
|
||||
|
||||
if(settings.position == 'bottom') {
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').css({
|
||||
'left': (e.pageX - (tooltip_width / 2) + settings.offsetX - 1) + 'px',
|
||||
'top': (e.pageY + 15 + settings.offsetY + 10) + 'px'
|
||||
});
|
||||
}
|
||||
|
||||
if(settings.position == 'bottom-right') {
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').css({
|
||||
'left': e.pageX - 2 + settings.offsetX + 'px',
|
||||
'top': (e.pageY + 15 + settings.offsetY + 10) + 'px'
|
||||
});
|
||||
}
|
||||
|
||||
if(settings.position == 'bottom-left') {
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').css({
|
||||
'left': (e.pageX - tooltip_width + settings.offsetX) + 12 + 'px',
|
||||
'top': (e.pageY + 15 + settings.offsetY + 10) + 'px'
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// If arrow is set true, style it and append it
|
||||
if (settings.arrow == true){
|
||||
|
||||
var arrow_class = 'tooltip-arrow-' + settings.position;
|
||||
|
||||
if (settings.followMouse == true) {
|
||||
if(arrow_class.search('right') > 0) {
|
||||
var temp_arrow_class = arrow_class;
|
||||
arrow_class = temp_arrow_class.replace('right', 'left');
|
||||
}
|
||||
else {
|
||||
var temp_arrow_class = arrow_class;
|
||||
arrow_class = temp_arrow_class.replace('left', 'right');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(arrow_class == 'tooltip-arrow-right') {
|
||||
var arrow_type = '◀';
|
||||
var arrow_vertical = 'top:' + ((tooltip_height / 2) - 5) + 'px';
|
||||
}
|
||||
if(arrow_class == 'tooltip-arrow-left') {
|
||||
var arrow_type = '▶';
|
||||
var arrow_vertical = 'top:' + ((tooltip_height / 2) - 4) + 'px';
|
||||
}
|
||||
if(arrow_class.search('top') > 0) {
|
||||
var arrow_type = '▼';
|
||||
}
|
||||
if(arrow_class.search('bottom') > 0) {
|
||||
var arrow_type = '▲';
|
||||
}
|
||||
|
||||
if(settings.arrowColor.length < 1) {
|
||||
var arrow_color = $(settings.tooltipTheme).not('.tooltip-kill').css('background-color');
|
||||
}
|
||||
else {
|
||||
var arrow_color = settings.arrowColor;
|
||||
}
|
||||
|
||||
// If the tooltip was going off the page and had to re-adjust, we need to update the arrow's position to stay next to the mouse
|
||||
var arrow_reposition = $(settings.tooltipTheme).not('.tooltip-kill').data('arrow-reposition');
|
||||
if (!arrow_reposition) {
|
||||
arrow_reposition = '';
|
||||
}
|
||||
else if (arrow_reposition == 'left') {
|
||||
arrow_class = 'tooltip-arrow-right';
|
||||
arrow_type = '◀';
|
||||
arrow_reposition = '';
|
||||
}
|
||||
else if (arrow_reposition == 'right') {
|
||||
arrow_class = 'tooltip-arrow-left';
|
||||
arrow_type = '▶';
|
||||
arrow_reposition = '';
|
||||
}
|
||||
else {
|
||||
arrow_reposition = 'left:'+ arrow_reposition +'px;';
|
||||
}
|
||||
|
||||
var arrow = '<div class="'+ arrow_class +' tooltip-arrow" style="color:'+ arrow_color +'; width:'+ tooltip_width +'px; display:none; '+ arrow_reposition +' '+ arrow_vertical +'">'+ arrow_type +'</div>';
|
||||
|
||||
}
|
||||
else {
|
||||
var arrow = '';
|
||||
}
|
||||
|
||||
// Place tooltip
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').css({'top': my_top+'px', 'left': my_left+'px'}).append(arrow);
|
||||
|
||||
// Determine how to animate the tooltip in
|
||||
if(settings.animation == 'slide') {
|
||||
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').delay(settings.delay).slideDown(settings.speed, function() {
|
||||
$('.tooltip-arrow').fadeIn(settings.speed);
|
||||
});
|
||||
|
||||
// If there is a timer, slide it out once the time runs out
|
||||
if(settings.timer > 0) {
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').delay(settings.timer).slideUp(settings.speed);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
$('.tooltip-arrow').show();
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').delay(settings.delay).fadeIn(settings.speed);
|
||||
|
||||
// If there is a timer, fade it out once the time runs out
|
||||
if(settings.timer > 0) {
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').delay(settings.timer).fadeOut(settings.speed);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}, function() {
|
||||
|
||||
$(settings.tooltipTheme).not('.tooltip-kill').clearQueue();
|
||||
|
||||
tooltip_text = $(this).data('title');
|
||||
$(this).attr('title', tooltip_text);
|
||||
|
||||
$(settings.tooltipTheme).addClass('tooltip-kill');
|
||||
|
||||
// Animate out and remove the tooltip we just sentencted to death
|
||||
animateOut('.tooltip-kill');
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
})( jQuery );
|
||||