tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1137392 - in /openejb/trunk/sandbox/tools/src/main/resources/generate-index: config.properties javascript/index.js javascript/prettyprint.js velocity/index.vm
Date Sun, 19 Jun 2011 17:56:17 GMT
Author: rmannibucau
Date: Sun Jun 19 17:56:17 2011
New Revision: 1137392

URL: http://svn.apache.org/viewvc?rev=1137392&view=rev
Log:
adding an input to filter apis

Modified:
    openejb/trunk/sandbox/tools/src/main/resources/generate-index/config.properties
    openejb/trunk/sandbox/tools/src/main/resources/generate-index/javascript/index.js
    openejb/trunk/sandbox/tools/src/main/resources/generate-index/javascript/prettyprint.js
    openejb/trunk/sandbox/tools/src/main/resources/generate-index/velocity/index.vm

Modified: openejb/trunk/sandbox/tools/src/main/resources/generate-index/config.properties
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/tools/src/main/resources/generate-index/config.properties?rev=1137392&r1=1137391&r2=1137392&view=diff
==============================================================================
--- openejb/trunk/sandbox/tools/src/main/resources/generate-index/config.properties (original)
+++ openejb/trunk/sandbox/tools/src/main/resources/generate-index/config.properties Sun Jun
19 17:56:17 2011
@@ -1,4 +1,4 @@
-base=http://people.apache.org/~rmannibucau
+base = http://people.apache.org/~rmannibucau
 
 # input/output
 examples.zip = /tmp/examples.zip

Modified: openejb/trunk/sandbox/tools/src/main/resources/generate-index/javascript/index.js
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/tools/src/main/resources/generate-index/javascript/index.js?rev=1137392&r1=1137391&r2=1137392&view=diff
==============================================================================
--- openejb/trunk/sandbox/tools/src/main/resources/generate-index/javascript/index.js (original)
+++ openejb/trunk/sandbox/tools/src/main/resources/generate-index/javascript/index.js Sun
Jun 19 17:56:17 2011
@@ -1,3 +1,40 @@
+$(document).ready(function() {
+    $('input[type=text]#searchbox').keyup(function() {
+        input = $(this).val();
+        if (input.length != 0) {
+            var filter = input.split(' ');
+            var regexps = new Array();
+            var idx = 0;
+
+            for (var i = 0; i < filter.length; i++) {
+                if (!$.trim(filter[i]).length == 0) {
+                    regexps[idx++] = new RegExp(filter[i],"i");
+                }
+            }
+        }
+
+        // filtering apis
+        $('div#checkboxes-check > ul > li > input[type=button].button').each(function(i,
val) {
+                var toShow = false;
+                if (input.length == 0) {
+                    toShow = true;
+                } else {
+                    for (var i = 0; i < regexps.length; i++) {
+                        if (regexps[i].test($(val).attr('value'))) {
+                            toShow = true;
+                            break;
+                        }
+                    }
+                }
+                if (toShow) {
+                    $(val).show('slow');
+                } else {
+                    $(val).hide();
+                }
+            });
+        });
+});
+
 var close = ' X';
 var selectedClasses = new Array(); // classes to use
 var correspondingExamples = new Array(); // classes to use

Modified: openejb/trunk/sandbox/tools/src/main/resources/generate-index/javascript/prettyprint.js
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/tools/src/main/resources/generate-index/javascript/prettyprint.js?rev=1137392&r1=1137391&r2=1137392&view=diff
==============================================================================
--- openejb/trunk/sandbox/tools/src/main/resources/generate-index/javascript/prettyprint.js
(original)
+++ openejb/trunk/sandbox/tools/src/main/resources/generate-index/javascript/prettyprint.js
Sun Jun 19 17:56:17 2011
@@ -1,4 +1,4 @@
 $(document).ready(function() {
     $('code').addClass('prettyprint');
     prettyPrint();
-});
\ No newline at end of file
+});

Modified: openejb/trunk/sandbox/tools/src/main/resources/generate-index/velocity/index.vm
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/tools/src/main/resources/generate-index/velocity/index.vm?rev=1137392&r1=1137391&r2=1137392&view=diff
==============================================================================
--- openejb/trunk/sandbox/tools/src/main/resources/generate-index/velocity/index.vm (original)
+++ openejb/trunk/sandbox/tools/src/main/resources/generate-index/velocity/index.vm Sun Jun
19 17:56:17 2011
@@ -2,6 +2,10 @@
             <h2>OpenEJB examples:</h2>
 
             <div id="checkboxes-check">
+                <div id="search-box">
+                    API: <input id="searchbox" type="text" />
+                </div>
+
                 <ul>
 #foreach( $entry in $classes.entrySet() )
                     <li><input class="$examplesClasses.get($entry.key)" type="button"
api="$classes.get($entry.key)" value="$entry.key" onclick="javascript:filterExamples(this)"
></li>



Mime
View raw message