Adds success notification for comments
diff --git a/asterix-examples/src/main/resources/black-cherry/static/js/asterix-sdk-stable.js b/asterix-examples/src/main/resources/black-cherry/static/js/asterix-sdk-stable.js
index 72aafd4..a6b3978 100755
--- a/asterix-examples/src/main/resources/black-cherry/static/js/asterix-sdk-stable.js
+++ b/asterix-examples/src/main/resources/black-cherry/static/js/asterix-sdk-stable.js
@@ -112,7 +112,6 @@
success_fn(data);
},
error: function(xhr, status, error) {
-
}
});
diff --git a/asterix-examples/src/main/resources/black-cherry/static/js/cherry.js b/asterix-examples/src/main/resources/black-cherry/static/js/cherry.js
index eb3aba5..70f2c4e 100755
--- a/asterix-examples/src/main/resources/black-cherry/static/js/cherry.js
+++ b/asterix-examples/src/main/resources/black-cherry/static/js/cherry.js
@@ -648,7 +648,9 @@
APIqueryTracker["active_tweetbook"],
new AExpression("$mt.tweetid = " + deleteTweetCommentOnId.toString())
);
- A.update(toDelete.val());
+ A.update(
+ toDelete.val()
+ );
// Hide comment from map
$('#drilldown_modal').modal('hide');
@@ -694,9 +696,13 @@
);
// Insert query to add metacomment to said tweetbook dataset
- A.update(toInsert.val());
+ A.update(toInsert.val(), function () { alert("Test"); });
- // TODO Some acknowledgement would be good here.
+ // TODO Some stress testing of error conditions might be good here...
+ onPlotTweetbook(APIqueryTracker["active_tweetbook"]);
+ var successMessage = "Saved comment on <b>Tweet #" + tweetId +
+ "</b> in dataset <b>" + save_metacomment_target_tweetbook + "</b>.";
+ addSuccessBlock(successMessage, 'drilltweetobj' + tweetId);
}
});
@@ -888,6 +894,7 @@
return toPlot;
}
+
function onCleanTweetbookDrilldown (rec) {
var drilldown_cleaned = [];
@@ -909,6 +916,7 @@
return drilldown_cleaned;
}
+
function onClickTweetbookMapMarker(tweet_arr) {
$('#drilldown_modal_body').html('');
@@ -923,6 +931,7 @@
/** Toggling Review and Explore Modes **/
+
/**
* Explore mode: Initial map creation and screen alignment
*/
@@ -936,6 +945,7 @@
$('#query-preview-window').height(prev_window_target +'px');
}
+
/**
* Launching explore mode: clear windows/variables, show correct sidebar
*/
@@ -949,6 +959,7 @@
$("#clear-button").trigger("click");
}
+
/**
* Launching review mode: clear windows/variables, show correct sidebar
*/
@@ -964,7 +975,8 @@
/** Icon / Interface Utility Methods **/
-/** Creates a delete icon button using default trash icon
+/**
+* Creates a delete icon button using default trash icon
* @param {String} id, id for this element
* @param {String} attachTo, id string of an element to which I can attach this button.
* @param {Function} onClick, a function to fire when this icon is clicked
@@ -980,6 +992,19 @@
}
+/**
+* Creates a success message and attaches it to a div with provided ID.
+* @param {String} message, a message to post
+* @param {String} appendTarget, a target div to which to append the alert
+*/
+function addSuccessBlock(message, appendTarget) {
+
+ $('<div/>')
+ .attr("class", "alert alert-success")
+ .html('<button type="button" class="close" data-dismiss="alert">×</button>' + message)
+ .appendTo('#' + appendTarget);
+}
+
/** Map Widget Utility Methods **/
/**