diff --git a/readthedocsext/theme/static/readthedocsext/theme/js/site.js b/readthedocsext/theme/static/readthedocsext/theme/js/site.js index 337b54d9..3177f69a 100644 --- a/readthedocsext/theme/static/readthedocsext/theme/js/site.js +++ b/readthedocsext/theme/static/readthedocsext/theme/js/site.js @@ -1 +1 @@ -!function(e){function t(t){for(var n,a,u=t[0],s=t[1],c=t[2],f=0,b=[];fe.length)&&(t=e.length);for(var r=0,n=new Array(t);r=h[o];t.device[o](i)}}));var r=a()(window),n=function(){t.viewport_width(r.width())};r.on("resize",n),n()})),m=function(){function e(t){b(this,e),this.id=t.id,this.url=t.url,this.loaded=o.a.observable(!1),this.loading=o.a.observable(!1),this.promise=null,this.data=o.a.observable()}return l(e,[{key:"fetch",value:function(){var e=this;if(this.promise)return this.promise;this.promise=new Promise((function(t,r){if(e.loaded())return t(e.data());e.loading(!0),a.a.getJSON(e.url).then((function(r){return e.data(r),e.loaded(!0),e.loading(!1),t(r)}))}))}}]),e}(),_=l((function e(){var t=this;b(this,e),this.config=o.a.observable(),this.search_project_config=o.a.observable(),this.config.subscribe((function(e){if(void 0!==e){var r=new URL(e.api_projects_list_url,window.location.origin);r.search="?name={query}",t.search_project_config({type:"category",apiSettings:{url:r.href,onResponse:function(e){return{results:{"category-projects":{name:"Projects",results:e.results.map((function(e,t){var r=e.slug;e.subproject_of?r="Subproject of "+e.subproject_of.name:e.translation_of&&(r=e.language.name+" translation of "+e.translation_of.name);var n=new URL(e.urls.home),o=new URL(window.location.href);return n.hostname!=o.hostname&&(n.hostname=o.hostname),{title:e.name,description:r,url:n.toString()}}))}}}}},minCharacters:2})}}))}));d=_,v="HeaderView",(p=f(p="view_name"))in d?Object.defineProperty(d,p,{value:v,enumerable:!0,configurable:!0,writable:!0}):d[p]=v,u.a.add_view(_)},,function(e,t,r){"use strict";r(1)},function(e,t,r){"use strict";(function(e,n,o){r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return d}));var i=r(1),a=r.n(i),u=r(0),s=r.n(u);function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?i-1:0),u=1;u select").dropdown({placeholder:""}),o()("[data-content]:not([data-semanticui-popup])").popup({position:"top center",delay:{show:500},variation:"small"}),o()(".ui.menu > .item[data-tab]").tab(),new a.a(".ui.button[data-clipboard-text]"),o()(".ui.button[data-clipboard-text]").popup({on:"click",hoverable:!1})}}])&&f(n.prototype,i),l&&f(n,l),Object.defineProperty(n,"prototype",{writable:!1}),t}()}).call(this,r(7))},,function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=r.n(n),i=r(1),a=r.n(i);function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"body";console.debug("Attaching application to selector:",e),o.a.applyBindings(this,a()(e)[0])}},{key:"show_modal",value:function(e){return function(t,r){var n="[data-modal-id="+e+"]";console.debug("Showing modal:",n),0===a()(n).modal("show").length&&console.debug("Modal not found:",n)}}},{key:"post_child_form",value:function(e,t){var r=t.currentTarget.querySelector(":scope > form");return r&&r.submit(),!1}}])&&s(t.prototype,r),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},,,,,function(e,t,r){r(16),e.exports=r(17)},function(e,t,r){},function(e,t,r){"use strict";r.r(t);var n=r(1),o=r.n(n),i=r(8);o()(document).ready((function(){(new i.a).run()}))},,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r(5),r(3)},function(e,t,r){"use strict";var n=r(1),o=r.n(n),i=r(0),a=r.n(i),u=r(2);function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0)setTimeout(n,2e3);else{var o=e.statusText;e.responseJSON&&(o=e.responseJSON.detail),t.reject({message:o})}}))}),2e3),t})(e).then((function(){t.resolve()})).fail((function(e){t.reject(e)}))},error:function(e){var r=e.responseJSON.detail||e.statusText;t.reject({message:r})}}),t}h(w,"view_name","ProjectTrafficAnalyticsView"),u.a.add_view(w);r(5);var j=r(3);function O(e){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(e,t){return(P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=T(e);if(t){var o=T(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return x(this,r)}}function x(e,t){if(t&&("object"===O(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function T(e){return(T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function E(e,t){for(var r=0;r0}))})),D=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&P(e,t)}(r,e);var t=k(r);function r(){var e;return R(this,r),(e=t.call(this)).config=o.a.observable(),e.search_config=o.a.observable(),e.selected=o.a.observable(),e.is_loading=o.a.observable(!1),e.is_syncing=o.a.observable(!1),e.is_selected=o.a.computed((function(){return void 0!==e.selected()})),e.error=o.a.observable(),e.config.subscribe((function(t){void 0!==t&&e.init_search()})),e}return A(r,[{key:"sync_remote_repos",value:function(){var e=this,t=this.config(),r={url:t.urls.api_sync_remote_repositories,token:t.csrf_token};return this.is_syncing(!0),this.is_loading(!0),S(r).fail((function(t){console.error("Error syncing remote repositories:",t.message),e.error(t.message)})).always((function(){e.is_syncing(!1),e.is_loading(!1)}))}},{key:"init_search",value:function(){var e=this,t=this.config().urls.remoterepository_list+"?full_name={query}";this.search_config({type:"knockout",templates:{knockout:function(e){var t=a()("
");o.a.applyBindingsToNode(t[0],{template:{name:"remote-repo-results",data:{remote_repos:e.results.map((function(e){return new L(e)}))}}});var r=t.html();return t.remove(),r}},apiSettings:{url:t},selector:{prompt:".ui.text",title:".title .text"},fullTextSearch:!0,onSelect:function(t,r){e.selected(new L(t))}})}}]),r}(j.b);function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function H(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&U(e,t)}function U(e,t){return(U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function q(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=J(e);if(t){var o=J(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return $(this,r)}}function $(e,t){if(t&&("object"===B(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function J(e){return(J=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function M(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function z(e,t){for(var r=0;r0&&void 0!==arguments[0]&&arguments[0];M(this,e),this.is_expanded=o.a.observable(r),this.dropdown_class=o.a.computed((function(){return t.is_expanded()?"fa-caret-down":"fa-ellipsis"}))}return F(e,[{key:"toggle_expanded",value:function(){var e=this.is_expanded();this.is_expanded(!e)}}]),e}();K(Q,"view_name","ProjectHeaderView"),u.a.add_view(Q);var X=function(){function e(){var t=this;M(this,e),this.projects=o.a.observableArray(),this.config=o.a.observable(),this.filter_project_config=o.a.observable(),this.config.subscribe((function(e){if(void 0!==e){var r=e.api_url+"?name={query}";e.errors;t.filter_project_config({apiSettings:{url:r,cache:!1},throttle:500,fields:{name:"name",value:"slug"},saveRemoteData:!1,filterRemoteData:!1,sortSelect:!0,onChange:function(e,t,r){window.location.href="?project="+e}})}})),this.filter_config={action:"select",onChange:function(e,t,r){r.closest("form").submit()}}}return F(e,[{key:"project",value:function(e){var t=new G(e);return this.projects.push(t),t}}]),e}();K(X,"view_name","ProjectListView"),u.a.add_view(X);var G=function(e){H(r,e);var t=q(r);function r(e){var n;return M(this,r),(n=t.call(this,e)).url_docs=o.a.observable(),n.data.subscribe((function(e){n.url_docs(e.canonical_url)})),n}return F(r)}(j.a),Y=function(){function e(){var t=this;M(this,e),this.config=o.a.observable(),this.is_loading=o.a.observable(!1),this.search_config=o.a.computed((function(){var e=t.config();if(void 0!==e)return t.init_search(e)}))}return F(e,[{key:"init_search",value:function(e){return{apiSettings:{url:e.api_url+"?verbose_name={query}"},selector:{prompt:".ui.text"},fields:{title:"verbose_name",description:"identifier"},fullTextSearch:!0,onSelect:function(e,t){window.location.href=e.urls.dashboard.edit},error:e.errors||{}}}}]),e}();K(Y,"view_name","ProjectVersionCreateView"),u.a.add_view(Y);var Z=function(){function e(){var t=this;M(this,e),this.versions=o.a.observableArray(),this.config=o.a.observable(),this.filter_version_config=o.a.observable(),this.config.subscribe((function(e){if(void 0!==e){var r=e.api_url+"?verbose_name={query}&active=True";e.errors;t.filter_version_config({apiSettings:{url:r,cache:!1,onResponse:function(e){return{results:e.results.map((function(e){return console.dir(e),{name:e.verbose_name,value:e.slug}}))}}},throttle:500,saveRemoteData:!1,filterRemoteData:!1,sortSelect:!0,onChange:function(e,t,r){window.location.href="?version="+e}})}})),this.filter_config={action:"select",onChange:function(e,t,r){r.closest("form").submit()}}}return F(e,[{key:"attach_add_version",value:function(){return console.debug(arguments),{}}},{key:"version",value:function(e){var t=new ee(e);return this.versions.push(t),t}}]),e}();K(Z,"view_name","ProjectVersionListView"),u.a.add_view(Z);var ee=function(e){H(r,e);var t=q(r);function r(e){var n;return M(this,r),(n=t.call(this,e)).url_pdf=o.a.observable(),n.url_epub=o.a.observable(),n.url_html=o.a.observable(),n.url_docs=o.a.observable(),n.is_built=o.a.observable(!0),n.data.subscribe((function(e){n.url_pdf(e.downloads.pdf),n.url_epub(e.downloads.epub),n.url_html(e.downloads.html),n.url_docs(e.urls.documentation),n.is_built(e.built)})),n}return F(r,[{key:"trigger_build",value:function(e,t){return function(r,n){a.a.ajax({type:"POST",url:e,data:{csrfmiddlewaretoken:t}}).then((function(e){e.build.urls.build?window.location.href=e.build.urls.build:console.debug("Redirect to new build failed")})).catch((function(e){console.error(e)}))}}}]),r}(j.a)},function(e,t,r){"use strict";var n=r(1),o=r.n(n),i=r(0),a=r.n(i),u=r(4),s=r.n(u),c=r(11),l=r.n(c),f=r(12),b=r.n(f),d=r(13),p=r.n(d),v=r(2);function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){if(e){if("string"==typeof e)return _(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&r.is_expanded(!0)})),this.output=a.a.observable(),this.output_lines=a.a.computed((function(){return r.output().split(/\n/).map((function(e,t){return new x({command:r,output:e,line_number:t+1})}))}),null,{deferEvaluation:!0}),this.output(t.output)}return w(e,[{key:"color_output",value:function(e){return Promise.all([r.e(0).then(r.t.bind(null,49,7)).then((function(e){return e.default})),r.e(4).then(r.t.bind(null,50,7)).then((function(e){return e.default}))]).then((function(t){var r,n,o=y(t,2);r=o[0],n=o[1];var i=new r;return i.use_classes=!0,e=n(e=i.ansi_to_html(e),{allowedTags:["span"],allowedAttributes:{span:["class"]}})}))}},{key:"toggle_expanded",value:function(){return this.is_expanded(!this.is_expanded()),!1}}]),e}(),E=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};j(this,e),this.id=r.id,this.api_url="/api/v2/build/",this.success=a.a.observable(r.success),this.error=a.a.observable(r.error),this.state=a.a.observable(r.state),this.state_display=a.a.observable(r.state_display),this.is_finished=a.a.observable(!1),this.is_loading=a.a.observable(!0),this.can_cancel=a.a.observable(!1),this.can_retry=a.a.observable(!1),this.can_view_docs=a.a.observable(!1),this.state.subscribe((function(e){t.update_state(e)})),this.progress_config=a.a.computed((function(){var e=t.state(),r=["triggered","queued","cloning","installing","building","uploading","finished"];if(a.a.computedContext.isInitial())return{autoSuccess:!1,value:r.indexOf(e),total:r.length-1,label:t.state_display()};if(t.is_finished()){var n="cancelled"===e,o=t.error()||!1===t.success();return n?function(e){e("set warning","Build cancelled")}:o?function(e){e("set error","Build failed")}:function(e){e("set success","Build succeeded")}}return function(n){n("set progress",r.indexOf(e)),n("set label",t.state_display())}})).extend({deferred:!0}),this.date=a.a.observable(r.date),this.length=a.a.observable(r.length),this.date_display=a.a.observable(),this.date_display_since=a.a.observable(),this.length_display=a.a.observable(),s.a.extend(l.a),s.a.extend(b.a),s.a.extend(p.a),this.date.subscribe((function(e){var r=s()(e);t.date_display(r.format("llll")),t.date_display_since(r.fromNow())})),this.length.subscribe((function(e){t.length_display(s.a.duration(e,"seconds").humanize())})),this.config=a.a.observable(),this.builder=a.a.observable(r.builder),this.commands=a.a.observableArray(r.commands),this.commit=a.a.observable(r.commit),this.commit_short=a.a.computed((function(){var e=t.commit();if(e)return e.substring(0,8)})),this.docs_url=a.a.observable(r.docs_url),this.commit_url=a.a.observable(r.commit_url),this.legacy_output=a.a.observable(!1),this.selected_hash=a.a.observable(o()(location).attr("hash")),this.selected_hash.subscribe((function(e){o()(location).attr("hash",e)})),this.selected_line=a.a.observable(),this.selected_line.subscribe((function(e){e&&e.is_selected(!1)}),this,"beforeChange"),this.selected_line.subscribe((function(e){e.command.is_expanded(!0),e.is_selected(!0),t.selected_hash(e.anchor_id())})),this.show_debug=a.a.observable(!1),this.is_polling=a.a.observable(!0),this.is_polling.subscribe((function(e){e||t.set_selected_line_from_hash(t.selected_hash())})),this.poll_api()}return w(e,[{key:"poll_api",value:function(){var e=this;o.a.getJSON(this.api_url+this.id+"/").then((function(t){e.date(t.date),e.success(t.success),e.error(t.error),e.length(t.length),e.commit(t.commit),e.docs_url(t.docs_url),e.commit_url(t.commit_url),e.builder(t.builder),e.config(t.config),e.state(t.state),e.state_display(t.state_display),e.add_command({id:0,command:"readthedocs-build --show-config",output:JSON.stringify(t.config,null," "),exit_code:0,run_time:0,is_debug:!0});var r,n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=m(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t.commands);try{for(n.s();!(r=n.n()).done;){var o=r.value;e.add_command(o)}}catch(e){n.e(e)}finally{n.f()}e.is_loading(!1)})),this.is_finished()?this.is_polling(!1):setTimeout((function(){e.poll_api()}),2e3)}},{key:"add_command",value:function(e){a.a.utils.arrayFirst(this.commands(),(function(t){return t.id()===e.id}))||this.commands.push(new T(e))}},{key:"set_selected_line",value:function(e){this.selected_line(e);var t=document.querySelector("[data-selected=true]");return t&&(t.scrollIntoView?t.scrollIntoView({behavior:"auto",block:"center",inline:"center"}):o()(t).focus()),!1}},{key:"set_selected_line_from_hash",value:function(e){if(e){var t=e.match(/^#(\d+)--(\d+)$/);if(!t)return;var r=a.a.utils.arrayFirst(this.commands(),(function(e){return e.id()==t[1]}));if(r){var n=a.a.utils.arrayFirst(r.output_lines(),(function(e){return e.line_number()==t[2]}));n&&this.set_selected_line(n)}}}},{key:"show_legacy_output",value:function(){this.legacy_output(!0)}},{key:"toggle_debug",value:function(){var e=this.show_debug();this.show_debug(!e)}},{key:"update_state",value:function(e){["finished","cancelled"].includes(e)?(this.is_finished(!0),this.can_cancel(!1),this.can_retry(!0),this.success()&&this.can_view_docs(!0)):this.can_cancel(!0)}}]),e}();O=E,k="BuildDetailView",(P=S(P="view_name"))in O?Object.defineProperty(O,P,{value:k,enumerable:!0,configurable:!0,writable:!0}):O[P]=k,v.a.add_view(E);r(3);function A(e){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function C(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=h[o];t.device[o](i)}}));var r=a()(window),n=function(){t.viewport_width(r.width())};r.on("resize",n),n()})),m=function(){function e(t){b(this,e),this.id=t.id,this.url=t.url,this.loaded=o.a.observable(!1),this.loading=o.a.observable(!1),this.promise=null,this.data=o.a.observable()}return l(e,[{key:"fetch",value:function(){var e=this;if(this.promise)return this.promise;this.promise=new Promise((function(t,r){if(e.loaded())return t(e.data());e.loading(!0),a.a.getJSON(e.url).then((function(r){return e.data(r),e.loaded(!0),e.loading(!1),t(r)}))}))}}]),e}(),_=l((function e(){var t=this;b(this,e),this.config=o.a.observable(),this.search_project_config=o.a.observable(),this.config.subscribe((function(e){if(void 0!==e){var r=new URL(e.api_projects_list_url,window.location.origin);r.search="?name={query}",t.search_project_config({type:"category",apiSettings:{url:r.href,onResponse:function(e){return{results:{"category-projects":{name:"Projects",results:e.results.map((function(e,t){var r=e.slug;e.subproject_of?r="Subproject of "+e.subproject_of.name:e.translation_of&&(r=e.language.name+" translation of "+e.translation_of.name);var n=new URL(e.urls.home),o=new URL(window.location.href);return n.hostname!=o.hostname&&(n.hostname=o.hostname),{title:e.name,description:r,url:n.toString()}}))}}}}},minCharacters:2})}}))}));d=_,v="HeaderView",(p=f(p="view_name"))in d?Object.defineProperty(d,p,{value:v,enumerable:!0,configurable:!0,writable:!0}):d[p]=v,u.a.add_view(_)},,function(e,t,r){"use strict";r(1)},function(e,t,r){"use strict";(function(e,n,o){r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return d}));var i=r(1),a=r.n(i),u=r(0),s=r.n(u);function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?i-1:0),u=1;u select").dropdown({placeholder:""}),o()("[data-content]:not([data-semanticui-popup])").popup({position:"top center",delay:{show:500},variation:"small"}),o()(".ui.menu > .item[data-tab]").tab(),new a.a("[data-clipboard-text], [data-clipboard-target]"),o()("[data-clipboard-text], [data-clipboard-target]").popup({on:"click",hoverable:!1,content:"Copied!"})}}])&&f(n.prototype,i),l&&f(n,l),Object.defineProperty(n,"prototype",{writable:!1}),t}()}).call(this,r(7))},,function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=r.n(n),i=r(1),a=r.n(i);function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"body";console.debug("Attaching application to selector:",e),o.a.applyBindings(this,a()(e)[0])}},{key:"show_modal",value:function(e){return function(t,r){var n="[data-modal-id="+e+"]";console.debug("Showing modal:",n),0===a()(n).modal("show").length&&console.debug("Modal not found:",n)}}},{key:"post_child_form",value:function(e,t){var r=t.currentTarget.querySelector(":scope > form");return r&&r.submit(),!1}}])&&s(t.prototype,r),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},,,,,function(e,t,r){r(16),e.exports=r(17)},function(e,t,r){},function(e,t,r){"use strict";r.r(t);var n=r(1),o=r.n(n),i=r(8);o()(document).ready((function(){(new i.a).run()}))},,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r(5),r(3)},function(e,t,r){"use strict";var n=r(1),o=r.n(n),i=r(0),a=r.n(i),u=r(2);function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0)setTimeout(n,2e3);else{var o=e.statusText;e.responseJSON&&(o=e.responseJSON.detail),t.reject({message:o})}}))}),2e3),t})(e).then((function(){t.resolve()})).fail((function(e){t.reject(e)}))},error:function(e){var r=e.responseJSON.detail||e.statusText;t.reject({message:r})}}),t}h(w,"view_name","ProjectTrafficAnalyticsView"),u.a.add_view(w);r(5);var j=r(3);function O(e){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(e,t){return(P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=T(e);if(t){var o=T(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return x(this,r)}}function x(e,t){if(t&&("object"===O(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function T(e){return(T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function E(e,t){for(var r=0;r0}))})),D=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&P(e,t)}(r,e);var t=k(r);function r(){var e;return R(this,r),(e=t.call(this)).config=o.a.observable(),e.search_config=o.a.observable(),e.selected=o.a.observable(),e.is_loading=o.a.observable(!1),e.is_syncing=o.a.observable(!1),e.is_selected=o.a.computed((function(){return void 0!==e.selected()})),e.error=o.a.observable(),e.config.subscribe((function(t){void 0!==t&&e.init_search()})),e}return C(r,[{key:"sync_remote_repos",value:function(){var e=this,t=this.config(),r={url:t.urls.api_sync_remote_repositories,token:t.csrf_token};return this.is_syncing(!0),this.is_loading(!0),S(r).fail((function(t){console.error("Error syncing remote repositories:",t.message),e.error(t.message)})).always((function(){e.is_syncing(!1),e.is_loading(!1)}))}},{key:"init_search",value:function(){var e=this,t=this.config().urls.remoterepository_list+"?full_name={query}";this.search_config({type:"knockout",templates:{knockout:function(e){var t=a()("
");o.a.applyBindingsToNode(t[0],{template:{name:"remote-repo-results",data:{remote_repos:e.results.map((function(e){return new L(e)}))}}});var r=t.html();return t.remove(),r}},apiSettings:{url:t},selector:{prompt:".ui.text",title:".title .text"},fullTextSearch:!0,onSelect:function(t,r){e.selected(new L(t))}})}}]),r}(j.b);function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function H(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&U(e,t)}function U(e,t){return(U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function q(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=J(e);if(t){var o=J(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return $(this,r)}}function $(e,t){if(t&&("object"===B(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function J(e){return(J=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function M(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function z(e,t){for(var r=0;r0&&void 0!==arguments[0]&&arguments[0];M(this,e),this.is_expanded=o.a.observable(r),this.dropdown_class=o.a.computed((function(){return t.is_expanded()?"fa-caret-down":"fa-ellipsis"}))}return F(e,[{key:"toggle_expanded",value:function(){var e=this.is_expanded();this.is_expanded(!e)}}]),e}();K(Q,"view_name","ProjectHeaderView"),u.a.add_view(Q);var X=function(){function e(){var t=this;M(this,e),this.projects=o.a.observableArray(),this.config=o.a.observable(),this.filter_project_config=o.a.observable(),this.config.subscribe((function(e){if(void 0!==e){var r=e.api_url+"?name={query}";e.errors;t.filter_project_config({apiSettings:{url:r,cache:!1},throttle:500,fields:{name:"name",value:"slug"},saveRemoteData:!1,filterRemoteData:!1,sortSelect:!0,onChange:function(e,t,r){window.location.href="?project="+e}})}})),this.filter_config={action:"select",onChange:function(e,t,r){r.closest("form").submit()}}}return F(e,[{key:"project",value:function(e){var t=new G(e);return this.projects.push(t),t}}]),e}();K(X,"view_name","ProjectListView"),u.a.add_view(X);var G=function(e){H(r,e);var t=q(r);function r(e){var n;return M(this,r),(n=t.call(this,e)).url_docs=o.a.observable(),n.data.subscribe((function(e){n.url_docs(e.canonical_url)})),n}return F(r)}(j.a),Y=function(){function e(){var t=this;M(this,e),this.config=o.a.observable(),this.is_loading=o.a.observable(!1),this.search_config=o.a.computed((function(){var e=t.config();if(void 0!==e)return t.init_search(e)}))}return F(e,[{key:"init_search",value:function(e){return{apiSettings:{url:e.api_url+"?verbose_name={query}"},selector:{prompt:".ui.text"},fields:{title:"verbose_name",description:"identifier"},fullTextSearch:!0,onSelect:function(e,t){window.location.href=e.urls.dashboard.edit},error:e.errors||{}}}}]),e}();K(Y,"view_name","ProjectVersionCreateView"),u.a.add_view(Y);var Z=function(){function e(){var t=this;M(this,e),this.versions=o.a.observableArray(),this.config=o.a.observable(),this.filter_version_config=o.a.observable(),this.config.subscribe((function(e){if(void 0!==e){var r=e.api_url+"?verbose_name={query}&active=True";e.errors;t.filter_version_config({apiSettings:{url:r,cache:!1,onResponse:function(e){return{results:e.results.map((function(e){return console.dir(e),{name:e.verbose_name,value:e.slug}}))}}},throttle:500,saveRemoteData:!1,filterRemoteData:!1,sortSelect:!0,onChange:function(e,t,r){window.location.href="?version="+e}})}})),this.filter_config={action:"select",onChange:function(e,t,r){r.closest("form").submit()}}}return F(e,[{key:"attach_add_version",value:function(){return console.debug(arguments),{}}},{key:"version",value:function(e){var t=new ee(e);return this.versions.push(t),t}}]),e}();K(Z,"view_name","ProjectVersionListView"),u.a.add_view(Z);var ee=function(e){H(r,e);var t=q(r);function r(e){var n;return M(this,r),(n=t.call(this,e)).url_pdf=o.a.observable(),n.url_epub=o.a.observable(),n.url_html=o.a.observable(),n.url_docs=o.a.observable(),n.is_built=o.a.observable(!0),n.data.subscribe((function(e){n.url_pdf(e.downloads.pdf),n.url_epub(e.downloads.epub),n.url_html(e.downloads.html),n.url_docs(e.urls.documentation),n.is_built(e.built)})),n}return F(r,[{key:"trigger_build",value:function(e,t){return function(r,n){a.a.ajax({type:"POST",url:e,data:{csrfmiddlewaretoken:t}}).then((function(e){e.build.urls.build?window.location.href=e.build.urls.build:console.debug("Redirect to new build failed")})).catch((function(e){console.error(e)}))}}}]),r}(j.a)},function(e,t,r){"use strict";var n=r(1),o=r.n(n),i=r(0),a=r.n(i),u=r(4),s=r.n(u),c=r(11),l=r.n(c),f=r(12),b=r.n(f),d=r(13),p=r.n(d),v=r(2);function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){if(e){if("string"==typeof e)return _(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&r.is_expanded(!0)})),this.output=a.a.observable(),this.output_lines=a.a.computed((function(){return r.output().split(/\n/).map((function(e,t){return new x({command:r,output:e,line_number:t+1})}))}),null,{deferEvaluation:!0}),this.output(t.output)}return w(e,[{key:"color_output",value:function(e){return Promise.all([r.e(0).then(r.t.bind(null,49,7)).then((function(e){return e.default})),r.e(4).then(r.t.bind(null,50,7)).then((function(e){return e.default}))]).then((function(t){var r,n,o=y(t,2);r=o[0],n=o[1];var i=new r;return i.use_classes=!0,e=n(e=i.ansi_to_html(e),{allowedTags:["span"],allowedAttributes:{span:["class"]}})}))}},{key:"toggle_expanded",value:function(){return this.is_expanded(!this.is_expanded()),!1}}]),e}(),E=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};j(this,e),this.id=r.id,this.api_url="/api/v2/build/",this.success=a.a.observable(r.success),this.error=a.a.observable(r.error),this.state=a.a.observable(r.state),this.state_display=a.a.observable(r.state_display),this.is_finished=a.a.observable(!1),this.is_loading=a.a.observable(!0),this.can_cancel=a.a.observable(!1),this.can_retry=a.a.observable(!1),this.can_view_docs=a.a.observable(!1),this.state.subscribe((function(e){t.update_state(e)})),this.progress_config=a.a.computed((function(){var e=t.state(),r=["triggered","queued","cloning","installing","building","uploading","finished"];if(a.a.computedContext.isInitial())return{autoSuccess:!1,value:r.indexOf(e),total:r.length-1,label:t.state_display()};if(t.is_finished()){var n="cancelled"===e,o=t.error()||!1===t.success();return n?function(e){e("set warning","Build cancelled")}:o?function(e){e("set error","Build failed")}:function(e){e("set success","Build succeeded")}}return function(n){n("set progress",r.indexOf(e)),n("set label",t.state_display())}})).extend({deferred:!0}),this.date=a.a.observable(r.date),this.length=a.a.observable(r.length),this.date_display=a.a.observable(),this.date_display_since=a.a.observable(),this.length_display=a.a.observable(),s.a.extend(l.a),s.a.extend(b.a),s.a.extend(p.a),this.date.subscribe((function(e){var r=s()(e);t.date_display(r.format("llll")),t.date_display_since(r.fromNow())})),this.length.subscribe((function(e){t.length_display(s.a.duration(e,"seconds").humanize())})),this.config=a.a.observable(),this.builder=a.a.observable(r.builder),this.commands=a.a.observableArray(r.commands),this.commit=a.a.observable(r.commit),this.commit_short=a.a.computed((function(){var e=t.commit();if(e)return e.substring(0,8)})),this.docs_url=a.a.observable(r.docs_url),this.commit_url=a.a.observable(r.commit_url),this.legacy_output=a.a.observable(!1),this.selected_hash=a.a.observable(o()(location).attr("hash")),this.selected_hash.subscribe((function(e){o()(location).attr("hash",e)})),this.selected_line=a.a.observable(),this.selected_line.subscribe((function(e){e&&e.is_selected(!1)}),this,"beforeChange"),this.selected_line.subscribe((function(e){e.command.is_expanded(!0),e.is_selected(!0),t.selected_hash(e.anchor_id())})),this.show_debug=a.a.observable(!1),this.is_polling=a.a.observable(!0),this.is_polling.subscribe((function(e){e||t.set_selected_line_from_hash(t.selected_hash())})),this.poll_api()}return w(e,[{key:"poll_api",value:function(){var e=this;o.a.getJSON(this.api_url+this.id+"/").then((function(t){e.date(t.date),e.success(t.success),e.error(t.error),e.length(t.length),e.commit(t.commit),e.docs_url(t.docs_url),e.commit_url(t.commit_url),e.builder(t.builder),e.config(t.config),e.state(t.state),e.state_display(t.state_display),e.add_command({id:0,command:"readthedocs-build --show-config",output:JSON.stringify(t.config,null," "),exit_code:0,run_time:0,is_debug:!0});var r,n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=m(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t.commands);try{for(n.s();!(r=n.n()).done;){var o=r.value;e.add_command(o)}}catch(e){n.e(e)}finally{n.f()}e.is_loading(!1)})),this.is_finished()?this.is_polling(!1):setTimeout((function(){e.poll_api()}),2e3)}},{key:"add_command",value:function(e){a.a.utils.arrayFirst(this.commands(),(function(t){return t.id()===e.id}))||this.commands.push(new T(e))}},{key:"set_selected_line",value:function(e){this.selected_line(e);var t=document.querySelector("[data-selected=true]");return t&&(t.scrollIntoView?t.scrollIntoView({behavior:"auto",block:"center",inline:"center"}):o()(t).focus()),!1}},{key:"set_selected_line_from_hash",value:function(e){if(e){var t=e.match(/^#(\d+)--(\d+)$/);if(!t)return;var r=a.a.utils.arrayFirst(this.commands(),(function(e){return e.id()==t[1]}));if(r){var n=a.a.utils.arrayFirst(r.output_lines(),(function(e){return e.line_number()==t[2]}));n&&this.set_selected_line(n)}}}},{key:"show_legacy_output",value:function(){this.legacy_output(!0)}},{key:"toggle_debug",value:function(){var e=this.show_debug();this.show_debug(!e)}},{key:"update_state",value:function(e){["finished","cancelled"].includes(e)?(this.is_finished(!0),this.can_cancel(!1),this.can_retry(!0),this.success()&&this.can_view_docs(!0)):this.can_cancel(!0)}}]),e}();O=E,k="BuildDetailView",(P=S(P="view_name"))in O?Object.defineProperty(O,P,{value:k,enumerable:!0,configurable:!0,writable:!0}):O[P]=k,v.a.add_view(E);r(3);function C(e){return(C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function A(e,t){for(var r=0;r + {% blocktrans trimmed %} + A .readthedocs.yaml configuration file is required at the root of your repository in order to build your documentation. + {% endblocktrans %} + + + {% trans "Learn how to add a configuration file to your project." %} + +
+ +
+ {% trans "Example configuration for:" %} + +
+ +
+
+ .readthedocs.yaml +
+ + + + +
+# Read the Docs configuration file
+# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
+
+# Required
+version: 2
+
+# Set the OS, Python version, and other tools you might need
+build:
+  os: ubuntu-22.04
+  tools:
+    python: "3.11"
+    # You can also specify other tool versions:
+    # nodejs: "19"
+    # rust: "1.64"
+    # golang: "1.19"
+
+# Build documentation in the "docs/" directory with Sphinx
+sphinx:
+   configuration: docs/conf.py
+
+# Optionally build your docs in additional formats such as PDF and ePub
+# formats:
+#    - pdf
+#    - epub
+
+# Optionally, but recommended,
+# declare the Python requirements required to build your documentation
+# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
+# python:
+#    install:
+#    - requirements: docs/requirements.txt
+      
+
+
+ + {# Show the base form #} + {{ block.super }} + +{% endblock project_add_content_form %} + +{% block project_add_sidebar_help_topics %} + {% include "includes/elements/link.html" with url="https://docs.readthedocs.io/page/config-file/index.html" text="Configuration file tutorial" is_external=True class="item" %} + {% include "includes/elements/link.html" with url="https://docs.readthedocs.io/page/config-file/v2.html" text="Configuration file reference" is_external=True class="item" %} + {% include "includes/elements/link.html" with url="https://docs.readthedocs.io/page/guides/setup/git-repo-manual.html" text="Manually configuring a Git repository" is_external=True class="item" %} +{% endblock project_add_sidebar_help_topics %} diff --git a/src/js/application/index.js b/src/js/application/index.js index b7d0c40c..44e20610 100644 --- a/src/js/application/index.js +++ b/src/js/application/index.js @@ -128,13 +128,17 @@ export class Application { }); jquery(".ui.menu > .item[data-tab]").tab(); - // Initialize clipboard, but only for data-clipboard-text. This is the most - // generalized pattern for clipboard usage, so we won't yet worry about - // adding the other data binding selectors. - var clipboard_global = new clipboard(".ui.button[data-clipboard-text]"); - jquery(".ui.button[data-clipboard-text]").popup({ + /* Initialize clipboard.js using a few selectors that we are using. This + * isn't a great fit for Knockout custom data binding or plugin, as the + * library uses some builtin/hardcoded selectors. */ + var clipboard_global = new clipboard( + "[data-clipboard-text], [data-clipboard-target]" + ); + // Provide the user with some visual feedback using FUI popups + jquery("[data-clipboard-text], [data-clipboard-target]").popup({ on: "click", hoverable: false, + content: "Copied!", }); } }