[Rt-commit] rt branch, 4.2/static-js, created. rt-4.1.6-28-g748a489

Thomas Sibley trs at bestpractical.com
Tue Feb 19 14:37:11 EST 2013


The branch, 4.2/static-js has been created
        at  748a4895c2515be394406e3d8273bd694fdc1138 (commit)

- Log -----------------------------------------------------------------
commit 044b2c4f20539a4d13dc8202450f02b69e157c07
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Jan 15 15:29:52 2013 -0800

    Remove all Mason from our (now static) JS files
    
    This also fixes a bug where the user preference override of
    MessageBoxRichTextHeight was never used since a per-request current user
    couldn't be used in the global JS.  With the use of RT.Config it can.
    
    Our Mason-commented license is removed and not replaced by a
    JS-commented license to avoid needlessly increasing our unsquished JS by
    22kb.

diff --git a/share/html/Elements/JavascriptConfig b/share/html/Elements/JavascriptConfig
index e151828..9e3143c 100644
--- a/share/html/Elements/JavascriptConfig
+++ b/share/html/Elements/JavascriptConfig
@@ -48,7 +48,7 @@
 <%init>
 my $Config = {};
 $Config->{$_} = RT->Config->Get( $_, $session{CurrentUser} )
-  for qw(rtname WebPath);
+  for qw(rtname WebPath MessageBoxRichTextHeight);
 
 my $CurrentUser = {};
 if ($session{CurrentUser} and $session{CurrentUser}->id) {
diff --git a/share/html/NoAuth/js/cascaded.js b/share/html/NoAuth/js/cascaded.js
index fb20b32..b47357e 100644
--- a/share/html/NoAuth/js/cascaded.js
+++ b/share/html/NoAuth/js/cascaded.js
@@ -1,50 +1,3 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
-%#                                          <sales at 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 }}}
 function filter_cascade (id, val) {
     var select = document.getElementById(id);
     var complete_select = document.getElementById(id + "-Complete" );
diff --git a/share/html/NoAuth/js/combobox.js b/share/html/NoAuth/js/combobox.js
index 22815bd..58dfad0 100644
--- a/share/html/NoAuth/js/combobox.js
+++ b/share/html/NoAuth/js/combobox.js
@@ -1,50 +1,3 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
-%#                                          <sales at 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 }}}
 function ComboBox_InitWith(n) {
     if ( typeof( window.addEventListener ) != "undefined" ) {
         window.addEventListener("load", ComboBox_Init(n), false);
diff --git a/share/html/NoAuth/js/event-registration.js b/share/html/NoAuth/js/event-registration.js
index bbeeec8..5601459 100644
--- a/share/html/NoAuth/js/event-registration.js
+++ b/share/html/NoAuth/js/event-registration.js
@@ -1,50 +1,3 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
-%#                                          <sales at 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 }}}
 jQuery(function() {
     var global_checkboxes = [
         "form[name=AddRemoveScrip] input[type=checkbox][name^=AddScrip-][value=0]",
diff --git a/share/html/NoAuth/js/history-folding.js b/share/html/NoAuth/js/history-folding.js
index e6ad124..091d164 100644
--- a/share/html/NoAuth/js/history-folding.js
+++ b/share/html/NoAuth/js/history-folding.js
@@ -1,50 +1,3 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
-%#                                          <sales at 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 }}}
 function fold_message_stanza(e,showmsg, hidemsg) {
     var box = jQuery(e).next("br").next('.message-stanza');
     if ( box.hasClass('closed') ) {
diff --git a/share/html/NoAuth/js/jquery-ui-patch-datepicker.js b/share/html/NoAuth/js/jquery-ui-patch-datepicker.js
index 2ac101f..48f0176 100644
--- a/share/html/NoAuth/js/jquery-ui-patch-datepicker.js
+++ b/share/html/NoAuth/js/jquery-ui-patch-datepicker.js
@@ -1,50 +1,3 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
-%#                                          <sales at 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 }}}
 (function($){
     $.datepicker._newInst_orig = $.datepicker._newInst;
     $.datepicker._newInst = function(target, inline) {
diff --git a/share/html/NoAuth/js/jquery.modal-defaults.js b/share/html/NoAuth/js/jquery.modal-defaults.js
index f5c0c55..d14b002 100644
--- a/share/html/NoAuth/js/jquery.modal-defaults.js
+++ b/share/html/NoAuth/js/jquery.modal-defaults.js
@@ -1,49 +1,2 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
-%#                                          <sales at 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 }}}
 // RT's styles have some crazy z-indexes, so get above 'em all by default.
 jQuery.fn.modal.defaults.zIndex = 9999;
diff --git a/share/html/NoAuth/js/jquery_noconflict.js b/share/html/NoAuth/js/jquery_noconflict.js
index dd6412d..48eab5a 100644
--- a/share/html/NoAuth/js/jquery_noconflict.js
+++ b/share/html/NoAuth/js/jquery_noconflict.js
@@ -1,50 +1,3 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
-%#                                          <sales at 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 }}}
 /**
  * noConflict.js - Tell jQuery not to clobber $()
  */
diff --git a/share/html/NoAuth/js/late.js b/share/html/NoAuth/js/late.js
index cacf883..4fa3878 100644
--- a/share/html/NoAuth/js/late.js
+++ b/share/html/NoAuth/js/late.js
@@ -1,50 +1,3 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
-%#                                          <sales at 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 }}}
 // Lower the speed limit for hover intent event
 jQuery.event.special.hover.speed = 80; // pixels per second
 
diff --git a/share/html/NoAuth/js/titlebox-state.js b/share/html/NoAuth/js/titlebox-state.js
index a5e5dac..d405339 100644
--- a/share/html/NoAuth/js/titlebox-state.js
+++ b/share/html/NoAuth/js/titlebox-state.js
@@ -1,52 +1,5 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
-%#                                          <sales at 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 }}}
 function createCookie(name,value,days) {
-    var path = <%RT->Config->Get('WebPath')|n,j%> ? <%RT->Config->Get('WebPath')|n,j%> : "/";
+    var path = RT.Config.WebPath ? RT.Config.WebPath : "/";
 
     if (days) {
         var date = new Date();
diff --git a/share/html/NoAuth/js/userautocomplete.js b/share/html/NoAuth/js/userautocomplete.js
index b4f678c..ef9988f 100644
--- a/share/html/NoAuth/js/userautocomplete.js
+++ b/share/html/NoAuth/js/userautocomplete.js
@@ -1,50 +1,3 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
-%#                                          <sales at 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 }}}
 jQuery(function() {
     // inputs that accept multiple email addresses
     var multipleCompletion = new Array("Requestors", "To", "Bcc", "Cc", "AdminCc", "WatcherAddressEmail[123]", "UpdateCc", "UpdateBcc");
@@ -70,7 +23,7 @@ jQuery(function() {
             continue;
 
         var options = {
-            source: <% RT->Config->Get('WebPath') |n,j%>+"/Helpers/Autocomplete/Users"
+            source: RT.Config.WebPath + "/Helpers/Autocomplete/Users"
         };
 
         var queryargs = [];
diff --git a/share/html/NoAuth/js/util.js b/share/html/NoAuth/js/util.js
index eef7ab6..1a762a9 100644
--- a/share/html/NoAuth/js/util.js
+++ b/share/html/NoAuth/js/util.js
@@ -1,50 +1,3 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
-%#                                          <sales at 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 }}}
 /* Visibility */
 
 function show(id) { delClass( id, 'hidden' ) }
@@ -310,8 +263,8 @@ function ReplaceAllTextareas(encoded) {
             textArea.parentNode.appendChild(typeField);
 
 
-            CKEDITOR.replace(textArea.name,{width:'100%',height:<% RT->Config->Get('MessageBoxRichTextHeight') |n,j%>});
-            CKEDITOR.basePath = <%RT->Config->Get('WebPath')|n,j%>+"/static/RichText/";
+            CKEDITOR.replace(textArea.name,{ width: '100%', height: RT.Config.MessageBoxRichTextHeight });
+            CKEDITOR.basePath = RT.Config.WebPath + "/static/RichText/";
 
             jQuery("#" + textArea.name + "___Frame").addClass("richtext-editor");
         }

commit aa336bc8ac224c2e646ab3ab2a90520ce412bc93
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Jan 15 15:31:11 2013 -0800

    Use RT.Config.WebPath in inline JS instead of interpolating from Mason

diff --git a/share/html/Admin/Elements/EditRights b/share/html/Admin/Elements/EditRights
index e673593..30cf4b5 100644
--- a/share/html/Admin/Elements/EditRights
+++ b/share/html/Admin/Elements/EditRights
@@ -116,7 +116,7 @@ for my $category (@$Principals) {
 
 % if (lc $AddPrincipal eq 'group') {
             jQuery("#AddPrincipalForRights-"+<% lc $AddPrincipal |n,j%>).autocomplete({
-                source: <% RT->Config->Get('WebPath') |n,j%>+"/Helpers/Autocomplete/Groups",
+                source: RT.Config.WebPath + "/Helpers/Autocomplete/Groups",
                 select: addprincipal_onselect,
                 change: addprincipal_onchange
             });
diff --git a/share/html/Admin/Elements/SelectNewGroupMembers b/share/html/Admin/Elements/SelectNewGroupMembers
index 8778dae..1b9f4a9 100644
--- a/share/html/Admin/Elements/SelectNewGroupMembers
+++ b/share/html/Admin/Elements/SelectNewGroupMembers
@@ -51,7 +51,7 @@
 <script type="text/javascript">
 jQuery(function(){
     jQuery("#"+<% $Name |n,j%>+"Users").autocomplete({
-        source: <% RT->Config->Get('WebPath') |n,j%>+"/Helpers/Autocomplete/Users?return=Name;privileged=1;exclude="+<% $user_ids |n,u,j %>,
+        source: RT.Config.WebPath + "/Helpers/Autocomplete/Users?return=Name;privileged=1;exclude="+<% $user_ids |n,u,j %>,
         // Auto-submit once a user is chosen
         select: function( event, ui ) {
             jQuery(event.target).val(ui.item.value);
@@ -68,7 +68,7 @@ jQuery(function(){
 <script type="text/javascript">
 jQuery(function(){
     jQuery("#"+<% $Name |n,j%>+"Groups").autocomplete({
-        source: <% RT->Config->Get('WebPath') |n,j%>+"/Helpers/Autocomplete/Groups?exclude="+<% $group_ids |n,u,j %>,
+        source: RT.Config.WebPath + "/Helpers/Autocomplete/Groups?exclude="+<% $group_ids |n,u,j %>,
         // Auto-submit once a user is chosen
         select: function( event, ui ) {
             jQuery(event.target).val(ui.item.value);
diff --git a/share/html/Admin/Groups/index.html b/share/html/Admin/Groups/index.html
index 6a15471..adc4a28 100644
--- a/share/html/Admin/Groups/index.html
+++ b/share/html/Admin/Groups/index.html
@@ -57,7 +57,7 @@
 <script type="text/javascript">
 jQuery(function(){
     jQuery("#autocomplete-GroupString").autocomplete({
-        source: <% RT->Config->Get('WebPath') |n,j%>+"/Helpers/Autocomplete/Groups",
+        source: RT.Config.WebPath + "/Helpers/Autocomplete/Groups",
         // Auto-submit once a group is chosen
         select: function( event, ui ) {
             jQuery(event.target).val(ui.item.value);
diff --git a/share/html/Admin/Users/index.html b/share/html/Admin/Users/index.html
index 3dbfddb..18e007a 100644
--- a/share/html/Admin/Users/index.html
+++ b/share/html/Admin/Users/index.html
@@ -62,7 +62,7 @@
 <script type="text/javascript">
 jQuery(function(){
     jQuery("#autocomplete-UserString").autocomplete({
-        source: <% RT->Config->Get('WebPath') |n,j%>+"/Helpers/Autocomplete/Users?return=Name",
+        source: RT.Config.WebPath + "/Helpers/Autocomplete/Users?return=Name",
         // Auto-submit once a user is chosen
         select: function( event, ui ) {
             jQuery(event.target).val(ui.item.value);
diff --git a/share/html/Elements/EditCustomFieldAutocomplete b/share/html/Elements/EditCustomFieldAutocomplete
index 911e607..f37ee1e 100644
--- a/share/html/Elements/EditCustomFieldAutocomplete
+++ b/share/html/Elements/EditCustomFieldAutocomplete
@@ -52,7 +52,7 @@
 var id = <% "$name-Values" |n,j%>;
 id = id.replace(/:/g,'\\:');
 jQuery('#'+id).autocomplete( {
-    source: <%RT->Config->Get('WebPath') |n,j%>+"/Helpers/Autocomplete/CustomFieldValues?"+<% $Context |n,j %>+<% "$name-Values" |n,u,j%>,
+    source: RT.Config.WebPath + "/Helpers/Autocomplete/CustomFieldValues?"+<% $Context |n,j %>+<% "$name-Values" |n,u,j%>,
     focus: function () {
         // prevent value inserted on focus
         return false;
@@ -76,7 +76,7 @@ jQuery('#'+id).autocomplete( {
 var id = <% "$name-Value" |n,j%>;
 id = id.replace(/:/g,'\\:');
 jQuery('#'+id).autocomplete( {
-    source: <%RT->Config->Get('WebPath')|n,j%>+"/Helpers/Autocomplete/CustomFieldValues?"+<% $Context |n,j %>+<% "$name-Value" |n,u,j%>
+    source: RT.Config.WebPath + "/Helpers/Autocomplete/CustomFieldValues?"+<% $Context |n,j %>+<% "$name-Value" |n,u,j%>
 }
 );
 % }
diff --git a/share/html/Elements/SelectOwnerAutocomplete b/share/html/Elements/SelectOwnerAutocomplete
index 81b3838..a41b4ed 100644
--- a/share/html/Elements/SelectOwnerAutocomplete
+++ b/share/html/Elements/SelectOwnerAutocomplete
@@ -86,7 +86,7 @@ my $query = $m->comp('/Elements/QueryString',
                 }
                 else {
                     jQuery.ajax({
-                        url: <% RT->Config->Get('WebPath')|n,j%>+"/Helpers/Autocomplete/Owners?"+<% $query|n,j %>,
+                        url: RT.Config.WebPath + "/Helpers/Autocomplete/Owners?"+<% $query|n,j %>,
                         dataType: "json",
                         data: request,
                         success: function( data ) {

commit 7a00cbb35eac76b8e97e383f156f5051f716867e
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Jan 15 17:26:47 2013 -0800

    Remove a duplicate condition check

diff --git a/lib/RT/Interface/Web/Handler.pm b/lib/RT/Interface/Web/Handler.pm
index d8bf65e..37519ff 100644
--- a/lib/RT/Interface/Web/Handler.pm
+++ b/lib/RT/Interface/Web/Handler.pm
@@ -277,13 +277,11 @@ sub PSGIApp {
 
     for my $static ( RT->Config->Get('StaticRoots') ) {
         if ( ref $static && ref $static eq 'HASH' ) {
-            if ( ref $static eq 'HASH' ) {
-                $builder->add_middleware(
-                    'Plack::Middleware::Static',
-                    pass_through => 1,
-                    %$static
-                );
-            }
+            $builder->add_middleware(
+                'Plack::Middleware::Static',
+                pass_through => 1,
+                %$static
+            );
         }
         else {
             $RT::Logger->error(

commit d514189e93c11f00bcbccfae030d026437eb9142
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Jan 15 17:27:32 2013 -0800

    Add LWP::Simple to the core dependencies
    
    This should have been added in 7d5b33b with `make jsmin` or added even
    earlier to the development dependencies with 3d11b14 when
    sbin/rt-message-catalog was rewritten to use Launchpad translations.

diff --git a/sbin/rt-test-dependencies.in b/sbin/rt-test-dependencies.in
index 3f2d265..aa5006b 100644
--- a/sbin/rt-test-dependencies.in
+++ b/sbin/rt-test-dependencies.in
@@ -202,6 +202,7 @@ Sys::Syslog 0.16
 Locale::Maketext 1.06
 Locale::Maketext::Lexicon 0.32
 Locale::Maketext::Fuzzy 0.11
+LWP::Simple
 MIME::Entity 5.425
 Mail::Mailer 1.57
 Email::Address

commit 16206c9ef899ba15cee2f6fb1b4421e4a3f78fc6
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Jan 15 17:29:57 2013 -0800

    Refactor the static middleware wrapping into a method to enable reuse
    
    The StaticWrap method functions somewhat like our own little ad-hoc
    middleware, hence the "wrap" moniker.  Producing a standalone static app
    would require using the builder's mount function, and that removes the
    ability of @StaticRoots config definitions to serve paths outside of
    m{^/static/}.

diff --git a/lib/RT/Interface/Web/Handler.pm b/lib/RT/Interface/Web/Handler.pm
index 37519ff..e6f057f 100644
--- a/lib/RT/Interface/Web/Handler.pm
+++ b/lib/RT/Interface/Web/Handler.pm
@@ -231,8 +231,6 @@ sub PSGIApp {
 
     $self->InitSessionDir;
 
-    my $builder = Plack::Builder->new();
-
     my $mason = sub {
         my $env = shift;
         RT::ConnectToDatabase() unless RT->InstallMode;
@@ -273,7 +271,13 @@ sub PSGIApp {
                                             $self->CleanupRequest()
                                         });
     };
+    return $self->StaticWrap($mason);
+}
 
+sub StaticWrap {
+    my $self    = shift;
+    my $app     = shift;
+    my $builder = Plack::Builder->new;
 
     for my $static ( RT->Config->Get('StaticRoots') ) {
         if ( ref $static && ref $static eq 'HASH' ) {
@@ -303,7 +307,7 @@ sub PSGIApp {
             pass_through => 1,
         );
     }
-    return $builder->to_app($mason);
+    return $builder->to_app($app);
 }
 
 sub _psgi_response_cb {

commit 9b725e825bda7d7db45802ecdc5b916212fd25e9
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Jan 15 17:36:00 2013 -0800

    Serve individual JS files via the static handler
    
    This is possible now that none of the JS needs to be parsed by Mason,
    thanks to 4fe4fc0.
    
    Squished JS is still served via Mason, although that could be replaced
    in the future by Plack middleware (i.e.  Plack::Middleware::Assets,
    Plack::Middleware::JSConcat, or our own).  RT::Squish::JS makes internal
    PSGI requests to the static handler in order to fetch the JS content for
    squishing.

diff --git a/lib/RT/Squish/JS.pm b/lib/RT/Squish/JS.pm
index e968e0f..70654d0 100644
--- a/lib/RT/Squish/JS.pm
+++ b/lib/RT/Squish/JS.pm
@@ -65,6 +65,9 @@ use warnings;
 package RT::Squish::JS;
 use base 'RT::Squish';
 
+use LWP::Simple ();
+use LWP::Protocol::PSGI;
+
 =head2 Squish
 
 not only concatenate files, but also minify them
@@ -73,18 +76,27 @@ not only concatenate files, but also minify them
 
 sub Squish {
     my $self    = shift;
-    my $content;
+    my $content = "";
+
+    LWP::Protocol::PSGI->register(
+        RT::Interface::Web::Handler->StaticWrap(
+            # Anything the static wrap doesn't handle gets 404'd.
+            sub { [404, [], []] }
+        )
+    );
 
     for my $file ( RT::Interface::Web->JSFiles ) {
-        my $path = "/NoAuth/js/$file";
-        if ( $HTML::Mason::Commands::m->comp_exists($path) ) {
-            $content .= $HTML::Mason::Commands::m->scomp($path);
+        my $uri = "http://psgi-internal/static/js/$file";
+
+        if (defined(my $js = LWP::Simple::get($uri))) {
+            $content .= $js;
         } else {
-            RT->Logger->error("Unable to open $path for JS Squishing");
+            RT->Logger->error("Unable to fetch $uri for JS Squishing");
             next;
         }
     }
 
+    LWP::Protocol::PSGI->unregister;
     return $self->Filter($content);
 }
 
diff --git a/sbin/rt-test-dependencies.in b/sbin/rt-test-dependencies.in
index aa5006b..827f00b 100644
--- a/sbin/rt-test-dependencies.in
+++ b/sbin/rt-test-dependencies.in
@@ -254,6 +254,7 @@ HTML::Mason::PSGIHandler 0.52
 Plack 0.9971
 Plack::Handler::Starlet
 CGI::Emulate::PSGI
+LWP::Protocol::PSGI
 .
 
 $deps{'MAILGATE'} = [ text_to_hash( << '.') ];
diff --git a/share/html/Admin/Tools/Queries.html b/share/html/Admin/Tools/Queries.html
index dbc6fc5..da22bc3 100644
--- a/share/html/Admin/Tools/Queries.html
+++ b/share/html/Admin/Tools/Queries.html
@@ -53,7 +53,7 @@ unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'Super
 </%init>
 <& /Admin/Elements/Header, Title => $title &>
 <& /Elements/Tabs &>
-<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/jquery.tablesorter.min.js"></script>
+<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/static/js/jquery.tablesorter.min.js"></script>
 
 <&|/Widgets/TitleBox, title => loc('SQL Queries') &>
 % my $history = $RT::Handle->QueryHistory;
diff --git a/share/html/Admin/Tools/Theme.html b/share/html/Admin/Tools/Theme.html
index 179f211..e2241b0 100644
--- a/share/html/Admin/Tools/Theme.html
+++ b/share/html/Admin/Tools/Theme.html
@@ -51,7 +51,7 @@
 <& /Elements/Tabs &>
 <& /Elements/ListActions, actions => \@results &>
 
-<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/farbtastic.js"></script>
+<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/static/js/farbtastic.js"></script>
 
 <div id="simple-customize">
 <div id="upload-logo">
diff --git a/share/html/Elements/EditCustomFieldSelect b/share/html/Elements/EditCustomFieldSelect
index ed6bb14..f329953 100644
--- a/share/html/Elements/EditCustomFieldSelect
+++ b/share/html/Elements/EditCustomFieldSelect
@@ -53,7 +53,7 @@
 % my $id = $NamePrefix . $CustomField->Id;
 % my $out = $m->scomp('SELF:options', %ARGS, SelectedRef => \$selected, CategoryRef => \@category);
 % if (!$HideCategory and @category and not $CustomField->BasedOnObj->id) {
-  <script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/cascaded.js"></script>
+  <script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/static/js/cascaded.js"></script>
 %# XXX - Hide this select from w3m?
   <select onchange="filter_cascade(<% "$id-Values" |n,j%>, this.value)" name="<% $id %>-Category" class="CF-<%$CustomField->id%>-Edit">
     <option value=""<% !$selected && qq[ selected="selected"] |n %>><&|/l&>-</&></option>
@@ -63,7 +63,7 @@
 %   }
     </select><br />
 % } elsif ($CustomField->BasedOnObj->id) {
-<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/cascaded.js"></script>
+<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/static/js/cascaded.js"></script>
 <script type="text/javascript"><!--
 jQuery(  function () {
     var basedon = document.getElementById(<% $NamePrefix . $CustomField->BasedOnObj->id . "-Values" |n,j%>);
diff --git a/share/html/Elements/HeaderJavascript b/share/html/Elements/HeaderJavascript
index 1a8f34f..2e9a814 100644
--- a/share/html/Elements/HeaderJavascript
+++ b/share/html/Elements/HeaderJavascript
@@ -52,7 +52,7 @@ $onload => undef
 <& JavascriptConfig &>
 
 % for my $jsfile ( @js_files ) {
-<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/<% $jsfile %>"></script>
+<script type="text/javascript" src="<%RT->Config->Get('WebPath')%><% $jsfile %>"></script>
 % }
 
 % if ( $RichText and RT->Config->Get('MessageBoxRichText',  $session{'CurrentUser'}) ) {
@@ -78,11 +78,11 @@ $RichText => 1
 
 my @js_files;
 if ( RT->Config->Get('DevelMode') ) {
-    @js_files = RT::Interface::Web->JSFiles();
+    @js_files = map { "/static/js/$_" } RT::Interface::Web->JSFiles();
 }
 else {
     my $key = RT::Interface::Web::SquishedJS()->Key;
-    @js_files = "squished-$key.js";
+    @js_files = "/NoAuth/js/squished-$key.js";
 }
 
 </%INIT>
diff --git a/share/html/NoAuth/js/dhandler b/share/html/NoAuth/js/dhandler
index cdb2588..5d2cdbf 100644
--- a/share/html/NoAuth/js/dhandler
+++ b/share/html/NoAuth/js/dhandler
@@ -45,9 +45,6 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-<%ONCE>
-my $content = '';
-</%ONCE>
 <%INIT>
 my $arg = $m->dhandler_arg;
 if ( $arg =~ m{squished-[a-f0-9]{32}\.js$} ) {
@@ -61,5 +58,4 @@ if ( $arg =~ m{squished-[a-f0-9]{32}\.js$} ) {
 else {
     return $m->decline;
 }
-
 </%INIT>
diff --git a/share/html/Widgets/ComboBox b/share/html/Widgets/ComboBox
index 69ac079..92c3062 100644
--- a/share/html/Widgets/ComboBox
+++ b/share/html/Widgets/ComboBox
@@ -52,7 +52,7 @@ my $z_index = 9999;
 %# reset $z_index. assuming at most 1000 comboboxx in one page
 % $z_index = 9999 if $z_index < 9000;
 <nobr>
-<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/combobox.js"></script>
+<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/static/js/combobox.js"></script>
 
 <div id="<% $Name %>_Container" class="combobox <%$Class%>" style="z-index: <%$z_index--%>">
 <input name="<% $Name %>" id="<% $Name %>" class="combo-text" value="<% $Default || '' %>" type="text" <% $Size ? "size='$Size'" : '' |n %> autocomplete="off" />
diff --git a/share/html/Widgets/SelectionBox b/share/html/Widgets/SelectionBox
index 979adc9..6d9b8f1 100644
--- a/share/html/Widgets/SelectionBox
+++ b/share/html/Widgets/SelectionBox
@@ -74,8 +74,8 @@
 %# on every button clicked in non-js mode.
 <%method header>
 % unless ($nojs) {
-<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/class.js"></script>
-<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/list.js"></script>
+<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/static/js/class.js"></script>
+<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/static/js/list.js"></script>
 % }
 <%ARGS>
 $nojs => 0
diff --git a/share/html/m/_elements/header b/share/html/m/_elements/header
index c8800d8..93dd963 100644
--- a/share/html/m/_elements/header
+++ b/share/html/m/_elements/header
@@ -59,7 +59,7 @@ $r->headers_out->{'Cache-control'} = 'no-cache';
 <link rel="stylesheet" type="text/css" href="<%RT->Config->Get('WebPath')|n%>/m/style.css"/>
 <title><%$title%></title>
 % my ($jquery) = grep { /^jquery-\d+\./ } RT::Interface::Web->JSFiles;
-<script src="<% RT->Config->Get('WebPath') %>/NoAuth/js/<% $jquery %>"></script>
+<script src="<% RT->Config->Get('WebPath') %>/static/js/<% $jquery %>"></script>
 <meta name="viewport" content="width=device-width height=device-height user-scalable=yes"/>
 </head>
 <body>
diff --git a/share/html/NoAuth/js/cascaded.js b/share/static/js/cascaded.js
similarity index 100%
rename from share/html/NoAuth/js/cascaded.js
rename to share/static/js/cascaded.js
diff --git a/share/html/NoAuth/js/class.js b/share/static/js/class.js
similarity index 100%
rename from share/html/NoAuth/js/class.js
rename to share/static/js/class.js
diff --git a/share/html/NoAuth/js/combobox.js b/share/static/js/combobox.js
similarity index 100%
rename from share/html/NoAuth/js/combobox.js
rename to share/static/js/combobox.js
diff --git a/share/html/NoAuth/js/event-registration.js b/share/static/js/event-registration.js
similarity index 100%
rename from share/html/NoAuth/js/event-registration.js
rename to share/static/js/event-registration.js
diff --git a/share/html/NoAuth/js/farbtastic.js b/share/static/js/farbtastic.js
similarity index 100%
rename from share/html/NoAuth/js/farbtastic.js
rename to share/static/js/farbtastic.js
diff --git a/share/html/NoAuth/js/history-folding.js b/share/static/js/history-folding.js
similarity index 100%
rename from share/html/NoAuth/js/history-folding.js
rename to share/static/js/history-folding.js
diff --git a/share/html/NoAuth/js/jquery-1.4.2.min.js b/share/static/js/jquery-1.4.2.min.js
similarity index 100%
rename from share/html/NoAuth/js/jquery-1.4.2.min.js
rename to share/static/js/jquery-1.4.2.min.js
diff --git a/share/html/NoAuth/js/jquery-ui-1.8.4.custom.min.js b/share/static/js/jquery-ui-1.8.4.custom.min.js
similarity index 100%
rename from share/html/NoAuth/js/jquery-ui-1.8.4.custom.min.js
rename to share/static/js/jquery-ui-1.8.4.custom.min.js
diff --git a/share/html/NoAuth/js/jquery-ui-patch-datepicker.js b/share/static/js/jquery-ui-patch-datepicker.js
similarity index 100%
rename from share/html/NoAuth/js/jquery-ui-patch-datepicker.js
rename to share/static/js/jquery-ui-patch-datepicker.js
diff --git a/share/html/NoAuth/js/jquery-ui-timepicker-addon.js b/share/static/js/jquery-ui-timepicker-addon.js
similarity index 100%
rename from share/html/NoAuth/js/jquery-ui-timepicker-addon.js
rename to share/static/js/jquery-ui-timepicker-addon.js
diff --git a/share/html/NoAuth/js/jquery.event.hover-1.0.js b/share/static/js/jquery.event.hover-1.0.js
similarity index 100%
rename from share/html/NoAuth/js/jquery.event.hover-1.0.js
rename to share/static/js/jquery.event.hover-1.0.js
diff --git a/share/html/NoAuth/js/jquery.modal-defaults.js b/share/static/js/jquery.modal-defaults.js
similarity index 100%
rename from share/html/NoAuth/js/jquery.modal-defaults.js
rename to share/static/js/jquery.modal-defaults.js
diff --git a/share/html/NoAuth/js/jquery.modal.min.js b/share/static/js/jquery.modal.min.js
similarity index 100%
rename from share/html/NoAuth/js/jquery.modal.min.js
rename to share/static/js/jquery.modal.min.js
diff --git a/share/html/NoAuth/js/jquery.supposition.js b/share/static/js/jquery.supposition.js
similarity index 100%
rename from share/html/NoAuth/js/jquery.supposition.js
rename to share/static/js/jquery.supposition.js
diff --git a/share/html/NoAuth/js/jquery.tablesorter.min.js b/share/static/js/jquery.tablesorter.min.js
similarity index 100%
rename from share/html/NoAuth/js/jquery.tablesorter.min.js
rename to share/static/js/jquery.tablesorter.min.js
diff --git a/share/html/NoAuth/js/jquery_noconflict.js b/share/static/js/jquery_noconflict.js
similarity index 100%
rename from share/html/NoAuth/js/jquery_noconflict.js
rename to share/static/js/jquery_noconflict.js
diff --git a/share/html/NoAuth/js/late.js b/share/static/js/late.js
similarity index 100%
rename from share/html/NoAuth/js/late.js
rename to share/static/js/late.js
diff --git a/share/html/NoAuth/js/list.js b/share/static/js/list.js
similarity index 100%
rename from share/html/NoAuth/js/list.js
rename to share/static/js/list.js
diff --git a/share/html/NoAuth/js/superfish.js b/share/static/js/superfish.js
similarity index 100%
rename from share/html/NoAuth/js/superfish.js
rename to share/static/js/superfish.js
diff --git a/share/html/NoAuth/js/supersubs.js b/share/static/js/supersubs.js
similarity index 100%
rename from share/html/NoAuth/js/supersubs.js
rename to share/static/js/supersubs.js
diff --git a/share/html/NoAuth/js/titlebox-state.js b/share/static/js/titlebox-state.js
similarity index 100%
rename from share/html/NoAuth/js/titlebox-state.js
rename to share/static/js/titlebox-state.js
diff --git a/share/html/NoAuth/js/userautocomplete.js b/share/static/js/userautocomplete.js
similarity index 100%
rename from share/html/NoAuth/js/userautocomplete.js
rename to share/static/js/userautocomplete.js
diff --git a/share/html/NoAuth/js/util.js b/share/static/js/util.js
similarity index 100%
rename from share/html/NoAuth/js/util.js
rename to share/static/js/util.js
diff --git a/t/web/squish.t b/t/web/squish.t
index ff43e74..1ed268f 100644
--- a/t/web/squish.t
+++ b/t/web/squish.t
@@ -5,7 +5,7 @@ use RT::Test tests => 26;
 
 RT->Config->Set( DevelMode            => 0 );
 RT->Config->Set( WebDefaultStylesheet => 'aileron' );
-RT->Config->Set( MasonLocalComponentRoot => RT::Test::get_abs_relocatable_dir('html') );
+RT->Config->Set( LocalStaticPath => RT::Test::get_abs_relocatable_dir('static') );
 
 my ( $url, $m ) = RT::Test->started_ok;
 $m->login;
diff --git a/t/web/html/NoAuth/js/not-by-default.js b/t/web/static/js/not-by-default.js
similarity index 100%
rename from t/web/html/NoAuth/js/not-by-default.js
rename to t/web/static/js/not-by-default.js

commit 182c5bf71e1219750fef29e01963f7fe35ea2009
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Jan 16 12:26:30 2013 -0800

    Clarify where AddJavaScript and AddStyleSheets expect files to live

diff --git a/lib/RT.pm b/lib/RT.pm
index f7b0b52..279edc6 100644
--- a/lib/RT.pm
+++ b/lib/RT.pm
@@ -751,12 +751,16 @@ sub CanonicalizeGeneratedPaths {
 
 =head2 AddJavaScript
 
-helper method to add js files to C<JSFiles> config.
-to add extra js files, you can add the following line
-in the plugin's main file:
+Helper method to add JS files to the C<@JSFiles> config at runtime.
+
+To add files, you can add the following line to your extension's main C<.pm>
+file:
 
     RT->AddJavaScript( 'foo.js', 'bar.js' ); 
 
+Files are expected to be in a static root in a F<js/> directory, such as
+F<static/js/> in your extension or F<local/static/js/> for local overlays.
+
 =cut
 
 sub AddJavaScript {
@@ -769,13 +773,17 @@ sub AddJavaScript {
 
 =head2 AddStyleSheets
 
-helper method to add css files to C<CSSFiles> config
+Helper method to add CSS files to the C<@CSSFiles> config at runtime.
 
-to add extra css files, you can add the following line
-in the plugin's main file:
+To add files, you can add the following line to your extension's main C<.pm>
+file:
 
     RT->AddStyleSheets( 'foo.css', 'bar.css' ); 
 
+Files are expected to be in a Mason root in a F<NoAuth/css/> directory, such as
+F<html/NoAuth/css/> in your extension or F<local/html/NoAuth/css/> for local
+overlays.
+
 =cut
 
 sub AddStyleSheets {

commit 748a4895c2515be394406e3d8273bd694fdc1138
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Feb 14 18:25:23 2013 -0800

    Use a pure Plack and HTTP::Message solution for internal PSGI requests
    
    Replaces LWP::Protocol::PSGI and the complexity wrapped up in that
    module with a much more straightforward approach.  Since we're writing
    new code — not pulling the PSGI-wool over the eyes of otherwise
    unsuspecting code — we don't need the cloak of LWP.
    
    A nice side benefit is that without LWP::Protocol::PSGI, there are no
    warnings when LWP::Protocol::https isn't installed.  Thus, we won't need
    to either require it for the squishing functionality or suppress the
    warning with ugly warning handlers.

diff --git a/lib/RT/Squish/JS.pm b/lib/RT/Squish/JS.pm
index 70654d0..b2a7dfd 100644
--- a/lib/RT/Squish/JS.pm
+++ b/lib/RT/Squish/JS.pm
@@ -65,8 +65,9 @@ use warnings;
 package RT::Squish::JS;
 use base 'RT::Squish';
 
-use LWP::Simple ();
-use LWP::Protocol::PSGI;
+use HTTP::Message::PSGI;
+use HTTP::Request;
+use HTTP::Response;
 
 =head2 Squish
 
@@ -77,26 +78,25 @@ not only concatenate files, but also minify them
 sub Squish {
     my $self    = shift;
     my $content = "";
-
-    LWP::Protocol::PSGI->register(
-        RT::Interface::Web::Handler->StaticWrap(
-            # Anything the static wrap doesn't handle gets 404'd.
-            sub { [404, [], []] }
-        )
+    my $static  = RT::Interface::Web::Handler->StaticWrap(
+        # Anything the static wrap doesn't handle gets 404'd.
+        sub { [404, [], []] }
     );
 
     for my $file ( RT::Interface::Web->JSFiles ) {
-        my $uri = "http://psgi-internal/static/js/$file";
+        my $uri = "/static/js/$file";
+        my $res = HTTP::Response->from_psgi(
+            $static->( HTTP::Request->new(GET => $uri)->to_psgi )
+        );
 
-        if (defined(my $js = LWP::Simple::get($uri))) {
-            $content .= $js;
+        if ($res->is_success) {
+            $content .= $res->decoded_content;
         } else {
-            RT->Logger->error("Unable to fetch $uri for JS Squishing");
+            RT->Logger->error("Unable to fetch $uri for JS Squishing: " . $res->status_line);
             next;
         }
     }
 
-    LWP::Protocol::PSGI->unregister;
     return $self->Filter($content);
 }
 
diff --git a/sbin/rt-test-dependencies.in b/sbin/rt-test-dependencies.in
index 827f00b..18675b5 100644
--- a/sbin/rt-test-dependencies.in
+++ b/sbin/rt-test-dependencies.in
@@ -230,6 +230,7 @@ Regexp::IPv6
 Symbol::Global::Name
 HTML::Entities
 Role::Basic 0.12
+HTTP::Message 6.00
 .
 
 $deps{'MASON'} = [ text_to_hash( << '.') ];
@@ -254,7 +255,6 @@ HTML::Mason::PSGIHandler 0.52
 Plack 0.9971
 Plack::Handler::Starlet
 CGI::Emulate::PSGI
-LWP::Protocol::PSGI
 .
 
 $deps{'MAILGATE'} = [ text_to_hash( << '.') ];

-----------------------------------------------------------------------


More information about the Rt-commit mailing list