Skip to content

Commit

Permalink
Merge branch 'release/1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
gregpriday committed Sep 28, 2016
2 parents 7fef259 + 491692f commit a1f790c
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build
Submodule build updated 1 files
+1 −1 package.json
1 change: 1 addition & 0 deletions build-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ module.exports = {
src: [
'**/!(*.js|*.less)', // Everything except .js and .less files
'lib/**/*.*', // libraries used at runtime
'!{node_modules,node_modules/**}', // Ignore build/ and contents
'!{build,build/**}', // Ignore build/ and contents
'!{tests,tests/**}', // Ignore tests/ and contents
'!{tmp,tmp/**}', // Ignore tmp/ and contents
Expand Down
97 changes: 93 additions & 4 deletions js/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,103 @@ var substr = 'ab'.substr(-1) === 'b'
}).call(this,require('_process'))
},{"_process":3}],3:[function(require,module,exports){
// shim for using process in browser

var process = module.exports = {};

// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.

var cachedSetTimeout;
var cachedClearTimeout;

function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}


}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}



}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;

function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
Expand All @@ -253,7 +342,7 @@ function drainQueue() {
if (draining) {
return;
}
var timeout = setTimeout(cleanUpNextTick);
var timeout = runTimeout(cleanUpNextTick);
draining = true;

var len = queue.length;
Expand All @@ -270,7 +359,7 @@ function drainQueue() {
}
currentQueue = null;
draining = false;
clearTimeout(timeout);
runClearTimeout(timeout);
}

process.nextTick = function (fun) {
Expand All @@ -282,7 +371,7 @@ process.nextTick = function (fun) {
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
setTimeout(drainQueue, 0);
runTimeout(drainQueue);
}
};

Expand Down
4 changes: 3 additions & 1 deletion js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,9 @@
this.css = css;

// Load the CSS
this.parsed = this.parser.parse(css, {silent:true});
this.parsed = this.parser.parse(css, {
silent:true
} );
var rules = this.parsed.stylesheet.rules;

// Add the dropdown menu items
Expand Down
4 changes: 3 additions & 1 deletion js/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@
var parser = window.css;
$('.socss-theme-styles').each(function(){
var $$ = $(this);
var p = parser.parse( $$.html() );
var p = parser.parse( $$.html(), {
silent: true
} );
socss.parsedCss[ $$.attr('id') ] = p;
});
}
Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ We offer free support on the [SiteOrigin support forums](https://siteorigin.com/

== Changelog ==

= 1.1.1 - 28 September 2016 =
* Properly handle errors in frontend CSS.
* Added notice about SiteOrigin Premium.

= 1.1 - 26 September 2016 =
* Changed CSS parsing library. Fixed several issues with the visual editor mode.
* Added address bar to preview window.
Expand Down
9 changes: 9 additions & 0 deletions tpl/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
<div id="poststuff">
<div id="so-custom-css-info">

<?php if( $this->display_teaser() ) : ?>
<div class="postbox">
<h3 class="hndle"><span><?php _e('Get The Full Experience', 'so-css') ?></span></h3>
<div class="inside">
<?php printf( __( '%sSiteOrigin Premium%s adds a <strong>Google Web Font</strong> selector to SiteOrigin CSS so you can easily change any font.', 'so-css' ) , '<a href="https://siteorigin.com/downloads/premium/?featured_addon=plugins/web-font-selector" target="_blank">', '</a>' ); ?>
</div>
</div>
<?php endif; ?>

<?php if( !get_user_meta( $user->ID, 'socss_hide_gs' ) ) : ?>
<div class="postbox" id="so-custom-css-getting-started">
<h3 class="hndle">
Expand Down

0 comments on commit a1f790c

Please sign in to comment.