Changeset 117

Show
Ignore:
Timestamp:
11/29/07 15:15:24 (1 year ago)
Author:
Stuart Thiel
Message:

-Fixed #102

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • MediAnnotateXPI/trunk/srcExtension/chrome.manifest

    r64 r117  
    1 content videannotate chrome/videannotate/content/ 
     1content mediannotate chrome/mediannotate/content/ 
    22 
    3 overlay chrome://browser/content/browser.xul chrome://videannotate/content/overlay.xul 
     3overlay chrome://browser/content/browser.xul chrome://mediannotate/content/overlay.xul 
    44 
    5 overlay chrome://zotero/content/itemPane.xul chrome://videannotate/content/itemPane.xul 
    6 overlay chrome://zotero/content/overlay.xul chrome://videannotate/content/overlay.xul 
     5overlay chrome://zotero/content/itemPane.xul chrome://mediannotate/content/itemPane.xul 
     6overlay chrome://zotero/content/overlay.xul chrome://mediannotate/content/overlay.xul 
    77 
    8 skin videannotate global chrome/videannotate/skin/global/ 
    9 locale videannotate en-US chrome/videannotate/locale/en-US/ 
     8skin mediannotate global chrome/mediannotate/skin/global/ 
     9locale mediannotate en-US chrome/mediannotate/locale/en-US/ 
  • MediAnnotateXPI/trunk/srcExtension/chrome/MediAnnotate/content/itemPane.xul

    r75 r117  
    11<?xml version="1.0"?> 
    2 <overlay id="videannotate-overlay-z" 
     2<overlay id="mediannotate-overlay-z" 
    33    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 
    4     <!-- <script src="chrome://videannotate/content/overlay.js"/>  --> 
     4    <!-- <script src="chrome://mediannotate/content/overlay.js"/>  --> 
    55 
    66  <button  
    77        id="zotero-go-to-url" 
    8         oncommand="videannotate.isVideAnnotateCompatibleItem?videannotate.workItOut(event):ZoteroItemPane.onViewClick(this, event)"  
     8        oncommand="mediannotate.isMediAnnotateCompatibleItem?mediannotate.workItOut(event):ZoteroItemPane.onViewClick(this, event)"  
    99        /> 
    1010 
  • MediAnnotateXPI/trunk/srcExtension/chrome/MediAnnotate/content/mediannotate.xul

    r114 r117  
    11<?xml version="1.0"?> 
    22 <window xmlns="http://www.w3.org/1999/xhtml"  
    3          title="videannotate"> 
    4 <script type="application/x-javascript" src="chrome://videannotate/content/file.js" /> 
     3         title="mediannotate"> 
     4<script type="application/x-javascript" src="chrome://mediannotate/content/file.js" /> 
    55          
    66<center><p id="applet-holder" xmlns="http://www.w3.org/1999/xhtml"> 
     
    3232}  
    3333 
    34 var result = "<object id='VA-applet' type='application/x-java-applet' width='533' height='400'>\n" + 
    35 "  <param name='code' value='org.videannotate.app.VideoAnnotater'/>" + 
     34var result = "<object id='MA-applet' type='application/x-java-applet' width='533' height='400'>\n" + 
     35"  <param name='code' value='org.mediannotate.app.MediAnnotater'/>" + 
    3636"  <param name='archive' \n" + 
    37 "  value='SVideAnnotate.jar'/>\n" +  
     37"  value='SMediAnnotate.jar'/>\n" +  
    3838"  <param name='url' value='" + url + "'/>\n" + 
    3939(mediannotate?"  <param name='mediannotate' value='" + mediannotate + "'/>\n":"") + 
  • MediAnnotateXPI/trunk/srcExtension/chrome/MediAnnotate/content/overlay.js

    r103 r117  
    1 var videannotate = { 
     1var mediannotate = { 
    22  onLoad: function() { 
    33    // initialization code 
     
    55  }, 
    66 
    7     prepareVideAnnotate: function() { 
     7    prepareMediAnnotate: function() { 
    88    var extensionMatch = /^.*((mpg)|(avi)|(mov))$/i; 
    99        var itemId = ZoteroPane.getSelectedItems(true)[0]; 
     
    1313        //Let's init things to blank and let real decisions be made later if necessary. 
    1414        this.parentItem = false; 
    15         document.getElementById('VA-menu-item').hidden=true; 
     15        document.getElementById('MA-menu-item').hidden=true; 
    1616        this.current_url = false; 
    17         this.isVideAnnotateCompatibleItem = false; 
     17        this.isMediAnnotateCompatibleItem = false; 
    1818        this.isMediaAnnotation = false; 
    1919 
     
    2727        } else if(this.item.getField('url').match(extensionMatch)) { 
    2828        this.current_url = this.item.getField('url'); 
    29                 this.isVideAnnotateCompatibleItem = true; 
     29                this.isMediAnnotateCompatibleItem = true; 
    3030                this.parentItem = this.item; 
    3131                 
     
    3535                this.parentItem = Zotero.Items.get(this.item.getSource()); 
    3636                this.current_url = this.parentItem.getField('url'); 
    37                 this.prepareVAEntryView(this.item); 
    38         } 
    39  
    40         if(this.isMediaAnnotation || this.isVideAnnotateCompatible) { 
    41                 document.getElementById('VA-menu-item').hidden=false; 
     37                this.prepareMAEntryView(this.item); 
     38        } 
     39 
     40        if(this.isMediaAnnotation || this.isMediAnnotateCompatible) { 
     41                document.getElementById('MA-menu-item').hidden=false; 
    4242                document.getElementById("zotero-items-tree").ondblclick = function ondblclick(event) { 
    43                         videannotate.workItOut(event); 
     43                        mediannotate.workItOut(event); 
    4444                } 
    4545 
     
    6666        } 
    6767  }, 
    68    
    69   prepareVAEntryView: function(item) { 
     68     
     69  prepareMAEntryView: function(item) { 
    7070        var xmlString = item.getNote(); 
    7171        var objDOMParser = new DOMParser(); 
     
    7373        this.xmlDoc = xmlDoc; 
    7474             
    75         document.getElementById('va-description').value = this.xmlDoc.evaluate("//description", this.xmlDoc, null, XPathResult.ANY_TYPE, null).iterateNext().textContent; 
    76         document.getElementById('va-start-time').value = this.xmlDoc.evaluate("//start", this.xmlDoc, null, XPathResult.ANY_TYPE, null).iterateNext().textContent; 
    77         document.getElementById('va-end-time').value = this.xmlDoc.evaluate("//end", this.xmlDoc, null, XPathResult.ANY_TYPE, null).iterateNext().textContent; 
    78         document.getElementById('va-itemRef').value = item.getID(); 
     75        document.getElementById('ma-description').value = this.xmlDoc.evaluate("//description", this.xmlDoc, null, XPathResult.ANY_TYPE, null).iterateNext().textContent; 
     76        document.getElementById('ma-start-time').value = this.xmlDoc.evaluate("//start", this.xmlDoc, null, XPathResult.ANY_TYPE, null).iterateNext().textContent; 
     77        document.getElementById('ma-end-time').value = this.xmlDoc.evaluate("//end", this.xmlDoc, null, XPathResult.ANY_TYPE, null).iterateNext().textContent; 
     78        document.getElementById('ma-itemRef').value = item.getID(); 
    7979         
    8080        //This is a silly way of doing things.  
    8181        //document.getElementById('zotero-item-pane-content').selectedIndex = 4; 
    8282        //Below is the correct way (or at least a much better way). 
    83         var VAPanel = document.getElementById('zotero-view-VA'); 
    84         document.getElementById('zotero-item-pane-content').selectedPanel = VAPanel; 
     83        var MAPanel = document.getElementById('zotero-view-MA'); 
     84        document.getElementById('zotero-item-pane-content').selectedPanel = MAPanel; 
    8585         
    8686        //Load tags into the popup scrollbar 
     
    9191  applyChange: function() { 
    9292    if(this.isSaveable) { 
    93     var item = Zotero.Items.get(document.getElementById('va-itemRef').value); 
    94                 var newNote = "<mediannotate><description>" + document.getElementById('va-description').value  + "</description>\n" + 
    95                   "<start>" + document.getElementById('va-start-time').value + "</start>\n" + 
    96                   "<end>" + document.getElementById('va-end-time').value + "</end></mediannotate>"; 
     93    var item = Zotero.Items.get(document.getElementById('ma-itemRef').value); 
     94                var newNote = "<mediannotate><description>" + document.getElementById('ma-description').value  + "</description>\n" + 
     95                  "<start>" + document.getElementById('ma-start-time').value + "</start>\n" + 
     96                  "<end>" + document.getElementById('ma-end-time').value + "</end></mediannotate>"; 
    9797                item.updateNote(newNote); 
    98                 var title = document.getElementById('va-start-time').value + " - " + document.getElementById('va-end-time').value + " " + Zotero.Notes.noteToTitle(document.getElementById('va-description').value); 
     98                var title = document.getElementById('ma-start-time').value + " - " + document.getElementById('ma-end-time').value + " " + Zotero.Notes.noteToTitle(document.getElementById('ma-description').value); 
    9999                item.setField(110, title, false); 
    100100                item.save(); 
     
    105105                var newID = this._addMediaAnnotation("0 - 0 ", this.parentItem.getID(), "", 12); 
    106106                this.item = Zotero.Items.get(newID); 
    107         var myApplet = content.document.getElementById('VA-applet');   
     107        var myApplet = content.document.getElementById('MA-applet');   
    108108                   
    109109 
     
    113113                this.item.updateNote(newNote); 
    114114                ZoteroPane.selectItem(newID); 
    115                 var title = document.getElementById('va-start-time').value + " - " + document.getElementById('va-end-time').value + " " + Zotero.Notes.noteToTitle(document.getElementById('va-description').value); 
     115                var title = document.getElementById('ma-start-time').value + " - " + document.getElementById('ma-end-time').value + " " + Zotero.Notes.noteToTitle(document.getElementById('ma-description').value); 
    116116                this.item.setField(110, title, false); 
    117117                this.item.save(); 
     
    128128   
    129129  workItOut: function(event) { 
    130         var url = "chrome://videannotate/content/videannotate.xul?url=" + this.current_url; 
     130        var url = "chrome://mediannotate/content/mediannotate.xul?url=" + this.current_url; 
    131131                if(this.isMediaAnnotation) { 
    132132                        var flatnote = this.item.getNote().replace('\n', ' '); 
     
    199199}; 
    200200 
    201 window.addEventListener("load", function(e) { videannotate.onLoad(e); }, false);  
     201window.addEventListener("load", function(e) { mediannotate.onLoad(e); }, false);  
  • MediAnnotateXPI/trunk/srcExtension/chrome/MediAnnotate/content/overlay.xul

    r103 r117  
    11<?xml version="1.0"?> 
    2 <overlay id="videannotate-overlay-z" 
     2<overlay id="mediannotate-overlay-z" 
    33    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 
    4     <script src="chrome://videannotate/content/tags.js"/> 
    5     <script src="chrome://videannotate/content/overlay.js"/> 
     4    <script src="chrome://mediannotate/content/tags.js"/> 
     5    <script src="chrome://mediannotate/content/overlay.js"/> 
    66 
    77 
    88    <button  
    99    id="zotero-attachment-view"  
    10         oncommand="videannotate.isVideAnnotateCompatibleItem?videannotate.workItOut(event):ZoteroPane.viewSelectedAttachment(event);"/> 
     10        oncommand="mediannotate.isMediAnnotateCompatibleItem?mediannotate.workItOut(event):ZoteroPane.viewSelectedAttachment(event);"/> 
    1111         
    1212        <tree  
    1313        id="zotero-items-tree" 
    14         onselect="ZoteroPane.itemSelected();videannotate.prepareVideAnnotate();" /> 
     14        onselect="ZoteroPane.itemSelected();mediannotate.prepareMediAnnotate();" /> 
    1515 
    1616<!-- This is debug code to find stuff --> 
    1717        <deck id="zotero-item-pane-content"> 
    18                 <vbox id="zotero-view-VA" flex="1"> 
    19                         <button id="va-view-button" label="View in VideAnnotate" oncommand="videannotate.workItOut(event)"/> 
    20                         <hbox id="va-time-indicators" flex="0"> 
    21                         <textbox id="va-start-time" rows="1" cols="8" onchange="videannotate.applyChange()"/> 
    22                         <textbox id="va-end-time" rows="1" cols="8" onchange="videannotate.applyChange()"/> 
     18                <vbox id="zotero-view-MA" flex="1"> 
     19                        <button id="ma-view-button" label="View in MediAnnotate" oncommand="mediannotate.workItOut(event)"/> 
     20                        <hbox id="ma-time-indicators" flex="0"> 
     21                        <textbox id="ma-start-time" rows="1" cols="8" onchange="mediannotate.applyChange()"/> 
     22                        <textbox id="ma-end-time" rows="1" cols="8" onchange="mediannotate.applyChange()"/> 
    2323                        </hbox> 
    24                         <textbox id="va-description" rows="8" cols="25" multiline="true" onchange="videannotate.applyChange()"/> 
    25                         <label id="va-itemRef" hidden="true" /> 
     24                        <textbox id="ma-description" rows="8" cols="25" multiline="true" onchange="mediannotate.applyChange()"/> 
     25                        <label id="ma-itemRef" hidden="true" /> 
    2626                        <label id="ma-TagsLabel" class="zotero-clicky" value="Tags: [click here]" crop="end" onclick="mediannotate_tags.showPopup();"/> 
    2727                        <!-- ignorekeys="true" lets us have input fields in the popup, a useful thing to know. --> 
     
    4848         
    4949        <popup id="zotero-itemmenu" onpopupshowing="ZoteroPane.buildItemContextMenu();"> 
    50                 <menuitem id="VA-menu-item" label="Add Media Annotation" hidden="true" oncommand="videannotate.addMediaAnnotation();"/> 
     50                <menuitem id="MA-menu-item" label="Add Media Annotation" hidden="true" oncommand="mediannotate.addMediaAnnotation();"/> 
    5151        </popup> 
    5252 
  • MediAnnotateXPI/trunk/srcExtension/install.rdf

    r104 r117  
    55    <em:id>videannotate@htmlweb.com</em:id> 
    66    <em:name>MediAnnotate</em:name> 
    7     <em:version>0.6.0.5</em:version> 
    8     <em:creator>Stuart ThielConcordia University University</em:creator> 
     7    <em:version>0.6.0.6</em:version> 
     8    <em:creator>Stuart Thiel Concordia University University</em:creator> 
    99    <em:developer>Stuart Thiel</em:developer> 
    10     <em:homepageURL>http://videannotate.htmlweb.com/trac/</em:homepageURL> 
    11     <em:updateURL>http://videannotate.htmlweb.com/trac/browser/VideAnnotateXPI/trunk/update_videannotate.rdf?format=raw</em:updateURL> 
     10    <em:homepageURL>http://mediannotate.htmlweb.com/trac/</em:homepageURL> 
     11    <em:updateURL>http://mediannotate.htmlweb.com/trac/browser/MediAnnotateXPI/trunk/update_mediannotate.rdf?format=raw</em:updateURL> 
    1212    <em:type>2</em:type> <!-- type=extension -->  
    1313     
  • MediAnnotateXPI/trunk/update_videannotate.rdf

    r104 r117  
    1414              <minVersion>2.0</minVersion> 
    1515              <maxVersion>2.0.0.*</maxVersion> 
    16               <updateLink>http://videannotate.htmlweb.com/trac/browser/VideAnnotateXPI/trunk/va.xpi?format=raw</updateLink> 
     16              <updateLink>http://mediannotate.htmlweb.com/trac/browser/MediAnnotateXPI/trunk/ma.xpi?format=raw</updateLink> 
    1717            </RDF:Description> 
    1818          </targetApplication>