rasvaan / accurator

Accurator cpack
7 stars 3 forks source link

Add context to tag #210

Closed rasvaan closed 5 years ago

rasvaan commented 8 years ago

Add the code indicating the context of a tag again:

        var context = "";
        var index = parseInt(localStorage.getItem("itemIndex"));
        var clusterId = parseInt(localStorage.getItem("clusterId"));
        var query = localStorage.getItem("query");

        if(query === "random") {
            context = "random, " + index;
        } else if(query === "expertise") {
            context = "expertise, " + index;
        } else if(query === "expertise values") {
            context = "recommendation, " + index + ", " + clusterId;
        } else if (query !== "") {
            context = "search, " + query + ", " + index + ", " + clusterId;
        } else {
            context = "unknown";
        }

        Y.io(this.get("store.add"), {
            method: "POST",
            data:{
            reached_object_with: context,