diff --git a/plugins/Stats/StatsPlugin.py b/plugins/Stats/StatsPlugin.py
index 9e0c1cbf..7bc09165 100644
--- a/plugins/Stats/StatsPlugin.py
+++ b/plugins/Stats/StatsPlugin.py
@@ -31,6 +31,7 @@ class UiRequestPlugin(object):
def actionStats(self):
import gc, sys
from Ui import UiRequest
+ from Crypt import CryptConnection
hpy = None
if self.get.get("size") == "1": # Calc obj size
@@ -47,16 +48,17 @@ class UiRequestPlugin(object):
yield """
"""
# Memory
try:
yield "rev%s | " % config.rev
- yield "IP external: %s | " % config.ip_external
+ yield "%s | " % config.ip_external
yield "Opened: %s | " % main.file_server.port_opened
- yield "Recv: %.2fMB, Sent: %.2fMB | " % (float(main.file_server.bytes_recv)/1024/1024, float(main.file_server.bytes_sent)/1024/1024)
+ yield "Crypt: %s | " % CryptConnection.manager.crypt_supported
+ yield "In: %.2fMB, Out: %.2fMB | " % (float(main.file_server.bytes_recv)/1024/1024, float(main.file_server.bytes_sent)/1024/1024)
yield "Peerid: %s | " % main.file_server.peer_id
import psutil
process = psutil.Process(os.getpid())
@@ -64,7 +66,7 @@ class UiRequestPlugin(object):
yield "Mem: %.2fMB | " % mem
yield "Threads: %s | " % len(process.threads())
yield "CPU: usr %.2fs sys %.2fs | " % process.cpu_times()
- yield "Open files: %s | " % len(process.open_files())
+ yield "Files: %s | " % len(process.open_files())
yield "Sockets: %s | " % len(process.connections())
yield "Calc size on off"
except Exception, err:
@@ -73,15 +75,20 @@ class UiRequestPlugin(object):
# Connections
yield "Connections (%s, total made: %s):
" % (len(main.file_server.connections), main.file_server.last_connection_id)
- yield "
id | protocol | type | ip | open | ping | buff | " - yield "idle | open | delay | sent | received | last sent | waiting | version | peerid |
---|
id | proto | type | ip | open | crypt | ping | buff | " + yield "idle | open | delay | out | in | last sent | waiting | version | peerid |
---|
"+(escaped?code:escape(code,true))+"\n
"}return''+(escaped?code:escape(code,true))+"\n
\n"};Renderer.prototype.blockquote=function(quote){return"\n"+quote+"\n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"
"+text+"
\n"};Renderer.prototype.table=function(header,body){return""+text+"
"};Renderer.prototype.br=function(){return this.options.xhtml?""+escape(e.message+"",true)+""}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); + + +/* ---- data/1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/lib/pnglib.js ---- */ + + +/** +* A handy class to calculate color values. +* +* @version 1.0 +* @author Robert Eisele

";
+ };
+
+ return Renderer;
+
+ })(marked.Renderer);
+
+ Text = (function() {
+ function Text() {
+ this.toUrl = __bind(this.toUrl, this);
+ }
+
+ Text.prototype.toColor = function(text) {
+ var color, hash, i, value, _i, _j, _ref;
+ hash = 0;
+ for (i = _i = 0, _ref = text.length - 1; 0 <= _ref ? _i <= _ref : _i >= _ref; i = 0 <= _ref ? ++_i : --_i) {
+ hash = text.charCodeAt(i) + ((hash << 5) - hash);
+ }
+ color = '#';
+ return "hsl(" + (hash % 360) + ",30%,50%)";
+ for (i = _j = 0; _j <= 2; i = ++_j) {
+ value = (hash >> (i * 8)) & 0xFF;
+ color += ('00' + value.toString(16)).substr(-2);
+ }
+ return color;
+ };
+
+ Text.prototype.toMarked = function(text, options) {
+ if (options == null) {
+ options = {};
+ }
+ options["gfm"] = true;
+ options["breaks"] = true;
+ if (options.sanitize) {
+ options["renderer"] = renderer;
+ }
+ text = marked(text, options);
+ return this.fixHtmlLinks(text);
+ };
+
+ Text.prototype.fixHtmlLinks = function(text) {
+ if (window.is_proxy) {
+ return text.replace(/href="http:\/\/(127.0.0.1|localhost):43110/g, 'href="http://zero');
+ } else {
+ return text.replace(/href="http:\/\/(127.0.0.1|localhost):43110/g, 'href="');
+ }
+ };
+
+ Text.prototype.fixLink = function(link) {
+ if (window.is_proxy) {
+ return link.replace(/http:\/\/(127.0.0.1|localhost):43110/, 'http://zero');
+ } else {
+ return link.replace(/http:\/\/(127.0.0.1|localhost):43110/, '');
+ }
+ };
+
+ Text.prototype.toUrl = function(text) {
+ return text.replace(/[^A-Za-z0-9]/g, "+").replace(/[+]+/g, "+").replace(/[+]+$/, "");
+ };
+
+ return Text;
+
+ })();
+
+ window.is_proxy = window.location.pathname === "/";
+
+ window.renderer = new Renderer();
+
+ window.Text = new Text();
+
+}).call(this);
+
+
+
+/* ---- data/1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/Time.coffee ---- */
+
+
+(function() {
+ var Time;
+
+ Time = (function() {
+ function Time() {}
+
+ Time.prototype.since = function(time) {
+ var back, now, secs;
+ now = +(new Date) / 1000;
+ secs = now - time;
+ if (secs < 60) {
+ back = "Just now";
+ } else if (secs < 60 * 60) {
+ back = (Math.round(secs / 60)) + " minutes ago";
+ } else if (secs < 60 * 60 * 24) {
+ back = (Math.round(secs / 60 / 60)) + " hours ago";
+ } else if (secs < 60 * 60 * 24 * 3) {
+ back = (Math.round(secs / 60 / 60 / 24)) + " days ago";
+ } else {
+ back = "on " + this.date(time);
+ }
+ back = back.replace(/1 ([a-z]+)s/, "1 $1");
+ return back;
+ };
+
+ Time.prototype.date = function(timestamp, format) {
+ var display, parts;
+ if (format == null) {
+ format = "short";
+ }
+ parts = (new Date(timestamp * 1000)).toString().split(" ");
+ if (format === "short") {
+ display = parts.slice(1, 4);
+ } else {
+ display = parts.slice(1, 5);
+ }
+ return display.join(" ").replace(/( [0-9]{4})/, ",$1");
+ };
+
+ Time.prototype.timestamp = function(date) {
+ if (date == null) {
+ date = "";
+ }
+ if (date === "now" || date === "") {
+ return parseInt(+(new Date) / 1000);
+ } else {
+ return parseInt(Date.parse(date) / 1000);
+ }
+ };
+
+ Time.prototype.readtime = function(text) {
+ var chars;
+ chars = text.length;
+ if (chars > 1500) {
+ return parseInt(chars / 1500) + " min read";
+ } else {
+ return "less than 1 min read";
+ }
+ };
+
+ return Time;
+
+ })();
+
+ window.Time = new Time;
+
+}).call(this);
+
+
+
+/* ---- data/1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/utils/ZeroFrame.coffee ---- */
+
+
+(function() {
+ var ZeroFrame,
+ __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ __hasProp = {}.hasOwnProperty;
+
+ ZeroFrame = (function(_super) {
+ __extends(ZeroFrame, _super);
+
+ function ZeroFrame(url) {
+ this.onCloseWebsocket = __bind(this.onCloseWebsocket, this);
+ this.onOpenWebsocket = __bind(this.onOpenWebsocket, this);
+ this.route = __bind(this.route, this);
+ this.onMessage = __bind(this.onMessage, this);
+ this.url = url;
+ this.waiting_cb = {};
+ this.connect();
+ this.next_message_id = 1;
+ this.init();
+ }
+
+ ZeroFrame.prototype.init = function() {
+ return this;
+ };
+
+ ZeroFrame.prototype.connect = function() {
+ this.target = window.parent;
+ window.addEventListener("message", this.onMessage, false);
+ return this.cmd("innerReady");
+ };
+
+ ZeroFrame.prototype.onMessage = function(e) {
+ var cmd, message;
+ message = e.data;
+ cmd = message.cmd;
+ if (cmd === "response") {
+ if (this.waiting_cb[message.to] != null) {
+ return this.waiting_cb[message.to](message.result);
+ } else {
+ return this.log("Websocket callback not found:", message);
+ }
+ } else if (cmd === "wrapperReady") {
+ return this.cmd("innerReady");
+ } else if (cmd === "ping") {
+ return this.response(message.id, "pong");
+ } else if (cmd === "wrapperOpenedWebsocket") {
+ return this.onOpenWebsocket();
+ } else if (cmd === "wrapperClosedWebsocket") {
+ return this.onCloseWebsocket();
+ } else {
+ return this.onRequest(cmd, message);
+ }
+ };
+
+ ZeroFrame.prototype.route = function(cmd, message) {
+ return this.log("Unknown command", message);
+ };
+
+ ZeroFrame.prototype.response = function(to, result) {
+ return this.send({
+ "cmd": "response",
+ "to": to,
+ "result": result
+ });
+ };
+
+ ZeroFrame.prototype.cmd = function(cmd, params, cb) {
+ if (params == null) {
+ params = {};
+ }
+ if (cb == null) {
+ cb = null;
+ }
+ return this.send({
+ "cmd": cmd,
+ "params": params
+ }, cb);
+ };
+
+ ZeroFrame.prototype.send = function(message, cb) {
+ if (cb == null) {
+ cb = null;
+ }
+ message.id = this.next_message_id;
+ this.next_message_id += 1;
+ this.target.postMessage(message, "*");
+ if (cb) {
+ return this.waiting_cb[message.id] = cb;
+ }
+ };
+
+ ZeroFrame.prototype.onOpenWebsocket = function() {
+ return this.log("Websocket open");
+ };
+
+ ZeroFrame.prototype.onCloseWebsocket = function() {
+ return this.log("Websocket close");
+ };
+
+ return ZeroFrame;
+
+ })(Class);
+
+ window.ZeroFrame = ZeroFrame;
+
+}).call(this);
+
+
+
+/* ---- data/1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/Comments.coffee ---- */
+
+
+(function() {
+ var Comments,
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ __hasProp = {}.hasOwnProperty;
+
+ Comments = (function(_super) {
+ __extends(Comments, _super);
+
+ function Comments() {
+ return Comments.__super__.constructor.apply(this, arguments);
+ }
+
+ Comments.prototype.pagePost = function(post_id, cb) {
+ if (cb == null) {
+ cb = false;
+ }
+ this.post_id = post_id;
+ this.rules = {};
+ $(".button-submit-comment").on("click", (function(_this) {
+ return function() {
+ _this.submitComment();
+ return false;
+ };
+ })(this));
+ this.loadComments("noanim", cb);
+ this.autoExpand($(".comment-textarea"));
+ return $(".certselect").on("click", (function(_this) {
+ return function() {
+ if (Page.server_info.rev < 160) {
+ Page.cmd("wrapperNotification", ["error", "Comments requires at least ZeroNet 0.3.0 Please upgade!"]);
+ } else {
+ Page.cmd("certSelect", [["zeroid.bit"]]);
+ }
+ return false;
+ };
+ })(this));
+ };
+
+ Comments.prototype.loadComments = function(type, cb) {
+ var query;
+ if (type == null) {
+ type = "show";
+ }
+ if (cb == null) {
+ cb = false;
+ }
+ query = "SELECT comment.*, json_content.json_id AS content_json_id, keyvalue.value AS cert_user_id, json.directory, (SELECT COUNT(*) FROM comment_vote WHERE comment_vote.comment_uri = comment.comment_id || '@' || json.directory)+1 AS votes FROM comment LEFT JOIN json USING (json_id) LEFT JOIN json AS json_content ON (json_content.directory = json.directory AND json_content.file_name='content.json') LEFT JOIN keyvalue ON (keyvalue.json_id = json_content.json_id AND key = 'cert_user_id') WHERE post_id = " + this.post_id + " ORDER BY date_added DESC";
+ return Page.cmd("dbQuery", query, (function(_this) {
+ return function(comments) {
+ var comment, comment_address, elem, user_address, _i, _len;
+ $(".comments-num").text(comments.length);
+ for (_i = 0, _len = comments.length; _i < _len; _i++) {
+ comment = comments[_i];
+ user_address = comment.directory.replace("users/", "");
+ comment_address = comment.comment_id + "_" + user_address;
+ elem = $("#comment_" + comment_address);
+ if (elem.length === 0) {
+ elem = $(".comment.template").clone().removeClass("template").attr("id", "comment_" + comment_address).data("post_id", _this.post_id);
+ if (type !== "noanim") {
+ elem.cssSlideDown();
+ }
+ $(".reply", elem).on("click", function(e) {
+ return _this.buttonReply($(e.target).parents(".comment"));
+ });
+ }
+ _this.applyCommentData(elem, comment);
+ elem.appendTo(".comments");
+ }
+ return setTimeout((function() {
+ return Page.addInlineEditors();
+ }), 1000);
+ };
+ })(this));
+ };
+
+ Comments.prototype.applyCommentData = function(elem, comment) {
+ var cert_domain, user_address, user_name, _ref;
+ _ref = comment.cert_user_id.split("@"), user_name = _ref[0], cert_domain = _ref[1];
+ user_address = comment.directory.replace("users/", "");
+ $(".comment-body", elem).html(Text.toMarked(comment.body, {
+ "sanitize": true
+ }));
+ $(".user_name", elem).text(user_name).css({
+ "color": Text.toColor(comment.cert_user_id)
+ }).attr("title", user_name + "@" + cert_domain + ": " + user_address);
+ $(".added", elem).text(Time.since(comment.date_added)).attr("title", Time.date(comment.date_added, "long"));
+ if (user_address === Page.site_info.auth_address) {
+ $(elem).attr("data-object", "Comment:" + comment.comment_id).attr("data-deletable", "yes");
+ return $(".comment-body", elem).attr("data-editable", "body").data("content", comment.body);
+ }
+ };
+
+ Comments.prototype.buttonReply = function(elem) {
+ var body_add, elem_quote, post_id, user_name;
+ this.log("Reply to", elem);
+ user_name = $(".user_name", elem).text();
+ post_id = elem.attr("id");
+ body_add = "> [" + user_name + "](\#" + post_id + "): ";
+ elem_quote = $(".comment-body", elem).clone();
+ $("blockquote", elem_quote).remove();
+ body_add += elem_quote.text().trim("\n").replace(/\n/g, "\n> ");
+ body_add += "\n\n";
+ $(".comment-new .comment-textarea").val($(".comment-new .comment-textarea").val() + body_add);
+ $(".comment-new .comment-textarea").trigger("input").focus();
+ return false;
+ };
+
+ Comments.prototype.submitComment = function() {
+ var body, inner_path;
+ if (!Page.site_info.cert_user_id) {
+ Page.cmd("wrapperNotification", ["info", "Please, select your account."]);
+ return false;
+ }
+ body = $(".comment-new .comment-textarea").val();
+ if (!body) {
+ $(".comment-new .comment-textarea").focus();
+ return false;
+ }
+ $(".comment-new .button-submit").addClass("loading");
+ inner_path = "data/users/" + Page.site_info.auth_address + "/data.json";
+ return Page.cmd("fileGet", {
+ "inner_path": inner_path,
+ "required": false
+ }, (function(_this) {
+ return function(data) {
+ var json_raw;
+ if (data) {
+ data = JSON.parse(data);
+ } else {
+ data = {
+ "next_comment_id": 1,
+ "comment": [],
+ "comment_vote": {}
+ };
+ }
+ data.comment.push({
+ "comment_id": data.next_comment_id,
+ "body": body,
+ "post_id": _this.post_id,
+ "date_added": Time.timestamp()
+ });
+ data.next_comment_id += 1;
+ json_raw = unescape(encodeURIComponent(JSON.stringify(data, void 0, '\t')));
+ return Page.writePublish(inner_path, btoa(json_raw), function(res) {
+ $(".comment-new .button-submit").removeClass("loading");
+ _this.loadComments();
+ _this.checkCert("updaterules");
+ _this.log("Writepublish result", res);
+ if (res !== false) {
+ return $(".comment-new .comment-textarea").val("");
+ }
+ });
+ };
+ })(this));
+ };
+
+ Comments.prototype.checkCert = function(type) {
+ var last_cert_user_id;
+ last_cert_user_id = $(".comment-new .user_name").text();
+ if (Page.site_info.cert_user_id) {
+ $(".comment-new").removeClass("comment-nocert");
+ $(".comment-new .user_name").text(Page.site_info.cert_user_id);
+ } else {
+ $(".comment-new").addClass("comment-nocert");
+ $(".comment-new .user_name").text("Please sign in");
+ }
+ if ($(".comment-new .user_name").text() !== last_cert_user_id || type === "updaterules") {
+ if (Page.site_info.cert_user_id) {
+ return Page.cmd("fileRules", "data/users/" + Page.site_info.auth_address + "/content.json", (function(_this) {
+ return function(rules) {
+ _this.rules = rules;
+ if (rules.max_size) {
+ return _this.setCurrentSize(rules.current_size);
+ } else {
+ return _this.setCurrentSize(0);
+ }
+ };
+ })(this));
+ } else {
+ return this.setCurrentSize(0);
+ }
+ }
+ };
+
+ Comments.prototype.setCurrentSize = function(current_size) {
+ var current_size_kb;
+ if (current_size) {
+ current_size_kb = current_size / 1000;
+ $(".user-size").text("used: " + (current_size_kb.toFixed(1)) + "k/" + (Math.round(this.rules.max_size / 1000)) + "k");
+ return $(".user-size-used").css("width", Math.round(70 * current_size / this.rules.max_size));
+ } else {
+ return $(".user-size").text("");
+ }
+ };
+
+ Comments.prototype.autoExpand = function(elem) {
+ var editor;
+ editor = elem[0];
+ if (elem.height() > 0) {
+ elem.height(1);
+ }
+ elem.on("input", (function(_this) {
+ return function() {
+ var current_size, min_height, new_height, old_height;
+ if (editor.scrollHeight > elem.height()) {
+ old_height = elem.height();
+ elem.height(1);
+ new_height = editor.scrollHeight;
+ new_height += parseFloat(elem.css("borderTopWidth"));
+ new_height += parseFloat(elem.css("borderBottomWidth"));
+ new_height -= parseFloat(elem.css("paddingTop"));
+ new_height -= parseFloat(elem.css("paddingBottom"));
+ min_height = parseFloat(elem.css("lineHeight")) * 2;
+ if (new_height < min_height) {
+ new_height = min_height + 4;
+ }
+ elem.height(new_height - 4);
+ }
+ if (_this.rules.max_size) {
+ if (elem.val().length > 0) {
+ current_size = _this.rules.current_size + elem.val().length + 90;
+ } else {
+ current_size = _this.rules.current_size;
+ }
+ return _this.setCurrentSize(current_size);
+ }
+ };
+ })(this));
+ if (elem.height() > 0) {
+ return elem.trigger("input");
+ } else {
+ return elem.height("48px");
+ }
+ };
+
+ return Comments;
+
+ })(Class);
+
+ window.Comments = new Comments();
+
+}).call(this);
+
+
+
+/* ---- data/1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8/js/ZeroBlog.coffee ---- */
+
+
+(function() {
+ var ZeroBlog,
+ __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ __hasProp = {}.hasOwnProperty;
+
+ ZeroBlog = (function(_super) {
+ __extends(ZeroBlog, _super);
+
+ function ZeroBlog() {
+ this.setSiteinfo = __bind(this.setSiteinfo, this);
+ this.actionSetSiteInfo = __bind(this.actionSetSiteInfo, this);
+ this.saveContent = __bind(this.saveContent, this);
+ this.getContent = __bind(this.getContent, this);
+ this.getObject = __bind(this.getObject, this);
+ this.onOpenWebsocket = __bind(this.onOpenWebsocket, this);
+ this.publish = __bind(this.publish, this);
+ this.pageLoaded = __bind(this.pageLoaded, this);
+ return ZeroBlog.__super__.constructor.apply(this, arguments);
+ }
+
+ ZeroBlog.prototype.init = function() {
+ this.data = null;
+ this.site_info = null;
+ this.server_info = null;
+ this.event_page_load = $.Deferred();
+ this.event_site_info = $.Deferred();
+ $.when(this.event_page_load, this.event_site_info).done((function(_this) {
+ return function() {
+ if (_this.site_info.settings.own || _this.data.demo) {
+ _this.addInlineEditors();
+ _this.checkPublishbar();
+ $(".publishbar").on("click", _this.publish);
+ $(".posts .button.new").css("display", "inline-block");
+ return $(".editbar .icon-help").on("click", function() {
+ $(".editbar .markdown-help").css("display", "block");
+ $(".editbar .markdown-help").toggleClassLater("visible", 10);
+ $(".editbar .icon-help").toggleClass("active");
+ return false;
+ });
+ }
+ };
+ })(this));
+ $.when(this.event_site_info).done((function(_this) {
+ return function() {
+ var imagedata;
+ _this.log("event site info");
+ imagedata = new Identicon(_this.site_info.address, 70).toString();
+ return $("body").append("");
+ };
+ })(this));
+ return this.log("inited!");
+ };
+
+ ZeroBlog.prototype.loadData = function(query) {
+ if (query == null) {
+ query = "new";
+ }
+ if (query === "old") {
+ query = "SELECT key, value FROM json LEFT JOIN keyvalue USING (json_id) WHERE path = 'data.json'";
+ } else {
+ query = "SELECT key, value FROM json LEFT JOIN keyvalue USING (json_id) WHERE directory = '' AND file_name = 'data.json'";
+ }
+ return this.cmd("dbQuery", [query], (function(_this) {
+ return function(res) {
+ var row, _i, _len;
+ _this.data = {};
+ if (res) {
+ for (_i = 0, _len = res.length; _i < _len; _i++) {
+ row = res[_i];
+ _this.data[row.key] = row.value;
+ }
+ $(".left h1 a:not(.editable-edit)").html(_this.data.title).data("content", _this.data.title);
+ $(".left h2").html(Text.toMarked(_this.data.description)).data("content", _this.data.description);
+ return $(".left .links").html(Text.toMarked(_this.data.links)).data("content", _this.data.links);
+ }
+ };
+ })(this));
+ };
+
+ ZeroBlog.prototype.routeUrl = function(url) {
+ var match;
+ this.log("Routing url:", url);
+ if (match = url.match(/Post:([0-9]+)/)) {
+ $("body").addClass("page-post");
+ this.post_id = parseInt(match[1]);
+ return this.pagePost();
+ } else {
+ $("body").addClass("page-main");
+ return this.pageMain();
+ }
+ };
+
+ ZeroBlog.prototype.pagePost = function() {
+ var s;
+ s = +(new Date);
+ return this.cmd("dbQuery", ["SELECT * FROM post WHERE post_id = " + this.post_id + " LIMIT 1"], (function(_this) {
+ return function(res) {
+ if (res.length) {
+ _this.applyPostdata($(".post-full"), res[0], true);
+ Comments.pagePost(_this.post_id);
+ } else {
+ $(".post-full").html("