Last active
April 25, 2018 10:04
-
-
Save tan9/47cc80472fc6c62cace96dfe9dfa669b to your computer and use it in GitHub Desktop.
This file contains hidden or 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 medulla | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @match http://localhost:16501/* | |
// @match http://localhost:16502/* | |
// @match http://localhost:16503/* | |
// @match http://localhost:16504/* | |
// @match http://localhost:16505/* | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
$('[bgcolor]').removeAttr('bgcolor'); | |
$('input[type=button][style]').removeAttr('style'); | |
$('head').append('<link rel="stylesheet" href="/Resource/ASPortalStyle.css">'); | |
$('head').append('<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.10/css/all.css" integrity="sha384-+d0P83n9kaQMCwj8F4RJB66tzIwOKmrdb46+porD/OvrJ+37WqIM7UoBtwHO6Nlg" crossorigin="anonymous">'); | |
$('head').append('<style>i.fas { color: #666; padding: 0 2px; }</style>'); | |
let imageToFontAwesome = { | |
'/Resource/css/icons/records.png': 'file', | |
'/Resource/images/attachment.gif': 'paperclip', | |
'/Resource/images/accountitem.gif': 'user', | |
'/Resource/images/add.gif': 'plus', | |
'/Resource/images/addform.gif': 'plus-square', | |
'/Resource/images/alert.jpg': 'exclamation-triangle', | |
'/Resource/images/btn_add.png': 'plus', | |
'/Resource/images/btn_delete.png': 'trash', | |
'/Resource/images/btn_set.png': 'cog', | |
'/Resource/images/cal.gif': 'calendar-alt', | |
'/Resource/images/calSelect.gif': 'calendar-alt', | |
'/Resource/images/caseiditem.gif': 'address-card', | |
'/Resource/images/contactfolder.gif': 'folder-open', | |
'/Resource/images/cross.gif': 'times', | |
'/Resource/images/delete.gif': 'times', | |
'/Resource/images/edit.gif': 'edit', | |
'/Resource/images/folder.gif': 'folder', | |
'/Resource/images/groupicon.gif': 'users', | |
'/Resource/images/imeiitem.gif': 'mobile', | |
'/Resource/images/info.gif': 'info-circle', | |
'/Resource/images/larrow.gif': 'backward', | |
'/Resource/images/mailbox1.gif': 'bookmark', | |
'/Resource/images/menu.gif': 'book', | |
'/Resource/images/modify.gif': 'edit', | |
'/Resource/images/new.gif': 'fire', | |
'/Resource/images/posticon.gif': 'file-alt', | |
'/Resource/images/print.gif': 'print', | |
'/Resource/images/rarrow.gif': 'forward', | |
'/Resource/images/refresh.gif': 'sync-alt', | |
'/Resource/images/showall.gif': 'address-book', | |
'/Resource/images/sticky.gif': 'thumbtack', | |
'/Resource/images/telitem.gif': 'phone', | |
'/Resource/images/trash.gif': 'trash', | |
'/Resource/images/user.gif': 'user', | |
'/Resource/images/voiceitem.gif': 'volume-up', | |
}; | |
let replaceIcon = () => { | |
Object.keys(imageToFontAwesome) | |
.forEach((key) => { | |
$(`img[src='${key}']:visible`).each((i, img) => { | |
$(img).after(`<i class="fas fa-${imageToFontAwesome[key]}" title="${img.title}">`); | |
$(img).css('display', 'none'); | |
}); | |
}); | |
}; | |
replaceIcon(); | |
setInterval(() => { | |
replaceIcon(); | |
}, 500); | |
$('#msgBoxDiv').hide(); | |
$('#changeBoxDiv').hide(); | |
$('#selectTipDiv').hide(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment