-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WysiwygHelper 上で TitleIconHeleperからアイコン一覧の取得 * 取得したアイコン情報を app.serviceとしてhash値として登録 * wysiwyg設定としての組込 * titleicons プラグインを組み込み(emoticonsプラグインをベースに)
- Loading branch information
Showing
4 changed files
with
104 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/** | ||
* plugin.js | ||
* | ||
* Released under LGPL License. | ||
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved | ||
* | ||
* License: http://www.tinymce.com/license | ||
* Contributing: http://www.tinymce.com/contributing | ||
*/ | ||
|
||
/*global tinymce:true */ | ||
|
||
tinymce.PluginManager.add('titleicons', function(editor, url) { | ||
var titleicons = editor.settings.nc3Configs.title_icon_paths; | ||
|
||
function getHtml() { | ||
var titleiconsHtml; | ||
|
||
titleiconsHtml = '<table role="list" class="mce-grid">'; | ||
|
||
tinymce.each(titleicons, function(row) { | ||
titleiconsHtml += '<tr>'; | ||
|
||
tinymce.each(row, function(icon) { | ||
var emoticonUrl = icon.path; | ||
|
||
titleiconsHtml += '<td><a href="#" data-mce-url="' + emoticonUrl + | ||
'" data-mce-alt="' + icon.alt + '" tabindex="-1" ' + | ||
'role="option" aria-label="' + icon.alt + '">' + | ||
'<img src="' + emoticonUrl + '" style="width: 18px; height: 18px"' + | ||
' role="presentation" /></a></td>'; | ||
}); | ||
|
||
titleiconsHtml += '</tr>'; | ||
}); | ||
|
||
titleiconsHtml += '</table>'; | ||
|
||
return titleiconsHtml; | ||
} | ||
|
||
editor.addButton('titleicons', { | ||
type: 'panelbutton', | ||
panel: { | ||
role: 'application', | ||
autohide: true, | ||
html: getHtml, | ||
onclick: function(e) { | ||
var linkElm = editor.dom.getParent(e.target, 'a'); | ||
|
||
if (linkElm) { | ||
editor.insertContent( | ||
'<img src="' + linkElm.getAttribute('data-mce-url') + '"' + | ||
' alt="' + linkElm.getAttribute('data-mce-alt') + '"' + | ||
' width="' + editor.settings.titleIconSize + '"' + | ||
' height="' + editor.settings.titleIconSize + '" />' | ||
); | ||
|
||
this.hide(); | ||
} | ||
} | ||
}, | ||
tooltip: 'Emoticons', | ||
icon: 'emoticons' | ||
}); | ||
}); |
This file contains 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