-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making changes to js,css can be painful with a packaged jar since a compilation is needed to repackage any new changes. This change allows for the paths to the static resources to be configured at runtime. While developing locally, you can then set the prefix to bypass the jar and the browser will resolve it on your local filesystem. Author: @franklinhu Fixes #112 URL: #112
- Loading branch information
Franklin Hu
committed
Aug 14, 2012
1 parent
90f6772
commit 4fc612b
Showing
7 changed files
with
139 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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
36 changes: 6 additions & 30 deletions
36
zipkin-finatra/src/main/resources/templates/layouts/application.mustache
This file contains 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
31 changes: 31 additions & 0 deletions
31
zipkin-finatra/src/main/scala/com/twitter/zipkin/config/CssConfig.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright 2012 Twitter Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.twitter.zipkin.config | ||
|
||
class CssConfig extends StaticResourceConfig { | ||
val resourceType = "css" | ||
|
||
val remoteResources = Seq( | ||
"https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/ui-lightness/jquery-ui.css" | ||
) | ||
|
||
val localResources = Seq( | ||
"bootstrap.css", | ||
"bootstrap-responsive.css", | ||
"datepicker.css", | ||
"application.css" | ||
) | ||
} |
50 changes: 50 additions & 0 deletions
50
zipkin-finatra/src/main/scala/com/twitter/zipkin/config/JsConfig.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright 2012 Twitter Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.twitter.zipkin.config | ||
|
||
class JsConfig extends StaticResourceConfig { | ||
val resourceType = "js" | ||
|
||
lazy val remoteResources = Seq( | ||
"https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js", | ||
"https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js" | ||
) | ||
|
||
lazy val localResources = Seq( | ||
"bootstrap.js", | ||
"datepicker.js", | ||
"d3-2.9.1.js", | ||
"hogan-2.0.0.js", | ||
|
||
"zipkin.js", | ||
"zipkin-node.js", | ||
"zipkin-span.js", | ||
"zipkin-tree.js", | ||
"zipkin-annotation.js", | ||
"zipkin-config.js", | ||
"zipkin-filter-span.js", | ||
"zipkin-kv-annotation.js", | ||
"zipkin-lazy-tree.js", | ||
"zipkin-onebox.js", | ||
"zipkin-trace-dependency.js", | ||
"zipkin-trace-summary.js", | ||
|
||
"application.js", | ||
"application-index.js", | ||
"application-show.js", | ||
"application-static.js" | ||
) | ||
} |
31 changes: 31 additions & 0 deletions
31
zipkin-finatra/src/main/scala/com/twitter/zipkin/config/StaticResourceConfig.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright 2012 Twitter Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.twitter.zipkin.config | ||
|
||
trait StaticResourceConfig { | ||
val pathPrefix: String = "/public" | ||
|
||
val resourceType: String | ||
|
||
val remoteResources: Seq[String] | ||
|
||
val localResources: Seq[String] | ||
|
||
lazy val resources = remoteResources ++ | ||
localResources.map { r => | ||
"%s/%s/%s".format(pathPrefix, resourceType, r) | ||
} | ||
} |
This file contains 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
This file contains 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