Completed
Push — master ( ac7ab4...0ea204 )
by
unknown
02:15
created
public/includes/assets.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 			$postid 			= get_the_ID();
69 69
 			
70 70
 			$post_date = get_the_time('U', $postid);
71
-            $delta = time() - $post_date;
71
+			$delta = time() - $post_date;
72 72
 
73 73
 			$strings = array(
74 74
 				'save' 				=> __('Save','lasso'),
@@ -120,8 +120,8 @@  discard block
 block discarded – undo
120 120
 			wp_localize_script( 'wp-api', 'WP_API_Settings', $settings );
121 121
 			
122 122
 			if ( class_exists( 'WP_REST_Controller' )) {
123
-                // we are using REST API V2
124
-			    $using_restapiv2 = true;
123
+				// we are using REST API V2
124
+				$using_restapiv2 = true;
125 125
 			}
126 126
 
127 127
 			// localized objects
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 			
193 193
 			
194 194
 			if (!$using_restapiv2) {
195
-               // enqueue REST API V1
195
+			   // enqueue REST API V1
196 196
 			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
197 197
 			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
198 198
 			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 			if ($show_color) {
203 203
 				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'iris'), LASSO_VERSION, true);
204 204
 			} else {
205
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery'), LASSO_VERSION, true);
205
+				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery'), LASSO_VERSION, true);
206 206
 			}
207 207
 			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
208 208
 
Please login to merge, or discard this patch.
Spacing   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -10,15 +10,15 @@  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
-		if ( lasso_user_can('edit_posts')) {
21
+		if (lasso_user_can('edit_posts')) {
22 22
 
23 23
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
24 24
 
@@ -33,21 +33,21 @@  discard block
 block discarded – undo
33 33
 			// url for json api
34 34
 			$home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false;
35 35
 
36
-			$article_object 	= lasso_editor_get_option('article_class','lasso_editor');
36
+			$article_object 	= lasso_editor_get_option('article_class', 'lasso_editor');
37 37
 
38
-			$article_object 	= empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
38
+			$article_object 	= empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
39 39
 
40
-			$featImgClass 		= lasso_editor_get_option('featimg_class','lasso_editor');
41
-			if (empty( $featImgClass )) {
40
+			$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
41
+			if (empty($featImgClass)) {
42 42
 				$featImgClass = lasso_get_supported_theme_featured_image_class();
43 43
 			}
44
-			$titleClass 		= lasso_editor_get_option('title_class','lasso_editor');
45
-			if (empty( $titleClass )) {
44
+			$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
45
+			if (empty($titleClass)) {
46 46
 				$titleClass = lasso_get_supported_theme_title_class();
47 47
 			}
48
-			$toolbar_headings  	= lasso_editor_get_option('toolbar_headings', 'lasso_editor');
49
-			$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
50
-			$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
48
+			$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
49
+			$objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor');
50
+			$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
51 51
 
52 52
 			
53 53
 			//text alignement
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 			
59 59
 			if ($show_color) {
60 60
 				//color picker
61
-				wp_enqueue_style( 'wp-color-picker' );
62
-				wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 );
61
+				wp_enqueue_style('wp-color-picker');
62
+				wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1);
63 63
 			}
64 64
 
65 65
 
@@ -71,75 +71,75 @@  discard block
 block discarded – undo
71 71
             $delta = time() - $post_date;
72 72
 
73 73
 			$strings = array(
74
-				'save' 				=> __('Save','lasso'),
75
-				'saving' 			=> __('Saving...','lasso'),
76
-				'saved'				=> __('Saved!','lasso'),
77
-				'adding' 			=> __('Adding...','lasso'),
78
-				'added'				=> __('Added!','lasso'),
79
-				'loading' 			=> __('Loading...','lasso'),
80
-				'loadMore'			=> __('Load More','lasso'),
81
-				'noPostsFound'		=> __('No more posts found','lasso'),
82
-				'fetchFail'	    	=> __('Fetching failed. REST API 1.2.5 plugin may not have been installed or configured correctly. (This requirement will be removed after WordPress adds built-in REST API support.)','lasso'),
83
-				'galleryCreated' 	=> __('Gallery Created!','lasso'),
84
-				'galleryUpdated' 	=> __('Gallery Updated!','lasso'),
85
-				'justWrite'			=> __('Just write...','lasso'),
86
-				'chooseImage'		=> __('Choose an image','lasso'),
87
-				'updateImage'		=> __('Update Image','lasso'),
88
-				'insertImage'		=> __('Insert Image','lasso'),
89
-				'selectImage'		=> __('Select Image','lasso'),
90
-				'removeFeatImg'     => __('Remove featured image?','lasso'),
91
-				'updateSelectedImg' => __('Update Selected Image','lasso'),
92
-				'chooseImages'		=> __('Choose images','lasso'),
93
-				'editImage'			=> __('Edit Image','lasso'),
94
-				'addImages'			=> __('Add Images','lasso'),
95
-				'addNewGallery'		=> __('Add New Gallery','lasso'),
96
-				'selectGallery'		=> __('Select Lasso Gallery Image','lasso'),
97
-				'useSelectedImages' => __('Use Selected Images','lasso'),
98
-				'publishPost'		=> __('Publish Post?','lasso'),
99
-				'publishYes'		=> __('Yes, publish it!','lasso'),
100
-				'deletePost'		=> __('Trash Post?','lasso'),
101
-				'deleteYes'			=> __('Yes, trash it!','lasso'),
102
-				'warning'			=> __('Oh snap!','laso'),
103
-				'cancelText'		=> __('O.K. got it!','lasso'),
104
-				'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'),
74
+				'save' 				=> __('Save', 'lasso'),
75
+				'saving' 			=> __('Saving...', 'lasso'),
76
+				'saved'				=> __('Saved!', 'lasso'),
77
+				'adding' 			=> __('Adding...', 'lasso'),
78
+				'added'				=> __('Added!', 'lasso'),
79
+				'loading' 			=> __('Loading...', 'lasso'),
80
+				'loadMore'			=> __('Load More', 'lasso'),
81
+				'noPostsFound'		=> __('No more posts found', 'lasso'),
82
+				'fetchFail'	    	=> __('Fetching failed. REST API 1.2.5 plugin may not have been installed or configured correctly. (This requirement will be removed after WordPress adds built-in REST API support.)', 'lasso'),
83
+				'galleryCreated' 	=> __('Gallery Created!', 'lasso'),
84
+				'galleryUpdated' 	=> __('Gallery Updated!', 'lasso'),
85
+				'justWrite'			=> __('Just write...', 'lasso'),
86
+				'chooseImage'		=> __('Choose an image', 'lasso'),
87
+				'updateImage'		=> __('Update Image', 'lasso'),
88
+				'insertImage'		=> __('Insert Image', 'lasso'),
89
+				'selectImage'		=> __('Select Image', 'lasso'),
90
+				'removeFeatImg'     => __('Remove featured image?', 'lasso'),
91
+				'updateSelectedImg' => __('Update Selected Image', 'lasso'),
92
+				'chooseImages'		=> __('Choose images', 'lasso'),
93
+				'editImage'			=> __('Edit Image', 'lasso'),
94
+				'addImages'			=> __('Add Images', 'lasso'),
95
+				'addNewGallery'		=> __('Add New Gallery', 'lasso'),
96
+				'selectGallery'		=> __('Select Lasso Gallery Image', 'lasso'),
97
+				'useSelectedImages' => __('Use Selected Images', 'lasso'),
98
+				'publishPost'		=> __('Publish Post?', 'lasso'),
99
+				'publishYes'		=> __('Yes, publish it!', 'lasso'),
100
+				'deletePost'		=> __('Trash Post?', 'lasso'),
101
+				'deleteYes'			=> __('Yes, trash it!', 'lasso'),
102
+				'warning'			=> __('Oh snap!', 'laso'),
103
+				'cancelText'		=> __('O.K. got it!', 'lasso'),
104
+				'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'),
105 105
 				'missingConfirm'	=> __('Update Settings', 'lasso'),
106
-				'helperText'		=> __('one more letter','lasso'),
106
+				'helperText'		=> __('one more letter', 'lasso'),
107 107
 				'editingBackup'  	=> __('You are currently editing a backup copy of this post.'),
108 108
 			);
109 109
 
110
-			$api_url = trailingslashit( home_url() ) . 'lasso-internal-api';
110
+			$api_url = trailingslashit(home_url()).'lasso-internal-api';
111 111
 
112 112
 			$gallery_class = new gallery();
113 113
 			$gallery_nonce_action = $gallery_class->nonce_action;
114
-			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
114
+			$gallery_nonce = wp_create_nonce($gallery_nonce_action);
115 115
 			
116
-			$settings = array( 'root' => esc_url_raw( rest_url() ), 'nonce' => wp_create_nonce( 'wp_rest' ) );
116
+			$settings = array('root' => esc_url_raw(rest_url()), 'nonce' => wp_create_nonce('wp_rest'));
117 117
 			//wp_enqueue_script( 'wp-api' );
118
-			wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
119
-			wp_localize_script( 'wp-api', 'wpApiSettings', $settings );
120
-			wp_localize_script( 'wp-api', 'WP_API_Settings', $settings );
118
+			wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
119
+			wp_localize_script('wp-api', 'wpApiSettings', $settings);
120
+			wp_localize_script('wp-api', 'WP_API_Settings', $settings);
121 121
 			
122
-			if ( class_exists( 'WP_REST_Controller' )) {
122
+			if (class_exists('WP_REST_Controller')) {
123 123
                 // we are using REST API V2
124 124
 			    $using_restapiv2 = true;
125 125
 			}
126 126
 
127 127
 			// localized objects
128 128
 			$objects = array(
129
-				'ajaxurl' 			=> esc_url( $api_url ),
130
-				'ajaxurl2' 			=> esc_url( admin_url( 'admin-ajax.php' )),
129
+				'ajaxurl' 			=> esc_url($api_url),
130
+				'ajaxurl2' 			=> esc_url(admin_url('admin-ajax.php')),
131 131
 				'editor' 			=> 'lasso--content', // ID of editable content (without #) DONT CHANGE
132 132
 				'article_object'	=> $article_object,
133 133
 				'featImgClass'		=> $featImgClass,
134 134
 				'titleClass'		=> $titleClass,
135 135
 				'strings'			=> $strings,
136
-				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ),
137
-				'post_status'		=> get_post_status( $postid ),
136
+				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'),
137
+				'post_status'		=> get_post_status($postid),
138 138
 				'postid'			=> $postid,
139 139
 				'permalink'			=> get_permalink(),
140 140
 				'edit_others_pages'	=> current_user_can('edit_others_pages') ? true : false,
141 141
 				'edit_others_posts'	=> current_user_can('edit_others_posts') ? true : false,
142
-				'userCanEdit'		=> current_user_can('edit_post', $postid ),
142
+				'userCanEdit'		=> current_user_can('edit_post', $postid),
143 143
 				'can_publish_posts'	=> current_user_can('publish_posts'),
144 144
 				'can_publish_pages'	=> current_user_can('publish_pages'),
145 145
 				'author'			=> is_user_logged_in() ? get_current_user_ID() : false,
@@ -173,18 +173,18 @@  discard block
 block discarded – undo
173 173
 				'postTags'    		=> lasso_get_objects('tag'),
174 174
 				'noResultsDiv'		=> lasso_editor_empty_results(),
175 175
 				'noRevisionsDiv'	=> lasso_editor_empty_results('revision'),
176
-				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false,
177
-				'mapLocations'		=> get_post_meta( $postid, 'ase_map_component_locations' ),
178
-				'mapStart'			=> get_post_meta( $postid, 'ase_map_component_start_point', true ),
179
-				'mapZoom'			=> get_post_meta( $postid, 'ase_map_component_zoom', true ),
176
+				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false,
177
+				'mapLocations'		=> get_post_meta($postid, 'ase_map_component_locations'),
178
+				'mapStart'			=> get_post_meta($postid, 'ase_map_component_start_point', true),
179
+				'mapZoom'			=> get_post_meta($postid, 'ase_map_component_zoom', true),
180 180
 				'revisionModal' 	=> lasso_editor_revision_modal(),
181 181
 				'isMobile'          => wp_is_mobile(),
182
-				'enableAutoSave'    => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ),
182
+				'enableAutoSave'    => lasso_editor_get_option('enable_autosave', 'lasso_editor'),
183 183
 				'showColor'         => $show_color,
184 184
 				'showAlignment'     => $show_align,
185 185
 				'showIgnoredItems'  => lasso_editor_get_option('show_ignored_items', 'lasso_editor'),
186 186
 				'restapi2'          => $using_restapiv2,
187
-				'skipToEdit'        =>( $delta < 30 ) // if it's a new post, skip to edit mode
187
+				'skipToEdit'        =>($delta < 30) // if it's a new post, skip to edit mode
188 188
 			);
189 189
 
190 190
 
@@ -193,18 +193,18 @@  discard block
 block discarded – undo
193 193
 			
194 194
 			if (!$using_restapiv2) {
195 195
                // enqueue REST API V1
196
-			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
197
-			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
198
-			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
196
+			   wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
197
+			   $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json'));
198
+			   wp_localize_script('wp-api-js', 'WP_API_Settings', $settings);
199 199
 			}
200 200
 
201
-			$postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min';
201
+			$postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min';
202 202
 			if ($show_color) {
203
-				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'iris'), LASSO_VERSION, true);
203
+				wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'iris'), LASSO_VERSION, true);
204 204
 			} else {
205
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery'), LASSO_VERSION, true);
205
+			    wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery'), LASSO_VERSION, true);
206 206
 			}
207
-			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
207
+			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects));
208 208
 
209 209
 
210 210
 		}
Please login to merge, or discard this patch.
public/includes/underscore-templates.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 		
12 12
 		// only run on posts and pages if user is logged in
13 13
 		if ( is_user_logged_in() && lasso_user_can('edit_posts') ) { 
14
-		    if ( !class_exists( 'WP_REST_Controller' ) ) {
15
-			    // using rest api v1 
14
+			if ( !class_exists( 'WP_REST_Controller' ) ) {
15
+				// using rest api v1 
16 16
 				?>
17 17
 				<script type="text/html" id="lasso-tmpl--post">
18 18
 					<li>
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 			<?php
32 32
 			} else {
33 33
 				// using rest api v2 
34
-		    ?>
34
+			?>
35 35
 				<script type="text/html" id="lasso-tmpl--post">
36 36
 					<li>
37 37
 						<a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class;?> <%= post.status %>" data-postid="<%= post.id %>" >
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 					</li>
48 48
 				</script>
49 49
 		<?php 
50
-		    }
50
+			}
51 51
 		}
52 52
 
53 53
 	}
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,28 +1,28 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( !function_exists( 'lasso_backbone_templates' ) ):
3
+if (!function_exists('lasso_backbone_templates')):
4 4
 
5 5
 	add_action('wp_footer', 'lasso_backbone_templates');
6
-	function lasso_backbone_templates(){
6
+	function lasso_backbone_templates() {
7 7
 
8 8
 		$can_delete = lasso_user_can('delete_others_posts');
9 9
 		$can_delete_class = $can_delete ? false : 'no-delete';
10 10
 
11 11
 		
12 12
 		// only run on posts and pages if user is logged in
13
-		if ( is_user_logged_in() && lasso_user_can('edit_posts') ) { 
14
-		    if ( !class_exists( 'WP_REST_Controller' ) ) {
13
+		if (is_user_logged_in() && lasso_user_can('edit_posts')) { 
14
+		    if (!class_exists('WP_REST_Controller')) {
15 15
 			    // using rest api v1 
16 16
 				?>
17 17
 				<script type="text/html" id="lasso-tmpl--post">
18 18
 					<li>
19
-						<a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class;?> <%= post.status %>" data-postid="<%= post.ID %>" >
19
+						<a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class; ?> <%= post.status %>" data-postid="<%= post.ID %>" >
20 20
 							<%= post.title %>
21 21
 
22 22
 							<div class="lasso--post-list__controls">
23
-								<span title="<?php echo esc_attr_e('Edit Post','lasso');?>" id="lasso--post__edit"></span>
24
-								<?php if( $can_delete ): ?>
25
-								<span title="<?php echo esc_attr_e('Delete Post','lasso');?>" id="lasso--post__delete"></span>
23
+								<span title="<?php echo esc_attr_e('Edit Post', 'lasso'); ?>" id="lasso--post__edit"></span>
24
+								<?php if ($can_delete): ?>
25
+								<span title="<?php echo esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post__delete"></span>
26 26
 								<?php endif; ?>
27 27
 							</div>
28 28
 						</a>
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
 		    ?>
35 35
 				<script type="text/html" id="lasso-tmpl--post">
36 36
 					<li>
37
-						<a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class;?> <%= post.status %>" data-postid="<%= post.id %>" >
37
+						<a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class; ?> <%= post.status %>" data-postid="<%= post.id %>" >
38 38
 							<%= post.title.rendered %>
39 39
 
40 40
 							<div class="lasso--post-list__controls">
41
-								<span title="<?php echo esc_attr_e('Edit Post','lasso');?>" id="lasso--post__edit"></span>
42
-								<?php if( $can_delete ): ?>
43
-								<span title="<?php echo esc_attr_e('Delete Post','lasso');?>" id="lasso--post__delete"></span>
41
+								<span title="<?php echo esc_attr_e('Edit Post', 'lasso'); ?>" id="lasso--post__edit"></span>
42
+								<?php if ($can_delete): ?>
43
+								<span title="<?php echo esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post__delete"></span>
44 44
 								<?php endif; ?>
45 45
 							</div>
46 46
 						</a>
Please login to merge, or discard this patch.