Back Home

Open Designs

Community. Driven.

    •  
      CommentAuthorColin
    • CommentTimeDec 31st 2006
     
    Don't shoot me down just yet, I have an idea...

    I know we've always said we shouldn't use JS in our templates because of exploits, etc., but what if we have a list of accepted libraries (Script.aculo.us, moo.fx, et al) that are purely for effects purposes that are allowed? I think it would greatly expand the variety of templates available on OD.

    I'm not saying we should allow designers to upload their own scripts, just that they can call a pre-approved script from the OpenDesigns.org site and explain in the template that the consumer must get their own copy of the scripts for their sites, not hotlink off of the one on OD. They could call it in their designs like this:

    <script type="text/javascript" src="http://opendesigns.org/scripts/prototype.js"></script>

    Thoughts?
    •  
      CommentAuthorJosh
    • CommentTimeDec 31st 2006
     
    I wouldn't mind javascript in designs so long as it is actually a part of the design and not some silly clock widget or the like.

    moo.fx and simaler scripts are great examples of useful JS IMO.
  1.  
    My opinion on this, the libraries are too bloated and large to be included in designs. What I mean, is with simple JavaScript you can show/hide elements, without needing a full script.aculo.us effect to do it. For example this snippet of JavaScript:

    function toggle(targetId) {
    if (document.getElementById) {
    target = document.getElementById(targetId);
    if ((target.style.display == "none")||(target.style.display == "")) {
    target.style.display = "block";
    } else {
    target.style.display = "none";
    }
    }
    }


    Then called with this:

    <a href="#" onclick="toggle('div_name_here'); return false">click me</a>

    Would toggle the display (between none & block) of the div called 'div_name_here' and thats just a simple way of hiding / showing any data you may want.

    Now if I were to do a similar thing in Script.aculo.us (it would be much nicer to look at, and could fade or slide or whatever which is "cool" and web 2.0) but I would be using a 64kb Prototype Library with the 3kb Script.aculo.us Library combined with the 32kb Script.aculo.us Effects Library. In my opinion, that added 100kb(ish) is just too much for the general user who downloads the template.

    Also, how many general users can comfortably edit the JavaScript without learning how to manipulate the Script.aculo.us library?

    See where I'm going with this? Maybe simple snippets of JavaScript are OK, but using full blown libraries is a bit much for the general person who would download the templates looking to create his first website from one of our templates.
    •  
      CommentAuthorJeremyD
    • CommentTimeDec 31st 2006
     
    *scratches head* i hate not knowing javascript :(
    •  
      CommentAuthorJosh
    • CommentTimeDec 31st 2006
     
    Maybe have a rule that if you use javascript in your design you need to provide a no-JS version as well? That wouldn't be hard for the most part.. and users that don't know or like javascript can chose that?
    •  
      CommentAuthoryugnats
    • CommentTimeDec 31st 2006
     
    or you could have a category for templates that use the prototype, etc libraries. i think its a great idea, colin, since it certainly would broaden the quality of templates. good one for the suggestion box :)
    •  
      CommentAuthorgnome
    • CommentTimeDec 31st 2006
     
    JeremyD: me too... But I am learning always.
  2.  
    Yeah it would certainly widen the variety of templates, so for that it's a good idea, I hope a few more people reply with their opinions to see what others think about it.

    JeremyD / gnome - Dynamic Drive is a great place for JavaScript resources, sure, a lot of them are pretty outdated and some may include mouse trailers ;o but it's a starting point to learn some basics. Otherwise, start by thinking what kind of JavaScript you want to learn, if you want to learn how to control CSS display properties onclick using JavaScript (that's my example above), then search for tutorials on that. If you want to use it for mouse trailers (haha) then search for that. But mainly, just play around with pre-built scripts and see how they're built, just learn whichever way is most comfortable for you.
    • CommentAuthorwfiedler
    • CommentTimeJan 1st 2007
     
    Tip: Look at this site:

    http://www.dhtmlgoodies.com
    •  
      CommentAuthorjanpd24
    • CommentTimeJan 1st 2007
     
    Posted By: JeremyD*scratches head* i hate not knowing javascript :(

    I know what you mean. I used to feel that way about PHP, but I'm learning ;-)
    • CommentAuthorCoolGoose
    • CommentTimeJan 1st 2007
     
    All the mootools library and efects use only 26kb. And if you are using this only for graphics you can reduce it even more. So size isn't really an issue.
    • CommentAuthorSaad
    • CommentTimeJan 1st 2007
     
    heck, i used to feel the same away about css/xhtml. i look back and realize ive come along way, since now i actually know what im doing, (sort of wink).
    •  
      CommentAuthorLobsterMan
    • CommentTimeJan 1st 2007
     
    The main reason JS is not allowed is to keep the templates simple and useful.
    •  
      CommentAuthorDENiAL
    • CommentTimeJan 1st 2007
     
    I would say, if you want to have some js, just write a tutorial, on how to ad it, instead of ipsum. Just an idea...
    •  
      CommentAuthorLobsterMan
    • CommentTimeJan 2nd 2007
     
    Posted By: DENiALI would say, if you want to have some js, just write a tutorial, on how to ad it, instead of ipsum. Just an idea...

    That's a great idea!
    •  
      CommentAuthorsnop
    • CommentTimeJan 2nd 2007
     
    Posted By: JoshMaybe have a rule that if you use javascript in your design you need to provide a no-JS version as well?

    I like this idea since I'm a big fan of javascript, and it would take care of LobsterMan's "simple and useful" requirement.
    •  
      CommentAuthorslajax
    • CommentTimeFeb 28th 2007 edited by slajax on the 28th February 2007 at 16:12:55 EST
     
    I am available to contribute. I've been writing advanced java script for a long time.
    Currently working on Windows Live-Map projects for Microsoft partners similar to this: www.demo.slajax.com/livemap.php.

    I would really like to develop some partnerships with some great designers (I'm drawing-deficient), so let me know if you want some flashy template effects, we can barter or something.


    Posted By: DENiALI would say, if you want to have some js, just write a tutorial, on how to ad it, instead of ipsum. Just an idea...


    I have a library called ajaxRDF (rapid development framework) that I have developed to pack Ajax functionality into a very easy to use implementation process.
    This would take care of any learning curve as it is targeted at designers who are not code savvy. I've been waiting for a reason like this to start beta testing it.
    Also it's under 30kb in its lite form just like mootools so it's not a size issue. I'm sure it's smaller then most designers images.

    Send me a message from my site if your interested in this stuff.
    •  
      CommentAuthorauhsoj
    • CommentTimeFeb 28th 2007
     
    My personal recommendation on this is to offer your "Hollywood" version of a template on your web site and mention it in the template you post through these free outlets. What that literally does is prevent CS scripting abuse (which is one of the primary reasons why JS is not allowed on these template sites) but it lets the user know that you have a version with added effects and bells & whistles available on your personal web site; This way the user can use the original layout if they do not want all of the effects, and browse to your web site to download the advanced template.

    JeremyD & janpd24:
    Javascript and PHP are a blast if you're really motivated to learn them. If you've ever learned to speak a new language, seeing your first script work is like holding your very first conversation in that language. (Don't pick the hard languages though! I'm learning Arabic and Japanese because I'm obsessed with the music...) It gets so much easier once you've gotten the basics of assigning variables, constructing functions, etc. down. The coolest thing IMO is constructing functions within a variable in JS and class nesting in PHP. (I personally love htaccess-related programming!) bigsmile
  3.  
    Posted By: DENiALI would say, if you want to have some js, just write a tutorial, on how to ad it, instead of ipsum. Just an idea...

    I think this is a great idea. It would be pretty easy to do, add CSS classes for everything that you want effects on, then use the same basic premise as my Properly degrading JavaScript Effects with Script.aculo.us to apply different effects to each element with a specific CSS class. In your template, explain to the user that they need to get scriptaculous (or whatever you choose to use), put it in a specific dir, and add "this code" to the head...then give them the code (in a properly styled code tag of course).
    • CommentAuthorDraicone
    • CommentTimeMar 1st 2007
     
    If the initial reason for not allowing JavaScript was exploits, be aware that some libraries - jQuery, for example - just make exploits easier. In fact, what takes 40 lines of code and is fairly conspicuous in raw JS, can be done in 2 lines of code that meld in with the flow using some libraries. We also can't restrict designers to particular libraries because many may not be familiar with moo.fx or the like.

    However, if we could use some basic JS to add spice to the designs, it could work out. Smooth scrolling is an excellent example of this. As long as the ease of use of the template is not compromised, limited JS sounds fine.
    •  
      CommentAuthorkirby145
    • CommentTimeMar 1st 2007 edited by gnome on the 01st March 2007 at 22:02:07 EST
     
    I use a js snippet from Dynamic Drive for a News fader. I generally code eveerything myself unless i can find an excuse: and this one is that MICROSOFT made and well doesn't that suck.
    /* Close Your Tags... */
    •  
      CommentAuthorbakercad
    • CommentTimeMar 1st 2007 edited by bakercad on the 01st March 2007 at 22:09:48 EST
     
    how about submitting your regular JS FREE design with a link to download the JS laden one on your own site?

    and PHP rocks! I love it