[Rt-commit] rt branch, no-prototype, updated. rt-3.8.8-186-g9e15d07

? sunnavy sunnavy at bestpractical.com
Thu Jul 29 06:20:51 EDT 2010


The branch, no-prototype has been updated
       via  9e15d07d837c8770f116b69293e37aa5215274d3 (commit)
      from  c68ecd3215503ce85d4a92c667c916584f41a9e3 (commit)

Summary of changes:
 share/html/Elements/HeaderJavascript          |    1 -
 share/html/Elements/ShowCustomFields          |    4 +-
 share/html/NoAuth/js/ahah.js                  |   51 -------------------------
 share/html/Ticket/Elements/Bookmark           |    3 +-
 share/html/Ticket/Elements/ClickToShowHistory |    2 +-
 5 files changed, 5 insertions(+), 56 deletions(-)
 delete mode 100644 share/html/NoAuth/js/ahah.js

- Log -----------------------------------------------------------------
commit 9e15d07d837c8770f116b69293e37aa5215274d3
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jul 29 15:44:34 2010 +0800

    remove ahah.js too

diff --git a/share/html/Elements/HeaderJavascript b/share/html/Elements/HeaderJavascript
index 50cdc3d..6f37521 100644
--- a/share/html/Elements/HeaderJavascript
+++ b/share/html/Elements/HeaderJavascript
@@ -51,7 +51,6 @@ $onload => undef
 </%args>
 <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/jquery-1.4.2.min.js"></script>
 <script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/jquery_noconflict.js"></script>
 <script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/jquery.autocomplete-min.js"></script>
diff --git a/share/html/Elements/ShowCustomFields b/share/html/Elements/ShowCustomFields
index b60c49a..1e7c553 100644
--- a/share/html/Elements/ShowCustomFields
+++ b/share/html/Elements/ShowCustomFields
@@ -112,9 +112,9 @@ my $print_value = sub {
        $m->out(   '<a href="'. $value->IncludeContentForValue .'">' );
        $m->print( $value->IncludeContentForValue );
        $m->out(   qq{</a></div>\n} );
-       $m->out(   qq{<script><!--\nahah('} );
+       $m->out(   qq{<script><!--\njQuery('#object_cf_value_$vid').load('} );
        $m->print( $value->IncludeContentForValue );
-       $m->out(   qq{', 'object_cf_value_$vid');\n--></script>\n} );
+       $m->out(   qq{');\n--></script>\n} );
     }
 };
 
diff --git a/share/html/NoAuth/js/ahah.js b/share/html/NoAuth/js/ahah.js
deleted file mode 100644
index 5fcb47a..0000000
--- a/share/html/NoAuth/js/ahah.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-% $r->content_type('application/x-javascript');
-*/
-// originally Fetched from http://www.opendarwin.org/~drernie/src/ahah.js - No Copyright - Public Domain
-// a patch fetched from http://www.xfront.com/microformats/examples/ahah/example01/ahah.js - see http://issues.bestpractical.com/Ticket/Display.html?id=14296
-
-function ahah(url, target, delay) {
-  // document.getElementById(target).innerHTML = 'Loading <a href="'+url+'">'+url +'</a>...';
-  var req;
-  if (window.XMLHttpRequest) {
-    req = new XMLHttpRequest();
-  } else if (window.ActiveXObject) {
-    req = new ActiveXObject("Microsoft.XMLHTTP");
-  }
-
-  var use_get;
-  if ( /webkit|firefox\/2/i.test( navigator.userAgent ) ) {
-      // seems safari has weird problem with post: 
-      // it does remove the old content of target
-      // while doesn't replace that with new content
-      // so is firefox 2
-      use_get = 1;
-  }
-
-  if (req != undefined) {
-    req.onreadystatechange = function() {ahahDone(req, url, target, delay);};
-    if ( use_get == 1 ) {
-        req.open("GET", url, true);
-    }
-    else{
-        req.open("POST", url, true);
-    }
-    req.send("");
-  }
-}  
-
-function ahahDone(req, url, target, delay) {
-  if (req.readyState == 4) { // only if req is "loaded"
-    if (req.status == 200) { // only if "OK"
-      document.getElementById(target).innerHTML = req.responseText;
-    } else {
-      document.getElementById(target).innerHTML="Error loading '"+url+"':\n"+req.statusText;
-    }
-    if (delay != undefined) {
-       setTimeout("ahah(url,target,delay)", delay); // resubmit after delay
-	    //server should ALSO delay before responding
-    }
-  }
-}
-
-% $m->abort();
diff --git a/share/html/Ticket/Elements/Bookmark b/share/html/Ticket/Elements/Bookmark
index d857d38..387bb09 100644
--- a/share/html/Ticket/Elements/Bookmark
+++ b/share/html/Ticket/Elements/Bookmark
@@ -83,7 +83,8 @@ $Toggle => 0
 </%ARGS>
 <span id="toggle-<% $id %>">
 % my $url = RT->Config->Get('WebPath') ."/Helpers/Toggle/TicketBookmark?id=". $id;
-<a align="right" href="<% $url %>" onclick="ahah('<% $url |n %>', 'toggle-<% $id |n %>'); return false;" >
+<a align="right" href="<% $url %>" onclick="jQuery('#toggle-<% $id |n
+%>').load('<% $url |n %>'); return false;" >
 % if ( $bookmarked ) {
 <img src="<% RT->Config->Get('WebPath') %>/NoAuth/images/star.gif" alt="<% loc('Remove Bookmark') %>" style="border-style: none" />
 % } else {
diff --git a/share/html/Ticket/Elements/ClickToShowHistory b/share/html/Ticket/Elements/ClickToShowHistory
index 41856c1..a3087c8 100644
--- a/share/html/Ticket/Elements/ClickToShowHistory
+++ b/share/html/Ticket/Elements/ClickToShowHistory
@@ -47,7 +47,7 @@
 %# END BPS TAGGED BLOCK }}}
 <div id="deferred_ticket_history">
     <& /Widgets/TitleBoxStart, title => 'History' &>
-        <a href="<% $url %>" onclick="ahah('<% $url |n %>', 'deferred_ticket_history'); return false;" >Show ticket history</a>
+        <a href="<% $url %>" onclick="jQuery('#deferred_ticket_history').load('<% $url |n %>'); return false;" >Show ticket history</a>
     <& /Widgets/TitleBoxEnd &>
 </div>
 <%ARGS>

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


More information about the Rt-commit mailing list