Misaka
Full Member
Yozakura Quartet: Hana no Uta
Posts: 912
inherit
179763
0
Oct 11, 2024 19:07:51 GMT -8
Misaka
Yozakura Quartet: Hana no Uta
912
May 2012
hellsingfan
|
Post by Misaka on Feb 22, 2013 20:12:56 GMT -8
So I started this a little while ago, and it's working out nicely. It's far from done, and not sure if I will get any time the next few days to work on it. Here's a preview. sweet its okay take your time on it
|
|
Misaka
Full Member
Yozakura Quartet: Hana no Uta
Posts: 912
inherit
179763
0
Oct 11, 2024 19:07:51 GMT -8
Misaka
Yozakura Quartet: Hana no Uta
912
May 2012
hellsingfan
|
Post by Misaka on Feb 25, 2013 8:45:30 GMT -8
bump
"I only bump request plugins every 3 days"
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Feb 25, 2013 13:40:08 GMT -8
Why are you bumping it though? If a coder is working on the request, there really is no need.
If you are in a rush for it, I can always post what I have so another coder can finish it?
|
|
Misaka
Full Member
Yozakura Quartet: Hana no Uta
Posts: 912
inherit
179763
0
Oct 11, 2024 19:07:51 GMT -8
Misaka
Yozakura Quartet: Hana no Uta
912
May 2012
hellsingfan
|
Post by Misaka on Feb 25, 2013 14:05:44 GMT -8
sorry its a habit I got with Todge who told me to remind him
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Mar 6, 2013 13:22:19 GMT -8
Just letting you know I haven't forgot about this. I am just super busy, so not getting much time to work on anything apart from maintaining my current plugins (bug fixing).
Am going to post the source code below in the hopes someone else feels like finishing it off, because I really don't know when I will get back to working on it.
It's a fiddly thing to do, as I am trying to mimic a real private message, so am having to hook into the actions menu.
Here's the source anyway, nothing complicated, and not much left.
- Finish binding events(i.e mark as read) - Link to fake PM page with mini profile - Do settings page to control title, message, sender name, avatar etc etc
$(function(){ (function(){
return { plugin: null, settings: null, old_rank: null, new_rank: null, data: [], unread: 0, init: function(){ this.setup(); this.capture_rank(); this.update_balloon_number(); if(yootil.location.check.message_list()){ this.insert_messages(); this.bind_events(); } }, setup: function(){ this.plugin = proboards.plugin.get("pixeldepth_rank_up_msg"); if(this.plugin && this.plugin.settings){ this.settings = this.plugin.settings; } }, // What a pain this is bind_events: function(){ var self = this; var select_menu = $(".select_menu_list"); var custom_inputs = $("input.rank-up-msg-checkbox"); var default_inputs = $("input.list-item-checkbox"); var selections = select_menu.filter(".selections"); var actions = select_menu.filter(".actions"); var status = $(".ui-selectMenu-box div.status"); selections.find("li.All").click(function(){ custom_inputs.prop("checked", true).show().closest("tr").addClass("state-selected"); }); selections.find("li.None").click(function(){ custom_inputs.prop("checked", false).hide().closest("tr").removeClass("state-selected"); }); selections.find("li.Read").click(function(){ custom_inputs.filter(".conv-rank-up-read").prop("checked", true).show().closest("tr").addClass("state-selected"); custom_inputs.filter(".conv-rank-up-unread").prop("checked", false).hide().closest("tr").removeClass("state-selected"); }); selections.find("li.New").click(function(){ custom_inputs.filter(".conv-rank-up-unread").prop("checked", true).show().closest("tr").addClass("state-selected"); custom_inputs.filter(".conv-rank-up-read").prop("checked", false).hide().closest("tr").removeClass("state-selected"); }); var mark_read = actions.find("li.mark_as_read"); var clone = mark_read.clone().removeClass("mark_as_read").addClass("custom_mark_as_read").unbind("click"); clone.click(function(){ self.mark_as_read.call(self, custom_inputs.filter(":checked")); }); status.filter(":contains('Actions')").parent().click(function(){ var custom_checked = custom_inputs.filter(":checked"); if(!default_inputs.filter(":checked").length && custom_checked.length && custom_checked.closest("tr").hasClass("new")){ actions.append(clone.show()); } }); mark_read.click(function(){ console.log(1); //self.mark_as_read(custom_inputs.filter(":checked")); }); }, mark_as_read: function(inputs){ var row = inputs.closest("tr"); var img = row.find("td.icon img"); img.attr("src", img.attr("src").replace(/-new\./i, ".")); row.find("td.main span.new-icon").hide(); row.removeClass("new"); inputs.removeClass("conv-rank-up-unread").addClass("conv-rank-up-read"); var self = this; row.each(function(){ var id = $(this).attr("data-rank-up-msg-id"); self.data[id].r = "1"; }); yootil.storage.set("pd_rank_up_data", this.data, true, true); }, insert_messages: function(){ if(this.data && this.data.length){ this.trim_messages(); var list = $(".conversations .content .list-content"); var title = $(".conversations div.title-bar span");
title.text(parseInt(title.text().replace(/\D/g, "")) + this.unread); list.find("tr").removeClass("last first"); for(var m = 0, l = this.data.length; m < l; m ++){ var read = (this.data[m].r == "1")? true : false; var icon_display = (read)? "" : "inline"; var new_msg = (!read)? "-new" : ""; var new_class = (!read)? " new" : ""; var row = '<tr class="item conversation conver-rank-up-row' + new_class + '" data-rank-up-msg-id="' + m + '">'; row += '<td class="icon"><img title="Conversation" alt="Conversation" src="http://images.proboards.com/icons/message' + new_msg + '.png" /></td>'; row += '<td class="clickable checkbox"><input type="checkbox" class="rank-up-msg-checkbox conv-rank-up-' + ((read)? "" : "un") + 'read" style="display: none" /></td>'; row += '<td title="Congratulaions, you have ranked up to ' + this.data[m].name + '" class="main clickable">'; row += '<table><tr><td><span class="icons"><span class="new-icon" style="display: ' + icon_display + ';"><a href="#">new</a></span></span></td>'; row += '<td><span class="link target"><a href="#">Congratulations, you have ranked up to ' + this.data[m].name + '</a></span></td></tr></table></td>'; row += '<td class="created-by"><a href="/user/1">Admin</a></td>'; row += '<td class="replies">0</td>'; row += '<td class="latest"><div>by <a href="/user/1">Admin</a><br /><abbr title="" class="time" data-timestamp="' + this.data[m].t + '"></abbr></div></td>'; row += '</tr>'; list.append(row); } list.find("tr.conver-rank-up-row").hover(function(){ $(this).find("td.checkbox input").show(); }, function(){ if(!$(this).hasClass("state-selected")){ $(this).find("td.checkbox input").hide(); } }); list.find("td.checkbox input.rank-up-msg-checkbox").click(function(){ if($(this).prop("checked")){ $(this).show().closest("tr").addClass("state-selected"); } else { $(this).hide().closest("tr").removeClass("state-selected"); } }); this.apply_first_and_last(list); } }, apply_first_and_last: function(list){ list.find("tr:first").addClass("first"); list.find("> tr:last").addClass("last"); }, trim_messages: function(){ this.data = this.data.slice(0, 5); yootil.storage.set("pd_rank_up_data", this.data, true, true); }, capture_rank: function(){ var current_rank = yootil.user.rank(); var data = yootil.storage.get("pd_rank_up_data", true); if(!current_rank || !current_rank.id || !current_rank.name){ return false; } var new_data = this.new_rank = { name: current_rank.name, id: current_rank.id, r: "1", t: (+ new Date) }; if(!data || !data.length || !data[0].name || !data[0].id || !data[0].r || !data[0].t){ yootil.storage.set("pd_rank_up_data", [new_data], true, true); } else { var old_rank = this.old_rank = data[0];
if(current_rank.id != old_rank.id){ new_data.r = "0"; data.unshift(new_data); yootil.storage.set("pd_rank_up_data", data, true, true); } } this.data = data; }, user_ranked_up: function(){ if(this.new_rank && this.new_rank.id && this.old_rank && this.old_rank.id){ if(this.new_rank.id != this.old_rank.id){ return true; } } return false; },
get_total_unread: function(){ var total = 0; if(this.data && this.data.length){ for(var m = 0, l = this.data.length; m < l; m ++){ if(this.data[m].r == "0"){ total ++; } } } return total; }, update_balloon_number: function(){ this.unread = this.get_total_unread(); if(this.unread){ var conver_link = $("#navigation-menu li a[href*='/conversations/inbox']"); if(conver_link && conver_link.length == 1){ var balloon = conver_link.find("div.tip-holder div.tip-number"); if(balloon && balloon.length == 1){ var current = parseInt(balloon.text()); balloon.text(current + this.unread); } else { conver_link.append('<div class="tip-holder"><div class="tip-number">' + this.unread + '</div><span class="tip"></span></div>'); } } } } }; })().init(); });
|
|
Misaka
Full Member
Yozakura Quartet: Hana no Uta
Posts: 912
inherit
179763
0
Oct 11, 2024 19:07:51 GMT -8
Misaka
Yozakura Quartet: Hana no Uta
912
May 2012
hellsingfan
|
Post by Misaka on Mar 6, 2013 16:15:05 GMT -8
ok
so since you got most of it done another Coder can do it if he/she feels like it
so its safe to start bumping for another coder?
|
|
Misaka
Full Member
Yozakura Quartet: Hana no Uta
Posts: 912
inherit
179763
0
Oct 11, 2024 19:07:51 GMT -8
Misaka
Yozakura Quartet: Hana no Uta
912
May 2012
hellsingfan
|
Post by Misaka on Mar 8, 2013 5:32:21 GMT -8
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Mar 8, 2013 9:32:34 GMT -8
over my head
|
|
Misaka
Full Member
Yozakura Quartet: Hana no Uta
Posts: 912
inherit
179763
0
Oct 11, 2024 19:07:51 GMT -8
Misaka
Yozakura Quartet: Hana no Uta
912
May 2012
hellsingfan
|
Post by Misaka on Mar 8, 2013 10:57:14 GMT -8
ok thanks for the answer
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,322
January 2004
todge
|
Post by Todge on Mar 8, 2013 13:07:48 GMT -8
Wow.. The code tag does not like indentation does it.. Sorry Misaka, over mine too.
|
|
Misaka
Full Member
Yozakura Quartet: Hana no Uta
Posts: 912
inherit
179763
0
Oct 11, 2024 19:07:51 GMT -8
Misaka
Yozakura Quartet: Hana no Uta
912
May 2012
hellsingfan
|
Post by Misaka on Mar 8, 2013 13:30:49 GMT -8
Wow.. The code tag does not like indentation does it.. Sorry Misaka, over mine too. its ok I wonder who else might be able to help finish this Tim Camara Brian"I'm going to be running out of coders soon"
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Mar 8, 2013 14:56:59 GMT -8
I blame Safari *shifty eyes* ....
Nah, I'll see if we can do something about that.
|
|
Misaka
Full Member
Yozakura Quartet: Hana no Uta
Posts: 912
inherit
179763
0
Oct 11, 2024 19:07:51 GMT -8
Misaka
Yozakura Quartet: Hana no Uta
912
May 2012
hellsingfan
|
Post by Misaka on Mar 8, 2013 15:13:36 GMT -8
I blame Safari *shifty eyes* .... Nah, I'll see if we can do something about that. really? your the best Tim Camara!!!
|
|
Misaka
Full Member
Yozakura Quartet: Hana no Uta
Posts: 912
inherit
179763
0
Oct 11, 2024 19:07:51 GMT -8
Misaka
Yozakura Quartet: Hana no Uta
912
May 2012
hellsingfan
|
Post by Misaka on Mar 18, 2013 3:40:44 GMT -8
Tim Camarajust clarifying something did you say you were going to attempt to finish this?
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Mar 18, 2013 7:33:06 GMT -8
There should be an update for this in our next push. Keith Rozett worked on this last week.
|
|