/* compact [ ../plugins/gestion_medias/Lecteur_multimedia/soundmanager/soundmanager2.js ../plugins/gestion_medias/Lecteur_multimedia/javascript/jscroller.js ../plugins/gestion_medias/Lecteur_multimedia/player_enclosure.js ../plugins/publication/porte_plume/javascript/xregexp-min.js ../plugins/publication/porte_plume/javascript/jquery.markitup_pour_spip.js ../plugins/publication/porte_plume/javascript/jquery.previsu_spip.js page=porte_plume_start.js(lang=fr) ] 69.8% */ /* ../plugins/gestion_medias/Lecteur_multimedia/soundmanager/soundmanager2.js */ ; function SoundManager(smURL,smID){ var self=this; this.version='V2.0b.20070415'; this.url=(smURL||'soundmanager2.swf'); this.debugMode=true;this.useConsole=true;this.consoleOnly=false;this.nullURL='data/null.mp3'; this.defaultOptions={ 'autoLoad':false,'stream':true,'autoPlay':false,'onid3':null,'onload':null,'whileloading':null,'onplay':null,'whileplaying':null,'onstop':null,'onfinish':null,'onbeforefinish':null,'onbeforefinishtime':5000,'onbeforefinishcomplete':null,'onjustbeforefinish':null,'onjustbeforefinishtime':200,'multiShot':true,'pan':0,'volume':100} this.allowPolling=true;this.enabled=false; this.o=null; this.id=(smID||'sm2movie'); this.oMC=null; this.sounds=[]; this.soundIDs=[]; this.isIE=(navigator.userAgent.match(/MSIE/)); this.isSafari=(navigator.userAgent.match(/safari/i)); this.debugID='soundmanager-debug'; this._debugOpen=true; this._didAppend=false; this._appendSuccess=false; this._didInit=false; this._disabled=false; this._hasConsole=(typeof console!='undefined'&&typeof console.log!='undefined'); this._debugLevels=!self.isSafari?['debug','info','warn','error']:['log','log','log','log']; this.getMovie=function(smID){ return self.isIE?window[smID]:(self.isSafari?document[smID+'-embed']:document.getElementById(smID+'-embed'))} this.loadFromXML=function(sXmlUrl){ try{ self.o._loadFromXML(sXmlUrl)}catch(e){ self._failSafely(); return true} } this.createSound=function(oOptions){ if(!self._didInit)throw new Error('soundManager.createSound(): Not loaded yet - wait for soundManager.onload() before calling sound-related methods'); if(arguments.length==2){ oOptions={'id':arguments[0],'url':arguments[1]} } var thisOptions=self._mergeObjects(oOptions); self._writeDebug('soundManager.createSound(): "'+thisOptions.id+'" ('+thisOptions.url+')',1); if(self._idCheck(thisOptions.id,true)){ self._writeDebug('sound '+thisOptions.id+' already defined - exiting',2); return false} self.sounds[thisOptions.id]=new SMSound(self,thisOptions); self.soundIDs[self.soundIDs.length]=thisOptions.id; try{ self.o._createSound(thisOptions.id,thisOptions.onjustbeforefinishtime)}catch(e){ self._failSafely(); return true} if(thisOptions.autoLoad||thisOptions.autoPlay)self.sounds[thisOptions.id].load(thisOptions); if(thisOptions.autoPlay)self.sounds[thisOptions.id].playState=1} this.destroySound=function(sID){ if(!self._idCheck(sID))return false; for(var i=self.soundIDs.length;i--;){ if(self.soundIDs[i]==sID){ delete self.soundIDs[i]; continue} } self.sounds[sID].unload(); delete self.sounds[sID]} this.load=function(sID,oOptions){ if(!self._idCheck(sID))return false; self.sounds[sID].load(oOptions)} this.unload=function(sID){ if(!self._idCheck(sID))return false; self.sounds[sID].unload()} this.play=function(sID,oOptions){ if(!self._idCheck(sID)){ if(typeof oOptions!='Object')oOptions={url:oOptions};if(oOptions&&oOptions.url){ self._writeDebug('soundController.play(): attempting to create "'+sID+'"',1); oOptions.id=sID; self.createSound(oOptions)}else{ return false} } self.sounds[sID].play(oOptions)} this.start=this.play; this.setPosition=function(sID,nMsecOffset){ if(!self._idCheck(sID))return false; self.sounds[sID].setPosition(nMsecOffset)} this.stop=function(sID){ if(!self._idCheck(sID))return false; self._writeDebug('soundManager.stop('+sID+')',1); self.sounds[sID].stop()} this.stopAll=function(){ self._writeDebug('soundManager.stopAll()',1); for(var oSound in self.sounds){ if(self.sounds[oSound]instanceof SMSound)self.sounds[oSound].stop()} } this.pause=function(sID){ if(!self._idCheck(sID))return false; self.sounds[sID].pause()} this.resume=function(sID){ if(!self._idCheck(sID))return false; self.sounds[sID].resume()} this.togglePause=function(sID){ if(!self._idCheck(sID))return false; self.sounds[sID].togglePause()} this.setPan=function(sID,nPan){ if(!self._idCheck(sID))return false; self.sounds[sID].setPan(nPan)} this.setVolume=function(sID,nVol){ if(!self._idCheck(sID))return false; self.sounds[sID].setVolume(nVol)} this.setPolling=function(bPolling){ if(!self.o||!self.allowPolling)return false; self._writeDebug('soundManager.setPolling('+bPolling+')'); self.o._setPolling(bPolling)} this.disable=function(){ if(self._disabled)return false; self._disabled=true; self._writeDebug('soundManager.disable(): Disabling all functions - future calls will return false.',1); for(var i=self.soundIDs.length;i--;){ self._disableObject(self.sounds[self.soundIDs[i]])} self.initComplete();self._disableObject(self)} this.getSoundById=function(sID,suppressDebug){ if(!sID)throw new Error('SoundManager.getSoundById(): sID is null/undefined'); var result=self.sounds[sID]; if(!result&&!suppressDebug){ self._writeDebug('"'+sID+'" is an invalid sound ID.',2)} return result} this.onload=function(){ soundManager._writeDebug('Warning: soundManager.onload() is undefined.',2)} this.onerror=function(){ } this._idCheck=this.getSoundById; this._disableObject=function(o){ for(var oProp in o){ if(typeof o[oProp]=='function'&&typeof o[oProp]._protected=='undefined')o[oProp]=function(){return false} } oProp=null} this._failSafely=function(){ var flashCPLink='http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html'; var fpgssTitle='You may need to whitelist this location/domain eg. file:///C:/ or C:/ or mysite.com, or set ALWAYS ALLOW under the Flash Player Global Security Settings page. Note that this seems to apply only to file system viewing.'; var flashCPL='view/edit'; var FPGSS='FPGSS'; if(!self._disabled){ self._writeDebug('soundManager: JS->Flash communication failed. Possible causes: flash/browser security restrictions ('+flashCPL+'), insufficient browser/plugin support, or .swf not found',2); self._writeDebug('Verify that the movie path of '+self.url+' is correct (test link)',1); if(self._didAppend){ if(!document.domain){ self._writeDebug('Loading from local file system? (document.domain appears to be null, this URL path may need to be added to \'trusted locations\' in '+FPGSS+')',1); self._writeDebug('Possible security/domain restrictions ('+flashCPL+'), should work when served by http on same domain',1)} } self.disable()} } this._createMovie=function(smID,smURL){ if(self._didAppend&&self._appendSuccess)return false;if(window.location.href.indexOf('debug=1')+1)self.debugMode=true;self._didAppend=true; var html=['','']; var toggleElement='
-
'; var debugHTML='
'; var appXHTML='soundManager._createMovie(): appendChild/innerHTML set failed. Serving application/xhtml+xml MIME type? Browser may be enforcing strict rules, not allowing write to innerHTML. (PS: If so, this means your commitment to XML validation is going to break stuff now, because this part isn\'t finished yet. ;))'; var sHTML='
'+html[self.isIE?0:1]+'
'+(self.debugMode&&((!self._hasConsole||!self.useConsole)||(self.useConsole&&self._hasConsole&&!self.consoleOnly))&&!document.getElementById(self.debugID)?'x'+debugHTML+toggleElement:''); var oTarget=(document.body?document.body:document.getElementsByTagName('div')[0]); if(oTarget){ self.oMC=document.createElement('div'); self.oMC.className='movieContainer'; self.oMC.style.position='absolute'; self.oMC.style.left='-256px'; self.oMC.style.width='1px'; self.oMC.style.height='1px'; try{ oTarget.appendChild(self.oMC); self.oMC.innerHTML=html[self.isIE?0:1]; self._appendSuccess=true}catch(e){ throw new Error(appXHTML)} if(!document.getElementById(self.debugID)&&((!self._hasConsole||!self.useConsole)||(self.useConsole&&self._hasConsole&&!self.consoleOnly))){ var oDebug=document.createElement('div'); oDebug.id=self.debugID; oDebug.style.display=(self.debugMode?'block':'none'); if(self.debugMode){ try{ var oD=document.createElement('div'); oTarget.appendChild(oD); oD.innerHTML=toggleElement}catch(e){ throw new Error(appXHTML)} } oTarget.appendChild(oDebug)} oTarget=null} self._writeDebug('-- SoundManager 2 Version '+self.version.substr(1)+' --',1); self._writeDebug('soundManager._createMovie(): trying to load '+smURL+'',1)} this._writeDebug=function(sText,sType){ if(!self.debugMode)return false; if(self._hasConsole&&self.useConsole){ console[self._debugLevels[sType]||'log'](sText);if(self.useConsoleOnly)return true} var sDID='soundmanager-debug'; try{ var o=document.getElementById(sDID); if(!o)return false; var p=document.createElement('div'); p.innerHTML=sText; o.insertBefore(p,o.firstChild)}catch(e){ } o=null} this._writeDebug._protected=true; this._writeDebugAlert=function(sText){alert(sText)} if(window.location.href.indexOf('debug=alert')+1){ self.debugMode=true; self._writeDebug=self._writeDebugAlert} this._toggleDebug=function(){ var o=document.getElementById(self.debugID); var oT=document.getElementById(self.debugID+'-toggle'); if(!o)return false; if(self._debugOpen){ oT.innerHTML='+'; o.style.display='none'}else{ oT.innerHTML='-'; o.style.display='block'} self._debugOpen=!self._debugOpen} this._toggleDebug._protected=true; this._debug=function(){ self._writeDebug('soundManager._debug(): sounds by id/url:',0); for(var i=0,j=self.soundIDs.length;itest URL]')); self.loaded=bSuccess; self.loadSuccess=bSuccess; self.readyState=bSuccess?3:2; if(self.options.onload)self.options.onload.apply(self)} this._onbeforefinish=function(){ if(!self.didBeforeFinish){ self.didBeforeFinish=true; if(self.options.onbeforefinish)self.options.onbeforefinish.apply(self)} } this._onjustbeforefinish=function(msOffset){ if(!self.didJustBeforeFinish){ self.didJustBeforeFinish=true; if(self.options.onjustbeforefinish)self.options.onjustbeforefinish.apply(self)} } this._onfinish=function(){ sm._writeDebug('SMSound._onfinish(): "'+self.sID+'"'); self.playState=0; self.paused=false; if(self.options.onfinish)self.options.onfinish.apply(self); if(self.options.onbeforefinishcomplete)self.options.onbeforefinishcomplete.apply(self); self.setPosition(0); self.didBeforeFinish=false; self.didJustBeforeFinish=false} } var soundManager=new SoundManager(); if(window.addEventListener){ window.addEventListener('load',soundManager.beginDelayedInit,false); window.addEventListener('beforeunload',soundManager.destruct,false)}else if(window.attachEvent){ window.attachEvent('onload',soundManager.beginInit); window.attachEvent('beforeunload',soundManager.destruct)}else{ soundManager.onerror(); soundManager.disable()} /* ../plugins/gestion_medias/Lecteur_multimedia/javascript/jscroller.js */ ; jQuery(document).ready(function(){ this.defaults={ scroller:{ interval:0, refresh:300,direction:"left",speed:2, id:"#scroller", cont_id:"#scroller_container", height:30, width:160, min_height:15, min_width:80 } } var config=jQuery.extend(this.defaults); var scroller=jQuery(config.scroller.id); var scroller_cont=jQuery(config.scroller.cont_id); detectSizes(); scroller_init(); function startScroll(){ if(!config.scroller.interval){ config.scroller.interval=setInterval(doScroll,config.scroller.refresh)} } function stopScroll(){ window.clearInterval(config.scroller.interval); config.scroller.interval=0} function detectSizes(){ config.scroller.width=((scroller.width())||config.scroller.width); config.scroller.height=((scroller.height())||config.scroller.height); config.scroller.min_height=((scroller_cont.height())||config.scroller.min_height); config.scroller.min_width=((scroller_cont.width())||config.scroller.min_width)} function scroller_init(){ jQuery("#scroller a").click(function(){ window.open(this.href); return false}); scroller_cont.css('overflow','hidden'); if(!config.scroller.interval){ window.onfocus=startScroll; startScroll(); if(jQuery.browser.msie&&!config.scroller.interval){window.focus} } } function doScroll(){ var p_top=Number((/[0-9-,.]+/.exec(scroller.css('top'))||0)), p_left=Number((/[0-9-,.]+/.exec(scroller.css('left'))||0)); switch(config.scroller.direction){ case'up': if(p_top<=-1*config.scroller.height){p_top=config.scroller.min_height} scroller.css('top',p_top-config.scroller.speed+'px'); break; case'right': if(p_left>=config.scroller.min_width){p_left=-1*config.scroller.width} scroller.css('left',p_left+config.scroller.speed+'px'); break; case'left': if(p_left<=-1*config.scroller.width){p_left=config.scroller.min_width} scroller.css('left',p_left-config.scroller.speed+'px'); break; case'down': if(p_top>=config.scroller.min_height){p_top=-1*config.scroller.height} scroller.css('top',p_top+config.scroller.speed+'px'); break} } }); /* ../plugins/gestion_medias/Lecteur_multimedia/player_enclosure.js */ ; var track_index=0; live_track='stop'; live_video='stop'; isVideoPlaying=false; videoPause=false; isPlaying=false; soundManager.consoleOnly=true; soundManager.debugMode=false; var seljQ='@'; if(jQuery.fn.jquery>="1.3.0") seljQ=''; jQuery(document).ready(function(){ lecteur_multimedia_init()}); function lecteur_multimedia_init(){ mp3Array=new Array(); mp3Titles=new Array(); flvArray=new Array(); flvTitles=new Array(); var aff=jQuery("a["+seljQ+"rel='enclosure']["+seljQ+"href$=mp3]").size(); jQuery("a["+seljQ+"rel='enclosure']["+seljQ+"href$=mp3]").each( function(i){ mp3Array.push(this.href); mp3Titles.push(jQuery(this).html()); jQuery(this).click( function(e){ e.preventDefault(); player_play(i); jQuery("#bouton_play").attr('src',DIR_PLUGIN_PLAYER+'skins/blogo/pause.png')} ); if(jQuery(this).parent().attr("class")) if(jQuery(this).parent().attr("class").split(" ").contains("play_")) jQuery(this).parent().click( function(e){ player_play(i); jQuery("#bouton_play").attr('src',DIR_PLUGIN_PLAYER+'skins/blogo/pause.png')} ); jQuery(this).before(' ')} ); jQuery("a["+seljQ+"rel='video']").each( function(i){ flvArray.push(this.href); flvTitles.push(jQuery(this).html()); jQuery(this).click( function(e){ e.preventDefault(); video_play(i)} )} ); jQuery(".playliste").find("span").remove(); jQuery(".playliste li").hover(function(){ jQuery(this).addClass("over")},function(){ jQuery(this).removeClass("over")}); jQuery("span.play_").each( function(i){ jQuery(this).toggle( function(e){ if(live_track!=='stop'){ player_stop()}else{ player_play(i); jQuery(this).html("").addClass("play_on")} },function(e){ player_stop()} )} ); jQuery('#bouton_play').click(function(e){ if(!isPlaying){ jQuery(this).attr('src',DIR_PLUGIN_PLAYER+'skins/blogo/pause.png'); if(live_track=='stop'){ player_play(0)}else{ player_togglePause()} }else{ jQuery(this).attr('src',DIR_PLUGIN_PLAYER+'skins/blogo/play.png'); player_togglePause()} }); jQuery("#scrollbar").click(function(e){ var x=Math.round((e.pageX-this.offsetLeft)/jQuery(this).width()*100); if(live_track!=='stop'){ var mySound=soundManager.getSoundById('son_'+track_index); var newposition=Math.round(mySound.durationEstimate*x/100); soundManager.setPosition('son_'+track_index,newposition)} if(isVideoPlaying){ var position=Math.round(myListener.duration*x/100); getFlashObject().SetVariable("method:setPosition",position)} }); jQuery("#now_playing").change(function(){ scroller_init()}); if(key_espace_stop){ jQuery(document).keypress(function(e) { key=(e.charCode)?e.charCode:e.keyCode; if( (key==32)||(key==27)){ if(isPlaying){ player_togglePause()} if(isVideoPlaying){ } } })} } function player_play(i){ player_stop(); jQuery("#bouton_play").attr('src',DIR_PLUGIN_PLAYER+'skins/blogo/pause.png'); track_index=i; live_track=i; jQuery("span.play_:eq("+i+")").html("").addClass("play_on"); jQuery(".play_:eq("+i+")").addClass("play_on"); if(soundManager.url!='undefined'){ player_creer_son(i); file1=mp3Titles[track_index]; file1=file1.replace(/(%20)/g,' '); file1=file1.substr(0,90); file1=file1.replace(/(.mp3)/g,' '); file1=file1.replace(/(_|-)/g,' '); var taille=file1.length; $large_s='auto'; jQuery("#now_playing").width($large_s); jQuery("#scroller").width($large_s); jQuery("#now_playing").html(file1); var taille=jQuery("#scroller").width(); var min_taille=jQuery("#scroller_container").width(); jQuery.extend({scroller:{ interval:0, refresh:300,direction:"left",speed:2, id:"#scroller", cont_id:"#scroller_container", height:30, width:taille, min_height:15, min_width:min_taille }}); jQuery("#scroller").css("left",min_taille-taille); soundManager.play('son_'+i,{volume:100}); isPlaying=true}else{ var playa=''; playa='
'+ '
'; jQuery('body').append(playa); jQuery('div#musicplayer').css({position:"fixed",top:"10px",right:"10px",width:"0",height:"0"}); playlist=''; deb=0; for(j=i;j0){ playlist=playlist+'|'+mp3Array[j]}else{ playlist=mp3Array[j]; deb=1} } jQuery("#musicplayer").html(''+ ''+ ''+ ''+ '')} } function player_creer_son(i){ soundManager.createSound({ id:'son_'+i,url:mp3Array[i], onfinish:function(){ player_play(i+1) }, onid3:function(){ }, onload:function(){ }, whileloading:function(){ var timer=this.bytesLoaded/this.bytesTotal*100; var minutes=Math.floor(this.durationEstimate/1000/60); var secondes=Math.floor((this.durationEstimate-minutes*1000*60)/1000); jQuery(".duration").html(minutes+"'"+secondes+"''"); jQuery("#loading").css({width:Math.round(timer)+"%"})},onplay:function(){ jQuery("#loading").css("cursor","hand"); var minutes=Math.floor(this.durationEstimate/1000/60); var secondes=Math.floor((this.durationEstimate-minutes*1000*60)/1000); jQuery(".duration").html(minutes+"'"+secondes+"''")},whileplaying:function(){ var minutes=Math.floor(this.position/1000/60); var secondes=Math.floor((this.position-minutes*1000*60)/1000); var timer2=this.position/this.durationEstimate*100; jQuery("#position").css({width:Math.round(timer2)+"%"}); jQuery(".position").html(minutes+"'"+secondes+"''")},'volume':100 })} function player_stop(){ isPlaying=false; jQuery("span.play_on").html(''); jQuery("span.play_on").removeClass("play_on"); live_track='stop'; jQuery(".playliste li.play_on").removeClass("play_on"); reset_boutons(); soundManager.destroySound("son_"+track_index); soundManager.stopAll(); jQuery("#musicplayer").html(''); jQuery("#now_playing").html('')} function unLoad(i){ soundManager.unload(i)} function player_next(){ unLoad("son_"+track_index); track_index++; player_play(track_index)} function player_prev(){ unLoad("son_"+track_index); track_index--; player_play(track_index)} function player_togglePause(){ soundManager.togglePause('son_'+live_track); if(isPlaying==true){ isPlaying=false}else{ isPlaying=true} } function reset_boutons(){ jQuery("#bouton_play").attr('src',DIR_PLUGIN_PLAYER+'skins/blogo/play.png'); jQuery(".position").html("0'00''"); jQuery("#position,#loading").width(0)} function Player_init(url_player){ soundManager.onload=function(){ soundManager.createSound('aDrumSound',url_player)} } Array.prototype.contains=function(ele){ for(var i=0;ilive_track = "+live_track)}; /* ../plugins/publication/porte_plume/javascript/xregexp-min.js */ ; var XRegExp;if(!XRegExp){(function(){XRegExp=function(r,l){if(XRegExp.isRegExp(r)){if(l!==undefined){throw TypeError("can't supply flags when constructing one RegExp from another")}return r.addFlags("")}if(h){throw Error("can't call the XRegExp constructor within token definition functions")}var l=l||"",k=[],s=0,p=XRegExp.OUTSIDE_CLASS,m={hasNamedCapture:false,captureNames:[],hasFlag:function(u){if(u.length>1){throw SyntaxError("flag can't be more than one character")}return l.indexOf(u)>-1}},n,q,o,t;while(s1&&XRegExp._indexOf(m,"")>-1){k=RegExp("^"+this.source+"$(?!\\s)",XRegExp._getNativeFlags(this));i.replace.call(m[0],k,function(){for(var p=1;p(m.index+m[0].length)){this.lastIndex--}}return m};if(!c){RegExp.prototype.test=function(l){var k=i.exec.call(this,l);if(k&&this.global&&this.lastIndex>(k.index+k[0].length)){this.lastIndex--}return!!k}}String.prototype.match=function(l){if(!XRegExp.isRegExp(l)){l=RegExp(l)}if(l.global){var k=i.match.apply(this,arguments);l.lastIndex=0;return k}return l.exec(this)};String.prototype.replace=function(m,n){var o=XRegExp.isRegExp(m),l,k,p;if(o&&typeof n.valueOf()==="string"&&n.indexOf("${")===-1&&d){return i.replace.apply(this,arguments)}if(!o){m=m+""}else{if(m._xregexp){l=m._xregexp.captureNames}}if(typeof n==="function"){k=i.replace.call(this,m,function(){if(l){arguments[0]=new String(arguments[0]);for(var q=0;qq.length-3){t=String.prototype.slice.call(r,-1)+t;r=Math.floor(r/10)}return(r?q[r]||"":"$")+t}}else{var u=+v;if(u<=q.length-3){return q[u]}u=l?XRegExp._indexOf(l,v):-1;return u>-1?q[u+1]:s}})})}if(o&&m.global){m.lastIndex=0}return k};String.prototype.split=function(o,k){if(!XRegExp.isRegExp(o)){return i.split.apply(this,arguments)}var q=this+"",m=[],p=0,n,l;if(k===undefined||+k<0){k=Infinity}else{k=Math.floor(+k);if(!k){return[]}}o=o.addFlags("g");while(n=o.exec(q)){if(o.lastIndex>p){m.push(q.slice(p,n.index));if(n.length>1&&n.index=k){break}}if(!n[0].length){o.lastIndex++}}if(p===q.length){if(!i.test.call(o,"")||l){m.push("")}}else{m.push(q.slice(p))}return m.length>k?m.slice(0,k):m}})();RegExp.prototype.addFlags=function(b){var c=XRegExp(this.source,(b||"")+XRegExp._getNativeFlags(this)),a=this._xregexp;if(a){c._xregexp={source:a.source,captureNames:a.captureNames?a.captureNames.slice(0):null}}return c};RegExp.prototype.apply=function(b,a){return this.exec(a[0])};RegExp.prototype.call=function(a,b){return this.exec(b)};RegExp.prototype.forEachExec=function(e,f,c){var d=this.addFlags("g"),b=-1,a;while(a=d.exec(e)){f.call(c,a,++b,e,d);if(!a[0].length){d.lastIndex++}}if(this.global){this.lastIndex=0}};RegExp.prototype.validate=function(b){var a=RegExp("^(?:"+this.source+")$(?!\\s)",XRegExp._getNativeFlags(this));if(this.global){this.lastIndex=0}return b.search(a)===0};XRegExp.cache=function(c,a){var b="/"+c+"/"+(a||"");return XRegExp.cache[b]||(XRegExp.cache[b]=XRegExp(c,a))};XRegExp.escape=function(a){return a.replace(/[-[\]{}()*+?.\\^$|,#\s]/g,"\\$&")};XRegExp.freezeTokens=function(){XRegExp.addToken=null};XRegExp.isRegExp=function(a){return Object.prototype.toString.call(a)==="[object RegExp]"};XRegExp.matchWithinChain=function(e,a,b){var c;function d(g,l){var j=a[l].addFlags("g"),f=[],k,h;for(h=0;h/,function(b){this.captureNames.push(b[1]);this.hasNamedCapture=true;return"("});XRegExp.addToken(/\\k<([\w$]+)>/,function(c){var b=XRegExp._indexOf(this.captureNames,c[1]);return b>-1?"\\"+(b+1)+(isNaN(c.input.charAt(c.index+c[0].length))?"":"(?:)"):c[0]});XRegExp.addToken(/\[\^?]/,function(b){return b[0]==="[]"?"\\b\\B":"[\\s\\S]"});XRegExp.addToken(/(?:\s+|#.*)+/,function(b){return a.test(b.input.slice(b.index+b[0].length))?"":"(?:)"},XRegExp.OUTSIDE_CLASS,function(){return this.hasFlag("x")});XRegExp.addToken(/\./,function(){return"[\\s\\S]"},XRegExp.OUTSIDE_CLASS,function(){return this.hasFlag("s")})})();XRegExp.version="1.2.0"}; /* ../plugins/publication/porte_plume/javascript/jquery.markitup_pour_spip.js */ ; ;(function($){ $.fn.markItUp=function(settings,extraSettings){ var options,ctrlKey,shiftKey,altKey; ctrlKey=shiftKey=altKey=false; options={id:'', nameSpace:'', root:'', lang:'', previewInWindow:'',previewAutoRefresh:true, previewPosition:'after', previewTemplatePath:'~/templates/preview.html', previewParserPath:'', previewParserVar:'data', resizeHandle:true, beforeInsert:'', afterInsert:'', onEnter:{}, onShiftEnter:{}, onCtrlEnter:{}, onTab:{}, markupSet:[{}] }; $.extend(options,settings,extraSettings); if(!options.root){ $('script').each(function(a,tag){ miuScript=$(tag).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/); if(miuScript!==null){ options.root=miuScript[1]} })} return this.each(function(){ var $$,textarea,levels,scrollPosition,caretPosition,caretEffectivePosition, clicked,hash,header,footer,previewWindow,template,iFrame,abort, before,after; $$=$(this); textarea=this; levels=[]; abort=false; scrollPosition=caretPosition=0; options.previewParserPath=localize(options.previewParserPath); options.previewTemplatePath=localize(options.previewTemplatePath); function localize(data,inText){ if(inText){ return data.replace(/("|')~\//g,"$1"+options.root)} return data.replace(/^~\//,options.root)} function init(){ id='';nameSpace=''; if(options.id){ id='id="'+options.id+'"'}else if($$.attr("id")){ id='id="markItUp'+($$.attr("id").substr(0,1).toUpperCase())+($$.attr("id").substr(1))+'"'} if(options.nameSpace){ nameSpace='class="'+options.nameSpace+'"'} $$.wrap('
'); $$.wrap('
'); $$.wrap('
'); $$.addClass("markItUpEditor"); header=$('
').insertBefore($$); $(dropMenus(options.markupSet)).appendTo(header); $(header).find("li.markItUpDropMenu ul:empty").parent().remove(); footer=$('
').insertAfter($$); if(options.resizeHandle===true&&$.browser.safari!==true){ resizeHandle=$('
') .insertAfter($$) .bind("mousedown",function(e){ var h=$$.height(),y=e.clientY,mouseMove,mouseUp; mouseMove=function(e){ $$.css("height",Math.max(20,e.clientY+h-y)+"px"); return false}; mouseUp=function(e){ $("html").unbind("mousemove",mouseMove).unbind("mouseup",mouseUp); return false}; $("html").bind("mousemove",mouseMove).bind("mouseup",mouseUp)}); footer.append(resizeHandle)} $$.keydown(keyPressed).keyup(keyPressed); $$.bind("insertion",function(e,settings){ if(settings.target!==false){ get()} if(textarea===$.markItUp.focused){ markup(settings)} }); $$.focus(function(){ $.markItUp.focused=this})} function dropMenus(markupSet){ var ul=$('
    '),i=0; var lang=($$.attr('lang')||options.lang); $('li:hover > ul',ul).css('display','block'); $.each(markupSet,function(){ var button=this,t='',title,li,j; if((!lang||!button.lang||($.inArray(lang,button.lang)!=-1)) &&(!button.lang_not||($.inArray(lang,button.lang_not)==-1))){ title=(button.key)?(button.name||'')+' [Ctrl+'+button.key+']':(button.name||''); key=(button.key)?'accesskey="'+button.key+'"':''; if(button.separator){ li=$('
  • '+(button.separator||'')+'
  • ').appendTo(ul)}else{ i++; for(j=levels.length-1;j>=0;j--){ t+=levels[j]+"-"} li=$('
  • '+(button.name||'')+'
  • ') .bind("contextmenu",function(){return false}).click(function(){ return false}).focusin(function(){ $$.focus()}).mousedown(function(){ if(button.call){ eval(button.call)()} setTimeout(function(){markup(button)},1); return false}).hover(function(){ $('> ul',this).show(); $(document).one('click',function(){$('ul ul',header).hide()} )},function(){ $('> ul',this).hide()} ).appendTo(ul); if(button.dropMenu){ levels.push(i); $(li).addClass('markItUpDropMenu').append(dropMenus(button.dropMenu))} } } }); levels.pop(); return ul} function magicMarkups(string){ if(string){ string=string.toString(); string=string.replace(/\(\!\(([\s\S]*?)\)\!\)/g, function(x,a){ var b=a.split('|!|'); if(altKey===true){ return(b[1]!==undefined)?b[1]:b[0]}else{ return(b[1]===undefined)?"":b[0]} } ); string=string.replace(/\[\!\[([\s\S]*?)\]\!\]/g, function(x,a){ var b=a.split(':!:'); if(abort===true){ return false} value=prompt(b[0],(b[1])?b[1]:''); if(value===null){ abort=true} return value} ); return string} return""} function prepare(action){ if($.isFunction(action)){ action=action(hash)} return magicMarkups(action)} function build(string){ openWith=prepare(clicked.openWith); placeHolder=prepare(clicked.placeHolder); replaceWith=prepare(clicked.replaceWith); closeWith=prepare(clicked.closeWith); if(replaceWith!==""){ block=openWith+replaceWith+closeWith}else if(selection===''&&placeHolder!==''){ block=openWith+placeHolder+closeWith}else{ block=openWith+(string||selection)+closeWith} return{block:block, openWith:openWith, replaceWith:replaceWith, placeHolder:placeHolder, closeWith:closeWith }} function selectWord(){ selectionBeforeAfter(/\s|[.,;:!¡?¿()]/); selectionSave()} function selectLine(){ selectionBeforeAfter(/\r?\n/); selectionSave()} function selectionRemoveLast(pattern){ if(!pattern)pattern=/\s/; last=selection[selection.length-1]; if(last&&last.match(pattern)){ set(caretPosition,selection.length-1); get(); $.extend(hash,{caretPosition:caretPosition,scrollPosition:scrollPosition})} } function selectionBeforeAfter(pattern){ if(!pattern)pattern=/\s/; before=textarea.value.substring(0,caretEffectivePosition); after=textarea.value.substring(caretEffectivePosition+selection.length-fixIeBug(selection)); before=before.split(pattern); after=after.split(pattern)} function selectionSave(){ nb_before=before?before[before.length-1].length:0; nb_after=after?after[0].length:0; nb=nb_before+selection.length+nb_after-fixIeBug(selection); caretPosition=caretPosition-nb_before; set(caretPosition,nb); get(); $.extend(hash,{selection:selection,caretPosition:caretPosition,scrollPosition:scrollPosition})} function markup(button){ var len,j,n,i; hash=clicked=button; get(); $.extend(hash,{line:"", root:options.root, textarea:textarea, selection:(selection||''), caretPosition:caretPosition, ctrlKey:ctrlKey, shiftKey:shiftKey, altKey:altKey } ); if(button.selectionType){ if(button.selectionType=="word"){ if(!selection){ selectWord()}else{ selectionRemoveLast(/\s/)} } if(button.selectionType=="line"){ selectLine()} if(button.selectionType=="return"){ selectionBeforeAfter(/\r?\n/); before_last=before[before.length-1]; after=''; if(r=before_last.match(/^-([*#]+) ?(.*)$/)){ if(r[2]){ button.replaceWith="\n-"+r[1]+' '; before_last=''}else{ button.replaceWith="\n"} }else{ before_last=''; button.replaceWith="\n"} before[before.length-1]=before_last; selectionSave()} } prepare(options.beforeInsert); prepare(clicked.beforeInsert); if(ctrlKey===true&&shiftKey===true){ prepare(clicked.beforeMultiInsert)} $.extend(hash,{line:1}); if((button.forceMultiline===true&&selection.length) ||(ctrlKey===true&&shiftKey===true)){ lines=selection.split(/\r?\n/); for(j=0,n=lines.length,i=0;i'); if(options.previewPosition=='after'){ iFrame.insertAfter(footer)}else{ iFrame.insertBefore(header)} previewWindow=iFrame[iFrame.length-1].contentWindow||frame[iFrame.length-1]} }else if(altKey===true){ if(iFrame){ iFrame.remove()}else{ previewWindow.close()} previewWindow=iFrame=false} if(!options.previewAutoRefresh){ refreshPreview()} if(options.previewInWindow){ previewWindow.focus()} } function refreshPreview(){ renderPreview()} function renderPreview(){ var phtml; if(options.previewParserPath!==''){ $.ajax({ type:'POST', url:options.previewParserPath, data:options.previewParserVar+'='+encodeURIComponent($$.val()), success:function(data){ writeInPreview(localize(data,1))} })}else{ if(!template){ $.ajax({ url:options.previewTemplatePath, success:function(data){ writeInPreview(localize(data,1).replace(//g,$$.val()))} })} } return false} function writeInPreview(data){ if(previewWindow.document){ try{ sp=previewWindow.document.documentElement.scrollTop }catch(e){ sp=0} previewWindow.document.open(); previewWindow.document.write(data); previewWindow.document.close(); previewWindow.document.documentElement.scrollTop=sp} } function keyPressed(e){ if(e.type==='keydown'){ if(e.which===18){e.altKey=true}if(e.which===17){e.ctrlKey=true}if(e.which===16){e.shiftKey=true}} shiftKey=e.shiftKey; altKey=e.altKey; ctrlKey=(!(e.altKey&&e.ctrlKey))?e.ctrlKey:false; if(e.type==='keydown'){ if(ctrlKey===true){ li=$("a[accesskey="+String.fromCharCode(e.which)+"]",header).parent('li'); if(li.length!==0){ ctrlKey=false; setTimeout(function(){ li.triggerHandler('mousedown')},1); return false} } if(!$.browser.opera){ if(e.which===13||e.which===10){if(ctrlKey===true){ctrlKey=false; markup(options.onCtrlEnter); return options.onCtrlEnter.keepDefault}else if(shiftKey===true){shiftKey=false; markup(options.onShiftEnter); return options.onShiftEnter.keepDefault}else{markup(options.onEnter); return options.onEnter.keepDefault} } if(e.which===9){if(shiftKey==true||ctrlKey==true||altKey==true){ return false} markup(options.onTab); return options.onTab.keepDefault} } } } init()})}; $.fn.markItUpRemove=function(){ return this.each(function(){ var $$=$(this).unbind().removeClass('markItUpEditor'); $$.parent('div').parent('div.markItUp').parent('div').replaceWith($$)} )}; $.markItUp=function(settings){ var options={target:false}; $.extend(options,settings); if(options.target){ return $(options.target).each(function(){ $(this).focus(); $(this).trigger('insertion',[options])})}else{ $('textarea').trigger('insertion',[options])} }})(jQuery); /* ../plugins/publication/porte_plume/javascript/jquery.previsu_spip.js */ ; ;(function($){ $.fn.previsu_spip=function(settings){ var options; options={ previewParserPath:'', previewParserVar:'data', textEditer:'Editer', textVoir:'Voir' }; $.extend(options,settings); return this.each(function(){ var $$,textarea,tabs,preview; $$=$(this); textarea=this; function init(){ $$.addClass("pp_previsualisation"); tabs=$('
    ').prependTo($$.parent()); $(tabs).append( ''+options.textVoir+''+ ''+options.textEditer+'' ); preview=$('
    ').insertAfter(tabs); preview.hide(); $('.previsuVoir').click(function(){ mark=$(this).parent().parent(); objet=mark.parents('.formulaire_spip')[0].className.match(/formulaire_editer_(\w+)/); champ=mark.parents('li')[0].className.match(/editer_(\w+)/); $(mark).find('.markItUpPreview').height( $(mark).find('.markItUpHeader').height() +$(mark).find('.markItUpEditor').height() +$(mark).find('.markItUpFooter').height() ); $(mark).find('.markItUpHeader').hide(); $(mark).find('.markItUpEditor').hide(); $(mark).find('.markItUpFooter').hide(); $(this).addClass('on').next().removeClass('on'); $(mark).find('.markItUpPreview').show() .addClass('ajaxLoad') .html(renderPreview( $(mark).find('textarea.pp_previsualisation').val(), champ[1].toUpperCase(), objet[1]) ) .removeClass('ajaxLoad'); return false}); $('.previsuEditer').click(function(){ mark=$(this).parent().parent(); $(mark).find('.markItUpPreview').hide(); $(mark).find('.markItUpHeader').show(); $(mark).find('.markItUpEditor').show(); $(mark).find('.markItUpFooter').show(); $(this).addClass('on').prev().removeClass('on'); return false})} function renderPreview(val,champ,objet){ var phtml; if(options.previewParserPath!==''){ $.ajax({ type:'POST', async:false, url:options.previewParserPath, data:'champ='+champ +'&objet='+objet +'&'+options.previewParserVar+'='+encodeURIComponent(val), success:function(data){ phtml=data} })} return phtml} init()})}})(jQuery); /* page=porte_plume_start.js(lang=fr) */ ; barre_outils_edition={"nameSpace":"edition","previewAutoRefresh":false,"onEnter":{"keepDefault":false,"selectionType":"return","replaceWith":"\n"} ,"onShiftEnter":{"keepDefault":false,"replaceWith":"\n_ "} ,"onCtrlEnter":{"keepDefault":false,"replaceWith":"\n\n"} ,"markupSet":[{"name":"Transformer en {{{intertitre}}}","key":"H","className":"outil_header1","openWith":"\n{{{","closeWith":"}}}\n","selectionType":"line"} ,{"name":"Mettre en {{gras}}","key":"B","className":"outil_bold","replaceWith":function(h){return espace_si_accolade(h,'{{','}}')},"selectionType":"word"} ,{"name":"Mettre en {italique}","key":"I","className":"outil_italic","replaceWith":function(h){return espace_si_accolade(h,'{','}')},"selectionType":"word"} ,{"name":"Mettre en liste","className":"outil_liste_ul","replaceWith":function(h){return outil_liste(h,'*')},"selectionType":"line","forceMultiline":true,"dropMenu":[{"id":"liste_ol","name":"Mettre en liste numérotée","className":"outil_liste_ol","replaceWith":function(h){return outil_liste(h,'#')},"display":true,"selectionType":"line","forceMultiline":true} ,{"id":"desindenter","name":"Désindenter une liste","className":"outil_desindenter","replaceWith":function(h){return outil_desindenter(h)},"display":true,"selectionType":"line","forceMultiline":true} ,{"id":"indenter","name":"Indenter une liste","className":"outil_indenter","replaceWith":function(h){return outil_indenter(h)},"display":true,"selectionType":"line","forceMultiline":true} ] } ,{"separator":"---------------"} ,{"name":"Transformer en [lien hypertexte->http://...]","key":"L","className":"outil_link","openWith":"[","closeWith":"->[![Veuillez indiquer l'adresse de votre lien (vous pouvez indiquer une adresse Internet sous la forme http://www.monsite.com, une adresse courriel, ou simplement indiquer le numéro d'un article de ce site.]!]]"} ,{"name":"Transformer en [[Note de bas de page]]","className":"outil_notes","openWith":"[[","closeWith":"]]","selectionType":"word"} ,{"separator":"---------------"} ,{"name":"Citer un message","key":"Q","className":"outil_quote","openWith":"\n","closeWith":"\n","selectionType":"word"} ,{"name":"Entourer de « guillemets »","className":"outil_guillemets","openWith":"«","closeWith":"»","lang":["fr","eo","cpf","ar","es"] ,"selectionType":"word"} ,{"name":"Entourer de “guillemets de second niveau”","className":"outil_guillemets_simples","openWith":"“","closeWith":"”","lang":["fr","eo","cpf","ar","es"] ,"selectionType":"word"} ,{"name":"Entourer de « guillemets »","className":"outil_guillemets_de","openWith":"„","closeWith":"“","lang":["bg","de","pl","hr","src"] ,"selectionType":"word"} ,{"name":"Entourer de “guillemets de second niveau”","className":"outil_guillemets_de_simples","openWith":"‚","closeWith":"‘","lang":["bg","de","pl","hr","src"] ,"selectionType":"word"} ,{"name":"Entourer de « guillemets »","className":"outil_guillemets_simples","openWith":"“","closeWith":"”","lang_not":["fr","eo","cpf","ar","es","bg","de","pl","hr","src"] ,"selectionType":"word"} ,{"name":"Entourer de “guillemets de second niveau”","className":"outil_guillemets_uniques","openWith":"‘","closeWith":"’","lang_not":["fr","eo","cpf","ar","es","bg","de","pl","hr","src"] ,"selectionType":"word"} ,{"separator":"---------------"} ,{"name":"Insérer des caractères spécifiques","className":"outil_caracteres","dropMenu":[{"id":"A_grave","name":"Insérer un A accent grave majuscule","className":"outil_a_maj_grave","replaceWith":"À","display":true,"lang":["fr","eo","cpf"] } ,{"id":"E_aigu","name":"Insérer un E accent aigu majuscule","className":"outil_e_maj_aigu","replaceWith":"É","display":true,"lang":["fr","eo","cpf"] } ,{"id":"E_grave","name":"Insérer un E majuscule accent grave","className":"outil_e_maj_grave","replaceWith":"È","display":true,"lang":["fr","eo","cpf"] } ,{"id":"aelig","name":"Insérer un E dans l'A","className":"outil_aelig","replaceWith":"æ","display":true,"lang":["fr","eo","cpf"] } ,{"id":"AElig","name":"Insérer un E dans l'A majuscule","className":"outil_aelig_maj","replaceWith":"Æ","display":true,"lang":["fr","eo","cpf"] } ,{"id":"oe","name":"Insérer un E dans l'O","className":"outil_oe","replaceWith":"œ","display":true,"lang":["fr"] } ,{"id":"OE","name":"Insérer un E dans l'O majuscule","className":"outil_oe_maj","replaceWith":"Œ","display":true,"lang":["fr"] } ,{"id":"Ccedil","name":"Insérer un C cédille majuscule","className":"outil_ccedil_maj","replaceWith":"Ç","display":true,"lang":["fr","eo","cpf"] } ,{"id":"uppercase","name":"Passer en majuscules","className":"outil_uppercase","replaceWith":function(markitup){return markitup.selection.toUpperCase()},"display":true,"lang":["fr","en"] } ,{"id":"lowercase","name":"Passer en minuscules","className":"outil_lowercase","replaceWith":function(markitup){return markitup.selection.toLowerCase()},"display":true,"lang":["fr","en"] } ] } ,{"separator":"---------------"} ,{"name":"Insérer un paragraphe factice","className":"outil_lorem_ipsum","replaceWith":"\n\nLorem ipsum dolor sit amet, consectetuer adipiscing elit.Aenean ut orci vel massa suscipit pulvinar. Nulla sollicitudin. Fusce varius, ligula non tempus aliquam, nunc turpis ullamcorper nibh, in tempus sapien eros vitae ligula. Pellentesque rhoncus nunc et augue. Integer id felis. Curabitur aliquet pellentesque diam. Integer quis metus vitae elit lobortis egestas. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi vel erat non mauris convallis vehicula. Nulla et sapien. Integer tortor tellus, aliquam faucibus, convallis id, congue eu, quam. Mauris ullamcorper felis vitae erat. Proin feugiat, augue non elementum posuere, metus purus iaculis lectus, et tristique ligula justo vitae magna.\n\n","dropMenu":[{"id":"lorem_ipsum_big","name":"Insérer trois paragraphes factices","className":"outil_lorem_ipsum_big","replaceWith":"\n\nLorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur lacus mi, varius sit amet, suscipit in, hendrerit sit amet, turpis. Duis in odio. Fusce mauris. Nulla quis ante. Vestibulum id dui. Curabitur quis est ac quam euismod ullamcorper. Phasellus nec justo. Vestibulum id erat sed odio ultrices hendrerit. Duis fermentum, velit ut pretium fermentum, felis turpis rhoncus justo, vel adipiscing nulla lectus sed eros. In hac habitasse platea dictumst. In hac habitasse platea dictumst. Curabitur tellus velit, consequat nec, tincidunt sit amet, posuere vel, ligula. Aenean auctor mollis mi. In adipiscing dolor vel diam. Morbi justo. Maecenas eu risus id mi tincidunt vestibulum.\n\nMaecenas lacinia. Sed aliquet bibendum nisl. Vivamus vulputate, sapien ut molestie iaculis, diam libero porttitor dolor, eget semper orci orci ut sem. Nunc venenatis. Curabitur adipiscing, velit at iaculis dictum, lacus nulla adipiscing mauris, id rhoncus velit nisl ac mauris. Aliquam egestas, sapien sed placerat lacinia, tellus erat tempor quam, at sollicitudin ligula eros sit amet sapien. Nam at dui id libero vehicula sodales. Vestibulum dictum risus eget metus. Cras lorem. Pellentesque lobortis sodales ipsum. Vivamus convallis lectus in nunc. Vivamus metus libero, ullamcorper in, porttitor nec, dapibus id, est. Praesent pede. Sed viverra consequat leo. Mauris pharetra tortor a orci.\n\nMaecenas sed lacus. Phasellus iaculis risus et elit. Morbi sagittis nunc vitae sem. Aliquam ac lorem vel magna ornare malesuada. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris est dolor, aliquam eget, feugiat ut, tempus at, arcu. Duis porta, pede sed hendrerit pellentesque, orci dolor consectetuer risus, id scelerisque tellus ipsum quis felis. Sed ultrices. Nullam eleifend dui sodales massa. Morbi consectetuer pellentesque dui. Vestibulum urna. Fusce congue velit ut erat. Aliquam quis odio sollicitudin ipsum euismod porta. Vivamus pharetra, lacus eu tempor lobortis, diam nisi vulputate lorem, ut aliquet dui neque eu sem. Morbi varius, nisi ac laoreet mollis, pede odio cursus nisi, in imperdiet dolor enim at metus. Nunc pretium pulvinar tortor. Vestibulum euismod ultrices est. Etiam lobortis, enim ut bibendum dictum, urna orci lacinia tortor, at eleifend pede sem eu sem. Morbi a neque. Vestibulum cursus.\n\n","display":true} ] } ,{"separator":"---------------"} ,{"name":"Insérer un code informatique (code)","className":"outil_code","openWith":"","closeWith":"","dropMenu":[{"id":"cadre_spip","name":"Insérer un code preformaté SPIP (cadre)","className":"outil_cadre","openWith":"\n","closeWith":"\n","display":true} ,{"id":"cadre_php","name":"Insérer un code preformaté PHP (cadre)","className":"outil_cadre","openWith":"\n","closeWith":"\n","display":true} ,{"id":"pre","name":"Insérer un code preformaté (pre)","className":"outil_pre","openWith":"
    ","closeWith":"
    ","display":true} ,{"id":"var","name":"Insérer une variable (var)","className":"outil_var","openWith":"","closeWith":"","display":true} ,{"id":"samp","name":"Insérer une sortie de code (samp)","className":"outil_samp","openWith":"","closeWith":"","display":true} ,{"id":"kbd","name":"Insérer une entrée clavier (kdb)","className":"outil_kbd","openWith":"","closeWith":"","display":true} ,{"id":"lienTrac","name":"Insérer un lien vers le trac de SPIP","className":"outil_lien_trac","openWith":"[?","closeWith":"#trac]","display":true} ] } ] } function outil_liste(h,c){ if((s=h.selection)&&(r=s.match(/^-([*#]+) (.*)$/))){ r[1]=r[1].replace(/[#*]/g,c); s='-'+r[1]+' '+r[2]}else{ s='-'+c+' '+s} return s} function outil_indenter(h){ if(s=h.selection){ if(s.substr(0,2)=='-*'){ s='-**'+s.substr(2)}else if(s.substr(0,2)=='-#'){ s='-##'+s.substr(2)}else{ s='-* '+s} } return s} function outil_desindenter(h){ if(s=h.selection){ if(s.substr(0,3)=='-**'){ s='-*'+s.substr(3)}else if(s.substr(0,3)=='-* '){ s=s.substr(3)}else if(s.substr(0,3)=='-##'){ s='-#'+s.substr(3)}else if(s.substr(0,3)=='-# '){ s=s.substr(3)} } return s} function espace_si_accolade(h,openWith,closeWith){ if(s=h.selection){ if(s.charAt(0)=='{'){ return openWith+' '+s+' '+closeWith} else if(c=h.textarea.selectionStart){ if(h.textarea.value.charAt(c-1)=='{'){ return' '+openWith+s+closeWith+' '} } } return openWith+s+closeWith} barre_outils_forum={"nameSpace":"forum","previewAutoRefresh":false,"onEnter":{"keepDefault":false,"selectionType":"return","replaceWith":"\n"} ,"onShiftEnter":{"keepDefault":false,"replaceWith":"\n_ "} ,"onCtrlEnter":{"keepDefault":false,"replaceWith":"\n\n"} ,"markupSet":[{"name":"Mettre en {{gras}}","key":"B","className":"outil_bold","replaceWith":function(h){return espace_si_accolade(h,'{{','}}')},"selectionType":"word"} ,{"name":"Mettre en {italique}","key":"I","className":"outil_italic","replaceWith":function(h){return espace_si_accolade(h,'{','}')},"selectionType":"word"} ,{"separator":"---------------"} ,{"name":"Transformer en [lien hypertexte->http://...]","key":"L","className":"outil_link","openWith":"[","closeWith":"->[![Veuillez indiquer l'adresse de votre lien (vous pouvez indiquer une adresse Internet sous la forme http://www.monsite.com, une adresse courriel, ou simplement indiquer le numéro d'un article de ce site.]!]]"} ,{"separator":"---------------"} ,{"name":"Citer un message","key":"Q","className":"outil_quote","openWith":"\n","closeWith":"\n","selectionType":"word"} ,{"name":"Entourer de « guillemets »","className":"outil_guillemets","openWith":"«","closeWith":"»","lang":["fr","eo","cpf","ar","es"] ,"selectionType":"word"} ,{"name":"Entourer de “guillemets de second niveau”","className":"outil_guillemets_simples","openWith":"“","closeWith":"”","lang":["fr","eo","cpf","ar","es"] ,"selectionType":"word"} ,{"name":"Entourer de « guillemets »","className":"outil_guillemets_de","openWith":"„","closeWith":"“","lang":["bg","de","pl","hr","src"] ,"selectionType":"word"} ,{"name":"Entourer de “guillemets de second niveau”","className":"outil_guillemets_de_simples","openWith":"‚","closeWith":"‘","lang":["bg","de","pl","hr","src"] ,"selectionType":"word"} ,{"name":"Entourer de « guillemets »","className":"outil_guillemets_simples","openWith":"“","closeWith":"”","lang_not":["fr","eo","cpf","ar","es","bg","de","pl","hr","src"] ,"selectionType":"word"} ,{"name":"Entourer de “guillemets de second niveau”","className":"outil_guillemets_uniques","openWith":"‘","closeWith":"’","lang_not":["fr","eo","cpf","ar","es","bg","de","pl","hr","src"] ,"selectionType":"word"} ,{"separator":"---------------"} ] } function outil_liste(h,c){ if((s=h.selection)&&(r=s.match(/^-([*#]+) (.*)$/))){ r[1]=r[1].replace(/[#*]/g,c); s='-'+r[1]+' '+r[2]}else{ s='-'+c+' '+s} return s} function outil_indenter(h){ if(s=h.selection){ if(s.substr(0,2)=='-*'){ s='-**'+s.substr(2)}else if(s.substr(0,2)=='-#'){ s='-##'+s.substr(2)}else{ s='-* '+s} } return s} function outil_desindenter(h){ if(s=h.selection){ if(s.substr(0,3)=='-**'){ s='-*'+s.substr(3)}else if(s.substr(0,3)=='-* '){ s=s.substr(3)}else if(s.substr(0,3)=='-##'){ s='-#'+s.substr(3)}else if(s.substr(0,3)=='-# '){ s=s.substr(3)} } return s} function espace_si_accolade(h,openWith,closeWith){ if(s=h.selection){ if(s.charAt(0)=='{'){ return openWith+' '+s+' '+closeWith} else if(c=h.textarea.selectionStart){ if(h.textarea.value.charAt(c-1)=='{'){ return' '+openWith+s+closeWith+' '} } } return openWith+s+closeWith} ;(function($){ $.fn.barre_outils=function(nom,settings){ options={ lang:'fr' }; $.extend(options,settings); return $(this) .not('.markItUpEditor, .no_barre') .markItUp(eval('barre_outils_'+nom),{lang:options.lang})}; $.fn.barre_previsualisation=function(settings){ options={ previewParserPath:"index.php?action=porte_plume_previsu",textEditer:"Éditer", textVoir:"Voir" }; $.extend(options,settings); return $(this) .not('.pp_previsualisation, .no_previsualisation') .previsu_spip(options)}; $(window).load(function(){ function barrebouilles(){ $('.formulaire_spip textarea.inserer_barre_forum').barre_outils('forum'); $('.formulaire_spip textarea.inserer_barre_edition').barre_outils('edition'); $('.formulaire_spip textarea.inserer_previsualisation').barre_previsualisation(); $('textarea.textarea_forum').barre_outils('forum'); $('.formulaire_forum textarea[name=texte]').barre_outils('forum'); $('.formulaire_spip textarea[name=texte]') .barre_outils('edition') .barre_previsualisation()} barrebouilles(); onAjaxLoad(barrebouilles)})})(jQuery);