Update Userscript
This commit is contained in:
1 parent
07fc4b3728
commit
fb7dbd5716
2 files changed
+7
-4
No files matched your search
@@ -15,7 +15,7 @@ log = CPLog(__name__)
|
|||||||
|
|
||||||
class Userscript(Plugin):
|
class Userscript(Plugin):
|
||||||
|
|
||||||
version = 4
|
version = 5
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
addApiView('userscript.get/(.*)/(.*)', self.getUserScript, static = True)
|
addApiView('userscript.get/(.*)/(.*)', self.getUserScript, static = True)
|
||||||
|
|||||||
@@ -25,13 +25,16 @@ var version = {{version}},
|
|||||||
host = '{{host}}',
|
host = '{{host}}',
|
||||||
api = '{{api}}';
|
api = '{{api}}';
|
||||||
|
|
||||||
function create() {
|
var create = function() {
|
||||||
|
var A, B;
|
||||||
switch (arguments.length) {
|
switch (arguments.length) {
|
||||||
case 1:
|
case 1:
|
||||||
var A = document.createTextNode(arguments[0]);
|
A = document.createTextNode(arguments[0]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
var A = document.createElement(arguments[0]), B = arguments[1];
|
A = document.createElement(arguments[0]);
|
||||||
|
B = arguments[1];
|
||||||
|
|
||||||
for ( var b in B) {
|
for ( var b in B) {
|
||||||
if (b.indexOf("on") == 0){
|
if (b.indexOf("on") == 0){
|
||||||
A.addEventListener(b.substring(2), B[b], false);
|
A.addEventListener(b.substring(2), B[b], false);
|
||||||
|
|||||||
Reference in new issue
Block a user