This commit is contained in:
raluca-elena 2014-08-07 20:18:10 +00:00
Родитель 2f8c7ef964
Коммит 5fd205ace4
2 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -12,7 +12,7 @@
<script src="./superagent.js"></script> <script src="./superagent.js"></script>
<script src="rot.js"> <script src="rot.js">
</script> </script>
<script src="anotherApp.js"> <script src="app.js">
</script> </script>
<div style="display: inline-flex;"> <div style="display: inline-flex;">
<div> <div>

Просмотреть файл

@ -184,15 +184,18 @@ function getFeatures(cb) {
function setTag(uuid, feature, tag, cb) { function setTag(uuid, feature, tag, cb) {
console.log("in setTag(uuid:", uuid, ", feature:", feature, ", tag:", tag, ")"); console.log("in setTag(uuid:", uuid, ", feature:", feature, ", tag:", tag, ")");
console.log("allFeatures[uuid][feature] is-------------------------- ", allFeatures[uuid][feature]); console.log("allFeatures[uuid]", allFeatures[uuid]);
console.log("allFeatures[uuid]*******************", JSON.parse(allFeatures[uuid])[feature]);
//console.log("allFeatures[uuid][feature] is-------------------------- ", allFeatures[uuid][feature]);
if (allFeatures[uuid] === undefined) { if (allFeatures[uuid] === undefined) {
cb("No such uuid: " + uuid + " :( in allFeatures:" + allFeatures); cb("No such uuid: " + uuid + " :( in allFeatures:" + allFeatures);
} else if (allFeatures[uuid][feature] === undefined) { } else if (JSON.parse(allFeatures[uuid])[feature] === undefined) {
cb("No such feature: " + feature + " for uuid: " + uuid + " :("); cb("No such feature: " + feature + " for uuid: " + uuid + " :(");
} else if (tag in allTags) { } else if (tag in allTags) {
cb("Tag alread used: " + tag + " :("); cb("Tag alread used: " + tag + " :(");
} else { } else {
var url = allThings[uuid].localURL + "/tags/" + tag; var url = allThings[uuid].localURL + "/tags/" + tag;
console.log("in SET TAG PUT(url)***************************", url);
superagent.put(url) superagent.put(url)
.send(feature) .send(feature)
.end(function(res){ .end(function(res){