diff --git a/docs/button.html b/docs/button.html index 45fa755e9..04dfd1bd1 100755 --- a/docs/button.html +++ b/docs/button.html @@ -18,7 +18,7 @@ - + diff --git a/docs/form.html b/docs/form.html index 083352480..42ae700f5 100755 --- a/docs/form.html +++ b/docs/form.html @@ -15,20 +15,20 @@ - - + - - - - + + + + +
@@ -148,48 +148,52 @@A form is a collection of user input elements, and has no stylings of its own.
-Let's go ahead and get you signed up.
-A form is a collection of user input elements, and has no stylings of its own.
+Let's go ahead and get you signed up.
+A field is a form element containing a label and an input
-A field is a form element containing a label and an input
+A textarea uses the default form element
diff --git a/docs/javascript/semantic.js b/docs/javascript/semantic.js index 6c5bc2322..1770e13e2 100755 --- a/docs/javascript/semantic.js +++ b/docs/javascript/semantic.js @@ -1,5 +1,5 @@ // namespace -var semantic = { +window.semantic = { handler: {} }; @@ -7,16 +7,18 @@ var semantic = { semantic.ready = function() { // selector cache - var - $ui = $('.ui').not('.hover, .down'), - $swap = $('.swap'), - $menu = $('.menu.button'), - $demo = $('.demo'), - $waypoints = $('h2'), - - $peek = $('.peek'), - $peekMenu = $peek.find('li'), - $code = $('.code'), + var + $ui = $('.ui').not('.hover, .down'), + $swap = $('.swap'), + $menu = $('.menu.button'), + $demo = $('.demo'), + $waypoints = $('h2'), + + $exampleCode = $('.example i.code'), + + $peek = $('.peek'), + $peekMenu = $peek.find('li'), + $code = $('div.code'), // alias handler @@ -25,19 +27,60 @@ semantic.ready = function() { // event handlers handler = { + createCode: function() { + var + $example = $(this).closest('.example'), + $shape = $example.find('.shape.module'), + $demo = $example.find('.demo'), + $annotated = $example.find('.annotated'), + $code = $annotated.find('.code'), + code = $demo.get(0).innerHTML + ; + // add source if doesnt exist and initialize + if($annotated.size() === 0) { + $annotated = $('') + .addClass('annotated') + .appendTo($example) + ; + } + if( $code.size() === 0) { + code = code.replace('^(\s+)', '$1$1'); + console.log(code); + $code = $('') + .data('type', 'html') + .addClass('code') + .text(code) + .appendTo($annotated) + ; + $.proxy(handler.initializeCode, $code)(); + } + if( $demo.is(':visible') ) { + $demo.hide(); + $annotated.fadeIn(500); + } + else { + $annotated.hide(); + $demo.fadeIn(500); + } + }, + + removeIndents: function(code) { + + }, + initializeCode: function() { - var - $content = $(this), - contentType = $content.data('type') || 'javascript', - editor = ace.edit($content[0]), + var + $code = $(this), + contentType = $code.data('type') || 'javascript', + editor = ace.edit($code[0]), editorSession = editor.getSession(), - padding = 3, + padding = 0, codeHeight = editor.getSession().getScreenLength() * (editor.renderer.lineHeight + padding) + editor.renderer.scrollBar.getWidth() ; editor.setTheme('ace/theme/github'); editor.setShowPrintMargin(false); editor.setReadOnly(true); - editor.renderer.setShowGutter(false); + editor.renderer.setShowGutter(false); editor.setHighlightActiveLine(false); editorSession.setMode('ace/mode/'+ contentType); @@ -92,7 +135,7 @@ semantic.ready = function() { continuous : false, offset : 215, handler : function(direction) { - var + var index = (direction == 'down') ? $waypoints.index(this) : ($waypoints.index(this) - 1 >= 0) @@ -114,6 +157,10 @@ semantic.ready = function() { ; } + $exampleCode + .on('click', handler.createCode) + ; + $swap .on('click', handler.swapStyle) ; diff --git a/docs/library/jquery.js.REMOVED.git-id b/docs/library/jquery.js.REMOVED.git-id new file mode 100644 index 000000000..2f2c2173c --- /dev/null +++ b/docs/library/jquery.js.REMOVED.git-id @@ -0,0 +1 @@ +9908c1a7219dda4289be6b1dce8de87c439bec13 \ No newline at end of file diff --git a/docs/module.html b/docs/module.html index 287a75409..9dcd7c876 100755 --- a/docs/module.html +++ b/docs/module.html @@ -16,7 +16,7 @@ - + diff --git a/docs/shape.html b/docs/shape.html index fdc21e344..8d8114f8d 100755 --- a/docs/shape.html +++ b/docs/shape.html @@ -17,7 +17,7 @@ - + @@ -184,7 +184,11 @@