text: var NewsView=function(e){"use strict";e(document).ready(function(){Locale.ensureLoaded("system");Locale.ensureLoaded("news")});function t(){s("new")}function s(t){Modal.create({id:"newsAddEditModal",modal_large:true,title:Locale.str("news","edit"),oncreated:function(s,o){e("#"+s).modal("show");var n="__api__/news/"+t+"?include_settings=news.categories";e.getJSON(n,function(n,a,r){var i=e("#template-news-addedit").html();n=e.extend({},n,Locale.getViewsStrings(["system","news"]));n.method=t==="new"?"post":"put";n.newsid=t;var l=n.settings.news.categories;if(typeof l!=="null"||typeof l!=="undefined"){n.has_categories=true;if(typeof l==="string"){n.categories=l.split(",")}else{n.categories=l}for(var d in n.categories){n.categories[d]=n.categories[d].replace(/(^\s+|\s+$)/,"")}}n.urid=UIDGenerator.get();var c={"rights-controls":e("#template-rights-controls").html(),"locales-selection":e("#template-locales-selection").html()};n.simple_rights_visible=(n.rights.rights&4)>0;var u=r.getResponseHeader("Mojura-Supported-Languages");n.supported_locales=typeof u==="string"?u.split(", "):[];n.is_multilingual=n.supported_locales.length>1;var g=Mustache.render(i,n,c);e(".modal-body","#"+s).html(g);o()});return true},onsubmitted:function(e,t){location.reload()}})}function o(t){Modal.create({id:"newsDeleteModal",btn_class:"btn-danger",btn_action:Locale.str("system","delete"),title:Locale.str("news","delete"),oncreated:function(s){e("#"+s).modal("show");var o=e("#template-news-delete").html();var n=Locale.getViewsStrings(["system","news"]);n.newsid=t;n.urid=UIDGenerator.get();var a=Mustache.render(o,n);e(".modal-body","#"+s).html(a)},onsubmitted:function(e,t){n()}})}function n(){document.location=e("base").attr("href")+"news"}return{showAdd:t,showEdit:s,showDelete:o,gotoList:n}}(jQuery);