Permalink
Browse files

don't need these

  • Loading branch information...
1 parent 546686b commit 6d8c30243bc32be7ba54951dbe1450edaf9a4a51 @rgarcia committed Feb 26, 2012
View
@@ -1,50 +0,0 @@
-define([
- 'underscore',
- '../models/cssprop'
-], function(_, CSSProp) {
-
- return {
-
- mapping: {
-
- 'read' : {
- 'url' : '/cssprop/:name',
- 'method' : 'get',
- 'description' : 'returns docuemnt for css property name',
- 'auth' : false
- },
-
- 'read_all' : {
- 'url' : '/cssprop',
- 'method' : 'get',
- 'description' : 'returns everything',
- 'auth' : false
- },
-
-
- },
-
- read: function(req, res) {
- CSSProp.findOne({ name: req.params.name }, function(error, cssprop) {
- if (!error && cssprop) {
- res.header('Content-Type', 'application/json');
- res.send(JSON.stringify(cssprop), 200);
- } else {
- res.send('could not find css prop with name: ' + req.params.name, 404);
- }
- });
- },
-
- read_all: function(req, res) {
- CSSProp.find({}, function(error, cssprop) {
- if (!error && cssprop) {
- res.header('Content-Type', 'application/json');
- res.send(JSON.stringify(cssprop), 200);
- } else {
- res.send('error', 404);
- }
- });
- },
-
- };
-});
View
@@ -1,49 +0,0 @@
-define([
- 'underscore',
- '../models/jqentry'
-], function(_, JQEntry) {
-
- return {
-
- mapping: {
-
- 'read' : {
- 'url' : '/jqentry/:name',
- 'method' : 'get',
- 'description' : 'returns docuemnt for css property name',
- 'auth' : false
- },
-
- 'read_all' : {
- 'url' : '/jqentry',
- 'method' : 'get',
- 'description' : 'returns everything',
- 'auth' : false
- },
-
- },
-
- read: function(req, res) {
- JQEntry.findOne({ name: req.params.name }, function(error, cssprop) {
- if (!error && cssprop) {
- res.header('Content-Type', 'application/json');
- res.send(JSON.stringify(cssprop), 200);
- } else {
- res.send('could not find css prop with name: ' + req.params.name, 404);
- }
- });
- },
-
- read_all: function(req, res) {
- JQEntry.find({}, function(error, cssprop) {
- if (!error && cssprop) {
- res.header('Content-Type', 'application/json');
- res.send(JSON.stringify(cssprop), 200);
- } else {
- res.send('error', 404);
- }
- });
- },
-
- };
-});
View
@@ -1,76 +0,0 @@
-define([
- './mozdevcssprop',
- './mdnhtmlelement',
- './mdnjsobj',
- './mdndomobj',
- './phpext',
- './jqentry',
-], function(CSSPropActions, HTMLElementActions, MDNJsObjActions, MDNDomObjActions, PhpExtActions, JQEntryActions) {
-
- var mappingString = "";
-
- function add_to_mapping_string(method, url, description, auth) {
- mappingString += "<div style='width: 400px; height: 20px; padding: 5px; background-color: #ccc; color: #000; font-family: Arial, Verdana, sans-serif'><b>" + method + " " + url + "</b></div><div style='width: 400px; padding: 5px; background-color: #eee; color: #000; font-family: Arial, Verdana, sans-serif'>" + description + "<br /><b>Auth:</b> " + auth + "</div><br />";
- }
-
- function bootController(app, actions) {
- var mapping = actions["mapping"];
-
- Object.keys(actions).map(function(action) {
- var fn = actions[action];
-
- if (typeof(fn) === "function") {
- var a = mapping[action];
- if (a) {
- add_to_mapping_string(a.method, a.url, a.description, a.auth);
- switch(a.method) {
- case 'get':
- app.get(a.url, fn);
- console.log("initialized get " + a.url);
- break;
- case 'post':
- app.post(a.url, fn);
- console.log("initialized post " + a.url);
- break;
- case 'put':
- app.put(a.url, fn);
- console.log("initialized put " + a.url);
- break;
- case 'delete':
- app.del(a.url, fn);
- console.log("initialized delete " + a.url);
- break;
- }
- } else {
- console.log("WARNING: no mapping for " + action + " defined");
- }
- }
- });
- }
-
- return {
- bootControllers : function(app) {
- console.log("booting cssprop controller");
- bootController(app, CSSPropActions);
-
- console.log("booting mdnhtmlelement controller");
- bootController(app, HTMLElementActions);
-
- console.log("booting mdnjsobj controller");
- bootController(app, MDNJsObjActions);
-
- console.log("booting mdndomobj controller");
- bootController(app, MDNDomObjActions);
-
- console.log("booting phpext controller");
- bootController(app, PhpExtActions);
-
- console.log("booting jqentry controller");
- bootController(app, JQEntryActions);
-
- app.get("/show_available_interfaces", function(req, res){
- res.send(mappingString);
- });
- }
- }
-});
View
@@ -1,49 +0,0 @@
-define([
- 'underscore',
- '../models/mdndomobj'
-], function(_, MDNDomObj) {
-
- return {
-
- mapping: {
-
- 'read' : {
- 'url' : '/mdndomobj/:name',
- 'method' : 'get',
- 'description' : 'returns docuemnt for css property name',
- 'auth' : false
- },
-
- 'read_all' : {
- 'url' : '/mdndomobj',
- 'method' : 'get',
- 'description' : 'returns everything',
- 'auth' : false
- },
-
- },
-
- read: function(req, res) {
- MDNDomObj.findOne({ name: req.params.name }, function(error, cssprop) {
- if (!error && cssprop) {
- res.header('Content-Type', 'application/json');
- res.send(JSON.stringify(cssprop), 200);
- } else {
- res.send('could not find css prop with name: ' + req.params.name, 404);
- }
- });
- },
-
- read_all: function(req, res) {
- MDNDomObj.find({}, function(error, cssprop) {
- if (!error && cssprop) {
- res.header('Content-Type', 'application/json');
- res.send(JSON.stringify(cssprop), 200);
- } else {
- res.send('error', 404);
- }
- });
- },
-
- };
-});
@@ -1,49 +0,0 @@
-define([
- 'underscore',
- '../models/mdnhtmlelement'
-], function(_, MDNHtmlElement) {
-
- return {
-
- mapping: {
-
- 'read' : {
- 'url' : '/mdnhtmlelement/:name',
- 'method' : 'get',
- 'description' : 'returns docuemnt for css property name',
- 'auth' : false
- },
-
- 'read_all' : {
- 'url' : '/mdnhtmlelement',
- 'method' : 'get',
- 'description' : 'returns everything',
- 'auth' : false
- },
-
- },
-
- read: function(req, res) {
- MDNHtmlElement.findOne({ name: req.params.name }, function(error, cssprop) {
- if (!error && cssprop) {
- res.header('Content-Type', 'application/json');
- res.send(JSON.stringify(cssprop), 200);
- } else {
- res.send('could not find css prop with name: ' + req.params.name, 404);
- }
- });
- },
-
- read_all: function(req, res) {
- MDNHtmlElement.find({}, function(error, cssprop) {
- if (!error && cssprop) {
- res.header('Content-Type', 'application/json');
- res.send(JSON.stringify(cssprop), 200);
- } else {
- res.send('error', 404);
- }
- });
- },
-
- };
-});
View
@@ -1,49 +0,0 @@
-define([
- 'underscore',
- '../models/mdnjsobj'
-], function(_, MDNJsObj) {
-
- return {
-
- mapping: {
-
- 'read' : {
- 'url' : '/mdnjsobj/:name',
- 'method' : 'get',
- 'description' : 'returns docuemnt for css property name',
- 'auth' : false
- },
-
- 'read_all' : {
- 'url' : '/mdnjsobj',
- 'method' : 'get',
- 'description' : 'returns everything',
- 'auth' : false
- },
-
- },
-
- read: function(req, res) {
- MDNJsObj.findOne({ name: req.params.name }, function(error, cssprop) {
- if (!error && cssprop) {
- res.header('Content-Type', 'application/json');
- res.send(JSON.stringify(cssprop), 200);
- } else {
- res.send('could not find css prop with name: ' + req.params.name, 404);
- }
- });
- },
-
- read_all: function(req, res) {
- MDNJsObj.find({}, function(error, cssprop) {
- if (!error && cssprop) {
- res.header('Content-Type', 'application/json');
- res.send(JSON.stringify(cssprop), 200);
- } else {
- res.send('error', 404);
- }
- });
- },
-
- };
-});
@@ -1,49 +0,0 @@
-define([
- 'underscore',
- '../models/mozdevcssprop'
-], function(_, MozDevCSSProp) {
-
- return {
-
- mapping: {
-
- 'read' : {
- 'url' : '/mozdevcssprop/:name',
- 'method' : 'get',
- 'description' : 'returns docuemnt for css property name',
- 'auth' : false
- },
-
- 'read_all' : {
- 'url' : '/mozdevcssprop',
- 'method' : 'get',
- 'description' : 'returns everything',
- 'auth' : false
- },
-
- },
-
- read: function(req, res) {
- MozDevCSSProp.findOne({ name: req.params.name }, function(error, cssprop) {
- if (!error && cssprop) {
- res.header('Content-Type', 'application/json');
- res.send(JSON.stringify(cssprop), 200);
- } else {
- res.send('could not find css prop with name: ' + req.params.name, 404);
- }
- });
- },
-
- read_all: function(req, res) {
- MozDevCSSProp.find({}, function(error, cssprop) {
- if (!error && cssprop) {
- res.header('Content-Type', 'application/json');
- res.send(JSON.stringify(cssprop), 200);
- } else {
- res.send('error', 404);
- }
- });
- },
-
- };
-});
Oops, something went wrong.

0 comments on commit 6d8c302

Please sign in to comment.