Skip to content

Commit

Permalink
some bufixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tkurz committed Apr 17, 2013
1 parent a6d809d commit 14444a6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
9 changes: 5 additions & 4 deletions extension/simple/SimpleExtension.js
Expand Up @@ -22,9 +22,9 @@ function SimpleExtension(editor) {
popup = editor.popup.custom("Simple Extension");

var text = "No graph selected";
if(graph) text = "Selected " + graph.uri;
if(graph) text = "Graph: " + graph;

popup.setContent($("<h1></h1>").text(text));
popup.setContent($("<p></p>").text(text));

popup.open();
}
Expand All @@ -34,12 +34,13 @@ function SimpleExtension(editor) {

editor.menu.createSeperator("Project");
editor.menu.createMenuItem("Project","Extension",function(){
new Popup();
var popup = new Popup();
popup.open();
});

//bindings
editor.event.bind(editor.EventCode.GRAPH.LOAD,function(event){
graph = event.graph.uri;
graph = event.data.uri;
});
}

Expand Down
2 changes: 1 addition & 1 deletion html/settings.html
Expand Up @@ -89,7 +89,7 @@ <h1 id="popup_title" class="alert_title">Settings</h1>
<div class="clear"></div>
</div>
<div style="margin-top:10px;width: 100%;text-align: center;float:left;">
<button class="popup_cancel">Cancel</button>
<button class="popup_cancel">OK</button>
</div>
<div class="clear"></div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion js/sparql-client-old.js
Expand Up @@ -30,7 +30,8 @@ function SparqlClient(endpointSelect, endpointUpdate) {
this.ask = function(query, onsuccess, onfailure) {
HTTP.get(endpointSelect, {query:encodeURIComponent(query)}, null, "application/sparql-results+json", {
200:function(data) {
if (onsuccess)onsuccess(JSON.parse(data).boolean == 'true')
var value = JSON.parse(data).boolean;
if (onsuccess)onsuccess(value ? value : value == 'true');
},
"default":function(err) {
if (onfailure)onfailure(err)
Expand Down
8 changes: 4 additions & 4 deletions js/sparql-client.js
Expand Up @@ -6,7 +6,7 @@
function SparqlClient(endpointSelect, endpointUpdate) {

this.select = function(query, onsuccess, onfailure) {
$.getJSON(endpointSelect+"?query="+encodeURIComponent(query)+"&output=json",onsuccess(data.results.bindings))
$.getJSON(endpointSelect+"?query="+encodeURIComponent(query)+"&output=json")
.done(function(data){
onsuccess(data.results.bindings);
})
Expand All @@ -16,17 +16,17 @@ function SparqlClient(endpointSelect, endpointUpdate) {
}

this.ask = function(query, onsuccess, onfailure) {
$.getJSON(endpointSelect+"?query="+encodeURIComponent(query)+"&output=json",onsuccess(data.results.bindings))
$.getJSON(endpointSelect+"?query="+encodeURIComponent(query)+"&output=json")
.done(function(data){
onsuccess(data.boolean == 'true');
onsuccess(data.boolean ? data.boolean : data.boolean == 'true');
})
.fail(function(){
onfailure();
});
}

this.update = function(query, onsuccess, onfailure) {
$.post(endpointUpdate+"?update="+encodeURIComponent(query)+"&output=json",onsuccess(data.results.bindings))
$.post(endpointUpdate+"?query="+encodeURIComponent(query)+"&output=json")
.done(function(){
onsuccess();
})
Expand Down
3 changes: 2 additions & 1 deletion skos-editor.0.2.0.js
Expand Up @@ -941,6 +941,7 @@ function SKOSEditor(options) {
popups.info("Info", "select a graph first");
}
var text = input_field.val();

if (text.length >= minLenght) {
//return
if (e.keyCode == 13) {
Expand Down Expand Up @@ -2067,7 +2068,7 @@ function SKOSEditor(options) {
var timeout;
$("#"+background).show();
$("#" + container).load("skosjs/html/settings.html", function() {
$("#" + container).load("html/settings.html", function() {
$(".popup_cancel").click(function() {
clearTimeout(timeout);
close();
Expand Down

0 comments on commit 14444a6

Please sign in to comment.