protoblast
Advanced tools
Comparing version 0.6.6 to 0.6.7
@@ -0,1 +1,10 @@ | ||
## 0.6.7 (2019-06-18) | ||
* Fix the `magic.js` file breaking the client-side file | ||
* Backport `String.tokenizeHTML()` and `String#encodeHTML()` fixes | ||
* Backport add `Protoblast#version_string` property, use it to add to the `#loaded_versions` property | ||
* Backport `RURL` should keep slashes when no protocol is given | ||
* Backport Fix `Date#timeAgo()` returning big hours, minutes & seconds when date is more than a month ago | ||
* Backport Fix Request class not accepting a RURL instance | ||
## 0.6.6 (2019-02-25) | ||
@@ -2,0 +11,0 @@ |
@@ -816,3 +816,3 @@ module.exports = function BlastDate(Blast, Collection, Bound, Obj) { | ||
* @since 0.6.0 | ||
* @version 0.6.0 | ||
* @version 0.7.0 | ||
* | ||
@@ -838,5 +838,5 @@ * @param {Object} settings | ||
months = Math.round(days / 30); | ||
minutes = ~~minutes; | ||
seconds = Math.round(seconds); | ||
hours = ~~hours; | ||
minutes = (~~minutes) % 60; | ||
seconds = Math.round(seconds) % 60; | ||
hours = (~~hours) % 24; | ||
@@ -858,4 +858,7 @@ if (!settings) { | ||
if (months == 1) { | ||
result += numberString(settings.month, 1); | ||
days = days % 30; | ||
// Only show amount of months if we didn't round up | ||
if ((days / 30) >= 1) { | ||
result += numberString(settings.month, 1); | ||
days = days % 30; | ||
} | ||
} else if (months > 1) { | ||
@@ -867,21 +870,28 @@ result += numberString(settings.months, months); | ||
if (!years) { | ||
if (result) result += settings.separator; | ||
if (days == 1) { | ||
result += numberString(settings.day, 1); | ||
temp = numberString(settings.day, 1); | ||
} else if (days > 1) { | ||
result += numberString(settings.days, days); | ||
} else if (hours == 1) { | ||
result += numberString(settings.hour, 1); | ||
} else if (hours > 1) { | ||
result += numberString(settings.hours, hours); | ||
} else if (minutes == 1) { | ||
result += numberString(settings.minute, 1); | ||
} else if (minutes > 1) { | ||
result += numberString(settings.minutes, minutes); | ||
} else if (future || seconds > 30) { | ||
result += numberString(settings.seconds, seconds); | ||
temp = numberString(settings.days, days); | ||
} else if (!months && hours == 1) { | ||
temp = numberString(settings.hour, 1); | ||
} else if (!months && hours > 1) { | ||
temp = numberString(settings.hours, hours); | ||
} else if (!months && minutes == 1) { | ||
temp = numberString(settings.minute, 1); | ||
} else if (!months && minutes > 1) { | ||
temp = numberString(settings.minutes, minutes); | ||
} else if (!months && (future || seconds > 30)) { | ||
temp = numberString(settings.seconds, seconds); | ||
} else if (!result) { | ||
return numberString(settings.now, seconds); | ||
} | ||
if (temp) { | ||
if (result) { | ||
result += settings.separator; | ||
} | ||
result += temp; | ||
} | ||
} | ||
@@ -888,0 +898,0 @@ |
@@ -259,2 +259,3 @@ module.exports = function BlastInitLoader(modifyPrototype) { | ||
Blast.version = version; | ||
Blast.version_string = r_package.version; | ||
} | ||
@@ -278,6 +279,10 @@ // PROTOBLAST END CUT | ||
if (ctx.__Protoblast.version && !ctx.__Protoblast.loaded_versions[ctx.__Protoblast.version]) { | ||
ctx.__Protoblast.loaded_versions[ctx.__Protoblast.version] = ctx.__Protoblast; | ||
if (ctx.__Protoblast.version && !ctx.__Protoblast.version_string) { | ||
ctx.__Protoblast.version_string = ctx.__Protoblast.version.major + '.' + ctx.__Protoblast.version.minor + '.' + ctx.__Protoblast.version.patch; | ||
} | ||
if (ctx.__Protoblast.version_string && !ctx.__Protoblast.loaded_versions[ctx.__Protoblast.version_string]) { | ||
ctx.__Protoblast.loaded_versions[ctx.__Protoblast.version_string] = ctx.__Protoblast; | ||
} | ||
if (Blast.isNWWindow) { | ||
@@ -961,2 +966,7 @@ // We're in a NW.JS window, and Protoblast has already been loaded | ||
// The "magic.js" file still needs to be wrapped | ||
if (name == 'magic') { | ||
temp = 'module.exports = function(Blast, Collection, Bound, Obj) {"use strict";' + temp + '\n};'; | ||
} | ||
code += 'require.register("' + name + '.js", function(module, exports, require){\n'; | ||
@@ -963,0 +973,0 @@ code += temp; |
@@ -172,3 +172,3 @@ module.exports = function BlastRequest(Blast, Collection) { | ||
* @since 0.6.2 | ||
* @version 0.6.4 | ||
* @version 0.7.0 | ||
*/ | ||
@@ -187,3 +187,3 @@ Request.setMethod(function setOptions(options) { | ||
if (typeof options == 'string' && RURL.isUrl(options)) { | ||
if (typeof options == 'string' || RURL.isUrl(options)) { | ||
return this.setUrl(options); | ||
@@ -190,0 +190,0 @@ } |
@@ -898,3 +898,3 @@ module.exports = function BlastURL(Blast, Collection, Bound, Obj) { | ||
* @since 0.5.7 | ||
* @version 0.5.7 | ||
* @version 0.7.0 | ||
* | ||
@@ -923,2 +923,4 @@ * @type {String} | ||
protocol = protocol.toLowerCase(); | ||
} else if (extracted) { | ||
this.slashes = extracted.slashes; | ||
} | ||
@@ -1358,3 +1360,3 @@ | ||
* @since 0.1.3 | ||
* @version 0.4.1 | ||
* @version 0.7.0 | ||
* | ||
@@ -1369,6 +1371,6 @@ * @return {String} | ||
result = this.protocol; | ||
} | ||
if (this.slashes) { | ||
result += '//'; | ||
} | ||
if (this.slashes) { | ||
result += '//'; | ||
} | ||
@@ -1375,0 +1377,0 @@ |
@@ -8,3 +8,3 @@ module.exports = function BlastStringEntities(Blast, Collection) { | ||
* @since 0.1.2 | ||
* @version 0.4.1 | ||
* @version 0.7.0 | ||
* | ||
@@ -19,3 +19,3 @@ * @return {String} The encoded string | ||
return this.replace(/[\u0000-\u0019\u0021-\u0028\u0080-\uffff<>\&]/g, function entityEncoder(character, offset, str) { | ||
return this.replace(/[\u0000-\u0009\u0011-\u0019\u0021-\u0028\u0080-\uffff<>\&]/g, function entityEncoder(character, offset, str) { | ||
@@ -22,0 +22,0 @@ // See if we need to skip this character |
@@ -905,2 +905,3 @@ module.exports = function BlastString(Blast, Collection, Bound, Obj) { | ||
if (state === STATE.TAG_NAME || state === STATE.TAG_CONTENT) { | ||
if (!char.trim()) { | ||
@@ -944,2 +945,19 @@ if (!current || current.type != 'whitespace') { | ||
// Handle unclosed tags | ||
if (depth && source[i + 1] != '>') { | ||
result.push({type: 'close_bracket', value: '>'}); | ||
tag_buffer = ''; | ||
i -= 2; | ||
depth--; | ||
current = null; | ||
if (!closing && last_tag.toLowerCase() == 'script') { | ||
state = STATE.SCRIPT; | ||
} else { | ||
state = STATE.PLAINTEXT; | ||
} | ||
continue; | ||
} | ||
// Ignore self-closing slashes | ||
@@ -946,0 +964,0 @@ if (char == '/') { |
{ | ||
"name": "protoblast", | ||
"description": "Native object expansion library", | ||
"version": "0.6.6", | ||
"version": "0.6.7", | ||
"author": "Jelle De Loecker <jelle@develry.be>", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
618055
25194