Initial commit
This commit is contained in:
commit
d7619777af
915 changed files with 59386 additions and 0 deletions
23
scripts/7_nieaktywni.user.js
Normal file
23
scripts/7_nieaktywni.user.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// ==UserScript==
|
||||
// @name Nieaktywni
|
||||
// @namespace Ktoska
|
||||
// @description Nieaktywni w galaktyce , podswietlanie
|
||||
// @include http://*ogame*.*/galaxy.php*
|
||||
// ==/UserScript==
|
||||
|
||||
var allElements, thisElement;
|
||||
allElements = document.getElementsByTagName('span');
|
||||
for (var i = 0; i < allElements.length; i++) {
|
||||
thisElement = allElements[i];
|
||||
if (thisElement.className.substring(0,8)=='inactive')
|
||||
{
|
||||
thisElement.style.color = "red";
|
||||
}
|
||||
if (thisElement.className.substring(0,12)=='longinactive')
|
||||
{
|
||||
thisElement.style.color = "maroon";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
64
scripts/chat.js
Normal file
64
scripts/chat.js
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
// Définition du pseudo
|
||||
var nick="<?php print $nick; ?>";
|
||||
var nick=nick.replace(/\+/,"plus");
|
||||
|
||||
// Scrolling automatique
|
||||
function descendreTchat(){
|
||||
var elDiv =document.getElementById('shoutbox');
|
||||
elDiv.scrollTop = elDiv.scrollHeight-elDiv.offsetHeight;
|
||||
}
|
||||
|
||||
// Ajout de message
|
||||
function addMessage(){
|
||||
var x_object = null;
|
||||
if(window.XMLHttpRequest){
|
||||
x_object = new XMLHttpRequest();
|
||||
}else if(window.ActiveXObject){
|
||||
x_object = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}else{
|
||||
alert('AJAX Error');
|
||||
return;
|
||||
}
|
||||
x_object.open("POST","chat_add.php",true);
|
||||
x_object.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
msg.value=msg.value.replace(/\+/g,"plus");
|
||||
x_object.send("nick="+nick+"&msg="+msg.value);
|
||||
msg.value = "";
|
||||
showMessage();
|
||||
}
|
||||
|
||||
// Affichage des messages
|
||||
function showMessage(){
|
||||
var x_object2 = null;
|
||||
if(window.XMLHttpRequest){
|
||||
x_object2 = new XMLHttpRequest();
|
||||
}else if(window.ActiveXObject){
|
||||
x_object2 = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}else{
|
||||
alert('AJAX Error');
|
||||
return;
|
||||
}
|
||||
x_object2.open("POST","chat_msg.php",true);
|
||||
x_object2.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
x_object2.send(null);
|
||||
|
||||
x_object2.onreadystatechange = function(){
|
||||
if(x_object2.readyState==4){
|
||||
if(x_object2.status==200){
|
||||
document.getElementById('shoutbox').innerHTML = x_object2.responseText;
|
||||
descendreTchat();
|
||||
Layer1.style.visibility="hidden";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Raccourcis des smileys
|
||||
function addSmiley(smiley){
|
||||
msg.value=msg.value+smiley;
|
||||
msg.focus();
|
||||
}
|
||||
|
||||
// Intervalle entre les messages
|
||||
setInterval(showMessage,3000);
|
||||
32
scripts/cnt.js
Normal file
32
scripts/cnt.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
var pp;
|
||||
|
||||
function t() {
|
||||
v = new Date();
|
||||
var btc = document.getElementById('btc');
|
||||
n = new Date();
|
||||
ss = pp;
|
||||
s = ss - Math.round((n.getTime() - v.getTime()) / 1000.);
|
||||
m = 0;
|
||||
h = 0;
|
||||
if ( s < 0 ) {
|
||||
btc.innerHTML = "Terminé<br>" + "<a href=?cp=" + pl + ">Continuer</a>"
|
||||
} else {
|
||||
if ( s > 59 ) {
|
||||
m = Math.floor( s / 60 );
|
||||
s = s - m * 60
|
||||
}
|
||||
if ( m > 59 ) {
|
||||
h = Math.floor( m / 60 );
|
||||
m = m - h * 60
|
||||
}
|
||||
if ( s < 10 ) {
|
||||
s = "0" + s
|
||||
}
|
||||
if ( m < 10 ) {
|
||||
m = "0" + m
|
||||
}
|
||||
btc.innerHTML = h + ":" + m + ":" + s + "<br><a href=" + ps + "?cmd=" + pk + "&cp=" + pl + ">Annuler</a>"
|
||||
}
|
||||
pp = pp - 1;
|
||||
window.setTimeout("t();", 999);
|
||||
}
|
||||
14
scripts/cntchar.js
Normal file
14
scripts/cntchar.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
var x = "";
|
||||
var e = null;
|
||||
|
||||
function cntchar(m) {
|
||||
if(window.document.forms[0].text.value.length > m) {
|
||||
window.document.forms[0].text.value = x;
|
||||
} else {
|
||||
x = window.document.forms[0].text.value;
|
||||
}
|
||||
if(e == null)
|
||||
e = document.getElementById('cntChars');
|
||||
else
|
||||
e.childNodes[0].data = window.document.forms[0].text.value.length;
|
||||
}
|
||||
31
scripts/cntfe.js
Normal file
31
scripts/cntfe.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
function tfe(){
|
||||
v=new Date();
|
||||
var bxxfe=document.getElementById('bxxfe');
|
||||
n=new Date();
|
||||
ssfe=ppfe;
|
||||
ssse=ssfe-Math.round((n.getTime()-v.getTime())/1000.);
|
||||
me=0;he=0;
|
||||
if(ssse<0){
|
||||
//ps como session :P
|
||||
bxxfe.innerHTML="-"
|
||||
}else{
|
||||
if(ssse>59){
|
||||
me=Math.floor(ssse/60);
|
||||
ssse=ssse-me*60
|
||||
}
|
||||
if(me>59){
|
||||
he=Math.floor(me/60);
|
||||
me=me-he*60
|
||||
}
|
||||
if(ssse<10){
|
||||
ssse="0"+ssse
|
||||
}
|
||||
if(me<10){
|
||||
me="0"+me
|
||||
}
|
||||
bxxfe.innerHTML=he+":"+me+":"+ssse
|
||||
}
|
||||
ppfe=ppfe-1;
|
||||
window.setTimeout("tfe();",999);
|
||||
|
||||
}
|
||||
31
scripts/cntfs.js
Normal file
31
scripts/cntfs.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
function tfs(){
|
||||
v=new Date();
|
||||
var bxxfs=document.getElementById('bxxfs');
|
||||
n=new Date();
|
||||
ssfs=ppfs;
|
||||
sss=ssfs-Math.round((n.getTime()-v.getTime())/1000.);
|
||||
ms=0;hs=0;
|
||||
if(sss<0){
|
||||
//ps como session :P
|
||||
bxxfs.innerHTML="-"
|
||||
}else{
|
||||
if(sss>59){
|
||||
ms=Math.floor(sss/60);
|
||||
sss=sss-ms*60
|
||||
}
|
||||
if(ms>59){
|
||||
hs=Math.floor(ms/60);
|
||||
ms=ms-hs*60
|
||||
}
|
||||
if(sss<10){
|
||||
sss="0"+sss
|
||||
}
|
||||
if(ms<10){
|
||||
ms="0"+ms
|
||||
}
|
||||
bxxfs.innerHTML=hs+":"+ms+":"+sss
|
||||
}
|
||||
ppfs=ppfs-1;
|
||||
window.setTimeout("tfs();",999);
|
||||
|
||||
}
|
||||
32
scripts/cntneu.js
Normal file
32
scripts/cntneu.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
function t(){
|
||||
v=new Date();
|
||||
var bxx=document.getElementById('bxx');
|
||||
n=new Date();
|
||||
ss=pp;
|
||||
s=ss-Math.round((n.getTime()-v.getTime())/1000.);
|
||||
m=0;h=0;
|
||||
if(s<0){
|
||||
bxx.innerHTML="Uko<6B>czono<br>"+"<a href=b_building.php?session="+ps+"&cp="+pl+">Dalej</a>";
|
||||
document.location.href="b_building.php?session="+ps+"&cp="+pl;
|
||||
}else{
|
||||
if(s>59){
|
||||
m=Math.floor(s/60);
|
||||
s=s-m*60
|
||||
}
|
||||
if(m>59){
|
||||
h=Math.floor(m/60);
|
||||
m=m-h*60
|
||||
}
|
||||
if(s<10){
|
||||
s="0"+s
|
||||
}
|
||||
if(m<10){
|
||||
m="0"+m
|
||||
}
|
||||
bxx.innerHTML=h+":"+m+":"+s+"<br><a href=b_building.php?session="+ps+"&unbau="+pk+"&cp="+pl+">Przerwij</a>"
|
||||
}
|
||||
pp=pp-1;
|
||||
window.setTimeout("t();",999);
|
||||
|
||||
}
|
||||
|
||||
36
scripts/cntneu2.js
Normal file
36
scripts/cntneu2.js
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
function tt(){
|
||||
v = new Date();
|
||||
n = new Date();
|
||||
o = new Date();
|
||||
//for (cn = 1; cn <= anz; cn++) {
|
||||
bxx = document.getElementById('bxy');
|
||||
ss = bxx.title;
|
||||
s = ss - Math.round((n.getTime() - v.getTime()) / 1000.);
|
||||
m = 0;
|
||||
h = 0;
|
||||
if (s < 0) {
|
||||
bxx.innerHTML = "-";
|
||||
} else {
|
||||
if (s > 59) {
|
||||
m = Math.floor(s/60);
|
||||
s = s - m * 60;
|
||||
}
|
||||
if (m > 59) {
|
||||
h = Math.floor(m / 60);
|
||||
m = m - h * 60;
|
||||
}
|
||||
if (s < 10) {
|
||||
s = "0" + s;
|
||||
}
|
||||
if (m < 10) {
|
||||
m = "0" + m;
|
||||
}
|
||||
bxx.innerHTML = h + ":" + m + ":" + s + "";
|
||||
}
|
||||
bxx.title = bxx.title - 1;
|
||||
//}
|
||||
window.setTimeout("tt();", 999);
|
||||
|
||||
|
||||
}
|
||||
|
||||
307
scripts/createbanner.php
Normal file
307
scripts/createbanner.php
Normal file
|
|
@ -0,0 +1,307 @@
|
|||
<?php
|
||||
/**
|
||||
* XNova Legacies
|
||||
*
|
||||
* @license http://www.xnova-ng.org/license-legacies
|
||||
* @see http://www.xnova-ng.org/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* - Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* - Neither the name of the team or any contributor may be used to endorse or
|
||||
* promote products derived from this software without specific prior written
|
||||
* permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* --> NOTICE <--
|
||||
* This file is part of the core development branch, changing its contents will
|
||||
* make you unable to use the automatic updates manager. Please refer to the
|
||||
* documentation for further information about customizing XNova.
|
||||
*
|
||||
*/
|
||||
|
||||
define('FONT_FILE', dirname(__FILE__) . '/resources/fonts/visitor/visitor.ttf');
|
||||
define('BACKGROUND_FILE', dirname(__FILE__) . '/resources/backgrounds/default.png');
|
||||
define('TIMEZONE', 'Europe/Paris');
|
||||
|
||||
date_default_timezone_set(TIMEZONE);
|
||||
|
||||
require_once dirname(dirname(__FILE__)) . '/db/mysql.php';
|
||||
|
||||
/**
|
||||
*
|
||||
* @todo Update the position alignment management.
|
||||
* @author Greg
|
||||
*
|
||||
*/
|
||||
class Legacies_Block_Image_Png
|
||||
{
|
||||
private $_format = NULL;
|
||||
private $_mime = NULL;
|
||||
|
||||
const COLOR_RED = 'red';
|
||||
const COLOR_GREEN = 'green';
|
||||
const COLOR_BLUE = 'blue';
|
||||
|
||||
const POSITION_LEFT = 0x01;
|
||||
const POSITION_RIGHT = 0x02;
|
||||
const POSITION_CENTER = 0x03;
|
||||
|
||||
const POSITION_TOP = 0x10;
|
||||
const POSITION_BOTTOM = 0x20;
|
||||
const POSITION_MIDDLE = 0x30;
|
||||
|
||||
const POSITION_DEFAULT = 0x11;
|
||||
|
||||
private $_texts = array();
|
||||
private $_background = NULL;
|
||||
private $_font = NULL;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_setMime('image/png');
|
||||
$this->_setFormat('png');
|
||||
}
|
||||
|
||||
protected function _getFormat()
|
||||
{
|
||||
return $this->_format;
|
||||
}
|
||||
|
||||
protected function _setFormat($format)
|
||||
{
|
||||
$this->_format = $format;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function _getMime()
|
||||
{
|
||||
return $this->_mime;
|
||||
}
|
||||
|
||||
protected function _setMime($mime)
|
||||
{
|
||||
$this->_mime = $mime;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHeaders()
|
||||
{
|
||||
return array(
|
||||
'Content-Type' => $this->_getMime()
|
||||
);
|
||||
}
|
||||
|
||||
public function addText($content, $fontSize, $fontFile, $positionAbscix, $positionOrdinates, $angle, Array $color, $alignment = self::POSITION_DEFAULT)
|
||||
{
|
||||
$this->_texts[] = array(
|
||||
'content' => $content,
|
||||
'color' => $color,
|
||||
'sizes' => $this->_getTextPositions($content, $fontSize, $fontFile, $positionAbscix, $positionOrdinates, $angle, $alignment),
|
||||
'font_size' => $fontSize,
|
||||
'font_file' => $fontFile,
|
||||
);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function _getTextPositions($textContent, $fontSize, $fontFile, $positionAbscix, $positionOrdinates, $angle = 0, $alignment = self::POSITION_DEFAULT)
|
||||
{
|
||||
$dimensions = imageFtbBox($fontSize, $angle, $fontFile, $textContent);
|
||||
$width = $dimensions[2] - $dimensions[0];
|
||||
$height = $dimensions[1] - $dimensions[7];
|
||||
|
||||
switch ($alignment & 0x7) {
|
||||
case self::POSITION_CENTER:
|
||||
$positionAbscix -= ceil($width / 2);
|
||||
break;
|
||||
|
||||
case self::POSITION_RIGHT:
|
||||
$positionAbscix -= $width;
|
||||
break;
|
||||
|
||||
case self::POSITION_LEFT:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($alignment & 0x70) {
|
||||
case self::POSITION_MIDDLE:
|
||||
$positionOrdinates -= ceil($height / 2);
|
||||
break;
|
||||
|
||||
case self::POSITION_TOP:
|
||||
$positionOrdinates -= $height;
|
||||
break;
|
||||
|
||||
case self::POSITION_BOTTOM:
|
||||
default:
|
||||
$width = 0;
|
||||
$height = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return array(
|
||||
'abscix' => $positionAbscix,
|
||||
'ordinate' => $positionOrdinates,
|
||||
'alignment' => $alignment,
|
||||
'width' => $width,
|
||||
'height' => $height,
|
||||
'angle' => $angle
|
||||
);
|
||||
}
|
||||
|
||||
public function setBackground($backgroundImage)
|
||||
{
|
||||
$this->_background = $backgroundImage;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setFont($fontFile)
|
||||
{
|
||||
$this->_font = $fontFile;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
ob_start();
|
||||
if (!is_null($this->_background)) {
|
||||
$gdHandler = imageCreateFromPng($this->_background);
|
||||
} else {
|
||||
$gdHandler = imageCreateTrueColor();
|
||||
}
|
||||
|
||||
foreach ($this->_texts as $text) {
|
||||
$color = imageColorAllocate(
|
||||
$gdHandler,
|
||||
$text['color'][self::COLOR_RED],
|
||||
$text['color'][self::COLOR_GREEN],
|
||||
$text['color'][self::COLOR_BLUE]
|
||||
);
|
||||
|
||||
switch ($text['sizes']['alignment'] & 0x0F) {
|
||||
case self::POSITION_CENTER:
|
||||
$text['sizes']['abscix'] -= floor(imageSX($gdHandler) / 2);
|
||||
break;
|
||||
|
||||
case self::POSITION_RIGHT:
|
||||
$text['sizes']['abscix'] = imageSX($gdHandler) - ($text['sizes']['abscix'] + $text['sizes']['width']) -10;
|
||||
break;
|
||||
|
||||
case self::POSITION_LEFT:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
$imageText = imageTtfText(
|
||||
$gdHandler,
|
||||
$text['font_size'],
|
||||
$text['sizes']['angle'],
|
||||
$text['sizes']['abscix'],
|
||||
$text['sizes']['ordinate'],
|
||||
$color,
|
||||
$text['font_file'],
|
||||
$text['content']
|
||||
);
|
||||
}
|
||||
|
||||
imagePng($gdHandler);
|
||||
imageDestroy($gdHandler);
|
||||
|
||||
$imageData = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
return $imageData;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET['id'])) {
|
||||
$id = (int) $_GET['id'];
|
||||
} else {
|
||||
header('HTTP/1.1 412 Precondition Failed');
|
||||
die();
|
||||
}
|
||||
|
||||
$textColor = array(
|
||||
Legacies_Block_Image_Png::COLOR_RED => 0xEF,
|
||||
Legacies_Block_Image_Png::COLOR_GREEN => 0xEF,
|
||||
Legacies_Block_Image_Png::COLOR_BLUE => 0xEF
|
||||
);
|
||||
|
||||
$sql = <<<EOF
|
||||
SELECT
|
||||
users.username AS username,
|
||||
planets.name AS planet_name,
|
||||
stats.build_points AS build_points,
|
||||
stats.fleet_points AS fleet_points,
|
||||
stats.tech_points AS tech_points,
|
||||
stats.total_points AS total_points
|
||||
FROM {{table}}users AS users
|
||||
LEFT JOIN {{table}}statpoints AS stats ON stats.id_owner=users.id
|
||||
LEFT JOIN {{table}}planets AS planets ON planets.id_owner=users.id
|
||||
WHERE users.id={$id}
|
||||
EOF;
|
||||
|
||||
|
||||
$data = array_merge(
|
||||
array(
|
||||
'game_name' => 'XNova:Legacies',
|
||||
'date' => date('d M Y')
|
||||
),
|
||||
doquery($sql, '', true)
|
||||
);
|
||||
|
||||
function number_format_custom($number)
|
||||
{
|
||||
return number_format($number, 0, ',', '.');
|
||||
}
|
||||
|
||||
$image = new Legacies_Block_Image_Png();
|
||||
$image
|
||||
->setBackground(BACKGROUND_FILE)
|
||||
->addText($data['game_name'], 24, FONT_FILE, 5, 37, 0, $textColor)
|
||||
->addText($data['username'], 24, FONT_FILE, 250, 37, 0, $textColor)
|
||||
|
||||
->addText('Batiments:',
|
||||
14, FONT_FILE, 5, 50, 0, $textColor)
|
||||
->addText(number_format_custom($data['build_points']), 14, FONT_FILE, 100, 50, 0, $textColor)
|
||||
->addText('Flottes:', 14, FONT_FILE, 5, 70, 0, $textColor)
|
||||
->addText(number_format_custom($data['fleet_points']), 14, FONT_FILE, 100, 70, 0, $textColor)
|
||||
|
||||
->addText('Technologies:', 14, FONT_FILE, 205, 50, 0, $textColor)
|
||||
->addText(number_format_custom($data['tech_points']), 14, FONT_FILE, 320, 50, 0, $textColor)
|
||||
->addText('Total:', 14, FONT_FILE, 205, 70, 0, $textColor)
|
||||
->addText(number_format_custom($data['total_points']), 14, FONT_FILE, 320, 70, 0, $textColor)
|
||||
;
|
||||
|
||||
foreach ($image->getHeaders() as $headerName => $headerValue) {
|
||||
header(sprintf('%s: %s', $headerName, $headerValue));
|
||||
}
|
||||
|
||||
echo $image->render();
|
||||
31
scripts/cst.js
Normal file
31
scripts/cst.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
function t(){
|
||||
v=new Date();
|
||||
var bxx=document.getElementById('bxx');
|
||||
n=new Date();
|
||||
ss=pp;
|
||||
s=ss-Math.round((n.getTime()-v.getTime())/1000.);
|
||||
m=0;h=0;
|
||||
if(s<0){
|
||||
//ps como session :P
|
||||
bxx.innerHTML="Koniec<br>"+"<a href=?cp="+pl+">kontynuuj</a>"
|
||||
}else{
|
||||
if(s>59){
|
||||
m=Math.floor(s/60);
|
||||
s=s-m*60
|
||||
}
|
||||
if(m>59){
|
||||
h=Math.floor(m/60);
|
||||
m=m-h*60
|
||||
}
|
||||
if(s<10){
|
||||
s="0"+s
|
||||
}
|
||||
if(m<10){
|
||||
m="0"+m
|
||||
}
|
||||
bxx.innerHTML=h+":"+m+":"+s+"<br><a href="+ps+"?unbau="+pk+"&cp="+pl+">Anuluj</a>"
|
||||
}
|
||||
pp=pp-1;
|
||||
window.setTimeout("t();",999);
|
||||
|
||||
}
|
||||
638
scripts/flotten.js
Normal file
638
scripts/flotten.js
Normal file
|
|
@ -0,0 +1,638 @@
|
|||
function speed() {
|
||||
var sp;
|
||||
sp = document.getElementsByName("speed")[0].value;
|
||||
|
||||
return(sp);
|
||||
}
|
||||
|
||||
function target() {
|
||||
var galaxy;
|
||||
var system;
|
||||
var planet;
|
||||
|
||||
galaxy = document.getElementsByName("galaxy")[0].value;
|
||||
system = document.getElementsByName("system")[0].value;
|
||||
planet = document.getElementsByName("planet")[0].value;
|
||||
|
||||
return("["+galaxy+":"+system+":"+planet+"]");
|
||||
}
|
||||
|
||||
function setTarget(galaxy, solarsystem, planet, planettype) {
|
||||
document.getElementsByName('galaxy')[0].value = galaxy;
|
||||
document.getElementsByName('system')[0].value = solarsystem;
|
||||
document.getElementsByName('planet')[0].value = planet;
|
||||
document.getElementsByName('planettype')[0].value = planettype;
|
||||
}
|
||||
|
||||
function setMission(mission) {
|
||||
document.getElementsByName('order')[0].selectedIndex = mission;
|
||||
return;
|
||||
}
|
||||
|
||||
function setUnion(unionid) {
|
||||
document.getElementsByName('union2')[0].selectedIndex = unionid;
|
||||
}
|
||||
|
||||
function setTargetLong(galaxy, solarsystem, planet, planettype, mission, cnt) {
|
||||
setTarget(galaxy, solarsystem, planet, planettype);
|
||||
setMission(mission);
|
||||
setUnions(cnt);
|
||||
}
|
||||
|
||||
function min(a, b) {
|
||||
a = a * 1;
|
||||
b = b * 1;
|
||||
if (a > b) {
|
||||
return b;
|
||||
} else {
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
function maxspeed() {
|
||||
var msp = 1000000000;
|
||||
for (i = 200; i < 220; i++) {
|
||||
if (document.getElementsByName("ship" + i)[0]) {
|
||||
if ((document.getElementsByName("speed" + i)[0].value * 1) >= 1
|
||||
&& (document.getElementsByName("ship" + i)[0].value * 1) >= 1) {
|
||||
msp = min(msp, document.getElementsByName("speed" + i)[0].value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(msp);
|
||||
}
|
||||
|
||||
function distance() {
|
||||
var thisGalaxy;
|
||||
var thisSystem;
|
||||
var thisPlanet;
|
||||
|
||||
var targetGalaxy;
|
||||
var targetSystem;
|
||||
var targetPlanet;
|
||||
|
||||
var dist;
|
||||
|
||||
thisGalaxy = document.getElementsByName("thisgalaxy")[0].value;
|
||||
thisSystem = document.getElementsByName("thissystem")[0].value;
|
||||
thisPlanet = document.getElementsByName("thisplanet")[0].value;
|
||||
|
||||
targetGalaxy = document.getElementsByName("galaxy")[0].value;
|
||||
targetSystem = document.getElementsByName("system")[0].value;
|
||||
targetPlanet = document.getElementsByName("planet")[0].value;
|
||||
|
||||
dist = 0;
|
||||
if ((targetGalaxy - thisGalaxy) != 0) {
|
||||
dist = Math.abs(targetGalaxy - thisGalaxy) * 20000;
|
||||
} else if ((targetSystem - thisSystem) != 0) {
|
||||
dist = Math.abs(targetSystem - thisSystem) * 5 * 19 + 2700;
|
||||
} else if ((targetPlanet - thisPlanet) != 0) {
|
||||
dist = Math.abs(targetPlanet - thisPlanet) * 5 + 1000;
|
||||
} else {
|
||||
dist = 5;
|
||||
}
|
||||
|
||||
return(dist);
|
||||
}
|
||||
|
||||
function duration() {
|
||||
var speedfactor;
|
||||
|
||||
speedfactor = document.getElementsByName("speedfactor")[0].value;
|
||||
msp = maxspeed();
|
||||
sp = speed();
|
||||
dist = distance();
|
||||
|
||||
ret = Math.round(((35000 / sp * Math.sqrt(dist * 10 / msp) + 10) / speedfactor ));
|
||||
return ret;
|
||||
}
|
||||
|
||||
function consumption2() {
|
||||
var consumption;
|
||||
var basicConsumption = 0;
|
||||
|
||||
for (i = 200; i < 220; i++) {
|
||||
if (document.getElementsByName("ship" + i)[0]) {
|
||||
basicConsumption = basicConsumption +
|
||||
document.getElementsByName("consumption" + i)[0].value
|
||||
* document.getElementsByName("ship" + i)[0].value;
|
||||
}
|
||||
}
|
||||
|
||||
speedfactor = document.getElementsByName("speedfactor")[0].value;
|
||||
msp = maxspeed();
|
||||
sp = speed();
|
||||
dist = distance();
|
||||
|
||||
consumption = Math.round(basicConsumption * dist / 35000 * ((sp / 10) + 1) * ((sp / 10) + 1)) + 1;
|
||||
|
||||
return(consumption);
|
||||
}
|
||||
|
||||
function consumption() {
|
||||
var consumption = 0;
|
||||
var basicConsumption = 0;
|
||||
var values;
|
||||
var i;
|
||||
|
||||
msp = maxspeed();
|
||||
sp = speed();
|
||||
dist = distance();
|
||||
dur = duration();
|
||||
speedfactor = document.getElementsByName("speedfactor")[0].value;
|
||||
|
||||
for (i = 200; i < 220; i++) {
|
||||
if (document.getElementsByName("ship" + i)[0]) {
|
||||
shipspeed = document.getElementsByName("speed" + i)[0].value;
|
||||
spd = 35000 / (dur * speedfactor - 10) * Math.sqrt(dist * 10 / shipspeed);
|
||||
|
||||
//spd = Math.max(msp / document.getElementsByName("speed" + i)[0].value, 0.1);
|
||||
//spd = Math.min(spd, 1.0);
|
||||
//spd = spd * sp;
|
||||
//spd = 10;
|
||||
basicConsumption = document.getElementsByName("consumption" + i)[0].value
|
||||
* document.getElementsByName("ship" + i)[0].value;
|
||||
consumption += basicConsumption * dist / 35000 * ((spd / 10) + 1) * ((spd / 10) + 1);
|
||||
// values = values + " " + spd;
|
||||
}
|
||||
}
|
||||
|
||||
consumption = Math.round(consumption) + 1;
|
||||
|
||||
// document.write(values);
|
||||
|
||||
return(consumption);
|
||||
}
|
||||
|
||||
function probeConsumption() {
|
||||
var consumption = 0;
|
||||
var basicConsumption = 0;
|
||||
var values;
|
||||
var i;
|
||||
|
||||
msp = maxspeed();
|
||||
sp = speed();
|
||||
dist = distance();
|
||||
dur = duration();
|
||||
speedfactor = document.getElementsByName("speedfactor")[0].value;
|
||||
|
||||
|
||||
if (document.getElementsByName("ship210")[0]) {
|
||||
shipspeed = document.getElementsByName("speed210")[0].value;
|
||||
spd = 35000 / (dur * speedfactor - 10) * Math.sqrt(dist * 10 / shipspeed);
|
||||
|
||||
basicConsumption = document.getElementsByName("consumption210")[0].value
|
||||
* document.getElementsByName("ship210")[0].value;
|
||||
consumption += basicConsumption * dist / 35000 * ((spd / 10) + 1) * ((spd / 10) + 1);
|
||||
}
|
||||
|
||||
|
||||
consumption = Math.round(consumption) + 1;
|
||||
|
||||
// document.write(values);
|
||||
|
||||
return(consumption);
|
||||
}
|
||||
|
||||
function unusedProbeStorage() {
|
||||
|
||||
var storage = document.getElementsByName('capacity210')[0].value * document.getElementsByName('ship210')[0].value;
|
||||
var stor = storage - probeConsumption();
|
||||
return (stor>0)?stor:0;
|
||||
|
||||
}
|
||||
|
||||
function storage() {
|
||||
var storage = 0;
|
||||
|
||||
for (i = 200; i < 300; i++) {
|
||||
|
||||
if (document.getElementsByName("ship" + i)[0]) {
|
||||
if ((document.getElementsByName("ship" + i)[0].value * 1) >= 1) {
|
||||
storage
|
||||
+= document.getElementsByName("ship" + i)[0].value
|
||||
* document.getElementsByName("capacity" + i)[0].value
|
||||
}
|
||||
}
|
||||
}
|
||||
storage = storage * getStorageFaktor();
|
||||
storage -= consumption();
|
||||
if (document.getElementsByName("ship210")[0]) {
|
||||
storage -= unusedProbeStorage();
|
||||
}
|
||||
|
||||
return(storage);
|
||||
}
|
||||
|
||||
|
||||
function fleetInfo() {
|
||||
document.getElementById("speed").innerHTML = speed() * 10 + "%";
|
||||
document.getElementById("target").innerHTML = target();
|
||||
document.getElementById("distance").innerHTML = distance();
|
||||
|
||||
var seconds = duration();
|
||||
var hours = Math.floor(seconds / 3600);
|
||||
seconds -= hours * 3600;
|
||||
|
||||
var minutes = Math.floor(seconds / 60);
|
||||
seconds -= minutes * 60;
|
||||
|
||||
if (minutes < 10) minutes = "0" + minutes;
|
||||
if (seconds < 10) seconds = "0" + seconds;
|
||||
|
||||
document.getElementById("duration").innerHTML = hours + ":" + minutes + ":" + seconds + " h";
|
||||
|
||||
var stor = storage();
|
||||
var cons = consumption();
|
||||
document.getElementById("maxspeed").innerHTML = tsdpkt(maxspeed());
|
||||
if (stor >= 0) {
|
||||
document.getElementById("consumption").innerHTML = '<font color="lime">'+cons+'</font>';
|
||||
document.getElementById("storage").innerHTML = '<font color="lime">'+stor+'</font>';
|
||||
} else {
|
||||
document.getElementById("consumption").innerHTML = '<font color="red">'+cons+'</font>';
|
||||
document.getElementById("storage").innerHTML = '<font color="red">'+stor+'</font>';
|
||||
}
|
||||
calculateTransportCapacity();
|
||||
}
|
||||
|
||||
function shortInfo() {
|
||||
|
||||
document.getElementById("distance").innerHTML = tsdpkt(distance());
|
||||
var seconds = duration();
|
||||
var hours = Math.floor(seconds / 3600);
|
||||
seconds -= hours * 3600;
|
||||
|
||||
var minutes = Math.floor(seconds / 60);
|
||||
seconds -= minutes * 60;
|
||||
|
||||
if (minutes < 10) minutes = "0" + minutes;
|
||||
if (seconds < 10) seconds = "0" + seconds;
|
||||
|
||||
document.getElementById("duration").innerHTML = hours + ":" + minutes + ":" + seconds + " h";
|
||||
var stor = storage();
|
||||
var cons = consumption();
|
||||
|
||||
|
||||
document.getElementById("maxspeed").innerHTML = tsdpkt(maxspeed());
|
||||
if (stor >= 0) {
|
||||
document.getElementById("consumption").innerHTML = '<font color="lime">'+tsdpkt(cons)+'</font>';
|
||||
document.getElementById("storage").innerHTML = '<font color="lime">'+tsdpkt(stor)+'</font>';
|
||||
} else {
|
||||
document.getElementById("consumption").innerHTML = '<font color="red">'+tsdpkt(cons)+'</font>';
|
||||
document.getElementById("storage").innerHTML = '<font color="red">'+tsdpkt(stor)+'</font>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function setResource(id, val) {
|
||||
if (document.getElementsByName(id)[0]) {
|
||||
document.getElementsByName("resource" + id)[0].value = val;
|
||||
}
|
||||
}
|
||||
|
||||
function maxResource(id) {
|
||||
var thisresource = parseInt(document.getElementsByName("thisresource" + id)[0].value);
|
||||
var thisresourcechosen = parseInt(document.getElementsByName("resource" + id)[0].value);
|
||||
|
||||
if (isNaN(thisresourcechosen)){
|
||||
thisresourcechosen=0;
|
||||
}
|
||||
if (isNaN(thisresource)){
|
||||
thisresource=0;
|
||||
}
|
||||
|
||||
var storCap = storage();
|
||||
if (id==3){
|
||||
thisresource -= consumption();
|
||||
}
|
||||
|
||||
var metalToTransport = parseInt(document.getElementsByName("resource1")[0].value);
|
||||
var crystalToTransport = parseInt(document.getElementsByName("resource2")[0].value);
|
||||
var deuteriumToTransport = parseInt(document.getElementsByName("resource3")[0].value);
|
||||
|
||||
if (isNaN(metalToTransport)){
|
||||
metalToTransport=0;
|
||||
}
|
||||
if (isNaN(crystalToTransport)){
|
||||
crystalToTransport=0;
|
||||
}
|
||||
if (isNaN(deuteriumToTransport)){
|
||||
deuteriumToTransport=0;
|
||||
}
|
||||
|
||||
var freeCapacity = Math.max(storCap - metalToTransport - crystalToTransport - deuteriumToTransport, 0);
|
||||
var cargo = Math.min (freeCapacity + thisresourcechosen, thisresource);
|
||||
|
||||
if (document.getElementsByName("resource" + id)[0]) {
|
||||
document.getElementsByName("resource" + id)[0].value = cargo;
|
||||
}
|
||||
calculateTransportCapacity();
|
||||
}
|
||||
|
||||
function maxResources() {
|
||||
var id;
|
||||
var storCap = storage();
|
||||
var metalToTransport = document.getElementsByName("thisresource1")[0].value;
|
||||
var crystalToTransport = document.getElementsByName("thisresource2")[0].value;
|
||||
var deuteriumToTransport = document.getElementsByName("thisresource3")[0].value - consumption();
|
||||
|
||||
var freeCapacity = storCap - metalToTransport - crystalToTransport - deuteriumToTransport;
|
||||
if (freeCapacity < 0) {
|
||||
metalToTransport = Math.min(metalToTransport, storCap);
|
||||
crystalToTransport = Math.min(crystalToTransport, storCap - metalToTransport);
|
||||
deuteriumToTransport = Math.min(deuteriumToTransport, storCap - metalToTransport - crystalToTransport);
|
||||
}
|
||||
document.getElementsByName("resource1")[0].value = Math.max(metalToTransport, 0);
|
||||
document.getElementsByName("resource2")[0].value = Math.max(crystalToTransport, 0);
|
||||
document.getElementsByName("resource3")[0].value = Math.max(deuteriumToTransport, 0);
|
||||
calculateTransportCapacity();
|
||||
}
|
||||
|
||||
function maxShip(id) {
|
||||
if (document.getElementsByName(id)[0]) {
|
||||
document.getElementsByName(id)[0].value = document.getElementsByName("max" + id)[0].value;
|
||||
}
|
||||
}
|
||||
|
||||
function maxShips() {
|
||||
var id;
|
||||
for (i = 200; i < 220; i++) {
|
||||
id = "ship"+i;
|
||||
maxShip(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function noShip(id) {
|
||||
if (document.getElementsByName(id)[0]) {
|
||||
document.getElementsByName(id)[0].value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function noShips (){
|
||||
var id;
|
||||
for (i = 200; i < 220; i++) {
|
||||
id = "ship"+i;
|
||||
noShip(id);
|
||||
}
|
||||
}
|
||||
|
||||
function calculateTransportCapacity() {
|
||||
var metal = Math.abs(document.getElementsByName("resource1")[0].value);
|
||||
var crystal = Math.abs(document.getElementsByName("resource2")[0].value);
|
||||
var deuterium = Math.abs(document.getElementsByName("resource3")[0].value);
|
||||
|
||||
transportCapacity = storage() - metal - crystal - deuterium;
|
||||
|
||||
if (transportCapacity < 0) {
|
||||
document.getElementById("remainingresources").innerHTML="<font color=red>"+transportCapacity+"</font>";
|
||||
} else {
|
||||
document.getElementById("remainingresources").innerHTML="<font color=lime>"+transportCapacity+"</font>";
|
||||
}
|
||||
return transportCapacity;
|
||||
}
|
||||
|
||||
function getLayerRef(id, document) {
|
||||
if (!document)
|
||||
document = window.document;
|
||||
|
||||
if (document.layers) {
|
||||
for (var l = 0; l < document.layers.length; l++)
|
||||
if (document.layers[l].id == id)
|
||||
return document.layers[l];
|
||||
for (var l = 0; l < document.layers.length; l++) {
|
||||
var result = getLayerRef(id, document.layers[l].document);
|
||||
if (result)
|
||||
return result;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
else if (document.all) {
|
||||
return document.all[id];
|
||||
}
|
||||
else if (document.getElementById) {
|
||||
return document.getElementById(id);
|
||||
}
|
||||
}
|
||||
|
||||
function setVisibility(objLayer, visible) {
|
||||
if (document.layers) {
|
||||
objLayer.visibility =
|
||||
(visible == true) ? 'show' : 'hide';
|
||||
} else {
|
||||
objLayer.style.visibility =
|
||||
(visible == true) ? 'visible' : 'hidden';
|
||||
}
|
||||
}
|
||||
|
||||
function setVisibilityForDivByPrefix(prefix, visible, d) {
|
||||
if (!d)
|
||||
d = window.document;
|
||||
|
||||
if (document.layers) {
|
||||
for (var i = 0; i < d.layers.length; i++) {
|
||||
if (d.layers[i].id.substr(0, prefix.length) == prefix)
|
||||
setVisibility(d.layers[l], visible);
|
||||
setVisibilityForDivByPrefix(prefix, visible, d.layers[i].document);
|
||||
}
|
||||
} else if (document.all) {
|
||||
var layers = document.all.tags("div");
|
||||
for (i = 0; i < layers.length; i++) {
|
||||
if (layers[i].id.substr(0, prefix.length) == prefix)
|
||||
setVisibility(document.all.tags("div")[i].visible);
|
||||
}
|
||||
} else if (document.getElementsByTagName) {
|
||||
var layers = document.getElementsByTagName("div");
|
||||
for (i = 0; i < layers.length; i++) {
|
||||
if (layers[i].id.substr(0, prefix.length) == prefix)
|
||||
setVisibility(layers[i].visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
function disableSome() {
|
||||
document.forms[0].mission[6].disabled = true;
|
||||
document.forms[0].mission[7].disabled = true;
|
||||
document.forms[0].mission[8].disabled = true;
|
||||
}
|
||||
*/
|
||||
function setPlanet(string) {
|
||||
var splitstring = string.split(":");
|
||||
document.getElementsByName('galaxy')[0].value = splitstring[0];
|
||||
document.getElementsByName('system')[0].value = splitstring[1];
|
||||
document.getElementsByName('planet')[0].value = splitstring[2];
|
||||
document.getElementsByName('planettype')[0].value = splitstring[3];
|
||||
setMission(splitstring[4]);
|
||||
}
|
||||
|
||||
function setUnions(cnt) {
|
||||
galaxy = document.getElementsByName('galaxy')[0].value;
|
||||
system = document.getElementsByName('system')[0].value;
|
||||
planet = document.getElementsByName('planet')[0].value;
|
||||
planettype = document.getElementsByName('planettype')[0].value;
|
||||
|
||||
thisgalaxy = document.getElementsByName("thisgalaxy")[0].value;
|
||||
thissystem = document.getElementsByName("thissystem")[0].value;
|
||||
thisplanet = document.getElementsByName("thisplanet")[0].value;
|
||||
thisplanettype = document.getElementsByName("thisplanettype")[0].value;
|
||||
|
||||
spd = document.getElementsByName("speed")[0].value;
|
||||
speedfactor = document.getElementsByName("speedfactor")[0].value;
|
||||
|
||||
for (i = 0; i < cnt; i++) {
|
||||
// alert ("set unions called "+ cnt);
|
||||
var string = document.getElementById("union"+i).innerHTML;
|
||||
time = document.getElementsByName('union'+i+'time')[0].value;
|
||||
/* alert ("set unions called "+ time);*/
|
||||
targetgalaxy = document.getElementsByName('union'+i+'galaxy')[0].value;
|
||||
targetsystem = document.getElementsByName('union'+i+'system')[0].value;
|
||||
targetplanet = document.getElementsByName('union'+i+'planet')[0].value;
|
||||
targetplanettype = document.getElementsByName('union'+i+'planettype')[0].value;
|
||||
|
||||
if (targetgalaxy == galaxy && targetsystem == system
|
||||
&& targetplanet == planet && targetplanettype == planettype){
|
||||
|
||||
|
||||
inSpeedLimit = isInSpeedLimit(flightTime(thisgalaxy, thissystem, thisplanet,
|
||||
targetgalaxy, targetsystem, targetplanet,
|
||||
spd, speedfactor), time);
|
||||
// alert ("in here" + inSpeedLimit);
|
||||
if (inSpeedLimit == 2) {
|
||||
document.getElementById("union"+i).innerHTML =
|
||||
'<font color="lime">'+string+'</font>';
|
||||
} else if (inSpeedLimit == 1) {
|
||||
document.getElementById("union"+i).innerHTML =
|
||||
'<font color="orange">'+string+'</font>';
|
||||
} else {
|
||||
document.getElementById("union"+i).innerHTML =
|
||||
'<font color="red">'+string+'</font>';
|
||||
}
|
||||
} else {
|
||||
document.getElementById("union"+i).innerHTML =
|
||||
'<font color="#00a0ff">'+string+'</font>';
|
||||
// alert("red"+i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function isInSpeedLimit(flightlength, eventtime) {
|
||||
var time = new Date();
|
||||
time = Math.round(time / 1000);
|
||||
if (flightlength < ((eventtime - time) * (1 + 0.5))) {
|
||||
return 2;
|
||||
} else if (flightlength < ((eventtime - time) * 1)) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function flightTime(galaxy, system, planet,
|
||||
targetgalaxy, targetsystem, targetplanet,
|
||||
spd, maxspeed, speedfactor) {
|
||||
// alert ("flighttime called 1"+galaxy+" "+system+" "+planet+" "+targetgalaxy+" "+targetsystem+" "+targetplanet);
|
||||
|
||||
if ((galaxy - targetgalaxy) != 0) {
|
||||
dist = Math.abs(galaxy - targetgalaxy) * 20000;
|
||||
} else if ((system - targetsystem) != 0) {
|
||||
dist = Math.abs(system - targetsystem) * 5 * 19 + 2700;
|
||||
} else if ((planet - targetplanet) != 0) {
|
||||
dist = Math.abs(planet - targetplanet) * 5 + 1000;
|
||||
} else {
|
||||
dist = 5;
|
||||
}
|
||||
return Math.round(((35000 / spd * Math.sqrt(dist * 10 / maxspeed) + 10) / speedfactor));
|
||||
}
|
||||
|
||||
function showCoords() {
|
||||
document.getElementsByName('speed')[0].disabled = false;
|
||||
document.getElementsByName('galaxy')[0].disabled = false;
|
||||
document.getElementsByName('system')[0].disabled = false;
|
||||
document.getElementsByName('planet')[0].disabled = false;
|
||||
document.getElementsByName('planettype')[0].disabled = false;
|
||||
document.getElementsByName('shortlinks')[0].disabled = false;
|
||||
}
|
||||
|
||||
function hideCoords() {
|
||||
document.getElementsByName('speed')[0].disabled = true;
|
||||
document.getElementsByName('galaxy')[0].disabled = true;
|
||||
document.getElementsByName('system')[0].disabled = true;
|
||||
document.getElementsByName('planet')[0].disabled = true;
|
||||
document.getElementsByName('planettype')[0].disabled = true;
|
||||
document.getElementsByName('shortlinks')[0].disabled = true;
|
||||
}
|
||||
|
||||
function showOrders() {
|
||||
document.getElementsByName('order')[0].disabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
function hideOrders() {
|
||||
document.getElementsByName('order')[0].disabled = true;
|
||||
}
|
||||
|
||||
function showResources() {
|
||||
document.getElementsByName('resource1')[0].disabled = false;
|
||||
document.getElementsByName('resource2')[0].disabled = false;
|
||||
document.getElementsByName('resource3')[0].disabled = false;
|
||||
document.getElementsByName('holdingtime')[0].disabled = false;
|
||||
}
|
||||
|
||||
function hideResources() {
|
||||
document.getElementsByName('resource1')[0].disabled = true;
|
||||
document.getElementsByName('resource2')[0].disabled = true;
|
||||
document.getElementsByName('resource3')[0].disabled = true;
|
||||
document.getElementsByName('holdingtime')[0].disabled = true;
|
||||
}
|
||||
|
||||
function setShips(s16,s17,s18,s19,s20,s21,s22,s23,s24,s25,s27,s28,s29){
|
||||
|
||||
setNumber('202',s16);
|
||||
setNumber('203',s17);
|
||||
setNumber('204',s18);
|
||||
setNumber('205',s19);
|
||||
setNumber('206',s20);
|
||||
setNumber('207',s21);
|
||||
setNumber('208',s22);
|
||||
setNumber('209',s23);
|
||||
setNumber('210',s24);
|
||||
setNumber('211',s25);
|
||||
setNumber('213',s27);
|
||||
setNumber('214',s28);
|
||||
setNumber('215',s29);
|
||||
|
||||
}
|
||||
|
||||
function setNumber(name,number){
|
||||
if (typeof document.getElementsByName('ship'+name)[0] != 'undefined'){
|
||||
document.getElementsByName('ship'+name)[0].value=number;
|
||||
}
|
||||
}
|
||||
|
||||
function tsdpkt(f) {
|
||||
r = "";
|
||||
vz = "";
|
||||
if (f < 0) { vz = "-"; }
|
||||
f = abs(f);
|
||||
r = f % 1000;
|
||||
while (f >= 1000){
|
||||
k1 = "";
|
||||
if ((f % 1000) < 100) { k1 = "0"; }
|
||||
if ((f % 1000) < 10) { k1 = "00"; }
|
||||
if ((f % 1000) == 0) { k1 = "00"; }
|
||||
f = abs((f-(f % 1000)) / 1000);
|
||||
r = f % 1000 + "." + k1 + r;
|
||||
}
|
||||
r = vz + r;
|
||||
return r;
|
||||
}
|
||||
|
||||
function abs(a) {
|
||||
if(a < 0) return -a;
|
||||
return a;
|
||||
}
|
||||
138
scripts/functions.js
Normal file
138
scripts/functions.js
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
function keypress(e){
|
||||
if(e.keyCode == 13) {
|
||||
submitLogin();
|
||||
}
|
||||
}
|
||||
|
||||
function submitLogin(){
|
||||
changeAction('login');
|
||||
document.loginForm.submit();
|
||||
}
|
||||
|
||||
function openLink(value) {
|
||||
if(value != "" && value != 0) {
|
||||
var valarr = value.split(/\|/);
|
||||
var link = "http://nwl.gameforge.de/index.php?type=redirect&lang=org&zone=ogame&target=" + valarr[1];
|
||||
if(valarr[0] == "new_window") {
|
||||
window.open(link);
|
||||
}
|
||||
else {
|
||||
top.location.href = link;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function checkCookie() {
|
||||
var uni = document.loginForm.universe.value;
|
||||
getUniFromCookie(uni);
|
||||
}
|
||||
|
||||
function setCookie() {
|
||||
var uni = document.loginForm.universe.value;
|
||||
var user = document.loginForm.login.value;
|
||||
var pw = document.loginForm.pass.value;
|
||||
var str = user + "," + pw;
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime()+(365*24*60*60*1000));
|
||||
cookie_setzen(uni, str, date);
|
||||
}
|
||||
|
||||
|
||||
function getCookie(name) {
|
||||
var i=0; //Suchposition im Cookie
|
||||
var suche = name + "=";
|
||||
while (i<document.cookie.length) {
|
||||
if (document.cookie.substring(i, i + suche.length)
|
||||
== suche) {
|
||||
var ende = document.cookie.indexOf(";", i
|
||||
+ suche.length);
|
||||
ende = (ende > -1) ? ende :
|
||||
document.cookie.length;
|
||||
var cook = document.cookie.substring(i
|
||||
+ suche.length, ende);
|
||||
return unescape(cook);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
function cookie_setzen() {
|
||||
var anzParameter = cookie_setzen.arguments.length;
|
||||
var parameter = cookie_setzen.arguments;
|
||||
// 1. Cookie-Name
|
||||
var name = parameter[0];
|
||||
// 2. Cookie-Wert
|
||||
var value = (anzParameter >= 2) ? parameter[1] : "";
|
||||
value = escape(value); // URL-Codierung
|
||||
// 3. Haltbarkeitsdatum
|
||||
var expires = (anzParameter >= 3) ? parameter[2] : null;
|
||||
if (expires != null) {
|
||||
if (expires.toGMTString) {
|
||||
expires = expires.toGMTString();
|
||||
}
|
||||
}
|
||||
// 4. Domain
|
||||
var domain = (anzParameter >= 4) ? parameter[3] : null;
|
||||
// 5. Pfad
|
||||
var path = (anzParameter >= 5) ? parameter[4] : null;
|
||||
|
||||
if (path != null) {
|
||||
path = escape(path); // Sonderzeichen umwandeln
|
||||
}
|
||||
// 6. Sicherheitsstufe
|
||||
var secure = (anzParameter >= 6) ? parameter[5] : null;
|
||||
// Zusammensetzen des Cookies
|
||||
var c = name + "=" + escape(value);
|
||||
if (expires != null) {
|
||||
c += "; expires=" + expires;
|
||||
}
|
||||
if (domain != null) {
|
||||
|
||||
c += "; domain=" + domain;
|
||||
}
|
||||
if (path != null) {
|
||||
c += "; path=" + path;
|
||||
}
|
||||
if (secure) {
|
||||
c += "; secure";
|
||||
}
|
||||
// Cookie setzen
|
||||
document.cookie = c;
|
||||
}
|
||||
|
||||
function cookie_lesen(name) {
|
||||
var i = document.cookie.indexOf(name + "=");
|
||||
var c = "";
|
||||
if (i > -1) {
|
||||
var ende = document.cookie.indexOf("; ",
|
||||
i+name.length+1);
|
||||
if (ende == -1) {
|
||||
ende = document.cookie.length;
|
||||
}
|
||||
c = document.cookie.substring(i+name.length+1, ende);
|
||||
}
|
||||
return unescape(c);
|
||||
}
|
||||
|
||||
function getUniFromCookie(uni) {
|
||||
var str = cookie_lesen(uni);
|
||||
str = unescape(str);
|
||||
|
||||
|
||||
if(str.length > 0) {
|
||||
var trennzeichenPos = str.search(',');
|
||||
var user = str.substring(0, trennzeichenPos);
|
||||
var pw = str.substring(trennzeichenPos, str.length);
|
||||
|
||||
document.loginForm.login.value = user;
|
||||
document.loginForm.pass.value = pw;
|
||||
}
|
||||
else {
|
||||
document.loginForm.login.value = "";
|
||||
document.loginForm.pass.value = "";
|
||||
}
|
||||
|
||||
}
|
||||
53
scripts/gsc.1.js
Normal file
53
scripts/gsc.1.js
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
function wrt(s,p1,p2){
|
||||
|
||||
document.write("<center>");
|
||||
document.write("<form action=\"galaxia.php?session=" + s + "\" method=post id=galaxy_form>");
|
||||
|
||||
document.write("<input type=\"hidden\" name=\"session\" value=\"" + s + "\">");
|
||||
document.write("<input type=\"hidden\" id=\"auto\" value=\"dr\">");
|
||||
|
||||
document.write("<table border=0> <tr><td> <table> <tr><td class=c colspan=3>Galaxie</td></tr> <tr>");
|
||||
document.write("<td class=l><input type=button name=ml value=\"<-\" onClick=\"galaxy_submit('ml')\"></td>");
|
||||
document.write("<td class=l><input type=text name=p1 value=" + p1 + " size=5 maxlength=3></td>");
|
||||
document.write("<td class=l><input type=button name=mr value=\"->\" onClick=\"galaxy_submit('mr')\"></td> </tr> </table></td><td><table> <tr><td class=c colspan=3>Sonnensystem</td></tr><tr><td class=l><input type=button name=xl value=\"<-\" onClick=\"galaxy_submit('xl')\"></td><td class=l><input type=text name=p2 value=" + p2 + " size=5 maxlength=3></td>");
|
||||
document.write("<td class=l><input type=button name=xr value=\"->\" onClick=\"galaxy_submit('xr')\"></td> </tr> </table> </td></tr> <tr><td colspan=2 align=center> <input type=submit value=Anzeigen></td></tr></table>");
|
||||
|
||||
|
||||
}
|
||||
|
||||
function wrt2(s,p1,p2){
|
||||
document.write(" <table width=470> <tr> <td class=c colspan=3>Sonnensystem " + p1 + ":" + p2 + " </td></tr> <tr> <th>Planet</th> <th>Name</th> <th>Aktion</th> </tr>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
function wrtg(s,ss,b,p1,p2,a){
|
||||
s=s.replace(/#1/g,'<tr><th>');
|
||||
s=s.replace(/#2/g,'</th><th>');
|
||||
s=s.replace(/#3/g,'</th>');
|
||||
|
||||
|
||||
s=s.replace(/#8/g,'<th> <a href=\"fleet.php?fstate=3&type=Spionage&gesver2=1&ladekap2=5&s=10&c210='+a+'&ft1='+p1+'&ft2='+p2+'&ft3=');
|
||||
s=s.replace(/#9/g,'\"><img src=\"http://80.237.203.119/ogame/game/img/e.gif\" border=0 alt=\"'+a+' Sonde schicken\"> </a>');
|
||||
s=s.replace(/#b/g,'<a href=\"galaxy.php?mode=1&p1='+p1+'&p2='+p2+'&ft3=');
|
||||
s=s.replace(/#c/g,'\"><img src=\"http://ogame.org/ogame/game/img/r.gif\" border=0 alt=\"Raketenangriff\"> </a>');
|
||||
|
||||
|
||||
s=s.replace(/#4/g,'<a href=\"messages.php?mode=write&id=');
|
||||
s=s.replace(/#5/g,'\"><img src=\"http://80.237.203.119/ogame/game/img/m.gif\" border=0 alt=\"Nachricht schreiben\"></a><a href=\"buddy.php?a=2&u=');
|
||||
s=s.replace(/#X/g,'\"><img src=\"http://80.237.203.119/ogame/game/img/b.gif\" border=0 alt=\"Buddyanfrage\"></a>');
|
||||
s=s.replace(/#6/g,'</th>');
|
||||
s=s.replace(/#7/g,'<th>');
|
||||
s=s.replace(/#a/g,'</th><th></th>');
|
||||
document.write(s);
|
||||
document.write('<tr><td class=c colspan=3>( '+b+' Planeten besiedelt )</th></tr></table> (*) Flottenbewegung oder Aktivit<69>t auf Planet (g) User gesperrt<br>(i) Spieler 2 Wochen inaktiv (I) Spieler 4 Wochen inaktiv<br><font color=#ffa0a0>starker Spieler<font color=#ffffff> <font color=#a0ffa0>schwacher Spieler<font color=#ffffff>   <font color=#0000ff>Urlaubsmodus<font color=#ffffff>');
|
||||
document.write('</center> </body> </html>');
|
||||
|
||||
}
|
||||
|
||||
function galaxy_submit(value) {
|
||||
document.getElementById('auto').name = value;
|
||||
document.getElementById('galaxy_form').submit();
|
||||
}
|
||||
|
||||
|
||||
1
scripts/jquery.js
vendored
Normal file
1
scripts/jquery.js
vendored
Normal file
File diff suppressed because one or more lines are too long
33
scripts/ocnt.js
Normal file
33
scripts/ocnt.js
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
function t() {
|
||||
v = new Date();
|
||||
n = new Date();
|
||||
o = new Date();
|
||||
for (cn = 1; cn <= anz; cn++) {
|
||||
bxx = document.getElementById('bxx' + cn);
|
||||
ss = bxx.title;
|
||||
s = ss - Math.round((n.getTime() - v.getTime()) / 1000.);
|
||||
m = 0;
|
||||
h = 0;
|
||||
if (s < 0) {
|
||||
bxx.innerHTML = "-";
|
||||
} else {
|
||||
if (s > 59) {
|
||||
m = Math.floor(s/60);
|
||||
s = s - m * 60;
|
||||
}
|
||||
if (m > 59) {
|
||||
h = Math.floor(m / 60);
|
||||
m = m - h * 60;
|
||||
}
|
||||
if (s < 10) {
|
||||
s = "0" + s;
|
||||
}
|
||||
if (m < 10) {
|
||||
m = "0" + m;
|
||||
}
|
||||
bxx.innerHTML = h + ":" + m + ":" + s + "";
|
||||
}
|
||||
bxx.title = bxx.title - 1;
|
||||
}
|
||||
window.setTimeout("t();", 999);
|
||||
}
|
||||
1491
scripts/overlib.js
Normal file
1491
scripts/overlib.js
Normal file
File diff suppressed because it is too large
Load diff
141
scripts/registration.js
Normal file
141
scripts/registration.js
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
var ajax = new sack();
|
||||
|
||||
function showInfo(id) {
|
||||
printMessage(id, 'infotext');
|
||||
document.getElementById('statustext').innerHTML = "";
|
||||
}
|
||||
|
||||
function wait() {
|
||||
return;
|
||||
}
|
||||
|
||||
checkUsername.oldname = "";
|
||||
checkUsername.lastcheck = "103";
|
||||
function checkUsername() {
|
||||
var username = document.forms[0].elements[0].value;
|
||||
if (username.length > 2 && username.length < 20) {
|
||||
if (username != checkUsername.oldname) {
|
||||
checkUsername.oldname = username;
|
||||
remoteCheckUsername();
|
||||
return checkUsername.lastcheck;
|
||||
} else {
|
||||
return checkUsername.lastcheck;
|
||||
}
|
||||
} else {
|
||||
checkUsername.lastcheck = "103";
|
||||
return "103";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
checkEmail.oldmail = "";
|
||||
checkEmail.lastcheck = "104";
|
||||
function checkEmail() {
|
||||
var email = document.forms[0].elements[1].value;
|
||||
if (email.length >= 3 && email.length < 64) {
|
||||
if (email != checkEmail.oldmail) {
|
||||
checkEmail.oldmail = email;
|
||||
m = email.match(/[a-zA-Z0-9]+@+[a-zA-Z0-9]+[.]+[a-zA-Z0-9]{2,4}/);
|
||||
if (m) {
|
||||
remoteCheckEmail();
|
||||
} else {
|
||||
checkEmail.lastcheck = "104";
|
||||
return checkEmail.lastcheck;
|
||||
}
|
||||
} else {
|
||||
return checkEmail.lastcheck;
|
||||
}
|
||||
} else {
|
||||
checkEmail.lastcheck = "104";
|
||||
return "104";
|
||||
}
|
||||
}
|
||||
|
||||
function remoteCheckUsername() {
|
||||
var username = document.forms[0].elements[0].value;
|
||||
ajax.requestFile = "check_registration.php";
|
||||
|
||||
// turn on its execute flag
|
||||
ajax.runResponse = whenResponse;
|
||||
ajax.execute = true;
|
||||
|
||||
ajax.setVar("action", "check_username");
|
||||
ajax.setVar("username", username);
|
||||
ajax.runAJAX();
|
||||
}
|
||||
|
||||
function remoteCheckEmail() {
|
||||
var email = document.forms[0].elements[1].value;
|
||||
ajax.requestFile = "check_registration.php";
|
||||
|
||||
// turn on its execute flag
|
||||
ajax.runResponse = whenResponse;
|
||||
ajax.execute = true;
|
||||
|
||||
ajax.setVar("action", "check_email");
|
||||
ajax.setVar("email", email);
|
||||
ajax.runAJAX();
|
||||
}
|
||||
|
||||
function checkAGB() {
|
||||
if (document.forms[0].elements[2].checked == true) {
|
||||
return 0;
|
||||
} else{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
function checkData() {
|
||||
//document.getElementById('debug').innerHTML = checkUsername() + " " + checkEmail() + " " + checkAGB();
|
||||
if (checkUsername.lastcheck == "0"
|
||||
&& checkEmail.lastcheck == "0"
|
||||
&& !checkAGB()) {
|
||||
document.forms[0].elements[4].disabled = false;
|
||||
|
||||
} else {
|
||||
document.forms[0].elements[4].disabled = true;
|
||||
//document.write(document.forms[0].elements[3].value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function pollUsername() {
|
||||
pollUsername.interval = setInterval("printMessage(checkUsername())", 1000);
|
||||
clearInterval(pollEmail.interval);
|
||||
}
|
||||
|
||||
function stopPollingUsername() {
|
||||
clearInterval(pollUsername.interval);
|
||||
}
|
||||
|
||||
function pollEmail() {
|
||||
pollEmail.interval = setInterval("printMessage(checkEmail())", 1000);
|
||||
clearInterval(pollUsername.interval);
|
||||
}
|
||||
|
||||
function stopPollingEmail() {
|
||||
clearInterval(pollEmail.interval);
|
||||
}
|
||||
|
||||
|
||||
function whenLoading(){
|
||||
}
|
||||
|
||||
function whenLoaded(){
|
||||
}
|
||||
|
||||
function whenInteractive(){
|
||||
}
|
||||
|
||||
function whenResponse(){
|
||||
retVals = this.response.split(" ");
|
||||
switch (retVals[0]) {
|
||||
case "1": // check username
|
||||
checkUsername.lastcheck = retVals[1];
|
||||
break;
|
||||
case "2": // check email
|
||||
checkEmail.lastcheck = retVals[1];
|
||||
//checkEmail();
|
||||
break;
|
||||
}
|
||||
}
|
||||
204
scripts/res.js
Normal file
204
scripts/res.js
Normal file
|
|
@ -0,0 +1,204 @@
|
|||
// ==UserScript==
|
||||
// @name OGame Screen of Resources
|
||||
// @namespace http://www.midgar.com.ar/grease/ogame/
|
||||
// @description Graficzny interfejs surowc<77>w
|
||||
// @include http://ogame*.de/game/*
|
||||
// @include http://*.gfsrv.net/game/*
|
||||
// ==/UserScript==
|
||||
function formatNmb(numero)
|
||||
{
|
||||
var nNmb = String(numero);
|
||||
var sRes = "";
|
||||
for (var j, i = nNmb.length - 1, j = 0; i >= 0; i--, j++)
|
||||
sRes = nNmb.charAt(i) + ((j > 0) && (j % 3 == 0)? ".": "") + sRes;
|
||||
return sRes;
|
||||
}
|
||||
|
||||
if (document.location.href.indexOf('/game/resources.php') == -1) return;
|
||||
//GM_log('Init: '+document.location.href);
|
||||
|
||||
var T_Recursos = document.getElementsByTagName("td");
|
||||
var Metal = T_Recursos[18].innerHTML.replace(/\./,'');
|
||||
var Crystal = T_Recursos[19].innerHTML.replace(/\./,'');
|
||||
var Deut = T_Recursos[20].innerHTML.replace(/\./,'');
|
||||
|
||||
Metal = Metal.replace(/\./g,'');
|
||||
Crystal = Crystal .replace(/\./g,'');
|
||||
Deut = Deut.replace(/\./g,'');
|
||||
|
||||
|
||||
|
||||
|
||||
var PMetal = T_Recursos[40].innerHTML.replace(/\./g,'');
|
||||
var PCrystal = T_Recursos[41].innerHTML.replace(/\./g,'');
|
||||
var PDeut = T_Recursos[42].innerHTML.replace(/\./g,'');
|
||||
|
||||
PMetal = PMetal.replace(/\./g,'');
|
||||
PCrystal = PCrystal .replace(/\./g,'');
|
||||
PDeut = PDeut.replace(/\./g,'');
|
||||
|
||||
|
||||
var AlmM = T_Recursos[35].innerHTML.replace(/\./g,'');
|
||||
var AlmC = T_Recursos[36].innerHTML.replace(/\./g,'');
|
||||
var AlmD = T_Recursos[37].innerHTML.replace(/\./g,'');
|
||||
|
||||
AlmM = AlmM.replace(/k/,'000');
|
||||
AlmC = AlmC.replace(/k/,'000');
|
||||
AlmD = AlmD.replace(/k/,'000');
|
||||
|
||||
AlmM = AlmM.replace(/\./g,'');
|
||||
AlmC = AlmC.replace(/\./g,'');
|
||||
AlmD = AlmD.replace(/\./g,'');
|
||||
|
||||
|
||||
if (Metal.indexOf('<font color')!=-1) {
|
||||
Metal = Metal.substring(22, Metal.indexOf('</font'));
|
||||
}
|
||||
if (Crystal.indexOf('<font color')!=-1) {
|
||||
Crystal = Crystal.substring(22, Crystal.indexOf('</font'));
|
||||
}
|
||||
if (Deut.indexOf('<font color')!=-1) {
|
||||
Deut = Deut.substring(22, Deut.indexOf('</font'));
|
||||
}
|
||||
|
||||
if (PMetal.indexOf('<font color')!=-1) {
|
||||
PMetal = PMetal.substring(22, PMetal.indexOf('</font'));
|
||||
}
|
||||
if (PCrystal.indexOf('<font color')!=-1) {
|
||||
PCrystal = PCrystal.substring(22, PCrystal.indexOf('</font'));
|
||||
}
|
||||
if (PDeut.indexOf('<font color')!=-1) {
|
||||
PDeut = PDeut.substring(22, PDeut.indexOf('</font'));
|
||||
}
|
||||
|
||||
if (AlmM.indexOf('<font color')!=-1) {
|
||||
AlmM = AlmM.substring(22, AlmM.indexOf('</font'));
|
||||
}
|
||||
if (AlmC.indexOf('<font color')!=-1) {
|
||||
AlmC = AlmC.substring(22, AlmC.indexOf('</font'));
|
||||
}
|
||||
if (AlmD.indexOf('<font color')!=-1) {
|
||||
AlmD = AlmD.substring(22, AlmD.indexOf('</font'));
|
||||
}
|
||||
|
||||
var XMetal = new Array(3);
|
||||
var XCrystal = new Array(3);
|
||||
var XDeut = new Array(3);
|
||||
|
||||
XMetal[0] = PMetal * 24;
|
||||
XCrystal[0] = PCrystal * 24;
|
||||
XDeut[0] = PDeut *24;
|
||||
XMetal[1] = PMetal * 168;
|
||||
XCrystal[1] = PCrystal * 168;
|
||||
XDeut[1] = PDeut * 168;
|
||||
XMetal[2] = PMetal * 720;
|
||||
XCrystal[2] = PCrystal * 720;
|
||||
XDeut[2] = PDeut * 720;
|
||||
|
||||
// Buscar Formulario de Recursos
|
||||
|
||||
var ResFormC, T_Form, ResForm;
|
||||
ResFormC = document.getElementsByTagName('table');
|
||||
|
||||
for (var i = 0; i < ResFormC.length; i++) {
|
||||
|
||||
T_Form = ResFormC[i];
|
||||
if (T_Form.getAttribute('width') == '550') {
|
||||
ResForm = T_Form;
|
||||
}
|
||||
}
|
||||
|
||||
// Buscar Factor de Produccion
|
||||
var T_Factor = /Wsp\u00F3\u0142czynnik produkcji(.)*\:(.)*[0-9.]/gi.exec(document.body.innerHTML);
|
||||
|
||||
var Factor, FactorPorc;
|
||||
if (T_Factor.length) {
|
||||
Factor=T_Factor[0].split(":");
|
||||
Factor=parseFloat(Factor[1]) * 100;
|
||||
FactorPorc=parseInt(parseFloat(Factor) * 2.5);
|
||||
}
|
||||
|
||||
// Agregar tabla de factor de produccion
|
||||
if (ResForm) {
|
||||
// Buscar Produccion Real
|
||||
|
||||
|
||||
|
||||
// Procesar Tablas
|
||||
var ProdFact = document.createElement('div');
|
||||
|
||||
ProdFact.innerHTML = '<table width="500"><tr>'+
|
||||
'<th>Wsp\u00F3\u0142czynnik produkcji</th>'+
|
||||
'<th>'+Factor+'%</th>'+
|
||||
'<th width="250"><div style="border: 1px solid #FFFFFF; width: 250px;"><div style="background-color: '+(Factor < 100 ? '#C00000' : '#00C000' )+'; width: '+FactorPorc+'px;"> </div></div></th>'+
|
||||
'</tr></table><br />';
|
||||
|
||||
var CuentaRec = document.createElement('div');
|
||||
|
||||
CuentaRec.innerHTML = '<br /><table width="500">'+
|
||||
'<tr><td class="c" colspan="4">Wydoycie</td></tr>'+
|
||||
'<tr>'+
|
||||
'<td class="c"> </td>'+
|
||||
'<th>24h</th>'+
|
||||
'<th>Tydzien</th>'+
|
||||
'<th>Miesi\u0105c</th>'+
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<td class="c">Metal</td>'+
|
||||
'<th><font color="#00ff00">'+formatNmb(XMetal[0])+'</font></th>'+
|
||||
'<th><font color="#00ff00">'+formatNmb(XMetal[1])+'</font></th>'+
|
||||
'<th><font color="#00ff00">'+formatNmb(XMetal[2])+'</font></th>'+
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<td class="c">Cristal</td>'+
|
||||
'<th><font color="#00ff00">'+formatNmb(XCrystal[0])+'</font></th>'+
|
||||
'<th><font color="#00ff00">'+formatNmb(XCrystal[1])+'</font></th>'+
|
||||
'<th><font color="#00ff00">'+formatNmb(XCrystal[2])+'</font></th>'+
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<td class="c">Deut</td>'+
|
||||
'<th><font color="#00ff00">'+formatNmb(XDeut[0])+'</font></th>'+
|
||||
'<th><font color="#00ff00">'+formatNmb(XDeut[1])+'</font></th>'+
|
||||
'<th><font color="#00ff00">'+formatNmb(XDeut[2])+'</font></th>'+
|
||||
'</tr>'+
|
||||
'</table><br />';
|
||||
|
||||
var EAlmM=(Metal / AlmM) * 100;
|
||||
var EAlmMPorc=parseInt((Metal / AlmM) * 250);
|
||||
var EAlmC=(Crystal / AlmC) * 100;
|
||||
var EAlmCPorc=parseInt((Crystal / AlmC) * 250);
|
||||
var EAlmD=(Deut / AlmD) * 100;
|
||||
var EAlmDPorc=parseInt((Deut / AlmD) * 250);
|
||||
|
||||
EAlmM = Math.round(EAlmM);
|
||||
EAlmC = Math.round(EAlmC);
|
||||
EAlmD = Math.round(EAlmD);
|
||||
|
||||
|
||||
|
||||
|
||||
CuentaRec.innerHTML += '<table width="500">'+
|
||||
'<tr><td class="c" colspan="3">Magazyny</td></tr>'+
|
||||
'<tr>'+
|
||||
'<th>Metal</th>'+
|
||||
'<th>'+EAlmM+'%</th>'+
|
||||
'<th width="250"><div style="border: 1px solid #FFFFFF; width: 250px;"><div style="background-color: '+(EAlmM > 100 ? '#C00000' : '#00C000' )+'; width: '+(EAlmMPorc > 250 ? 250 : EAlmMPorc)+'px;"> </div></div></th>'+
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<th>Kryszta\u0142</th>'+
|
||||
'<th>'+EAlmC+'%</th>'+
|
||||
'<th width="250"><div style="border: 1px solid #FFFFFF; width: 250px;"><div style="background-color: '+(EAlmC > 100 ? '#C00000' : '#00C000' )+'; width: '+(EAlmCPorc > 250 ? 250 : EAlmCPorc)+'px;"> </div></div></th>'+
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<th>Deuter</th>'+
|
||||
'<th>'+EAlmD+'%</th>'+
|
||||
'<th width="250"><div style="border: 1px solid #FFFFFF; width: 250px;"><div style="background-color: '+(EAlmD > 100 ? '#C00000' : '#00C000' )+'; width: '+(EAlmDPorc > 250 ? 250 : EAlmDPorc)+'px;"> </div></div></th>'+
|
||||
'</tr>'+
|
||||
'</table><br />';
|
||||
|
||||
|
||||
ResForm.parentNode.insertBefore(CuentaRec, ResForm.nextSibling);
|
||||
ResForm.parentNode.insertBefore(ProdFact, ResForm);
|
||||
//document.body.innerHTML = document.body.innerHTML.replace(/Fattore di produzione(.)+n\:(.)*[0-9.]/gi,'');
|
||||
|
||||
}
|
||||
BIN
scripts/resources/backgrounds/default.png
Normal file
BIN
scripts/resources/backgrounds/default.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
86
scripts/resources/fonts/visitor/README
Normal file
86
scripts/resources/fonts/visitor/README
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
______________________________
|
||||
Visitor Created by Brian Kent
|
||||
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
|
||||
Thanks for Downloading Visitor.
|
||||
|
||||
-Visitor TT1 [.ttf]
|
||||
-Visitor TT2 [.ttf]
|
||||
-Visitor [7pt] [.fon]
|
||||
|
||||
'Visitor.fon' is a Windows Bitmap Font (.fon). This font is best
|
||||
used at 7pt. To use it at larger point sizes (for images), try using
|
||||
a graphics program like Photo Shop, Paint Shop Pro, or the Paint
|
||||
program that comes with Windows. Type out your text at the recommended
|
||||
point size [7pt], then resize the image. Set the color mode to 256
|
||||
or 2 colors so the edges don't get blured when resizing, then after you
|
||||
have the text to the size that you want, then change back to a higher
|
||||
color mode and edit the image.
|
||||
|
||||
For programs that don't show Bitmap Fonts in the Font Selector, you
|
||||
may be able to get the font to work by typing in:
|
||||
visitor -brk-
|
||||
|
||||
The TTF versions were created different ways. TT1 was created from
|
||||
within FontLab and TT2 was created in Illustrator then imported into
|
||||
FontLab. I didn't know which one to include so I just included both.
|
||||
|
||||
|
||||
If you have any questions or comments, you can e-mail me at
|
||||
kentpw@norwich.net
|
||||
|
||||
You can visit my Homepage <ÆNIGMA GAMES & FONTS> at
|
||||
http://www.aenigmafonts.com/
|
||||
|
||||
____________
|
||||
!!! NOTE !!!
|
||||
¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
This font has been updated! I've edited the (BRK) in the font name
|
||||
to just BRK. It seems that Adobe Illustrator and web pages with CSS
|
||||
don't like fonts with ( and ) in their name.
|
||||
|
||||
________________
|
||||
INSTALLING FONTS
|
||||
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
There's a couple of ways to install Fonts. The 'easy' way to
|
||||
install fonts is to just Unzip/place the font file(s) into your
|
||||
Windows\Fonts directory (I always use this method). If you're unable
|
||||
to do it the 'easy' way, then try to do it this way (for Windows
|
||||
95/98/NT):
|
||||
|
||||
1] Unzip the Font(s) to a folder (or somewhere, just remember where
|
||||
you unzipped it) on your Computer.
|
||||
|
||||
2] Next, click on the START button, then select SETTINGS then
|
||||
CONTROL PANEL.
|
||||
|
||||
3] When the Control Panel Window pops up, Double Click on FONTS.
|
||||
|
||||
4] When the FONTS window pops up, select File then Install New Font...
|
||||
|
||||
5] A Add Fonts window will pop up, just go to the folder that you
|
||||
unzipped the Font(s) to, select the Font(s) and then click on OK.
|
||||
Now the Font(s) are installed.
|
||||
|
||||
Now you can use the Font(s) in programs the utilize Fonts. Make
|
||||
sure that you install the font(s) first, then open up your apps
|
||||
(so the app will recognize the font). Sometimes you'll have to
|
||||
wait until you computer 'auto-refreshes' for programs to recognize
|
||||
fonts (Windows is sometimes slow to do that). You can refresh your
|
||||
computer quicker by going into Windows Explorer -or- My Computer and
|
||||
press F5 (or in the menubar select VIEW then REFRESH).
|
||||
|
||||
|
||||
__________
|
||||
DISCLAIMER
|
||||
¯¯¯¯¯¯¯¯¯¯
|
||||
-The font(s) in this zip file were created by me (Brian Kent). All
|
||||
of my Fonts are Freeware, you can use them any way you want to
|
||||
(Personal use, Commercial use, or whatever).
|
||||
|
||||
-If you have a Font related site and would like to offer my fonts on
|
||||
your site, go right ahead. All I ask is that you keep this text file
|
||||
intact with the Font.
|
||||
|
||||
-You may not Sell or Distribute my Fonts for profit or alter them in
|
||||
any way without asking me first. [e-mail - kentpw@norwich.net]
|
||||
BIN
scripts/resources/fonts/visitor/visitor.ttf
Normal file
BIN
scripts/resources/fonts/visitor/visitor.ttf
Normal file
Binary file not shown.
300
scripts/thickbox.js
Normal file
300
scripts/thickbox.js
Normal file
|
|
@ -0,0 +1,300 @@
|
|||
/*
|
||||
* Thickbox 3 - One Box To Rule Them All.
|
||||
* By Cody Lindley (http://www.codylindley.com)
|
||||
* Copyright (c) 2007 cody lindley
|
||||
* Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
var tb_pathToImage = "images/loadingAnimation.gif";
|
||||
|
||||
/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
|
||||
//on page load call tb_init
|
||||
$(document).ready(function(){
|
||||
tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
|
||||
imgLoader = new Image();// preload image
|
||||
imgLoader.src = tb_pathToImage;
|
||||
});
|
||||
|
||||
//add thickbox to href & area elements that have a class of .thickbox
|
||||
function tb_init(domChunk){
|
||||
$(domChunk).click(function(){
|
||||
var t = this.title || this.name || null;
|
||||
var a = this.href || this.alt;
|
||||
var g = this.rel || false;
|
||||
tb_show(t,a,g);
|
||||
this.blur();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link
|
||||
|
||||
try {
|
||||
if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
|
||||
$("body","html").css({height: "100%", width: "100%"});
|
||||
$("html").css("overflow","hidden");
|
||||
if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
|
||||
$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
|
||||
$("#TB_overlay").click(tb_remove);
|
||||
}
|
||||
}else{//all others
|
||||
if(document.getElementById("TB_overlay") === null){
|
||||
$("body").append("<div id='TB_overlay'></div><div id='TB_window'>");
|
||||
$("#TB_overlay").click(tb_remove);
|
||||
}
|
||||
}
|
||||
|
||||
if(caption===null){caption="";}
|
||||
$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
|
||||
$('#TB_load').show();//show loader
|
||||
|
||||
var baseURL;
|
||||
if(url.indexOf("?")!==-1){ //ff there is a query string involved
|
||||
baseURL = url.substr(0, url.indexOf("?"));
|
||||
}else{
|
||||
baseURL = url;
|
||||
}
|
||||
|
||||
var urlString = /\.jpg|\.jpeg|\.png|\.gif|\.bmp/g;
|
||||
var urlType = baseURL.toLowerCase().match(urlString);
|
||||
|
||||
if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images
|
||||
|
||||
TB_PrevCaption = "";
|
||||
TB_PrevURL = "";
|
||||
TB_PrevHTML = "";
|
||||
TB_NextCaption = "";
|
||||
TB_NextURL = "";
|
||||
TB_NextHTML = "";
|
||||
TB_imageCount = "";
|
||||
TB_FoundURL = false;
|
||||
if(imageGroup){
|
||||
TB_TempArray = $("a[@rel="+imageGroup+"]").get();
|
||||
for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) {
|
||||
var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);
|
||||
if (!(TB_TempArray[TB_Counter].href == url)) {
|
||||
if (TB_FoundURL) {
|
||||
TB_NextCaption = TB_TempArray[TB_Counter].title;
|
||||
TB_NextURL = TB_TempArray[TB_Counter].href;
|
||||
TB_NextHTML = "<span id='TB_next'> <a href='#'>Next ></a></span>";
|
||||
} else {
|
||||
TB_PrevCaption = TB_TempArray[TB_Counter].title;
|
||||
TB_PrevURL = TB_TempArray[TB_Counter].href;
|
||||
TB_PrevHTML = "<span id='TB_prev'> <a href='#'>< Prev</a></span>";
|
||||
}
|
||||
} else {
|
||||
TB_FoundURL = true;
|
||||
TB_imageCount = "Image " + (TB_Counter + 1) +" of "+ (TB_TempArray.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
imgPreloader = new Image();
|
||||
imgPreloader.onload = function(){
|
||||
imgPreloader.onload = null;
|
||||
|
||||
// Resizing large images - orginal by Christian Montoya edited by me.
|
||||
var pagesize = tb_getPageSize();
|
||||
var x = pagesize[0] - 150;
|
||||
var y = pagesize[1] - 150;
|
||||
var imageWidth = imgPreloader.width;
|
||||
var imageHeight = imgPreloader.height;
|
||||
if (imageWidth > x) {
|
||||
imageHeight = imageHeight * (x / imageWidth);
|
||||
imageWidth = x;
|
||||
if (imageHeight > y) {
|
||||
imageWidth = imageWidth * (y / imageHeight);
|
||||
imageHeight = y;
|
||||
}
|
||||
} else if (imageHeight > y) {
|
||||
imageWidth = imageWidth * (y / imageHeight);
|
||||
imageHeight = y;
|
||||
if (imageWidth > x) {
|
||||
imageHeight = imageHeight * (x / imageWidth);
|
||||
imageWidth = x;
|
||||
}
|
||||
}
|
||||
// End Resizing
|
||||
|
||||
|
||||
|
||||
TB_WIDTH = ((imageWidth + 30) + (imageWidth / 2));
|
||||
TB_HEIGHT = ((imageHeight + 60) + (imageHeight / 2));
|
||||
imageWidth = (imageWidth + (imageWidth / 2));
|
||||
imageHeight = (imageHeight + (imageHeight / 2));
|
||||
$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>Schliessen</a> oder dr¨cke ESC</div>");
|
||||
|
||||
$("#TB_closeWindowButton").click(tb_remove);
|
||||
|
||||
if (!(TB_PrevHTML === "")) {
|
||||
function goPrev(){
|
||||
if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);}
|
||||
$("#TB_window").remove();
|
||||
$("body").append("<div id='TB_window'></div>");
|
||||
tb_show(TB_PrevCaption, TB_PrevURL, imageGroup);
|
||||
return false;
|
||||
}
|
||||
$("#TB_prev").click(goPrev);
|
||||
}
|
||||
|
||||
if (!(TB_NextHTML === "")) {
|
||||
function goNext(){
|
||||
$("#TB_window").remove();
|
||||
$("body").append("<div id='TB_window'></div>");
|
||||
tb_show(TB_NextCaption, TB_NextURL, imageGroup);
|
||||
return false;
|
||||
}
|
||||
$("#TB_next").click(goNext);
|
||||
|
||||
}
|
||||
|
||||
document.onkeydown = function(e){
|
||||
if (e == null) { // ie
|
||||
keycode = event.keyCode;
|
||||
} else { // mozilla
|
||||
keycode = e.which;
|
||||
}
|
||||
if(keycode == 27){ // close
|
||||
tb_remove();
|
||||
} else if(keycode == 190){ // display previous image
|
||||
if(!(TB_NextHTML == "")){
|
||||
document.onkeydown = "";
|
||||
goNext();
|
||||
}
|
||||
} else if(keycode == 188){ // display next image
|
||||
if(!(TB_PrevHTML == "")){
|
||||
document.onkeydown = "";
|
||||
goPrev();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
tb_position();
|
||||
$("#TB_load").remove();
|
||||
$("#TB_ImageOff").click(tb_remove);
|
||||
$("#TB_window").css({display:"block"}); //for safari using css instead of show
|
||||
};
|
||||
|
||||
imgPreloader.src = url;
|
||||
}else{//code to show html pages
|
||||
|
||||
var queryString = url.replace(/^[^\?]+\??/,'');
|
||||
var params = tb_parseQuery( queryString );
|
||||
|
||||
TB_WIDTH = (params['width']*1) + 30 || 630; //defaults to 630 if no paramaters were added to URL
|
||||
TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL
|
||||
ajaxContentW = TB_WIDTH - 30;
|
||||
ajaxContentH = TB_HEIGHT - 45;
|
||||
|
||||
if(url.indexOf('TB_iframe') != -1){
|
||||
urlNoQuery = url.split('TB_');
|
||||
$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent' style='width:"+(ajaxContentW + 29 + 250)+"px;height:"+(ajaxContentH + 17 + 300)+"px;' onload='tb_showIframe()'> </iframe>");
|
||||
}else{
|
||||
if($("#TB_window").css("display") != "block"){
|
||||
if(params['modal'] != "true"){
|
||||
$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>close</a> or Esc Key</div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");
|
||||
}else{
|
||||
$("#TB_overlay").unbind();
|
||||
$("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");
|
||||
}
|
||||
}else{
|
||||
$("#TB_ajaxContent")[0].style.width = ajaxContentW +"px";
|
||||
$("#TB_ajaxContent")[0].style.height = ajaxContentH +"px";
|
||||
$("#TB_ajaxContent")[0].scrollTop = 0;
|
||||
$("#TB_ajaxWindowTitle").html(caption);
|
||||
}
|
||||
}
|
||||
|
||||
$("#TB_closeWindowButton").click(tb_remove);
|
||||
|
||||
if(url.indexOf('TB_inline') != -1){
|
||||
$("#TB_ajaxContent").html($('#' + params['inlineId']).html());
|
||||
tb_position();
|
||||
$("#TB_load").remove();
|
||||
$("#TB_window").css({display:"block"});
|
||||
}else if(url.indexOf('TB_iframe') != -1){
|
||||
tb_position();
|
||||
if(frames['TB_iframeContent'] === undefined){//be nice to safari
|
||||
$("#TB_load").remove();
|
||||
$("#TB_window").css({display:"block"});
|
||||
$(document).keyup( function(e){ var key = e.keyCode; if(key == 27){tb_remove();}});
|
||||
}
|
||||
}else{
|
||||
$("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method
|
||||
tb_position();
|
||||
$("#TB_load").remove();
|
||||
tb_init("#TB_ajaxContent a.thickbox");
|
||||
$("#TB_window").css({display:"block"});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!params['modal']){
|
||||
document.onkeyup = function(e){
|
||||
if (e == null) { // ie
|
||||
keycode = event.keyCode;
|
||||
} else { // mozilla
|
||||
keycode = e.which;
|
||||
}
|
||||
if(keycode == 27){ // close
|
||||
tb_remove();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
} catch(e) {
|
||||
//nothing here
|
||||
}
|
||||
}
|
||||
|
||||
//helper functions below
|
||||
function tb_showIframe(){
|
||||
$("#TB_load").remove();
|
||||
$("#TB_window").css({display:"block"});
|
||||
}
|
||||
|
||||
function tb_remove() {
|
||||
$("#TB_imageOff").unbind("click");
|
||||
$("#TB_overlay").unbind("click");
|
||||
$("#TB_closeWindowButton").unbind("click");
|
||||
$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').remove();});
|
||||
$("#TB_load").remove();
|
||||
if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
|
||||
$("body","html").css({height: "auto", width: "auto"});
|
||||
$("html").css("overflow","");
|
||||
}
|
||||
document.onkeydown = "";
|
||||
return false;
|
||||
}
|
||||
|
||||
function tb_position() {
|
||||
$("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'});
|
||||
if ( !(jQuery.browser.msie && typeof XMLHttpRequest == 'function')) { // take away IE6
|
||||
$("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'});
|
||||
}
|
||||
}
|
||||
|
||||
function tb_parseQuery ( query ) {
|
||||
var Params = {};
|
||||
if ( ! query ) {return Params;}// return empty object
|
||||
var Pairs = query.split(/[;&]/);
|
||||
for ( var i = 0; i < Pairs.length; i++ ) {
|
||||
var KeyVal = Pairs[i].split('=');
|
||||
if ( ! KeyVal || KeyVal.length != 2 ) {continue;}
|
||||
var key = unescape( KeyVal[0] );
|
||||
var val = unescape( KeyVal[1] );
|
||||
val = val.replace(/\+/g, ' ');
|
||||
Params[key] = val;
|
||||
}
|
||||
return Params;
|
||||
}
|
||||
|
||||
function tb_getPageSize(){
|
||||
var de = document.documentElement;
|
||||
var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
|
||||
var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
|
||||
arrayPageSize = [w,h];
|
||||
return arrayPageSize;
|
||||
}
|
||||
35
scripts/time.js
Normal file
35
scripts/time.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
function HeureCheck()
|
||||
{
|
||||
krucial = new Date;
|
||||
heure = krucial.getHours();
|
||||
min = krucial.getMinutes();
|
||||
sec = krucial.getSeconds();
|
||||
jour = krucial.getDate();
|
||||
mois = krucial.getMonth()+1;
|
||||
annee = krucial.getFullYear();
|
||||
if (sec < 10) { sec0 = "0"; }
|
||||
else { sec0 = ""; }
|
||||
if (min < 10) { min0 = "0"; }
|
||||
else { min0 = ""; }
|
||||
if (heure < 10) { heure0 = "0"; }
|
||||
else { heure0 = ""; }
|
||||
if (mois < 10) { mois0 = "0"; }
|
||||
else { mois0 = ""; }
|
||||
if (jour < 10) { jour0 = "0"; }
|
||||
else { jour0 = ""; }
|
||||
if (annee < 10) { annee0 = "0"; }
|
||||
else { annee0 = ""; }
|
||||
DinaDate = "" + jour0 + jour + "/" + mois0 + mois + "/" + annee0 + annee;
|
||||
total = DinaDate
|
||||
DinaHeure = heure0 + heure + ":" + min0 + min + ":" + sec0 + sec;
|
||||
total = DinaHeure
|
||||
total = "Nous sommes le " + DinaDate + " et il est " + DinaHeure + ".";
|
||||
|
||||
document.getElementById("dateheure").innerHTML = total;
|
||||
|
||||
tempo = setTimeout("HeureCheck()", 1000)
|
||||
}
|
||||
window.onload = HeureCheck;
|
||||
|
||||
//Script r<>alis<69> par Max485 membre de XNova
|
||||
//Message de Tom : La flemme d'en faire un mieux ^^
|
||||
133
scripts/tw-sack.js
Normal file
133
scripts/tw-sack.js
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
/* Simple AJAX Code-Kit (SACK) */
|
||||
/* <20>2005 Gregory Wild-Smith */
|
||||
/* www.twilightuniverse.com */
|
||||
/* Software licenced under a modified X11 licence, see documentation or authors website for more details */
|
||||
|
||||
function sack(file){
|
||||
this.AjaxFailedAlert = "Your browser does not support the enhanced functionality of this website, and therefore you will have an experience that differs from the intended one.\n";
|
||||
this.requestFile = file;
|
||||
this.method = "POST";
|
||||
this.URLString = "";
|
||||
this.encodeURIString = true;
|
||||
this.execute = false;
|
||||
|
||||
this.onLoading = function() { };
|
||||
this.onLoaded = function() { };
|
||||
this.onInteractive = function() { };
|
||||
this.onCompletion = function() { };
|
||||
|
||||
this.createAJAX = function() {
|
||||
try {
|
||||
this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
|
||||
} catch (e) {
|
||||
try {
|
||||
this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
} catch (err) {
|
||||
this.xmlhttp = null;
|
||||
}
|
||||
}
|
||||
if(!this.xmlhttp && typeof XMLHttpRequest != "undefined")
|
||||
this.xmlhttp = new XMLHttpRequest();
|
||||
if (!this.xmlhttp){
|
||||
this.failed = true;
|
||||
}
|
||||
};
|
||||
|
||||
this.setVar = function(name, value){
|
||||
if (this.URLString.length < 3){
|
||||
this.URLString = name + "=" + value;
|
||||
} else {
|
||||
this.URLString += "&" + name + "=" + value;
|
||||
}
|
||||
}
|
||||
|
||||
this.encVar = function(name, value){
|
||||
var varString = encodeURIComponent(name) + "=" + encodeURIComponent(value);
|
||||
return varString;
|
||||
}
|
||||
|
||||
this.encodeURLString = function(string){
|
||||
varArray = string.split('&');
|
||||
for (i = 0; i < varArray.length; i++){
|
||||
urlVars = varArray[i].split('=');
|
||||
if (urlVars[0].indexOf('amp;') != -1){
|
||||
urlVars[0] = urlVars[0].substring(4);
|
||||
}
|
||||
varArray[i] = this.encVar(urlVars[0],urlVars[1]);
|
||||
}
|
||||
return varArray.join('&');
|
||||
}
|
||||
|
||||
this.runResponse = function(){
|
||||
eval(this.response);
|
||||
}
|
||||
|
||||
this.runAJAX = function(urlstring){
|
||||
this.responseStatus = new Array(2);
|
||||
if(this.failed && this.AjaxFailedAlert){
|
||||
alert(this.AjaxFailedAlert);
|
||||
} else {
|
||||
if (urlstring){
|
||||
if (this.URLString.length){
|
||||
this.URLString = this.URLString + "&" + urlstring;
|
||||
} else {
|
||||
this.URLString = urlstring;
|
||||
}
|
||||
}
|
||||
if (this.encodeURIString){
|
||||
var timeval = new Date().getTime();
|
||||
this.URLString = this.encodeURLString(this.URLString);
|
||||
this.setVar("rndval", timeval);
|
||||
}
|
||||
if (this.element) { this.elementObj = document.getElementById(this.element); }
|
||||
if (this.xmlhttp) {
|
||||
var self = this;
|
||||
if (this.method == "GET") {
|
||||
var totalurlstring = this.requestFile + "?" + this.URLString;
|
||||
this.xmlhttp.open(this.method, totalurlstring, true);
|
||||
} else {
|
||||
this.xmlhttp.open(this.method, this.requestFile, true);
|
||||
}
|
||||
if (this.method == "POST"){
|
||||
try {
|
||||
this.xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded')
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
this.xmlhttp.send(this.URLString);
|
||||
this.xmlhttp.onreadystatechange = function() {
|
||||
switch (self.xmlhttp.readyState){
|
||||
case 1:
|
||||
self.onLoading();
|
||||
break;
|
||||
case 2:
|
||||
self.onLoaded();
|
||||
break;
|
||||
case 3:
|
||||
self.onInteractive();
|
||||
break;
|
||||
case 4:
|
||||
self.response = self.xmlhttp.responseText;
|
||||
self.responseXML = self.xmlhttp.responseXML;
|
||||
self.responseStatus[0] = self.xmlhttp.status;
|
||||
self.responseStatus[1] = self.xmlhttp.statusText;
|
||||
self.onCompletion();
|
||||
if(self.execute){ self.runResponse(); }
|
||||
if (self.elementObj) {
|
||||
var elemNodeName = self.elementObj.nodeName;
|
||||
elemNodeName.toLowerCase();
|
||||
if (elemNodeName == "input" || elemNodeName == "select" || elemNodeName == "option" || elemNodeName == "textarea"){
|
||||
self.elementObj.value = self.response;
|
||||
} else {
|
||||
self.elementObj.innerHTML = self.response;
|
||||
}
|
||||
}
|
||||
self.URLString = "";
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
this.createAJAX();
|
||||
}
|
||||
71
scripts/utilities.js
Normal file
71
scripts/utilities.js
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
function t(){
|
||||
v = new Date();
|
||||
n = new Date();
|
||||
o = new Date();
|
||||
for (cn = 1; cn <= anz; cn++) {
|
||||
bxx = document.getElementById('bxx' + cn);
|
||||
ss = bxx.title;
|
||||
s = ss - Math.round((n.getTime() - v.getTime()) / 1000.);
|
||||
m = 0;
|
||||
h = 0;
|
||||
if (s < 0) {
|
||||
bxx.innerHTML = "-";
|
||||
} else {
|
||||
if (s > 59) {
|
||||
m = Math.floor(s/60);
|
||||
s = s - m * 60;
|
||||
}
|
||||
if (m > 59) {
|
||||
h = Math.floor(m / 60);
|
||||
m = m - h * 60;
|
||||
}
|
||||
if (s < 10) {
|
||||
s = "0" + s;
|
||||
}
|
||||
if (m < 10) {
|
||||
m = "0" + m;
|
||||
}
|
||||
bxx.innerHTML = h + ":" + m + ":" + s + "";
|
||||
}
|
||||
bxx.title = bxx.title - 1;
|
||||
}
|
||||
window.setTimeout("t();", 999);
|
||||
}
|
||||
|
||||
var x = "";
|
||||
var e = null;
|
||||
|
||||
function cntchar(m) {
|
||||
if (window.document.forms[0].text.value.length > m) {
|
||||
window.document.forms[0].text.value = x;
|
||||
} else {
|
||||
x = window.document.forms[0].text.value;
|
||||
}
|
||||
if (e == null) {
|
||||
e = document.getElementById('cntChars');
|
||||
} else {
|
||||
e.childNodes[0].data = window.document.forms[0].text.value.length;
|
||||
}
|
||||
}
|
||||
|
||||
function fenster(target_url,win_name) {
|
||||
var new_win = window.open(target_url,win_name,'resizable=yes,scrollbars=yes,menubar=no,toolbar=no,width=640,height=480,top=0,left=0');
|
||||
new_win.focus();
|
||||
}
|
||||
|
||||
function fenstered(target_url,win_name) {
|
||||
var new_win = window.open(target_url,win_name,'resizable=yes,scrollbars=yes,menubar=no,toolbar=no,width=480,height=480,top=0,left=0');
|
||||
new_win.focus();
|
||||
}
|
||||
|
||||
function haha(z1) {
|
||||
eval("location='"+z1.options[z1.selectedIndex].value+"'");
|
||||
}
|
||||
|
||||
function link_to_gamepay() {
|
||||
document.getElementsByName("lang");
|
||||
document.getElementsByName("name");
|
||||
document.getElementsByName("playerid");
|
||||
document.getElementsByName("checksum");
|
||||
document.getElementsByName("session");
|
||||
}
|
||||
5
scripts/win.js
Normal file
5
scripts/win.js
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
function fenster(target_url,win_name)
|
||||
{
|
||||
var new_win = window.open(target_url,win_name,'resizable=yes,scrollbars=yes,menubar=no,toolbar=no,width=640,height=480,top=0,left=0');
|
||||
new_win.focus();
|
||||
}
|
||||
478
scripts/wz_tooltip.js
Normal file
478
scripts/wz_tooltip.js
Normal file
|
|
@ -0,0 +1,478 @@
|
|||
/* This notice must be untouched at all times.
|
||||
|
||||
wz_tooltip.js v. 3.31
|
||||
|
||||
The latest version is available at
|
||||
http://www.walterzorn.com
|
||||
or http://www.devira.com
|
||||
or http://www.walterzorn.de
|
||||
|
||||
Copyright (c) 2002-2004 Walter Zorn. All rights reserved.
|
||||
Created 1. 12. 2002 by Walter Zorn (Web: http://www.walterzorn.com )
|
||||
Last modified: 22. 6. 2005
|
||||
|
||||
Cross-browser tooltips working even in Opera 5 and 6,
|
||||
as well as in NN 4, Gecko-Browsers, IE4+, Opera 7 and Konqueror.
|
||||
No onmouseouts required.
|
||||
Appearance of tooltips can be individually configured
|
||||
via commands within the onmouseovers.
|
||||
|
||||
LICENSE: LGPL
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License (LGPL) as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
For more details on the GNU Lesser General Public License,
|
||||
see http://www.gnu.org/copyleft/lesser.html
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//////////////// GLOBAL TOOPTIP CONFIGURATION /////////////////////
|
||||
var ttBgColor = "#344566";
|
||||
var ttBgImg = ""; // path to background image;
|
||||
var ttBorderColor = "#003399";
|
||||
var ttBorderWidth = 1;
|
||||
var ttDelay = 500; // time span until tooltip shows up [milliseconds]
|
||||
var ttFontColor = "#E6EBFB";
|
||||
var ttFontFace = "arial,helvetica,sans-serif";
|
||||
var ttFontSize = "11px";
|
||||
var ttFontWeight = "bold"; // alternative is "bold";
|
||||
var ttOffsetX = 12; // horizontal offset of left-top corner from mousepointer
|
||||
var ttOffsetY = 15; // vertical offset "
|
||||
var ttOpacity = 100; // opacity of tooltip in percent (must be integer between 0 and 100)
|
||||
var ttPadding = 3; // spacing between border and content
|
||||
var ttShadowColor = "";
|
||||
var ttShadowWidth = 0;
|
||||
var ttTemp = 0; // time span after which the tooltip disappears; 0 (zero) means "infinite timespan"
|
||||
var ttTextAlign = "left";
|
||||
var ttTitleColor = "#ffffff"; // color of caption text
|
||||
var ttWidth = 300;
|
||||
//////////////////// END OF TOOLTIP CONFIG ////////////////////////
|
||||
|
||||
|
||||
|
||||
////////////// TAGS WITH TOOLTIP FUNCTIONALITY ////////////////////
|
||||
// List may be extended or shortened:
|
||||
var tt_tags = new Array("a","area","b","big","caption","center","code","dd","div","dl","dt","em","h1","h2","h3","h4","h5","h6","i","img","input","li","map","ol","p","pre","s","small","span","strike","strong","sub","sup","table","td","th","tr","tt","u","var","ul","layer");
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
///////// DON'T CHANGE ANYTHING BELOW THIS LINE /////////////////////
|
||||
var tt_obj, // current tooltip
|
||||
tt_ifrm, // iframe to cover windowed controls in IE
|
||||
tt_objW = 0, tt_objH = 0, // width and height of tt_obj
|
||||
tt_objX = 0, tt_objY = 0,
|
||||
tt_offX = 0, tt_offY = 0,
|
||||
xlim = 0, ylim = 0, // right and bottom borders of visible client area
|
||||
tt_sup = false, // true if T_ABOVE cmd
|
||||
tt_sticky = false, // tt_obj sticky?
|
||||
tt_wirklich_sticky = false, // f<>r den Mouseover-Effekt ben<65>tigt
|
||||
tt_wait = false,
|
||||
tt_act = false, // tooltip visibility flag
|
||||
tt_sub = false, // true while tooltip below mousepointer
|
||||
tt_u = "undefined",
|
||||
tt_mf, // stores previous mousemove evthandler
|
||||
// Opera: disable href when hovering <a>
|
||||
tt_tag = null; // stores hovered dom node, href and previous statusbar txt
|
||||
|
||||
|
||||
var tt_db = (document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body? document.body : null,
|
||||
tt_n = navigator.userAgent.toLowerCase(),
|
||||
tt_nv = navigator.appVersion;
|
||||
// Browser flags
|
||||
var tt_op = !!(window.opera && document.getElementById),
|
||||
tt_op6 = tt_op && !document.defaultView,
|
||||
tt_op7 = tt_op && !tt_op6,
|
||||
tt_ie = tt_n.indexOf("msie") != -1 && document.all && tt_db && !tt_op,
|
||||
tt_ie6 = tt_ie && parseFloat(tt_nv.substring(tt_nv.indexOf("MSIE")+5)) >= 5.5;
|
||||
tt_n4 = (document.layers && typeof document.classes != tt_u),
|
||||
tt_n6 = (!tt_op && document.defaultView && typeof document.defaultView.getComputedStyle != tt_u),
|
||||
tt_w3c = !tt_ie && !tt_n6 && !tt_op && document.getElementById;
|
||||
|
||||
function tt_Int(t_x)
|
||||
{
|
||||
var t_y;
|
||||
return isNaN(t_y = parseInt(t_x))? 0 : t_y;
|
||||
}
|
||||
function wzReplace(t_x, t_y)
|
||||
{
|
||||
var t_ret = "",
|
||||
t_str = this,
|
||||
t_xI;
|
||||
while((t_xI = t_str.indexOf(t_x)) != -1)
|
||||
{
|
||||
t_ret += t_str.substring(0, t_xI) + t_y;
|
||||
t_str = t_str.substring(t_xI + t_x.length);
|
||||
}
|
||||
return t_ret+t_str;
|
||||
}
|
||||
String.prototype.wzReplace = wzReplace;
|
||||
function tt_N4Tags(tagtyp, t_d, t_y)
|
||||
{
|
||||
t_d = t_d || document;
|
||||
t_y = t_y || new Array();
|
||||
var t_x = (tagtyp=="a")? t_d.links : t_d.layers;
|
||||
for(var z = t_x.length; z--;) t_y[t_y.length] = t_x[z];
|
||||
for(z = t_d.layers.length; z--;) t_y = tt_N4Tags(tagtyp, t_d.layers[z].document, t_y);
|
||||
return t_y;
|
||||
}
|
||||
function tt_Htm(tt, t_id, txt)
|
||||
{
|
||||
var t_bgc = (typeof tt.T_BGCOLOR != tt_u)? tt.T_BGCOLOR : ttBgColor,
|
||||
t_bgimg = (typeof tt.T_BGIMG != tt_u)? tt.T_BGIMG : ttBgImg,
|
||||
t_bc = (typeof tt.T_BORDERCOLOR != tt_u)? tt.T_BORDERCOLOR : ttBorderColor,
|
||||
t_bw = (typeof tt.T_BORDERWIDTH != tt_u)? tt.T_BORDERWIDTH : ttBorderWidth,
|
||||
t_ff = (typeof tt.T_FONTFACE != tt_u)? tt.T_FONTFACE : ttFontFace,
|
||||
t_fc = (typeof tt.T_FONTCOLOR != tt_u)? tt.T_FONTCOLOR : ttFontColor,
|
||||
t_fsz = (typeof tt.T_FONTSIZE != tt_u)? tt.T_FONTSIZE : ttFontSize,
|
||||
t_fwght = (typeof tt.T_FONTWEIGHT != tt_u)? tt.T_FONTWEIGHT : ttFontWeight,
|
||||
t_opa = (typeof tt.T_OPACITY != tt_u)? tt.T_OPACITY : ttOpacity,
|
||||
t_padd = (typeof tt.T_PADDING != tt_u)? tt.T_PADDING : ttPadding,
|
||||
t_shc = (typeof tt.T_SHADOWCOLOR != tt_u)? tt.T_SHADOWCOLOR : (ttShadowColor || 0),
|
||||
t_shw = (typeof tt.T_SHADOWWIDTH != tt_u)? tt.T_SHADOWWIDTH : (ttShadowWidth || 0),
|
||||
t_algn = (typeof tt.T_TEXTALIGN != tt_u)? tt.T_TEXTALIGN : ttTextAlign,
|
||||
t_tit = (typeof tt.T_TITLE != tt_u)? tt.T_TITLE : "",
|
||||
t_titc = (typeof tt.T_TITLECOLOR != tt_u)? tt.T_TITLECOLOR : ttTitleColor,
|
||||
t_w = (typeof tt.T_WIDTH != tt_u)? tt.T_WIDTH : ttWidth;
|
||||
if (t_shc || t_shw)
|
||||
{
|
||||
t_shc = t_shc || "#cccccc";
|
||||
t_shw = t_shw || 5;
|
||||
}
|
||||
if (tt_n4 && (t_fsz == "10px" || t_fsz == "11px")) t_fsz = "12px";
|
||||
|
||||
var t_optx = (tt_n4? '' : tt_n6? ('-moz-opacity:'+(t_opa/100.0)) : tt_ie? ('filter:Alpha(opacity='+t_opa+')') : ('opacity:'+(t_opa/100.0))) + ';';
|
||||
var t_y = '<div id="'+t_id+'" style="position:absolute;z-index:1010;';
|
||||
t_y += 'left:0px;top:0px;width:'+(t_w+t_shw)+'px;visibility:'+(tt_n4? 'hide' : 'hidden')+';'+t_optx+'">' +
|
||||
'<table border="0" cellpadding="0" cellspacing="0"'+(t_bc? (' bgcolor="'+t_bc+'"') : '')+' width="'+t_w+'">';
|
||||
if (t_tit)
|
||||
{
|
||||
t_y += '<tr><th style="padding-left:3px;padding-right:3px;" align="'+t_algn+'"><font color="'+t_titc+'" face="'+t_ff+'" ' +
|
||||
'style="color:'+t_titc+';font-family:'+t_ff+';font-size:'+t_fsz+';"><b>' +
|
||||
(tt_n4? ' ' : '')+t_tit+'<\/b><\/font><\/th><\/tr>';
|
||||
}
|
||||
t_y += '<tr><th style="padding:0px;" class="tooltip_border"><table border="0" cellpadding="'+t_padd+'" cellspacing="'+t_bw+'" width="100%">' +
|
||||
'<tr><th'+(t_bgc? (' bgcolor="'+t_bgc+'"') : '')+(t_bgimg? ' background="'+t_bgimg+'"' : '')+' style="text-align:'+t_algn+';';
|
||||
if (tt_n6) t_y += 'padding:'+t_padd+'px;';
|
||||
t_y += '" align="'+t_algn+'">';
|
||||
//t_y += '<font color="'+t_fc+'" face="'+t_ff+'"' +
|
||||
//' style="color:'+t_fc+';font-family:'+t_ff+';font-size:'+t_fsz+';font-weight:'+t_fwght+';">';
|
||||
//if (t_fwght == 'bold') t_y += '<b>';
|
||||
t_y += txt;
|
||||
//if (t_fwght == 'bold') t_y += '<\/b>';
|
||||
//t_y += '<\/font>';
|
||||
t_y += '<\/th><\/tr><\/table><\/th><\/tr><\/table>';
|
||||
if (t_shw)
|
||||
{
|
||||
var t_spct = Math.round(t_shw*1.3);
|
||||
if (tt_n4)
|
||||
{
|
||||
t_y += '<layer bgcolor="'+t_shc+'" left="'+t_w+'" top="'+t_spct+'" width="'+t_shw+'" height="0"><\/layer>' +
|
||||
'<layer bgcolor="'+t_shc+'" left="'+t_spct+'" align="bottom" width="'+(t_w-t_spct)+'" height="'+t_shw+'"><\/layer>';
|
||||
}
|
||||
else
|
||||
{
|
||||
t_optx = tt_n6? '-moz-opacity:0.85;' : tt_ie? 'filter:Alpha(opacity=85);' : 'opacity:0.85;';
|
||||
t_y += '<div id="'+t_id+'R" style="position:absolute;background:'+t_shc+';left:'+t_w+'px;top:'+t_spct+'px;width:'+t_shw+'px;height:1px;overflow:hidden;'+t_optx+'"><\/div>' +
|
||||
'<div style="position:relative;background:'+t_shc+';left:'+t_spct+'px;top:0px;width:'+(t_w-t_spct)+'px;height:'+t_shw+'px;overflow:hidden;'+t_optx+'"><\/div>';
|
||||
}
|
||||
}
|
||||
return(t_y+'<\/div>' +
|
||||
(tt_ie ? '<iframe id="TTiEiFrM" src="javascript:false" scrolling="no" frameborder="0" style="filter:Alpha(opacity=0);position:absolute;top:0px;left:0px;display:none;"><\/iframe>' : ''));
|
||||
}
|
||||
function tt_EvX(t_e, korrektur)
|
||||
{
|
||||
var t_y = tt_Int(t_e.pageX || t_e.clientX || 0) +
|
||||
tt_Int(tt_ie? tt_db.scrollLeft : 0);
|
||||
if (!korrektur) return t_y;
|
||||
t_y += tt_offX;
|
||||
if (t_y > xlim) t_y = xlim;
|
||||
var t_scr = tt_Int(window.pageXOffset || (tt_db? tt_db.scrollLeft : 0) || 0);
|
||||
if (t_y < t_scr) t_y = t_scr;
|
||||
return t_y;
|
||||
}
|
||||
function tt_EvY(t_e, korrektur)
|
||||
{
|
||||
var t_y = tt_Int(t_e.pageY || t_e.clientY || 0) +
|
||||
tt_Int(tt_ie? tt_db.scrollTop : 0);
|
||||
if (!korrektur) return t_y;
|
||||
if (tt_sup) t_y -= (tt_objH + tt_offY - 15);
|
||||
else if (t_y > ylim || !tt_sub && t_y > ylim-24)
|
||||
{
|
||||
t_y -= (tt_objH + 5);
|
||||
tt_sub = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
t_y += tt_offY;
|
||||
tt_sub = true;
|
||||
}
|
||||
return t_y;
|
||||
}
|
||||
function tt_ReleasMov()
|
||||
{
|
||||
if (document.onmousemove == tt_Move)
|
||||
{
|
||||
if (!tt_mf && document.releaseEvents) document.releaseEvents(Event.MOUSEMOVE);
|
||||
document.onmousemove = tt_mf;
|
||||
}
|
||||
}
|
||||
function tt_ShowIfrm(t_x)
|
||||
{
|
||||
if (!tt_ie6 || !tt_obj) return;
|
||||
tt_ifrm = document.getElementById("TTiEiFrM");
|
||||
//tt_obj.style.display = t_x? "block" : "none";
|
||||
if (t_x)
|
||||
{
|
||||
tt_ifrm.style.width = tt_objW+'px';
|
||||
tt_ifrm.style.height = tt_objH+'px';
|
||||
tt_ifrm.style.zIndex = tt_obj.style.zIndex - 1;
|
||||
tt_ifrm.style.display = "block";
|
||||
}
|
||||
else tt_ifrm.style.display = "none";
|
||||
}
|
||||
function tt_GetDiv(t_id)
|
||||
{
|
||||
return(
|
||||
tt_n4? (document.layers[t_id] || null)
|
||||
: tt_ie? (document.all[t_id] || null)
|
||||
: (document.getElementById(t_id) || null)
|
||||
);
|
||||
}
|
||||
function tt_GetDivW()
|
||||
{
|
||||
return tt_Int(
|
||||
tt_n4? tt_obj.clip.width
|
||||
: (tt_obj.style.pixelWidth || tt_obj.offsetWidth)
|
||||
);
|
||||
}
|
||||
function tt_GetDivH()
|
||||
{
|
||||
return tt_Int(
|
||||
tt_n4? tt_obj.clip.height
|
||||
: (tt_obj.style.pixelHeight || tt_obj.offsetHeight)
|
||||
);
|
||||
}
|
||||
|
||||
// Compat with DragDrop Lib: Ensure that z-index of tooltip is lifted beyond toplevel dragdrop element
|
||||
function tt_SetDivZ()
|
||||
{
|
||||
var t_i = tt_obj.style || tt_obj;
|
||||
if (window.dd && dd.z)
|
||||
t_i.zIndex = Math.max(dd.z+1, t_i.zIndex);
|
||||
}
|
||||
function tt_SetDivPos(t_x, t_y)
|
||||
{
|
||||
var t_i = tt_obj.style || tt_obj;
|
||||
var t_px = (tt_op6 || tt_n4)? '' : 'px';
|
||||
t_i.left = (tt_objX = t_x) + t_px;
|
||||
t_i.top = (tt_objY = t_y) + t_px;
|
||||
if (tt_ifrm)
|
||||
{
|
||||
tt_ifrm.style.left = t_i.left;
|
||||
tt_ifrm.style.top = t_i.top;
|
||||
}
|
||||
}
|
||||
function tt_ShowDiv(t_x)
|
||||
{
|
||||
if (tt_n4) tt_obj.visibility = t_x? 'show' : 'hide';
|
||||
else tt_obj.style.visibility = t_x? 'visible' : 'hidden';
|
||||
tt_act = t_x;
|
||||
tt_ShowIfrm(t_x);
|
||||
}
|
||||
function tt_OpDeHref(t_e)
|
||||
{
|
||||
if (t_e && t_e.target.hasAttribute("href"))
|
||||
{
|
||||
tt_tag = t_e.target;
|
||||
tt_tag.t_href = tt_tag.getAttribute("href");
|
||||
tt_tag.removeAttribute("href");
|
||||
tt_tag.style.cursor = "hand";
|
||||
tt_tag.onmousedown = tt_OpReHref;
|
||||
tt_tag.stats = window.status;
|
||||
window.status = tt_tag.t_href;
|
||||
}
|
||||
}
|
||||
function tt_OpReHref()
|
||||
{
|
||||
if (tt_tag)
|
||||
{
|
||||
tt_tag.setAttribute("href", tt_tag.t_href);
|
||||
window.status = tt_tag.stats;
|
||||
tt_tag = null;
|
||||
}
|
||||
}
|
||||
function tt_Show(t_e, t_id, t_sup, t_delay, t_fix, t_left, t_offx, t_offy, t_static, t_sticky, t_temp)
|
||||
{
|
||||
if (tt_obj) tt_Hide();
|
||||
tt_mf = document.onmousemove || null;
|
||||
if (window.dd && (window.DRAG && tt_mf == DRAG || window.RESIZE && tt_mf == RESIZE)) return;
|
||||
var t_uf = document.onmouseup || null, t_sh, t_h;
|
||||
if (tt_mf && t_uf) t_uf(t_e);
|
||||
|
||||
tt_obj = tt_GetDiv(t_id);
|
||||
if (tt_obj)
|
||||
{
|
||||
t_e = t_e || window.event;
|
||||
tt_sub = !(tt_sup = t_sup);
|
||||
tt_sticky = tt_wirklich_sticky = t_sticky;
|
||||
tt_objW = tt_GetDivW();
|
||||
tt_objH = tt_GetDivH();
|
||||
tt_offX = t_left? -(tt_objW+t_offx) : t_offx;
|
||||
tt_offY = t_offy;
|
||||
if (tt_op7) tt_OpDeHref(t_e);
|
||||
if (tt_n4)
|
||||
{
|
||||
if (tt_obj.document.layers.length)
|
||||
{
|
||||
t_sh = tt_obj.document.layers[0];
|
||||
t_sh.clip.height = tt_objH - Math.round(t_sh.clip.width*1.3);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
t_sh = tt_GetDiv(t_id+'R');
|
||||
if (t_sh)
|
||||
{
|
||||
t_h = tt_objH - tt_Int(t_sh.style.pixelTop || t_sh.style.top || 0);
|
||||
if (typeof t_sh.style.pixelHeight != tt_u) t_sh.style.pixelHeight = t_h;
|
||||
else t_sh.style.height = t_h+'px';
|
||||
}
|
||||
}
|
||||
|
||||
xlim = tt_Int((tt_db && tt_db.clientWidth)? tt_db.clientWidth : window.innerWidth) +
|
||||
tt_Int(window.pageXOffset || (tt_db? tt_db.scrollLeft : 0) || 0) -
|
||||
tt_objW -
|
||||
(tt_n4? 21 : 0);
|
||||
ylim = tt_Int(window.innerHeight || tt_db.clientHeight) +
|
||||
tt_Int(window.pageYOffset || (tt_db? tt_db.scrollTop : 0) || 0) -
|
||||
tt_objH - tt_offY;
|
||||
|
||||
tt_SetDivZ();
|
||||
if (t_fix) tt_SetDivPos(tt_Int((t_fix = t_fix.split(','))[0]), tt_Int(t_fix[1]));
|
||||
else tt_SetDivPos(tt_EvX(t_e, true), tt_EvY(t_e, true));
|
||||
|
||||
var t_txt = 'tt_ShowDiv(\'true\');';
|
||||
if (t_sticky) t_txt += '{'+
|
||||
'tt_ReleasMov();'+
|
||||
'window.tt_upFunc = document.onmouseup || null;'+
|
||||
'if (document.captureEvents) document.captureEvents(Event.MOUSEUP);'+
|
||||
'document.onmouseup = new Function("window.setTimeout(\'tt_Hide();\', 10);");'+
|
||||
'}';
|
||||
else if (t_static) t_txt += 'tt_ReleasMov();';
|
||||
if (t_temp > 0) t_txt += 'window.tt_rtm = window.setTimeout(\'tt_sticky = false; tt_Hide();\','+t_temp+');';
|
||||
window.tt_rdl = window.setTimeout(t_txt, t_delay);
|
||||
|
||||
if (!t_fix)
|
||||
{
|
||||
if (document.captureEvents) document.captureEvents(Event.MOUSEMOVE);
|
||||
document.onmousemove = tt_Move;
|
||||
}
|
||||
}
|
||||
}
|
||||
var tt_area = false;
|
||||
function tt_Move(t_ev)
|
||||
{
|
||||
if (!tt_obj) return;
|
||||
if (tt_n6 || tt_w3c)
|
||||
{
|
||||
if (tt_wait) return;
|
||||
tt_wait = true;
|
||||
setTimeout('tt_wait = false;', 5);
|
||||
}
|
||||
var t_e = t_ev || window.event;
|
||||
tt_SetDivPos(tt_EvX(t_e, true), tt_EvY(t_e, true));
|
||||
if (tt_op6)
|
||||
{
|
||||
if (tt_area && t_e.target.tagName != 'AREA') tt_Hide();
|
||||
else if (t_e.target.tagName == 'AREA') tt_area = true;
|
||||
}
|
||||
}
|
||||
function tt_Hide()
|
||||
{
|
||||
if (window.tt_obj)
|
||||
{
|
||||
if (window.tt_rdl) window.clearTimeout(tt_rdl);
|
||||
if (!tt_sticky || !tt_act)
|
||||
{
|
||||
if (window.tt_rtm) window.clearTimeout(tt_rtm);
|
||||
tt_ShowDiv(false);
|
||||
tt_SetDivPos(-tt_objW, -tt_objH);
|
||||
tt_obj = null;
|
||||
if (typeof window.tt_upFunc != tt_u) document.onmouseup = window.tt_upFunc;
|
||||
}
|
||||
tt_sticky = false;
|
||||
if (tt_op6 && tt_area) tt_area = false;
|
||||
tt_ReleasMov();
|
||||
if (tt_op7) tt_OpReHref();
|
||||
}
|
||||
}
|
||||
function tt_Init()
|
||||
{
|
||||
if (!(tt_op || tt_n4 || tt_n6 || tt_ie || tt_w3c)) return;
|
||||
|
||||
var htm = tt_n4? '<div style="position:absolute;"><\/div>' : '',
|
||||
tags,
|
||||
t_tj,
|
||||
over,
|
||||
esc = 'return escape(';
|
||||
var i = tt_tags.length; while(i--)
|
||||
{
|
||||
tags = tt_ie? (document.all.tags(tt_tags[i]) || 1)
|
||||
: document.getElementsByTagName? (document.getElementsByTagName(tt_tags[i]) || 1)
|
||||
: (!tt_n4 && tt_tags[i]=="a")? document.links
|
||||
: 1;
|
||||
if (tt_n4 && (tt_tags[i] == "a" || tt_tags[i] == "layer")) tags = tt_N4Tags(tt_tags[i]);
|
||||
var j = tags.length; while(j--)
|
||||
{
|
||||
if (typeof (t_tj = tags[j]).onmouseover == "function" && t_tj.onmouseover.toString().indexOf(esc) != -1 && !tt_n6 || tt_n6 && (over = t_tj.getAttribute("onmouseover")) && over.indexOf(esc) != -1)
|
||||
{
|
||||
if (over) t_tj.onmouseover = new Function(over);
|
||||
var txt = unescape(t_tj.onmouseover());
|
||||
htm += tt_Htm(
|
||||
t_tj,
|
||||
"tOoLtIp"+i+""+j,
|
||||
txt.wzReplace("& ","&")
|
||||
);
|
||||
|
||||
t_tj.onmouseover = new Function('e',
|
||||
'tt_Show(e,'+
|
||||
'"tOoLtIp' +i+''+j+ '",'+
|
||||
(typeof t_tj.T_ABOVE != tt_u)+','+
|
||||
((typeof t_tj.T_DELAY != tt_u)? t_tj.T_DELAY : ttDelay)+','+
|
||||
((typeof t_tj.T_FIX != tt_u)? '"'+t_tj.T_FIX+'"' : '""')+','+
|
||||
(typeof t_tj.T_LEFT != tt_u)+','+
|
||||
((typeof t_tj.T_OFFSETX != tt_u)? t_tj.T_OFFSETX : ttOffsetX)+','+
|
||||
((typeof t_tj.T_OFFSETY != tt_u)? t_tj.T_OFFSETY : ttOffsetY)+','+
|
||||
(typeof t_tj.T_STATIC != tt_u)+','+
|
||||
(typeof t_tj.T_STICKY != tt_u)+','+
|
||||
((typeof t_tj.T_TEMP != tt_u)? t_tj.T_TEMP : ttTemp)+
|
||||
');'
|
||||
);
|
||||
t_tj.onmouseout = tt_Hide;
|
||||
if (t_tj.alt) t_tj.alt = "";
|
||||
if (t_tj.title) t_tj.title = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
document.write(htm);
|
||||
}
|
||||
function tt_Mousemove(event)
|
||||
{
|
||||
if (tt_obj && tt_wirklich_sticky) {
|
||||
var m_x = tt_EvX(event, false), m_y = tt_EvY(event, false);
|
||||
if (m_x < tt_objX || m_x > (tt_objX+tt_objW)
|
||||
|| m_y < tt_objY || m_y > (tt_objY+tt_objH+10))
|
||||
tt_Hide();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
tt_Init();
|
||||
Loading…
Reference in a new issue