iconfont_iOS

icon font unicode for iOS

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        iconfont_iOS
// @description icon font unicode for iOS
// @namespace   https://github.com/chenshengzhi
// @include     *www.iconfont.cn/*
// @version     0.0.1
// @require     http://cdn.staticfile.org/jquery/2.1.1/jquery.min.js
// @grant       none
// ==/UserScript==

var btn = document.createElement("input");
btn.type = "button";
btn.value = "iOS";
btn.style.position = 'fixed';
var top = '30px';
btn.style.top = top;
btn.style.right = '30px';
btn.style.width = '60px';
btn.style.height = '60px';
btn.style.backgroundColor = '#208F72';
btn.style.borderStyle = 'none';
btn.style.borderRadius = '30px';
btn.style.color = 'white';
btn.style.fontSize = '16px';
btn.onclick = function (){
    var lists = $("ul.font-lists").children("li").children(".unicode");
    lists.each(function(){
        var normalUnicode = $(this).html().replace("&", '&');
        console.log(normalUnicode);
        var index = normalUnicode.indexOf("#x") + 2;
        var temp = normalUnicode.substr(index);
        temp = temp.substr(0, temp.length-1);
        for (var i = temp.length; i < 8; i = temp.length) {
            temp = '0' + temp;
        }
        var newUnicode = "\\U" + temp;
        console.log(newUnicode);
        $(this).html(newUnicode);
    });

    var lists = $("ul.font-lists").children("li");
    lists.each(function(){
        var unicode = $(this).children(".unicode").html();
        $(this).children(".name").attr("data-clipboard-text", unicode);
    });
};
document.body.appendChild(btn);