Completed
Push — master ( 70d7ae...57f4e1 )
by
unknown
01:43
created
public/includes/assets.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@  discard block
 block discarded – undo
20 20
 	
21 21
 		global $post;
22 22
 		if ( lasso_user_can('edit_posts') && 
23
-		     !( function_exists( 'is_gutenberg_page' ) && has_blocks( $post->post_content) )) {// bail if the post has Gutenberg bloc
23
+			 !( function_exists( 'is_gutenberg_page' ) && has_blocks( $post->post_content) )) {// bail if the post has Gutenberg bloc
24 24
 			
25 25
 			/**    Returns the time offset from UTC
26
-			*/
26
+			 */
27 27
 			function get_UTC_offset() {
28 28
 				$timezone_string = get_option( 'timezone_string' );
29 29
 				if (empty( $timezone_string ) ) {
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
40 40
 
41
-            //don't load autocomplete if it's a stockholm theme
41
+			//don't load autocomplete if it's a stockholm theme
42 42
 			$themename  	= wp_get_theme()->get('Name');
43 43
 			if ($themename !='Stockholm' ) {
44 44
 				wp_enqueue_script('jquery-ui-autocomplete');
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 			$tz_offset = get_UTC_offset();
114 114
 			$post_date = get_the_time('U', $postid);
115 115
 			$time = (time()+$tz_offset);
116
-            $delta = $time - $post_date;
116
+			$delta = $time - $post_date;
117 117
 
118 118
 			$strings = array(
119 119
 				'save' 				=> __('Save','lasso'),
@@ -165,11 +165,11 @@  discard block
 block discarded – undo
165 165
 			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
166 166
 			
167 167
 			
168
-            if ($allow_change_date) {
169
-			    $permalink = get_site_url().'/?p='.$postid;
170
-            } else {
171
-                $permalink = get_permalink($postid);
172
-            }
168
+			if ($allow_change_date) {
169
+				$permalink = get_site_url().'/?p='.$postid;
170
+			} else {
171
+				$permalink = get_permalink($postid);
172
+			}
173 173
 			
174 174
 			// rest api
175 175
 			$rest_nonce = '';
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 				'customFields'      => $custom_fields,
264 264
 				'clickToInsert'     => ($insert_comp_ui =='click'),
265 265
 				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph      
266
-                'rtl'               => is_rtl(),				
266
+				'rtl'               => is_rtl(),				
267 267
 				'skipToEdit'        =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode
268 268
 				'linksEditable'    => $links_editable,
269 269
 				'supportPendingStatus' => !$no_pending_status
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 			
275 275
 			
276 276
 			if (!$using_restapiv2) {
277
-               // enqueue REST API V1
277
+			   // enqueue REST API V1
278 278
 			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
279 279
 			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
280 280
 			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 			if ($show_color) {
291 291
 				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
292 292
 			} else {
293
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
293
+				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
294 294
 			}
295 295
 			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
296 296
 
Please login to merge, or discard this patch.
Spacing   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -10,24 +10,24 @@  discard block
 block discarded – undo
10 10
 
11 11
 class assets {
12 12
 
13
-	public function __construct(){
13
+	public function __construct() {
14 14
 
15
-		add_action('wp_enqueue_scripts', array($this,'scripts'));
15
+		add_action('wp_enqueue_scripts', array($this, 'scripts'));
16 16
 	}
17 17
 
18
-	public function scripts(){
18
+	public function scripts() {
19 19
 
20 20
 	
21 21
 		global $post;
22
-		if ( lasso_user_can('edit_posts') && 
23
-		     !( function_exists( 'is_gutenberg_page' ) && has_blocks( $post->post_content) )) {// bail if the post has Gutenberg bloc
22
+		if (lasso_user_can('edit_posts') && 
23
+		     !(function_exists('is_gutenberg_page') && has_blocks($post->post_content))) {// bail if the post has Gutenberg bloc
24 24
 			
25 25
 			/**    Returns the time offset from UTC
26 26
 			*/
27 27
 			function get_UTC_offset() {
28
-				$timezone_string = get_option( 'timezone_string' );
29
-				if (empty( $timezone_string ) ) {
30
-					return get_option('gmt_offset')*3600;
28
+				$timezone_string = get_option('timezone_string');
29
+				if (empty($timezone_string)) {
30
+					return get_option('gmt_offset') * 3600;
31 31
 				}
32 32
 				
33 33
 				$origin_dtz = new \DateTimeZone($timezone_string);				
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
40 40
 
41 41
             //don't load autocomplete if it's a stockholm theme
42
-			$themename  	= wp_get_theme()->get('Name');
43
-			if ($themename !='Stockholm' ) {
42
+			$themename = wp_get_theme()->get('Name');
43
+			if ($themename != 'Stockholm') {
44 44
 				wp_enqueue_script('jquery-ui-autocomplete');
45 45
 			}
46 46
 			wp_enqueue_script('jquery-ui-draggable');
@@ -53,28 +53,28 @@  discard block
 block discarded – undo
53 53
 			// url for json api
54 54
 			$home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false;
55 55
 
56
-			$article_object 	= lasso_editor_get_option('article_class','lasso_editor');
56
+			$article_object 	= lasso_editor_get_option('article_class', 'lasso_editor');
57 57
 
58
-			$article_object 	= empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
58
+			$article_object 	= empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
59 59
 
60
-			$featImgClass 		= lasso_editor_get_option('featimg_class','lasso_editor');
61
-			if (empty( $featImgClass )) {
60
+			$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
61
+			if (empty($featImgClass)) {
62 62
 				$featImgClass = lasso_get_supported_theme_featured_image_class();
63 63
 			}
64
-			$titleClass 		= lasso_editor_get_option('title_class','lasso_editor');
65
-			if (empty( $titleClass )) {
64
+			$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
65
+			if (empty($titleClass)) {
66 66
 				$titleClass = lasso_get_supported_theme_title_class();
67 67
 			}
68
-			$toolbar_headings  	= lasso_editor_get_option('toolbar_headings', 'lasso_editor');
69
-			$toolbar_headings_h4  	= lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
68
+			$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
69
+			$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
70 70
 			$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
71
-			$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
71
+			$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
72 72
 			$disableRESTSave = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor');
73
-			$save_to_post_disabled  = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
74
-			$edit_post_disabled  = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' );
73
+			$save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor');
74
+			$edit_post_disabled = lasso_editor_get_option('post_edit_disabled', 'lasso_editor');
75 75
 			
76
-			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b');
77
-			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i');
76
+			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', 'b');
77
+			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', 'i');
78 78
 
79 79
 			
80 80
 			//text alignement
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
 			
92 92
 			if ($show_color) {
93 93
 				//color picker
94
-				wp_enqueue_style( 'wp-color-picker' );
95
-				wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 );
94
+				wp_enqueue_style('wp-color-picker');
95
+				wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1);
96 96
 			}
97 97
 			
98 98
 			// click to insert components, not drag and drop
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 			
105 105
 			// custom fields
106 106
 			
107
-			$custom_fields = apply_filters( 'editus_custom_fields', null ); //array('testFieldName' => '#field1');
107
+			$custom_fields = apply_filters('editus_custom_fields', null); //array('testFieldName' => '#field1');
108 108
 
109 109
 
110 110
 
@@ -112,57 +112,57 @@  discard block
 block discarded – undo
112 112
 			$postid 			= get_the_ID();
113 113
 			$tz_offset = get_UTC_offset();
114 114
 			$post_date = get_the_time('U', $postid);
115
-			$time = (time()+$tz_offset);
115
+			$time = (time() + $tz_offset);
116 116
             $delta = $time - $post_date;
117 117
 
118 118
 			$strings = array(
119
-				'save' 				=> __('Save','lasso'),
120
-				'selectText'	  	=> __('Please Select Text First.','lasso'),
121
-				'cancel' 			=> __('Cancel','lasso'),
122
-				'exiteditor' 		=> __('Exit Editor','lasso'),
123
-				'saving' 			=> __('Saving...','lasso'),
124
-				'saved'				=> __('Saved!','lasso'),
125
-				'adding' 			=> __('Adding...','lasso'),
126
-				'added'				=> __('Added!','lasso'),
127
-				'loading' 			=> __('Loading...','lasso'),
128
-				'loadMore'			=> __('Load More','lasso'),
129
-				'close'			=> __('Close','lasso'),
130
-				'noPostsFound'		=> __('No more posts found','lasso'),
131
-				'fetchFail'	    	=> __('Fetching failed.','lasso'),
132
-				'galleryCreated' 	=> __('Gallery Created!','lasso'),
133
-				'galleryUpdated' 	=> __('Gallery Updated!','lasso'),
134
-				'justWrite'			=> __('Just write...','lasso'),
135
-				'chooseImage'		=> __('Choose an image','lasso'),
136
-				'updateImage'		=> __('Update Image','lasso'),
137
-				'insertImage'		=> __('Insert Image','lasso'),
138
-				'selectImage'		=> __('Select Image','lasso'),
139
-				'removeFeatImg'     => __('Remove featured image?','lasso'),
140
-				'updateSelectedImg' => __('Update Selected Image','lasso'),
141
-				'chooseImages'		=> __('Choose images','lasso'),
142
-				'editImage'			=> __('Edit Image','lasso'),
143
-				'addImages'			=> __('Add Images','lasso'),
144
-				'addNewGallery'		=> __('Add New Gallery','lasso'),
145
-				'selectGallery'		=> __('Select Editus Gallery Image','lasso'),
146
-				'useSelectedImages' => __('Use Selected Images','lasso'),
147
-				'publishPost'		=> __('Publish Post?','lasso'),
148
-				'publishYes'		=> __('Yes, publish it!','lasso'),
149
-				'deletePost'		=> __('Trash Post?','lasso'),
150
-				'deleteYes'			=> __('Yes, trash it!','lasso'),
151
-				'warning'			=> __('Oh snap!','laso'),
152
-				'cancelText'		=> __('O.K. got it!','lasso'),
153
-				'missingClass'		=> __('It looks like we are either missing the Article CSS class, or it is configured incorrectly. Editus will not function correctly without this CSS class.','lasso'),
119
+				'save' 				=> __('Save', 'lasso'),
120
+				'selectText'	  	=> __('Please Select Text First.', 'lasso'),
121
+				'cancel' 			=> __('Cancel', 'lasso'),
122
+				'exiteditor' 		=> __('Exit Editor', 'lasso'),
123
+				'saving' 			=> __('Saving...', 'lasso'),
124
+				'saved'				=> __('Saved!', 'lasso'),
125
+				'adding' 			=> __('Adding...', 'lasso'),
126
+				'added'				=> __('Added!', 'lasso'),
127
+				'loading' 			=> __('Loading...', 'lasso'),
128
+				'loadMore'			=> __('Load More', 'lasso'),
129
+				'close'			=> __('Close', 'lasso'),
130
+				'noPostsFound'		=> __('No more posts found', 'lasso'),
131
+				'fetchFail'	    	=> __('Fetching failed.', 'lasso'),
132
+				'galleryCreated' 	=> __('Gallery Created!', 'lasso'),
133
+				'galleryUpdated' 	=> __('Gallery Updated!', 'lasso'),
134
+				'justWrite'			=> __('Just write...', 'lasso'),
135
+				'chooseImage'		=> __('Choose an image', 'lasso'),
136
+				'updateImage'		=> __('Update Image', 'lasso'),
137
+				'insertImage'		=> __('Insert Image', 'lasso'),
138
+				'selectImage'		=> __('Select Image', 'lasso'),
139
+				'removeFeatImg'     => __('Remove featured image?', 'lasso'),
140
+				'updateSelectedImg' => __('Update Selected Image', 'lasso'),
141
+				'chooseImages'		=> __('Choose images', 'lasso'),
142
+				'editImage'			=> __('Edit Image', 'lasso'),
143
+				'addImages'			=> __('Add Images', 'lasso'),
144
+				'addNewGallery'		=> __('Add New Gallery', 'lasso'),
145
+				'selectGallery'		=> __('Select Editus Gallery Image', 'lasso'),
146
+				'useSelectedImages' => __('Use Selected Images', 'lasso'),
147
+				'publishPost'		=> __('Publish Post?', 'lasso'),
148
+				'publishYes'		=> __('Yes, publish it!', 'lasso'),
149
+				'deletePost'		=> __('Trash Post?', 'lasso'),
150
+				'deleteYes'			=> __('Yes, trash it!', 'lasso'),
151
+				'warning'			=> __('Oh snap!', 'laso'),
152
+				'cancelText'		=> __('O.K. got it!', 'lasso'),
153
+				'missingClass'		=> __('It looks like we are either missing the Article CSS class, or it is configured incorrectly. Editus will not function correctly without this CSS class.', 'lasso'),
154 154
 				'missingConfirm'	=> __('Update Settings', 'lasso'),
155
-				'helperText'		=> __('one more letter','lasso'),
155
+				'helperText'		=> __('one more letter', 'lasso'),
156 156
 				'editingBackup'  	=> __('You are currently editing a backup copy of this post.'),
157 157
 				
158 158
 				
159 159
 			);
160 160
 
161
-			$api_url = trailingslashit( home_url() ) . 'lasso-internal-api';
161
+			$api_url = trailingslashit(home_url()).'lasso-internal-api';
162 162
 
163 163
 			$gallery_class = new gallery();
164 164
 			$gallery_nonce_action = $gallery_class->nonce_action;
165
-			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
165
+			$gallery_nonce = wp_create_nonce($gallery_nonce_action);
166 166
 			
167 167
 			
168 168
             if ($allow_change_date) {
@@ -177,13 +177,13 @@  discard block
 block discarded – undo
177 177
 			  
178 178
 			if (function_exists('rest_url')) {
179 179
 				//$rest_root = esc_url_raw( rest_url());
180
-				$rest_nonce = wp_create_nonce( 'wp_rest' );
181
-				$settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce );
182
-				wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
183
-				wp_localize_script( 'wp-api', 'wpApiSettings', $settings );
184
-				wp_localize_script( 'wp-api', 'WP_API_Settings', $settings );
180
+				$rest_nonce = wp_create_nonce('wp_rest');
181
+				$settings = array('root' => $rest_root, 'nonce' => $rest_nonce);
182
+				wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
183
+				wp_localize_script('wp-api', 'wpApiSettings', $settings);
184
+				wp_localize_script('wp-api', 'WP_API_Settings', $settings);
185 185
 				
186
-				if ( class_exists( 'WP_REST_Controller' )) {
186
+				if (class_exists('WP_REST_Controller')) {
187 187
 					// we are using REST API V2
188 188
 					$using_restapiv2 = true;
189 189
 				}
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
 
192 192
 			// localized objects
193 193
 			$objects = array(
194
-				'ajaxurl' 			=> esc_url( $api_url ),
195
-				'ajaxurl2' 			=> esc_url( admin_url( 'admin-ajax.php' )),
194
+				'ajaxurl' 			=> esc_url($api_url),
195
+				'ajaxurl2' 			=> esc_url(admin_url('admin-ajax.php')),
196 196
 				'siteUrl'           => site_url(),
197 197
 				'rest_root'         => $rest_root,
198 198
 				'rest_nonce'        => $rest_nonce,
@@ -201,13 +201,13 @@  discard block
 block discarded – undo
201 201
 				'featImgClass'		=> $featImgClass,
202 202
 				'titleClass'		=> $titleClass,
203 203
 				'strings'			=> $strings,
204
-				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ),
205
-				'post_status'		=> get_post_status( $postid ),
204
+				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'),
205
+				'post_status'		=> get_post_status($postid),
206 206
 				'postid'			=> $postid,
207 207
 				'permalink'			=> $permalink,
208 208
 				'edit_others_pages'	=> current_user_can('edit_others_pages') ? true : false,
209 209
 				'edit_others_posts'	=> current_user_can('edit_others_posts') ? true : false,
210
-				'userCanEdit'		=> current_user_can('edit_post', $postid ),
210
+				'userCanEdit'		=> current_user_can('edit_post', $postid),
211 211
 				'can_publish'		=> is_page() ? current_user_can('publish_pages') : current_user_can('publish_posts'),
212 212
 				//'can_publish_posts'	=> current_user_can('publish_posts'),
213 213
 				//'can_publish_pages'	=> current_user_can('publish_pages'),
@@ -243,28 +243,28 @@  discard block
 block discarded – undo
243 243
 				'postTags'    		=> lasso_get_objects('tag'),
244 244
 				'noResultsDiv'		=> lasso_editor_empty_results(),
245 245
 				'noRevisionsDiv'	=> lasso_editor_empty_results('revision'),
246
-				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false,
247
-				'mapLocations'		=> get_post_meta( $postid, 'ase_map_component_locations' ),
248
-				'mapStart'			=> get_post_meta( $postid, 'ase_map_component_start_point', true ),
249
-				'mapZoom'			=> get_post_meta( $postid, 'ase_map_component_zoom', true ),
246
+				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false,
247
+				'mapLocations'		=> get_post_meta($postid, 'ase_map_component_locations'),
248
+				'mapStart'			=> get_post_meta($postid, 'ase_map_component_start_point', true),
249
+				'mapZoom'			=> get_post_meta($postid, 'ase_map_component_zoom', true),
250 250
 				'revisionModal' 	=> lasso_editor_revision_modal(),
251 251
 				'isMobile'          => wp_is_mobile(),
252
-				'enableAutoSave'    => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ),
252
+				'enableAutoSave'    => lasso_editor_get_option('enable_autosave', 'lasso_editor'),
253 253
 				'showColor'         => $show_color,
254 254
 				'showAlignment'     => $show_align,
255 255
 				'showIgnoredItems'  => lasso_editor_get_option('show_ignored_items', 'lasso_editor'),
256 256
 				'restapi2'          => $using_restapiv2,
257 257
 				'saveusingrest'     => $using_restapiv2 && !$disableRESTSave,
258
-				'newObjectContent'  => '<p>'.apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ).'</p>',
258
+				'newObjectContent'  => '<p>'.apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')).'</p>',
259 259
 				'disableSavePost'   => $save_to_post_disabled,
260 260
 				'disableEditPost'   => $edit_post_disabled,
261 261
 				'boldTag'           => $bold_tag,
262 262
 				'iTag'           	=> $i_tag,
263 263
 				'customFields'      => $custom_fields,
264
-				'clickToInsert'     => ($insert_comp_ui =='click'),
265
-				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph      
264
+				'clickToInsert'     => ($insert_comp_ui == 'click'),
265
+				'buttonOnEmptyP'     => ($insert_comp_ui == 'mediumcom'), // auto show a button to insert components on an empty paragraph      
266 266
                 'rtl'               => is_rtl(),				
267
-				'skipToEdit'        =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode
267
+				'skipToEdit'        =>($delta < 10 && $delta >= 0), // if it's a new post, skip to edit mode
268 268
 				'linksEditable'    => $links_editable,
269 269
 				'supportPendingStatus' => !$no_pending_status
270 270
 			);
@@ -275,9 +275,9 @@  discard block
 block discarded – undo
275 275
 			
276 276
 			if (!$using_restapiv2) {
277 277
                // enqueue REST API V1
278
-			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
279
-			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
280
-			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
278
+			   wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
279
+			   $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json'));
280
+			   wp_localize_script('wp-api-js', 'WP_API_Settings', $settings);
281 281
 			}
282 282
 			
283 283
 			if ($allow_change_date) {
@@ -286,13 +286,13 @@  discard block
 block discarded – undo
286 286
 				wp_enqueue_style('jquery-ui');
287 287
 			}
288 288
 
289
-			$postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min';
289
+			$postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min';
290 290
 			if ($show_color) {
291
-				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
291
+				wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true);
292 292
 			} else {
293
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
293
+			    wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
294 294
 			}
295
-			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
295
+			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects));
296 296
 
297 297
 
298 298
 		}
Please login to merge, or discard this patch.