Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Side by Side Diff: static/js/main/main.js

Issue 58593002: chromium-status: add status field help text (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/chromium-status
Patch Set: fixup javascript/wrapping Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | status.py » ('j') | templates/main.html » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /*
6 * Code for the main user-visible status page.
7 */
8
9 window.onload = function() {
10 document.add_new_message.message.focus();
11 help_init();
12 }
13
14 /*
15 * Functions for managing the help text.
16 */
17
18 function help_init() {
19 // Set up the help text logic.
20 var message = document.add_new_message.message;
21 message.onmouseover = help_show;
22 message.onmousemove = help_show;
23 message.onmouseout = help_hide;
24 message.onkeypress = auto_submit;
25
26 var help = document.getElementById('help');
27 help.onmouseover = help_show;
28 help.onmouseout = help_hide;
29 }
30
31 function help_show() {
32 var message = document.add_new_message.message;
33 var help = document.getElementById('help');
34 help.style.left = message.offsetLeft + 'px';
35 help.style.top = message.offsetTop + message.offsetHeight + 'px';
36 help.hidden = false;
37 }
38
39 function help_hide() {
40 var help = document.getElementById('help');
41 help.hidden = true;
42 }
43
44 /*
45 * Misc functions.
46 */
47
48 // Used by the status field.
49 function auto_submit(e) {
50 if (!e.shiftKey && e.keyCode == 13) {
51 // Catch the enter key in the textarea. Allow shift+enter to work
52 // so people editing a lot of text can play around with things.
53 var form = document.getElementsByName('add_new_message')[0]
54 form.submit();
55 return false;
56 }
57 return true;
58 }
OLDNEW
« no previous file with comments | « no previous file | status.py » ('j') | templates/main.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698