Version Description
- Save buttons!
- Prevent directory listing of folders by adding blank index.php files to all folders - silence is golden!
Download this release
Release Info
Developer | DesignsAndCode |
Plugin | Forget About Shortcode Buttons |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.4 to 1.1.0
- assets/css/button-styles.min.css +1 -0
- assets/css/index.php +1 -0
- assets/fonts/index.php +1 -0
- assets/index.php +1 -0
- assets/js/fasc-buttons/index.php +1 -0
- assets/js/fasc-buttons/popup.css +158 -1
- assets/js/fasc-buttons/popup.js +0 -1
- assets/js/fasc-buttons/popup.min.js +1 -0
- assets/js/fasc-buttons/popup.php +25 -4
- assets/js/fasc-buttons/scripts.js +0 -1
- assets/js/fasc-buttons/scripts.min.js +1 -0
- assets/js/index.php +1 -0
- forget-about-shortcode-buttons.php +136 -5
- index.php +1 -0
- readme.txt +7 -3
assets/css/button-styles.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
@import url(../../../../../wp-includes/css/dashicons.min.css);a.fasc-button{display:inline-block;color:#fff;text-decoration:none;margin:3px 0}a.fasc-button:hover{text-decoration:none}a.fasc-button.fasc-ico-before:before,a.fasc-button.fasc-ico:before{vertical-align:middle;display:inline-block;-webkit-font-smoothing:antialiased;margin-top:-2px}a.fasc-size-xsmall.fasc-ico-before:before,a.fasc-size-xsmall.fasc-ico:before{font:400 12px/1 dashicons;padding-right:4px}a.fasc-size-small.fasc-ico-before:before,a.fasc-size-small.fasc-ico:before{font:400 14px/1 dashicons;padding-right:4px}a.fasc-size-medium.fasc-ico-before:before,a.fasc-size-medium.fasc-ico:before{font:400 16px/1 dashicons;padding-right:5px}a.fasc-size-large.fasc-ico-before:before,a.fasc-size-large.fasc-ico:before{font:400 20px/1 dashicons;padding-right:6px;line-height:22px}a.fasc-size-xlarge.fasc-ico-before:before,a.fasc-size-xlarge.fasc-ico:before{font:400 28px/1 dashicons;padding-right:6px;line-height:22px}.fasc-size-xsmall{font-size:10px;padding:5px 7px;border:0}.fasc-size-small{font-size:12px;padding:6px 8px;border:0}.fasc-size-medium{padding:7px 9px;font-size:14px;border:0}.fasc-size-large{font-size:18px;padding:8px 10px;border:0}.fasc-size-xlarge{font-size:24px;padding:11px 13px;border:0}.fasc-type-flat:hover{background-image:-webkit-linear-gradient(top,rgba(0,0,0,.1),rgba(0,0,0,.1));background-image:-moz-linear-gradient(top,rgba(0,0,0,.1),rgba(0,0,0,.1));background-image:-o-linear-gradient(top,rgba(0,0,0,.1),rgba(0,0,0,.1));background-image:linear-gradient(to bottom,rgba(0,0,0,.1),rgba(0,0,0,.1))}.fasc-type-glossy{background-color:#247edd;border:1px solid rgba(0,0,0,.1);background-image:-webkit-linear-gradient(top,rgba(255,255,255,.3),rgba(255,255,255,0)50%,rgba(0,0,0,.12)51%,rgba(0,0,0,.04));background-image:-moz-linear-gradient(top,rgba(255,255,255,.3),rgba(255,255,255,0)50%,rgba(0,0,0,.12)51%,rgba(0,0,0,.04));background-image:-o-linear-gradient(top,rgba(255,255,255,.3),rgba(255,255,255,0)50%,rgba(0,0,0,.12)51%,rgba(0,0,0,.04));background-image:linear-gradient(to bottom,rgba(255,255,255,.3),rgba(255,255,255,0)50%,rgba(0,0,0,.12)51%,rgba(0,0,0,.04))}.fasc-type-glossy:hover{background-image:-webkit-linear-gradient(top,rgba(0,0,0,.1),0(0,0,0,0) 50%,rgba(0,0,0,.1)51%,rgba(0,0,0,.1));background-image:-moz-linear-gradient(top,rgba(0,0,0,.1),rgba(0,0,0,0)50%,rgba(0,0,0,.1)51%,rgba(0,0,0,.1));background-image:-o-linear-gradient(top,rgba(0,0,0,.1),rgba(0,0,0,0)50%,rgba(0,0,0,.1)51%,rgba(0,0,0,.1));background-image:linear-gradient(to bottom,rgba(0,0,0,.1),rgba(0,0,0,0)50%,rgba(0,0,0,.1)51%,rgba(0,0,0,.1))}.fasc-type-popout.fasc-size-xlarge{-webkit-box-shadow:7px 7px 0 #777;-moz-box-shadow:7px 7px 0 #777;box-shadow:7px 7px 0 #777}.fasc-type-popout.fasc-size-large{-webkit-box-shadow:6px 6px 0 #777;-moz-box-shadow:6px 6px 0 #777;box-shadow:6px 6px 0 #777}.fasc-type-popout.fasc-size-medium{-webkit-box-shadow:5px 5px 0 #777;-moz-box-shadow:5px 5px 0 #777;box-shadow:5px 5px 0 #777}.fasc-type-popout.fasc-size-small{-webkit-box-shadow:4px 4px 0 #777;-moz-box-shadow:4px 4px 0 #777;box-shadow:4px 4px 0 #777}.fasc-type-popout.fasc-size-xsmall{-webkit-box-shadow:3px 3px 0 #777;-moz-box-shadow:3px 3px 0 #777;box-shadow:3px 3px 0 #777}.fasc-type-popout.fasc-size-xlarge:hover{-webkit-box-shadow:5px 5px 0 #777;-moz-box-shadow:5px 5px 0 #777;box-shadow:5px 5px 0 #777}.fasc-type-popout.fasc-size-large:hover{-webkit-box-shadow:4px 4px 0 #777;-moz-box-shadow:4px 4px 0 #777;box-shadow:4px 4px 0 #777}.fasc-type-popout.fasc-size-medium:hover,.fasc-type-popout.fasc-size-small:hover{-webkit-box-shadow:3px 3px 0 #777;-moz-box-shadow:3px 3px 0 #777;box-shadow:3px 3px 0 #777}.fasc-type-popout.fasc-size-xsmall:hover{-webkit-box-shadow:2px 2px 0 #777;-moz-box-shadow:2px 2px 0 #777;box-shadow:2px 2px 0 #777}.fasc-type-popout:hover{background-image:-webkit-linear-gradient(top,rgba(0,0,0,.1),rgba(0,0,0,.1));background-image:-moz-linear-gradient(top,rgba(0,0,0,.1),rgba(0,0,0,.1));background-image:-o-linear-gradient(top,rgba(0,0,0,.1),rgba(0,0,0,.1));background-image:linear-gradient(to bottom,rgba(0,0,0,.1),rgba(0,0,0,.1))}.fasc-rounded-medium.fasc-size-xlarge,a.fasc-button.rounded.fasc-size-xlarge{border-radius:15px}.fasc-rounded-medium.fasc-size-large,a.fasc-button.rounded.fasc-size-large{border-radius:10px}.fasc-rounded-medium.fasc-size-medium,a.fasc-button.rounded.fasc-size-medium{border-radius:9px}.fasc-rounded-medium.fasc-size-small,a.fasc-button.rounded.fasc-size-small{border-radius:8px}.fasc-rounded-medium.fasc-size-xsmall,a.fasc-button.rounded.fasc-size-xsmall{border-radius:7px}
|
assets/css/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Silence is golden
|
assets/fonts/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Silence is golden
|
assets/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Silence is golden
|
assets/js/fasc-buttons/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Silence is golden
|
assets/js/fasc-buttons/popup.css
CHANGED
@@ -117,6 +117,7 @@ input[type="text"]
|
|
117 |
list-style:none;
|
118 |
|
119 |
}
|
|
|
120 |
#tab-header li
|
121 |
{
|
122 |
padding:10px;
|
@@ -135,6 +136,10 @@ input[type="text"]
|
|
135 |
margin-bottom:-1px;
|
136 |
}
|
137 |
|
|
|
|
|
|
|
|
|
138 |
#tab-header a
|
139 |
{
|
140 |
text-decoration:none;
|
@@ -163,11 +168,17 @@ input[type="text"]
|
|
163 |
z-index:10;
|
164 |
position:relative;
|
165 |
padding:20px 25px 10px 25px;
|
|
|
166 |
|
167 |
}
|
|
|
|
|
|
|
|
|
|
|
168 |
#tab-2-content
|
169 |
{
|
170 |
-
display:none
|
171 |
/*padding-top:10px;*/
|
172 |
}
|
173 |
#tab-2-content .ico-grid
|
@@ -178,6 +189,7 @@ input[type="text"]
|
|
178 |
/*background-color:#fafafa;*/
|
179 |
|
180 |
}
|
|
|
181 |
#tab-2-content .ico-grid .grid-container
|
182 |
{
|
183 |
position:absolute;
|
@@ -265,6 +277,151 @@ input[type="text"]
|
|
265 |
font-weight:normal;
|
266 |
}
|
267 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
#fasc-footer
|
269 |
{
|
270 |
position:absolute;
|
117 |
list-style:none;
|
118 |
|
119 |
}
|
120 |
+
|
121 |
#tab-header li
|
122 |
{
|
123 |
padding:10px;
|
136 |
margin-bottom:-1px;
|
137 |
}
|
138 |
|
139 |
+
#tab-header li.settings
|
140 |
+
{
|
141 |
+
float:right;
|
142 |
+
}
|
143 |
#tab-header a
|
144 |
{
|
145 |
text-decoration:none;
|
168 |
z-index:10;
|
169 |
position:relative;
|
170 |
padding:20px 25px 10px 25px;
|
171 |
+
display:none;
|
172 |
|
173 |
}
|
174 |
+
#tab-1-content
|
175 |
+
{
|
176 |
+
display:block;
|
177 |
+
}
|
178 |
+
|
179 |
#tab-2-content
|
180 |
{
|
181 |
+
/*display:none;*/
|
182 |
/*padding-top:10px;*/
|
183 |
}
|
184 |
#tab-2-content .ico-grid
|
189 |
/*background-color:#fafafa;*/
|
190 |
|
191 |
}
|
192 |
+
|
193 |
#tab-2-content .ico-grid .grid-container
|
194 |
{
|
195 |
position:absolute;
|
277 |
font-weight:normal;
|
278 |
}
|
279 |
|
280 |
+
#tab-4-content .container-grid
|
281 |
+
{
|
282 |
+
height:240px;
|
283 |
+
overflow-y:scroll;
|
284 |
+
position:relative;
|
285 |
+
/*background-color:#fafafa;*/
|
286 |
+
|
287 |
+
}
|
288 |
+
|
289 |
+
.saved-buttons-tab .container-grid
|
290 |
+
{
|
291 |
+
margin-top:10px;
|
292 |
+
height:250px;
|
293 |
+
overflow:hidden;
|
294 |
+
overflow-y:scroll;
|
295 |
+
|
296 |
+
}
|
297 |
+
|
298 |
+
.saved-buttons-tab .container-grid ul,
|
299 |
+
.saved-buttons-tab .container-grid li
|
300 |
+
{
|
301 |
+
list-style:none;
|
302 |
+
list-style-type:none;
|
303 |
+
padding:0;
|
304 |
+
margin:0;
|
305 |
+
|
306 |
+
}
|
307 |
+
|
308 |
+
.saved-buttons-tab .container-grid li .wrap .name .fasc-button-edit
|
309 |
+
{
|
310 |
+
color:#eee;
|
311 |
+
position:relative;
|
312 |
+
z-index:9999;
|
313 |
+
}
|
314 |
+
|
315 |
+
.saved-buttons-tab .container-grid li .wrap:hover .name .fasc-button-edit
|
316 |
+
{
|
317 |
+
color:#333 !important;
|
318 |
+
}
|
319 |
+
|
320 |
+
.saved-buttons-tab .container-grid li .fasc-button-remove
|
321 |
+
{
|
322 |
+
width:auto;
|
323 |
+
font-weight:bold;
|
324 |
+
color:#ccc;
|
325 |
+
display:block;
|
326 |
+
text-align:right;
|
327 |
+
color:#eee;
|
328 |
+
z-index:9999;
|
329 |
+
position:relative;
|
330 |
+
}
|
331 |
+
|
332 |
+
.saved-buttons-tab .container-grid li:hover .fasc-button-remove
|
333 |
+
{
|
334 |
+
color:#d93030 !important;
|
335 |
+
}
|
336 |
+
|
337 |
+
.saved-buttons-tab .container-grid li
|
338 |
+
{
|
339 |
+
padding-right:20px;
|
340 |
+
position:relative;
|
341 |
+
}
|
342 |
+
|
343 |
+
.saved-buttons-tab .container-grid li .wrap
|
344 |
+
{
|
345 |
+
margin-bottom: 5px;
|
346 |
+
background-color: #f7fdff;
|
347 |
+
border: 1px solid #f7fdff;
|
348 |
+
text-align: left;
|
349 |
+
cursor: pointer;
|
350 |
+
border-radius: 3px;
|
351 |
+
padding:5px 10px;
|
352 |
+
position:relative;
|
353 |
+
line-height:20px;
|
354 |
+
height:auto;
|
355 |
+
|
356 |
+
|
357 |
+
}
|
358 |
+
.saved-buttons-tab .container-grid li .wrap .full_button
|
359 |
+
{
|
360 |
+
display:none;
|
361 |
+
}
|
362 |
+
|
363 |
+
.saved-buttons-tab .container-grid li .wrap .name
|
364 |
+
{
|
365 |
+
width:220px;
|
366 |
+
margin-right:10px;
|
367 |
+
vertical-align:bottom;
|
368 |
+
float:left;
|
369 |
+
z-index:9999;
|
370 |
+
position:relative;
|
371 |
+
}
|
372 |
+
.saved-buttons-tab .container-grid li .wrap .col
|
373 |
+
{
|
374 |
+
width:20px;
|
375 |
+
height:20px;
|
376 |
+
display:inline-block;
|
377 |
+
margin-left:5px;
|
378 |
+
float:right;
|
379 |
+
}
|
380 |
+
|
381 |
+
.saved-buttons-tab .container-grid li .wrap:after
|
382 |
+
{
|
383 |
+
content: "";
|
384 |
+
display:block;
|
385 |
+
width:100%;
|
386 |
+
height:100%;
|
387 |
+
position:absolute;
|
388 |
+
top:0;
|
389 |
+
left:0;
|
390 |
+
}
|
391 |
+
|
392 |
+
.saved-buttons-tab .container-grid li .wrap .fasc-button-update
|
393 |
+
{
|
394 |
+
display:none;
|
395 |
+
}
|
396 |
+
|
397 |
+
.saved-buttons-tab .container-grid li .wrap .fasc-button-update[data-action="remove"]
|
398 |
+
{
|
399 |
+
|
400 |
+
margin-top:3px;
|
401 |
+
}
|
402 |
+
|
403 |
+
.saved-buttons-tab .container-grid li .wrap:hover
|
404 |
+
{
|
405 |
+
color:#333333;
|
406 |
+
border:1px solid #cccccc;
|
407 |
+
}
|
408 |
+
.saved-buttons-tab .container-grid li .wrap.active
|
409 |
+
{
|
410 |
+
color:#000000;
|
411 |
+
background-color:#eff8fb;
|
412 |
+
border:1px solid #aaaaaa;
|
413 |
+
}
|
414 |
+
|
415 |
+
a.save-btn
|
416 |
+
{
|
417 |
+
position:absolute;bottom:10px;right:10px;font-size:24px;color:rgba(0,0,0,0.2);text-decoration:none;
|
418 |
+
}
|
419 |
+
.save-btn:hover
|
420 |
+
{
|
421 |
+
color:rgba(0,0,0,0.5);
|
422 |
+
}
|
423 |
+
|
424 |
+
|
425 |
#fasc-footer
|
426 |
{
|
427 |
position:absolute;
|
assets/js/fasc-buttons/popup.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
function getButton(){var e=jQuery("#button-dialog input#button-url").val();var t=jQuery("#button-dialog input#button-text").val();var n=jQuery("#button-dialog select#button-size").val();var r=jQuery("#button-dialog input#button-color").val();var i=jQuery("#button-dialog input#text-color").val();var s=jQuery("#button-dialog select#button-type").val();var o=jQuery("#button-dialog select#button-align").val();var u=jQuery("#button-dialog input#new-window").prop("checked");var a="";var f="";var l="";var c="";var h="";var p="";var d="";if(u==true){p=' target="_blank"'}if(s){if(s!=""){l=" "+s}}if(n){if(n!=""){c=" "+n}}var v=$($("#tab-2-content .ico-grid div.active").get(0));var m="";var g="";if(v.length==1){var y=v.attr("class").split(" ");var b=0;var w="dashicons";for(b=0;b<y.length;b++){if(y[b]!="active"&&y[b]!="fa"&&y[b]!="dashicons"){m+=" "+y[b]}if(y[b]=="fa"){w="fontawesome"}}if(b>0){if(w=="fontawesome"){m=" ico-fa fasc-ico-before"+m}else{m=" fasc-ico-before"+m}}}var E='<a href="'+e+'" class="fasc-button'+c+l+m+'"'+p+' style="background-color:'+r+";color:"+i+';" data-fasc-style="background-color:'+r+";color:"+i+';">'+t+"</a>";return E}function rgb2hex(e){if(e.search("rgb")==-1){return e}else{e=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/);function t(e){return("0"+parseInt(e).toString(16)).slice(-2)}return"#"+t(e[1])+t(e[2])+t(e[3])}}var $currentNode=null;(function(e){e(function(){e("#tab-header a").click(function(){$this=e(this);var t=$this.attr("href");$this.parent().parent().find("li").removeClass("active");$this.parent().addClass("active");e("#button-dialog .fasc-tab-content").hide();e("#button-dialog "+t).show();if(e(".ico-grid .grid-container div.active").length>0){e(".ico-grid").scrollTop(e(".ico-grid .grid-container div.active").position().top-5)}return false});e("#tab-2-content #icon-type-select").change(function(t){e("#tab-2-content .ico-grid .grid-container").removeClass("ico-screen-active");e("#tab-2-content #"+e(this).val()).addClass("ico-screen-active")});e("#tab-2-content .ico-grid div").click(function(t){t.preventDefault();e("#tab-2-content .ico-grid div").removeClass("active");e(this).addClass("active");$previewButton.html(getButton());e("#tab-2-content .fasc-ico-position").removeAttr("checked");e('#tab-2-content .fasc-ico-position[value="before"]').prop("checked",true);return false});e("#tab-2-content .fasc-ico-position").change(function(t){if(e(this).val()=="none"){e("#tab-2-content .ico-grid div div:not(.clear)").removeClass("active")}else if(e(this).val()=="before"){var n=e("#tab-2-content .ico-grid div.active");if(n.length==1){}else{e(e("#tab-2-content .ico-grid div.ico-screen-active div:not(.clear)").get(0)).addClass("active")}}$previewButton.html(getButton())});$previewButton=jQuery(".preview-button-area .centered-button");e('#button-dialog select, #button-dialog input[type="checkbox"]').change(function(){$previewButton.html(getButton())});e('#button-dialog input[type="text"]').keyup(function(){$previewButton.html(getButton())});e('#button-dialog input[type="text"]').keyup(function(){$previewButton.html(getButton())});$previewButton.html(getButton())})})(window.jQuery);var ButtonDialog={local_ed:"ed",init:function(e){ButtonDialog.local_ed=e;tinyMCEPopup.resizeToInnerSize();var t=top.tinymce.activeEditor.windowManager.getParams();$currentNode=t.target;$("#tab-2-content .ico-grid .grid-container").removeClass("ico-screen-active");$("#tab-2-content #"+$("#tab-2-content #icon-type-select").val()).addClass("ico-screen-active");if(source=="click"){var n="";var r=$currentNode.attr("href");jQuery("#button-dialog input#button-url").val(r);var i=$currentNode.attr("target");if(typeof i!="undefined"){if(i=="_blank"){jQuery("#button-dialog input#new-window").prop("checked",true)}}var s=$currentNode.text();jQuery("#button-dialog input#button-text").val(s);var o=rgb2hex($currentNode.css("color"));jQuery("#text-color").val(o);var u=rgb2hex($currentNode.css("background-color"));jQuery("#button-color").val(u);var a=$currentNode.attr("class").split(/\s+/);for(var f=0;f<a.length;f++){if(a[f].substring(0,9)=="fasc-type"){var l=a[f];if($currentNode.hasClass("fasc-rounded-medium")||$currentNode.hasClass("rounded")){l=l+" "+"fasc-rounded-medium"}jQuery("#button-type option").removeAttr("selected");jQuery('#button-type option[value="'+l+'"]').attr("selected","selected");$("#button-type").val(l)}else if(a[f].substring(0,9)=="fasc-size"){var c=a[f];jQuery("#button-size option").removeAttr("selected");jQuery('#button-size option[value="'+c+'"]').attr("selected","selected");$("#button-size").val(c)}else if(a[f].substring(0,9)=="dashicons"){$("#tab-2-content .ico-grid .grid-container").removeClass("ico-screen-active");$("#tab-2-content #dashicons-grid").addClass("ico-screen-active");$("#icon-type-select").val("dashicons-grid");var h=a[f];$(".ico-grid ."+h).addClass("active");$('#tab-2-content .fasc-ico-position[value="before"]').attr("checked","checked")}else if(a[f].substring(0,3)=="fa-"){$("#tab-2-content .ico-grid .grid-container").removeClass("ico-screen-active");$button=$("#tab-2-content .ico-grid").find("."+a[f]);var p=$button.parent().attr("id");var d=$("#tab-2-content #"+p);d.addClass("ico-screen-active");$("#icon-type-select").val(p);$(".ico-grid ."+a[f]).addClass("active");$('#tab-2-content .fasc-ico-position[value="before"]').attr("checked","checked")}}}else{var s=e.selection.getContent();jQuery("#button-dialog input#button-text").val(s)}$previewButton=jQuery(".preview-button-area .centered-button");$previewButton.html(getButton());$("#button-color, #text-color").minicolors({position:"top left",change:function(e,t){$previewButton.html(getButton())}})},insert:function(t){if(source=="click"){var n=t.selection.getNode();t.selection.select(n)}tinyMCEPopup.execCommand("mceReplaceContent",false,getButton());tinyMCEPopup.close()}};tinyMCEPopup.onInit.add(ButtonDialog.init,ButtonDialog)
|
|
assets/js/fasc-buttons/popup.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
function loadTab(e){$("#button-dialog .fasc-tab-content").hide();$("#button-dialog "+e).show();if($(".ico-grid .grid-container div.active").length>0){$(".ico-grid").scrollTop($(".ico-grid .grid-container div.active").position().top-5)}}function parseButtons(e){var t=$(".saved-buttons-tab .container-grid ul");t.empty();var n="";var r=0;$.each(e,function(i){n="";var s=$(e[i]["html"]);var o=s.css("background-color");var u=s.css("color");n+="<li data-index='"+r+"'>";n+='<div class="wrap">';n+='<div class="full_button">'+e[i]["html"]+"</div>";n+='<div class="name"><span>'+e[i]["name"]+'</span> <a class="dashicons dashicons-edit fasc-button-edit"></a><a class="fa fa-check fasc-button-update" data-action="update"></a><a class="dashicons dashicons-no-alt fasc-button-update" data-action="remove"></a></div>';n+='<div class="col fasc-button-remove dashicons dashicons-no-alt"></div>';n+='<div class="col" style="background-color:'+o+';"></div>';n+='<div class="col" style="background-color:'+u+';"></div>';n+='<div class="clear"></div>';n+="</div>";n+="</li>";t.append(n);r++});var i=function(e){var t=e.text();var n=$("<input>",{val:t,type:"text",width:"170px","data-orig-text":t});e.replaceWith(n);n.select()};var s=function(e){var t=$("<span>",{text:e.attr("data-orig-text")});e.replaceWith(t);t.on("click",i)};var o=function(e){var t=$("<span>",{text:e.val()});e.replaceWith(t);t.on("click",i)};$(".fasc-button-edit").click(function(){$(this).hide();$(this).parent().find(".fasc-button-update").show().css("display","inline-block");i($(this).parent().find("span"));return false});$(".fasc-button-remove").click(function(e){e.preventDefault();var t=$(this).closest("li").attr("data-index");$.get(ajax_url+"?action=fasc_buttons&load=remove_button&index="+t,function(e){parseButtons(e)},"json");return false});$(".fasc-button-update").click(function(){var e=$(this);$(this).parent().find(".fasc-button-update").hide();$(this).parent().find(".fasc-button-edit").show();if(e.attr("data-action")=="remove"){s($(this).parent().find("input"))}else{var t=$(this).closest("li").attr("data-index");var n=encodeURIComponent($(this).parent().find("input").val());$.get(ajax_url+"?action=fasc_buttons&load=update_button&index="+t+"&name="+n,function(e){parseButtons(e)},"json");o($(this).parent().find("input"))}return false});var u=$(".saved-buttons-tab .container-grid li .wrap");u.on("click",function(){u.removeClass("active");$(this).addClass("active");var e=$(this).find(".full_button a.fasc-button");setupFormHTML(e,true);$previewButton=jQuery(".preview-button-area .centered-button");$previewButton.html(getButton())})}function getButton(e){var t={content:"",isSaving:false};$.extend(t,e);var n=jQuery("#button-dialog input#button-url").val();var r=jQuery("#button-dialog input#button-text").val();var i=jQuery("#button-dialog select#button-size").val();var s=jQuery("#button-dialog input#button-color").val();var o=jQuery("#button-dialog input#text-color").val();var u=jQuery("#button-dialog select#button-type").val();var a=jQuery("#button-dialog select#button-align").val();var f=jQuery("#button-dialog input#new-window").prop("checked");var l="";var c="";var h="";var p="";var d="";var v="";var m="";if(f==true){v=' target="_blank"'}if(u){if(u!=""){h=" "+u}}if(i){if(i!=""){p=" "+i}}var g=$($("#tab-2-content .ico-grid div.active").get(0));var y="";var b="";if(g.length==1){var w=g.attr("class").split(" ");var E=0;var S="dashicons";for(E=0;E<w.length;E++){if(w[E]!="active"&&w[E]!="fa"&&w[E]!="dashicons"){y+=" "+w[E]}if(w[E]=="fa"){S="fontawesome"}}if(E>0){if(S=="fontawesome"){y=" ico-fa fasc-ico-before"+y}else{y=" fasc-ico-before"+y}}}var x="";if(!t.isSaving){x='<a href="'+n+'" class="fasc-button'+p+h+y+'"'+v+' style="background-color:'+s+";color:"+o+';" data-fasc-style="background-color:'+s+";color:"+o+';">'+r+"</a>"}else{x='<a class="fasc-button'+p+h+y+'"'+v+' style="background-color:'+s+";color:"+o+';" data-fasc-style="background-color:'+s+";color:"+o+';"></a>'}return x}function rgb2hex(e){if(e.search("rgb")==-1){return e}else{e=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/);function t(e){return("0"+parseInt(e).toString(16)).slice(-2)}return"#"+t(e[1])+t(e[2])+t(e[3])}}function setupFormHTML(e,t){var n="";var r=e.attr("href");if(typeof t=="undefined"){jQuery("#button-dialog input#button-url").val(r)}var i=e.attr("target");jQuery("#button-dialog input#new-window").prop("checked",false);if(typeof i!="undefined"){if(i=="_blank"){jQuery("#button-dialog input#new-window").prop("checked",true)}}if(typeof t=="undefined"){var s=e.text();jQuery("#button-dialog input#button-text").val(s)}var o=rgb2hex(e.css("color"));jQuery("#text-color").val(o);refreshMiniColors(jQuery("#text-color"),o);var u=rgb2hex(e.css("background-color"));jQuery("#button-color").val(u);refreshMiniColors(jQuery("#button-color"),u);var a=e.attr("class").split(/\s+/);$("#tab-2-content .ico-grid > div > div").removeClass("active");for(var f=0;f<a.length;f++){if(a[f].substring(0,9)=="fasc-type"){var l=a[f];if(e.hasClass("fasc-rounded-medium")||e.hasClass("rounded")){l=l+" "+"fasc-rounded-medium"}jQuery("#button-type option").removeAttr("selected");jQuery('#button-type option[value="'+l+'"]').attr("selected","selected");$("#button-type").val(l)}else if(a[f].substring(0,9)=="fasc-size"){var c=a[f];jQuery("#button-size option").removeAttr("selected");jQuery('#button-size option[value="'+c+'"]').attr("selected","selected");$("#button-size").val(c)}else if(a[f].substring(0,9)=="dashicons"){$("#tab-2-content .ico-grid .grid-container").removeClass("ico-screen-active");$("#tab-2-content #dashicons-grid").addClass("ico-screen-active");$("#icon-type-select").val("dashicons-grid");var h=a[f];$(".ico-grid ."+h).addClass("active");$('#tab-2-content .fasc-ico-position[value="before"]').attr("checked","checked")}else if(a[f].substring(0,3)=="fa-"){$("#tab-2-content .ico-grid .grid-container").removeClass("ico-screen-active");$button=$("#tab-2-content .ico-grid").find("."+a[f]);var p=$button.parent().attr("id");var d=$("#tab-2-content #"+p);d.addClass("ico-screen-active");$("#icon-type-select").val(p);$(".ico-grid ."+a[f]).addClass("active");$('#tab-2-content .fasc-ico-position[value="before"]').attr("checked","checked")}}}function refreshMiniColors(e,t){var n=jQuery(".preview-button-area .centered-button");e.minicolors({position:"top left",change:function(e,t){n.html(getButton())}});if(typeof t!="undefined"){e.minicolors("value",t)}}var $currentNode=null;(function(e){e(function(){e("#tab-header a").click(function(){var t=e(this);var n=t.attr("href");t.parent().parent().find("li").removeClass("active");t.parent().addClass("active");loadTab(n);return false});e("#tab-2-content #icon-type-select").change(function(t){e("#tab-2-content .ico-grid .grid-container").removeClass("ico-screen-active");e("#tab-2-content #"+e(this).val()).addClass("ico-screen-active")});e("#tab-2-content .ico-grid div").click(function(t){t.preventDefault();e("#tab-2-content .ico-grid div").removeClass("active");e(this).addClass("active");$previewButton.html(getButton());e("#tab-2-content .fasc-ico-position").removeAttr("checked");e('#tab-2-content .fasc-ico-position[value="before"]').prop("checked",true);return false});e("#tab-2-content .fasc-ico-position").change(function(t){if(e(this).val()=="none"){e("#tab-2-content .ico-grid div div:not(.clear)").removeClass("active")}else if(e(this).val()=="before"){var n=e("#tab-2-content .ico-grid div.active");if(n.length==1){}else{e(e("#tab-2-content .ico-grid div.ico-screen-active div:not(.clear)").get(0)).addClass("active")}}$previewButton.html(getButton())});$previewButton=jQuery(".preview-button-area .centered-button");e('#button-dialog select, #button-dialog input[type="checkbox"]').change(function(){$previewButton.html(getButton())});e('#button-dialog input[type="text"]').keyup(function(){$previewButton.html(getButton())});e('#button-dialog input[type="text"]').keyup(function(){$previewButton.html(getButton())});$previewButton.html(getButton());e.get(ajax_url+"?action=fasc_buttons&load=get_buttons",function(e){parseButtons(e)},"json");e(".save-btn").click(function(){var t={};t.button=getButton({isSaving:true});e.post(ajax_url+"?action=fasc_buttons&load=save_button",t,function(e){parseButtons(e)},"json");e("#tab-header li").removeClass("active");e('#tab-header li a[href="#tab-3-content"]').parent().addClass("active");loadTab("#tab-3-content");return false})})})(window.jQuery);var ButtonDialog={local_ed:"ed",init:function(e){ButtonDialog.local_ed=e;tinyMCEPopup.resizeToInnerSize();var t=top.tinymce.activeEditor.windowManager.getParams();$currentNode=t.target;$("#tab-2-content .ico-grid .grid-container").removeClass("ico-screen-active");$("#tab-2-content #"+$("#tab-2-content #icon-type-select").val()).addClass("ico-screen-active");if(source=="click"){setupFormHTML($currentNode)}else{var n=e.selection.getContent();jQuery("#button-dialog input#button-text").val(n)}$previewButton=jQuery(".preview-button-area .centered-button");$previewButton.html(getButton());refreshMiniColors($("#button-color, #text-color"))},insert:function(t){if(source=="click"){var n=t.selection.getNode();t.selection.select(n)}tinyMCEPopup.execCommand("mceReplaceContent",false,getButton());tinyMCEPopup.close()}};tinyMCEPopup.onInit.add(ButtonDialog.init,ButtonDialog)
|
assets/js/fasc-buttons/popup.php
CHANGED
@@ -35,8 +35,9 @@
|
|
35 |
<link rel="stylesheet" href="popup.css?ver=<?php echo $fasc_plugin_ver; ?>">
|
36 |
<script type="text/javascript">
|
37 |
var source = "<?php echo $source; ?>";
|
|
|
38 |
</script>
|
39 |
-
<script type="text/javascript" src="popup.js?ver=<?php echo $fasc_plugin_ver; ?>"></script>
|
40 |
</head>
|
41 |
<body>
|
42 |
|
@@ -44,10 +45,11 @@ var source = "<?php echo $source; ?>";
|
|
44 |
<!-- http://www.tinymce.com/develop/bugtracker_view.php?id=5575 -->
|
45 |
|
46 |
<div id="button-dialog">
|
47 |
-
<div class="preview-button-area">
|
48 |
<div class="centered-button">
|
49 |
|
50 |
</div>
|
|
|
51 |
</div>
|
52 |
|
53 |
<form action="/" method="get" accept-charset="utf-8">
|
@@ -56,8 +58,8 @@ var source = "<?php echo $source; ?>";
|
|
56 |
<ul>
|
57 |
<li class="active"><a href="#tab-1-content">Properties</a></li>
|
58 |
<li><a href="#tab-2-content">Icon</a></li>
|
59 |
-
|
60 |
-
<!--<li><a href="#tab-4-content"><div data-code="f111" class="dashicons dashicons-admin-generic active"></div></a></li>-->
|
61 |
</ul><div class="clear"></div>
|
62 |
</div>
|
63 |
|
@@ -219,6 +221,25 @@ var source = "<?php echo $source; ?>";
|
|
219 |
<?php require_once("fa-medical-grid.php"); ?>
|
220 |
<div class="clear"></div>
|
221 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
<div class="clear"></div>
|
223 |
</div>
|
224 |
</div>
|
35 |
<link rel="stylesheet" href="popup.css?ver=<?php echo $fasc_plugin_ver; ?>">
|
36 |
<script type="text/javascript">
|
37 |
var source = "<?php echo $source; ?>";
|
38 |
+
var ajax_url = "<?php echo $_GET['ajaxurl']; ?>";
|
39 |
</script>
|
40 |
+
<script type="text/javascript" src="popup.min.js?ver=<?php echo $fasc_plugin_ver; ?>"></script>
|
41 |
</head>
|
42 |
<body>
|
43 |
|
45 |
<!-- http://www.tinymce.com/develop/bugtracker_view.php?id=5575 -->
|
46 |
|
47 |
<div id="button-dialog">
|
48 |
+
<div class="preview-button-area" style="position:relative;">
|
49 |
<div class="centered-button">
|
50 |
|
51 |
</div>
|
52 |
+
<a href="#" class="fa fa-save save-btn"></a>
|
53 |
</div>
|
54 |
|
55 |
<form action="/" method="get" accept-charset="utf-8">
|
58 |
<ul>
|
59 |
<li class="active"><a href="#tab-1-content">Properties</a></li>
|
60 |
<li><a href="#tab-2-content">Icon</a></li>
|
61 |
+
<li><a href="#tab-3-content">Templates</a></li>
|
62 |
+
<!--<li class="settings"><a href="#tab-4-content"><div data-code="f111" class="dashicons dashicons-admin-generic active"></div></a></li>-->
|
63 |
</ul><div class="clear"></div>
|
64 |
</div>
|
65 |
|
221 |
<?php require_once("fa-medical-grid.php"); ?>
|
222 |
<div class="clear"></div>
|
223 |
</div>
|
224 |
+
<div class="clear"></div>
|
225 |
+
</div>
|
226 |
+
</div>
|
227 |
+
<div id="tab-3-content" class="fasc-tab-content saved-buttons-tab">
|
228 |
+
|
229 |
+
<div class="container-grid">
|
230 |
+
|
231 |
+
<ul>
|
232 |
+
</ul>
|
233 |
+
|
234 |
+
<div class="clear"></div>
|
235 |
+
</div>
|
236 |
+
</div>
|
237 |
+
<div id="tab-4-content" class="fasc-tab-content">
|
238 |
+
<strong>Button Attributes</strong>
|
239 |
+
<div class="container-grid">
|
240 |
+
|
241 |
+
|
242 |
+
|
243 |
<div class="clear"></div>
|
244 |
</div>
|
245 |
</div>
|
assets/js/fasc-buttons/scripts.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
(function(e){"use strict";var t="1.0.4";e(function(){tinymce.create("tinymce.plugins.fascbuttons",{init:function(n,r){function i(){var e=tinymce.activeEditor.dom.select(".fasc-button");var t=false;jQuery(e).each(function(){if(jQuery(this).is("[data-fasc-style]")){var e=jQuery(this).attr("data-fasc-style").replace(/\s+/,"");var r="";if(jQuery(this).is("[style]")){r=jQuery(this).attr("style").replace(/\s+/,"")}if(e!=r){jQuery(this).attr("style",jQuery(this).attr("data-fasc-style"));n.nodeChanged();t=true}}});if(t==true){n.undoManager.removeLevel()}}function s(){var t=tinymce.activeEditor.dom.select(".fasc-button");jQuery(t).each(function(){if(jQuery(this).is("[data-fasc-style]")){var t=tinymce.activeEditor.dom.parseStyle(jQuery(this).attr("data-fasc-style"));var n=tinymce.activeEditor.dom.parseStyle(jQuery(this).attr("style"));if(e(t).not(n).length==0&&e(n).not(t).length==0){}else{}}})}var o=n;var u=false;var a={};var f=520;var l=420;if(tinymce.majorVersion<4){alert("FASC Buttons only work with WordPress 3.9 and above. Please update your WordPress installation")}n.addButton("fascbuttons",{icon:"fascbutton-ico",tooltip:"Insert Button",onclick:function(){n.windowManager.open({url:r+"/popup.php?ver="+t+"&source=insert",width:l,height:f},{plugin_url:r})}});n.on("change",function(e){});n.on("PastePostProcess",function(){i()});n.onInit.add(function(e){e.undoManager.onAdd.add(function(e,t){});e.undoManager.removeLevel=function(){if(this.data.length>1){this.data.splice(this.data.length-1,1)}}});n.on("undo",function(e,t){s()});n.on("redo",function(e){});n.on("dblClick",function(e){if(jQuery(e.target).hasClass("fasc-button")){n.selection.select(e.toElement);n.windowManager.open({url:r+"/popup.php?ver="+t+"&source=click",width:l,height:f},{plugin_url:r,target:jQuery(e.target)})}});n.on("click",function(e,t){});n.on("keyDown",function(e,t){})},createControl:function(e,t){return null},getInfo:function(){return{longname:"Forget About Shortcodes Buttons",author:"Ross Morsali",authorurl:"http://www.designsandcode.com/",infourl:"",version:"1.0.4"}}});tinymce.PluginManager.add("fascbuttons",tinymce.plugins.fascbuttons)})})(jQuery)
|
|
assets/js/fasc-buttons/scripts.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(e){"use strict";var t=fasc_ver;e(function(){tinymce.create("tinymce.plugins.fascbuttons",{init:function(n,r){function i(){var e=tinymce.activeEditor.dom.select(".fasc-button");var t=false;jQuery(e).each(function(){if(jQuery(this).is("[data-fasc-style]")){var e=jQuery(this).attr("data-fasc-style").replace(/\s+/,"");var r="";if(jQuery(this).is("[style]")){r=jQuery(this).attr("style").replace(/\s+/,"")}if(e!=r){jQuery(this).attr("style",jQuery(this).attr("data-fasc-style"));n.nodeChanged();t=true}}});if(t==true){n.undoManager.removeLevel()}}function s(){var t=tinymce.activeEditor.dom.select(".fasc-button");jQuery(t).each(function(){if(jQuery(this).is("[data-fasc-style]")){var t=tinymce.activeEditor.dom.parseStyle(jQuery(this).attr("data-fasc-style"));var n=tinymce.activeEditor.dom.parseStyle(jQuery(this).attr("style"));if(e(t).not(n).length==0&&e(n).not(t).length==0){}else{}}})}var o=n;var u=false;var a={};var f=520;var l=420;if(tinymce.majorVersion<4){alert("FASC Buttons only work with WordPress 3.9 and above. Please update your WordPress installation")}n.addButton("fascbuttons",{icon:"fascbutton-ico",tooltip:"Insert Button",onclick:function(){n.windowManager.open({url:r+"/popup.php?ver="+t+"&source=insert&ajaxurl="+encodeURIComponent(fasc_ajaxurl),width:l,height:f},{plugin_url:r})}});n.on("change",function(e){});n.on("PastePostProcess",function(){i()});n.onInit.add(function(e){e.undoManager.onAdd.add(function(e,t){});e.undoManager.removeLevel=function(){if(this.data.length>1){this.data.splice(this.data.length-1,1)}}});n.on("undo",function(e,t){s()});n.on("redo",function(e){});n.on("dblClick",function(e){if(jQuery(e.target).hasClass("fasc-button")){n.selection.select(e.toElement);n.windowManager.open({url:r+"/popup.php?ver="+t+"&source=click&ajaxurl="+encodeURIComponent(fasc_ajaxurl),width:l,height:f},{plugin_url:r,target:jQuery(e.target)})}});n.on("click",function(e,t){});n.on("keyDown",function(e,t){})},createControl:function(e,t){return null},getInfo:function(){return{longname:"Forget About Shortcodes Buttons",author:"Ross Morsali",authorurl:"http://www.designsandcode.com/",infourl:"",version:"1.0.4"}}});tinymce.PluginManager.add("fascbuttons",tinymce.plugins.fascbuttons)})})(jQuery)
|
assets/js/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Silence is golden
|
forget-about-shortcode-buttons.php
CHANGED
@@ -6,7 +6,7 @@ Description: A visual way to add CSS buttons in the post editor screen.
|
|
6 |
Author: Designs & Code
|
7 |
Author URI: http://www.designsandcode.com/
|
8 |
License: GPL v3
|
9 |
-
Version: 1.0
|
10 |
Text Domain: fascbuttons
|
11 |
*/
|
12 |
|
@@ -14,7 +14,7 @@ Text Domain: fascbuttons
|
|
14 |
* Set up Plugin Globals
|
15 |
*/
|
16 |
if (!defined('FASC_BUTTONS_VERSION_NUM'))
|
17 |
-
define('FASC_BUTTONS_VERSION_NUM', '1.0
|
18 |
|
19 |
if (!defined('PLUGIN_SLUG'))
|
20 |
define('PLUGIN_SLUG', 'fasc-buttons');
|
@@ -48,8 +48,7 @@ if ( ! class_exists( 'FascButtons' ) )
|
|
48 |
{
|
49 |
class FascButtons
|
50 |
{
|
51 |
-
|
52 |
-
|
53 |
public function __construct()
|
54 |
{
|
55 |
//admin styles
|
@@ -63,7 +62,139 @@ if ( ! class_exists( 'FascButtons' ) )
|
|
63 |
//regular styles
|
64 |
add_action( 'wp_print_styles', array($this, 'fasc_fe_styles') );
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
public function fasc_fe_styles()
|
68 |
{
|
69 |
wp_enqueue_style( 'fasc-buttons-style', plugins_url( '/assets/css/button-styles.css' , __FILE__ ), array(), FASC_BUTTONS_VERSION_NUM );
|
@@ -86,7 +217,7 @@ if ( ! class_exists( 'FascButtons' ) )
|
|
86 |
|
87 |
public function add_mce_plugin( $plugin_array )
|
88 |
{
|
89 |
-
$plugin_array["fascbuttons"] = plugins_url( '/assets/js/'.PLUGIN_SLUG.'/scripts.js?ver='.FASC_BUTTONS_VERSION_NUM , __FILE__ );
|
90 |
return $plugin_array;
|
91 |
}
|
92 |
|
6 |
Author: Designs & Code
|
7 |
Author URI: http://www.designsandcode.com/
|
8 |
License: GPL v3
|
9 |
+
Version: 1.1.0
|
10 |
Text Domain: fascbuttons
|
11 |
*/
|
12 |
|
14 |
* Set up Plugin Globals
|
15 |
*/
|
16 |
if (!defined('FASC_BUTTONS_VERSION_NUM'))
|
17 |
+
define('FASC_BUTTONS_VERSION_NUM', '1.1.0');
|
18 |
|
19 |
if (!defined('PLUGIN_SLUG'))
|
20 |
define('PLUGIN_SLUG', 'fasc-buttons');
|
48 |
{
|
49 |
class FascButtons
|
50 |
{
|
51 |
+
|
|
|
52 |
public function __construct()
|
53 |
{
|
54 |
//admin styles
|
62 |
//regular styles
|
63 |
add_action( 'wp_print_styles', array($this, 'fasc_fe_styles') );
|
64 |
|
65 |
+
//Admin Ajax
|
66 |
+
add_action( 'wp_ajax_fasc_buttons', array($this, 'fasc_buttons') ); //if logged in
|
67 |
+
|
68 |
+
add_action('admin_head', array($this, 'my_add_styles_admin'));
|
69 |
+
}
|
70 |
+
|
71 |
+
public function my_add_styles_admin() {
|
72 |
+
|
73 |
+
global $current_screen;
|
74 |
+
$type = $current_screen->post_type;
|
75 |
+
|
76 |
+
if (is_admin() && $type == 'post' || $type == 'page') {
|
77 |
+
?>
|
78 |
+
<script type="text/javascript">
|
79 |
+
var fasc_ajaxurl = '<?php echo admin_url( 'admin-ajax.php' ); ?>';
|
80 |
+
var fasc_ver = '<?php echo FASC_BUTTONS_VERSION_NUM; ?>';
|
81 |
+
</script>
|
82 |
+
<?php
|
83 |
+
}
|
84 |
}
|
85 |
+
public function fasc_buttons()
|
86 |
+
{
|
87 |
+
if($_GET['load']=="save_button")
|
88 |
+
{
|
89 |
+
//$buttons = get_user_meta(get_current_user_id(), 'fasc-buttons', true); //get existing buttons
|
90 |
+
$buttons = get_option('fasc-buttons'); //get existing buttons
|
91 |
+
|
92 |
+
//var_dump($buttons);
|
93 |
+
if(!is_array($buttons))
|
94 |
+
{
|
95 |
+
$buttons = array();
|
96 |
+
}
|
97 |
+
|
98 |
+
$button_html = $_POST['button'];
|
99 |
+
if($button_html!="")
|
100 |
+
{
|
101 |
+
|
102 |
+
$button_html = stripslashes($button_html);
|
103 |
+
|
104 |
+
$button_number = count($buttons)+1;
|
105 |
+
|
106 |
+
$button_data = array();
|
107 |
+
$button_data['name'] = "Button ".$button_number;
|
108 |
+
$button_data['html'] = $button_html;
|
109 |
+
|
110 |
+
array_push($buttons, $button_data);
|
111 |
+
|
112 |
+
}
|
113 |
+
|
114 |
+
//update_user_meta(get_current_user_id(), 'fasc-buttons', $buttons);
|
115 |
+
update_option('fasc-buttons', $buttons);
|
116 |
+
|
117 |
+
$buttons = array_reverse($buttons);
|
118 |
+
|
119 |
+
echo json_encode($buttons);
|
120 |
+
}
|
121 |
+
else if($_GET['load']=="get_buttons")
|
122 |
+
{
|
123 |
+
//$buttons = get_user_meta(get_current_user_id(), 'fasc-buttons', true); //get existing buttons
|
124 |
+
$buttons = get_option('fasc-buttons'); //get existing buttons
|
125 |
+
|
126 |
+
if(!is_array($buttons))
|
127 |
+
{
|
128 |
+
$buttons = array();
|
129 |
+
}
|
130 |
+
|
131 |
+
$buttons = array_reverse($buttons);
|
132 |
+
|
133 |
+
echo json_encode($buttons);
|
134 |
+
}
|
135 |
+
else if($_GET['load']=="remove_button")
|
136 |
+
{
|
137 |
+
//$buttons = get_user_meta(get_current_user_id(), 'fasc-buttons', true); //get existing buttons
|
138 |
+
$buttons = get_option('fasc-buttons'); //get existing buttons
|
139 |
+
|
140 |
+
if(!is_array($buttons))
|
141 |
+
{
|
142 |
+
$buttons = array();
|
143 |
+
}
|
144 |
+
|
145 |
+
$buttons = array_reverse($buttons);
|
146 |
+
|
147 |
+
$removeIndex = (int)$_GET['index'];
|
148 |
+
|
149 |
+
unset($buttons[$removeIndex]);
|
150 |
+
|
151 |
+
$newButtons = array_reverse($buttons);
|
152 |
+
//update_user_meta(get_current_user_id(), 'fasc-buttons', $newButtons);
|
153 |
+
update_option('fasc-buttons', $newButtons);
|
154 |
+
|
155 |
+
echo json_encode($buttons);
|
156 |
+
}
|
157 |
+
else if($_GET['load']=="update_button")
|
158 |
+
{
|
159 |
+
//$buttons = get_user_meta(get_current_user_id(), 'fasc-buttons', true); //get existing buttons
|
160 |
+
$buttons = get_option('fasc-buttons'); //get existing buttons
|
161 |
+
|
162 |
+
if(!is_array($buttons))
|
163 |
+
{
|
164 |
+
$buttons = array();
|
165 |
+
}
|
166 |
+
|
167 |
+
$buttons = array_reverse($buttons);
|
168 |
+
|
169 |
+
$renameIndex = (int)$_GET['index'];
|
170 |
+
|
171 |
+
$name = $_GET['name'];
|
172 |
+
$buttons[$renameIndex]['name'] = $name;
|
173 |
+
|
174 |
+
$newButtons = array_reverse($buttons);
|
175 |
+
//update_user_meta(get_current_user_id(), 'fasc-buttons', $newButtons);
|
176 |
+
update_option('fasc-buttons', $newButtons);
|
177 |
+
|
178 |
+
echo json_encode($buttons);
|
179 |
+
}
|
180 |
+
else
|
181 |
+
{
|
182 |
+
$msg = array();
|
183 |
+
$msg['error'] = "1";
|
184 |
+
|
185 |
+
echo json_encode($msg);
|
186 |
+
}
|
187 |
+
|
188 |
+
//var_dump($_GET);
|
189 |
+
//delete_user_meta(get_current_user_id(), 'fasc-buttons');
|
190 |
+
exit;
|
191 |
+
}
|
192 |
+
|
193 |
+
public function save_presets()
|
194 |
+
{
|
195 |
+
|
196 |
+
}
|
197 |
+
|
198 |
public function fasc_fe_styles()
|
199 |
{
|
200 |
wp_enqueue_style( 'fasc-buttons-style', plugins_url( '/assets/css/button-styles.css' , __FILE__ ), array(), FASC_BUTTONS_VERSION_NUM );
|
217 |
|
218 |
public function add_mce_plugin( $plugin_array )
|
219 |
{
|
220 |
+
$plugin_array["fascbuttons"] = plugins_url( '/assets/js/'.PLUGIN_SLUG.'/scripts.min.js?ver='.FASC_BUTTONS_VERSION_NUM , __FILE__ );
|
221 |
return $plugin_array;
|
222 |
}
|
223 |
|
index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Silence is golden
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: DesignsAndCode
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ZAHPNUHNUBQJY&lc=GB&item_name=Ross%20Morsali&item_number=wordpress%2dplugin¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted
|
4 |
Tags: css, button, shortcode, edit, visual editor, buttons, wysiwyg, post editor, tinymce, shortcodes, button editor
|
5 |
Requires at least: 3.9
|
6 |
-
Tested up to:
|
7 |
-
Stable tag: 1.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -31,6 +31,10 @@ Ask me some questions!
|
|
31 |
|
32 |
== Changelog ==
|
33 |
|
|
|
|
|
|
|
|
|
34 |
= 1.0.4 =
|
35 |
* Bug fix - properly use WP versioning and cache busting methods - upgrading to 1.0.3 caused some layout errors for some users as assets were being loaded from the cache - should be no more problems regarding caching and updating the plugin now
|
36 |
|
@@ -59,7 +63,7 @@ Ask me some questions!
|
|
59 |
|
60 |
**This plugin is only compatible with WordPress 3.9 and upwards**
|
61 |
|
62 |
-
**
|
63 |
|
64 |
Forget About Shortcode (FASC) Buttons are a visual way to add CSS buttons in the post editor screen and to your themes. Instead of adding shortcodes in the post editor, you insert real, styled buttons - making the process of adding buttons to your posts and pages much more natural whilst improving the appearance and usability of the post editor.
|
65 |
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ZAHPNUHNUBQJY&lc=GB&item_name=Ross%20Morsali&item_number=wordpress%2dplugin¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted
|
4 |
Tags: css, button, shortcode, edit, visual editor, buttons, wysiwyg, post editor, tinymce, shortcodes, button editor
|
5 |
Requires at least: 3.9
|
6 |
+
Tested up to: 4.2
|
7 |
+
Stable tag: 1.1.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
31 |
|
32 |
== Changelog ==
|
33 |
|
34 |
+
= 1.1.0 =
|
35 |
+
* Save buttons!
|
36 |
+
* Prevent directory listing of folders by adding blank index.php files to all folders - silence is golden!
|
37 |
+
|
38 |
= 1.0.4 =
|
39 |
* Bug fix - properly use WP versioning and cache busting methods - upgrading to 1.0.3 caused some layout errors for some users as assets were being loaded from the cache - should be no more problems regarding caching and updating the plugin now
|
40 |
|
63 |
|
64 |
**This plugin is only compatible with WordPress 3.9 and upwards**
|
65 |
|
66 |
+
**Feature requests/ideas welcome!**
|
67 |
|
68 |
Forget About Shortcode (FASC) Buttons are a visual way to add CSS buttons in the post editor screen and to your themes. Instead of adding shortcodes in the post editor, you insert real, styled buttons - making the process of adding buttons to your posts and pages much more natural whilst improving the appearance and usability of the post editor.
|
69 |
|