Файл: static/js/custom/daily_category.js
Строк: 58
<?php
var n=0;var max_n=0;var e=10;$("#page_daily_category").bind("pageshow",function(){e=parseInt($("#notes").attr("data-e"));load_notes(0,true)});$("#page_daily_category").bind("pagehide",function(){$("#page_daily_category").remove()});$("#page_daily_category #next").on("click",next_page);$("#page_daily_category #back").on("click",back_page);$("#page_daily_category").on("swipeleft","#notes",back_page);$("#page_daily_category").on("swiperight","#notes",next_page);function load_notes(b,a){if(a){$.mobile.showPageLoadingMsg()}$.getJSON("/modules/daily_get/?category="+$("#notes").attr("data-category")+"&n="+b+"&hide=0",function(d){var c="";$.each(d,function(f,g){if(f==0){c+='<ul data-role="listview" id="daily_list" data-inset="true" data-max="'+g+'"><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.topic+"</h3><p>"+g.text+'</p><p class="ui-li-aside">'+g.date+"</p></a></li>"}});if(max_n==0){c+="<li>Записей нет.</li>"}c+="</ul>";$("#notes").html(c).trigger("create").trigger("refresh");update_navigation();if(a){$.mobile.hidePageLoadingMsg()}})}function next_page(){if((n-e)<0){return}n=n-e;load_notes(n,true)}function back_page(){if((n+e)>=max_n){return}n=n+e;load_notes(n,true)};
?>