[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.4-46-g2ce7553
Thomas Sibley
trs at bestpractical.com
Fri Oct 1 11:30:11 EDT 2010
The branch, 3.9-trunk has been updated
via 2ce755353afc6ba9f513e2363137c0f7b2545d3e (commit)
via 65cf1dd43982afa479cb4264239b41eaffbb553b (commit)
via 7d95eb98c9f8ba74e63c5440da0241be6599275a (commit)
via 8bc3938eb4f6da7c90c0337028710963e22b5a76 (commit)
from 57b5513cc99191e6bf0624c18a7ce038f2ae8bbc (commit)
Summary of changes:
share/html/Admin/Elements/EditRights | 15 +++-
share/html/NoAuth/js/userautocomplete.js | 4 +-
share/html/NoAuth/js/util.js | 131 +++++++++++++++--------------
3 files changed, 81 insertions(+), 69 deletions(-)
- Log -----------------------------------------------------------------
commit 8bc3938eb4f6da7c90c0337028710963e22b5a76
Author: Thomas Sibley <trs at bestpractical.com>
Date: Fri Oct 1 11:00:57 2010 -0400
Fix over-indenting of the last few blocks
diff --git a/share/html/NoAuth/js/util.js b/share/html/NoAuth/js/util.js
index db89ff4..5cb34fc 100644
--- a/share/html/NoAuth/js/util.js
+++ b/share/html/NoAuth/js/util.js
@@ -213,67 +213,67 @@ function doOnLoad( js ) {
}
jQuery(function() {
- jQuery(".ui-datepicker:not(.withtime)").datepicker( {
- dateFormat: 'yy-mm-dd',
- constrainInput: false
- } );
-
- jQuery(".ui-datepicker.withtime").datepicker( {
- dateFormat: 'yy-mm-dd',
- constrainInput: false,
- onSelect: function( dateText, inst ) {
- // trigger timepicker to get time
- var button = document.createElement('input');
- button.setAttribute('type', 'button');
- jQuery(button).width('5em');
- jQuery(button).insertAfter(this);
- jQuery(button).timepickr({val: '00:00'});
- var date_input = this;
-
- jQuery(button).blur( function() {
- var time = jQuery(button).val();
- if ( ! time.match(/\d\d:\d\d/) ) {
- time = '00:00';
- }
- jQuery(date_input).val( dateText + ' ' + time + ':00' );
- jQuery(button).remove();
- } );
-
- jQuery(button).focus();
- }
- } );
- });
-
- function ReplaceAllTextareas(encoded) {
- var sAgent = navigator.userAgent.toLowerCase();
- if (!FCKeditor_IsCompatibleBrowser() ||
- sAgent.indexOf('iphone') != -1 ||
- sAgent.indexOf('android') != -1 )
- return false;
-
- // 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 (jQuery(textArea).hasClass("messagebox")) {
- // Turn the original plain text content into HTML
- // if (encoded == 0) textArea.value = textArea.value .replace( /&/g, "&") .replace( /</g, "<") .replace( />/g, ">") .replace( /\n/g, "\n<br />");
- var FCKeditorEncoded = document.createElement('input');
- FCKeditorEncoded.setAttribute('type', 'hidden');
- FCKeditorEncoded.setAttribute('name', 'FCKeditorEncoded');
- FCKeditorEncoded.setAttribute('value', '1');
- textArea.parentNode.appendChild(FCKeditorEncoded);
-
- 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, '100%', <% RT->Config->Get('MessageBoxRichTextHeight', $session{CurrentUser} ) %> );
- oFCKeditor.BasePath = "<%RT->Config->Get('WebPath')%>/NoAuth/RichText/";
- oFCKeditor.ReplaceTextarea();
- }
+ jQuery(".ui-datepicker:not(.withtime)").datepicker( {
+ dateFormat: 'yy-mm-dd',
+ constrainInput: false
+ } );
+
+ jQuery(".ui-datepicker.withtime").datepicker( {
+ dateFormat: 'yy-mm-dd',
+ constrainInput: false,
+ onSelect: function( dateText, inst ) {
+ // trigger timepicker to get time
+ var button = document.createElement('input');
+ button.setAttribute('type', 'button');
+ jQuery(button).width('5em');
+ jQuery(button).insertAfter(this);
+ jQuery(button).timepickr({val: '00:00'});
+ var date_input = this;
+
+ jQuery(button).blur( function() {
+ var time = jQuery(button).val();
+ if ( ! time.match(/\d\d:\d\d/) ) {
+ time = '00:00';
+ }
+ jQuery(date_input).val( dateText + ' ' + time + ':00' );
+ jQuery(button).remove();
+ } );
+
+ jQuery(button).focus();
}
- };
+ } );
+});
+
+function ReplaceAllTextareas(encoded) {
+ var sAgent = navigator.userAgent.toLowerCase();
+ if (!FCKeditor_IsCompatibleBrowser() ||
+ sAgent.indexOf('iphone') != -1 ||
+ sAgent.indexOf('android') != -1 )
+ return false;
+
+ // 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 (jQuery(textArea).hasClass("messagebox")) {
+ // Turn the original plain text content into HTML
+ // if (encoded == 0) textArea.value = textArea.value .replace( /&/g, "&") .replace( /</g, "<") .replace( />/g, ">") .replace( /\n/g, "\n<br />");
+ var FCKeditorEncoded = document.createElement('input');
+ FCKeditorEncoded.setAttribute('type', 'hidden');
+ FCKeditorEncoded.setAttribute('name', 'FCKeditorEncoded');
+ FCKeditorEncoded.setAttribute('value', '1');
+ textArea.parentNode.appendChild(FCKeditorEncoded);
+
+ 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, '100%', <% RT->Config->Get('MessageBoxRichTextHeight', $session{CurrentUser} ) %> );
+ oFCKeditor.BasePath = "<%RT->Config->Get('WebPath')%>/NoAuth/RichText/";
+ oFCKeditor.ReplaceTextarea();
+ }
+ }
+};
commit 7d95eb98c9f8ba74e63c5440da0241be6599275a
Author: Thomas Sibley <trs at bestpractical.com>
Date: Fri Oct 1 11:26:43 2010 -0400
Set the URL fragment when a main tab is selected in the rights editor
This will help pass links around. Since it's keyed off of ID, the
fragments aren't portable across systems. System groups/roles, however,
are very likely to have the same ID.
diff --git a/share/html/Admin/Elements/EditRights b/share/html/Admin/Elements/EditRights
index 3856995..b3c70b6 100644
--- a/share/html/Admin/Elements/EditRights
+++ b/share/html/Admin/Elements/EditRights
@@ -74,7 +74,11 @@ unless ( $AddPrincipal ) {
<script type="text/javascript">
jQuery(function() {
- jQuery(".rights-editor").tabs();
+ jQuery(".rights-editor").tabs({
+ select: function(ev, ui) {
+ window.location.hash = ui.tab.hash;
+ }
+ });
jQuery(".rights-editor .category-tabs").tabs();
});
</script>
commit 65cf1dd43982afa479cb4264239b41eaffbb553b
Author: Thomas Sibley <trs at bestpractical.com>
Date: Fri Oct 1 11:31:36 2010 -0400
Change #acl-addprincipal to #acl-AddPrincipal just for style's sake
diff --git a/share/html/Admin/Elements/EditRights b/share/html/Admin/Elements/EditRights
index b3c70b6..e85b681 100644
--- a/share/html/Admin/Elements/EditRights
+++ b/share/html/Admin/Elements/EditRights
@@ -104,7 +104,7 @@ for my $category (@$Principals) {
% if ( $AddPrincipal ) {
<li class="category"><&|/l&>Add</&> <% loc($AddPrincipal) %></li>
<li>
- <a href="#acl-addprincipal">
+ <a href="#acl-AddPrincipal">
<input type="text" value=""
name="AddPrincipalForRights-<% lc $AddPrincipal %>"
id="AddPrincipalForRights-<% lc $AddPrincipal %>" />
@@ -224,16 +224,16 @@ if ($obj->isa('RT::Group') and $obj->Domain eq 'UserDefined') {
if ( $AddPrincipal ) {
my $acldesc = join '-', 'addprincipal', ref($Context), $Context->Id;
</%perl>
- <div id="acl-addprincipal">
+ <div id="acl-AddPrincipal">
<h3><&|/l&>Add rights for this</&> <% loc($AddPrincipal) %></h3>
<div class="category-tabs">
<ul>
% for my $category (sort { $catsort{$a} <=> $catsort{$b} } keys %categories) {
- <li><a href="#acl-addprincipal-<% $category %>"><% loc($category_desc{$category} || 'Miscellaneous') %></a></li>
+ <li><a href="#acl-AddPrincipal-<% $category %>"><% loc($category_desc{$category} || 'Miscellaneous') %></a></li>
% }
</ul>
% for my $category (sort { $catsort{$a} <=> $catsort{$b} } keys %categories) {
- <div id="acl-addprincipal-<% $category %>">
+ <div id="acl-AddPrincipal-<% $category %>">
<ul class="rights-list">
% for my $right (sort @{$categories{$category}}) {
<li>
commit 2ce755353afc6ba9f513e2363137c0f7b2545d3e
Author: Thomas Sibley <trs at bestpractical.com>
Date: Fri Oct 1 11:32:38 2010 -0400
Update the title of the rights panel when adding a user/group
diff --git a/share/html/Admin/Elements/EditRights b/share/html/Admin/Elements/EditRights
index e85b681..123b6dc 100644
--- a/share/html/Admin/Elements/EditRights
+++ b/share/html/Admin/Elements/EditRights
@@ -112,6 +112,7 @@ for my $category (@$Principals) {
<script type="text/javascript">
jQuery("#AddPrincipalForRights-<% lc $AddPrincipal %>").autocomplete({
source: "<% RT->Config->Get('WebPath')%>/Helpers/Autocomplete/Groups",
+ select: update_addprincipal_title
});
</script>
% }
diff --git a/share/html/NoAuth/js/userautocomplete.js b/share/html/NoAuth/js/userautocomplete.js
index 6f0fa21..3e7bad4 100644
--- a/share/html/NoAuth/js/userautocomplete.js
+++ b/share/html/NoAuth/js/userautocomplete.js
@@ -75,8 +75,10 @@ jQuery(function() {
var queryargs = [];
- if (inputName.match("AddPrincipalForRights-user"))
+ if (inputName.match("AddPrincipalForRights-user")) {
queryargs.push("return=Name");
+ options.select = update_addprincipal_title;
+ }
if (inputName.match(onlyPrivileged)) {
queryargs.push("privileged=1");
diff --git a/share/html/NoAuth/js/util.js b/share/html/NoAuth/js/util.js
index 5cb34fc..003eaed 100644
--- a/share/html/NoAuth/js/util.js
+++ b/share/html/NoAuth/js/util.js
@@ -277,3 +277,8 @@ function ReplaceAllTextareas(encoded) {
}
}
};
+
+function update_addprincipal_title(ev, ui) {
+ var h3 = jQuery("#acl-AddPrincipal h3");
+ h3.html( h3.text().replace(/: .+$/,'') + ": " + ui.item.value );
+}
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list