Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Suki
1
The Pub / Re: Question about SHA1/256 (github issue #60)
« on April 20th, 2017, 01:48 AM »
I pop up every once in a while and since I'm dealing with the same thing myself I chime in.


I wouldn't use bcrypt on the client side, too much of an issue and as far as I know it wasn't designed to do hashing but to encrypt.  Besides, everyone is going towards https so client hashing will become less of an issue.

So, use bycrypt yes but on server side only.
2
The Pub / Re: Question about SHA1/256 (github issue #60)
« on April 18th, 2017, 01:09 AM »
If there are any changes, it will be known pretty early, any change in the default algo will be made in the next full release after a proposed algo was included. Plenty of time IMO.

And you will always know what thing was changed and to what. Theres a similar problem if you chose an user defined algo, sooner or later you will have to upgrade your script to get rid of obsolete ones.
3
Development blog / Re: Alphababy!
« on April 20th, 2014, 06:00 PM »
Congrats! :D
4
The Pub / Re: Repository name poll! Yayer!!
« on January 20th, 2014, 07:49 PM »
I created my repos long before knowing what I was doing so there isn't any consistency between them. I wouldn't worry that much, just avoid changing it in the future.

Since theres a tendency in github to add silly names to your projects I usually avoid reading the name and go straight for the description/readme.
5
The Pub / Re: Repository name poll! Yayer!!
« on January 18th, 2014, 05:31 PM »
I voted for github.com/Wedge/wedge  using Wedge to reference the actual github account and wedge for the product seems easier to handle and understand.
6
The Pub / Re: Minimum PHP version?
« on December 30th, 2013, 02:20 AM »
Yeah, 5.3 seems like a perfect choice.

Closures can be used in ways regular anonymous functions can't but it requires a full oop approach for that to happen. The whole new array syntax was just a late response at all the bickering from guys who keep pushing for PHP to become more like python or ruby or any other cool new programming language not based on C principles. It really is just a cosmetic thing that shouldn't have to receive soo much publicity.  I would rather see more useful stuff.

5.4 also has object binding in closures which can be really useful when you work with properties who also are closures themselves (since PHP can't distinguish between a closure property and a plain method) or just when you want to inject some external behavior to some class without messing with it or if you for some reason don't like to use the use() keyword :P
7
The Pub / Re: Infinite Scroll
« on September 29th, 2013, 10:21 PM »
Quote from Nao on September 29th, 2013, 08:04 PM
Which one..?
The very same one that its named infinite scroll :P I tried others, most of them was built around custom needs so they wouldn't work for me anyway.
Quote from Nao on September 29th, 2013, 08:04 PM
Yes, it's better for accessibility. Although, as you may have noticed, Wedge does it differently: it only triggers on mouse wheels, and only starts counting mouse wheels after you reach the end of the page. It was a deliberate decision, to ensure that the user actually wants to see the next page.
I must admit, I'm a mouse wheel freak... I tend to roll it everywhere, including at the end of a page, so it was a no-brainer for me. The counterpart, though, is that I can't decide whether to use the system to just load the next page the 'regular' way, because the current solution at least allows me to keep reading the last post in the page, even if I'm wheeling a bit too much.
Thats an interesting approach, I'll give it a try :)  I also like the refresh one!
Quote from Nao on September 29th, 2013, 08:04 PM
Did your data have any events attached to them..?
Yes, if the message is a status, users can make a comment on it as well as deleting it, if the message was a comment, theres only the deletion part, thats all I have at the moment, I don't think I'll ever implement editing or even a comment of a comment (child comment) that would be a nightmare!
Quote from Nao on September 29th, 2013, 08:04 PM
At this point, I'd be glad to have an ugly solution that just ensures developers can freely work around this infinite scrolling thing... :-/

I'm trying to figure out a 'different way', but it's hard. Something like, take all functions that knowingly modify messages (layout, contents...), and have them declare themselves to a special hook that will call them again when new posts are inserted. But I need to figure out a clean way to do that. And I don't even know if it's viable.

Either way, it probably won't be ready for v1.0... In fact, I'm likely to keep things as they are for now, because it 'mostly works', and I'll just fix my existing broken code (i.e. duplicate HTML.) I think that the face value of having this nice infinite scrolling effect is important for Wedge to gain some momentum among the SMF community, and if removed later and replaced with a plugin, it'll have less visibility and I'll be sad about it. (I DID spend a lot of time on this...)
Yep, after taking a lot of approaches, suddenly ugly code doesn't seem so ugly anymore :P

Having a single template for messages sure is handy but it comes with its own set of issues, everything gotta be normalized, I'm (ab)using $context to show the poster data (it shows in a fancy lightbox) so before I show the data, I load all possible users IDs and pass them to an instantiated class that sets a $context array, then on the template I use $context['userData'][$userID]['avatar']  but since sometimes I call the template from another instantiated class, the whole global scope gets lose (I haven't really figure it out why exactly :( since I use Dependency Injection, I suspect it has something to do with it but I'm not sure) so I again do some nasty tricks to successfully keep $context in global scope .
Quote from Nao on September 29th, 2013, 08:04 PM
That's a good thing, but it's still something that should be kept to a minimum or to very specific events like the one in your example, because it does mean all events of the same type will bubble up the DOM, be caught by jQuery, which will determine if it was in the 'domain' it was watching, etc... Heck, I'm not exactly sure why the jQuery team replaced .live() with that. Maybe they wanted to make it harder to use the function, and thus encourage dropping it..?
Well, the number of events is an user option, they decide how many messages are showing per page, I'm sure they will chose something like 10 to 15.

I don't know how .live() used to work, from what I read, now its just a duplicate of .on() but I learned not to trust the first (or the most voted) answer I found on stackoverflow :P
8
The Pub / Re: Infinite Scroll
« on September 29th, 2013, 07:23 PM »
I faced the same annoyances :( infinitescroll is nice and dandy but it is really a pain in the posterior.

I used the jquery plugin along with my custom pagination class, later and for performance, I changed my big fat query (I was loading every single message) for the SMF approach of using $start and LIMIT, turns out the jquery script was borked (because how it works vs how SMF works) so I have to code my very own version of it.

I couldn't get a fine and stable code for scrolling events, yes jQuery has .scroll() and I can get if the user has reached the bottom of a page, however, it was very unstable (if the user stays at the bottom the event gets fire constantly) so I decided to use a "load more" button.

Another issue was handling all the HTML, I had 2 options, sent the entire data plus HTML as a json object or just send the pure data and have all the HTML either created on-the-fly or as an empty shell on the template itself, I decided to just sent the already constructed HTML as a json object and then just use .append() on an empty <ul> created on-the-fly by jQuery.

I didn't want to have multiple template structures so I took the message HTML, isolated it on a  single function with all the data (content, poster, time, etc) passed as a param and thats the only template I use for every place where I show a message, it is a little hackish because in the same function I can either return the structured HTML or just print it, depending on where exactly I'm using that template function, my solution was to use a var and at the end simple decide what to do, return it or print it, not nice but it works.

I also faced the duplicate DOM elements, in my case it wasn't that much of an issue since I don't handle that many features and options, my solution was handling all JS events using jQuery(document).on() to differentiate between events I use the ID in the ID attribute so:

Code: [Select]
jQuery(document).on('submit', '.form_comment', function(event){

// The most important thing is... the ID
var StatusID = parseInt(jQuery(this).attr('id').replace('form_comment_', ''));

var comment = {
'commentStatus' : StatusID,
'commentOwner' : jQuery('#commentOwner_' + StatusID).val(),
'commentPoster' : jQuery('#commentPoster_' + StatusID).val(),
'commentStatusPoster' : jQuery('#commentStatusPoster_' + StatusID).val(),
'commentContent' : jQuery('#commentContent_' + StatusID).val(),
};

But I recon, the amount of DOM elements I manage is extremely low and this approach wouldn't work on handling forum messages.
9
Off-topic / Re: Some advice when using jquery.ajax()
« on April 8th, 2013, 11:37 PM »
Quote from Nao on April 8th, 2013, 11:04 PM
So I replied to it, and also mentioned that the fact that your last post was that particular one (and you hadn't posted in weeks), pretty much implied that the 'thanks' was along the lines of 'thanks for all the fish', if you know what I mean.... ;)
There's nothing else to be found in my post...
.___.  then why the mention about me not been grateful ???  that is what bothers me...  there is no "thanks for the fish" or whatever you call it, it is a simple and mere "thanks" meaning "thank you"... There's nothing else to be found in my post...

I don't know what do I need to do to you realize my thanks are just that, simple thanks, nothing more. nothing was implied there, I locked the topic because there was nothing else to discuss and no one else were going to help me, thus, the topic being open was pretty much pointless and the only possible way to go was to keep discussing your reasons for not helping me, something I certainly wasn't interested on discuss since I understood your reasons in the first place and thanked you already.

It is I the one that is repeating myself, I already said thanks as many times as it can be said without losing its meaning, again I do not know what else do you want.

Been in lurking mode is a bad thing here? I don't know about you but I just don't post on any topic for the sake of posting, also, I'm not here 24/7, I usually enter here from my phone, do check the main page and if there is an interesting topic I read it, if I have something to say, I say it, if not I left the site as simple as that.

I posted looking for help here because I felt sufficiently confident in actually asking for help from you guys, I realized that was a mistake, I recognized your reasons, I thanked you and all the people who helped me and that was it, I went back to my old routine of checking the site, I honestly don't know how that can be misinterpreted in any way...  I actually have been talking to Arantor and never ever told him about this topic or anything related to your response or me been mad because of your response because there is no issue with it.

So please, once again, do not misinterpret my posting or actions or the lack thereof.
And once again, there is no "thanks for the fish", "ungratefulness", "unfriendliness" or any other bad action on my part. Thank you, means thank you.

If you do not want to waste time on this then I suggest you to accept the fact that I was thanking you and nothing else, do not look for any issues where there is none.
10
Off-topic / Re: Some advice when using jquery.ajax()
« on April 8th, 2013, 09:23 PM »
I already said thanks, I understood your reasons and said thanks, I honestly don't know what else do you want from me or why do you think I wasn't been grateful...  It does bother me the fact that I always said thanks for the help received here and yet you post a month later saying I wasn't...

As for me "retiring" I've been login here fairly often and I've been reading most if not all the post and topics since then, me not posting doesn't mean anything (it means I do not have anything to add to any topic posted here) so please do not make wrong assumptions and specially do not make false impressions of me not being thankful and grateful for your help just because I didn't posted anymore, that was just a coincidence if anything.

As for how much on topic this was, I dunno, you want to re-write some template, thats far from what I wanted to do, as far as I know you have specific boards for Wedge features/discussions, this was a generic jQuery problem that has nothing to do with whatever approach you're doing for Wedge.

I respectfully request for the lock to stay in place to avoid people to keep posting about my issue (or any other topic derivate of it) and instead create a new topic on whatever board it fits the most where people can only focused on your ideas. Or at least do not jump to wrong conclusions about my lack of posting here.

Thanks.
11
Off-topic / Re: Some advice when using jquery.ajax()
« on April 8th, 2013, 05:28 PM »
Quote from Suki on March 16th, 2013, 11:58 PM
OK thanks.
OK thanks, means OK thanks, as far as I understand thanks means I'm thankful on the help provided here.

I don't know what else do I need to say?  You don't want to help me, fair enough, thats why I said thanks and locked the topic to prevent more people inserting their opinions on whether or not they find it fair, its a shame the lock wasn't respected.
12
Off-topic / Re: Some advice when using jquery.ajax()
« on March 16th, 2013, 11:58 PM »
OK thanks.
13
Off-topic / Re: Some advice when using jquery.ajax()
« on March 16th, 2013, 03:32 PM »
edited.
14
Off-topic / Re: Some advice when using jquery.ajax()
« on March 15th, 2013, 07:59 PM »
OK, I uploaded the latest branch with the mention script implementation to my site, the url for fetching the json object is this one: http://missallsunday.com/index.php?action=breezeajax;sa=usersmention  strangely enough, all the browsers I tested this url are receiving a php file, this is the only request that is sending a php file as a response as all the others are sending a json response. Could be a cache issue?, a server issue? im on LiteSpeed and sometimes it takes a while to pick up new pages specially if those pages are generated dynamically.

This is the code I'm currently using to send the ajax request and also firing the mention script:

Code: [Select]
jQuery(function(){

var breezeUsers = jQuery.ajax({
type: 'GET',
url: smf_scripturl + '?action=breezeajax;sa=usersmention',
data: '',
cache: false,
dataType: 'json',
success: function(html)
{
return html.data;
}
});
console.log(breezeUsers);
data = jQuery.map(breezeUsers, function(value, i) {
return {'id':i, 'name':value,};
});

jQuery('#content').atwho("@",{
tpl: "<li data-value='(${name}, ${id})'>${name} <small>${name}</small></li>",
'data': data,
'choose': "data-value",
'callbacks': false,
});
});

Now, both Opera drangonfly and firebug are telling me this error: name.toLowerCase is not a function  and points out to the jquery.atwho.js file at line 6 in this particular code:  https://gist.github.com/MissAllSunday/5172154

I'm not good with JS but as far as I know, filter is a callback (the script has many callbacks) that gets triggered by default and I don't understand javascript enough to see where the problem is.

I don't know if the problem is generated by my initial object or if the problem is somewhere else, if I hardcoded the var:

var breezeUers = {"1":"Suki","2":"manzanita"};

and pass that to the mention script it does work as intended that is why I assume the issue is on the data that is been sent from the browser or in the way I'm handling that data and pass it over to the mention script.
15
Off-topic / Re: Some advice when using jquery.ajax()
« on March 15th, 2013, 02:44 PM »
OK, thanks for the replies, I'm using 1.9.1

This is the method I'm using to sent the response from the server: https://gist.github.com/MissAllSunday/5169914

I'll give this another try today, is json the more appropriate way to send the data back?   I think the problem is that the server is sending this: "{1:'Suki', 2:'manzanita', }" instead of this: {1:'Suki', 2:'manzanita', } thus the mention script treats it like a string.

The mention script fires a bunch of callbacks that I cannot disable, this callbacks expect the data to be a valid js object/array