W3C home > Mailing lists > Public > www-validator-cvs@w3.org > August 2009

2006/unicorn/WebContent/scripts w3c-validator.js,1.1.2.7,1.1.2.8

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 21 Aug 2009 16:11:30 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MeWiA-0000El-OA@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/WebContent/scripts
In directory hutz:/tmp/cvs-serv897/WebContent/scripts

Modified Files:
      Tag: dev2
	w3c-validator.js 
Log Message:
/!\ does'nt work : choose previous version

Index: w3c-validator.js
===================================================================
RCS file: /sources/public/2006/unicorn/WebContent/scripts/Attic/w3c-validator.js,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -d -r1.1.2.7 -r1.1.2.8
--- w3c-validator.js	21 Aug 2009 15:03:16 -0000	1.1.2.7
+++ w3c-validator.js	21 Aug 2009 16:11:28 -0000	1.1.2.8
@@ -11,6 +11,8 @@
 		W3C.TaskButtons = $$('input.change_task');
 		W3C.TaskButtons.setStyle('display', 'none');
 		W3C.Tasks = $$('select.ucn_task');
+		// The current TaskID
+		W3C.TaskID = $$('input.task')[0].getProperty('value');
 		W3C.SectionFx = [];
 		W3C.OptionsFx = [];
 		
@@ -25,7 +27,7 @@
 		});
 	
 		//updating the location
-		W3C.updateLocation();
+		//W3C.updateLocation();
 		
 		W3C.initializeOptions();
 		
@@ -102,7 +104,10 @@
 							option.setProperty('selected', '');
 						};
 					});
+					W3C.TaskID = taskID;
 					W3C.initializeOptions(); 
+					
+					
 				},
 				onFailure: function() {
 					$$('fieldset.options').set('html', '');
@@ -142,13 +147,18 @@
 			link.addEvent('click', function(event){
 				option.setStyle('display', 'block'); // before any slide effect, set display:block
 				var block = (option.getStyle('margin-top').toInt() == 0);
-				W3C.setHash((block) ? pid : pid + opt);
+				W3C.setHash((block) ? pid + task : pid + task + opt);
 				event.stop();
 				W3C.refreshOptionLinks(!block, i);
 			});
+			
 		});
 		
 		W3C.updateLocation();
+		
+		//var task = '+task_' + $$('input.task')[0].getProperty('value');
+		//W3C.setHash(W3C.Location[0].replace(/-/g, '_') + task + (W3C.WithOptions ? '+with_options' : ''));
+		
 		W3C.refreshOptionLinks(W3C.WithOptions);
 		
 		W3C.OptionsFx.each(function (fx) {
@@ -159,7 +169,15 @@
 	
 	updateLocation: function(){
 		W3C.Location = window.location.hash.replace('#', '').split('+');
-		W3C.WithOptions = (W3C.Location[1] && W3C.Location[1].contains('with_options'));
+		W3C.WithOptions = (W3C.Location[1] && W3C.Location[1].contains('with_options')) || (W3C.Location[2] && W3C.Location[2].contains('with_options'));
+		
+		// check if there is a task defined in the url, if so the task id is added to W3C.TaskID
+		window.location.hash.replace('#', '').split('+').each(function (string) {
+			if (string.contains('task_')) {
+				W3C.TaskID = string.replace('task_', '');
+				alert("W3C.task: " + W3C.TaskID);
+			}
+		});
 	},
 	
 	refreshOptionLinks: function(options, idx){
@@ -173,7 +191,8 @@
 		}
 		
 		W3C.TabLinks.each(function(link){
-			link.href = (options) ? link.original + '+with_options' : link.original;
+			var original = link.original + (W3C.TaskID ? '+task_' + W3C.TaskID : '');//$$('input.task')[0].getProperty('value');
+			link.href = (options) ? original + '+with_options' : original;
 		});
 	},
 	
Received on Friday, 21 August 2009 16:11:40 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:38 UTC