1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 12:20:44 +02:00

Bbcode button styling and fixes.

This commit is contained in:
Cameron
2013-04-21 02:00:08 -07:00
parent 13b650d140
commit 8b0c9c79a3
5 changed files with 82 additions and 14 deletions

View File

@@ -29,8 +29,37 @@ class bbcode_shortcodes extends e_shortcode
// The BBcode Buttons.
function bb_format($id)
{
$text = "<select class='e-bb bbcode_buttons e-pointer' id='{$id}' title='Format text' onchange=\"addtext(this.value);this.value=''\">
$formats = array(
0 => array('[p][/p]','Paragraph'),
1 => array('[h=2][/h]','Heading'),
2 => array('[block][/block]','Block'),
3 => array('[blockquote][/blockquote]', 'Quote'),
4 => array('[code][/code]', 'Code')
);
if(e_BOOTSTRAP)
{
$text = '<div class="btn-group">';
$text .= '<a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#" title="">';
$text .= "Format";
$text .= ' <span class="caret"></span></a>';
$text .= "<ul class='dropdown-menu'>\n";
foreach($formats as $fm)
{
$text .= "<li><a href=\"javascript:addtext('".$fm[0]."')\">".$fm[1]."</a></li>\n";
}
$text .= "</ul>";
$text .= "</div>";
return $text;
}
// Legacy Version.
$text = "<select class='btn e-bb bbcode_buttons e-pointer' id='{$id}' title='Format text' onchange=\"addtext(this.value);this.value=''\">
<option value=''>Format</option>
<option value='[p][/p]'>Paragraph</option>
<option value='[h2][/h2]'>Heading</option>
@@ -38,6 +67,7 @@ class bbcode_shortcodes extends e_shortcode
<option value='[blockquote][/blockquote]'>Quote</option>
<option value='[code][/code]'>Code</option>
</select>";
return $text;
@@ -107,7 +137,7 @@ class bbcode_shortcodes extends e_shortcode
{
list($tag,$tmp) = explode("--",$this->var['tagid']); // works with $frm->bbarea to detect textarea from first half of tag.
}
$text = "<a class='e-modal' data-target='#uiModal' title='Media Manager : ".$this->var['template']."' id='{$id}' href='".e_ADMIN."image.php?mode=main&action=dialog&for=".$this->var['template']."&tagid=".$tag."&iframe=1&bbcode=img' >";
$text = "<a class='e-modal' data-modal-caption='Media Manager' data-target='#uiModal' title='Media Manager : ".$this->var['template']."' id='{$id}' href='".e_ADMIN."image.php?mode=main&action=dialog&for=".$this->var['template']."&tagid=".$tag."&iframe=1&bbcode=img' >";
$text .= "<img class='btn btn-small bbcode_buttons e-pointer' src='".e_IMAGE_ABS."bbcode/preimage.png' title='".LANHELP_45."' alt='' />";
$text .= "</a>\n";
return $text;
@@ -123,7 +153,7 @@ class bbcode_shortcodes extends e_shortcode
{
list($tag,$tmp) = explode("--",$this->var['tagid']); // works with $frm->bbarea to detect textarea from first half of tag.
}
$text = "<a class=' e-modal' data-target='#uiModal' id='{$id}' href='".e_ADMIN."image.php?mode=dialog&action=list&for=_common_file&tagid=".$tag."&iframe=1&bbcode=file' >";
$text = "<a class='e-modal' data-modal-caption='Media Manager' data-target='#uiModal' id='{$id}' href='".e_ADMIN."image.php?mode=main&amp;action=dialog&amp;for=_common_file&amp;tagid=".$tag."&amp;iframe=1&amp;bbcode=file' >";
$text .= "<img class='btn btn-small bbcode_buttons e-pointer' src='".e_IMAGE_ABS."bbcode/prefile.png' title='".LANHELP_39."' alt='' />";
$text .= "</a>\n";
return $text;
@@ -131,11 +161,37 @@ class bbcode_shortcodes extends e_shortcode
function bb_fontsize($id) // FIXME CSS issues
{
$data = "size";
$formid = $id."_";
$event = $this->getEvent('expandit',$formid, LANHELP_22);
if(deftrue('e_BOOTSTRAP'))
{
$tp = e107::getParser();
$sizes = array(7,8,9,10,11,12,14,15,18,20,22,24,26,28,30,36);
$text = '<div class="btn-group">';
$text .= '<a class="dropdown-toggle" data-toggle="dropdown" href="#" title="">';
$text .= "<img class='btn btn-small bbcode_buttons e-pointer' src='".e_IMAGE_ABS."bbcode/fontsize.png' alt='' title='".LANHELP_22."' />\n";
$text .= '</a>';
$text .= "<ul class='dropdown-menu'>\n";
foreach($sizes as $s)
{
$text .= "<li><a href=\"javascript:addtext('[size=".$s."][/size]')\">".$tp->toHtml("[size=".$s."]Size ".$s."[/size]",true)."</a></li>\n";
}
$text .= "</ul>";
$text .= "</div>";
return $text;
}
// Legacy BC Support
$data = "size";
$formid = $id."_";
$event = $this->getEvent('expandit',$formid, LANHELP_22);
$text = "<a {$event} class=' e-bb e-expandit' onclick=\"expandit('{$this->var['tagid']}')\" data-function='show' href='#{$this->var['tagid']}' title='".LANHELP_22."' data-bbcode='{$data}'>
<img class='btn btn-small bbcode_buttons e-pointer' src='".e_IMAGE_ABS."bbcode/fontsize.png' alt='' title='".LANHELP_22."' /></a>";
@@ -149,10 +205,14 @@ class bbcode_shortcodes extends e_shortcode
<option value=''>".LANHELP_41."</option>";
$sizes = array(7,8,9,10,11,12,14,15,18,20,22,24,26,28,30,36);
foreach($sizes as $s){
foreach($sizes as $s)
{
$text .= "<option value='[size=".$s."][/size]'>".$s."px</option>\n";
}
$text .="</select></td></tr> \n </table></div>
$text .="</select>
</td></tr> \n </table></div>
</div>\n<!-- End of Size selector -->";
return $text;
}

View File

@@ -5296,7 +5296,7 @@ class e_admin_form_ui extends e_form
<fieldset class='e-filter'>
<legend class='e-hideme'>".LAN_LABEL_LABEL_SELECTED."</legend>
".$filter_pre."
<div class='left' style='margin-top:10px;margin-bottom:-10px'>
<div class='left form-inline' style='margin-top:10px;margin-bottom:-10px'>
".$this->text('searchquery', $current_query[0], 50, $input_options)."<i class='icon-search searchquery'></i>
".$this->select_open('filter_options', array('class' => 'e-tip tbox select filter', 'id' => false, 'title'=>'Filter the results below'))."
".$this->option(LAN_FILTER_LABEL_DISPLAYALL, '')."

View File

@@ -60,7 +60,7 @@ define("LANHELP_45", "Insert image from directory: ");
define("LANHELP_46", "* No files found in: ");
define("LANHELP_47", "Insert flash: [flash=width,height]http://www.example.com/file.swf[/flash]");
define("LANHELP_48", "YouTube video: [youtube=tiny|small|medium|big|huge|width,height]6kYjxJmk0wc[/youtube]");
define("LANHELP_48", "YouTube video: [youtube=tiny | small | medium | big | huge | width,height]6kYjxJmk0wc[/youtube]");
define("LANHELP_49", "Paragraph: [p=class name]Paragraph text[/p]");
define("LANHELP_50", "Heading: for H2 [h]Heading text[/h] or [h=2]Heading text[/h]");
define("LANHELP_51", "Disable HTML new lines for enclosed text: [nobr]text[/nobr]");

View File

@@ -126,8 +126,16 @@ td.options { }
legend { display:none }
.btn { vertical-align: top; }
.bootstrap-select.btn-group, .bootstrap-select.btn-group[class*="span"] {
margin-bottom: 0px;
}
/*
.btn { vertical-align: top; }
*/
input::-webkit-input-placeholder { font-style:italic }

View File

@@ -19,7 +19,7 @@ a.media-select-icon { text-align:center; vertical-align:middle; margin:1px; bo
a.media-select-icon:hover { border:1px solid red; }
.media-select-container { padding:10px; }
.media-select-active { border: 2px solid silver; }
.media-select-active { border: 1px solid silver; }
.e-moving { background-color: silver; }
tr.highlight-even { background-color: silver; }