mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-20 10:11:00 +00:00
Big Cleanup
1) Removed unnecessary files 2) Trailling spaces (no all though) 3) Some space to tab conversion
This commit is contained in:
@@ -1,38 +1,38 @@
|
||||
function handleMove(element, dx, leftXLimit, rightXLimit)
|
||||
{
|
||||
var xStart = element.getStyle('left').toInt();
|
||||
|
||||
var xDest = xStart + dx;
|
||||
|
||||
|
||||
|
||||
var xDest = xStart + dx;
|
||||
|
||||
|
||||
|
||||
xDest = Math.min(xDest, rightXLimit);
|
||||
xDest = Math.max(xDest, leftXLimit);
|
||||
|
||||
|
||||
var nextStyle = 'block';
|
||||
if (xDest == leftXLimit) {
|
||||
nextStyle = 'none';
|
||||
}
|
||||
$$('#screenshots .next img').setStyle('display', nextStyle);
|
||||
|
||||
|
||||
var prevStyle = 'block';
|
||||
if (xDest == rightXLimit) {
|
||||
prevStyle = 'none';
|
||||
}
|
||||
$$('#screenshots .prev img').setStyle('display', prevStyle);
|
||||
|
||||
|
||||
element.lastDest = xDest;
|
||||
|
||||
if(element.fx == null){
|
||||
element.fx = new Fx.Morph(element, {duration: 'normal', transition: Fx.Transitions.Sine.easeInOut});
|
||||
}
|
||||
element.fx.start({
|
||||
'left': xDest
|
||||
'left': xDest
|
||||
});
|
||||
}
|
||||
|
||||
window.addEvent('domready', function() {
|
||||
|
||||
|
||||
//Overlay functions. Add FadeIN/OUT later.
|
||||
$$('div.overlay').addEvents({
|
||||
show: function() {
|
||||
@@ -42,25 +42,25 @@ window.addEvent('domready', function() {
|
||||
this.setStyle('display', 'none');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//Close Buttons
|
||||
$$('div.overlay .closer').addEvent('click', function(event) {
|
||||
event.stop();
|
||||
this.getParent('div.overlay').fireEvent('hide');
|
||||
});
|
||||
|
||||
|
||||
//Signup Buttons
|
||||
$$('.signup_link').addEvent('click', function(event) {
|
||||
event.stop();
|
||||
$('signup_layer').fireEvent('show');
|
||||
});
|
||||
|
||||
|
||||
//Login Buttons
|
||||
$$('.login_link').addEvent('click', function(event) {
|
||||
event.stop();
|
||||
$('login_layer').fireEvent('show');
|
||||
});
|
||||
|
||||
|
||||
//Login Buttons
|
||||
$$('#screenshot_list li a').each(function(item, index){
|
||||
item.addEvent('click', function(event) {
|
||||
@@ -70,7 +70,7 @@ window.addEvent('domready', function() {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
if ($('screenshot_list')) {
|
||||
$('screenshot_list').addEvents({
|
||||
moveRight: function() {
|
||||
@@ -88,89 +88,89 @@ window.addEvent('domready', function() {
|
||||
handleMove(this, -98, leftXLimit, rightXLimit);
|
||||
}
|
||||
});
|
||||
|
||||
$$('*.dynamic_img').addEvents({
|
||||
'mouseenter': function() {
|
||||
this.addClass('over');
|
||||
},
|
||||
'mouseleave': function() {
|
||||
this.removeClass('over');
|
||||
}
|
||||
});
|
||||
|
||||
$$('*.dynamic_btn').addEvents({
|
||||
'mouseenter': function() {
|
||||
this.addClass('over');
|
||||
},
|
||||
'mouseleave': function() {
|
||||
this.removeClass('over');
|
||||
this.removeClass('clicked');
|
||||
},
|
||||
'mousedown': function() {
|
||||
this.removeClass('over');
|
||||
this.addClass('clicked');
|
||||
},
|
||||
'mouseup': function() {
|
||||
this.removeClass('clicked');
|
||||
this.addClass('over');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$$('#screenshots .next').addEvent('click', function(e) {
|
||||
$('screenshot_list').fireEvent('moveLeft');
|
||||
});
|
||||
$$('#screenshots .prev').addEvent('click', function(e) {
|
||||
$('screenshot_list').fireEvent('moveRight');
|
||||
});
|
||||
|
||||
$$('*.dynamic_img').addEvents({
|
||||
'mouseenter': function() {
|
||||
this.addClass('over');
|
||||
},
|
||||
'mouseleave': function() {
|
||||
this.removeClass('over');
|
||||
}
|
||||
});
|
||||
|
||||
$$('*.dynamic_btn').addEvents({
|
||||
'mouseenter': function() {
|
||||
this.addClass('over');
|
||||
},
|
||||
'mouseleave': function() {
|
||||
this.removeClass('over');
|
||||
this.removeClass('clicked');
|
||||
},
|
||||
'mousedown': function() {
|
||||
this.removeClass('over');
|
||||
this.addClass('clicked');
|
||||
},
|
||||
'mouseup': function() {
|
||||
this.removeClass('clicked');
|
||||
this.addClass('over');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$$('#screenshots .next').addEvent('click', function(e) {
|
||||
$('screenshot_list').fireEvent('moveLeft');
|
||||
});
|
||||
$$('#screenshots .prev').addEvent('click', function(e) {
|
||||
$('screenshot_list').fireEvent('moveRight');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
t_minus();
|
||||
|
||||
|
||||
});
|
||||
|
||||
Fx.Screenshots = new Class({
|
||||
|
||||
Implements: [Events, Options],
|
||||
Implements: [Events, Options],
|
||||
|
||||
$current: 0,
|
||||
$length: 0,
|
||||
$current: 0,
|
||||
$length: 0,
|
||||
|
||||
initialize: function(image, headline, comment, elements){
|
||||
var self = this;
|
||||
initialize: function(image, headline, comment, elements){
|
||||
var self = this;
|
||||
|
||||
this.elements = elements;
|
||||
this.targetImg = $(image);
|
||||
this.targetHl = $(headline);
|
||||
this.targetDesc = $(comment);
|
||||
this.$length = this.elements.length;
|
||||
},
|
||||
this.elements = elements;
|
||||
this.targetImg = $(image);
|
||||
this.targetHl = $(headline);
|
||||
this.targetDesc = $(comment);
|
||||
this.$length = this.elements.length;
|
||||
},
|
||||
|
||||
showNext: function(){
|
||||
var index = this.$current + 1;
|
||||
if (index >= this.$length) index = 0;
|
||||
this.render(index);
|
||||
},
|
||||
showNext: function(){
|
||||
var index = this.$current + 1;
|
||||
if (index >= this.$length) index = 0;
|
||||
this.render(index);
|
||||
},
|
||||
|
||||
showPrev: function(){
|
||||
var index = this.$current - 1;
|
||||
if (index < 0) index = this.$length - 1;
|
||||
this.render(index);
|
||||
},
|
||||
showPrev: function(){
|
||||
var index = this.$current - 1;
|
||||
if (index < 0) index = this.$length - 1;
|
||||
this.render(index);
|
||||
},
|
||||
|
||||
show: function(num){
|
||||
this.render(num);
|
||||
return this;
|
||||
},
|
||||
show: function(num){
|
||||
this.render(num);
|
||||
return this;
|
||||
},
|
||||
|
||||
render: function(index){
|
||||
index = this.elements[index] != undefined ? index : 0;
|
||||
var elem = this.elements[index];
|
||||
this.targetImg.src = elem.img;
|
||||
this.targetHl.innerHTML = elem.hl;
|
||||
this.targetDesc.innerHTML = elem.desc;
|
||||
this.$current = index;
|
||||
}
|
||||
render: function(index){
|
||||
index = this.elements[index] != undefined ? index : 0;
|
||||
var elem = this.elements[index];
|
||||
this.targetImg.src = elem.img;
|
||||
this.targetHl.innerHTML = elem.hl;
|
||||
this.targetDesc.innerHTML = elem.desc;
|
||||
this.$current = index;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -179,21 +179,21 @@ Fx.Screenshots = new Class({
|
||||
function Popup(i, j, game_url)
|
||||
{
|
||||
var layer = $('iframe_layer');
|
||||
|
||||
|
||||
$('frame_box').empty();
|
||||
$('frame_box').innerHTML = "<iframe frameborder=\"0\" id=\"Frame\" src=\"" + game_url + "manual.php?typ=" + i + "&s=" + j + "\" width=\"412\" height=\"440\" border=\"0\"></iframe>";
|
||||
|
||||
|
||||
$('iframe_layer').fireEvent('show');
|
||||
|
||||
|
||||
var windowSize = window.getSize();
|
||||
|
||||
|
||||
if (windowSize.x < 700 || windowSize.y < 700) {
|
||||
$$('#iframe_layer .overlay_content').setStyle('position', 'absolute');
|
||||
return true;
|
||||
} else {
|
||||
$$('#iframe_layer .overlay_content').setStyle('position', 'fixed');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function t_minus()
|
||||
|
||||
Reference in New Issue
Block a user