Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bug fixes and example screws

  • Loading branch information...
commit 41ce1bde958e47e48821abc646877a023cada7ce 1 parent 67c478a
@pnegri authored
View
3  examples/assemble-test/app.coffee
@@ -1,4 +1,4 @@
-arcabouco = require 'arcabouco-js'
+arcabouco = require '../../main.js'
config =
baseDirectory: __dirname
@@ -6,7 +6,6 @@ config =
app = new arcabouco config
app.assemble __dirname + '/pieces'
-
app.build()
server = app.createServer()
View
2  examples/assemble-test/pieces/welcome/welcome.coffee
@@ -1,4 +1,4 @@
-WelcomeController =
+class WelcomeController
index: ( params ) ->
responder = params.response
template = params.app.Template
View
2  examples/minimal-test/app.coffee
@@ -1,4 +1,4 @@
-arcabouco = require 'arcabouco-js'
+arcabouco = require '../../main.js'
config =
baseDirectory: __dirname
View
10 lib/arcabouco.coffee
@@ -15,12 +15,15 @@ class ContentGenerator
addContentFor: ( where, data, options = { group: 'default' } ) ->
priority = 0
priority = options.priority if options.priority
- group = options.group
+
+ group = 'default'
+ group = options.group if options.group
@ensureArray( where, group )
type = 'plain'
type = 'function' if typeof data == 'function'
+
@contentArray[ group ][ where ].push
'type': type
data: data
@@ -35,6 +38,7 @@ class ContentGenerator
priorityArray = Underscore.sortBy @contentArray[ group ][ where ],
( obj ) ->
return obj.priority
+
for aContent in priorityArray
output = ''
if aContent.type == 'plain'
@@ -78,8 +82,8 @@ class Arcabouco
#@content_for = @ContentGenerator.getContentFor
- @Template.loadTemplate Common.Path.normalize(__dirname + '/../views/404.haml'), '404'
- @Template.loadTemplate Common.Path.normalize(__dirname + '/../views/500.haml'), '500'
+ @Template.loadTemplate Common.Path.normalize(__dirname + '/../templates/404.haml'), '404'
+ @Template.loadTemplate Common.Path.normalize(__dirname + '/../templates/500.haml'), '500'
setInterval =>
# TODO: SEPARATE THIS INTO A CLASS
View
2  package.json
@@ -1,7 +1,7 @@
{
"name" : "arcabouco-js",
"description" : "scalable microframework in node.js",
- "version" : "0.6.3",
+ "version" : "0.6.6",
"author" : "Patrick Negri <patrick@iugu.com.br>",
"homepage": "http://github.com/pnegri/arcabouco-js",
"contributors" : [],
View
46 sample-screws/screw-compatible-web-app/screw-compatible-web-app.coffee
@@ -0,0 +1,46 @@
+class ScrewCompatibleWebApp
+ bootstrap: ( application ) ->
+ return unless application
+
+ application.ContentGenerator.addContentFor 'start_of_document',
+ '<!--[if IEMobile 7]><html class="no-js ie7" manifest="default.appcache?v=1"><![endif]-->'
+
+ application.ContentGenerator.addContentFor 'start_of_document',
+ '<!--[if lt IE 7]><html class="no-js ie6"><![endif]-->'
+
+ application.ContentGenerator.addContentFor 'start_of_document',
+ '<!--[if IE 7]><html class="no-js ie7"><![endif]-->'
+
+ application.ContentGenerator.addContentFor 'start_of_document',
+ '<!--[if IE 8]><html class="no-js ie8"><![endif]-->'
+
+ application.ContentGenerator.addContentFor 'start_of_document',
+ '<!--[if (gte IE 9)|(gt IEMobile 7)]><html class="ie9 no-js" manifest="default.appcache?v=1"><![endif]-->'
+
+ application.ContentGenerator.addContentFor 'start_of_document',
+ '<!--[if !(IEMobile)|!(IE)><!--><html class="no-js"><!--<![endif]-->'
+
+ application.ContentGenerator.addContentFor 'head',
+ '<link rel="canonical" href="/" />'
+
+ application.ContentGenerator.addContentFor 'head',
+ '<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />'
+
+ application.ContentGenerator.addContentFor 'head',
+ '<meta http-equiv="cleartype" content="on" />'
+
+ application.ContentGenerator.addContentFor 'head',
+ '<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />'
+
+ # TODO: Remove Mootools Dependancy
+ application.ContentGenerator.addContentFor 'head',
+ '<script type="text/javascript">$$("html").removeClass("no-js").addClass("js");if (Browser.Platform.ios) { $$("html").addClass( "ios" ); }; if (Browser.Platform.android) { $$("html").addClass( "android" ); }; document.addEvent("domready", function() { $$("html").removeClass("not-ready").addClass("ready"); });</script>', { priority: 1000 }
+
+ application.Template.loadTemplate __dirname + '/template/app.no-js.haml', 'compatible.no-js'
+
+ application.ContentGenerator.addContentFor 'start_of_body',
+ application.Template.doRenderPartial( 'compatible.no-js' )
+
+ application.ContentGenerator.addContentFor 'end_of_document', '</html>'
+
+module.exports = ScrewCompatibleWebApp
View
4 sample-screws/screw-compatible-web-app/template/app.no-js.haml
@@ -0,0 +1,4 @@
+%noscript
+ .js-warning
+ .wrapper
+ %p Error: Your browser must have Javascript enabled to use this service
View
7 sample-screws/screw-html5shiv/screw-html5shiv.coffee
@@ -0,0 +1,7 @@
+
+class ScrewHTML5SHIV
+ bootstrap: ( application ) ->
+ return unless application
+ application.ContentGenerator.addContentFor 'head', '<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->'
+
+module.exports = ScrewHTML5SHIV
View
9 sample-screws/screw-mootools/screw-mootools.coffee
@@ -0,0 +1,9 @@
+class ScrewMootools
+ bootstrap: ( application ) ->
+ return unless application
+
+ application.ContentGenerator.addContentFor 'head',
+ '<script src="http://ajax.googleapis.com/ajax/libs/mootools/1.3.2/mootools-yui-compressed.js"></script>',
+ 'default', { priority: -1000 }
+
+module.exports = ScrewMootools
View
0  views/404.haml → templates/404.haml
File renamed without changes
View
0  views/500.haml → templates/500.haml
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.