Shortcoder - Version 3.0

Version Description

  • Plugin code rewritten from scratch.
  • Shortcode syntax is changed.
  • Supports any custom parameters.
  • Admin interface is redesigned and easy to use.
  • Added a tinyMCE button to the editing toolbar for inserting the shortcodes in the post.
  • Inbuilt shortcodes are removed.
Download this release

Release Info

Developer vaakash
Plugin Icon 128x128 Shortcoder
Version 3.0
Comparing to
See all releases

Version 3.0

images/Thumbs.db ADDED
Binary file
images/aw.png ADDED
Binary file
images/donate.png ADDED
Binary file
images/grey-bg.png ADDED
Binary file
images/paypal.gif ADDED
Binary file
images/share.png ADDED
Binary file
images/shortcoder-2.png ADDED
Binary file
images/shortcoder.png ADDED
Binary file
images/toggle-arrow.png ADDED
Binary file
images/trash-can.png ADDED
Binary file
js/nicedit/Thumbs.db ADDED
Binary file
js/nicedit/nicEdit.js ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* NicEdit - Micro Inline WYSIWYG
2
+ * Copyright 2007-2008 Brian Kirchoff
3
+ *
4
+ * NicEdit is distributed under the terms of the MIT license
5
+ * For more information visit http://nicedit.com/
6
+ * Do not remove this copyright message
7
+ */
8
+ 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))}};
9
+
10
+
11
+
12
+ var nicEditorConfig = bkClass.extend({
13
+ buttons : {
14
+ 'bold' : {name : __('Click to Bold'), command : 'Bold', tags : ['B','STRONG'], css : {'font-weight' : 'bold'}, key : 'b'},
15
+ 'italic' : {name : __('Click to Italic'), command : 'Italic', tags : ['EM','I'], css : {'font-style' : 'italic'}, key : 'i'},
16
+ 'underline' : {name : __('Click to Underline'), command : 'Underline', tags : ['U'], css : {'text-decoration' : 'underline'}, key : 'u'},
17
+ 'left' : {name : __('Left Align'), command : 'justifyleft', noActive : true},
18
+ 'center' : {name : __('Center Align'), command : 'justifycenter', noActive : true},
19
+ 'right' : {name : __('Right Align'), command : 'justifyright', noActive : true},
20
+ 'justify' : {name : __('Justify Align'), command : 'justifyfull', noActive : true},
21
+ 'ol' : {name : __('Insert Ordered List'), command : 'insertorderedlist', tags : ['OL']},
22
+ 'ul' : {name : __('Insert Unordered List'), command : 'insertunorderedlist', tags : ['UL']},
23
+ 'subscript' : {name : __('Click to Subscript'), command : 'subscript', tags : ['SUB']},
24
+ 'superscript' : {name : __('Click to Superscript'), command : 'superscript', tags : ['SUP']},
25
+ 'strikethrough' : {name : __('Click to Strike Through'), command : 'strikeThrough', css : {'text-decoration' : 'line-through'}},
26
+ 'removeformat' : {name : __('Remove Formatting'), command : 'removeformat', noActive : true},
27
+ 'indent' : {name : __('Indent Text'), command : 'indent', noActive : true},
28
+ 'outdent' : {name : __('Remove Indent'), command : 'outdent', noActive : true},
29
+ 'hr' : {name : __('Horizontal Rule'), command : 'insertHorizontalRule', noActive : true}
30
+ },
31
+ iconsPath : '../nicEditorIcons.gif',
32
+ buttonList : ['save','bold','italic','underline','left','center','right','justify','ol','ul','fontSize','fontFamily','fontFormat','indent','outdent','image','upload','link','unlink','forecolor','bgcolor'],
33
+ iconList : {"bgcolor":1,"forecolor":2,"bold":3,"center":4,"hr":5,"indent":6,"italic":7,"justify":8,"left":9,"ol":10,"outdent":11,"removeformat":12,"right":13,"save":14,"strikethrough":15,"subscript":16,"superscript":17,"ul":18,"underline":19,"image":20,"link":21,"unlink":22,"close":23,"arrow":24}
34
+
35
+ });
36
+ ;
37
+ 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);
38
+ 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){return null}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.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()}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)}});
39
+ 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)}});
40
+ 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()}});
41
+ 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()}}}});
42
+ 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(){}});
43
+
44
+
45
+ var nicPaneOptions = { };
46
+
47
+ 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)}});
48
+
49
+ 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()}}});
50
+
51
+
52
+ var nicSelectOptions = {
53
+ buttons : {
54
+ 'fontSize' : {name : __('Select Font Size'), type : 'nicEditorFontSizeSelect', command : 'fontsize'},
55
+ 'fontFamily' : {name : __('Select Font Family'), type : 'nicEditorFontFamilySelect', command : 'fontname'},
56
+ 'fontFormat' : {name : __('Select Font Format'), type : 'nicEditorFontFormatSelect', command : 'formatBlock'}
57
+ }
58
+ };
59
+
60
+ 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&nbsp;(8pt)",2:"2&nbsp;(10pt)",3:"3&nbsp;(12pt)",4:"4&nbsp;(14pt)",5:"5&nbsp;(18pt)",6:"6&nbsp;(24pt)"},init:function(){this.setDisplay("Font&nbsp;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&nbsp;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&nbsp;6",h5:"Heading&nbsp;5",h4:"Heading&nbsp;4",h3:"Heading&nbsp;3",h2:"Heading&nbsp;2",h1:"Heading&nbsp;1"},init:function(){this.setDisplay("Font&nbsp;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);
61
+
62
+
63
+ var nicLinkOptions = {
64
+ buttons : {
65
+ 'link' : {name : 'Add Link', type : 'nicLinkButton', tags : ['A']},
66
+ 'unlink' : {name : 'Remove Link', command : 'unlink', noActive : true}
67
+ }
68
+ };
69
+
70
+ 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);
71
+
72
+
73
+ var nicColorOptions = {
74
+ buttons : {
75
+ 'forecolor' : {name : __('Change Text Color'), type : 'nicEditorColorButton', noClose : true},
76
+ 'bgcolor' : {name : __('Change Background Color'), type : 'nicEditorBgColorButton', noClose : true}
77
+ }
78
+ };
79
+
80
+ 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);
81
+
82
+
83
+ var nicImageOptions = {
84
+ buttons : {
85
+ 'image' : {name : 'Add Image', type : 'nicImageButton', tags : ['IMG']}
86
+ }
87
+
88
+ };
89
+
90
+ 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);
91
+
92
+ var nicXHTML=bkClass.extend({stripAttributes:["_moz_dirty","_moz_resizing","_extended"],noShort:["style","title","script","textarea","a"],cssReplace:{"font-weight:bold;":"strong","font-style:italic;":"em"},sizes:{1:"xx-small",2:"x-small",3:"small",4:"medium",5:"large",6:"x-large"},construct:function(A){this.ne=A;if(this.ne.options.xhtml){A.addEvent("get",this.cleanup.closure(this))}},cleanup:function(A){var B=A.getElm();var C=this.toXHTML(B);A.content=C},toXHTML:function(C,A,L){var G="";var O="";var P="";var I=C.nodeType;var Q=C.nodeName.toLowerCase();var N=C.hasChildNodes&&C.hasChildNodes();var B=new Array();switch(I){case 1:var H=C.attributes;switch(Q){case"b":Q="strong";break;case"i":Q="em";break;case"font":Q="span";break}if(A){for(var F=0;F<H.length;F++){var K=H[F];var M=K.nodeName.toLowerCase();var D=K.nodeValue;if(!K.specified||!D||bkLib.inArray(this.stripAttributes,M)||typeof (D)=="function"){continue}switch(M){case"style":var J=D.replace(/ /g,"");for(itm in this.cssReplace){if(J.indexOf(itm)!=-1){B.push(this.cssReplace[itm]);J=J.replace(itm,"")}}P+=J;D="";break;case"class":D=D.replace("Apple-style-span","");break;case"size":P+="font-size:"+this.sizes[D]+";";D="";break}if(D){O+=" "+M+'="'+D+'"'}}if(P){O+=' style="'+P+'"'}for(var F=0;F<B.length;F++){G+="<"+B[F]+">"}if(O==""&&Q=="span"){A=false}if(A){G+="<"+Q;if(Q!="br"){G+=O}}}if(!N&&!bkLib.inArray(this.noShort,M)){if(A){G+=" />"}}else{if(A){G+=">"}for(var F=0;F<C.childNodes.length;F++){var E=this.toXHTML(C.childNodes[F],true,true);if(E){G+=E}}}if(A&&N){G+="</"+Q+">"}for(var F=0;F<B.length;F++){G+="</"+B[F]+">"}break;case 3:G+=C.nodeValue;break}return G}});nicEditors.registerPlugin(nicXHTML);
93
+
js/nicedit/nicEditorIcons.gif ADDED
Binary file
js/share.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <head>
3
+ <style type="text/css">
4
+ <!--
5
+ body {
6
+ font: 13px Arial, Helvetica, sans-serif;
7
+ padding: 10px;
8
+ overflow: hidden;
9
+ }
10
+ .txtBox{
11
+ font-size: 20px;
12
+ padding: 5px;
13
+ width: 25%;
14
+ }
15
+ p {
16
+ font-size: 12px;
17
+ }
18
+ #close{
19
+ background: #dfdfdf;
20
+ height: 21px;
21
+ width: 15px;
22
+ top: -5px;
23
+ right: -5px;
24
+ position: absolute;
25
+ padding: 8px 5px 1px 10px;
26
+ -webkit-border-radius: 35px;
27
+ -moz-border-radius: 35px;
28
+ border-radius: 35px;
29
+ cursor: pointer;
30
+ }
31
+ -->
32
+ </style>
33
+
34
+ </head>
35
+ <body>
36
+ <?php $id = intval($_GET['i']); ?>
37
+
38
+ <div id="close" onClick="parent.sc_closeiframe();">x</div>
39
+
40
+ <?php if ($id == 1): ?>
41
+ <div id="donate">
42
+ <h3>Donate and support this plugin !</h3>
43
+ <p>If you like this plugin, then just make a small donation for this plugin.</p>
44
+ <p style="font-size:10px">This plugin is free with premium features, so your donation will encourage me to work on the plugin to add more features.</p>
45
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
46
+ <input name="cmd" value="_donations" type="hidden">
47
+ <input name="business" value="donations@aakashweb.com" type="hidden">$&nbsp;
48
+ <input type="number" name="amount" class="txtBox" value="20">&nbsp;
49
+ <input align="right" src="../images/paypal.gif" name="submit" alt="PayPal - The safer, easier way to pay online!" type="image" border="0">
50
+ <input name="item_name" value="Donation for Shortcoder plugin" type="hidden">
51
+ <input name="no_shipping" value="0" type="hidden">
52
+ <input name="no_note" value="1" type="hidden">
53
+ <input name="currency_code" value="USD" type="hidden">
54
+ <input name="tax" value="0" type="hidden">
55
+ <input name="lc" value="US" type="hidden">
56
+ <input name="bn" value="PP-DonationsBF" type="hidden">
57
+ </form>
58
+ </div>
59
+ <?php endif; ?>
60
+
61
+ <?php if ($id == 2): ?>
62
+ <div id="share">
63
+ <h3>Share this plugin !!</h3>
64
+ <div class="addthis_toolbox addthis_default_style">
65
+ <a class="addthis_button_facebook_like" fb:like:layout="button_count" fb:like:href="http://facebook.com/aakashweb"></a>
66
+ <a class="addthis_button_google_plusone" g:plusone:size="medium" g:plusone:href="http://www.aakashweb.com"></a>
67
+ <a class="addthis_button_tweet" tw:count="horizontal" tw:url="http://www.aakashweb.com/wordpress-plugins/shortcoder/" tw:text="Shortcoder - Awesome plugin for creating custom Shortcodes in Wordpress !"></a>
68
+ </div>
69
+ <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=vaakash"></script>
70
+ </div>
71
+ <?php endif; ?>
72
+
73
+ </body>
74
+ </html>
js/tinymce/Thumbs.db ADDED
Binary file
js/tinymce/editor_plugin.js ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Shortcoder inserting javascript in TinyMCE editor
3
+ * http://www.aakashweb.com
4
+ * v1.1
5
+ * Added since WP Socializer v2.0
6
+ */
7
+ function sc_show_editor(){
8
+ var url = document.getElementById('sc_editorUrl').innerHTML;
9
+ tb_show('Insert a Shortcode', url + '?random=' + Math.random() + '&TB_iframe=1');
10
+ }
11
+
12
+ // For adding button in the visual editing toolbox
13
+ (function() {
14
+ tinymce.create('tinymce.plugins.SCButton', {
15
+
16
+ init : function(ed, url) {
17
+ ed.addButton('scbutton', {
18
+ title : 'Insert shortcodes created using Shortcoder',
19
+ image : url + '/icon.png',
20
+ onclick : function() {
21
+ sc_show_editor();
22
+ }
23
+ });
24
+ },
25
+
26
+ getInfo : function() {
27
+ return {
28
+ longname : 'Shortcoder',
29
+ author : 'Aakash Chakravarthy',
30
+ authorurl : 'http://www.aakashweb.com/',
31
+ infourl : 'http://www.aakashweb.com/',
32
+ version : '1.0'
33
+ };
34
+ }
35
+
36
+ });
37
+
38
+ tinymce.PluginManager.add('scbutton', tinymce.plugins.SCButton);
39
+ })();
40
+
41
+ // For adding button in the code editing toolbox
42
+
43
+ if(document.getElementById("ed_toolbar")){
44
+ qt_toolbar = document.getElementById("ed_toolbar");
45
+ edButtons[edButtons.length] = new edButton("ed_scbutton", "WP Socializer", "", "","");
46
+ var qt_button = qt_toolbar.lastChild;
47
+ while (qt_button.nodeType != 1){
48
+ qt_button = qt_button.previousSibling;
49
+ }
50
+ qt_button = qt_button.cloneNode(true);
51
+ qt_button.value = 'Shortcoder';
52
+ qt_button.title = 'Insert shortcodes created using Shortcoder';
53
+ qt_button.onclick = function(){ sc_show_editor(); };
54
+ qt_button.id = "ed_scbutton";
55
+ qt_toolbar.appendChild(qt_button);
56
+ }
js/tinymce/icon.png ADDED
Binary file
languages/readme.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html>
3
+ <head>
4
+ <title>Shortcoder - Plugin - Language Translation</title>
5
+ <style>
6
+ body{
7
+ font: 13px/2em Arial, Helvetica, sans-serif;
8
+ background: #DDF1FF;
9
+ }
10
+ #wrap{
11
+ margin: 0px auto;
12
+ padding: 10px;
13
+ width: 750px;
14
+ background: #FFFFFF;
15
+ border: 1px solid #0099FF;
16
+ }
17
+ h1, h2{
18
+ font-weight: normal;
19
+ border-bottom: 1px solid #E0E0E0;
20
+ }
21
+ .grey{
22
+ color: #999999;
23
+ }
24
+ </style>
25
+ </head>
26
+ <body>
27
+ <div id="wrap">
28
+ <h1>Shortcoder - Plugin - Language Translation</h1>
29
+ <h3>Credits</h3>
30
+ <p>All Translations in this folder were made - By <a href="http://www.aakashweb.com/" rel="follow">Aakash Chakravarthy</a> </p>
31
+ <p>PO and MO files were made with Poedit software. Translations were done with Google Translate and Microsoft Translate. </p>
32
+ <h2>Contact Author </h2>
33
+ <ul>
34
+ <li>Website: <a href="http://www.aakashweb.com/" rel="follow">Aakash Web</a></li>
35
+ <li>Support: <a href="http://www.aakashweb.com/forum/">Forum</a> </li>
36
+ <li>Email: aakash.19493 AT gmail DOT com</li>
37
+ <li>Twitter: <a href="http://twitter.com/vaakash">vaakash</a></li>
38
+ </ul>
39
+ <p>More Translations needed. Please submit a Translation in <a href="http://www.aakashweb.com/wordpress-plugins/shortcoder/" rel="follow">this page</a>. </p>
40
+ </div>
41
+ </body>
42
+ </html>
languages/sc-de_DE.mo ADDED
Binary file
languages/sc-de_DE.po ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Shortcoder\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-07-30 11:56+0530\n"
6
+ "PO-Revision-Date: 2010-07-30 11:57+0530\n"
7
+ "Last-Translator: Aakash Chakravarthy <aakash.19493@gmail.com>\n"
8
+ "Language-Team: Aakash Chakravarthy <aakash.19493@gmail.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "X-Poedit-SearchPath-0: ..\n"
15
+
16
+ #: ../adm-sidebar.php:10
17
+ msgid "Donate and support this plugin's future"
18
+ msgstr "Spenden und Unterstützung dieses Plugin die Zukunft"
19
+
20
+ #: ../adm-sidebar.php:14
21
+ msgid "Plugin Support"
22
+ msgstr "Plugin-Unterstützung"
23
+
24
+ #: ../adm-sidebar.php:18
25
+ msgid "Plugin Documentation"
26
+ msgstr "Plugin-Dokumentation"
27
+
28
+ #: ../adm-sidebar.php:22
29
+ msgid "Bugs Report"
30
+ msgstr "Fehler melden"
31
+
32
+ #: ../adm-sidebar.php:26
33
+ msgid "FAQ's"
34
+ msgstr "FAQ's"
35
+
36
+ #: ../adm-sidebar.php:30
37
+ msgid "Request a feature"
38
+ msgstr "Fordern Sie eine Funktion"
39
+
40
+ #: ../adm-sidebar.php:34
41
+ msgid "Author Website"
42
+ msgstr "Autor Website"
43
+
44
+ #: ../adm-sidebar.php:38
45
+ msgid "Support this plugin"
46
+ msgstr "Unterstützen Sie dieses Plugin"
47
+
48
+ #: ../adm-sidebar.php:42
49
+ msgid "Follow the author"
50
+ msgstr "Folgen Sie den Autor"
51
+
52
+ #: ../adm-sidebar.php:46
53
+ msgid "Subscribe to Updates"
54
+ msgstr "Abonnieren Sie Updates"
55
+
56
+ #: ../adm-sidebar.php:50
57
+ msgid "Promote this plugin"
58
+ msgstr "Förderung dieses Plugin"
59
+
60
+ #: ../adm-sidebar.php:55
61
+ msgid "More plugins"
62
+ msgstr "Weitere Plugins"
63
+
64
+ #: ../shortcoder.php:257
65
+ msgid "Updated successfully."
66
+ msgstr "Erfolgreich aktualisiert."
67
+
68
+ #: ../shortcoder.php:259
69
+ msgid "Unable to update !"
70
+ msgstr "Kann Update!"
71
+
72
+ #: ../shortcoder.php:290
73
+ msgid "Select a shortcode"
74
+ msgstr "Wählen Sie eine Shortcode"
75
+
76
+ #: ../shortcoder.php:294
77
+ msgid "Shortcode Name"
78
+ msgstr "Shortcode Name"
79
+
80
+ #: ../shortcoder.php:301
81
+ msgid "Select the Shortcode Attribute to be edited"
82
+ msgstr "Wählen Sie das Shortcode Attribute bearbeitet werden"
83
+
84
+ #: ../shortcoder.php:306
85
+ msgid "Properties"
86
+ msgstr "Eigenschaften"
87
+
88
+ #: ../shortcoder.php:310
89
+ msgid "Name"
90
+ msgstr "Name"
91
+
92
+ #: ../shortcoder.php:312
93
+ #, php-format
94
+ msgid "Edit the attribute name. This is used as [sc name=\"<b>%s</b>\"]"
95
+ msgstr "Bearbeiten Sie das Attribut name. Dies wird als [sc name=\"<b>%s</b>\"] verwendet"
96
+
97
+ #: ../shortcoder.php:315
98
+ msgid "Content:"
99
+ msgstr "Inhalt:"
100
+
101
+ #: ../shortcoder.php:323
102
+ #, php-format
103
+ msgid "Enter any Javascript / HTML / Flash embed code or Plain text. This is the output got when the shortcode [sc name=\"%s\"] is used in your post."
104
+ msgstr "Geben Sie Javascript / HTML / Flash-Code oder Plain Text einzubetten. Dies ist der Ausgang bekam, wenn die shortcode [sc name=\"%s\"] wird in Ihrem Beitrag verwenden."
105
+
106
+ #: ../shortcoder.php:329
107
+ msgid "Optional Settings"
108
+ msgstr "Optionale Einstellungen"
109
+
110
+ #: ../shortcoder.php:333
111
+ msgid "Disable this shortcode"
112
+ msgstr "Deaktivieren Sie diese Kurzwahlnummer"
113
+
114
+ #: ../shortcoder.php:336
115
+ msgid "Checking this checkbox will not display anything when this shortcode attribute is used."
116
+ msgstr "Überprüfen Sie diese Checkbox, wird nichts angezeigt wird, wenn dieser Shortcode Attribut verwendet wird."
117
+
118
+ #: ../shortcoder.php:341
119
+ msgid "Do not execute this shortcode in :"
120
+ msgstr "Führ dies nicht Shortcode in:"
121
+
122
+ #: ../shortcoder.php:343
123
+ msgid "Home page"
124
+ msgstr "Startseite"
125
+
126
+ #: ../shortcoder.php:345
127
+ msgid "Post pages"
128
+ msgstr "Post-Seiten"
129
+
130
+ #: ../shortcoder.php:347
131
+ msgid "Page"
132
+ msgstr "Seite"
133
+
134
+ #: ../shortcoder.php:349
135
+ msgid "Archive or Tag pages"
136
+ msgstr "Archive oder Tag-Seiten"
137
+
138
+ #: ../shortcoder.php:351
139
+ msgid "Search results page"
140
+ msgstr "Suchergebnisse Seite"
141
+
142
+ #: ../shortcoder.php:357
143
+ msgid "Do not show this shortcode to :"
144
+ msgstr "Don't show this Shortcode zu:"
145
+
146
+ #: ../shortcoder.php:359
147
+ msgid "Administrator"
148
+ msgstr "Administrator"
149
+
150
+ #: ../shortcoder.php:367
151
+ msgid "Update"
152
+ msgstr "Aktualisierung"
153
+
154
+ #: ../shortcoder.php:373
155
+ msgid "Preview"
156
+ msgstr "Vorschau"
157
+
languages/sc-es_ES.mo ADDED
Binary file
languages/sc-es_ES.po ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Shortcoder\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-07-30 12:06+0530\n"
6
+ "PO-Revision-Date: 2010-07-30 12:18+0530\n"
7
+ "Last-Translator: Aakash Chakravarthy <aakash.19493@gmail.com>\n"
8
+ "Language-Team: Aakash Chakravarthy <aakash.19493@gmail.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "X-Poedit-SearchPath-0: ..\n"
15
+
16
+ #: ../adm-sidebar.php:10
17
+ msgid "Donate and support this plugin's future"
18
+ msgstr "Dona y apoyar este plugin futuro"
19
+
20
+ #: ../adm-sidebar.php:14
21
+ msgid "Plugin Support"
22
+ msgstr "Plugin de Apoyo"
23
+
24
+ #: ../adm-sidebar.php:18
25
+ msgid "Plugin Documentation"
26
+ msgstr "Plugin de Documentación"
27
+
28
+ #: ../adm-sidebar.php:22
29
+ msgid "Bugs Report"
30
+ msgstr "Avisa de un error"
31
+
32
+ #: ../adm-sidebar.php:26
33
+ msgid "FAQ's"
34
+ msgstr "Preguntas frecuentes"
35
+
36
+ #: ../adm-sidebar.php:30
37
+ msgid "Request a feature"
38
+ msgstr "Solicitar una característica"
39
+
40
+ #: ../adm-sidebar.php:34
41
+ msgid "Author Website"
42
+ msgstr "Autor Web"
43
+
44
+ #: ../adm-sidebar.php:38
45
+ msgid "Support this plugin"
46
+ msgstr "Apoya a este plugin"
47
+
48
+ #: ../adm-sidebar.php:42
49
+ msgid "Follow the author"
50
+ msgstr "Siga el autor"
51
+
52
+ #: ../adm-sidebar.php:46
53
+ msgid "Subscribe to Updates"
54
+ msgstr "Suscribirse a las actualizaciones"
55
+
56
+ #: ../adm-sidebar.php:50
57
+ msgid "Promote this plugin"
58
+ msgstr "Promover este plugin"
59
+
60
+ #: ../adm-sidebar.php:55
61
+ msgid "More plugins"
62
+ msgstr "Más plugins"
63
+
64
+ #: ../shortcoder.php:257
65
+ msgid "Updated successfully."
66
+ msgstr "Actualizado con éxito."
67
+
68
+ #: ../shortcoder.php:259
69
+ msgid "Unable to update !"
70
+ msgstr "No se puede actualizar!"
71
+
72
+ #: ../shortcoder.php:290
73
+ msgid "Select a shortcode"
74
+ msgstr "Seleccione un Shortcode"
75
+
76
+ #: ../shortcoder.php:294
77
+ msgid "Shortcode Name"
78
+ msgstr "Shortcode nombre"
79
+
80
+ #: ../shortcoder.php:301
81
+ msgid "Select the Shortcode Attribute to be edited"
82
+ msgstr "Seleccione el Shortcode Attribute a editar"
83
+
84
+ #: ../shortcoder.php:306
85
+ msgid "Properties"
86
+ msgstr "Propiedades"
87
+
88
+ #: ../shortcoder.php:310
89
+ msgid "Name"
90
+ msgstr "Nombre"
91
+
92
+ #: ../shortcoder.php:312
93
+ #, php-format
94
+ msgid "Edit the attribute name. This is used as [sc name=\"<b>%s</b>\"]"
95
+ msgstr "Edite el nombre del atributo. Esto se utiliza como [sc name=\"<b>%s</b>\"]"
96
+
97
+ #: ../shortcoder.php:315
98
+ msgid "Content:"
99
+ msgstr "Contenido:"
100
+
101
+ #: ../shortcoder.php:323
102
+ #, php-format
103
+ msgid "Enter any Javascript / HTML / Flash embed code or Plain text. This is the output got when the shortcode [sc name=\"%s\"] is used in your post."
104
+ msgstr "Enter any Javascript / HTML / Flash embed code or Plain text. This is the output got when the shortcode [sc name=\"%s\"] is used in your post."
105
+
106
+ #: ../shortcoder.php:329
107
+ msgid "Optional Settings"
108
+ msgstr "Configuración opcional"
109
+
110
+ #: ../shortcoder.php:333
111
+ msgid "Disable this shortcode"
112
+ msgstr "Desactive esta deficiencia"
113
+
114
+ #: ../shortcoder.php:336
115
+ msgid "Checking this checkbox will not display anything when this shortcode attribute is used."
116
+ msgstr "Al marcar esta casilla no se mostrará nada cuando este atributo se utiliza código corto."
117
+
118
+ #: ../shortcoder.php:341
119
+ msgid "Do not execute this shortcode in :"
120
+ msgstr "No ejecutar esta deficiencia en:"
121
+
122
+ #: ../shortcoder.php:343
123
+ msgid "Home page"
124
+ msgstr "Portada del sitio"
125
+
126
+ #: ../shortcoder.php:345
127
+ msgid "Post pages"
128
+ msgstr "Las páginas de entrada"
129
+
130
+ #: ../shortcoder.php:347
131
+ msgid "Page"
132
+ msgstr "Página"
133
+
134
+ #: ../shortcoder.php:349
135
+ msgid "Archive or Tag pages"
136
+ msgstr "Archivo de etiquetas o páginas"
137
+
138
+ #: ../shortcoder.php:351
139
+ msgid "Search results page"
140
+ msgstr "Resultados de la búsqueda la página"
141
+
142
+ #: ../shortcoder.php:357
143
+ msgid "Do not show this shortcode to :"
144
+ msgstr "No mostrar esta deficiencia a:"
145
+
146
+ #: ../shortcoder.php:359
147
+ msgid "Administrator"
148
+ msgstr "Administrador"
149
+
150
+ #: ../shortcoder.php:367
151
+ msgid "Update"
152
+ msgstr "Actualización"
153
+
154
+ #: ../shortcoder.php:373
155
+ msgid "Preview"
156
+ msgstr "Prevista"
157
+
readme.txt ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Shortcoder ===
2
+ Contributors: Aakash Chakravarthy
3
+ Author URI: http://www.aakashweb.com/
4
+ Plugin URI: http://www.aakashweb.com/wordpress-plugins/shortcoder/
5
+ Tags: shortcode, ads, adsense, advertising, bookmark, bookmarking, bookmarks, custom, embed, feed, feeds, rss, flash, html, image, images, javascript, jquery, link, links, media, page, pages, youtube, plugin, post, posts, share, social, social bookmarking, form, template, video, yahoo
6
+ Donate link: http://bit.ly/scdonate
7
+ Requires at least: 2.5
8
+ Tested up to: 3.4
9
+ Stable tag: 3.0
10
+
11
+ Create custom "Shortcodes" with HTML, Javascript snippets stored in it and use that shortcode within posts and pages. Check the demo video.
12
+
13
+ == Description ==
14
+
15
+ Shortcoder is a plugin which allows to create a custom shortcode and store HTML, Javascript and other snippets in it. So if that shortcode is used in any post or pages, then the code stored in the shortcode get exceuted in that place.
16
+
17
+ [youtube="http://www.youtube.com/watch?v=GrlRADfvjII"]
18
+
19
+ = An example usage =
20
+
21
+ 1. Create a shortcode named "adsenseAd" in the Shortcoder admin page.
22
+ 1. Paste the adsense code in the box given and save it.
23
+ 1. Use `[sc:adsenseAd]` in your posts and pages.
24
+ 1. Tada !!! the ad appears in the post.
25
+
26
+ * Using this idea, shortcodes can be created for frequently used snippets.
27
+ * You can also add parameters (like `%id%`) inside the snippets, and vary it like `[sc:youtube id="GrlRADfvjII"]`
28
+ * This plugin will be hugely useful to all !!!
29
+
30
+ = Features =
31
+
32
+ * Easy admin interface, no clusters create shortcodes easily.
33
+ * Visual editor avaialble, so useful for beginners.
34
+ * tinyMCE button avaialble in the editing toolbar so no typing required to insert the shortcode.
35
+ * Globally disable the shortcode when not needed.
36
+ * Can disable the shortcode, showing it to the admins.
37
+
38
+ = Resources =
39
+
40
+ * [Documentation](http://www.aakashweb.com/wordpress-plugins/shortcoder/)
41
+ * [FAQs](http://www.aakashweb.com/faqs/wordpress-plugins/shortcoder/)
42
+ * [Support](http://www.aakashweb.com/forum/)
43
+ * [Report Bugs](http://www.aakashweb.com/forum/)
44
+
45
+ == Installation ==
46
+
47
+ 1. Extract the zipped file and upload the folder `Shortcoder` to to `/wp-content/plugins/` directory.
48
+ 1. Activate the plugin through the `Plugins` menu in WordPress.
49
+ 1. Go to the "Shortcoder" admin page.
50
+ 1. Enter a shortcode name.
51
+ 1. Paste some code in it.
52
+ 1. Then use the shortcode `[sc:"name of the shortcode"]` in your post. ex: If "youtube" is the shortcode name, then just use `[sc:youtube]` in your posts
53
+ 1. That's all !
54
+
55
+ You can also insert some parameters within the post. Check this page to [learn more](http://www.aakashweb.com/wordpress-plugins/shortcoder/).
56
+
57
+ == Frequently Asked Questions ==
58
+
59
+ Please visit the [Plugin homepage](http://www.aakashweb.com/faqs/shortcoder/) for lots of FAQ's. Selected are given here.
60
+
61
+ = I've created a shortcode, how to use it ? =
62
+
63
+ For example, consider you made a shortcode "advertisement". Then you should use the shortcode `[sc:advertisement]` in your post.
64
+
65
+ = How to temporarily disable a shortcode ? =
66
+
67
+ Just check the "Temporarily disable this shortcode" in the shortcode admin page to disable it.
68
+ Note: When you disable a shortcode, the shortcode will not be executed in the page.
69
+
70
+ For more FAQs please visit the [Plugin homepage](http://www.aakashweb.com/faqs/shortcoder/)
71
+
72
+ == Screenshots ==
73
+
74
+ 1. Shortcoder admin page with a Shortcode created (youtube) with a parameter `%id%`.
75
+ 2. Using the shortcode `[sc:youtube id="GrlRADfvjII"]` in a post.
76
+ 3. Output of the Shortcode (The shortcode gets replaced with the youtube video).
77
+ 4. Select the shortcodes created using the toolbar button.
78
+
79
+ [More Screenshots](http://www.aakashweb.com/wordpress-plugins/shortcoder/)
80
+
81
+ == Changelog ==
82
+
83
+ = 3.0 =
84
+ * Plugin code rewritten from scratch.
85
+ * Shortcode syntax is changed.
86
+ * Supports any custom parameters.
87
+ * Admin interface is redesigned and easy to use.
88
+ * Added a tinyMCE button to the editing toolbar for inserting the shortcodes in the post.
89
+ * Inbuilt shortcodes are removed.
90
+
91
+ = 2.3 =
92
+ * Can disable the shortcode to Administrators.
93
+ * Admin interface changed.
94
+
95
+ = 1.3.1 =
96
+ * Changed the folder name's case and some minor bugs.
97
+ * Code revision.
98
+
99
+ = 1.3 =
100
+ * Initial Version with 5 inbuilt shortcodes.
101
+
102
+ (Pre made versions are not released)
103
+
104
+ == Upgrade Notice ==
105
+
106
+ Major upgrade. Entire code is rewritten from scratch.
sc-admin-css.css ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Admin Page CSS for Shortcoder plugin
3
+ * Author : Aakash Chakravarthy
4
+ * Version : 3.0
5
+ */
6
+ .wrap{
7
+ margin: 015px auto 15px;
8
+ width: 630px;
9
+ padding: 0px;
10
+ }
11
+ .wrap #content{
12
+ background: #FFFFFF;
13
+ padding: 15px;
14
+ border: 1px solid #dfdfdf;
15
+ margin: 10px 0px 0px;
16
+ -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
17
+ -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
18
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
19
+ -moz-border-radius: 10px;
20
+ border-radius: 10px;
21
+ }
22
+ .wrap h3{
23
+ margin: 0px -15px 15px;
24
+ padding: 0px 15px 10px;
25
+ border-bottom: 1px solid #dfdfdf;
26
+ background: url(images/grey-bg.png) repeat-x 0px 10px;
27
+ }
28
+ .wrap h3 small{
29
+ color: #666666;
30
+ font-size: 11px;
31
+ margin: 0px 0px 0px 5px;
32
+ }
33
+ #sc_form{
34
+ margin: 0px -15px 10px;
35
+ padding: 0px 15px 20px;
36
+ border-bottom: 1px solid #dfdfdf;
37
+ }
38
+ #sc_name{
39
+ padding: 5px;
40
+ width: 100%;
41
+ margin: 0px 0px 10px;
42
+ font-size: 14px;
43
+ font-weight: bold;
44
+ }
45
+ #sc_content{
46
+ width: 100%;
47
+ font: 11.5px/2em "Courier New", Courier, monospace;
48
+ resize: vertical;
49
+ }
50
+ #sc_list li{
51
+ background: #F5F5F5 url(images/grey-bg.png) repeat-x;
52
+ float: left;
53
+ cursor: pointer;
54
+ color: #454545;
55
+ margin: 0px 5px 6px 0px;
56
+ padding: 3px 10px;
57
+ border: 1px solid #dfdfdf;
58
+ border-radius: 10px;
59
+ }
60
+ #sc_list li:hover{
61
+ border-color: #0099CC;
62
+ }
63
+ #sc_list li:active{
64
+ background: #f2f2f2;
65
+ }
66
+ #sc_settings{
67
+ margin-bottom: 10px;
68
+ display: block;
69
+ margin-top: 10px;
70
+ }
71
+ #sc_submit{
72
+ float: right;
73
+ background: #F5F5F5 url(images/grey-bg.png) repeat-x;
74
+ font-size: 15px;
75
+ font-weight: bold;
76
+ padding: 5px 15px;
77
+ margin: -15px 0px 0px;
78
+ border-color: #00CC00;
79
+ }
80
+ #sc_submit:hover{
81
+ border-color: #009900;
82
+ }
83
+ .sc_btdisabled{
84
+ opacity: 0.5;
85
+ }
86
+ #sc_code{
87
+ font-size: 10px;
88
+ color: #666666;
89
+ border: 1px solid #dfdfdf;
90
+ display: none;
91
+ background: #FCFCFC;
92
+ float: right;
93
+ margin-top: -57px;
94
+ padding: 0px 5px;
95
+ }
96
+ #sc_delete{
97
+ background: #F7F7F7 url(images/trash-can.png) no-repeat;
98
+ height: 48px;
99
+ width: 48px;
100
+ border: 1px solid #FF0000;
101
+ position: fixed;
102
+ right: 0px;
103
+ bottom: 0px;
104
+ -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
105
+ -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
106
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
107
+ -moz-border-radius: 10px;
108
+ border-radius: 10px;
109
+ margin-right: 35px;
110
+ margin-bottom: 55px;
111
+ opacity: 0.2;
112
+ }
113
+ #sc_editor{
114
+ clear: both !important;
115
+ }
116
+ .sc_trashHover{
117
+ opacity: 1 !important;
118
+ -moz-box-shadow: 0px 0px 5px 1px #ff0000 !important;
119
+ box-shadow: 0px 0px 5px 1px #ff0000 !important;
120
+ }
121
+ .sc_back{
122
+ margin: -45px 0px 0px;
123
+ float: right;
124
+ font-weight: bold;
125
+ cursor: pointer;
126
+ }
127
+ .sc_back:hover{
128
+ color: #666666;
129
+ }
130
+ .sc_switch_editor{
131
+ float:right;
132
+ margin: 0px;
133
+ }
134
+ .sc_switch_editor li{
135
+ float:left;
136
+ background: #CC3300;
137
+ -webkit-border-radius: 2px;
138
+ -moz-border-radius: 2px;
139
+ border-radius: 2px;
140
+ margin-right: 3px;
141
+ background: #F5F5F5 url(images/grey-bg.png) repeat-x;
142
+ border: 1px solid #dfdfdf;
143
+ padding: 3px 8px;
144
+ cursor: pointer;
145
+ }
146
+ .sc_editor_active{
147
+ border-color: #666666!important;
148
+ }
149
+
150
+ .sc_share_wrap{
151
+ margin-left: -65px;
152
+ position: absolute;
153
+ top: 20%;
154
+ }
155
+ .sc_share_wrap li{
156
+ padding: 7px;
157
+ background: white url(images/grey-bg.png) repeat-x bottom;
158
+ border: 1px solid #dfdfdf;
159
+ margin: 0px 0px 7px;
160
+ opacity: 0.6;
161
+ -webkit-border-radius: 5px;
162
+ -moz-border-radius: 5px;
163
+ border-radius: 5px;
164
+ cursor: pointer;
165
+ }
166
+ .sc_share_wrap a{
167
+ background-repeat: no-repeat;
168
+ height: 32px;
169
+ width: 32px;
170
+ display: block;
171
+ }
172
+ .sc_donate a{ background-image: url(images/donate.png); }
173
+ .sc_share a{ background-image: url(images/share.png); }
174
+ .sc_share_iframe{
175
+ background: #FFFFFF;
176
+ border: 1px solid #dfdfdf;
177
+ -webkit-border-radius: 5px;
178
+ -moz-border-radius: 5px;
179
+ border-radius: 5px;
180
+ -moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
181
+ -webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
182
+ box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
183
+ }
184
+
185
+ .sc_hidden_text{
186
+ display: none;
187
+ }
188
+ .sc_credits{
189
+ background: url(images/aw.png) no-repeat;
190
+ padding-left: 23px;
191
+ color: #8B8B8B;
192
+ margin-left: -5px;
193
+ font-size: 13px;
194
+ text-decoration: none;
195
+ }
196
+ .smallText{
197
+ font-size: 11px;
198
+ color: #333333;
199
+ font-weight: none;
200
+ }
201
+ .grey{
202
+ color: #999;
203
+ }
204
+ .nicEdit-main {
205
+ font-family: Georgia, "Times New Roman", Times, serif;
206
+ font-size: 14px;
207
+ }
208
+
209
+ * html .clearfix{
210
+ height: 1%;
211
+ overflow: visible;
212
+ }
213
+
214
+ /* float clearing for IE7 */
215
+ *+html .clearfix{
216
+ min-height: 1%;
217
+ }
218
+
219
+ /* float clearing for everyone else */
220
+ .clearfix:after{
221
+ clear: both;
222
+ content: ".";
223
+ display: block;
224
+ height: 0;
225
+ visibility: hidden;
226
+ font-size: 0;
227
+ }
sc-admin-js.js ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $j = jQuery.noConflict();
2
+
3
+ $j(document).ready(function(){
4
+ var sccontent;
5
+
6
+ $j('#sc_list li').click(function(){
7
+ $j('#sc_name_edit').val($j(this).text());
8
+ $j('#sc_edit_form').submit();
9
+ });
10
+
11
+ $j('#sc_list li').draggable({
12
+ start: function(){ $j('#sc_delete').addClass('sc_trashHover'); },
13
+ stop: function(){ $j('#sc_delete').removeClass('sc_trashHover'); }
14
+ });
15
+ $j('#sc_delete').droppable({
16
+ drop: function(e, ui){
17
+ $j('#sc_list li').unbind('click');
18
+ $j('#sc_name_edit').val(ui.draggable.text());
19
+ $j('#sc_form_action').val('delete');
20
+ $j('#sc_edit_form').submit();
21
+ }
22
+ });
23
+
24
+ $j('#sc_name').bind('keyup focus change',function(){
25
+ sc_triggerElements($j(this).val());
26
+ });
27
+
28
+ $j('.sc_back').click(function(){
29
+ location.reload();
30
+ });
31
+
32
+ sc_triggerElements($j('#sc_name').val());
33
+
34
+ $j('.sc_switch_editor li:first').addClass('sc_editor_active');
35
+
36
+ $j('.sc_editor_html').click(function(){
37
+ sccontent.removeInstance('sc_content');
38
+ $j('.sc_switch_editor li').removeClass('sc_editor_active');
39
+ $j(this).addClass('sc_editor_active');
40
+ });
41
+
42
+ $j('.sc_editor_visual').click(function(){
43
+ sccontent = new nicEditor({
44
+ buttonList : ['bold','italic','underline','left','center','right','justify','ol','ul','subscript','superscript','strikethrough', 'fontFormat','removeformat','indent','outdent','hr','image','forecolor','bgcolor','link' ,'unlink'],
45
+ iconsPath : $j('.sc_hidden_text').text()
46
+ }).panelInstance('sc_content');
47
+ $j('.sc_switch_editor li').removeClass('sc_editor_active');
48
+ $j(this).addClass('sc_editor_active');
49
+ });
50
+
51
+ // Video
52
+ $j('.sc_open_video').click(function(e){
53
+ e.preventDefault();
54
+ newwindow2=window.open('','name','height=340,width=585');
55
+ var tmp = newwindow2.document;
56
+ tmp.write('<iframe width="560" height="315" src="http://www.youtube.com/embed/GrlRADfvjII" frameborder="0" allowfullscreen></iframe>');
57
+ tmp.close();
58
+ });
59
+
60
+ // Share bar
61
+ $j('.sc_share_wrap li').mouseenter(function(){
62
+ $this = $j(this);
63
+ $j('.sc_share_iframe').remove();
64
+ $j('body').append('<iframe class="sc_share_iframe"></iframe>');
65
+ $j('.sc_share_iframe').css({
66
+ position: 'absolute',
67
+ top: $this.offset()['top'],
68
+ left: $this.offset()['left'] + 55,
69
+ width: $this.attr('data-width'),
70
+ height: $this.attr('data-height'),
71
+ }).attr('src', $this.attr('data-url')).hide().fadeIn();
72
+ });
73
+
74
+ $j('.sc_share_iframe').live('mouseout', function(){
75
+ $j(this).remove();
76
+ });
77
+
78
+ });
79
+
80
+ var sc_closeiframe = function(){
81
+ $j('.sc_share_iframe').remove();
82
+ }
83
+
84
+ function sc_triggerElements(val){
85
+ if(val != ''){
86
+ if(sc_wsc(val)){
87
+ code = '"' + val + '"';
88
+ }else{
89
+ code = val;
90
+ }
91
+
92
+ $j('#sc_code').show();
93
+ $j('#sc_code').html('Your shortcode is <b>[sc:' + code + ']</b>');
94
+ $j('#sc_submit').removeClass('sc_btdisabled').removeAttr('disabled');
95
+ }else{
96
+ $j('#sc_code').hide();
97
+ $j('#sc_submit').addClass('sc_btdisabled').attr('disabled', 'disabled');
98
+ }
99
+ }
100
+
101
+ function sc_wsc(s) {
102
+ return s.indexOf(' ') >= 0;
103
+ }
sc-editor.php ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shortcoder include for inserting and editing shortcodes in post and pages
4
+ * v1.0
5
+ **/
6
+
7
+ if ( ! isset( $_GET['inline'] ) )
8
+ define( 'IFRAME_REQUEST' , true );
9
+
10
+ // Load WordPress Administration Bootstrap
11
+ require_once('../../../wp-admin/admin.php');
12
+
13
+ if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
14
+ wp_die(__('You do not have permission to edit posts.'));
15
+
16
+ // Load all created shortodes
17
+ $sc_options = get_option('shortcoder_data');
18
+
19
+ if(empty($sc_options))
20
+ die();
21
+ ?>
22
+
23
+ <html>
24
+ <head>
25
+ <title>Shortcodes created</title>
26
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
27
+ <style type="text/css">
28
+ body{
29
+ font: 13px Arial, Helvetica, sans-serif;
30
+ padding: 10px;
31
+ }
32
+ h2{
33
+ font-size: 23px;
34
+ font-weight: normal;
35
+ }
36
+ h4{
37
+ margin: 0px 0px 10px;
38
+ }
39
+ hr{
40
+ border-width: 0px;
41
+ margin: 10px -10px;
42
+ border-bottom: 1px solid #dfdfdf;
43
+ }
44
+ .sc_wrap{
45
+ border: 1px solid #dfdfdf;
46
+ -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
47
+ -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
48
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
49
+ -moz-border-radius: 10px;
50
+ border-radius: 10px;
51
+ }
52
+ .sc_shortcode{
53
+ border-bottom: 1px solid #ccc;
54
+ padding: 0px;
55
+ -moz-border-radius: 10px;
56
+ border-radius: 10px;
57
+ }
58
+ .sc_shortcode_name{
59
+ cursor: pointer;
60
+ padding: 10px;
61
+ }
62
+ .sc_params{
63
+ border: 1px solid #dfdfdf;
64
+ background: #F9F9F9;
65
+ margin: 2px 10px 10px;
66
+ padding: 10px;
67
+ display: none;
68
+ -moz-border-radius: 5px;
69
+ border-radius: 5px;
70
+ }
71
+ .sc_insert{
72
+ -moz-border-radius:20px;
73
+ -webkit-border-radius:20px;
74
+ border-radius:20px;
75
+ -moz-box-shadow:1px 1px 2px rgba(0, 0, 0, 0.5);
76
+ -webkit-box-shadow:1px 1px 2px rgba(0, 0, 0, 0.5);
77
+ box-shadow:1px 1px 2px rgba(0, 0, 0, 0.5);
78
+ background: -moz-linear-gradient(19% 65% 90deg,#0087B4, #0099CC, #0099CC 51%);
79
+ background: -webkit-gradient(linear, 0% 45%, 0% 60%, from(#0099CC), to(#0087B4));
80
+ color:#FFFFFF;
81
+ padding:2px 15px;
82
+ text-shadow:0 1px 1px rgba(0, 0, 0, 0.5);
83
+ border: 1px solid #267ed4;
84
+ font-weight: bold;
85
+ }
86
+
87
+ .sc_insert:hover{
88
+ background: -moz-linear-gradient(19% 65% 90deg,#0082AD, #0099CC, #0099CC 51%);
89
+ background: -webkit-gradient(linear, 0% 45%, 0% 60%, from(#0099CC), to(#0082AD));
90
+ color: #f1f1f1;
91
+ }
92
+ input[type=text], textarea{
93
+ padding: 5px;
94
+ border: 1px solid #ccc;
95
+ box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1);
96
+ -moz-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1);
97
+ -webkit-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1);
98
+ -moz-border-radius: 5px;
99
+ border-radius: 5px;
100
+ width: 120px;
101
+ margin: 0px 25px 10px 0px;
102
+ cursor: pointer;
103
+ }
104
+ .sc_toggle{
105
+ background: url(images/toggle-arrow.png) no-repeat;
106
+ float: right;
107
+ width: 16px;
108
+ height: 16px;
109
+ opacity: 0.4;
110
+ }
111
+
112
+ .sc_share_iframe{
113
+ background: #FFFFFF;
114
+ border: 1px solid #dfdfdf;
115
+ -webkit-border-radius: 5px;
116
+ -moz-border-radius: 5px;
117
+ border-radius: 5px;
118
+ -moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
119
+ -webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
120
+ box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
121
+ }
122
+ .sc_credits{
123
+ background: url(images/aw.png) no-repeat;
124
+ padding-left: 23px;
125
+ color: #8B8B8B;
126
+ margin-left: -5px;
127
+ font-size: 13px;
128
+ text-decoration: none;
129
+ }
130
+ </style>
131
+ <script type="text/javascript">
132
+ $(document).ready(function(){
133
+
134
+ $('.sc_shortcode_name').append('<span class="sc_toggle"></span>');
135
+
136
+ $('.sc_insert').click(function(){
137
+ var params = '';
138
+ var scname = $(this).attr('data-name');
139
+ var sc = '';
140
+
141
+ $(this).parent().children().find('input[type="text"]').each(function(){
142
+ if($(this).val() != ''){
143
+ attr = $(this).attr('data-param');
144
+ val = $(this).val();
145
+ params += attr + '="' + val + '" ';
146
+ }
147
+ });
148
+
149
+ if(wsc(scname)){
150
+ name = '"' + scname + '"';
151
+ }else{
152
+ name = scname;
153
+ }
154
+ sc = '[sc:' + name + ' ' + params + ']';
155
+ parent.send_to_editor(sc);
156
+ });
157
+
158
+ $('.sc_share_bar img').mouseenter(function(){
159
+ $this = $(this);
160
+ $('.sc_share_iframe').remove();
161
+ $('body').append('<iframe class="sc_share_iframe"></iframe>');
162
+ $('.sc_share_iframe').css({
163
+ position: 'absolute',
164
+ top: $this.offset()['top'] - $this.attr('data-height') - 15,
165
+ left: $this.offset()['left'] - $this.attr('data-width')/2 ,
166
+ width: $this.attr('data-width'),
167
+ height: $this.attr('data-height'),
168
+ }).attr('src', $this.attr('data-url')).hide().fadeIn();
169
+
170
+ });
171
+
172
+ $('.sc_shortcode_name').click(function(e){
173
+ $('.sc_params').slideUp();
174
+ if($(this).next('.sc_params').is(':visible')){
175
+ $(this).next('.sc_params').slideUp();
176
+ }else{
177
+ $(this).next('.sc_params').slideDown();
178
+ }
179
+ })
180
+
181
+ });
182
+
183
+ var sc_closeiframe = function(){
184
+ $('.sc_share_iframe').remove();
185
+ }
186
+
187
+ function wsc(s){
188
+ if(s == null)
189
+ return '';
190
+ return s.indexOf(' ') >= 0;
191
+ }
192
+ </script>
193
+ </head>
194
+ <body>
195
+ <?php sc_admin_buttons('fbrec'); ?>
196
+ <h2><img src="images/shortcoder.png" align="absmiddle" alt="Shortcoder" width="35px"/> List of Shortcodes created</h2>
197
+
198
+ <div class="sc_wrap">
199
+ <?php
200
+ foreach($sc_options as $key=>$value){
201
+ if($key != '_version_fix'){
202
+ echo '<div class="sc_shortcode"><div class="sc_shortcode_name">' . $key;
203
+ echo '</div>';
204
+ preg_match_all('/%[^%\s]+%/', $value['content'], $matches);
205
+ echo '<div class="sc_params">';
206
+ if(!empty($matches[0])){
207
+ echo '<h4>Available parameters: </h4>';
208
+ $temp = array();
209
+ foreach($matches[0] as $k=>$v){
210
+ $cleaned = str_replace('%', '', $v);
211
+ if(!in_array($cleaned, $temp)){
212
+ array_push($temp, $cleaned);
213
+ echo '<label>' . $cleaned . ': <input type="text" data-param="' . $cleaned . '"/></label> ';
214
+ }
215
+ }
216
+ echo'<hr/>';
217
+ }else{
218
+ echo 'No parameters avaialble - ';
219
+ }
220
+ echo '<input type="button" class="sc_insert cupid-blue" data-name="' . $key . '" value="Insert Shortcode"/>';
221
+ echo '</div>';
222
+ echo '</div>';
223
+ }
224
+ }
225
+ ?>
226
+ </div>
227
+
228
+ <p class="sc_share_bar" align="center">
229
+ <img class="sc_donate" src="images/donate.png" data-width="300" data-height="220" data-url="<?php echo SC_URL . 'js/share.php?i=1'; ?>"/>
230
+ &nbsp;&nbsp;&nbsp;
231
+ <img class="sc_share" src="images/share.png" data-width="350" data-height="85" data-url="<?php echo SC_URL . 'js/share.php?i=2'; ?>"/>
232
+ </p>
233
+
234
+ <p align="center"><a class="sc_credits" href="http://www.aakashweb.com/" target="_blank">a Aakash Web plugin</a></p>
235
+
236
+
237
+ <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=vaakash"></script>
238
+ </body>
239
+ </html>
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.png ADDED
Binary file
screenshot-4.png ADDED
Binary file
shortcoder.php ADDED
@@ -0,0 +1,335 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Shortcoder
4
+ Plugin URI: http://www.aakashweb.com
5
+ Description: Shortcoder is a plugin which allows to create a custom shortcode and store HTML, Javascript and other snippets in it. So if that shortcode is used in any post or pages, then the code stored in the shortcode get exceuted in that place.
6
+ Author: Aakash Chakravarthy
7
+ Version: 3.0
8
+ Author URI: http://www.aakashweb.com/
9
+ */
10
+
11
+ if(!defined('WP_CONTENT_URL')) {
12
+ $sc_url = get_option('siteurl') . '/wp-content/plugins/' . plugin_basename(dirname(__FILE__)).'/';
13
+ }else{
14
+ $sc_url = WP_CONTENT_URL . '/plugins/' . plugin_basename(dirname(__FILE__)) . '/';
15
+ }
16
+
17
+ define('SC_VERSION', '3.0');
18
+ define('SC_AUTHOR', 'Aakash Chakravarthy');
19
+ define('SC_URL', $sc_url);
20
+
21
+ $sc_donate_link = 'http://bit.ly/scdonate';
22
+
23
+ // Load languages
24
+ load_plugin_textdomain('sc', false, basename(dirname(__FILE__)) . '/languages/');
25
+
26
+ // Add admin menu
27
+ function sc_add_menu() {
28
+ add_menu_page('Shortcoder','Shortcoder','manage_options','shortcoder', 'sc_admin_page', SC_URL . 'images/shortcoder-2.png');
29
+ }
30
+
31
+ add_action('admin_menu','sc_add_menu');
32
+
33
+ // Load the Javascripts
34
+ function sc_admin_js(){
35
+ // Check whether the page is the Shortcoder admin page.
36
+ if (isset($_GET['page']) && $_GET['page'] == 'shortcoder'){
37
+ wp_enqueue_script(array(
38
+ 'jquery',
39
+ 'jquery-ui-core',
40
+ 'jquery-ui-draggable',
41
+ 'jquery-ui-droppable'
42
+ ));
43
+ wp_enqueue_script('shortcoder-admin-js', SC_URL . 'sc-admin-js.js');
44
+ wp_enqueue_script('shortcoder-nicedit-js', SC_URL . 'js/nicedit/nicEdit.js');
45
+ }
46
+ }
47
+ add_action('admin_print_scripts', 'sc_admin_js');
48
+
49
+ // Load the CSS
50
+ function sc_admin_css(){
51
+ if (isset($_GET['page']) && $_GET['page'] == 'shortcoder') {
52
+ wp_enqueue_style('shortcoder-admin-css', SC_URL . 'sc-admin-css.css');
53
+ }
54
+ }
55
+ add_action('admin_print_styles', 'sc_admin_css');
56
+
57
+ // Register the shortcode
58
+ add_shortcode('sc', 'shortcoder');
59
+
60
+ function shortcoder_all_ok($name){
61
+
62
+ $sc_options = get_option('shortcoder_data');
63
+
64
+ if($sc_options[$name]['disabled'] == 0){
65
+ if(current_user_can('level_10') && $sc_options[$name]['hide_admin'] == 1){
66
+ return false;
67
+ }else{
68
+ return true;
69
+ }
70
+ }else{
71
+ return false;
72
+ }
73
+ }
74
+
75
+ // Main function
76
+ function shortcoder($atts, $content) {
77
+
78
+ $sc_options = get_option('shortcoder_data');
79
+
80
+ // Get the Shortcode name
81
+ if(isset($atts[0])){
82
+ $sc_name = str_replace(array('"', "'", ":"), '', $atts[0]);
83
+ unset($atts[0]);
84
+ }else{
85
+ // Old version with "name" param support
86
+ if(array_key_exists("name", $atts)){
87
+ $tVal = $atts['name'];
88
+ if(array_key_exists($tVal, $sc_options)){
89
+ $sc_name = $tVal;
90
+ unset($atts['name']);
91
+ }
92
+ }
93
+ }
94
+
95
+ if(!isset($sc_name)){
96
+ return '';
97
+ }
98
+
99
+ // Check whether shortcoder can execute
100
+ if(shortcoder_all_ok($sc_name)){
101
+
102
+ // If SC has parameters, then replace it
103
+ if(!empty($atts)){
104
+ $keys = array();
105
+ $values = array();
106
+ $i = 0;
107
+
108
+ // Seperate Key and value from atts
109
+ foreach($atts as $k=>$v){
110
+ if($k !== 0){
111
+ $keys[$i] = "%" . $k . "%";
112
+ $values[$i] = $v;
113
+ }
114
+ $i++;
115
+ }
116
+
117
+ // Replace the params
118
+ $sc_content = $sc_options[$sc_name]['content'];
119
+ $sc_content_rep1 = str_replace($keys, $values, $sc_content);
120
+ $sc_content_rep2 = preg_replace('/%[^%\s]+%/', '', $sc_content_rep1);
121
+ return "<!-- Start Shortcoder content -->" . $sc_content_rep2 . "<!-- End Shortcoder content -->";
122
+ }
123
+ else{
124
+
125
+ // If the SC has no params, then replace the %vars%
126
+ $sc_content = $sc_options[$sc_name]['content'];
127
+ $sc_content_rep = preg_replace('/%[^%\s]+%/', '', $sc_content);
128
+ return "<!-- Start Shortcoder content -->" . $sc_content_rep . "<!-- End Shortcoder content -->";
129
+ }
130
+
131
+ }else{
132
+ return '';
133
+ }
134
+ }
135
+
136
+ // Shortcoder admin page
137
+ function sc_admin_page(){
138
+
139
+ $sc_updated = false;
140
+ $sc_options = get_option('shortcoder_data');
141
+
142
+ // Old version fix
143
+ if(!isset($sc_options['_version_fix'])){
144
+ $temp = array();
145
+ if(!empty($sc_options)){
146
+ for($i=0; $i<=20; $i++){
147
+ $name = $sc_options[$i]['sc_name'];
148
+ $cnt = $sc_options[$i]['sc_content'];
149
+ $disable = $sc_options[$i]['sc_disable'];
150
+ $admin = $sc_options[$i]['sc_is_admin'];
151
+ if(isset($name)){
152
+ $temp[$name]['content'] = $cnt;
153
+ $temp[$name]['disabled'] = $disable;
154
+ $temp[$name]['hide_admin'] = $admin;
155
+ }
156
+ }
157
+ }
158
+ unset($sc_options);
159
+ $sc_options = $temp;
160
+ unset($temp);
161
+ $sc_options['_version_fix'] = 1;
162
+ update_option("shortcoder_data", $sc_options);
163
+ }
164
+
165
+ $title = "Create a Shortcode";
166
+ $button = "Create Shortcode";
167
+ $sc_content = '';
168
+ $sc_disable = 0;
169
+ $sc_hide_admin = 0;
170
+
171
+ // Insert shortcode
172
+ if (isset($_POST["sc_form_main"]) && $_POST["sc_form_main"] == '1' && check_admin_referer('shortcoder_create_form')){
173
+ $sc_options = get_option('shortcoder_data');
174
+ $sc_name = stripslashes($_POST['sc_name']);
175
+
176
+ $sc_options[$sc_name] = array(
177
+ 'content' => stripslashes($_POST['sc_content']),
178
+ 'disabled' => intval($_POST['sc_disable']),
179
+ 'hide_admin' => intval($_POST['sc_hide_admin'])
180
+ );
181
+
182
+ // Updating the DB
183
+ update_option("shortcoder_data", $sc_options);
184
+ $sc_updated = true;
185
+
186
+ // Insert Message
187
+ if($sc_updated == 'true'){
188
+ echo '<div class="message updated fade"><p>' . __('Shortcode updated successfully !', 'sc') . '</p></div>';
189
+ }else{
190
+ echo '<div class="message error fade"><p>' . __('Unable to create shortcode !', 'sc') . '</p></div>';
191
+ }
192
+ }
193
+
194
+ // Edit shortcode
195
+ if (isset($_POST["sc_form_edit"]) && $_POST["sc_form_edit"] == '1' && check_admin_referer('shortcoder_edit_form')){
196
+ $sc_options = get_option('shortcoder_data');
197
+ $sc_name_edit = stripslashes($_POST['sc_name_edit']);
198
+
199
+ if($_POST["sc_form_action"] == "edit"){
200
+ $sc_content = stripslashes($sc_options[$sc_name_edit]['content']);
201
+ $sc_disable = $sc_options[$sc_name_edit]['disabled'];
202
+ $sc_hide_admin = $sc_options[$sc_name_edit]['hide_admin'];
203
+
204
+ $title = "Edit this Shortcode - " . '<small>' . $sc_name_edit . '</small>';
205
+ $button = "Update Shortcode";
206
+ $edit = 1;
207
+ }else{
208
+ unset($sc_options[$sc_name_edit]);
209
+ unset($sc_name_edit);
210
+ update_option("shortcoder_data", $sc_options);
211
+ echo '<div class="message updated fade"><p>' . __('Shortcode deleted successfully !', 'sc') . '</p></div>';
212
+ }
213
+ }
214
+
215
+ ?>
216
+
217
+ <!-- Shortcoder Admin page -->
218
+
219
+ <div class="wrap">
220
+ <?php sc_admin_buttons('fbrec'); ?>
221
+ <h2><img width="32" height="32" src="<?php echo SC_URL; ?>images/shortcoder.png" align="absmiddle"/> Shortcoder<span class="smallText"> v<?php echo SC_VERSION; ?></span></h2>
222
+
223
+ <ul class="sc_share_wrap">
224
+ <li class="sc_donate" data-width="300" data-height="220" data-url="<?php echo SC_URL . 'js/share.php?i=1'; ?>"><a href="#"></a></li>
225
+ <li class="sc_share" data-width="350" data-height="85" data-url="<?php echo SC_URL . 'js/share.php?i=2'; ?>"><a href="#"></a></li>
226
+ </ul>
227
+
228
+ <div id="content">
229
+ <h3><?php echo $title; ?></h3>
230
+ <?php if($edit == 1) echo '<span class="sc_back">&lt;&lt; Back</span>'; ?>
231
+
232
+ <form method="post" id="sc_form">
233
+ <label>Name: <input type="text" name="sc_name" id="sc_name" value="<?php echo $sc_name_edit; ?>" placeholder="Enter a shortcode name"/></label>
234
+ <div id="sc_code"></div>
235
+ <label for="sc_content">Content:</label>
236
+ <ul class="sc_switch_editor"><li class="sc_editor_html">HTML</li><li class="sc_editor_visual">Visual</li></ul>
237
+ <div id="sc_editor"><textarea name="sc_content" id="sc_content" placeholder="Enter the shortcode content here. " rows="6"><?php echo $sc_content; ?></textarea></div>
238
+
239
+ <div id="sc_settings">
240
+ <label class="smallText"><input name="sc_disable" id="sc_disable" type="checkbox" value="1" <?php echo $sc_disable == "1" ? 'checked="checked"' : ""; ?>/> Temporarily disable this shortcode</label><br />
241
+ <label class="smallText"><input name="sc_hide_admin" id="sc_hide_admin" type="checkbox" value="1" <?php echo $sc_hide_admin == "1" ? 'checked="checked"' : ""; ?>/> Disable this Shortcode to admins</label>
242
+ <input id="sc_submit" type="submit" name="sc_submit" value="<?php echo $button; ?>" />
243
+ </div>
244
+
245
+ <?php wp_nonce_field('shortcoder_create_form'); ?>
246
+ <input name="sc_form_main" type="hidden" value="1" />
247
+ <small class="grey">Note: Use <strong>%someParameter%</strong> to insert custom parameters. <a href="http://www.aakashweb.com/wordpress-plugins/shortcoder/" target="_blank">Learn More</a>.</small>
248
+ </form>
249
+
250
+ <h3>Created shortcodes <small>(Click to edit)</small></h3>
251
+ <form method="post" id="sc_edit_form">
252
+ <ul id="sc_list" class="clearfix">
253
+ <?php
254
+ $sc_options = get_option('shortcoder_data');
255
+ foreach($sc_options as $key=>$value){
256
+ if($key != '_version_fix')
257
+ echo '<li>' . $key . '</li>';
258
+ }
259
+ ?>
260
+ </ul>
261
+
262
+ <?php wp_nonce_field('shortcoder_edit_form'); ?>
263
+ <input name="sc_form_edit" type="hidden" value="1" />
264
+ <input name="sc_form_action" id="sc_form_action" type="hidden" value="edit" />
265
+ <input name="sc_name_edit" id="sc_name_edit" type="hidden" />
266
+ </form>
267
+
268
+ <div id="sc_delete" title="Drag & drop shortcodes to delete"></div>
269
+ </div><!-- Content -->
270
+
271
+ <p align="center"><a href="http://www.aakashweb.com/forum/" target="_blank">Report bugs</a> | <a href="http://www.aakashweb.com/forum/" target="_blank">Support Forum</a> | <a href="http://www.aakashweb.com/wordpress-plugins/shortcoder/" target="_blank">Documentation</a> | <a href="http://www.aakashweb.com/wordpress-plugins/shortcoder/" target="_blank">Help</a> | <a href="http://bit.ly/scdonate" target="_blank">Donate</a><br/><br/>
272
+ <a href="#" class="sc_open_video">(Demo video)</a><br /><br />
273
+ <a href="https://twitter.com/vaakash" target="_blank" class="twitter-follow-button" data-show-count="false" data-width="130px" data-align="center">Follow @vaakash</a><br/><br/>
274
+ <a href="http://www.aakashweb.com/" target="_blank" class="sc_credits">a Aakash Web plugin</a></p>
275
+ <span class="sc_hidden_text"><?php echo SC_URL.'js/nicedit/nicEditorIcons.gif'; ?></span>
276
+
277
+ </div><!-- Wrap -->
278
+
279
+ <?php
280
+ }
281
+
282
+ function sc_admin_footer(){
283
+ if(in_array($GLOBALS['pagenow'], array('post.php', 'post-new.php'))){
284
+ echo '<span id="sc_editorUrl" style="display:none;">' . SC_URL . 'sc-editor.php</span>';
285
+ }
286
+ }
287
+ add_action('admin_footer', 'sc_admin_footer');
288
+
289
+ function sc_admin_buttons($type){
290
+ switch($type){
291
+ case 'fbrec':
292
+ echo '<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Ffacebook.com%2Faakashweb&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=true&amp;action=recommend&amp;colorscheme=light&amp;font=arial&amp;height=21&amp;appId=106994469342299" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width: 126px; height:21px;float: right;margin-top: 15px;" allowtransparency="true"></iframe>';
293
+ break;
294
+ }
295
+ }
296
+
297
+ // Action Links
298
+ function sc_plugin_actions($links, $file){
299
+ static $this_plugin;
300
+ global $sc_donate_link;
301
+
302
+ if(!$this_plugin) $this_plugin = plugin_basename(__FILE__);
303
+ if( $file == $this_plugin ){
304
+ $settings_link = "<a href='$sc_donate_link' title='If you like this plugin, then just make a small Donation to continue this plugin development.' target='_blank'>" . __('Make Donations', 'hja') . '</a> ';
305
+ $links = array_merge(array($settings_link), $links);
306
+ }
307
+ return $links;
308
+ }
309
+ add_filter('plugin_action_links', 'sc_plugin_actions', 10, 2);
310
+
311
+ // Shortcoder tinyMCE buttons
312
+ function sc_addbuttons() {
313
+ if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
314
+ return;
315
+
316
+ if ( get_user_option('rich_editing') == 'true') {
317
+ add_filter("mce_external_plugins", "sc_add_tinymce_plugin");
318
+ add_filter('mce_buttons', 'sc_register_button');
319
+ }
320
+ }
321
+
322
+ function sc_register_button($buttons) {
323
+ array_push($buttons, "|", "scbutton");
324
+ return $buttons;
325
+ }
326
+
327
+ function sc_add_tinymce_plugin($plugin_array) {
328
+ $plugin_array['scbutton'] = SC_URL . 'js/tinymce/editor_plugin.js';
329
+ return $plugin_array;
330
+ }
331
+
332
+ // init process for button control
333
+ add_action('init', 'sc_addbuttons');
334
+
335
+ ?>