Blame view

sources/apps/impressionist/js/layout.js 1.79 KB
42e4f8d60   Kload   add all apps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
  (function($){
  	var initLayout = function() {
  		var hash = window.location.hash.replace('#', '');
  		var currentTab = $('ul.navigationTabs a')
  							.bind('click', showTab)
  							.filter('a[rel=' + hash + ']');
  		if (currentTab.size() == 0) {
  			currentTab = $('ul.navigationTabs a:first');
  		}
  		showTab.apply(currentTab.get(0));
  		$('#colorpickerHolder').ColorPicker({flat: true});
  		$('#colorpickerHolder2').ColorPicker({
  			flat: true,
  			color: '#00ff00',
  			onSubmit: function(hsb, hex, rgb) {
  				$('#colorSelector2 div').css('backgroundColor', '#' + hex);
  			}
  		});
  		$('#colorpickerHolder2>div').css('position', 'absolute');
  		var widt = false;
  		$('#colorSelector2').bind('click', function() {
  			$('#colorpickerHolder2').stop().animate({height: widt ? 0 : 173}, 500);
  			widt = !widt;
  		});
  		$('#colorpickerField1, #colorpickerField2, #colorpickerField3').ColorPicker({
  			onSubmit: function(hsb, hex, rgb, el) {
  				$(el).val(hex);
  				$(el).ColorPickerHide();
  			},
  			onBeforeShow: function () {
  				$(this).ColorPickerSetColor(this.value);
  			}
  		})
  		.bind('keyup', function(){
  			$(this).ColorPickerSetColor(this.value);
  		});
  		$('#colorSelector').ColorPicker({
  			color: '#0000ff',
  			onShow: function (colpkr) {
  				$(colpkr).fadeIn(500);
  				return false;
  			},
  			onHide: function (colpkr) {
  				$(colpkr).fadeOut(500);
  				return false;
  			},
  			onChange: function (hsb, hex, rgb) {
  				$('#colorSelector div').css('backgroundColor', '#' + hex);
  			}
  		});
  	};
  	
  	var showTab = function(e) {
  		var tabIndex = $('ul.navigationTabs a')
  							.removeClass('active')
  							.index(this);
  		$(this)
  			.addClass('active')
  			.blur();
  		$('div.tab')
  			.hide()
  				.eq(tabIndex)
  				.show();
  	};
  	
  	EYE.register(initLayout, 'init');
  })(jQuery)