This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Lanhu TW | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://lanhuapp.com/web/ | |
// @icon https://lhcdn.lanhuapp.com/web/static/favicon.ico?v=2 | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = [ | |
{ | |
id: 2, | |
name: 'c', | |
parent: 0 | |
}, | |
{ | |
id: 3, | |
name: 'd', | |
parent: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toUnicode(str) { | |
return str.split('').map(function (value, index, array) { | |
var temp = value.charCodeAt(0).toString(16).toUpperCase(); | |
if (temp.length > 2) { | |
return '\\u' + temp; | |
} | |
return value; | |
}).join(''); | |
} |