From fccd2725f64f0743c371e4eb756a5ec3b3f7a1b6 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Thu, 23 Jan 2014 23:56:50 +0000 Subject: [PATCH] Compatibility: set new magic classes into elements with old magic IDs. --- tools/htdocs/mkws.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 41ecb4b..ae6740b 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -1401,6 +1401,21 @@ function _mkws_jquery_plugin ($) { $(document).ready(function() { log("on load ready"); + + // 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 + " mkwsTeam_AUTO"); + log("added magic classes to '" + node.attr('id') + "'"); + } + } + // Backwards compatibility: the special-case undefined team mkws.teams[''] = _make_mkws_team(j, undefined); log("Made the unnamed MKWS team"); -- 1.7.10.4