Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Support media, rel & title attributes for link tag
  • Loading branch information
Maas-Maarten Zeeman committed May 9, 2011
1 parent 0a564b6 commit b534f9a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/support/z_lib_include.erl
Expand Up @@ -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
[] ->
Expand Down

0 comments on commit b534f9a

Please sign in to comment.