From 9288a6b8277ca217218dd38bfa60a61bf386dc00 Mon Sep 17 00:00:00 2001 From: Andrew Hyland Date: Mon, 31 Aug 2009 07:54:57 +0000 Subject: [PATCH] #34 - 'Merge' the remaining files --- oaiorebuilder/content/compoundobjects.js | 20 +- oaiorebuilder/content/firefoxOverlay.xul | 55 ++- oaiorebuilder/content/init.js | 123 +---- oaiorebuilder/content/loregui.js | 399 ++-------------- oaiorebuilder/content/loreui.css | 122 ++++- oaiorebuilder/content/loreui.html | 4 - oaiorebuilder/content/options.xul | 1 - oaiorebuilder/content/overlay.js | 565 ++++++++++++++--------- oaiorebuilder/content/uifunctions.js | 51 +- oaiorebuilder/content/util.js | 71 ++- oaiorebuilder/skin/icons/chart_line.png | Bin 0 -> 526 bytes 11 files changed, 656 insertions(+), 755 deletions(-) create mode 100644 oaiorebuilder/skin/icons/chart_line.png diff --git a/oaiorebuilder/content/compoundobjects.js b/oaiorebuilder/content/compoundobjects.js index 21ddb477..d0dddc50 100644 --- a/oaiorebuilder/content/compoundobjects.js +++ b/oaiorebuilder/content/compoundobjects.js @@ -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, @@ -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); } @@ -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, @@ -84,7 +83,7 @@ lore.ore.openView = function (panelid,paneltitle,activationhandler){ activationhandler(); } else { - lore.ui.compoundobjectab.activate(panelid); + lore.ui.loreviews.activate(panelid); } } /** @@ -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, @@ -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); } diff --git a/oaiorebuilder/content/firefoxOverlay.xul b/oaiorebuilder/content/firefoxOverlay.xul index c926ebf1..fe9d47b7 100644 --- a/oaiorebuilder/content/firefoxOverlay.xul +++ b/oaiorebuilder/content/firefoxOverlay.xul @@ -1,5 +1,7 @@ + + @@ -8,11 +10,53 @@ + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -38,7 +82,10 @@ + + + "); @@ -293,46 +244,6 @@ lore.ui.initExtComponents = function() { 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 @@ -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); } diff --git a/oaiorebuilder/content/loregui.js b/oaiorebuilder/content/loregui.js index 2a63ac3a..afa3c3e6 100644 --- a/oaiorebuilder/content/loregui.js +++ b/oaiorebuilder/content/loregui.js @@ -21,7 +21,7 @@ lore.ui.vismode = new Ext.ux.plugin.VisibilityMode({hideMode: 'nosize', bubble: false}); lore.ui.gui_spec = { layout: "border", - items: [{ + items: [{region:"north", layout: "fit"},{ region: "center", layout: "fit", border: false, @@ -37,341 +37,8 @@ lore.ui.gui_spec = { id: "loreviews", plugins : lore.ui.vismode, deferredRender: false, - items: [{ - xtype: "tabpanel", - title: "Annotations", - id: "annotationstab", - deferredRender: false, - activeTab: "annotimeline", - items: [{ - title: "Annotation Timeline", - xtype: "panel", - id: "annotimeline" - },{ - xtype: "form", - id: "annotationslistform", - title: "Annotation Editor", - layout: 'border', - items: [{ - region: "north", - split: true, - id: "annotationslist", - xtype: "grid", - height:90, - autoWidth: true, - autoScroll: true, - stripeRows: true, - view: new Ext.grid.GridView({ - forceFit: true, - - getRowClass: function(rec){ - if (!rec.data.id) { - return "newanno"; - } - } - }), - ds: new Ext.data.JsonStore({ - fields: [ - {name: 'created'}, - {name: 'creator'}, - {name: 'title'}, - {name: 'body'}, - {name: 'modified'}, - {name: 'type'}, - {name: 'lang'}, - {name: 'resource'}, - {name: 'id'}, - {name: 'context'}, - {name: 'isReply'}, - {name: 'bodyURL'}, - {name: 'about'}, - {name: 'original'}, - {name: 'variant'}, - {name: 'originalcontext'}, - {name: 'variantcontext'}, - {name: 'variationagent'}, - {name: 'variationplace'}, - {name: 'variationdate'}, - {name: 'tags'} - ], - data: {} - }), - cm: new Ext.grid.ColumnModel([{ - header: 'Date created', - sortable: true, - //xtype: 'datecolumn', - //format: '"D, d M Y H:i:s \\G\\M\\T O"', - dataIndex: 'created' - }, { - header: 'Creator', - sortable: true, - dataIndex: 'creator' - - }, { - header: 'Title', - sortable: true, - dataIndex: 'title' - }, { - header: 'Body (preview)', - dataIndex: 'body', - hidden: false - }, { - header: 'Date Modified', - dataIndex: 'modified', - hidden: true - }, { - header: 'Type', - dataIndex: 'type', - hidden: true - }, { - header: 'Lang', - dataIndex: 'lang', - hidden: true, - width: 40 - - }]), - sm: new Ext.grid.RowSelectionModel({ - singleSelect: true - }) - }, { - region: "center", - xtype: 'fieldset', - layout: 'form', - autoScroll: true, - id: 'annotationsform', - labelWidth: 100, - title: 'Edit Annotation:', - defaultType: 'textfield', - labelAlign: 'right', - buttonAlign: 'right', - style: 'border:none; margin-left:10px;margin-top:10px;', - defaults: { - hideMode: 'display', - anchor: '-30' - }, - items: [{ - xtype: "combo", - id: "typecombo", - fieldLabel: 'Type', - name: 'type', - hiddenName: 'type', - store: new Ext.data.SimpleStore({ - fields: ['typename', 'qtype'], - data: [['Comment', "http://www.w3.org/2000/10/annotationType#Comment"], ['Explanation', "http://www.w3.org/2000/10/annotationType#Explanation"], ['Variation', "http://austlit.edu.au/ontologies/2009/03/lit-annotation-ns#VariationAnnotation"]] - }), - valueField: 'qtype', - displayField: 'typename', - typeAhead: true, - triggerAction: 'all', - forceSelection: true, - mode: 'local', - selectOnFocus: true - }, { - fieldLabel: 'Title', - name: 'title' - }, { - fieldLabel: 'Creator', - name: 'creator' - }, { - fieldLabel: 'Variation Agent', - name: 'variationagent', - hideParent:true - }, { - fieldLabel: 'Variation Place', - name: 'variationplace', - hideParent:true - }, { - fieldLabel: 'Variation Date', - name: 'variationdate', - hideParent:true - }, { - fieldLabel: 'ID', - name: 'id', - hidden: true, - hideLabel: true, - style: {padding:0,margin:0,display:'none'} - }, { - fieldLabel: 'Annotates', - name: 'resource', - readOnly: true, - hideParent: true, - style: {background:'none',border:'none','font-size':'90%'}, - labelStyle: 'font-size:90%;' - - }, { - fieldLabel: 'Context', - name: 'context', - readOnly: true, - hidden: true, - hideLabel: true, - style: {background:'none',border:'none',padding:0,margin:0} - }, { - fieldLabel: 'Original resource', - name: 'original', - id: 'originalfield', - readOnly: true, - style: {background:'none',border:'none','font-size':'90%'}, - labelStyle: 'font-size:90%' - }, { - fieldLabel: 'Original Context Xpointer', - name: 'originalcontext', - readOnly: true, - style: {background:'none',border:'none',padding:0,margin:0}, - hidden: true, - hideLabel: true - }, { - fieldLabel: 'Selection', - name: 'contextdisp', - readOnly: true, - style: {background:'none',border:'none','font-size':'90%'}, - labelStyle: 'font-size:90%;' - }, { - fieldLabel: 'Variant resource', - name: 'variant', - id: 'variantfield', - readOnly: true, - style: {background:'none',border:'none','font-size':'90%'}, - labelStyle: 'font-size:90%' - }, { - fieldLabel: 'Variant Context Xpointer', - name: 'variantcontext', - readOnly: true, - style: {background:'none',border:'none',padding:0,margin:0}, - hidden: true, - hideLabel: true - }, { - fieldLabel: 'Variant selection', - name: 'rcontextdisp', - readOnly: true, - style: {background:'none',border:'none','font-size':'90%'}, - labelStyle: 'font-size:90%' - }, { - id:'tagselector', - xtype:'superboxselect', - allowBlank: true, - msgTarget: 'under', - allowAddNewData: true, - fieldLabel: 'Tags', - emptyText: 'Type or select tags', - resizable: true, - name: 'tags', - store: new Ext.data.SimpleStore({ - fields: ['id', 'name'], - data: lore.anno.thesaurus - }), - mode: 'local', - displayField: 'name', - valueField: 'id', - extraItemCls: 'x-tag', - listeners: { - newitem: function(bs,v){ - v = v.slice(0,1).toUpperCase() + v.slice(1).toLowerCase(); - var newObj = { - id: v, - name: v - }; - bs.addItem(newObj); - } - } - },{ - fieldLabel: 'Body', - xtype: 'htmleditor', - plugins: [ - new Ext.ux.form.HtmlEditor.Img() - ], - name: 'body', - enableFont: false, - enableColors: false, - enableSourceEdit: false, - anchor: '-30 100%' - } - - ], - buttons: [{ - text: 'Update variant selection', - id: 'updrctxtbtn', - hidden: true, - tooltip: 'For Variation Annotations: set the context in the variant resource to be the current selection from the main browser window' - }, { - text: 'Update selection', - id: 'updctxtbtn', - tooltip: 'Set the context of the annotation to be the current selection from the main browser window' - }, { - text: 'Delete Annotation', - id: 'delannobtn', - tooltip: 'Delete the annotation - CANNOT BE UNDONE' - },{ - text: 'Save Annotation', - id: 'updannobtn', - tooltip: 'Save the annotation to the repository' - }, { - text: 'Cancel', - id: 'cancelupdbtn', - tooltip: 'Cancel - changes will be discarded' - }] - }] - }, { - xtype: "panel", - title: "Variations", - id: "variationannotations", - // html: '
', - deferredRender: false, - layout: 'column', - items: [ - { - xtype: "panel", - id: "variationsleftcolumn", - columnWidth: 0.20, - layout: 'border', - items: [{ - xtype: "grid", - id: "variationannotationlisting", - title: "Variation Annotations", - region: 'center', - split: true, - store: lore.anno.variationStore, - autoExpandColumn: 'variationName', - columns: [ - {id: 'variationName', sortable: false, dataIndex: 'name'} - ] - }] - }, - { - xtype: "panel", - id: "variationannotationsource", - title: "Original Resource", - html: '
about:blank
', - layout: "fit", - autoScroll: true, - - columnWidth: .40 - }, - { - xtype: "panel", - id: "variationannotationtarget", - title: "Variant Resource", - html: '
about:blank
', - layout: "fit", - autoScroll: true, - /* - floating: true, - draggable: lore.dragHandler, - width: 500, - height: 400, - x: 800, - y: 10, - */ - columnWidth: .40 - }] - }] - }, { - xtype: "tabpanel", - title: "Compound Objects", - id: "compoundobjecteditor", - deferredRender: false, - plugins : lore.ui.vismode, - defaults : {plugins: lore.ui.vismode}, - items: [{ + items: [ + { title: "Editor", xtype: "panel", id: "drawingarea", @@ -397,10 +64,10 @@ lore.ui.gui_spec = { title: "Explore", id: "remexploreview", autoScroll:true - }*/], - activeTab: "drawingarea" - }, { - + }*///], + //.. activeTab: "drawingarea" + // }, { + ,{ title: "Text mining", id: "textmining", autoWidth: true, @@ -413,8 +80,6 @@ lore.ui.gui_spec = { iconCls: "welcome-icon" }], - activeTab: "annotationstab" - } ] }, { @@ -428,7 +93,6 @@ lore.ui.gui_spec = { } , { region: "west", - title: "LORE", id: "loresidebar", border: false, width: 250, @@ -494,16 +158,7 @@ lore.ui.gui_spec = { }), new Ext.Button({ text: "Remove property" })] - }, - { - xtype: "panel", - title: "Annotation summary", - id: "annotationsummary", - autoWidth: true, - viewConfig: { - forceFit: true - } - } + } ] }] }] @@ -513,6 +168,44 @@ try { //lore.debug.ui("lore height is " + innerHeight); lore.ui.main_window = new Ext.Viewport(lore.ui.gui_spec); lore.ui.main_window.show(); + } catch (ex) { lore.debug.ui("Exception creating lore UI", ex); } + +lore.ui.ore.disableUIFeatures = function(opts) { + // TODO: should add UI elements back manually when re-enabling, but easier to reset via reload for now + lore.debug.ui("LORE Compound Objects: disable ui features?", opts); + lore.ui.disabled = opts; + + var tmtab = Ext.getCmp("textmining"); + var cotab = Ext.getCmp("loreviews"); + if (opts.disable_textmining){ + if(tmtab){ + // remove text mining tab + lore.ui.loreviews.remove(lore.ui.textminingtab); + + } + } else if (!tmtab){ + window.location.reload(true); + } + + if (opts.disable_compoundobjects){ + // remove compound object tab + if (cotab){ + cotab.hide(); + // remove source tree nodes + //lore.ui.remstreeroot.remove(); + //lore.ui.recenttreeroot.remove(); + // remove propertytabs + //lore.ui.propertytabs.remove(lore.ui.grid); + //lore.ui.propertytabs.remove(lore.ui.nodegrid); + } + } else if (!cotab){ + window.location.reload(true); + } else { + if ( !cotab.isVisible() ){ + cotab.show(); + } + } +} \ No newline at end of file diff --git a/oaiorebuilder/content/loreui.css b/oaiorebuilder/content/loreui.css index 9900641f..e204a10c 100644 --- a/oaiorebuilder/content/loreui.css +++ b/oaiorebuilder/content/loreui.css @@ -18,6 +18,9 @@ * along with LORE. If not, see . */ + + + /* tool bar styles */ .tb-new-obj { background-image: url(../skin/icons/oaioreicon-sm.png) !important; @@ -109,9 +112,42 @@ .x-tree-node .annoreply-icon { background-image: url(chrome://lore/skin/icons/comments.png); } + +.x-tree-node .anno-view { + height: 16px !important; +} +.x-tree-node .anno-icon-launchWindow { + background-image: url(chrome://lore/skin/icons/page_go.png); + /*display:none;*/ +} +.x-tree-node .anno-icon-splitter { + background-image: url(chrome://lore/skin/icons/application_tile_horizontal.png); + /*display:none;*/ +} + +.x-tree-node .anno-icon-timeline { + background-image: url(chrome://lore/skin/icons/chart_line.png); +} + +/*.x-tree-selected .anno-icon-launchWindow, .x-tree-selected .anno-icon-splitter { + display: inline !important; +}*/ + +.x-tree-node a { + color:blue; + +} + +/* #90 */ .x-tree-node-ct { visibility: inherit !important; } + +.x-tree-node a:hover { + color:blue; + text-decoration:underline; +} + .orelink { font-style:italic; color: #51666b; @@ -169,9 +205,15 @@ } #welcome iframe {border:none;} +.annoreadonly { + border: 0; + background-color: red; + +} + /* Annotation editor styles */ -.newanno td { - color: red !important; +.annochanged { + background-color: #ffcccc !important; } .x-grid3-cell-inner { height: 1.2em; @@ -190,6 +232,7 @@ #annotimeline{ height:100%; width:100%; + overflow-x:scroll; overflow-y:scroll; } .timeline-copyright { display:none; @@ -231,3 +274,78 @@ #trailcarousel {height:100%;width:100%} +.left-spacer4 { + padding-left: 4px; +} +.x-column-tree .x-panel-header { + padding: 3px 0px 0px 0px; + border-bottom-width: 0px; +} + +.x-column-tree .x-panel-header .x-panel-header-text { + margin-left: 3px +} + +.x-column-tree .x-tree-node { + zoom:1; +} +.x-column-tree .x-tree-node-el { + /*border-bottom:1px solid #eee; borders? */ + zoom:1; +} + +.x-column-tree .x-tree-node a { + line-height:18px; + vertical-align:middle; +} +.x-column-tree .x-tree-node a span{ + +} +.x-column-tree .x-tree-node .x-tree-selected a span{ + background:transparent; + color:#000; +} +.x-tree-col { + /*overflow:hidden;*/ + float:left; + padding:0 1px; + zoom:1; + whitespace:normal; +} + +.x-tree-col-text, .x-tree-hd-text { + color:#888888; + +/* overflow:hidden; + * -o-text-overflow: ellipsis; + text-overflow: ellipsis; + white-space: nowrap; + */ + + padding:3px 3px 3px 5px; + white-space: normal; + + font:normal 11px arial, tahoma, helvetica, sans-serif; +} + +/* + * Any images displayed in the column text are shrunk to thumbnail size + */ +.x-tree-col-text img { + width:64; + height:64; +} + +.x-tree-headers { + /*margin-top: 3px;*/ + background: #f9f9f9 url(chrome://lore/content/lib/ext/resources/images/default/grid/grid3-hrow.gif) repeat-x 0 bottom; + cursor:default; + zoom:1; +} + +.x-tree-hd { + float:left; + overflow:hidden; + border-left:1px solid #eee; + border-right:1px solid #d0d0d0; +} diff --git a/oaiorebuilder/content/loreui.html b/oaiorebuilder/content/loreui.html index 5b160d24..49b3a14c 100644 --- a/oaiorebuilder/content/loreui.html +++ b/oaiorebuilder/content/loreui.html @@ -49,9 +49,6 @@ - - - @@ -64,7 +61,6 @@ - diff --git a/oaiorebuilder/content/options.xul b/oaiorebuilder/content/options.xul index 73075a4d..8c19d197 100644 --- a/oaiorebuilder/content/options.xul +++ b/oaiorebuilder/content/options.xul @@ -42,5 +42,4 @@ -