/*
@license
---
skripts: materiala pievienosanas informacija cata
autors : ReSLeaR- (Korchevskiy Evgeniy)
tulkojums: http://ucozwebmeistars.ucoz.lv/
---
*/
var addInfoToChat={_text:"",_url:"",showWindow:function(e){var t=_uButton(null,"button",{ext:1,text:"Pievienot čatā",content:'id="dwewetew65et5v"'});new _uWnd("addInfoToChat","Satura pievienošana",360,200,{autosize:1,resize:1,modal:1,notaskbar:1,fadetype:2,fadespeed:200,fadeclosetype:1,fadeclosespeed:500,align:"center"},'
Materiāls veiksmīgi pievienots
(nosaukums)'+t+"
")},showAlert:function(e,t,n,a){var o=e?"load"==e?"myWinLoadS":"myWinLoadSD":"myWinLoadSF",d=t||(e?"load"==e?"Lūdzu, uzgaidiet...":'Veiksmīgi!':'Kļūda, mēģiniet atkārtoti!');return _uWnd.alert('","",{header:0,close:1,w:280,h:90,tm:a?a:2e4,align:"left",name:"addInfoToChat_"+(n||"_"+Date.now())}),e?1:0},success:function(e){var t=this;e=$(e).text(),e.indexOf("myWinSuccess")!=-1&&/href="(.+?)"/.test(e)?(_uWnd.close("addInfoToChat_ww"),t._url=e.match(/href=\"(.+?)\"/i)[1],this.showWindow()):$(e)[0]&&t.showAlert(0,$(e).text(),"ww")},parse:function(e){var t=this,n=$('#addEntForm [name="title"]').val()||t._url||!1,a=t._url||!1;if(!n||!a)return console.error(n,a),t.showAlert(0);var o=e.replace("%TITLE%",n).replace("%URL%",a);return o},init:function(e){var t=this,n=$(document);t._text=e,n.on("click","#wsedrtgbhjnmk",function(){t.toggle("toggle")}),n.on("change","#ddasdawq",function(){$(this).attr("checked")?t.replace_button(!1):(t.toggle("hide"),t.replace_button(!0))}),t.replace_button(!1),$("#addEntForm").removeAttr("onsubmit").submit(function(e){e.preventDefault(),window.CKEDITOR&&(CKEDITOR.instances.brief.updateElement(),CKEDITOR.instances.message.updateElement()),window.uCoz&&window.uCoz.uwbb&&$("[name=message], [name=brief]").sync(),_uPostForm("addEntForm",{success:function(e){t.success(e)}}),t.showAlert("load",0,"ww",0)})},replace_button:function(e){var t=this;$(document).off("click","#dwewetew65et5v").on("click","#dwewetew65et5v",function(){e?document.location.href=t._url:(t.showAlert("load",0,"aq"),t.postChat(t.parse(t._text)))}),$("#dwewetew65et5v").find("a").html(e?"Doties uz materiāla lapu":"Pieveinot čatā")},postChat:function(e){var t=this;return e?void $.post("/mchat/",{mcmessage:e,a:18,ajax:1},function(e){var n=$(e).text();return n.indexOf("newEntryT")==-1?(console.error(n),t.showAlert(0)):(_uWnd.getbyname("addInfoToChat_aq").close(),$("#ddasdawq").before('Ieraksts veiksmīgi pievienots čatā!
'),$("#wsedrtgbhjnmk, #dwdqwdqwrf, #ddasdawq, #ddasdawq + label").animate({opacity:0,height:0},300),$("#dwdqwdqwrf + div").css("margin-top",0),t.replace_button(!0),_uWnd.getbyname("addInfoToChat").checksize(),void 0)}):(console.error(e),t.showAlert(0))},toggle:function(e){e=e?e:"toggle",$("#dwdqwdqwrf").animate({height:e,opacity:e},150,function(){_uWnd.getbyname("addInfoToChat").checksize()})}};