1"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _slicedToArray(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr)){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i["return"]&&_i["return"]()}finally{if(_d)throw _e}}return _arr}throw new TypeError("Invalid attempt to destructure non-iterable instance")}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _slicedToArray(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr)){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i["return"]&&_i["return"]()}finally{if(_d)throw _e}}return _arr}throw new TypeError("Invalid attempt to destructure non-iterable instance")}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _slicedToArray(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr)){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i["return"]&&_i["return"]()}finally{if(_d)throw _e}}return _arr}throw new TypeError("Invalid attempt to destructure non-iterable instance")}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),GithubUrl=function(){function GithubUrl(_ref){var owner=_ref.owner,repo=_ref.repo,branch=_ref.branch,path=_ref.path;_classCallCheck(this,GithubUrl),this.ghData={keys:{secret:atob(GH.SECRET),id:atob(GH.ID)},owner:owner,repo:repo,branch:branch,path:path?"/"+path:""}}return _createClass(GithubUrl,[{key:"_listMd",value:function(json){return json.filter(function(elt){return"dir"===elt.type||elt.name.match(/.md$/)?elt:void 0})}},{key:"_listByFolder",value:function(json){var files=[],dirs=[];return json.map(function(elt){"file"===elt.type&&files.push(elt),"dir"===elt.type&&dirs.push(elt)}),dirs.concat(files)}},{key:"toGhApiSearch",value:function(query){var owner=this.ghData.owner;return"https://api.github.com/search/code"+("?q="+query+"+language:Markdown+user:"+owner)}},{key:"toGhApiUrl",value:function(){var _ghData=this.ghData,keys=_ghData.keys,owner=_ghData.owner,repo=_ghData.repo,branch=_ghData.branch,path=_ghData.path,branchParam=branch?"ref="+branch+"&":"";return"https://api.github.com"+("/repos/"+owner+"/"+repo+"/contents"+path)+("?"+branchParam+"client_id="+keys.id+"&client_secret="+keys.secret)}},{key:"toGhRepoApiUrl",value:function(){var _ghData2=this.ghData,keys=_ghData2.keys,owner=_ghData2.owner;return"https://api.github.com/users/"+owner+"/repos"+("?client_id="+keys.id+"&client_secret="+keys.secret)}},{key:"getProseUrl",value:function(){var _ghData3=this.ghData,owner=_ghData3.owner,repo=_ghData3.repo,branch=_ghData3.branch,path=_ghData3.path;return"http://prose.io/#"+owner+"/"+repo+"/edit/"+branch+path}},{key:"getGhUrl",value:function(){var _ghData4=this.ghData,owner=_ghData4.owner,repo=_ghData4.repo,branch=_ghData4.branch,path=_ghData4.path;return"https://github.com/"+owner+"/"+repo+"/blob/"+branch+path}},{key:"getHtmlBlob",value:function(){var _this=this;return new Promise(function(resolve){fetch(_this.toGhApiUrl(),{headers:{Accept:"application/vnd.github.v3.html"}}).then(function(response){return response.text()}).then(function(htmlResponse){resolve(htmlResponse)})})}},{key:"getMdBlob",value:function(){var _this2=this;return new Promise(function(resolve){fetch(_this2.toGhApiUrl(),{headers:{Accept:"application/vnd.github.v3.raw"}}).then(function(response){return response.text()}).then(function(mdResponse){resolve(mdResponse)})})}},{key:"getJsonRepo",value:function(){var _this3=this;return new Promise(function(resolve){fetch(_this3.toGhRepoApiUrl(),{headers:{Accept:"application/vnd.github.v3"}}).then(function(response){return response.json()}).then(function(json){resolve(json)})})}},{key:"getJsonSearch",value:function(query){var _this4=this;return new Promise(function(resolve){fetch(_this4.toGhApiSearch(query),{headers:{Accept:"application/vnd.github.v3.html"}}).then(function(response){return response.json()}).then(function(json){resolve(json)})})}},{key:"getJsonFolders",value:function(){var _this5=this;return new Promise(function(resolve){fetch(_this5.toGhApiUrl(),{headers:{Accept:"application/vnd.github.v3"}}).then(function(response){return response.json()}).then(function(json){resolve(_this5._listByFolder(_this5._listMd(json)))})})}}]),GithubUrl}(),_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),Layout=function(){function Layout(){_classCallCheck(this,Layout),this._htmlTpl=""}return _createClass(Layout,[{key:"_getTemplateNames",value:function(){return Array.from(this._htmlTpl.querySelectorAll("[data-template]")).map(function(div){return div.getAttribute("data-template")})}},{key:"html",value:function(_html){var htmlTpl=document.createElement("template");htmlTpl.innerHTML=_html,this._htmlTpl=htmlTpl.content}},{key:"render",value:function(){var clone=document.importNode(this._htmlTpl,!0);document.querySelector("#container").innerHTML="",document.querySelector("#container").appendChild(clone),this._getTemplateNames().map(function(tplName){if(!template.hasOwnProperty(tplName))throw"Template "+tplName+" is undefined";return template[tplName].render()})}}]),Layout}(),_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),Markdown=function(){function Markdown(content){_classCallCheck(this,Markdown),this.content=content,this.metas={},this.isMetas()&&this._extractMetas()}return _createClass(Markdown,[{key:"isMetas",value:function(){return!!this.content.match(/---([\s\S]*?)---/)}},{key:"_extractMetas",value:function(){var _this=this,labelList="";this.content.match(/---([\s\S]*?)---/)[1].split("\n").map(function(elt){if(elt.match(/^\w+:$/)){var _elt$match=elt.match(/^(\w+):$/),_elt$match2=_slicedToArray(_elt$match,2),label=_elt$match2[1];_this.metas[label]=[],labelList=label}if(elt.match(/^ - [\s\S]*?$/)){var _elt$match3=elt.match(/^ - ([\s\S]*?)$/),_elt$match32=_slicedToArray(_elt$match3,2),content=_elt$match32[1];_this.metas[labelList].push(content)}if(elt.match(/^\w+: [\s\S]*?$/)){var _elt$match4=elt.match(/^(\w+): ([\s\S]*?)$/),_elt$match42=_slicedToArray(_elt$match4,3),label=_elt$match42[1],content=_elt$match42[2];_this.metas[label]=content.trim()}})}}]),Markdown}(),_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),Router=function(){function Router(){_classCallCheck(this,Router),this.url="",this.currentRoute="",this.injectLayout=function(){},this._routes=[],this.params={},this.queries={},this._isOffLine()&&this._go503()}return _createClass(Router,[{key:"_isOffLine",value:function(){return!navigator.onLine}},{key:"_go503",value:function(){window.location="./503.html"}},{key:"_urlWithoutParams",value:function(){return this.url.split("?")[0]}},{key:"_resetRoute",value:function(){this.currentRoute="",this.layout="",this.params={},this.queries={}}},{key:"_setQueryParameters",value:function(){var _this=this,queries=this.url.split("?")[1];queries&&queries.split("&").map(function(query){_this.queries[query.split("=")[0]]=query.split("=")[1]})}},{key:"_setParams",value:function(pattern){var patternItems=pattern.split("/"),urlValues=this._urlWithoutParams().split("/");for(var index in patternItems){var patternItem=patternItems[index];if(patternItem.startsWith(":")){var paramName=patternItem.match(/^:(\w+)/)[1];this.params[paramName]=-1!==patternItem.indexOf("(.*)")?urlValues.slice(index).join("/"):urlValues[index]}}}},{key:"_patternToRegex",value:function(pattern){var regex=["^"];return pattern.split("/").map(function(patternItem){if(patternItem.startsWith(":")){var regTmp="[0-9A-Za-zÃ-Å¿-_.]*";patternItem.endsWith("(.*)")&&(regTmp="[0-9A-Za-zÃ-Å¿-_./]*"),patternItem.endsWith("?")&&(regex.pop(),regTmp="(/[0-9A-Za-zÃ-Å¿-_./]*|)"),regex.push(regTmp)}else regex.push(patternItem);regex.push("/")}),regex.pop(),regex.push("$"),regex.join("")}},{key:"_checkPatternWithUrl",value:function(pattern){return!!this._urlWithoutParams().match(this._patternToRegex(pattern))}},{key:"_findAndSetCurrentRoute",value:function(){var route={};for(var index in this._routes)if(route=this._routes[index],this._checkPatternWithUrl(route.pattern)){this._setParams(route.pattern),this._setQueryParameters(),route.action.bind(this)();break}return route}},{key:"isNoRoute",value:function(){return!this.currentRoute}},{key:"go",value:function(url){this._resetRoute(),this.url=url||"/",this._findAndSetCurrentRoute(),this.injectLayout()}},{key:"route",value:function(pattern,action){this._routes.push({pattern:pattern,action:action})}}]),Router}(),_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),Template=function(){function Template(name){_classCallCheck(this,Template),this._htmlTpl="",this._name=name,this._events={},this.data=function(){}}return _createClass(Template,[{key:"html",value:function(_html){var htmlTpl=document.createElement("template");htmlTpl.innerHTML=_html,this._htmlTpl=htmlTpl.content,this._events={}}},{key:"_renderEvents",value:function(clone){var _this=this,_loop=function(_event){var _event$split=_event.split(" "),_event$split2=_slicedToArray(_event$split,2),evtType=_event$split2[0],evtSelector=_event$split2[1],func=_this._events[_event];
1clone.querySelector(evtSelector).addEventListener(evtType,function(evt){return func(evt)})};for(var _event in this._events)_loop(_event);return clone}},{key:"_injectHtml",value:function(){var selector='[data-template="'+this._name+'"]',clone=document.importNode(this._htmlTpl,!0);this._renderEvents(clone),document.querySelector(selector).innerHTML="",document.querySelector(selector).appendChild(clone)}},{key:"renderAsync",value:function(){this._injectHtml()}},{key:"render",value:function(){this.data(),this._htmlTpl&&this._injectHtml()}},{key:"events",value:function(_events){this._events=_events}}]),Template}(),template={},layout={};window.addEventListener("hashchange",function(){var ghUrl=window.location.toString().split("#")[1],anchor=document.querySelector('a[name="'+ghUrl+'"]');document.querySelector(".search-engine").style.display="",anchor?(anchor.scrollIntoView(),window.location="#"+router.url):(router.go(ghUrl),"home"!==(void 0).currentRoute&&(window.location="#"+ghUrl))}),window.addEventListener("load",function(){var ghUrl=window.location.toString().split("#")[1];router.go(ghUrl),router.isNoRoute()&&(window.location="./404.html",window.location.reload(!0)),document.querySelector("#button-gh-search").addEventListener("click",function(){if(document.querySelector("#gh-search").value.length>2){var userQuery=document.querySelector("#gh-search").value,apiUrl=new GithubUrl(router.params).toGhApiSearch(userQuery);router.go(apiUrl.replace("https://api.github.com/",""))}}),document.querySelector("#gh-search").addEventListener("keypress",function(evt){if("Enter"===evt.key&&evt.target.value.length>2){var userQuery=evt.target.value,apiUrl=new GithubUrl(router.params).toGhApiSearch(userQuery);router.go(apiUrl.replace("https://api.github.com/",""))}})}),layout.folders=new Layout("folders"),layout.folders.html('\n <main class="container">\n <div id="breadcrumb" class="breadcrumb" data-template="breadcrumb">\n </div>\n <section id="gh-list" class="gh-list" data-template="folders">\n </section>\n </main>'),layout.home=new Layout("home"),layout.home.html('\n <main>\n <section class="home-intro">\n <div class="home-intro-content container">\n <h2>'+MULTIBAO.UVP1+"<span>"+MULTIBAO.UVP2+'</span></h2>\n <a href="#multibao/contributions/blob/master/pages/commencer_ici.md">'+MULTIBAO.BUTTON1+'</a>\n <a href="#multibao/documentation/blob/master/README.md">'+MULTIBAO.BUTTON2+'</a>\n </div>\n </section>\n <section id="gh-crew-list" class="container">\n <ul data-template="crews">\n </ul>\n </section>\n </main>'),layout.repos=new Layout("repos"),layout.repos.html('\n <main class="container">\n <div id="breadcrumb" class="breadcrumb" data-template="breadcrumb">\n </div>\n <section id="gh-list" class="gh-list" data-template="repos">\n </section>\n </main>'),layout.searchList=new Layout("searchList"),layout.searchList.html('\n <main class="container">\n <!--\n <section class="search-result search-result-blank">\n il n\'y a pas de résultat pour la recherche <span>agilité</span> dans le repo <a href=""> Super repo de démo</a>\n </section>\n <section class="search-result">
1\n <span>3</span> résultat(s) pour la recherche <span>agilité</span> dans le repo <a href=""> Super repo de démo</a>\n </section>\n -->\n <section id="gh-list" class="gh-list" data-template="searchList">\n </section>\n </main>'),layout.viewer=new Layout("viewer"),layout.viewer.html('\n <main data-template="contribution" class="container">\n </main>\n ');var router=new Router;router.route("/",function(){this.currentRoute="home",layout.home.render(),document.querySelector(".search-engine").style.display="none"}),router.route("search/code",function(){this.currentRoute="search",layout.searchList.render()}),router.route(":owner/:repo/blob/:branch/:path(.*)",function(){this.currentRoute="blob",layout.viewer.render(),document.querySelector("header").style.display="none"}),router.route(":owner/:repo/tree/:branch/:path(.*)?",function(){this.currentRoute="tree",layout.folders.render()}),router.route(":owner/:repo",function(){this.currentRoute="list",layout.folders.render()}),router.route(":owner",function(){this.currentRoute="repos",layout.repos.render()}),template.breadcrumb=new Template("breadcrumb"),template.breadcrumb.data=function(){var _router$params=router.params,owner=_router$params.owner,repo=_router$params.repo,branch=_router$params.branch,path=_router$params.path,folders=[];path&&!function(){var pathByFolder=[];path.split("/").map(function(elt){pathByFolder.push("/"+elt),folders.push({link:"#"+owner+"/"+repo+"/tree/"+branch+pathByFolder.join(""),label:elt})})}();var _ownerTpl$repoTpl$foldersTpl={ownerTpl:{label:owner,link:"#"+owner},repoTpl:{label:repo,link:"#"+owner+"/"+repo+"/tree/"+branch},foldersTpl:folders},ownerTpl=_ownerTpl$repoTpl$foldersTpl.ownerTpl,repoTpl=_ownerTpl$repoTpl$foldersTpl.repoTpl,foldersTpl=_ownerTpl$repoTpl$foldersTpl.foldersTpl;template.breadcrumb.html('<ul>\n <li><a href="#">Accueil</a></li>\n <li><a href="'+ownerTpl.link+'">'+ownerTpl.label+"</a></li>\n "+(repoTpl.label?'<li><a href="'+repoTpl.link+'">'+repoTpl.label+"</a></li>":"")+foldersTpl.map(function(folder){return'<li><a href="'+folder.link+'">'+folder.label+"</a></li>"}).join("\n")+"</ul>")},!function(){var html=function(_ref){var link=_ref.link,label=_ref.label,content=_ref.content,prose_url=_ref.prose_url,git_url=_ref.git_url;return'\n <a name="top"></a>\n <aside class="contribution-tools">
1\n <a href="'+git_url+'" data-tootik="Voir sur Github" class="github-link"></a>\n <a href="'+prose_url+'" data-tootik="Editer sur prose.io" class="proseio-link"></a>\n <a href="#multibao/documentation/blob/master/README.md" data-tootik="Aide" class="help-link"></a>\n <a href="#top" class="page-top">Haut de page</a>\n </aside>\n <div id="parentRepo" class="breadcrumbs">\n à retrouver dans le dépôt : <a href="'+link+'">'+label+'</a>\n </div>\n <article id="contribution">\n '+content+"\n </article>\n "};template.contribution=new Template("contribution"),template.contribution.data=function(){var ghApi=new GithubUrl(router.params);ghApi.getHtmlBlob().then(function(htmlResponse){var _router$params=router.params,owner=_router$params.owner,repo=_router$params.repo,branch=_router$params.branch,path=_router$params.path,data={git_url:ghApi.getGhUrl(),prose_url:ghApi.getProseUrl(),content:htmlResponse,link:"#"+owner+"/"+repo+"/tree/"+branch+"/"+path.replace(/(\/|)[0-9A-Za-z\u00C0-\u017F\-\_\.]*$/,""),label:""+owner+" - "+repo};template.contribution.html(html(data)),template.contribution.renderAsync()})}}(),!function(){var htmlWithMetas=function(_ref){{var title=_ref.title,label=_ref.label,owner=_ref.owner;_ref.classAttr}return'<li><a title="'+title+'" href="#'+owner+'" data-owner="'+owner+'">\n <h3>'+label+"</h3><p>"+title+"</p></a>\n </li>"};template.crews=new Template("crews"),template.crews.data=function(){var ghApi=new GithubUrl({owner:GH.OWNER,repo:GH.CREW}),html=[];ghApi.getJsonFolders().then(function(jsonResponse){jsonResponse.map(function(elt){if("README.md"!==elt.name){var readmeUrl={owner:GH.OWNER,repo:GH.CREW,branch:"master",path:elt.name},ghApiBlob=new GithubUrl(readmeUrl);ghApiBlob.getMdBlob().then(function(mdResponse){var contribution=new Markdown(mdResponse);if(contribution.isMetas()){var metas={label:contribution.metas.label,title:contribution.metas.title,owner:contribution.metas.owner};html.push(htmlWithMetas(metas))}template.crews.html(html.join("\n")),template.crews.renderAsync(template.crews._htmlTpl)})}})})}}(),!function(){var htmlContribWithMetas=function(_ref){var url=_ref.url,title=_ref.title,authors=_ref.authors,image_url=(_ref.git_url,_ref.prose_url,_ref.image_url),description=_ref.description;return'<article class="gh-list-item gh-type-file">\n <h2 class="gh-list-title"><a href="#'+url+'">'+title+'</a></h2>\n <div class="gh-list-content">\n <div class="gh-list-meta">\n <p>Mise à jour par : '+authors+'</p>\n </div>\n <img src="'+image_url+'">\n <p class="gh-list-excerpt">'+description+'</p>\n <a class="gh-list-readmore"\n title="Lire la suite de la fiche : '+title+'"\n href="#'+url+'">Lire la fiche</a>\n </div>\n </article>'},htmlContribNoMetas=function(_ref2){var url=_ref2.url,title=_ref2.title;return'<article class="gh-list-item gh-type-file">\n <h2 class="gh-list-title"><a href="#'+url+'">'+title+"</a></h2>\n </article>"},htmlFolderWithMetas=function(_ref3){var url=_ref3.url,title=_ref3.title,folders=_ref3.folders,files=_ref3.files,contributors=_ref3.contributors,git_url=_ref3.git_url,image_url=_ref3.image_url,description=_ref3.description;return'<article class="gh-list-item gh-type-folder">\n <h2 class="gh-list-title"><a href="#'+url+'">'+title+'</a></h2>\n <div class="gh-list-content">\n <div class="gh-list-meta">\n <p>Dossiers : '+folders+" - Fiches : "+files+"</p>\n <p>Contributeurs : "+contributors+'</p>\n </p>\n <p>\n <a href="'+git_url+'">Voir sur Github</a>\n </p>\n </div>\n <img src="'+image_url+'">\n <p class="gh-list-excerpt">'+description+'</p>\n <a class="gh-list-readmore"\n title="Lire la suite de la fiche : '+title+'"\n href="#'+url+'">Lire la présentation complète</a>\n </div>\n </article>'},htmlFolderNoMetas=function(_ref4){var url=_ref4.url,title=_ref4.title;return'<article class="gh-list-item gh-type-folder">\n <h2 class="gh-list-title"><a href="#'+url+'">'+title+"</a></h2>\n </article>"};template.folders=new Template("folders"),template.folders.data=function(){var ghApi=new GithubUrl(router.params),html=[];ghApi.getJsonFolders().then(function(jsonResponse){jsonResponse.map(function(_ref5){var name=_ref5.name,type=_ref5.type,html_url=_ref5.html_url;if("file"===type){var readmeUrl={owner:router.params.owner,repo:router.params.repo,branch:"master",path:""+(router.params.path?""+router.params.path+"/"+name:name)},ghApiBlob=new GithubUrl(readmeUrl);ghApiBlob.getMdBlob().then(function(mdResponse){var contribution=new Markdown(mdResponse);if(contribution.isMetas()){var metas={prose_url:("http://prose.io/#"+html_url.match(/^https:\/\/github.com\/(.*)/)[1]).replace("blob","edit"),git_url:html_url,url:""+html_url.match(/^https:\/\/github.com\/(.*)/)[1],description:contribution.metas.description,title:contribution.metas.title||name,authors:contribution.metas.authors,image_url:contribution.metas.image_url||"http://lorempixel.com/g/350/150/"};html.push(htmlContribWithMetas(metas))}else{var noMetas={title:name,url:""+html_url.match(/^https:\/\/github.com\/(.*)/)[1]};html.push(htmlContribNoMetas(noMetas))}template.folders.html(html.join("\n")),template.folders.renderAsync(template.folders._htmlTpl)})}else{var readmeUrl={owner:router.params.owner,repo:name,branch:"master",path:""+(router.params.path?""+router.params.path+"/README.md":"README.md")},ghApiBlob=new GithubUrl(readmeUrl);ghApiBlob.getMdBlob().then(function(mdResponse){var contribution=new Markdown(mdResponse);if(contribution.isMetas()){var metas={url:""+html_url.match(/^https:\/\/github.com\/(.*)/)[1],title:contribution.metas.title||name,git_url:html_url,folders:12,files:5,contributors:contribution.metas.contributors,description:"Lorem ipsum",image_url:"http://lorempixel.com/g/350/150/"};html.push(htmlFolderWithMetas(metas))}else{var noMetas={title:name,url:""+html_url.match(/^https:\/\/github.com\/(.*)/)[1]};html.push(htmlFolderNoMetas(noMetas))}template.folders.html(html.join("\n")),template.folders.renderAsync(template.folders._htmlTpl)})}})})}}(),!function(){var htmlWithMetas=function(_ref){var url=_ref.url,title=_ref.title,folders=_ref.folders,files=_ref.files,contributors=_ref.contributors,git_url=_ref.git_url,image_url=_ref.image_url,description=_ref.description,readme_url=_ref.readme_url;return'<article class="gh-list-item gh-type-repo">\n <h2 class="gh-list-title"><a href="#'+url+'">'+title+'</a></h2>\n <div class="gh-list-content">\n <div class="gh-list-meta">\n <p>Dossiers : '+folders+" - Fiches : "+files+"</p>\n <p>Contributeurs : "+contributors+'</p>\n </p>\n <p>\n <a href="'+git_url+'">Voir sur Github</a>\n </p>\n </div>\n <img src="'+image_url+'">\n <p class="gh-list-excerpt">'+description+'</p>\n <a class="gh-list-readmore"\n title="Lire la suite de la fiche Titre de la fiche"\n href="#'+readme_url+'">Lire la présentation complète</a>\n </div>\n </article>'},htmlNoMetas=function(_ref2){var url=_ref2.url,title=_ref2.title;return'<article class="gh-list-item gh-type-repo">\n <h2 class="gh-list-title"><a href="#'+url+'">'+title+"</a></h2>\n </article>"};template.repos=new Template("repos"),template.repos.data=function(){var ghApi=new GithubUrl(router.params),html=[];ghApi.getJsonRepo().then(function(jsonResponse){jsonResponse.map(function(_ref3){var name=_ref3.name,html_url=(_ref3.type,_ref3.html_url),readmeUrl=(_ref3.url,{owner:router.params.owner,repo:name,branch:"master",path:"README.md"}),ghApiBlob=new GithubUrl(readmeUrl);ghApiBlob.getMdBlob().then(function(mdResponse){var contribution=new Markdown(mdResponse);if(contribution.isMetas()){var metas={url:html_url.replace("https://github.com/",""),git_url:html_url,readme_url:html_url.replace("https://github.com/","")+"/blob/master/README.md",title:contribution.metas.title,image_url:contribution.metas.image_url||"http://lorempixel.com/g/350/150/",description:contribution.metas.description,contributors:contribution.metas.contributors,folders:contribution.metas.folders,files:contribution.metas.files};html.push(htmlWithMetas(metas))}else{var noMetas={url:html_url.replace("https://github.com/",""),title:name};html.push(htmlNoMetas(noMetas))}template.repos.html(html.join("\n")),template.repos.renderAsync(template.repos._htmlTpl)})})})}}(),!function(){var htmlWithMetas=function(_ref){var url=_ref.url,title=_ref.title,authors=_ref.authors,image_url=(_ref.prose_url,_ref.git_url,_ref.image_url),description=_ref.description;return'<article class="gh-list-item gh-type-file">\n <h2 class="gh-list-title"><a href="#'+url+'">'+title+'</a></h2>\n <div class="gh-list-content">\n <div class="gh-list-meta">\n <p>Créé par : '+authors+'</p>\n </div>\n <img src="'+image_url+'">\n <p class="gh-list-excerpt">'+description+'</p>\n <a class="gh-list-readmore"\n title="Lire la suite de la fiche : $(titre)"\n href="#'+url+'">Lire la fiche</a>\n </div>\n </article>'},htmlNoMetas=function(_ref2){var url=_ref2.url,title=_ref2.title;return'<article class="gh-list-item gh-type-file">\n <h2 class="gh-list-title"><a href="#'+url+'">'+title+"</a></h2>\n </article>"};template.searchList=new Template("searchList"),template.searchList.data=function(){var _router$queries$q$match=router.queries.q.match(/(.*)\+language:Markdown\+user:([0-9A-Za-z\u00C0-\u01
17F\-\_\.]*)/),_router$queries$q$match2=_slicedToArray(_router$queries$q$match,3),query=(_router$queries$q$match2[0],_router$queries$q$match2[1]),user=_router$queries$q$match2[2];router.params.owner=user;var ghApi=new GithubUrl(router.params),html=[];ghApi.getJsonSearch(query).then(function(jsonResponse){jsonResponse.items.map(function(_ref3){var name=_ref3.name,path=_ref3.path,html_url=_ref3.html_url,repository=_ref3.repository,readmeUrl={owner:router.params.owner,repo:repository.name,branch:"master",path:path},ghApiBlob=new GithubUrl(readmeUrl);ghApiBlob.getMdBlob().then(function(mdResponse){var contribution=new Markdown(mdResponse);if(contribution.isMetas()){var metas={prose_url:("http://prose.io/#"+html_url.match(/^https:\/\/github.com\/(.*)/)[1]).replace("blob","edit"),git_url:html_url,url:""+repository.full_name+"/blob/master/"+path,description:contribution.metas.description,title:contribution.metas.title,authors:contribution.metas.contributors,image_url:contribution.metas.image_url||"http://lorempixel.com/g/350/150/"};html.push(htmlWithMetas(metas))}else{var noMetas={title:name,url:""+repository.full_name+"/blob/master/"+path};html.push(htmlNoMetas(noMetas))}template.searchList.html(html.join("\n")),template.searchList.renderAsync(template.searchList._htmlTpl)})})})}}();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.