Changeset 268
- Timestamp:
- 09/08/08 10:59:44 (4 months ago)
- Files:
-
- MediAnnotateXPI/trunk/srcExtension/chrome/vertov/content/overlay.js (modified) (6 diffs)
- MediAnnotateXPI/trunk/srcExtension/install.rdf (modified) (1 diff)
- MediAnnotateXPI/trunk/update_mediannotate.rdf (modified) (1 diff)
- MediAnnotateXPI/trunk/vertov.xpi (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
MediAnnotateXPI/trunk/srcExtension/chrome/vertov/content/overlay.js
r267 r268 3 3 * This is the install script code. 4 4 */ 5 const MY_EXTENSION_VERSION = "0.7. 4";5 const MY_EXTENSION_VERSION = "0.7.5.5"; 6 6 const MY_EXTENSION_STRING = "mediannotate.install.finished"; 7 7 function initializeOverlay() { … … 39 39 this.timecodeRegexpEval = '($1 * 1000 * 1000 * 60) + ($2 * 1000 * 60) + ($3 * 1000) + ($4 * 33.3);' 40 40 this.sprintfString = "%02d:%02d:%02d.%02d"; 41 this.isZotero15 = Zotero.Item.prototype.setNote; 41 42 //Mac's can play flv in quicktime with Perian installed. Windows, no chance. 42 43 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; … … 223 224 "</mediannotate>"; 224 225 try { 225 item.updateNote(newNote); 226 if(this.isZotero15) { 227 item.setNote(newNote); 228 } else { 229 item.updateNote(newNote); 230 } 231 226 232 //Sometimes were applying a change because we've switched to another item and the change in item takes effect before 227 233 //the onchange takes effect. If that item is a Media Annotation, we'll want to switch back to the MAPanel because … … 266 272 myApplet.wrappedJSObject.getTime() + 267 273 "<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 } 270 280 ZoteroPane.selectItem(newID); 271 281 var title = document.getElementById('ma-start-time').value + " - " + document.getElementById('ma-end-time').value + " " + Zotero.Notes.noteToTitle(document.getElementById('ma-description').value); … … 310 320 _addToDB: function (url, title, linkMode, mimeType, charsetID, sourceItemID){ 311 321 Zotero.DB.beginTransaction(); 322 312 323 try { 313 324 if (sourceItemID){ 314 325 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 316 332 if (!sourceItem || sourceItem.isAttachment()){ 317 333 Zotero.DB.rollbackTransaction(); … … 320 336 } 321 337 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 } 323 343 attachmentItem.setField('title', title); 324 344 attachmentItem.setField('url', url); 325 345 attachmentItem.setField('accessDate', "CURRENT_TIMESTAMP"); 346 if(this.isZotero15) { 347 attachmentItem.setSource(sourceItemID); 348 attachmentItem.attachmentLinkMode = linkMode; 349 attachmentItem.attachmentMIMEType = mimeType; 350 } 326 351 attachmentItem.save(); 327 352 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 } 339 366 340 367 if (sourceItemID){ MediAnnotateXPI/trunk/srcExtension/install.rdf
r267 r268 5 5 <em:id>videannotate@htmlweb.com</em:id> 6 6 <em:name>Vertov</em:name> 7 <em:version>0.7.5. 4.4</em:version>7 <em:version>0.7.5.5</em:version> 8 8 <em:creator>Stuart Thiel Concordia University University</em:creator> 9 9 <em:developer>Stuart Thiel</em:developer> MediAnnotateXPI/trunk/update_mediannotate.rdf
r267 r268 8 8 <RDF:li> 9 9 <RDF:Description> 10 <version>0.7.5. 4.4</version>10 <version>0.7.5.5</version> 11 11 <targetApplication> 12 12 <RDF:Description>
