Changeset 268

Show
Ignore:
Timestamp:
09/08/08 10:59:44 (4 months ago)
Author:
Stuart Thiel
Message:

-Fixed #213

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • MediAnnotateXPI/trunk/srcExtension/chrome/vertov/content/overlay.js

    r267 r268  
    33* This is the install script code.  
    44*/ 
    5 const MY_EXTENSION_VERSION = "0.7.4"; 
     5const MY_EXTENSION_VERSION = "0.7.5.5"; 
    66const MY_EXTENSION_STRING = "mediannotate.install.finished"; 
    77function initializeOverlay() { 
     
    3939    this.timecodeRegexpEval = '($1 * 1000 * 1000 * 60) + ($2 * 1000 * 60) + ($3 * 1000) + ($4 * 33.3);' 
    4040    this.sprintfString = "%02d:%02d:%02d.%02d"; 
     41    this.isZotero15 = Zotero.Item.prototype.setNote; 
    4142    //Mac's can play flv in quicktime with Perian installed. Windows, no chance. 
    4243    if (navigator.appVersion.indexOf("Mac")!=-1) this.extensionMatch = /^.*((mp3)|(wav)|(mpg)|(avi)|(mov)|(flv)|(flc)|(dv)|(sdp)|(mp4)|(mpeg)|(moov)|(qt)|(movie)|(au)|(3gp)|(3gpp)|(3g2)|(3gp2)|(ac3)|(aac)|(aif)|(aifc)|(aiff)|(amc)|(amr)|(bwf)|(caf)|(cdda)|(cel)|(dif)|(fli)|(gsm)|(kar)|(m15)|(m1a)|(m1s)|(m1v)|(m75)|(mid)|(midi)|(mpa)|(mpm)|(mpv)|(mqv)|(qcp)|(qtl)|(sdv)|(smf)|(snd)|(ulw)|(vfw))$/i; 
     
    223224                  "</mediannotate>"; 
    224225                try { 
    225                         item.updateNote(newNote); 
     226                        if(this.isZotero15) { 
     227                                item.setNote(newNote); 
     228                        } else { 
     229                                item.updateNote(newNote); 
     230                        } 
     231                         
    226232                        //Sometimes were applying a change because we've switched to another item and the change in item takes effect before 
    227233                        //the onchange takes effect. If that item is a Media Annotation, we'll want to switch back to the MAPanel because 
     
    266272                  myApplet.wrappedJSObject.getTime() +  
    267273                  "<url><![CDATA["+url+"]]></url>" + 
    268                   "</mediannotate>";             
    269                 this.item.updateNote(newNote); 
     274                  "</mediannotate>"; 
     275                if(this.isZotero15) { 
     276                        this.item.setNote(newNote); 
     277                } else { 
     278                        this.item.updateNote(newNote); 
     279                } 
    270280                ZoteroPane.selectItem(newID); 
    271281                var title = document.getElementById('ma-start-time').value + " - " + document.getElementById('ma-end-time').value + " " + Zotero.Notes.noteToTitle(document.getElementById('ma-description').value); 
     
    310320        _addToDB: function (url, title, linkMode, mimeType, charsetID, sourceItemID){ 
    311321                Zotero.DB.beginTransaction(); 
     322                 
    312323                try { 
    313324                if (sourceItemID){ 
    314325                        var sourceItem = new Zotero.Item(); 
    315                         sourceItem.loadFromID(sourceItemID); 
     326                        if(this.isZotero15) { 
     327                                sourceItem = new Zotero.Item(1, 1); 
     328                        } else { 
     329                                sourceItem.loadFromID(sourceItemID); 
     330                        } 
     331 
    316332                        if (!sourceItem || sourceItem.isAttachment()){ 
    317333                                Zotero.DB.rollbackTransaction(); 
     
    320336                } 
    321337                 
    322                 var attachmentItem = new Zotero.Item('attachment'); 
     338                if(this.isZotero15) { 
     339                        var attachmentItem = new Zotero.Item(false, 'attachment'); 
     340                } else { 
     341                        var attachmentItem = new Zotero.Item('attachment'); 
     342                } 
    323343                attachmentItem.setField('title', title); 
    324344                attachmentItem.setField('url', url); 
    325345                attachmentItem.setField('accessDate', "CURRENT_TIMESTAMP"); 
     346                if(this.isZotero15) { 
     347                        attachmentItem.setSource(sourceItemID); 
     348                        attachmentItem.attachmentLinkMode = linkMode; 
     349                        attachmentItem.attachmentMIMEType = mimeType; 
     350                } 
    326351                attachmentItem.save(); 
    327352                 
    328                 var sql = "INSERT INTO itemAttachments (itemID, sourceItemID, linkMode, " 
    329                         + "mimeType, charsetID, path) VALUES (?,?,?,?,?,?)"; 
    330                 var bindParams = [ 
    331                         attachmentItem.getID(), 
    332                         sourceItemID ? {int:sourceItemID} : null, 
    333                         {int:linkMode}, 
    334                         mimeType ? {string:mimeType} : null, 
    335                         charsetID ? {int:charsetID} : null, 
    336                         null 
    337                 ]; 
    338                 Zotero.DB.query(sql, bindParams); 
     353                if(!this.isZotero15) { 
     354                        var sql = "INSERT INTO itemAttachments (itemID, sourceItemID, linkMode, " 
     355                                + "mimeType, charsetID, path) VALUES (?,?,?,?,?,?)"; 
     356                        var bindParams = [ 
     357                                attachmentItem.getID(), 
     358                                sourceItemID ? {int:sourceItemID} : null, 
     359                                {int:linkMode}, 
     360                                mimeType ? {string:mimeType} : null, 
     361                                charsetID ? {int:charsetID} : null, 
     362                                null 
     363                        ]; 
     364                        Zotero.DB.query(sql, bindParams); 
     365                } 
    339366                 
    340367                if (sourceItemID){ 
  • MediAnnotateXPI/trunk/srcExtension/install.rdf

    r267 r268  
    55    <em:id>videannotate@htmlweb.com</em:id> 
    66    <em:name>Vertov</em:name> 
    7     <em:version>0.7.5.4.4</em:version> 
     7    <em:version>0.7.5.5</em:version> 
    88    <em:creator>Stuart Thiel Concordia University University</em:creator> 
    99    <em:developer>Stuart Thiel</em:developer> 
  • MediAnnotateXPI/trunk/update_mediannotate.rdf

    r267 r268  
    88      <RDF:li> 
    99        <RDF:Description> 
    10           <version>0.7.5.4.4</version> 
     10          <version>0.7.5.5</version> 
    1111          <targetApplication> 
    1212            <RDF:Description>