mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01:00
Media-Manager and TinyMce connectivity
This commit is contained in:
parent
2a50dc6177
commit
972b7fa401
@ -349,12 +349,16 @@ class media_admin_ui extends e_admin_ui
|
||||
/* Send the generated IMG bbcode back to the textarea/window */
|
||||
function saveBB()
|
||||
{
|
||||
var add = document.getElementById('bbcode_holder').value;
|
||||
addtext(add);
|
||||
|
||||
// tinyMCE.execCommand('mceInsertContent',false,'hi there');
|
||||
|
||||
|
||||
var add = document.getElementById('bbcode_holder').value;
|
||||
var html = document.getElementById('html_holder').value;
|
||||
// tinyMCE.execCommand('mceInsertContent',false,add);
|
||||
tinyMCE.execCommand('mceInsertRawHTML',false,html);
|
||||
tinyMCEPopup.close();
|
||||
|
||||
|
||||
//addtext(add);
|
||||
//parent.e107Widgets.DialogManagerDefault.getWindow('e-dialog').close();
|
||||
return false;
|
||||
}
|
||||
@ -503,6 +507,11 @@ class media_admin_ui extends e_admin_ui
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
<table><tr><td>Preview<br /></td></tr>
|
||||
<tr><td style='text-align:center'>
|
||||
<img id='preview' src='".e_IMAGE_ABS."generic/blank.gif' style='border:1px solid silver; min-width:220px; min-height:180px;' />
|
||||
|
||||
</td></tr></table>
|
||||
</fieldset>";
|
||||
}
|
||||
$text .= "</div>";
|
||||
@ -587,7 +596,7 @@ class media_admin_ui extends e_admin_ui
|
||||
|
||||
document.getElementById('bbcode_holder').value = bb;
|
||||
|
||||
var html = '<img src=\''+ src +'\' style=\'' + style + '\' />';
|
||||
var html = '<img style=\"' + style + '\" src=\"'+ src +'\" />';
|
||||
document.getElementById('html_holder').value = html;
|
||||
|
||||
}
|
||||
|
@ -366,6 +366,7 @@ class e_media
|
||||
<div style='display:block;border:1px solid silver;padding-top:40px;text-align:center;vertical-align:middle;width:120px;height:58px'>
|
||||
No Image</div>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
$srch = array("{MEDIA_URL}","{MEDIA_PATH}");
|
||||
@ -386,11 +387,11 @@ class e_media
|
||||
}
|
||||
else // TinyMce and other applications.
|
||||
{
|
||||
//TODO Add a preview window
|
||||
$onclicki = "document.getElementById('src').value = '{$im['media_url']}';
|
||||
document.getElementById('preview').src = '{$realPath}';
|
||||
updateBB();
|
||||
;
|
||||
|
||||
return false;";
|
||||
return false;";
|
||||
}
|
||||
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
if(e_WYSIWYG || strpos(e_SELF,"tinymce/admin_config.php"))
|
||||
if(e_WYSIWYG || strpos(e_SELF,"tinymce/admin_config.php") )
|
||||
{
|
||||
require_once(e_PLUGIN."tinymce/wysiwyg.php");
|
||||
if(deftrue('TINYMCE_CONFIG'))
|
||||
@ -25,8 +25,12 @@ if(e_WYSIWYG || strpos(e_SELF,"tinymce/admin_config.php"))
|
||||
{
|
||||
$wy = new wysiwyg();
|
||||
}
|
||||
|
||||
$wy -> render();
|
||||
|
||||
if(!strpos(e_SELF,e_ADMIN_ABS."image.php"))
|
||||
{
|
||||
$wy -> render();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -83,9 +83,10 @@
|
||||
|
||||
|
||||
// New Image Handler // verified
|
||||
rep(/<img(?:\s*)?(?:style="(.*)")?\s?(?:src="(\S*)")(?:\s*)?(?:alt="(\S*)")?(?:\s*)?(?:width="([\d]*)")?\s*(?:height="([\d]*)")?(?:\s*)?\/>/gi,"[img style=$1;width:$4px;height:$5px]$2[/img]" )
|
||||
// rep(/<img(?:\s*)?(?:style="(.*)")?\s?(?:src="([\S ]*)")(?:\s*)?(?:alt="(\S*)")?(?:\s*)?(?:width="([\d]*)")?\s*(?:height="([\d]*)")?(?:\s*)?\/>/gi,"[img style=$1;width:$4px;height:$5px]$2[/img]" )
|
||||
rep(/<img(?:\s*)?(?:style="(.*)")?\s?(?:src="([^;"]*)")(?:\s*)?(?:width="([\d]*)")?\s*(?:height="([\d]*)")?(?:\s*)?(?:alt="(\S*)")? (?:\s*)?\/>/gi,"[img style=$1;width:$4px;height:$5px]$2[/img]" );
|
||||
rep(/;width:px;height:px/gi, ""); // Img cleanup.
|
||||
rep(/<img\s*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
|
||||
// rep(/<img\s*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
|
||||
|
||||
rep(/<blockquote[^>]*>/gi,"[blockquote]");
|
||||
rep(/<\/blockquote>/gi,"[/blockquote]");
|
||||
|
@ -23,7 +23,7 @@
|
||||
ed.addCommand('mceibrowser', function() {
|
||||
ed.windowManager.open({
|
||||
file : url + '/ibrowser.php',
|
||||
width : 800 + parseInt(ed.getLang('ibrowser.delta_width', 0)),
|
||||
width : 830 + parseInt(ed.getLang('ibrowser.delta_width', 0)),
|
||||
height : 770 + parseInt(ed.getLang('ibrowser.delta_height', 0)),
|
||||
inline : 1
|
||||
}, {
|
||||
|
Loading…
x
Reference in New Issue
Block a user