Completed
Push — master ( 7d69b4...47a4bc )
by
unknown
03:05
created
public/includes/assets.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -10,14 +10,14 @@  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
-		if ( lasso_user_can('edit_posts') ) {
20
+		if (lasso_user_can('edit_posts')) {
21 21
 
22 22
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
23 23
 
@@ -32,75 +32,75 @@  discard block
 block discarded – undo
32 32
 			// url for json api
33 33
 			$home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false;
34 34
 
35
-			$article_object 	= lasso_editor_get_option('article_class','lasso_editor');
35
+			$article_object 	= lasso_editor_get_option('article_class', 'lasso_editor');
36 36
 
37
-			$article_object 	= empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
37
+			$article_object 	= empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
38 38
 
39
-			$featImgClass 		= lasso_editor_get_option('featimg_class','lasso_editor');
40
-			$titleClass 		= lasso_editor_get_option('title_class','lasso_editor');
41
-			$toolbar_headings  	= lasso_editor_get_option('toolbar_headings', 'lasso_editor');
42
-			$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
39
+			$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
40
+			$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
41
+			$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
42
+			$objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor');
43 43
 
44 44
 			// post id reference
45
-			$postid 			= get_the_ID();
45
+			$postid = get_the_ID();
46 46
 
47 47
 			$strings = array(
48
-				'save' 				=> __('Save','lasso'),
49
-				'saving' 			=> __('Saving...','lasso'),
50
-				'saved'				=> __('Saved!','lasso'),
51
-				'adding' 			=> __('Adding...','lasso'),
52
-				'added'				=> __('Added!','lasso'),
53
-				'loading' 			=> __('Loading...','lasso'),
54
-				'loadMore'			=> __('Load More','lasso'),
55
-				'noPostsFound'		=> __('No more posts found','lasso'),
56
-				'galleryCreated' 	=> __('Gallery Created!','lasso'),
57
-				'galleryUpdated' 	=> __('Gallery Updated!','lasso'),
58
-				'justWrite'			=> __('Just write...','lasso'),
59
-				'chooseImage'		=> __('Choose an image','lasso'),
60
-				'updateImage'		=> __('Update Image','lasso'),
61
-				'insertImage'		=> __('Insert Image','lasso'),
62
-				'selectImage'		=> __('Select Image','lasso'),
63
-				'removeFeatImg'     => __('Remove featured image?','lasso'),
64
-				'updateSelectedImg' => __('Update Selected Image','lasso'),
65
-				'chooseImages'		=> __('Choose images','lasso'),
66
-				'editImage'			=> __('Edit Image','lasso'),
67
-				'addImages'			=> __('Add Images','lasso'),
68
-				'addNewGallery'		=> __('Add New Gallery','lasso'),
69
-				'selectGallery'		=> __('Select Lasso Gallery Image','lasso'),
70
-				'useSelectedImages' => __('Use Selected Images','lasso'),
71
-				'publishPost'		=> __('Publish Post?','lasso'),
72
-				'publishYes'		=> __('Yes, publish it!','lasso'),
73
-				'deletePost'		=> __('Trash Post?','lasso'),
74
-				'deleteYes'			=> __('Yes, trash it!','lasso'),
75
-				'warning'			=> __('Oh snap!','laso'),
76
-				'cancelText'		=> __('O.K. got it!','lasso'),
77
-				'missingClass'		=> __('It looks like we are missing the Article CSS class. Editus will not function correctly without this CSS class.','lasso'),
48
+				'save' 				=> __('Save', 'lasso'),
49
+				'saving' 			=> __('Saving...', 'lasso'),
50
+				'saved'				=> __('Saved!', 'lasso'),
51
+				'adding' 			=> __('Adding...', 'lasso'),
52
+				'added'				=> __('Added!', 'lasso'),
53
+				'loading' 			=> __('Loading...', 'lasso'),
54
+				'loadMore'			=> __('Load More', 'lasso'),
55
+				'noPostsFound'		=> __('No more posts found', 'lasso'),
56
+				'galleryCreated' 	=> __('Gallery Created!', 'lasso'),
57
+				'galleryUpdated' 	=> __('Gallery Updated!', 'lasso'),
58
+				'justWrite'			=> __('Just write...', 'lasso'),
59
+				'chooseImage'		=> __('Choose an image', 'lasso'),
60
+				'updateImage'		=> __('Update Image', 'lasso'),
61
+				'insertImage'		=> __('Insert Image', 'lasso'),
62
+				'selectImage'		=> __('Select Image', 'lasso'),
63
+				'removeFeatImg'     => __('Remove featured image?', 'lasso'),
64
+				'updateSelectedImg' => __('Update Selected Image', 'lasso'),
65
+				'chooseImages'		=> __('Choose images', 'lasso'),
66
+				'editImage'			=> __('Edit Image', 'lasso'),
67
+				'addImages'			=> __('Add Images', 'lasso'),
68
+				'addNewGallery'		=> __('Add New Gallery', 'lasso'),
69
+				'selectGallery'		=> __('Select Lasso Gallery Image', 'lasso'),
70
+				'useSelectedImages' => __('Use Selected Images', 'lasso'),
71
+				'publishPost'		=> __('Publish Post?', 'lasso'),
72
+				'publishYes'		=> __('Yes, publish it!', 'lasso'),
73
+				'deletePost'		=> __('Trash Post?', 'lasso'),
74
+				'deleteYes'			=> __('Yes, trash it!', 'lasso'),
75
+				'warning'			=> __('Oh snap!', 'laso'),
76
+				'cancelText'		=> __('O.K. got it!', 'lasso'),
77
+				'missingClass'		=> __('It looks like we are missing the Article CSS class. Editus will not function correctly without this CSS class.', 'lasso'),
78 78
 				'missingConfirm'	=> __('Update Settings', 'lasso'),
79
-				'helperText'		=> __('one more letter','lasso'),
79
+				'helperText'		=> __('one more letter', 'lasso'),
80 80
 				'editingBackup'  	=> __('You are currently editing a backup copy of this post.')
81 81
 			);
82 82
 
83
-			$api_url = trailingslashit( home_url() ) . 'lasso-internal-api';
83
+			$api_url = trailingslashit(home_url()).'lasso-internal-api';
84 84
 
85 85
 			$gallery_class = new gallery();
86 86
 			$gallery_nonce_action = $gallery_class->nonce_action;
87
-			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
87
+			$gallery_nonce = wp_create_nonce($gallery_nonce_action);
88 88
 
89 89
 			// localized objects
90 90
 			$objects = array(
91
-				'ajaxurl' 			=> esc_url( $api_url ),
91
+				'ajaxurl' 			=> esc_url($api_url),
92 92
 				'editor' 			=> 'lasso--content', // ID of editable content (without #) DONT CHANGE
93 93
 				'article_object'	=> $article_object,
94 94
 				'featImgClass'		=> $featImgClass,
95 95
 				'titleClass'		=> $titleClass,
96 96
 				'strings'			=> $strings,
97
-				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ),
98
-				'post_status'		=> get_post_status( $postid ),
97
+				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'),
98
+				'post_status'		=> get_post_status($postid),
99 99
 				'postid'			=> $postid,
100 100
 				'permalink'			=> get_permalink(),
101 101
 				'edit_others_pages'	=> current_user_can('edit_others_pages') ? 'true' : 'false',
102 102
 				'edit_others_posts'	=> current_user_can('edit_others_posts') ? 'true' : 'false',
103
-				'userCanEdit'		=> current_user_can('edit_post', $postid ),
103
+				'userCanEdit'		=> current_user_can('edit_post', $postid),
104 104
 				'can_publish_posts'	=> current_user_can('publish_posts'),
105 105
 				'can_publish_pages'	=> current_user_can('publish_pages'),
106 106
 				'author'			=> is_user_logged_in() ? get_current_user_ID() : false,
@@ -132,22 +132,22 @@  discard block
 block discarded – undo
132 132
 				'postTags'    		=> lasso_get_objects('tag'),
133 133
 				'noResultsDiv'		=> lasso_editor_empty_results(),
134 134
 				'noRevisionsDiv'	=> lasso_editor_empty_results('revision'),
135
-				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false,
136
-				'mapLocations'		=> get_post_meta( $postid, 'ase_map_component_locations' ),
137
-				'mapStart'			=> get_post_meta( $postid, 'ase_map_component_start_point', true ),
138
-				'mapZoom'			=> get_post_meta( $postid, 'ase_map_component_zoom', true ),
135
+				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false,
136
+				'mapLocations'		=> get_post_meta($postid, 'ase_map_component_locations'),
137
+				'mapStart'			=> get_post_meta($postid, 'ase_map_component_start_point', true),
138
+				'mapZoom'			=> get_post_meta($postid, 'ase_map_component_zoom', true),
139 139
 				'revisionModal' 	=> lasso_editor_revision_modal()
140 140
 			);
141 141
 
142 142
 
143 143
 			// wp api client
144
-			wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
145
-				$settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
146
-				wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
144
+			wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
145
+				$settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json'));
146
+				wp_localize_script('wp-api-js', 'WP_API_Settings', $settings);
147 147
 
148
-				$postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min';
149
-				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery'), LASSO_VERSION, true);
150
-				wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
148
+				$postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min';
149
+				wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery'), LASSO_VERSION, true);
150
+				wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects));
151 151
 
152 152
 
153 153
 		}
Please login to merge, or discard this patch.