This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <head> | |
| <%= meta %> | |
| <%= title_tag %> | |
| <%= favicon %> | |
| <%= ie_shim %> | |
| <%= webfonts %> | |
| <%= javascripts %> | |
| <%= styles :mobile,:general,:ie %> | |
| </head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Sinatra | |
| module JavaScripts | |
| def js *scripts | |
| @js ||= [] | |
| @js = scripts | |
| end | |
| def javascripts(*args) | |
| js = [] | |
| js << settings.javascripts if settings.respond_to?('javascripts') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| get '/' | |
| js :backbone, :application | |
| js :admin if logged_in? | |
| slim :index | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require './sinatra/helpers' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'sinatra/base' | |
| module Sinatra | |
| module JavaScripts | |
| def js *scripts | |
| @js ||= [] | |
| @js = scripts | |
| end | |
| def javascripts(*args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| get '/' do | |
| js :backbone, :custom | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| helpers do | |
| def js *scripts | |
| @js ||= [] | |
| @js = scripts | |
| end | |
| def javascripts(*args) | |
| js = [] | |
| js << settings.javascripts if settings.respond_to?('javascripts') | |
| js << args |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| get '/' do | |
| js "custom.js","sorter.js","colorpicker.js" | |
| slim :index | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| helpers do | |
| def js *scripts | |
| @js ||= [] | |
| @js = scripts | |
| end | |
| def javascripts(*args) | |
| js = [] | |
| js << settings.javascripts if settings.respond_to?('javascripts') | |
| js << args |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| helpers do | |
| def javascripts *scripts | |
| javascripts = (@js ? @js + settings.javascripts + args : settings.javascripts + args).uniq | |
| javascripts.each do |script| | |
| html << "<script src=\"/#{script}\"></script>" | |
| end.join | |
| end | |
| end |