From 784a4a308437b5d98605a79bbd339426d8145ad8 Mon Sep 17 00:00:00 2001 From: Siddharth Seth Date: Tue, 29 Nov 2011 00:10:56 +0000 Subject: [PATCH] MAPREDUCE-3045. Fixed UI filters to not filter on hidden title-numeric sort fields. Contributed by Jonathan Eagles git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1207714 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../src/main/resources/webapps/static/yarn.dt.plugins.js | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 076004cd7d..ab117274f7 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -119,6 +119,9 @@ Release 0.23.1 - Unreleased MAPREDUCE-3413. RM web ui applications not sorted in any order by default. (Jonathan Eagles via mahadev) + MAPREDUCE-3045. Fixed UI filters to not filter on hidden title-numeric + sort fields. (Jonathan Eagles via sseth) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/webapps/static/yarn.dt.plugins.js b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/webapps/static/yarn.dt.plugins.js index 4d00706939..86661acb49 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/webapps/static/yarn.dt.plugins.js +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/webapps/static/yarn.dt.plugins.js @@ -2,6 +2,11 @@ if (!jQuery.fn.dataTableExt.fnVersionCheck("1.7.5")) { alert("These plugins requires dataTables 1.7.5+"); } +// don't filter on hidden html elements for an sType of title-numeric +$.fn.dataTableExt.ofnSearch['title-numeric'] = function ( sData ) { + return sData.replace(/\n/g," ").replace( /<.*?>/g, "" ); +} + // 'title-numeric' sort type jQuery.fn.dataTableExt.oSort['title-numeric-asc'] = function(a,b) { var x = a.match(/title=["']?(-?\d+\.?\d*)/)[1];