karma4u101/FoBo — Issue #1: FoBoRules in boot for path rewrites and defaults for FoBo.init
Author: karma4u101
Created: 2012-02-06 12:54:55+00:00
State: open
Labels: Improvement

In bootstrap.liftweb.Boot.Boot do something like this
//Set rules, defaults are provided so no need to set the rules if you always will use the latest versions
FoBoRules.jquery = JQuery141 || JQuery171 || ...
FoBoRules.toolkit = FoBo010 || FoBo020 || Foundation214 || Foundation215 || Bootstrap140 || Bootstrap200 || Blueprint101
//The init has to be present
Fobo.init()

In templates have something like this
link rel="stylesheet" type='text/css' href='/classpath/fobo/fobo.css' ||
link rel="stylesheet" type='text/css' href='/classpath/fobo/foundation.css' ||
link rel="stylesheet" type='text/css' href='/classpath/fobo/bootstrap.css' ||

Find a way to path rewrite to the actual css paths like
.../fobo.css ==>> /classpath/fobo/css/fobo-[version].css
.../bootstrap.css =>> /classpath/fobo/orgin/css/bootstrap-[version].css

Scripts
script type="text/javascript" src="/classpath/fobo/jquery.js"
script type="text/javascript" src="/classpath/fobo/bootstrap-twipsy.js"
script type="text/javascript" src="/classpath/fobo/bootstrap-dropdown.js"
script type="text/javascript" src="/classpath/fobo/bootstrap-popover.js"
script type="text/javascript" src="/classpath/fobo/bootstrap-scrollspy.js"

rewrite
../jquery.js ==>> /classpath/fobo/js/jquery-[version].js

In the fobo lift module have something like this
case ojbect FoBoJQueryArtifact {
def pathRewriter: PartialFunction[List[String], List[String]] = {
case "fobo" :: "jquery.js" :: Nil if Props.devMode => List("fobo","js","jquery-1.7.1.js") //default version
}
}

case ojbect FoBoToolkitArtifact {
def pathRewriter: PartialFunction[List[String], List[String]] = {
case "fobo" :: "bootstrap.css" :: Nil if Props.devMode => List("fobo","orgin","css","bootstrap-2.0.0.css") //default version
}
}

case object JQuery171 extends FoBoJQueryArtifact {
override def pathRewriter: PartialFunction[List[String], List[String]] = {
case "fobo" :: "jquery.js" :: Nil if Props.devMode => List("fobo","js","jquery-1.7.1.js")
// case "fobo" :: "jquery.js" :: Nil => List(fobo","js","jquery-1.7.1-min.js")
}
}

case object Bootstrap140 extends FoBoToolkitArtifact {
override def pathRewriter: PartialFunction[List[String], List[String]] = {
case "fobo" :: "bootstrap.css" :: Nil if Props.devMode => List("fobo","orgin","css","bootstrap-1.4.0.css")
}
}
:
: