1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-29 10:38:08 +01:00

TinyMce emoticons popup - work in progress.

This commit is contained in:
Cameron 2013-02-28 06:30:44 -08:00
parent 2feaade4ce
commit aa26b0ba36
5 changed files with 72 additions and 3 deletions

View File

@ -55,6 +55,10 @@ if(e_WYSIWYG || strpos(e_SELF,"tinymce/admin_config.php") )
e107::js('inline',"
$(function() {
$('.e-wysiwyg').each(function() {
@ -71,6 +75,22 @@ if(e_WYSIWYG || strpos(e_SELF,"tinymce/admin_config.php") )
tinyMCE.selectedInstance.execCommand('mceInsertContent',0,val);
return false;
});
$('img.tinyInsertEmote').live('click',function() {
var src = $(this).attr('src');
alert(src);
// var html = '<img src=\''+src +'\' alt=\'emote\' />';
tinyMCE.execCommand('mceInsertRawHTML',false, 'hi there');
;
$('.mceContentBody', window.top.document).tinymce().execCommand('mceInsertContent',false,src);
// tinyMCE.selectedInstance.execCommand('mceInsertContent',0,src);
$('#uiModal').modal('hide');
return true;
});
// When new tab is added - convert textarea to TinyMce.

View File

@ -37,6 +37,13 @@
title : 'emoticons.desc',
onclick: function(){
// $("div.modal-body").html('hi there');
$('div.modal-body').load(url + "/emoticons.php");
$('#uiModal').modal('show');
/*
$.colorbox({
href: url + "/emoticons.php",
iframe: true,
@ -46,6 +53,7 @@
opacity: 0.3,
scrolling: false
});
*/
},
//cmd : 'mceEmotion',
image : url + '/images/emoticons.png'

View File

@ -48,7 +48,7 @@ require_once(HEADERF);
$value = ($value2 ? $value2 : $value);
// $str .= "\n<a href='javascript:void(0);' onmousedown=\"javascript:insertEmotion('$key')\"><img src=\"".e_IMAGE_ABS."emotes/" . $pref['emotepack'] . "/$key\" style=\"border:0; padding-top:2px;\" alt=\"\" /></a> ";
$str .= "\n<img class='selectEmote' src=\"".e_IMAGE_ABS."emotes/" . $pref['emotepack'] . "/$key\" style=\"border:0; padding-top:2px;\" alt=\"\" />";
$str .= "\n<img class='tinyInsertEmote' src=\"".e_IMAGE_ABS."emotes/" . $pref['emotepack'] . "/$key\" style=\"border:0; padding-top:2px;\" alt=\"\" />";
}
@ -58,6 +58,9 @@ require_once(HEADERF);
echo $str;
function headerjs(){
return;
global $pref;
// $js = "<script type='text/javascript' src='../../tiny_mce_popup.js'></script>";
$js .= " <script type='text/javascript'>
@ -68,8 +71,10 @@ function headerjs(){
function insertEmotion(file_name, title) {
var html = '<img src=\'".e_IMAGE_ABS."emotes/".$pref['emotepack']."/' + file_name + '\' alt=\'' + file_name + '\' />';
tinyMCE.execCommand('mceInsertContent', false, html);
tinyMCEPopup.close();
tinyMCE.selectedInstance.execCommand('mceInsertContent',0,html);
//tinyMCE.execCommand('mceInsertContent', false, html);
//tinyMCEPopup.close();
}
";

View File

@ -37,6 +37,10 @@
title : 'ibrowser.desc',
// cmd : 'mceibrowser',
onclick: function() {
// $('div.modal-body').load(url + "/ibrowser.php");
// $('#uiModal').modal('show');
$.colorbox({
href: url + "/ibrowser.php",
iframe: true,

View File

@ -260,7 +260,39 @@ class wysiwyg
// 'theme_advanced_resize_vertical' => 'true',
'dialog_type' => "modal",
// 'theme_advanced_source_editor_height' => '400',
// ------------- html5 Stuff.
// 'visualblocks_default_state' => 'true',
// Schema is HTML5 instead of default HTML4
// 'schema' => "html5",
// End container block element when pressing enter inside an empty block
// 'end_container_on_empty_block' => true,
// HTML5 formats
/*
'style_formats' => "[
{title : 'h1', block : 'h1'},
{title : 'h2', block : 'h2'},
{title : 'h3', block : 'h3'},
{title : 'h4', block : 'h4'},
{title : 'h5', block : 'h5'},
{title : 'h6', block : 'h6'},
{title : 'p', block : 'p'},
{title : 'div', block : 'div'},
{title : 'pre', block : 'pre'},
{title : 'section', block : 'section', wrapper: true, merge_siblings: false},
{title : 'article', block : 'article', wrapper: true, merge_siblings: false},
{title : 'blockquote', block : 'blockquote', wrapper: true},
{title : 'hgroup', block : 'hgroup', wrapper: true},
{title : 'aside', block : 'aside', wrapper: true},
{title : 'figure', block : 'figure', wrapper: true}
]",
*/
// --------------------------------
// 'theme_advanced_statusbar_location' => 'bottom',
'theme_advanced_resizing' => 'false',