mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 04:40:44 +02:00
TinyMce emoticons popup - work in progress.
This commit is contained in:
@@ -55,6 +55,10 @@ if(e_WYSIWYG || strpos(e_SELF,"tinymce/admin_config.php") )
|
|||||||
e107::js('inline',"
|
e107::js('inline',"
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('.e-wysiwyg').each(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);
|
tinyMCE.selectedInstance.execCommand('mceInsertContent',0,val);
|
||||||
return false;
|
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.
|
// When new tab is added - convert textarea to TinyMce.
|
||||||
|
@@ -37,6 +37,13 @@
|
|||||||
title : 'emoticons.desc',
|
title : 'emoticons.desc',
|
||||||
onclick: function(){
|
onclick: function(){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// $("div.modal-body").html('hi there');
|
||||||
|
$('div.modal-body').load(url + "/emoticons.php");
|
||||||
|
$('#uiModal').modal('show');
|
||||||
|
|
||||||
|
/*
|
||||||
$.colorbox({
|
$.colorbox({
|
||||||
href: url + "/emoticons.php",
|
href: url + "/emoticons.php",
|
||||||
iframe: true,
|
iframe: true,
|
||||||
@@ -46,6 +53,7 @@
|
|||||||
opacity: 0.3,
|
opacity: 0.3,
|
||||||
scrolling: false
|
scrolling: false
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
},
|
},
|
||||||
//cmd : 'mceEmotion',
|
//cmd : 'mceEmotion',
|
||||||
image : url + '/images/emoticons.png'
|
image : url + '/images/emoticons.png'
|
||||||
|
@@ -48,7 +48,7 @@ require_once(HEADERF);
|
|||||||
$value = ($value2 ? $value2 : $value);
|
$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<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;
|
echo $str;
|
||||||
|
|
||||||
function headerjs(){
|
function headerjs(){
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
global $pref;
|
global $pref;
|
||||||
// $js = "<script type='text/javascript' src='../../tiny_mce_popup.js'></script>";
|
// $js = "<script type='text/javascript' src='../../tiny_mce_popup.js'></script>";
|
||||||
$js .= " <script type='text/javascript'>
|
$js .= " <script type='text/javascript'>
|
||||||
@@ -68,8 +71,10 @@ function headerjs(){
|
|||||||
|
|
||||||
function insertEmotion(file_name, title) {
|
function insertEmotion(file_name, title) {
|
||||||
var html = '<img src=\'".e_IMAGE_ABS."emotes/".$pref['emotepack']."/' + file_name + '\' alt=\'' + file_name + '\' />';
|
var html = '<img src=\'".e_IMAGE_ABS."emotes/".$pref['emotepack']."/' + file_name + '\' alt=\'' + file_name + '\' />';
|
||||||
tinyMCE.execCommand('mceInsertContent', false, html);
|
tinyMCE.selectedInstance.execCommand('mceInsertContent',0,html);
|
||||||
tinyMCEPopup.close();
|
//tinyMCE.execCommand('mceInsertContent', false, html);
|
||||||
|
|
||||||
|
//tinyMCEPopup.close();
|
||||||
}
|
}
|
||||||
";
|
";
|
||||||
|
|
||||||
|
@@ -37,6 +37,10 @@
|
|||||||
title : 'ibrowser.desc',
|
title : 'ibrowser.desc',
|
||||||
// cmd : 'mceibrowser',
|
// cmd : 'mceibrowser',
|
||||||
onclick: function() {
|
onclick: function() {
|
||||||
|
|
||||||
|
// $('div.modal-body').load(url + "/ibrowser.php");
|
||||||
|
// $('#uiModal').modal('show');
|
||||||
|
|
||||||
$.colorbox({
|
$.colorbox({
|
||||||
href: url + "/ibrowser.php",
|
href: url + "/ibrowser.php",
|
||||||
iframe: true,
|
iframe: true,
|
||||||
|
@@ -260,7 +260,39 @@ class wysiwyg
|
|||||||
// 'theme_advanced_resize_vertical' => 'true',
|
// 'theme_advanced_resize_vertical' => 'true',
|
||||||
'dialog_type' => "modal",
|
'dialog_type' => "modal",
|
||||||
// 'theme_advanced_source_editor_height' => '400',
|
// '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_statusbar_location' => 'bottom',
|
||||||
'theme_advanced_resizing' => 'false',
|
'theme_advanced_resizing' => 'false',
|
||||||
|
Reference in New Issue
Block a user