Commit f4740424 authored by Alex Vandiver's avatar Alex Vandiver
Browse files

From 3.6-EXPERIMENTAL-ABERDEEN:

Rich text editing
zh_tw.po updates
EmailInput refactoring, for possible later autocompleter

Also:
Unification of a couple "permission denied" messages
Clean up prototype/scriptaculous files
license tag new files

git-svn-id: svn+ssh://svn.bestpractical.com/svn/bps-public/rt/branches/3.8-TESTING@11964 e417ac7c-1bcc-0310-8ffa-8f5827389a85
parent a2d9cada
......@@ -467,6 +467,9 @@ Set($MessageBoxHeight, 15);
# Default wrapping: "HARD" (choices "SOFT", "HARD")
Set($MessageBoxWrap, "HARD");
# Should "rich text" editing for email messages be turned on?
Set($MessageBoxRichText, 1);
# Support implicit links in WikiText custom fields? A true value
# causes InterCapped or ALLCAPS words in WikiText fields to
# automatically become links to searches for those words. If used on
......
......@@ -45,9 +45,6 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/libs/prototype.js"></script>
<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/libs/scriptaculous/effects.js"></script>
<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/libs/scriptaculous/controls.js"></script>
% if ( $Multiple ) {
<textarea cols="<% $Cols %>" rows="<% $Rows %>" name="<% $name %>-Values" id="<% $name %>-Values" ><% $Default %></textarea><div id="<% $name %>-Choices" class="autocomplete"></div>
<script type="text/javascript">
......
......@@ -45,3 +45,9 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
<input name="<% $Name %>" size="<% $Size %>" value="<% $Default || '' %>" />
<%ARGS>
$Name
$Size => 40
$Default => ''
</%ARGS>
......@@ -52,11 +52,54 @@ $onload => undef
<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/util.js"></script>
<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/titlebox-state.js"></script>
<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/ahah.js"></script>
<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/prototype/prototype.js"></script>
<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/scriptaculous/scriptaculous.js?load=effects,controls"></script>
% if ( RT->Config->Get('MessageBoxRichText')) {
<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/RichText/fckeditor.js"></script>
% }
<script type="text/javascript"><!--
onLoadHook("loadTitleBoxStates()");
% if ( $focus ) {
onLoadHook("focusElementById('<% $focus %>')");
% }
% if ( RT->Config->Get('MessageBoxRichText')) {
function ReplaceAllTextareas() {
// replace all content and signature message boxes
var allTextAreas = document.getElementsByTagName("textarea");
for (var i=0; i < allTextAreas.length; i++) {
var textArea = allTextAreas[i];
if ( (textArea.getAttribute('class') == 'messagebox')
|| (textArea.getAttribute('className') == 'messagebox')) {
// Turn the original plain text content into HTML
%# Special case - When continuing an edit session with attachment, keep the HTMLified content.
% if (!$m->request_args->{'AddMoreAttach'}) {
textArea.value = textArea.value.replace(
/&/g, "&amp;"
).replace(
/</g, "&lt;"
).replace(
/>/g, "&gt;"
).replace(
/\n/g, "\n<br />"
);
% }
var typeField = document.createElement('input');
typeField.setAttribute('type', 'hidden');
typeField.setAttribute('name', textArea.name + 'Type');
typeField.setAttribute('value', 'text/html');
textArea.parentNode.appendChild(typeField);
var oFCKeditor = new FCKeditor( textArea.name ) ;
oFCKeditor.BasePath = "/NoAuth/RichText/";
oFCKeditor.ReplaceTextarea();
}
}
}
onLoadHook("ReplaceAllTextareas()");
% }
% if ( $onload ) {
onLoadHook("<% $onload |n %>");
% }
......
......@@ -47,16 +47,22 @@
%# END BPS TAGGED BLOCK }}}
<select name="GroupField">
% foreach my $col (RT::Group->BasicColumns) {
<option value="<% $col->[0] %>"><% loc($col->[1]) %></option>
<option <% ($GroupField eq $col->[0]) ? 'SELECTED' : '' %> value="<% $col->[0] %>"><% loc($col->[1]) %></option>
% }
% while (my $CF = $CFs->Next) {
<option value="CustomField-<% $CF->Id %>"><&|/l&>CustomField</&>: <% $CF->Name %></option>
% my $val = "CustomField-" . $CF->Id;
<option <% ($GroupField eq $val) ? 'SELECTED' : '' %> value="<% $val %>"><&|/l&>CustomField</&>: <% $CF->Name %></option>
% }
</select>
<& /Elements/SelectMatch, Name=> 'GroupOp' &>
<input size="8" name="GroupString" />
<& /Elements/SelectMatch, Name => 'GroupOp', Default => $GroupOp &>
<input size="8" name="GroupString" value="<% $GroupString %>" />
<%INIT>
my $CFs = RT::CustomFields->new($session{'CurrentUser'});
$CFs->LimitToChildType('RT::Group');
$CFs->OrderBy( FIELD => 'Name' );
</%INIT>
<%ARGS>
$GroupField => ''
$GroupOp => ''
$GroupString => ''
</%ARGS>
......@@ -46,16 +46,12 @@
%#
%# END BPS TAGGED BLOCK }}}
<select name="<%$Name%>">
<option value="MemberOf"><&|/l&>Member of</&></option>
<option value="DependsOn"><&|/l&>Depends on</&></option>
<option value="RefersTo"><&|/l&>Refers to</&></option>
<option <% ($Default eq 'MemberOf') ? 'selected="selected"' : '' %> value="MemberOf"><&|/l&>Member of</&></option>
<option <% ($Default eq 'DependsOn') ? 'selected="selected"' : '' %> value="DependsOn"><&|/l&>Depends on</&></option>
<option <% ($Default eq 'RefersTo') ? 'selected="selected"' : '' %> value="RefersTo"><&|/l&>Refers to</&></option>
</select>
<%ARGS>
$Name => "LinkType"
$Default => undef
$Default => ''
</%ARGS>
<%INIT>
# TODO handle Default
</%INIT>
......@@ -67,13 +67,13 @@ my $FalseDefault='';
my $LikeDefault='';
my $NotLikeDefault ='';
if ($Default && $Default =~ /false/i) {
if ($Default && $Default =~ /false|!=/i) {
$FalseDefault = qq[ selected="selected"];
}
elsif ($Default && $Default =~ /true/i) {
elsif ($Default && $Default =~ /true|=/i) {
$TrueDefault = qq[ selected="selected"];
}
elsif ($Default && $Default =~ /notlike/i) {
elsif ($Default && $Default =~ /notlike|NOT LIKE/i) {
$NotLikeDefault = qq[ selected="selected"];
}
else {
......
......@@ -47,16 +47,22 @@
%# END BPS TAGGED BLOCK }}}
<select name="UserField">
% foreach my $col (RT::User->BasicColumns) {
<option value="<% $col->[0] %>"><% loc($col->[1]) %></option>
<option <% ($UserField eq $col->[0]) ? 'SELECTED' : '' %> value="<% $col->[0] %>"><% loc($col->[1]) %></option>
% }
% while (my $CF = $CFs->Next) {
<option value="CustomField-<% $CF->Id %>"><&|/l&>CustomField</&>: <% $CF->Name %></option>
% my $val = "CustomField-" . $CF->Id;
<option <% ($UserField eq $val) ? 'SELECTED' : '' %> value="<% $val %>"><&|/l&>CustomField</&>: <% $CF->Name %></option>
% }
</select>
<& /Elements/SelectMatch, Name=> 'UserOp' &>
<input size="8" name="UserString" />
<& /Elements/SelectMatch, Name => 'UserOp', Default => $UserOp &>
<input size="8" name="UserString" value="<% $UserString %>" />
<%INIT>
my $CFs = RT::CustomFields->new($session{'CurrentUser'});
$CFs->LimitToChildType('RT::User');
$CFs->OrderBy( FIELD => 'Name' );
</%INIT>
<%ARGS>
$UserField => ''
$UserOp => ''
$UserString => ''
</%ARGS>
......@@ -45,3 +45,18 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
<public:component lightweight="true">
<script language="javascript">
function CancelEvent()
{
return false ;
}
this.onresizestart = CancelEvent ;
this.onbeforeeditfocus = CancelEvent ;
</script>
</public:component>
%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
%# This software is Copyright (c) 1996-2008 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
%#
%#
%# LICENSE:
%#
%# This work is made available to you under the terms of Version 2 of
%# the GNU General Public License. A copy of that license should have
%# been provided with this software, but in any event can be snarfed
%# from www.gnu.org.
%#
%# This work is distributed in the hope that it will be useful, but
%# WITHOUT ANY WARRANTY; without even the implied warranty of
%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
%# General Public License for more details.
%#
%# You should have received a copy of the GNU General Public License
%# along with this program; if not, write to the Free Software
%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
%# 02110-1301 or visit their web page on the internet at
%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
%#
%# (The following paragraph is not intended to limit the rights granted
%# to you to modify and distribute this software under the terms of
%# the GNU General Public License and is only of importance to you if
%# you choose to contribute your changes and enhancements to the
%# community by submitting them to Best Practical Solutions, LLC.)
%#
%# By intentionally submitting any modifications, corrections or
%# derivatives to this work, or any other work intended for use with
%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
%# you are the copyright holder for those contributions and you grant
%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
%# royalty-free, perpetual, license to use, copy, create derivative
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
<public:component lightweight="true">
<public:attach event="oncontentready" onevent="ShowBorders()" />
<public:attach event="onpropertychange" onevent="OnPropertyChange()" />
<script language="javascript">
var oClassRegex = /\s*FCK__ShowTableBorders/ ;
function ShowBorders()
{
if ( this.border == 0 )
{
if ( !oClassRegex.test( this.className ) )
this.className += ' FCK__ShowTableBorders' ;
}
else
{
if ( oClassRegex.test( this.className ) )
{
this.className = this.className.replace( oClassRegex, '' ) ;
if ( this.className.length == 0 )
this.removeAttribute( 'className', 0 ) ;
}
}
}
function OnPropertyChange()
{
if ( event.propertyName == 'border' || event.propertyName == 'className' )
ShowBorders.call(this) ;
}
</script>
</public:component>
/*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
* Licensed under the terms of any of the following licenses at your
* choice:
*
* - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html
*
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html
*
* - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html
*
* == END LICENSE ==
*
* This is the default CSS file used by the editor area. It defines the
* initial font of the editor and background color.
*
* A user can configure the editor to use another CSS file. Just change
* the value of the FCKConfig.EditorAreaCSS key in the configuration
* file.
*/
/*
The "body" styles should match your editor web site, mainly regarding
background color and font family and size.
*/
body
{
background-color: #ffffff;
padding: 5px 5px 5px 5px;
margin: 0px;
}
body, td
{
font-family: Arial, Verdana, sans-serif;
font-size: 12px;
}
a[href]
{
color: -moz-hyperlinktext !important; /* For Firefox... mark as important, otherwise it becomes black */
text-decoration: -moz-anchor-decoration; /* For Firefox 3, otherwise no underline will be used */
}
/*
Just uncomment the following block if you want to avoid spaces between
paragraphs. Remember to apply the same style in your output front end page.
*/
/*
p, ul, li
{
margin-top: 0px;
margin-bottom: 0px;
}
*/
/*
The following are some sample styles used in the "Styles" toolbar command.
You should instead remove them, and include the styles used by the site
you are using the editor in.
*/
.Bold
{
font-weight: bold;
}
.Title
{
font-weight: bold;
font-size: 18px;
color: #cc3300;
}
.Code
{
border: #8b4513 1px solid;
padding-right: 5px;
padding-left: 5px;
color: #000066;
font-family: 'Courier New' , Monospace;
background-color: #ff9933;
}
/*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
* Licensed under the terms of any of the following licenses at your
* choice:
*
* - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html
*
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html
*
* - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html
*
* == END LICENSE ==
*
* This CSS Style Sheet defines rules used by the editor for its internal use.
*/
/* Fix to allow putting the caret at the end of the content in Firefox if
clicking below the content. */
html
{
min-height: 100%;
}
table.FCK__ShowTableBorders, table.FCK__ShowTableBorders td, table.FCK__ShowTableBorders th
{
border: #d3d3d3 1px solid;
}
form
{
border: 1px dotted #FF0000;
padding: 2px;
}
.FCK__Flash
{
border: #a9a9a9 1px solid;
background-position: center center;
background-image: url(images/fck_flashlogo.gif);
background-repeat: no-repeat;
width: 80px;
height: 80px;
}
/* Empty anchors images */
.FCK__Anchor
{
border: 1px dotted #00F;
background-position: center center;
background-image: url(images/fck_anchor.gif);
background-repeat: no-repeat;
width: 16px;
height: 15px;
vertical-align: middle;
}
/* Anchors with content */
.FCK__AnchorC
{
border: 1px dotted #00F;
background-position: 1px center;
background-image: url(images/fck_anchor.gif);
background-repeat: no-repeat;
padding-left: 18px;
}
/* Any anchor for non-IE, if we combine it with the previous rule IE ignores all. */
a[name]
{
border: 1px dotted #00F;
background-position: 0 center;
background-image: url(images/fck_anchor.gif);
background-repeat: no-repeat;
padding-left: 18px;
}
.FCK__PageBreak
{
background-position: center center;
background-image: url(images/fck_pagebreak.gif);
background-repeat: no-repeat;
clear: both;
display: block;
float: none;
width: 100%;
border-top: #999999 1px dotted;
border-bottom: #999999 1px dotted;
border-right: 0px;
border-left: 0px;
height: 5px;
}
/* Hidden fields */
.FCK__InputHidden
{
width: 19px;
height: 18px;
background-image: url(images/fck_hiddenfield.gif);
background-repeat: no-repeat;
vertical-align: text-bottom;
background-position: center center;
}
.FCK__ShowBlocks p,
.FCK__ShowBlocks div,
.FCK__ShowBlocks pre,
.FCK__ShowBlocks address,
.FCK__ShowBlocks blockquote,
.FCK__ShowBlocks h1,
.FCK__ShowBlocks h2,
.FCK__ShowBlocks h3,
.FCK__ShowBlocks h4,
.FCK__ShowBlocks h5,
.FCK__ShowBlocks h6
{
background-repeat: no-repeat;
border: 1px dotted gray;
padding-top: 8px;
padding-left: 8px;
}
.FCK__ShowBlocks p
{
background-image: url(images/block_p.png);
}
.FCK__ShowBlocks div
{
background-image: url(images/block_div.png);
}
.FCK__ShowBlocks pre
{
background-image: url(images/block_pre.png);
}
.FCK__ShowBlocks address
{
background-image: url(images/block_address.png);
}
.FCK__ShowBlocks blockquote
{
background-image: url(images/block_blockquote.png);
}
.FCK__ShowBlocks h1
{
background-image: url(images/block_h1.png);
}
.FCK__ShowBlocks h2
{
background-image: url(images/block_h2.png);
}
.FCK__ShowBlocks h3
{
background-image: url(images/block_h3.png);
}
.FCK__ShowBlocks h4
{
background-image: url(images/block_h4.png);
}
.FCK__ShowBlocks h5
{
background-image: url(images/block_h5.png);
}
.FCK__ShowBlocks h6
{
background-image: url(images/block_h6.png);
}
/*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
* Licensed under the terms of any of the following licenses at your
* choice:
*
* - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html
*
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html
*
* - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html
*
* == END LICENSE ==
*
* This CSS Style Sheet defines the rules to show table borders on Gecko.
*/
/* For tables with the "border" attribute set to "0" */
table[border="0"],
table[border="0"] > tr > td, table[border="0"] > tr > th,
table[border="0"] > tbody > tr > td, table[border="0"] > tbody > tr > th,
table[border="0"] > thead > tr > td, table[border="0"] > thead > tr > th,
table[border="0"] > tfoot > tr > td, table[border="0"] > tfoot > tr > th
{
border: #d3d3d3 1px dotted ;
}
/* For tables with no "border" attribute set */
table:not([border]),
table:not([border]) > tr > td, table:not([border]) > tr > th,
table:not([border]) > tbody > tr > td, table:not([border]) > tbody > tr > th,
table:not([border]) > thead > tr > td, table:not([border]) > thead > tr > th,
table:not([border]) > tfoot > tr > td, table:not([border]) > tfoot > tr > th
{
border: #d3d3d3 1px dotted ;
}