formations/javascript/bower_components/remark/out/remark.min.js

7 lines
229 KiB
JavaScript
Raw Normal View History

2015-03-25 17:27:03 +01:00
require=function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i}({"components/printing":[function(require,module,exports){module.exports=require("nZr0zp")},{}],nZr0zp:[function(require,module,exports){var EventEmitter=require("events").EventEmitter,styler=require("components/styler");var LANDSCAPE="landscape",PORTRAIT="portrait",PAGE_HEIGHT=681,PAGE_WIDTH=908;function PrintComponent(){}PrintComponent.prototype=new EventEmitter;PrintComponent.prototype.init=function(){var self=this;this.setPageOrientation(LANDSCAPE);if(!window.matchMedia){return false}window.matchMedia("print").addListener(function(e){self.onPrint(e)})};PrintComponent.prototype.onPrint=function(e){var slideHeight;if(!e.matches){return}this.emit("print",{isPortrait:this._orientation==="portrait",pageHeight:this._pageHeight,pageWidth:this._pageWidth})};PrintComponent.prototype.setPageOrientation=function(orientation){if(orientation===PORTRAIT){this._pageHeight=PAGE_WIDTH;this._pageWidth=PAGE_HEIGHT}else if(orientation===LANDSCAPE){this._pageHeight=PAGE_HEIGHT;this._pageWidth=PAGE_WIDTH}else{throw new Error("Unknown print orientation: "+orientation)}this._orientation=orientation;styler.setPageSize(this._pageWidth+"px "+this._pageHeight+"px")};module.exports=new PrintComponent},{events:1,"components/styler":"t5Lx4S"}],"components/slide-number":[function(require,module,exports){module.exports=require("aIW4aw")},{}],aIW4aw:[function(require,module,exports){module.exports=SlideNumberViewModel;function SlideNumberViewModel(slide,slideshow){var self=this;self.slide=slide;self.slideshow=slideshow;self.element=document.createElement("div");self.element.className="remark-slide-number";self.element.innerHTML=formatSlideNumber(self.slide,self.slideshow)}function formatSlideNumber(slide,slideshow){var format=slideshow.getSlideNumberFormat(),slides=slideshow.getSlides(),current=getSlideNo(slide,slideshow),total=getSlideNo(slides[slides.length-1],slideshow);if(typeof format==="function"){return format.call(slideshow,current,total)}return format.replace("%current%",current).replace("%total%",total)}function getSlideNo(slide,slideshow){var slides=slideshow.getSlides(),i,slideNo=0;for(i=0;i<=slide.getSlideIndex()&&i<slides.length;++i){if(slides[i].properties.count!=="false"){slideNo+=1}}return Math.max(1,slideNo)}},{}],2:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}if(canPost){var queue=[];window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],1:[function(require,module,exports){!function(process){if(!process.EventEmitter)process.EventEmitter=function(){};var EventEmitter=exports.EventEmitter=process.EventEmitter;var isArray=typeof Array.isArray==="function"?Array.isArray:function(xs){return Object.prototype.toString.call(xs)==="[object Array]"};function indexOf(xs,x){if(xs.indexOf)return xs.indexOf(x);for(var i=0;i<xs.length;i++){if(x===xs[i])return i}return-1}var defaultMaxListeners=10;EventEmitter.prototype.setMaxListen
this.QUOTE_STRING_MODE={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[this.BACKSLASH_ESCAPE]};this.PHRASAL_WORDS_MODE={begin:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\b/};this.C_LINE_COMMENT_MODE={className:"comment",begin:"//",end:"$",contains:[this.PHRASAL_WORDS_MODE]};this.C_BLOCK_COMMENT_MODE={className:"comment",begin:"/\\*",end:"\\*/",contains:[this.PHRASAL_WORDS_MODE]};this.HASH_COMMENT_MODE={className:"comment",begin:"#",end:"$",contains:[this.PHRASAL_WORDS_MODE]};this.NUMBER_MODE={className:"number",begin:this.NUMBER_RE,relevance:0};this.C_NUMBER_MODE={className:"number",begin:this.C_NUMBER_RE,relevance:0};this.BINARY_NUMBER_MODE={className:"number",begin:this.BINARY_NUMBER_RE,relevance:0};this.CSS_NUMBER_MODE={className:"number",begin:this.NUMBER_RE+"("+"%|em|ex|ch|rem"+"|vw|vh|vmin|vmax"+"|cm|mm|in|pt|pc|px"+"|deg|grad|rad|turn"+"|s|ms"+"|Hz|kHz"+"|dpi|dpcm|dppx"+")?",relevance:0};this.REGEXP_MODE={className:"regexp",begin:/\//,end:/\/[gim]*/,illegal:/\n/,contains:[this.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[this.BACKSLASH_ESCAPE]}]};this.TITLE_MODE={className:"title",begin:this.IDENT_RE,relevance:0};this.UNDERSCORE_TITLE_MODE={className:"title",begin:this.UNDERSCORE_IDENT_RE,relevance:0}},languages=[{name:"javascript",create:function(hljs){return{aliases:["js"],keywords:{keyword:"in if for while finally var new function do return void else break catch "+"instanceof with throw case default try this switch continue typeof delete "+"let yield const class",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent "+"encodeURI encodeURIComponent escape unescape Object Function Boolean Error "+"EvalError InternalError RangeError ReferenceError StopIteration SyntaxError "+"TypeError URIError Number Math Date String RegExp Array Float32Array "+"Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array "+"Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require "+"module console window document"},contains:[{className:"pi",begin:/^\s*('|")use strict('|")/,relevance:10},hljs.APOS_STRING_MODE,hljs.QUOTE_STRING_MODE,hljs.C_LINE_COMMENT_MODE,hljs.C_BLOCK_COMMENT_MODE,hljs.C_NUMBER_MODE,{begin:"("+hljs.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[hljs.C_LINE_COMMENT_MODE,hljs.C_BLOCK_COMMENT_MODE,hljs.REGEXP_MODE,{begin:/</,end:/>;/,relevance:0,subLanguage:"xml"}],relevance:0},{className:"function",beginKeywords:"function",end:/\{/,excludeEnd:true,contains:[hljs.inherit(hljs.TITLE_MODE,{begin:/[A-Za-z$_][0-9A-Za-z$_]*/}),{className:"params",begin:/\(/,end:/\)/,contains:[hljs.C_LINE_COMMENT_MODE,hljs.C_BLOCK_COMMENT_MODE],illegal:/["'\(]/}],illegal:/\[|%/},{begin:/\$[(.]/},{begin:"\\."+hljs.IDENT_RE,relevance:0}]}}},{name:"ruby",create:function(hljs){var RUBY_METHOD_RE="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var RUBY_KEYWORDS="and false then defined module in return redo if BEGIN retry end for true self when "+"next until do begin unless END rescue nil else break undef not super class case "+"require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor";var YARDOCTAG={className:"yardoctag",begin:"@[A-Za-z]+"};var COMMENT={className:"comment",variants:[{begin:"#",end:"$",contains:[YARDOCTAG]},{begin:"^\\=begin",end:"^\\=end",contains:[YARDOCTAG],relevance:10},{begin:"^__END__",end:"\\n$"}]};var SUBST={className:"subst",begin:"#\\{",end:"}",keywords:RUBY_KEYWORDS};var STRING={className:"string",contains:[hljs.BACKSLASH_ESCAPE,SUBST],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:"%[qw]?\\(",end:"\\)"},{begin:"%[qw]?\\[",end:"\\]"},{begin:"%[qw]?{",end:"}"},{begin:"%[qw]?<",end:">",relevance:10},{begin:"%[qw]?/",end:"/",relevance:10},{begin:"%[qw]?%",end:"%",relevance:10},{begin:"%[qw]?-",end:"-",relevance:10},{begin:"%[qw]?\\|",end:"\\|",relevance:10},{begin:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-
SUBST.contains=EXPRESSIONS;return{aliases:["coffee","cson","iced"],keywords:KEYWORDS,contains:EXPRESSIONS.concat([{className:"comment",begin:"###",end:"###"},hljs.HASH_COMMENT_MODE,{className:"function",begin:"("+JS_IDENT_RE+"\\s*=\\s*)?(\\(.*\\))?\\s*\\B[-=]>",end:"[-=]>",returnBegin:true,contains:[TITLE,{className:"params",begin:"\\(",returnBegin:true,contains:[{begin:/\(/,end:/\)/,keywords:KEYWORDS,contains:["self"].concat(EXPRESSIONS)}]}]},{className:"class",beginKeywords:"class",end:"$",illegal:/[:="\[\]]/,contains:[{beginKeywords:"extends",endsWithParent:true,illegal:/[:="\[\]]/,contains:[TITLE]},TITLE]},{className:"attribute",begin:JS_IDENT_RE+":",end:":",returnBegin:true,excludeEnd:true,relevance:0}])}}},{name:"lisp",create:function(hljs){var LISP_IDENT_RE="[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#!]*";var LISP_SIMPLE_NUMBER_RE="(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?";var SHEBANG={className:"shebang",begin:"^#!",end:"$"};var LITERAL={className:"literal",begin:"\\b(t{1}|nil)\\b"};var NUMBER={className:"number",variants:[{begin:LISP_SIMPLE_NUMBER_RE,relevance:0},{begin:"#b[0-1]+(/[0-1]+)?"},{begin:"#o[0-7]+(/[0-7]+)?"},{begin:"#x[0-9a-f]+(/[0-9a-f]+)?"},{begin:"#c\\("+LISP_SIMPLE_NUMBER_RE+" +"+LISP_SIMPLE_NUMBER_RE,end:"\\)"}]};var STRING=hljs.inherit(hljs.QUOTE_STRING_MODE,{illegal:null});var COMMENT={className:"comment",begin:";",end:"$"};var VARIABLE={className:"variable",begin:"\\*",end:"\\*"};var KEYWORD={className:"keyword",begin:"[:&]"+LISP_IDENT_RE};var QUOTED_LIST={begin:"\\(",end:"\\)",contains:["self",LITERAL,STRING,NUMBER]};var QUOTED={className:"quoted",contains:[NUMBER,STRING,VARIABLE,KEYWORD,QUOTED_LIST],variants:[{begin:"['`]\\(",end:"\\)"},{begin:"\\(quote ",end:"\\)",keywords:{title:"quote"}}]};var LIST={className:"list",begin:"\\(",end:"\\)"};var BODY={endsWithParent:true,relevance:0};LIST.contains=[{className:"title",begin:LISP_IDENT_RE},BODY];BODY.contains=[QUOTED,LIST,LITERAL,NUMBER,STRING,COMMENT,VARIABLE,KEYWORD];return{illegal:/\S/,contains:[NUMBER,SHEBANG,LITERAL,STRING,COMMENT,QUOTED,LIST]}}},{name:"clojure",create:function(hljs){var keywords={built_in:"def cond apply if-not if-let if not not= = &lt; < > &lt;= <= >= == + / * - rem "+"quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? "+"set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? "+"class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? "+"string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . "+"inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last "+"drop-while while intern condp case reduced cycle split-at split-with repeat replicate "+"iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext "+"nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends "+"add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler "+"set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter "+"monitor-exit defmacro defn defn- macroexpand macroexpand-1 for dosync and or "+"when when-not when-let comp juxt partial sequence memoize constantly complement identity assert "+"peek pop doto proxy defstruct first rest cons defprotocol cast coll deftype defrecord last butlast "+"sigs reify second ffirst fnext nfirst nnext defmulti defmethod meta with-meta ns in-ns create-ns import "+"refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! "+"assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger "+"bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline "+"flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking "+"assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! "+"reset-meta! commute get-valid
}()},{}],8:[function(require,module,exports){exports.addClass=function(element,className){element.className=exports.getClasses(element).concat([className]).join(" ")};exports.removeClass=function(element,className){element.className=exports.getClasses(element).filter(function(klass){return klass!==className}).join(" ")};exports.toggleClass=function(element,className){var classes=exports.getClasses(element),index=classes.indexOf(className);if(index!==-1){classes.splice(index,1)}else{classes.push(className)}element.className=classes.join(" ")};exports.getClasses=function(element){return element.className.split(" ").filter(function(s){return s!==""})};exports.hasClass=function(element,className){return exports.getClasses(element).indexOf(className)!==-1};exports.getPrefixedProperty=function(element,propertyName){var capitalizedPropertName=propertyName[0].toUpperCase()+propertyName.slice(1);return element[propertyName]||element["moz"+capitalizedPropertName]||element["webkit"+capitalizedPropertName]}},{}],4:[function(require,module,exports){var EventEmitter=require("events").EventEmitter,highlighter=require("./highlighter"),converter=require("./converter"),Parser=require("./parser"),Slideshow=require("./models/slideshow"),SlideshowView=require("./views/slideshowView"),DefaultController=require("./controllers/defaultController"),Dom=require("./dom"),macros=require("./macros");module.exports=Api;function Api(dom){this.dom=dom||new Dom;this.macros=macros}Api.prototype.highlighter=highlighter;Api.prototype.convert=function(markdown){var parser=new Parser,content=parser.parse(markdown||"",macros)[0].content;return converter.convertMarkdown(content,{},true)};Api.prototype.create=function(options){var events,slideshow,slideshowView,controller;options=applyDefaults(this.dom,options);events=new EventEmitter;events.setMaxListeners(0);slideshow=new Slideshow(events,options);slideshowView=new SlideshowView(events,this.dom,options.container,slideshow);controller=options.controller||new DefaultController(events,this.dom,slideshowView,options.navigation);return slideshow};function applyDefaults(dom,options){var sourceElement;options=options||{};if(options.hasOwnProperty("sourceUrl")){var req=new dom.XMLHttpRequest;req.open("GET",options.sourceUrl,false);req.send();options.source=req.responseText.replace(/\r\n/g,"\n")}else if(!options.hasOwnProperty("source")){sourceElement=dom.getElementById("source");if(sourceElement){options.source=unescape(sourceElement.innerHTML);sourceElement.style.display="none"}}if(!(options.container instanceof window.HTMLElement)){options.container=dom.getBodyElement()}return options}function unescape(source){source=source.replace(/&[l|g]t;/g,function(match){return match==="&lt;"?"<":">"});source=source.replace(/&amp;/g,"&");source=source.replace(/&quot;/g,'"');return source}},{events:1,"./highlighter":7,"./converter":9,"./parser":10,"./dom":11,"./controllers/defaultController":12,"./views/slideshowView":13,"./models/slideshow":14,"./macros":15}],11:[function(require,module,exports){module.exports=Dom;function Dom(){}Dom.prototype.XMLHttpRequest=XMLHttpRequest;Dom.prototype.getHTMLElement=function(){return document.getElementsByTagName("html")[0]};Dom.prototype.getBodyElement=function(){return document.body};Dom.prototype.getElementById=function(id){return document.getElementById(id)};Dom.prototype.getLocationHash=function(){return window.location.hash};Dom.prototype.setLocationHash=function(hash){if(typeof window.history.replaceState==="function"){window.history.replaceState(undefined,undefined,hash)}else{window.location.hash=hash}}},{}],15:[function(require,module,exports){var macros=module.exports={};macros.hello=function(){return"hello!"}},{}],10:[function(require,module,exports){!function(){var Lexer=require("./lexer");module.exports=Parser;function Parser(){}Parser.prototype.parse=function(src,macros){var self=this,lexer=new Lexer,tokens=lexer.lex(cleanInput(src)),slides=[],stack=[createSlide()];macros=macros||{};tokens.forEach(function(token){switch(token.type){case"text":case"code":case"fences":appendTo(st
events.on("slideChanged",updateHash);navigateByHash()}function navigateByHash(){var slideNoOrName=(dom.getLocationHash()||"").substr(1);events.emit("gotoSlide",slideNoOrName)}function updateHash(slideNoOrName){dom.setLocationHash("#"+slideNoOrName)}}},{}],18:[function(require,module,exports){var converter=require("../converter");module.exports=NotesView;function NotesView(events,element,slideViewsAccessor){var self=this;self.events=events;self.element=element;self.slideViewsAccessor=slideViewsAccessor;self.configureElements();events.on("showSlide",function(slideIndex){self.showSlide(slideIndex)})}NotesView.prototype.showSlide=function(slideIndex){var self=this,slideViews=self.slideViewsAccessor(),slideView=slideViews[slideIndex],nextSlideView=slideViews[slideIndex+1];self.notesElement.innerHTML=slideView.notesElement.innerHTML;if(nextSlideView){self.notesPreviewElement.innerHTML=nextSlideView.notesElement.innerHTML}else{self.notesPreviewElement.innerHTML=""}};NotesView.prototype.configureElements=function(){var self=this;self.notesElement=self.element.getElementsByClassName("remark-notes")[0];self.notesPreviewElement=self.element.getElementsByClassName("remark-notes-preview")[0];self.notesElement.addEventListener("mousewheel",function(event){event.stopPropagation()});self.notesPreviewElement.addEventListener("mousewheel",function(event){event.stopPropagation()});self.toolbarElement=self.element.getElementsByClassName("remark-toolbar")[0];var commands={increase:function(){self.notesElement.style.fontSize=(parseFloat(self.notesElement.style.fontSize)||1)+.1+"em";self.notesPreviewElement.style.fontsize=self.notesElement.style.fontSize},decrease:function(){self.notesElement.style.fontSize=(parseFloat(self.notesElement.style.fontSize)||1)-.1+"em";self.notesPreviewElement.style.fontsize=self.notesElement.style.fontSize}};self.toolbarElement.getElementsByTagName("a").forEach(function(link){link.addEventListener("click",function(e){var command=e.target.hash.substr(1);commands[command]();e.preventDefault()})})}},{"../converter":9}],17:[function(require,module,exports){var SlideNumber=require("components/slide-number"),converter=require("../converter"),highlighter=require("../highlighter"),utils=require("../utils");module.exports=SlideView;function SlideView(events,slideshow,scaler,slide){var self=this;self.events=events;self.slideshow=slideshow;self.scaler=scaler;self.slide=slide;self.slideNumber=new SlideNumber(slide,slideshow);self.configureElements();self.updateDimensions();self.events.on("propertiesChanged",function(changes){if(changes.hasOwnProperty("ratio")){self.updateDimensions()}})}SlideView.prototype.updateDimensions=function(){var self=this,dimensions=self.scaler.dimensions;self.scalingElement.style.width=dimensions.width+"px";self.scalingElement.style.height=dimensions.height+"px"};SlideView.prototype.scale=function(containerElement){var self=this;self.scaler.scaleToFit(self.scalingElement,containerElement)};SlideView.prototype.show=function(){utils.addClass(this.containerElement,"remark-visible");utils.removeClass(this.containerElement,"remark-fading")};SlideView.prototype.hide=function(){var self=this;utils.removeClass(this.containerElement,"remark-visible");utils.addClass(this.containerElement,"remark-fading");setTimeout(function(){utils.removeClass(self.containerElement,"remark-fading")},1e3)};SlideView.prototype.configureElements=function(){var self=this;self.containerElement=document.createElement("div");self.containerElement.className="remark-slide-container";self.scalingElement=document.createElement("div");self.scalingElement.className="remark-slide-scaler";self.element=document.createElement("div");self.element.className="remark-slide";self.contentElement=createContentElement(self.events,self.slideshow,self.slide);self.notesElement=createNotesElement(self.slideshow,self.slide.notes);self.contentElement.appendChild(self.slideNumber.element);self.element.appendChild(self.contentElement);self.scalingElement.appendChild(self.element);self.containerElement.appendChild(self.scalingElement);self.containerElement.a