r9412 - apps/gobi/trunk/code/Page

[email protected]
Newsgroups gmane.comp.java.helma.cvs
Message-ID <[email protected]>
Author: hannes
Date: 2008-12-11 14:42:56 +0100 (Thu, 11 Dec 2008)
New Revision: 9412

Modified:
   apps/gobi/trunk/code/Page/PageMacros.js
Log:
Add pattern option to list macro to only list pages with matching names.

Details at http://dev.helma.org/trac/helma/changeset/9412

Modified: apps/gobi/trunk/code/Page/PageMacros.js
===================================================================
--- apps/gobi/trunk/code/Page/PageMacros.js	2008-12-11 13:26:52 UTC (rev 9411)
+++ apps/gobi/trunk/code/Page/PageMacros.js	2008-12-11 13:42:56 UTC (rev 9412)
@@ -299,6 +299,12 @@
         return;
         
     var list = this.list();
+    if (param.pattern) {
+        var regexp = new RegExp(param.pattern, "gi");
+        list = list.filter(function(elem) {
+            return elem.name && elem.name.match(regexp);
+        })
+    }
     if (param.skin || param.separator) {
         // if skin or separatos is defined, use skinnedlist() to render
         PageList.skinnedList(list, param);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.