/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ /* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ /* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/NoteServer/note-server.js */ function NoteServer(_1){ this.editor=_1; var _2=_1.config; var _3=this; _2.registerButton({id:"insertscore",tooltip:this._lc("Insert GUIDO Music Notation"),image:_1.imgURL("note.gif","NoteServer"),textMode:false,action:function(_4){ _3.buttonPress(_4); }}); _2.addToolbarElement("insertscore","insertimage",1); } NoteServer._pluginInfo={name:"NoteServer",version:"1.1",developer:"Richard Christophe",developer_url:"http://piano-go.chez.tiscali.fr/guido.html",c_owner:"Richard Christophe",sponsor:"",sponsor_url:"",license:"htmlArea"}; NoteServer.prototype._lc=function(_5){ return Xinha._lc(_5,"NoteServer"); }; NoteServer.prototype.buttonPress=function(_6){ _6._popupDialog("plugin://NoteServer/codenote",function(_7){ if(!_7){ return false; }else{ IncludeGuido(_6,_7); } },null); }; var noteserveraddress="clef.cs.ubc.ca"; var htmlbase="/salieri/nview"; var versionstring=""; function GetGIFURL(_8,_9,_a){ _8=escape(_8); _8=_8.replace(/\//g,"%2F"); if(!_9){ _9="1.0"; } if(!_a){ _a="1"; } var _b="http://"+noteserveraddress+"/scripts/salieri"+versionstring+"/gifserv.pl?"+"pagewidth=21"+"&pageheight=29.7"+"&zoomfactor="+_9+"&pagesizeadjust=yes"+"&outputformat=gif87"+"&pagenum="+_a+"&gmndata="+_8; return _b; } function GetMIDIURL(_c){ _c=escape(_c); _c=_c.replace(/\//g,"%2F"); var _d="http://"+noteserveraddress+"/scripts/salieri"+versionstring+"/midserv.pl?"+"gmndata="+_c; return _d; } function GetAPPLETURL(_e,_f){ _e=escape(_e); _e=_e.replace(/\//g,"%2F"); var _10=""+""+""+""+""+""+""+""; return _10; } function IncludeGuido(_11,_12){ if(!_12["f_zoom"]){ zoom=""; } var _13=GetGIFURL(_12["f_code"],_12["f_zoom"],""); var _14=GetMIDIURL(_12["f_code"]); var _15="
"; if(_12["f_applet"]==false){ if(((navigator.userAgent.toLowerCase().indexOf("msie")!=-1)&&(navigator.userAgent.toLowerCase().indexOf("opera")==-1))){ _11.focusEditor(); _11.insertHTML(""); }else{ img=new Image(); img.src=_13; var doc=_11._doc; var sel=_11._getSelection(); var _18=_11._createRange(sel); _11._doc.execCommand("insertimage",false,img.src); } }else{ var _19=GetAPPLETURL(_12["f_code"],_12["f_zoom"]); _15=_15+_19+"
"; } if(_12["f_affcode"]){ _15=_15+Xinha._lc("GUIDO Code","NoteServer")+" : "+_12["f_code"]+"
"; } if(_12["f_midi"]){ _15=_15+""+Xinha._lc("MIDI File","NoteServer")+"
"; } _11.focusEditor(); _11.insertHTML(_15); } function IncludeGuidoStringAsApplet(_1a,_1b,_1c){ _1b=escape(_1b); _1b=_1b.replace(/\//g,"%2F"); var _1d=""+""+""+""+""+""+""+""; alert(_1d); _1a.focusEditor(); _1a.insertHTML(_1d); }