Commits

Jason Scheirer committed 9f57dff

Length-limit request

  • Participants
  • Parent commits 73ecb1d

Comments (0)

Files changed (1)

         var match = /^[A-Za-z_]+$/;
         if (match.test(searchTerm))
         {
-            var resultHolder = this.$.resultholder;
-        resultHolder.destroyClientControls();
-            this.createComponent({kind: "onyx.ProgressBar",
-                                  progress: 100,
-                                  content: "Searching",
-                                  container: resultHolder}).render();
-
-            var request = new enyo.Ajax({url: '/match-o-matic/' + verb + "/" + searchTerm, 
-                                        method: 'GET'}
-                                       ).response(this, 'gotWords').error(this, 'failedToFetch');
-            request.go({});
+	    if (searchTerm.length <= 11)
+            {
+                var resultHolder = this.$.resultholder;
+                resultHolder.destroyClientControls();
+                this.createComponent({kind: "onyx.ProgressBar",
+                                      progress: 100,
+                                      content: "Searching",
+                                      container: resultHolder}).render();
+    
+                var request = new enyo.Ajax({url: '/match-o-matic/' + verb + "/" + searchTerm, 
+                                            method: 'GET'}
+                                           ).response(this, 'gotWords').error(this, 'failedToFetch');
+                request.go({});
+	    }
+	    else
+	    {
+            	this.errorMessage("CPU cycles don't grow on trees.");
+	    }
         }
         else
         {