Changeset 2929010
- Timestamp:
- 06/21/2023 08:08:22 AM (3 years ago)
- Location:
- siteimprove
- Files:
-
- 28 added
- 4 edited
-
tags/2.0.2 (added)
-
tags/2.0.2/admin (added)
-
tags/2.0.2/admin/class-siteimprove-admin.php (added)
-
tags/2.0.2/admin/css (added)
-
tags/2.0.2/admin/css/siteimprove-admin.css (added)
-
tags/2.0.2/admin/css/siteimprove-preview.css (added)
-
tags/2.0.2/admin/img (added)
-
tags/2.0.2/admin/img/si-icon.svg (added)
-
tags/2.0.2/admin/index.php (added)
-
tags/2.0.2/admin/js (added)
-
tags/2.0.2/admin/js/siteimprove-admin.js (added)
-
tags/2.0.2/admin/js/siteimprove.js (added)
-
tags/2.0.2/admin/partials (added)
-
tags/2.0.2/admin/partials/class-siteimprove-admin-settings.php (added)
-
tags/2.0.2/includes (added)
-
tags/2.0.2/includes/class-siteimprove-activator.php (added)
-
tags/2.0.2/includes/class-siteimprove-deactivator.php (added)
-
tags/2.0.2/includes/class-siteimprove-i18n.php (added)
-
tags/2.0.2/includes/class-siteimprove-loader.php (added)
-
tags/2.0.2/includes/class-siteimprove.php (added)
-
tags/2.0.2/includes/class-siteimproveutils.php (added)
-
tags/2.0.2/includes/index.php (added)
-
tags/2.0.2/index.php (added)
-
tags/2.0.2/languages (added)
-
tags/2.0.2/languages/siteimprove.pot (added)
-
tags/2.0.2/readme.txt (added)
-
tags/2.0.2/siteimprove.php (added)
-
tags/2.0.2/uninstall.php (added)
-
trunk/admin/class-siteimprove-admin.php (modified) (4 diffs)
-
trunk/admin/js/siteimprove.js (modified) (5 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/siteimprove.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
siteimprove/trunk/admin/class-siteimprove-admin.php
r2919146 r2929010 91 91 $prepublish_enabled = intval( get_option( 'siteimprove_prepublish_enabled', 0 ) ); 92 92 93 if ( $wp_query->is_preview() && 1 === $prepublish_allowed && 1 === $prepublish_enabled ) {93 if ( ( $wp_query->is_preview() || $wp_query->is_singular() ) && 1 === $prepublish_allowed && 1 === $prepublish_enabled ) { 94 94 wp_enqueue_style( 'siteimprove_preview_css', plugin_dir_url( __FILE__ ) . 'css/siteimprove-preview.css', array(), $this->version, 'all' ); 95 95 } … … 191 191 } 192 192 193 $ preview = is_preview();193 $is_content_page = is_preview() || is_singular(); 194 194 195 195 $si_js_args = array( … … 198 198 'url' => $url, 199 199 'version' => $disabled_new_version, 200 ' preview' => $preview,200 'is_content_page' => $is_content_page, 201 201 ); 202 202 … … 397 397 $prepublish_enabled = intval( get_option( 'siteimprove_prepublish_enabled', 0 ) ); 398 398 399 if ( is_preview() && 1 === $prepublish_allowed && 1 === $prepublish_enabled ) {399 if ( ( is_preview() || is_singular() ) && 1 === $prepublish_allowed && 1 === $prepublish_enabled ) { 400 400 $prepublish_button = '<svg xmlns="http://www.w3.org/2000/svg" height="28px" width="28px" viewBox="0 0 24 24" focusable="false" aria-hidden="true" fill="currentColor"><path fill="#141155" d="M12.015625.113281C5.433594.113281.113281 5.433594.113281 12.015625c0 6.578125 5.320313 11.886719 11.902344 11.886719 6.578125 0 11.886719-5.324219 11.886719-11.886719 0-6.566406-5.324219-11.902344-11.886719-11.902344Zm0 0"></path><path fill="#fff" d="m6.097656 14.796875 1.695313-1.003906c.367187.945312 1.074219 1.539062 2.328125 1.539062 1.257812 0 1.625-.507812 1.625-1.074219 0-.746093-.679688-1.042968-2.1875-1.480468-1.539063-.4375-3.050782-1.074219-3.050782-3.007813 0-1.933593 1.609376-2.992187 3.332032-2.992187s2.9375.847656 3.613281 2.257812l-1.664063.960938c-.367187-.777344-.917968-1.300782-1.949218-1.300782-.832032 0-1.328125.4375-1.328125 1.019532 0 .621094.382812.945312 1.921875 1.410156 1.609375.523438 3.316406 1.058594 3.316406 3.121094 0 1.890625-1.523438 3.046875-3.671875 3.046875-2.058594.015625-3.441406-.972657-3.980469-2.496094m8.667969-6.917969c0-.621094.507813-1.160156 1.144531-1.160156.636719 0 1.15625.539062 1.15625 1.160156 0 .621094-.507812 1.140625-1.15625 1.140625-.648437 0-1.144531-.519531-1.144531-1.140625m.214844 1.988282h1.863281v7.230468h-1.863281Zm0 0"></path></svg>'; 401 401 $admin_bar->add_menu( -
siteimprove/trunk/admin/js/siteimprove.js
r2919146 r2929010 32 32 33 33 var siteimprove = { 34 input: function (url, token, version, preview) {34 input: function (url, token, version, is_content_page) { 35 35 this.url = url; 36 36 this.token = token; 37 37 this.method = "input"; 38 38 this.version = version; 39 this. preview = preview;39 this.is_content_page = is_content_page; 40 40 this.common(url); 41 41 }, … … 45 45 this.method = "domain"; 46 46 this.common(url); 47 }, 48 clear: function (callback, token) { 49 this.callback = callback; 50 this.token = token; 51 this.method = "clear"; 52 this.common(); 47 53 }, 48 54 recheck: function (url, token) { … … 121 127 // 0 = overlay-v1.js 122 128 // 1 = overlay-latest.js 123 if (this.version == 1 && this.preview) {129 if (this.version == 1 && this.is_content_page) { 124 130 _si.push(['registerPrepublishCallback', getDomCallback, this.token]); 125 131 } 126 132 _si.push([this.method, this.url, this.token]); 127 133 128 // Calling the "clear" method to avoid smallbox showing a "Page not found" message when inside wp-admin panel134 // Calling the "clear" method to avoid smallbox showing a "Page not found" message when inside wp-admin panel 129 135 // Do not do this for domain, so we can still see site-view of the plugin 130 if (this.method !== "domain") {136 if (this.version == 0 && this.method !== "domain") { 131 137 const pattern = /(?:\/wp-admin\/{1})[\D-\d]+.php/; 132 if (this.url .match(pattern)) {138 if (this.url && this.url.match(pattern)) { 133 139 setTimeout(() => { 134 _si.push(['clear' ]);140 _si.push(['clear', null, this.token]); 135 141 }, 500); 136 142 } … … 180 186 // If exist siteimprove_input, call input Siteimprove method. 181 187 if (typeof siteimprove_input !== "undefined") { 182 siteimprove.input(siteimprove_input.url, siteimprove_input.token, siteimprove_input.version, siteimprove_input. preview);188 siteimprove.input(siteimprove_input.url, siteimprove_input.token, siteimprove_input.version, siteimprove_input.is_content_page); 183 189 } 184 190 … … 188 194 if( "0" === siteimprove_domain.version ){ 189 195 siteimprove.domain(siteimprove_domain.url, siteimprove_domain.token); 196 } else { 197 siteimprove.clear(null, siteimprove_domain.token); 190 198 } 191 199 } -
siteimprove/trunk/readme.txt
r2919182 r2929010 87 87 == Changelog == 88 88 89 = 2.0.2 = 90 * Added - Calling "clear" on non-content pages in WordPress 91 * Added - Prepublish can now be started from a published page 92 89 93 = 2.0.1 = 90 94 * Bugfix - Fixed checkbox for "Use latest experience" was not properly checked on by default -
siteimprove/trunk/siteimprove.php
r2919182 r2929010 10 10 * Plugin URI: https://www.siteimprove.com/integrations/cms-plugin/wordpress/ 11 11 * Description: Integration with Siteimprove. 12 * Version: 2.0. 112 * Version: 2.0.2 13 13 * Author: Siteimprove 14 14 * Author URI: http://www.siteimprove.com/
Note: See TracChangeset
for help on using the changeset viewer.