Tibor SzászInteraction matters

  • Home
  • About me
  • Projects
  • Reqest price offer
  • Contact me
  • RSS

2010 0314

Video maximizer script

Video maximizer script I've added a new feature to my blog and I would like to share it with you. It's damn easy and very useful, if you care about design.
The reason I created this script is that the videos I embed has various sizes and enlarging them is a boring task, so let a small code do it:

function fixVideos()
{
	// Maybe you should be more specific, than me
	var videos = document.getElementsByTagName('embed');
	var cwidth = 550; // The width you want to resize to
	var ratio = 0;
	for( i=0; i < videos.length; i++ )
	{
		ratio = videos[i].height / videos[i].width;
		videos[i].width = cwidth;
		videos[i].height = ratio * cwidth;
	}
}
That's it.


Category: Programming - Tags: javascript resizing - 1 Read more

2010 0205

What tables could be also good for?

What tables could be also good for? Finally, we live at an age where even a beginner web developer finds it embarrassing to use table layout for sitebuilding. Tables are very good what they created for: displaying arrays of data. You can style, script, enhance them in many ways.
I often have to hack into CMS systems functionality to make them customized for the clients and requests can be sometimes tricky to do, but I think there is always a simple solution. These clients usually use WYSIWYG editors to manage their pages, but I can't expect that they know XHTML or JSON to manage fancy widgets.

This was the case last time, when I needed to add a tabbed JS widget to a Drupal website. I came up with the idea, that tables can be used for describing data, nothing more and after processing the cells data, the whole table can simply be replaced with the markup for the widget.
This is a dirty hack I know, but at least the users can cope with it. It worked pretty well, the first column is the tab's name and the second column is its contents. There is a valid table attribute "summary" that is suitable for triggering the conversion, the user only have to enter "tabs" to it and the script does the rest.
It is not a problem if the javascript is turned off, because the data is still accessible and it can still be formatted with CSS to make it look pretty.


Category: Programming - Tags: table javascript hack Read more

2010 0202

JavaScript template engine upgraded

JavaScript template engine upgraded I'm a big fan of separating the business logic and the presentation layer. This can be easily done by PHP, ROR, Java, etc. but when you try to do it in JavaScript it's not obvious how to do it, or which is the best way.

I've researched a lot on the topic and found two schools that is used by JS template libraries:
- Template language parsing
- Procedural approach
Both are great ways to generate, it only depends on your needs.

Here are some projects worth noting:


  • JST - JavaScipt templates - Big and evolved library, Smarty like syntax, GPL
  • SWATO - Very similar to the above, it's created for Java develpers. Example.
  • Chain.js - a nice tutorial about this.
  • PURE - this is a hybrid one and library free
  • jTemplates - a jQuery plugin
  • JTL - A Django template engine port
I played with the last one. It had some basic functions such as for loop, counter, reverse order, if syntax for checking if a value exists. The only problem was that it didn't had a comparison operator for strings and variables, so I decided to upgrade it.


Category: Programming - Tags: javascript template free open-source Read more

 < 1 2 3 4 5 > 

Briefing

Me myself and I
I love coding, especially for the web. I'm in the online industry for 6 years. My favourite toys are:
JavaScript, PHP, XHTML, MySQL, Canvas, Flash
Váltás magyar nyelvre

Topics

  • Coffee break
  • Design & stuff
  • Generative arts
  • Programming
  • User experience

Friends

  • Kárpáti Róbert
  • Royaljerry
  • Bagi Zoltán
  • Pegazoo
  • Charles Alexander Deli
  • Bence Bangócs
  • Lunakid
  • Rapp design

Feeling so social

  • Facebook
  • IWIW
  • TurulMeme

Tags

javascript (14) php (6) mootools (5) iscaffold (4) codeigniter (4) tutorial (3) crud (3) structure-synth (2) renders (2) template (2) css (2) free (2) google (2) drupal (1) data-visualisation (1) resizing (1) canvas (1) soundcloud (1) wordpress (1) joomla (1) google-buzz (1) hack (1) script (1) rss (1) bermuda-triangle (1) interface (1) design, (1) transitions (1) easing (1) microsoft (1) windows8 (1) magyar (1) bugs (1) ie8 (1) experience (1) user (1) twitter (1) facebook (1) email (1) table (1) rc1 (1) nl2br (1) drag-and-drop (1) slideshow (1) wikipedia (1) dns (1) svg (1) experiment (1) firefox-extension (1) tagging (1) slimbox (1) bugfix (1) cfdg (1) lists (1) inspiration (1) data-uri (1) trick (1) forge (1) infovis (1) blackout (1) tabs (1) library (1) sitebuild (1) utf8 (1) class (1) ajax (1) konami-codes (1) open-source (1)




All rights reserved, ©2008-2012 - Built on CodeIgniter framework - Konami codes - Mostly Valid XHTML 1.1 - Valid CSS 2.1