mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 12:20:44 +02:00
Merge branch 'master' of https://github.com/e107inc/e107
This commit is contained in:
@@ -3477,9 +3477,9 @@ class e_form
|
|||||||
{
|
{
|
||||||
return $this->renderInline($field,$id,$attributes['title'],$value,substr($value,0,50)."...",'textarea'); //FIXME.
|
return $this->renderInline($field,$id,$attributes['title'],$value,substr($value,0,50)."...",'textarea'); //FIXME.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$expand = '...';
|
$expand = '<span class="e-expandit-ellipsis">...</span>';
|
||||||
$toexpand = false;
|
$toexpand = false;
|
||||||
if($attributes['type'] == 'bbarea' && !isset($parms['bb'])) $parms['bb'] = true; //force bb parsing for bbareas
|
if($attributes['type'] == 'bbarea' && !isset($parms['bb'])) $parms['bb'] = true; //force bb parsing for bbareas
|
||||||
$elid = trim(str_replace('_', '-', $field)).'-'.$id;
|
$elid = trim(str_replace('_', '-', $field)).'-'.$id;
|
||||||
@@ -3489,17 +3489,11 @@ class e_form
|
|||||||
$ttl = vartrue($parms['expand']);
|
$ttl = vartrue($parms['expand']);
|
||||||
if($ttl == 1)
|
if($ttl == 1)
|
||||||
{
|
{
|
||||||
$ttl = $expand."<button class='btn btn-default btn-xs btn-mini pull-right'>More..</button>";
|
$dataAttr = "data-text-more='" . LAN_MORE . "' data-text-less='" . LAN_LESS . "'";
|
||||||
$ttl1 = "<button class='btn btn-default btn-xs btn-mini pull-right'>..Less</button>";
|
$ttl = $expand."<button class='btn btn-default btn-xs btn-mini pull-right' {$dataAttr}>" . LAN_MORE . "</button>";
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$ttl1 = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$expands = '<a href="#'.$elid.'-expand" class="e-show-if-js e-expandit">'.defset($ttl, $ttl)."</a>";
|
$expands = '<a href="#'.$elid.'-expand" class="e-show-if-js e-expandit">'.defset($ttl, $ttl)."</a>";
|
||||||
$contracts = '<a href="#'.$elid.'-expand" class="e-show-if-js e-expandit">'.defset($ttl1, $ttl1)."</a>";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$oldval = $value;
|
$oldval = $value;
|
||||||
@@ -3517,9 +3511,8 @@ class e_form
|
|||||||
if($toexpand)
|
if($toexpand)
|
||||||
{
|
{
|
||||||
// force hide! TODO - core style .expand-c (expand container)
|
// force hide! TODO - core style .expand-c (expand container)
|
||||||
// TODO: Hide 'More..' button when text fully displayed.
|
$value .= '<span class="expand-c" style="display: none" id="'.$elid.'-expand"><span>'.str_replace($value,'',$oldval).'</span></span>';
|
||||||
$value .= '<span class="expand-c" style="display: none" id="'.$elid.'-expand"><span>'.str_replace($value,'',$oldval).$contracts.'</span></span>';
|
$value .= varset($expands); // 'More..' button. Keep it at the bottom so it does't cut the sentence.
|
||||||
$value .= $expands; // 'More..' button. Keep it at the bottom so it does't cut the sentence.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -50,6 +50,7 @@ define("LAN_EDIT","Edit");
|
|||||||
define("LAN_DELETE","Delete");
|
define("LAN_DELETE","Delete");
|
||||||
define("LAN_DEFAULT","Default");
|
define("LAN_DEFAULT","Default");
|
||||||
define("LAN_MORE", "More..");
|
define("LAN_MORE", "More..");
|
||||||
|
define("LAN_LESS", "..Less");
|
||||||
define("LAN_READ_MORE", "Read more..");
|
define("LAN_READ_MORE", "Read more..");
|
||||||
define("LAN_GOPAGE", "Go to page");
|
define("LAN_GOPAGE", "Go to page");
|
||||||
define("LAN_GOTOPAGEX", "Go to page [x]");
|
define("LAN_GOTOPAGEX", "Go to page [x]");
|
||||||
|
@@ -326,6 +326,82 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Behavior to attach a click event to elements with .e-expandit class.
|
||||||
|
*
|
||||||
|
* @type {{attach: Function}}
|
||||||
|
*/
|
||||||
|
e107.behaviors.eExpandIt = {
|
||||||
|
attach: function (context, settings)
|
||||||
|
{
|
||||||
|
$(context).find('.e-expandit').once('e-expandit').each(function ()
|
||||||
|
{
|
||||||
|
// default 'toggle'.
|
||||||
|
$(this).click(function ()
|
||||||
|
{
|
||||||
|
var $this = $(this);
|
||||||
|
var href = ($this.is("a")) ? $this.attr("href") : '';
|
||||||
|
var $button = $this.find('button');
|
||||||
|
|
||||||
|
if($button.length > 0)
|
||||||
|
{
|
||||||
|
var textMore = $button.attr('data-text-more');
|
||||||
|
var textLess = $button.attr('data-text-less');
|
||||||
|
|
||||||
|
if(textLess && textMore)
|
||||||
|
{
|
||||||
|
if($button.html() == textMore)
|
||||||
|
{
|
||||||
|
$this.find('.e-expandit-ellipsis').hide();
|
||||||
|
$button.html(textLess);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this.find('.e-expandit-ellipsis').show();
|
||||||
|
$button.html(textMore);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if((href === "#" || href == "") && $this.attr("data-target"))
|
||||||
|
{
|
||||||
|
var select = $this.attr("data-target").split(','); // support multiple targets (comma separated)
|
||||||
|
|
||||||
|
$(select).each(function ()
|
||||||
|
{
|
||||||
|
$('#' + this).slideToggle("slow");
|
||||||
|
});
|
||||||
|
|
||||||
|
if($this.attr("data-return") === 'true')
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(href === "#" || href == "")
|
||||||
|
{
|
||||||
|
var idt = $(this).nextAll("div");
|
||||||
|
$(idt).slideToggle("slow");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$(href).slideToggle('slow', function ()
|
||||||
|
{
|
||||||
|
if($(this).is(':visible'))
|
||||||
|
{
|
||||||
|
$(this).css('display', 'initial');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dynamic next/prev.
|
* Dynamic next/prev.
|
||||||
*
|
*
|
||||||
@@ -439,52 +515,7 @@ $(document).ready(function()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// default 'toggle'.
|
|
||||||
$(".e-expandit").click(function () {
|
|
||||||
|
|
||||||
var href = ($(this).is("a")) ? $(this).attr("href") : '';
|
|
||||||
|
|
||||||
if((href === "#" || href == "") && $(this).attr("data-target"))
|
|
||||||
{
|
|
||||||
select = $(this).attr("data-target").split(','); // support multiple targets (comma separated)
|
|
||||||
|
|
||||||
$(select).each( function() {
|
|
||||||
|
|
||||||
$('#'+ this).slideToggle("slow");
|
|
||||||
});
|
|
||||||
|
|
||||||
if($(this).attr("data-return")==='true')
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(href === "#" || href == "")
|
|
||||||
{
|
|
||||||
idt = $(this).nextAll("div");
|
|
||||||
$(idt).slideToggle("slow");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//var id = $(this).attr("href");
|
|
||||||
$(href).slideToggle("slow");
|
|
||||||
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// On
|
// On
|
||||||
$(".e-expandit-on").click(function () {
|
$(".e-expandit-on").click(function () {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user