changeset 4513:0253b8e7d76c

templates: replace some YUD with jQuery when we test and test it anyway
author Mads Kiilerich <madski@unity3d.com>
date Mon, 08 Sep 2014 13:38:56 +0200
parents 72747179701a
children 155f281be5f8
files kallithea/templates/admin/admin_log.html kallithea/templates/admin/settings/settings_system.html kallithea/templates/base/base.html kallithea/templates/changelog/changelog_summary_data.html kallithea/templates/files/files.html kallithea/templates/followers/followers_data.html kallithea/templates/forks/forks_data.html kallithea/templates/journal/journal_data.html kallithea/templates/pullrequests/pullrequest_show_my.html
diffstat 9 files changed, 20 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/templates/admin/admin_log.html	Mon Sep 08 13:38:56 2014 +0200
+++ b/kallithea/templates/admin/admin_log.html	Mon Sep 08 13:38:56 2014 +0200
@@ -39,7 +39,8 @@
 
 <script type="text/javascript">
   $(document).ready(function(){
-    $('#user_log').on('click','.pager_link',function(e){
+    var $user_log = $('#user_log');
+    $user_log.on('click','.pager_link',function(e){
       ypjax(e.target.href,"user_log",function(){
         show_more_event();
         tooltip_activate();
--- a/kallithea/templates/admin/settings/settings_system.html	Mon Sep 08 13:38:56 2014 +0200
+++ b/kallithea/templates/admin/settings/settings_system.html	Mon Sep 08 13:38:56 2014 +0200
@@ -36,7 +36,8 @@
 
 <script>
     $('#check_for_update').click(function(e){
-        $('#update_notice').show();
+        var $update_notice = $('#update_notice');
+        $update_notice.show();
         ypjax("${h.url('admin_settings_system_update')}",
               "update_notice");
     })
--- a/kallithea/templates/base/base.html	Mon Sep 08 13:38:56 2014 +0200
+++ b/kallithea/templates/base/base.html	Mon Sep 08 13:38:56 2014 +0200
@@ -208,9 +208,10 @@
   </div>
   <script type="text/javascript">
       YUE.on('branch_tag_switcher_2','mouseover',function(){
-         var loaded = YUD.hasClass('branch_tag_switcher_2','loaded');
+         var $branch_tag_switcher_2 = $('#branch_tag_switcher_2');
+         var loaded = $branch_tag_switcher_2.hasClass('loaded');
          if(!loaded){
-             YUD.addClass('branch_tag_switcher_2','loaded');
+             $branch_tag_switcher_2.addClass('loaded');
              ypjax("${h.url('branch_tag_switcher',repo_name=c.repo_name)}",'switch_to_list_2');
          }
          return false;
--- a/kallithea/templates/changelog/changelog_summary_data.html	Mon Sep 08 13:38:56 2014 +0200
+++ b/kallithea/templates/changelog/changelog_summary_data.html	Mon Sep 08 13:38:56 2014 +0200
@@ -70,7 +70,8 @@
 
 <script type="text/javascript">
   $(document).ready(function(){
-    $('#shortlog_data').on('click','.pager_link',function(e){
+    var $shortlog_data = $('#shortlog_data');
+    $shortlog_data.on('click','.pager_link',function(e){
       ypjax(e.target.href,"shortlog_data",function(){tooltip_activate();});
       e.preventDefault();
     });
--- a/kallithea/templates/files/files.html	Mon Sep 08 13:38:56 2014 +0200
+++ b/kallithea/templates/files/files.html	Mon Sep 08 13:38:56 2014 +0200
@@ -198,7 +198,6 @@
 
 $(document).ready(function(){
     ypjax_links();
-    var container = 'files_data';
     var $files_data = $('#files_data');
     //Bind to StateChange Event
     History.Adapter.bind(window,'statechange',function(){
@@ -209,9 +208,8 @@
         var _cur_time = new Date().getTime();
         // get from cache if it's there and not yet expired !
         if(_cache_obj !== undefined && _cache_obj[0] > _cur_time){
-            YUD.get(container).innerHTML=_cache_obj[1];
-            YUD.setStyle(container,'opacity','1.0');
-
+            $files_data.html(_cache_obj[1]);
+            $files_data.css('opacity','1.0');
             //callbacks after ypjax call
             callbacks(State);
         }
--- a/kallithea/templates/followers/followers_data.html	Mon Sep 08 13:38:56 2014 +0200
+++ b/kallithea/templates/followers/followers_data.html	Mon Sep 08 13:38:56 2014 +0200
@@ -18,7 +18,8 @@
 <div class="pagination-wh pagination-left">
 <script type="text/javascript">
 $(document).ready(function(){
-    $('#followers').on('click','.pager_link',function(e){
+    var $followers = $('#followers');
+    $followers.on('click','.pager_link',function(e){
         ypjax(e.target.href,"followers",function(){
             show_more_event();
             tooltip_activate();
--- a/kallithea/templates/forks/forks_data.html	Mon Sep 08 13:38:56 2014 +0200
+++ b/kallithea/templates/forks/forks_data.html	Mon Sep 08 13:38:56 2014 +0200
@@ -26,7 +26,8 @@
   <div class="pagination-wh pagination-left">
   <script type="text/javascript">
   $(document).ready(function(){
-      $('#forks').on('click','.pager_link',function(e){
+      var $forks = $('#forks');
+      $forks.on('click','.pager_link',function(e){
           ypjax(e.target.href,"forks",function(){
               show_more_event();
               tooltip_activate();
--- a/kallithea/templates/journal/journal_data.html	Mon Sep 08 13:38:56 2014 +0200
+++ b/kallithea/templates/journal/journal_data.html	Mon Sep 08 13:38:56 2014 +0200
@@ -40,7 +40,8 @@
   </div>
     <script type="text/javascript">
     $(document).ready(function(){
-        $('#journal').on('click','.pager_link',function(e){
+        var $journal = $('#journal');
+        $journal.on('click','.pager_link',function(e){
             ypjax(e.target.href,"journal",function(){
                 show_more_event();
                 tooltip_activate();
--- a/kallithea/templates/pullrequests/pullrequest_show_my.html	Mon Sep 08 13:38:56 2014 +0200
+++ b/kallithea/templates/pullrequests/pullrequest_show_my.html	Mon Sep 08 13:38:56 2014 +0200
@@ -31,11 +31,12 @@
 var show_pullrequests = function(e){
 
     var url = pyroutes.url('my_pullrequests_data');
-    if(YUD.get('show_closed') && YUD.get('show_closed').checked) {
+    if ($('#show_closed').prop('checked')) {
         var url = pyroutes.url('my_pullrequests_data', {'pr_show_closed': '1'});
     }
     ypjax(url, 'pullrequests_container', function(){
-        YUE.on('show_closed','change',function (e) {
+        // new #show_closed has just been loaded
+        $('#show_closed').change(function (e) {
             show_pullrequests(e);
         });
     });