December 2006
Monthly Archive
Mon 25 Dec 2006
Posted by trent under
CSS ,
Javascript[2] Comments
I ran into a need for a print preview on my website the other day and was unable to find a quick solution, so with a little thought I whipped up a small function which does just that with CSS and Javascript. Here’s what I come up with:
<link id=”screenCSS” media=”all” rel=”stylesheet” type=”text/css” />
<link id=”printCSS” media=”print” rel=”stylesheet” type=”text/css” />
<script language=”javascript”>
function togglePrintPreview()
{
var currCSS = document.getElementById(’printCSS’);
if(currCSS.media == ‘all’)
currCSS.media = ‘print’;
else currCSS.media = ‘all’;
}
</script>
Pretty simple theory.. just toggle the media attribute of the link tags from “print” to “all”. Maybe a little dumb,.. but very practical. View Example
Thu 21 Dec 2006
I’ve been working for a while on the aedCFC with the optional tree view. This uses an old database technique described on sitepoint.com .. however the tree.cfc I created was very basic as in only adding, deleting, and printing nodes which sortof holds back the possibility to making this a real fun, dynamic cfc with drag and drop for tree nodes(soon to come to the aedCFC). Finally I have added more to this tree functionality by successfully creating a function to move nodes(including child nodes) in the tree.cfc. I dont have any documentation just yet,.. but you can see its pretty straight forward to use. In the download there is an index.cfm which is a small form controller for the treecfc. All of the sql is basic so it is pretty likely it will work on most db’s(tested on mysql and mssql). DB table fields are specified in the comments. Maybe I will get some time to whip up some docs on this little tool.
Download Source
Mon 18 Dec 2006
Finally many of the features we have been working towards made it in the aedCFC. Our long time debated XML config file finally made it in as an option(mainly for backwards compatibility). The biggest downfall to the config before was the function calls with many parameters. I’ve read a few other postings on the great XML config debate and I come to the conclusion that the aed wasnt in the situation where XML would kill it. The XML may slow it down a little,.. but is it enough to really matter?
Sat 2 Dec 2006
Posted by trent under
ColdFusion ,
aedCFC1 Comment
Ok, so I am happy with the popularity? of the aedCFC we’ve posted on riaforge.org. I am also happy with the progress we’ve made with it over the past few months. Mr. Belcher and I both agree that we need to change the config file some to make the configuration a more clearcut process. I would say faster.. but it only takes about 3-4 minutes to set up a new add/edit/delete with aedCFC. An xml config??
Probably the most remarkable improvement in my opinion is the addition of the ‘tree’ view to allow add/edit/delete of hierarchial structure( menus, subcategories, etc..). Shad has an example on his site. Thoughts?..Anyone?
Sat 2 Dec 2006
Posted by trent under
CSS[45] Comments
Avoid cross-browser javascript when you can use css to make tooltips with less code. Honestly you were going to use css to style your tooltips anyway right? Your probably already have most of this code in your css already too. Besides that if you have an advanced site in the first place you probably have enought javascript already.
Also with the IE hack for the :hover state, you can do this with elements besides anchors.
If you dont like how it allows you to hover over the tooltip also then you can adjust the padding and top to separate the tool tip from the link.
View Full Example and Code
Download Source