correct exporting
This commit is contained in:
parent
ea98f9361e
commit
6ce344c267
1 changed files with 12 additions and 25 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
* @param {Ultraviolet} ctx
|
* @param {Ultraviolet} ctx
|
||||||
*/
|
*/
|
||||||
function attributes(ctx, meta = ctx.meta) {
|
export function attributes(ctx, meta = ctx.meta) {
|
||||||
const { html, js, attributePrefix } = ctx;
|
const { html, js, attributePrefix } = ctx;
|
||||||
const origPrefix = attributePrefix + '-attr-';
|
const origPrefix = attributePrefix + '-attr-';
|
||||||
|
|
||||||
|
|
@ -80,7 +80,7 @@ function attributes(ctx, meta = ctx.meta) {
|
||||||
*
|
*
|
||||||
* @param {Ultraviolet} ctx
|
* @param {Ultraviolet} ctx
|
||||||
*/
|
*/
|
||||||
function text(ctx) {
|
export function text(ctx) {
|
||||||
const { html, js, css } = ctx;
|
const { html, js, css } = ctx;
|
||||||
|
|
||||||
html.on('text', (text, type) => {
|
html.on('text', (text, type) => {
|
||||||
|
|
@ -101,7 +101,7 @@ function text(ctx) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isUrl(name, tag) {
|
export function isUrl(name, tag) {
|
||||||
return (
|
return (
|
||||||
(tag === 'object' && name === 'data') ||
|
(tag === 'object' && name === 'data') ||
|
||||||
[
|
[
|
||||||
|
|
@ -116,7 +116,8 @@ function isUrl(name, tag) {
|
||||||
].indexOf(name) > -1
|
].indexOf(name) > -1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
function isEvent(name) {
|
|
||||||
|
export function isEvent(name) {
|
||||||
return (
|
return (
|
||||||
[
|
[
|
||||||
'onafterprint',
|
'onafterprint',
|
||||||
|
|
@ -196,7 +197,7 @@ function isEvent(name) {
|
||||||
*
|
*
|
||||||
* @param {Ultraviolet} ctx
|
* @param {Ultraviolet} ctx
|
||||||
*/
|
*/
|
||||||
function injectHead(ctx) {
|
export function injectHead(ctx) {
|
||||||
const { html } = ctx;
|
const { html } = ctx;
|
||||||
html.on('element', (element, type) => {
|
html.on('element', (element, type) => {
|
||||||
if (type !== 'rewrite') return false;
|
if (type !== 'rewrite') return false;
|
||||||
|
|
@ -207,7 +208,7 @@ function injectHead(ctx) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createJsInject(
|
export function createJsInject(
|
||||||
bareURL = '',
|
bareURL = '',
|
||||||
bareData = {},
|
bareData = {},
|
||||||
cookies = '',
|
cookies = '',
|
||||||
|
|
@ -221,7 +222,7 @@ function createJsInject(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function createHtmlInject(
|
export function createHtmlInject(
|
||||||
handlerScript,
|
handlerScript,
|
||||||
bundleScript,
|
bundleScript,
|
||||||
clientScript,
|
clientScript,
|
||||||
|
|
@ -305,7 +306,7 @@ function createHtmlInject(
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function isForbidden(name) {
|
export function isForbidden(name) {
|
||||||
return (
|
return (
|
||||||
['http-equiv', 'integrity', 'sandbox', 'nonce', 'crossorigin'].indexOf(
|
['http-equiv', 'integrity', 'sandbox', 'nonce', 'crossorigin'].indexOf(
|
||||||
name
|
name
|
||||||
|
|
@ -313,28 +314,14 @@ function isForbidden(name) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function isHtml(name) {
|
export function isHtml(name) {
|
||||||
return name === 'srcdoc';
|
return name === 'srcdoc';
|
||||||
}
|
}
|
||||||
|
|
||||||
function isStyle(name) {
|
export function isStyle(name) {
|
||||||
return name === 'style';
|
return name === 'style';
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSrcset(name) {
|
export function isSrcset(name) {
|
||||||
return name === 'srcset' || name === 'imagesrcset';
|
return name === 'srcset' || name === 'imagesrcset';
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
|
||||||
attributes,
|
|
||||||
createHtmlInject,
|
|
||||||
createJsInject,
|
|
||||||
text,
|
|
||||||
isUrl,
|
|
||||||
isEvent,
|
|
||||||
isForbidden,
|
|
||||||
isHtml,
|
|
||||||
isStyle,
|
|
||||||
isSrcset,
|
|
||||||
injectHead,
|
|
||||||
};
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue