From 92e76801527e025119c3e313b6348491edae3317 Mon Sep 17 00:00:00 2001 From: Enrico Sacchetti Date: Mon, 2 Oct 2017 19:00:30 -0400 Subject: [PATCH 01/10] feat: initiate job board --- _layouts/default.html | 2 +- jobs/index.html | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 jobs/index.html diff --git a/_layouts/default.html b/_layouts/default.html index 8ceca5a..d5a123e 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -32,7 +32,7 @@

Blog Meetup Events - Job Board + Job Board Archive Code of Conduct diff --git a/jobs/index.html b/jobs/index.html new file mode 100644 index 0000000..3506c30 --- /dev/null +++ b/jobs/index.html @@ -0,0 +1,14 @@ +--- +layout: page +title: Job Board +--- + +
+ +
+ + From d42b37d3a88d45f7cf77a75264cbfa1e23b30b14 Mon Sep 17 00:00:00 2001 From: Enrico Sacchetti Date: Mon, 2 Oct 2017 21:07:37 -0400 Subject: [PATCH 02/10] feat(jobs): return list of jobs --- jobs/index.html | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/jobs/index.html b/jobs/index.html index 3506c30..266bf5a 100644 --- a/jobs/index.html +++ b/jobs/index.html @@ -3,12 +3,47 @@ title: Job Board --- -
+
    -
+ From 6f87123f810d6d04f37a2d7144ca1fc7b9cfa446 Mon Sep 17 00:00:00 2001 From: hutchic Date: Tue, 3 Oct 2017 03:25:54 +0000 Subject: [PATCH 03/10] feat(jobs): make the job list pretty --- Gemfile | 1 + README.md | 6 ++++++ _config.yml | 3 ++- _includes/head.html | 3 +++ css/jobs.scss | 4 ++++ jobs/index.html | 18 +++++++++++++----- 6 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 css/jobs.scss diff --git a/Gemfile b/Gemfile index 053c27d..8a5de68 100644 --- a/Gemfile +++ b/Gemfile @@ -1,2 +1,3 @@ source 'https://rubygems.org' gem 'github-pages' +gem 'jekyll-bootstrap-sass' diff --git a/README.md b/README.md index 237a958..c5c736f 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,12 @@ Follow the [detailed instructions](https://help.github.com/articles/setting-up-y - `git push -u origin feature-branch-name` - Create a pull request on GitHub +## Testing Locally + +``` +docker run -p 80:80 --rm --volume=$PWD:/srv/jekyll -it jekyll/jekyll:3.5 jekyll serve --watch --port 80 +``` + ### Rules for Contributing - Please maintain the same the same code style as the rest of the code base. diff --git a/_config.yml b/_config.yml index f63d9ed..5a33fa5 100644 --- a/_config.yml +++ b/_config.yml @@ -13,5 +13,6 @@ googleCalendar: exclude: [scripts] -gems: +plugins: - jekyll-redirect-from + - jekyll-bootstrap-sass \ No newline at end of file diff --git a/_includes/head.html b/_includes/head.html index 5674010..6c8f9c8 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -50,4 +50,7 @@ + {% if site.bootstrap == true %} + + {% endif %} diff --git a/css/jobs.scss b/css/jobs.scss new file mode 100644 index 0000000..1966cee --- /dev/null +++ b/css/jobs.scss @@ -0,0 +1,4 @@ +--- +--- + +@import 'bootstrap'; \ No newline at end of file diff --git a/jobs/index.html b/jobs/index.html index 266bf5a..3e0c4d0 100644 --- a/jobs/index.html +++ b/jobs/index.html @@ -1,11 +1,15 @@ --- layout: page title: Job Board +bootstrap: true --- -
    + -
+ +
+ +
+ diff --git a/_sass/_layout.scss b/_sass/_layout.scss index ada25f0..0f1dd91 100644 --- a/_sass/_layout.scss +++ b/_sass/_layout.scss @@ -56,6 +56,17 @@ } } +@media (max-width: 480px) { + .show-tablet-up { + display: none; + } +} +@media (max-width: 768px) { + .show-desktop-up { + display: none; + } +} + @media screen and (max-width: 1024px) { .tm-content { padding: 40px 28px; diff --git a/css/jobs.scss b/css/jobs.scss index 1966cee..bc47008 100644 --- a/css/jobs.scss +++ b/css/jobs.scss @@ -1,4 +1,10 @@ ---- ---- - -@import 'bootstrap'; \ No newline at end of file +--- +--- + +.tm-jobs-table { + width: 100%; +} +.tm-jobs-table td { + min-width: 130px; + white-space: normal; +} diff --git a/css/page-min.scss b/css/page-min.scss new file mode 100644 index 0000000..dd44fcb --- /dev/null +++ b/css/page-min.scss @@ -0,0 +1,5 @@ +--- +--- +@charset "utf-8"; + +@import "base", "layout"; diff --git a/events/index.html b/events/index.html index 8f0bf40..bd092c2 100644 --- a/events/index.html +++ b/events/index.html @@ -1,6 +1,7 @@ --- layout: events title: Events +css: events ---
diff --git a/jobs/index.html b/jobs/index.html index 3e0c4d0..be083ea 100644 --- a/jobs/index.html +++ b/jobs/index.html @@ -1,18 +1,24 @@ --- -layout: page +layout: page-min title: Job Board -bootstrap: true +css: jobs --- - - - -
- -
+ + + + + + + + + + +
JobDate PostedLabels
+ + From 51cb77b8e554aa173d2acf6e3785ef388a6f1238 Mon Sep 17 00:00:00 2001 From: hutchic Date: Fri, 6 Oct 2017 04:11:29 +0000 Subject: [PATCH 06/10] feat(jobs): use anchors for direct links and browser history --- assets/js/jobs.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/assets/js/jobs.js b/assets/js/jobs.js index 4e5db2c..7b972e3 100644 --- a/assets/js/jobs.js +++ b/assets/js/jobs.js @@ -2,6 +2,18 @@ var sdConverter = new showdown.Converter() +window.onload = function(event) +{ + if (location.hash != "") { + JobBoard.load() + } +} + +window.onpopstate = function(event) +{ + JobBoard.collapse() +} + var JobBoard = (function () { // Data var api = { @@ -97,13 +109,23 @@ var JobBoard = (function () { jobBody.innerHTML = jobCollection } + + var jobById = function(job) { + return job.id == location.hash.replace("#", "") + } return { + load: function () { + jobDescription.set(sdConverter.makeHtml(jobs.find(jobById).body)).open() + jobTable.close() + }, expand: function (el) { + history.pushState(undefined, undefined, "#" + jobs[el.dataset.index].id) jobDescription.set(sdConverter.makeHtml(jobs[el.dataset.index].body)).open() jobTable.close() }, collapse: function () { + history.pushState("", document.title, window.location.pathname + window.location.search) jobDescription.close() jobTable.open() } From e76b89ce4f91dace441946f3357a6a0edd585ebe Mon Sep 17 00:00:00 2001 From: hutchic Date: Fri, 6 Oct 2017 04:16:25 +0000 Subject: [PATCH 07/10] feat(jobs): handle job anchors that don't exist anymore --- assets/js/jobs.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/js/jobs.js b/assets/js/jobs.js index 7b972e3..8b3335a 100644 --- a/assets/js/jobs.js +++ b/assets/js/jobs.js @@ -116,7 +116,13 @@ var JobBoard = (function () { return { load: function () { - jobDescription.set(sdConverter.makeHtml(jobs.find(jobById).body)).open() + var job = jobs.find(jobById) + if (job == undefined) { + history.pushState("", document.title, window.location.pathname + window.location.search) + return + } + + jobDescription.set(sdConverter.makeHtml(job.body)).open() jobTable.close() }, expand: function (el) { From 849050eb87847b890d5ca42166553419a1f96e68 Mon Sep 17 00:00:00 2001 From: Enrico Sacchetti Date: Wed, 11 Oct 2017 00:16:51 -0400 Subject: [PATCH 08/10] feat(jobs): polish controller - use unpkg for bluebird and showdown - add styles for job details --- assets/js/jobs.js | 175 ++++++++++++++++++++++++-------------- assets/js/showdown.min.js | 3 - css/jobs.scss | 12 +++ jobs/index.html | 7 +- 4 files changed, 127 insertions(+), 70 deletions(-) delete mode 100644 assets/js/showdown.min.js diff --git a/assets/js/jobs.js b/assets/js/jobs.js index 8b3335a..1a680d8 100644 --- a/assets/js/jobs.js +++ b/assets/js/jobs.js @@ -1,30 +1,24 @@ -/* globals showdown */ +/* globals showdown, XMLHttpRequest, history, Promise */ -var sdConverter = new showdown.Converter() - -window.onload = function(event) -{ - if (location.hash != "") { - JobBoard.load() - } -} - -window.onpopstate = function(event) -{ - JobBoard.collapse() -} +var sdConverter = new showdown.Converter({ + simplifiedAutoLink: true +}) +// Job Board Controller var JobBoard = (function () { - // Data + // Options var api = { endpoint: 'https://api.github.com/repos/TechnologyMasters/jobs/issues', headers: { Accept: 'application/vnd.github.v3+json' } } - var jobs = null + var jobs = null // contains fetched jobs + + /** + * Components + */ - // Components var jobTable = (function (el) { var element = el @@ -38,16 +32,28 @@ var JobBoard = (function () { } })(document.getElementById('job-table')) - var jobBody = document.getElementById('job-body') + // Wrapper for job rows + var jobBody = (function (el) { + var element = el + + return { + set: function (value) { + element.innerHTML = value + return element + } + } + })(document.getElementById('job-body')) + + // Single table row containing job details var jobItem = function (element, index) { var date = new Date(element.created_at) var dateOptions = { - year: "numeric", month: "short", day: "numeric" + year: 'numeric', month: 'short', day: 'numeric' } - var postedDate = date.toLocaleDateString("en-US", dateOptions) + var postedDate = date.toLocaleDateString('en-US', dateOptions) var labels = '' - element.labels.forEach(function(label) { + element.labels.forEach(function (label) { labels += '\ \ ' + label.name + '\ @@ -55,7 +61,7 @@ var JobBoard = (function () { }) return '\ - \ + \ \ ' + element.title + '\ \ @@ -68,13 +74,19 @@ var JobBoard = (function () { ' } - var jobDescription = (function (el, body) { + // "Expanded job description" wrapper + var jobDescription = (function (el, title, body) { var element = el + var elTitle = title var elBody = body return { - set: function (html) { - elBody.innerHTML = html + setTitle: function (title) { + elTitle.innerHTML = title + return this + }, + setBody: function (html, raw) { + elBody.innerHTML = raw ? html : sdConverter.makeHtml(html) return this }, close: function () { @@ -84,56 +96,89 @@ var JobBoard = (function () { element.style.display = 'block' } } - })(document.getElementById('tm-jobs-description'), document.getElementById('tm-jobs-description_body')) - - // Get jobs json - var request = new XMLHttpRequest() - request.open('GET', api.endpoint) - request.setRequestHeader('Accept', api.headers.Accept) - request.onload = function () { - if (request.status >= 200) { - jobs = JSON.parse(request.responseText) - setupJobs() - } - } - - request.send() - - // Create paginated list - var setupJobs = function () { - var jobCollection = '' - - jobs.forEach(function (element, index) { - jobCollection += jobItem(element, index) - }); - - jobBody.innerHTML = jobCollection - } - - var jobById = function(job) { - return job.id == location.hash.replace("#", "") - } + })( + document.getElementById('tm-jobs-description'), + document.getElementById('tm-jobs-description_title'), + document.getElementById('tm-jobs-description_body') + ) return { - load: function () { - var job = jobs.find(jobById) - if (job == undefined) { - history.pushState("", document.title, window.location.pathname + window.location.search) + loadHash: function () { + var findJob = function (el) { + return el.id === parseInt(window.location.hash.replace('#', '')) + } + + var job = jobs.find(findJob) + var jobIndex = jobs.findIndex(findJob) + if (!!job === false) { return } - jobDescription.set(sdConverter.makeHtml(job.body)).open() - jobTable.close() + this.expand( + jobIndex, + document.title, + window.location.pathname + window.location.search + ) }, - expand: function (el) { - history.pushState(undefined, undefined, "#" + jobs[el.dataset.index].id) - jobDescription.set(sdConverter.makeHtml(jobs[el.dataset.index].body)).open() + loadJobs: function () { + // Get jobs json + var self = this + var request = new XMLHttpRequest() + + var promise = new Promise(function (resolve, reject) { + request.open('GET', api.endpoint) + request.setRequestHeader('Accept', api.headers.Accept) + request.onload = function () { + if (request.status >= 200) { + jobs = JSON.parse(request.responseText) + self.listJobs() + resolve() + } + } + request.send() + }) + + return promise + }, + expand: function (index, title, path) { + history.pushState(undefined, undefined, '#' + jobs[index].id) + jobDescription + .setTitle(jobs[index].title) + .setBody(jobs[index].body) + .open() jobTable.close() }, collapse: function () { - history.pushState("", document.title, window.location.pathname + window.location.search) + history.pushState( + '', + document.title, + window.location.pathname + window.location.search + ) jobDescription.close() jobTable.open() - } + }, + listJobs: function () { + var jobCollection = '' + + jobs.forEach(function (element, index) { + jobCollection += jobItem(element, index) + }) + + jobBody.set(jobCollection) + }, + showTable: jobTable.open } })() + +// Main +JobBoard.loadJobs().then(function () { // fetch job data from GitHub + if (window.location.hash !== '') { + JobBoard.loadHash() + } else { + JobBoard.showTable() + } +}) + +window.onpopstate = function (event) { + JobBoard.collapse() +} diff --git a/assets/js/showdown.min.js b/assets/js/showdown.min.js deleted file mode 100644 index e648c23..0000000 --- a/assets/js/showdown.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! showdown v 1.7.5 - 02-10-2017 */ -(function(){function e(e){"use strict";var r={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:"Remove only spaces, ' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids",type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,description:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,description:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,description:"Parses simple line breaks as
(GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex:
foo
",type:"boolean"}};if(!1===e)return JSON.parse(JSON.stringify(r));var t={};for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n].defaultValue);return t}function r(e,r){"use strict";var t=r?"Error in "+r+" extension->":"Error in unnamed extension",s={valid:!0,error:""};n.helper.isArray(e)||(e=[e]);for(var a=0;a-1,p=new RegExp(r+"|"+t,"g"+l.replace(/g/g,"")),d=new RegExp(r,l.replace(/g/g,"")),h=[];do{for(s=0;i=p.exec(e);)if(d.test(i[0]))s++||(o=(a=p.lastIndex)-i[0].length);else if(s&&!--s){c=i.index+i[0].length;var f={left:{start:o,end:a},match:{start:a,end:i.index},right:{start:i.index,end:c},wholeMatch:{start:o,end:c}};if(h.push(f),!u)return h}}while(s&&(p.lastIndex=a));return h};n.helper.matchRecursiveRegExp=function(e,r,t,n){"use strict";for(var s=l(e,r,t,n),a=[],i=0;i0){var p=[];0!==o[0].wholeMatch.start&&p.push(e.slice(0,o[0].wholeMatch.start));for(var d=0;d=0?s+(t||0):s},n.helper.splitAtIndex=function(e,r){"use strict";if(!n.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[e.substring(0,r),e.substring(r)]},n.helper.encodeEmailAddress=function(e){"use strict";var r=[function(e){return"&#"+e.charCodeAt(0)+";"},function(e){return"&#x"+e.charCodeAt(0).toString(16)+";"},function(e){return e}];return e=e.replace(/./g,function(e){if("@"===e)e=r[Math.floor(2*Math.random())](e);else{var t=Math.random();e=t>.9?r[2](e):t>.45?r[1](e):r[0](e)}return e})},"undefined"==typeof console&&(console={warn:function(e){"use strict";alert(e)},log:function(e){"use strict";alert(e)},error:function(e){"use strict";throw e}}),n.helper.regexes={asteriskAndDash:/([*_])/g},n.Converter=function(e){"use strict";function t(e,t){if(t=t||null,n.helper.isString(e)){if(e=n.helper.stdExtName(e),t=e,n.extensions[e])return console.warn("DEPRECATION WARNING: "+e+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),void s(n.extensions[e],e);if(n.helper.isUndefined(a[e]))throw Error('Extension "'+e+'" could not be loaded. It was either not found or is not a valid extension.');e=a[e]}"function"==typeof e&&(e=e()),n.helper.isArray(e)||(e=[e]);var i=r(e,t);if(!i.valid)throw Error(i.error);for(var o=0;o? ?(['"].*['"])?\)$/m)>-1)i="";else if(!i){if(a||(a=s.toLowerCase().replace(/ ?\n/g," ")),i="#"+a,n.helper.isUndefined(t.gUrls[a]))return e;i=t.gUrls[a],n.helper.isUndefined(t.gTitles[a])||(l=t.gTitles[a])}var u='"};return e=(e=t.converter._dispatch("anchors.before",e,r,t)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,s),e=e.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,s),e=e.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]??(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,s),e=e.replace(/\[([^\[\]]+)]()()()()()/g,s),r.ghMentions&&(e=e.replace(/(^|\s)(\\)?(@([a-z\d\-]+))(?=[.!?;,[\]()]|\s|$)/gim,function(e,t,s,a,i){if("\\"===s)return t+a;if(!n.helper.isString(r.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var o=r.ghMentionsLink.replace(/\{u}/g,i),c="";return r.openLinksInNewWindow&&(c=' target="¨E95Eblank"'),t+'"+a+""})),e=t.converter._dispatch("anchors.after",e,r,t)});var u=/\b(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+)()(?=\s|$)(?!["<>])/gi,p=/\b(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]]?)(?=\s|$)(?!["<>])/gi,d=/<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>/gi,h=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,f=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,g=function(e){"use strict";return function(r,t,n,s,a){var i=t,o="",c="";return/^www\./i.test(t)&&(t=t.replace(/^www\./i,"http://www.")),e.excludeTrailingPunctuationFromURLs&&a&&(o=a),e.openLinksInNewWindow&&(c=' target="¨E95Eblank"'),'"+i+""+o}},b=function(e,r){"use strict";return function(t,s,a){var i="mailto:";return s=s||"",a=n.subParser("unescapeSpecialChars")(a,e,r),e.encodeEmails?(i=n.helper.encodeEmailAddress(i+a),a=n.helper.encodeEmailAddress(a)):i+=a,s+''+a+""}};n.subParser("autoLinks",function(e,r,t){"use strict";return e=t.converter._dispatch("autoLinks.before",e,r,t),e=e.replace(d,g(r)),e=e.replace(f,b(r,t)),e=t.converter._dispatch("autoLinks.after",e,r,t)}),n.subParser("simplifiedAutoLinks",function(e,r,t){"use strict";return r.simplifiedAutoLink?(e=t.converter._dispatch("simplifiedAutoLinks.before",e,r,t),e=r.excludeTrailingPunctuationFromURLs?e.replace(p,g(r)):e.replace(u,g(r)),e=e.replace(h,b(r,t)),e=t.converter._dispatch("simplifiedAutoLinks.after",e,r,t)):e}),n.subParser("blockGamut",function(e,r,t){"use strict";return e=t.converter._dispatch("blockGamut.before",e,r,t),e=n.subParser("blockQuotes")(e,r,t),e=n.subParser("headers")(e,r,t),e=n.subParser("horizontalRule")(e,r,t),e=n.subParser("lists")(e,r,t),e=n.subParser("codeBlocks")(e,r,t),e=n.subParser("tables")(e,r,t),e=n.subParser("hashHTMLBlocks")(e,r,t),e=n.subParser("paragraphs")(e,r,t),e=t.converter._dispatch("blockGamut.after",e,r,t)}),n.subParser("blockQuotes",function(e,r,t){"use strict";return e=t.converter._dispatch("blockQuotes.before",e,r,t),e=e.replace(/((^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(e,s){var a=s;return a=a.replace(/^[ \t]*>[ \t]?/gm,"¨0"),a=a.replace(/¨0/g,""),a=a.replace(/^[ \t]+$/gm,""),a=n.subParser("githubCodeBlocks")(a,r,t),a=n.subParser("blockGamut")(a,r,t),a=a.replace(/(^|\n)/g,"$1 "),a=a.replace(/(\s*
[^\r]+?<\/pre>)/gm,function(e,r){var t=r;return t=t.replace(/^  /gm,"¨0"),t=t.replace(/¨0/g,"")}),n.subParser("hashBlock")("
\n"+a+"\n
",r,t)}),e=t.converter._dispatch("blockQuotes.after",e,r,t)}),n.subParser("codeBlocks",function(e,r,t){"use strict";e=t.converter._dispatch("codeBlocks.before",e,r,t);var s=/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;return e=(e+="¨0").replace(s,function(e,s,a){var i=s,o=a,c="\n";return i=n.subParser("outdent")(i,r,t),i=n.subParser("encodeCode")(i,r,t),i=n.subParser("detab")(i,r,t),i=i.replace(/^\n+/g,""),i=i.replace(/\n+$/g,""),r.omitExtraWLInCodeBlocks&&(c=""),i="
"+i+c+"
",n.subParser("hashBlock")(i,r,t)+o}),e=e.replace(/¨0/,""),e=t.converter._dispatch("codeBlocks.after",e,r,t)}),n.subParser("codeSpans",function(e,r,t){"use strict";return void 0===(e=t.converter._dispatch("codeSpans.before",e,r,t))&&(e=""),e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(e,s,a,i){var o=i;return o=o.replace(/^([ \t]*)/g,""),o=o.replace(/[ \t]*$/g,""),o=n.subParser("encodeCode")(o,r,t),s+""+o+""}),e=t.converter._dispatch("codeSpans.after",e,r,t)}),n.subParser("detab",function(e,r,t){"use strict";return e=t.converter._dispatch("detab.before",e,r,t),e=e.replace(/\t(?=\t)/g," "),e=e.replace(/\t/g,"¨A¨B"),e=e.replace(/¨B(.+?)¨A/g,function(e,r){for(var t=r,n=4-t.length%4,s=0;s/g,">"),e=t.converter._dispatch("encodeAmpsAndAngles.after",e,r,t)}),n.subParser("encodeBackslashEscapes",function(e,r,t){"use strict";return e=t.converter._dispatch("encodeBackslashEscapes.before",e,r,t),e=e.replace(/\\(\\)/g,n.helper.escapeCharactersCallback),e=e.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,n.helper.escapeCharactersCallback),e=t.converter._dispatch("encodeBackslashEscapes.after",e,r,t)}),n.subParser("encodeCode",function(e,r,t){"use strict";return e=t.converter._dispatch("encodeCode.before",e,r,t),e=e.replace(/&/g,"&").replace(//g,">").replace(/([*_{}\[\]\\=~-])/g,n.helper.escapeCharactersCallback),e=t.converter._dispatch("encodeCode.after",e,r,t)}),n.subParser("escapeSpecialCharsWithinTagAttributes",function(e,r,t){"use strict";var s=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>)/gi,a=/-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;return e=(e=t.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",e,r,t)).replace(s,function(e){return e.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,n.helper.escapeCharactersCallback)}),e=e.replace(a,function(e){return e.replace(/([\\`*_~=|])/g,n.helper.escapeCharactersCallback)}),e=t.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",e,r,t)}),n.subParser("githubCodeBlocks",function(e,r,t){"use strict";return r.ghCodeBlocks?(e=t.converter._dispatch("githubCodeBlocks.before",e,r,t),e+="¨0",e=e.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g,function(e,s,a){var i=r.omitExtraWLInCodeBlocks?"":"\n";return a=n.subParser("encodeCode")(a,r,t),a=n.subParser("detab")(a,r,t),a=a.replace(/^\n+/g,""),a=a.replace(/\n+$/g,""),a="
"+a+i+"
",a=n.subParser("hashBlock")(a,r,t),"\n\n¨G"+(t.ghCodeBlocks.push({text:e,codeblock:a})-1)+"G\n\n"}),e=e.replace(/¨0/,""),t.converter._dispatch("githubCodeBlocks.after",e,r,t)):e}),n.subParser("hashBlock",function(e,r,t){"use strict";return e=t.converter._dispatch("hashBlock.before",e,r,t),e=e.replace(/(^\n+|\n+$)/g,""),e="\n\n¨K"+(t.gHtmlBlocks.push(e)-1)+"K\n\n",e=t.converter._dispatch("hashBlock.after",e,r,t)}),n.subParser("hashCodeTags",function(e,r,t){"use strict";e=t.converter._dispatch("hashCodeTags.before",e,r,t);return e=n.helper.replaceRecursiveRegExp(e,function(e,s,a,i){var o=a+n.subParser("encodeCode")(s,r,t)+i;return"¨C"+(t.gHtmlSpans.push(o)-1)+"C"},"]*>","","gim"),e=t.converter._dispatch("hashCodeTags.after",e,r,t)}),n.subParser("hashElement",function(e,r,t){"use strict";return function(e,r){var n=r;return n=n.replace(/\n\n/g,"\n"),n=n.replace(/^\n/,""),n=n.replace(/\n+$/g,""),n="\n\n¨K"+(t.gHtmlBlocks.push(n)-1)+"K\n\n"}}),n.subParser("hashHTMLBlocks",function(e,r,t){"use strict";e=t.converter._dispatch("hashHTMLBlocks.before",e,r,t);var s=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"];r.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,function(e,r){return"<"+r+">"}));for(var a=0;a]*>)","im"),c="<"+s[a]+"\\b[^>]*>",l="";-1!==(i=n.helper.regexIndexOf(e,o));){var u=n.helper.splitAtIndex(e,i),p=n.helper.replaceRecursiveRegExp(u[1],function(e,r,n,s){var a=e;return-1!==n.search(/\bmarkdown\b/)&&(a=n+t.converter.makeHtml(r)+s),"\n\n¨K"+(t.gHtmlBlocks.push(a)-1)+"K\n\n"},c,l,"im");if(p===u[1])break;e=u[0].concat(p)}return e=e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,n.subParser("hashElement")(e,r,t)),e=n.helper.replaceRecursiveRegExp(e,function(e){return"\n\n¨K"+(t.gHtmlBlocks.push(e)-1)+"K\n\n"},"^ {0,3}\x3c!--","--\x3e","gm"),e=e.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,n.subParser("hashElement")(e,r,t)),e=t.converter._dispatch("hashHTMLBlocks.after",e,r,t)}),n.subParser("hashHTMLSpans",function(e,r,t){"use strict";function n(e){return"¨C"+(t.gHtmlSpans.push(e)-1)+"C"}return e=t.converter._dispatch("hashHTMLSpans.before",e,r,t),e=e.replace(/<[^>]+?\/>/gi,function(e){return n(e)}),e=e.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(e){return n(e)}),e=e.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(e){return n(e)}),e=e.replace(/<[^>]+?>/gi,function(e){return n(e)}),e=t.converter._dispatch("hashHTMLSpans.after",e,r,t)}),n.subParser("unhashHTMLSpans",function(e,r,t){"use strict";e=t.converter._dispatch("unhashHTMLSpans.before",e,r,t);for(var n=0;n]*>\\s*]*>","^ {0,3}\\s*
","gim"),e=t.converter._dispatch("hashPreCodeTags.after",e,r,t)}),n.subParser("headers",function(e,r,t){"use strict";function s(e){var s,a;if(r.customizedHeaderId){var i=e.match(/\{([^{]+?)}\s*$/);i&&i[1]&&(e=i[1])}return s=e,a=n.helper.isString(r.prefixHeaderId)?r.prefixHeaderId:!0===r.prefixHeaderId?"section-":"",r.rawPrefixHeaderId||(s=a+s),s=r.ghCompatibleHeaderId?s.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():r.rawHeaderId?s.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():s.replace(/[^\w]/g,"").toLowerCase(),r.rawPrefixHeaderId&&(s=a+s),t.hashLinkCounts[s]?s=s+"-"+t.hashLinkCounts[s]++:t.hashLinkCounts[s]=1,s}e=t.converter._dispatch("headers.before",e,r,t);var a=isNaN(parseInt(r.headerLevelStart))?1:parseInt(r.headerLevelStart),i=r.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,o=r.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;e=(e=e.replace(i,function(e,i){var o=n.subParser("spanGamut")(i,r,t),c=r.noHeaderId?"":' id="'+s(i)+'"',l=a,u=""+o+"";return n.subParser("hashBlock")(u,r,t)})).replace(o,function(e,i){var o=n.subParser("spanGamut")(i,r,t),c=r.noHeaderId?"":' id="'+s(i)+'"',l=a+1,u=""+o+"";return n.subParser("hashBlock")(u,r,t)});var c=r.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;return e=e.replace(c,function(e,i,o){var c=o;r.customizedHeaderId&&(c=o.replace(/\s?\{([^{]+?)}\s*$/,""));var l=n.subParser("spanGamut")(c,r,t),u=r.noHeaderId?"":' id="'+s(o)+'"',p=a-1+i.length,d=""+l+"";return n.subParser("hashBlock")(d,r,t)}),e=t.converter._dispatch("headers.after",e,r,t)}),n.subParser("horizontalRule",function(e,r,t){"use strict";e=t.converter._dispatch("horizontalRule.before",e,r,t);var s=n.subParser("hashBlock")("
",r,t);return e=e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,s),e=e.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,s),e=e.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,s),e=t.converter._dispatch("horizontalRule.after",e,r,t)}),n.subParser("images",function(e,r,t){"use strict";function s(e,r,s,a,i,o,c,l){var u=t.gUrls,p=t.gTitles,d=t.gDimensions;if(s=s.toLowerCase(),l||(l=""),e.search(/\(? ?(['"].*['"])?\)$/m)>-1)a="";else if(""===a||null===a){if(""!==s&&null!==s||(s=r.toLowerCase().replace(/ ?\n/g," ")),a="#"+s,n.helper.isUndefined(u[s]))return e;a=u[s],n.helper.isUndefined(p[s])||(l=p[s]),n.helper.isUndefined(d[s])||(i=d[s].width,o=d[s].height)}r=r.replace(/"/g,""").replace(n.helper.regexes.asteriskAndDash,n.helper.escapeCharactersCallback);var h=''+r+'"}var a=/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,i=/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,o=/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,c=/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,l=/!\[([^\[\]]+)]()()()()()/g;return e=(e=t.converter._dispatch("images.before",e,r,t)).replace(c,s),e=e.replace(o,function(e,r,t,n,a,i,o,c){return n=n.replace(/\s/g,""),s(e,r,t,n,a,i,0,c)}),e=e.replace(i,s),e=e.replace(a,s),e=e.replace(l,s),e=t.converter._dispatch("images.after",e,r,t)}),n.subParser("italicsAndBold",function(e,r,t){"use strict";function s(e,s,a){return r.simplifiedAutoLink&&(e=n.subParser("simplifiedAutoLinks")(e,r,t)),s+e+a}return e=t.converter._dispatch("italicsAndBold.before",e,r,t),e=r.literalMidWordUnderscores?(e=(e=e.replace(/\b___(\S[\s\S]*)___\b/g,function(e,r){return s(r,"","")})).replace(/\b__(\S[\s\S]*)__\b/g,function(e,r){return s(r,"","")})).replace(/\b_(\S[\s\S]*?)_\b/g,function(e,r){return s(r,"","")}):(e=(e=e.replace(/___(\S[\s\S]*?)___/g,function(e,r){return/\S$/.test(r)?s(r,"",""):e})).replace(/__(\S[\s\S]*?)__/g,function(e,r){return/\S$/.test(r)?s(r,"",""):e})).replace(/_([^\s_][\s\S]*?)_/g,function(e,r){return/\S$/.test(r)?s(r,"",""):e}),e=r.literalMidWordAsterisks?(e=(e=e.trim().replace(/(^| )\*{3}(\S[\s\S]*?)\*{3}([ ,;!?.]|$)/g,function(e,r,t,n){return s(t,r+"",""+n)})).trim().replace(/(^| )\*{2}(\S[\s\S]*?)\*{2}([ ,;!?.]|$)/g,function(e,r,t,n){return s(t,r+"",""+n)})).trim().replace(/(^| )\*(\S[\s\S]*?)\*([ ,;!?.]|$)/g,function(e,r,t,n){return s(t,r+"",""+n)}):(e=(e=e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(e,r){return/\S$/.test(r)?s(r,"",""):e})).replace(/\*\*(\S[\s\S]*?)\*\*/g,function(e,r){return/\S$/.test(r)?s(r,"",""):e})).replace(/\*([^\s*][\s\S]*?)\*/g,function(e,r){return/\S$/.test(r)?s(r,"",""):e}),e=t.converter._dispatch("italicsAndBold.after",e,r,t)}),n.subParser("lists",function(e,r,t){"use strict";function s(e,s){t.gListLevel++,e=e.replace(/\n{2,}$/,"\n"),e+="¨0";var a=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,i=/\n[ \t]*\n(?!¨0)/.test(e);return r.disableForced4SpacesIndentedSublists&&(a=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),e=e.replace(a,function(e,s,a,o,c,l,u){u=u&&""!==u.trim();var p=n.subParser("outdent")(c,r,t),d="";return l&&r.tasklists&&(d=' class="task-list-item" style="list-style-type: none;"',p=p.replace(/^[ \t]*\[(x|X| )?]/m,function(){var e='-1?(p=n.subParser("githubCodeBlocks")(p,r,t),p=n.subParser("blockGamut")(p,r,t)):(p=(p=n.subParser("lists")(p,r,t)).replace(/\n$/,""),p=(p=n.subParser("hashHTMLBlocks")(p,r,t)).replace(/\n\n+/g,"\n\n"),p=i?n.subParser("paragraphs")(p,r,t):n.subParser("spanGamut")(p,r,t)),p=p.replace("¨A",""),p=""+p+"\n"}),e=e.replace(/¨0/g,""),t.gListLevel--,s&&(e=e.replace(/\s+$/,"")),e}function a(e,t,n){var a=r.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,i=r.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,o="ul"===t?a:i,c="";return-1!==e.search(o)?function e(r){var l=r.search(o);-1!==l?(c+="\n<"+t+">\n"+s(r.slice(0,l),!!n)+"\n",o="ul"===(t="ul"===t?"ol":"ul")?a:i,e(r.slice(l))):c+="\n<"+t+">\n"+s(r,!!n)+"\n"}(e):c="\n<"+t+">\n"+s(e,!!n)+"\n",c}return e=t.converter._dispatch("lists.before",e,r,t),e+="¨0",e=t.gListLevel?e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(e,r,t){return a(r,t.search(/[*+-]/g)>-1?"ul":"ol",!0)}):e.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(e,r,t,n){return a(t,n.search(/[*+-]/g)>-1?"ul":"ol",!1)}),e=e.replace(/¨0/,""),e=t.converter._dispatch("lists.after",e,r,t)}),n.subParser("outdent",function(e,r,t){"use strict";return e=t.converter._dispatch("outdent.before",e,r,t),e=e.replace(/^(\t|[ ]{1,4})/gm,"¨0"),e=e.replace(/¨0/g,""),e=t.converter._dispatch("outdent.after",e,r,t)}),n.subParser("paragraphs",function(e,r,t){"use strict";for(var s=(e=(e=(e=t.converter._dispatch("paragraphs.before",e,r,t)).replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),a=[],i=s.length,o=0;o=0?a.push(c):c.search(/\S/)>=0&&(c=(c=n.subParser("spanGamut")(c,r,t)).replace(/^([ \t]*)/g,"

"),c+="

",a.push(c))}for(i=a.length,o=0;o]*>\s*]*>/.test(u)&&(p=!0)}a[o]=u}return e=a.join("\n"),e=e.replace(/^\n+/g,""),e=e.replace(/\n+$/g,""),t.converter._dispatch("paragraphs.after",e,r,t)}),n.subParser("runExtension",function(e,r,t,n){"use strict";if(e.filter)r=e.filter(r,n.converter,t);else if(e.regex){var s=e.regex;s instanceof RegExp||(s=new RegExp(s,"g")),r=r.replace(s,e.replace)}return r}),n.subParser("spanGamut",function(e,r,t){"use strict";return e=t.converter._dispatch("spanGamut.before",e,r,t),e=n.subParser("codeSpans")(e,r,t),e=n.subParser("escapeSpecialCharsWithinTagAttributes")(e,r,t),e=n.subParser("encodeBackslashEscapes")(e,r,t),e=n.subParser("images")(e,r,t),e=n.subParser("anchors")(e,r,t),e=n.subParser("autoLinks")(e,r,t),e=n.subParser("italicsAndBold")(e,r,t),e=n.subParser("strikethrough")(e,r,t),e=n.subParser("simplifiedAutoLinks")(e,r,t),e=n.subParser("hashHTMLSpans")(e,r,t),e=n.subParser("encodeAmpsAndAngles")(e,r,t),r.simpleLineBreaks?/\n\n¨K/.test(e)||(e=e.replace(/\n+/g,"
\n")):e=e.replace(/ +\n/g,"
\n"),e=t.converter._dispatch("spanGamut.after",e,r,t)}),n.subParser("strikethrough",function(e,r,t){"use strict";function s(e){return r.simplifiedAutoLink&&(e=n.subParser("simplifiedAutoLinks")(e,r,t)),""+e+""}return r.strikethrough&&(e=(e=t.converter._dispatch("strikethrough.before",e,r,t)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(e,r){return s(r)}),e=t.converter._dispatch("strikethrough.after",e,r,t)),e}),n.subParser("stripLinkDefinitions",function(e,r,t){"use strict";var s=/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,a=/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,i=function(e,s,a,i,o,c,l){return s=s.toLowerCase(),a.match(/^data:.+?\/.+?;base64,/)?t.gUrls[s]=a.replace(/\s/g,""):t.gUrls[s]=n.subParser("encodeAmpsAndAngles")(a,r,t),c?c+l:(l&&(t.gTitles[s]=l.replace(/"|'/g,""")),r.parseImgDimensions&&i&&o&&(t.gDimensions[s]={width:i,height:o}),"")};return e=(e+="¨0").replace(a,i),e=e.replace(s,i),e=e.replace(/¨0/,"")}),n.subParser("tables",function(e,r,t){"use strict";function s(e){return/^:[ \t]*--*$/.test(e)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(e)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(e)?' style="text-align:center;"':""}function a(e,s){var a="";return e=e.trim(),(r.tablesHeaderId||r.tableHeaderId)&&(a=' id="'+e.replace(/ /g,"_").toLowerCase()+'"'),e=n.subParser("spanGamut")(e,r,t),""+e+"\n"}function i(e,s){return""+n.subParser("spanGamut")(e,r,t)+"\n"}function o(e,r){for(var t="\n\n\n",n=e.length,s=0;s\n\n\n",s=0;s\n";for(var a=0;a\n"}return t+="\n
\n"}function c(e){var r,t=e.split("\n");for(r=0;r
- + +
+

- + + From 5cd478ac46e45e8cbcde764f71236708a1de4467 Mon Sep 17 00:00:00 2001 From: Enrico Sacchetti Date: Wed, 11 Oct 2017 22:40:07 -0400 Subject: [PATCH 09/10] feat(jobs): add button for posting new jobs - refactor job board class names --- _config.yml | 2 ++ assets/js/jobs.js | 6 +++--- css/jobs.scss | 12 +++++++++--- jobs/index.html | 14 ++++++++++---- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/_config.yml b/_config.yml index f63d9ed..8afb466 100644 --- a/_config.yml +++ b/_config.yml @@ -11,6 +11,8 @@ googleCalendar: apiKey: AIzaSyD5FZvh3-1WZMbBj0M10zzO3GEQQlYADXg calendarId: zamtools.com_sksehlk62uahqednpmvbp7isno@group.calendar.google.com +newJob: https://github.com/TechnologyMasters/jobs/issues/new + exclude: [scripts] gems: diff --git a/assets/js/jobs.js b/assets/js/jobs.js index 1a680d8..a40f5a1 100644 --- a/assets/js/jobs.js +++ b/assets/js/jobs.js @@ -97,9 +97,9 @@ var JobBoard = (function () { } } })( - document.getElementById('tm-jobs-description'), - document.getElementById('tm-jobs-description_title'), - document.getElementById('tm-jobs-description_body') + document.getElementById('tm-jobs_description'), + document.getElementById('tm-jobs_description_title'), + document.getElementById('tm-jobs_description_body') ) return { diff --git a/css/jobs.scss b/css/jobs.scss index 6cf819b..6e76173 100644 --- a/css/jobs.scss +++ b/css/jobs.scss @@ -4,7 +4,12 @@ .job-board .tm-main { margin-top: 0; } -.tm-jobs-table { + +.tm-jobs_add { + background-color: #ededed; +} + +.tm-jobs_table { display: none; width: 100%; @@ -17,7 +22,8 @@ white-space: normal; } } -.tm-jobs-description { + +.tm-jobs_description { display: none; padding: 1rem; word-wrap: break-word; @@ -27,7 +33,7 @@ } } -.tm-jobs-description_backButton { +.tm-jobs_description_backButton { padding: 0.5rem 1rem; cursor: pointer; } diff --git a/jobs/index.html b/jobs/index.html index 24ddfa7..32ba511 100644 --- a/jobs/index.html +++ b/jobs/index.html @@ -4,7 +4,13 @@ css: jobs --- - + + +
@@ -16,11 +22,11 @@
Job
-
+

-

-
+

+
From ac642126d4d5fd63d9c5bece0c974b4d57d2d61c Mon Sep 17 00:00:00 2001 From: Enrico Sacchetti Date: Fri, 13 Oct 2017 00:27:44 -0400 Subject: [PATCH 10/10] refactor(jobs): use builder pattern in js, - add polyfill.io --- assets/js/jobs.js | 35 +++++++++++------------------------ jobs/index.html | 2 +- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/assets/js/jobs.js b/assets/js/jobs.js index a40f5a1..d0bcb4c 100644 --- a/assets/js/jobs.js +++ b/assets/js/jobs.js @@ -45,15 +45,15 @@ var JobBoard = (function () { })(document.getElementById('job-body')) // Single table row containing job details - var jobItem = function (element, index) { - var date = new Date(element.created_at) + var buildJobItem = function (job, index) { + var date = new Date(job.created_at) var dateOptions = { year: 'numeric', month: 'short', day: 'numeric' } var postedDate = date.toLocaleDateString('en-US', dateOptions) var labels = '' - element.labels.forEach(function (label) { + job.labels.forEach(function (label) { labels += '\ \ ' + label.name + '\ @@ -63,7 +63,7 @@ var JobBoard = (function () { return '\ \ \ - ' + element.title + '\ + ' + job.title + '\ \ \ ' + postedDate + '\ @@ -81,12 +81,9 @@ var JobBoard = (function () { var elBody = body return { - setTitle: function (title) { + setHtml: function (title, body, raw) { elTitle.innerHTML = title - return this - }, - setBody: function (html, raw) { - elBody.innerHTML = raw ? html : sdConverter.makeHtml(html) + elBody.innerHTML = raw ? body : sdConverter.makeHtml(body) return this }, close: function () { @@ -114,11 +111,7 @@ var JobBoard = (function () { return } - this.expand( - jobIndex, - document.title, - window.location.pathname + window.location.search - ) + this.expand(jobIndex) }, loadJobs: function () { // Get jobs json @@ -140,11 +133,10 @@ var JobBoard = (function () { return promise }, - expand: function (index, title, path) { + expand: function (index) { history.pushState(undefined, undefined, '#' + jobs[index].id) jobDescription - .setTitle(jobs[index].title) - .setBody(jobs[index].body) + .setHtml(jobs[index].title, jobs[index].body) .open() jobTable.close() }, @@ -158,13 +150,8 @@ var JobBoard = (function () { jobTable.open() }, listJobs: function () { - var jobCollection = '' - - jobs.forEach(function (element, index) { - jobCollection += jobItem(element, index) - }) - - jobBody.set(jobCollection) + var jobTableRowsHtml = jobs.map(buildJobItem).join('') + jobBody.set(jobTableRowsHtml) }, showTable: jobTable.open } diff --git a/jobs/index.html b/jobs/index.html index 32ba511..b89156a 100644 --- a/jobs/index.html +++ b/jobs/index.html @@ -30,5 +30,5 @@

- +