From 467abe4a0821d9fd9fe08d691c9eea4b001b927c Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Fri, 7 Feb 2014 15:47:09 +0000 Subject: [PATCH] Move some code around -- no effect. --- tools/htdocs/mkws.js | 103 +++++++++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 51 deletions(-) diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index b694bde..42585ea 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -1283,57 +1283,6 @@ function _mkws_jquery_plugin ($) { // enable before page load, so we could call it before mkws() runs _mkws_jquery_plugin(j); - $(document).ready(function() { - log("on load ready"); - default_mkws_config(); - - // Backwards compatibility: set new magic class names on any - // elements that have the old magic IDs. - var ids = [ "Switch", "Lang", "Search", "Pager", "Navi", - "Results", "Records", "Targets", "Ranking", - "Termlists", "Stat" ]; - for (var i = 0; i < ids.length; i++) { - var id = 'mkws' + ids[i]; - var node = $('#' + id); - if (node.attr('id')) { - node.addClass(id); - log("added magic class to '" + node.attr('id') + "'"); - } - } - - // For all MKWS-classed nodes that don't have a team - // specified, set the team to AUTO. - $('[class^="mkws"],[class*=" mkws"]').each(function () { - if (!this.className.match(/mkwsTeam_/)) { - log("adding AUTO team to node with class '" + this.className + "'"); - $(this).addClass('mkwsTeam_AUTO'); - } - }); - - // Find all nodes with an class, and determine their team from - // the mkwsTeam_* class. Make all team objects. - $('[class^="mkws"],[class*=" mkws"]').each(function () { - var node = this; - mkws.handle_node_with_team(node, function(tname) { - if (mkws.teams[tname]) { - log("MKWS team '" + tname + "' already exists, skipping"); - } else { - mkws.teams[tname] = team(j, tname); - log("Made MKWS team '" + tname + "'"); - } - }); - }); - - if (mkws_config.use_service_proxy) { - authenticate_session(mkws_config.service_proxy_auth, - mkws_config.service_proxy_auth_domain, - mkws_config.pazpar2_url); - } else { - // raw pp2 - run_auto_searches(); - } - }); - mkws.handle_node_with_team = function(node, callback) { var classes = node.className; @@ -1506,4 +1455,56 @@ function _mkws_jquery_plugin ($) { } } } + + + $(document).ready(function() { + log("on load ready"); + default_mkws_config(); + + // Backwards compatibility: set new magic class names on any + // elements that have the old magic IDs. + var ids = [ "Switch", "Lang", "Search", "Pager", "Navi", + "Results", "Records", "Targets", "Ranking", + "Termlists", "Stat" ]; + for (var i = 0; i < ids.length; i++) { + var id = 'mkws' + ids[i]; + var node = $('#' + id); + if (node.attr('id')) { + node.addClass(id); + log("added magic class to '" + node.attr('id') + "'"); + } + } + + // For all MKWS-classed nodes that don't have a team + // specified, set the team to AUTO. + $('[class^="mkws"],[class*=" mkws"]').each(function () { + if (!this.className.match(/mkwsTeam_/)) { + log("adding AUTO team to node with class '" + this.className + "'"); + $(this).addClass('mkwsTeam_AUTO'); + } + }); + + // Find all nodes with an class, and determine their team from + // the mkwsTeam_* class. Make all team objects. + $('[class^="mkws"],[class*=" mkws"]').each(function () { + var node = this; + mkws.handle_node_with_team(node, function(tname) { + if (mkws.teams[tname]) { + log("MKWS team '" + tname + "' already exists, skipping"); + } else { + mkws.teams[tname] = team(j, tname); + log("Made MKWS team '" + tname + "'"); + } + }); + }); + + if (mkws_config.use_service_proxy) { + authenticate_session(mkws_config.service_proxy_auth, + mkws_config.service_proxy_auth_domain, + mkws_config.pazpar2_url); + } else { + // raw pp2 + run_auto_searches(); + } + }); })(jQuery); -- 1.7.10.4