Файл: static/js/custom/forum_category.js
Строк: 85
<?php
var n=0;var max_n=0;var e=10;$("#page_forum_category").bind("pageshow",function(){e=parseInt($("#themes").attr("data-e"));load_themes(0,true)});$("#page_forum_category").bind("pagehide",function(){$("#page_forum_category").remove()});$("#page_forum_category #next").on("click",next_page);$("#page_forum_category #back").on("click",back_page);$("#page_forum_category").on("swipeleft","#news",back_page);$("#page_forum_category").on("swiperight","#news",next_page);$("#page_forum_category").on("taphold","#themes_list li",function(){if($("#page_forum_category").attr("data-admin")==0){return}message=$(this).attr("data-id");$("#page_forum_category #popup").popup("open",{positionTo:"window",transition:"flip"})});$("#page_forum_category").on("click","#delete",function(){$.get("/modules/forum_theme_delete/?id="+message,function(){load_themes(n,true)})});$("#page_forum_category").on("click","#close",function(){$.get("/modules/forum_theme_close/?id="+message,function(){load_themes(n,true)})});$("#page_forum_category").on("click","#warning",function(){$.get("/modules/forum_theme_warning/?id="+message,function(){load_themes(n,true)})});function load_themes(b,a){if(a){$.mobile.showPageLoadingMsg()}$.getJSON("/modules/forum_themes_get/?category="+$("#themes").attr("data-id")+"&n="+b,function(d){var c="";$.each(d,function(f,g){if(f==0){c+='<ul data-role="listview" id="themes_list" data-inset="true"><li data-role="list-divider">Темы</li>';max_n=g}else{c+='<li data-id="'+g.id+'" data-icon="false"><a href="'+g.url+'"><img id="user_avatar" data-user="'+g.user+'" class="image-radius" style="opacity: 1.0" src="/modules/get_avatar/?id='+g.user+'&size=2" alt=""><h3 style="font-size: 14px">'+g.name+"</h3><p>"+g.count+"</p><p>"+g.status+'</p><p class="ui-li-aside">'+g.date+"</p></a></li>"}});if(max_n==0){c+="<li>Тем нет.</li>"}c+="</ul>";$("#themes").html(c).trigger("create").trigger("refresh");update_navigation();if(a){$.mobile.hidePageLoadingMsg()}})}function next_page(){if((n-e)<0){return}n=n-e;load_themes(n,true)}function back_page(){if((n+e)>=max_n){return}n=n+e;load_themes(n,true)};
?>