Forums

RS-Linkify Thread is sticky

Quick find code: 261-262-33-65181208

Indecent Act

Indecent Act

Posts: 7,456 Rune Posts by user Forum Profile RuneMetrics Profile
Wow Ryan M !

I'm blown away, the progress you're making is just fantastic! Seriously, just...

WOW! :)

I got stuck on the settings page with FF. I couldn't get an editable listbox happening for clan / friends names. I actually really like the way their extensions and settings page are tied together, but I just got stuck on every new element I needed to add.

I'm going to outline a few things that may be significant or helpful.

But before I do I want to say I don't want you to feel any obligations at all towards this. It's very important to me that you know this. So when you read this, no matter what I say, I have no expectations and you have no obligations!

I need that mutual understanding else I can't feel comfortable relaying what I think maybe significant.

Okay here goes, think of this as nothing more than spoiler for the new linkify plus some stuff I had in my head when considering a FF port.

Oh warning, this will be a long post.

­­­­

Here goes...

For FF, I was going to call it a lite version of RS Linkify. I'm sure you can appreciate why. Don't think I need to say much more than that :)

Embedding and linkifing plain text was my primary focus. I kind of think of custom avatars/titles in that category since they are closely related, but they are not the focus, more on that in my next post.

No HTML5 colour pickers, now all jquery that FF can use.

As you most likely have assumed the new linkify wont have any signature support, nor will it be doing the suffix prefix thing for titles.

Text to image codes are getting cut down in a huge way. The most used codes will stay.

Linkify BB tags, I have no clue what I'm doing there. But since linkify may be running on minimal features for a while after the reskin. I may take the opportunity to make some changes. It's very hard to change / improve BB codes while they are in use, so I'm keeping things open in case I want to seize that rare opportunity.

Cont..

25-Feb-2015 14:13:23 - Last edited on 25-Feb-2015 16:15:35 by Indecent Act

Indecent Act

Indecent Act

Posts: 7,456 Rune Posts by user Forum Profile RuneMetrics Profile
.....

Now I'm thinking it may be a good idea for me to push out a major update asap.

There are some things that have improved so much in my new version. The only thing is it's it not written with any specific forum layout in mind. I've left it fairly open since I need to expect the unexpected.

If I don't get out a major update out soon, I'll post all the working code I have written. I'm using the new version right now, but it's doing less than half of what the live version is doing and it has little to no configurable options. Though most of the defaults are set, just they can only be changed by editing code.

I have written a new api for getting custom titles, not currently in use but again my new version is using it.

The big thing is they way linkify linkifies. This has changed so much. I got it down to 3 or 4 code branches which I thought was impossible since there are countless checks needed. This is something that I think may be of value. See linkifyThis function :)

http://www.indecentcode.com/test/threadForums.js.html

There are other functions (lightbox etc) that this script depends on and CSS and background stuff. But I'm trying to keep things relevant. It's very flexible, can pass and return objects or html. This linkify method should work in any modern browser, and it's this approach I'm trying to use as much as possible.

What I hope to do next is tie in custom avatar handling so it's all taken care of with the linkify routine. I think I can do it in the same way that a vid or img is handled. Basically an image is embedded when url with img extension is picked up. So I see no reason why avatars can't work the same way.

Okay, I have more but I'm going to stop myself now, the main thing I wanted to do was explain and show how things will work since they have been greatly improved.

Sorry for the mammoth post, but as I said even if it's read as a teaser/spoiler I'm good with that. If you get something more from this, then that's even better :)

25-Feb-2015 14:13:33 - Last edited on 25-Feb-2015 15:02:55 by Indecent Act

Indecent Act

Indecent Act

Posts: 7,456 Rune Posts by user Forum Profile RuneMetrics Profile
Final words (hehe that made me laugh)...

If you have any questions about the linkify routine I posted don't hesitate to ask. I'ts not finished, for example puush links without image extensions are not embedded. The safety check is too strict, but those things will be sorted soon.

It's all about how links are handled and how easy it is add to it without increasing the complexity.

I mentioned briefly that I'm moving away from HTML colour pickers, and I'm using jquery for that now. But there still may be other issues, last time I checked (a while ago now) FF didn't support HTML5 input sliders, if that's still the case I will look at writing something to deal with that very soon. This is where jquery is coming in handy, it's a time saver when it comes cross browser things.

Anyway the main thing I wanted say is, if there is anything at all you need to ask, don't hesitate. If you are going to build on my code (doesn't matter if it's never finished) I wan't you have the best and most relevant code I can offer.

Most importantly, keep having fun with it :)

25-Feb-2015 14:37:15 - Last edited on 26-Feb-2015 03:40:15 by Indecent Act

Ryan M
May Member 2008

Ryan M

Posts: 3,095 Adamant Posts by user Forum Profile RuneMetrics Profile
After toying around with it a little more, I'm finding a brick wall a more fun solution. The code you provide helps with a few things, although you might notice that
str = str.replace(sIdFromURL(str), sId).replace('/a=13', '').replace('sl=0/', '');
appends the session number before every potential hyperlink.

This still assumes you're using:
function sIdFromURL(dUrl){ var chrInx = dUrl.indexOf('/c='), retVal = ''; if(chrInx > 22){ dUrl=dUrl.substring(chrInx+3); chrInx = dUrl.indexOf('/'); retVal = dUrl.substring(0,chrInx); } return retVal;}

As it's not included in the snippet.

You might want to place
if (str.match("/c=")){ /*str replace*/ }
around it so that weird things don't happen. Also, there is like 999 different advert ID's. The note about the sId also applies elsewhere. The RL short linking will need /c added before sId and a / before view-idea for them to work as intended (Pg. 681).

The image checks don't seem to work as intended and either apply style="", nothing at all, or the length of the image. This seemed to be fixed by defining the style directly in the reObjLnk for images in rsLinkify-spoilMain and the preceding rsLinkify-ePic lines. I believe you're shying away from explicitly doing styles like this, but as before I'm not sure if you've solved this and it just wasn't in the linkifyThis function.

Other things to note based on snippet are that subsequent images after an image is deemed a spoiler will attempt to do the same to all forthcoming images.

Anyhow, the Firefox lite version is looking more and more like just a stand alone GM script. Since I can't seem to properly convert chrome.extension material as I'd like, for the time being, it's best to put it to the side for now.

Whenever I do get around to it, it'll be after the updated Linkify script is out (or just put features on hold).

26-Feb-2015 06:42:47

Indecent Act

Indecent Act

Posts: 7,456 Rune Posts by user Forum Profile RuneMetrics Profile
Well it looks at though you've looked at my post very thoroughly indeed :)

Sorry for not including some of the other functions. The session ID function has changed since we last discussed it. I can see what you are saying as you'll see by the function...

The function..
http://puu.sh/gdcHg.png

Test results..
http://puu.sh/gdd9x.png

What actually happens is sIdFromURL(dUrl) returns nothing or a sessionID. So replacing nothing with nothing is what happens when things don't match.

What I'm doing, is avoiding if-else-else if-etc. Since all strings are short (urls are generally not 1000's of characters) I'm making use of regex's logic.

I'm not determining what process to push them through. I'm putting them through all processes and only assigning a return value on a success. It looks resource hungry but it's actually not. The lack of complexity is where the strengths are.

As for the RL idea, the sId return value is c=XXXXXX/, but again that's my bad for not including some of the external functions so you weren't to know.

What you say about
replace('/a=13', '').replace('sl=0/', '')
is a good point. I'm going to move that somewhere else or do a similar verify like with the sessionID.

Not seeing the issue with Image links, I use page 50, 51 and 52 on this thread for testing and so far it checks out fine (warning if you go those pages it'll look messy. Looks pretty nice with my test version though). I know I didn't include the style sheet and that could be why there is an issue.

Subsequent images after spoiler deemed spoiler. That's my fav function you're faulting I'll have you know :)

Test page shows it's fine.
HTTP://puu.sh/gde7Y.jpg

Don't be deceived by the simplicity of it. There is good reasons that's my fav bit of code, I just hope I don't end up eating my words :)

I honestly didn't expect this. I thought you may glance over it but it's clear you have done much more than that!

I'm running out of chars again, all I wanted to say is...

26-Feb-2015 08:11:30 - Last edited on 26-Feb-2015 09:17:58 by Indecent Act

Quick find code: 261-262-33-65181208 Back to Top