Version Description
- Updated caching mechanism. Cache will be reseted when you add or remove terms
- Updated galleries mechanism. Removed some conflicts
- Fixed spoiler background for style=fancy
- Additional access check option for Shortcode Generator
Download this release
Release Info
Developer | gn_themes |
Plugin | Shortcodes Ultimate |
Version | 4.1.1 |
Comparing to | |
See all releases |
Code changes from version 4.1.0 to 4.1.1
- assets/css/box-shortcodes.css +1 -0
- assets/js/jsrender.js +4 -0
- assets/js/options-page.js +20 -31
- inc/core/class.assets.php +4 -2
- inc/core/class.generator.php +22 -4
- inc/core/tools.php +1 -1
- inc/views/galleries.php +7 -8
- readme.txt +6 -0
- shortcodes-ultimate.php +1 -1
assets/css/box-shortcodes.css
CHANGED
@@ -115,6 +115,7 @@
|
|
115 |
color: #333;
|
116 |
}
|
117 |
.su-spoiler-style-fancy {
|
|
|
118 |
border: 1px solid #ccc;
|
119 |
-webkit-border-radius: 10px;
|
120 |
-moz-border-radius: 10px;
|
115 |
color: #333;
|
116 |
}
|
117 |
.su-spoiler-style-fancy {
|
118 |
+
background: #fff;
|
119 |
border: 1px solid #ccc;
|
120 |
-webkit-border-radius: 10px;
|
121 |
-moz-border-radius: 10px;
|
assets/js/jsrender.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/*! JsRender v1.0.0-beta: http://github.com/BorisMoore/jsrender and http://jsviews.com/jsviews
|
2 |
+
informal pre V1.0 commit counter: 42 */
|
3 |
+
(function(n,t,i){"use strict";function it(n,t){t&&t.onError&&t.onError(n)===!1||(this.name="JsRender Error",this.message=n||"JsRender error")}function o(n,t){var i;n=n||{};for(i in t)n[i]=t[i];return n}function ct(n,t,i){return(!k.rTag||arguments.length)&&(v=n?n.charAt(0):v,y=n?n.charAt(1):y,f=t?t.charAt(0):f,h=t?t.charAt(1):h,w=i||w,n="\\"+v+"(\\"+w+")?\\"+y,t="\\"+f+"\\"+h,a="(?:(?:(\\w+(?=[\\/\\s\\"+f+"]))|(?:(\\w+)?(:)|(>)|!--((?:[^-]|-(?!-))*)--|(\\*)))\\s*((?:[^\\"+f+"]|\\"+f+"(?!\\"+h+"))*?)",k.rTag=a+")",a=new RegExp(n+a+"(\\/)?|(?:\\/(\\w+)))"+t,"g"),et=new RegExp("<.*>|([^\\\\]|^)[{}]|"+n+".*"+t)),[v,y,f,h,w]}function ei(n,t){t||(t=n,n=i);var e,f,o,u,r=this,s=!t||t==="root";if(n){if(u=r.type===t?r:i,!u)if(e=r.views,r._.useKey){for(f in e)if(u=e[f].get(n,t))break}else for(f=0,o=e.length;!u&&f<o;f++)u=e[f].get(n,t)}else if(s)while(r.parent.parent)u=r=r.parent;else while(r&&!u)u=r.type===t?r:i,r=r.parent;return u}function lt(){var n=this.get("item");return n?n.index:i}function oi(n,t){var u,f=this,r=t&&t[n]||(f.ctx||{})[n];return r=r===i?f.getRsc("helpers",n):r,r&&typeof r=="function"&&(u=function(){return r.apply(f,arguments)},o(u,r)),u||r}function si(n,t,u){var h,f,s,e=+u===u&&u,o=t.linkCtx;return e&&(u=(e=t.tmpl.bnds[e-1])(t.data,t,r)),s=u.args[0],(n||e)&&(f=o&&o.tag||{_:{inline:!o,bnd:e},tagName:n+":",flow:!0,_is:"tag"},o&&(o.tag=f,f.linkCtx=f.linkCtx||o,u.ctx=l(u.ctx,o.view.ctx)),f.tagCtx=u,u.view=t,f.ctx=u.ctx||{},delete u.ctx,t._.tag=f,n=n!=="true"&&n,n&&((h=t.getRsc("converters",n))||c("Unknown converter: {{"+n+":"))&&(f.depends=h.depends,s=h.apply(f,u.args)),s=e&&t._.onRender?t._.onRender(s,t,e):s,t._.tag=i),s}function hi(n,t){for(var e=this,u=r[n],f=u&&u[t];f===i&&e;)u=e.tmpl[n],f=u&&u[t],e=e.parent;return f}function ci(n,t,u,f,s){var et,h,ot,it,g,v,ut,p,a,nt,k,st,w,ft,b="",tt=+f===f&&f,y=t.linkCtx||0,d=t.ctx,ht=u||t.tmpl,ct=t._;for(n._is==="tag"&&(h=n,n=h.tagName),tt&&(f=(st=ht.bnds[tt-1])(t.data,t,r)),ut=f.length,h=h||y.tag,v=0;v<ut;v++)a=f[v],k=a.tmpl,k=a.content=k&&ht.tmpls[k-1],u=a.props.tmpl,v||u&&h||(w=t.getRsc("tags",n)||c("Unknown tag: {{"+n+"}}")),u=u||(h?h:w).template||k,u=""+u===u?t.getRsc("templates",u)||e(u):u,o(a,{tmpl:u,render:rt,index:v,view:t,ctx:l(a.ctx,d)}),h||(w._ctr?(h=new w._ctr,ft=!!h.init,h.attr=h.attr||w.attr||i):h={render:w.render},h._={inline:!y},y&&(y.attr=h.attr=y.attr||h.attr,y.tag=h,h.linkCtx=y),(h._.bnd=st||y.fn)?h._.arrVws={}:h.dataBoundOnly&&c("{^{"+n+"}} tag must be data-bound"),h.tagName=n,h.parent=g=d&&d.tag,h._is="tag",h._def=w),ct.tag=h,a.tag=h,h.tagCtxs=f,h.flow||(nt=a.ctx=a.ctx||{},ot=h.parents=nt.parentTags=d&&l(nt.parentTags,d.parentTags)||{},g&&(ot[g.tagName]=g),nt.tag=h);for(h.rendering={},v=0;v<ut;v++)a=h.tagCtx=f[v],h.ctx=a.ctx,!v&&ft&&(h.init(a,y,h.ctx),ft=i),p=i,(et=h.render)&&(p=et.apply(h,a.args)),p=p!==i?p:a.tmpl&&a.render()||(s?i:""),b=b?b+(p||""):p;return delete h.rendering,h.tagCtx=h.tagCtxs[0],h.ctx=h.tagCtx.ctx,h._.inline&&(it=h.attr)&&it!=="html"&&(b=it==="text"?wt.html(b):""),tt&&t._.onRender?t._.onRender(b,t,tt):b}function b(n,t,r,u,f,e,o,s){var c,l,a,y=t==="array",v={key:0,useKey:y?0:1,id:""+fi++,onRender:s,bnds:{}},h={data:u,tmpl:f,content:o,views:y?[]:{},parent:r,ctx:n,type:t,get:ei,getIndex:lt,getRsc:hi,hlp:oi,_:v,_is:"view"};return r&&(c=r.views,l=r._,l.useKey?(c[v.key="_"+l.useKey++]=h,a=l.tag,v.bnd=y&&(!a||!!a._.bnd&&a)):c.splice(v.key=h.index=e!==i?e:c.length,0,h),h.ctx=n||r.ctx),h}function li(n){var t,i,r,u,f;for(t in p)if(u=p[t],(f=u.compile)&&(i=n[t+"s"]))for(r in i)i[r]=f(r,i[r],n,t,u)}function ai(n,t,i){var u,r;return typeof t=="function"?t={depends:t.depends,render:t}:((r=t.template)&&(t.template=""+r===r?e[r]||e(r):r),t.init!==!1&&(u=t._ctr=function(){},(u.prototype=t).constructor=u)),i&&(t._parentTmpl=i),t}function at(r,u,f,o,s,h){function v(i){if(""+i===i||i.nodeType>0){try{a=i.nodeType>0?i:!et.test(i)&&t&&t(n.document).find(i)[0]}catch(u){}return a&&(i=a.getAttribute(ht),r=r||i,i=e[i],i||(r=r||"_"+ui++,a.setAttribute(ht,r),i=e[r]=at(r,a.innerHTML,f,o,s,h))),i}}var c,a;return u=u||"",c=v(u),h=h||(u.markup?u:{}),h.tmplName=r,f&&(h._parentTmpl=f),!c&&u.markup&&(c=v(u.markup))&&c.fn&&(c.debug!==u.debug||c.allowCode!==u.allowCode)&&(c=c.markup),c!==i?(r&&!f&&(tt[r]=function(){return u.render.apply(u,arguments)}),c.fn||u.fn?c.fn&&(u=r&&r!==c.tmplName?l(h,c):c):(u=vt(c,h),ut(c,u)),li(h),u):void 0}function vt(n,t){var i,f=d.wrapMap||{},r=o({markup:n,tmpls:[],links:{},tags:{},bnds:[],_is:"template",render:rt},t);return t.htmlTag||(i=ii.exec(n),r.htmlTag=i?i[1].toLowerCase():""),i=f[r.htmlTag],i&&i!==f.div&&(r.markup=u.trim(r.markup),r._elCnt=!0),r}function vi(n,t){function u(e,o,s){var l,h,a,c;if(e&&""+e!==e&&!e.nodeType&&!e.markup){for(a in e)u(a,e[a],o);return r}return o===i&&(o=e,e=i),e&&""+e!==e&&(s=o,o=e,e=i),c=s?s[f]=s[f]||{}:u,h=t.compile,(l=k.onBeforeStoreItem)&&(h=l(c,e,o,h)||h),e?o===null?delete c[e]:c[e]=h?o=h(e,o,s,n,t):o:o=h(i,o),h&&o&&(o._is=n),(l=k.onStoreItem)&&l(c,e,o,h),o}var f=n+"s";r[f]=u,p[n]=t}function rt(n,t,f,o,s,h){var w,ut,nt,y,tt,it,rt,k,p,ft,d,et,v,a=this,ot=!a.attr||a.attr==="html",g="";if(o===!0&&(rt=!0,o=0),a.tag?(k=a,a=a.tag,ft=a._,et=a.tagName,v=k.tmpl,t=l(t,a.ctx),p=k.content,k.props.link===!1&&(t=t||{},t.link=!1),f=f||k.view,n=n===i?f:n):v=a.jquery&&(a[0]||c('Unknown template: "'+a.selector+'"'))||a,v&&(!f&&n&&n._is==="view"&&(f=n),f&&(p=p||f.content,h=h||f._.onRender,n===f&&(n=f.data,s=!0),t=l(t,f.ctx)),f&&f.data!==i||((t=t||{}).root=n),v.fn||(v=e[v]||e(v)),v)){if(h=(t&&t.link)!==!1&&ot&&h,d=h,h===!0&&(d=i,h=f._.onRender),u.isArray(n)&&!s)for(y=rt?f:o!==i&&f||b(t,"array",f,n,v,o,p,h),w=0,ut=n.length;w<ut;w++)nt=n[w],tt=b(t,"item",y,nt,v,(o||0)+w,p,h),it=v.fn(nt,tt,r),g+=y._.onRender?y._.onRender(it,tt):it;else y=rt?f:b(t,et||"data",f,n,v,o,p,h),ft&&!a.flow&&(y.tag=a),g+=v.fn(n,y,r);return d?d(g,y):g}return""}function c(n){throw new r.sub.Error(n);}function s(n){c("Syntax error\n"+n)}function ut(n,t,i,r){function v(t){t-=f,t&&h.push(n.substr(f,t).replace(nt,"\\n"))}function c(t){t&&s('Unmatched or missing tag: "{{/'+t+'}}" in template:\n'+n)}function y(e,a,y,w,b,k,d,g,tt,it,rt,ut){k&&(b=":",w="html"),it=it||i;var at,st,ht=a&&[],ot="",et="",ct="",lt=!it&&!b&&!d;y=y||b,v(ut),f=ut+e.length,g?p&&h.push(["*","\n"+tt.replace(dt,"$1")+"\n"]):y?(y==="else"&&(ti.test(tt)&&s('for "{{else if expr}}" use "{{else expr}}"'),ht=u[6],u[7]=n.substring(u[7],ut),u=o.pop(),h=u[3],lt=!0),tt&&(tt=tt.replace(nt," "),ot=ft(tt,ht,t).replace(ni,function(n,t,i){return t?ct+=i+",":et+=i+",",""})),et=et.slice(0,-1),ot=ot.slice(0,-1),at=et&&et.indexOf("noerror:true")+1&&et||"",l=[y,w||!!r||"",ot,lt&&[],'params:"'+tt+'",props:{'+et+"}"+(ct?",ctx:{"+ct.slice(0,-1)+"}":""),at,ht||0],h.push(l),lt&&(o.push(u),u=l,u[7]=f)):rt&&(st=u[0],c(rt!==st&&st!=="else"&&rt),u[7]=n.substring(u[7],ut),u=o.pop()),c(!u&&rt),h=u[3]}var l,p=t&&t.allowCode,e=[],f=0,o=[],h=e,u=[,,,e];return n=n.replace(gt,"\\$&"),c(o[0]&&o[0][3].pop()[0]),n.replace(a,y),v(n.length),(f=e[e.length-1])&&c(""+f!==f&&+f[7]===f[7]&&f[0]),yt(e,i?n:t,i)}function yt(n,i,r){var c,f,e,l,a,y,st,ht,ct,lt,ft,p,o,et,v,tt,w,it,at,b,pt,wt,ot,rt,k,h=0,u="",g="",ut={},bt=n.length;for(""+i===i?(v=r?'data-link="'+i.replace(nt," ").slice(1,-1)+'"':i,i=0):(v=i.tmplName||"unnamed",i.allowCode&&(ut.allowCode=!0),i.debug&&(ut.debug=!0),p=i.bnds,et=i.tmpls),c=0;c<bt;c++)if(f=n[c],""+f===f)u+='\nret+="'+f+'";';else if(e=f[0],e==="*")u+=""+f[1];else{if(l=f[1],a=f[2],it=f[3],y=f[4],g=f[5],at=f[7],(wt=e==="else")||(h=0,p&&(o=f[6])&&(h=p.push(o))),(ot=e===":")?(l&&(e=l==="html"?">":l+e),g&&(rt="prm"+c,g="try{var "+rt+"=["+a+"][0];}catch(e){"+rt+'="";}\n',a=rt)):(it&&(tt=vt(at,ut),tt.tmplName=v+"/"+e,yt(it,tt),et.push(tt)),wt||(w=e,pt=u,u=""),b=n[c+1],b=b&&b[0]==="else"),y+=",args:["+a+"]}",ot&&o||l&&e!==">"){if(k=new Function("data,view,j,u"," // "+v+" "+h+" "+e+"\n"+g+"return {"+y+";"),k.paths=o,k._ctxs=e,r)return k;ft=1}if(u+=ot?"\n"+(o?"":g)+(r?"return ":"ret+=")+(ft?(ft=0,lt=!0,'c("'+l+'",view,'+(o?(p[h-1]=k,h):"{"+y)+");"):e===">"?(ht=!0,"h("+a+");"):(ct=!0,"(v="+a+")!="+(r?"=":"")+'u?v:"";')):(st=!0,"{view:view,tmpl:"+(it?et.length:"0")+","+y+","),w&&!b){if(u="["+u.slice(0,-1)+"]",(r||o)&&(u=new Function("data,view,j,u"," // "+v+" "+h+" "+w+"\nreturn "+u+";"),o&&((p[h-1]=u).paths=o),u._ctxs=e,r))return u;u=pt+'\nret+=t("'+w+'",view,this,'+(h||u)+");",o=0,w=0}}u="// "+v+"\nvar j=j||"+(t?"jQuery.":"js")+"views"+(ct?",v":"")+(st?",t=j._tag":"")+(lt?",c=j._cnvt":"")+(ht?",h=j.converters.html":"")+(r?";\n":',ret="";\n')+(d.tryCatch?"try{\n":"")+(ut.debug?"debugger;":"")+u+(r?"\n":"\nreturn ret;\n")+(d.tryCatch?"\n}catch(e){return j._err(e);}":"");try{u=new Function("data,view,j,u",u)}catch(kt){s("Compiled template code:\n\n"+u,kt)}return i&&(i.fn=u),u}function ft(n,t,i){function b(b,k,d,g,nt,tt,it,rt,et,ot,st,ht,ct,lt,at,vt,yt,pt,wt,kt){function gt(n,i,r,f,o,s,h){if(i&&(t&&(u==="linkTo"&&(e=t.to=t.to||[],e.push(nt)),(!u||l)&&t.push(nt)),i!==".")){var c=(r?'view.hlp("'+r+'")':f?"view":"data")+(h?(o?"."+o:r?"":f?"":"."+i)+(s||""):(h=r?"":f?o||"":i,""));return c=c+(h?"."+h:""),c.slice(0,9)==="view.data"?c.slice(5):c}return n}var dt;if(tt=tt||"",d=d||k||ht,nt=nt||et,ot=ot||yt||"",it)s(n);else return t&&vt&&!c&&!o&&(!u||l||e)&&(dt=p[r],kt.length-2>wt-dt&&(dt=kt.slice(dt,wt+1),vt=y+":"+dt+f,vt=w[vt]=w[vt]||ut(v+vt+h,i,!0),vt.paths||ft(dt,vt.paths=[],i),(e||t).push({_jsvOb:vt}))),c?(c=!ct,c?b:'"'):o?(o=!lt,o?b:'"'):(d?(r++,p[r]=wt++,d):"")+(pt?r?"":u?(u=l=e=!1,"\b"):",":rt?(r&&s(n),u=nt,l=g,"\b"+nt+":"):nt?nt.split("^").join(".").replace(bt,gt)+(ot?(a[++r]=!0,nt.charAt(0)!=="."&&(p[r]=wt),ot):tt):tt?tt:at?(a[r--]=!1,at)+(ot?(a[++r]=!0,ot):""):st?(a[r]||s(n),","):k?"":(c=ct,o=lt,'"'))}var u,e,l,w=i.links,a={},p={0:-1},r=0,o=!1,c=!1;return(n+" ").replace(kt,b)}function l(n,t){return n&&n!==t?t?o(o({},t),n):n:t&&o({},t)}function pt(n){return st[n]||(st[n]="&#"+n.charCodeAt(0)+";")}if((!t||!t.views)&&!n.jsviews){var u,g,a,et,v="{",y="{",f="}",h="}",w="^",bt=/^(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g,kt=/(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)([#~]?[\w$.^]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*!:?\/]|(=))\s*|([#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=\s*\.|\s*\^)|[)\]])([([]?))|(\s+)/g,nt=/[ \t]*(\r\n|\n|\r)/g,dt=/\\(['"])/g,gt=/['"\\]/g,ni=/\x08(~)?([^\x08]+)\x08/g,ti=/^if\s/,ii=/<(\w+)[>\s]/,ot=/[\x00`><"'&]/g,ri=ot,ui=0,fi=0,st={"&":"&","<":"<",">":">","\x00":"�","'":"'",'"':""","`":"`"},ht="data-jsv-tmpl",tt={},p={template:{compile:at},tag:{compile:ai},helper:{},converter:{}},r={jsviews:"v1.0.0-beta",render:tt,settings:{delimiters:ct,debugMode:!0,tryCatch:!0},sub:{View:b,Error:it,tmplFn:ut,parse:ft,extend:o,error:c,syntaxError:s},_cnvt:si,_tag:ci,_err:function(n){return d.debugMode?"Error: "+(n.message||n)+". ":""}};(it.prototype=new Error).constructor=it,lt.depends=function(){return[this.get("item"),"index"]};for(g in p)vi(g,p[g]);var e=r.templates,wt=r.converters,pi=r.helpers,yi=r.tags,k=r.sub,d=r.settings;t?(u=t,u.fn.render=rt):(u=n.jsviews={},u.isArray=Array&&Array.isArray||function(n){return Object.prototype.toString.call(n)==="[object Array]"}),u.render=tt,u.views=r,u.templates=e=r.templates,yi({"else":function(){},"if":{render:function(n){var t=this;return t.rendering.done||!n&&(arguments.length||!t.tagCtx.index)?"":(t.rendering.done=!0,t.selected=t.tagCtx.index,t.tagCtx.render())},onUpdate:function(n,t,i){for(var r,f,u=0;(r=this.tagCtxs[u])&&r.args.length;u++)if(r=r.args[0],f=!r!=!i[u].args[0],!!r||f)return f;return!1},flow:!0},"for":{render:function(n){var t=this,f=t.tagCtx,e=!arguments.length,r="",o=e||0;return t.rendering.done||(e?r=i:n!==i&&(r+=f.render(n),o+=u.isArray(n)?n.length:1),(t.rendering.done=o)&&(t.selected=f.index)),r},onArrayChange:function(n,t){var i,u=this,r=t.change;if(this.tagCtxs[1]&&(r==="insert"&&n.target.length===t.items.length||r==="remove"&&!n.target.length||r==="refresh"&&!t.oldItems.length!=!n.target.length))this.refresh();else for(i in u._.arrVws)i=u._.arrVws[i],i.data===n.target&&i._.onArrayChange.apply(i,arguments);n.done=!0},flow:!0},include:{flow:!0},"*":{render:function(n){return n},flow:!0}}),wt({html:function(n){return n!=i?String(n).replace(ri,pt):""},attr:function(n){return n!=i?String(n).replace(ot,pt):n===null?null:""},url:function(n){return n!=i?encodeURI(String(n)):n===null?null:""}}),ct()}})(this,this.jQuery);
|
4 |
+
//@ sourceMappingURL=jsrender.min.js.map
|
assets/js/options-page.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
// Wait DOM
|
2 |
-
jQuery(document).ready(function
|
3 |
|
4 |
// ########## Custom CSS screen ##########
|
5 |
|
@@ -10,7 +10,7 @@ jQuery(document).ready(function ($) {
|
|
10 |
var editor = ace.edit('sunrise-plugin-field-custom_css-editor'),
|
11 |
$textarea = $('#sunrise-plugin-field-custom_css').hide();
|
12 |
editor.getSession().setValue($textarea.val());
|
13 |
-
editor.getSession().on('change', function
|
14 |
$textarea.val(editor.getSession().getValue());
|
15 |
});
|
16 |
editor.getSession().setMode('ace/mode/css');
|
@@ -35,13 +35,13 @@ jQuery(document).ready(function ($) {
|
|
35 |
// ########## Galleries screen ##########
|
36 |
|
37 |
// Create new gallery
|
38 |
-
$('.su-gallery-create').click(function
|
39 |
// Prepare data
|
40 |
var $last = $('#su-galleries .su-gallery:last'),
|
41 |
id = ($last.length > 0) ? $last.data('id') + 1 : 0,
|
42 |
-
$gallery = $(
|
43 |
id: id
|
44 |
-
}));
|
45 |
// Hide not found message
|
46 |
$('#su-galleries-not-found').hide();
|
47 |
// Place new gallery
|
@@ -55,27 +55,27 @@ jQuery(document).ready(function ($) {
|
|
55 |
e.preventDefault();
|
56 |
});
|
57 |
// Open/close gallery
|
58 |
-
$('.su-gallery-open, .su-gallery-close').live('click', function
|
59 |
$(this).parents('.su-gallery').toggleClass('su-gallery-edit');
|
60 |
$(this).parents('.su-gallery').find('.su-gallery-image').removeClass('su-gallery-image-edit');
|
61 |
e.preventDefault();
|
62 |
});
|
63 |
// Close and save gallery
|
64 |
-
$('.su-gallery-save-close').live('click', function
|
65 |
$(this).parents('.su-gallery').removeClass('su-gallery-edit');
|
66 |
$(this).parents('.su-gallery').find('.su-gallery-image').removeClass('su-gallery-image-edit');
|
67 |
$('#sunrise-plugin-options-form').submit();
|
68 |
e.preventDefault();
|
69 |
});
|
70 |
// Image preview
|
71 |
-
$('.su-gallery-image-preview').live('click', function
|
72 |
$(this).magnificPopup({
|
73 |
type: 'image'
|
74 |
}).magnificPopup('open');
|
75 |
e.preventDefault();
|
76 |
});
|
77 |
// Delete gallery
|
78 |
-
$('.su-gallery-delete').live('click', function
|
79 |
var message = $('#su-galleries').data('delete-gallery-message');
|
80 |
if (confirm(message)) {
|
81 |
$(this).parents('.su-gallery').remove();
|
@@ -90,7 +90,7 @@ jQuery(document).ready(function ($) {
|
|
90 |
// Apply sortables
|
91 |
apply_sortable();
|
92 |
// Open/close image
|
93 |
-
$('.su-gallery-image-open, .su-gallery-image-title, .su-gallery-image-ok').live('click', function
|
94 |
var $image = $(this).parents('.su-gallery-image');
|
95 |
// Change image container class
|
96 |
$image.toggleClass('su-gallery-image-edit');
|
@@ -99,7 +99,7 @@ jQuery(document).ready(function ($) {
|
|
99 |
e.preventDefault();
|
100 |
});
|
101 |
// Delete image
|
102 |
-
$('.su-gallery-image-delete').live('click', function
|
103 |
// Get message
|
104 |
var message = $('#su-galleries').data('delete-image-message');
|
105 |
// Confirm deletion
|
@@ -116,14 +116,14 @@ jQuery(document).ready(function ($) {
|
|
116 |
items: '> .su-gallery-image',
|
117 |
handle: '.su-gallery-image-sort-handle',
|
118 |
axis: 'y',
|
119 |
-
stop: function
|
120 |
update_images();
|
121 |
}
|
122 |
});
|
123 |
}
|
124 |
|
125 |
function apply_uploads() {
|
126 |
-
$('.su-gallery-add-image:not(.su-gallery-add-image-ready) input:file').each(function
|
127 |
// Prepare data
|
128 |
var $container = $(this).parent(),
|
129 |
$gallery = $(this).parents('.su-gallery');
|
@@ -138,22 +138,22 @@ jQuery(document).ready(function ($) {
|
|
138 |
},
|
139 |
dataType: 'html',
|
140 |
autoUpload: true,
|
141 |
-
beforeSend: function
|
142 |
// Show loading animation
|
143 |
$container.addClass('su-gallery-image-uploading');
|
144 |
},
|
145 |
-
done: function
|
146 |
// Hide loading animation
|
147 |
$container.removeClass('su-gallery-image-uploading');
|
148 |
// Check result
|
149 |
if (data.result == '') return;
|
150 |
// Create new image section
|
151 |
-
var $image = $(
|
152 |
id: 999,
|
153 |
title: get_file_title(data.result),
|
154 |
gallery_id: $gallery.data('id'),
|
155 |
image: data.result
|
156 |
-
}));
|
157 |
// Append new image to gallery content
|
158 |
$container.after($image);
|
159 |
// Update images indexes
|
@@ -165,14 +165,14 @@ jQuery(document).ready(function ($) {
|
|
165 |
|
166 |
function update_images() {
|
167 |
// Loop through galleries
|
168 |
-
$('#su-galleries .su-gallery').each(function
|
169 |
// Prepare gallery data
|
170 |
var $gallery = $(this),
|
171 |
id = $gallery.data('id');
|
172 |
// Loop through images
|
173 |
-
$gallery.find('.su-gallery-image').each(function
|
174 |
// Loop through fields
|
175 |
-
$(this).find('[data-field]').each(function
|
176 |
$(this).attr('name', 'galleries[' + id + '][items][' + i + '][' + $(this).data('field') +
|
177 |
']')
|
178 |
});
|
@@ -187,15 +187,4 @@ jQuery(document).ready(function ($) {
|
|
187 |
if (url) return url.substring(url.lastIndexOf("/") + 1, url.lastIndexOf("."));
|
188 |
return "";
|
189 |
}
|
190 |
-
|
191 |
-
/* Tiny template system */
|
192 |
-
(function () {
|
193 |
-
var a = {};
|
194 |
-
this.tmpl = function b(c, d) {
|
195 |
-
var e = !/\W/.test(c) ? a[c] = a[c] || b(document.getElementById(c).innerHTML) : new Function("obj", "var p=[],print=function(){p.push.apply(p,arguments);};" + "with(obj){p.push('" +
|
196 |
-
c.replace(/[\r\t\n]/g, " ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g, "$1\r").replace(/\t=(.*?)%>/g, "',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'") +
|
197 |
-
"');}return p.join('');");
|
198 |
-
return d ? e(d) : e
|
199 |
-
}
|
200 |
-
})();
|
201 |
});
|
1 |
// Wait DOM
|
2 |
+
jQuery(document).ready(function($) {
|
3 |
|
4 |
// ########## Custom CSS screen ##########
|
5 |
|
10 |
var editor = ace.edit('sunrise-plugin-field-custom_css-editor'),
|
11 |
$textarea = $('#sunrise-plugin-field-custom_css').hide();
|
12 |
editor.getSession().setValue($textarea.val());
|
13 |
+
editor.getSession().on('change', function() {
|
14 |
$textarea.val(editor.getSession().getValue());
|
15 |
});
|
16 |
editor.getSession().setMode('ace/mode/css');
|
35 |
// ########## Galleries screen ##########
|
36 |
|
37 |
// Create new gallery
|
38 |
+
$('.su-gallery-create').click(function(e) {
|
39 |
// Prepare data
|
40 |
var $last = $('#su-galleries .su-gallery:last'),
|
41 |
id = ($last.length > 0) ? $last.data('id') + 1 : 0,
|
42 |
+
$gallery = $($.templates('#su_new_gallery_template').render([{
|
43 |
id: id
|
44 |
+
}]));
|
45 |
// Hide not found message
|
46 |
$('#su-galleries-not-found').hide();
|
47 |
// Place new gallery
|
55 |
e.preventDefault();
|
56 |
});
|
57 |
// Open/close gallery
|
58 |
+
$('.su-gallery-open, .su-gallery-close').live('click', function(e) {
|
59 |
$(this).parents('.su-gallery').toggleClass('su-gallery-edit');
|
60 |
$(this).parents('.su-gallery').find('.su-gallery-image').removeClass('su-gallery-image-edit');
|
61 |
e.preventDefault();
|
62 |
});
|
63 |
// Close and save gallery
|
64 |
+
$('.su-gallery-save-close').live('click', function(e) {
|
65 |
$(this).parents('.su-gallery').removeClass('su-gallery-edit');
|
66 |
$(this).parents('.su-gallery').find('.su-gallery-image').removeClass('su-gallery-image-edit');
|
67 |
$('#sunrise-plugin-options-form').submit();
|
68 |
e.preventDefault();
|
69 |
});
|
70 |
// Image preview
|
71 |
+
$('.su-gallery-image-preview').live('click', function(e) {
|
72 |
$(this).magnificPopup({
|
73 |
type: 'image'
|
74 |
}).magnificPopup('open');
|
75 |
e.preventDefault();
|
76 |
});
|
77 |
// Delete gallery
|
78 |
+
$('.su-gallery-delete').live('click', function(e) {
|
79 |
var message = $('#su-galleries').data('delete-gallery-message');
|
80 |
if (confirm(message)) {
|
81 |
$(this).parents('.su-gallery').remove();
|
90 |
// Apply sortables
|
91 |
apply_sortable();
|
92 |
// Open/close image
|
93 |
+
$('.su-gallery-image-open, .su-gallery-image-title, .su-gallery-image-ok').live('click', function(e) {
|
94 |
var $image = $(this).parents('.su-gallery-image');
|
95 |
// Change image container class
|
96 |
$image.toggleClass('su-gallery-image-edit');
|
99 |
e.preventDefault();
|
100 |
});
|
101 |
// Delete image
|
102 |
+
$('.su-gallery-image-delete').live('click', function(e) {
|
103 |
// Get message
|
104 |
var message = $('#su-galleries').data('delete-image-message');
|
105 |
// Confirm deletion
|
116 |
items: '> .su-gallery-image',
|
117 |
handle: '.su-gallery-image-sort-handle',
|
118 |
axis: 'y',
|
119 |
+
stop: function(event, ui) {
|
120 |
update_images();
|
121 |
}
|
122 |
});
|
123 |
}
|
124 |
|
125 |
function apply_uploads() {
|
126 |
+
$('.su-gallery-add-image:not(.su-gallery-add-image-ready) input:file').each(function() {
|
127 |
// Prepare data
|
128 |
var $container = $(this).parent(),
|
129 |
$gallery = $(this).parents('.su-gallery');
|
138 |
},
|
139 |
dataType: 'html',
|
140 |
autoUpload: true,
|
141 |
+
beforeSend: function() {
|
142 |
// Show loading animation
|
143 |
$container.addClass('su-gallery-image-uploading');
|
144 |
},
|
145 |
+
done: function(ev, data) {
|
146 |
// Hide loading animation
|
147 |
$container.removeClass('su-gallery-image-uploading');
|
148 |
// Check result
|
149 |
if (data.result == '') return;
|
150 |
// Create new image section
|
151 |
+
var $image = $($.templates('#su_new_image_template').render([{
|
152 |
id: 999,
|
153 |
title: get_file_title(data.result),
|
154 |
gallery_id: $gallery.data('id'),
|
155 |
image: data.result
|
156 |
+
}]));
|
157 |
// Append new image to gallery content
|
158 |
$container.after($image);
|
159 |
// Update images indexes
|
165 |
|
166 |
function update_images() {
|
167 |
// Loop through galleries
|
168 |
+
$('#su-galleries .su-gallery').each(function() {
|
169 |
// Prepare gallery data
|
170 |
var $gallery = $(this),
|
171 |
id = $gallery.data('id');
|
172 |
// Loop through images
|
173 |
+
$gallery.find('.su-gallery-image').each(function(i) {
|
174 |
// Loop through fields
|
175 |
+
$(this).find('[data-field]').each(function() {
|
176 |
$(this).attr('name', 'galleries[' + id + '][items][' + i + '][' + $(this).data('field') +
|
177 |
']')
|
178 |
});
|
187 |
if (url) return url.substring(url.lastIndexOf("/") + 1, url.lastIndexOf("."));
|
188 |
return "";
|
189 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
});
|
inc/core/class.assets.php
CHANGED
@@ -40,6 +40,8 @@ class Shortcodes_Ultimate_Assets {
|
|
40 |
$shult = shortcodes_ultimate();
|
41 |
// qTip
|
42 |
wp_register_script( 'qtip', $shult->assets( 'js', 'qtip.js' ), array( 'jquery' ), '1.0.0-rc3', true );
|
|
|
|
|
43 |
// Magnific Popup
|
44 |
wp_register_style( 'magnific-popup', $shult->assets( 'css', 'magnific-popup.css' ), false, '0.9.5', 'all' );
|
45 |
wp_register_script( 'magnific-popup', $shult->assets( 'js', 'magnific-popup.js' ), array( 'jquery' ), '0.9.5', true );
|
@@ -55,7 +57,7 @@ class Shortcodes_Ultimate_Assets {
|
|
55 |
wp_register_script( 'jplayer', $shult->assets( 'js', 'jplayer.js' ), array( 'jquery' ), $shult->version, true );
|
56 |
// Options page
|
57 |
wp_register_style( 'su-options-page', $shult->assets( 'css', 'options-page.css' ), false, $shult->version, 'all' );
|
58 |
-
wp_register_script( 'su-options-page', $shult->assets( 'js', 'options-page.js' ), array( 'magnific-popup', 'file-upload', 'jquery-ui-sortable', 'ace' ), $shult->version, true );
|
59 |
// Generator
|
60 |
wp_register_style( 'su-generator', $shult->assets( 'css', 'generator.css' ), array( 'farbtastic', 'magnific-popup' ), $shult->version, 'all' );
|
61 |
wp_register_script( 'su-generator', $shult->assets( 'js', 'generator.js' ), array( 'file-upload', 'farbtastic', 'magnific-popup', 'qtip' ), $shult->version, true );
|
@@ -145,7 +147,7 @@ class Shortcodes_Ultimate_Assets {
|
|
145 |
if ( $_GET['page'] !== $shult->slug ) return;
|
146 |
// Request assets
|
147 |
self::add( 'css', array( 'magnific-popup', 'ace', 'su-options-page' ) );
|
148 |
-
self::add( 'js', array( 'jquery', 'magnific-popup', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse', 'jquery-ui-sortable', 'iframe-transport', 'file-upload', '
|
149 |
}
|
150 |
|
151 |
/**
|
40 |
$shult = shortcodes_ultimate();
|
41 |
// qTip
|
42 |
wp_register_script( 'qtip', $shult->assets( 'js', 'qtip.js' ), array( 'jquery' ), '1.0.0-rc3', true );
|
43 |
+
// jsRender
|
44 |
+
wp_register_script( 'jsrender', $shult->assets( 'js', 'jsrender.js' ), array( 'jquery' ), '1.0.0-beta', true );
|
45 |
// Magnific Popup
|
46 |
wp_register_style( 'magnific-popup', $shult->assets( 'css', 'magnific-popup.css' ), false, '0.9.5', 'all' );
|
47 |
wp_register_script( 'magnific-popup', $shult->assets( 'js', 'magnific-popup.js' ), array( 'jquery' ), '0.9.5', true );
|
57 |
wp_register_script( 'jplayer', $shult->assets( 'js', 'jplayer.js' ), array( 'jquery' ), $shult->version, true );
|
58 |
// Options page
|
59 |
wp_register_style( 'su-options-page', $shult->assets( 'css', 'options-page.css' ), false, $shult->version, 'all' );
|
60 |
+
wp_register_script( 'su-options-page', $shult->assets( 'js', 'options-page.js' ), array( 'magnific-popup', 'file-upload', 'jquery-ui-sortable', 'ace', 'jsrender' ), $shult->version, true );
|
61 |
// Generator
|
62 |
wp_register_style( 'su-generator', $shult->assets( 'css', 'generator.css' ), array( 'farbtastic', 'magnific-popup' ), $shult->version, 'all' );
|
63 |
wp_register_script( 'su-generator', $shult->assets( 'js', 'generator.js' ), array( 'file-upload', 'farbtastic', 'magnific-popup', 'qtip' ), $shult->version, true );
|
147 |
if ( $_GET['page'] !== $shult->slug ) return;
|
148 |
// Request assets
|
149 |
self::add( 'css', array( 'magnific-popup', 'ace', 'su-options-page' ) );
|
150 |
+
self::add( 'js', array( 'jquery', 'magnific-popup', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse', 'jquery-ui-sortable', 'iframe-transport', 'file-upload', 'jsrender', 'su-options-page' ) );
|
151 |
}
|
152 |
|
153 |
/**
|
inc/core/class.generator.php
CHANGED
@@ -12,6 +12,9 @@ class Shortcodes_Ultimate_Generator {
|
|
12 |
add_action( 'media_buttons', array( __CLASS__, 'button' ), 100 );
|
13 |
add_action( 'su/activation', array( __CLASS__, 'reset' ) );
|
14 |
add_action( 'sunrise_page_before', array( __CLASS__, 'reset' ) );
|
|
|
|
|
|
|
15 |
add_action( 'wp_ajax_su_generator_settings', array( __CLASS__, 'settings' ) );
|
16 |
add_action( 'wp_ajax_su_generator_preview', array( __CLASS__, 'preview' ) );
|
17 |
add_action( 'wp_ajax_su_generator_get_terms', array( __CLASS__, 'get_terms' ) );
|
@@ -31,6 +34,9 @@ class Shortcodes_Ultimate_Generator {
|
|
31 |
* @return string
|
32 |
*/
|
33 |
public static function button( $args = array() ) {
|
|
|
|
|
|
|
34 |
$shult = shortcodes_ultimate();
|
35 |
// Prepare args
|
36 |
$args = wp_parse_args( $args, array(
|
@@ -124,7 +130,7 @@ class Shortcodes_Ultimate_Generator {
|
|
124 |
public static function settings() {
|
125 |
$shult = shortcodes_ultimate();
|
126 |
// Capability check
|
127 |
-
|
128 |
// Param check
|
129 |
if ( empty( $_REQUEST['shortcode'] ) ) wp_die( __( 'Shortcode not specified', 'su' ) );
|
130 |
// Get cache
|
@@ -238,7 +244,7 @@ class Shortcodes_Ultimate_Generator {
|
|
238 |
*/
|
239 |
public static function preview() {
|
240 |
// Check authentication
|
241 |
-
|
242 |
// Output results
|
243 |
do_action( 'su/generator/preview/before' );
|
244 |
echo '<h5>' . __( 'Preview', 'su' ) . '</h5>';
|
@@ -253,7 +259,7 @@ class Shortcodes_Ultimate_Generator {
|
|
253 |
*/
|
254 |
public static function get_terms() {
|
255 |
// Check authentication
|
256 |
-
|
257 |
die( json_encode( su_get_terms( sanitize_text_field( $_POST['taxonomy'] ) ) ) );
|
258 |
}
|
259 |
|
@@ -262,7 +268,7 @@ class Shortcodes_Ultimate_Generator {
|
|
262 |
*/
|
263 |
public static function upload() {
|
264 |
// Check capability
|
265 |
-
|
266 |
// Create mew upload instance
|
267 |
$upload = new MediaUpload;
|
268 |
// Save file
|
@@ -297,6 +303,18 @@ class Shortcodes_Ultimate_Generator {
|
|
297 |
// Print result
|
298 |
die( implode( '', $options ) );
|
299 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
}
|
301 |
|
302 |
new Shortcodes_Ultimate_Generator;
|
12 |
add_action( 'media_buttons', array( __CLASS__, 'button' ), 100 );
|
13 |
add_action( 'su/activation', array( __CLASS__, 'reset' ) );
|
14 |
add_action( 'sunrise_page_before', array( __CLASS__, 'reset' ) );
|
15 |
+
add_action( 'create_term', array( __CLASS__, 'reset' ), 10, 3 );
|
16 |
+
add_action( 'edit_term', array( __CLASS__, 'reset' ), 10, 3 );
|
17 |
+
add_action( 'delete_term', array( __CLASS__, 'reset' ), 10, 3 );
|
18 |
add_action( 'wp_ajax_su_generator_settings', array( __CLASS__, 'settings' ) );
|
19 |
add_action( 'wp_ajax_su_generator_preview', array( __CLASS__, 'preview' ) );
|
20 |
add_action( 'wp_ajax_su_generator_get_terms', array( __CLASS__, 'get_terms' ) );
|
34 |
* @return string
|
35 |
*/
|
36 |
public static function button( $args = array() ) {
|
37 |
+
// Check access
|
38 |
+
if ( !self::access_check() ) return;
|
39 |
+
// Plugin object
|
40 |
$shult = shortcodes_ultimate();
|
41 |
// Prepare args
|
42 |
$args = wp_parse_args( $args, array(
|
130 |
public static function settings() {
|
131 |
$shult = shortcodes_ultimate();
|
132 |
// Capability check
|
133 |
+
self::access();
|
134 |
// Param check
|
135 |
if ( empty( $_REQUEST['shortcode'] ) ) wp_die( __( 'Shortcode not specified', 'su' ) );
|
136 |
// Get cache
|
244 |
*/
|
245 |
public static function preview() {
|
246 |
// Check authentication
|
247 |
+
self::access();
|
248 |
// Output results
|
249 |
do_action( 'su/generator/preview/before' );
|
250 |
echo '<h5>' . __( 'Preview', 'su' ) . '</h5>';
|
259 |
*/
|
260 |
public static function get_terms() {
|
261 |
// Check authentication
|
262 |
+
self::access();
|
263 |
die( json_encode( su_get_terms( sanitize_text_field( $_POST['taxonomy'] ) ) ) );
|
264 |
}
|
265 |
|
268 |
*/
|
269 |
public static function upload() {
|
270 |
// Check capability
|
271 |
+
self::access();
|
272 |
// Create mew upload instance
|
273 |
$upload = new MediaUpload;
|
274 |
// Save file
|
303 |
// Print result
|
304 |
die( implode( '', $options ) );
|
305 |
}
|
306 |
+
|
307 |
+
/**
|
308 |
+
* Access check
|
309 |
+
*/
|
310 |
+
public static function access() {
|
311 |
+
if ( !self::access_check() ) wp_die( __( 'Access denied', 'su' ) );
|
312 |
+
}
|
313 |
+
|
314 |
+
public static function access_check() {
|
315 |
+
$by_role = ( get_option( 'su_generator_access' ) ) ? current_user_can( get_option( 'su_generator_access' ) ) : true;
|
316 |
+
return current_user_can( 'edit_posts' ) && $by_role;
|
317 |
+
}
|
318 |
}
|
319 |
|
320 |
new Shortcodes_Ultimate_Generator;
|
inc/core/tools.php
CHANGED
@@ -355,7 +355,7 @@ function su_get_taxonomies( $first = false ) {
|
|
355 |
function su_get_terms( $taxonomy ) {
|
356 |
$terms = array();
|
357 |
// Get the terms
|
358 |
-
foreach ( ( array ) get_terms( $taxonomy ) as $term ) {
|
359 |
$terms[$term->slug] = $term->name;
|
360 |
}
|
361 |
return $terms;
|
355 |
function su_get_terms( $taxonomy ) {
|
356 |
$terms = array();
|
357 |
// Get the terms
|
358 |
+
foreach ( ( array ) get_terms( $taxonomy, array( 'hide_empty' => false ) ) as $term ) {
|
359 |
$terms[$term->slug] = $term->name;
|
360 |
}
|
361 |
return $terms;
|
inc/views/galleries.php
CHANGED
@@ -24,7 +24,6 @@
|
|
24 |
</div>
|
25 |
<div class="su-gallery-content">
|
26 |
<div class="su-gallery-add-image">
|
27 |
-
<a href="#" class="button"><?php _e( 'Add image', $this->textdomain ); ?></a>
|
28 |
<input type="file" />
|
29 |
<small class="description"><?php _e( 'Max upload file size', $this->textdomain ); ?>: <?php echo floor( wp_max_upload_size() / 1024 / 1024 ) . __( 'Mb', $this->textdomain ); ?>. <a href="http://www.wpbeginner.com/wp-tutorials/how-to-increase-the-maximum-file-upload-size-in-wordpress/" target="_blank"><?php _e( 'How to increase', $this->textdomain ); ?></a>.</small>
|
30 |
</div>
|
@@ -68,9 +67,9 @@
|
|
68 |
?>
|
69 |
</div>
|
70 |
<script type="text/html" id="su_new_gallery_template">
|
71 |
-
<div class="su-gallery su-gallery-edit" data-id="
|
72 |
<div class="su-gallery-title">
|
73 |
-
<strong
|
74 |
<span class="su-gallery-actions">
|
75 |
<a href="#" class="su-gallery-open"><?php _e( 'Edit gallery', $this->textdomain ); ?></a>
|
76 |
<a href="#" class="su-gallery-save-close"><?php _e( 'Save & close', $this->textdomain ); ?></a>
|
@@ -89,9 +88,9 @@
|
|
89 |
<script type="text/html" id="su_new_image_template">
|
90 |
<div class="su-gallery-image">
|
91 |
<span class="su-gallery-image-sort-handle"></span>
|
92 |
-
<a href="
|
93 |
<div class="su-gallery-image-header">
|
94 |
-
<a href="#" class="su-gallery-image-title"
|
95 |
<span class="su-gallery-image-actions">
|
96 |
<a href="#" class="su-gallery-image-open"><?php _e( 'Edit', $this->textdomain ); ?></a>
|
97 |
<a href="#" class="su-gallery-image-delete"><?php _e( 'Delete', $this->textdomain ); ?></a>
|
@@ -99,10 +98,10 @@
|
|
99 |
</div>
|
100 |
<div class="su-gallery-image-data">
|
101 |
<label><?php _e( 'Title', $this->textdomain ); ?></label><br />
|
102 |
-
<input type="text" value="
|
103 |
<label><?php _e( 'Link', $this->textdomain ); ?></label><br />
|
104 |
-
<input type="text" value="
|
105 |
-
<input type="hidden" value="
|
106 |
<a href="#" class="button button-small su-gallery-image-ok"><?php _e( 'Close', $this->textdomain ); ?></a>
|
107 |
</div>
|
108 |
</div>
|
24 |
</div>
|
25 |
<div class="su-gallery-content">
|
26 |
<div class="su-gallery-add-image">
|
|
|
27 |
<input type="file" />
|
28 |
<small class="description"><?php _e( 'Max upload file size', $this->textdomain ); ?>: <?php echo floor( wp_max_upload_size() / 1024 / 1024 ) . __( 'Mb', $this->textdomain ); ?>. <a href="http://www.wpbeginner.com/wp-tutorials/how-to-increase-the-maximum-file-upload-size-in-wordpress/" target="_blank"><?php _e( 'How to increase', $this->textdomain ); ?></a>.</small>
|
29 |
</div>
|
67 |
?>
|
68 |
</div>
|
69 |
<script type="text/html" id="su_new_gallery_template">
|
70 |
+
<div class="su-gallery su-gallery-edit" data-id="{{:id}}">
|
71 |
<div class="su-gallery-title">
|
72 |
+
<strong>{{:id+1}}</strong>: <input type="text" value="" class="su-gallery-name" size="30" name="galleries[{{:id}}][name]" placeholder="<?php _e( 'Enter gallery name', $this->textdomain ); ?>" />
|
73 |
<span class="su-gallery-actions">
|
74 |
<a href="#" class="su-gallery-open"><?php _e( 'Edit gallery', $this->textdomain ); ?></a>
|
75 |
<a href="#" class="su-gallery-save-close"><?php _e( 'Save & close', $this->textdomain ); ?></a>
|
88 |
<script type="text/html" id="su_new_image_template">
|
89 |
<div class="su-gallery-image">
|
90 |
<span class="su-gallery-image-sort-handle"></span>
|
91 |
+
<a href="{{:image}}" class="su-gallery-image-preview"><img src="{{:image}}" alt="" /></a>
|
92 |
<div class="su-gallery-image-header">
|
93 |
+
<a href="#" class="su-gallery-image-title">{{:title}}</a>
|
94 |
<span class="su-gallery-image-actions">
|
95 |
<a href="#" class="su-gallery-image-open"><?php _e( 'Edit', $this->textdomain ); ?></a>
|
96 |
<a href="#" class="su-gallery-image-delete"><?php _e( 'Delete', $this->textdomain ); ?></a>
|
98 |
</div>
|
99 |
<div class="su-gallery-image-data">
|
100 |
<label><?php _e( 'Title', $this->textdomain ); ?></label><br />
|
101 |
+
<input type="text" value="{{:title}}" name="galleries[{{:gallery_id}}][items][{{:id}}][title]" class="su-gallery-image-title-value" data-field="title" /><br />
|
102 |
<label><?php _e( 'Link', $this->textdomain ); ?></label><br />
|
103 |
+
<input type="text" value="{{:image}}" name="galleries[{{:gallery_id}}][items][{{:id}}][link]" data-field="link" /><br />
|
104 |
+
<input type="hidden" value="{{:image}}" class="su-gallery-image-image" name="galleries[{{:gallery_id}}][items][{{:id}}][image]" data-field="image" />
|
105 |
<a href="#" class="button button-small su-gallery-image-ok"><?php _e( 'Close', $this->textdomain ); ?></a>
|
106 |
</div>
|
107 |
</div>
|
readme.txt
CHANGED
@@ -91,6 +91,12 @@ Upgrade normally via your Wordpress admin -> Plugins panel.
|
|
91 |
|
92 |
== Changelog ==
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
= 4.1 =
|
95 |
* [5 metro skins](http://gndev.info/shortcodes-ultimate/metro-skins/)
|
96 |
* New screencast - [How to create image gallery](http://www.youtube.com/watch?v=kCWyO2F7jTw)
|
91 |
|
92 |
== Changelog ==
|
93 |
|
94 |
+
= 4.1.1 =
|
95 |
+
* Updated caching mechanism. Cache will be reseted when you add or remove terms
|
96 |
+
* Updated galleries mechanism. Removed some conflicts
|
97 |
+
* Fixed spoiler background for style=fancy
|
98 |
+
* Additional access check option for Shortcode Generator
|
99 |
+
|
100 |
= 4.1 =
|
101 |
* [5 metro skins](http://gndev.info/shortcodes-ultimate/metro-skins/)
|
102 |
* New screencast - [How to create image gallery](http://www.youtube.com/watch?v=kCWyO2F7jTw)
|
shortcodes-ultimate.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Shortcodes Ultimate
|
4 |
Plugin URI: http://gndev.info/shortcodes-ultimate/
|
5 |
-
Version: 4.1.
|
6 |
Author: Vladimir Anokhin
|
7 |
Author URI: http://gndev.info/
|
8 |
Description: Supercharge your WordPress theme with mega pack of shortcodes
|
2 |
/*
|
3 |
Plugin Name: Shortcodes Ultimate
|
4 |
Plugin URI: http://gndev.info/shortcodes-ultimate/
|
5 |
+
Version: 4.1.1
|
6 |
Author: Vladimir Anokhin
|
7 |
Author URI: http://gndev.info/
|
8 |
Description: Supercharge your WordPress theme with mega pack of shortcodes
|