Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support media, rel & title attributes for link tag

  • Loading branch information...
commit b534f9ac495c75d34cd347ab400f2c3de62070d4 1 parent 0a564b6
Maas-Maarten Zeeman authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/support/z_lib_include.erl
9 src/support/z_lib_include.erl
View
@@ -59,12 +59,19 @@ tag1(Files, Args, Context) ->
true -> [<<"http://">>, z_context:hostname_port(Context), <<"/lib">>];
false -> <<"/lib">>
end,
+ TitleAttr = case proplists:get_value(title, Args) of
+ undefined -> [];
+ TitleValue -> [<<" title=\"">>, TitleValue, $"]
+ end,
+ MediaAttr = [<<" media=\"">>, proplists:get_value(media, Args, "all"), $"],
+ RelAttr = [<<" rel=\"">>, proplists:get_value(rel, Args, "stylesheet"), $"],
+
LinkElement = case CssPath of
[] ->
[];
_ ->
ModCss = newest(Css, {{1970,1,1},{12,0,0}}, Context),
- iolist_to_binary([ <<"<link href=\"">>, UrlPrefix, CssPath, ?SEP, integer_to_list(ModCss), <<".css\" type=\"text/css\" media=\"all\" rel=\"stylesheet\" />">>])
+ iolist_to_binary([ <<"<link href=\"">>, UrlPrefix, CssPath, ?SEP, integer_to_list(ModCss), <<".css\" type=\"text/css\"">>, MediaAttr, TitleAttr, RelAttr, $/, $>])
end,
ScriptElement = case JsPath of
[] ->
Please sign in to comment.
Something went wrong with that request. Please try again.