[Debtags-commits] [svn] r2210 - in web/trunk: . js

Enrico Zini enrico at alioth.debian.org
Tue Dec 5 01:46:30 CET 2006


Author: enrico
Date: Tue Dec  5 01:46:30 2006
New Revision: 2210

Modified:
   web/trunk/edit.html
   web/trunk/js/debtags.js
   web/trunk/main.css
   web/trunk/todo.html
Log:
Implemented extra tag hints

Modified: web/trunk/edit.html
==============================================================================
--- web/trunk/edit.html	(original)
+++ web/trunk/edit.html	Tue Dec  5 01:46:30 2006
@@ -1,14 +1,24 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html lang="en">
 <!-- TODO:
-	detect if cookies are not allowed and ask the user to please turn them on to
-	  help sorting out submissions
   give some per-facet intro when a facet is selected
 
   < h01ger> and make a developer-view, with all packages per developer and show a graph per developer :)
 
 	< h01ger> enrico, another todo-item: display (links to edit) e same source-package
 	< h01ger> enrico, suite::debian-edu and all the other CDDs are missing :)
+
+	Erich: Maybe you could add some "Loading..." display to the editor, at least for opera? I just tested with opera again, and at first thought it was still not working.
+	Erich: It would be interesting to have a button "similar packages". So when you're done editing a package you can easily go to another one you might know.
+
+	Search-as-you-type in the todo.html package list
+		do it with a dom visit that gets the package name looking at the text node
+		in the right place in the DOM, and sets visibility accordingly
+		(this removes the need of remembering the collection)
+
+	Get maintainer/comaintainer package list from
+	http://qa.debian.org/data/ddpo/results/ddpo_maintainers, where # indicates a
+	comaintained package.
 -->
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
@@ -22,6 +32,7 @@
   <script src="js/vocabulary.js"></script>
   <script src="js/tips.js"></script>
   <script src="js/debtags.js"></script>
+  <script src="js/extrawarnings.js"></script>
   <script type="text/javascript">
   <!--
 var pkg = false;
@@ -186,6 +197,15 @@
 			b += "<li>" + comments[i] + "</li>\n";
 		b += "</ul>";
 	}
+	comments = tagsetExtraWarnings(pkg, tags);
+	if (comments.length > 0)
+	{
+		b = "<div id='todotitle'>Hints:</div>";
+		b += "<ul>";
+		for (var i in comments)
+			b += "<li>" + comments[i] + "</li>\n";
+		b += "</ul>";
+	}
 	render("todolist", b);
 
 	/* TODO: update the field value

Modified: web/trunk/js/debtags.js
==============================================================================
--- web/trunk/js/debtags.js	(original)
+++ web/trunk/js/debtags.js	Tue Dec  5 01:46:30 2006
@@ -28,6 +28,11 @@
   has: function(name) {
 		return this._items.hasOwnProperty(name);
 	},
+	hasRE: function(re) {
+		var res = false;
+		this.each(function(t) { if(re.exec(t)) res = true; });
+		return res;
+	},
 	add: function(name) {
 		if (this.has(name))
 			return false;
@@ -714,32 +719,21 @@
 function commentTagset(pkg, tags)
 {
 	var res = new Array();
-	var nytRE = new RegExp("^special::not-yet-tagged");
-	var rolRE = new RegExp("^role::");
-	var x11RE = new RegExp("^(interface::(3d|x11)|x11::application)$");
-	var uitRE = new RegExp("^uitoolkit::");
-	var prgRE = new RegExp("^role::(program|devel-lib|plugin|shared-lib|source)$");
-	var iinRE = new RegExp("^implemented-in::");
-	var has_nyt = false;
-	var has_rol = false;
-	var has_x11 = false;
-	var has_uit = false;
-	var has_prg = false;
-	var has_iin = false;
-	tags.each(function(t){
-		if (nytRE.exec(t)) has_nyt = true;
-		if (rolRE.exec(t)) has_rol = true;
-		if (x11RE.exec(t)) has_x11 = true;
-		if (uitRE.exec(t)) has_uit = true;
-		if (prgRE.exec(t)) has_prg = true;
-		if (iinRE.exec(t)) has_iin = true;
-	});
-	if (!hasCookies) res.push("Please enable cookies for this page: it makes your contributions easier to process.  For questions, please <a href='mailto:debtags-devel at lists.alioth.debian.org'>mail the Debtags mailing list</a>.");
-	if (has_nyt) res.push("The <i>not-yet-tagged</i> tags are still present.");
-	if (!has_rol) res.push("A <i>role::*</i> tag is still missing.");
-	if (has_x11 && !has_uit) res.push("An <i>uitoolkit::*</i> tag seems to be missing.");
-	if (has_prg && !has_iin) res.push("An <i>implemented-in::*</i> tag seems to be missing.");
+	if (!hasCookies)
+		res.push("Please enable cookies for this page: it makes your contributions easier to process.  For questions, please <a href='mailto:debtags-devel at lists.alioth.debian.org'>mail the Debtags mailing list</a>.");
+	if (tags.hasRE(/^special::not-yet-tagged/))
+		res.push("The <i>not-yet-tagged</i> tags are still present.");
+	if (!tags.hasRE(/^role::/))
+		res.push("A <i>role::*</i> tag is still missing.");
+	if (tags.hasRE(/^(interface::(3d|x11)|x11::application)$/) && !tags.hasRE(/^uitoolkit::/))
+		res.push("An <i>uitoolkit::*</i> tag seems to be missing.");
+	if (tags.hasRE(/^role::(program|devel-lib|plugin|shared-lib|source)$/) && ! tags.hasRE(/^implemented-in::/))
+		res.push("An <i>implemented-in::*</i> tag seems to be missing.");
 	return res;
 }
 
+tagsetExtraWarnings = function(pkg, tags) {
+	return new Array();
+}
+
 // vim:set ts=2 sw=2:

Modified: web/trunk/main.css
==============================================================================
--- web/trunk/main.css	(original)
+++ web/trunk/main.css	Tue Dec  5 01:46:30 2006
@@ -173,6 +173,16 @@
 	content: "✘ ";
 	color: red;
 }
+div.pkghint {
+	font-size: small;
+}
+div.pkghint li {
+	list-style-type: none;
+}
+div.pkghint li:before {
+	content: "? ";
+	color: darkred;
+}
 /*
 #atfacets {
 	float: left;

Modified: web/trunk/todo.html
==============================================================================
--- web/trunk/todo.html	(original)
+++ web/trunk/todo.html	Tue Dec  5 01:46:30 2006
@@ -9,6 +9,7 @@
   <link rev="made" href="mailto:enrico at debian.org">
   <link href="main.css" rel="stylesheet" type="text/css">
   <script src="js/debtags.js"></script>
+  <script src="js/extrawarnings.js"></script>
   <script type="text/javascript">
   <!--
 var curpanel = "nyt";
@@ -39,6 +40,16 @@
 			b += "</ul>";
 			b += "</div>";
 		}
+		comments = tagsetExtraWarnings(p, tags);
+		if (comments.length > 0)
+		{
+			b += "<div class='pkghint'>";
+			b += "<ul>";
+			for (var i in comments)
+				b += "<li>" + comments[i] + "</li>\n";
+			b += "</ul>";
+			b += "</div>";
+		}
 		hasCookies = ohc;
 	}
 	return b;



More information about the Debtags-commits mailing list