@@ -12,7 +12,7 @@ jQuery(function () {
1212 jQuery ( block ) . css ( "display" , "none" ) ;
1313 }
1414
15- jQuery ( button ) . click ( function ( ) {
15+ jQuery ( button ) . on ( 'click' , function ( ) {
1616 jQuery ( block ) . animate ( {
1717 opacity : "toggle" ,
1818 height : "toggle"
@@ -30,47 +30,39 @@ jQuery(function () {
3030 switchBlock ( "#extraCallsBlock" , "#extraCallsEnable" ) ;
3131 switchBlock ( "#easingBlock" , "#easing" ) ;
3232
33- jQuery ( document ) . ready ( function ( ) {
34- jQuery ( ".slider-horizontal" ) . each ( function ( ) {
35- var mySl = jQuery ( this ) ;
36- var defaultState = mySl . prev ( 'input' ) . val ( ) ;
37- mySl . attr ( 'defSl' , defaultState ) ;
38- } ) ;
39-
40-
41-
42-
43- //Function enable codemirror on FancyBox Extra Calls
44-
45- jQuery ( '.start-editing' ) . click ( function ( ) {
46- wp . codeEditor . initialize ( jQuery ( this ) . next ( "textarea" ) ) ;
47- jQuery ( this ) . hide ( ) ;
48- } ) ;
49-
33+ jQuery ( ".slider-horizontal" ) . each ( function ( ) {
34+ var mySl = jQuery ( this ) ;
35+ var defaultState = mySl . prev ( 'input' ) . val ( ) ;
36+ mySl . attr ( 'defSl' , defaultState ) ;
37+ } ) ;
5038
51- //add color picker to buttons
52- jQuery ( '.color-btn' ) . wpColorPicker ( ) ;
39+ //Function enable codemirror on FancyBox Extra Calls
40+ jQuery ( '.start-editing' ) . on ( 'click' , function ( ) {
41+ wp . codeEditor . initialize ( jQuery ( this ) . next ( "textarea" ) ) ;
42+ jQuery ( this ) . hide ( ) ;
5343 } ) ;
5444
55- jQuery ( window ) . load ( function ( ) {
56- //function to initiate horizontal slider from jQuery UI
57- jQuery ( ".slider-horizontal" ) . each ( function ( ) {
58- var mySl = jQuery ( this ) ;
59- var minSl = parseFloat ( mySl . attr ( "minSl" ) ) ;
60- var maxSl = parseFloat ( mySl . attr ( "maxSl" ) ) ;
61- var defSl = parseFloat ( mySl . attr ( "defSl" ) ) ;
62- var stepSl = parseFloat ( mySl . attr ( "stepSl" ) ) ;
63- jQuery ( this ) . slider ( {
64- orientation : "horizontal" ,
65- range : "min" ,
66- min : minSl ,
67- max : maxSl ,
68- value : defSl ,
69- step : stepSl ,
70- slide : function ( event , ui ) {
71- mySl . prev ( "input" ) . val ( ui . value ) ;
72- }
73- } ) ;
45+
46+ //add color picker to buttons
47+ jQuery ( '.color-btn' ) . wpColorPicker ( ) ;
48+
49+ //function to initiate horizontal slider from jQuery UI
50+ jQuery ( ".slider-horizontal" ) . each ( function ( ) {
51+ var mySl = jQuery ( this ) ;
52+ var minSl = parseFloat ( mySl . attr ( "minSl" ) ) ;
53+ var maxSl = parseFloat ( mySl . attr ( "maxSl" ) ) ;
54+ var defSl = parseFloat ( mySl . attr ( "defSl" ) ) ;
55+ var stepSl = parseFloat ( mySl . attr ( "stepSl" ) ) ;
56+ jQuery ( this ) . slider ( {
57+ orientation : "horizontal" ,
58+ range : "min" ,
59+ min : minSl ,
60+ max : maxSl ,
61+ value : defSl ,
62+ step : stepSl ,
63+ slide : function ( event , ui ) {
64+ mySl . prev ( "input" ) . val ( ui . value ) ;
65+ }
7466 } ) ;
7567 } ) ;
7668
@@ -84,11 +76,11 @@ jQuery(function () {
8476 jQuery ( "#titleColorBlock" ) . css ( "display" , "none" ) ;
8577 }
8678
87- jQuery ( "#titlePositionFloat, #titlePositionOutside, #titlePositionOver" ) . click ( function ( ) {
79+ jQuery ( "#titlePositionFloat, #titlePositionOutside, #titlePositionOver" ) . on ( 'click' , function ( ) {
8880 jQuery ( "#titleColorBlock" ) . hide ( "slow" ) ;
8981 } ) ;
9082
91- jQuery ( "#titlePositionInside" ) . click ( function ( ) {
83+ jQuery ( "#titlePositionInside" ) . on ( 'click' , function ( ) {
9284 jQuery ( "#titleColorBlock" ) . show ( "slow" ) ;
9385 } ) ;
9486
@@ -104,11 +96,11 @@ jQuery(function () {
10496 jQuery ( "#customExpressionBlock" ) . css ( "display" , "none" ) ;
10597 }
10698
107- jQuery ( "#galleryTypeAll, #galleryTypeNone, #galleryTypePost, #galleryTypeGutenbergBlock" ) . click ( function ( ) {
99+ jQuery ( "#galleryTypeAll, #galleryTypeNone, #galleryTypePost, #galleryTypeGutenbergBlock" ) . on ( 'click' , function ( ) {
108100 jQuery ( "#customExpressionBlock" ) . hide ( "slow" ) ;
109101 } ) ;
110102
111- jQuery ( "#galleryTypeCustom" ) . click ( function ( ) {
103+ jQuery ( "#galleryTypeCustom" ) . on ( 'click' , function ( ) {
112104 jQuery ( "#customExpressionBlock" ) . show ( "slow" ) ;
113105 } ) ;
114106
@@ -133,42 +125,4 @@ function activatePlugin( url ) {
133125 location . reload ( ) ;
134126 }
135127 } ) ;
136- }
137-
138- jQuery ( '.mfbfw-modula-link' ) . click ( function ( evt ) {
139- evt . preventDefault ( ) ;
140-
141- var action = jQuery ( this ) . data ( 'action' ) ,
142- link = jQuery ( this ) . attr ( 'href' ) ;
143-
144- jQuery ( this ) . addClass ( 'updating-message' ) ;
145- jQuery ( this ) . attr ( 'disabled' , 'disabled' ) ;
146-
147- if ( 'install' == action ) {
148- wp . updates . installPlugin ( { slug : 'modula-best-grid-gallery' } ) ;
149- } else {
150- activatePlugin ( link ) ;
151- }
152-
153- } ) ;
154-
155- jQuery ( document ) . on ( 'wp-plugin-install-success' , function ( response , data ) {
156-
157- if ( 'modula-best-grid-gallery' == data . slug ) {
158-
159- jQuery . ajax ( {
160- type : 'POST' ,
161- data : { action : 'mfbfw_activate_link' } ,
162- dataType : 'json' ,
163- url : ajaxurl ,
164- success : function ( json ) {
165- if ( json . status ) {
166- activatePlugin ( json . link ) ;
167- }
168- }
169- } ) ;
170-
171- }
172- console . log ( response ) ;
173- console . log ( data ) ;
174- } ) ;
128+ }
0 commit comments