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 - Dragooon
736
Features: Theming / Re: JavaScript caching
« on July 3rd, 2011, 01:55 AM »
Quote from Joshua Dickerson on March 9th, 2011, 01:30 AM
What does that have to do with this function?

It's used for the following to remove bad URLs from the indexers view. Well, if we just changed them to real, good URLs and then worked with those instead, that would make more sense and more understandable for everyone IMO.

It's not even in use everywhere. I took a look at the message index for this board:
result:
Code: [Select]
<span style="font-weight: bold;" onclick="expandPages(this, 'http://www.simplemachines.org/community/index.php?board=74.%1$d', 150, 2100, 50);" onmouseover="this.style.cursor='pointer';"> ... </span>

So, if it isn't being used there with an odd URL, shouldn't it be presenting errors or odd accesses in the logs?

It's used several times on the infocenter toggle object on the board index to add quotes around the $txt and session vars.

The following is a shining example from the display template. It is so much harder to read because of the escaping:
Code: [Select]
sTemplateBodyEdit: '\n\t\t\t\t\t\t\t\t<div id="quick_edit_body_container" style="width: 90%">\n\t\t\t\t\t\t\t\t\t<div id="error_box" style="padding: 4px;" class="error"><' + '/div>\n\t\t\t\t\t\t\t\t\t<textarea class="editor" name="message" rows="12" style="width: 100%; margin-bottom: 10px;" tabindex="5">%body%<' + '/textarea><br />\n\t\t\t\t\t\t\t\t\t<input type="hidden" name="af00a1ba031" value="c5e7963677f5827d8476125917ac76b2" />\n\t\t\t\t\t\t\t\t\t<input type="hidden" name="topic" value="382883" />\n\t\t\t\t\t\t\t\t\t<input type="hidden" name="msg" value="%msg_id%" />\n\t\t\t\t\t\t\t\t\t<div class="righttext">\n\t\t\t\t\t\t\t\t\t\t<input type="submit" name="post" value="Save" tabindex="6" onclick="return oQuickModify.modifySave(\'c5e7963677f5827d8476125917ac76b2\', \'af00a1ba031\');" accesskey="s" class="button_submit" />&nbsp;&nbsp;<input type="button" value="Spell Check" tabindex="7" onclick="spellCheck(\'quickModForm\', \'message\');" class="button_submit" />&nbsp;&nbsp;<input type="submit" name="cancel" value="Cancel" tabindex="8" onclick="return oQuickModify.modifyCancel();" class="button_submit" />\n\t\t\t\t\t\t\t\t\t<' + '/div>\n\t\t\t\t\t\t\t\t<' + '/div>',
It escaped the tabs with \\t and line breaks with \\n so they can be readable in JavaScript... but not the HTML output that anyone is actually going to read. It changed all of the closing divs... why? I don't even see any URLs here for it to escape.

I finally found one that supports what everyone is saying:
Code: [Select]
sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ',
result:
Code: [Select]
sTemplateSubjectNormal: '<a hr'+'ef="http://www.simplemachines.org/community/index.php'+'?topic=382883.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%<' + '/a>'

How, you might ask, do I propose we fix that? Well, there are two (or even three) options.

One means that a normal, simple link is no longer created in the template. That makes the non-cached JavaScript a lot smaller.
Code: [Select]
Modify QuickModify() returning that link with the correct information. Makes a whole lot more sense that way.

Second would be to use the JavaScript var: smf_scripturl.
Code: [Select]
sTemplateSubjectNormal: \'<a href="\' + smf_scripturl \'?topic=', $context['current_topic'], '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>\'',

The last would be a URL creator function (pseudo since I'm using the browser to write all of this):
Code: [Select]
function url(base_uri = smf_scripturl, query_string, args)
{
   // see sprintf(): http://www.diveintojavascript.com/projects/javascript-sprintf
   return sprintf();
   // there are also easier replace().
}

Any way you look at that, it actually makes it easier for you to rewrite the URLs. It could still be possible to use a JS escaping function, but we should really figure out what we want to do with it and how it makes the user safer.
737
Off-topic / Re: Unknown's thoughts on Wedge
« on June 30th, 2011, 08:38 PM »
As someone who just went through a LOT of hell, I gotta say I am with Arantor now. File edits are a pain to deal with, even if that means removing a lot of control, modders and admins will go through anything to get it to work and it really messes things up. Although it can only with if you have an advanced templating system like TOX-G, because normal PHP template hooks won't cut it. That, and standardizing data loading, SQL querying etc.
738
Off-topic / Re: Unknown's thoughts on Wedge
« on June 28th, 2011, 11:38 AM »
Quote from [Unknown
link=msg=263240 date=1309240621]
I'm 25, so I guess I was about 17 when I started working on SMF.  Certainly have learned a few things since then.

Dunno about whizzkid, essentially I spent the couple years after high school working on SMF before I got a job.  It's much easier to get a lot of things done when you don't have other obligations etc. yet.  More a function of circumstance.

-[Unknown]
You are 8 years older than me...meh old people! So you didn't got to a professional university?
Quote from Nao/Gilles on June 28th, 2011, 07:49 AM
How old are you, Unknown?
If you're younger than Pete is, does that mean you were one of those Dragooon-like wizkids back when you started SMF?

I hate those fucking wizkids, they always end up being faster and better than me :niark:
Why, thank you!
739
Off-topic / Re: Unknown's thoughts on Wedge
« on June 27th, 2011, 04:37 PM »
While removing file edits in itself is a step backward in terms of freedom one provides to mod authors, I can see Arantor's point. I am personally with keeping file edits as everything is not always possible with hooks, but if we do keep file edits then most people will resort to directly editing files. But at the same time I do not completely like the idea of removing file edits. Perhaps if there was something in between? Like classifying mods, file edit mods are class B and totally hooked mods are class A. The reason being that I cannot see everything being done with file edits, I need file edits for WePortal which is more or less the first mod for Wedge(Unless someone beats me to it). So please keep file edits, but instead frown them upon.
740
Features: Posts & Topics / Re: Auto-embedding
« on June 27th, 2011, 10:28 AM »
Quote from Arantor on June 27th, 2011, 09:19 AM
Considering there already is in Aeva...
Which means not a chance.
741
Off-topic / Re: Unknown's thoughts on Wedge
« on June 26th, 2011, 11:52 PM »
Quote from Bloc on June 26th, 2011, 10:42 PM
Quote from Dragooon on June 26th, 2011, 08:46 PM
Quote
To me it seems Wedge has already been laid out with that lesser possibilities for me as a designer, while SMF is still "full on"...although its focus on CSS-only themes takes away the focus on getting mods out of themes. But at least you CAN still change any template, luckily. I do remember Nao mentioned that it can be done in Wedge too, so its not all bad - but focusing on stylings sends a powerful signal out to any starting designer for Wedge.
Wedge's theme system is only beyond SMF's, it doesn't remove any of the previous possibilities but has enhanced capability for additional css variations.
Quote
But I also see WHY Nao/Arantor wants more features in - more powerful, central developing point etc. I think thats a slightly wrong turn though. Take Yourasoft, where a core was to replace SMF, with its forum as a module only(allowing others to also make other forum modules). It was from day one agreed that things should/could have alternatives.
Personally, I think it is a more positive turn. Not only does it ensure a system that is powerful and well integrated down to the core, it adds more capabilities for a small time modder to extend upon. It may discourage alternatives, but it doesn't necessarily prevent them. Instead, it helps to improve the existing system with multiple people pouring in.
Yes, its good..but honestly, why would anyone create a mod that does what Aeva does then? In contrast, are there any mods that replace the moderating center in SMF2? In SMF11 there could have been more alternatives(was there more? I can't remember) but in SMF2 theres no reason to now. And that moderating center isn't a solution to all moderating needs..

I am not saying to ALWAYS have alternatives..the quality will maybe be worse sometimes, but with Aeva as built-in rather than a plugin, you will not see any evovlement in that area other than what you do yourself. It depends on how you look at it if thats a good thing or not.
Currently there are only 2 gallery mods for SMF, Aeva and SG(3 of you count SGL and SGP separately), and I created SMG(Base of Aeva) after SGP had been out for over 2 years(And it had dominated that time). Same's the case with TinyPortal, it had been out for a long time before an alternative game, simply because it dominated for a long time. Now there are 5 portal, which do the same thing in more or less the same way. So in all honestly, having a feature in core won't make that much of a difference provided there is someone who is willing to do that kind of effort to match up to it. This is emphasized by the fact that Nao spent 2 weeks straight on SGP before I released SMG, only because he didn't want to create one from scratch and had SGP as a base . Instead, most will try and improve what is in the core rather than making an alternative to it. This way a new kind of variety will be created. Plus we always got integration to 3rd party systems.
742
Off-topic / Re: Unknown's thoughts on Wedge
« on June 26th, 2011, 08:46 PM »
Quote
To me it seems Wedge has already been laid out with that lesser possibilities for me as a designer, while SMF is still "full on"...although its focus on CSS-only themes takes away the focus on getting mods out of themes. But at least you CAN still change any template, luckily. I do remember Nao mentioned that it can be done in Wedge too, so its not all bad - but focusing on stylings sends a powerful signal out to any starting designer for Wedge.
Wedge's theme system is only beyond SMF's, it doesn't remove any of the previous possibilities but has enhanced capability for additional css variations.
Quote
But I also see WHY Nao/Arantor wants more features in - more powerful, central developing point etc. I think thats a slightly wrong turn though. Take Yourasoft, where a core was to replace SMF, with its forum as a module only(allowing others to also make other forum modules). It was from day one agreed that things should/could have alternatives.
Personally, I think it is a more positive turn. Not only does it ensure a system that is powerful and well integrated down to the core, it adds more capabilities for a small time modder to extend upon. It may discourage alternatives, but it doesn't necessarily prevent them. Instead, it helps to improve the existing system with multiple people pouring in.
743
Off-topic / Re: Unknown's thoughts on Wedge
« on June 26th, 2011, 02:13 PM »
I agree with avoiding app store review process, mostly because I don't know how to make native apps(Never learned Objective C). Hence the reason I asked how you guys conceive HTML5 apps.
744
Off-topic / Re: Unknown's thoughts on Wedge
« on June 26th, 2011, 01:41 PM »
Quote
* "[Unknown "]takes a moment to say he did not intentionally hijack this topic.
Not a problem, the things you said are a good argument and worth a read.

Your iPhone app raised my eyebrow, mostly because I need to do something similar. Are the HTML5 apps made to be accessed by the browser, made using something like Sencha Touch, jQuery Mobile or jQTouch, or are they bundled into something like Phonegap to be treated like native apps?
745
Other software / Re: I can hardly wait
« on June 25th, 2011, 09:06 PM »
Quote from Nao/Gilles on June 25th, 2011, 09:04 PM
Next week! Hit me if I don't!
PM me your address and I'll make sure. I want to see wedge!!! :!:
746
Development blog / Re: Package Manager, how we won't miss thee
« on June 25th, 2011, 01:13 PM »
Okay, great.
747
Development blog / Re: Package Manager, how we won't miss thee
« on June 25th, 2011, 01:02 PM »
By collisions I was referring to same add-on to multiple repositories.
748
Development blog / Re: Package Manager, how we won't miss thee
« on June 25th, 2011, 12:57 PM »
So you guys plan on releasing full on updates? Hmm since you are going hook-only that makes sense.

And since you plan on having hook registry, then feature detection should be quite enough I believe.

Back to repositories, what do you think of showing all the mods that collide?
749
Off-topic / Re: PHP IDE for windows
« on June 25th, 2011, 12:53 PM »
Visual Studio for PHP? That's very heavy duty, might give it a shot.
Quote
Hmm, I actually hate that feature.  People who like it have suggested Aptana Studio to me.  I'm not sure it's not Java... supposedly it's good, though.  I guess it has git integration too.  I'm not a fan of SCM guis, though.
Aptana's git integration isn't any good, the only git GUI that's worth something on windows is SmartGit + Official Git GUI for staging. I love argument assist in IDEs, only because I keep forgetting them.
750
Development blog / Re: Package Manager, how we won't miss thee
« on June 25th, 2011, 11:28 AM »
Will you be registering the hooks that a mod calls for validation purposes?
Posted: June 25th, 2011, 11:28 AM

Oh and do you plan on providing delta updates?