JS- und CSS-MenĂ¼s: Frame-Header vereinheitlicht
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 28 Dec 2012 12:25:46 +0000 (13:25 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 28 Dec 2012 12:25:46 +0000 (13:25 +0100)
SL/Layout/Javascript.pm
SL/Layout/V3.pm
css/kivitendo/frame_header [deleted symlink]
css/kivitendo/frame_header/header.css [new file with mode: 0644]
js/quicksearch_input.js [new file with mode: 0644]
templates/webpages/menu/menunew.html
templates/webpages/menu/menuv3.html

index 8d61609..f3a2f0f 100644 (file)
@@ -10,6 +10,14 @@ sub init_sub_layouts {
   [ SL::Layout::None->new ]
 }
 
+sub use_javascript {
+  my $self = shift;
+  qw(
+    js/quicksearch_input.js
+  ),
+  $self->SUPER::use_javascript(@_);
+}
+
 sub pre_content {
   &display
 }
index ab50ef1..cc28167 100644 (file)
@@ -18,6 +18,14 @@ sub use_stylesheet {
   $self->SUPER::use_stylesheet(@_);
 }
 
+sub use_javascript {
+  my $self = shift;
+  qw(
+    js/quicksearch_input.js
+  ),
+  $self->SUPER::use_javascript(@_);
+}
+
 sub pre_content {
   &render;
 }
diff --git a/css/kivitendo/frame_header b/css/kivitendo/frame_header
deleted file mode 120000 (symlink)
index d69ab7f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../lx-office-erp/frame_header/
\ No newline at end of file
diff --git a/css/kivitendo/frame_header/header.css b/css/kivitendo/frame_header/header.css
new file mode 100644 (file)
index 0000000..376cb1e
--- /dev/null
@@ -0,0 +1,33 @@
+#frame-header .frame-header-element a:link,
+#frame-header .frame-header-element a:visited,
+#frame-header .frame-header-element a:hover,
+#frame-header .frame-header-element a:active {
+  text-decoration: underline;
+}
+
+#frame-header {
+  text-align: center;
+  margin: 0;
+  padding: 0;
+  border: 0;
+  overflow: hidden;
+  width: 100%;
+  border-spacing: 0;
+  font-size: 12px;
+}
+
+#frame-header .frame-header-left {
+  float: left;
+}
+#frame-header .frame-header-right {
+  float: right;
+}
+
+#frame-header .frame-header-left,
+#frame-header .frame-header-center,
+#frame-header .frame-header-right  {
+  border-spacing: 0;
+  padding: 0;
+  font-family: verdana,arial,sans-serif;
+  vertical-align: middle;
+}
diff --git a/js/quicksearch_input.js b/js/quicksearch_input.js
new file mode 100644 (file)
index 0000000..055b5f3
--- /dev/null
@@ -0,0 +1,23 @@
+function on_keydown_quicksearch(element, event) {
+  var key;
+
+  if (window.event)
+    key = window.event.keyCode;   // IE
+  else
+    key = event.which;            // Firefox
+
+  if (key != 13)
+    return true;
+
+  var search_term = $(element);
+  var value       = search_term.val();
+  if (!value)
+    return true;
+
+  var url = "ct.pl?action=list_contacts&INPUT_ENCODING=utf-8&filter.status=active&search_term=" + encodeURIComponent(value);
+
+  search_term.val('');
+  window.location.href = url;
+
+  return false;
+}
index e92a83d..b940246 100644 (file)
@@ -15,21 +15,18 @@ $(clockon);
 
  <script type="text/javascript" src="js/dhtmlsuite/menu-for-applications.js"></script>
 
- <table id='js-header' class="menunew">
-  <tr>
-   <td>
-    &nbsp;
-    [<a href="login.pl?action=company_logo" target="_blank">[% 'new Window' | $T8 %]</a>]
-    &nbsp;
-    [<a href="JavaScript:top.print()">[% 'print' | $T8 %]</a>]
-   </td>
-   <td align="right" nowrap>
-    [[% 'User' | $T8 %]: [% HTML.escape(MYCONFIG.login) %] -
-    <a href="controller.pl?action=LoginScreen/logout" target="_top">[% 'logout' | $T8 %]</a>]
-    [% date %] <span id='clock_id' style='position:relative'></span>&nbsp;
-   </td>
-  </tr>
- </table>
+ <div id="frame-header">
+  <span class="frame-header-element frame-header-left">
+   [<a href="login.pl?action=company_logo" target="_blank">[% 'new Window' | $T8 %]</a>]
+   [<a href="JavaScript:top.print()">[% 'print' | $T8 %]</a>]
+   [[% 'Search contacts' | $T8 %] <input size="15" name="search_term" id="search_term" onkeydown="return on_keydown_quicksearch($('#search_term'), event)">]
+  </span>
+  <span class="frame-header-element frame-header-right">
+   [[% 'User' | $T8 %]: [% MYCONFIG.login | html %] -
+   <a href="controller.pl?action=LoginScreen/logout" target="_top">[% 'logout' | $T8 %]</a>]
+   [% date %] <span id='clock_id' style='position:relative'></span>&nbsp;
+  </span>
+ </div>
 
  <div id="main_menu_div"></div>
 
index 537ec9c..3798bdc 100644 (file)
@@ -1,31 +1,8 @@
 [%- USE T8 %]
 [% USE HTML %]
+ <script type="text/javascript" src="js/quicksearch_input.js"></script>
  <script type="text/javascript">
  <!--
-function on_keydown_quicksearch(e) {
-  var key;
-
-  if (window.event)
-    key = window.event.keyCode;   // IE
-  else
-    key = e.which;                // Firefox
-
-  if (key != 13)
-    return true;
-
-  var search_term = $("#search_term");
-  var value       = search_term.val();
-  if (!value)
-    return true;
-
-  var url = "ct.pl?action=list_contacts&INPUT_ENCODING=utf-8&filter.status=active&search_term=" + encodeURIComponent(value);
-
-  search_term.val('');
-  window.location.href = url;
-
-  return false;
-}
-
 function clockon() {
   var now = new Date();
   var h = now.getHours();
@@ -41,7 +18,7 @@ $(clockon);
  <span class="frame-header-element frame-header-left">
     [<a href="login.pl?action=company_logo" target="_blank">[% 'new Window' | $T8 %]</a>]
     [<a href="JavaScript:top.print()">[% 'print' | $T8 %]</a>]
-    [[% 'Search contacts' | $T8 %] <input size="15" name="search_term" id="search_term" onkeydown="return on_keydown_quicksearch(event)">]
+    [[% 'Search contacts' | $T8 %] <input size="15" name="search_term" id="search_term" onkeydown="return on_keydown_quicksearch($('#search_term'), event)">]
  </span>
  <span class="frame-header-element frame-header-right">
     [[% 'User' | $T8 %]: [% MYCONFIG.login | html %] -