--- a/server.py +++ b/server.py @@ -34,14 +34,22 @@ resource = "default" if request.args.has_key('uri'): resource = request.args['uri'] - for i in collection.find({'resource':resource}): + for i in collection.find({'uri':resource}): del(i['_id']) ret[x] = i x = x + 1 + else: + for i in collection.find(): + del(i['_id']) + ret[x] = i + x = x + 1 if len(ret) == 0: ret['error'] = "Sorry! No re-treats for you." return jsonify(ret) +@app.route('/sweets', methods=['GET']) +def displaySweet(): + return render_template('sweets.html') @app.route('/search', methods=['GET']) def search(): @@ -57,7 +65,6 @@ try: if keyword in i['nodes']: del(i['_id']) - i['text'] = urllib.unquote_plus(i['text']) ret[y] = i y = y + 1 except: @@ -119,7 +126,7 @@ bs_js = root.makeelement('script') bs_js.set('src', 'static/bootstrap.js') - + jit = root.makeelement('script') jit.set('src', 'static/jit.js') --- a/static/tree.js +++ b/static/tree.js @@ -4,7 +4,7 @@ iStuff = ua.match(/iPhone/i) || ua.match(/iPad/i), typeOfCanvas = typeof HTMLCanvasElement, nativeCanvasSupport = (typeOfCanvas == 'object' || typeOfCanvas == 'function'), - textSupport = nativeCanvasSupport + textSupport = nativeCanvasSupport && (typeof document.createElement('canvas').getContext('2d').fillText == 'function'); //I'm setting this based on the fact that ExCanvas provides text support for IE //and that as of today iPhone/iPad current text support is lame @@ -121,12 +121,12 @@ } //Log.write('centering node ', node.name); console.log('centering node', node.name); - RGraph.onClick(node.id, { - hideLabels: false, - onComplete: function() { - //Log.write("done"); + RGraph.onClick(node.id, { + hideLabels: false, + onComplete: function() { + //Log.write("done"); } - }); + }); var html = '

' + node.name + '

Links To::