Mercurial > hg > extraction-interface
annotate js/layout.js @ 117:e6b516fa7b60 extractapp
1. add new columns : book year and edition year.
2. remove duplicate column : time.
author | Calvin Yeh <cyeh@mpiwg-berlin.mpg.de> |
---|---|
date | Thu, 28 Sep 2017 17:45:30 +0200 |
parents | 886f43b26ee2 |
children |
rev | line source |
---|---|
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
1 (function($){ |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
2 var initLayout = function() { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
3 var hash = window.location.hash.replace('#', ''); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
4 var currentTab = $('ul.navigationTabs a') |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
5 .bind('click', showTab) |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
6 .filter('a[rel=' + hash + ']'); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
7 if (currentTab.size() == 0) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
8 currentTab = $('ul.navigationTabs a:first'); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
9 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
10 showTab.apply(currentTab.get(0)); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
11 $('#colorpickerHolder').ColorPicker({flat: true}); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
12 $('#colorpickerHolder2').ColorPicker({ |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
13 flat: true, |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
14 color: '#00ff00', |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
15 onSubmit: function(hsb, hex, rgb) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
16 $('#colorSelector2 div').css('backgroundColor', '#' + hex); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
17 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
18 }); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
19 $('#colorpickerHolder2>div').css('position', 'absolute'); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
20 var widt = false; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
21 $('#colorSelector2').bind('click', function() { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
22 $('#colorpickerHolder2').stop().animate({height: widt ? 0 : 173}, 500); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
23 widt = !widt; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
24 }); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
25 $('#colorpickerField1, #colorpickerField2, #colorpickerField3').ColorPicker({ |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
26 onSubmit: function(hsb, hex, rgb, el) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
27 $(el).val(hex); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
28 $(el).ColorPickerHide(); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
29 }, |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
30 onBeforeShow: function () { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
31 $(this).ColorPickerSetColor(this.value); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
32 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
33 }) |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
34 .bind('keyup', function(){ |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
35 $(this).ColorPickerSetColor(this.value); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
36 }); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
37 $('#colorSelector').ColorPicker({ |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
38 color: '#0000ff', |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
39 onShow: function (colpkr) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
40 $(colpkr).fadeIn(500); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
41 return false; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
42 }, |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
43 onHide: function (colpkr) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
44 $(colpkr).fadeOut(500); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
45 return false; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
46 }, |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
47 onChange: function (hsb, hex, rgb) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
48 $('#colorSelector div').css('backgroundColor', '#' + hex); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
49 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
50 }); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
51 }; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
52 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
53 var showTab = function(e) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
54 var tabIndex = $('ul.navigationTabs a') |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
55 .removeClass('active') |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
56 .index(this); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
57 $(this) |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
58 .addClass('active') |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
59 .blur(); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
60 $('div.tab') |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
61 .hide() |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
62 .eq(tabIndex) |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
63 .show(); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
64 }; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
65 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
66 EYE.register(initLayout, 'init'); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
67 })(jQuery) |