This repository has been archived by the owner on May 2, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
196 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
(function($){JOBAD.modules.register({ | ||
info: { | ||
'identifier': 'fex_tooltip', | ||
'title': 'Testing tooltip', | ||
'author': 'Alexandru Toader', | ||
'description': 'Show text of fields that overflow ', | ||
'hasCleanNamespace': false | ||
}, | ||
hoverText: function(target){ | ||
if((target.is("span.title-dependency") || target.is("span.title-text") || target.is("div.cell-iterator") || target.is("div.cell-value")) | ||
&& target[0].scrollWidth> target.width()){ | ||
return target.text(); | ||
} | ||
}, | ||
}); | ||
})(JOBAD.refs.$); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
(function($){ | ||
JOBAD.modules.register({ | ||
info: { | ||
'identifier': 'navigate', | ||
'title': 'Show dependency graph', | ||
'author': 'Alexandru Toader', | ||
'description': 'Show the dependency graph of the selected item', | ||
'hasCleanNamespace': false | ||
}, | ||
/** | ||
@base_path base path for the planetary installation | ||
@token string used to identify the workflow | ||
@context Context message containing all the available cd/name pairs in the current document | ||
*/ | ||
init: function (JOBADInstance, base_path, token, context) { | ||
this.localStore.set("base_path", base_path); | ||
this.localStore.set("token", token); | ||
this.localStore.set("context", context); | ||
}, | ||
contextMenuEntries: function (target) { | ||
var message = this.localStore.get("context"); | ||
var base_path = this.localStore.get("base_path"); | ||
var token = this.localStore.get("token"); | ||
var i = 0; | ||
while (true) { | ||
if (typeof message.context[i] == 'undefined') | ||
break; | ||
if (target.is('span') && target.is('.omdoc-term') && target.attr('omdoc:cd') == message.context[i].theory && target.attr('omdoc:name') == message.context[i].symbol) | ||
return [ | ||
["Show cell in spreadsheet", | ||
function () { | ||
if (Communication.isActive()) { | ||
var token = this.localStore.get("token"); | ||
var term = new sally.OntologyItem; | ||
term.theory = target.attr("omdoc:cd"); | ||
term.symbol = target.attr("omdoc:name"); | ||
var message = new sally.TheoNavigateTo; | ||
message.term = term; | ||
message.actionId = token; | ||
Communication.sendMessage(message); | ||
} | ||
} | ||
]]; | ||
i++; | ||
} | ||
|
||
}, | ||
}); | ||
})(JOBAD.refs.$); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
(function($){ | ||
JOBAD.modules.register({ | ||
info: { | ||
'identifier': 'opendef', | ||
'title': 'Open definition', | ||
'author': 'Alexandru Toader', | ||
'description': 'Open the definition of the selected ontology item', | ||
'hasCleanNamespace': false | ||
}, | ||
/** | ||
@base_path base path for the planetary installation | ||
@token string used to identify the workflow | ||
*/ | ||
init: function(JOBADInstance, base_path, token){ | ||
this.localStore.set("base_path", base_path); | ||
this.localStore.set("token", token); | ||
}, | ||
contextMenuEntries: function (target) { | ||
var cd, symbol; | ||
var token = this.localStore.get("token"); | ||
var base_path = this.localStore.get("base_path"); | ||
if (target.is('span')) { | ||
cd = target.attr("omdoc:cd"); | ||
symbol = target.attr("omdoc:name"); | ||
} else if (target.is('div')) { | ||
var aux = target.attr('id'); | ||
aux = aux.substring(aux.lastIndexOf("/") + 1); | ||
cd = aux.substring(0, aux.indexOf(".omdoc")); | ||
symbol = aux.substring(aux.indexOf("#") + 1, aux.lastIndexOf(".def")); | ||
} | ||
if ((target.is('.omdoc-term') || target.attr('class') == 'node') && typeof(token) != 'undefined') | ||
return { | ||
"Look-up definition": function(element) { | ||
window.open(base_path + "index.php?q=sally/showdef/" + cd + "/" + symbol + "/" + token, "_parent"); | ||
} | ||
} | ||
|
||
}, | ||
}); | ||
})(JOBAD.refs.$); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
(function($){JOBAD.modules.register({ | ||
info: { | ||
'identifier': 'searchGoogle', | ||
'title': 'Search Google', | ||
'author': 'Alexandru Toader', | ||
'description': 'Search Google for selected text or for the title of a node. ', | ||
'hasCleanNamespace': false | ||
}, | ||
getSelectedText: function () { | ||
var selectedText = (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text | ||
); | ||
if (!selectedText || selectedText == "") { | ||
|
||
if (document.activeElement && document.activeElement.selectionStart) { | ||
selectedText = document.activeElement.value.substring(document.activeElement.selectionStart.document.activeElement.selectionEnd); | ||
} | ||
} | ||
|
||
return selectedText; | ||
}, | ||
|
||
contextMenuEntries: function (target) { | ||
var txt = this.getSelectedText().toString(); | ||
var text = "Search Google for "; | ||
if (txt && txt.replace(/\s+/g, ' ') != '') { | ||
text += '"' + txt.substring(0, 5) + ".." + '""'; | ||
return [ | ||
[text, function (element) { | ||
window.open("http://www.google.com/search?q=" + txt, "_parent"); | ||
}] | ||
]; | ||
} else if (target.attr('class') == 'node' && target.is('div')) { | ||
console.log("here"); | ||
txt = target.text(); | ||
text += '"' + txt.substring(0, 5) + ".." + '""'; | ||
return [ | ||
[text, function (element) { | ||
window.open("http://www.google.com/search?q=" + txt, "_parent"); | ||
}] | ||
]; | ||
} | ||
|
||
}, | ||
}); | ||
})(JOBAD.refs.$); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
(function($){JOBAD.modules.register({ | ||
info: { | ||
'identifier': 'showGraph', | ||
'title': 'Show dependency graph', | ||
'author': 'Alexandru Toader', | ||
'description': 'Show the dependency graph of the selected item', | ||
'hasCleanNamespace': false | ||
}, | ||
/** | ||
@base_path base path for the planetary installation | ||
@token string used to identify the workflow | ||
*/ | ||
init: function(JOBADInstance, base_path, token){ | ||
this.localStore.set("base_path", base_path); | ||
this.localStore.set("token", token); | ||
}, | ||
contextMenuEntries: function (target) { | ||
var cd, symbol; | ||
var token = this.localStore.get("token"); | ||
var base_path = this.localStore.get("base_path"); | ||
if (target.is('span')) { | ||
cd = target.attr("omdoc:cd"); | ||
symbol = target.attr("omdoc:name"); | ||
if (target.is('.omdoc-term') && typeof(token) != 'undefined') | ||
return [ | ||
["Show dependency graph", function (element) { | ||
window.open(base_path+"index.php?q=sally/semnav/" + cd + "/" + symbol + "/" + token, "_parent"); | ||
}] | ||
]; | ||
} | ||
|
||
}, | ||
}); | ||
})(JOBAD.refs.$); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
annotation-xml { | ||
display:none; | ||
} | ||
|
||
span.omdoc-term { | ||
color: blue; | ||
} | ||
|
||
mo { | ||
display: none; | ||
} |