{"size": 3466, "ext": "js", "max_stars_repo_path": "public/js/chunks/1078.js", "max_stars_repo_name": "thekanbo/fusioncms-cms", "max_stars_repo_stars_event_min_datetime": "2020-04-22T04:50:24.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-29T00:45:35.000Z", "max_issues_repo_path": "public/js/chunks/1078.js", "max_issues_repo_name": "thekanbo/fusioncms-cms", "max_issues_repo_issues_event_min_datetime": "2020-04-30T21:50:56.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-19T01:05:08.000Z", "max_forks_repo_path": "public/js/chunks/1078.js", "max_forks_repo_name": "thekanbo/fusioncms-cms", "max_forks_repo_forks_event_min_datetime": "2020-04-22T22:00:01.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-23T06:20:05.000Z"}
{"max_stars_count": 34, "max_issues_count": 16, "max_forks_count": 14, "avg_line_length": 3466.0, "max_line_length": 3466, "alphanum_fraction": 0.6898442008}
(self.webpackChunkfusioncms=self.webpackChunkfusioncms||[]).push([[1078],{1078:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});var s=r(6072);const o={props:{form:{type:Object,required:!0},resource:{type:Object,required:!1,default:function(){}}}};var a=r(1900);const i={auth:function(){return{permission:"scripts.create"}},head:{title:function(){return{inner:"Create a Script"}}},data:function(){return{form:new s.Z({name:"",description:"",code:"",location:"head",include_on:"all",include_where:"",type:"user",order:0,status:!0},!0)}},components:{"shared-form":(0,a.Z)(o,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("form-container",[r("portal",{attrs:{to:"actions"}},[r("div",{staticClass:"buttons"},["sm"!=t.$mq?r("ui-button",{attrs:{to:{name:"scripts"},variant:"secondary"}},[t._v("Go Back")]):t._e(),t._v(" "),r("ui-button",{attrs:{type:"submit",variant:"primary",disabled:!t.form.hasChanges},on:{click:function(e){return e.preventDefault(),t.$parent.submit(e)}}},[t._v("Save")])],1)]),t._v(" "),r("section-card",{attrs:{title:"General Information",description:"General information about this script and what it does."}},[r("ui-input-group",{attrs:{name:"name",label:"Name",help:"What should this script be called?",autocomplete:"off",autofocus:"",required:"","has-error":t.form.errors.has("name"),"error-message":t.form.errors.get("name")},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}}),t._v(" "),r("ui-textarea-group",{attrs:{name:"description",label:"Description",help:"Give a short description of what this script does.",autocomplete:"off","has-error":t.form.errors.has("description"),"error-message":t.form.errors.get("description")},model:{value:t.form.description,callback:function(e){t.$set(t.form,"description",e)},expression:"form.description"}})],1),t._v(" "),r("section-card",{attrs:{title:"Function",description:"The source code and placement of the script."}},[r("ui-textarea-group",{attrs:{name:"code",label:"Source Code",help:"The source code of the script. Must include opening and closing script tags.",autocomplete:"off","has-error":t.form.errors.has("code"),"error-message":t.form.errors.get("code")},model:{value:t.form.code,callback:function(e){t.$set(t.form,"code",e)},expression:"form.code"}})],1),t._v(" "),r("portal",{attrs:{to:"sidebar-right"}},[r("sidebar",{attrs:{id:"script-sidebar"}},[r("sidebar-section",{attrs:{id:"script_panel_status",tabindex:"-1"}},[r("ui-toggle",{attrs:{id:"script-status",name:"status",label:"Status",help:t.form.status?"Toggle to disable this script.":"Toggle to enable this script.","has-error":t.form.errors.has("status"),"error-message":t.form.errors.get("status")},model:{value:t.form.status,callback:function(e){t.$set(t.form,"status",e)},expression:"form.status"}})],1),t._v(" "),t.resource?r("status-card",{attrs:{entry:t.resource,id:"script_panel_status_card",tabindex:"-1"}}):t._e()],1)],1)],1)}),[],!1,null,null,null).exports},methods:{submit:function(){var t=this;this.form.post("/api/scripts").then((function(e){toast("Script successfully saved","success"),t.$router.push("/scripts")})).catch((function(t){toast(t.message,"failed")}))}}};const n=(0,a.Z)(i,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("portal",{attrs:{to:"title"}},[r("page-title",{attrs:{icon:"code"}},[t._v("Create Script")])],1),t._v(" "),r("shared-form",{attrs:{form:t.form}})],1)}),[],!1,null,null,null).exports}}]);