Skip to content

Commit

Permalink
Version 7.8.13
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <[email protected]>
  • Loading branch information
Kwpolska committed Mar 20, 2018
1 parent e4662d3 commit e8f38ca
Show file tree
Hide file tree
Showing 163 changed files with 6,253 additions and 1,335 deletions.
9 changes: 9 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
New in v7.8.13
==============

* Add new Thai translation by Narumol Hankrotha and Jean Jordaan
(v8 backport)
* Hide “Incomplete language” message for overrides of complete
languages
* Restore ability to override messages partially

New in v7.8.12
==============

Expand Down
8 changes: 4 additions & 4 deletions bower_components/livereload-js/.bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "livereload-js",
"version": "2.2.1",
"version": "2.3.0",
"main": "dist/livereload.js",
"homepage": "http://livereload.com",
"authors": [
Expand All @@ -27,11 +27,11 @@
"moduleType": [
"globals"
],
"_release": "2.2.1",
"_release": "2.3.0",
"_resolution": {
"type": "version",
"tag": "v2.2.1",
"commit": "91fdfa00a3e7fac0482397a315e18947c54bbfd3"
"tag": "v2.3.0",
"commit": "269c03edcf276e64b6015a199b11d3897ac18304"
},
"_source": "https://github.com/livereload/livereload-js.git",
"_target": "~2",
Expand Down
7 changes: 6 additions & 1 deletion bower_components/livereload-js/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ module.exports = function(grunt) {
},
src: ['lib/startup.js'],
dest: 'dist/livereload.js'
},

test: {
src: ['test/html/browserified/main.js'],
dest: 'test/html/browserified/bundle.js'
}
},

Expand All @@ -35,7 +40,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-mocha-test');

grunt.registerTask('build', ['coffee', 'browserify']);
grunt.registerTask('build', ['coffee', 'browserify:dist']);
grunt.registerTask('test', ['mochaTest']);
grunt.registerTask('default', ['build', 'test']);

Expand Down
50 changes: 43 additions & 7 deletions bower_components/livereload-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The server notifies the client whenever a change is made. Available servers are:
* [rack-livereload](https://github.com/johnbintz/rack-livereload)
* [guard-livereload](https://github.com/guard/guard-livereload)
* [grunt-contrib-watch](https://github.com/gruntjs/grunt-contrib-watch)
* [python-livereload](https://github.com/lepture/python-livereload)
* more available on Google :-)
* you can even write your own; refer to the [LiveReload protocol](http://help.livereload.com/kb/ecosystem/livereload-protocol)

Expand Down Expand Up @@ -53,22 +54,35 @@ Would love, but doesn't seem possible:
* live JS reloading


Installing using Bower and npm
------------------------------
Installing using Bower
----------------------

This script is published on Bower and npm. (But, to reiterate: the preferred method is to avoid installing it altogether, and instead use the one bundled with your LiveReload server/app/tool.)
This script is published on Bower. (But, to reiterate: the preferred method is to avoid installing it altogether, and instead use the one bundled with your LiveReload server/app/tool.)

Using Bower:
Installation:

bower install livereload-js --save-dev

This gives you a component containing a single script file, `dist/livereload.js`.

If you're using Browserify, you can require LiveReload via npm:

Installing using npm and Browserify
-----------------------------------

Including livereload.js into your Browserify bundle probably makes no sense, because livereload.js isn't something you would ship to production.

But if you insist _and_ you know what you're doing, you can install LiveReload via npm:

npm install livereload-js --save

Note that the package uses `window` and `document` globals, so won't run under Node.js environment.
and then add this to your bundle:

window.LiveReloadOptions = { host: 'localhost' };
require('livereload-js');

Note that livereload-js package uses `window` and `document` globals, so won't run under Node.js environment.

The reason you need to specify `LiveReloadOptions` is that `livereload.js` won't be able to find its `<script>` tag and would normally bail out with an error message.


Using livereload.js
Expand Down Expand Up @@ -121,9 +135,27 @@ Alternatively, instead of loading livereload.js from the LiveReload server, you
```


Options
-------

Options can either be specified as query parameters of the `<script src="..../livereload.js">` tag's source URL, or as a global `window.LiveReloadOptions` dictionary. If the dictionary is specified, `livereload.js` does not even try looking for its `<script>` tag.

The set of supported options is the same for both methods:

* `host`: the host that runs a LiveReload server; required if specifying `LiveReloadOptions`, otherwise will be autodetected as the origin of the `<script>` tag
* `port`: optional server port override
* `path`: optional path to livereload server (default: 'livereload')
* `mindelay`, `maxdelay`: range of reconnection delays (if `livereload.js` cannot connect to the server, it will attempt to reconnect with increasing delays); defaults to 1,000 ms minimum and 60,000 ms maximum
* `handshake_timeout`: timeout for a protocol handshake to be completed after a connection attempt; mostly only needed if you're running an interactive debugger on your web socket server
* `isChromeExtension`: reload chrome runtime instead of page when true (default: false)
* `reloadMissingCSS`: prevent reload of CSS when changed stylesheet isn't found in page (default: true)


Issues & Limitations
--------------------

**Serving livereload.js outside of the domain root.** Livereload.js expects to be served from the domain root (i.e. `http://myawesomeblog.com/livereload.js`). Serving from outside the domain root is possible, just add the `host` parameter to the `script` tag (see parameters documentation above).

**Live reloading of imported stylesheets has a 200ms lag.** Modifying a CSS `@import` rule to reference a not-yet-cached file causes WebKit to lose all document styles, so we have to apply a workaround that causes a lag.

Our workaround is to add a temporary `<link />` element for the imported stylesheet we're trying to reload, wait 200ms to make sure WebKit loads the new file, then remove `<link />` and recreate the `@import` rule. This prevents a flash of unstyled content. (We also wait 200 more milliseconds and recreate the `@import` rule again, in case those initial 200ms were not enough.)
Expand Down Expand Up @@ -171,6 +203,10 @@ To run tests:

grunt

Manual testing: open files in `test/html/*` in various browsers, make some changes and make sure they are applied.

Testing the Browserify usage scenario: `grunt browserify:test`, then perform manual testing of `test/html/browserified/`.


Releasing a new version
-----------------------
Expand Down Expand Up @@ -208,7 +244,7 @@ Version history

2.1.0 (Jan 16, 2015)

* use case-insensitive matching for `rel` attribute in `<link rel="stylesheet">` tags, to accomodate legacy Rails versions
* use case-insensitive matching for `rel` attribute in `<link rel="stylesheet">` tags, to accommodate legacy Rails versions
* avoid usage of `console` when it's not definited
* some README changes

Expand Down
2 changes: 1 addition & 1 deletion bower_components/livereload-js/bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "livereload-js",
"version": "2.2.1",
"version": "2.2.2",
"main": "dist/livereload.js",
"homepage": "http://livereload.com",
"authors": [
Expand Down
99 changes: 74 additions & 25 deletions bower_components/livereload-js/dist/livereload.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@

_ref = require('./protocol'), Parser = _ref.Parser, PROTOCOL_6 = _ref.PROTOCOL_6, PROTOCOL_7 = _ref.PROTOCOL_7;

Version = '2.2.1';
Version = '2.2.2';

exports.Connector = Connector = (function() {
function Connector(options, WebSocket, Timer, handlers) {
var path;
this.options = options;
this.WebSocket = WebSocket;
this.Timer = Timer;
this.handlers = handlers;
this._uri = "ws://" + this.options.host + ":" + this.options.port + "/livereload";
path = this.options.path ? "" + this.options.path : "livereload";
this._uri = "ws" + (this.options.https ? "s" : "") + "://" + this.options.host + ":" + this.options.port + "/" + path;
this._nextDelay = this.options.mindelay;
this._connectionDesired = false;
this.protocol = 0;
Expand Down Expand Up @@ -278,7 +280,8 @@

},{}],4:[function(require,module,exports){
(function() {
var Connector, LiveReload, Options, Reloader, Timer;
var Connector, LiveReload, Options, ProtocolError, Reloader, Timer,
__hasProp = {}.hasOwnProperty;

Connector = require('./connector').Connector;

Expand All @@ -288,23 +291,40 @@

Reloader = require('./reloader').Reloader;

ProtocolError = require('./protocol').ProtocolError;

exports.LiveReload = LiveReload = (function() {
function LiveReload(window) {
var k, v, _ref;
this.window = window;
this.listeners = {};
this.plugins = [];
this.pluginIdentifiers = {};
this.console = this.window.location.href.match(/LR-verbose/) && this.window.console && this.window.console.log && this.window.console.error ? this.window.console : {
this.console = this.window.console && this.window.console.log && this.window.console.error ? this.window.location.href.match(/LR-verbose/) ? this.window.console : {
log: function() {},
error: this.window.console.error.bind(this.window.console)
} : {
log: function() {},
error: function() {}
};
if (!(this.WebSocket = this.window.WebSocket || this.window.MozWebSocket)) {
this.console.error("LiveReload disabled because the browser does not seem to support web sockets");
return;
}
if (!(this.options = Options.extract(this.window.document))) {
this.console.error("LiveReload disabled because it could not find its own <SCRIPT> tag");
return;
if ('LiveReloadOptions' in window) {
this.options = new Options();
_ref = window['LiveReloadOptions'];
for (k in _ref) {
if (!__hasProp.call(_ref, k)) continue;
v = _ref[k];
this.options.set(k, v);
}
} else {
this.options = Options.extract(this.window.document);
if (!this.options) {
this.console.error("LiveReload disabled because it could not find its own <SCRIPT> tag");
return;
}
}
this.reloader = new Reloader(this.window, this.console, Timer);
this.connector = new Connector(this.options, this.WebSocket, Timer, {
Expand Down Expand Up @@ -372,6 +392,7 @@
};
})(this)
});
this.initialized = true;
}

LiveReload.prototype.on = function(eventName, handler) {
Expand All @@ -383,11 +404,12 @@
};

LiveReload.prototype.performReload = function(message) {
var _ref, _ref1;
var _ref, _ref1, _ref2;
this.log("LiveReload received reload request: " + (JSON.stringify(message, null, 2)));
return this.reloader.reload(message.path, {
liveCSS: (_ref = message.liveCSS) != null ? _ref : true,
liveImg: (_ref1 = message.liveImg) != null ? _ref1 : true,
reloadMissingCSS: (_ref2 = message.reloadMissingCSS) != null ? _ref2 : true,
originalPath: message.originalPath || '',
overrideURL: message.overrideURL || '',
serverURL: "http://" + this.options.host + ":" + this.options.port
Expand All @@ -400,6 +422,9 @@

LiveReload.prototype.shutDown = function() {
var _base;
if (!this.initialized) {
return;
}
this.connector.disconnect();
this.log("LiveReload disconnected.");
return typeof (_base = this.listeners).shutdown === "function" ? _base.shutdown() : void 0;
Expand All @@ -411,6 +436,9 @@

LiveReload.prototype.addPlugin = function(pluginClass) {
var plugin;
if (!this.initialized) {
return;
}
if (this.hasPlugin(pluginClass.identifier)) {
return;
}
Expand All @@ -433,6 +461,9 @@

LiveReload.prototype.analyze = function() {
var plugin, pluginData, pluginsData, _i, _len, _ref;
if (!this.initialized) {
return;
}
if (!(this.connector.protocol >= 7)) {
return;
}
Expand All @@ -456,12 +487,13 @@

}).call(this);

},{"./connector":1,"./options":5,"./reloader":7,"./timer":9}],5:[function(require,module,exports){
},{"./connector":1,"./options":5,"./protocol":6,"./reloader":7,"./timer":9}],5:[function(require,module,exports){
(function() {
var Options;

exports.Options = Options = (function() {
function Options() {
this.https = false;
this.host = null;
this.port = 35729;
this.snipver = null;
Expand Down Expand Up @@ -493,6 +525,7 @@
element = _ref[_i];
if ((src = element.src) && (m = src.match(/^[^:]+:\/\/(.*)\/z?livereload\.js(?:\?(.*))?$/))) {
options = new Options();
options.https = src.indexOf("https") === 0;
if (mm = m[1].match(/^([^\/:]+)(?::(\d+))?$/)) {
options.host = mm[1];
if (mm[2]) {
Expand Down Expand Up @@ -618,14 +651,22 @@
var IMAGE_STYLES, Reloader, numberOfMatchingSegments, pathFromUrl, pathsMatch, pickBestMatch, splitUrl;

splitUrl = function(url) {
var hash, index, params;
var comboSign, hash, index, params;
if ((index = url.indexOf('#')) >= 0) {
hash = url.slice(index);
url = url.slice(0, index);
} else {
hash = '';
}
if ((index = url.indexOf('?')) >= 0) {
comboSign = url.indexOf('??');
if (comboSign >= 0) {
if (comboSign + 1 !== url.lastIndexOf('?')) {
index = url.lastIndexOf('?');
}
} else {
index = url.indexOf('?');
}
if (index >= 0) {
params = url.slice(index);
url = url.slice(0, index);
} else {
Expand Down Expand Up @@ -733,26 +774,30 @@
return;
}
}
if (options.liveCSS) {
if (path.match(/\.css$/i)) {
if (this.reloadStylesheet(path)) {
return;
}
}
}
if (options.liveImg) {
if (path.match(/\.(jpe?g|png|gif)$/i)) {
this.reloadImages(path);
if (options.liveCSS && path.match(/\.css(?:\.map)?$/i)) {
if (this.reloadStylesheet(path)) {
return;
}
}
if (options.liveImg && path.match(/\.(jpe?g|png|gif)$/i)) {
this.reloadImages(path);
return;
}
if (options.isChromeExtension) {
this.reloadChromeExtension();
return;
}
return this.reloadPage();
};

Reloader.prototype.reloadPage = function() {
return this.window.document.location.reload();
};

Reloader.prototype.reloadChromeExtension = function() {
return this.window.chrome.runtime.reload();
};

Reloader.prototype.reloadImages = function(path) {
var expando, img, selector, styleNames, styleSheet, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3, _results;
expando = this.generateUniqueString();
Expand Down Expand Up @@ -882,10 +927,14 @@
this.reattachStylesheetLink(match.object);
}
} else {
this.console.log("LiveReload will reload all stylesheets because path '" + path + "' did not match any specific one");
for (_l = 0, _len3 = links.length; _l < _len3; _l++) {
link = links[_l];
this.reattachStylesheetLink(link);
if (this.options.reloadMissingCSS) {
this.console.log("LiveReload will reload all stylesheets because path '" + path + "' did not match any specific one. To disable this behavior, set 'options.reloadMissingCSS' to 'false'.");
for (_l = 0, _len3 = links.length; _l < _len3; _l++) {
link = links[_l];
this.reattachStylesheetLink(link);
}
} else {
this.console.log("LiveReload will not reload path '" + path + "' because the stylesheet was not found on the page and 'options.reloadMissingCSS' was set to 'false'.");
}
}
return true;
Expand Down
Loading

0 comments on commit e8f38ca

Please sign in to comment.