ref: refs/heads/master
commit f3af03d680f86be167a49e56a7aeee9d5732e0ca
Author: Duncan Mac-Vicar P
Date: Thu Aug 13 15:35:40 2009 +0200
make the javascripts and css go to head section
---
.../systemtime/app/views/system_time/index.rhtml | 53 ++++++++++----------
webclient/app/views/layouts/main.rhtml | 3 +
2 files changed, 30 insertions(+), 26 deletions(-)
diff --git a/plugins/systemtime/app/views/system_time/index.rhtml b/plugins/systemtime/app/views/system_time/index.rhtml
index 26d4a70..e873fe0 100644
--- a/plugins/systemtime/app/views/system_time/index.rhtml
+++ b/plugins/systemtime/app/views/system_time/index.rhtml
@@ -1,31 +1,32 @@
<% if @permissions %>
- <link rel="stylesheet" href="/inc/smoothness/jquery.ui.custom.css" type="text/css" media="screen" title="default" charset="utf-8" />
-
- <% javascript_tag do -%>
- $(document).ready( function() {
- $(".datepicker").datepicker( { dateFormat: 'dd/mm/yy'} );
- });
- <% end -%>
-
- <!-- FIXME move javascript function outside of index -->
- <% javascript_tag do -%>
- function submitTime() {
- if (!$("#date_date")[0].value.match( /^\d{2}\/\d{2}\/\d{4}$/)){
- alert ("<%= _("Invalid date format. Correct one is dd/mm/yyyy") %>");
- return false;
- }
- if (!$("#currenttime")[0].value.match( /^\d{2}:\d{2}:\d{2}$/)) {
- alert ("<%= _("Invalid time format. Correct one is hh:mm:ss") %>");
- return false;
- }
- Element.show('progress');
- return true;
- };
- <% end -%>
-
- <%= javascript_include_tag :defaults %>
- <% disabled = ! @permissions[:write] %>
+ <% content_for :head do %>
+ <link rel="stylesheet" href="/inc/smoothness/jquery.ui.custom.css" type="text/css" media="screen" title="default" charset="utf-8" />
+
+ <% javascript_tag do -%>
+ $(document).ready( function() {
+ $(".datepicker").datepicker( { dateFormat: 'dd/mm/yy'} );
+ });
+ <% end -%>
+
+ <!-- FIXME move javascript function outside of index -->
+ <% javascript_tag do -%>
+ function submitTime() {
+ if (!$("#date_date")[0].value.match( /^\d{2}\/\d{2}\/\d{4}$/)){
+ alert ("<%= _("Invalid date format. Correct one is dd/mm/yyyy") %>");
+ return false;
+ }
+ if (!$("#currenttime")[0].value.match( /^\d{2}:\d{2}:\d{2}$/)) {
+ alert ("<%= _("Invalid time format. Correct one is hh:mm:ss") %>");
+ return false;
+ }
+ Element.show('progress');
+ return true;
+ };
+ <% end -%>
+
+ <% end %>
+ <% disabled = ! @permissions[:write] %>
<div class='plugin-icon'><img src='/icons/yast-ntp-client.png' alt="time module"/></div>
<div class='plugin-content'>
diff --git a/webclient/app/views/layouts/main.rhtml b/webclient/app/views/layouts/main.rhtml
index a692f7d..88e0b3f 100644
--- a/webclient/app/views/layouts/main.rhtml
+++ b/webclient/app/views/layouts/main.rhtml
@@ -31,6 +31,9 @@
<script type="text/javascript" charset="utf-8" src="/inc/yast.widgets.js"></script>
<script type="text/javascript" charset="utf-8" src="/inc/yast.helpers.js"></script>
+ <!-- custom page scripts and css -->
+ <%= yield :head %>
+
<title>WebYaST</title>
</head>
<body id="shell" onload="">
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org