2015-04-22 07:50:11 +09:00
|
|
|
// ------------------------------ Dynamic Icons ------------------------------ //
|
|
|
|
|
2015-05-10 13:37:42 +09:00
|
|
|
/**
|
|
|
|
* Take an icon name (such as "open") and return the HTML code to display the icon
|
|
|
|
* @param {string} iconName - the name of the icon
|
|
|
|
* @param {string} [iconClass] - an optional class to assign to the icon
|
|
|
|
*/
|
2015-04-24 09:28:50 +09:00
|
|
|
Telescope.utils.getIcon = function (iconName, iconClass) {
|
|
|
|
var icons = Telescope.utils.icons;
|
2015-04-22 07:50:11 +09:00
|
|
|
var iconCode = !!icons[iconName] ? icons[iconName] : iconName;
|
|
|
|
var iconClass = (typeof iconClass === 'string') ? ' '+iconClass : '';
|
2015-08-21 10:20:48 +09:00
|
|
|
return '<i class="icon fa fa-fw fa-' + iconCode + ' icon-' + iconName + iconClass+ '" aria-hidden="true"></i>';
|
2015-05-01 18:22:00 +02:00
|
|
|
};
|
2015-04-22 07:50:11 +09:00
|
|
|
|
2015-05-10 13:37:42 +09:00
|
|
|
/**
|
|
|
|
* A directory of icon keys and icon codes
|
|
|
|
*/
|
2015-04-24 09:28:50 +09:00
|
|
|
Telescope.utils.icons = {
|
2015-08-21 10:20:48 +09:00
|
|
|
expand: "angle-down",
|
|
|
|
collapse: "angle-up",
|
2015-08-21 11:18:20 +09:00
|
|
|
next: "angle-right",
|
2015-07-16 12:03:15 +09:00
|
|
|
close: "times",
|
2015-04-22 07:50:11 +09:00
|
|
|
upvote: "chevron-up",
|
|
|
|
voted: "check",
|
|
|
|
downvote: "chevron-down",
|
|
|
|
facebook: "facebook-square",
|
|
|
|
twitter: "twitter",
|
|
|
|
googleplus: "google-plus",
|
|
|
|
linkedin: "linkedin-square",
|
|
|
|
comment: "comment-o",
|
|
|
|
share: "share-square-o",
|
|
|
|
more: "ellipsis-h",
|
|
|
|
menu: "bars",
|
|
|
|
subscribe: "envelope-o",
|
|
|
|
delete: "trash-o",
|
|
|
|
edit: "pencil",
|
|
|
|
popularity: "fire",
|
|
|
|
time: "clock-o",
|
|
|
|
best: "star",
|
2015-08-18 10:21:21 +09:00
|
|
|
search: "search",
|
|
|
|
edit: "pencil",
|
|
|
|
approve: "check-circle-o",
|
|
|
|
unapprove: "times-circle-o",
|
|
|
|
views: "eye",
|
|
|
|
clicks: "mouse-pointer",
|
|
|
|
score: "line-chart"
|
2015-05-01 18:22:00 +02:00
|
|
|
};
|