@andatoshiki/toshiki-cdn
Version:
Toshiki's own CDN packages
1,030 lines (1,029 loc) • 28 kB
JavaScript
/* A polyfill for browsers that don't support ligatures. */
/* The script tag referring to this file must be placed before the ending body tag. */
/* To provide support for elements dynamically added, this script adds
method 'icomoonLiga' to the window object. You can pass element references to this method.
*/
(function () {
'use strict';
function supportsProperty(p) {
var prefixes = ['Webkit', 'Moz', 'O', 'ms'],
i,
div = document.createElement('div'),
ret = p in div.style;
if (!ret) {
p = p.charAt(0).toUpperCase() + p.substr(1);
for (i = 0; i < prefixes.length; i += 1) {
ret = prefixes[i] + p in div.style;
if (ret) {
break;
}
}
}
return ret;
}
var icons;
if (!supportsProperty('fontFeatureSettings')) {
icons = {
'home': '',
'house': '',
'home2': '',
'house2': '',
'home3': '',
'house3': '',
'office': '',
'buildings': '',
'newspaper': '',
'news': '',
'pencil': '',
'write': '',
'pencil2': '',
'write2': '',
'quill': '',
'feather': '',
'pen': '',
'write3': '',
'blog': '',
'pen2': '',
'eyedropper': '',
'color': '',
'droplet': '',
'color2': '',
'paint-format': '',
'format': '',
'image': '',
'picture': '',
'images': '',
'pictures': '',
'camera': '',
'photo': '',
'headphones': '',
'headset': '',
'music': '',
'song': '',
'play': '',
'video': '',
'film': '',
'video2': '',
'video-camera': '',
'video3': '',
'dice': '',
'game': '',
'pacman': '',
'game2': '',
'spades': '',
'cards': '',
'clubs': '',
'cards2': '',
'diamonds': '',
'cards3': '',
'bullhorn': '',
'megaphone': '',
'connection': '',
'wifi': '',
'podcast': '',
'broadcast': '',
'feed': '',
'wave': '',
'mic': '',
'microphone': '',
'book': '',
'read': '',
'books': '',
'library': '',
'library2': '',
'bank': '',
'file-text': '',
'file': '',
'profile': '',
'file2': '',
'file-empty': '',
'file3': '',
'files-empty': '',
'files': '',
'file-text2': '',
'file4': '',
'file-picture': '',
'file5': '',
'file-music': '',
'file6': '',
'file-play': '',
'file7': '',
'file-video': '',
'file8': '',
'file-zip': '',
'file9': '',
'copy': '',
'duplicate': '',
'paste': '',
'clipboard-file': '',
'stack': '',
'layers': '',
'folder': '',
'directory': '',
'folder-open': '',
'directory2': '',
'folder-plus': '',
'directory3': '',
'folder-minus': '',
'directory4': '',
'folder-download': '',
'directory5': '',
'folder-upload': '',
'directory6': '',
'price-tag': '',
'price-tags': '',
'barcode': '',
'qrcode': '',
'ticket': '',
'theater': '',
'cart': '',
'purchase': '',
'coin-dollar': '',
'money': '',
'coin-euro': '',
'money2': '',
'coin-pound': '',
'money3': '',
'coin-yen': '',
'money4': '',
'credit-card': '',
'money5': '',
'calculator': '',
'compute': '',
'lifebuoy': '',
'support': '',
'phone': '',
'telephone': '',
'phone-hang-up': '',
'telephone2': '',
'address-book': '',
'contact': '',
'envelop': '',
'mail': '',
'pushpin': '',
'pin': '',
'location': '',
'map-marker': '',
'location2': '',
'map-marker2': '',
'compass': '',
'direction': '',
'compass2': '',
'direction2': '',
'map': '',
'guide': '',
'map2': '',
'guide2': '',
'history': '',
'time': '',
'clock': '',
'time2': '',
'clock2': '',
'time3': '',
'alarm': '',
'time4': '',
'bell': '',
'alarm2': '',
'stopwatch': '',
'time5': '',
'calendar': '',
'date': '',
'printer': '',
'print': '',
'keyboard': '',
'typing': '',
'display': '',
'screen': '',
'laptop': '',
'computer': '',
'mobile': '',
'cell-phone': '',
'mobile2': '',
'cell-phone2': '',
'tablet': '',
'mobile3': '',
'tv': '',
'television': '',
'drawer': '',
'box': '',
'drawer2': '',
'box2': '',
'box-add': '',
'box3': '',
'box-remove': '',
'box4': '',
'download': '',
'save': '',
'upload': '',
'load': '',
'floppy-disk': '',
'save2': '',
'drive': '',
'save3': '',
'database': '',
'db': '',
'undo': '',
'ccw': '',
'redo': '',
'cw': '',
'undo2': '',
'left': '',
'redo2': '',
'right': '',
'forward': '',
'right2': '',
'reply': '',
'left2': '',
'bubble': '',
'comment': '',
'bubbles': '',
'comments': '',
'bubbles2': '',
'comments2': '',
'bubble2': '',
'comment2': '',
'bubbles3': '',
'comments3': '',
'bubbles4': '',
'comments4': '',
'user': '',
'profile2': '',
'users': '',
'group': '',
'user-plus': '',
'user2': '',
'user-minus': '',
'user3': '',
'user-check': '',
'user4': '',
'user-tie': '',
'user5': '',
'quotes-left': '',
'ldquo': '',
'quotes-right': '',
'rdquo': '',
'hour-glass': '',
'loading': '',
'spinner': '',
'loading2': '',
'spinner2': '',
'loading3': '',
'spinner3': '',
'loading4': '',
'spinner4': '',
'loading5': '',
'spinner5': '',
'loading6': '',
'spinner6': '',
'loading7': '',
'spinner7': '',
'loading8': '',
'spinner8': '',
'loading9': '',
'spinner9': '',
'loading10': '',
'spinner10': '',
'loading11': '',
'spinner11': '',
'loading12': '',
'binoculars': '',
'lookup': '',
'search': '',
'magnifier': '',
'zoom-in': '',
'magnifier2': '',
'zoom-out': '',
'magnifier3': '',
'enlarge': '',
'expand': '',
'shrink': '',
'collapse': '',
'enlarge2': '',
'expand2': '',
'shrink2': '',
'collapse2': '',
'key': '',
'password': '',
'key2': '',
'password2': '',
'lock': '',
'secure': '',
'unlocked': '',
'lock-open': '',
'wrench': '',
'tool': '',
'equalizer': '',
'sliders': '',
'equalizer2': '',
'sliders2': '',
'cog': '',
'gear': '',
'cogs': '',
'gears': '',
'hammer': '',
'tool2': '',
'magic-wand': '',
'wizard': '',
'aid-kit': '',
'health': '',
'bug': '',
'virus': '',
'pie-chart': '',
'stats': '',
'stats-dots': '',
'stats2': '',
'stats-bars': '',
'stats3': '',
'stats-bars2': '',
'stats4': '',
'trophy': '',
'cup': '',
'gift': '',
'present': '',
'glass': '',
'drink': '',
'glass2': '',
'drink2': '',
'mug': '',
'drink3': '',
'spoon-knife': '',
'food': '',
'leaf': '',
'nature': '',
'rocket': '',
'jet': '',
'meter': '',
'gauge': '',
'meter2': '',
'gauge2': '',
'hammer2': '',
'gavel': '',
'fire': '',
'flame': '',
'lab': '',
'beta': '',
'magnet': '',
'attract': '',
'bin': '',
'trashcan': '',
'bin2': '',
'trashcan2': '',
'briefcase': '',
'portfolio': '',
'airplane': '',
'travel': '',
'truck': '',
'transit': '',
'road': '',
'asphalt': '',
'accessibility': '',
'target': '',
'goal': '',
'shield': '',
'security': '',
'power': '',
'lightning': '',
'switch': '',
'power-cord': '',
'plugin': '',
'clipboard': '',
'board': '',
'list-numbered': '',
'options': '',
'list': '',
'todo': '',
'list2': '',
'todo2': '',
'tree': '',
'branches': '',
'menu': '',
'list3': '',
'menu2': '',
'options2': '',
'menu3': '',
'options3': '',
'menu4': '',
'options4': '',
'cloud': '',
'weather': '',
'cloud-download': '',
'cloud2': '',
'cloud-upload': '',
'cloud3': '',
'cloud-check': '',
'cloud4': '',
'download2': '',
'save4': '',
'upload2': '',
'load2': '',
'download3': '',
'save5': '',
'upload3': '',
'load3': '',
'sphere': '',
'globe': '',
'earth': '',
'globe2': '',
'link': '',
'chain': '',
'flag': '',
'report': '',
'attachment': '',
'paperclip': '',
'eye': '',
'views': '',
'eye-plus': '',
'views2': '',
'eye-minus': '',
'views3': '',
'eye-blocked': '',
'views4': '',
'bookmark': '',
'ribbon': '',
'bookmarks': '',
'ribbons': '',
'sun': '',
'weather2': '',
'contrast': '',
'brightness-contrast': '',
'star-empty': '',
'rate': '',
'star-half': '',
'rate2': '',
'star-full': '',
'rate3': '',
'heart': '',
'like': '',
'heart-broken': '',
'heart2': '',
'man': '',
'male': '',
'woman': '',
'female': '',
'man-woman': '',
'toilet': '',
'happy': '',
'emoticon': '',
'happy2': '',
'emoticon2': '',
'smile': '',
'emoticon3': '',
'smile2': '',
'emoticon4': '',
'tongue': '',
'emoticon5': '',
'tongue2': '',
'emoticon6': '',
'sad': '',
'emoticon7': '',
'sad2': '',
'emoticon8': '',
'wink': '',
'emoticon9': '',
'wink2': '',
'emoticon10': '',
'grin': '',
'emoticon11': '',
'grin2': '',
'emoticon12': '',
'cool': '',
'emoticon13': '',
'cool2': '',
'emoticon14': '',
'angry': '',
'emoticon15': '',
'angry2': '',
'emoticon16': '',
'evil': '',
'emoticon17': '',
'evil2': '',
'emoticon18': '',
'shocked': '',
'emoticon19': '',
'shocked2': '',
'emoticon20': '',
'baffled': '',
'emoticon21': '',
'baffled2': '',
'emoticon22': '',
'confused': '',
'emoticon23': '',
'confused2': '',
'emoticon24': '',
'neutral': '',
'emoticon25': '',
'neutral2': '',
'emoticon26': '',
'hipster': '',
'emoticon27': '',
'hipster2': '',
'emoticon28': '',
'wondering': '',
'emoticon29': '',
'wondering2': '',
'emoticon30': '',
'sleepy': '',
'emoticon31': '',
'sleepy2': '',
'emoticon32': '',
'frustrated': '',
'emoticon33': '',
'frustrated2': '',
'emoticon34': '',
'crying': '',
'emoticon35': '',
'crying2': '',
'emoticon36': '',
'point-up': '',
'finger': '',
'point-right': '',
'finger2': '',
'point-down': '',
'finger3': '',
'point-left': '',
'finger4': '',
'warning': '',
'sign': '',
'notification': '',
'warning2': '',
'question': '',
'help': '',
'plus': '',
'add': '',
'minus': '',
'subtract': '',
'info': '',
'information': '',
'cancel-circle': '',
'close': '',
'blocked': '',
'forbidden': '',
'cross': '',
'cancel': '',
'checkmark': '',
'tick': '',
'checkmark2': '',
'tick2': '',
'spell-check': '',
'spelling': '',
'enter': '',
'signin': '',
'exit': '',
'signout': '',
'play2': '',
'player': '',
'pause': '',
'player2': '',
'stop': '',
'player3': '',
'previous': '',
'player4': '',
'next': '',
'player5': '',
'backward': '',
'player6': '',
'forward2': '',
'player7': '',
'play3': '',
'player8': '',
'pause2': '',
'player9': '',
'stop2': '',
'player10': '',
'backward2': '',
'player11': '',
'forward3': '',
'player12': '',
'first': '',
'player13': '',
'last': '',
'player14': '',
'previous2': '',
'player15': '',
'next2': '',
'player16': '',
'eject': '',
'player17': '',
'volume-high': '',
'volume': '',
'volume-medium': '',
'volume2': '',
'volume-low': '',
'volume3': '',
'volume-mute': '',
'volume4': '',
'volume-mute2': '',
'volume5': '',
'volume-increase': '',
'volume6': '',
'volume-decrease': '',
'volume7': '',
'loop': '',
'repeat': '',
'loop2': '',
'repeat2': '',
'infinite': '',
'shuffle': '',
'random': '',
'arrow-up-left': '',
'up-left': '',
'arrow-up': '',
'up': '',
'arrow-up-right': '',
'up-right': '',
'arrow-right': '',
'right3': '',
'arrow-down-right': '',
'down-right': '',
'arrow-down': '',
'down': '',
'arrow-down-left': '',
'down-left': '',
'arrow-left': '',
'left3': '',
'arrow-up-left2': '',
'up-left2': '',
'arrow-up2': '',
'up2': '',
'arrow-up-right2': '',
'up-right2': '',
'arrow-right2': '',
'right4': '',
'arrow-down-right2': '',
'down-right2': '',
'arrow-down2': '',
'down2': '',
'arrow-down-left2': '',
'down-left2': '',
'arrow-left2': '',
'left4': '',
'circle-up': '',
'up3': '',
'circle-right': '',
'right5': '',
'circle-down': '',
'down3': '',
'circle-left': '',
'left5': '',
'tab': '',
'arrows': '',
'move-up': '',
'sort': '',
'move-down': '',
'sort2': '',
'sort-alpha-asc': '',
'arrange': '',
'sort-alpha-desc': '',
'arrange2': '',
'sort-numeric-asc': '',
'arrange3': '',
'sort-numberic-desc': '',
'arrange4': '',
'sort-amount-asc': '',
'arrange5': '',
'sort-amount-desc': '',
'arrange6': '',
'command': '',
'cmd': '',
'shift': '',
'ctrl': '',
'control': '',
'opt': '',
'option': '',
'checkbox-checked': '',
'checkbox': '',
'checkbox-unchecked': '',
'checkbox2': '',
'radio-checked': '',
'radio-button': '',
'radio-checked2': '',
'radio-button2': '',
'radio-unchecked': '',
'radio-button3': '',
'crop': '',
'resize': '',
'make-group': '',
'ungroup': '',
'scissors': '',
'cut': '',
'filter': '',
'funnel': '',
'font': '',
'typeface': '',
'ligature': '',
'typography': '',
'ligature2': '',
'typography2': '',
'text-height': '',
'wysiwyg': '',
'text-width': '',
'wysiwyg2': '',
'font-size': '',
'wysiwyg3': '',
'bold': '',
'wysiwyg4': '',
'underline': '',
'wysiwyg5': '',
'italic': '',
'wysiwyg6': '',
'strikethrough': '',
'wysiwyg7': '',
'omega': '',
'wysiwyg8': '',
'sigma': '',
'wysiwyg9': '',
'page-break': '',
'wysiwyg10': '',
'superscript': '',
'wysiwyg11': '',
'subscript': '',
'wysiwyg12': '',
'superscript2': '',
'wysiwyg13': '',
'subscript2': '',
'wysiwyg14': '',
'text-color': '',
'wysiwyg15': '',
'pagebreak': '',
'wysiwyg16': '',
'clear-formatting': '',
'wysiwyg17': '',
'table': '',
'wysiwyg18': '',
'table2': '',
'wysiwyg19': '',
'insert-template': '',
'wysiwyg20': '',
'pilcrow': '',
'wysiwyg21': '',
'ltr': '',
'wysiwyg22': '',
'rtl': '',
'wysiwyg23': '',
'section': '',
'wysiwyg24': '',
'paragraph-left': '',
'wysiwyg25': '',
'paragraph-center': '',
'wysiwyg26': '',
'paragraph-right': '',
'wysiwyg27': '',
'paragraph-justify': '',
'wysiwyg28': '',
'indent-increase': '',
'wysiwyg29': '',
'indent-decrease': '',
'wysiwyg30': '',
'share': '',
'out': '',
'new-tab': '',
'out2': '',
'embed': '',
'code': '',
'embed2': '',
'code2': '',
'terminal': '',
'console': '',
'share2': '',
'social': '',
'mail2': '',
'contact2': '',
'mail3': '',
'contact3': '',
'mail4': '',
'contact4': '',
'mail5': '',
'contact5': '',
'amazon': '',
'brand': '',
'google': '',
'brand2': '',
'google2': '',
'brand3': '',
'google3': '',
'brand4': '',
'google-plus': '',
'brand5': '',
'google-plus2': '',
'brand6': '',
'google-plus3': '',
'brand7': '',
'hangouts': '',
'brand8': '',
'google-drive': '',
'brand9': '',
'facebook': '',
'brand10': '',
'facebook2': '',
'brand11': '',
'instagram': '',
'brand12': '',
'whatsapp': '',
'brand13': '',
'spotify': '',
'brand14': '',
'telegram': '',
'brand15': '',
'twitter': '',
'brand16': '',
'vine': '',
'brand17': '',
'vk': '',
'brand18': '',
'renren': '',
'brand19': '',
'sina-weibo': '',
'brand20': '',
'feed2': '',
'rss': '',
'feed3': '',
'rss2': '',
'youtube': '',
'brand21': '',
'youtube2': '',
'brand22': '',
'twitch': '',
'brand23': '',
'vimeo': '',
'brand24': '',
'vimeo2': '',
'brand25': '',
'lanyrd': '',
'brand26': '',
'flickr': '',
'brand27': '',
'flickr2': '',
'brand28': '',
'flickr3': '',
'brand29': '',
'flickr4': '',
'brand30': '',
'dribbble': '',
'brand31': '',
'behance': '',
'brand32': '',
'behance2': '',
'brand33': '',
'deviantart': '',
'brand34': '',
'500px': '',
'brand35': '',
'steam': '',
'brand36': '',
'steam2': '',
'brand37': '',
'dropbox': '',
'brand38': '',
'onedrive': '',
'brand39': '',
'github': '',
'brand40': '',
'npm': '',
'brand41': '',
'basecamp': '',
'brand42': '',
'trello': '',
'brand43': '',
'wordpress': '',
'brand44': '',
'joomla': '',
'brand45': '',
'ello': '',
'brand46': '',
'blogger': '',
'brand47': '',
'blogger2': '',
'brand48': '',
'tumblr': '',
'brand49': '',
'tumblr2': '',
'brand50': '',
'yahoo': '',
'brand51': '',
'yahoo2': '',
'tux': '',
'brand52': '',
'apple': '',
'brand53': '',
'finder': '',
'brand54': '',
'android': '',
'brand55': '',
'windows': '',
'brand56': '',
'windows8': '',
'brand57': '',
'soundcloud': '',
'brand58': '',
'soundcloud2': '',
'brand59': '',
'skype': '',
'brand60': '',
'reddit': '',
'brand61': '',
'hackernews': '',
'brand62': '',
'wikipedia': '',
'brand63': '',
'linkedin': '',
'brand64': '',
'linkedin2': '',
'brand65': '',
'lastfm': '',
'brand66': '',
'lastfm2': '',
'brand67': '',
'delicious': '',
'brand68': '',
'stumbleupon': '',
'brand69': '',
'stumbleupon2': '',
'brand70': '',
'stackoverflow': '',
'brand71': '',
'pinterest': '',
'brand72': '',
'pinterest2': '',
'brand73': '',
'xing': '',
'brand74': '',
'xing2': '',
'brand75': '',
'flattr': '',
'brand76': '',
'foursquare': '',
'brand77': '',
'yelp': '',
'brand78': '',
'paypal': '',
'brand79': '',
'chrome': '',
'browser': '',
'firefox': '',
'browser2': '',
'IE': '',
'browser3': '',
'edge': '',
'browser4': '',
'safari': '',
'browser5': '',
'opera': '',
'browser6': '',
'file-pdf': '',
'file10': '',
'file-openoffice': '',
'file11': '',
'file-word': '',
'file12': '',
'file-excel': '',
'file13': '',
'libreoffice': '',
'file14': '',
'html-five': '',
'w3c': '',
'html-five2': '',
'w3c2': '',
'css3': '',
'w3c3': '',
'git': '',
'brand80': '',
'codepen': '',
'brand81': '',
'svg': '',
'IcoMoon': '',
'icomoon': '',
'0': 0
};
delete icons['0'];
window.icomoonLiga = function (els) {
var classes,
el,
i,
innerHTML,
key;
els = els || document.getElementsByTagName('*');
if (!els.length) {
els = [els];
}
for (i = 0; ; i += 1) {
el = els[i];
if (!el) {
break;
}
classes = el.className;
if (/icon/.test(classes)) {
innerHTML = el.innerHTML;
if (innerHTML && innerHTML.length > 1) {
for (key in icons) {
if (icons.hasOwnProperty(key)) {
innerHTML = innerHTML.replace(new RegExp(key, 'g'), icons[key]);
}
}
el.innerHTML = innerHTML;
}
}
}
};
window.icomoonLiga();
}
}());