1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 11:50:30 +02:00

Issue #434 - TinyMce Video and Glyph insert issue.

This commit is contained in:
Cameron
2014-05-31 23:15:26 -07:00
parent 0d063b82a8
commit 04afb156ae
5 changed files with 45 additions and 17 deletions

View File

@@ -1031,13 +1031,22 @@ class media_admin_ui extends e_admin_ui
$text = "<ul class='nav nav-tabs'>\n";
if($this->getQuery('bbcode') != 'video')
if($this->getQuery('bbcode') != 'video' && $this->getQuery('bbcode') != 'glyph')
{
$text .= "<li class='active'><a data-toggle='tab' href='#core-media-select'>Choose from Library</a></li>\n";
}
else
{
$videoActive = 'active';
if($this->getQuery('bbcode') == 'glyph')
{
$glyphActive = 'active';
}
else
{
$videoActive = 'active';
}
}
if($this->getQuery('bbcode') != 'video' && $this->getQuery('bbcode') !='glyph')
@@ -1052,7 +1061,7 @@ class media_admin_ui extends e_admin_ui
if($this->getQuery('glyphs') == 1 || $this->getQuery('bbcode') == 'glyph')
{
$text .= "<li><a data-toggle='tab' href='#core-media-glyphs'>Glyphs</a></li>\n";
$text .= "<li class='{$glyphActive}'><a data-toggle='tab' href='#core-media-glyphs'>Glyphs</a></li>\n";
}
if($this->getQuery('video') == 1 || $this->getQuery('bbcode') == 'video')
@@ -1071,9 +1080,9 @@ class media_admin_ui extends e_admin_ui
$text .= "
</ul>
<div class='tab-content'>";
<div class='tab-content media-manager'>";
if($this->getQuery('bbcode') != 'video')
if($this->getQuery('bbcode') != 'video' && $this->getQuery('bbcode') != 'glyph')
{
$text .= "<div class='tab-pane active' id='core-media-select'>
<div class='table' style='display:block'>";
@@ -1164,7 +1173,7 @@ class media_admin_ui extends e_admin_ui
if($this->getQuery('glyphs') == 1 || $this->getQuery('bbcode') == 'glyph')
{
//TODO
$text .= "<div class='tab-pane clearfix' id='core-media-glyphs' style='font-size:24px'>";
$text .= "<div class='tab-pane clearfix {$glyphActive}' id='core-media-glyphs' style='font-size:24px'>";
$text .= $this->glyphTab();
@@ -1260,7 +1269,7 @@ class media_admin_ui extends e_admin_ui
'type' =>'glyph',
'tagid' => $this->getQuery('tagid'),
'action' =>'glyph', // Used by AJAX to identify correct function.
'perPage' => 90,
'perPage' => 84,
'gridClass' => 'media-carousel-item-glyph pull-left',
'bbcode' =>'glyph',
'close' => 'true'

View File

@@ -1086,13 +1086,13 @@ class e_media
$close = (E107_DEBUG_LEVEL > 0) ? "" : " data-close='true' "; //
//
$text .= "\n\n<!-- Start Item -->\n<div class='media-carousel ".$data['gridClass']."'>
<div class='well clearfix'>
<a data-toggle='context' class='e-media-select e-dialog-save e-tip' ".$close." data-id='".$data['id']."' data-width='".$data['width']."' data-height='".$data['height']."' data-src='".$data['previewUrl']."' data-type='".$data['type']."' data-bbcode='".$data['bbcode']."' data-target='".$data['tagid']."' data-path='".$data['saveValue']."' data-preview='".$data['previewUrl']."' title=\"".$data['title']."\" style='float:left' href='#' >";
<a data-toggle='context' class='e-media-select e-tip e-dialog-save e-dialog-close' ".$close." data-id='".$data['id']."' data-width='".$data['width']."' data-height='".$data['height']."' data-src='".$data['previewUrl']."' data-type='".$data['type']."' data-bbcode='".$data['bbcode']."' data-target='".$data['tagid']."' data-path='".$data['saveValue']."' data-preview='".$data['previewUrl']."' title=\"".$data['title']."\" style='float:left' href='#' >";
if($data['type'] == 'image')
{

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: plugin.xml,v 1.3 2009-10-20 03:49:22 e107coders Exp $ -->
<e107Plugin name="TinyMce" version="1.0" date="2012-08-01" compatibility="2.0" installRequired="false">
<e107Plugin name="TinyMce" version="1.0" date="2012-08-01" compatibility="2.0" installRequired="true">
<author name="e107 Inc." url="http://e107.org" />
<description>Wysiwyg Text-Area Replacement</description>
<category>misc</category>

View File

@@ -16,6 +16,7 @@ if (!defined('e107_INIT')) { exit; }
e107::css('inline','
a.e-wysiwyg-toggle { margin-top:5px }
');
$pref = e107::getPref();
@@ -137,9 +138,27 @@ if((e_WYSIWYG && check_class($pref['post_html'])) || strpos(e_SELF,"tinymce4/adm
tinymce.activeEditor.execCommand('mceAddControl', false, id);
});
$('.e-dialog-save').click(function(){
$('.e-dialog-save').live('click', function(){
var html = $('#html_holder').val();
// var html = $('#html_holder').val();
var s = $('#bbcode_holder').val();
var p = $.ajax({
type: 'POST',
url: '".e_PLUGIN_ABS. "tinymce4/plugins/e107/parser.php', // parse bbcode value
data: { content: s, mode: 'tohtml' },
async : false,
dataType: 'html',
success: function(html) {
return html;
}
}).responseText;
html = p;
// alert(html);
if(html === undefined)
{
@@ -152,10 +171,10 @@ if((e_WYSIWYG && check_class($pref['post_html'])) || strpos(e_SELF,"tinymce4/adm
});
$('.e-dialog-close').click(function(){
// $('.e-dialog-close').click(function(){
top.tinymce.activeEditor.windowManager.close();
});
// top.tinymce.activeEditor.windowManager.close();
// });

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<e107Plugin name="TinyMce4" version="1.0" date="2014-01-15" compatibility="2.0" installRequired="true">
<e107Plugin name="TinyMce4" version="1.0" date="2014-01-15" compatibility="2.0" installRequired="false">
<author name="e107 Inc." url="http://e107.org" />
<description>Experimental TinyMce4 CDN version</description>
<category>misc</category>