open protocol

Tuesday, January 20, 2009

Adding "facebox-for-prototype" to your rails 2.x application

Just wanted to have the nice looking facebox which I discoverd on http://github.com/railsgarden/message_block in my rails application. With the first search I found facebox, but discovered that it works with jquery. As I use prototype I wanted to go for that and after a second short search I found facebox-for-prototype. Unfortunatly without tutorial, that's why I am writing this.

Step 1: Get the sources.

I always had hassle with git and never installed it and used some wget tactis. Currently I discovered there is a download link... just take this, its easier ;)

Step 2: Move the files to the right place.

All images i moved to: public/images/facebox
The css file to: public/stylesheets/facebox.css
The js file to: public/javascripts/facebox.js

Note: It's easier to move the images to public/facebox, then you don't need to do step 3. Never tested this, but should work from the logical point of view :)

Step 3: Adapt the css and javascript

Per default the js and css wants to have the images into the folder public/facebox, because I had it in public/images/facebox I had to adapt the image sources in the css and js file. What I did was in all places where a picture was stated, I added a /images before the /facebox. Example:

Before in public/stylesheets/facebox.css:
background:url(/facebox/tr.png);

After in public/stylesheets/facebox.css:
background:url(/images/facebox/tr.png);

Step 4: Add the css and javascript to your application.

I added the following links into the <head> of my app/view/layout/application.html.erb:
<link href="/stylesheets/facebox.css" rel="stylesheet" type="text/css">
<%= javascript_include_tag :defaults %>
<script src="/javascripts/facebox.js" type="text/javascript"></script>

Be sure that you have prototype included (!) otherwise it will not work.

Step 5: Test facebox with a example link.

In the <body> of my app/view/layout/application.html.erb I added the following link:
<a href="http://www.blogger.com/images/rails.png" rel="facebox">Test facebox</a>

Step 6: Run the code.

Run ruby script/server and fire up your webbrowser with localhost:3000 and click on the link Test facebox. Et voila the facebox should appear.

Cheers -- jerik.

Labels: , , , , , ,

Sunday, December 14, 2008

install rails plugins from git repositories without git

In the last time, more and more repositories for rails plugins are maintained via git. Unfortunatly I am used to svn and not really interessted to use a *new* version control system.

I tried to install git to get the plugins I needed. The installation worked, but to get plugins via git, did not work. So I played a little bit around and figure out, that you just have to replace "git://" with "http://" and add a slash on the end of the address, to install rail plugins. I.e: the git address is:

git://github.com/jkraemer/acts_as_ferret.git
then you just have to use this address instead and it works
http://github.com/jkraemer/acts_as_ferret.git/
No I can easily install my plugins without git ;)

ruby script/plugin install http://github.com/jkraemer/acts_as_ferret.git/

cheers -- jerik

Saturday, December 06, 2008

The power of javascript II

On a previous post The power of Javascript I wrote some thoughts about javascript. It seems like there is going some projects on, regarding this. Interesstings seems to be http://aptana.com/jaxer

Cheers -- jerik

Wednesday, September 03, 2008

Raum Manager (de)

Ein sehr interessantes tool zur Steuerung des automatisierten Wohnens: Room-Manager von ingénoive. Mit diesem gerät kann man die Heizung, das Licht und andere elektronsiche Geräte steuern. Interessant finde ich das man der Room-manager die präsens von anwesenden bemerkt. So wie ich es verstehe ist es möglich über das stromnetz die gerätschaften zu steuern. Super fände ich eine möglichkeit damit auch über tcp/ip zu kommunizieren, dann könnte die spielwiese richtig interessant werden.

Gruss -- jerik

Labels: , ,

Thursday, August 21, 2008

Virtualisierung kann smart-home technologies fördern (de)

Gerade auf Smartbrief.com gelesen. Sollte es nicht im idealfall ein system sein was alles steuert?

Gruss -- jErik

Wednesday, August 20, 2008

Automatisiertes wohnen (de)

Automatisiertes Wohnen - so taufe ich das was ich gerne bei mir daheim hätte. Darunter verstehe ich die nutzung der IT/Elektronik - auf unkomplizierte und einfache weise, um mir das leben in meiner Wohnung angenhmer zu machen.

Derzeit sind zwei sachen realisiert und die dritte ist noch in der Warteschleife:

  1. Automatisches flurlicht - getriggert durch einen bewegungsmelder. Das ist inzwischen so praktisch das ich es schon morgens im Treppenflur vermisse.
  2. Automatische Musik - wird über bluethooth (handy) getriggert. Sobald ich daheim auftauche, springt die Musik an. Da macht das heim kommen richtig spass.
  3. Gleiche Musik in Bad/Küche/Schlafzimmer. Das war bereits etabliert - mittels kabel. Aber derzeit wird nach einer Lösung gesucht, die Wireless möglich ist. Das scheint eine nicht so leichte Aufgabe zu sein.
Für Punkt 3 Scheint die derzeitige IFA http://www.ifa-berlin.de/ interessant. In der letzten C't hatte ich einen Hifi anlage entdeckt, die mobile boxen hatte. Sah sehr interessant aus. Muss mal schauen das ich da auf dem laufenden bleibe.

Misc links bezüglich automatisiertem Wohnen (einfach mal als backup):

Gruss -- jerik

Labels: , , ,

Thursday, May 15, 2008

the power of scripting: launchy meets autoitv3

Yesterday i discoverd AutoItv3. As I normaly like more the *nix systems, I have to say, this is awesome and make the windows plattform more productive in my eyes.

With AutoItv3 you can automate erverything with which you interact on your desktop, like open outlook, write a mail, copy/paste text, ... . I just wrote two scripts for task that I normaly do within my job:

  • record my work hours

  • Enter an issue into the mantis ticket system


In both task I have to login into our intrant and navigate to the appropriate site. Sometimes this is cumbersome, cause our interanet has some *originalities*.

Record the work hours will be done once a day: here i added the script to the scheduled task of windwos. Now, at a 5 o'clock the script will be run and I just have to add the hours and save it. Nice.

The automating of mantis makes more fun: I created the following script:
; Autor: jerik
; Date: 2008-05-15
; Login into intranet and navigate to report issue formular in mantis

; http://www.autoitscript.com/autoit3/docs/libfunctions.htm
$url_login = "http://theloginpagefortheintranet.com"
#include

$sUsername = "foo"
$sPassword = "bar"

$oIE = _IECreate($url_login)

; get pointers to the login form and username and password fields
$oform = _IEFormGetObjByName($oIE, "login")
$ologin = _IEFormElementGetObjByName($oform, "user")
$opassword = _IEFormElementGetObjByName($oform, "pass")

; Set field values and submit the form
_IEFormElementSetValue($ologin, $sUsername)
_IEFormElementSetValue($opassword, $sPassword)
_IEFormSubmit($oform)


$url_add_issue = "http://theurltotheticketsystemmantis.com/create/an/new/issue"
_IENavigate($oIE, $url_add_issue)

saved it under the name: mantis_ticket.au3 and stored it under a folder which is monitored by launchy, in my case: "$HOME/workspace/bin"

Additional I had to add in the launchy options dialog > catalog, the extension *.au3 to the folder $HOME/workspace/bin and rescan the catalog to use immediately this new function.

And now, if I want to create a mantis ticket: I fire up launchy, type in mantis_ticket and hit Enter. That's all.

cheers -- jerik

Labels: , , , , ,