-
Notifications
You must be signed in to change notification settings - Fork 0
/
button-advanced.js
41 lines (33 loc) · 10.3 KB
/
button-advanced.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// create sceditor button and drop down
$.sceditor.command.set('fontawesome', {
dropDown : function(editor, caller, callback) {
// fa holds the icon list ( see the pull script if you need to update the icons )
var fa = {'adjust':'','adn':'','align-center':'','align-justify':'','align-left':'','align-right':'','ambulance':'','anchor':'','android':'','angellist':'','angle-double-down':'','angle-double-left':'','angle-double-right':'','angle-double-up':'','angle-down':'','angle-left':'','angle-right':'','angle-up':'','apple':'','archive':'','area-chart':'','arrow-circle-down':'','arrow-circle-left':'','arrow-circle-o-down':'','arrow-circle-o-left':'','arrow-circle-o-right':'','arrow-circle-o-up':'','arrow-circle-right':'','arrow-circle-up':'','arrow-down':'','arrow-left':'','arrow-right':'','arrow-up':'','arrows':'','arrows-alt':'','arrows-h':'','arrows-v':'','asterisk':'','at':'','backward':'','ban':'','bar-chart':'','barcode':'','bars':'','bed':'','beer':'','behance':'','behance-square':'','bell':'','bell-o':'','bell-slash':'','bell-slash-o':'','bicycle':'','binoculars':'','birthday-cake':'','bitbucket':'','bitbucket-square':'','bold':'','bolt':'','bomb':'','book':'','bookmark':'','bookmark-o':'','briefcase':'','btc':'','bug':'','building':'','building-o':'','bullhorn':'','bullseye':'','bus':'','buysellads':'','calculator':'','calendar':'','calendar-o':'','camera':'','camera-retro':'','car':'','caret-down':'','caret-left':'','caret-right':'','caret-square-o-down':'','caret-square-o-left':'','caret-square-o-right':'','caret-square-o-up':'','caret-up':'','cart-arrow-down':'','cart-plus':'','cc':'','cc-amex':'','cc-discover':'','cc-mastercard':'','cc-paypal':'','cc-stripe':'','cc-visa':'','certificate':'','chain-broken':'','check':'','check-circle':'','check-circle-o':'','check-square':'','check-square-o':'','chevron-circle-down':'','chevron-circle-left':'','chevron-circle-right':'','chevron-circle-up':'','chevron-down':'','chevron-left':'','chevron-right':'','chevron-up':'','child':'','circle':'','circle-o':'','circle-o-notch':'','circle-thin':'','clipboard':'','clock-o':'','cloud':'','cloud-download':'','cloud-upload':'','code':'','code-fork':'','codepen':'','coffee':'','cog':'','cogs':'','columns':'','comment':'','comment-o':'','comments':'','comments-o':'','compass':'','compress':'','connectdevelop':'','copyright':'','credit-card':'','crop':'','crosshairs':'','css3':'','cube':'','cubes':'','cutlery':'','dashcube':'','database':'','delicious':'','desktop':'','deviantart':'','diamond':'','digg':'','dot-circle-o':'','download':'','dribbble':'','dropbox':'','drupal':'','eject':'','ellipsis-h':'','ellipsis-v':'','empire':'','envelope':'','envelope-o':'','envelope-square':'','eraser':'','eur':'','exchange':'','exclamation':'','exclamation-circle':'','exclamation-triangle':'','expand':'','external-link':'','external-link-square':'','eye':'','eye-slash':'','eyedropper':'','facebook':'','facebook-official':'','facebook-square':'','fast-backward':'','fast-forward':'','fax':'','female':'','fighter-jet':'','file':'','file-archive-o':'','file-audio-o':'','file-code-o':'','file-excel-o':'','file-image-o':'','file-o':'','file-pdf-o':'','file-powerpoint-o':'','file-text':'','file-text-o':'','file-video-o':'','file-word-o':'','files-o':'','film':'','filter':'','fire':'','fire-extinguisher':'','flag':'','flag-checkered':'','flag-o':'','flask':'','flickr':'','floppy-o':'','folder':'','folder-o':'','folder-open':'','folder-open-o':'','font':'','forumbee':'','forward':'','foursquare':'','frown-o':'','futbol-o':'','gamepad':'','gavel':'','gbp':'','gift':'','git':'','git-square':'','github':'','github-alt':'','github-square':'','glass':'','globe':'','google':'','google-plus':'','google-plus-square':'','google-wallet':'','graduation-cap':'','gratipay':'','h-square':'','hacker-news':'','hand-o-down':'','hand-o-left':'','hand-o-right':'','hand-o-up':'','hdd-o':'','header':'','headphones':'','heart':'','heart-o':'','heartbeat':'','history':'','home':'','hospital-o':'','html5':'','ils':'','inbox':'','indent':'','info':'','info-circle':'','inr':'','instagram':'','ioxhost':'','italic':'','joomla':'','jpy':'','jsfiddle':'','key':'','keyboard-o':'','krw':'','language':'','laptop':'','lastfm':'','lastfm-square':'','leaf':'','leanpub':'','lemon-o':'','level-down':'','level-up':'','life-ring':'','lightbulb-o':'','line-chart':'','link':'','linkedin':'','linkedin-square':'','linux':'','list':'','list-alt':'','list-ol':'','list-ul':'','location-arrow':'','lock':'','long-arrow-down':'','long-arrow-left':'','long-arrow-right':'','long-arrow-up':'','magic':'','magnet':'','male':'','map-marker':'','mars':'','mars-double':'','mars-stroke':'','mars-stroke-h':'','mars-stroke-v':'','maxcdn':'','meanpath':'','medium':'','medkit':'','meh-o':'','mercury':'','microphone':'','microphone-slash':'','minus':'','minus-circle':'','minus-square':'','minus-square-o':'','mobile':'','money':'','moon-o':'','motorcycle':'','music':'','neuter':'','newspaper-o':'','openid':'','outdent':'','pagelines':'','paint-brush':'','paper-plane':'','paper-plane-o':'','paperclip':'','paragraph':'','pause':'','paw':'','paypal':'','pencil':'','pencil-square':'','pencil-square-o':'','phone':'','phone-square':'','picture-o':'','pie-chart':'','pied-piper':'','pied-piper-alt':'','pinterest':'','pinterest-p':'','pinterest-square':'','plane':'','play':'','play-circle':'','play-circle-o':'','plug':'','plus':'','plus-circle':'','plus-square':'','plus-square-o':'','power-off':'','print':'','puzzle-piece':'','qq':'','qrcode':'','question':'','question-circle':'','quote-left':'','quote-right':'','random':'','rebel':'','recycle':'','reddit':'','reddit-square':'','refresh':'','renren':'','repeat':'','reply':'','reply-all':'','retweet':'','road':'','rocket':'','rss':'','rss-square':'','rub':'','scissors':'','search':'','search-minus':'','search-plus':'','sellsy':'','server':'','share':'','share-alt':'','share-alt-square':'','share-square':'','share-square-o':'','shield':'','ship':'','shirtsinbulk':'','shopping-cart':'','sign-in':'','sign-out':'','signal':'','simplybuilt':'','sitemap':'','skyatlas':'','skype':'','slack':'','sliders':'','slideshare':'','smile-o':'','sort':'','sort-alpha-asc':'','sort-alpha-desc':'','sort-amount-asc':'','sort-amount-desc':'','sort-asc':'','sort-desc':'','sort-numeric-asc':'','sort-numeric-desc':'','soundcloud':'','space-shuttle':'','spinner':'','spoon':'','spotify':'','square':'','square-o':'','stack-exchange':'','stack-overflow':'','star':'','star-half':'','star-half-o':'','star-o':'','steam':'','steam-square':'','step-backward':'','step-forward':'','stethoscope':'','stop':'','street-view':'','strikethrough':'','stumbleupon':'','stumbleupon-circle':'','subscript':'','subway':'','suitcase':'','sun-o':'','superscript':'','table':'','tablet':'','tachometer':'','tag':'','tags':'','tasks':'','taxi':'','tencent-weibo':'','terminal':'','text-height':'','text-width':'','th':'','th-large':'','th-list':'','thumb-tack':'','thumbs-down':'','thumbs-o-down':'','thumbs-o-up':'','thumbs-up':'','ticket':'','times':'','times-circle':'','times-circle-o':'','tint':'','toggle-off':'','toggle-on':'','train':'','transgender':'','transgender-alt':'','trash':'','trash-o':'','tree':'','trello':'','trophy':'','truck':'','try':'','tty':'','tumblr':'','tumblr-square':'','twitch':'','twitter':'','twitter-square':'','umbrella':'','underline':'','undo':'','university':'','unlock':'','unlock-alt':'','upload':'','usd':'','user':'','user-md':'','user-plus':'','user-secret':'','user-times':'','users':'','venus':'','venus-double':'','venus-mars':'','viacoin':'','video-camera':'','vimeo-square':'','vine':'','vk':'','volume-down':'','volume-off':'','volume-up':'','weibo':'','weixin':'','whatsapp':'','wheelchair':'','wifi':'','windows':'','wordpress':'','wrench':'','xing':'','xing-square':'','yahoo':'','yelp':'','youtube':'','youtube-play':'','youtube-square':''},
a, b = '', c = document.createElement('DIV'), i, j;
for (i in fa) b += '<i class="fa" title="' + i.replace(/-/g, ' ') + '">' + fa[i] + '</i>';
c.innerHTML = b;
for (a = c.getElementsByTagName('I'), i = 0, j = a.length; i<j; i++) {
a[i].onclick = function() {
callback(this.innerHTML);
editor.closeDropDown(true);
}
}
editor.createDropDown(caller, 'fontawesome', c);
},
// if you want to add a default size for the icons, simply add the size tags into insert()
// wysiwyg
exec : function(c) {
var e = this;
$.sceditor.command.get('fontawesome').dropDown(e, c, function(icon) {
e.insert(' [font=FontAwesome]' + icon + '[/font] ', '', true, true, true);
});
},
// source
txtExec : function(c) {
var e = this;
$.sceditor.command.get('fontawesome').dropDown(e, c, function(icon) {
e.insertText(' [font=FontAwesome]' + icon + '[/font] ', '');
});
},
tooltip : 'Font Awesome Icons'
});