reordered plugins: first list encodings, then decodings

This commit is contained in:
Manuel Friedli 2015-03-26 22:25:01 +01:00
parent feb7939488
commit 7d2cdac227
1 changed files with 38 additions and 38 deletions

View File

@ -12,7 +12,7 @@
},
{
"id": "base64encode",
"name": "Base64 encode",
"name": "Encode Base64",
"convert": function (input) {
return {
"status": "OK",
@ -20,9 +20,45 @@
};
}
},
{
"id": "encodeuri",
"name": "Encode URI",
"convert": function (input) {
return {
"status": "OK",
"content": encodeURI(input).replace(/%5B/g, '[').replace(/%5D/g, ']')
};
}
},
{
"id": "encodeuricomponent",
"name": "Encode URI component",
"convert": function (input) {
return {
"status": "OK",
"content": encodeURIComponent(input).replace(/[!'()*]/g, function(c) {
return '%' + c.charCodeAt(0).toString(16);
})
};
}
},
{
"id": "encodehtmlentities",
"name": "Encode HTML entities",
"convert": function (input) {
return {
"status": "OK",
"content": input
.replace(/\&/g, "&")
.replace(/\</g, "&lt;")
.replace(/\>/g, "&gt;")
.replace(/\"/g, "&quot;")
};
}
},
{
"id": "base64decode",
"name": "Base64 decode",
"name": "Decode Base64",
"convert": function (input) {
try {
return {
@ -37,16 +73,6 @@
}
}
},
{
"id": "encodeuri",
"name": "Encode URI",
"convert": function (input) {
return {
"status": "OK",
"content": encodeURI(input).replace(/%5B/g, '[').replace(/%5D/g, ']')
};
}
},
{
"id": "decodeuri",
"name": "Decode URI",
@ -64,18 +90,6 @@
}
}
},
{
"id": "encodeuricomponent",
"name": "Encode URI component",
"convert": function (input) {
return {
"status": "OK",
"content": encodeURIComponent(input).replace(/[!'()*]/g, function(c) {
return '%' + c.charCodeAt(0).toString(16);
})
};
}
},
{
"id": "decodeuricomponent",
"name": "Decode URI component",
@ -93,20 +107,6 @@
}
}
},
{
"id": "encodehtmlentities",
"name": "Encode HTML entities",
"convert": function (input) {
return {
"status": "OK",
"content": input
.replace(/\&/g, "&amp;")
.replace(/\</g, "&lt;")
.replace(/\>/g, "&gt;")
.replace(/\"/g, "&quot;")
};
}
},
{
"id": "decodehtmlentities",
"name": "Decode HTML entities",