mirror of
https://github.com/flarum/framework.git
synced 2025-01-22 12:33:17 +08:00
Update Mithril
This commit is contained in:
parent
4037fb566c
commit
cba1868d9f
63
framework/core/js/admin/dist/app.js
vendored
63
framework/core/js/admin/dist/app.js
vendored
|
@ -623,7 +623,7 @@ exports.System = System;
|
|||
"use strict"
|
||||
|
||||
m.version = function () {
|
||||
return "v0.2.2-rc.1"
|
||||
return "v0.2.3"
|
||||
}
|
||||
|
||||
var hasOwn = {}.hasOwnProperty
|
||||
|
@ -647,9 +647,24 @@ exports.System = System;
|
|||
|
||||
function noop() {}
|
||||
|
||||
/* eslint-disable max-len */
|
||||
var voidElements = /^(AREA|BASE|BR|COL|COMMAND|EMBED|HR|IMG|INPUT|KEYGEN|LINK|META|PARAM|SOURCE|TRACK|WBR)$/
|
||||
/* eslint-enable max-len */
|
||||
var voidElements = {
|
||||
AREA: 1,
|
||||
BASE: 1,
|
||||
BR: 1,
|
||||
COL: 1,
|
||||
COMMAND: 1,
|
||||
EMBED: 1,
|
||||
HR: 1,
|
||||
IMG: 1,
|
||||
INPUT: 1,
|
||||
KEYGEN: 1,
|
||||
LINK: 1,
|
||||
META: 1,
|
||||
PARAM: 1,
|
||||
SOURCE: 1,
|
||||
TRACK: 1,
|
||||
WBR: 1
|
||||
}
|
||||
|
||||
// caching commonly used variables
|
||||
var $document, $location, $requestAnimationFrame, $cancelAnimationFrame
|
||||
|
@ -735,7 +750,9 @@ exports.System = System;
|
|||
* or splat (optional)
|
||||
*/
|
||||
function m(tag, pairs) {
|
||||
for (var args = [], i = 1; i < arguments.length; i++) {
|
||||
var args = []
|
||||
|
||||
for (var i = 1, length = arguments.length; i < length; i++) {
|
||||
args[i - 1] = arguments[i]
|
||||
}
|
||||
|
||||
|
@ -1065,7 +1082,7 @@ exports.System = System;
|
|||
nodes = injectHTML(parentElement, index, data)
|
||||
} else {
|
||||
nodes = [$document.createTextNode(data)]
|
||||
if (!parentElement.nodeName.match(voidElements)) {
|
||||
if (!(parentElement.nodeName in voidElements)) {
|
||||
insertNode(parentElement, nodes[0], index)
|
||||
}
|
||||
}
|
||||
|
@ -1345,7 +1362,7 @@ exports.System = System;
|
|||
var unloaders = []
|
||||
|
||||
function updateLists(views, controllers, view, controller) {
|
||||
if (controller.onunload != null) {
|
||||
if (controller.onunload != null && unloaders.map(function(u) {return u.handler}).indexOf(controller.onunload) < 0) {
|
||||
unloaders.push({
|
||||
controller: controller,
|
||||
handler: controller.onunload
|
||||
|
@ -1579,13 +1596,13 @@ exports.System = System;
|
|||
}
|
||||
}
|
||||
|
||||
function shouldUseSetAttribute(attrName) {
|
||||
return attrName !== "list" &&
|
||||
attrName !== "style" &&
|
||||
attrName !== "form" &&
|
||||
attrName !== "type" &&
|
||||
attrName !== "width" &&
|
||||
attrName !== "height"
|
||||
var shouldUseSetAttribute = {
|
||||
list: 1,
|
||||
style: 1,
|
||||
form: 1,
|
||||
type: 1,
|
||||
width: 1,
|
||||
height: 1
|
||||
}
|
||||
|
||||
function setSingleAttr(
|
||||
|
@ -1616,7 +1633,7 @@ exports.System = System;
|
|||
attrName === "className" ? "class" : attrName,
|
||||
dataAttr)
|
||||
}
|
||||
} else if (attrName in node && shouldUseSetAttribute(attrName)) {
|
||||
} else if (attrName in node && !shouldUseSetAttribute[attrName]) {
|
||||
// handle cases that are properties (but ignore cases where we
|
||||
// should use setAttribute instead)
|
||||
//
|
||||
|
@ -1907,9 +1924,7 @@ exports.System = System;
|
|||
}
|
||||
|
||||
m.component = function (component) {
|
||||
for (var args = [], i = 1; i < arguments.length; i++) {
|
||||
args.push(arguments[i])
|
||||
}
|
||||
var args = [].slice.call(arguments, 1)
|
||||
|
||||
return parameterize(component, args)
|
||||
}
|
||||
|
@ -2511,7 +2526,7 @@ exports.System = System;
|
|||
|
||||
m.deferred.onerror = function (e) {
|
||||
if (type.call(e) === "[object Error]" &&
|
||||
!e.constructor.toString().match(/ Error/)) {
|
||||
!/ Error/.test(e.constructor.toString())) {
|
||||
pendingRequests = 0
|
||||
throw e
|
||||
}
|
||||
|
@ -2657,16 +2672,14 @@ exports.System = System;
|
|||
}
|
||||
|
||||
function parameterizeUrl(url, data) {
|
||||
var tokens = url.match(/:[a-z]\w+/gi)
|
||||
|
||||
if (tokens && data) {
|
||||
forEach(tokens, function (token) {
|
||||
if (data) {
|
||||
url = url.replace(/:[a-z]\w+/gi, function(token){
|
||||
var key = token.slice(1)
|
||||
url = url.replace(token, data[key])
|
||||
var value = data[key]
|
||||
delete data[key]
|
||||
return value
|
||||
})
|
||||
}
|
||||
|
||||
return url
|
||||
}
|
||||
|
||||
|
|
63
framework/core/js/forum/dist/app.js
vendored
63
framework/core/js/forum/dist/app.js
vendored
|
@ -623,7 +623,7 @@ exports.System = System;
|
|||
"use strict"
|
||||
|
||||
m.version = function () {
|
||||
return "v0.2.2-rc.1"
|
||||
return "v0.2.3"
|
||||
}
|
||||
|
||||
var hasOwn = {}.hasOwnProperty
|
||||
|
@ -647,9 +647,24 @@ exports.System = System;
|
|||
|
||||
function noop() {}
|
||||
|
||||
/* eslint-disable max-len */
|
||||
var voidElements = /^(AREA|BASE|BR|COL|COMMAND|EMBED|HR|IMG|INPUT|KEYGEN|LINK|META|PARAM|SOURCE|TRACK|WBR)$/
|
||||
/* eslint-enable max-len */
|
||||
var voidElements = {
|
||||
AREA: 1,
|
||||
BASE: 1,
|
||||
BR: 1,
|
||||
COL: 1,
|
||||
COMMAND: 1,
|
||||
EMBED: 1,
|
||||
HR: 1,
|
||||
IMG: 1,
|
||||
INPUT: 1,
|
||||
KEYGEN: 1,
|
||||
LINK: 1,
|
||||
META: 1,
|
||||
PARAM: 1,
|
||||
SOURCE: 1,
|
||||
TRACK: 1,
|
||||
WBR: 1
|
||||
}
|
||||
|
||||
// caching commonly used variables
|
||||
var $document, $location, $requestAnimationFrame, $cancelAnimationFrame
|
||||
|
@ -735,7 +750,9 @@ exports.System = System;
|
|||
* or splat (optional)
|
||||
*/
|
||||
function m(tag, pairs) {
|
||||
for (var args = [], i = 1; i < arguments.length; i++) {
|
||||
var args = []
|
||||
|
||||
for (var i = 1, length = arguments.length; i < length; i++) {
|
||||
args[i - 1] = arguments[i]
|
||||
}
|
||||
|
||||
|
@ -1065,7 +1082,7 @@ exports.System = System;
|
|||
nodes = injectHTML(parentElement, index, data)
|
||||
} else {
|
||||
nodes = [$document.createTextNode(data)]
|
||||
if (!parentElement.nodeName.match(voidElements)) {
|
||||
if (!(parentElement.nodeName in voidElements)) {
|
||||
insertNode(parentElement, nodes[0], index)
|
||||
}
|
||||
}
|
||||
|
@ -1345,7 +1362,7 @@ exports.System = System;
|
|||
var unloaders = []
|
||||
|
||||
function updateLists(views, controllers, view, controller) {
|
||||
if (controller.onunload != null) {
|
||||
if (controller.onunload != null && unloaders.map(function(u) {return u.handler}).indexOf(controller.onunload) < 0) {
|
||||
unloaders.push({
|
||||
controller: controller,
|
||||
handler: controller.onunload
|
||||
|
@ -1579,13 +1596,13 @@ exports.System = System;
|
|||
}
|
||||
}
|
||||
|
||||
function shouldUseSetAttribute(attrName) {
|
||||
return attrName !== "list" &&
|
||||
attrName !== "style" &&
|
||||
attrName !== "form" &&
|
||||
attrName !== "type" &&
|
||||
attrName !== "width" &&
|
||||
attrName !== "height"
|
||||
var shouldUseSetAttribute = {
|
||||
list: 1,
|
||||
style: 1,
|
||||
form: 1,
|
||||
type: 1,
|
||||
width: 1,
|
||||
height: 1
|
||||
}
|
||||
|
||||
function setSingleAttr(
|
||||
|
@ -1616,7 +1633,7 @@ exports.System = System;
|
|||
attrName === "className" ? "class" : attrName,
|
||||
dataAttr)
|
||||
}
|
||||
} else if (attrName in node && shouldUseSetAttribute(attrName)) {
|
||||
} else if (attrName in node && !shouldUseSetAttribute[attrName]) {
|
||||
// handle cases that are properties (but ignore cases where we
|
||||
// should use setAttribute instead)
|
||||
//
|
||||
|
@ -1907,9 +1924,7 @@ exports.System = System;
|
|||
}
|
||||
|
||||
m.component = function (component) {
|
||||
for (var args = [], i = 1; i < arguments.length; i++) {
|
||||
args.push(arguments[i])
|
||||
}
|
||||
var args = [].slice.call(arguments, 1)
|
||||
|
||||
return parameterize(component, args)
|
||||
}
|
||||
|
@ -2511,7 +2526,7 @@ exports.System = System;
|
|||
|
||||
m.deferred.onerror = function (e) {
|
||||
if (type.call(e) === "[object Error]" &&
|
||||
!e.constructor.toString().match(/ Error/)) {
|
||||
!/ Error/.test(e.constructor.toString())) {
|
||||
pendingRequests = 0
|
||||
throw e
|
||||
}
|
||||
|
@ -2657,16 +2672,14 @@ exports.System = System;
|
|||
}
|
||||
|
||||
function parameterizeUrl(url, data) {
|
||||
var tokens = url.match(/:[a-z]\w+/gi)
|
||||
|
||||
if (tokens && data) {
|
||||
forEach(tokens, function (token) {
|
||||
if (data) {
|
||||
url = url.replace(/:[a-z]\w+/gi, function(token){
|
||||
var key = token.slice(1)
|
||||
url = url.replace(token, data[key])
|
||||
var value = data[key]
|
||||
delete data[key]
|
||||
return value
|
||||
})
|
||||
}
|
||||
|
||||
return url
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user