diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
commit | 972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch) | |
tree | 97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /bitbake/lib/toaster/toastergui/static/js/main.js | |
download | poky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js/main.js')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/main.js | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/main.js b/bitbake/lib/toaster/toastergui/static/js/main.js new file mode 100644 index 0000000000..eef6b468f4 --- /dev/null +++ b/bitbake/lib/toaster/toastergui/static/js/main.js | |||
@@ -0,0 +1,111 @@ | |||
1 | $(document).ready(function() { | ||
2 | |||
3 | /* | ||
4 | * PrettyPrint plugin. | ||
5 | * | ||
6 | */ | ||
7 | // Init | ||
8 | prettyPrint(); | ||
9 | |||
10 | // Prevent invalid links from jumping page scroll | ||
11 | $('a[href=#]').click(function() { | ||
12 | return false; | ||
13 | }); | ||
14 | |||
15 | |||
16 | /* Belen's additions */ | ||
17 | |||
18 | // turn Edit columns dropdown into a multiselect menu | ||
19 | $('.dropdown-menu input, .dropdown-menu label').click(function(e) { | ||
20 | e.stopPropagation(); | ||
21 | }); | ||
22 | |||
23 | // enable popovers in any table cells that contain an anchor with the | ||
24 | // .btn class applied, and make sure popovers work on click, are mutually | ||
25 | // exclusive and they close when your click outside their area | ||
26 | |||
27 | $('html').click(function(e){ | ||
28 | $('td > a.btn').popover('hide'); | ||
29 | }); | ||
30 | |||
31 | $('td > a.btn').popover({ | ||
32 | html:true, | ||
33 | placement:'left', | ||
34 | container:'body', | ||
35 | trigger:'manual' | ||
36 | }).click(function(e){ | ||
37 | $('td > a.btn').not(this).popover('hide'); | ||
38 | // ideally we would use 'toggle' here | ||
39 | // but it seems buggy in our Bootstrap version | ||
40 | $(this).popover('show'); | ||
41 | e.stopPropagation(); | ||
42 | }); | ||
43 | |||
44 | // enable tooltips for applied filters | ||
45 | $('th a.btn-primary').tooltip({container:'body', html:true, placement:'bottom', delay:{hide:1500}}); | ||
46 | |||
47 | // hide applied filter tooltip when you click on the filter button | ||
48 | $('th a.btn-primary').click(function () { | ||
49 | $('.tooltip').hide(); | ||
50 | }); | ||
51 | |||
52 | // enable help information tooltip | ||
53 | $(".get-help").tooltip({container:'body', html:true, delay:{show:300}}); | ||
54 | |||
55 | // show help bubble only on hover inside tables | ||
56 | $(".hover-help").css("visibility","hidden"); | ||
57 | $("th, td").hover(function () { | ||
58 | $(this).find(".hover-help").css("visibility","visible"); | ||
59 | }); | ||
60 | $("th, td").mouseleave(function () { | ||
61 | $(this).find(".hover-help").css("visibility","hidden"); | ||
62 | }); | ||
63 | |||
64 | // show task type and outcome in task details pages | ||
65 | $(".task-info").tooltip({ container: 'body', html: true, delay: {show: 200}, placement: 'right' }); | ||
66 | |||
67 | // linking directly to tabs | ||
68 | $(function(){ | ||
69 | var hash = window.location.hash; | ||
70 | hash && $('ul.nav a[href="' + hash + '"]').tab('show'); | ||
71 | |||
72 | $('.nav-tabs a').click(function (e) { | ||
73 | $(this).tab('show'); | ||
74 | $('body').scrollTop(); | ||
75 | }); | ||
76 | }); | ||
77 | |||
78 | // toggle for long content (variables, python stack trace, etc) | ||
79 | $('.full, .full-hide').hide(); | ||
80 | $('.full-show').click(function(){ | ||
81 | $('.full').slideDown(function(){ | ||
82 | $('.full-hide').show(); | ||
83 | }); | ||
84 | $(this).hide(); | ||
85 | }); | ||
86 | $('.full-hide').click(function(){ | ||
87 | $(this).hide(); | ||
88 | $('.full').slideUp(function(){ | ||
89 | $('.full-show').show(); | ||
90 | }); | ||
91 | }); | ||
92 | |||
93 | //toggle the errors and warnings sections | ||
94 | $('.show-errors').click(function() { | ||
95 | $('#collapse-errors').addClass('in'); | ||
96 | }); | ||
97 | $('.toggle-errors').click(function() { | ||
98 | $('#collapse-errors').toggleClass('in'); | ||
99 | }); | ||
100 | $('.show-warnings').click(function() { | ||
101 | $('#collapse-warnings').addClass('in'); | ||
102 | }); | ||
103 | $('.toggle-warnings').click(function() { | ||
104 | $('#collapse-warnings').toggleClass('in'); | ||
105 | }); | ||
106 | //show warnings section when requested from the previous page | ||
107 | if (location.href.search('#warnings') > -1) { | ||
108 | $('#collapse-warnings').addClass('in'); | ||
109 | } | ||
110 | |||
111 | }); | ||