Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[enhance] bootstrap: import responsive css if version >= 2.0.0 + chan…

…ged the directory hierarchy + doc
  • Loading branch information...
commit e440bc31d5ee11bb5f7b0bf5383a10a4567fc5c6 1 parent e1d6b6a
@Aqua-Ye Aqua-Ye authored
View
62 stdlib/themes/bootstrap/core/core.opa
@@ -18,30 +18,6 @@
/*Author: Ida Swarczewskaja, MLstate */
-/**
- * {1 About this module}
- * This module allows you to use Twitter's bootstrap style (http://twitter.github.com/bootstrap/) directly in your application.
- * It also includes several sets of icons.
- *
- * {2 Where should I start}
- * If you want to use the legacy version (1.1.1), just import this package.
- * Otherwise, call : Bootstrap.import(A_CERTAIN_VERSION) before launching your server.
- * /!\ We do not check if the version you gave is correct or not /!\
- *
- * {3 How to use icons}
- * There are different sizes:
- * - to use 16x16 pixels icon, set class "icon"
- * - to use 32x32 pixels icon, set class "icon32"
- * There are different colors:
- * - gray is the default
- * - to use black color, set class "icon-white"
- * - to use white color, set class "icon-black"
- * There are different icons:
- * - triangle (icon-triangle-n,icon-triangle-e, ...)
- * - arrow (icon-arrow-n, icon-arrowthick-n, icon-arrowreturn-se, ...)
- * - icon-plus, icon-minus, icon-close, icon-check, icon-help, icon-notice ...
- */
-
/* Publish resources */
@private
@@ -582,11 +558,37 @@ icon32 = css
_ = Client_code.register_css_declaration([icon16,icon32])
+/**
+ * {1 About this module}
+ *
+ * This module allows you to use Twitter's Bootstrap style (http://twitter.github.com/bootstrap/) directly in your application.
+ * It also includes several sets of icons.
+ *
+ * {1 Where should I start}
+ *
+ * If you want to use the latest version, just import this package (stdlib.themes.bootstrap).
+ * Otherwise, import stdlib.themes.bootstrap.v{X.Y.Z}.
+ * /!\ If the version you are looking for is not embed in Opa, it will reference GitHub's URL.
+ *
+ * {1 How to use icons}
+ *
+ * There are different sizes:
+ * - to use 16x16 pixels icon, set class "icon"
+ * - to use 32x32 pixels icon, set class "icon32"
+ * There are different colors:
+ * - gray is the default
+ * - to use black color, set class "icon-white"
+ * - to use white color, set class "icon-black"
+ * There are different icons:
+ * - triangle (icon-triangle-n,icon-triangle-e, ...)
+ * - arrow (icon-arrow-n, icon-arrowthick-n, icon-arrowreturn-se, ...)
+ * - icon-plus, icon-minus, icon-close, icon-check, icon-help, icon-notice ...
+ */
Bootstrap = {{
@private
compute_version_url(v:string) =
- if String.le(v, "1.2.0") then
+ if String.le(v, "1.2.0") then // Does not work
"https://raw.github.com/twitter/bootstrap/v{v}/bootstrap-{v}.min.css"
else if String.le(v, "1.4.0") then
"http://twitter.github.com/bootstrap/{v}/bootstrap.min.css"
@@ -618,11 +620,13 @@ Bootstrap = {{
url(v:string) =
Map.get("stdlib/themes/bootstrap/css/{v}/bootstrap.min.css", uri_css) ?
- compute_version_url(v)
+ compute_version_url(v) // fallback
import(v:string) =
- Resource.register_external_css(
- url(v)
- )
+ do Resource.register_external_css(url(v))
+ if String.lt(v, "2.0.0") then void
+ else match Map.get("stdlib/themes/bootstrap/css/{v}/bootstrap-responsive.min.css", uri_css)
+ {some=url} -> Resource.register_external_css(url)
+ {none} -> void
}}
View
24 stdlib/themes/bootstrap/latest.opa
@@ -18,30 +18,6 @@
/*Author: Ida Swarczewskaja, MLstate */
-/**
- * {1 About this module}
- * This module allows you to use Twitter's bootstrap style (http://twitter.github.com/bootstrap/) directly in your application.
- * It also includes several sets of icons.
- *
- * {2 Where should I start}
- * If you want to use the latest version, just import this package (stdlib.themes.bootstrap).
- * Otherwise, import stdlib.themes.bootstrap.v{X_Y_Z}.
- * /!\ If the version you are looking for is not embed in Opa, it will reference GitHub's URL.
- *
- * {3 How to use icons}
- * There are different sizes:
- * - to use 16x16 pixels icon, set class "icon"
- * - to use 32x32 pixels icon, set class "icon32"
- * There are different colors:
- * - gray is the default
- * - to use black color, set class "icon-white"
- * - to use white color, set class "icon-black"
- * There are different icons:
- * - triangle (icon-triangle-n,icon-triangle-e, ...)
- * - arrow (icon-arrow-n, icon-arrowthick-n, icon-arrowreturn-se, ...)
- * - icon-plus, icon-minus, icon-close, icon-check, icon-help, icon-notice ...
- */
-
import stdlib.themes.bootstrap.core
do Bootstrap.import("2.0.1")
View
0  stdlib/themes/bootstrap/v1_1_1/style.opa → stdlib/themes/bootstrap/v1/1/1/style.opa
File renamed without changes
View
30 stdlib/themes/bootstrap/v1/2/0/style.opa
@@ -0,0 +1,30 @@
+/*
+ Copyright © 2011, 2012 MLstate
+
+ This file is part of OPA.
+
+ OPA is free software: you can redistribute it and/or modify it under the
+ terms of the GNU Affero General Public License, version 3, as published by
+ the Free Software Foundation.
+
+ OPA is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
+ more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with OPA. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/*Author: Ida Swarczewskaja, MLstate */
+
+/**
+ * {1 About this module}
+ * This module allows you to use version 1.2.0 of Twitter's Bootstrap style
+ * (http://twitter.github.com/bootstrap/) directly in your application.
+ * It also includes several sets of icons.
+ */
+
+import stdlib.themes.bootstrap.core
+
+do Bootstrap.import("1.2.0")
View
0  stdlib/themes/bootstrap/v1_3_0/style.opa → stdlib/themes/bootstrap/v1/3/0/style.opa
File renamed without changes
View
0  stdlib/themes/bootstrap/v1_4_0/style.opa → stdlib/themes/bootstrap/v1/4/0/style.opa
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.