Re: [Catalyst] Re: javascript in Catalyst using Template Toolkit
On Sat, 2007-12-22 at 09:06 -0500, kevin montuori wrote: (defun ii-insert-catalyst-url () (interactive) (let ((path (read-from-minibuffer URI: ))) (insert (format a href=\[%% Catalyst.uri_for('%s') %%]\/a path)) (backward-char 4))) This would be better written as: (defun ii-insert-catalyst-url (path) (interactive sURI: ) (insert (format a href=\[%% Catalyst.uri_for('%s') %%]\/a path)) (backward-char 4)) Now you can call the function non-interactively. Regards, Jonathan Rockway signature.asc Description: This is a digitally signed message part ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: javascript in Catalyst using Template Toolkit
On 23 Dec 2007, at 01:06, kevin montuori wrote: obCatalyst: let me add that if you use emacs :| you could define a little function like: (defun ii-insert-catalyst-url () (interactive) (let ((path (read-from-minibuffer URI: ))) (insert (format a href=\[%% Catalyst.uri_for('%s') %%]\/ a path)) (backward-char 4))) to do the work for you. if you're accustomed to using html-mode or sgml-mode you might even rebind C-c C-c h (html-href-anchor): (add-hook 'html-mode-hook well tt-mode would be more sensible. Some people ought to be able to write a little vi macro to do this too. I suspect that the macro would be written in perl. Also most of the time we'duse c.uri_for not Catalyst.uri_for '(lambda () (define-key html-mode-map \C-c\C-c\h 'ii-insert-catalyst-url))) and there'd be no new finger memory to develop, so no extra work whatsoever. This is axiomatic. Software sucks. You can a contribution to how much your software sucks by taking that little bit of extra effort and making the little bit of software that you're responsible for suck less. Because if software sucks, good software sucks less. HTH ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Re: javascript in Catalyst using Template Toolkit
KD == Kieren Diment [EMAIL PROTECTED] writes: KD On 23 Dec 2007, at 01:06, kevin montuori wrote: (add-hook 'html-mode-hook KD well tt-mode would be more sensible. my mileage varied. the font-locking of TT keywords would be ok but the the completion, indention, and validation sgml-/html-mode provides is actually useful. k. -- kevin montuori ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: javascript in Catalyst using Template Toolkit
heh. i'm picturing how that request would have gone over with the firewall group at the last fortune 500 i worked for. yes kevin, under those circumstances you likely wouldn't do it that way. on the other hand, if you are running your app on a server that you own and do admin for, and don't have such admin problems to negotiate, it would be fine, eh? horses for courses and all that. cheers, D ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ Dev site: http://dev.catalyst.perl.org/