Demo script

What is Demo script?

This is just a demo script that shows you all the options you have using Tutorialbuilder

Example

Version

2.0

Authors

Tags

Download

download version 2.0

Full source

  1. 1: helloWorld = function(){
  2. 2: var config = {
  3. 3: foo:'bar',
  4. 4: CSS:{
  5. 5: ids:{
  6. 6: menu:'menu',
  7. 7: footer:'footer'
  8. 8: },
  9. 9: classes:{
  10. 10: demo:'demo',
  11. 11: highlight:'current'
  12. 12: }
  13. 13: }
  14. 14: };
  15. 15: function init(){
  16. 16: if(window.console){
  17. 17: console.log('init was here');
  18. 18: alert('script executed!')
  19. 19: }
  20. 20: };
  21. 21: function otherStuff(){
  22. 22: if(window.console){
  23. 23: console.log('this would be other stuff');
  24. 24: }
  25. 25: };
  26. 26: return {
  27. 27: init:init
  28. 28: };
  29. 29: }();
  30. 30: helloWorld.init();

Explanations

We're using the revealing module pattern to define the main script. In this case, the main module name will be helloWorld.

  1. 1: helloWorld = function(){

You can use both lists and definition lists:

foo
this is a bar
CSS
An object that contains CSS information
  • list item 1
  • list item 2
  • list item 3

Text surrounded by linebreaks will be turned into paragraphs.

Each word enclosed in hashes will become code, words in asterisks will become strong.

  1. 2: var config = {
  2. 3: foo:'bar',
  3. 4: CSS:{
  4. 5: ids:{
  5. 6: menu:'menu',
  6. 7: footer:'footer'
  7. 8: },
  8. 9: classes:{
  9. 10: demo:'demo',
  10. 11: highlight:'current'
  11. 12: }
  12. 13: }
  13. 14: };

Any comment in the code will intercept the code display and turned into explanations

  1. 15: function init(){
  2. 16: if(window.console){
  3. 17: console.log('init was here');
  4. 18: alert('script executed!')
  5. 19: }
  6. 20: };

If you want to highlight a certain line, add a double slash followed by a star at the end of it.

  1. 21: function otherStuff(){
  2. 22: if(window.console){
  3. 23: console.log('this would be other stuff');
  4. 24: }
  5. 25: };
  6. 26: return {
  7. 27: init:init
  8. 28: };

You can add links by adding words in quotes followed by a colon and the url

  1. 29: }();
  2. 30: helloWorld.init();

© Christian Heilmann, 2008. Licensed under the BSD license.