Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
#34 - 'Merge' the remaining files
Browse files Browse the repository at this point in the history
  • Loading branch information
hyland82 committed Aug 31, 2009
1 parent 22ac34e commit 9288a6b
Show file tree
Hide file tree
Showing 11 changed files with 656 additions and 755 deletions.
20 changes: 9 additions & 11 deletions oaiorebuilder/content/compoundobjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ lore.ore.closeView = function(tabpanel, panel) {
* Create or show the RDF View
*/
lore.ore.openRDFView = function() {
/*lore.ui.loreviews.activate("compoundobjecteditor");

if (!lore.ui.rdftab) {
lore.ui.compoundobjecttab.add({
lore.ui.loreviews.add({
title : 'RDF/XML',
id : "remrdfview",
autoScroll : true,
Expand All @@ -60,8 +60,8 @@ lore.ore.openRDFView = function() {
lore.ui.rdftab.on("close", lore.ore.closeView);
lore.ore.updateRDFHTML();
} else {
lore.ui.compoundobjecttab.activate('remrdfview');
}*/
lore.ui.loreviews.activate('remrdfview');
}
lore.debug.ore("open rdf view");
lore.ore.openView("remrdfview","RDF/XML",lore.ore.updateRDFHTML);
}
Expand All @@ -70,10 +70,9 @@ lore.ore.openSMILView = function() {
lore.ore.openView("remsmilview", "SMIL", lore.ore.showSMIL);
}
lore.ore.openView = function (panelid,paneltitle,activationhandler){
lore.ui.loreviews.activate("compoundobjecteditor");
var tab = Ext.getCmp(panelid);
if (!tab) {
lore.ui.compoundobjecttab.add({
lore.ui.loreviews.add({
title : paneltitle,
id : panelid,
autoScroll : true,
Expand All @@ -84,7 +83,7 @@ lore.ore.openView = function (panelid,paneltitle,activationhandler){
activationhandler();
}
else {
lore.ui.compoundobjectab.activate(panelid);
lore.ui.loreviews.activate(panelid);
}
}
/**
Expand Down Expand Up @@ -410,8 +409,8 @@ lore.ore.readRDF = function(rdfURL) {
// reset the graphical view
lore.ui.initGraphicalView();

lore.ui.loreviews.activate("compoundobjecteditor");
lore.ui.compoundobjecttab.activate("drawingarea");

lore.ui.loreviews.activate("drawingarea");
var theRDF = new RDF();
theRDF.getRDFURL(rdfURL, function() {
var remurl = theRDF.Match(null, null,
Expand Down Expand Up @@ -850,8 +849,7 @@ lore.ore.graph.addFigureXY = function(theURL, x, y) {
fig.setContent(theURL);
lore.ore.graph.Graph.addFigure(fig, x, y);
lore.ore.graph.lookup[theURL] = fig.getId();
lore.ui.loreviews.activate("compoundobjecteditor");
lore.ui.compoundobjecttab.activate("drawingarea");
lore.ui.loreviews.activate("drawingarea");
} else {
lore.ui.loreWarning("Resource is already in resource map: " + theURL);
}
Expand Down
55 changes: 51 additions & 4 deletions oaiorebuilder/content/firefoxOverlay.xul
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://lore/skin/overlay.css" type="text/css"?>


<!DOCTYPE overlay SYSTEM "chrome://lore/locale/lore.dtd">
<xul:overlay id="lore-overlay" xmlns="http://www.w3.org/1999/xhtml"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
Expand All @@ -8,21 +10,63 @@
<xul:stringbundleset id="stringbundleset">
<xul:stringbundle id="lore-strings" src="chrome://lore/locale/lore.properties"/>
</xul:stringbundleset>

<xul:vbox id="appcontent">
<xul:splitter id="oobContentSplitter" collapsed="true"/>
<xul:vbox flex="2" align="stretch" id="oobContentBox" collapsed="true" persist="height">

<xul:tabbrowser id="content" flex="3" orient="horizontal" >

<xul:splitter id="oobAnnoVarContentSplitter" class="chromeclass-extrachrome" orient="horizontal" collapsed = "true" />

<xul:vbox id="oobAnnoVarContentBox" flex="2" height="100%" collapsed="true" >
<xul:label id = "oobAnnoVarContentLabel" value="Annotation Variation Resource: http://www.google.com" />
<xul:button id = "oobAnnoVarContentHideMe" label="Hide Me" onclick = "loreoverlay.hideVariationSplitter();" />
<xul:iframe id = "oobAnnoVarContent" flex="1" src="about:blank" type="content" />
</xul:vbox>

<xul:splitter id="oobAnnoContentSplitter" class="chromeclass-extrachrome" collapsed = "true" />

<xul:vbox flex="2" id = "oobAnnoContentBox" collapsed="true" persist = "width">

<xul:toolbox>

<xul:toolbar id="anno-toolbar">
<xul:label value="LORE Annotations" style="margin-top:5px;margin-right:10px;margin-left:5px;font-weight:bolder" />
<xul:toolbarbutton id="oobMenuButton" tooltiptext="&lore.showAboutTip;" oncommand="loreoverlay.openAbout()" />
<xul:toolbarbutton id="show-prefs" tooltiptext="&lore.showPrefsTip;" oncommand="loreoverlay.openOptions();"/>
<xul:toolbarseparator id="annsep" />
<xul:toolbarbutton id="add-annotation" tooltiptext="&lore.addAnnotationTip;" oncommand="loreoverlay.addAnnotation();"/>
<xul:toolbarbutton id="remove-annotation" tooltiptext="&lore.removeAnnotationTip;" oncommand="loreoverlay.removeAnnotation();" />
<xul:toolbarbutton id="edit-annotation" tooltiptext="&lore.editAnnotationTip;" oncommand="loreoverlay.editAnnotation();" />
<xul:toolbarbutton id="reply-annotation" tooltiptext="&lore.replyAnnotationTip;" oncommand="loreoverlay.replyToAnnotation();" />

<xul:toolbarbutton id="save-annotation" tooltiptext="&lore.saveAnnotationTip;" oncommand="loreoverlay.saveAnnotation();" />
<xul:toolbarseparator id ="annsep2" />
<xul:toolbarbutton id="save-all-annotations" tooltiptext="&lore.saveAllAnnotationsTip;" oncommand="loreoverlay.saveAllAnnotations();" />
<xul:toolbarbutton id="show-annotations" tooltiptext="&lore.showAnnotationsTip;" oncommand="loreoverlay.showAnnotations();"/>
<xul:toolbarseparator id ="annsep3" />
<xul:toolbarbutton id="reset-graph" tooltiptext="&lore.resetGraphTip;" oncommand="window.annographiframe.location.reload(true);"/><!-- label="&lore.resetGraphLabel;"-->
</xul:toolbar>
</xul:toolbox>
<xul:iframe tooltip="aHTMLTooltip" flex="3" height="100%" width="300px" src="chrome://lore/content/loreui_anno.html" name="annographiframe" id="annographiframe"/>
</xul:vbox>

</xul:tabbrowser>

<xul:splitter id="oobContentSplitter" collapsed="true" orient="vertical" />
<xul:vbox flex="2" align="stretch" id="oobContentBox" collapsed="true" persist="height" width="100%">
<xul:toolbox>
<xul:toolbar id="graph-toolbar">
<xul:label value="LORE Compound Objects" style="margin-top:5px;margin-right:10px;margin-left:5px;font-weight:bolder" />
<xul:toolbarbutton id="oobMenuButton" tooltiptext="&lore.showAboutTip;" oncommand="loreoverlay.openAbout()">
<!--xul:menupopup>
<xul:menuitem id="oobMenuAbout" label="About" oncommand="loreoverlay.openAbout()"/>
<xul:menuitem id="oobMenuOptions" label="Options" oncommand="loreoverlay.openOptions()"/>
</xul:menupopup-->
</xul:toolbarbutton>
<xul:toolbarbutton id="show-prefs" tooltiptext="&lore.showPrefsTip;" oncommand="loreoverlay.openOptions();"/>
<xul:toolbarseparator id="annsep" />
<!-- <xul:toolbarseparator id="annsep" />
<xul:toolbarbutton id="add-annotation" tooltiptext="&lore.addAnnotationTip;" oncommand="loreoverlay.addAnnotation();"/>
<xul:toolbarbutton id="show-annotations" tooltiptext="&lore.showAnnotationsTip;" oncommand="loreoverlay.showAnnotations();"/>
<xul:toolbarbutton id="show-annotations" tooltiptext="&lore.showAnnotationsTip;" oncommand="loreoverlay.showAnnotations();"/> -->
<xul:toolbarseparator id="cosep"/>
<xul:toolbarbutton id="add-node" tooltiptext="&lore.addNodeTip;" oncommand="loreoverlay.addGraphNode();"/><!-- label="&lore.addNodeLabel;"-->
<xul:toolbarbutton id="load-rdf" tooltiptext="&lore.loadRDFTip;" oncommand="loreoverlay.loadRDF();"/><!-- label="&lore.loadRDFLabel;"-->
Expand All @@ -38,7 +82,10 @@
<xul:tooltip id="aHTMLTooltip" onpopupshowing="return loreoverlay.fillInHTMLTooltip(document.tooltipNode);" />
<xul:iframe tooltip="aHTMLTooltip" flex="3" height="450px" width="100%" src="chrome://lore/content/loreui.html" name="graphiframe" id="graphiframe"/>
</xul:vbox>


</xul:vbox>

<xul:popup id="contentAreaContextMenu" onpopupshown="loreoverlay.onMenuPopup(event)">
<xul:menuseparator id="oaioresep"/>
<xul:menuitem id="addlink-lore" label="&loreContextLink.label;"
Expand Down
123 changes: 17 additions & 106 deletions oaiorebuilder/content/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ lore.ui.setUpMetadataMenu = function(the_grid, gridname) {
* Initialise the graphical view
*/
lore.ui.initGraphicalView = function() {
lore.ui.compoundobjecttab.activate("drawingarea");
lore.ui.loreviews.activate("drawingarea");

lore.ore.graph.lookup = {};
lore.ore.graph.modified = false;
if (lore.ore.graph.Graph) {
Expand Down Expand Up @@ -170,25 +171,17 @@ lore.ui.initExtComponents = function() {
lore.ui.grid = Ext.getCmp("remgrid");
lore.ui.nodegrid = Ext.getCmp('nodegrid');
lore.ui.lorestatus = Ext.getCmp('lorestatus');
lore.anno.annotabsm = Ext.getCmp("annotationslist").getSelectionModel();
lore.anno.annotabds = Ext.getCmp("annotationslist").getStore();
lore.ui.annotationsform = Ext.getCmp("annotationslistform").getForm();
lore.ui.loreviews = Ext.getCmp("loreviews");
lore.ui.welcometab = Ext.getCmp("welcome");
lore.ui.summarytab = Ext.getCmp("remlistview");

lore.ui.exploretab = Ext.getCmp("remexploreview");
lore.ui.compoundobjecttab = Ext.getCmp("compoundobjecteditor");

lore.ui.textminingtab = Ext.getCmp("textmining");
// set up the sources tree
var sourcestreeroot = Ext.getCmp("sourcestree").getRootNode();
lore.ui.clearTree(sourcestreeroot);
lore.ui.annotationstreeroot = new Ext.tree.TreeNode({
id : "annotationstree",
text : "Annotations",
draggable : false,
iconCls : "tree-anno"
});

lore.ui.remstreeroot = new Ext.tree.TreeNode({
id : "remstree",
text : "Compound Objects",
Expand All @@ -201,30 +194,26 @@ lore.ui.initExtComponents = function() {
draggable : false,
iconCls : "tree-ore"
});
sourcestreeroot.appendChild(lore.ui.annotationstreeroot);

sourcestreeroot.appendChild(lore.ui.remstreeroot);
sourcestreeroot.appendChild(lore.ui.recenttreeroot);

// set up event handlers
lore.ui.compoundobjecttab.on("beforeremove", lore.ore.closeView);
//lore.ui.compoundobjecttab.on("beforeremove", lore.ore.closeView);
// create a context menu for the compound object tab to hide/show RDF/XML
// Tab
lore.ui.compoundobjecttab.contextmenu = new Ext.menu.Menu({
lore.ui.loreviews.contextmenu = new Ext.menu.Menu({
id : "co-context-menu"
});
lore.ui.compoundobjecttab.contextmenu.add({
lore.ui.loreviews.contextmenu.add({
text : "Show RDF/XML",
handler : lore.ore.openRDFView
});
lore.ui.compoundobjecttab.contextmenu.add({
text: "Show SMIL",
handler : lore.ore.openSMILView
});
lore.ui.loreviews.on("contextmenu", function(tabpanel, panel, e) {
if (panel.id == 'compoundobjecteditor') {
lore.ui.compoundobjecttab.contextmenu.showAt(e.xy);
}
});
lore.ui.loreviews.contextmenu.add({
text: "Show SMIL",
handler: lore.ore.openSMILView
});

lore.ui.summarytab.on("activate", lore.ore.showCompoundObjectSummary);
var smiltab = Ext.getCmp("remsmilview");
var rdftab = Ext.getCmp("remrdfview");
Expand All @@ -247,92 +236,14 @@ lore.ui.initExtComponents = function() {
if (lore.ui.exploretab){
lore.ui.exploretab.on("activate", lore.ore.showExploreUI);
}
lore.anno.annotabsm
.on('rowdeselect', lore.anno.handleAnnotationDeselection);
lore.anno.annotabsm.on('rowselect', lore.anno.handleAnnotationSelection);
Ext.getCmp("cancelupdbtn")
.on('click', lore.anno.handleCancelAnnotationEdit);
Ext.getCmp("updannobtn").on('click', lore.anno.handleSaveAnnotationChanges);
Ext.getCmp("delannobtn").on('click',
function (){
Ext.MessageBox.show({
title:'Delete annotation',
msg: 'Are you sure you want to delete this annotation forever?',
buttons: Ext.MessageBox.YESNO,
fn: function(btn) {
if(btn == 'yes') lore.anno.handleDeleteAnnotation();
},
icon: Ext.Msg.QUESTION
});
});
Ext.getCmp("updctxtbtn").on('click',
lore.anno.handleUpdateAnnotationContext);
Ext.getCmp("updrctxtbtn").on('click',
lore.anno.handleUpdateAnnotationVariantContext);
Ext.getCmp("variantfield").on('specialkey', lore.anno.launchFieldWindow);
Ext.getCmp("originalfield").on('specialkey', lore.anno.launchFieldWindow);
Ext.getCmp("typecombo").on('valid', lore.anno.handleAnnotationTypeChange);
lore.anno.setAnnotationFormUI(false);

// set up variation annotations panel
var variationsPanel = Ext.getCmp("variationannotations");
variationsPanel.on("render", lore.anno.onVariationsShow);
variationsPanel.on("show", lore.anno.onVariationsShow);
variationsPanel.on("resize", lore.anno.onVariationsShow);
var variationsListing = Ext.getCmp("variationannotationlisting");
variationsListing.on("rowclick", lore.anno.onVariationListingClick);
lore.anno.onVariationsShow(variationsPanel);
// listen for frame load events (used to do highlighting in revision frames)
window.addEventListener("DOMFrameContentLoaded", lore.anno.handleFrameLoad,
true);


// set up welcome tab contents
lore.ui.welcometab.body.update("<iframe height='100%' width='100%' "
+ "src='chrome://lore/content/welcome.html'></iframe>");
Ext.QuickTips.interceptTitles = true;
Ext.QuickTips.init();
}

/**
* Create a Timeline visualisation
*/
lore.ui.initTimeline = function() {
var tl = Ext.getCmp("annotimeline");
if (typeof Timeline !== "undefined" && !lore.ui.disabled.disable_annotations) {
lore.anno.annoEventSource = new Timeline.DefaultEventSource();
var theme = Timeline.ClassicTheme.create();
theme.event.bubble.width = 350;
var bandConfig = [Timeline.createBandInfo({
eventSource : lore.anno.annoEventSource,
theme: theme,
width : "90%",
intervalUnit : Timeline.DateTime.WEEK,
intervalPixels : 100,
timeZone : 10,
layout: "original"
}), Timeline.createBandInfo({
eventSource : lore.anno.annoEventSource,
theme: theme,
//showEventText: false,
width : "10%",
intervalUnit : Timeline.DateTime.MONTH,
intervalPixels : 430,
timeZone : 10,
layout: "overview"
})];

bandConfig[1].syncWith = 0;
bandConfig[1].highlight = true;
lore.anno.annotimeline = Timeline.create(document
.getElementById("annotimeline"), bandConfig, Timeline.HORIZONTAL);
tl.on("resize", function() {
lore.anno.scheduleTimelineLayout();
});
lore.anno.annotimeline.getBand(0).getEventPainter().setFilterMatcher(function(evt){
return !(evt._eventID == "flagdelete");
});
}
}

/**
* Initialise LORE
Expand All @@ -358,15 +269,15 @@ lore.ui.init = function() {
lore.ui.initExtComponents();
lore.ui.initProperties();
lore.ui.initOntologies();
lore.ui.initTimeline();
lore.ui.initGraphicalView();
lore.ui.loreInfo("Welcome to LORE");

if (lore.ui.currentURL && lore.ui.currentURL != 'about:blank'
&& lore.ui.currentURL != '' && lore.ui.lorevisible) {
lore.ui.updateSourceLists(lore.ui.currentURL);
lore.ore.updateCompoundObjectsSourceList(lore.ui.currentURL);
lore.ui.loadedURL = lore.ui.currentURL;
}
lore.debug.ui("LORE init complete", this);
lore.debug.ui("LORE Compound Object init complete", this);
} catch (e) {
lore.debug.ui("exception in init",e);
}
Expand Down
Loading

0 comments on commit 9288a6b

Please sign in to comment.