Skip to content

Commit 88e3f3f

Browse files
committed
Merge branch 'release/1.5.11'
2 parents 014d609 + dfac82b commit 88e3f3f

File tree

5 files changed

+267
-182
lines changed

5 files changed

+267
-182
lines changed

changelog.txt

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
== Changelog ==
2+
3+
= 1.5.11 - 13 August 2024 =
4+
* Added Divi theme compatibility.
5+
* Accounted for for themes that don't use menu item selectors by adding them automatically.
6+
7+
= 1.5.10 - 31 May 2024 =
8+
* Updated SiteOrigin Installer.
9+
* Updated Tested up to tag.
10+
* Updated Required PHP version.
11+
12+
= 1.5.9 - 11 November 2023 =
13+
* Updated Tested up to tag.
14+
* Updated SiteOrigin Installer.
15+
16+
= 1.5.8 - 11 August 2023 =
17+
* Updated the SiteOrigin Installer submodule.
18+
19+
= 1.5.7 - 09 August 2023 =
20+
* Updated the expand/compress title depending on the state in the visual editor.
21+
* Updated the "Tested up to" version in the readme.txt file from 6.2 to 6.3, indicating compatibility with WordPress version 6.3.
22+
* Added SiteOrigin Installer submodule and functionality to handle the installer link and status in the editor and page templates.
23+
24+
= 1.5.6 - 07 April 2023 =
25+
* WordPress PHP Coding Standards improvements.
26+
* Updated `Tested up to` tag.
27+
28+
= 1.5.5 - 30 September 2022 =
29+
* Added a check to ensure WP Filesystem is setup.
30+
31+
= 1.5.4 - 28 September 2022 =
32+
* Developer: Introduced definable Custom CSS file name and location using `siteorigin_custom_css_file` and `siteorigin_css_enqueue_css`.
33+
34+
= 1.5.3 - 25 May 2022 =
35+
* Updated WordPress `Tested up to` tag.
36+
37+
= 1.5.2 - 27 January 2022 =
38+
* Updated `Tested up to` tag to `5.9`.
39+
40+
= 1.5.1 - 30 December 2021 =
41+
* Basic Editor Theme Setting: Updated field to show selected option.
42+
43+
= 1.5.0 - 16 December 2021 =
44+
* Basic Editor: Added a dark theme option.
45+
* Ajax Saving: Resolved unintended slashes added during escaping.
46+
47+
= 1.4.3 - 29 November 2021 =
48+
* Restored editor scrollbar.
49+
* Added a fixed editor height.
50+
51+
= 1.4.2 - 08 November 2021 =
52+
* Fixed string translation functions.
53+
54+
= 1.4.1 - 02 November 2021 =
55+
* Removed Save button rounding.
56+
* Fixed Visual Editor `Navigate To` link functionality.
57+
58+
= 1.4.0 - 11 October 2021 =
59+
* Added Ajax saving. Users can now save in the expanded and visual editors without exiting to basic editor.
60+
* Expanded/Visual toolbar buttons re-ordered for consistency between modes.
61+
* Removed Font Awesome. Icons are now added via a custom font.
62+
63+
= 1.3.2 - 20 July 2021 =
64+
* Updated `Tested up to` tag.
65+
66+
= 1.3.1 - 10 July 2021 =
67+
* Updated the Plugins page action link list.
68+
69+
= 1.3.0 - 14 June 2021 =
70+
* Inspector: Added a new Border Radius setting to the Decoration tab.
71+
* Allowed for right-clicking anywhere in the Basic Editor.
72+
73+
= 1.2.14 - 26 April 2021 =
74+
* Resolved Photo Gallery by 10Web plugin conflict.
75+
76+
= 1.2.13 - 01 February 2021 =
77+
* Inspector: Added support for WooCommerce single product tabs.
78+
* Inspector: Highlight important classes when element with class is selected.
79+
* Restored the scrollbar in the Custom CSS content field.
80+
* Developer: Further changes for jQuery 3.5.
81+
* Developer: For WP 4.9+ use the WordPress version of CodeMirror if available.
82+
* Developer: Removed `socss-codemirror-show-hint` as a dependency. The script can now be removed to disable hints.
83+
84+
= 1.2.12 - 12 December 2020 =
85+
* Developer: jQuery updates for WordPress 5.6.
86+
87+
= 1.2.11 - 21 October 2020 =
88+
* Fixed Background image setting writing to CSS.
89+
90+
= 1.2.10 - 09 September 2020 =
91+
* Increased the specificity of the Save CSS button styling to prevent plugin conflicts.
92+
93+
= 1.2.9 - 29 July 2020 =
94+
* Resolved Font Family field output.
95+
96+
= 1.2.8 - 22 May 2020 =
97+
* Renamed `custom_css` textarea to prevent conflicts.
98+
99+
= 1.2.7 - 19 May 2020 =
100+
* Restored `Save` button functionality.
101+
102+
= 1.2.6 - 15 May 2020 =
103+
* Minor visual editor form styling fixes.
104+
* Resolved PHP 7.4 `preg_replace()` warning.
105+
* Moved the basic editor Save button to the sidebar.
106+
107+
= 1.2.5 - 05 February 2020 =
108+
* Removed `themeCSS` localized script to prevent `preg_replace()` warning.
109+
* Minor form styling fixes.
110+
* Updated CSS NPM library.
111+
* Rebuilt minified files using new build script.
112+
113+
= 1.2.4 - 17 January 2019 =
114+
* Prefix so-css for all codemirror assets.
115+
* Prevent JS error when attempting to set active element to null.
116+
117+
= 1.2.3 - 25 June 2018 =
118+
* Add preview iframe 'load' event listener in `render` function.
119+
* Reverted change to stylesheet hook.
120+
121+
= 1.2.2 - 16 June 2018 =
122+
* Removed reference to non-existent view.
123+
124+
= 1.2.1 - 15 June 2018 =
125+
* Removed `.min` suffix from new stylesheets for CodeMirror plugins.
126+
127+
= 1.2.0 - 6 June 2018 =
128+
* Updated CSS library.
129+
* UI changes to make it more obvious when viewing revision.
130+
* Ensure revisions are sorted in descending time order.
131+
* Don't link to revision currently being displayed.
132+
* Add search functionality to editor.
133+
* Enable persistent search and JumpToLine.
134+
135+
= 1.1.5 - 19 September 2017 =
136+
* Use `home_url` instead of `site_url` to determine where to open CSS preview.
137+
* Increment and decrement buttons work when value empty or zero. Also added repeating action while button held down.
138+
* Scroll editor instead of the whole page so 'Save' button is always visible.
139+
* Set color CSS on visual editor and inspector.
140+
* Saving generated CSS to stylesheet file in uploads directory.
141+
142+
= 1.1.4 - 31 January 2017 =
143+
* Updated CodeMirror to 2.25.2.
144+
* Removed extra line padding.
145+
* Better integration with WordPress.org translation.
146+
147+
= 1.1.3 - 31 January 2017 =
148+
* Removed leading slash in paths after plugin_dir_url().
149+
* Updated to latest CodeMirror.
150+
* Fixed padding issue that was causing problems with Firefox and the color picker.
151+
152+
= 1.1.2 - 11 November 2016 =
153+
* Ignore anything other than actual rules in media query subrules.
154+
* Removed depreciated jQuery function.
155+
* Updated CSSLint library.
156+
* Updated minicolors.
157+
158+
= 1.1.1 - 28 September 2016 =
159+
* Properly handle errors in frontend CSS.
160+
* Added notice about SiteOrigin Premium.
161+
162+
= 1.1 - 26 September 2016 =
163+
* Changed CSS parsing library. Fixed several issues with the visual editor mode.
164+
* Added address bar to preview window.
165+
* Small CSS fixes.
166+
* Small changes to allow adding more visual editor fields.
167+
168+
= 1.0.8 - 15 August 2016 =
169+
* Fixed action link.
170+
* Support for GlotPress.
171+
* Removed unused code.
172+
* Handling of @imports for future addons.
173+
174+
= 1.0.7 - 4 July 2016 =
175+
* Ensure user can copy/paste in editor via context menu.
176+
* Added plugin action links
177+
* Add classes on `body` element to selectors window.
178+
179+
= 1.0.6 - 24 February 2016 =
180+
* Disabled autocompletion on single item (automatic autocompletion).
181+
* Fixed conflict with NextGen Gallery.
182+
* Only display relevant linting messages.
183+
184+
= 1.0.5 - 21 January 2016 =
185+
* Updated to latest version of Code Mirror.
186+
187+
= 1.0.4 - 10 November 2015 =
188+
* Fixed CSS parsing when going into visual mode.
189+
190+
= 1.0.3 - 29 October 2015 =
191+
* Changed video image
192+
* Adjust revision times by GMT offset.
193+
* Don't overwrite media queries sub styles, rather just append them.
194+
195+
= 1.0.2 =
196+
* Dequeue functionality that conflicted with WordPress color picker, if it's enqueued.
197+
* Removed wp_styles for compatibility with older versions of WordPress
198+
199+
= 1.0.1 =
200+
* Fixed conflicts with CSS editor in SiteOrigin themes.
201+
* Force dequeue scripts that cause problems with main editing interface.
202+
* Made it easier to follow links with inspector enabled.
203+
204+
= 1.0 =
205+
* Initial release.

inc/installer

js/inspector.js

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
view : { },
1010
fn : {}
1111
};
12-
12+
1313
var getSelectorSpecificity = function(selector, useParts) {
1414
var specificities = [];
1515
var ruleSpecificity = SPECIFICITY.calculate( selector );
@@ -148,7 +148,7 @@
148148

149149
var $h = this.$('.socss-hierarchy');
150150
$h.empty();
151-
151+
152152
if ( !el ) {
153153
return;
154154
}
@@ -199,6 +199,41 @@
199199
}
200200
} );
201201

202+
// If the selected element is a link, check if it's a menu item.
203+
if ( el.is( 'a' ) ) {
204+
const parent = el.closest( '.menu-item' );
205+
if ( parent.length ) {
206+
// Certain themes don't use the menu-item class.
207+
// To make it easier for users, we add the parent classes to the selectors array.
208+
const parentClasses = parent.attr( 'class' ).split( /\s+/ );
209+
210+
const existingSelectors = new Set( selectors.map( s => s.selector ) );
211+
212+
// If a class isn't already present, add it to the selectors array.
213+
parentClasses.forEach( cls => {
214+
if ( ! existingSelectors.has( selector ) ) {
215+
selectors.push( {
216+
selector: '.' + cls,
217+
specificity: getSelectorSpecificity( '.' + cls )
218+
} );
219+
}
220+
} );
221+
222+
// Move the * selector to the end of the selectors list.
223+
selectors.sort( ( a, b ) => {
224+
if ( a.selector === '*' ) {
225+
return 1;
226+
}
227+
228+
if ( b.selector === '*' ) {
229+
return -1;
230+
}
231+
232+
return 0;
233+
} );
234+
}
235+
}
236+
202237
var container = this.$('.socss-selectors-window').empty();
203238

204239
_.each( selectors, function( selector ){
@@ -351,7 +386,7 @@
351386
if (typeof rules[i].selectors === 'undefined') {
352387
continue;
353388
}
354-
389+
355390
for(var j = 0; j < rules[i].selectors.length; j++) {
356391
selectors = selectors.concat( getSelectorSpecificity( rules[i].selectors[j] ) );
357392
}
@@ -362,10 +397,10 @@
362397
$('body *').each(function(){
363398
var $$ = $(this);
364399
var elName = socss.fn.elSelector( $$ );
365-
400+
366401
selectors = selectors.concat(getSelectorSpecificity(elName));
367402
});
368-
403+
369404
var $body = $('body');
370405
var bName = socss.fn.elSelector($body);
371406
selectors = selectors.concat(getSelectorSpecificity(bName, true));
@@ -417,7 +452,7 @@
417452
case 'page':
418453
case 'supports':
419454
return true;
420-
455+
421456
}
422457
return false;
423458
};
@@ -431,7 +466,7 @@
431466
) {
432467
continue;
433468
}
434-
469+
435470
for(var j = 0; j < rule.selectors.length; j++) {
436471
var ruleSpecificity = SPECIFICITY.calculate( rule.selectors[j] );
437472
for (var l = 0; l < ruleSpecificity.length; l++) {

0 commit comments

Comments
 (0)