Changeset 189
- Timestamp:
- 03/12/08 20:31:10 (10 months ago)
- Files:
-
- MediAnnotateXPI/trunk/ma.xpi (modified) (previous)
- MediAnnotateXPI/trunk/srcExtension/chrome/MediAnnotate/content/itemPane.xul (modified) (1 diff)
- MediAnnotateXPI/trunk/srcExtension/chrome/MediAnnotate/content/overlay.js (modified) (6 diffs)
- MediAnnotateXPI/trunk/srcExtension/chrome/MediAnnotate/content/overlay.xul (modified) (1 diff)
- MediAnnotateXPI/trunk/srcExtension/install.rdf (modified) (1 diff)
- MediAnnotateXPI/trunk/update_mediannotate.rdf (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
MediAnnotateXPI/trunk/srcExtension/chrome/MediAnnotate/content/itemPane.xul
r135 r189 5 5 <button 6 6 id="zotero-go-to-url" 7 oncommand="mediannotate.is MediAnnotateCompatibleItem?mediannotate.workItOut(event):ZoteroItemPane.onViewClick(this, event)"7 oncommand="mediannotate.isPlayableItem()?mediannotate.workItOut(event):ZoteroItemPane.onViewClick(this, event)" 8 8 /> 9 9 MediAnnotateXPI/trunk/srcExtension/chrome/MediAnnotate/content/overlay.js
r188 r189 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 //Mac's can play flv in quicktime with Perian installed. Windows, no chance. 42 if (navigator.appVersion.indexOf("Mac")!=-1) this.extensionMatch = /^.*((mpg)|(avi)|(mov)|(flv))$/i; 43 else this.extensionMatch = /^.*((mpg)|(avi)|(mov))$/i; 41 44 }, 42 45 … … 57 60 if(this.isMediaAnnotation)this.showMAPanel(); 58 61 59 //Mac's can play flv in quicktime with Perian installed. Windows, no chance.60 if (navigator.appVersion.indexOf("Mac")!=-1) var extensionMatch = /^.*((mpg)|(avi)|(mov)|(flv))$/i;61 else var extensionMatch = /^.*((mpg)|(avi)|(mov))$/i;62 62 var itemId = ZoteroPane.getSelectedItems(true)[0]; 63 63 this.item = Zotero.Items.get(itemId); … … 67 67 document.getElementById('MA-menu-item').hidden=true; 68 68 this.current_url = false; 69 this.isMediAnnotateCompatibleItem = false;70 69 this.isMediaAnnotation = false; 71 70 72 //The reerror messages are annoying when this happens.71 //The error messages are annoying when this happens. 73 72 if(!this.item) { 74 73 Zotero.debug("No item selected"); 75 } else //Check if it's a "mediannotate" attachment 76 if(this.item.getType() == 14) { 77 this.isMediaAnnotation = this.isXMLNote(this.item.getNote()); 78 //If it's not an attachment, check if it's mediannotate compatible 79 } else if(this.item.getField('url').match(extensionMatch)) { 80 if(this.item.isRegularItem()) { 81 var snapID = this.item.getBestSnapshot(); 82 if (snapID) { 83 this.current_url = Zotero.Items.get(snapID).getLocalFileURL(); 84 } 85 } else { 86 this.current_url = this.item.getField('url'); 87 } 88 this.isMediAnnotateCompatibleItem = true; 89 this.parentItem = this.item; 90 74 } else { 75 this.isMediaAnnotation = this.isXMLNote(this.item); 76 91 77 } 92 78 … … 94 80 this.applyChange(); 95 81 this.parentItem = Zotero.Items.get(this.item.getSource()); 96 this.current_url = this.parentItem.getField('url');97 82 this.prepareMAEntryView(this.item); 98 83 } else { 84 this.parentItem = this.item; 99 85 //In the even that we're not a Media Annotation, let's put the old item info panel back. 100 86 document.getElementById('zotero-item-pane-content').selectedPanel = oldPanel; 101 87 } 102 103 if(this.isMediaAnnotation || this.isMediAnnotateCompatibleItem) { 88 89 if(this.item && (this.isPlayableItem())) { 90 this.current_url = this.getPlayableURL(); 104 91 document.getElementById('MA-menu-item').hidden=false; 105 92 document.getElementById("zotero-items-tree").ondblclick = function ondblclick(event) { … … 114 101 115 102 } 116 } 103 } //The check for being in mid-change 117 104 }, 118 105 119 isXMLNote: function(note_text) { 106 isXMLNote: function(item) { 107 if(item.getType() != 14) return false; 120 108 var objDOMParser = new DOMParser(); 121 var xmlDoc = objDOMParser.parseFromString( note_text, "text/xml");109 var xmlDoc = objDOMParser.parseFromString(item.getNote(), "text/xml"); 122 110 try { 123 111 xmlDoc.evaluate("/mediannotate", xmlDoc, null, XPathResult.ANY_TYPE, null).iterateNext().textContent; … … 159 147 showMAPanel: function() { 160 148 document.getElementById('zotero-item-pane-content').selectedPanel = document.getElementById('zotero-view-MA'); 149 }, 150 151 isPlayableItem: function() { 152 return this.isMediaAnnotation || this.item.getField('url').match(this.extensionMatch); 153 }, 154 155 getPlayableURL: function() { 156 var url = this.item.getField('url');; 157 if(this.isMediaAnnotation) url = this.parentItem.getField('url'); 158 else if(this.item.isRegularItem()) { 159 var snapID = this.item.getBestSnapshot(); 160 if (snapID) { 161 url = Zotero.Items.get(snapID).getLocalFileURL(); 162 } 163 } 164 return url; 161 165 }, 162 166 MediAnnotateXPI/trunk/srcExtension/chrome/MediAnnotate/content/overlay.xul
r139 r189 13 13 <button 14 14 id="zotero-attachment-view" 15 oncommand="mediannotate.is MediAnnotateCompatibleItem?mediannotate.workItOut(event):ZoteroPane.viewSelectedAttachment(event);"/>15 oncommand="mediannotate.isPlayableItem()?mediannotate.workItOut(event):ZoteroPane.viewSelectedAttachment(event);"/> 16 16 17 17 <tree MediAnnotateXPI/trunk/srcExtension/install.rdf
r188 r189 5 5 <em:id>videannotate@htmlweb.com</em:id> 6 6 <em:name>MediAnnotate</em:name> 7 <em:version>0.6.9. 6</em:version>7 <em:version>0.6.9.7</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
r188 r189 8 8 <RDF:li> 9 9 <RDF:Description> 10 <version>0.6.9. 6</version>10 <version>0.6.9.7</version> 11 11 <targetApplication> 12 12 <RDF:Description>
