#musicbrainz

/

      • brianfreud
        <img src="/static/images/release_editor/edit-off.gif" class="hidden switchable" title="Set" alt="Set" />
      • aCiD2
        oh, yea - those too then, heh
      • brianfreud
        :P
      • brianfreud was confused :D
      • aCiD2
        basically, everything but the row wrapper, the main label, and the errors template
      • generic/row.tt will handle those
      • brianfreud
        ok, you will also need to be able to pass object, too, to row.tt
      • else you have no intelligence
      • so [%- INCLUDE 'forms/generic/row.tt' field=form.field('artist_$i')label=l('Artist') object="artist_$i" type='switchable' %]
      • aCiD2
        that's no problem, that will cascade down just fine
      • doesn't need any changes
      • the_p has quit
      • brianfreud
        ok, moved that bit to widget/switch.tt, and changed tracks.tt to ^^
      • how now does row.tt know to use switch.tt ?
      • aCiD2
        pass type='switch'
      • but, as switch.tt includes some input.tt templates, those will also need a type given, or you'll end recursivly creating switch.tt's
      • you already do that on the checkbox, but line 13 needs type='text' on it
      • aCiD2 goes to make dinner
      • outsidecontext joined the channel
      • ruaok returns with brekky
      • brianfreud enjoys pre-work coffee
      • outsidecontext enjoys an after-work whyskey
      • ruaok
        amazing how we're never on the same page, but still get shit done. :)
      • some of us are always drunk while the others are toiling at work. so odd.
      • brianfreud
        ruaok: btw, having learned from our experiences in the past, btw, every single bit of js I write is getting documented as to exactly how to use / implement it :)
      • stubs was just to much a pita to make work :P
      • Muz
        ruaok: always drunk you say? I'll get right on it!
      • Muz packs up from work and heads to the pub.
      • outsidecontext
        Muz, good plan
      • ruaok
        Muz: thanks for picking up the slack.
      • brianfreud: I'm glad that experience helped. :-)
      • nikki sips tea
      • WTF @ the last three comments: http://blog.musicbrainz.org/?p=369
      • she sounds like my ex. :-(
      • navap
        haha
      • brianfreud
        looks like blog spam to me :P
      • navap
        ruaok: The "Annual Report" link, links to 2006 - maybe that should be taken down, or renamed?
      • luks
        brianfreud: http://bugs.musicbrainz.org/browser/mb_server/b... is a better version of the JS lookup code
      • ruaok
        I suppose.
      • brianfreud
        luks: thanks. Even though it's called ArtistSelect(), does it also now do the label lookup?
      • luks
        yeah
      • brianfreud
        k
      • luks
        it will need the server side to be written, too
      • brianfreud
        the JSON server?
      • luks
        this script uses a different format than the current one, but since it doesn't exist in TT yet it shouldn't be a problem
      • yeah, the script that gives you search results in json
      • brianfreud
        k. We actually have another need for data to be fed out with JSON too. I don't really know anything about the server end for JSON, not sure if both can be fed out from the same server, or if "server" is even really the right terminology.
      • luks
        it's just a regular page, but instead of html it will return json
      • brianfreud
        ah, like the languages list page?
      • hmm, wonder if a JSON page can be templated then?
      • gettext for javascript uses JSON results to pass l() translations to js code
      • luks
        no, there are modules to generate JSON for you from a perl object
      • you can use templates for that, but I don't see why
      • brianfreud
        like I say, I know nothing (yet) about the server side for JSON - only that gettext and your lookup both need JSON results to be fed in for them towork
      • luks
        hm, right, translating JS will be more fun
      • brianfreud
        there's a JQuery plugin for it, made sure of that a week ago.
      • luks
        that should work
      • brianfreud
        The .js client end seems straightforward enough. Now I just need to spend the next couple of days reading up on the server end of JSON
      • luks
        we will need a separate .po files for JS and the rest
      • brianfreud
        why?
      • luks
        because there will be a lot of translations, but only few of them used in JS
      • sending all of them doesn't seem like a good idea
      • brianfreud
        ah, not a technical thing, but rather, for faster response
      • if it's a webservice, though, rather than a hard-coded page, shouldn't it just be sending back only the requested string(s)?
      • navap
        Maybe Im crazy, but shouldn't this be set to "Interview" as per its last edit? http://musicbrainz.org/release/0775f70b-c750-47...
      • luks
        brianfreud: that would be slooooow :)
      • <link href="path/to/translation.json" lang="ro" rel="gettext"/>
      • navap
        And why are the release events not sorted the same as on http://musicbrainz.org/release/26b95b5c-e6c7-4e...
      • luks
        our "path/to/translation.json" will return all trasnlations in one request
      • brianfreud
        for every language?
      • luks
        just the currently selected one
      • brianfreud
        k
      • nikki
        navap: hmm, well, it changed it from album to interview, but then the album one was cancelled...
      • navap
        But kot the Interview..
      • not*
      • nikki
        so I guess it was something to do with the two edits cancelling each other or whatever
      • brianfreud
        I will likely have to work with you a bit in figuring out how to pull off the server end of things for both JSON needs
      • luks
        I can do the server part if you want
      • nikki
        yes, but when the spokenword->album one was cancelled, I presume it thought it was reverting the edit, changing interview to spokenword
      • brianfreud
        well, to paraphrase ruaok, lol, first I'd at least like to learn how, even if you end up doing it in the long run :)
      • I am guessing, though, that that means writing a .pm over in /lib?
      • luks
        in lib/MusicBrainz/Server/Controller to be more specific
      • navap
        hm, I see..the edits should actually be in a different order.
      • Kerensky97 has left the channel
      • brianfreud
        do you recall what file held the old JSON server's code?
      • nikki
        so it should be interview, but a glitch in the way the edits are handled broke it :P
      • luks
      • but the new version should be simpler
      • aCiD2
        wth are those comments rob :P
      • ruaok
        spam or psycho hose beast.
      • ruaok shrugs
      • brianfreud
        hmmm, looks straightforward enough
      • ok, scary... perl has begun to be comprehensible :P
      • luks
        depends on who's perl code are you reading :)
      • brianfreud
        luks: more from a speed of code point of view, did you worry about eval() protections, or are we safe using it without too much concern, do you think?
      • luks
        eval() used where?
      • brianfreud
        for anything fed to the client specifically by the two JSON feeds we're talknig about
      • FauxFaux
        eval(posted_vars[1])
      • luks
        what do you have json for?
      • brianfreud
        notice you didn
      • luks
        er, jquery for
      • brianfreud
        well, yes - and that plugin uses it
      • var messages = eval('(' + data + ')'); /// var fn = eval('(function(' + v + ') {return ' + expr + ';})');
      • ruaok
      • navap
        Indeed
      • luks
        :(
      • brianfreud
        but I notice you didn't in your code
      • ruaok
        I need to find a GF like that. I'd be proud to be her BF.
      • luks
        brianfreud: my code uses $.getJSON
      • I'll take a look what does the gettext plusin uses eval instead
      • brianfreud considers messing with the gettext plugin to de-eval it
      • brianfreud
        too bad such a useful function has to be so dangerous, by nature
      • luks
        I don't find it useful :)
      • in fact, I was never in a situation when I needed to use eval in any language
      • hm, actually that's a lie, I used it once in python:)
      • brianfreud
        I've managed in a non-framework manner to avoid using it before, but you can end up doing cartwheels (I did, at least) trying to do what you need, and only what you need, for JSON feeds that tend to send WAY too much info back
      • ruaok
        how about DB transactions in perl?
      • pretty much need to use eval for that...
      • luks
        well, I mean different kind of eval
      • eval { } is the only way to catch errors in perl
      • ruaok
        ok
      • luks
        I meant eval with a string variable
      • ruaok nods
      • brianfreud specifically thinking of the early JSON implementation for FreeBase
      • brianfreud
        oh fun, more snow coming down hard again
      • hmm, ok, a script file with a comment like this must be high on the list to port: /* TODO: remove this function */ :D
      • aCiD2
        brianfreud: gonna merge now, that sound good?
      • luks
        such TODO usually means the function can't be simply removed, because other code depends on it :)
      • brianfreud
        sure - you merging pronik's patches from yesterday too?
      • aCiD2
        brianfreud: somewhere in the perl it says "Delete this when we use a real database" that makes me chuckle
      • brianfreud: if you've merged them into your branch, then yes, probably :P
      • brianfreud
        luks: yes... hence why, whenever possible, I'm throwing out old stuff, as a lot of it just fixed things other things broke.
      • in this particular case, movefocus.js fixed one thing... and broke Opera anyhow
      • chefkoch joined the channel
      • Kerensky97 joined the channel
      • YAY! :)
      • aCiD2
        what's the yay about?
      • brianfreud
        Been talking with Neil via email... he just did a quick code audit and relicensed Diff Match and Patch as LGPL 2.1 (as opposed to Diff_Match_Patch, which is identical, but remains Apache 2.0)
      • CatCat totally wants to see top contributors and cost per hit/ws hit type spot, that was really interesting
      • CatCat
        brianfreud: huh?
      • neil who?
      • brianfreud
        Fraser - the guy who now works for Google, and who wrote the js diff engine that's a ton better (and faster) than the one by John Resig which we were using
      • aCiD2
        I don't think git is really working out how it should be because of git-svn :(
      • i just tried to merge your branch, and even bits where there's no conflict, git thinks are conflicts
      • ruaok
        common problem from what I've read aCiD2
      • aCiD2
        :(
      • ruaok
        is it safe to call the situation a mess yet?
      • ruaok ducks