Permalink
Browse files

add new naminating api function commented out

  • Loading branch information...
jlipps committed Nov 15, 2012
1 parent 5c0774f commit 95f98d480d89d497470f00c53d2786d0a815b6cf
Showing with 25 additions and 3 deletions.
  1. +1 −0 .gitignore
  2. +22 −0 app.py
  3. +2 −3 static/naminator.js
View
@@ -0,0 +1 @@
+auth.json
View
22 app.py
@@ -35,6 +35,28 @@ def naminatorize():
return render_json(json.dumps(naminatorized))
+#@app.route("/naminatorize", methods=['GET', 'POST'])
+#def naminatorize():
+ #text = request.form.get('text') or request.args.get('text')
+ #if not text:
+ #return render_json('{}')
+
+ #naminatorized = []
+ #for name in text.split(" "):
+ #suffix = "nator"
+ #did_something_clever = False
+ #if name.endswith('e'):
+ #name = name[:-1] + 'i'
+ #did_something_clever = True
+ #if not name.endswith(('a', 'i', 'o', 'u', 'y')):
+ #suffix = 'i' + suffix
+ #else:
+ #did_something_clever = True
+
+ #naminatorized.append({(name + suffix): did_something_clever})
+ #return render_json(json.dumps({'result': naminatorized, 'version': '0.1'}))
+
+
@app.route("/")
def index():
return render_template("index.html", **locals())
View
@@ -1,10 +1,9 @@
$(function() {
console.log("Page loaded!");
-
- $('#doItNau').click(doTheNaminating);
+ $('#doItNau').click(window.doTheNaminating);
});
-var doTheNaminating = function() {
+window.doTheNaminating = function() {
console.log("Doing the naminating");
$.ajax({
url: '/naminatorize'

0 comments on commit 95f98d4

Please sign in to comment.