mirror of
https://github.com/flarum/core.git
synced 2025-06-06 22:55:11 +02:00
Update bower deps
This commit is contained in:
parent
371e2ef759
commit
e1b3642453
633
js/admin/dist/app.js
vendored
633
js/admin/dist/app.js
vendored
@ -569,11 +569,11 @@ exports.System = System;
|
|||||||
global.m = m
|
global.m = m
|
||||||
}
|
}
|
||||||
/* eslint-enable no-undef */
|
/* eslint-enable no-undef */
|
||||||
})(typeof window !== "undefined" ? window : {}, function (global, undefined) { // eslint-disable-line
|
})(typeof window !== "undefined" ? window : this, function (global, undefined) { // eslint-disable-line
|
||||||
"use strict"
|
"use strict"
|
||||||
|
|
||||||
m.version = function () {
|
m.version = function () {
|
||||||
return "v0.2.3"
|
return "v0.2.5"
|
||||||
}
|
}
|
||||||
|
|
||||||
var hasOwn = {}.hasOwnProperty
|
var hasOwn = {}.hasOwnProperty
|
||||||
@ -655,7 +655,7 @@ exports.System = System;
|
|||||||
classes.push(match[2])
|
classes.push(match[2])
|
||||||
} else if (match[3][0] === "[") {
|
} else if (match[3][0] === "[") {
|
||||||
var pair = /\[(.+?)(?:=("|'|)(.*?)\2)?\]/.exec(match[3])
|
var pair = /\[(.+?)(?:=("|'|)(.*?)\2)?\]/.exec(match[3])
|
||||||
cell.attrs[pair[1]] = pair[3] || (pair[2] ? "" : true)
|
cell.attrs[pair[1]] = pair[3] || ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -700,7 +700,11 @@ exports.System = System;
|
|||||||
* or splat (optional)
|
* or splat (optional)
|
||||||
*/
|
*/
|
||||||
function m(tag, pairs) {
|
function m(tag, pairs) {
|
||||||
var args = [].slice.call(arguments, 1)
|
var args = []
|
||||||
|
|
||||||
|
for (var i = 1, length = arguments.length; i < length; i++) {
|
||||||
|
args[i - 1] = arguments[i]
|
||||||
|
}
|
||||||
|
|
||||||
if (isObject(tag)) return parameterize(tag, args)
|
if (isObject(tag)) return parameterize(tag, args)
|
||||||
|
|
||||||
@ -794,8 +798,10 @@ exports.System = System;
|
|||||||
})
|
})
|
||||||
|
|
||||||
var actions = []
|
var actions = []
|
||||||
for (var prop in existing) if (hasOwn.call(existing, prop)) {
|
for (var prop in existing) {
|
||||||
actions.push(existing[prop])
|
if (hasOwn.call(existing, prop)) {
|
||||||
|
actions.push(existing[prop])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var changes = actions.sort(sortChanges)
|
var changes = actions.sort(sortChanges)
|
||||||
@ -926,8 +932,10 @@ exports.System = System;
|
|||||||
|
|
||||||
if (cached.controllers) {
|
if (cached.controllers) {
|
||||||
forEach(cached.controllers, function (controller) {
|
forEach(cached.controllers, function (controller) {
|
||||||
if (controller.onunload) controller.onunload({preventDefault: noop});
|
if (controller.onunload) {
|
||||||
});
|
controller.onunload({preventDefault: noop})
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1308,7 +1316,9 @@ exports.System = System;
|
|||||||
var unloaders = []
|
var unloaders = []
|
||||||
|
|
||||||
function updateLists(views, controllers, view, controller) {
|
function updateLists(views, controllers, view, controller) {
|
||||||
if (controller.onunload != null && unloaders.map(function(u) {return u.handler}).indexOf(controller.onunload) < 0) {
|
if (controller.onunload != null &&
|
||||||
|
unloaders.map(function (u) { return u.handler })
|
||||||
|
.indexOf(controller.onunload) < 0) {
|
||||||
unloaders.push({
|
unloaders.push({
|
||||||
controller: controller,
|
controller: controller,
|
||||||
handler: controller.onunload
|
handler: controller.onunload
|
||||||
@ -1320,11 +1330,32 @@ exports.System = System;
|
|||||||
}
|
}
|
||||||
|
|
||||||
var forcing = false
|
var forcing = false
|
||||||
function checkView(data, view, cached, cachedControllers, controllers, views) {
|
function checkView(
|
||||||
var controller = getController(cached.views, view, cachedControllers, data.controller)
|
data,
|
||||||
|
view,
|
||||||
|
cached,
|
||||||
|
cachedControllers,
|
||||||
|
controllers,
|
||||||
|
views
|
||||||
|
) {
|
||||||
|
var controller = getController(
|
||||||
|
cached.views,
|
||||||
|
view,
|
||||||
|
cachedControllers,
|
||||||
|
data.controller)
|
||||||
|
|
||||||
var key = data && data.attrs && data.attrs.key
|
var key = data && data.attrs && data.attrs.key
|
||||||
data = pendingRequests === 0 || forcing || cachedControllers && cachedControllers.indexOf(controller) > -1 ? data.view(controller) : {tag: "placeholder"}
|
|
||||||
if (data.subtree === "retain") return data;
|
if (pendingRequests === 0 ||
|
||||||
|
forcing ||
|
||||||
|
cachedControllers &&
|
||||||
|
cachedControllers.indexOf(controller) > -1) {
|
||||||
|
data = data.view(controller)
|
||||||
|
} else {
|
||||||
|
data = {tag: "placeholder"}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.subtree === "retain") return data
|
||||||
data.attrs = data.attrs || {}
|
data.attrs = data.attrs || {}
|
||||||
data.attrs.key = key
|
data.attrs.key = key
|
||||||
updateLists(views, controllers, view, controller)
|
updateLists(views, controllers, view, controller)
|
||||||
@ -1389,6 +1420,9 @@ exports.System = System;
|
|||||||
// set attributes first, then create children
|
// set attributes first, then create children
|
||||||
var attrs = constructAttrs(data, node, namespace, hasKeys)
|
var attrs = constructAttrs(data, node, namespace, hasKeys)
|
||||||
|
|
||||||
|
// add the node to its parent before attaching children to it
|
||||||
|
insertNode(parentElement, node, index)
|
||||||
|
|
||||||
var children = constructChildren(data, node, cached, editable,
|
var children = constructChildren(data, node, cached, editable,
|
||||||
namespace, configs)
|
namespace, configs)
|
||||||
|
|
||||||
@ -1412,7 +1446,7 @@ exports.System = System;
|
|||||||
controllers)
|
controllers)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNew || shouldReattach === true && node != null) {
|
if (!isNew && shouldReattach === true && node != null) {
|
||||||
insertNode(parentElement, node, index)
|
insertNode(parentElement, node, index)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1531,14 +1565,18 @@ exports.System = System;
|
|||||||
}
|
}
|
||||||
|
|
||||||
function copyStyleAttrs(node, dataAttr, cachedAttr) {
|
function copyStyleAttrs(node, dataAttr, cachedAttr) {
|
||||||
for (var rule in dataAttr) if (hasOwn.call(dataAttr, rule)) {
|
for (var rule in dataAttr) {
|
||||||
if (cachedAttr == null || cachedAttr[rule] !== dataAttr[rule]) {
|
if (hasOwn.call(dataAttr, rule)) {
|
||||||
node.style[rule] = dataAttr[rule]
|
if (cachedAttr == null || cachedAttr[rule] !== dataAttr[rule]) {
|
||||||
|
node.style[rule] = dataAttr[rule]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (rule in cachedAttr) if (hasOwn.call(cachedAttr, rule)) {
|
for (rule in cachedAttr) {
|
||||||
if (!hasOwn.call(dataAttr, rule)) node.style[rule] = ""
|
if (hasOwn.call(cachedAttr, rule)) {
|
||||||
|
if (!hasOwn.call(dataAttr, rule)) node.style[rule] = ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1611,7 +1649,7 @@ exports.System = System;
|
|||||||
tag,
|
tag,
|
||||||
namespace
|
namespace
|
||||||
) {
|
) {
|
||||||
if (!(attrName in cachedAttrs) || (cachedAttr !== dataAttr)) {
|
if (!(attrName in cachedAttrs) || (cachedAttr !== dataAttr) || ($document.activeElement === node)) {
|
||||||
cachedAttrs[attrName] = dataAttr
|
cachedAttrs[attrName] = dataAttr
|
||||||
try {
|
try {
|
||||||
return setSingleAttr(
|
return setSingleAttr(
|
||||||
@ -1634,16 +1672,18 @@ exports.System = System;
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setAttributes(node, tag, dataAttrs, cachedAttrs, namespace) {
|
function setAttributes(node, tag, dataAttrs, cachedAttrs, namespace) {
|
||||||
for (var attrName in dataAttrs) if (hasOwn.call(dataAttrs, attrName)) {
|
for (var attrName in dataAttrs) {
|
||||||
if (trySetAttr(
|
if (hasOwn.call(dataAttrs, attrName)) {
|
||||||
node,
|
if (trySetAttr(
|
||||||
attrName,
|
node,
|
||||||
dataAttrs[attrName],
|
attrName,
|
||||||
cachedAttrs[attrName],
|
dataAttrs[attrName],
|
||||||
cachedAttrs,
|
cachedAttrs[attrName],
|
||||||
tag,
|
cachedAttrs,
|
||||||
namespace)) {
|
tag,
|
||||||
continue
|
namespace)) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return cachedAttrs
|
return cachedAttrs
|
||||||
@ -1695,9 +1735,41 @@ exports.System = System;
|
|||||||
$document.createRange().createContextualFragment(data))
|
$document.createRange().createContextualFragment(data))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
parentElement.insertAdjacentHTML("beforeend", data)
|
parentElement.insertAdjacentHTML("beforeend", data)
|
||||||
|
replaceScriptNodes(parentElement)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Replace script tags inside given DOM element with executable ones.
|
||||||
|
// Will also check children recursively and replace any found script
|
||||||
|
// tags in same manner.
|
||||||
|
function replaceScriptNodes(node) {
|
||||||
|
if (node.tagName === "SCRIPT") {
|
||||||
|
node.parentNode.replaceChild(buildExecutableNode(node), node)
|
||||||
|
} else {
|
||||||
|
var children = node.childNodes
|
||||||
|
if (children && children.length) {
|
||||||
|
for (var i = 0; i < children.length; i++) {
|
||||||
|
replaceScriptNodes(children[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return node
|
||||||
|
}
|
||||||
|
|
||||||
|
// Replace script element with one whose contents are executable.
|
||||||
|
function buildExecutableNode(node){
|
||||||
|
var scriptEl = document.createElement("script")
|
||||||
|
var attrs = node.attributes
|
||||||
|
|
||||||
|
for (var i = 0; i < attrs.length; i++) {
|
||||||
|
scriptEl.setAttribute(attrs[i].name, attrs[i].value)
|
||||||
|
}
|
||||||
|
|
||||||
|
scriptEl.text = node.innerHTML
|
||||||
|
return scriptEl
|
||||||
|
}
|
||||||
|
|
||||||
function injectHTML(parentElement, index, data) {
|
function injectHTML(parentElement, index, data) {
|
||||||
var nextSibling = parentElement.childNodes[index]
|
var nextSibling = parentElement.childNodes[index]
|
||||||
if (nextSibling) {
|
if (nextSibling) {
|
||||||
@ -1825,7 +1897,7 @@ exports.System = System;
|
|||||||
}
|
}
|
||||||
|
|
||||||
m.prop = function (store) {
|
m.prop = function (store) {
|
||||||
if ((store != null && isObject(store) || isFunction(store)) &&
|
if ((store != null && (isObject(store) || isFunction(store)) || ((typeof Promise !== "undefined") && (store instanceof Promise))) &&
|
||||||
isFunction(store.then)) {
|
isFunction(store.then)) {
|
||||||
return propify(store)
|
return propify(store)
|
||||||
}
|
}
|
||||||
@ -1870,7 +1942,11 @@ exports.System = System;
|
|||||||
}
|
}
|
||||||
|
|
||||||
m.component = function (component) {
|
m.component = function (component) {
|
||||||
var args = [].slice.call(arguments, 1)
|
var args = new Array(arguments.length - 1)
|
||||||
|
|
||||||
|
for (var i = 1; i < arguments.length; i++) {
|
||||||
|
args[i - 1] = arguments[i]
|
||||||
|
}
|
||||||
|
|
||||||
return parameterize(component, args)
|
return parameterize(component, args)
|
||||||
}
|
}
|
||||||
@ -1962,7 +2038,7 @@ exports.System = System;
|
|||||||
try {
|
try {
|
||||||
// lastRedrawId is a positive number if a second redraw is requested
|
// lastRedrawId is a positive number if a second redraw is requested
|
||||||
// before the next animation frame
|
// before the next animation frame
|
||||||
// lastRedrawID is null if it's the first redraw and not an event
|
// lastRedrawId is null if it's the first redraw and not an event
|
||||||
// handler
|
// handler
|
||||||
if (lastRedrawId && !force) {
|
if (lastRedrawId && !force) {
|
||||||
// when setTimeout: only reschedule redraw if time between now
|
// when setTimeout: only reschedule redraw if time between now
|
||||||
@ -2021,7 +2097,7 @@ exports.System = System;
|
|||||||
|
|
||||||
m.withAttr = function (prop, withAttrCallback, callbackThis) {
|
m.withAttr = function (prop, withAttrCallback, callbackThis) {
|
||||||
return function (e) {
|
return function (e) {
|
||||||
e = e || event
|
e = e || window.event
|
||||||
/* eslint-disable no-invalid-this */
|
/* eslint-disable no-invalid-this */
|
||||||
var currentTarget = e.currentTarget || this
|
var currentTarget = e.currentTarget || this
|
||||||
var _this = callbackThis || this
|
var _this = callbackThis || this
|
||||||
@ -2103,8 +2179,10 @@ exports.System = System;
|
|||||||
params = {}
|
params = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i in args) if (hasOwn.call(args, i)) {
|
for (var i in args) {
|
||||||
params[i] = args[i]
|
if (hasOwn.call(args, i)) {
|
||||||
|
params[i] = args[i]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var querystring = buildQueryString(params)
|
var querystring = buildQueryString(params)
|
||||||
@ -2130,8 +2208,16 @@ exports.System = System;
|
|||||||
var method = replaceHistory ? "replaceState" : "pushState"
|
var method = replaceHistory ? "replaceState" : "pushState"
|
||||||
computePreRedrawHook = setScroll
|
computePreRedrawHook = setScroll
|
||||||
computePostRedrawHook = function () {
|
computePostRedrawHook = function () {
|
||||||
global.history[method](null, $document.title,
|
try {
|
||||||
modes[m.route.mode] + currentRoute)
|
global.history[method](null, $document.title,
|
||||||
|
modes[m.route.mode] + currentRoute)
|
||||||
|
} catch (err) {
|
||||||
|
// In the event of a pushState or replaceState failure,
|
||||||
|
// fallback to a standard redirect. This is specifically
|
||||||
|
// to address a Safari security error when attempting to
|
||||||
|
// call pushState more than 100 times.
|
||||||
|
$location[m.route.mode] = currentRoute
|
||||||
|
}
|
||||||
}
|
}
|
||||||
redirect(modes[m.route.mode] + currentRoute)
|
redirect(modes[m.route.mode] + currentRoute)
|
||||||
} else {
|
} else {
|
||||||
@ -2180,29 +2266,31 @@ exports.System = System;
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var route in router) if (hasOwn.call(router, route)) {
|
for (var route in router) {
|
||||||
if (route === path) {
|
if (hasOwn.call(router, route)) {
|
||||||
m.mount(root, router[route])
|
if (route === path) {
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
var matcher = new RegExp("^" + route
|
|
||||||
.replace(/:[^\/]+?\.{3}/g, "(.*?)")
|
|
||||||
.replace(/:[^\/]+/g, "([^\\/]+)") + "\/?$")
|
|
||||||
|
|
||||||
if (matcher.test(path)) {
|
|
||||||
/* eslint-disable no-loop-func */
|
|
||||||
path.replace(matcher, function () {
|
|
||||||
var keys = route.match(/:[^\/]+/g) || []
|
|
||||||
var values = [].slice.call(arguments, 1, -2)
|
|
||||||
forEach(keys, function (key, i) {
|
|
||||||
routeParams[key.replace(/:|\./g, "")] =
|
|
||||||
decodeURIComponent(values[i])
|
|
||||||
})
|
|
||||||
m.mount(root, router[route])
|
m.mount(root, router[route])
|
||||||
})
|
return true
|
||||||
/* eslint-enable no-loop-func */
|
}
|
||||||
return true
|
|
||||||
|
var matcher = new RegExp("^" + route
|
||||||
|
.replace(/:[^\/]+?\.{3}/g, "(.*?)")
|
||||||
|
.replace(/:[^\/]+/g, "([^\\/]+)") + "\/?$")
|
||||||
|
|
||||||
|
if (matcher.test(path)) {
|
||||||
|
/* eslint-disable no-loop-func */
|
||||||
|
path.replace(matcher, function () {
|
||||||
|
var keys = route.match(/:[^\/]+/g) || []
|
||||||
|
var values = [].slice.call(arguments, 1, -2)
|
||||||
|
forEach(keys, function (key, i) {
|
||||||
|
routeParams[key.replace(/:|\./g, "")] =
|
||||||
|
decodeURIComponent(values[i])
|
||||||
|
})
|
||||||
|
m.mount(root, router[route])
|
||||||
|
})
|
||||||
|
/* eslint-enable no-loop-func */
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2248,32 +2336,35 @@ exports.System = System;
|
|||||||
var duplicates = {}
|
var duplicates = {}
|
||||||
var str = []
|
var str = []
|
||||||
|
|
||||||
for (var prop in object) if (hasOwn.call(object, prop)) {
|
for (var prop in object) {
|
||||||
var key = prefix ? prefix + "[" + prop + "]" : prop
|
if (hasOwn.call(object, prop)) {
|
||||||
var value = object[prop]
|
var key = prefix ? prefix + "[" + prop + "]" : prop
|
||||||
|
var value = object[prop]
|
||||||
|
|
||||||
if (value === null) {
|
if (value === null) {
|
||||||
str.push(encodeURIComponent(key))
|
str.push(encodeURIComponent(key))
|
||||||
} else if (isObject(value)) {
|
} else if (isObject(value)) {
|
||||||
str.push(buildQueryString(value, key))
|
str.push(buildQueryString(value, key))
|
||||||
} else if (isArray(value)) {
|
} else if (isArray(value)) {
|
||||||
var keys = []
|
var keys = []
|
||||||
duplicates[key] = duplicates[key] || {}
|
duplicates[key] = duplicates[key] || {}
|
||||||
/* eslint-disable no-loop-func */
|
/* eslint-disable no-loop-func */
|
||||||
forEach(value, function (item) {
|
forEach(value, function (item) {
|
||||||
/* eslint-enable no-loop-func */
|
/* eslint-enable no-loop-func */
|
||||||
if (!duplicates[key][item]) {
|
if (!duplicates[key][item]) {
|
||||||
duplicates[key][item] = true
|
duplicates[key][item] = true
|
||||||
keys.push(encodeURIComponent(key) + "=" +
|
keys.push(encodeURIComponent(key) + "=" +
|
||||||
encodeURIComponent(item))
|
encodeURIComponent(item))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
str.push(keys.join("&"))
|
str.push(keys.join("&"))
|
||||||
} else if (value !== undefined) {
|
} else if (value !== undefined) {
|
||||||
str.push(encodeURIComponent(key) + "=" +
|
str.push(encodeURIComponent(key) + "=" +
|
||||||
encodeURIComponent(value))
|
encodeURIComponent(value))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return str.join("&")
|
return str.join("&")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2481,7 +2572,7 @@ exports.System = System;
|
|||||||
m.sync = function (args) {
|
m.sync = function (args) {
|
||||||
var deferred = m.deferred()
|
var deferred = m.deferred()
|
||||||
var outstanding = args.length
|
var outstanding = args.length
|
||||||
var results = new Array(outstanding)
|
var results = []
|
||||||
var method = "resolve"
|
var method = "resolve"
|
||||||
|
|
||||||
function synchronizer(pos, resolved) {
|
function synchronizer(pos, resolved) {
|
||||||
@ -2510,7 +2601,7 @@ exports.System = System;
|
|||||||
function identity(value) { return value }
|
function identity(value) { return value }
|
||||||
|
|
||||||
function handleJsonp(options) {
|
function handleJsonp(options) {
|
||||||
var callbackKey = "mithril_callback_" +
|
var callbackKey = options.callbackName || "mithril_callback_" +
|
||||||
new Date().getTime() + "_" +
|
new Date().getTime() + "_" +
|
||||||
(Math.round(Math.random() * 1e16)).toString(36)
|
(Math.round(Math.random() * 1e16)).toString(36)
|
||||||
|
|
||||||
@ -2619,9 +2710,9 @@ exports.System = System;
|
|||||||
|
|
||||||
function parameterizeUrl(url, data) {
|
function parameterizeUrl(url, data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
url = url.replace(/:[a-z]\w+/gi, function(token){
|
url = url.replace(/:[a-z]\w+/gi, function (token){
|
||||||
var key = token.slice(1)
|
var key = token.slice(1)
|
||||||
var value = data[key]
|
var value = data[key] || token
|
||||||
delete data[key]
|
delete data[key]
|
||||||
return value
|
return value
|
||||||
})
|
})
|
||||||
@ -2686,6 +2777,7 @@ exports.System = System;
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
deferred.reject(e)
|
deferred.reject(e)
|
||||||
|
m.deferred.onerror(e)
|
||||||
} finally {
|
} finally {
|
||||||
if (options.background !== true) m.endComputation()
|
if (options.background !== true) m.endComputation()
|
||||||
}
|
}
|
||||||
@ -2697,7 +2789,7 @@ exports.System = System;
|
|||||||
}
|
}
|
||||||
|
|
||||||
return m
|
return m
|
||||||
})
|
}); // eslint-disable-line
|
||||||
;
|
;
|
||||||
( function _package( factory ){
|
( function _package( factory ){
|
||||||
if( typeof define === 'function' && define.amd ){
|
if( typeof define === 'function' && define.amd ){
|
||||||
@ -14921,10 +15013,10 @@ return jQuery;
|
|||||||
}).call(this);
|
}).call(this);
|
||||||
;
|
;
|
||||||
/* ========================================================================
|
/* ========================================================================
|
||||||
* Bootstrap: affix.js v3.3.6
|
* Bootstrap: affix.js v3.3.7
|
||||||
* http://getbootstrap.com/javascript/#affix
|
* http://getbootstrap.com/javascript/#affix
|
||||||
* ========================================================================
|
* ========================================================================
|
||||||
* Copyright 2011-2015 Twitter, Inc.
|
* Copyright 2011-2016 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
@ -14950,7 +15042,7 @@ return jQuery;
|
|||||||
this.checkPosition()
|
this.checkPosition()
|
||||||
}
|
}
|
||||||
|
|
||||||
Affix.VERSION = '3.3.6'
|
Affix.VERSION = '3.3.7'
|
||||||
|
|
||||||
Affix.RESET = 'affix affix-top affix-bottom'
|
Affix.RESET = 'affix affix-top affix-bottom'
|
||||||
|
|
||||||
@ -15084,10 +15176,10 @@ return jQuery;
|
|||||||
}(jQuery);
|
}(jQuery);
|
||||||
;
|
;
|
||||||
/* ========================================================================
|
/* ========================================================================
|
||||||
* Bootstrap: dropdown.js v3.3.6
|
* Bootstrap: dropdown.js v3.3.7
|
||||||
* http://getbootstrap.com/javascript/#dropdowns
|
* http://getbootstrap.com/javascript/#dropdowns
|
||||||
* ========================================================================
|
* ========================================================================
|
||||||
* Copyright 2011-2015 Twitter, Inc.
|
* Copyright 2011-2016 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
@ -15104,7 +15196,7 @@ return jQuery;
|
|||||||
$(element).on('click.bs.dropdown', this.toggle)
|
$(element).on('click.bs.dropdown', this.toggle)
|
||||||
}
|
}
|
||||||
|
|
||||||
Dropdown.VERSION = '3.3.6'
|
Dropdown.VERSION = '3.3.7'
|
||||||
|
|
||||||
function getParent($this) {
|
function getParent($this) {
|
||||||
var selector = $this.attr('data-target')
|
var selector = $this.attr('data-target')
|
||||||
@ -15250,10 +15342,10 @@ return jQuery;
|
|||||||
}(jQuery);
|
}(jQuery);
|
||||||
;
|
;
|
||||||
/* ========================================================================
|
/* ========================================================================
|
||||||
* Bootstrap: modal.js v3.3.6
|
* Bootstrap: modal.js v3.3.7
|
||||||
* http://getbootstrap.com/javascript/#modals
|
* http://getbootstrap.com/javascript/#modals
|
||||||
* ========================================================================
|
* ========================================================================
|
||||||
* Copyright 2011-2015 Twitter, Inc.
|
* Copyright 2011-2016 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
@ -15284,7 +15376,7 @@ return jQuery;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Modal.VERSION = '3.3.6'
|
Modal.VERSION = '3.3.7'
|
||||||
|
|
||||||
Modal.TRANSITION_DURATION = 300
|
Modal.TRANSITION_DURATION = 300
|
||||||
Modal.BACKDROP_TRANSITION_DURATION = 150
|
Modal.BACKDROP_TRANSITION_DURATION = 150
|
||||||
@ -15391,7 +15483,9 @@ return jQuery;
|
|||||||
$(document)
|
$(document)
|
||||||
.off('focusin.bs.modal') // guard against infinite focus loop
|
.off('focusin.bs.modal') // guard against infinite focus loop
|
||||||
.on('focusin.bs.modal', $.proxy(function (e) {
|
.on('focusin.bs.modal', $.proxy(function (e) {
|
||||||
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
|
if (document !== e.target &&
|
||||||
|
this.$element[0] !== e.target &&
|
||||||
|
!this.$element.has(e.target).length) {
|
||||||
this.$element.trigger('focus')
|
this.$element.trigger('focus')
|
||||||
}
|
}
|
||||||
}, this))
|
}, this))
|
||||||
@ -15588,11 +15682,11 @@ return jQuery;
|
|||||||
}(jQuery);
|
}(jQuery);
|
||||||
;
|
;
|
||||||
/* ========================================================================
|
/* ========================================================================
|
||||||
* Bootstrap: tooltip.js v3.3.6
|
* Bootstrap: tooltip.js v3.3.7
|
||||||
* http://getbootstrap.com/javascript/#tooltip
|
* http://getbootstrap.com/javascript/#tooltip
|
||||||
* Inspired by the original jQuery.tipsy by Jason Frame
|
* Inspired by the original jQuery.tipsy by Jason Frame
|
||||||
* ========================================================================
|
* ========================================================================
|
||||||
* Copyright 2011-2015 Twitter, Inc.
|
* Copyright 2011-2016 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
@ -15615,7 +15709,7 @@ return jQuery;
|
|||||||
this.init('tooltip', element, options)
|
this.init('tooltip', element, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
Tooltip.VERSION = '3.3.6'
|
Tooltip.VERSION = '3.3.7'
|
||||||
|
|
||||||
Tooltip.TRANSITION_DURATION = 150
|
Tooltip.TRANSITION_DURATION = 150
|
||||||
|
|
||||||
@ -15906,9 +16000,11 @@ return jQuery;
|
|||||||
|
|
||||||
function complete() {
|
function complete() {
|
||||||
if (that.hoverState != 'in') $tip.detach()
|
if (that.hoverState != 'in') $tip.detach()
|
||||||
that.$element
|
if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary.
|
||||||
.removeAttr('aria-describedby')
|
that.$element
|
||||||
.trigger('hidden.bs.' + that.type)
|
.removeAttr('aria-describedby')
|
||||||
|
.trigger('hidden.bs.' + that.type)
|
||||||
|
}
|
||||||
callback && callback()
|
callback && callback()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -15951,7 +16047,10 @@ return jQuery;
|
|||||||
// width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
|
// width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
|
||||||
elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
|
elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
|
||||||
}
|
}
|
||||||
var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
|
var isSvg = window.SVGElement && el instanceof window.SVGElement
|
||||||
|
// Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3.
|
||||||
|
// See https://github.com/twbs/bootstrap/issues/20280
|
||||||
|
var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset())
|
||||||
var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
|
var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
|
||||||
var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
|
var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
|
||||||
|
|
||||||
@ -16067,6 +16166,7 @@ return jQuery;
|
|||||||
that.$tip = null
|
that.$tip = null
|
||||||
that.$arrow = null
|
that.$arrow = null
|
||||||
that.$viewport = null
|
that.$viewport = null
|
||||||
|
that.$element = null
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16103,10 +16203,10 @@ return jQuery;
|
|||||||
}(jQuery);
|
}(jQuery);
|
||||||
;
|
;
|
||||||
/* ========================================================================
|
/* ========================================================================
|
||||||
* Bootstrap: transition.js v3.3.6
|
* Bootstrap: transition.js v3.3.7
|
||||||
* http://getbootstrap.com/javascript/#transitions
|
* http://getbootstrap.com/javascript/#transitions
|
||||||
* ========================================================================
|
* ========================================================================
|
||||||
* Copyright 2011-2015 Twitter, Inc.
|
* Copyright 2011-2016 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
@ -16976,7 +17076,6 @@ System.register('flarum/Component', [], function (_export, _context) {
|
|||||||
* @param {Array|Object} children
|
* @param {Array|Object} children
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function Component() {
|
function Component() {
|
||||||
var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
||||||
var children = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
|
var children = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
|
||||||
@ -19694,16 +19793,16 @@ System.register('flarum/components/PermissionDropdown', ['flarum/components/Drop
|
|||||||
if (restrictToGroupIds.indexOf(Group.GUEST_ID) !== -1) {
|
if (restrictToGroupIds.indexOf(Group.GUEST_ID) !== -1) {
|
||||||
// do nothing
|
// do nothing
|
||||||
} else if (restrictToGroupIds.indexOf(Group.MEMBER_ID) !== -1) {
|
} else if (restrictToGroupIds.indexOf(Group.MEMBER_ID) !== -1) {
|
||||||
groupIds = groupIds.filter(function (id) {
|
groupIds = groupIds.filter(function (id) {
|
||||||
return id !== Group.GUEST_ID;
|
return id !== Group.GUEST_ID;
|
||||||
});
|
});
|
||||||
} else if (groupIds.indexOf(Group.MEMBER_ID) !== -1) {
|
} else if (groupIds.indexOf(Group.MEMBER_ID) !== -1) {
|
||||||
groupIds = restrictToGroupIds;
|
groupIds = restrictToGroupIds;
|
||||||
} else {
|
} else {
|
||||||
groupIds = restrictToGroupIds.filter(function (id) {
|
groupIds = restrictToGroupIds.filter(function (id) {
|
||||||
return groupIds.indexOf(id) !== -1;
|
return groupIds.indexOf(id) !== -1;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
groupIds = filterByRequiredPermissions(groupIds, required);
|
groupIds = filterByRequiredPermissions(groupIds, required);
|
||||||
});
|
});
|
||||||
@ -20967,88 +21066,87 @@ System.register('flarum/components/UploadImageButton', ['flarum/components/Butto
|
|||||||
System.register("flarum/extend", [], function (_export, _context) {
|
System.register("flarum/extend", [], function (_export, _context) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extend an object's method by running its output through a mutating callback
|
||||||
|
* every time it is called.
|
||||||
|
*
|
||||||
|
* The callback accepts the method's return value and should perform any
|
||||||
|
* mutations directly on this value. For this reason, this function will not be
|
||||||
|
* effective on methods which return scalar values (numbers, strings, booleans).
|
||||||
|
*
|
||||||
|
* Care should be taken to extend the correct object – in most cases, a class'
|
||||||
|
* prototype will be the desired target of extension, not the class itself.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* extend(Discussion.prototype, 'badges', function(badges) {
|
||||||
|
* // do something with `badges`
|
||||||
|
* });
|
||||||
|
*
|
||||||
|
* @param {Object} object The object that owns the method
|
||||||
|
* @param {String} method The name of the method to extend
|
||||||
|
* @param {function} callback A callback which mutates the method's output
|
||||||
|
*/
|
||||||
|
function extend(object, method, callback) {
|
||||||
|
var original = object[method];
|
||||||
|
|
||||||
|
object[method] = function () {
|
||||||
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||||
|
args[_key] = arguments[_key];
|
||||||
|
}
|
||||||
|
|
||||||
|
var value = original ? original.apply(this, args) : undefined;
|
||||||
|
|
||||||
|
callback.apply(this, [value].concat(args));
|
||||||
|
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
|
||||||
|
babelHelpers.extends(object[method], original);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override an object's method by replacing it with a new function, so that the
|
||||||
|
* new function will be run every time the object's method is called.
|
||||||
|
*
|
||||||
|
* The replacement function accepts the original method as its first argument,
|
||||||
|
* which is like a call to 'super'. Any arguments passed to the original method
|
||||||
|
* are also passed to the replacement.
|
||||||
|
*
|
||||||
|
* Care should be taken to extend the correct object – in most cases, a class'
|
||||||
|
* prototype will be the desired target of extension, not the class itself.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* override(Discussion.prototype, 'badges', function(original) {
|
||||||
|
* const badges = original();
|
||||||
|
* // do something with badges
|
||||||
|
* return badges;
|
||||||
|
* });
|
||||||
|
*
|
||||||
|
* @param {Object} object The object that owns the method
|
||||||
|
* @param {String} method The name of the method to override
|
||||||
|
* @param {function} newMethod The method to replace it with
|
||||||
|
*/
|
||||||
|
|
||||||
|
_export("extend", extend);
|
||||||
|
|
||||||
|
function override(object, method, newMethod) {
|
||||||
|
var original = object[method];
|
||||||
|
|
||||||
|
object[method] = function () {
|
||||||
|
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||||
|
args[_key2] = arguments[_key2];
|
||||||
|
}
|
||||||
|
|
||||||
|
return newMethod.apply(this, [original.bind(this)].concat(args));
|
||||||
|
};
|
||||||
|
|
||||||
|
babelHelpers.extends(object[method], original);
|
||||||
|
}
|
||||||
|
_export("override", override);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
setters: [],
|
setters: [],
|
||||||
execute: function () {
|
execute: function () {}
|
||||||
/**
|
|
||||||
* Extend an object's method by running its output through a mutating callback
|
|
||||||
* every time it is called.
|
|
||||||
*
|
|
||||||
* The callback accepts the method's return value and should perform any
|
|
||||||
* mutations directly on this value. For this reason, this function will not be
|
|
||||||
* effective on methods which return scalar values (numbers, strings, booleans).
|
|
||||||
*
|
|
||||||
* Care should be taken to extend the correct object – in most cases, a class'
|
|
||||||
* prototype will be the desired target of extension, not the class itself.
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* extend(Discussion.prototype, 'badges', function(badges) {
|
|
||||||
* // do something with `badges`
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* @param {Object} object The object that owns the method
|
|
||||||
* @param {String} method The name of the method to extend
|
|
||||||
* @param {function} callback A callback which mutates the method's output
|
|
||||||
*/
|
|
||||||
function extend(object, method, callback) {
|
|
||||||
var original = object[method];
|
|
||||||
|
|
||||||
object[method] = function () {
|
|
||||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
||||||
args[_key] = arguments[_key];
|
|
||||||
}
|
|
||||||
|
|
||||||
var value = original ? original.apply(this, args) : undefined;
|
|
||||||
|
|
||||||
callback.apply(this, [value].concat(args));
|
|
||||||
|
|
||||||
return value;
|
|
||||||
};
|
|
||||||
|
|
||||||
babelHelpers.extends(object[method], original);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Override an object's method by replacing it with a new function, so that the
|
|
||||||
* new function will be run every time the object's method is called.
|
|
||||||
*
|
|
||||||
* The replacement function accepts the original method as its first argument,
|
|
||||||
* which is like a call to 'super'. Any arguments passed to the original method
|
|
||||||
* are also passed to the replacement.
|
|
||||||
*
|
|
||||||
* Care should be taken to extend the correct object – in most cases, a class'
|
|
||||||
* prototype will be the desired target of extension, not the class itself.
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* override(Discussion.prototype, 'badges', function(original) {
|
|
||||||
* const badges = original();
|
|
||||||
* // do something with badges
|
|
||||||
* return badges;
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* @param {Object} object The object that owns the method
|
|
||||||
* @param {String} method The name of the method to override
|
|
||||||
* @param {function} newMethod The method to replace it with
|
|
||||||
*/
|
|
||||||
|
|
||||||
_export("extend", extend);
|
|
||||||
|
|
||||||
function override(object, method, newMethod) {
|
|
||||||
var original = object[method];
|
|
||||||
|
|
||||||
object[method] = function () {
|
|
||||||
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
||||||
args[_key2] = arguments[_key2];
|
|
||||||
}
|
|
||||||
|
|
||||||
return newMethod.apply(this, [original.bind(this)].concat(args));
|
|
||||||
};
|
|
||||||
|
|
||||||
babelHelpers.extends(object[method], original);
|
|
||||||
}
|
|
||||||
|
|
||||||
_export("override", override);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
});;
|
});;
|
||||||
'use strict';
|
'use strict';
|
||||||
@ -21592,7 +21690,6 @@ System.register('flarum/Model', [], function (_export, _context) {
|
|||||||
* @param {Store} store The data store that this model should be persisted to.
|
* @param {Store} store The data store that this model should be persisted to.
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function Model() {
|
function Model() {
|
||||||
var data = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
var data = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
||||||
var store = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
|
var store = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
|
||||||
@ -23429,7 +23526,6 @@ System.register("flarum/utils/ScrollListener", [], function (_export, _context)
|
|||||||
* changes.
|
* changes.
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function ScrollListener(callback) {
|
function ScrollListener(callback) {
|
||||||
babelHelpers.classCallCheck(this, ScrollListener);
|
babelHelpers.classCallCheck(this, ScrollListener);
|
||||||
|
|
||||||
@ -23490,78 +23586,78 @@ System.register("flarum/utils/ScrollListener", [], function (_export, _context)
|
|||||||
System.register('flarum/utils/string', [], function (_export, _context) {
|
System.register('flarum/utils/string', [], function (_export, _context) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Truncate a string to the given length, appending ellipses if necessary.
|
||||||
|
*
|
||||||
|
* @param {String} string
|
||||||
|
* @param {Number} length
|
||||||
|
* @param {Number} [start=0]
|
||||||
|
* @return {String}
|
||||||
|
*/
|
||||||
|
function truncate(string, length) {
|
||||||
|
var start = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2];
|
||||||
|
|
||||||
|
return (start > 0 ? '...' : '') + string.substring(start, start + length) + (string.length > start + length ? '...' : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a slug out of the given string. Non-alphanumeric characters are
|
||||||
|
* converted to hyphens.
|
||||||
|
*
|
||||||
|
* @param {String} string
|
||||||
|
* @return {String}
|
||||||
|
*/
|
||||||
|
|
||||||
|
_export('truncate', truncate);
|
||||||
|
|
||||||
|
function slug(string) {
|
||||||
|
return string.toLowerCase().replace(/[^a-z0-9]/gi, '-').replace(/-+/g, '-').replace(/-$|^-/g, '') || '-';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Strip HTML tags and quotes out of the given string, replacing them with
|
||||||
|
* meaningful punctuation.
|
||||||
|
*
|
||||||
|
* @param {String} string
|
||||||
|
* @return {String}
|
||||||
|
*/
|
||||||
|
|
||||||
|
_export('slug', slug);
|
||||||
|
|
||||||
|
function getPlainContent(string) {
|
||||||
|
var html = string.replace(/(<\/p>|<br>)/g, '$1 ').replace(/<img\b[^>]*>/ig, ' ');
|
||||||
|
|
||||||
|
var dom = $('<div/>').html(html);
|
||||||
|
|
||||||
|
dom.find(getPlainContent.removeSelectors.join(',')).remove();
|
||||||
|
|
||||||
|
return dom.text().replace(/\s+/g, ' ').trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An array of DOM selectors to remove when getting plain content.
|
||||||
|
*
|
||||||
|
* @type {Array}
|
||||||
|
*/
|
||||||
|
|
||||||
|
_export('getPlainContent', getPlainContent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make a string's first character uppercase.
|
||||||
|
*
|
||||||
|
* @param {String} string
|
||||||
|
* @return {String}
|
||||||
|
*/
|
||||||
|
function ucfirst(string) {
|
||||||
|
return string.substr(0, 1).toUpperCase() + string.substr(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
_export('ucfirst', ucfirst);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
setters: [],
|
setters: [],
|
||||||
execute: function () {
|
execute: function () {
|
||||||
/**
|
|
||||||
* Truncate a string to the given length, appending ellipses if necessary.
|
|
||||||
*
|
|
||||||
* @param {String} string
|
|
||||||
* @param {Number} length
|
|
||||||
* @param {Number} [start=0]
|
|
||||||
* @return {String}
|
|
||||||
*/
|
|
||||||
function truncate(string, length) {
|
|
||||||
var start = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2];
|
|
||||||
|
|
||||||
return (start > 0 ? '...' : '') + string.substring(start, start + length) + (string.length > start + length ? '...' : '');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a slug out of the given string. Non-alphanumeric characters are
|
|
||||||
* converted to hyphens.
|
|
||||||
*
|
|
||||||
* @param {String} string
|
|
||||||
* @return {String}
|
|
||||||
*/
|
|
||||||
|
|
||||||
_export('truncate', truncate);
|
|
||||||
|
|
||||||
function slug(string) {
|
|
||||||
return string.toLowerCase().replace(/[^a-z0-9]/gi, '-').replace(/-+/g, '-').replace(/-$|^-/g, '') || '-';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Strip HTML tags and quotes out of the given string, replacing them with
|
|
||||||
* meaningful punctuation.
|
|
||||||
*
|
|
||||||
* @param {String} string
|
|
||||||
* @return {String}
|
|
||||||
*/
|
|
||||||
|
|
||||||
_export('slug', slug);
|
|
||||||
|
|
||||||
function getPlainContent(string) {
|
|
||||||
var html = string.replace(/(<\/p>|<br>)/g, '$1 ').replace(/<img\b[^>]*>/ig, ' ');
|
|
||||||
|
|
||||||
var dom = $('<div/>').html(html);
|
|
||||||
|
|
||||||
dom.find(getPlainContent.removeSelectors.join(',')).remove();
|
|
||||||
|
|
||||||
return dom.text().replace(/\s+/g, ' ').trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An array of DOM selectors to remove when getting plain content.
|
|
||||||
*
|
|
||||||
* @type {Array}
|
|
||||||
*/
|
|
||||||
|
|
||||||
_export('getPlainContent', getPlainContent);
|
|
||||||
|
|
||||||
getPlainContent.removeSelectors = ['blockquote', 'script'];
|
getPlainContent.removeSelectors = ['blockquote', 'script'];
|
||||||
|
|
||||||
/**
|
|
||||||
* Make a string's first character uppercase.
|
|
||||||
*
|
|
||||||
* @param {String} string
|
|
||||||
* @return {String}
|
|
||||||
*/
|
|
||||||
function ucfirst(string) {
|
|
||||||
return string.substr(0, 1).toUpperCase() + string.substr(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
_export('ucfirst', ucfirst);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});;
|
});;
|
||||||
@ -23646,7 +23742,6 @@ System.register('flarum/utils/SubtreeRetainer', [], function (_export, _context)
|
|||||||
/**
|
/**
|
||||||
* @param {...callbacks} callbacks Functions returning data to keep track of.
|
* @param {...callbacks} callbacks Functions returning data to keep track of.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function SubtreeRetainer() {
|
function SubtreeRetainer() {
|
||||||
babelHelpers.classCallCheck(this, SubtreeRetainer);
|
babelHelpers.classCallCheck(this, SubtreeRetainer);
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
"spin.js": "~2.0.1",
|
"spin.js": "~2.0.1",
|
||||||
"moment": "~2.8.4",
|
"moment": "~2.8.4",
|
||||||
"color-thief": "v2.0",
|
"color-thief": "v2.0",
|
||||||
"mithril": "lhorie/mithril.js#v0.2.3",
|
"mithril": "lhorie/mithril.js#v0.2.5",
|
||||||
"es6-micro-loader": "caridy/es6-micro-loader#v0.2.1",
|
"es6-micro-loader": "caridy/es6-micro-loader#v0.2.1",
|
||||||
"fastclick": "~1.0.6",
|
"fastclick": "~1.0.6",
|
||||||
"autolink": "~1.0.0",
|
"autolink": "~1.0.0",
|
||||||
|
617
js/forum/dist/app.js
vendored
617
js/forum/dist/app.js
vendored
@ -569,11 +569,11 @@ exports.System = System;
|
|||||||
global.m = m
|
global.m = m
|
||||||
}
|
}
|
||||||
/* eslint-enable no-undef */
|
/* eslint-enable no-undef */
|
||||||
})(typeof window !== "undefined" ? window : {}, function (global, undefined) { // eslint-disable-line
|
})(typeof window !== "undefined" ? window : this, function (global, undefined) { // eslint-disable-line
|
||||||
"use strict"
|
"use strict"
|
||||||
|
|
||||||
m.version = function () {
|
m.version = function () {
|
||||||
return "v0.2.3"
|
return "v0.2.5"
|
||||||
}
|
}
|
||||||
|
|
||||||
var hasOwn = {}.hasOwnProperty
|
var hasOwn = {}.hasOwnProperty
|
||||||
@ -655,7 +655,7 @@ exports.System = System;
|
|||||||
classes.push(match[2])
|
classes.push(match[2])
|
||||||
} else if (match[3][0] === "[") {
|
} else if (match[3][0] === "[") {
|
||||||
var pair = /\[(.+?)(?:=("|'|)(.*?)\2)?\]/.exec(match[3])
|
var pair = /\[(.+?)(?:=("|'|)(.*?)\2)?\]/.exec(match[3])
|
||||||
cell.attrs[pair[1]] = pair[3] || (pair[2] ? "" : true)
|
cell.attrs[pair[1]] = pair[3] || ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -700,7 +700,11 @@ exports.System = System;
|
|||||||
* or splat (optional)
|
* or splat (optional)
|
||||||
*/
|
*/
|
||||||
function m(tag, pairs) {
|
function m(tag, pairs) {
|
||||||
var args = [].slice.call(arguments, 1)
|
var args = []
|
||||||
|
|
||||||
|
for (var i = 1, length = arguments.length; i < length; i++) {
|
||||||
|
args[i - 1] = arguments[i]
|
||||||
|
}
|
||||||
|
|
||||||
if (isObject(tag)) return parameterize(tag, args)
|
if (isObject(tag)) return parameterize(tag, args)
|
||||||
|
|
||||||
@ -794,8 +798,10 @@ exports.System = System;
|
|||||||
})
|
})
|
||||||
|
|
||||||
var actions = []
|
var actions = []
|
||||||
for (var prop in existing) if (hasOwn.call(existing, prop)) {
|
for (var prop in existing) {
|
||||||
actions.push(existing[prop])
|
if (hasOwn.call(existing, prop)) {
|
||||||
|
actions.push(existing[prop])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var changes = actions.sort(sortChanges)
|
var changes = actions.sort(sortChanges)
|
||||||
@ -926,8 +932,10 @@ exports.System = System;
|
|||||||
|
|
||||||
if (cached.controllers) {
|
if (cached.controllers) {
|
||||||
forEach(cached.controllers, function (controller) {
|
forEach(cached.controllers, function (controller) {
|
||||||
if (controller.onunload) controller.onunload({preventDefault: noop});
|
if (controller.onunload) {
|
||||||
});
|
controller.onunload({preventDefault: noop})
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1308,7 +1316,9 @@ exports.System = System;
|
|||||||
var unloaders = []
|
var unloaders = []
|
||||||
|
|
||||||
function updateLists(views, controllers, view, controller) {
|
function updateLists(views, controllers, view, controller) {
|
||||||
if (controller.onunload != null && unloaders.map(function(u) {return u.handler}).indexOf(controller.onunload) < 0) {
|
if (controller.onunload != null &&
|
||||||
|
unloaders.map(function (u) { return u.handler })
|
||||||
|
.indexOf(controller.onunload) < 0) {
|
||||||
unloaders.push({
|
unloaders.push({
|
||||||
controller: controller,
|
controller: controller,
|
||||||
handler: controller.onunload
|
handler: controller.onunload
|
||||||
@ -1320,11 +1330,32 @@ exports.System = System;
|
|||||||
}
|
}
|
||||||
|
|
||||||
var forcing = false
|
var forcing = false
|
||||||
function checkView(data, view, cached, cachedControllers, controllers, views) {
|
function checkView(
|
||||||
var controller = getController(cached.views, view, cachedControllers, data.controller)
|
data,
|
||||||
|
view,
|
||||||
|
cached,
|
||||||
|
cachedControllers,
|
||||||
|
controllers,
|
||||||
|
views
|
||||||
|
) {
|
||||||
|
var controller = getController(
|
||||||
|
cached.views,
|
||||||
|
view,
|
||||||
|
cachedControllers,
|
||||||
|
data.controller)
|
||||||
|
|
||||||
var key = data && data.attrs && data.attrs.key
|
var key = data && data.attrs && data.attrs.key
|
||||||
data = pendingRequests === 0 || forcing || cachedControllers && cachedControllers.indexOf(controller) > -1 ? data.view(controller) : {tag: "placeholder"}
|
|
||||||
if (data.subtree === "retain") return data;
|
if (pendingRequests === 0 ||
|
||||||
|
forcing ||
|
||||||
|
cachedControllers &&
|
||||||
|
cachedControllers.indexOf(controller) > -1) {
|
||||||
|
data = data.view(controller)
|
||||||
|
} else {
|
||||||
|
data = {tag: "placeholder"}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.subtree === "retain") return data
|
||||||
data.attrs = data.attrs || {}
|
data.attrs = data.attrs || {}
|
||||||
data.attrs.key = key
|
data.attrs.key = key
|
||||||
updateLists(views, controllers, view, controller)
|
updateLists(views, controllers, view, controller)
|
||||||
@ -1389,6 +1420,9 @@ exports.System = System;
|
|||||||
// set attributes first, then create children
|
// set attributes first, then create children
|
||||||
var attrs = constructAttrs(data, node, namespace, hasKeys)
|
var attrs = constructAttrs(data, node, namespace, hasKeys)
|
||||||
|
|
||||||
|
// add the node to its parent before attaching children to it
|
||||||
|
insertNode(parentElement, node, index)
|
||||||
|
|
||||||
var children = constructChildren(data, node, cached, editable,
|
var children = constructChildren(data, node, cached, editable,
|
||||||
namespace, configs)
|
namespace, configs)
|
||||||
|
|
||||||
@ -1412,7 +1446,7 @@ exports.System = System;
|
|||||||
controllers)
|
controllers)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNew || shouldReattach === true && node != null) {
|
if (!isNew && shouldReattach === true && node != null) {
|
||||||
insertNode(parentElement, node, index)
|
insertNode(parentElement, node, index)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1531,14 +1565,18 @@ exports.System = System;
|
|||||||
}
|
}
|
||||||
|
|
||||||
function copyStyleAttrs(node, dataAttr, cachedAttr) {
|
function copyStyleAttrs(node, dataAttr, cachedAttr) {
|
||||||
for (var rule in dataAttr) if (hasOwn.call(dataAttr, rule)) {
|
for (var rule in dataAttr) {
|
||||||
if (cachedAttr == null || cachedAttr[rule] !== dataAttr[rule]) {
|
if (hasOwn.call(dataAttr, rule)) {
|
||||||
node.style[rule] = dataAttr[rule]
|
if (cachedAttr == null || cachedAttr[rule] !== dataAttr[rule]) {
|
||||||
|
node.style[rule] = dataAttr[rule]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (rule in cachedAttr) if (hasOwn.call(cachedAttr, rule)) {
|
for (rule in cachedAttr) {
|
||||||
if (!hasOwn.call(dataAttr, rule)) node.style[rule] = ""
|
if (hasOwn.call(cachedAttr, rule)) {
|
||||||
|
if (!hasOwn.call(dataAttr, rule)) node.style[rule] = ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1611,7 +1649,7 @@ exports.System = System;
|
|||||||
tag,
|
tag,
|
||||||
namespace
|
namespace
|
||||||
) {
|
) {
|
||||||
if (!(attrName in cachedAttrs) || (cachedAttr !== dataAttr)) {
|
if (!(attrName in cachedAttrs) || (cachedAttr !== dataAttr) || ($document.activeElement === node)) {
|
||||||
cachedAttrs[attrName] = dataAttr
|
cachedAttrs[attrName] = dataAttr
|
||||||
try {
|
try {
|
||||||
return setSingleAttr(
|
return setSingleAttr(
|
||||||
@ -1634,16 +1672,18 @@ exports.System = System;
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setAttributes(node, tag, dataAttrs, cachedAttrs, namespace) {
|
function setAttributes(node, tag, dataAttrs, cachedAttrs, namespace) {
|
||||||
for (var attrName in dataAttrs) if (hasOwn.call(dataAttrs, attrName)) {
|
for (var attrName in dataAttrs) {
|
||||||
if (trySetAttr(
|
if (hasOwn.call(dataAttrs, attrName)) {
|
||||||
node,
|
if (trySetAttr(
|
||||||
attrName,
|
node,
|
||||||
dataAttrs[attrName],
|
attrName,
|
||||||
cachedAttrs[attrName],
|
dataAttrs[attrName],
|
||||||
cachedAttrs,
|
cachedAttrs[attrName],
|
||||||
tag,
|
cachedAttrs,
|
||||||
namespace)) {
|
tag,
|
||||||
continue
|
namespace)) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return cachedAttrs
|
return cachedAttrs
|
||||||
@ -1695,9 +1735,41 @@ exports.System = System;
|
|||||||
$document.createRange().createContextualFragment(data))
|
$document.createRange().createContextualFragment(data))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
parentElement.insertAdjacentHTML("beforeend", data)
|
parentElement.insertAdjacentHTML("beforeend", data)
|
||||||
|
replaceScriptNodes(parentElement)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Replace script tags inside given DOM element with executable ones.
|
||||||
|
// Will also check children recursively and replace any found script
|
||||||
|
// tags in same manner.
|
||||||
|
function replaceScriptNodes(node) {
|
||||||
|
if (node.tagName === "SCRIPT") {
|
||||||
|
node.parentNode.replaceChild(buildExecutableNode(node), node)
|
||||||
|
} else {
|
||||||
|
var children = node.childNodes
|
||||||
|
if (children && children.length) {
|
||||||
|
for (var i = 0; i < children.length; i++) {
|
||||||
|
replaceScriptNodes(children[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return node
|
||||||
|
}
|
||||||
|
|
||||||
|
// Replace script element with one whose contents are executable.
|
||||||
|
function buildExecutableNode(node){
|
||||||
|
var scriptEl = document.createElement("script")
|
||||||
|
var attrs = node.attributes
|
||||||
|
|
||||||
|
for (var i = 0; i < attrs.length; i++) {
|
||||||
|
scriptEl.setAttribute(attrs[i].name, attrs[i].value)
|
||||||
|
}
|
||||||
|
|
||||||
|
scriptEl.text = node.innerHTML
|
||||||
|
return scriptEl
|
||||||
|
}
|
||||||
|
|
||||||
function injectHTML(parentElement, index, data) {
|
function injectHTML(parentElement, index, data) {
|
||||||
var nextSibling = parentElement.childNodes[index]
|
var nextSibling = parentElement.childNodes[index]
|
||||||
if (nextSibling) {
|
if (nextSibling) {
|
||||||
@ -1825,7 +1897,7 @@ exports.System = System;
|
|||||||
}
|
}
|
||||||
|
|
||||||
m.prop = function (store) {
|
m.prop = function (store) {
|
||||||
if ((store != null && isObject(store) || isFunction(store)) &&
|
if ((store != null && (isObject(store) || isFunction(store)) || ((typeof Promise !== "undefined") && (store instanceof Promise))) &&
|
||||||
isFunction(store.then)) {
|
isFunction(store.then)) {
|
||||||
return propify(store)
|
return propify(store)
|
||||||
}
|
}
|
||||||
@ -1870,7 +1942,11 @@ exports.System = System;
|
|||||||
}
|
}
|
||||||
|
|
||||||
m.component = function (component) {
|
m.component = function (component) {
|
||||||
var args = [].slice.call(arguments, 1)
|
var args = new Array(arguments.length - 1)
|
||||||
|
|
||||||
|
for (var i = 1; i < arguments.length; i++) {
|
||||||
|
args[i - 1] = arguments[i]
|
||||||
|
}
|
||||||
|
|
||||||
return parameterize(component, args)
|
return parameterize(component, args)
|
||||||
}
|
}
|
||||||
@ -1962,7 +2038,7 @@ exports.System = System;
|
|||||||
try {
|
try {
|
||||||
// lastRedrawId is a positive number if a second redraw is requested
|
// lastRedrawId is a positive number if a second redraw is requested
|
||||||
// before the next animation frame
|
// before the next animation frame
|
||||||
// lastRedrawID is null if it's the first redraw and not an event
|
// lastRedrawId is null if it's the first redraw and not an event
|
||||||
// handler
|
// handler
|
||||||
if (lastRedrawId && !force) {
|
if (lastRedrawId && !force) {
|
||||||
// when setTimeout: only reschedule redraw if time between now
|
// when setTimeout: only reschedule redraw if time between now
|
||||||
@ -2021,7 +2097,7 @@ exports.System = System;
|
|||||||
|
|
||||||
m.withAttr = function (prop, withAttrCallback, callbackThis) {
|
m.withAttr = function (prop, withAttrCallback, callbackThis) {
|
||||||
return function (e) {
|
return function (e) {
|
||||||
e = e || event
|
e = e || window.event
|
||||||
/* eslint-disable no-invalid-this */
|
/* eslint-disable no-invalid-this */
|
||||||
var currentTarget = e.currentTarget || this
|
var currentTarget = e.currentTarget || this
|
||||||
var _this = callbackThis || this
|
var _this = callbackThis || this
|
||||||
@ -2103,8 +2179,10 @@ exports.System = System;
|
|||||||
params = {}
|
params = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i in args) if (hasOwn.call(args, i)) {
|
for (var i in args) {
|
||||||
params[i] = args[i]
|
if (hasOwn.call(args, i)) {
|
||||||
|
params[i] = args[i]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var querystring = buildQueryString(params)
|
var querystring = buildQueryString(params)
|
||||||
@ -2130,8 +2208,16 @@ exports.System = System;
|
|||||||
var method = replaceHistory ? "replaceState" : "pushState"
|
var method = replaceHistory ? "replaceState" : "pushState"
|
||||||
computePreRedrawHook = setScroll
|
computePreRedrawHook = setScroll
|
||||||
computePostRedrawHook = function () {
|
computePostRedrawHook = function () {
|
||||||
global.history[method](null, $document.title,
|
try {
|
||||||
modes[m.route.mode] + currentRoute)
|
global.history[method](null, $document.title,
|
||||||
|
modes[m.route.mode] + currentRoute)
|
||||||
|
} catch (err) {
|
||||||
|
// In the event of a pushState or replaceState failure,
|
||||||
|
// fallback to a standard redirect. This is specifically
|
||||||
|
// to address a Safari security error when attempting to
|
||||||
|
// call pushState more than 100 times.
|
||||||
|
$location[m.route.mode] = currentRoute
|
||||||
|
}
|
||||||
}
|
}
|
||||||
redirect(modes[m.route.mode] + currentRoute)
|
redirect(modes[m.route.mode] + currentRoute)
|
||||||
} else {
|
} else {
|
||||||
@ -2180,29 +2266,31 @@ exports.System = System;
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var route in router) if (hasOwn.call(router, route)) {
|
for (var route in router) {
|
||||||
if (route === path) {
|
if (hasOwn.call(router, route)) {
|
||||||
m.mount(root, router[route])
|
if (route === path) {
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
var matcher = new RegExp("^" + route
|
|
||||||
.replace(/:[^\/]+?\.{3}/g, "(.*?)")
|
|
||||||
.replace(/:[^\/]+/g, "([^\\/]+)") + "\/?$")
|
|
||||||
|
|
||||||
if (matcher.test(path)) {
|
|
||||||
/* eslint-disable no-loop-func */
|
|
||||||
path.replace(matcher, function () {
|
|
||||||
var keys = route.match(/:[^\/]+/g) || []
|
|
||||||
var values = [].slice.call(arguments, 1, -2)
|
|
||||||
forEach(keys, function (key, i) {
|
|
||||||
routeParams[key.replace(/:|\./g, "")] =
|
|
||||||
decodeURIComponent(values[i])
|
|
||||||
})
|
|
||||||
m.mount(root, router[route])
|
m.mount(root, router[route])
|
||||||
})
|
return true
|
||||||
/* eslint-enable no-loop-func */
|
}
|
||||||
return true
|
|
||||||
|
var matcher = new RegExp("^" + route
|
||||||
|
.replace(/:[^\/]+?\.{3}/g, "(.*?)")
|
||||||
|
.replace(/:[^\/]+/g, "([^\\/]+)") + "\/?$")
|
||||||
|
|
||||||
|
if (matcher.test(path)) {
|
||||||
|
/* eslint-disable no-loop-func */
|
||||||
|
path.replace(matcher, function () {
|
||||||
|
var keys = route.match(/:[^\/]+/g) || []
|
||||||
|
var values = [].slice.call(arguments, 1, -2)
|
||||||
|
forEach(keys, function (key, i) {
|
||||||
|
routeParams[key.replace(/:|\./g, "")] =
|
||||||
|
decodeURIComponent(values[i])
|
||||||
|
})
|
||||||
|
m.mount(root, router[route])
|
||||||
|
})
|
||||||
|
/* eslint-enable no-loop-func */
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2248,32 +2336,35 @@ exports.System = System;
|
|||||||
var duplicates = {}
|
var duplicates = {}
|
||||||
var str = []
|
var str = []
|
||||||
|
|
||||||
for (var prop in object) if (hasOwn.call(object, prop)) {
|
for (var prop in object) {
|
||||||
var key = prefix ? prefix + "[" + prop + "]" : prop
|
if (hasOwn.call(object, prop)) {
|
||||||
var value = object[prop]
|
var key = prefix ? prefix + "[" + prop + "]" : prop
|
||||||
|
var value = object[prop]
|
||||||
|
|
||||||
if (value === null) {
|
if (value === null) {
|
||||||
str.push(encodeURIComponent(key))
|
str.push(encodeURIComponent(key))
|
||||||
} else if (isObject(value)) {
|
} else if (isObject(value)) {
|
||||||
str.push(buildQueryString(value, key))
|
str.push(buildQueryString(value, key))
|
||||||
} else if (isArray(value)) {
|
} else if (isArray(value)) {
|
||||||
var keys = []
|
var keys = []
|
||||||
duplicates[key] = duplicates[key] || {}
|
duplicates[key] = duplicates[key] || {}
|
||||||
/* eslint-disable no-loop-func */
|
/* eslint-disable no-loop-func */
|
||||||
forEach(value, function (item) {
|
forEach(value, function (item) {
|
||||||
/* eslint-enable no-loop-func */
|
/* eslint-enable no-loop-func */
|
||||||
if (!duplicates[key][item]) {
|
if (!duplicates[key][item]) {
|
||||||
duplicates[key][item] = true
|
duplicates[key][item] = true
|
||||||
keys.push(encodeURIComponent(key) + "=" +
|
keys.push(encodeURIComponent(key) + "=" +
|
||||||
encodeURIComponent(item))
|
encodeURIComponent(item))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
str.push(keys.join("&"))
|
str.push(keys.join("&"))
|
||||||
} else if (value !== undefined) {
|
} else if (value !== undefined) {
|
||||||
str.push(encodeURIComponent(key) + "=" +
|
str.push(encodeURIComponent(key) + "=" +
|
||||||
encodeURIComponent(value))
|
encodeURIComponent(value))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return str.join("&")
|
return str.join("&")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2481,7 +2572,7 @@ exports.System = System;
|
|||||||
m.sync = function (args) {
|
m.sync = function (args) {
|
||||||
var deferred = m.deferred()
|
var deferred = m.deferred()
|
||||||
var outstanding = args.length
|
var outstanding = args.length
|
||||||
var results = new Array(outstanding)
|
var results = []
|
||||||
var method = "resolve"
|
var method = "resolve"
|
||||||
|
|
||||||
function synchronizer(pos, resolved) {
|
function synchronizer(pos, resolved) {
|
||||||
@ -2510,7 +2601,7 @@ exports.System = System;
|
|||||||
function identity(value) { return value }
|
function identity(value) { return value }
|
||||||
|
|
||||||
function handleJsonp(options) {
|
function handleJsonp(options) {
|
||||||
var callbackKey = "mithril_callback_" +
|
var callbackKey = options.callbackName || "mithril_callback_" +
|
||||||
new Date().getTime() + "_" +
|
new Date().getTime() + "_" +
|
||||||
(Math.round(Math.random() * 1e16)).toString(36)
|
(Math.round(Math.random() * 1e16)).toString(36)
|
||||||
|
|
||||||
@ -2619,9 +2710,9 @@ exports.System = System;
|
|||||||
|
|
||||||
function parameterizeUrl(url, data) {
|
function parameterizeUrl(url, data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
url = url.replace(/:[a-z]\w+/gi, function(token){
|
url = url.replace(/:[a-z]\w+/gi, function (token){
|
||||||
var key = token.slice(1)
|
var key = token.slice(1)
|
||||||
var value = data[key]
|
var value = data[key] || token
|
||||||
delete data[key]
|
delete data[key]
|
||||||
return value
|
return value
|
||||||
})
|
})
|
||||||
@ -2686,6 +2777,7 @@ exports.System = System;
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
deferred.reject(e)
|
deferred.reject(e)
|
||||||
|
m.deferred.onerror(e)
|
||||||
} finally {
|
} finally {
|
||||||
if (options.background !== true) m.endComputation()
|
if (options.background !== true) m.endComputation()
|
||||||
}
|
}
|
||||||
@ -2697,7 +2789,7 @@ exports.System = System;
|
|||||||
}
|
}
|
||||||
|
|
||||||
return m
|
return m
|
||||||
})
|
}); // eslint-disable-line
|
||||||
;
|
;
|
||||||
( function _package( factory ){
|
( function _package( factory ){
|
||||||
if( typeof define === 'function' && define.amd ){
|
if( typeof define === 'function' && define.amd ){
|
||||||
@ -15728,14 +15820,14 @@ var MMCQ = (function() {
|
|||||||
}
|
}
|
||||||
}).call(this);
|
}).call(this);
|
||||||
;
|
;
|
||||||
(function(){var h=[].slice;String.prototype.autoLink=function(){var b,f,d,a,e,g;a=1<=arguments.length?h.call(arguments,0):[];e=/(^|[\s\n]|<br\/?>)((?:https?|ftp):\/\/[\-A-Z0-9+\u0026\u2019@#\/%?=()~_|!:,.;]*[\-A-Z0-9+\u0026@#\/%=~()_|])/gi;if(!(0<a.length))return this.replace(e,"$1<a href='$2'>$2</a>");d=a[0];f=function(){var c;c=[];for(b in d)g=d[b],"callback"!==b&&c.push(" "+b+"='"+g+"'");return c}().join("");return this.replace(e,function(c,b,a){c=("function"===typeof d.callback?d.callback(a):void 0)||"<a href='"+
|
(function(){var h=[].slice;String.prototype.autoLink=function(){var b,f,d,a,e,g;a=1<=arguments.length?h.call(arguments,0):[];e=/(^|[\s\n]|<[A-Za-z]*\/?>)((?:https?|ftp):\/\/[\-A-Z0-9+\u0026\u2019@#\/%?=()~_|!:,.;]*[\-A-Z0-9+\u0026@#\/%=~()_|])/gi;if(!(0<a.length))return this.replace(e,"$1<a href='$2'>$2</a>");d=a[0];f=function(){var c;c=[];for(b in d)g=d[b],"callback"!==b&&c.push(" "+b+"='"+g+"'");return c}().join("");return this.replace(e,function(c,b,a){c=("function"===typeof d.callback?d.callback(a):
|
||||||
a+"'"+f+">"+a+"</a>";return""+b+c})}}).call(this);
|
void 0)||"<a href='"+a+"'"+f+">"+a+"</a>";return""+b+c})}}).call(this);
|
||||||
;
|
;
|
||||||
/* ========================================================================
|
/* ========================================================================
|
||||||
* Bootstrap: affix.js v3.3.6
|
* Bootstrap: affix.js v3.3.7
|
||||||
* http://getbootstrap.com/javascript/#affix
|
* http://getbootstrap.com/javascript/#affix
|
||||||
* ========================================================================
|
* ========================================================================
|
||||||
* Copyright 2011-2015 Twitter, Inc.
|
* Copyright 2011-2016 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
@ -15761,7 +15853,7 @@ a+"'"+f+">"+a+"</a>";return""+b+c})}}).call(this);
|
|||||||
this.checkPosition()
|
this.checkPosition()
|
||||||
}
|
}
|
||||||
|
|
||||||
Affix.VERSION = '3.3.6'
|
Affix.VERSION = '3.3.7'
|
||||||
|
|
||||||
Affix.RESET = 'affix affix-top affix-bottom'
|
Affix.RESET = 'affix affix-top affix-bottom'
|
||||||
|
|
||||||
@ -15895,10 +15987,10 @@ a+"'"+f+">"+a+"</a>";return""+b+c})}}).call(this);
|
|||||||
}(jQuery);
|
}(jQuery);
|
||||||
;
|
;
|
||||||
/* ========================================================================
|
/* ========================================================================
|
||||||
* Bootstrap: dropdown.js v3.3.6
|
* Bootstrap: dropdown.js v3.3.7
|
||||||
* http://getbootstrap.com/javascript/#dropdowns
|
* http://getbootstrap.com/javascript/#dropdowns
|
||||||
* ========================================================================
|
* ========================================================================
|
||||||
* Copyright 2011-2015 Twitter, Inc.
|
* Copyright 2011-2016 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
@ -15915,7 +16007,7 @@ a+"'"+f+">"+a+"</a>";return""+b+c})}}).call(this);
|
|||||||
$(element).on('click.bs.dropdown', this.toggle)
|
$(element).on('click.bs.dropdown', this.toggle)
|
||||||
}
|
}
|
||||||
|
|
||||||
Dropdown.VERSION = '3.3.6'
|
Dropdown.VERSION = '3.3.7'
|
||||||
|
|
||||||
function getParent($this) {
|
function getParent($this) {
|
||||||
var selector = $this.attr('data-target')
|
var selector = $this.attr('data-target')
|
||||||
@ -16061,10 +16153,10 @@ a+"'"+f+">"+a+"</a>";return""+b+c})}}).call(this);
|
|||||||
}(jQuery);
|
}(jQuery);
|
||||||
;
|
;
|
||||||
/* ========================================================================
|
/* ========================================================================
|
||||||
* Bootstrap: modal.js v3.3.6
|
* Bootstrap: modal.js v3.3.7
|
||||||
* http://getbootstrap.com/javascript/#modals
|
* http://getbootstrap.com/javascript/#modals
|
||||||
* ========================================================================
|
* ========================================================================
|
||||||
* Copyright 2011-2015 Twitter, Inc.
|
* Copyright 2011-2016 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
@ -16095,7 +16187,7 @@ a+"'"+f+">"+a+"</a>";return""+b+c})}}).call(this);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Modal.VERSION = '3.3.6'
|
Modal.VERSION = '3.3.7'
|
||||||
|
|
||||||
Modal.TRANSITION_DURATION = 300
|
Modal.TRANSITION_DURATION = 300
|
||||||
Modal.BACKDROP_TRANSITION_DURATION = 150
|
Modal.BACKDROP_TRANSITION_DURATION = 150
|
||||||
@ -16202,7 +16294,9 @@ a+"'"+f+">"+a+"</a>";return""+b+c})}}).call(this);
|
|||||||
$(document)
|
$(document)
|
||||||
.off('focusin.bs.modal') // guard against infinite focus loop
|
.off('focusin.bs.modal') // guard against infinite focus loop
|
||||||
.on('focusin.bs.modal', $.proxy(function (e) {
|
.on('focusin.bs.modal', $.proxy(function (e) {
|
||||||
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
|
if (document !== e.target &&
|
||||||
|
this.$element[0] !== e.target &&
|
||||||
|
!this.$element.has(e.target).length) {
|
||||||
this.$element.trigger('focus')
|
this.$element.trigger('focus')
|
||||||
}
|
}
|
||||||
}, this))
|
}, this))
|
||||||
@ -16399,11 +16493,11 @@ a+"'"+f+">"+a+"</a>";return""+b+c})}}).call(this);
|
|||||||
}(jQuery);
|
}(jQuery);
|
||||||
;
|
;
|
||||||
/* ========================================================================
|
/* ========================================================================
|
||||||
* Bootstrap: tooltip.js v3.3.6
|
* Bootstrap: tooltip.js v3.3.7
|
||||||
* http://getbootstrap.com/javascript/#tooltip
|
* http://getbootstrap.com/javascript/#tooltip
|
||||||
* Inspired by the original jQuery.tipsy by Jason Frame
|
* Inspired by the original jQuery.tipsy by Jason Frame
|
||||||
* ========================================================================
|
* ========================================================================
|
||||||
* Copyright 2011-2015 Twitter, Inc.
|
* Copyright 2011-2016 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
@ -16426,7 +16520,7 @@ a+"'"+f+">"+a+"</a>";return""+b+c})}}).call(this);
|
|||||||
this.init('tooltip', element, options)
|
this.init('tooltip', element, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
Tooltip.VERSION = '3.3.6'
|
Tooltip.VERSION = '3.3.7'
|
||||||
|
|
||||||
Tooltip.TRANSITION_DURATION = 150
|
Tooltip.TRANSITION_DURATION = 150
|
||||||
|
|
||||||
@ -16717,9 +16811,11 @@ a+"'"+f+">"+a+"</a>";return""+b+c})}}).call(this);
|
|||||||
|
|
||||||
function complete() {
|
function complete() {
|
||||||
if (that.hoverState != 'in') $tip.detach()
|
if (that.hoverState != 'in') $tip.detach()
|
||||||
that.$element
|
if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary.
|
||||||
.removeAttr('aria-describedby')
|
that.$element
|
||||||
.trigger('hidden.bs.' + that.type)
|
.removeAttr('aria-describedby')
|
||||||
|
.trigger('hidden.bs.' + that.type)
|
||||||
|
}
|
||||||
callback && callback()
|
callback && callback()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16762,7 +16858,10 @@ a+"'"+f+">"+a+"</a>";return""+b+c})}}).call(this);
|
|||||||
// width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
|
// width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
|
||||||
elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
|
elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
|
||||||
}
|
}
|
||||||
var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
|
var isSvg = window.SVGElement && el instanceof window.SVGElement
|
||||||
|
// Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3.
|
||||||
|
// See https://github.com/twbs/bootstrap/issues/20280
|
||||||
|
var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset())
|
||||||
var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
|
var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
|
||||||
var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
|
var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
|
||||||
|
|
||||||
@ -16878,6 +16977,7 @@ a+"'"+f+">"+a+"</a>";return""+b+c})}}).call(this);
|
|||||||
that.$tip = null
|
that.$tip = null
|
||||||
that.$arrow = null
|
that.$arrow = null
|
||||||
that.$viewport = null
|
that.$viewport = null
|
||||||
|
that.$element = null
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16914,10 +17014,10 @@ a+"'"+f+">"+a+"</a>";return""+b+c})}}).call(this);
|
|||||||
}(jQuery);
|
}(jQuery);
|
||||||
;
|
;
|
||||||
/* ========================================================================
|
/* ========================================================================
|
||||||
* Bootstrap: transition.js v3.3.6
|
* Bootstrap: transition.js v3.3.7
|
||||||
* http://getbootstrap.com/javascript/#transitions
|
* http://getbootstrap.com/javascript/#transitions
|
||||||
* ========================================================================
|
* ========================================================================
|
||||||
* Copyright 2011-2015 Twitter, Inc.
|
* Copyright 2011-2016 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
@ -18620,7 +18720,6 @@ System.register('flarum/Component', [], function (_export, _context) {
|
|||||||
* @param {Array|Object} children
|
* @param {Array|Object} children
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function Component() {
|
function Component() {
|
||||||
var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
||||||
var children = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
|
var children = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
|
||||||
@ -28087,88 +28186,87 @@ System.register('flarum/components/WelcomeHero', ['flarum/Component', 'flarum/co
|
|||||||
System.register("flarum/extend", [], function (_export, _context) {
|
System.register("flarum/extend", [], function (_export, _context) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extend an object's method by running its output through a mutating callback
|
||||||
|
* every time it is called.
|
||||||
|
*
|
||||||
|
* The callback accepts the method's return value and should perform any
|
||||||
|
* mutations directly on this value. For this reason, this function will not be
|
||||||
|
* effective on methods which return scalar values (numbers, strings, booleans).
|
||||||
|
*
|
||||||
|
* Care should be taken to extend the correct object – in most cases, a class'
|
||||||
|
* prototype will be the desired target of extension, not the class itself.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* extend(Discussion.prototype, 'badges', function(badges) {
|
||||||
|
* // do something with `badges`
|
||||||
|
* });
|
||||||
|
*
|
||||||
|
* @param {Object} object The object that owns the method
|
||||||
|
* @param {String} method The name of the method to extend
|
||||||
|
* @param {function} callback A callback which mutates the method's output
|
||||||
|
*/
|
||||||
|
function extend(object, method, callback) {
|
||||||
|
var original = object[method];
|
||||||
|
|
||||||
|
object[method] = function () {
|
||||||
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||||
|
args[_key] = arguments[_key];
|
||||||
|
}
|
||||||
|
|
||||||
|
var value = original ? original.apply(this, args) : undefined;
|
||||||
|
|
||||||
|
callback.apply(this, [value].concat(args));
|
||||||
|
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
|
||||||
|
babelHelpers.extends(object[method], original);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override an object's method by replacing it with a new function, so that the
|
||||||
|
* new function will be run every time the object's method is called.
|
||||||
|
*
|
||||||
|
* The replacement function accepts the original method as its first argument,
|
||||||
|
* which is like a call to 'super'. Any arguments passed to the original method
|
||||||
|
* are also passed to the replacement.
|
||||||
|
*
|
||||||
|
* Care should be taken to extend the correct object – in most cases, a class'
|
||||||
|
* prototype will be the desired target of extension, not the class itself.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* override(Discussion.prototype, 'badges', function(original) {
|
||||||
|
* const badges = original();
|
||||||
|
* // do something with badges
|
||||||
|
* return badges;
|
||||||
|
* });
|
||||||
|
*
|
||||||
|
* @param {Object} object The object that owns the method
|
||||||
|
* @param {String} method The name of the method to override
|
||||||
|
* @param {function} newMethod The method to replace it with
|
||||||
|
*/
|
||||||
|
|
||||||
|
_export("extend", extend);
|
||||||
|
|
||||||
|
function override(object, method, newMethod) {
|
||||||
|
var original = object[method];
|
||||||
|
|
||||||
|
object[method] = function () {
|
||||||
|
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||||
|
args[_key2] = arguments[_key2];
|
||||||
|
}
|
||||||
|
|
||||||
|
return newMethod.apply(this, [original.bind(this)].concat(args));
|
||||||
|
};
|
||||||
|
|
||||||
|
babelHelpers.extends(object[method], original);
|
||||||
|
}
|
||||||
|
_export("override", override);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
setters: [],
|
setters: [],
|
||||||
execute: function () {
|
execute: function () {}
|
||||||
/**
|
|
||||||
* Extend an object's method by running its output through a mutating callback
|
|
||||||
* every time it is called.
|
|
||||||
*
|
|
||||||
* The callback accepts the method's return value and should perform any
|
|
||||||
* mutations directly on this value. For this reason, this function will not be
|
|
||||||
* effective on methods which return scalar values (numbers, strings, booleans).
|
|
||||||
*
|
|
||||||
* Care should be taken to extend the correct object – in most cases, a class'
|
|
||||||
* prototype will be the desired target of extension, not the class itself.
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* extend(Discussion.prototype, 'badges', function(badges) {
|
|
||||||
* // do something with `badges`
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* @param {Object} object The object that owns the method
|
|
||||||
* @param {String} method The name of the method to extend
|
|
||||||
* @param {function} callback A callback which mutates the method's output
|
|
||||||
*/
|
|
||||||
function extend(object, method, callback) {
|
|
||||||
var original = object[method];
|
|
||||||
|
|
||||||
object[method] = function () {
|
|
||||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
||||||
args[_key] = arguments[_key];
|
|
||||||
}
|
|
||||||
|
|
||||||
var value = original ? original.apply(this, args) : undefined;
|
|
||||||
|
|
||||||
callback.apply(this, [value].concat(args));
|
|
||||||
|
|
||||||
return value;
|
|
||||||
};
|
|
||||||
|
|
||||||
babelHelpers.extends(object[method], original);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Override an object's method by replacing it with a new function, so that the
|
|
||||||
* new function will be run every time the object's method is called.
|
|
||||||
*
|
|
||||||
* The replacement function accepts the original method as its first argument,
|
|
||||||
* which is like a call to 'super'. Any arguments passed to the original method
|
|
||||||
* are also passed to the replacement.
|
|
||||||
*
|
|
||||||
* Care should be taken to extend the correct object – in most cases, a class'
|
|
||||||
* prototype will be the desired target of extension, not the class itself.
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* override(Discussion.prototype, 'badges', function(original) {
|
|
||||||
* const badges = original();
|
|
||||||
* // do something with badges
|
|
||||||
* return badges;
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* @param {Object} object The object that owns the method
|
|
||||||
* @param {String} method The name of the method to override
|
|
||||||
* @param {function} newMethod The method to replace it with
|
|
||||||
*/
|
|
||||||
|
|
||||||
_export("extend", extend);
|
|
||||||
|
|
||||||
function override(object, method, newMethod) {
|
|
||||||
var original = object[method];
|
|
||||||
|
|
||||||
object[method] = function () {
|
|
||||||
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
||||||
args[_key2] = arguments[_key2];
|
|
||||||
}
|
|
||||||
|
|
||||||
return newMethod.apply(this, [original.bind(this)].concat(args));
|
|
||||||
};
|
|
||||||
|
|
||||||
babelHelpers.extends(object[method], original);
|
|
||||||
}
|
|
||||||
|
|
||||||
_export("override", override);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
});;
|
});;
|
||||||
'use strict';
|
'use strict';
|
||||||
@ -28998,7 +29096,6 @@ System.register('flarum/Model', [], function (_export, _context) {
|
|||||||
* @param {Store} store The data store that this model should be persisted to.
|
* @param {Store} store The data store that this model should be persisted to.
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function Model() {
|
function Model() {
|
||||||
var data = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
var data = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
||||||
var store = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
|
var store = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
|
||||||
@ -31495,7 +31592,6 @@ System.register("flarum/utils/ScrollListener", [], function (_export, _context)
|
|||||||
* changes.
|
* changes.
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function ScrollListener(callback) {
|
function ScrollListener(callback) {
|
||||||
babelHelpers.classCallCheck(this, ScrollListener);
|
babelHelpers.classCallCheck(this, ScrollListener);
|
||||||
|
|
||||||
@ -31716,78 +31812,78 @@ System.register('flarum/utils/slidable', [], function (_export, _context) {
|
|||||||
System.register('flarum/utils/string', [], function (_export, _context) {
|
System.register('flarum/utils/string', [], function (_export, _context) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Truncate a string to the given length, appending ellipses if necessary.
|
||||||
|
*
|
||||||
|
* @param {String} string
|
||||||
|
* @param {Number} length
|
||||||
|
* @param {Number} [start=0]
|
||||||
|
* @return {String}
|
||||||
|
*/
|
||||||
|
function truncate(string, length) {
|
||||||
|
var start = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2];
|
||||||
|
|
||||||
|
return (start > 0 ? '...' : '') + string.substring(start, start + length) + (string.length > start + length ? '...' : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a slug out of the given string. Non-alphanumeric characters are
|
||||||
|
* converted to hyphens.
|
||||||
|
*
|
||||||
|
* @param {String} string
|
||||||
|
* @return {String}
|
||||||
|
*/
|
||||||
|
|
||||||
|
_export('truncate', truncate);
|
||||||
|
|
||||||
|
function slug(string) {
|
||||||
|
return string.toLowerCase().replace(/[^a-z0-9]/gi, '-').replace(/-+/g, '-').replace(/-$|^-/g, '') || '-';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Strip HTML tags and quotes out of the given string, replacing them with
|
||||||
|
* meaningful punctuation.
|
||||||
|
*
|
||||||
|
* @param {String} string
|
||||||
|
* @return {String}
|
||||||
|
*/
|
||||||
|
|
||||||
|
_export('slug', slug);
|
||||||
|
|
||||||
|
function getPlainContent(string) {
|
||||||
|
var html = string.replace(/(<\/p>|<br>)/g, '$1 ').replace(/<img\b[^>]*>/ig, ' ');
|
||||||
|
|
||||||
|
var dom = $('<div/>').html(html);
|
||||||
|
|
||||||
|
dom.find(getPlainContent.removeSelectors.join(',')).remove();
|
||||||
|
|
||||||
|
return dom.text().replace(/\s+/g, ' ').trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An array of DOM selectors to remove when getting plain content.
|
||||||
|
*
|
||||||
|
* @type {Array}
|
||||||
|
*/
|
||||||
|
|
||||||
|
_export('getPlainContent', getPlainContent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make a string's first character uppercase.
|
||||||
|
*
|
||||||
|
* @param {String} string
|
||||||
|
* @return {String}
|
||||||
|
*/
|
||||||
|
function ucfirst(string) {
|
||||||
|
return string.substr(0, 1).toUpperCase() + string.substr(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
_export('ucfirst', ucfirst);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
setters: [],
|
setters: [],
|
||||||
execute: function () {
|
execute: function () {
|
||||||
/**
|
|
||||||
* Truncate a string to the given length, appending ellipses if necessary.
|
|
||||||
*
|
|
||||||
* @param {String} string
|
|
||||||
* @param {Number} length
|
|
||||||
* @param {Number} [start=0]
|
|
||||||
* @return {String}
|
|
||||||
*/
|
|
||||||
function truncate(string, length) {
|
|
||||||
var start = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2];
|
|
||||||
|
|
||||||
return (start > 0 ? '...' : '') + string.substring(start, start + length) + (string.length > start + length ? '...' : '');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a slug out of the given string. Non-alphanumeric characters are
|
|
||||||
* converted to hyphens.
|
|
||||||
*
|
|
||||||
* @param {String} string
|
|
||||||
* @return {String}
|
|
||||||
*/
|
|
||||||
|
|
||||||
_export('truncate', truncate);
|
|
||||||
|
|
||||||
function slug(string) {
|
|
||||||
return string.toLowerCase().replace(/[^a-z0-9]/gi, '-').replace(/-+/g, '-').replace(/-$|^-/g, '') || '-';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Strip HTML tags and quotes out of the given string, replacing them with
|
|
||||||
* meaningful punctuation.
|
|
||||||
*
|
|
||||||
* @param {String} string
|
|
||||||
* @return {String}
|
|
||||||
*/
|
|
||||||
|
|
||||||
_export('slug', slug);
|
|
||||||
|
|
||||||
function getPlainContent(string) {
|
|
||||||
var html = string.replace(/(<\/p>|<br>)/g, '$1 ').replace(/<img\b[^>]*>/ig, ' ');
|
|
||||||
|
|
||||||
var dom = $('<div/>').html(html);
|
|
||||||
|
|
||||||
dom.find(getPlainContent.removeSelectors.join(',')).remove();
|
|
||||||
|
|
||||||
return dom.text().replace(/\s+/g, ' ').trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An array of DOM selectors to remove when getting plain content.
|
|
||||||
*
|
|
||||||
* @type {Array}
|
|
||||||
*/
|
|
||||||
|
|
||||||
_export('getPlainContent', getPlainContent);
|
|
||||||
|
|
||||||
getPlainContent.removeSelectors = ['blockquote', 'script'];
|
getPlainContent.removeSelectors = ['blockquote', 'script'];
|
||||||
|
|
||||||
/**
|
|
||||||
* Make a string's first character uppercase.
|
|
||||||
*
|
|
||||||
* @param {String} string
|
|
||||||
* @return {String}
|
|
||||||
*/
|
|
||||||
function ucfirst(string) {
|
|
||||||
return string.substr(0, 1).toUpperCase() + string.substr(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
_export('ucfirst', ucfirst);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});;
|
});;
|
||||||
@ -31872,7 +31968,6 @@ System.register('flarum/utils/SubtreeRetainer', [], function (_export, _context)
|
|||||||
/**
|
/**
|
||||||
* @param {...callbacks} callbacks Functions returning data to keep track of.
|
* @param {...callbacks} callbacks Functions returning data to keep track of.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function SubtreeRetainer() {
|
function SubtreeRetainer() {
|
||||||
babelHelpers.classCallCheck(this, SubtreeRetainer);
|
babelHelpers.classCallCheck(this, SubtreeRetainer);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user