-
Notifications
You must be signed in to change notification settings - Fork 1
/
src.ac33b095.js
1 lines (1 loc) · 9.67 KB
/
src.ac33b095.js
1
parcelRequire=function(e){var r="function"==typeof parcelRequire&&parcelRequire,n="function"==typeof require&&require,i={};function u(e,u){if(e in i)return i[e];var t="function"==typeof parcelRequire&&parcelRequire;if(!u&&t)return t(e,!0);if(r)return r(e,!0);if(n&&"string"==typeof e)return n(e);var o=new Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}return u.register=function(e,r){i[e]=r},i=e(u),u.modules=i,u}(function (require) {var a={},b=window.matchMedia("(prefers-color-scheme: dark)").matches?"github-dark":"github-light";a.preferredTheme=b;var c="preferred-color-scheme";a.preferredThemeId=c;var d=function(){function e(){var e=this;this.element=document.createElement("form"),this.element.innerHTML="\n <h3 id=\"heading-repository\">Repository</h3>\n <p>\n Choose the repository utterances will connect to.\n </p>\n <ol>\n <li>Make sure the repo is public, otherwise your readers will not be able to view the issues/comments.</li>\n <li>Make sure the <a href=\"https://github.com/apps/utterances\">utterances app</a>\n is installed on the repo, otherwise users will not be able to post comments.\n </li>\n <li>If your repo is a fork, navigate to its <em>settings</em> tab and confirm\n the <em>issues</em> feature is turned on. </li>\n </ol>\n <fieldset>\n <div>\n <label for=\"repo\">repo:</label><br/>\n <input id=\"repo\" class=\"form-control\" type=\"text\" placeholder=\"owner/repo\">\n <p class=\"note\">\n A <strong>public</strong> GitHub repository. This is where the blog\n post issues and issue-comments will be posted.\n </p>\n </div>\n </fieldset>\n\n <h3 id=\"heading-mapping\">Blog Post \u2194\uFE0F Issue Mapping</h3>\n <p>Choose the mapping between blog posts and GitHub issues.</p>\n <fieldset>\n <div class=\"form-checkbox\">\n <label>\n <input type=\"radio\" value=\"pathname\" name=\"mapping\" checked=\"checked\">\n Issue title contains page pathname\n <p class=\"note\">\n Utterances will search for an issue whose title contains the blog post's pathname\n URL component. If a matching issue is not found, Utterances will automatically\n create one the first time someone comments on your post.\n </p>\n </label>\n </div>\n <div class=\"form-checkbox\">\n <label>\n <input type=\"radio\" value=\"url\" name=\"mapping\">\n Issue title contains page URL\n <p class=\"note\">\n Utterances will search for an issue whose title contains the blog post's URL.\n If a matching issue is not found, Utterances will automatically create one the first\n time someone comments on your post.\n </p>\n </label>\n </div>\n <div class=\"form-checkbox\">\n <label>\n <input type=\"radio\" value=\"title\" name=\"mapping\">\n Issue title contains page title\n <p class=\"note\">\n Utterances will search for an issue whose title contains the blog post's title.\n If a matching issue is not found, Utterances will automatically create one the first\n time someone comments on your post.\n </p>\n </label>\n </div>\n <div class=\"form-checkbox\">\n <label>\n <input type=\"radio\" value=\"og:title\" name=\"mapping\">\n Issue title contains page og:title\n <p class=\"note\">\n Utterances will search for an issue whose title contains the page's\n <a href=\"http://ogp.me/\">Open Graph</a> title meta.\n If a matching issue is not found, Utterances will automatically create one the first\n time someone comments on your post.\n </p>\n </label>\n </div>\n <div class=\"form-checkbox\">\n <label>\n <input type=\"radio\" value=\"issue-number\" name=\"mapping\">\n Specific issue number\n <p class=\"note\">\n You configure Utterances to load a specific issue by number. Issues are not automatically\n created.\n </p>\n </label>\n </div>\n <div class=\"form-checkbox\">\n <label>\n <input type=\"radio\" value=\"specific-term\" name=\"mapping\">\n Issue title contains specific term\n <p class=\"note\">\n You configure Utterances to search for an issue whose title contains a specific term of your choosing.\n If a matching issue is not found, Utterances will automatically create one the first\n time someone comments on your post. The issue's title will be the term you chose.\n </p>\n </label>\n </div>\n </fieldset>\n\n <h3 id=\"heading-issue-label\">Issue Label</h3>\n <p>\n Choose the label that will be assigned to issues created by Utterances.\n </p>\n <fieldset>\n <div>\n <label for=\"label\">label (optional):</label><br/>\n <input id=\"label\" class=\"form-control\" type=\"text\" placeholder=\"Comment\">\n <p class=\"note\">\n Label names are case sensitive.\n The label must exist in your repo-\n Utterances cannot attach labels that do not exist.\n Emoji are supported in label names.\u2728\uD83D\uDCAC\u2728\n </p>\n </div>\n </fieldset>\n\n <h3 id=\"heading-theme\">Theme</h3>\n <p>\n Choose an Utterances theme that matches your blog.\n Can't find a theme you like?\n <a href=\"https://github.com/utterance/utterances/blob/master/CONTRIBUTING.md\">Contribute</a> a custom theme.\n </p>\n\n <select id=\"theme\" class=\"form-select\" value=\"github-light\" aria-label=\"Theme\">\n <option value=\"github-light\">GitHub Light</option>\n <option value=\"github-dark\">GitHub Dark</option>\n <option value=\"preferred-color-scheme\">Preferred Color Scheme</option>\n <option value=\"github-dark-orange\">GitHub Dark Orange</option>\n <option value=\"icy-dark\">Icy Dark</option>\n <option value=\"dark-blue\">Dark Blue</option>\n <option value=\"photon-dark\">Photon Dark</option>\n </select>\n\n <h3 id=\"heading-enable\">Enable Utterances</h3>\n\n <p>Add the following script tag to your blog's template. Position it where you want the\n comments to appear. Customize the layout using the <code>.utterances</code> and\n <code>.utterances-frame</code> selectors.\n </p>\n <div class=\"config-field\" id=\"script\" class=\"highlight highlight-text-html-basic\"></div>\n <button id=\"copy-button\" type=\"button\" class=\"btn btn-blue code-action\">Copy</button>\n <br/>\n <br/>",this.element.addEventListener("submit",function(e){return e.preventDefault()}),this.element.action="javascript:",this.script=this.element.querySelector("#script"),this.repo=this.element.querySelector("#repo"),this.label=this.element.querySelector("#label"),this.theme=this.element.querySelector("#theme");var t=document.getElementById("theme-stylesheet");this.theme.addEventListener("change",function(){var n=e.theme.value;n===c&&(n=b),t.href="/stylesheets/themes/"+n+"/index.css";var s={type:"set-theme",theme:n};document.querySelector("iframe").contentWindow.postMessage(s,location.origin)}),this.element.querySelector("#copy-button").addEventListener("click",function(){return e.copyTextToClipboard(e.script.textContent)}),this.element.addEventListener("change",function(){return e.outputConfig()}),this.element.addEventListener("input",function(){return e.outputConfig()}),this.outputConfig()}return e.prototype.outputConfig=function(){var e,t=this.element.querySelector("input[name=\"mapping\"]:checked");e="issue-number"===t.value?this.makeConfigScriptAttribute("issue-number","[ENTER ISSUE NUMBER HERE]"):"specific-term"===t.value?this.makeConfigScriptAttribute("issue-term","[ENTER TERM HERE]"):this.makeConfigScriptAttribute("issue-term",t.value),this.script.innerHTML=this.makeConfigScript(this.makeConfigScriptAttribute("repo",""===this.repo.value?"[ENTER REPO HERE]":this.repo.value)+"\n"+e+"\n"+(this.label.value?this.makeConfigScriptAttribute("label",this.label.value)+"\n":"")+this.makeConfigScriptAttribute("theme",this.theme.value)+"\n"+this.makeConfigScriptAttribute("crossorigin","anonymous")+"\n"+this.makeConfigScriptAttribute("autocreate","true"))},e.prototype.makeConfigScriptAttribute=function(e,t){return"<span class=\"pl-s1\"> <span class=\"pl-e\">"+e+"</span>=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span>"+t+"<span class=\"pl-pds\">\"</span></span></span>"},e.prototype.makeConfigScript=function(e){return"<pre><span class=\"pl-s1\"><<span class=\"pl-ent\">script</span> <span class=\"pl-e\">src</span>=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span>https://utteranc.es/client.js<span class=\"pl-pds\">\"</span></span></span>\n"+e+"\n<span class=\"pl-s1\"> <span class=\"pl-e\">async</span>></span>\n<span class=\"pl-s1\"></<span class=\"pl-ent\">script</span>></span></pre>"},e.prototype.copyTextToClipboard=function(e){var t=document.createElement("textarea");t.style.cssText="position:fixed;top:0;left:0;width:2em;height:2em;padding:0;border:none;outline:none;box-shadow:none;background:transparent",t.value=e,document.body.appendChild(t),t.select();try{document.execCommand("copy")}catch(n){}document.body.removeChild(t)},e}();document.querySelector("h2#configuration").insertAdjacentElement("afterend",new d().element);a.__esModule=true;return{"QCba":{},"N98m":a};});