Browse Source

HUE-153. Problems with meta refresh handling.

Marcus McLaughlin 15 years ago
parent
commit
a8d2d3224f

+ 1 - 1
desktop/core/static/js/Source/CCS/CCS.JFrame.js

@@ -639,7 +639,7 @@ CCS.JFrame = new Class({
 		},
 		meta: function(data) {
 			//grab any meta tags and remove them from the html
-			data.meta = data.html.getTags('meta');
+			data.meta = Elements.from(data.html.getTags('meta').join(' ').replace('meta', 'span'));
 			data.html = data.html.stripTags('meta');
 		},
 		elements: function(data) {

+ 6 - 18
desktop/core/static/js/Source/JFrameFilters/CCS.JFrame.AutoRefresh.js

@@ -37,24 +37,12 @@ CCS.JFrame.addGlobalFilters({
 		//contents with the number of seconds until a refresh.
                 if (content && content.meta) {
 			var sec, url;
-                        			content.meta.each(function(meta) {
-			        var match = metaRE.exec(meta);
-                                if(match[1]) {
-                                         var data = match[1]; //set data to string of html attributes, space separated
-                                } else {
-                                         return;
-                                }  
-                                data = data.trim().split(' ');
-                                var attributeMap = new Object;
-                                data.each(function(item) {
-                                        var attribute = item.split('=');
-                                        attributeMap[attribute[0].replace(removeQuotes, '')] = attribute[1].replace(removeQuotes, ''); // remove quotes within string
-                                }); 
-                                var parts = attributeMap['content'].split(';');
-				if (attributeMap['http-equiv'] == "refresh") {
-					sec = parts[0];
-					if (parts[1]) url = unescape(parts[1].replace('url=', ''));
-				}
+                        content.meta.each(function(meta) {
+                                var parts = meta.get('content').split(';');
+                                if(meta.get('http-equiv') == "refresh") {
+                                        sec = parts[0].toInt();
+				        if (parts[1]) url = unescape(parts[1].replace('url=', ''));
+                                }
 			}, this);
 			if (!sec) return;
 			var end = new Date().increment('second', sec);