- From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
- Date: Fri, 23 Oct 2009 09:45:41 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2006/unicorn/WebContent/scripts In directory hutz:/tmp/cvs-serv26606/WebContent/scripts Modified Files: w3c_unicorn_results-yc.js w3c_unicorn_results.js Log Message: deactivated events on info/error/warning icons in case of a grouped observation Index: w3c_unicorn_results.js =================================================================== RCS file: /sources/public/2006/unicorn/WebContent/scripts/w3c_unicorn_results.js,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- w3c_unicorn_results.js 22 Oct 2009 12:56:50 -0000 1.21 +++ w3c_unicorn_results.js 23 Oct 2009 09:45:39 -0000 1.22 @@ -58,29 +58,32 @@ observer.getElement('a.anchor').addEvent('click', function(event) { W3C.open(observer, true); }); - if (observer.getElement('a.infos')) { - observer.getElement('a.infos').addEvent('click', function(event) { - event.preventDefault(); - W3C.open(observer, true); - W3C.closeAllSectionsBut(observer, observer.getElement('div.infos'), true); - scroller.toElement(observer); - }); - } - if (observer.getElement('a.errors')) { - observer.getElement('a.errors').addEvent('click', function(event) { - event.preventDefault(); - W3C.open(observer, true); - W3C.closeAllSectionsBut(observer, observer.getElement('div.errors'), true); - scroller.toElement(observer); - }); - } - if (observer.getElement('a.warnings')) { - observer.getElement('a.warnings').addEvent('click', function(event) { - event.preventDefault(); - W3C.open(observer, true); - W3C.closeAllSectionsBut(observer, observer.getElement('div.warnings'), true); - scroller.toElement(observer); - }); + + if (!observer.hasClass('grouped')) { + if (observer.getElement('a.infos')) { + observer.getElement('a.infos').addEvent('click', function(event) { + event.preventDefault(); + W3C.open(observer, true); + W3C.closeAllSectionsBut(observer, observer.getElement('div.infos'), true); + scroller.toElement(observer); + }); + } + if (observer.getElement('a.errors')) { + observer.getElement('a.errors').addEvent('click', function(event) { + event.preventDefault(); + W3C.open(observer, true); + W3C.closeAllSectionsBut(observer, observer.getElement('div.errors'), true); + scroller.toElement(observer); + }); + } + if (observer.getElement('a.warnings')) { + observer.getElement('a.warnings').addEvent('click', function(event) { + event.preventDefault(); + W3C.open(observer, true); + W3C.closeAllSectionsBut(observer, observer.getElement('div.warnings'), true); + scroller.toElement(observer); + }); + } } }); Index: w3c_unicorn_results-yc.js =================================================================== RCS file: /sources/public/2006/unicorn/WebContent/scripts/w3c_unicorn_results-yc.js,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- w3c_unicorn_results-yc.js 22 Oct 2009 12:56:50 -0000 1.1 +++ w3c_unicorn_results-yc.js 23 Oct 2009 09:45:39 -0000 1.2 @@ -2,4 +2,4 @@ // Author: Thomas GAMBET. // (c) COPYRIGHT MIT, ERCIM and Keio, 2009. // Compressed with YUI Compressor 2.4.2 (source: ./w3c_unicorn_index.js) -var W3C={start:function(){W3C.cleanHash();W3C.ContextsToShow=7;W3C.Observers=$$(".observer");var g=500;var a=$$(".observer.invalid");var e=new Fx.Scroll(document);var j=new Fx.Scroll(document,{duration:0});$$(".section").each(function(o){var q=o.getElement(".title");var p=o.getElement(".block");if(!o.hasClass("observer")||o.getElement(".section")!=null){q.addClass("pointer");var n=new Element("span",{"class":"arrow"});var m;if(q.getElement("span.icons")!=null){m=q.getElement("span.icons")}else{m=q.getElement("a.anchor")}n.inject(m,"after")}o.store("fxSlide",new Fx.Slide(p,{duration:g,link:"cancel"}));o.store("block",p);q.addEvent("click",function(r){W3C.toggle(o)})});$$(".observer .section").each(function(m){if(m.hasClass("warnings")){W3C.close(m,false)}else{W3C.open(m,false)}});$$(".observer .title a").each(function(m){m.addEvent("click",function(n){n.stopPropagation()})});$$(".observer").each(function(m){W3C.open(m,false);if(m.hasClass("valid")&&a.length>0){W3C.close(m,false)}m.getElement("a.anchor").addvent("click",function(n){W3C.open(m,true)});if(m.getElement("a.infos")){m.getElement("a.infos").addEvent("click",function(n){n.preventDefault();W3C.open(m,true);W3C.closeAllSectionsBut(m,m.getElement("div.infos"),true);e.toElement(m)})}if(m.getElement("a.errors")){m.getElement("a.errors").addEvent("click",function(n){n.preventDefault();W3C.open(m,true);W3C.closeAllSectionsBut(m,m.getElement("div.errors"),true);e.toElement(m)})}if(m.getElement("a.warnings")){m.getElement("a.warnings").addEvent("click",function(n){n.preventDefault();W3C.open(m,true);W3C.closeAllSectionsBut(m,m.getElement("div.warnings"),true);e.toElement(m)})}});$$("div#messages pre").slide("hide");$$("div#messages > div").each(function(m){if(m.getElement("pre")){m.addClass("pointer");m.addEvent("click",function(n){m.getElement("pre").slide("toggle")})}});var d=new Fx.SmoothScroll({links:".smooth",wheelStops:true});W3C.parseHash();var c=$("observations").getProperty("class");var k=new RegExp(/contextShow:'[^']*'/);var b=k.exec(c);var l="";fori=0;i<b.length;i++){l=l+b[i]}var f=l.replace("contextShow:","").replace(/'/g,"");var k=new RegExp(/contextHide:'[^']*'/);var b=k.exec(c);var l="";for(i=0;i<b.length;i++){l=l+b[i]}var h=l.replace("contextHide:","").replace(/'/g,"");$$("td.message").each(function(m){if(m.getProperty("rowspan")>W3C.ContextsToShow){var n=m.getParent("tr");var t=n.getElement("td.anchor");var u=m.getProperty("rowspan");var o=1;var s=n;var r=new Array();var q=0;while(o<=u){if(o>W3C.ContextsToShow){s.setStyle("display","none");r[q]=s;q++}if(o==u){var v=new Element("tr",{"class":"showContext"});var p=new Element("td",{colspan:"3"});p.addClass("pointer");p.setProperty("title",f.replace(/%1/,r.length));p.set("text",f.replace(/%1/,r.length));p.inject(v);v.inject(s,"after");v.addEvent("click",function(w){var x=r.some(function(y){if(y.getStyle("display")=="none"){return true}else{return false}});if(x){r.each(function(y){y.setStyle("display","")});m.setProperty("rowspan",u+1);t.setProperty("rowspan",u+1);p.setProperty("title",h);p.set("tet",h);j.toElement(n)}else{r.each(function(y){y.setStyle("display","none")});m.setProperty("rowspan",W3C.ContextsToShow+1);t.setProperty("rowspan",W3C.ContextsToShow+1);p.setProperty("title",f.replace(/%1/,r.length));p.set("text",f.replace(/%1/,r.length));j.toElement(n)}})}s=s.getNext("tr");o++}m.setProperty("rowspan",W3C.ContextsToShow+1);t.setProperty("rowspan",W3C.ContextsToShow+1)}})},toggle:function(b){var c=b.getElement(".title");var a=b.retrieve("fxSlide");if(b.retrieve("open")){W3C.close(b,true)}else{W3C.open(b,true)}},close:function(b,e){var d=b.retrieve("open");var c=b.getElement(".title");var a=b.retrieve("fxSlide");c.removeClass("toggled");b.store("open",false);if(e&&d){a.slideOut().chain(function(){b.getElement("div").setStyle("display","none");a.callChain()})}else{a.hide();b.getElement("div").setStyle("display","none")}},open:function(c,e){var b=!c.retrieve("open");var d=c.getElement(".title");var a=c.retrieve("fxSlide");d.addClass("toggled");c.store("open",true);c.getElement("div").setStyle("dsplay","");if(e&&b){a.slideIn().chain(function(){c.getElement("div").setStyle("height","auto");a.callChain()})}else{a.show();c.getElement("div").setStyle("height","auto")}},closeAllObserversBut:function(a,b){W3C.Observers.each(function(c){if(c!=a){W3C.close(c,b)}});W3C.open(a,b)},closeAllSectionsBut:function(a,b,c){a.getElements(".section").each(function(d){if(d!=b){W3C.close(d,c)}});W3C.open(b,c)},parseHash:function(){var e=window.location.hash;if(e==""){return}var b=e.replace("#","").split("_");var k=b[0];var n=b[1];var a=b[2];var j=b[3];var f=new Fx.Scroll(document,{duration:0});var g=W3C.Observers.getProperty("id").indexOf(k);if(g==-1){W3C.setHash("");return}var h=W3C.Observers[g];W3C.open(h,false);if(!n){f.toElement(h);return}var l=h.getElements(".section").getProperty("id").indexOf(k+"_"+n);if(l==-1){W3C.setHash(k);return}var m=h.getElements(".section")[l];W3C.closeAllSectionsBut(h,m,false);if(!a){f.toElement(h);return}var d=m.getElements("td.uri").getProperty("id").indexOf(k+"_"+n+"_"+a);if(d==-1){W3.setHash(k+"_"+n);return}var c=m.getElements("td.uri")[d];if(!j){f.toElement(c);return}W3C.setHash(e)},updateHash:function(){var c=W3C.Forms[W3C.SelectedTab].getProperty("id");var b="+task_"+W3C.TaskOptions[W3C.SelectedTask].getProperty("value");var a=W3C.WithOptions?"+with_options":"";W3C.setHash(c+b+a)},cleanHash:function(){var a=window.location.hash;if(a.match("^#validate-by")){W3C.setHash("")}},setHash:function(a){if(window.webkit419){W3C.FakeForm=W3C.FakeForm||new Element("form",{method:"get"}).injectInside(document.body);W3C.FakeForm.setProperty("action","#"+a).submit()}else{window.location.replace("#"+a)}}};window.addEvent("domready",W3C.start);window.addEvent("onbeforeunload",function(){console.log(history.toString());history.go(-2)}); \ No newline at end of file +var W3C={start:function(){W3C.cleanHash();W3C.ContextsToShow=7;W3C.Observers=$$(".observer");var g=500;var a=$$(".observer.invalid");var e=new Fx.Scroll(document);var j=new Fx.Scroll(document,{duration:0});$$(".section").each(function(o){var q=o.getElement(".title");var p=o.getElement(".block");if(!o.hasClass("observer")||o.getElement(".section")!=null){q.addClass("pointer");var n=new Element("span",{"class":"arrow"});var m;if(q.getElement("span.icons")!=null){m=q.getElement("span.icons")}else{m=q.getElement("a.anchor")}n.inject(m,"after")}o.store("fxSlide",new Fx.Slide(p,{duration:g,link:"cancel"}));o.store("block",p);q.addEvent("click",function(r){W3C.toggle(o)})});$$(".observer .section").each(function(m){if(m.hasClass("warnings")){W3C.close(m,false)}else{W3C.open(m,false)}});$$(".observer .title a").each(function(m){m.addEvent("click",function(n){n.stopPropagation()})});$$(".observer").each(function(m){W3C.open(m,false);if(m.hasClass("valid")&&a.length>0){W3C.close(m,false)}m.getElement("a.anchor").addvent("click",function(n){W3C.open(m,true)});if(!m.hasClass("grouped")){if(m.getElement("a.infos")){m.getElement("a.infos").addEvent("click",function(n){n.preventDefault();W3C.open(m,true);W3C.closeAllSectionsBut(m,m.getElement("div.infos"),true);e.toElement(m)})}if(m.getElement("a.errors")){m.getElement("a.errors").addEvent("click",function(n){n.preventDefault();W3C.open(m,true);W3C.closeAllSectionsBut(m,m.getElement("div.errors"),true);e.toElement(m)})}if(m.getElement("a.warnings")){m.getElement("a.warnings").addEvent("click",function(n){n.preventDefault();W3C.open(m,true);W3C.closeAllSectionsBut(m,m.getElement("div.warnings"),true);e.toElement(m)})}}});$$("div#messages pre").slide("hide");$$("div#messages > div").each(function(m){if(m.getElement("pre")){m.addClass("pointer");m.addEvent("click",function(n){m.getElement("pre").slide("toggle")})}});var d=new Fx.SmoothScroll({links:".smooth",wheelStops:true});W3C.parseHash();var c=$("observations").getProperty("class");var k=new RegExp(/contextShow:'[^']*'/);ar b=k.exec(c);var l="";for(i=0;i<b.length;i++){l=l+b[i]}var f=l.replace("contextShow:","").replace(/'/g,"");var k=new RegExp(/contextHide:'[^']*'/);var b=k.exec(c);var l="";for(i=0;i<b.length;i++){l=l+b[i]}var h=l.replace("contextHide:","").replace(/'/g,"");$$("td.message").each(function(m){if(m.getProperty("rowspan")>W3C.ContextsToShow){var n=m.getParent("tr");var t=n.getElement("td.anchor");var u=m.getProperty("rowspan");var o=1;var s=n;var r=new Array();var q=0;while(o<=u){if(o>W3C.ContextsToShow){s.setStyle("display","none");r[q]=s;q++}if(o==u){var v=new Element("tr",{"class":"showContext"});var p=new Element("td",{colspan:"3"});p.addClass("pointer");p.setProperty("title",f.replace(/%1/,r.length));p.set("text",f.replace(/%1/,r.length));p.inject(v);v.inject(s,"after");v.addEvent("click",function(w){var x=r.some(function(y){if(y.getStyle("display")=="none"){return true}else{return false}});if(x){r.each(function(y){y.setStyle("display","")});m.setProperty("rowspan",u+1);t.setProperty("rowspan",u+1);p.setPoperty("title",h);p.set("text",h);j.toElement(n)}else{r.each(function(y){y.setStyle("display","none")});m.setProperty("rowspan",W3C.ContextsToShow+1);t.setProperty("rowspan",W3C.ContextsToShow+1);p.setProperty("title",f.replace(/%1/,r.length));p.set("text",f.replace(/%1/,r.length));j.toElement(n)}})}s=s.getNext("tr");o++}m.setProperty("rowspan",W3C.ContextsToShow+1);t.setProperty("rowspan",W3C.ContextsToShow+1)}})},toggle:function(b){var c=b.getElement(".title");var a=b.retrieve("fxSlide");if(b.retrieve("open")){W3C.close(b,true)}else{W3C.open(b,true)}},close:function(b,e){var d=b.retrieve("open");var c=b.getElement(".title");var a=b.retrieve("fxSlide");c.removeClass("toggled");b.store("open",false);if(e&&d){a.slideOut().chain(function(){b.getElement("div").setStyle("display","none");a.callChain()})}else{a.hide();b.getElement("div").setStyle("display","none")}},open:function(c,e){var b=!c.retrieve("open");var d=c.getElement(".title");var a=c.retrieve("fxSlide");d.addClass("toggled");c.store("open",true);c.gtElement("div").setStyle("display","");if(e&&b){a.slideIn().chain(function(){c.getElement("div").setStyle("height","auto");a.callChain()})}else{a.show();c.getElement("div").setStyle("height","auto")}},closeAllObserversBut:function(a,b){W3C.Observers.each(function(c){if(c!=a){W3C.close(c,b)}});W3C.open(a,b)},closeAllSectionsBut:function(a,b,c){a.getElements(".section").each(function(d){if(d!=b){W3C.close(d,c)}});W3C.open(b,c)},parseHash:function(){var e=window.location.hash;if(e==""){return}var b=e.replace("#","").split("_");var k=b[0];var n=b[1];var a=b[2];var j=b[3];var f=new Fx.Scroll(document,{duration:0});var g=W3C.Observers.getProperty("id").indexOf(k);if(g==-1){W3C.setHash("");return}var h=W3C.Observers[g];W3C.open(h,false);if(!n){f.toElement(h);return}var l=h.getElements(".section").getProperty("id").indexOf(k+"_"+n);if(l==-1){W3C.setHash(k);return}var m=h.getElements(".section")[l];W3C.closeAllSectionsBut(h,m,false);if(!a){f.toElement(h);return}var d=m.getElements("td.uri").getProperty("id").indexOfk+"_"+n+"_"+a);if(d==-1){W3C.setHash(k+"_"+n);return}var c=m.getElements("td.uri")[d];if(!j){f.toElement(c);return}W3C.setHash(e)},updateHash:function(){var c=W3C.Forms[W3C.SelectedTab].getProperty("id");var b="+task_"+W3C.TaskOptions[W3C.SelectedTask].getProperty("value");var a=W3C.WithOptions?"+with_options":"";W3C.setHash(c+b+a)},cleanHash:function(){var a=window.location.hash;if(a.match("^#validate-by")){W3C.setHash("")}},setHash:function(a){if(window.webkit419){W3C.FakeForm=W3C.FakeForm||new Element("form",{method:"get"}).injectInside(document.body);W3C.FakeForm.setProperty("action","#"+a).submit()}else{window.location.replace("#"+a)}}};window.addEvent("domready",W3C.start);window.addEvent("onbeforeunload",function(){console.log(history.toString());history.go(-2)}); \ No newline at end of file
Received on Friday, 23 October 2009 09:45:43 UTC