[Manual] Add scripts and raw wiki

This commit is contained in:
2023-02-28 12:07:24 +01:00
parent d29725b74a
commit 5320dc75f0
1482 changed files with 27397 additions and 3932 deletions

View File

@ -0,0 +1,34 @@
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
enables js via <<script>> and disables with <<script 0>>
Modified from original to add ability to exec scripts with a script="" param
*/
exports.name = "script";
exports.params = [
{name: "run"},
{name: "script"},
];
/*
Run the macro
*/
exports.run = function(run, script) {
var off = run ? run.toLowerCase() : false;
if(off && ["0","no","off","false"].indexOf(off) > -1) {
$tw.config.htmlUnsafeElements = ["script"];
} else {
$tw.config.htmlUnsafeElements = [];
if (script) {
eval(script);
}
}
return "";
};
})();