Version Description
- New - added support for FASC buttons in WP 4.8 widget areas :)
- Fix - an issue with button styles in the admin area, only when they were selected (this is due to some new CSS classes being added in WP 4.8)
- Fix - some copy / paste issues and buttons losing their styles (WP 4.8 bug)
- Fix - a compatibility with other TinyMCE related plugins - FASC was extending the view object incorrectly
- Fix - some issues on the
PostProcess
TinyMCE event, made sure FASC only handles this when there are FASC buttons to be handled
Download this release
Release Info
Developer | DesignsAndCode |
Plugin | Forget About Shortcode Buttons |
Version | 2.1.0 |
Comparing to | |
See all releases |
Code changes from version 2.0.1 to 2.1.0
- admin/class-forget-about-shortcode-buttons-admin.php +4 -3
- admin/css/button-styles.css +118 -9
- admin/css/forget-about-shortcode-buttons-mce.css +2 -21
- admin/js/forget-about-shortcode-buttons-admin.js +1 -1
- admin/js/forget-about-shortcode-buttons-fasc-views.js +1 -25
- admin/js/jquery.minicolors.min.js +1 -11
- admin/js/mce/fasc-button.js +1 -1
- admin/js/mce/fasc-plugin.js +1 -6
- forget-about-shortcode-buttons.php +2 -2
- includes/class-forget-about-shortcode-buttons.php +1 -1
- readme.txt +14 -5
admin/class-forget-about-shortcode-buttons-admin.php
CHANGED
@@ -237,7 +237,7 @@ class Forget_About_Shortcode_Buttons_Admin {
|
|
237 |
|
238 |
$post_types = get_post_types( $args, 'names' );
|
239 |
|
240 |
-
if (is_admin() && in_array($type, $post_types) && ( $this->is_edit_page() ) ) {
|
241 |
|
242 |
//wp_enqueue_script( 'thickbox' );
|
243 |
wp_enqueue_script( 'wp-color-picker' );
|
@@ -246,7 +246,7 @@ class Forget_About_Shortcode_Buttons_Admin {
|
|
246 |
//wp_enqueue_script( $this->plugin_name.'-fasc-plugin', plugin_dir_url( __FILE__ ) . 'js/forget-about-shortcode-buttons-fasc-plugin.js', array( 'jquery', 'editor', $this->plugin_name.'-fasc-views' ), $this->version, false );
|
247 |
|
248 |
wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/forget-about-shortcode-buttons-admin.js', array( 'jquery', $this->plugin_name.'-fasc-views', 'wp-color-picker' ), $this->version, false );
|
249 |
-
wp_localize_script($this->plugin_name, 'Fasc', array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'home_url' => (home_url('/')) ));
|
250 |
|
251 |
wp_enqueue_script( $this->plugin_name.'-minicolors', plugin_dir_url( __FILE__ ) . 'js/jquery.minicolors.min.js', array( 'jquery', $this->plugin_name.'-fasc-views', 'wp-color-picker' ), $this->version, false );
|
252 |
}
|
@@ -267,6 +267,7 @@ class Forget_About_Shortcode_Buttons_Admin {
|
|
267 |
|
268 |
global $current_screen;
|
269 |
$type = $current_screen->post_type;
|
|
|
270 |
|
271 |
//only add the script to post edit screens and all public post types
|
272 |
$args = array(
|
@@ -275,7 +276,7 @@ class Forget_About_Shortcode_Buttons_Admin {
|
|
275 |
|
276 |
$post_types = get_post_types( $args, 'names' );
|
277 |
|
278 |
-
if (is_admin() && in_array($type, $post_types) ) {
|
279 |
|
280 |
// insert relevant templates
|
281 |
require_once plugin_dir_path( __FILE__ ) . 'partials/forget-about-shortcode-buttons-admin-backbone-templates.php';
|
237 |
|
238 |
$post_types = get_post_types( $args, 'names' );
|
239 |
|
240 |
+
if (is_admin() && ( ( in_array($type, $post_types) && ( $this->is_edit_page() ) ) || ( $base == "widgets" ) )) {
|
241 |
|
242 |
//wp_enqueue_script( 'thickbox' );
|
243 |
wp_enqueue_script( 'wp-color-picker' );
|
246 |
//wp_enqueue_script( $this->plugin_name.'-fasc-plugin', plugin_dir_url( __FILE__ ) . 'js/forget-about-shortcode-buttons-fasc-plugin.js', array( 'jquery', 'editor', $this->plugin_name.'-fasc-views' ), $this->version, false );
|
247 |
|
248 |
wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/forget-about-shortcode-buttons-admin.js', array( 'jquery', $this->plugin_name.'-fasc-views', 'wp-color-picker' ), $this->version, false );
|
249 |
+
wp_localize_script($this->plugin_name, 'Fasc', array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'plugin_url' => plugin_dir_url( __FILE__ ), 'home_url' => (home_url('/')) ));
|
250 |
|
251 |
wp_enqueue_script( $this->plugin_name.'-minicolors', plugin_dir_url( __FILE__ ) . 'js/jquery.minicolors.min.js', array( 'jquery', $this->plugin_name.'-fasc-views', 'wp-color-picker' ), $this->version, false );
|
252 |
}
|
267 |
|
268 |
global $current_screen;
|
269 |
$type = $current_screen->post_type;
|
270 |
+
$base = $current_screen->base;
|
271 |
|
272 |
//only add the script to post edit screens and all public post types
|
273 |
$args = array(
|
276 |
|
277 |
$post_types = get_post_types( $args, 'names' );
|
278 |
|
279 |
+
if (is_admin() && ( in_array($type, $post_types) || ( $base == "widgets" ) ) ) {
|
280 |
|
281 |
// insert relevant templates
|
282 |
require_once plugin_dir_path( __FILE__ ) . 'partials/forget-about-shortcode-buttons-admin-backbone-templates.php';
|
admin/css/button-styles.css
CHANGED
@@ -2,6 +2,8 @@
|
|
2 |
/* hacky? */
|
3 |
@import url('font-awesome.min.css'); /* hacky? */
|
4 |
|
|
|
|
|
5 |
a.fasc-button
|
6 |
{
|
7 |
display:inline-block;
|
@@ -14,6 +16,9 @@ a.fasc-button
|
|
14 |
box-shadow: none;
|
15 |
box-sizing: border-box;
|
16 |
}
|
|
|
|
|
|
|
17 |
a.fasc-button:hover, a.fasc-button:focus, a.fasc-button:visited, a.fasc-button:active
|
18 |
{
|
19 |
text-decoration:none;
|
@@ -23,6 +28,10 @@ a.fasc-button:hover, a.fasc-button:focus, a.fasc-button:visited, a.fasc-button
|
|
23 |
}
|
24 |
|
25 |
/*a.fasc-button.fasc-ico:before, */
|
|
|
|
|
|
|
|
|
26 |
a.fasc-button.fasc-ico-before:before,
|
27 |
a.fasc-button.fasc-ico-after:after
|
28 |
{
|
@@ -31,32 +40,45 @@ a.fasc-button.fasc-ico-after:after
|
|
31 |
-webkit-font-smoothing: antialiased;
|
32 |
margin-top:-2px;
|
33 |
}
|
|
|
|
|
34 |
a.fasc-button.fasc-ico-after:before
|
35 |
{
|
36 |
display: none;
|
37 |
content: none;
|
38 |
}
|
39 |
/* before icons */
|
40 |
-
a.fasc-size-xsmall.fasc-ico-before:before
|
|
|
|
|
|
|
41 |
font:400 12px/1 dashicons;
|
42 |
padding-right:4px;
|
43 |
}
|
|
|
|
|
44 |
a.fasc-size-small.fasc-ico-before:before
|
45 |
{
|
46 |
font:400 14px/1 dashicons;
|
47 |
padding-right:4px;
|
48 |
}
|
|
|
|
|
49 |
a.fasc-size-medium.fasc-ico-before:before
|
50 |
{
|
51 |
font:400 16px/1 dashicons;
|
52 |
padding-right:5px;
|
53 |
}
|
|
|
|
|
54 |
a.fasc-size-large.fasc-ico-before:before
|
55 |
{
|
56 |
font:400 20px/1 dashicons;
|
57 |
padding-right:6px;
|
58 |
line-height:22px;
|
59 |
}
|
|
|
|
|
60 |
a.fasc-size-xlarge.fasc-ico-before:before
|
61 |
{
|
62 |
font:400 28px/1 dashicons;
|
@@ -65,6 +87,8 @@ a.fasc-size-xlarge.fasc-ico-before:before
|
|
65 |
}
|
66 |
|
67 |
|
|
|
|
|
68 |
a.fasc-button.ico-fa.fasc-ico-before:before
|
69 |
{
|
70 |
vertical-align:middle;
|
@@ -74,28 +98,38 @@ a.fasc-button.ico-fa.fasc-ico-before:before
|
|
74 |
padding-top:0;
|
75 |
padding-left:1px;
|
76 |
}
|
|
|
|
|
77 |
a.fasc-size-xsmall.ico-fa.fasc-ico-before:before
|
78 |
{
|
79 |
font:400 11px/1 FontAwesome;
|
80 |
padding-right:6px;
|
81 |
}
|
|
|
|
|
82 |
a.fasc-size-small.ico-fa.fasc-ico-before:before
|
83 |
{
|
84 |
font:400 13px/1 FontAwesome;
|
85 |
padding-right:7px;
|
86 |
|
87 |
}
|
|
|
|
|
88 |
a.fasc-size-medium.ico-fa.fasc-ico-before:before
|
89 |
{
|
90 |
font:400 15px/1 FontAwesome;
|
91 |
padding-right:8px;
|
92 |
}
|
|
|
|
|
93 |
a.fasc-size-large.ico-fa.fasc-ico-before:before
|
94 |
{
|
95 |
font:400 19px/1 FontAwesome;
|
96 |
padding-right:9px;
|
97 |
line-height:22px;
|
98 |
}
|
|
|
|
|
99 |
a.fasc-size-xlarge.ico-fa.fasc-ico-before:before
|
100 |
{
|
101 |
font:400 28px/1 FontAwesome;
|
@@ -108,28 +142,39 @@ a.fasc-size-xlarge.ico-fa.fasc-ico-before:before
|
|
108 |
|
109 |
|
110 |
|
111 |
-
a.fasc-size-xsmall.fasc-ico-after:after
|
|
|
|
|
|
|
112 |
font:400 12px/1 dashicons;
|
113 |
padding-left:4px;
|
114 |
}
|
115 |
|
|
|
|
|
116 |
a.fasc-size-small.fasc-ico-after:after
|
117 |
{
|
118 |
font:400 14px/1 dashicons;
|
119 |
padding-left:4px;
|
120 |
}
|
121 |
|
|
|
|
|
122 |
a.fasc-size-medium.fasc-ico-after:after
|
123 |
{
|
124 |
font:400 16px/1 dashicons;
|
125 |
padding-left:5px;
|
126 |
}
|
|
|
|
|
127 |
a.fasc-size-large.fasc-ico-after:after
|
128 |
{
|
129 |
font:400 20px/1 dashicons;
|
130 |
padding-left:6px;
|
131 |
line-height:22px;
|
132 |
}
|
|
|
|
|
133 |
a.fasc-size-xlarge.fasc-ico-after:after
|
134 |
{
|
135 |
font:400 28px/1 dashicons;
|
@@ -138,6 +183,8 @@ a.fasc-size-xlarge.fasc-ico-after:after
|
|
138 |
}
|
139 |
|
140 |
|
|
|
|
|
141 |
a.fasc-button.ico-fa.fasc-ico-after:after
|
142 |
{
|
143 |
vertical-align:middle;
|
@@ -147,28 +194,38 @@ a.fasc-button.ico-fa.fasc-ico-after:after
|
|
147 |
padding-top:0;
|
148 |
padding-right:1px;
|
149 |
}
|
|
|
|
|
150 |
a.fasc-size-xsmall.ico-fa.fasc-ico-after:after
|
151 |
{
|
152 |
font:400 11px/1 FontAwesome;
|
153 |
padding-left:6px;
|
154 |
}
|
|
|
|
|
155 |
a.fasc-size-small.ico-fa.fasc-ico-after:after
|
156 |
{
|
157 |
font:400 13px/1 FontAwesome;
|
158 |
padding-left:7px;
|
159 |
|
160 |
}
|
|
|
|
|
161 |
a.fasc-size-medium.ico-fa.fasc-ico-after:after
|
162 |
{
|
163 |
font:400 15px/1 FontAwesome;
|
164 |
padding-left:8px;
|
165 |
}
|
|
|
|
|
166 |
a.fasc-size-large.ico-fa.fasc-ico-after:after
|
167 |
{
|
168 |
font:400 19px/1 FontAwesome;
|
169 |
padding-left:9px;
|
170 |
line-height:22px;
|
171 |
}
|
|
|
|
|
172 |
a.fasc-size-xlarge.ico-fa.fasc-ico-after:after
|
173 |
{
|
174 |
font:400 28px/1 FontAwesome;
|
@@ -179,12 +236,16 @@ a.fasc-size-xlarge.ico-fa.fasc-ico-after:after
|
|
179 |
|
180 |
|
181 |
/* sizes */
|
|
|
|
|
182 |
.fasc-size-xsmall
|
183 |
{
|
184 |
font-size:10px;
|
185 |
padding:5px 7px;
|
186 |
border:0;
|
187 |
}
|
|
|
|
|
188 |
.fasc-size-small
|
189 |
{
|
190 |
font-size:12px;
|
@@ -193,6 +254,8 @@ a.fasc-size-xlarge.ico-fa.fasc-ico-after:after
|
|
193 |
line-height: 17px;
|
194 |
}
|
195 |
|
|
|
|
|
196 |
.fasc-size-medium
|
197 |
{
|
198 |
font-size:14px;
|
@@ -202,6 +265,8 @@ a.fasc-size-xlarge.ico-fa.fasc-ico-after:after
|
|
202 |
border:0;
|
203 |
}
|
204 |
|
|
|
|
|
205 |
.fasc-size-large
|
206 |
{
|
207 |
font-size:18px;
|
@@ -209,10 +274,12 @@ a.fasc-size-xlarge.ico-fa.fasc-ico-after:after
|
|
209 |
border:0;
|
210 |
line-height: 24px;
|
211 |
}
|
|
|
|
|
212 |
.fasc-size-xlarge
|
213 |
{
|
214 |
font-size:24px;
|
215 |
-
padding:11px 13px;
|
216 |
border:0;
|
217 |
line-height: 33px;
|
218 |
}
|
@@ -231,6 +298,8 @@ a.fasc-size-xlarge.ico-fa.fasc-ico-after:after
|
|
231 |
|
232 |
/* glossy */
|
233 |
|
|
|
|
|
234 |
a.fasc-type-glossy
|
235 |
{
|
236 |
background-color: #247edd;
|
@@ -242,6 +311,8 @@ a.fasc-type-glossy
|
|
242 |
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.12) 51%, rgba(0, 0, 0, 0.04));
|
243 |
|
244 |
}
|
|
|
|
|
245 |
a.fasc-type-glossy:hover
|
246 |
{
|
247 |
/* remove hover effects for tinymce editor */
|
@@ -277,6 +348,10 @@ a.fasc-type-glossy:hover
|
|
277 |
|
278 |
|
279 |
/* 3d */ /* changes to prevent rollover, :hover should be set to same as regular */
|
|
|
|
|
|
|
|
|
280 |
.fasc-type-popout.fasc-size-xlarge,
|
281 |
.fasc-type-popout.fasc-size-xlarge:hover
|
282 |
{
|
@@ -284,6 +359,10 @@ a.fasc-type-glossy:hover
|
|
284 |
-moz-box-shadow: 7px 7px 0px #777777;
|
285 |
box-shadow: 7px 7px 0px #777777;
|
286 |
}
|
|
|
|
|
|
|
|
|
287 |
.fasc-type-popout.fasc-size-large,
|
288 |
.fasc-type-popout.fasc-size-large:hover
|
289 |
{
|
@@ -291,6 +370,10 @@ a.fasc-type-glossy:hover
|
|
291 |
-moz-box-shadow: 6px 6px 0px #777777;
|
292 |
box-shadow: 6px 6px 0px #777777;
|
293 |
}
|
|
|
|
|
|
|
|
|
294 |
.fasc-type-popout.fasc-size-medium,
|
295 |
.fasc-type-popout.fasc-size-medium:hover
|
296 |
{
|
@@ -298,6 +381,10 @@ a.fasc-type-glossy:hover
|
|
298 |
-moz-box-shadow: 5px 5px 0px #777777;
|
299 |
box-shadow: 5px 5px 0px #777777;
|
300 |
}
|
|
|
|
|
|
|
|
|
301 |
.fasc-type-popout.fasc-size-small,
|
302 |
.fasc-type-popout.fasc-size-small:hover
|
303 |
{
|
@@ -305,6 +392,10 @@ a.fasc-type-glossy:hover
|
|
305 |
-moz-box-shadow: 4px 4px 0px #777777;
|
306 |
box-shadow: 4px 4px 0px #777777;
|
307 |
}
|
|
|
|
|
|
|
|
|
308 |
.fasc-type-popout.fasc-size-xsmall,
|
309 |
.fasc-type-popout.fasc-size-xsmall:hover
|
310 |
{
|
@@ -323,42 +414,60 @@ a.fasc-type-glossy:hover
|
|
323 |
}
|
324 |
|
325 |
/* rounded */
|
326 |
-
a.fasc-button.rounded.fasc-size-xlarge, .fasc-rounded-medium.fasc-size-xlarge
|
|
|
|
|
327 |
{
|
328 |
border-radius:15px;
|
329 |
}
|
330 |
-
a.fasc-button.rounded.fasc-size-large, .fasc-rounded-medium.fasc-size-large
|
|
|
|
|
331 |
{
|
332 |
border-radius:10px;
|
333 |
}
|
334 |
-
a.fasc-button.rounded.fasc-size-medium, .fasc-rounded-medium.fasc-size-medium
|
|
|
|
|
335 |
{
|
336 |
border-radius:9px;
|
337 |
}
|
338 |
-
a.fasc-button.rounded.fasc-size-small, .fasc-rounded-medium.fasc-size-small
|
|
|
|
|
339 |
{
|
340 |
border-radius:8px;
|
341 |
}
|
342 |
-
a.fasc-button.rounded.fasc-size-xsmall, .fasc-rounded-medium.fasc-size-xsmall
|
|
|
|
|
343 |
{
|
344 |
border-radius:7px;
|
345 |
}
|
346 |
|
347 |
|
348 |
|
349 |
-
a.fasc-style-bold
|
|
|
|
|
350 |
{
|
351 |
font-weight:bold;
|
352 |
}
|
|
|
|
|
353 |
a.fasc-style-italic
|
354 |
{
|
355 |
font-style: italic;
|
356 |
}
|
|
|
|
|
357 |
a.fasc-style-strikethrough
|
358 |
{
|
359 |
text-decoration: line-through;
|
360 |
}
|
361 |
|
|
|
|
|
362 |
.fasc-button.fasc-style-strikethrough:hover
|
363 |
{
|
364 |
text-decoration: line-through;
|
2 |
/* hacky? */
|
3 |
@import url('font-awesome.min.css'); /* hacky? */
|
4 |
|
5 |
+
.mce-content-body a[data-mce-selected].fasc-button,
|
6 |
+
.mce-content-body a.fasc-button,
|
7 |
a.fasc-button
|
8 |
{
|
9 |
display:inline-block;
|
16 |
box-shadow: none;
|
17 |
box-sizing: border-box;
|
18 |
}
|
19 |
+
|
20 |
+
.mce-content-body a[data-mce-selected].fasc-button:hover, .mce-content-body a[data-mce-selected].fasc-button:focus, .mce-content-body a[data-mce-selected].fasc-button:visited, .mce-content-body a[data-mce-selected].fasc-button:active,
|
21 |
+
.mce-content-body a.fasc-button:hover, .mce-content-body a.fasc-button:focus, .mce-content-body a.fasc-button:visited, .mce-content-body a.fasc-button:active,
|
22 |
a.fasc-button:hover, a.fasc-button:focus, a.fasc-button:visited, a.fasc-button:active
|
23 |
{
|
24 |
text-decoration:none;
|
28 |
}
|
29 |
|
30 |
/*a.fasc-button.fasc-ico:before, */
|
31 |
+
.mce-content-body a[data-mce-selected].fasc-button.fasc-ico-before:before,
|
32 |
+
.mce-content-body a[data-mce-selected].fasc-button.fasc-ico-after:after,
|
33 |
+
.mce-content-body a.fasc-button.fasc-ico-before:before,
|
34 |
+
.mce-content-body a.fasc-button.fasc-ico-after:after,
|
35 |
a.fasc-button.fasc-ico-before:before,
|
36 |
a.fasc-button.fasc-ico-after:after
|
37 |
{
|
40 |
-webkit-font-smoothing: antialiased;
|
41 |
margin-top:-2px;
|
42 |
}
|
43 |
+
.mce-content-body a[data-mce-selected].fasc-button.fasc-ico-after:before,
|
44 |
+
.mce-content-body a.fasc-button.fasc-ico-after:before,
|
45 |
a.fasc-button.fasc-ico-after:before
|
46 |
{
|
47 |
display: none;
|
48 |
content: none;
|
49 |
}
|
50 |
/* before icons */
|
51 |
+
.mce-content-body a[data-mce-selected].fasc-size-xsmall.fasc-ico-before:before,
|
52 |
+
.mce-content-body a.fasc-size-xsmall.fasc-ico-before:before,
|
53 |
+
a.fasc-size-xsmall.fasc-ico-before:before
|
54 |
+
{
|
55 |
font:400 12px/1 dashicons;
|
56 |
padding-right:4px;
|
57 |
}
|
58 |
+
.mce-content-body a[data-mce-selected].fasc-size-small.fasc-ico-before:before,
|
59 |
+
.mce-content-body a.fasc-size-small.fasc-ico-before:before,
|
60 |
a.fasc-size-small.fasc-ico-before:before
|
61 |
{
|
62 |
font:400 14px/1 dashicons;
|
63 |
padding-right:4px;
|
64 |
}
|
65 |
+
.mce-content-body a[data-mce-selected].fasc-size-medium.fasc-ico-before:before,
|
66 |
+
.mce-content-body a.fasc-size-medium.fasc-ico-before:before,
|
67 |
a.fasc-size-medium.fasc-ico-before:before
|
68 |
{
|
69 |
font:400 16px/1 dashicons;
|
70 |
padding-right:5px;
|
71 |
}
|
72 |
+
.mce-content-body a[data-mce-selected].fasc-size-large.fasc-ico-before:before,
|
73 |
+
.mce-content-body a.fasc-size-large.fasc-ico-before:before,
|
74 |
a.fasc-size-large.fasc-ico-before:before
|
75 |
{
|
76 |
font:400 20px/1 dashicons;
|
77 |
padding-right:6px;
|
78 |
line-height:22px;
|
79 |
}
|
80 |
+
.mce-content-body a[data-mce-selected].fasc-size-xlarge.fasc-ico-before:before,
|
81 |
+
.mce-content-body a.fasc-size-xlarge.fasc-ico-before:before,
|
82 |
a.fasc-size-xlarge.fasc-ico-before:before
|
83 |
{
|
84 |
font:400 28px/1 dashicons;
|
87 |
}
|
88 |
|
89 |
|
90 |
+
.mce-content-body a[data-mce-selected].fasc-button.ico-fa.fasc-ico-before:before,
|
91 |
+
.mce-content-body a.fasc-button.ico-fa.fasc-ico-before:before,
|
92 |
a.fasc-button.ico-fa.fasc-ico-before:before
|
93 |
{
|
94 |
vertical-align:middle;
|
98 |
padding-top:0;
|
99 |
padding-left:1px;
|
100 |
}
|
101 |
+
.mce-content-body a[data-mce-selected].fasc-size-xsmall.ico-fa.fasc-ico-before:before,
|
102 |
+
.mce-content-body a.fasc-size-xsmall.ico-fa.fasc-ico-before:before,
|
103 |
a.fasc-size-xsmall.ico-fa.fasc-ico-before:before
|
104 |
{
|
105 |
font:400 11px/1 FontAwesome;
|
106 |
padding-right:6px;
|
107 |
}
|
108 |
+
.mce-content-body a[data-mce-selected].fasc-size-small.ico-fa.fasc-ico-before:before,
|
109 |
+
.mce-content-body a.fasc-size-small.ico-fa.fasc-ico-before:before,
|
110 |
a.fasc-size-small.ico-fa.fasc-ico-before:before
|
111 |
{
|
112 |
font:400 13px/1 FontAwesome;
|
113 |
padding-right:7px;
|
114 |
|
115 |
}
|
116 |
+
.mce-content-body a[data-mce-selected].fasc-size-medium.ico-fa.fasc-ico-before:before,
|
117 |
+
.mce-content-body a.fasc-size-medium.ico-fa.fasc-ico-before:before,
|
118 |
a.fasc-size-medium.ico-fa.fasc-ico-before:before
|
119 |
{
|
120 |
font:400 15px/1 FontAwesome;
|
121 |
padding-right:8px;
|
122 |
}
|
123 |
+
.mce-content-body a[data-mce-selected].fasc-size-large.ico-fa.fasc-ico-before:before,
|
124 |
+
.mce-content-body a.fasc-size-large.ico-fa.fasc-ico-before:before,
|
125 |
a.fasc-size-large.ico-fa.fasc-ico-before:before
|
126 |
{
|
127 |
font:400 19px/1 FontAwesome;
|
128 |
padding-right:9px;
|
129 |
line-height:22px;
|
130 |
}
|
131 |
+
.mce-content-body a[data-mce-selected].fasc-size-xlarge.ico-fa.fasc-ico-before:before,
|
132 |
+
.mce-content-body a.fasc-size-xlarge.ico-fa.fasc-ico-before:before,
|
133 |
a.fasc-size-xlarge.ico-fa.fasc-ico-before:before
|
134 |
{
|
135 |
font:400 28px/1 FontAwesome;
|
142 |
|
143 |
|
144 |
|
145 |
+
.mce-content-body a[data-mce-selected].fasc-size-xsmall.fasc-ico-after:after,
|
146 |
+
.mce-content-body a.fasc-size-xsmall.fasc-ico-after:after,
|
147 |
+
a.fasc-size-xsmall.fasc-ico-after:after
|
148 |
+
{
|
149 |
font:400 12px/1 dashicons;
|
150 |
padding-left:4px;
|
151 |
}
|
152 |
|
153 |
+
.mce-content-body a[data-mce-selected].fasc-size-small.fasc-ico-after:after,
|
154 |
+
.mce-content-body a.fasc-size-small.fasc-ico-after:after,
|
155 |
a.fasc-size-small.fasc-ico-after:after
|
156 |
{
|
157 |
font:400 14px/1 dashicons;
|
158 |
padding-left:4px;
|
159 |
}
|
160 |
|
161 |
+
.mce-content-body a[data-mce-selected].fasc-size-medium.fasc-ico-after:after,
|
162 |
+
.mce-content-body a.fasc-size-medium.fasc-ico-after:after,
|
163 |
a.fasc-size-medium.fasc-ico-after:after
|
164 |
{
|
165 |
font:400 16px/1 dashicons;
|
166 |
padding-left:5px;
|
167 |
}
|
168 |
+
.mce-content-body a[data-mce-selected].fasc-size-large.fasc-ico-after:after,
|
169 |
+
.mce-content-body a.fasc-size-large.fasc-ico-after:after,
|
170 |
a.fasc-size-large.fasc-ico-after:after
|
171 |
{
|
172 |
font:400 20px/1 dashicons;
|
173 |
padding-left:6px;
|
174 |
line-height:22px;
|
175 |
}
|
176 |
+
.mce-content-body a[data-mce-selected].fasc-size-xlarge.fasc-ico-after:after,
|
177 |
+
.mce-content-body a.fasc-size-xlarge.fasc-ico-after:after,
|
178 |
a.fasc-size-xlarge.fasc-ico-after:after
|
179 |
{
|
180 |
font:400 28px/1 dashicons;
|
183 |
}
|
184 |
|
185 |
|
186 |
+
.mce-content-body a[data-mce-selected].fasc-button.ico-fa.fasc-ico-after:after,
|
187 |
+
.mce-content-body a.fasc-button.ico-fa.fasc-ico-after:after,
|
188 |
a.fasc-button.ico-fa.fasc-ico-after:after
|
189 |
{
|
190 |
vertical-align:middle;
|
194 |
padding-top:0;
|
195 |
padding-right:1px;
|
196 |
}
|
197 |
+
.mce-content-body a[data-mce-selected].fasc-size-xsmall.ico-fa.fasc-ico-after:after,
|
198 |
+
.mce-content-body a.fasc-size-xsmall.ico-fa.fasc-ico-after:after,
|
199 |
a.fasc-size-xsmall.ico-fa.fasc-ico-after:after
|
200 |
{
|
201 |
font:400 11px/1 FontAwesome;
|
202 |
padding-left:6px;
|
203 |
}
|
204 |
+
.mce-content-body a[data-mce-selected].fasc-size-small.ico-fa.fasc-ico-after:after,
|
205 |
+
.mce-content-body a.fasc-size-small.ico-fa.fasc-ico-after:after,
|
206 |
a.fasc-size-small.ico-fa.fasc-ico-after:after
|
207 |
{
|
208 |
font:400 13px/1 FontAwesome;
|
209 |
padding-left:7px;
|
210 |
|
211 |
}
|
212 |
+
.mce-content-body a[data-mce-selected].fasc-size-medium.ico-fa.fasc-ico-after:after,
|
213 |
+
.mce-content-body a.fasc-size-medium.ico-fa.fasc-ico-after:after,
|
214 |
a.fasc-size-medium.ico-fa.fasc-ico-after:after
|
215 |
{
|
216 |
font:400 15px/1 FontAwesome;
|
217 |
padding-left:8px;
|
218 |
}
|
219 |
+
.mce-content-body a[data-mce-selected].fasc-size-large.ico-fa.fasc-ico-after:after,
|
220 |
+
.mce-content-body a.fasc-size-large.ico-fa.fasc-ico-after:after,
|
221 |
a.fasc-size-large.ico-fa.fasc-ico-after:after
|
222 |
{
|
223 |
font:400 19px/1 FontAwesome;
|
224 |
padding-left:9px;
|
225 |
line-height:22px;
|
226 |
}
|
227 |
+
.mce-content-body a[data-mce-selected].fasc-size-xlarge.ico-fa.fasc-ico-after:after,
|
228 |
+
.mce-content-body a.fasc-size-xlarge.ico-fa.fasc-ico-after:after,
|
229 |
a.fasc-size-xlarge.ico-fa.fasc-ico-after:after
|
230 |
{
|
231 |
font:400 28px/1 FontAwesome;
|
236 |
|
237 |
|
238 |
/* sizes */
|
239 |
+
.mce-content-body a[data-mce-selected].fasc-size-xsmall,
|
240 |
+
.mce-content-body a.fasc-size-xsmall,
|
241 |
.fasc-size-xsmall
|
242 |
{
|
243 |
font-size:10px;
|
244 |
padding:5px 7px;
|
245 |
border:0;
|
246 |
}
|
247 |
+
.mce-content-body a[data-mce-selected].fasc-size-small,
|
248 |
+
.mce-content-body a.fasc-size-small,
|
249 |
.fasc-size-small
|
250 |
{
|
251 |
font-size:12px;
|
254 |
line-height: 17px;
|
255 |
}
|
256 |
|
257 |
+
.mce-content-body a[data-mce-selected].fasc-size-medium,
|
258 |
+
.mce-content-body a.fasc-size-medium,
|
259 |
.fasc-size-medium
|
260 |
{
|
261 |
font-size:14px;
|
265 |
border:0;
|
266 |
}
|
267 |
|
268 |
+
.mce-content-body a[data-mce-selected].fasc-size-large,
|
269 |
+
.mce-content-body a.fasc-size-large,
|
270 |
.fasc-size-large
|
271 |
{
|
272 |
font-size:18px;
|
274 |
border:0;
|
275 |
line-height: 24px;
|
276 |
}
|
277 |
+
.mce-content-body a[data-mce-selected].fasc-size-xlarge,
|
278 |
+
.mce-content-body a.fasc-size-xlarge,
|
279 |
.fasc-size-xlarge
|
280 |
{
|
281 |
font-size:24px;
|
282 |
+
padding:11px 13px !important;
|
283 |
border:0;
|
284 |
line-height: 33px;
|
285 |
}
|
298 |
|
299 |
/* glossy */
|
300 |
|
301 |
+
.mce-content-body a[data-mce-selected].fasc-type-glossy,
|
302 |
+
.mce-content-body a.fasc-type-glossy,
|
303 |
a.fasc-type-glossy
|
304 |
{
|
305 |
background-color: #247edd;
|
311 |
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.12) 51%, rgba(0, 0, 0, 0.04));
|
312 |
|
313 |
}
|
314 |
+
.mce-content-body a[data-mce-selected].fasc-type-glossy:hover,
|
315 |
+
.mce-content-body a.fasc-type-glossy:hover,
|
316 |
a.fasc-type-glossy:hover
|
317 |
{
|
318 |
/* remove hover effects for tinymce editor */
|
348 |
|
349 |
|
350 |
/* 3d */ /* changes to prevent rollover, :hover should be set to same as regular */
|
351 |
+
.mce-content-body a[data-mce-selected].fasc-type-popout.fasc-size-xlarge,
|
352 |
+
.mce-content-body a[data-mce-selected].fasc-type-popout.fasc-size-xlarge:hover,
|
353 |
+
.mce-content-body a.fasc-type-popout.fasc-size-xlarge,
|
354 |
+
.mce-content-body a.fasc-type-popout.fasc-size-xlarge:hover
|
355 |
.fasc-type-popout.fasc-size-xlarge,
|
356 |
.fasc-type-popout.fasc-size-xlarge:hover
|
357 |
{
|
359 |
-moz-box-shadow: 7px 7px 0px #777777;
|
360 |
box-shadow: 7px 7px 0px #777777;
|
361 |
}
|
362 |
+
.mce-content-body a[data-mce-selected].fasc-type-popout.fasc-size-large,
|
363 |
+
.mce-content-body a[data-mce-selected].fasc-type-popout.fasc-size-large:hover,
|
364 |
+
.mce-content-body a.fasc-type-popout.fasc-size-large,
|
365 |
+
.mce-content-body a.fasc-type-popout.fasc-size-large:hover
|
366 |
.fasc-type-popout.fasc-size-large,
|
367 |
.fasc-type-popout.fasc-size-large:hover
|
368 |
{
|
370 |
-moz-box-shadow: 6px 6px 0px #777777;
|
371 |
box-shadow: 6px 6px 0px #777777;
|
372 |
}
|
373 |
+
.mce-content-body a[data-mce-selected].fasc-type-popout.fasc-size-medium,
|
374 |
+
.mce-content-body a[data-mce-selected].fasc-type-popout.fasc-size-medium:hover,
|
375 |
+
.mce-content-body a.fasc-type-popout.fasc-size-medium,
|
376 |
+
.mce-content-body a.fasc-type-popout.fasc-size-medium:hover
|
377 |
.fasc-type-popout.fasc-size-medium,
|
378 |
.fasc-type-popout.fasc-size-medium:hover
|
379 |
{
|
381 |
-moz-box-shadow: 5px 5px 0px #777777;
|
382 |
box-shadow: 5px 5px 0px #777777;
|
383 |
}
|
384 |
+
.mce-content-body a[data-mce-selected].fasc-type-popout.fasc-size-small,
|
385 |
+
.mce-content-body a[data-mce-selected].fasc-type-popout.fasc-size-small:hover,
|
386 |
+
.mce-content-body a.fasc-type-popout.fasc-size-small,
|
387 |
+
.mce-content-body a.fasc-type-popout.fasc-size-small:hover
|
388 |
.fasc-type-popout.fasc-size-small,
|
389 |
.fasc-type-popout.fasc-size-small:hover
|
390 |
{
|
392 |
-moz-box-shadow: 4px 4px 0px #777777;
|
393 |
box-shadow: 4px 4px 0px #777777;
|
394 |
}
|
395 |
+
.mce-content-body a[data-mce-selected].fasc-type-popout.fasc-size-xsmall,
|
396 |
+
.mce-content-body a[data-mce-selected].fasc-type-popout.fasc-size-xsmall:hover,
|
397 |
+
.mce-content-body a[data-mce-selected].fasc-type-popout.fasc-size-xsmall,
|
398 |
+
.mce-content-body a[data-mce-selected].fasc-type-popout.fasc-size-xsmall:hover
|
399 |
.fasc-type-popout.fasc-size-xsmall,
|
400 |
.fasc-type-popout.fasc-size-xsmall:hover
|
401 |
{
|
414 |
}
|
415 |
|
416 |
/* rounded */
|
417 |
+
a.fasc-button.rounded.fasc-size-xlarge, .fasc-rounded-medium.fasc-size-xlarge,
|
418 |
+
.mce-content-body a[data-mce-selected].fasc-button.rounded.fasc-size-xlarge, .mce-content-body a[data-mce-selected].fasc-rounded-medium.fasc-size-xlarge,
|
419 |
+
.mce-content-body a.fasc-button.rounded.fasc-size-xlarge, .mce-content-body a.fasc-rounded-medium.fasc-size-xlarge
|
420 |
{
|
421 |
border-radius:15px;
|
422 |
}
|
423 |
+
a.fasc-button.rounded.fasc-size-large, .fasc-rounded-medium.fasc-size-large,
|
424 |
+
.mce-content-body a[data-mce-selected].fasc-button.rounded.fasc-size-large, .mce-content-body a[data-mce-selected].fasc-rounded-medium.fasc-size-large,
|
425 |
+
.mce-content-body a.fasc-button.rounded.fasc-size-large, .mce-content-body a.fasc-rounded-medium.fasc-size-large
|
426 |
{
|
427 |
border-radius:10px;
|
428 |
}
|
429 |
+
a.fasc-button.rounded.fasc-size-medium, .fasc-rounded-medium.fasc-size-medium,
|
430 |
+
.mce-content-body a[data-mce-selected].fasc-button.rounded.fasc-size-medium, .mce-content-body a[data-mce-selected].fasc-rounded-medium.fasc-size-medium,
|
431 |
+
.mce-content-body a.fasc-button.rounded.fasc-size-medium, .mce-content-body a.fasc-rounded-medium.fasc-size-medium
|
432 |
{
|
433 |
border-radius:9px;
|
434 |
}
|
435 |
+
a.fasc-button.rounded.fasc-size-small, .fasc-rounded-medium.fasc-size-small,
|
436 |
+
.mce-content-body a[data-mce-selected].fasc-button.rounded.fasc-size-small, .mce-content-body a[data-mce-selected].fasc-rounded-medium.fasc-size-small,
|
437 |
+
.mce-content-body a.fasc-button.rounded.fasc-size-small, .mce-content-body a.fasc-rounded-medium.fasc-size-small
|
438 |
{
|
439 |
border-radius:8px;
|
440 |
}
|
441 |
+
a.fasc-button.rounded.fasc-size-xsmall, .fasc-rounded-medium.fasc-size-xsmall,
|
442 |
+
.mce-content-body a[data-mce-selected].fasc-button.rounded.fasc-size-xsmall, .mce-content-body a[data-mce-selected].fasc-rounded-medium.fasc-size-xsmall,
|
443 |
+
.mce-content-body a.fasc-button.rounded.fasc-size-xsmall, .mce-content-body a.fasc-rounded-medium.fasc-size-xsmall
|
444 |
{
|
445 |
border-radius:7px;
|
446 |
}
|
447 |
|
448 |
|
449 |
|
450 |
+
a.fasc-style-bold,
|
451 |
+
.mce-content-body a[data-mce-selected].fasc-style-bold,
|
452 |
+
.mce-content-body a.fasc-style-bold
|
453 |
{
|
454 |
font-weight:bold;
|
455 |
}
|
456 |
+
.mce-content-body a[data-mce-selected].fasc-style-italic,
|
457 |
+
.mce-content-body a.fasc-style-italic,
|
458 |
a.fasc-style-italic
|
459 |
{
|
460 |
font-style: italic;
|
461 |
}
|
462 |
+
.mce-content-body a[data-mce-selected].fasc-style-strikethrough,
|
463 |
+
.mce-content-body a.fasc-style-strikethrough,
|
464 |
a.fasc-style-strikethrough
|
465 |
{
|
466 |
text-decoration: line-through;
|
467 |
}
|
468 |
|
469 |
+
.mce-content-body a[data-mce-selected].fasc-button.fasc-style-strikethrough:hover,
|
470 |
+
.mce-content-body a.fasc-button.fasc-style-strikethrough:hover,
|
471 |
.fasc-button.fasc-style-strikethrough:hover
|
472 |
{
|
473 |
text-decoration: line-through;
|
admin/css/forget-about-shortcode-buttons-mce.css
CHANGED
@@ -2,31 +2,12 @@
|
|
2 |
* All of the CSS for your admin-specific functionality should be
|
3 |
* included in this file.
|
4 |
*/
|
5 |
-
|
6 |
-
|
7 |
-
@import url(button-styles.css);
|
8 |
@import url(font-awesome.min.css);
|
9 |
|
10 |
-
body { background: #ffffff; }
|
11 |
-
|
12 |
.fasc-button
|
13 |
{
|
14 |
-
cursor:help !important;
|
15 |
-
}
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
.fascview-wrap[data-fascview-type="boutique_banner"],
|
22 |
-
.fascview-wrap[data-fascview-type="testsc"]
|
23 |
-
{
|
24 |
-
display:inline-block !important;
|
25 |
-
width:auto !important;
|
26 |
-
}
|
27 |
-
.full_banner
|
28 |
-
{
|
29 |
-
background-color:#faa !important;
|
30 |
}
|
31 |
|
32 |
.fascview-wrap div, .fascview-wrap p
|
2 |
* All of the CSS for your admin-specific functionality should be
|
3 |
* included in this file.
|
4 |
*/
|
5 |
+
@import url(button-styles.css);
|
|
|
|
|
6 |
@import url(font-awesome.min.css);
|
7 |
|
|
|
|
|
8 |
.fasc-button
|
9 |
{
|
10 |
+
/* cursor:help !important; */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
}
|
12 |
|
13 |
.fascview-wrap div, .fascview-wrap p
|
admin/js/forget-about-shortcode-buttons-admin.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(a){"use strict";function b(a){function b(a){return("0"+parseInt(a).toString(16)).slice(-2)}return-1==a.search("rgb")?a:(a=a.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/),"#"+b(a[1])+b(a[2])+b(a[3]))}wp.mce=wp.mce||{};var c={};c.button={content_id:"fasc-popup-edit-button",is_editing:!1,$node:{},init:function(a,b,c,d){this.$popup=b,this.$preview_area=b.find(".preview-button-area .centered-button"),this.is_editing=c,this.$node=jQuery(a),this.setupControls(b),this.setupIcons(a,b),this.setupTabs(b),this.is_editing?this.setSettingsFromNode(a,b,!0):this.initEmptyTemplate(a,b,d),this.updatePreview()},setupIcons:function(b,c){var d=this,f=(a(b),c.find('.fasc-ajax-content .fasc-tab-content[data-fasc-tab="2"]'));f.find("#fasc-popup-icon-type-select").change(function(b){a(this).val();f.find(".ico-grid .grid-container").removeClass("ico-screen-active").hide(),f.find("#"+a(this).val()).addClass("ico-screen-active").show()}),f.find(".ico-grid div").click(function(b){b.preventDefault();var c=f.find(".fasc-ico-position:checked").val();return f.find(".ico-grid div").removeClass("active"),a(this).addClass("active"),"none"!=c&&""!=c||(c="before"),f.find(".fasc-ico-position").removeAttr("checked"),f.find(".fasc-ico-position").prop("checked",!1),f.find('.fasc-ico-position[value="'+c+'"]').prop("checked",!0),d.updatePreview(),!1}),f.find(".fasc-ico-position").change(function(b){if(f.find(".fasc-ico-position").removeAttr("checked"),f.find(".fasc-ico-position").prop("checked",!1),a(this).prop("checked",!0),"none"==a(this).val())f.find(".ico-grid div div:not(.clear)").removeClass("active");else{var c=f.find(".ico-grid div.active");if(c.length<1){var e=f.find(".ico-grid .grid-container.ico-screen-active"),c={};c=e.length>0?a(f.find(".ico-grid .grid-container.ico-screen-active div:not(.clear)").get(0)).addClass("active"):a(f.find(".ico-grid .grid-container:first-child div:not(.clear)").get(0)).addClass("active")}}d.updatePreview()}),a('.fasc-ajax-content select, .fasc-ajax-content input[type="checkbox"]').change(function(){d.updatePreview()}),a('.fasc-ajax-content input[type="text"]').keyup(function(){d.updatePreview()}),a('.fasc-ajax-content input[type="text"]').keyup(function(){d.updatePreview()}),a.get(Fasc.ajax_url+"?action=fasc_buttons&load=get_buttons",function(a){d.parseTemplateButtons(a)},"json"),a(".fasc-save-btn").click(function(){var b={};return b.button=d.createButtonHtml({isSaving:!0}),a.post(Fasc.ajax_url+"?action=fasc_buttons&load=save_button",b,function(a){d.parseTemplateButtons(a)},"json"),d.$tabs.find("li").removeClass("active"),d.$tabs.find("li[data-fasc-tab='3']").addClass("active"),d.loadTab(3,c),!1}),d.updatePreview()},parseTemplateButtons:function(b){var c=this,d=a(".saved-buttons-tab .container-grid ul");d.empty();var e="",f=0;a.each(b,function(c){e="";var g=a(b[c].html),h=g.css("background-color"),i=g.css("color");e+="<li data-index='"+f+"'>",e+='<div class="wrap">',e+='<div class="full_button">'+b[c].html+"</div>",e+='<div class="name"><span>'+b[c].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>',e+='<div class="col fasc-button-remove dashicons dashicons-no-alt"></div>',e+='<div class="col" style="background-color:'+h+';"></div>',e+='<div class="col" style="background-color:'+i+';"></div>',e+='<div class="clear"></div>',e+="</div>",e+="</li>",d.append(e),f++});var g=function(b){var c=b.text(),d=a("<input>",{val:c,type:"text",width:"170px","data-orig-text":c});b.replaceWith(d),d.select()},h=function(b){var c=a("<span>",{text:b.attr("data-orig-text")});b.replaceWith(c),c.on("click",g)},i=function(b){var c=a("<span>",{text:b.val()});b.replaceWith(c),c.on("click",g)};a(".fasc-button-edit").click(function(){return a(this).hide(),a(this).parent().find(".fasc-button-update").show().css("display","inline-block"),g(a(this).parent().find("span")),!1}),a(".fasc-button-remove").click(function(b){b.preventDefault();var d=a(this).closest("li").attr("data-index");return a.get(Fasc.ajax_url+"?action=fasc_buttons&load=remove_button&index="+d,function(a){c.parseTemplateButtons(a)},"json"),!1}),a(".fasc-button-update").click(function(){var b=a(this);if(a(this).parent().find(".fasc-button-update").hide(),a(this).parent().find(".fasc-button-edit").show(),"remove"==b.attr("data-action"))h(a(this).parent().find("input"));else{var d=a(this).closest("li").attr("data-index"),e=encodeURIComponent(a(this).parent().find("input").val());a.get(Fasc.ajax_url+"?action=fasc_buttons&load=update_button&index="+d+"&name="+e,function(a){c.parseTemplateButtons(a)},"json"),i(a(this).parent().find("input"))}return!1});var j=a(".saved-buttons-tab .container-grid li .wrap");j.on("click",function(){j.removeClass("active"),a(this).addClass("active");var b=a(this).find(".full_button a.fasc-button");c.loadButtonTemplate(b,!0),c.updatePreview()})},loadButtonTemplate:function(c,d){var e=this,f=c.attr("target");jQuery(".fasc-ajax-content input#fasc-popup-new-window").prop("checked",!1),void 0!==f&&"_blank"==f&&jQuery(".fasc-ajax-content input#fasc-popup-new-window").prop("checked",!0);var g=c.attr("rel");if(jQuery(".fasc-ajax-content input#fasc-popup-nofollow").prop("checked",!1),void 0!==g&&-1!==g.indexOf("nofollow")&&jQuery(".fasc-ajax-content input#fasc-popup-nofollow").prop("checked",!0),void 0===d){var h=c.text();jQuery(".fasc-ajax-content input#fasc-popup-button-text").val(h)}var i=b(c.css("color"));jQuery("#fasc-popup-text-color").val(i),e.refreshMiniColors(jQuery("#fasc-popup-text-color"),i,e.$popup);var j=b(c.css("background-color"));jQuery("#fasc-popup-button-color").val(j),e.refreshMiniColors(jQuery("#fasc-popup-button-color"),j,e.$popup);var k=e.$popup.find('.fasc-ajax-content .fasc-tab-content[data-fasc-tab="2"]');k.find(".ico-grid > div > div").removeClass("active");var l=c.attr("class").split(/\s+/);e.$popup.find(".fasc-mce-button[data-fasc-action='bold']").attr("data-fasc-button-active","0"),e.$popup.find(".fasc-mce-button[data-fasc-action='italic']").attr("data-fasc-button-active","0"),e.$popup.find(".fasc-mce-button[data-fasc-action='strikethrough']").attr("data-fasc-button-active","0");for(var m=0;m<l.length;m++)if("fasc-type"==l[m].substring(0,9)){var n=l[m];(c.hasClass("fasc-rounded-medium")||c.hasClass("rounded"))&&(n+=" fasc-rounded-medium"),jQuery("#fasc-popup-button-type option").prop("selected",!1),jQuery('#fasc-popup-button-type option[value="'+n+'"]').prop("selected",!0),a("#fasc-popup-button-type").val(n)}else if("fasc-style"==l[m].substring(0,10))"fasc-style-bold"==l[m]?e.$popup.find(".fasc-mce-button[data-fasc-action='bold']").attr("data-fasc-button-active","1"):"fasc-style-italic"==l[m]?e.$popup.find(".fasc-mce-button[data-fasc-action='italic']").attr("data-fasc-button-active","1"):"fasc-style-strikethrough"==l[m]&&e.$popup.find(".fasc-mce-button[data-fasc-action='strikethrough']").attr("data-fasc-button-active","1");else if("fasc-size"==l[m].substring(0,9)){var o=l[m];jQuery("#fasc-popup-button-size option").prop("selected",!1),jQuery('#fasc-popup-button-size option[value="'+o+'"]').prop("selected",!0),a("#button-size").val(o)}else if("dashicons"==l[m].substring(0,9)){k.find(".ico-grid .grid-container").removeClass("ico-screen-active"),k.find("#dashicons-grid").addClass("ico-screen-active"),e.$popup.find("#fasc-popup-icon-type-select").val("dashicons-grid"),e.$popup.find("#fasc-popup-icon-type-select").trigger("change");var p=l[m];e.$popup.find(".ico-grid ."+p).addClass("active")}else if("fa-"==l[m].substring(0,3)){k.find(".ico-grid .grid-container").removeClass("ico-screen-active");var q=k.find(".ico-grid").find("."+l[m]),r=q.parent().attr("id"),s=k.find("#"+r);s.addClass("ico-screen-active"),e.$popup.find("#fasc-popup-icon-type-select").val(r),e.$popup.find("#fasc-popup-icon-type-select").trigger("change"),e.$popup.find(".ico-grid ."+l[m]).addClass("active")}c.hasClass("fasc-ico-before")||c.hasClass("fasc-ico-after")?c.hasClass("fasc-ico-before")?(k.find(".fasc-ico-position").prop("checked",!1),k.find('.fasc-ico-position[value="before"]').prop("checked",!0)):c.hasClass("fasc-ico-after")&&(k.find(".fasc-ico-position").prop("checked",!1),k.find('.fasc-ico-position[value="after"]').prop("checked",!0)):(k.find(".fasc-ico-position").prop("checked",!1),k.find('.fasc-ico-position[value="none"]').prop("checked",!0))},setupControls:function(b){var c=this;b.find('.fasc-ajax-content select, .fasc-ajax-content input[type="checkbox"]').change(function(){c.updatePreview()}),b.find('.fasc-ajax-content input[type="text"]').keyup(function(){c.updatePreview()}),b.find('.fasc-ajax-content input[type="text"]').keyup(function(){c.updatePreview()});var d=b.find("[data-fasc-action='popup-colorpicker']");d.click(function(c){var e=a(this),f=e.attr("data-fasc-button-active");d.attr("data-fasc-button-active","");var g=1-f;e.attr("data-fasc-button-active",g);var h=e.data("fasc-action-target"),i=b.find('[data-fasc-colorpicker-name="'+h+'"]'),j=b.find("[data-fasc-colorpicker-name]").not('[data-fasc-colorpicker-name="'+h+'"]'),k=e.position();j.stop(!0,!0).hide(),i.stop(!0,!0).fadeToggle(100),i.css("left",Math.round(k.left)+"px"),i.css("top",Math.round(k.top+e.parent().outerHeight())+"px")}),b.on("click",function(c){0==a(c.target).closest("[data-fasc-action='popup-colorpicker'], .fasc-popup-colorpicker-container").length&&(b.find("[data-fasc-colorpicker-name]").hide(),d.attr("data-fasc-button-active",""))}),b.find(".fasc-mce-button-toggle").on("click",function(){var b=a(this),d=b.attr("data-fasc-button-active"),e=1-d;b.attr("data-fasc-button-active",e),c.updatePreview()}),c.updatePreview()},updatePreview:function(){this.$preview_area.html(this.createButtonHtml()),this.$preview_area.find(".fasc-button").off(),this.$preview_area.find(".fasc-button").click(function(a){a.preventDefault(),a.stopPropagation()})},createButtonHtml:function(b){var c={content:"",isSaving:!1,hasID:!1};a.extend(c,b);var d=jQuery(".fasc-ajax-content input#fasc-popup-button-url").val(),e=jQuery(".fasc-ajax-content input#fasc-popup-button-text").val(),f=jQuery(".fasc-ajax-content select#fasc-popup-button-size").val(),g=jQuery(".fasc-ajax-content input#fasc-popup-button-color").val(),h=jQuery(".fasc-ajax-content input#fasc-popup-text-color").val(),i=jQuery(".fasc-ajax-content select#fasc-popup-button-type").val(),k=(jQuery(".fasc-ajax-content select#fasc-popup-button-align").val(),jQuery(".fasc-ajax-content input#fasc-popup-new-window").prop("checked")),l=jQuery(".fasc-ajax-content input#fasc-popup-nofollow").prop("checked"),o="",p="",r="",s="";1==k&&(r=' target="_blank"'),1==l&&(s=' rel="nofollow"'),i&&""!=i&&(o=" "+i),f&&""!=f&&(p=" "+f);var u=a(a('.fasc-ajax-content .fasc-tab-content[data-fasc-tab="2"] .ico-grid div.active').get(0)),v=a('.fasc-ajax-content .fasc-tab-content[data-fasc-tab="2"] .fasc-ico-position:checked').val(),w="";if(1==u.length){var y=u.attr("class").split(" "),z=0,A="dashicons";for(z=0;z<y.length;z++)"active"!=y[z]&&"fa"!=y[z]&&"dashicons"!=y[z]&&(w+=" "+y[z]),"fa"==y[z]&&(A="fontawesome");z>0&&("before"!=v&&"after"!=v||(w="fontawesome"==A?" ico-fa fasc-ico-"+v+w:" fasc-ico-"+v+w))}var B="";1==this.$popup.find(".fasc-mce-button[data-fasc-action='bold']").attr("data-fasc-button-active")&&(B+=" fasc-style-bold"),1==this.$popup.find(".fasc-mce-button[data-fasc-action='italic']").attr("data-fasc-button-active")&&(B+=" fasc-style-italic");var E=this.$popup.find(".fasc-mce-button[data-fasc-action='strikethrough']").attr("data-fasc-button-active");1==E&&(B+=" fasc-style-strikethrough");this.$popup.find(".fasc-mce-button[data-fasc-action='strikethrough']").attr("data-fasc-button-active");1==E&&(B+=" fasc-style-strikethrough");var G="";if(c.hasID){G=' data-fasc-id="fasc-button-tid-'+(new Date).getTime()+'"'}var I="";return I=c.isSaving?'<a class="fasc-button'+p+o+w+B+'"'+r+s+' style="background-color:'+g+";color:"+h+';" data-fasc-style="background-color:'+g+";color:"+h+';"'+G+"></a>":'<a data-fasc-href="'+d+'" class="fasc-button'+p+o+w+B+'"'+r+s+' style="background-color:'+g+";color:"+h+';" data-fasc-style="background-color:'+g+";color:"+h+';"'+G+">"+e+"</a>",c.isSaving,I},setupTabs:function(b){var c=this;this.$tabs=b.find(".tab-header");var d=this.$tabs.find("li");this.$tabs.find("li a");d.click(function(){var e=a(this),f=e.attr("data-fasc-tab");return d.removeClass("active"),e.addClass("active"),c.loadTab(f,b),!1})},loadTab:function(b,c){c.find(".fasc-ajax-content .fasc-tab-content").hide(),c.find(".fasc-ajax-content .fasc-tab-content[data-fasc-tab="+b+"]").show(),this.loadTabContent(b),a(".ico-grid .grid-container div.active").length>0&&a(".ico-grid").scrollTop(a(".ico-grid .grid-container div.active").position().top-5)},loadTabContent:function(a,b){},refreshMiniColors:function(b,c,d){var e=this;jQuery(".preview-button-area .centered-button");b.is_text_input=!1,b.minicolors({inline:!0,opacity:!1,showSpeed:0,hideSpeed:0,textfield:!0,change:function(c,f){var g=b.val(),h=b.parent().parent().find(".fasc-popup-color-input");1==b.is_text_input?b.is_text_input=!1:h.val(g),h.off("input"),h.on("input",function(){var c=a(this).val();b.is_text_input=!0,b.minicolors("value",c)});var i=a("#fasc-popup-button-color").val(),j=a("#fasc-popup-text-color").val();d.find(".fasc-ico-fg .fg-panel").css("background-color",j),d.find(".fasc-ico-bg .bg-panel").css("background-color",i),e.updatePreview()}}),void 0!==c&&b.minicolors("value",c)},initEmptyTemplate:function(a,c,d){jQuery("#fasc-popup-button-text").val(d);var e=c.find(".preview-button-area .centered-button .fasc-button");this.refreshMiniColors(c.find("#fasc-popup-text-color"),b(e.css("color")),c),this.refreshMiniColors(c.find("#fasc-popup-button-color"),b(e.css("background-color")),c)},setSettingsFromNode:function(c,d,e){var f=a(c),h=f.attr("data-fasc-href");d.find(".fasc-ajax-content input#fasc-popup-button-url").val(h);var i=f.attr("target");d.find(".fasc-ajax-content input#fasc-popup-new-window").prop("checked",!1),void 0!==i&&"_blank"==i&&d.find(".fasc-ajax-content input#fasc-popup-new-window").prop("checked",!0);var j=f.attr("rel");d.find(".fasc-ajax-content input#fasc-popup-nofollow").prop("checked",!1),void 0!==j&&-1!==j.indexOf("nofollow")&&d.find(".fasc-ajax-content input#fasc-popup-nofollow").prop("checked",!0);var k=f.text();d.find(".fasc-ajax-content input#fasc-popup-button-text").val(k);var l=b(f.css("color"));d.find("#fasc-popup-text-color").val(l),d.find(".fasc-ico-fg .fg-panel").css("background-color",l),this.refreshMiniColors(d.find("#fasc-popup-text-color"),l,d);var m=b(f.css("background-color"));d.find("#fasc-popup-button-color").val(m),d.find(".fasc-ico-bg .bg-panel").css("background-color",m),this.refreshMiniColors(d.find("#fasc-popup-button-color"),m,d);var n=d.find('.fasc-ajax-content .fasc-tab-content[data-fasc-tab="2"]'),o=f.attr("class").split(/\s+/);n.find(".ico-grid > div > div").removeClass("active");for(var p=0;p<o.length;p++)if("fasc-type"==o[p].substring(0,9)){var q=o[p];(f.hasClass("fasc-rounded-medium")||f.hasClass("rounded"))&&(q+=" fasc-rounded-medium"),d.find("#fasc-popup-button-type option").prop("selected",!1),d.find('#fasc-popup-button-type option[value="'+q+'"]').prop("selected",!0),d.find("#fasc-popup-button-type").val(q)}else if("fasc-style"==o[p].substring(0,10))"fasc-style-bold"==o[p]?d.find(".fasc-mce-button[data-fasc-action='bold']").attr("data-fasc-button-active","1"):"fasc-style-italic"==o[p]?d.find(".fasc-mce-button[data-fasc-action='italic']").attr("data-fasc-button-active","1"):"fasc-style-strikethrough"==o[p]&&d.find(".fasc-mce-button[data-fasc-action='strikethrough']").attr("data-fasc-button-active","1");else if("fasc-size"==o[p].substring(0,9)){var r=o[p];d.find("#fasc-popup-button-size option").prop("selected",!1),d.find('#fasc-popup-button-size option[value="'+r+'"]').prop("selected",!0),d.find("#fasc-popup-button-size").val(r)}else if("dashicons"==o[p].substring(0,9)){n.find(".ico-grid .grid-container").removeClass("ico-screen-active"),n.find("#dashicons-grid").addClass("ico-screen-active"),d.find("#fasc-popup-icon-type-select").val("dashicons-grid"),d.find("#fasc-popup-icon-type-select").trigger("change");var s=o[p];d.find(".ico-grid ."+s).addClass("active")}else if("fa-"==o[p].substring(0,3)){n.find(".ico-grid .grid-container").removeClass("ico-screen-active");var t=n.find(".ico-grid").find("."+o[p]),u=t.parent().attr("id"),v=n.find("#"+u);v.addClass("ico-screen-active"),d.find("#fasc-popup-icon-type-select").val(u),d.find("#fasc-popup-icon-type-select").trigger("change"),d.find(".ico-grid ."+o[p]).addClass("active")}f.hasClass("fasc-ico-before")||f.hasClass("fasc-ico-after")?f.hasClass("fasc-ico-before")?(n.find(".fasc-ico-position").prop("checked",!1),n.find('.fasc-ico-position[value="before"]').prop("checked",!0)):f.hasClass("fasc-ico-after")&&(n.find(".fasc-ico-position").prop("checked",!1),n.find('.fasc-ico-position[value="after"]').prop("checked",!0)):(n.find(".fasc-ico-position").prop("checked",!1),n.find('.fasc-ico-position[value="none"]').prop("checked",!0))}},wp.mce.fascpopup={open:function(b,d,e,f,g){this.type=d,this.templateID=d,this.is_editing=f;var h=c[d].content_id,i=jQuery("<div/>",{class:"fasc-thickbox-overlay"}).appendTo("body"),j=a("#fasc-popup-template").clone();j.removeAttr("id"),j.addClass(h);var k=a("#"+h),l=k.clone();k.remove();var m=j.find(".fasc-thickbox-content"),n=j.find(".fasc-thickbox-title-inner"),o=j.find(".fasc-thickbox-action-right");this.initTemplate(j,l,m,n,o),j.insertAfter(i),c[d].init(b,j,this.is_editing,g),j.show(),this.initEvents(b,j,o,m,l,e)},initTemplate:function(a,b,c,d,e){c.html(b.html());var f=b.attr("data-fasc-title"),g=b.attr("data-fasc-submit-label"),h=b.attr("data-fasc-width"),i=b.attr("data-fasc-height");d.text(f),e.text(g),a.css("max-width",h),a.css("max-height",i)},initEvents:function(b,d,e,f,g,h){var i=this;d.find("label").click(function(){}),d.find(".fasc-close-ajax-window").click(function(){i.removePopup(d,g)}),a(".fasc-thickbox-overlay").on("click",function(a){i.removePopup(d,g)}),e.click(function(a){a.preventDefault(),a.stopImmediatePropagation();var b=c[i.type].createButtonHtml({isSaving:!1,hasID:!0}),e=jQuery(b).attr("data-fasc-id");return h(b,e),i.removePopup(d,g),!1});var k=g.attr("data-fasc-width"),l=g.attr("data-fasc-height");a(window).resize(_.debounce(function(){i.centerPopup(d)},100)),i.centerPopup(d,k,l)},removePopup:function(b,d){var e=this;a(".fasc-thickbox-overlay").remove(),b.remove(),a("body").append(d),d.attr("id",c[e.type].content_id)},centerPopup:function(b,c,d){var e=b.find(".fasc-thickbox-header"),f=b.find(".fasc-thickbox-footer"),g=b.find(".fasc-thickbox-content"),i=(a(window),-b.height()/2),j=-b.width()/2;b.css("position","fixed").css({"margin-left":j+"px","margin-top":i+"px",left:"50%",top:"50%"}),g.hide();var k=b.outerHeight(),l=k;l-=e.outerHeight(),l-=f.outerHeight(),g.height(l),g.show()}}}(jQuery);
|
1 |
+
function addFascToEditor(t){function a(t){t.stopPropagation()}function e(){var a=tinymce.activeEditor.dom.select(".fasc-button"),e=!1;jQuery(a).each(function(){if(jQuery(this).is("[data-fasc-style]")){var a=jQuery(this).attr("data-fasc-style").replace(/\s+/,""),o="";jQuery(this).is("[style]")&&(o=jQuery(this).attr("style").replace(/\s+/,"")),a!=o&&(jQuery(this).attr("style",jQuery(this).attr("data-fasc-style")),t.nodeChanged(),e=!0)}})}function o(a){t.undoManager.transact(function(){t.dom.remove(a),c(),t.focus()})}function n(a){var e=t.dom;a&&(a!==d&&(t.getBody().focus(),c(),d=a,e.setAttrib(a,"data-mce-selected",1)),t.nodeChanged())}function c(){var e=t.dom;d&&(e.unbind(d,"beforedeactivate focusin focusout click mouseup",a),e.setAttrib(d,"data-mce-selected",null)),d=null}function i(a){var e=l(a),o=e.find(".fasc-button");o.attr("data-fasc-temp",null),o.attr("data-fasc-style",null);var n=1;return l(o).each(function(){var t=l(this);n++;var a=t.attr("data-fasc-href");t.attr("href",a),t.attr("data-fasc-href",null),t.attr("data-fasc-id",null)}),t.dom.getOuterHTML(e)}function s(){for(var a=t.dom.select(".fasc-button"),e=0;e<a.length;e++){var o=a[e],n=t.dom.getAttrib(o,"href"),c=t.dom.getAttrib(o,"data-fasc-href"),i=t.dom.getAttrib(o,"style");""==c&&""!=n&&(t.dom.setAttrib(o,"data-fasc-href",n),t.dom.setAttrib(o,"href",null)),t.dom.setAttrib(o,"data-fasc-style",i)}}function r(t,a,e,o,i){if(void 0===i)var i="";"function"!=typeof o&&(o=function(o,i){var s=t.$(o);e?t.$(a).replaceWith(s):t.selection.setContent(o);t.$("[data-fasc-id='"+i+"']");c(),t.focus(),t.nodeChanged(),n(t.dom.select("a[data-fasc-id='"+i+"']")[0]),t.undoManager.add()}),wp.mce.fascpopup.open(a,"button",o,e,i)}var d,f,p,u,l=t.$,v=(tinymce.Env,tinymce.util.VK,tinymce.dom.TreeWalker,!0),h=function(){return!1};/iPad|iPod|iPhone/.test(navigator.userAgent);if(t.addButton("button_fasc_insert_button",{title:"Insert Button",icon:"fascbutton-ico",onclick:function(){t.execCommand("popup_insert_fasc_button",0,0)}}),t.addCommand("popup_insert_fasc_button",function(a,e){var o=!1;t.dom.hasClass(t.selection.getNode(),"fasc-button")&&(o=!0);var n=t.selection.getContent({format:"text"});r(t,t.selection.getNode(),o,{},n)}),"undefined"==typeof wp||!wp.mce)return{getView:h};t.on("SetContent",function(){s()}),t.on("init",function(){t.on("dblClick",function(a){if(t.dom.hasClass(a.target,"fasc-button"))return a.preventDefault(),r(t,a.target,!0),!1},!0),t.addCommand("popup_insert_fasc_button",function(a,e){var o=!1;t.dom.hasClass(t.selection.getNode(),"fasc-button")&&(o=!0);var n=t.selection.getContent({format:"text"});r(t,t.selection.getNode(),o,{},n)});var a=!1;t.selection,window.MutationObserver||window.WebKitMutationObserver;t.dom.bind(t.getDoc(),"touchmove",function(){a=!0}),t.on("mousedown mouseup click touchend",function(e){v=!1,t.dom.hasClass(e.target,"fasc-button")?"touchend"===e.type&&a?a=!1:n(e.target):"touchend"!==e.type&&"mousedown"!==e.type||c(),"touchend"===e.type&&a&&(a=!1)},!0)}),t.on("PreProcess",function(t){},!0),t.on("hide",function(){c()}),t.on("PostProcess",function(a){a.content&&t.$("<div>"+a.content+"</div>").clone().find(".fasc-button").length>0&&(a.content=i(a.content))}),t.on("keydown",function(a){if(c(),32==a.keyCode&&t.dom.hasClass(t.selection.getNode(),"fasc-button")&&t.selection.getRng().startOffset==l(t.selection.getNode()).text().length){var e=tinymce.DOM.uniqueId(),o=t.dom.create("span",{id:e}," ");t.dom.insertAfter(o,t.selection.getNode());var n=t.dom.select("span#"+e);return t.selection.select(n[0]),t.selection.collapse(0),t.dom.setAttrib(e,"id",""),!1}}),t.on("focus",function(){p=!0,v=!1}),t.on("blur",function(){p=!1}),t.on("NodeChange",function(a){t.dom,t.dom.select(".fascview-wrap"),a.element.className;f=!1,clearInterval(void 0)}),t.on("BeforeExecCommand",function(){t.selection.getNode()}),t.on("ExecCommand",function(){}),t.on("ResolveName",function(t){}),t.on("PastePostProcess",function(){e()}),t.addButton("fasc_view_edit",{tooltip:"Edit ",icon:"dashicon dashicons-edit",onclick:function(){d&&r(t,d,!0)}}),t.addButton("fasc_view_remove",{tooltip:"Remove",icon:"dashicon dashicons-no",onclick:function(){d&&o(d)}}),t.once("preinit",function(){t.wp&&t.wp._createToolbar&&(u=t.wp._createToolbar(["fasc_view_edit","fasc_view_remove"]))}),t.on("wptoolbar",function(t){d&&(t.element=d,t.toolbar=u)}),t.wp=t.wp||{}}!function(t){"use strict";function a(t){if(-1==t.search("rgb"))return t;function a(t){return("0"+parseInt(t).toString(16)).slice(-2)}return"#"+a((t=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/))[1])+a(t[2])+a(t[3])}jQuery(document).on("tinymce-editor-setup",function(t,a){jQuery("body").hasClass("widgets-php")&&(a.settings.toolbar1+=",button_fasc_insert_button",a.on("PreInit",function(t){a.dom.loadCSS(Fasc.plugin_url+"css/forget-about-shortcode-buttons-mce.css")}),addFascToEditor(a))}),wp.mce=wp.mce||{};var e={};e.button={content_id:"fasc-popup-edit-button",is_editing:!1,$node:{},init:function(t,a,e,o){this.$popup=a,this.$preview_area=a.find(".preview-button-area .centered-button"),this.is_editing=e,this.$node=jQuery(t),this.setupControls(a),this.setupIcons(t,a),this.setupTabs(a),this.is_editing?this.setSettingsFromNode(t,a,!0):this.initEmptyTemplate(t,a,o),this.updatePreview()},setupIcons:function(a,e){var o=this,n=(t(a),e.find('.fasc-ajax-content .fasc-tab-content[data-fasc-tab="2"]'));n.find("#fasc-popup-icon-type-select").change(function(a){t(this).val();n.find(".ico-grid .grid-container").removeClass("ico-screen-active").hide(),n.find("#"+t(this).val()).addClass("ico-screen-active").show()}),n.find(".ico-grid div").click(function(a){a.preventDefault();var e=n.find(".fasc-ico-position:checked").val();return n.find(".ico-grid div").removeClass("active"),t(this).addClass("active"),"none"!=e&&""!=e||(e="before"),n.find(".fasc-ico-position").removeAttr("checked"),n.find(".fasc-ico-position").prop("checked",!1),n.find('.fasc-ico-position[value="'+e+'"]').prop("checked",!0),o.updatePreview(),!1}),n.find(".fasc-ico-position").change(function(a){if(n.find(".fasc-ico-position").removeAttr("checked"),n.find(".fasc-ico-position").prop("checked",!1),t(this).prop("checked",!0),"none"==t(this).val())n.find(".ico-grid div div:not(.clear)").removeClass("active");else if(n.find(".ico-grid div.active").length<1){n.find(".ico-grid .grid-container.ico-screen-active").length>0?t(n.find(".ico-grid .grid-container.ico-screen-active div:not(.clear)").get(0)).addClass("active"):t(n.find(".ico-grid .grid-container:first-child div:not(.clear)").get(0)).addClass("active")}o.updatePreview()}),t('.fasc-ajax-content select, .fasc-ajax-content input[type="checkbox"]').change(function(){o.updatePreview()}),t('.fasc-ajax-content input[type="text"]').keyup(function(){o.updatePreview()}),t('.fasc-ajax-content input[type="text"]').keyup(function(){o.updatePreview()}),t.get(Fasc.ajax_url+"?action=fasc_buttons&load=get_buttons",function(t){o.parseTemplateButtons(t)},"json"),t(".fasc-save-btn").click(function(){var a={};return a.button=o.createButtonHtml({isSaving:!0}),t.post(Fasc.ajax_url+"?action=fasc_buttons&load=save_button",a,function(t){o.parseTemplateButtons(t)},"json"),o.$tabs.find("li").removeClass("active"),o.$tabs.find("li[data-fasc-tab='3']").addClass("active"),o.loadTab(3,e),!1}),o.updatePreview()},parseTemplateButtons:function(a){var e=this,o=t(".saved-buttons-tab .container-grid ul");o.empty();var n="",c=0;t.each(a,function(e){n="";var i=t(a[e].html),s=i.css("background-color"),r=i.css("color");n+="<li data-index='"+c+"'>",n+='<div class="wrap">',n+='<div class="full_button">'+a[e].html+"</div>",n+='<div class="name"><span>'+a[e].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:'+s+';"></div>',n+='<div class="col" style="background-color:'+r+';"></div>',n+='<div class="clear"></div>',n+="</div>",n+="</li>",o.append(n),c++});var i=function(a){var e=a.text(),o=t("<input>",{val:e,type:"text",width:"170px","data-orig-text":e});a.replaceWith(o),o.select()},s=function(a){var e=t("<span>",{text:a.attr("data-orig-text")});a.replaceWith(e),e.on("click",i)},r=function(a){var e=t("<span>",{text:a.val()});a.replaceWith(e),e.on("click",i)};t(".fasc-button-edit").click(function(){return t(this).hide(),t(this).parent().find(".fasc-button-update").show().css("display","inline-block"),i(t(this).parent().find("span")),!1}),t(".fasc-button-remove").click(function(a){a.preventDefault();var o=t(this).closest("li").attr("data-index");return t.get(Fasc.ajax_url+"?action=fasc_buttons&load=remove_button&index="+o,function(t){e.parseTemplateButtons(t)},"json"),!1}),t(".fasc-button-update").click(function(){var a=t(this);if(t(this).parent().find(".fasc-button-update").hide(),t(this).parent().find(".fasc-button-edit").show(),"remove"==a.attr("data-action"))s(t(this).parent().find("input"));else{var o=t(this).closest("li").attr("data-index"),n=encodeURIComponent(t(this).parent().find("input").val());t.get(Fasc.ajax_url+"?action=fasc_buttons&load=update_button&index="+o+"&name="+n,function(t){e.parseTemplateButtons(t)},"json"),r(t(this).parent().find("input"))}return!1});var d=t(".saved-buttons-tab .container-grid li .wrap");d.on("click",function(){d.removeClass("active"),t(this).addClass("active");var a=t(this).find(".full_button a.fasc-button");e.loadButtonTemplate(a,!0),e.updatePreview()})},loadButtonTemplate:function(e,o){var n=this,c=e.attr("target");jQuery(".fasc-ajax-content input#fasc-popup-new-window").prop("checked",!1),void 0!==c&&"_blank"==c&&jQuery(".fasc-ajax-content input#fasc-popup-new-window").prop("checked",!0);var i=e.attr("rel");if(jQuery(".fasc-ajax-content input#fasc-popup-nofollow").prop("checked",!1),void 0!==i&&-1!==i.indexOf("nofollow")&&jQuery(".fasc-ajax-content input#fasc-popup-nofollow").prop("checked",!0),void 0===o){var s=e.text();jQuery(".fasc-ajax-content input#fasc-popup-button-text").val(s)}var r=a(e.css("color"));jQuery("#fasc-popup-text-color").val(r),n.refreshMiniColors(jQuery("#fasc-popup-text-color"),r,n.$popup);var d=a(e.css("background-color"));jQuery("#fasc-popup-button-color").val(d),n.refreshMiniColors(jQuery("#fasc-popup-button-color"),d,n.$popup);var f=n.$popup.find('.fasc-ajax-content .fasc-tab-content[data-fasc-tab="2"]');f.find(".ico-grid > div > div").removeClass("active");var p=e.attr("class").split(/\s+/);n.$popup.find(".fasc-mce-button[data-fasc-action='bold']").attr("data-fasc-button-active","0"),n.$popup.find(".fasc-mce-button[data-fasc-action='italic']").attr("data-fasc-button-active","0"),n.$popup.find(".fasc-mce-button[data-fasc-action='strikethrough']").attr("data-fasc-button-active","0");for(var u=0;u<p.length;u++)if("fasc-type"==p[u].substring(0,9)){var l=p[u];(e.hasClass("fasc-rounded-medium")||e.hasClass("rounded"))&&(l+=" fasc-rounded-medium"),jQuery("#fasc-popup-button-type option").prop("selected",!1),jQuery('#fasc-popup-button-type option[value="'+l+'"]').prop("selected",!0),t("#fasc-popup-button-type").val(l)}else if("fasc-style"==p[u].substring(0,10))"fasc-style-bold"==p[u]?n.$popup.find(".fasc-mce-button[data-fasc-action='bold']").attr("data-fasc-button-active","1"):"fasc-style-italic"==p[u]?n.$popup.find(".fasc-mce-button[data-fasc-action='italic']").attr("data-fasc-button-active","1"):"fasc-style-strikethrough"==p[u]&&n.$popup.find(".fasc-mce-button[data-fasc-action='strikethrough']").attr("data-fasc-button-active","1");else if("fasc-size"==p[u].substring(0,9)){var v=p[u];jQuery("#fasc-popup-button-size option").prop("selected",!1),jQuery('#fasc-popup-button-size option[value="'+v+'"]').prop("selected",!0),t("#button-size").val(v)}else if("dashicons"==p[u].substring(0,9)){f.find(".ico-grid .grid-container").removeClass("ico-screen-active"),f.find("#dashicons-grid").addClass("ico-screen-active"),n.$popup.find("#fasc-popup-icon-type-select").val("dashicons-grid"),n.$popup.find("#fasc-popup-icon-type-select").trigger("change");var h=p[u];n.$popup.find(".ico-grid ."+h).addClass("active")}else if("fa-"==p[u].substring(0,3)){f.find(".ico-grid .grid-container").removeClass("ico-screen-active");var b=f.find(".ico-grid").find("."+p[u]).parent().attr("id");f.find("#"+b).addClass("ico-screen-active"),n.$popup.find("#fasc-popup-icon-type-select").val(b),n.$popup.find("#fasc-popup-icon-type-select").trigger("change"),n.$popup.find(".ico-grid ."+p[u]).addClass("active")}e.hasClass("fasc-ico-before")||e.hasClass("fasc-ico-after")?e.hasClass("fasc-ico-before")?(f.find(".fasc-ico-position").prop("checked",!1),f.find('.fasc-ico-position[value="before"]').prop("checked",!0)):e.hasClass("fasc-ico-after")&&(f.find(".fasc-ico-position").prop("checked",!1),f.find('.fasc-ico-position[value="after"]').prop("checked",!0)):(f.find(".fasc-ico-position").prop("checked",!1),f.find('.fasc-ico-position[value="none"]').prop("checked",!0))},setupControls:function(a){var e=this;a.find('.fasc-ajax-content select, .fasc-ajax-content input[type="checkbox"]').change(function(){e.updatePreview()}),a.find('.fasc-ajax-content input[type="text"]').keyup(function(){e.updatePreview()}),a.find('.fasc-ajax-content input[type="text"]').keyup(function(){e.updatePreview()});var o=a.find("[data-fasc-action='popup-colorpicker']");o.click(function(e){var n=t(this),c=n.attr("data-fasc-button-active");o.attr("data-fasc-button-active","");var i=1-c;n.attr("data-fasc-button-active",i);var s=n.data("fasc-action-target"),r=a.find('[data-fasc-colorpicker-name="'+s+'"]'),d=a.find("[data-fasc-colorpicker-name]").not('[data-fasc-colorpicker-name="'+s+'"]'),f=n.position();d.stop(!0,!0).hide(),r.stop(!0,!0).fadeToggle(100),r.css("left",Math.round(f.left)+"px"),r.css("top",Math.round(f.top+n.parent().outerHeight())+"px")}),a.on("click",function(e){0==t(e.target).closest("[data-fasc-action='popup-colorpicker'], .fasc-popup-colorpicker-container").length&&(a.find("[data-fasc-colorpicker-name]").hide(),o.attr("data-fasc-button-active",""))}),a.find(".fasc-mce-button-toggle").on("click",function(){var a=t(this),o=1-a.attr("data-fasc-button-active");a.attr("data-fasc-button-active",o),e.updatePreview()}),e.updatePreview()},updatePreview:function(){this.$preview_area.html(this.createButtonHtml()),this.$preview_area.find(".fasc-button").off(),this.$preview_area.find(".fasc-button").click(function(t){t.preventDefault(),t.stopPropagation()})},createButtonHtml:function(a){var e={content:"",isSaving:!1,hasID:!1};t.extend(e,a);var o=jQuery(".fasc-ajax-content input#fasc-popup-button-url").val(),n=jQuery(".fasc-ajax-content input#fasc-popup-button-text").val(),c=jQuery(".fasc-ajax-content select#fasc-popup-button-size").val(),i=jQuery(".fasc-ajax-content input#fasc-popup-button-color").val(),s=jQuery(".fasc-ajax-content input#fasc-popup-text-color").val(),r=jQuery(".fasc-ajax-content select#fasc-popup-button-type").val(),d=(jQuery(".fasc-ajax-content select#fasc-popup-button-align").val(),jQuery(".fasc-ajax-content input#fasc-popup-new-window").prop("checked")),f=jQuery(".fasc-ajax-content input#fasc-popup-nofollow").prop("checked"),p="",u="",l="",v="";1==d&&(l=' target="_blank"'),1==f&&(v=' rel="nofollow"'),r&&""!=r&&(p=" "+r),c&&""!=c&&(u=" "+c);var h=t(t('.fasc-ajax-content .fasc-tab-content[data-fasc-tab="2"] .ico-grid div.active').get(0)),b=t('.fasc-ajax-content .fasc-tab-content[data-fasc-tab="2"] .fasc-ico-position:checked').val(),g="";if(1==h.length){var m=h.attr("class").split(" "),y=0,k="dashicons";for(y=0;y<m.length;y++)"active"!=m[y]&&"fa"!=m[y]&&"dashicons"!=m[y]&&(g+=" "+m[y]),"fa"==m[y]&&(k="fontawesome");y>0&&("before"!=b&&"after"!=b||(g="fontawesome"==k?" ico-fa fasc-ico-"+b+g:" fasc-ico-"+b+g))}var x="";1==this.$popup.find(".fasc-mce-button[data-fasc-action='bold']").attr("data-fasc-button-active")&&(x+=" fasc-style-bold"),1==this.$popup.find(".fasc-mce-button[data-fasc-action='italic']").attr("data-fasc-button-active")&&(x+=" fasc-style-italic");var w=this.$popup.find(".fasc-mce-button[data-fasc-action='strikethrough']").attr("data-fasc-button-active");1==w&&(x+=" fasc-style-strikethrough");this.$popup.find(".fasc-mce-button[data-fasc-action='strikethrough']").attr("data-fasc-button-active");1==w&&(x+=" fasc-style-strikethrough");var j="";e.hasID&&(j=' data-fasc-id="fasc-button-tid-'+(new Date).getTime()+'"');return e.isSaving?'<a class="fasc-button'+u+p+g+x+'"'+l+v+' style="background-color:'+i+";color:"+s+';" data-fasc-style="background-color:'+i+";color:"+s+';"'+j+"></a>":'<a data-fasc-href="'+o+'" class="fasc-button'+u+p+g+x+'"'+l+v+' style="background-color:'+i+";color:"+s+';" data-fasc-style="background-color:'+i+";color:"+s+';"'+j+">"+n+"</a>"},setupTabs:function(a){var e=this;this.$tabs=a.find(".tab-header");var o=this.$tabs.find("li");this.$tabs.find("li a");o.click(function(){var n=t(this),c=n.attr("data-fasc-tab");return o.removeClass("active"),n.addClass("active"),e.loadTab(c,a),!1})},loadTab:function(a,e){e.find(".fasc-ajax-content .fasc-tab-content").hide(),e.find(".fasc-ajax-content .fasc-tab-content[data-fasc-tab="+a+"]").show(),this.loadTabContent(a),t(".ico-grid .grid-container div.active").length>0&&t(".ico-grid").scrollTop(t(".ico-grid .grid-container div.active").position().top-5)},loadTabContent:function(t,a){},refreshMiniColors:function(a,e,o){var n=this;jQuery(".preview-button-area .centered-button");a.is_text_input=!1,a.minicolors({inline:!0,opacity:!1,showSpeed:0,hideSpeed:0,textfield:!0,change:function(e,c){var i=a.val(),s=a.parent().parent().find(".fasc-popup-color-input");1==a.is_text_input?a.is_text_input=!1:s.val(i),s.off("input"),s.on("input",function(){var e=t(this).val();a.is_text_input=!0,a.minicolors("value",e)});var r=t("#fasc-popup-button-color").val(),d=t("#fasc-popup-text-color").val();o.find(".fasc-ico-fg .fg-panel").css("background-color",d),o.find(".fasc-ico-bg .bg-panel").css("background-color",r),n.updatePreview()}}),void 0!==e&&a.minicolors("value",e)},initEmptyTemplate:function(t,e,o){jQuery("#fasc-popup-button-text").val(o);var n=e.find(".preview-button-area .centered-button .fasc-button");this.refreshMiniColors(e.find("#fasc-popup-text-color"),a(n.css("color")),e),this.refreshMiniColors(e.find("#fasc-popup-button-color"),a(n.css("background-color")),e)},setSettingsFromNode:function(e,o,n){var c=t(e),i=c.attr("data-fasc-href");o.find(".fasc-ajax-content input#fasc-popup-button-url").val(i);var s=c.attr("target");o.find(".fasc-ajax-content input#fasc-popup-new-window").prop("checked",!1),void 0!==s&&"_blank"==s&&o.find(".fasc-ajax-content input#fasc-popup-new-window").prop("checked",!0);var r=c.attr("rel");o.find(".fasc-ajax-content input#fasc-popup-nofollow").prop("checked",!1),void 0!==r&&-1!==r.indexOf("nofollow")&&o.find(".fasc-ajax-content input#fasc-popup-nofollow").prop("checked",!0);var d=c.text();o.find(".fasc-ajax-content input#fasc-popup-button-text").val(d);var f=a(c.css("color"));o.find("#fasc-popup-text-color").val(f),o.find(".fasc-ico-fg .fg-panel").css("background-color",f),this.refreshMiniColors(o.find("#fasc-popup-text-color"),f,o);var p=a(c.css("background-color"));o.find("#fasc-popup-button-color").val(p),o.find(".fasc-ico-bg .bg-panel").css("background-color",p),this.refreshMiniColors(o.find("#fasc-popup-button-color"),p,o);var u=o.find('.fasc-ajax-content .fasc-tab-content[data-fasc-tab="2"]'),l=c.attr("class").split(/\s+/);u.find(".ico-grid > div > div").removeClass("active");for(var v=0;v<l.length;v++)if("fasc-type"==l[v].substring(0,9)){var h=l[v];(c.hasClass("fasc-rounded-medium")||c.hasClass("rounded"))&&(h+=" fasc-rounded-medium"),o.find("#fasc-popup-button-type option").prop("selected",!1),o.find('#fasc-popup-button-type option[value="'+h+'"]').prop("selected",!0),o.find("#fasc-popup-button-type").val(h)}else if("fasc-style"==l[v].substring(0,10))"fasc-style-bold"==l[v]?o.find(".fasc-mce-button[data-fasc-action='bold']").attr("data-fasc-button-active","1"):"fasc-style-italic"==l[v]?o.find(".fasc-mce-button[data-fasc-action='italic']").attr("data-fasc-button-active","1"):"fasc-style-strikethrough"==l[v]&&o.find(".fasc-mce-button[data-fasc-action='strikethrough']").attr("data-fasc-button-active","1");else if("fasc-size"==l[v].substring(0,9)){var b=l[v];o.find("#fasc-popup-button-size option").prop("selected",!1),o.find('#fasc-popup-button-size option[value="'+b+'"]').prop("selected",!0),o.find("#fasc-popup-button-size").val(b)}else if("dashicons"==l[v].substring(0,9)){u.find(".ico-grid .grid-container").removeClass("ico-screen-active"),u.find("#dashicons-grid").addClass("ico-screen-active"),o.find("#fasc-popup-icon-type-select").val("dashicons-grid"),o.find("#fasc-popup-icon-type-select").trigger("change");var g=l[v];o.find(".ico-grid ."+g).addClass("active")}else if("fa-"==l[v].substring(0,3)){u.find(".ico-grid .grid-container").removeClass("ico-screen-active");var m=u.find(".ico-grid").find("."+l[v]).parent().attr("id");u.find("#"+m).addClass("ico-screen-active"),o.find("#fasc-popup-icon-type-select").val(m),o.find("#fasc-popup-icon-type-select").trigger("change"),o.find(".ico-grid ."+l[v]).addClass("active")}c.hasClass("fasc-ico-before")||c.hasClass("fasc-ico-after")?c.hasClass("fasc-ico-before")?(u.find(".fasc-ico-position").prop("checked",!1),u.find('.fasc-ico-position[value="before"]').prop("checked",!0)):c.hasClass("fasc-ico-after")&&(u.find(".fasc-ico-position").prop("checked",!1),u.find('.fasc-ico-position[value="after"]').prop("checked",!0)):(u.find(".fasc-ico-position").prop("checked",!1),u.find('.fasc-ico-position[value="none"]').prop("checked",!0))}},wp.mce.fascpopup={open:function(a,o,n,c,i){this.type=o,this.templateID=o,this.is_editing=c;var s=e[o].content_id,r=jQuery("<div/>",{class:"fasc-thickbox-overlay"}).appendTo("body"),d=t("#fasc-popup-template").clone();d.removeAttr("id"),d.addClass(s);var f=t("#"+s),p=f.clone();f.remove();var u=d.find(".fasc-thickbox-content"),l=d.find(".fasc-thickbox-title-inner"),v=d.find(".fasc-thickbox-action-right");this.initTemplate(d,p,u,l,v),d.insertAfter(r),e[o].init(a,d,this.is_editing,i),d.show(),this.initEvents(a,d,v,u,p,n)},initTemplate:function(t,a,e,o,n){e.html(a.html());var c=a.attr("data-fasc-title"),i=a.attr("data-fasc-submit-label"),s=a.attr("data-fasc-width"),r=a.attr("data-fasc-height");o.text(c),n.text(i),t.css("max-width",s),t.css("max-height",r)},initEvents:function(a,o,n,c,i,s){var r=this;o.find("label").click(function(){}),o.find(".fasc-close-ajax-window").click(function(){r.removePopup(o,i)}),t(".fasc-thickbox-overlay").on("click",function(t){r.removePopup(o,i)}),n.click(function(t){t.preventDefault(),t.stopImmediatePropagation();var a=e[r.type].createButtonHtml({isSaving:!1,hasID:!0}),n=jQuery(a).attr("data-fasc-id");return s(a,n),r.removePopup(o,i),!1});var d=i.attr("data-fasc-width"),f=i.attr("data-fasc-height");t(window).resize(_.debounce(function(){r.centerPopup(o)},100)),r.centerPopup(o,d,f)},removePopup:function(a,o){var n=this;t(".fasc-thickbox-overlay").remove(),a.remove(),t("body").append(o),o.attr("id",e[n.type].content_id)},centerPopup:function(a,e,o){var n=a.find(".fasc-thickbox-header"),c=a.find(".fasc-thickbox-footer"),i=a.find(".fasc-thickbox-content"),s=(t(window),-a.height()/2),r=-a.width()/2;a.css("position","fixed").css({"margin-left":r+"px","margin-top":s+"px",left:"50%",top:"50%"}),i.hide();var d=a.outerHeight();d-=n.outerHeight(),d-=c.outerHeight(),i.height(d),i.show()}}}(jQuery);
|
admin/js/forget-about-shortcode-buttons-fasc-views.js
CHANGED
@@ -1,25 +1 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
/*
|
4 |
-
* The TinyMCE view API.
|
5 |
-
*
|
6 |
-
* Note: this API is "experimental" meaning that it will probably change
|
7 |
-
* in the next few releases based on feedback from 3.9.0.
|
8 |
-
* If you decide to use it, please follow the development closely.
|
9 |
-
*
|
10 |
-
* Diagram
|
11 |
-
*
|
12 |
-
* |- registered view constructor (type)
|
13 |
-
* | |- view instance (unique text)
|
14 |
-
* | | |- editor 1
|
15 |
-
* | | | |- view node
|
16 |
-
* | | | |- view node
|
17 |
-
* | | | |- ...
|
18 |
-
* | | |- editor 2
|
19 |
-
* | | | |- ...
|
20 |
-
* | |- view instance
|
21 |
-
* | | |- ...
|
22 |
-
* |- registered view
|
23 |
-
* | |- ...
|
24 |
-
*/
|
25 |
-
!function(a,b,c,d){"use strict";var e={},f={};b.mce=b.mce||{},b.mce.fascviews={register:function(a,b){},unregister:function(a){delete e[a]},get:function(a){return e[a]},unbind:function(){_.each(f,function(a){a.unbind()})},render:function(a){_.each(f,function(b){b.render(a)})},edit:function(a,b){var c=this.getInstance(b);c&&c.edit&&c.edit(c.text,function(d,e){c.update(d,a,b,e)})},remove:function(a,b){var c=this.getInstance(b);c&&c.remove(a,b)}},b.mce.View=function(a){_.extend(this,a),this.initialize()},b.mce.View.extend=Backbone.View.extend,_.extend(b.mce.View.prototype,{content:null,loader:!0,initialize:function(){},getContent:function(){return this.content}})}(window,window.wp,window.wp.shortcode,window.jQuery);
|
1 |
+
!function(n,e,t,i){"use strict";var c={},o={};e.mce=e.mce||{},e.mce.fascviews={register:function(n,e){},unregister:function(n){delete c[n]},get:function(n){return c[n]},unbind:function(){_.each(o,function(n){n.unbind()})},render:function(n){_.each(o,function(e){e.render(n)})},edit:function(n,e){var t=this.getInstance(e);t&&t.edit&&t.edit(t.text,function(i,c){t.update(i,n,e,c)})},remove:function(n,e){var t=this.getInstance(e);t&&t.remove(n,e)}}}(window,window.wp,window.wp.shortcode,window.jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/js/jquery.minicolors.min.js
CHANGED
@@ -1,11 +1 @@
|
|
1 |
-
/*
|
2 |
-
* jQuery MiniColors: A tiny color picker built on jQuery
|
3 |
-
*
|
4 |
-
* Copyright: Cory LaViska for A Beautiful Site, LLC: http://www.abeautifulsite.net/
|
5 |
-
*
|
6 |
-
* Contribute: https://github.com/claviska/jquery-minicolors
|
7 |
-
*
|
8 |
-
* @license: http://opensource.org/licenses/MIT
|
9 |
-
*
|
10 |
-
*/
|
11 |
-
!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function($){"use strict";function i(i,t){var o=$('<div class="minicolors" />'),s=$.minicolors.defaults,a,n,r,c,l;if(!i.data("minicolors-initialized")){if(t=$.extend(!0,{},s,t),o.addClass("minicolors-theme-"+t.theme).toggleClass("minicolors-with-opacity",t.opacity).toggleClass("minicolors-no-data-uris",t.dataUris!==!0),void 0!==t.position&&$.each(t.position.split(" "),function(){o.addClass("minicolors-position-"+this)}),a="rgb"===t.format?t.opacity?"25":"20":t.keywords?"11":"7",i.addClass("minicolors-input").data("minicolors-initialized",!1).data("minicolors-settings",t).prop("size",a).wrap(o).after('<div class="minicolors-panel minicolors-slider-'+t.control+'"><div class="minicolors-slider minicolors-sprite"><div class="minicolors-picker"></div></div><div class="minicolors-opacity-slider minicolors-sprite"><div class="minicolors-picker"></div></div><div class="minicolors-grid minicolors-sprite"><div class="minicolors-grid-inner"></div><div class="minicolors-picker"><div></div></div></div></div>'),t.inline||(i.after('<span class="minicolors-swatch minicolors-sprite minicolors-input-swatch"><span class="minicolors-swatch-color"></span></span>'),i.next(".minicolors-input-swatch").on("click",function(t){t.preventDefault(),i.focus()})),c=i.parent().find(".minicolors-panel"),c.on("selectstart",function(){return!1}).end(),t.swatches&&0!==t.swatches.length)for(t.swatches.length>7&&(t.swatches.length=7),c.addClass("minicolors-with-swatches"),n=$('<ul class="minicolors-swatches"></ul>').appendTo(c),l=0;l<t.swatches.length;++l)r=t.swatches[l],r=f(r)?u(r,!0):x(p(r,!0)),$('<li class="minicolors-swatch minicolors-sprite"><span class="minicolors-swatch-color"></span></li>').appendTo(n).data("swatch-color",t.swatches[l]).find(".minicolors-swatch-color").css({backgroundColor:y(r),opacity:r.a}),t.swatches[l]=r;t.inline&&i.parent().addClass("minicolors-inline"),e(i,!1),i.data("minicolors-initialized",!0)}}function t(i){var t=i.parent();i.removeData("minicolors-initialized").removeData("minicolors-settings").removeProp("size").removeClass("minicolors-input"),t.before(i).remove()}function o(i){var t=i.parent(),o=t.find(".minicolors-panel"),a=i.data("minicolors-settings");!i.data("minicolors-initialized")||i.prop("disabled")||t.hasClass("minicolors-inline")||t.hasClass("minicolors-focus")||(s(),t.addClass("minicolors-focus"),o.stop(!0,!0).fadeIn(a.showSpeed,function(){a.show&&a.show.call(i.get(0))}))}function s(){$(".minicolors-focus").each(function(){var i=$(this),t=i.find(".minicolors-input"),o=i.find(".minicolors-panel"),s=t.data("minicolors-settings");o.fadeOut(s.hideSpeed,function(){s.hide&&s.hide.call(t.get(0)),i.removeClass("minicolors-focus")})})}function a(i,t,o){var s=i.parents(".minicolors").find(".minicolors-input"),a=s.data("minicolors-settings"),r=i.find("[class$=-picker]"),e=i.offset().left,c=i.offset().top,l=Math.round(t.pageX-e),h=Math.round(t.pageY-c),d=o?a.animationSpeed:0,p,u,g,m;t.originalEvent.changedTouches&&(l=t.originalEvent.changedTouches[0].pageX-e,h=t.originalEvent.changedTouches[0].pageY-c),0>l&&(l=0),0>h&&(h=0),l>i.width()&&(l=i.width()),h>i.height()&&(h=i.height()),i.parent().is(".minicolors-slider-wheel")&&r.parent().is(".minicolors-grid")&&(p=75-l,u=75-h,g=Math.sqrt(p*p+u*u),m=Math.atan2(u,p),0>m&&(m+=2*Math.PI),g>75&&(g=75,l=75-75*Math.cos(m),h=75-75*Math.sin(m)),l=Math.round(l),h=Math.round(h)),i.is(".minicolors-grid")?r.stop(!0).animate({top:h+"px",left:l+"px"},d,a.animationEasing,function(){n(s,i)}):r.stop(!0).animate({top:h+"px"},d,a.animationEasing,function(){n(s,i)})}function n(i,t){function o(i,t){var o,s;return i.length&&t?(o=i.offset().left,s=i.offset().top,{x:o-t.offset().left+i.outerWidth()/2,y:s-t.offset().top+i.outerHeight()/2}):null}var s,a,n,e,l,h,d,p=i.val(),u=i.attr("data-opacity"),g=i.parent(),f=i.data("minicolors-settings"),v=g.find(".minicolors-input-swatch"),b=g.find(".minicolors-grid"),w=g.find(".minicolors-slider"),y=g.find(".minicolors-opacity-slider"),k=b.find("[class$=-picker]"),M=w.find("[class$=-picker]"),x=y.find("[class$=-picker]"),I=o(k,b),S=o(M,w),z=o(x,y);if(t.is(".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider")){switch(f.control){case"wheel":e=b.width()/2-I.x,l=b.height()/2-I.y,h=Math.sqrt(e*e+l*l),d=Math.atan2(l,e),0>d&&(d+=2*Math.PI),h>75&&(h=75,I.x=69-75*Math.cos(d),I.y=69-75*Math.sin(d)),a=m(h/.75,0,100),s=m(180*d/Math.PI,0,360),n=m(100-Math.floor(S.y*(100/w.height())),0,100),p=C({h:s,s:a,b:n}),w.css("backgroundColor",C({h:s,s:a,b:100}));break;case"saturation":s=m(parseInt(I.x*(360/b.width()),10),0,360),a=m(100-Math.floor(S.y*(100/w.height())),0,100),n=m(100-Math.floor(I.y*(100/b.height())),0,100),p=C({h:s,s:a,b:n}),w.css("backgroundColor",C({h:s,s:100,b:n})),g.find(".minicolors-grid-inner").css("opacity",a/100);break;case"brightness":s=m(parseInt(I.x*(360/b.width()),10),0,360),a=m(100-Math.floor(I.y*(100/b.height())),0,100),n=m(100-Math.floor(S.y*(100/w.height())),0,100),p=C({h:s,s:a,b:n}),w.css("backgroundColor",C({h:s,s:a,b:100})),g.find(".minicolors-grid-inner").css("opacity",1-n/100);break;default:s=m(360-parseInt(S.y*(360/w.height()),10),0,360),a=m(Math.floor(I.x*(100/b.width())),0,100),n=m(100-Math.floor(I.y*(100/b.height())),0,100),p=C({h:s,s:a,b:n}),b.css("backgroundColor",C({h:s,s:100,b:100}))}u=f.opacity?parseFloat(1-z.y/y.height()).toFixed(2):1,r(i,p,u)}else v.find("span").css({backgroundColor:p,opacity:u}),c(i,p,u)}function r(i,t,o){var s,a=i.parent(),n=i.data("minicolors-settings"),r=a.find(".minicolors-input-swatch");n.opacity&&i.attr("data-opacity",o),"rgb"===n.format?(s=f(t)?u(t,!0):x(p(t,!0)),o=""===i.attr("data-opacity")?1:m(parseFloat(i.attr("data-opacity")).toFixed(2),0,1),(isNaN(o)||!n.opacity)&&(o=1),t=i.minicolors("rgbObject").a<=1&&s&&n.opacity?"rgba("+s.r+", "+s.g+", "+s.b+", "+parseFloat(o)+")":"rgb("+s.r+", "+s.g+", "+s.b+")"):(f(t)&&(t=w(t)),t=d(t,n.letterCase)),i.val(t),r.find("span").css({backgroundColor:t,opacity:o}),c(i,t,o)}function e(i,t){var o,s,a,n,r,e,l,h,b,y,M=i.parent(),x=i.data("minicolors-settings"),I=M.find(".minicolors-input-swatch"),S=M.find(".minicolors-grid"),z=M.find(".minicolors-slider"),F=M.find(".minicolors-opacity-slider"),D=S.find("[class$=-picker]"),T=z.find("[class$=-picker]"),j=F.find("[class$=-picker]");switch(f(i.val())?(o=w(i.val()),r=m(parseFloat(v(i.val())).toFixed(2),0,1),r&&i.attr("data-opacity",r)):o=d(p(i.val(),!0),x.letterCase),o||(o=d(g(x.defaultValue,!0),x.letterCase)),s=k(o),n=x.keywords?$.map(x.keywords.split(","),function(i){return $.trim(i.toLowerCase())}):[],e=""!==i.val()&&$.inArray(i.val().toLowerCase(),n)>-1?d(i.val()):f(i.val())?u(i.val()):o,t||i.val(e),x.opacity&&(a=""===i.attr("data-opacity")?1:m(parseFloat(i.attr("data-opacity")).toFixed(2),0,1),isNaN(a)&&(a=1),i.attr("data-opacity",a),I.find("span").css("opacity",a),h=m(F.height()-F.height()*a,0,F.height()),j.css("top",h+"px")),"transparent"===i.val().toLowerCase()&&I.find("span").css("opacity",0),I.find("span").css("backgroundColor",o),x.control){case"wheel":b=m(Math.ceil(.75*s.s),0,S.height()/2),y=s.h*Math.PI/180,l=m(75-Math.cos(y)*b,0,S.width()),h=m(75-Math.sin(y)*b,0,S.height()),D.css({top:h+"px",left:l+"px"}),h=150-s.b/(100/S.height()),""===o&&(h=0),T.css("top",h+"px"),z.css("backgroundColor",C({h:s.h,s:s.s,b:100}));break;case"saturation":l=m(5*s.h/12,0,150),h=m(S.height()-Math.ceil(s.b/(100/S.height())),0,S.height()),D.css({top:h+"px",left:l+"px"}),h=m(z.height()-s.s*(z.height()/100),0,z.height()),T.css("top",h+"px"),z.css("backgroundColor",C({h:s.h,s:100,b:s.b})),M.find(".minicolors-grid-inner").css("opacity",s.s/100);break;case"brightness":l=m(5*s.h/12,0,150),h=m(S.height()-Math.ceil(s.s/(100/S.height())),0,S.height()),D.css({top:h+"px",left:l+"px"}),h=m(z.height()-s.b*(z.height()/100),0,z.height()),T.css("top",h+"px"),z.css("backgroundColor",C({h:s.h,s:s.s,b:100})),M.find(".minicolors-grid-inner").css("opacity",1-s.b/100);break;default:l=m(Math.ceil(s.s/(100/S.width())),0,S.width()),h=m(S.height()-Math.ceil(s.b/(100/S.height())),0,S.height()),D.css({top:h+"px",left:l+"px"}),h=m(z.height()-s.h/(360/z.height()),0,z.height()),T.css("top",h+"px"),S.css("backgroundColor",C({h:s.h,s:100,b:100}))}i.data("minicolors-initialized")&&c(i,e,a)}function c(i,t,o){var s=i.data("minicolors-settings"),a=i.data("minicolors-lastChange"),n,r,e;if(!a||a.value!==t||a.opacity!==o){if(i.data("minicolors-lastChange",{value:t,opacity:o}),s.swatches&&0!==s.swatches.length){for(n=f(t)?u(t,!0):x(t),r=-1,e=0;e<s.swatches.length;++e)if(n.r===s.swatches[e].r&&n.g===s.swatches[e].g&&n.b===s.swatches[e].b&&n.a===s.swatches[e].a){r=e;break}i.parent().find(".minicolors-swatches .minicolors-swatch").removeClass("selected"),-1!==e&&i.parent().find(".minicolors-swatches .minicolors-swatch").eq(e).addClass("selected")}s.change&&(s.changeDelay?(clearTimeout(i.data("minicolors-changeTimeout")),i.data("minicolors-changeTimeout",setTimeout(function(){s.change.call(i.get(0),t,o)},s.changeDelay))):s.change.call(i.get(0),t,o)),i.trigger("change").trigger("input")}}function l(i){var t=p($(i).val(),!0),o=x(t),s=$(i).attr("data-opacity");return o?(void 0!==s&&$.extend(o,{a:parseFloat(s)}),o):null}function h(i,t){var o=p($(i).val(),!0),s=x(o),a=$(i).attr("data-opacity");return s?(void 0===a&&(a=1),t?"rgba("+s.r+", "+s.g+", "+s.b+", "+parseFloat(a)+")":"rgb("+s.r+", "+s.g+", "+s.b+")"):null}function d(i,t){return"uppercase"===t?i.toUpperCase():i.toLowerCase()}function p(i,t){return i=i.replace(/^#/g,""),i.match(/^[A-F0-9]{3,6}/gi)?3!==i.length&&6!==i.length?"":(3===i.length&&t&&(i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]),"#"+i):""}function u(i,t){var o=i.replace(/[^\d,.]/g,""),s=o.split(",");return s[0]=m(parseInt(s[0],10),0,255),s[1]=m(parseInt(s[1],10),0,255),s[2]=m(parseInt(s[2],10),0,255),s[3]&&(s[3]=m(parseFloat(s[3],10),0,1)),t?{r:s[0],g:s[1],b:s[2],a:s[3]?s[3]:null}:"undefined"!=typeof s[3]&&s[3]<=1?"rgba("+s[0]+", "+s[1]+", "+s[2]+", "+s[3]+")":"rgb("+s[0]+", "+s[1]+", "+s[2]+")"}function g(i,t){return f(i)?u(i):p(i,t)}function m(i,t,o){return t>i&&(i=t),i>o&&(i=o),i}function f(i){var t=i.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);return t&&4===t.length?!0:!1}function v(i){return i=i.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+(\.\d{1,2})?|\.\d{1,2})[\s+]?/i),i&&6===i.length?i[4]:"1"}function b(i){var t={},o=Math.round(i.h),s=Math.round(255*i.s/100),a=Math.round(255*i.b/100);if(0===s)t.r=t.g=t.b=a;else{var n=a,r=(255-s)*a/255,e=(n-r)*(o%60)/60;360===o&&(o=0),60>o?(t.r=n,t.b=r,t.g=r+e):120>o?(t.g=n,t.b=r,t.r=n-e):180>o?(t.g=n,t.r=r,t.b=r+e):240>o?(t.b=n,t.r=r,t.g=n-e):300>o?(t.b=n,t.g=r,t.r=r+e):360>o?(t.r=n,t.g=r,t.b=n-e):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}}function w(i){return i=i.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i),i&&4===i.length?"#"+("0"+parseInt(i[1],10).toString(16)).slice(-2)+("0"+parseInt(i[2],10).toString(16)).slice(-2)+("0"+parseInt(i[3],10).toString(16)).slice(-2):""}function y(i){var t=[i.r.toString(16),i.g.toString(16),i.b.toString(16)];return $.each(t,function(i,o){1===o.length&&(t[i]="0"+o)}),"#"+t.join("")}function C(i){return y(b(i))}function k(i){var t=M(x(i));return 0===t.s&&(t.h=360),t}function M(i){var t={h:0,s:0,b:0},o=Math.min(i.r,i.g,i.b),s=Math.max(i.r,i.g,i.b),a=s-o;return t.b=s,t.s=0!==s?255*a/s:0,0!==t.s?i.r===s?t.h=(i.g-i.b)/a:i.g===s?t.h=2+(i.b-i.r)/a:t.h=4+(i.r-i.g)/a:t.h=-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t}function x(i){return i=parseInt(i.indexOf("#")>-1?i.substring(1):i,16),{r:i>>16,g:(65280&i)>>8,b:255&i}}$.minicolors={defaults:{animationSpeed:50,animationEasing:"swing",change:null,changeDelay:0,control:"hue",dataUris:!0,defaultValue:"",format:"hex",hide:null,hideSpeed:100,inline:!1,keywords:"",letterCase:"lowercase",opacity:!1,position:"bottom left",show:null,showSpeed:100,theme:"default",swatches:[]}},$.extend($.fn,{minicolors:function(a,n){switch(a){case"destroy":return $(this).each(function(){t($(this))}),$(this);case"hide":return s(),$(this);case"opacity":return void 0===n?$(this).attr("data-opacity"):($(this).each(function(){e($(this).attr("data-opacity",n))}),$(this));case"rgbObject":return l($(this),"rgbaObject"===a);case"rgbString":case"rgbaString":return h($(this),"rgbaString"===a);case"settings":return void 0===n?$(this).data("minicolors-settings"):($(this).each(function(){var i=$(this).data("minicolors-settings")||{};t($(this)),$(this).minicolors($.extend(!0,i,n))}),$(this));case"show":return o($(this).eq(0)),$(this);case"value":return void 0===n?$(this).val():($(this).each(function(){"object"==typeof n?(n.opacity&&$(this).attr("data-opacity",m(n.opacity,0,1)),n.color&&$(this).val(n.color)):$(this).val(n),e($(this))}),$(this));default:return"create"!==a&&(n=a),$(this).each(function(){i($(this),n)}),$(this)}}}),$(document).on("mousedown.minicolors touchstart.minicolors",function(i){$(i.target).parents().add(i.target).hasClass("minicolors")||s()}).on("mousedown.minicolors touchstart.minicolors",".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider",function(i){var t=$(this);i.preventDefault(),$(document).data("minicolors-target",t),a(t,i,!0)}).on("mousemove.minicolors touchmove.minicolors",function(i){var t=$(document).data("minicolors-target");t&&a(t,i)}).on("mouseup.minicolors touchend.minicolors",function(){$(this).removeData("minicolors-target")}).on("click.minicolors",".minicolors-swatches li",function(i){i.preventDefault();var t=$(this),o=t.parents(".minicolors").find(".minicolors-input"),s=t.data("swatch-color");r(o,s,v(s)),e(o)}).on("mousedown.minicolors touchstart.minicolors",".minicolors-input-swatch",function(i){var t=$(this).parent().find(".minicolors-input");i.preventDefault(),o(t)}).on("focus.minicolors",".minicolors-input",function(){var i=$(this);i.data("minicolors-initialized")&&o(i)}).on("blur.minicolors",".minicolors-input",function(){var i=$(this),t=i.data("minicolors-settings"),o,s,a,n,r;i.data("minicolors-initialized")&&(o=t.keywords?$.map(t.keywords.split(","),function(i){return $.trim(i.toLowerCase())}):[],""!==i.val()&&$.inArray(i.val().toLowerCase(),o)>-1?r=i.val():(f(i.val())?a=u(i.val(),!0):(s=p(i.val(),!0),a=s?x(s):null),r=null===a?t.defaultValue:"rgb"===t.format?u(t.opacity?"rgba("+a.r+","+a.g+","+a.b+","+i.attr("data-opacity")+")":"rgb("+a.r+","+a.g+","+a.b+")"):y(a)),n=t.opacity?i.attr("data-opacity"):1,"transparent"===r.toLowerCase()&&(n=0),i.closest(".minicolors").find(".minicolors-input-swatch > span").css("opacity",n),i.val(r),""===i.val()&&i.val(g(t.defaultValue,!0)),i.val(d(i.val(),t.letterCase)))}).on("keydown.minicolors",".minicolors-input",function(i){var t=$(this);if(t.data("minicolors-initialized"))switch(i.keyCode){case 9:s();break;case 13:case 27:s(),t.blur()}}).on("keyup.minicolors",".minicolors-input",function(){var i=$(this);i.data("minicolors-initialized")&&e(i,!0)}).on("paste.minicolors",".minicolors-input",function(){var i=$(this);i.data("minicolors-initialized")&&setTimeout(function(){e(i,!0)},1)})});
|
1 |
+
!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";function t(t,o){var s,a,n,r,e,l=i('<div class="minicolors" />'),h=i.minicolors.defaults;if(!t.data("minicolors-initialized")){if(o=i.extend(!0,{},h,o),l.addClass("minicolors-theme-"+o.theme).toggleClass("minicolors-with-opacity",o.opacity).toggleClass("minicolors-no-data-uris",!0!==o.dataUris),void 0!==o.position&&i.each(o.position.split(" "),function(){l.addClass("minicolors-position-"+this)}),s="rgb"===o.format?o.opacity?"25":"20":o.keywords?"11":"7",t.addClass("minicolors-input").data("minicolors-initialized",!1).data("minicolors-settings",o).prop("size",s).wrap(l).after('<div class="minicolors-panel minicolors-slider-'+o.control+'"><div class="minicolors-slider minicolors-sprite"><div class="minicolors-picker"></div></div><div class="minicolors-opacity-slider minicolors-sprite"><div class="minicolors-picker"></div></div><div class="minicolors-grid minicolors-sprite"><div class="minicolors-grid-inner"></div><div class="minicolors-picker"><div></div></div></div></div>'),o.inline||(t.after('<span class="minicolors-swatch minicolors-sprite minicolors-input-swatch"><span class="minicolors-swatch-color"></span></span>'),t.next(".minicolors-input-swatch").on("click",function(i){i.preventDefault(),t.focus()})),(r=t.parent().find(".minicolors-panel")).on("selectstart",function(){return!1}).end(),o.swatches&&0!==o.swatches.length)for(o.swatches.length>7&&(o.swatches.length=7),r.addClass("minicolors-with-swatches"),a=i('<ul class="minicolors-swatches"></ul>').appendTo(r),e=0;e<o.swatches.length;++e)n=o.swatches[e],n=v(n)?g(n,!0):I(u(n,!0)),i('<li class="minicolors-swatch minicolors-sprite"><span class="minicolors-swatch-color"></span></li>').appendTo(a).data("swatch-color",o.swatches[e]).find(".minicolors-swatch-color").css({backgroundColor:C(n),opacity:n.a}),o.swatches[e]=n;o.inline&&t.parent().addClass("minicolors-inline"),c(t,!1),t.data("minicolors-initialized",!0)}}function o(i){var t=i.parent();i.removeData("minicolors-initialized").removeData("minicolors-settings").removeProp("size").removeClass("minicolors-input"),t.before(i).remove()}function s(i){var t=i.parent(),o=t.find(".minicolors-panel"),s=i.data("minicolors-settings");!i.data("minicolors-initialized")||i.prop("disabled")||t.hasClass("minicolors-inline")||t.hasClass("minicolors-focus")||(a(),t.addClass("minicolors-focus"),o.stop(!0,!0).fadeIn(s.showSpeed,function(){s.show&&s.show.call(i.get(0))}))}function a(){i(".minicolors-focus").each(function(){var t=i(this),o=t.find(".minicolors-input"),s=t.find(".minicolors-panel"),a=o.data("minicolors-settings");s.fadeOut(a.hideSpeed,function(){a.hide&&a.hide.call(o.get(0)),t.removeClass("minicolors-focus")})})}function n(i,t,o){var s,a,n,e,c=i.parents(".minicolors").find(".minicolors-input"),l=c.data("minicolors-settings"),h=i.find("[class$=-picker]"),d=i.offset().left,p=i.offset().top,u=Math.round(t.pageX-d),g=Math.round(t.pageY-p),m=o?l.animationSpeed:0;t.originalEvent.changedTouches&&(u=t.originalEvent.changedTouches[0].pageX-d,g=t.originalEvent.changedTouches[0].pageY-p),0>u&&(u=0),0>g&&(g=0),u>i.width()&&(u=i.width()),g>i.height()&&(g=i.height()),i.parent().is(".minicolors-slider-wheel")&&h.parent().is(".minicolors-grid")&&(s=75-u,a=75-g,n=Math.sqrt(s*s+a*a),0>(e=Math.atan2(a,s))&&(e+=2*Math.PI),n>75&&(n=75,u=75-75*Math.cos(e),g=75-75*Math.sin(e)),u=Math.round(u),g=Math.round(g)),i.is(".minicolors-grid")?h.stop(!0).animate({top:g+"px",left:u+"px"},m,l.animationEasing,function(){r(c,i)}):h.stop(!0).animate({top:g+"px"},m,l.animationEasing,function(){r(c,i)})}function r(i,t){function o(i,t){var o,s;return i.length&&t?(o=i.offset().left,s=i.offset().top,{x:o-t.offset().left+i.outerWidth()/2,y:s-t.offset().top+i.outerHeight()/2}):null}var s,a,n,r,c,h,d,p=i.val(),u=i.attr("data-opacity"),g=i.parent(),m=i.data("minicolors-settings"),v=g.find(".minicolors-input-swatch"),b=g.find(".minicolors-grid"),w=g.find(".minicolors-slider"),y=g.find(".minicolors-opacity-slider"),C=b.find("[class$=-picker]"),M=w.find("[class$=-picker]"),x=y.find("[class$=-picker]"),I=o(C,b),S=o(M,w),z=o(x,y);if(t.is(".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider")){switch(m.control){case"wheel":r=b.width()/2-I.x,c=b.height()/2-I.y,h=Math.sqrt(r*r+c*c),0>(d=Math.atan2(c,r))&&(d+=2*Math.PI),h>75&&(h=75,I.x=69-75*Math.cos(d),I.y=69-75*Math.sin(d)),a=f(h/.75,0,100),p=k({h:s=f(180*d/Math.PI,0,360),s:a,b:n=f(100-Math.floor(S.y*(100/w.height())),0,100)}),w.css("backgroundColor",k({h:s,s:a,b:100}));break;case"saturation":p=k({h:s=f(parseInt(I.x*(360/b.width()),10),0,360),s:a=f(100-Math.floor(S.y*(100/w.height())),0,100),b:n=f(100-Math.floor(I.y*(100/b.height())),0,100)}),w.css("backgroundColor",k({h:s,s:100,b:n})),g.find(".minicolors-grid-inner").css("opacity",a/100);break;case"brightness":p=k({h:s=f(parseInt(I.x*(360/b.width()),10),0,360),s:a=f(100-Math.floor(I.y*(100/b.height())),0,100),b:n=f(100-Math.floor(S.y*(100/w.height())),0,100)}),w.css("backgroundColor",k({h:s,s:a,b:100})),g.find(".minicolors-grid-inner").css("opacity",1-n/100);break;default:p=k({h:s=f(360-parseInt(S.y*(360/w.height()),10),0,360),s:a=f(Math.floor(I.x*(100/b.width())),0,100),b:n=f(100-Math.floor(I.y*(100/b.height())),0,100)}),b.css("backgroundColor",k({h:s,s:100,b:100}))}e(i,p,u=m.opacity?parseFloat(1-z.y/y.height()).toFixed(2):1)}else v.find("span").css({backgroundColor:p,opacity:u}),l(i,p,u)}function e(i,t,o){var s,a=i.parent(),n=i.data("minicolors-settings"),r=a.find(".minicolors-input-swatch");n.opacity&&i.attr("data-opacity",o),"rgb"===n.format?(s=v(t)?g(t,!0):I(u(t,!0)),o=""===i.attr("data-opacity")?1:f(parseFloat(i.attr("data-opacity")).toFixed(2),0,1),(isNaN(o)||!n.opacity)&&(o=1),t=i.minicolors("rgbObject").a<=1&&s&&n.opacity?"rgba("+s.r+", "+s.g+", "+s.b+", "+parseFloat(o)+")":"rgb("+s.r+", "+s.g+", "+s.b+")"):(v(t)&&(t=y(t)),t=p(t,n.letterCase)),i.val(t),r.find("span").css({backgroundColor:t,opacity:o}),l(i,t,o)}function c(t,o){var s,a,n,r,e,c,h,d,w,C,x=t.parent(),I=t.data("minicolors-settings"),S=x.find(".minicolors-input-swatch"),z=x.find(".minicolors-grid"),F=x.find(".minicolors-slider"),D=x.find(".minicolors-opacity-slider"),T=z.find("[class$=-picker]"),j=F.find("[class$=-picker]"),q=D.find("[class$=-picker]");switch(v(t.val())?(s=y(t.val()),(e=f(parseFloat(b(t.val())).toFixed(2),0,1))&&t.attr("data-opacity",e)):s=p(u(t.val(),!0),I.letterCase),s||(s=p(m(I.defaultValue,!0),I.letterCase)),a=M(s),r=I.keywords?i.map(I.keywords.split(","),function(t){return i.trim(t.toLowerCase())}):[],c=""!==t.val()&&i.inArray(t.val().toLowerCase(),r)>-1?p(t.val()):v(t.val())?g(t.val()):s,o||t.val(c),I.opacity&&(n=""===t.attr("data-opacity")?1:f(parseFloat(t.attr("data-opacity")).toFixed(2),0,1),isNaN(n)&&(n=1),t.attr("data-opacity",n),S.find("span").css("opacity",n),d=f(D.height()-D.height()*n,0,D.height()),q.css("top",d+"px")),"transparent"===t.val().toLowerCase()&&S.find("span").css("opacity",0),S.find("span").css("backgroundColor",s),I.control){case"wheel":w=f(Math.ceil(.75*a.s),0,z.height()/2),C=a.h*Math.PI/180,h=f(75-Math.cos(C)*w,0,z.width()),d=f(75-Math.sin(C)*w,0,z.height()),T.css({top:d+"px",left:h+"px"}),d=150-a.b/(100/z.height()),""===s&&(d=0),j.css("top",d+"px"),F.css("backgroundColor",k({h:a.h,s:a.s,b:100}));break;case"saturation":h=f(5*a.h/12,0,150),d=f(z.height()-Math.ceil(a.b/(100/z.height())),0,z.height()),T.css({top:d+"px",left:h+"px"}),d=f(F.height()-a.s*(F.height()/100),0,F.height()),j.css("top",d+"px"),F.css("backgroundColor",k({h:a.h,s:100,b:a.b})),x.find(".minicolors-grid-inner").css("opacity",a.s/100);break;case"brightness":h=f(5*a.h/12,0,150),d=f(z.height()-Math.ceil(a.s/(100/z.height())),0,z.height()),T.css({top:d+"px",left:h+"px"}),d=f(F.height()-a.b*(F.height()/100),0,F.height()),j.css("top",d+"px"),F.css("backgroundColor",k({h:a.h,s:a.s,b:100})),x.find(".minicolors-grid-inner").css("opacity",1-a.b/100);break;default:h=f(Math.ceil(a.s/(100/z.width())),0,z.width()),d=f(z.height()-Math.ceil(a.b/(100/z.height())),0,z.height()),T.css({top:d+"px",left:h+"px"}),d=f(F.height()-a.h/(360/F.height()),0,F.height()),j.css("top",d+"px"),z.css("backgroundColor",k({h:a.h,s:100,b:100}))}t.data("minicolors-initialized")&&l(t,c,n)}function l(i,t,o){var s,a,n=i.data("minicolors-settings"),r=i.data("minicolors-lastChange");if(!r||r.value!==t||r.opacity!==o){if(i.data("minicolors-lastChange",{value:t,opacity:o}),n.swatches&&0!==n.swatches.length){for(s=v(t)?g(t,!0):I(t),-1,a=0;a<n.swatches.length;++a)if(s.r===n.swatches[a].r&&s.g===n.swatches[a].g&&s.b===n.swatches[a].b&&s.a===n.swatches[a].a){a;break}i.parent().find(".minicolors-swatches .minicolors-swatch").removeClass("selected"),-1!==a&&i.parent().find(".minicolors-swatches .minicolors-swatch").eq(a).addClass("selected")}n.change&&(n.changeDelay?(clearTimeout(i.data("minicolors-changeTimeout")),i.data("minicolors-changeTimeout",setTimeout(function(){n.change.call(i.get(0),t,o)},n.changeDelay))):n.change.call(i.get(0),t,o)),i.trigger("change").trigger("input")}}function h(t){var o=I(u(i(t).val(),!0)),s=i(t).attr("data-opacity");return o?(void 0!==s&&i.extend(o,{a:parseFloat(s)}),o):null}function d(t,o){var s=I(u(i(t).val(),!0)),a=i(t).attr("data-opacity");return s?(void 0===a&&(a=1),o?"rgba("+s.r+", "+s.g+", "+s.b+", "+parseFloat(a)+")":"rgb("+s.r+", "+s.g+", "+s.b+")"):null}function p(i,t){return"uppercase"===t?i.toUpperCase():i.toLowerCase()}function u(i,t){return i=i.replace(/^#/g,""),i.match(/^[A-F0-9]{3,6}/gi)?3!==i.length&&6!==i.length?"":(3===i.length&&t&&(i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]),"#"+i):""}function g(i,t){var o=i.replace(/[^\d,.]/g,"").split(",");return o[0]=f(parseInt(o[0],10),0,255),o[1]=f(parseInt(o[1],10),0,255),o[2]=f(parseInt(o[2],10),0,255),o[3]&&(o[3]=f(parseFloat(o[3],10),0,1)),t?{r:o[0],g:o[1],b:o[2],a:o[3]?o[3]:null}:void 0!==o[3]&&o[3]<=1?"rgba("+o[0]+", "+o[1]+", "+o[2]+", "+o[3]+")":"rgb("+o[0]+", "+o[1]+", "+o[2]+")"}function m(i,t){return v(i)?g(i):u(i,t)}function f(i,t,o){return t>i&&(i=t),i>o&&(i=o),i}function v(i){var t=i.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);return!(!t||4!==t.length)}function b(i){return i=i.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+(\.\d{1,2})?|\.\d{1,2})[\s+]?/i),i&&6===i.length?i[4]:"1"}function w(i){var t={},o=Math.round(i.h),s=Math.round(255*i.s/100),a=Math.round(255*i.b/100);if(0===s)t.r=t.g=t.b=a;else{var n=a,r=(255-s)*a/255,e=o%60*(n-r)/60;360===o&&(o=0),60>o?(t.r=n,t.b=r,t.g=r+e):120>o?(t.g=n,t.b=r,t.r=n-e):180>o?(t.g=n,t.r=r,t.b=r+e):240>o?(t.b=n,t.r=r,t.g=n-e):300>o?(t.b=n,t.g=r,t.r=r+e):360>o?(t.r=n,t.g=r,t.b=n-e):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}}function y(i){return i=i.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i),i&&4===i.length?"#"+("0"+parseInt(i[1],10).toString(16)).slice(-2)+("0"+parseInt(i[2],10).toString(16)).slice(-2)+("0"+parseInt(i[3],10).toString(16)).slice(-2):""}function C(t){var o=[t.r.toString(16),t.g.toString(16),t.b.toString(16)];return i.each(o,function(i,t){1===t.length&&(o[i]="0"+t)}),"#"+o.join("")}function k(i){return C(w(i))}function M(i){var t=x(I(i));return 0===t.s&&(t.h=360),t}function x(i){var t={h:0,s:0,b:0},o=Math.min(i.r,i.g,i.b),s=Math.max(i.r,i.g,i.b),a=s-o;return t.b=s,t.s=0!==s?255*a/s:0,0!==t.s?i.r===s?t.h=(i.g-i.b)/a:i.g===s?t.h=2+(i.b-i.r)/a:t.h=4+(i.r-i.g)/a:t.h=-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t}function I(i){return i=parseInt(i.indexOf("#")>-1?i.substring(1):i,16),{r:i>>16,g:(65280&i)>>8,b:255&i}}i.minicolors={defaults:{animationSpeed:50,animationEasing:"swing",change:null,changeDelay:0,control:"hue",dataUris:!0,defaultValue:"",format:"hex",hide:null,hideSpeed:100,inline:!1,keywords:"",letterCase:"lowercase",opacity:!1,position:"bottom left",show:null,showSpeed:100,theme:"default",swatches:[]}},i.extend(i.fn,{minicolors:function(n,r){switch(n){case"destroy":return i(this).each(function(){o(i(this))}),i(this);case"hide":return a(),i(this);case"opacity":return void 0===r?i(this).attr("data-opacity"):(i(this).each(function(){c(i(this).attr("data-opacity",r))}),i(this));case"rgbObject":return h(i(this));case"rgbString":case"rgbaString":return d(i(this),"rgbaString"===n);case"settings":return void 0===r?i(this).data("minicolors-settings"):(i(this).each(function(){var t=i(this).data("minicolors-settings")||{};o(i(this)),i(this).minicolors(i.extend(!0,t,r))}),i(this));case"show":return s(i(this).eq(0)),i(this);case"value":return void 0===r?i(this).val():(i(this).each(function(){"object"==typeof r?(r.opacity&&i(this).attr("data-opacity",f(r.opacity,0,1)),r.color&&i(this).val(r.color)):i(this).val(r),c(i(this))}),i(this));default:return"create"!==n&&(r=n),i(this).each(function(){t(i(this),r)}),i(this)}}}),i(document).on("mousedown.minicolors touchstart.minicolors",function(t){i(t.target).parents().add(t.target).hasClass("minicolors")||a()}).on("mousedown.minicolors touchstart.minicolors",".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider",function(t){var o=i(this);t.preventDefault(),i(document).data("minicolors-target",o),n(o,t,!0)}).on("mousemove.minicolors touchmove.minicolors",function(t){var o=i(document).data("minicolors-target");o&&n(o,t)}).on("mouseup.minicolors touchend.minicolors",function(){i(this).removeData("minicolors-target")}).on("click.minicolors",".minicolors-swatches li",function(t){t.preventDefault();var o=i(this),s=o.parents(".minicolors").find(".minicolors-input"),a=o.data("swatch-color");e(s,a,b(a)),c(s)}).on("mousedown.minicolors touchstart.minicolors",".minicolors-input-swatch",function(t){var o=i(this).parent().find(".minicolors-input");t.preventDefault(),s(o)}).on("focus.minicolors",".minicolors-input",function(){var t=i(this);t.data("minicolors-initialized")&&s(t)}).on("blur.minicolors",".minicolors-input",function(){var t,o,s,a,n,r=i(this),e=r.data("minicolors-settings");r.data("minicolors-initialized")&&(t=e.keywords?i.map(e.keywords.split(","),function(t){return i.trim(t.toLowerCase())}):[],""!==r.val()&&i.inArray(r.val().toLowerCase(),t)>-1?n=r.val():(v(r.val())?s=g(r.val(),!0):(o=u(r.val(),!0),s=o?I(o):null),n=null===s?e.defaultValue:"rgb"===e.format?g(e.opacity?"rgba("+s.r+","+s.g+","+s.b+","+r.attr("data-opacity")+")":"rgb("+s.r+","+s.g+","+s.b+")"):C(s)),a=e.opacity?r.attr("data-opacity"):1,"transparent"===n.toLowerCase()&&(a=0),r.closest(".minicolors").find(".minicolors-input-swatch > span").css("opacity",a),r.val(n),""===r.val()&&r.val(m(e.defaultValue,!0)),r.val(p(r.val(),e.letterCase)))}).on("keydown.minicolors",".minicolors-input",function(t){var o=i(this);if(o.data("minicolors-initialized"))switch(t.keyCode){case 9:a();break;case 13:case 27:a(),o.blur()}}).on("keyup.minicolors",".minicolors-input",function(){var t=i(this);t.data("minicolors-initialized")&&c(t,!0)}).on("paste.minicolors",".minicolors-input",function(){var t=i(this);t.data("minicolors-initialized")&&setTimeout(function(){c(t,!0)},1)})});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/js/mce/fasc-button.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(){tinymce.create("tinymce.plugins.FascButton",{init:function(
|
1 |
+
!function(){tinymce.create("tinymce.plugins.FascButton",{init:function(t,n){t.addButton("button_fasc_insert_button",{title:"Insert Button",icon:"fascbutton-ico",onclick:function(){t.execCommand("popup_insert_fasc_button",0,0)}})},createControl:function(t,n){return null}}),tinymce.PluginManager.add("fascbutton",tinymce.plugins.FascButton)}();
|
admin/js/mce/fasc-plugin.js
CHANGED
@@ -1,6 +1 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
/**
|
4 |
-
* WordPress View plugin.
|
5 |
-
*/
|
6 |
-
!function(){tinymce.PluginManager.add("fascview",function(a){function q(a){a.stopPropagation()}function s(){var b=tinymce.activeEditor.dom.select(".fasc-button"),c=!1;jQuery(b).each(function(){if(jQuery(this).is("[data-fasc-style]")){var b=jQuery(this).attr("data-fasc-style").replace(/\s+/,""),d="";jQuery(this).is("[style]")&&(d=jQuery(this).attr("style").replace(/\s+/,"")),b!=d&&(jQuery(this).attr("style",jQuery(this).attr("data-fasc-style")),a.nodeChanged(),c=!0)}})}function t(b){a.undoManager.transact(function(){a.dom.remove(b),v(),a.focus()})}function u(b){var e=a.dom;b&&(b!==c&&(a.getBody().focus(),v(),c=b,e.setAttrib(b,"data-mce-selected",1)),a.nodeChanged())}function v(){var d=a.dom;c&&(d.unbind(c,"beforedeactivate focusin focusout click mouseup",q),d.setAttrib(c,"data-mce-selected",null)),c=null}function w(c){var d=b(c),e=d.find(".fasc-button");return console.log("found fasc button: "),console.log(e),b(e).each(function(){var a=b(this),c=a.attr("data-fasc-href");a.attr("data-fasc-temp",null),a.attr("data-fasc-style",null),void 0!==c&&(a.attr("href",c),a.attr("data-fasc-href",null))}),a.dom.getOuterHTML(d)}function x(){for(var b=a.dom.select(".fasc-button"),c=0;c<b.length;c++){var d=b[c],e=a.dom.getAttrib(d,"href");""==a.dom.getAttrib(d,"data-fasc-href")&&""!=e&&(a.dom.setAttrib(d,"data-fasc-href",e),a.dom.setAttrib(d,"href",""))}}function y(a,b,c,d,e){if(void 0===e)var e="";"function"!=typeof d&&(d=function(d,e){var f=a.$(d);c?a.$(b).replaceWith(f):a.selection.setContent(d);a.$("[data-fasc-id='"+e+"']");v(),a.focus(),a.nodeChanged(),u(a.dom.select("a[data-fasc-id='"+e+"']")[0])}),wp.mce.fascpopup.open(b,"button",d,c,e)}var c,k,l,m,p,b=a.$,h=(tinymce.Env,tinymce.util.VK,tinymce.dom.TreeWalker,!0),i=function(){return!1};/iPad|iPod|iPhone/.test(navigator.userAgent);if("undefined"==typeof wp||!wp.mce)return{getView:i};a.on("SetContent",function(){x()}),a.on("init",function(){a.on("dblClick",function(b){if(a.dom.hasClass(b.target,"fasc-button"))return b.preventDefault(),y(a,b.target,!0),!1},!0),a.addCommand("popup_insert_fasc_button",function(b,c){var d=!1;a.dom.hasClass(a.selection.getNode(),"fasc-button")&&(d=!0);var e=a.selection.getContent({format:"text"});y(a,a.selection.getNode(),d,{},e)});var b=!1;a.selection,window.MutationObserver||window.WebKitMutationObserver;a.dom.bind(a.getDoc(),"touchmove",function(){b=!0}),a.on("mousedown mouseup click touchend",function(c){h=!1,a.dom.hasClass(c.target,"fasc-button")?"touchend"===c.type&&b?b=!1:u(c.target):"touchend"!==c.type&&"mousedown"!==c.type||v(),"touchend"===c.type&&b&&(b=!1)},!0)}),a.on("PreProcess",function(a){},!0),a.on("hide",function(){v()}),a.on("PostProcess",function(a){a.content&&(a.content=w(a.content))}),a.on("keydown",function(c){if(v(),32==c.keyCode&&a.dom.hasClass(a.selection.getNode(),"fasc-button")){if(a.selection.getRng().startOffset==b(a.selection.getNode()).text().length){var f=tinymce.DOM.uniqueId(),g=a.dom.create("span",{id:f}," ");a.dom.insertAfter(g,a.selection.getNode());var h=a.dom.select("span#"+f);return a.selection.select(h[0]),a.selection.collapse(0),a.dom.setAttrib(f,"id",""),!1}}}),a.on("focus",function(){m=!0,h=!1}),a.on("blur",function(){m=!1}),a.on("NodeChange",function(b){a.dom,a.dom.select(".fascview-wrap"),b.element.className;l=!1,clearInterval(k)}),a.on("BeforeExecCommand",function(){a.selection.getNode()}),a.on("ExecCommand",function(){}),a.on("ResolveName",function(a){}),a.on("PastePostProcess",function(){s()}),a.addButton("fasc_view_edit",{tooltip:"Edit ",icon:"dashicon dashicons-edit",onclick:function(){c&&y(a,c,!0)}}),a.addButton("fasc_view_remove",{tooltip:"Remove",icon:"dashicon dashicons-no",onclick:function(){c&&t(c)}}),a.once("preinit",function(){a.wp&&a.wp._createToolbar&&(p=a.wp._createToolbar(["fasc_view_edit","fasc_view_remove"]))}),a.on("wptoolbar",function(a){c&&(a.element=c,a.toolbar=p)}),a.wp=a.wp||{}})}();
|
1 |
+
!function(){tinymce.PluginManager.add("fascview",function(n){addFascToEditor(n)})}();
|
|
|
|
|
|
|
|
|
|
forget-about-shortcode-buttons.php
CHANGED
@@ -15,8 +15,8 @@
|
|
15 |
* @wordpress-plugin
|
16 |
* Plugin Name: Forget About Shortcode Buttons
|
17 |
* Plugin URI: http://www.designsandcode.com/wordpress-plugins/forget-about-shortcode-buttons-plugin/
|
18 |
-
* Description: A visual way to add CSS buttons in the
|
19 |
-
* Version: 2.0
|
20 |
* Author: Designs & Code
|
21 |
* Author URI: http://designsandcode.com
|
22 |
* License: GPL-2.0+
|
15 |
* @wordpress-plugin
|
16 |
* Plugin Name: Forget About Shortcode Buttons
|
17 |
* Plugin URI: http://www.designsandcode.com/wordpress-plugins/forget-about-shortcode-buttons-plugin/
|
18 |
+
* Description: A visual way to add CSS buttons in the rich text editor and to your themes.
|
19 |
+
* Version: 2.1.0
|
20 |
* Author: Designs & Code
|
21 |
* Author URI: http://designsandcode.com
|
22 |
* License: GPL-2.0+
|
includes/class-forget-about-shortcode-buttons.php
CHANGED
@@ -69,7 +69,7 @@ class Forget_About_Shortcode_Buttons {
|
|
69 |
public function __construct() {
|
70 |
|
71 |
$this->plugin_name = 'forget-about-shortcode-buttons';
|
72 |
-
$this->version = '2.0
|
73 |
|
74 |
$this->load_dependencies();
|
75 |
$this->set_locale();
|
69 |
public function __construct() {
|
70 |
|
71 |
$this->plugin_name = 'forget-about-shortcode-buttons';
|
72 |
+
$this->version = '2.1.0';
|
73 |
|
74 |
$this->load_dependencies();
|
75 |
$this->set_locale();
|
readme.txt
CHANGED
@@ -3,12 +3,12 @@ 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, wysiwyg
|
5 |
Requires at least: 4.2
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 2.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
-
A visual way to add CSS buttons in the
|
12 |
|
13 |
== Installation ==
|
14 |
|
@@ -31,11 +31,18 @@ Ask me some questions!
|
|
31 |
|
32 |
== Changelog ==
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
= 2.0.1 =
|
35 |
* Fix - an issue with the border effect on glossy buttons
|
36 |
* Fix - remove `box-shadow` properties from FASC buttons by default, some themes such as twentyseventeen add this to all anchor tags
|
37 |
* Fix - remove button rollover/hover effects from TinyMCE editor
|
38 |
-
* Fix - some issues when using multiple buttons in a post, and their
|
39 |
|
40 |
= 2.0.0 =
|
41 |
* Rewritten the core to use WP standards - no more iframes - be much quicker to load
|
@@ -87,12 +94,14 @@ Ask me some questions!
|
|
87 |
|
88 |
**Feature requests/ideas welcome!**
|
89 |
|
90 |
-
Forget About Shortcode (FASC) Buttons are a visual way to add CSS buttons in the
|
91 |
|
92 |
https://www.youtube.com/watch?v=BA9ruSe-i1A
|
93 |
|
94 |
FASC Buttons tries to be as clean as possible with the html, only using data attributes for necessary features - the buttons you use in the post editor use the exact same classes as on the front end of your site with no extra or hidden markup to make them behave this way.
|
95 |
|
|
|
|
|
96 |
* Editing a button couldn't be easier - just double click a button and an options panel appears allowing you to completely reconfigure the current button - beats tedious shortcodes and using precise syntax!
|
97 |
|
98 |
* Utilises the latest CSS properties for styling
|
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, wysiwyg
|
5 |
Requires at least: 4.2
|
6 |
+
Tested up to: 4.8
|
7 |
+
Stable tag: 2.1.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
+
A visual way to add CSS buttons in the rich text editor and to your themes.
|
12 |
|
13 |
== Installation ==
|
14 |
|
31 |
|
32 |
== Changelog ==
|
33 |
|
34 |
+
= 2.1.0 =
|
35 |
+
* New - added support for FASC buttons in WP 4.8 widget areas :)
|
36 |
+
* Fix - an issue with button styles in the admin area, only when they were selected (this is due to some new CSS classes being added in WP 4.8)
|
37 |
+
* Fix - some copy / paste issues and buttons losing their styles (WP 4.8 bug)
|
38 |
+
* Fix - a compatibility with other TinyMCE related plugins - FASC was extending the view object incorrectly
|
39 |
+
* Fix - some issues on the `PostProcess` TinyMCE event, made sure FASC only handles this when there are FASC buttons to be handled
|
40 |
+
|
41 |
= 2.0.1 =
|
42 |
* Fix - an issue with the border effect on glossy buttons
|
43 |
* Fix - remove `box-shadow` properties from FASC buttons by default, some themes such as twentyseventeen add this to all anchor tags
|
44 |
* Fix - remove button rollover/hover effects from TinyMCE editor
|
45 |
+
* Fix - some issues when using multiple buttons in a post, and their setting not being saved/retrieved correctly
|
46 |
|
47 |
= 2.0.0 =
|
48 |
* Rewritten the core to use WP standards - no more iframes - be much quicker to load
|
94 |
|
95 |
**Feature requests/ideas welcome!**
|
96 |
|
97 |
+
Forget About Shortcode (FASC) Buttons are a visual way to add CSS buttons in the rich text editor 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.
|
98 |
|
99 |
https://www.youtube.com/watch?v=BA9ruSe-i1A
|
100 |
|
101 |
FASC Buttons tries to be as clean as possible with the html, only using data attributes for necessary features - the buttons you use in the post editor use the exact same classes as on the front end of your site with no extra or hidden markup to make them behave this way.
|
102 |
|
103 |
+
* New - add FASC buttons to widgets in WP 4.8 :)
|
104 |
+
|
105 |
* Editing a button couldn't be easier - just double click a button and an options panel appears allowing you to completely reconfigure the current button - beats tedious shortcodes and using precise syntax!
|
106 |
|
107 |
* Utilises the latest CSS properties for styling
|