fixed #10667: cannot change size of template editor
This commit is contained in:
parent
ecd89d349a
commit
38ff4f053b
7 changed files with 72 additions and 205 deletions
|
|
@ -1,4 +1,5 @@
|
|||
7.7.17
|
||||
- fixed #10667: cannot change size of template editor
|
||||
- fixed #10654: Story Archive: Search not working properly
|
||||
- fixed #10692: Unprivileged users can stop spectre
|
||||
- fixed search indexer concatenates keywords to content.
|
||||
|
|
|
|||
|
|
@ -133,40 +133,43 @@ Renders a code area field.
|
|||
=cut
|
||||
|
||||
sub toHtml {
|
||||
my $self = shift;
|
||||
my $output = "";
|
||||
|
||||
# Do our superclass's job
|
||||
my $self = shift;
|
||||
my ($style, $url, $stow) = $self->session->quick(qw(style url stow));
|
||||
|
||||
my $value = $self->fixMacros($self->fixTags($self->fixSpecialCharacters(scalar $self->getOriginalValue)));
|
||||
my $width = $self->get('width') || 400;
|
||||
my $height = $self->get('height') || 150;
|
||||
my ($style, $url) = $self->session->quick(qw(style url));
|
||||
my $styleAttribute = "width: ".$width."px; height: ".$height."px; ".$self->get("style");
|
||||
$style->setRawHeadTags(qq|<style type="text/css">\ntextarea#|.$self->get('id').qq|{ $styleAttribute }\n</style>|);
|
||||
$output = '<textarea id="'.$self->get('id').'" name="'.$self->get("name").'" '.$self->get("extras").' rows="#" cols="#" style="width: '.$width.'px; height: '.$height.'px;">'.$value.'</textarea>';
|
||||
my $width = $self->get('width') || 400;
|
||||
my $height = $self->get('height') || 150;
|
||||
my $id = $self->get('id');
|
||||
my $name = $self->get('name');
|
||||
my $extras = $self->get('extras');
|
||||
my $syntax = $self->get('syntax');
|
||||
my $styleAttr = $self->get('style');
|
||||
|
||||
# Vars for JS below
|
||||
my $id = $self->get( "id" );
|
||||
my $syntax = $self->get( "syntax" );
|
||||
my $editareaPath = $self->session->url->extras( 'editarea' );
|
||||
|
||||
$self->session->style->setScript($editareaPath . '/edit_area/edit_area_full.js',{type=>"text/javascript"});
|
||||
$output .= qq~
|
||||
<script type="text/javascript">
|
||||
editAreaLoader.init({
|
||||
id : "$id",
|
||||
syntax : "$syntax",
|
||||
start_highlight : true,
|
||||
show_line_colors: true,
|
||||
display : "later",
|
||||
toolbar : "search, go_to_line, |, undo, redo, |, syntax_selection, highlight, reset_highlight, |, help"
|
||||
});
|
||||
</script>
|
||||
~;
|
||||
|
||||
return $output;
|
||||
$style->setLink($url->extras("yui/build/resize/assets/skins/sam/resize.css"), {type=>"text/css", rel=>"stylesheet"});
|
||||
$style->setScript($url->extras("yui/build/utilities/utilities.js"), {type=>"text/javascript"});
|
||||
$style->setScript($url->extras("yui/build/resize/resize-min.js"), {type=>"text/javascript"});
|
||||
$style->setScript($url->extras('editarea/edit_area/edit_area_full.js'), {type=>"text/javascript"});
|
||||
my $out = <<"END_HTML";
|
||||
<div id="${id}_resizewrapper" style="padding-right: 6px; padding-bottom: 6px; margin-bottom: 1em; width: ${width}px; height: ${height}px">
|
||||
<textarea id="$id" name="$name" $extras rows="#" cols="#" style="font-family: monospace; $styleAttr; height: 100%; width: 100%;">$value</textarea>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
var resize = new YAHOO.util.Resize('${id}_resizewrapper', {useShim : true});
|
||||
editAreaLoader.init({
|
||||
id : '$id',
|
||||
syntax : '$syntax',
|
||||
start_highlight : true,
|
||||
show_line_colors : true,
|
||||
allow_resize : 'no',
|
||||
display : 'later',
|
||||
toolbar : 'search,go_to_line,|,undo,redo,|,syntax_selection,highlight,reset_highlight,|,help'
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
END_HTML
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -143,61 +143,44 @@ sub toHtml {
|
|||
my $width = $self->get('width') || 400;
|
||||
my $height = $self->get('height') || 150;
|
||||
my ($style, $url, $stow) = $self->session->quick(qw(style url stow));
|
||||
my $out = '<textarea id="'.$self->get('id').'" name="'.$self->get("name").'" '
|
||||
. ( $self->get("maxlength") ? 'maxlength="' . $self->get( "maxlength" ) . '" ' : '' )
|
||||
. $self->get("extras") . ' rows="#" cols="#" style="width: '.$width.'px; height: '.$height.'px;">'.$value.'</textarea>'
|
||||
;
|
||||
my $sizeStyle = ' width: ' . $width . 'px; height: ' . $height . 'px;';
|
||||
my $out
|
||||
= '<textarea id="' . $self->get('id') . '"'
|
||||
. ' name="' . $self->get("name") . '"'
|
||||
. ( $self->get("maxlength") ? ' maxlength="' . $self->get( "maxlength" ) . '"' : '' )
|
||||
. ' ' . $self->get("extras")
|
||||
. ' rows="#" cols="#"'
|
||||
. ' style="' . $self->get('style')
|
||||
. ( $self->get("resizable") ? ' height: 100%; width: 100%' : $sizeStyle ) . '"'
|
||||
. '>' . $value . '</textarea>';
|
||||
|
||||
# Add the maxlength script
|
||||
$style->setScript(
|
||||
$url->extras( 'yui/build/yahoo-dom-event/yahoo-dom-event.js' ),
|
||||
{ type => 'text/javascript' },
|
||||
);
|
||||
$style->setScript(
|
||||
$url->extras( 'yui-webgui/build/form/textarea.js' ),
|
||||
{ type => 'text/javascript' },
|
||||
);
|
||||
|
||||
# Make sure we load the css for this plugin only once per id.
|
||||
unless ( $stow->get( 'textareaStyleLoaded_' . $self->get('id') ) ) {
|
||||
my $styleAttribute = "width: ".$width."px; height: ".$height."px; ".$self->get("style");
|
||||
$style->setRawHeadTags(qq|<style type="text/css">\ntextarea#|.$self->get('id').qq|{ $styleAttribute }\n</style>|);
|
||||
$stow->set( 'textareaStyleLoaded_' . $self->get('id'), 1 );
|
||||
}
|
||||
# Make sure we add the max length js only once for all texatareas.
|
||||
unless ( $stow->get( 'texareaHeadTagsLoaded' ) ) {
|
||||
$style->setRawHeadTags( q|
|
||||
<script type="text/javascript">
|
||||
YAHOO.util.Event.onDOMReady( function () { WebGUI.Form.Textarea.setMaxLength() } );
|
||||
</script>
|
||||
| );
|
||||
|
||||
$stow->set( 'texareaHeadTagsLoaded', 1 );
|
||||
}
|
||||
|
||||
if ($self->get("resizable")) {
|
||||
$style->setLink($url->extras("resize.css"), {type=>"text/css", rel=>"stylesheet"});
|
||||
$style->setLink($url->extras("resize-skin.css"), {type=>"text/css", rel=>"stylesheet"});
|
||||
if ($self->get("resizable")) {
|
||||
$style->setLink($url->extras("yui/build/resize/assets/skins/sam/resize.css"), {type=>"text/css", rel=>"stylesheet"});
|
||||
$style->setScript($url->extras("yui/build/utilities/utilities.js"), {type=>"text/javascript"});
|
||||
$style->setScript($url->extras("yui/build/resize/resize.js"), {type=>"text/javascript"});
|
||||
$out = qq|
|
||||
<div id="resize_| . $self->get('id'). qq|" style="width: | . ($width + 6) . qq|px; height: | . ($height + 6) . qq|px; overflow: hidden">
|
||||
$out
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
YAHOO.util.Event.onContentReady('| . $self->get('id') . qq|', function() {
|
||||
var Dom = YAHOO.util.Dom;
|
||||
var resize = new YAHOO.util.Resize('resize_| . $self->get('id'). qq|');
|
||||
resize.on('resize', function(ev) {
|
||||
Dom.setStyle('| . $self->get('id') . qq|', 'width', (ev.width - 6) + "px");
|
||||
Dom.setStyle('| . $self->get('id') . qq|', 'height', (ev.height - 6) + "px");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|;
|
||||
}
|
||||
return $out;
|
||||
$style->setScript($url->extras("yui/build/resize/resize-min.js"), {type=>"text/javascript"});
|
||||
$out = sprintf <<'END_HTML', $self->get('id'), $out, $sizeStyle;
|
||||
<div id="%1$s_resizewrapper" style="padding-right: 6px; padding-bottom: 6px; %3$s">%2$s</div>
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
var resize = new YAHOO.util.Resize('%1$s_resizewrapper');
|
||||
})();
|
||||
</script>
|
||||
END_HTML
|
||||
}
|
||||
elsif ($self->get('maxlength')) {
|
||||
$style->setScript(
|
||||
$url->extras( 'yui/build/yahoo-dom-event/yahoo-dom-event.js' ),
|
||||
{ type => 'text/javascript' },
|
||||
);
|
||||
}
|
||||
if ($self->get('maxlength')) {
|
||||
# Add the maxlength script
|
||||
$style->setScript(
|
||||
$url->extras( 'yui-webgui/build/form/textarea.js' ),
|
||||
{ type => 'text/javascript' },
|
||||
);
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB |
|
|
@ -1,114 +0,0 @@
|
|||
/*
|
||||
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 2.5.0
|
||||
*/
|
||||
/* Give the handle a background color */
|
||||
.yui-resize .yui-resize-handle {
|
||||
/*background-color: #0000FF;*/
|
||||
}
|
||||
/* Give the active handle a different color */
|
||||
.yui-resize .yui-resize-handle-active {
|
||||
background-color: #7D98B8;
|
||||
zoom: 1;
|
||||
}
|
||||
/* Give a border to the 8-way knob style handles */
|
||||
.yui-resize-knob .yui-resize-handle {
|
||||
border: 1px solid #808080;
|
||||
}
|
||||
/* Show the active handle when hovered */
|
||||
.yui-resize-hover .yui-resize-handle-active {
|
||||
opacity: 1;
|
||||
filter: alpha(opacity=100);
|
||||
}
|
||||
|
||||
/* Style the resize proxy */
|
||||
.yui-resize-proxy {
|
||||
border: 1px dashed #426FD9;
|
||||
}
|
||||
|
||||
/* Style the status box similar to a tooltip */
|
||||
.yui-resize-status {
|
||||
border: 1px solid #A6982B;
|
||||
border-top: 1px solid #D4C237;
|
||||
background-color: #FFEE69
|
||||
}
|
||||
|
||||
|
||||
/* Style the content of the status box */
|
||||
.yui-resize-status strong, .yui-resize-status em {
|
||||
float: left;
|
||||
display: block;
|
||||
clear: both;
|
||||
padding: 1px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Setup the gripper */
|
||||
.yui-resize .yui-resize-handle-inner-r,
|
||||
.yui-resize .yui-resize-handle-inner-l {
|
||||
background: transparent url( layout_sprite.png) no-repeat 0 -5px;
|
||||
height: 16px;
|
||||
width: 5px;
|
||||
position: absolute;
|
||||
top: 45%;
|
||||
}
|
||||
|
||||
/* Setup the gripper */
|
||||
.yui-resize .yui-resize-handle-inner-t,
|
||||
.yui-resize .yui-resize-handle-inner-b {
|
||||
background: transparent url(layout_sprite.png) no-repeat -20px 0;
|
||||
height: 5px;
|
||||
width: 16px;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
/* Bottom Right Gripper */
|
||||
.yui-resize .yui-resize-handle-br {
|
||||
background-image: url( layout_sprite.png );
|
||||
background-repeat: no-repeat;
|
||||
background-position: -22px -62px;
|
||||
}
|
||||
|
||||
/* Top Right Gripper */
|
||||
.yui-resize .yui-resize-handle-tr {
|
||||
background-image: url( layout_sprite.png );
|
||||
background-repeat: no-repeat;
|
||||
background-position: -22px -42px;
|
||||
}
|
||||
|
||||
/* Top Left Gripper */
|
||||
.yui-resize .yui-resize-handle-tl {
|
||||
background-image: url( layout_sprite.png );
|
||||
background-repeat: no-repeat;
|
||||
background-position: -22px -82px;
|
||||
}
|
||||
|
||||
/* Bottom Left Gripper */
|
||||
.yui-resize .yui-resize-handle-bl {
|
||||
background-image: url( layout_sprite.png );
|
||||
background-repeat: no-repeat;
|
||||
background-position: -22px -23px;
|
||||
}
|
||||
|
||||
/* Remove the background image from the 8-way knobs */
|
||||
.yui-resize-knob .yui-resize-handle-t,
|
||||
.yui-resize-knob .yui-resize-handle-r,
|
||||
.yui-resize-knob .yui-resize-handle-b,
|
||||
.yui-resize-knob .yui-resize-handle-l,
|
||||
.yui-resize-knob .yui-resize-handle-tl,
|
||||
.yui-resize-knob .yui-resize-handle-tr,
|
||||
.yui-resize-knob .yui-resize-handle-bl,
|
||||
.yui-resize-knob .yui-resize-handle-br,
|
||||
.yui-resize-knob .yui-resize-handle-inner-t,
|
||||
.yui-resize-knob .yui-resize-handle-inner-r,
|
||||
.yui-resize-knob .yui-resize-handle-inner-b,
|
||||
.yui-resize-knob .yui-resize-handle-inner-l,
|
||||
.yui-resize-knob .yui-resize-handle-inner-tl,
|
||||
.yui-resize-knob .yui-resize-handle-inner-tr,
|
||||
.yui-resize-knob .yui-resize-handle-inner-bl,
|
||||
.yui-resize-knob .yui-resize-handle-inner-br {
|
||||
background-image: none;
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
/*
|
||||
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 2.5.0
|
||||
*/
|
||||
.yui-resize{position:relative;zoom:1;z-index:0;}.yui-resize-wrap{zoom:1;}.yui-draggable{cursor:move;}.yui-resize .yui-resize-handle{position:absolute;z-index:1;font-size:0;margin:0;padding:0;zoom:1;height:1px;width:1px;}.yui-resize .yui-resize-handle-br{height:5px;width:5px;bottom:0;right:0;cursor:se-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-bl{height:5px;width:5px;bottom:0;left:0;cursor:sw-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-tl{height:5px;width:5px;top:0;left:0;cursor:nw-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-tr{height:5px;width:5px;top:0;right:0;cursor:ne-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-r{width:5px;height:100%;top:0;right:0;cursor:e-resize;zoom:1;}.yui-resize .yui-resize-handle-l{height:100%;width:5px;top:0;left:0;cursor:w-resize;zoom:1;}.yui-resize .yui-resize-handle-b{width:100%;height:5px;bottom:0;right:0;cursor:s-resize;zoom:1;}.yui-resize .yui-resize-handle-t{width:100%;height:5px;top:0;right:0;cursor:n-resize;zoom:1;}.yui-resize-proxy{position:absolute;border:1px dashed #000;visibility:hidden;z-index:1000;}.yui-resize-hover .yui-resize-handle,.yui-resize-hidden .yui-resize-handle{opacity:0;filter:alpha(opacity=0);}.yui-resize-ghost{opacity:.5;filter:alpha(opacity=50);}.yui-resize-knob .yui-resize-handle{height:6px;width:6px;}.yui-resize-knob .yui-resize-handle-tr{right:-3px;top:-3px;}.yui-resize-knob .yui-resize-handle-tl{left:-3px;top:-3px;}.yui-resize-knob .yui-resize-handle-bl{left:-3px;bottom:-3px;}.yui-resize-knob .yui-resize-handle-br{right:-3px;bottom:-3px;}.yui-resize-knob .yui-resize-handle-t{left:45%;top:-3px;}.yui-resize-knob .yui-resize-handle-r{right:-3px;top:45%;}.yui-resize-knob .yui-resize-handle-l{left:-3px;top:45%;}.yui-resize-knob .yui-resize-handle-b{left:45%;bottom:-3px;}.yui-resize-status{position:absolute;top:-999px;left:-999px;padding:2px;font-size:80%;display:none;zoom:1;z-index:9999;}.yui-resize-status strong,.yui-resize-status em{font-weight:normal;font-style:normal;padding:1px;zoom:1;}.yui-resize .yui-resize-handle{background-color:#F2F2F2;}.yui-resize .yui-resize-handle-active{background-color:#7D98B8;zoom:1;}.yui-resize-knob .yui-resize-handle{border:1px solid #808080;}.yui-resize-hover .yui-resize-handle-active{opacity:1;filter:alpha(opacity=100);}.yui-resize-proxy{border:1px dashed #426FD9;}.yui-resize-status{border:1px solid #A6982B;border-top:1px solid #D4C237;background-color:#FFEE69}.yui-resize-status strong,.yui-resize-status em{float:left;display:block;clear:both;padding:1px;text-align:center;}.yui-resize .yui-resize-handle-inner-r,.yui-resize .yui-resize-handle-inner-l{background:transparent url( layout_sprite.png) no-repeat 0 -5px;height:16px;width:5px;position:absolute;top:45%;}.yui-resize .yui-resize-handle-inner-t,.yui-resize .yui-resize-handle-inner-b{background:transparent url(layout_sprite.png) no-repeat -20px 0;height:5px;width:16px;position:absolute;left:50%;}.yui-resize .yui-resize-handle-br{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -62px;}.yui-resize .yui-resize-handle-tr{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -42px;}.yui-resize .yui-resize-handle-tl{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -82px;}.yui-resize .yui-resize-handle-bl{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -23px;}.yui-resize-knob .yui-resize-handle-t,.yui-resize-knob .yui-resize-handle-r,.yui-resize-knob .yui-resize-handle-b,.yui-resize-knob .yui-resize-handle-l,.yui-resize-knob .yui-resize-handle-tl,.yui-resize-knob .yui-resize-handle-tr,.yui-resize-knob .yui-resize-handle-bl,.yui-resize-knob .yui-resize-handle-br,.yui-resize-knob .yui-resize-handle-inner-t,.yui-resize-knob .yui-resize-handle-inner-r,.yui-resize-knob .yui-resize-handle-inner-b,.yui-resize-knob .yui-resize-handle-inner-l,.yui-resize-knob .yui-resize-handle-inner-tl,.yui-resize-knob .yui-resize-handle-inner-tr,.yui-resize-knob .yui-resize-handle-inner-bl,.yui-resize-knob .yui-resize-handle-inner-br{background-image:none;}
|
||||
1
www/extras/yui-webgui/build/form/textarea.js
vendored
1
www/extras/yui-webgui/build/form/textarea.js
vendored
|
|
@ -36,4 +36,5 @@ WebGUI.Form.Textarea.setMaxLength
|
|||
}
|
||||
}
|
||||
|
||||
YAHOO.util.Event.onDOMReady( function () { WebGUI.Form.Textarea.setMaxLength() } );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue