October 8th, 2013

Illuminati

Interesting Links for 08-10-2013


Original post on Dreamwidth - there are comment count unavailable comments there.
Illuminati

Things I've been achieving recently

I managed to get the FB page I have set up for my links posting the links with images, rather than being a bunch of text URLs, which looks a lot better. Seem to be getting more hits because of that.

The link-poster replacement is coming along nicely. All now AJAX-ified, to the point where it starts off as an empty framework on the page and then loads all of the data in. I managed to move around the dependencies so that the data load (which takes around a third of a second to come back) is actually done by the time everything loads, so that as far as the user is concerned it's there from the moment the page displays. I can use it to make indivudal posts of arbitrary text now, next up is producing posts from defined sources.

Speaking of which, I've been thoroughly impressed by laconic.js, which allows me to store the HTML along with Javascript without having to directly carry out text parsing, which always looks bad to me, and is hard to spot errors in. Instead I can write code like this:

$.el.div({id:postingWizard, title:siteName+' Posting'},
        $.el.form(
                $.el.div(
                        $.el.label({"for":subjectID},'Subject Line:'),
                        $.el.input({type:'text', id:subjectID})),
                $.el.div(
                        $.el.label({"for":textID},'Text:'),
                        $.el.textarea({rows:5,id:textID})),
                $.el.div(
                        $.el.label({"for":visibilityID},'Visibility:'),
                        $.el.select({id:visibilityID},
                                $.el.option("Public"),
                                $.el.option("FriendsOnly"),
                                $.el.option("Private")
                        )),
                $.el.div(
                        $.el.label({"for":tagsID},'Tags:'),
                        $.el.input({type:'text',id:tagsID}))
        )
)
.appendTo(document.body);

Which allows me to put the HTML I want to produce in the same place as the Javscript that goes with it, so I can have actual organisation. Why, exactly, HTML doesn't support client-side includes I have no idea, I guess I can look forward to stuff like that in future versions of HTML when Web Components comes along.

I spend the weekend sorting out little glitches in my code - I am _really_ looking forward to Java 8 coming along, when I get to use Lambdas, and sorting a list by one of its properties doesn't mean writing a whole new class to act as a comparator. Also, I ended up fudging date-passing from Java to JS using JSON, but I'm sure there's a cleaner way of doing it. Might get to that this weekend, or I might finally get around to moving all of my JS across to using Require.js and then combining it all into one file, which would speed up loading even more. I keep looking wistfully at Angular.js, but then reminding myself that getting my functionality working is more important than repeatedly rewriting my app in order to make it shinier under the covers. So possibly this weekend should be about getting the actual functionality of reading links in and reposting them working...



Original post on Dreamwidth - there are comment count unavailable comments there.