Posted: junho 26th, 2007 | Author: coredump | Filed under: Gaming, Linux e Open Source | Tags: javascript, linux, wow
Então, o World of Warcraft Armory é o terror do Linux. Depende de Flash 8 e usa uma caralhada de javascript que Djaga duvida. Até hoje eu me irritava pelo pessoal que usa Ubuntu conseguir acessar e eu com meu Debian não.
Felizmente, não era nada grave: o Debian usa o Iceweasel como browser, que é na verdade o Firefox com outro nome (problemas com logomarcas). Basta editar a configuração do Iceweasel e instalar o GNASH que tudo funciona beleza. Instalar o gnash é básico (aptitude install blah blah) e a configuração do Iceweasel é feita usando o ‘about:config’ mesmo – abre o browser, digita “about:config” e coloca no campo de busca “general.useragent.extra.firefox”, mudando o valor disso para “Firefox/2.0.0.4″.
Pronto, o Armory vai funcionar direitinho agora.
intel.
No Comments »
Posted: novembro 21st, 2006 | Author: coredump | Filed under: Linux e Open Source, Programação | Tags: javascript, turbogears
So, I was trying to make the Turbogears AutoComplete Widget work like the address field from gmail or hotmail. Basically to continue searching after a comma to add values. My javascript is not that good and I felt a little bad on messing with the default widgets, so I did something on the search controller to mimic this behavior. This is the complete controller I use with the Widget:
def complete(self, tagname):
tags = ['linux', 'security', 'love', 'politics', 'sex', 'religion',
'esports', 'programming', 'scifi', 'theories', 'spaced tag']
old_tagname = None
if ‘,’ in tagname:
new_tagname = tagname.replace(‘ ‘, ”).split(‘,’)
tagname = new_tagname.pop().strip()
old_tagname = ‘, ‘.join(new_tagname)
if tagname == ”:
return dict(tag = [])
reslist = []
for tag in tags:
if tag.startswith(tagname):
if old_tagname:
tag = old_tagname + ‘, ‘ + tag
reslist.append(tag)
return dict(tag = reslist)
@expose()
def default(self, *w, **kw):
raise redirect(“/”)
Yes, it’s kinda ugly but it works. In Brazil this is called gambiarra. I’ll elaborate a little more after, there’re too many variables and I’m sure I can make something more compact. Right now I just need this working
cya.Technorati Tags: turbogears, autocomplete, widgets, hacking
No Comments »
Comentários