cjvt-valency/src_diploma/flask_app/vue/dist/static/js/app.abe281d88cb13e210c8b.js
2019-03-07 09:00:01 +01:00

2 lines
30 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

webpackJsonp([1],{"/U5P":function(e,t){},"0eAL":function(e,t){},"1/oy":function(e,t){},"9M+g":function(e,t){},BtA6:function(e,t){},GfHa:function(e,t){},Id91:function(e,t){},"J/Fn":function(e,t){e.exports={api_addr:"http://localhost:5004"}},Jmt5:function(e,t){},LZNP:function(e,t){},MGy4:function(e,t){},NHnr:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=s("woOf"),a=s.n(n),i=s("//Fk"),r=s.n(i),o=s("7+uW"),l={render:function(){var e=this.$createElement;return(this._self._c||e)("router-view")},staticRenderFns:[]},c=s("VU/8")({name:"App"},l,!1,null,null,null).exports,d=s("/ocq"),u={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("nav",[s("b-navbar",{attrs:{toggleable:"md",type:"light",variant:"light"}},[s("b-navbar-toggle",{attrs:{target:"nav_collapse"}}),e._v(" "),s("b-navbar-brand",[e._v("Vezljivostni vzorci slovenskih glagolov")]),e._v(" "),s("b-collapse",{attrs:{"is-nav":"",id:"nav_collapse"}},[s("b-navbar-nav",[s("b-nav-item-dropdown",{attrs:{text:"Prikaz",right:""}},e._l(e.search_options,function(t){return s("b-dropdown-item",{key:t.val,attrs:{value:t.val},on:{click:function(s){e.setNavSS(t.val)}}},[e._v("\n "+e._s(t.key)+"\n ")])}))],1),e._v(" "),this.loggedIn()?s("b-navbar-nav",{staticClass:"ml-auto",attrs:{right:""}},[s("b-nav-item",[e._v("\n Uporabnik: "+e._s(this.$root.store.username)+" \n "),s("a",{attrs:{href:"#"},on:{click:function(t){e.logOut()}}},[e._v("(odjava)")])])],1):s("b-navbar-nav",{staticClass:"ml-auto",attrs:{right:""}},[s("b-nav-item",[s("router-link",{attrs:{to:"/register"}},[e._v("\n Registracija\n ")])],1),e._v(" "),s("b-nav-item",[s("router-link",{attrs:{to:"/login"}},[e._v("\n Prijava\n ")])],1)],1)],1)],1)],1)},staticRenderFns:[]},p=s("VU/8")({name:"Nav",props:["appState"],data:function(){return{search_options:[{key:"besede",val:"words"},{key:"udeleženske vloge",val:"functors"}]}},methods:{setNavSS:function(e){this.$root.store.radio="one",this.$root.store.navSS=e,this.$router.push({name:"Home"})},loggedIn:function(){return null!==this.$root.store.token},logOut:function(){this.$root.store.token=null,this.$root.store.username=null,this.$router.push({name:"Home"})}}},u,!1,null,null,null).exports,h={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("select",{directives:[{name:"model",rawName:"v-model",value:e.selectedLetter,expression:"selectedLetter"}],on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.selectedLetter=t.target.multiple?s:s[0]}}},e._l(e.alphabet,function(t){return s("option",{domProps:{value:t}},[e._v("\n "+e._s(t.toUpperCase())+" ("+e._s(e.getNumWords(t))+")\n ")])})),e._v(" "),s("table",e._l(e.getWords(),function(t){return s("tr",[s("td",[s("a",{attrs:{href:"#"},on:{click:function(s){e.selectHw(t)}}},[e._v(e._s(t[0])+"\n "),e.$root.store.has_se.includes(t[0])?s("span",[e._v("se")]):e._e()])]),e._v(" "),s("td",[e._v("("+e._s(t[1])+")")])])}))])},staticRenderFns:[]};var v=s("VU/8")({name:"LWords",data:function(){return{alphabet:"abcčdefghijklmnoprsštuvzž",letters:{},selectedLetter:"a"}},methods:{apiGetWords:function(){var e=this;this.$http.get(this.$root.storeGet("api_addr")+"/api/words").then(function(t){e.$root.store.api_error=null,e.$root.store.has_se=t.data.has_se,e.letters=t.data.sorted_words}).catch(function(t){e.$root.store.api_error=t})},getNumWords:function(e){var t=this.letters[e];return t?t.length:0},getWords:function(){var e=this.letters[this.selectedLetter];return e||[]},selectHw:function(e){this.$router.push({name:"MainDispl",params:{hw:e[0],fmode:!1}})}},mounted:function(){this.apiGetWords()}},h,!1,function(e){s("zbom")},"data-v-52c6d79c",null).exports,m={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("table",e._l(e.functors,function(t){return s("tr",[s("td",[s("a",{attrs:{href:"#"},on:{click:function(s){e.selectFunctor(t)}}},[e._v(e._s(t[0]))])]),e._v(" "),s("td",[e._v("("+e._s(t[1])+")")])])}))])},staticRenderFns:[]};var _=s("VU/8")({name:"LWords",props:["appState"],data:function(){return{functors:[]}},methods:{apiGetFunctors:function(){var e=this;this.$http.get(this.$root.store.api_addr+"/api/functors").then(function(t){e.$root.store.api_error=null,e.functors=t.data}).catch(function(t){e.$root.store.api_error=t})},selectFunctor:function(e){this.$router.push({name:"MainDispl",params:{hw:e[0],fmode:!0}})}},mounted:function(){this.apiGetFunctors()}},m,!1,function(e){s("aqri")},null,null).exports,f=s("fZjL"),g=s.n(f),w={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"pb-3"},[void 0===e.sense?s("div",[e._v("\n pomen ni definiran\n ")]):s("div",[s("span",[e._v(e._s(e.sense.desc))]),e._v(" "),s("br"),e._v("\n   \n "),s("small",{staticClass:"text-secondary"},[e._v("\n - "+e._s(e.sense.author)+"\n "+e._s(e.gen_id())+"\n ")])])])},staticRenderFns:[]},k=s("VU/8")({name:"Sense",props:["sense"],methods:{gen_id:function(){var e=this.sense.sense_id.split("-"),t="";return"SSKJ"===this.sense.author&&("0"!==e[1]&&(t+="["+e[1]+["] "]),"0"!==e[2]&&(t+="pomen "+e[2],"0"!==e[3]&&(t+="."+e[3])),"sopo"===e[4]&&(t+=" (sopomenka)")),t.length>0&&(t=": "+t),t}}},w,!1,null,null,null).exports,$={name:"Frame",props:{frameData:{},sensData:{},fmode:{default:!1,type:Boolean}},data:function(){return{hid:null,sid:null}},components:{Sense:k},watch:{frameData:function(){this.hid=null,this.sid=null}},methods:{setHid:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null!==t){for(var s=0;s<this.frameData.slots.length;s++)if(this.frameData.slots[s].tids.includes(t))return void(this.hid=s)}else this.hid=e},clearOnClick:function(e){"SPAN"!==e.target.tagName&&(this.sid=null)},setSid:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.sid=null,null!==t){for(var s=0;s<this.frameData.slots.length;s++)if(this.frameData.slots[s].tids.includes(t))return void(this.sid=s)}else this.sid=e},hasHoverTid:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==this.hid&&(null===t?e==this.hid:this.frameData.slots[this.hid].tids.includes(t))},hasSelTid:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==this.sid&&(null===t?e==this.sid:this.frameData.slots[this.sid].tids.includes(t))},isHw:function(e){return this.frameData.tids.includes(e)},getSense:function(){for(var e in this.sensData.senses)if(this.sensData.senses[e].sense_id===this.frameData.sense_info.sense_id)return this.sensData.senses[e]},getAggrHws:function(){return g()(this.frameData.aggr_sent).sort()},getAggrSent:function(e){for(var t=[],s=0;s<this.frameData.aggr_sent[e].length;s++)t.push(this.frameData.sentences[this.frameData.aggr_sent[e][s]]);return t}}},b={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"container-fluid",on:{click:e.clearOnClick}},[s("hr"),e._v(" "),s("div",{staticClass:"row"},[s("div",{staticClass:"col-sm-7"},[s("div",{staticClass:"row"},[s("div",{staticClass:"col-sm-12"},[e._v("\n št. povedi: "+e._s(e.frameData.sentences.length)+"\n ")])]),e._v(" "),s("div",{staticClass:"row my-frames"},[s("div",{staticClass:"col-sm-12"},e._l(e.frameData.slots,function(t,n){return s("span",[s("span",{class:{"my-pointer text-danger":e.hasHoverTid(e.idx=n),"my-underline text-danger":e.hasSelTid(e.idx=n)},on:{mouseover:function(t){e.setHid(e.idx=n)},mouseleave:function(t){e.setHid()},click:function(t){e.setSid(e.idx=n)}}},[e._v(e._s(t.functor))]),e._v("  \n ")])}))])]),e._v(" "),"three"===e.$root.store.radio?s("div",{staticClass:"col-sm-5"},[s("Sense",{attrs:{sense:e.getSense()}})],1):e._e()]),e._v(" "),s("div",{staticClass:"row"},[e.fmode?s("div",{staticClass:"col-sm-12"},e._l(e.getAggrHws(),function(t){return s("div",e._l(e.getAggrSent(t),function(n){return s("blockquote",[s("span",{staticClass:"text-secondary"},[e._v(" "+e._s(t))]),s("br"),e._v(" "),e._l(n,function(t,n){return s("span",{class:{"my-pointer text-danger":e.hasHoverTid(e.idx=null,e.tid=t[0]),"my-underline text-danger":e.hasSelTid(e.idx=null,e.tid=t[0]),"text-primary":e.isHw(t[0])},attrs:{title:t[1].msd},on:{mouseover:function(s){e.setHid(e.idx=null,e.tid=t[0])},mouseleave:function(t){e.setHid()},click:function(s){e.setSid(e.idx=null,e.tid=t[0])}}},[e.$root.mkspace(n,t[1].word)?s("span",[e._v(" ")]):e._e(),e._v(e._s(t[1].word))])})],2)}))})):s("div",{staticClass:"col-sm-12"},e._l(e.frameData.sentences,function(t){return s("blockquote",e._l(t,function(t,n){return s("span",{class:{"my-pointer text-danger":e.hasHoverTid(e.idx=null,e.tid=t[0]),"my-underline text-danger":e.hasSelTid(e.idx=null,e.tid=t[0]),"text-primary":e.isHw(t[0])},attrs:{title:t[1].msd},on:{mouseover:function(s){e.setHid(e.idx=null,e.tid=t[0])},mouseleave:function(t){e.setHid()},click:function(s){e.setSid(e.idx=null,e.tid=t[0])}}},[e.$root.mkspace(n,t[1].word)?s("span",[e._v(" ")]):e._e(),e._v(e._s(t[1].word))])}))}))]),e._v(" "),s("br")])},staticRenderFns:[]};var C=s("VU/8")($,b,!1,function(e){s("BtA6")},"data-v-69c7b77f",null).exports,y=s("mvHQ"),x=s.n(y),S={name:"EditSenses",props:["hw","sentences","sens"],components:{Sense:k},data:function(){return{picked_ssj_id:null,picked_sense_id:null,local_senses:[],local_sense_map:{},new_sense_desc:"",new_senses:[],delta_sense_map:{}}},created:function(){this.local_senses=this.sens.senses;var e=x()(this.sens.sense_map);for(var t in this.local_sense_map=JSON.parse(e),this.local_sense_map)this.local_sense_map[t].sense=this.sense_id_to_sense(this.local_sense_map[t].sense_id)},watch:{picked_ssj_id:function(){this.new_link()},picked_sense_id:function(){this.new_link()}},methods:{pick_ssj_id:function(e){this.picked_ssj_id=e,e in this.local_sense_map&&(this.picked_sense_id=this.local_sense_map[e].sense_id)},new_link:function(){null!==this.picked_ssj_id&&null!==this.picked_sense_id&&(this.local_sense_map[this.picked_ssj_id]={sense_id:this.picked_sense_id,sense:this.sense_id_to_sense(this.picked_sense_id)},this.delta_sense_map[this.picked_ssj_id]={sense_id:this.picked_sense_id})},new_sense:function(e){if(""!==this.new_sense_desc){var t={hw:this.hw,author:this.$root.store.username,desc:this.new_sense_desc,sense_id:"tmp_sense_id"+(new Date).getTime()};this.local_senses.push(t),this.new_senses.push(t),this.new_sense_desc=""}},sense_id_to_sense:function(e){for(var t=0;t<this.local_senses.length;t++)if(this.local_senses[t].sense_id===e)return this.local_senses[t]},cancel_all:function(){this.$parent.state="normal"},save_all:function(){var e={token:this.$root.store.token,hw:this.hw,sense_map:this.delta_sense_map,new_senses:this.new_senses},t=this;function s(e){e.$parent.state="normal",e.$parent.request_reload=!0}0!==g()(e.sense_map).length||0!==e.new_senses.length?this.$http.post(this.$root.store.api_addr+"/api/senses/update",e,{headers:{"Content-type":"application/json"}}).then(function(){s(t)}):s(t)}}},j={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"container-fluid"},[s("div",{staticClass:"row"},[s("div",{staticClass:"col-sm-12"},[s("p",{staticClass:"pb-0 mb-0"},[e._v("Urejanje pomenov za besedo: "),s("b",[e._v(e._s(e.hw))]),e._v(".")]),e._v(" "),e._m(0),e._v(" "),s("button",{on:{click:e.cancel_all}},[e._v("Prekliči")]),e._v(" "),s("button",{on:{click:e.save_all}},[e._v("Shrani")])])]),e._v(" "),s("div",{staticClass:"row"},[s("div",{staticClass:"my-sent col-sm-6"},e._l(e.sentences,function(t,n){return s("div",{staticClass:"border rounded my-sentences my-pointer",class:{"border-primary":n===e.picked_ssj_id},on:{click:function(t){e.pick_ssj_id(n)}}},[s("div",e._l(t.words,function(n,a){return s("span",{class:{"text-primary":a===parseInt(t.hw_idx)}},[e.$root.mkspace(a,n)?s("span",[e._v(" ")]):e._e(),e._v(e._s(n)+"\n ")])})),e._v(" "),s("hr"),e._v(" "),s("div",{staticClass:"col-sm-12"},[s("small",[n in e.local_sense_map?s("div",[s("Sense",{attrs:{sense:e.local_sense_map[n].sense}})],1):s("div",[s("Sense",{attrs:{sense:void 0}})],1)])])])})),e._v(" "),s("div",{staticClass:"col-sm-6 border rounded my-div-scroll sticky-top"},[e._l(e.local_senses,function(t){return s("div",{staticClass:"my-pointer",class:{"text-primary":t.sense_id===e.picked_sense_id},on:{click:function(s){e.picked_sense_id=t.sense_id}}},[s("Sense",{attrs:{sense:t}})],1)}),e._v(" "),s("div",{staticClass:"row"},[s("div",{staticClass:"col-sm-12"},[s("textarea",{directives:[{name:"model",rawName:"v-model",value:e.new_sense_desc,expression:"new_sense_desc"}],staticClass:"my-textarea",domProps:{value:e.new_sense_desc},on:{input:function(t){t.target.composing||(e.new_sense_desc=t.target.value)}}})]),e._v(" "),s("div",{staticClass:"col-sm-12"},[s("button",{on:{click:e.new_sense}},[e._v("Dodaj pomen")])])])],2)])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("small",[this._v('\n Z miško kliknite na poved, nato kliknite na pomen, ki ga želite dodeliti povedi. Par povedpomen bo obarvan z modro. Pare lahko shranite s klikom na gumb "Shrani". Možno je dodajanje poljubnih pomenov. \n ')])])}]};var D=s("VU/8")(S,j,!1,function(e){s("MGy4")},"data-v-7d730605",null).exports,N={name:"PulseLoader",props:{loading:{type:Boolean,default:!0},color:{type:String,default:"#5dc596"},size:{type:String,default:"15px"},margin:{type:String,default:"2px"},radius:{type:String,default:"100%"}},data:function(){return{spinnerStyle:{backgroundColor:this.color,width:this.size,height:this.size,margin:this.margin,borderRadius:this.radius,display:"inline-block",animationName:"v-pulseStretchDelay",animationDuration:"0.75s",animationIterationCount:"infinite",animationTimingFunction:"cubic-bezier(.2,.68,.18,1.08)",animationFillMode:"both"},spinnerDelay1:{animationDelay:"0.12s"},spinnerDelay2:{animationDelay:"0.24s"},spinnerDelay3:{animationDelay:"0.36s"}}}},F={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{directives:[{name:"show",rawName:"v-show",value:this.loading,expression:"loading"}],staticClass:"v-spinner"},[t("div",{staticClass:"v-pulse v-pulse1",style:[this.spinnerStyle,this.spinnerDelay1]}),t("div",{staticClass:"v-pulse v-pulse2",style:[this.spinnerStyle,this.spinnerDelay2]}),t("div",{staticClass:"v-pulse v-pulse3",style:[this.spinnerStyle,this.spinnerDelay3]})])},staticRenderFns:[]};var P={name:"MainDispl",components:{Frame:C,EditSenses:D,PulseLoader:s("VU/8")(N,F,!1,function(e){s("0eAL")},null,null).exports},props:["hw","fmode"],data:function(){return{frames:[],sentences:{},sens:{senses:[],sense_map:{}},state:"loading",request_reload:!1,loader_color:"#007bff"}},created:function(){this.reload()},computed:{show_loader:function(){return"loading"===this.state&&null!==this.$root.store.api_error}},watch:{hw:function(){this.reload()},frames:function(){this.buildSentences()},request_reload:function(){this.request_reload&&(this.request_reload=!1,this.reload())}},methods:{getFFrames:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null!==e&&void 0!==e){if(null===t)switch(this.$root.store.radio){case"one":t="reduce_0";break;case"two":t="reduce_1";break;default:t="reduce_0"}var s=this;this.$http.get(this.$root.storeGet("api_addr")+"/api/functor-frames?functor="+e+"&rf="+t).then(function(e){s.$root.store.api_error=null,s.frames=e.data.frames,s.state="normal"}).catch(function(e){s.$root.store.api_error=e})}},getFrames:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null!==e&&void 0!==e){if(null===t)switch(this.$root.store.radio){case"one":t="reduce_0";break;case"two":t="reduce_1";break;case"three":t="reduce_5"}var s=this;this.$http.get(this.$root.storeGet("api_addr")+"/api/frames?hw="+e+"&rf="+t).then(function(e){s.$root.store.api_error=null,s.frames=e.data.frames,s.state="normal"}).catch(function(e){s.$root.store.api_error=e})}},buildSentences:function(){if(0!=this.frames.length)for(var e in this.sentences={},this.frames)for(var t in this.frames[e].sentences){var s=this.frames[e].sentences[t],n=s[0][0].split(".");n.splice(-1,1),n=n.join(".");var a=[],i=-1,r=this.hw;for(var o in"_"===r[r.length-1]&&(r=r.substr(0,r.length-1)),s)a.push(s[o][1].word),s[o][1].lemma===r&&-1==i&&(i=o);this.sentences[n]={hw_idx:i,words:a}}},getSenses:function(e,t){if(null!==e&&void 0!==e){var s=this;this.$http.get(this.$root.store.api_addr+"/api/senses/get?hw="+e).then(function(e){s.sens.senses=e.data.senses,s.sens.sense_map=e.data.sense_map,t()})}},reload:function(){this.state="loading",this.sentences={},"functors"===this.$root.store.navSS?this.getFFrames(this.hw):(this.getFrames(this.hw),"three"===this.$root.store.radio&&this.getSenses(this.hw,this.sortBySense)),this.calcPos()},userEdit:function(){var e=this;this.$root.checkToken().then(function(t){e.state="editing"}).catch(function(e){alert("Za urejanje je potrebna prijava.")})},calcPos:function(){var e=this.fmode;return"string"==typeof e&&(e="true"===e),e?"udeleženska vloga":"_"===this.hw.substr(this.hw.length-1)?"pridevnik":"glagol"},sortBySense:function(){for(var e=[],t=[],s=0;s<this.frames.length;s++){"nedefinirano"===this.frames[s].sense_info.sense_id?e.push(this.frames[s]):t.push(this.frames[s])}this.frames=t.concat(e)}}},H={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.show_loader?s("div",[s("pulse-loader",{attrs:{color:e.loader_color}})],1):"editing"===e.state?s("div",{staticClass:"container-fluid"},[s("EditSenses",{attrs:{hw:e.hw,sentences:e.sentences,sens:e.sens}})],1):s("div",{staticClass:"container-fluid",attrs:{id:"head"}},[s("div",{staticClass:"row"},[s("div",{staticClass:"col-sm-4"},[s("table",[s("tr",[s("h4",{attrs:{id:"main-displ-hw"}},[e._v(e._s(e.hw)+"\n "),e.$root.store.has_se.includes(e.hw)?s("span",[e._v("se")]):e._e()])]),e._v(" "),s("tr",[e._v(e._s(e.calcPos()))])])]),e._v(" "),s("div",{staticClass:"col-sm-8"},[s("table",[s("tr",[e._v("Združevanje vezljivostnih vzorcev:")]),e._v(" "),s("tr",[s("label",{staticClass:"radio-inline"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.$root.store.radio,expression:"$root.store.radio"}],attrs:{value:"one",checked:"",type:"radio",name:"optradio"},domProps:{checked:e._q(e.$root.store.radio,"one")},on:{change:[function(t){e.$set(e.$root.store,"radio","one")},function(t){e.reload()}]}}),e._v("posamezne povedi")]),e._v("  \n "),s("label",{staticClass:"radio-inline"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.$root.store.radio,expression:"$root.store.radio"}],attrs:{value:"two",type:"radio",name:"optradio"},domProps:{checked:e._q(e.$root.store.radio,"two")},on:{change:[function(t){e.$set(e.$root.store,"radio","two")},function(t){e.reload()}]}}),e._v("skupne udeleženske vloge")]),e._v("  \n "),"words"===this.$root.store.navSS?s("label",{staticClass:"radio-inline"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.$root.store.radio,expression:"$root.store.radio"}],attrs:{value:"three",type:"radio",name:"optradio"},domProps:{checked:e._q(e.$root.store.radio,"three")},on:{change:[function(t){e.$set(e.$root.store,"radio","three")},function(t){e.reload()}]}}),e._v("po meri")]):e._e()])])])]),e._v(" "),"three"===e.$root.store.radio?s("div",{staticClass:"row"},[s("div",{staticClass:"col-sm-4"},[s("button",{on:{click:e.userEdit}},[e._v("razvrsti po pomenih")])])]):e._e(),e._v(" "),e._l(e.frames,function(t){return s("div",{staticClass:"row"},[s("Frame",{attrs:{frameData:t,sensData:e.sens,fmode:e.fmode}})],1)})],2)},staticRenderFns:[]};var z=s("VU/8")(P,H,!1,function(e){s("/U5P")},"data-v-d2fe5efa",null).exports,E={name:"Home",components:{Nav:p,LWords:v,LFunctors:_,MainDispl:z},methods:{navSS:function(){return"words"===this.$root.storeGet("navSS")}}},U={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",[null!==this.$root.store.api_error?t("p",{staticClass:"text-warning"},[this._v("\n api_error: "+this._s(this.$root.store.api_error)+"\n ")]):this._e(),this._v(" "),t("Nav"),this._v(" "),t("div",{staticClass:"my-home container-fluid"},[t("div",{staticClass:"row"},[t("div",{staticClass:"col-sm-2 border-right fill",attrs:{id:"serach"}},[this.navSS()?t("LWords"):t("LFunctors")],1),this._v(" "),t("div",{staticClass:"col-sm-10"},[t("router-view")],1)])])],1)},staticRenderFns:[]};var L=s("VU/8")(E,U,!1,function(e){s("y3ES")},"data-v-566eea54",null).exports,R={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",{staticClass:"col-sm-2"},[s("a",{attrs:{href:"#"},on:{click:this.$root.routeBack}},[e._v("Nazaj")])]),e._v(" "),s("div",{staticClass:"ev-login col-sm-4 offset-sm-4"},[e.error?s("div",{staticClass:"alert alert-danger"},[s("p",[e._v(e._s(e.error))])]):e._e(),e._v(" "),s("div",{staticClass:"form-group"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.credentials.username,expression:"credentials.username"}],staticClass:"form-control js-login__username",attrs:{type:"text","data-id":"login.username",placeholder:"Uporabnik"},domProps:{value:e.credentials.username},on:{input:function(t){t.target.composing||e.$set(e.credentials,"username",t.target.value)}}})]),e._v(" "),s("div",{staticClass:"form-group"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.credentials.password,expression:"credentials.password"}],staticClass:"form-control js-login__password ",attrs:{type:"password",placeholder:"Geslo"},domProps:{value:e.credentials.password},on:{input:function(t){t.target.composing||e.$set(e.credentials,"password",t.target.value)}}})]),e._v(" "),s("button",{staticClass:"btn btn-primary solid blank js-login__submit",attrs:{"data-id":"login.submit"},on:{click:function(t){e.submit()}}},[e._v("\n Prijava"),s("i",{staticClass:"fa fa-arrow-circle-o-right"})]),e._v(" "),s("br"),e._v(" "),s("br"),e._v(" "),s("br"),e._v(" "),s("router-link",{attrs:{to:"/new_pass"}},[e._v("Ste pozabili geslo?")]),e._v(" "),s("br"),e._v(" "),s("br"),e._v("\n Nov uporabnik?\n "),s("br"),e._v(" "),s("router-link",{attrs:{to:"/register"}},[e._v("Ustvarite nov račun.")])],1)])},staticRenderFns:[]};var G=s("VU/8")({name:"Login",data:function(){return{credentials:{username:"",password:""},loggingIn:!1,error:""}},methods:{submit:function(){if(this.error="",""!==this.credentials.username&&""!==this.credentials.password){var e={username:this.credentials.username,password:this.credentials.password},t=this;this.$http.post(this.$root.storeGet("api_addr")+"/api/login",e,{headers:{"Content-type":"application/x-www-form-urlencoded"}}).then(function(e){t.$root.store.api_error=null;var s=e.data.token;null===s?t.error="Napačno uporabniško ime ali geslo.":(t.$root.store.username=t.credentials.username,t.$root.store.token=s,t.$router.go(-1),t.$cookies.set("valency_token",s,172800))}).catch(function(e){t.$root.store.api_error=e})}else this.error="Izpolnite vsa polja."}}},R,!1,function(e){s("pvJg")},"data-v-79637862",null).exports,T={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",{staticClass:"col-sm-2"},[s("a",{attrs:{href:"#"},on:{click:this.$root.routeBack}},[e._v("Nazaj")])]),e._v(" "),s("div",{staticClass:"ev-login col-sm-4 offset-sm-4"},[e.error?s("div",{staticClass:"alert alert-danger"},[s("p",[e._v(e._s(e.error))])]):e._e(),e._v(" "),s("div",{staticClass:"form-group"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.credentials.username,expression:"credentials.username"}],staticClass:"form-control js-login__username",attrs:{type:"text",placeholder:"Uporabnik",autocomplete:"off"},domProps:{value:e.credentials.username},on:{input:function(t){t.target.composing||e.$set(e.credentials,"username",t.target.value)}}})]),e._v(" "),s("div",{staticClass:"form-group"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.credentials.email,expression:"credentials.email"}],staticClass:"form-control",attrs:{type:"email",placeholder:"e-pošta",autocomplete:"off"},domProps:{value:e.credentials.email},on:{input:function(t){t.target.composing||e.$set(e.credentials,"email",t.target.value)}}})]),e._v(" "),s("div",{staticClass:"form-group"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.credentials.password,expression:"credentials.password"}],staticClass:"form-control js-login__password ",attrs:{type:"password",placeholder:"Geslo",autocomplete:"off"},domProps:{value:e.credentials.password},on:{input:function(t){t.target.composing||e.$set(e.credentials,"password",t.target.value)}}})]),e._v(" "),s("div",{staticClass:"form-group"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.credentials.snd_password,expression:"credentials.snd_password"}],staticClass:"form-control js-login__password ",attrs:{type:"password",placeholder:"Ponovite geslo.",autocomplete:"off"},domProps:{value:e.credentials.snd_password},on:{input:function(t){t.target.composing||e.$set(e.credentials,"snd_password",t.target.value)}}})]),e._v(" "),s("button",{staticClass:"btn btn-primary solid blank js-login__submit",on:{click:function(t){e.submit()}}},[e._v("\n Registracija"),s("i",{staticClass:"fa fa-arrow-circle-o-right"})])])])},staticRenderFns:[]};var V=s("VU/8")({name:"Register",data:function(){return{credentials:{username:"",password:"",snd_password:"",email:""},error:""}},methods:{clearFields:function(){for(var e in this.credentials)this.credentials[e]=""},checkEmail:function(){return!0},submit:function(){var e={username:this.credentials.username,password:this.credentials.password};for(var t in this.credentials)if(""===e[t])return void(this.error="Izpolnite vsa polja.");if(this.checkEmail(this.credentials.email)){if(this.credentials.password!==this.credentials.snd_password)return this.error="Gesli se ne ujemata.",this.credentials.password="",void(this.credentials.snd_password="");var s=this,n={username:this.credentials.username,password:this.credentials.password,email:this.credentials.email};this.$http.post(this.$root.storeGet("api_addr")+"/api/register",n,{headers:{"Content-type":"application/json"}}).then(function(e){s.$router.push({name:"Home"})}).catch(function(e){s.$root.store.api_error=e,s.error="Registracija ni uspela."})}else this.error="Preverite e-poštni naslov."}}},T,!1,function(e){s("oTNY")},"data-v-36152572",null).exports,q={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",{staticClass:"col-sm-2"},[s("a",{attrs:{href:"#"},on:{click:this.$root.routeBack}},[e._v("Nazaj")])]),e._v(" "),s("div",{staticClass:"ev-login col-sm-4 offset-sm-4"},[e.error?s("div",{staticClass:"alert alert-danger"},[s("p",[e._v(e._s(e.error))])]):e._e(),e._v(" "),s("div",{staticClass:"form-group"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.credentials.username,expression:"credentials.username"}],staticClass:"form-control js-login__username",attrs:{type:"text","data-id":"login.username",placeholder:"Uporabnik"},domProps:{value:e.credentials.username},on:{input:function(t){t.target.composing||e.$set(e.credentials,"username",t.target.value)}}})]),e._v(" "),s("div",{staticClass:"form-group"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.credentials.email,expression:"credentials.email"}],staticClass:"form-control",attrs:{type:"email",placeholder:"e-pošta"},domProps:{value:e.credentials.email},on:{input:function(t){t.target.composing||e.$set(e.credentials,"email",t.target.value)}}})]),e._v(" "),e._m(0),e._v(" "),s("button",{staticClass:"btn btn-primary solid blank js-login__submit",attrs:{"data-id":"new_pass.submit"},on:{click:function(t){e.submit()}}},[e._v("\n Novo geslo"),s("i",{staticClass:"fa fa-arrow-circle-o-right"})])])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",[t("p",[this._v("Novo geslo bo poslano na vaš e-poštni naslov.")])])}]};var A=s("VU/8")({name:"NewPass",data:function(){return{credentials:{username:"",email:""},error:""}},methods:{submit:function(){if(this.error="",""!==this.credentials.username&&""!==this.credentials.email){var e={username:this.credentials.username,email:this.credentials.email},t=this;this.$http.post(this.$root.storeGet("api_addr")+"/api/new_pass",e,{headers:{"Content-type":"application/x-www-form-urlencoded"}}).then(function(e){t.$root.store.api_error=null,e.data.confirmation,t.$router.push({name:"Home"})}).catch(function(e){t.$root.store.api_error=e})}else this.error="Izpolnite vsa polja."}}},q,!1,function(e){s("LZNP")},"data-v-7dd6e1de",null).exports;o.a.use(d.a);var M=new d.a({mode:"history",routes:[{path:"/",redirect:"/home"},{path:"/home",name:"Home",component:L,children:[{path:"words/:hw",name:"MainDispl",component:z,props:!0}]},{path:"/login",name:"Login",component:G},{path:"/register",name:"Register",component:V},{path:"/new_pass",name:"NewPass",component:A}]}),W=s("ppUw"),B=s.n(W),I=s("e6fC"),J=(s("Jmt5"),s("9M+g"),s("mtWM")),O=s.n(J),Z=s("J/Fn"),K=s.n(Z);o.a.config.productionTip=!1,o.a.use(B.a),o.a.use(I.a),o.a.prototype.$http=O.a;var Q={api_error:null,api_addr:K.a.api_addr,token:null,username:null,navSS:"words",radio:"one",has_se:[]},Y={storeSet:function(e,t){Q[e]=t},storeGet:function(e){return Q[e]}},X={checkToken:function(){var e=this;return new r.a(function(t,s){null===e.store.token&&(e.store.username=null,s(!1));var n={token:e.store.token,user:e.store.username};e.$http.post(e.store.api_addr+"/api/token",n,{headers:{"Content-type":"application/x-www-form-urlencoded"}}).then(function(n){e.store.api_error=null,n.data.confirmation?t(!0):(e.store.username=null,e.store.token=null,s(!1))}).catch(function(t){e.store.api_error=t,s(t)})})}};new o.a({el:"#app",router:M,components:{App:c},template:"<App/>",data:function(){return{store:Q}},methods:a()(Y,X,{routeBack:function(){this.$router.go(-1)},mkspace:function(e,t){return![".",",",":",";"].includes(t)}}),beforeCreate:function(){if(document.title="Vezljivostni vzorci",this.$cookies.isKey("valency_token")){var e=this.$cookies.get("valency_token"),t={token:e};this.$http.post(Q.api_addr+"/api/token",t,{headers:{"Content-type":"application/x-www-form-urlencoded"}}).then(function(t){t.data.confirmation?(Q.username=t.data.username,Q.token=e):this.$cookies.remove("valency_token")}).catch(function(e){Q.api_error=e})}}})},aqri:function(e,t){},oTNY:function(e,t){},pvJg:function(e,t){},y3ES:function(e,t){},zbom:function(e,t){},zj2Q:function(e,t){}},["NHnr"]);
//# sourceMappingURL=app.abe281d88cb13e210c8b.js.map