var SITE_URL = "https://chatplayshare.com"; if(!URL_ROOT){ var URL_ROOT = "/"; } var plugin = { name : "comments", comments : {}, commentTimeout : null, commentsParsing : false, addingComment : false, replyingComment : false, newChild : false, newChildParent : false, options :{}, createOverlay: function(container, button){ button.html(""); container.append("
"); }, hideOverlay: function(container, button){ button.html(""); container.find(".details_overlay").remove(); }, integrate : function(plugins,options){ var framework = this; var headID = document.getElementsByTagName("head")[0]; if(document.getElementById("comments_plugin_css") == null){ var cssNode = document.createElement('link'); cssNode.id = "comments_plugin_css"; cssNode.type = 'text/css'; cssNode.rel = 'stylesheet'; cssNode.href = URLROOT + 'plugins/comments/css/comments.css'; cssNode.media = 'screen'; headID.appendChild(cssNode); } if(document.getElementById("comments_plugin_mobile_css") == null){ var cssNode = document.createElement('link'); cssNode.id = "comments_plugin_mobile_css"; cssNode.type = 'text/css'; cssNode.rel = 'stylesheet'; cssNode.href = URLROOT + 'plugins/comments/css/mobile/comments.css'; cssNode.media = 'screen'; headID.appendChild(cssNode); } var plugin = this; this.options = options; $(document).ready(function(){ var html = "\
"; if(options.title){ html = html + "

" + options.title + "

"; } if($d.session && $d.session.isLoggedIn()){ html += "
\
\
\
"; if(options.anonymous){ html += ""; } html += "\ \ \
\
\
"; }else{ html += ""; } html +="
\ \
\
    \
    \ "; var ele = $('#' + options.element) ele.append(html); if(typeof(uploader) != "undefined"){ new uploader({ field:ele.find(".comment_box_container"), button:ele.find(".upload_button").get(0), insertBefore:false, containField:false, stacked: false, fitted: true, floatRight:false }); ele.find(".comment_box_buttons").css({position:"absolute"}); } var textarea = ele.find("#comment"); var addComment = ele.find(".send_button"); if(addComment.length > 0){ addComment.click(function(){ framework.createOverlay(ele.find(".comment_box_container"),addComment); plugin.addComment(textarea,null,function(comment){ framework.hideOverlay(ele.find(".comment_box_container"),addComment); if(typeof(comment.error) == "undefined"){ textarea.html(""); } }); }); } var checkScroll = function(field){ console.log(field.clientHeight); if(field.clientHeight < field.scrollHeight || field.clientHeight >= 67){ ele.addClass("comment_scroll"); }else{ ele.removeClass("comment_scroll"); } }; textarea.keyup(function(e){ var Ucode = e.keyCode? e.keyCode : e.charCode; checkScroll(this); }); //setupCheckboxes(); plugin.comments = options.comments; if(typeof(plugin.comments) != "object"){ plugin.comments = {}; } plugin.processComments(plugin.comments, options.entityID); if($("#comment_sort").length > 0){ $("#comment_sort").change(function(){ $d.helpers.showOverlay($("#comments_list_container")); $d.network.post(URLROOT+"comments/sort/" + options.type,{entity:options.entityID,sort:$("#comment_sort").val(),session_id:""},function(result){ options.comments = result; plugin.processComments(result) }); }); } if("" != ""){ if(typeof(typeof window[""]) === "function"){ ; } } $d.initCheckboxes(ele); $d.initSelects(ele); }); }, processComment : function(comment,append,element,fadeIn){ var plugin = this; var framework = this; if(comment != null){ var image = ""; if(comment.image.startsWith("http")){ image = comment.image; }else{ image = SITE_URL + comment.image; } var commentUserImage = ""; var commentUsername = comment.username; if(comment.link && comment.link != "" && comment.deleted == false) { commentUserImage = ""; commentUsername = ""+comment.username+""; } var li = $(document.createElement("li")); li.addClass("comment_item clearfix"); li.attr("data-id",comment.id); li.attr("point-count",comment.score); li.attr("data-parent",comment.parent); li.attr("data-level",comment.level); li.attr("data-type",comment.type); li.attr("data-children",0); li.attr("data-guildings",comment.guilds); li.addClass("level-"+comment.level); if(comment.parent > 0){ var p = $("li[data-id="+comment.parent+"] > ul"); if(p.length > 0){ element = p; } } if(comment.level > 1){ li.addClass("sub-comment"); var parent = $(".comment_item[data-id='"+comment.parent+"']"); parent.addClass("has-children"); parent.data("children",parent.data("children") + 1); if(parent.length){ var setText = function(parent,e){ var text = "Show"; if(e.hasClass("collapsed")){ text = "Hide"; } var coText = "comment"; if(parent.data("children") > 1){ coText += "s"; } e.attr("title",text + " " + parent.data("children") + " " + coText); e.find(".comment_count").html(parent.data("children")); }; var e = parent.find("> .comment_container .collapse_comments"); if(e.length == 0){ parent.find(".comment_left").prepend("1"); e = parent.find("> .comment_container .collapse_comments"); console.log(e); e.click(function(){ var ele = $(this); if(parent.hasClass("collapsed")){ parent.removeClass("collapsed"); }else{ parent.addClass("collapsed"); } setText(parent,e); }); } if(e.length > 0){ setText(parent,e); } } } var container = $(document.createElement("div")); container.addClass("comment_container"); container.html("\
    \
    "+commentUserImage+"
    \
    \
    "+commentUsername+", "+comment.datetime+"
    \
    \
    \
    \
    \
    \
    \
    \
    \
    \
    \
    "+comment.score+" points
    \
    \
    \
    \ "); li.append(container); li.append(""); if(comment.loggedIn){ if(comment.deleted == false){ container.find(".comment_left").append(""); container.find(".comment_voting_buttons").append("\ "); var upvote = container.find(".upVote"); if(upvote.length > 0){ upvote.click(function(){ plugin.upvote(comment.id); }); } var downvote = container.find(".downVote"); if(downvote.length > 0){ downvote.click(function(){ plugin.downvote(comment.id); }); } var guildButton = container.find(".comment_guild"); var updateGuildCount = function(){ var con = guildButton.find(".comment_guilds"); if(li.data("guildings") > 0){ con.html(li.data("guildings")); li.addClass("guilded"); }else{ con.html(""); li.removeClass("guilded"); } }; updateGuildCount(); guildButton.click(function(){ var doGuild = function(){}; doGuild = function(c){ $d.network.post(URLROOT+"credits/guild",{entity:comment.id,type:"comment",uid:comment.user,confirm:c},function(data){ if(data == "confirm"){ if(confirm("You've already guilded this comment are you sure you'd like to give it another one?")){ doGuild(1); } }else{ if(data != false){ li.data("guildings",data); }else{ alert("You don't have enough credits"); } updateGuildCount(); } }); }; doGuild(0); }); var replyButton = $(""); container.find(".comment_buttons").append(replyButton); replyButton.click(function(){ var existing = $(".comment_reply_box[data-parent="+comment.id+"]"); $(".comment_reply_box").remove(); $(".replying").removeClass("replying"); if(!existing.length){ container.addClass("replying"); var replyBox = $("
  • \
    \
    \
    \ \ \
    \
    \
  • "); if(typeof(uploader) != "undefined"){ new uploader({ field:$(replyBox).find(".comment_reply_content"), button:$(replyBox).find(".upload_button").get(0), insertBefore:false, containField:false, stacked: false, fitted: true, floatRight:false }); }else{ replyBox.find(".upload_button").hide(); } var textarea = replyBox.find(".textarea"); if(comment.level == 21){ textarea.html("@"+comment.username + "  "); } var checkScroll = function(field){ if(field.clientHeight < field.scrollHeight || field.clientHeight >= 65){ $(replyBox).addClass("comment_scroll"); }else{ $(replyBox).removeClass("comment_scroll"); } }; textarea.keyup(function(e){ var Ucode = e.keyCode? e.keyCode : e.charCode; if(Ucode == 13) { if(e.shiftKey == false){ e.preventDefault(); $(this).parent().parent().parent().find(".send_button").click(); return false; }else{ checkScroll(this); } }else{ checkScroll(this); } }); replyBox.find(".send_button").click(function(){ var text = $(this).parent().parent().parent().find(".textarea"); var par = $(this).parent().parent().parent(); var button = $(this); framework.createOverlay(text.parent(),$(this)); var p = par.data("parent"); if(comment.level == 21){ p = par.data("cparent"); } plugin.addComment(text,p,function(comment){ if(typeof(comment.error) == "undefined"){ par.remove(); container.removeClass("replying"); }else{ framework.hideOverlay(text.parent(),button); } }); }); container.after(replyBox); textarea.focus(); } }); if(comment.delete == true){ li.addClass("deleteable"); var deleteButton = $(""); container.find(".comment_buttons").append(deleteButton); deleteButton.click(function(){ $(".comment_reply_box").remove(); container.removeClass("replying"); if(confirm("Are you sure you want to delete this comment?")){ var comment = $(this).attr("data-id"); var p = $(this).parent().parent().parent().parent(); var type = p.parent().data("type"); $d.helpers.showOverlay(p,"",false,false); $d.network.post(URLROOT+"comments/delete/" + type,{id:comment,session_id:""},function(){ plugin.comments[comment] = null; var children = $(".comment_item[data-parent="+comment+"]"); if(children.length > 0){ p.find(".comment_username").html("deleted"); p.find(".comment_reply").remove(); container.removeClass("replying"); p.find(".comment_delete").remove(); p.find(".comment_voting_buttons").remove(); p.addClass("comment_deleted"); p.find(".comment_content").html("[deleted]"); $d.helpers.hideOverlay(); }else{ p.remove(); } }); } }); } }else{ container.addClass("comment_deleted"); } } if(comment.previews && comment.previews.length > 0){ } var content = container.find(".comment_content"); if(content.length > 0) { content.html("

    "+comment.comment+"

    "); } if(fadeIn == true){ li.hide(); } if(typeof(append) != "undefined" && append == true && typeof(element) != "undefined" && element != null){ element.append(li); }else{ element.prepend(li); } if(fadeIn == true){ li.fadeIn(500); } if(typeof(comment.children) != "undefined" && comment.children != null){ for(var x in comment.children){ plugin.processComment(comment.children[x],true,element); } } return li; } }, processComments : function(comments, id) { var plugin = this; var process = function(comments) { if(comments && typeof(comments) != "undefined" && comments != null) { var element = $("#comments_list"); element.html(""); var count = 0; for(var commentIndex in comments) { var comment = comments[commentIndex]; if(comment != null){ plugin.processComment(comment,true,element); } } } }; if(comments && typeof(comments) != "undefined" && comments != null) { process(comments); plugin.updateList(); $d.helpers.hideOverlay(); } }, updateList : function(){ $("#comments_list li.comment_no_comment").remove(); var commentList = $("#comments_list li"); if(commentList.length > 1){ $("#comment_sort").css({display:"block"}); }else{ $("#comment_sort").css({display:"none"}); } if(commentList.length == 0){ var li = $(document.createElement("li")); li.addClass("comment_item clearfix comment_no_comment"); if($d.session && $d.session.isLoggedIn()){ li.html("
    Be the first to comment!
    "); }else{ //li.html("
    Login to comment
    "); } $("#comments_list").append(li); } }, addComment : function(element,parent,callback) { var plugin = this; if(typeof(parent) == "undefined" || parent == null){ parent = 0; } if(plugin.addingComment == false){ plugin.addingComment = true; if(typeof(element) != "undefined" && element != null){ var text = $(element); } else{ var text = $("#comment"); } if(text.length > 0) { var isDiv = false; if(text.is("div")){ isDiv = true; var content = $d.helpers.stripHTML(text.html()); }else{var content = text.val();} var domField = null; if(element){ domField = element.parent().get(0); if(domField.uploader){ var used = {}; for(var x in domField.uploader.uploads){ var upload = domField.uploader.uploads[x]; if(upload != null){ if(upload.url){ if(!used[upload.url]){ content += " " + upload.url.replace("%2F","/"); used[upload.url] = true; } } } } } } if(content == "") { alert("Please enter a comment"); plugin.addingComment = false; } else { var anonymous = false; if(plugin.options.anonymous){ var anonymous = document.getElementById("comment_anonymous").checked; } if(anonymous == true) {anonymous = 1;} else {anonymous = 0;} if(!isDiv){ text.attr("disabled",true); text.css({width:"69%"}); var loading = $("#comment_loading").css({display:"block"}); } $d.network.request({ type:"POST", url:URLROOT+"comments/save/" + plugin.options.type, data:{id:plugin.options.entityID, content:content, anonymous:anonymous, parent:parent, session_id:""} }).done(function(result){ if(result != "") { var newComment = JSON.parse(result); if(callback){ try{callback(newComment);} catch(e){} } if(typeof(newComment.error) == "undefined"){ if(domField != null && domField.uploader){ domField.uploader.clear(); } text.val(""); plugin.comments[newComment.id] = newComment; $("li[data-id="+newComment.parent+"]").addClass("collapsed"); var pComment = plugin.processComment(newComment,false,$("#comments_list"),true); plugin.updateList(); }else{ if(newComment.error == "spam"){ var element = $("#comments_list"); if($("#comments_list #spam_error_wait").length > 0){ $("#comments_list #spam_error_wait").html(newComment.wait); } else { element.prepend("

    You're doing the thing too quickly please wait " + newComment.wait + " seconds

    "); } } } } else { alert("Could not post your comment, please try again"); } }).always(function(result){ if(!isDiv){ text.attr("disabled",false); text.attr("style",''); loading.css({display:"none"}); } plugin.addingComment = false; }); } } } }, downvote : function(id) { var plugin = this; var uoption = $(".comment_upvote_"+id); var doption = $(".comment_downvote_"+id); var comment = $(".comment_item[data-id="+id+"]"); var points = parseInt(comment.attr("point-count")); if(doption.hasClass("selected")) { doption.removeClass("selected"); points++; } else if(uoption.hasClass("selected")) { uoption.removeClass("selected"); doption.addClass("selected"); points--; points--; } else { doption.addClass("selected"); points--; } if(plugin.comments[id]){ plugin.comments[id].upclass = ""; plugin.comments[id].downclass = ""; if(doption.hasClass("selected")){ plugin.comments[id].upclass = ""; plugin.comments[id].downclass = "selected"; }else if(uoption.hasClass("selected")){ plugin.comments[id].upclass = "selected"; plugin.comments[id].downclass = ""; } plugin.comments[id].score = points; } comment.attr("point-count",points); comment.find(".comment_score").first().html(points + " points"); $d.network.post(URLROOT+"comments/downVote/" + plugin.options.type, {cid:id,session_id:""}, function(result) {}); }, upvote : function(id) { var plugin = this; var uoption = $(".comment_upvote_"+id); var doption = $(".comment_downvote_"+id); var comment = $(".comment_item[data-id="+id+"]"); var index = id; var points = parseInt(comment.attr("point-count")); if(uoption.hasClass("selected")) { uoption.removeClass("selected"); points--; } else if(doption.hasClass("selected")) { doption.removeClass("selected"); uoption.addClass("selected"); points++; points++; } else { uoption.addClass("selected"); points++; } if(plugin.comments[id]){ plugin.comments[id].upclass = ""; plugin.comments[id].downclass = ""; if(doption.hasClass("selected")){ plugin.comments[id].upclass = ""; plugin.comments[id].downclass = "selected"; }else if(uoption.hasClass("selected")){ plugin.comments[id].upclass = "selected"; plugin.comments[id].downclass = ""; } plugin.comments[id].score = points; } comment.attr("point-count",points); comment.find(".comment_score").first().html(points + " points"); $d.network.post(URLROOT+"comments/upVote/" + plugin.options.type, {cid:id,session_id:""}, function(result) {}); } }; var options = { type:"topic", anonymous : "1", comments : [{"id":24133,"user":82220,"comment":"instead of bringing mice or dead birds, she will "hunt" for small pinecones and give them as gifts","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/giraffe.jpg","link":"\/profile\/DeangeloVickers","date":"2016-06-22","delete":false,"datetime":"Jun 22nd 2016 06:25","timestamp":1466576740,"loggedIn":false,"username":"DeangeloVickers","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":2,"type":"1","type_string":"topic"},{"id":24069,"user":57315,"comment":"Woke me up at 3am for snuggles per usual. She was rubbing her head on my chin and then bit me on the neck. Very unlike her to do that :\/","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/giraffe.jpg","link":"\/profile\/superjenjen","date":"2016-06-18","delete":false,"datetime":"Jun 18th 2016 19:22","timestamp":1466277743,"loggedIn":false,"username":"superjenjen","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":2,"type":"1","type_string":"topic"},{"id":23906,"user":-1,"comment":"Castiel likes to steal random things and hide them under couches and beds. Its everything from hairties to rolls of paper.","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/cat.jpg","link":"","date":"2016-06-07","delete":false,"datetime":"Jun 07th 2016 14:25","timestamp":1465309555,"loggedIn":false,"username":"Anonymous","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":1,"type":"1","type_string":"topic"},{"id":23279,"user":81437,"comment":"Way too many things lol he's a special lad...
    \nOne of the things he likes to do though everyday... is go to the bathroom and pull down all the neatly folded towels off the hanger thingy's and pile them on the floor and wander off (he's not clawing them or trying to climb or anything like that) I'm a neat freak, it bugs me but i love the little guy so i put up with it 24\/7","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/rhino.jpg","link":"\/profile\/BookGoblinz","date":"2016-05-13","delete":false,"datetime":"May 13th 2016 07:06","timestamp":1463123218,"loggedIn":false,"username":"BookGoblinz","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":22930,"user":33558,"comment":"She got stuck in a cutlery drawer once. [link<\/a>]","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/giraffe.jpg","link":"\/profile\/PreciousIllusions","date":"2016-04-21","delete":false,"datetime":"Apr 21st 2016 15:25","timestamp":1461252330,"loggedIn":false,"username":"PreciousIllusions","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":22725,"user":81032,"comment":"I got my cat when he was only 6wks old. He used to sit on my shoulder as I cooked dinner. He now, at almost a year old and 11lbs of kitty, still thinks that's its acceptable. He also shoves his head under the running faucet.","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/cat.jpg","link":"\/profile\/thederpypug","date":"2016-04-06","delete":false,"datetime":"Apr 06th 2016 03:47","timestamp":1459914457,"loggedIn":false,"username":"thederpypug","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":22717,"user":64358,"comment":"Female cat sitting in the living room way across the flat, me standing in the kitchen. I pretend to throw a kibble into the dining room and the silly thing looks to the side as if I threw it in the living room. There is a bedroom between dining room and living room...","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/giraffe.jpg","link":"\/profile\/Omnometroid","date":"2016-04-05","delete":false,"datetime":"Apr 05th 2016 21:04","timestamp":1459890263,"loggedIn":false,"username":"Omnometroid","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":22352,"user":17476,"comment":"My cat would steal my socks as a kitten and leave them all around the house if we were gone for more than an hour (usually my parents would go shopping or something, and I'd be outside playing w\/ my friends -- days of little to no parental supervision). My mom continued to blame me for a long time until she caught her in the act.","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/giraffe.jpg","link":"\/profile\/CowsGoMooALot","date":"2016-03-16","delete":false,"datetime":"Mar 16th 2016 16:03","timestamp":1458144190,"loggedIn":false,"username":"CowsGoMooALot","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[{"id":22378,"user":68149,"comment":"One of mine does that too. She'll also meow super loudly to present them to us and play around with them!!","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/giraffe.jpg","link":"\/profile\/CatsandUnicorns","date":"2016-03-17","delete":false,"datetime":"Mar 17th 2016 01:25","timestamp":1458177926,"loggedIn":false,"username":"CatsandUnicorns","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":2,"children":[],"deleted":0,"parent":22352,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"}],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":22344,"user":78758,"comment":"Learned to open doors and comes in during sexy time xD","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/rhino.jpg","link":"\/profile\/blobbyblobblob","date":"2016-03-16","delete":false,"datetime":"Mar 16th 2016 10:57","timestamp":1458125857,"loggedIn":false,"username":"blobbyblobblob","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":22340,"user":1,"comment":"Not exist, because I don't have a cat. I made myself sad :(","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/cat.jpg","link":"\/profile\/TheBritishAreComing","date":"2016-03-16","delete":false,"datetime":"Mar 16th 2016 07:53","timestamp":1458114784,"loggedIn":false,"username":"TheBritishAreComing","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[{"id":24128,"user":43237,"comment":"Why don't you buy a cat?","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/giraffe.jpg","link":"\/profile\/douchewadextreme","date":"2016-06-22","delete":false,"datetime":"Jun 22nd 2016 03:45","timestamp":1466567145,"loggedIn":false,"username":"douchewadextreme","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":2,"children":[],"deleted":0,"parent":22340,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"}],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":22335,"user":68149,"comment":"Eat our mattress and a dryer sheet... It's like we don't feed him.","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/giraffe.jpg","link":"\/profile\/CatsandUnicorns","date":"2016-03-16","delete":false,"datetime":"Mar 16th 2016 04:17","timestamp":1458101847,"loggedIn":false,"username":"CatsandUnicorns","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":22328,"user":51498,"comment":"Parents cat always climbs a tree to about head hight and then swipes at everybody who walks underneath","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/cat.jpg","link":"\/profile\/Pushsomeofthebuttons","date":"2016-03-16","delete":false,"datetime":"Mar 16th 2016 00:44","timestamp":1458089050,"loggedIn":false,"username":"Pushsomeofthebuttons","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":21408,"user":79851,"comment":"Our 19 pound tabby, batted a 26 pound poodle across the kitchen, and made a weird sound. The cat said "mmmmaaatt" as he did it. One of the funniest things i've seen a cat do!","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/rhino.jpg","link":"\/profile\/lukeleduke","date":"2016-01-31","delete":false,"datetime":"Jan 31st 2016 20:21","timestamp":1454271661,"loggedIn":false,"username":"lukeleduke","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":21209,"user":79554,"comment":"My cat taught herself to climb my loft bed so she can sleep with me at night :3 its super cute but also strange how she watched me to learn!","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/cat.jpg","link":"\/profile\/MagikarpsAreCool","date":"2016-01-25","delete":false,"datetime":"Jan 25th 2016 13:42","timestamp":1453729353,"loggedIn":false,"username":"MagikarpsAreCool","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":20475,"user":8011,"comment":"I used to have conversations with my ex wife's cat. We'd argue a good bit, but I was always her favorite creature. Now I see her on Skype from time to time and we'll talk then. It sounds weird when described, but when you witness it, it is really fucking freaky.","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/cat.jpg","link":"\/profile\/bufferkiller","date":"2015-12-07","delete":false,"datetime":"Dec 07th 2015 22:19","timestamp":1449526796,"loggedIn":false,"username":"bufferkiller","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":20474,"user":76135,"comment":"This was more cute than weird... I went to clean the litter tray for Monnie, without realising that he wanted to use it. He got so confused when he saw that it was empty that he jumped on the counter where I kept the bag of litter and climbed into it. Thing is he could only fit his front half in and ended up peeing on the counter instead. I couldn't do anything except just let him do his business. It was just cute that he actually tried to go in litter.","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/giraffe.jpg","link":"\/profile\/ihaveacreepyonion","date":"2015-12-07","delete":false,"datetime":"Dec 07th 2015 20:38","timestamp":1449520709,"loggedIn":false,"username":"ihaveacreepyonion","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":1,"type":"1","type_string":"topic"},{"id":20388,"user":29316,"comment":"Exist, because I don't have a cat.","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/cat.jpg","link":"\/profile\/imyourzer0","date":"2015-12-01","delete":false,"datetime":"Dec 01st 2015 02:03","timestamp":1448935380,"loggedIn":false,"username":"imyourzer0","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":20356,"user":76103,"comment":"My cat took a shit in the toilet he was a strange creature","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/cat.jpg","link":"\/profile\/kobolt60","date":"2015-11-29","delete":false,"datetime":"Nov 29th 2015 23:11","timestamp":1448838661,"loggedIn":false,"username":"kobolt60","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":20336,"user":47827,"comment":"My cat got a plastic bag stuck around her paw and ran all over the house, thinking the bag was chasing her. Took 20 minutes to get her out from under the bed (which is low so i can't get under) to get the bag off.","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/rhino.jpg","link":"\/profile\/McCoyer518","date":"2015-11-27","delete":false,"datetime":"Nov 27th 2015 23:57","timestamp":1448668661,"loggedIn":false,"username":"McCoyer518","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":20301,"user":78310,"comment":"My cat likes to stop and stare at one corner in my room, always the same corner.","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/giraffe.jpg","link":"\/profile\/Cassie","date":"2015-11-24","delete":false,"datetime":"Nov 24th 2015 21:16","timestamp":1448399765,"loggedIn":false,"username":"Cassie","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":2,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":20151,"user":44700,"comment":"Smelling the food even before we decide to what to cook. bastards six sense is legendary","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/rhino.jpg","link":"\/profile\/ilkeryuceler","date":"2015-11-02","delete":false,"datetime":"Nov 02nd 2015 14:44","timestamp":1446475469,"loggedIn":false,"username":"ilkeryuceler","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":19928,"user":42919,"comment":"My cat once floated towards the ceiling. It was weird ... I don't even have a cat.","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/rhino.jpg","link":"\/profile\/Kaltic","date":"2015-10-04","delete":false,"datetime":"Oct 04th 2015 03:41","timestamp":1443930068,"loggedIn":false,"username":"Kaltic","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":2,"level":1,"children":[{"id":19995,"user":27584,"comment":"Are you living in the quaint town of Night Vale?","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/giraffe.jpg","link":"\/profile\/kukura","date":"2015-10-13","delete":false,"datetime":"Oct 13th 2015 01:36","timestamp":1444700177,"loggedIn":false,"username":"kukura","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":2,"level":2,"children":[],"deleted":0,"parent":19928,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"}],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":19921,"user":23026,"comment":"turned into a rabbit","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/cat.jpg","link":"\/profile\/ShokkValue","date":"2015-10-04","delete":false,"datetime":"Oct 04th 2015 02:51","timestamp":1443927067,"loggedIn":false,"username":"ShokkValue","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":1,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":19872,"user":76579,"comment":"My cat was hitting the dishwasher repeatedly. It was really weird.","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/rhino.jpg","link":"\/profile\/Espadon","date":"2015-09-26","delete":false,"datetime":"Sep 26th 2015 18:33","timestamp":1443292429,"loggedIn":false,"username":"Espadon","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":3,"level":1,"children":[{"id":19873,"user":27584,"comment":"Oh, wow, that's bizarre. But, then again, I would probably too if I was aware of a machine that magically made a ton of noise all at once!","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/giraffe.jpg","link":"\/profile\/kukura","date":"2015-09-26","delete":false,"datetime":"Sep 26th 2015 19:58","timestamp":1443297511,"loggedIn":false,"username":"kukura","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":2,"level":2,"children":[],"deleted":0,"parent":19872,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"}],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":19850,"user":1,"comment":"I don't have a cat, so nothing :(","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/cat.jpg","link":"\/profile\/TheBritishAreComing","date":"2015-09-25","delete":false,"datetime":"Sep 25th 2015 06:59","timestamp":1443164365,"loggedIn":false,"username":"TheBritishAreComing","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":2,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":19847,"user":32667,"comment":"be afraid of my bedsheets","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/giraffe.jpg","link":"\/profile\/Imnotactuallyblue","date":"2015-09-25","delete":false,"datetime":"Sep 25th 2015 02:42","timestamp":1443148966,"loggedIn":false,"username":"Imnotactuallyblue","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":2,"level":1,"children":[],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"},{"id":19846,"user":10106,"comment":"Curled up in my bed. I dont have a cat. freaked me out.","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/rhino.jpg","link":"\/profile\/rdbcruzer","date":"2015-09-25","delete":false,"datetime":"Sep 25th 2015 02:42","timestamp":1443148928,"loggedIn":false,"username":"rdbcruzer","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":9,"level":1,"children":[{"id":19848,"user":27584,"comment":"Oof, yeah, that's generally problematic. You have a cat now, apparently.","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/giraffe.jpg","link":"\/profile\/kukura","date":"2015-09-25","delete":false,"datetime":"Sep 25th 2015 02:42","timestamp":1443148971,"loggedIn":false,"username":"kukura","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":2,"level":2,"children":[{"id":19849,"user":10106,"comment":"He left as quickly as he came. I named him Phil. Phil is on an adventure.","image":"https:\/\/chatplayshare.com\/themes\/default\/images\/profiles\/rhino.jpg","link":"\/profile\/rdbcruzer","date":"2015-09-25","delete":false,"datetime":"Sep 25th 2015 02:44","timestamp":1443149057,"loggedIn":false,"username":"rdbcruzer","upclass":"","downclass":"","upvoted":false,"downvoted":false,"score":4,"level":3,"children":[],"deleted":0,"parent":19848,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"}],"deleted":0,"parent":19846,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"}],"deleted":0,"parent":0,"previews":[],"entity":2070,"guilds":0,"type":"1","type_string":"topic"}], entityID : "2070", title : "Comments", element : "discussion_container", buttonText : "Add Comment", buttonClasses : "small_button small_button_green", answerClasses : "" }; if(typeof($d) == "undefined"){ $d = { initCheckboxes:function(element){ element.find("input[type=checkbox]").each(function(){ var c = $(this); if(!c.attr("checkbox_setup")){ c.attr("checkbox_setup",true); var id = c.attr("id"); var container = $(document.createElement("div")); container.addClass(c.get(0).className); c.get(0).className = ""; container.addClass("checkbox"); container.attr("id",id); container.prop("name",id); c.attr("id",id + "-checkbox"); container.prop("checked",c.get(0).checked); container.prop("value",c.val()); container.prop("type","checkbox"); container.attr("type","checkbox"); if(c.prop("title")){container.append(""+c.prop("title")+"");} c.before(container); c.remove(); container.append(c); if(c.get(0).checked){ container.addClass("checked"); } var checkUncheck = function(){ c.addClass("toSave"); if(c.get(0).checked){container.addClass("checked");} else{container.removeClass("checked");} }; container.click(function(){ var container = $(this); c.click(); container.prop("checked",c.get(0).checked); checkUncheck(); }); } }); }, initSelects: function(element){ try{ if(!this.helpers.isMobile()){ element.find("select").select2(); } }catch(e){} }, session: { isLoggedIn:function(){return false;} }, helpers: { stripHTML : function(string){ var div = $(document.createElement("div")); div.html(string.replace(/(
    ||
    )/gm,'\n').replace(/<\/p>/gm,'\n\n')); return div.text().trim(); }, showOverlay : function(containers, content, realignLeft, realignTop) { if(!content) {content = "";} // Adds a default loading icon if($.trim(content) == "") {content = "";} if(containers) { containers.each(function() { var container = $(this); container.append("
    "+content+"
    "); var contentDiv = $(".details_overlay_content"); if(typeof(realignLeft) == "undefined" || realignLeft == true || realignLeft == null){ var contentLeft = (container.outerWidth()/2)-(contentDiv.outerWidth()/2); contentDiv.css({left:contentLeft+"px"}); } if(typeof(realignTop) == "undefined" || realignTop == true || realignTop == null){ var contentTop = (container.outerHeight()/2)-(contentDiv.outerHeight()/2); contentDiv.css({top:contentTop+"px"}); } }); } }, hideOverlay : function(container) { if(container) {container.find("details_overlay").remove();} else { $(".details_overlay").each(function() { $(this).remove(); }); } }, }, network:{ request:$.ajax, post:$.post, get:$.get } } plugin.integrate(null,options); }else{ $d.plugins.add(plugin,options); $d.plugins.get("comments").integrate($d.plugins,options); $d.network.addHandler("comments", "update-score",function(data){ if(typeof(data) != "undefined" && data != null){ var comment = $(".comment_item[data-id="+data.comment+"]"); if(comment.length > 0){ if(typeof(plugin.comments[data.comment]) == "undefined"){ plugin.comments[data.comment] = {}; } if(typeof(plugin.comments[data.comment].score) == "undefined"){ plugin.comments[data.comment].score = 0; } plugin.comments[data.comment].score = data.score; comment.attr("point-count",data.score); comment.find(".comment_score").html(data.score + " points"); } } }); $d.network.addHandler("comments","deleted",function(data){ if(typeof(data) != "undefined" && data != null){ var p = $(".comment_item[data-id="+data+"]"); var children = $(".comment_item[data-parent="+data+"]"); if(children.length > 0){ p.find(".comment_username").html("deleted"); p.find(".comment_reply").remove(); p.find(".comment_delete").remove(); p.find(".comment_voting_buttons").remove(); p.addClass("comment_deleted"); p.find(".comment_content").html("[deleted]"); $d.helpers.hideOverlay(); }else{ p.remove(); } } }); $d.network.addHandler("comments","added",function(data){ if(typeof(data.comment) != "undefined"){ var newComment = data; if(typeof(newComment.error) == "undefined"){ if(!plugin.comments[newComment.id]){ setTimeout(function(){ plugin.comments[newComment.id] = newComment; var pComment = plugin.processComment(newComment,false,$("#comments_list"),true); $d.plugins.get("comments").updateList(); },1000); } } } }); }