Крупная уборка неиспользуемых файлов. Шаблонизатор заведёт во все файлы. Куча мелких правок.

This commit is contained in:
Igor Barkov (iwork)
2020-10-01 01:12:53 +03:00
parent c181c8eb1e
commit 6305bcef8c
1132 changed files with 988 additions and 9077 deletions
-326
View File
@@ -1,326 +0,0 @@
// Simple Set Clipboard System
// Author: Joseph Huckaby
const ZeroClipboard = {
version: "1.0.6",
clients: {}, // registered upload clients on page, indexed by id
moviePath: 'i/popup/ZeroClipboard.swf', // URL to movie
nextId: 1, // ID of next movie
$: function (thingy) {
// simple DOM lookup utility function
if (typeof(thingy) == 'string') thingy = document.getElementById(thingy);
if (!thingy.addClass) {
// extend element with a few useful methods
thingy.hide = function () {
this.style.display = 'none';
};
thingy.show = function () {
this.style.display = '';
};
thingy.addClass = function (name) {
this.removeClass(name);
this.className += ' ' + name;
};
thingy.removeClass = function (name) {
const classes = this.className.split(/\s+/);
let idx = -1;
for (let k = 0; k < classes.length; k++) {
if (classes[k] == name) {
idx = k;
k = classes.length;
}
}
if (idx > -1) {
classes.splice(idx, 1);
this.className = classes.join(' ');
}
return this;
};
thingy.hasClass = function (name) {
return !!this.className.match(new RegExp("\\s*" + name + "\\s*"));
};
}
return thingy;
},
setMoviePath: function (path) {
// set path to ZeroClipboard.swf
this.moviePath = path;
},
dispatch: function (id, eventName, args) {
// receive event from flash movie, send to client
const client = this.clients[id];
if (client) {
client.receiveEvent(eventName, args);
}
},
register: function (id, client) {
// register new client to receive events
this.clients[id] = client;
},
getDOMObjectPosition: function (obj, stopObj) {
// get absolute coordinates for dom element
const info = {
left: 0,
top: 0,
width: obj.width ? obj.width : obj.offsetWidth,
height: obj.height ? obj.height : obj.offsetHeight
};
while (obj && (obj != stopObj)) {
info.left += obj.offsetLeft;
info.top += obj.offsetTop;
obj = obj.offsetParent;
}
return info;
},
Client: function (elem) {
// constructor for new simple upload client
this.handlers = {};
// unique ID
this.id = ZeroClipboard.nextId++;
this.movieId = 'ZeroClipboardMovie_' + this.id;
// register client with singleton to receive flash events
ZeroClipboard.register(this.id, this);
// create movie
if (elem) this.glue(elem);
}
};
ZeroClipboard.Client.prototype = {
id: 0, // unique ID for us
ready: false, // whether movie is ready to receive events or not
movie: null, // reference to movie object
clipText: '', // text to copy to clipboard
handCursorEnabled: true, // whether to show hand cursor, or default pointer cursor
cssEffects: true, // enable CSS mouse effects on dom container
handlers: null, // user event handlers
glue: function(elem, appendElem, stylesToAdd) {
// glue to DOM element
// elem can be ID or actual DOM element object
this.domElement = ZeroClipboard.$(elem);
// float just above object, or zIndex 99 if dom element isn't set
let zIndex = 99;
if (this.domElement.style.zIndex) {
zIndex = parseInt(this.domElement.style.zIndex, 10) + 1;
}
if (typeof(appendElem) == 'string') {
appendElem = ZeroClipboard.$(appendElem);
}
else if (typeof(appendElem) == 'undefined') {
appendElem = document.getElementsByTagName('body')[0];
}
// find X/Y position of domElement
const box = ZeroClipboard.getDOMObjectPosition(this.domElement, appendElem);
// create floating DIV above element
this.div = document.createElement('div');
const style = this.div.style;
style.position = 'absolute';
style.left = '' + box.left + 'px';
style.top = '' + box.top + 'px';
style.width = '' + box.width + 'px';
style.height = '' + box.height + 'px';
style.zIndex = zIndex;
if (typeof(stylesToAdd) == 'object') {
for (addedStyle in stylesToAdd) {
style[addedStyle] = stylesToAdd[addedStyle];
}
}
// style.backgroundColor = '#f00'; // debug
appendElem.appendChild(this.div);
this.div.innerHTML = this.getHTML( box.width, box.height );
},
getHTML: function(width, height) {
// return HTML for movie
let html = '';
const flashvars = 'id=' + this.id +
'&width=' + width +
'&height=' + height;
if (navigator.userAgent.match(/MSIE/)) {
// IE gets an OBJECT tag
const protocol = location.href.match(/^https/i) ? 'https://' : 'http://';
html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>';
}
else {
// all other browsers get an EMBED tag
html += '<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />';
}
return html;
},
hide: function() {
// temporarily hide floater offscreen
if (this.div) {
this.div.style.left = '-100px';
this.div.style.top = '-20px';
}
},
show: function() {
// show ourselves after a call to hide()
this.reposition();
},
destroy: function() {
// destroy control and floater
if (this.domElement && this.div) {
this.hide();
this.div.innerHTML = '';
const body = document.getElementsByTagName('body')[0];
try {
body.removeChild(this.div);
} catch (e) {
}
this.domElement = null;
this.div = null;
}
},
reposition: function(elem) {
// reposition our floating div, optionally to new container
// warning: container CANNOT change size, only position
if (elem) {
this.domElement = ZeroClipboard.$(elem);
if (!this.domElement) this.hide();
}
if (this.domElement && this.div) {
const box = ZeroClipboard.getDOMObjectPosition(this.domElement);
const style = this.div.style;
style.left = '' + box.left + 'px';
style.top = '' + box.top + 'px';
}
},
setText: function(newText) {
// set text to be copied to clipboard
this.clipText = newText;
if (this.ready) this.movie.setText(newText);
},
addEventListener: function(eventName, func) {
// add user event listener for event
// event types: load, queueStart, fileStart, fileComplete, queueComplete, progress, error, cancel
eventName = eventName.toString().toLowerCase().replace(/^on/, '');
if (!this.handlers[eventName]) this.handlers[eventName] = [];
this.handlers[eventName].push(func);
},
setHandCursor: function(enabled) {
// enable hand cursor (true), or default arrow cursor (false)
this.handCursorEnabled = enabled;
if (this.ready) this.movie.setHandCursor(enabled);
},
setCSSEffects: function(enabled) {
// enable or disable CSS effects on DOM container
this.cssEffects = !!enabled;
},
receiveEvent: function(eventName, args) {
// receive event from flash
eventName = eventName.toString().toLowerCase().replace(/^on/, '');
// special behavior for certain events
switch (eventName) {
case 'load':
// movie claims it is ready, but in IE this isn't always the case...
// bug fix: Cannot extend EMBED DOM elements in Firefox, must use traditional function
this.movie = document.getElementById(this.movieId);
if (!this.movie) {
var self = this;
setTimeout( function() { self.receiveEvent('load', null); }, 1 );
return;
}
// firefox on pc needs a "kick" in order to set these in certain cases
if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) {
var self = this;
setTimeout( function() { self.receiveEvent('load', null); }, 100 );
this.ready = true;
return;
}
this.ready = true;
this.movie.setText( this.clipText );
this.movie.setHandCursor( this.handCursorEnabled );
break;
case 'mouseover':
if (this.domElement && this.cssEffects) {
this.domElement.addClass('hover');
if (this.recoverActive) this.domElement.addClass('active');
}
break;
case 'mouseout':
if (this.domElement && this.cssEffects) {
this.recoverActive = false;
if (this.domElement.hasClass('active')) {
this.domElement.removeClass('active');
this.recoverActive = true;
}
this.domElement.removeClass('hover');
}
break;
case 'mousedown':
if (this.domElement && this.cssEffects) {
this.domElement.addClass('active');
}
break;
case 'mouseup':
if (this.domElement && this.cssEffects) {
this.domElement.removeClass('active');
this.recoverActive = false;
}
break;
} // switch eventName
if (this.handlers[eventName]) {
let idx = 0;
const len = this.handlers[eventName].length;
for (; idx < len; idx++) {
const func = this.handlers[eventName][idx];
if (typeof(func) == 'function') {
// actual function reference
func(this, args);
}
else if ((typeof(func) == 'object') && (func.length == 2)) {
// PHP style object + method, i.e. [myObject, 'myMethod']
func[0][ func[1] ](this, args);
}
else if (typeof(func) == 'string') {
// name of function
window[func](this, args);
}
} // foreach event handler defined
} // user defined handler for event
}
};
-10
View File
@@ -1,10 +0,0 @@
CWS €
е1Є—„PЌ\__Нq€QЈЕ<6»ЋР‡‘-9&шDk€јялw”­щ¶KC{Ќ]0/
ҐЭxCрМч]F=сВw¬В/,рk®Уiъ4°
iёе„—^ЙЌNаDLnvЈИч
!‹^PПЄuѓРт-ЧiЅЌ}—Д±дF8Ю™ВйО{ЏЋчЃмп"xФ-нf`Яг{›¶X№пЙС4jЩк№Я
™qБ±E]WIЭn”тuяТѓw¤0ўgl ЫЏe‡ѕЕФЭЧ;µЈ7{ыGjxГeZ„WaДО•kuyuWx9Зуы—uяњ:ћvаS‹ы^ЫЯЏ4ч“Їuh@Пїv(Н_Y+љіЈЁіU­RЛoІµ–^ЭilV7tэIµЩuЬИсrй‘ЭИqГ‘>m·RmъЙzє§йkѕс+±`¦?(‘Ћ¶"з‚ҐЃ“я“dкцШJ@=“˜ZЪЩXњЧтџо*gнШN+T›мМсцЧidK—ЋЕmЫхэ@¶™sfGЉРЛ—ь$‰є›*ФІj¶гZЪaЬћд@©v°_ыaђ‡7Ђ—ҐЗЌЭ7ЖП»/Х edЭxхЈ’ВгџrqNЮ¤&mЅг†ЁIQ”wў‘t3П_Ы§7¤рNt\ЮЁвїК-ф)SъLЗтЛ?\ЖeЎ гІ„Кѓе) Ќ Кby©"WоUоWT++ ¤(¬ЁZNМЉѓҐЎЗЂ DAIўЃ”)¤
d„Y s@оІ ж1ђ «@ЦЂTЃик:g6ФMny д а/Ђ| д+ [@ѕт
ђoЃ|к6АђgЂл м‚°Вs
%Sfш"8эИ‡p6H°(©"d>k$Ѓ‚‘ў"¤ 8—X>¦в9¤bQДHC˜k!ффзњ’€¦МВКђ©® П"'Йmr4#…Ыd9#ЕЫдXFJ2СтаћюjщOЅ·ЏМў9Ш.С!sxеЋ1‚>нµЛн±ЅQЬ?qЋOU†]Ь®Шк©|"}/![6е%:)SnOЇbгЋБZ6g’аЩЅ9њБ»уў)W1]8Y4ecKн{¦bЬ' |°Ќoат6№Ѓ·…ёІ-Ж°°ў™`¬Ж hжSЧц4­
Ї!<ЃdBTMйй§№ЏvЋ ™oКйч‰ыcЬЇљ9CЗYЉw}TВхџпй є№®›є№©›ЏtSвїЧh:YvъtxҐя}smsжoO·љ$
-263
View File
@@ -1,263 +0,0 @@
var xmlHttpp = [];
function screenSize() {
var w, h;
w = (window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));
h = (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
return {w:w, h:h};
}
function endingsForm(n, form1, form2, form5) {
var last_digit = n % 10;
var last_two_digits = n % 100;
if(last_digit == 1 && last_two_digits != 11) {
return form1;
}
if((last_digit == 2 && last_two_digits != 12) || (last_digit == 3 && last_two_digits != 13) || (last_digit == 4 && last_two_digits != 14)) {
return form2;
}
return form5
}
/**
* Function : dump()
* Arguments: The data - array,hash(associative array),object
* The level - OPTIONAL
* Returns : The textual representation of the array.
* This function was inspired by the print_r function of PHP.
* This will accept some data as the argument and return a
* text that will be a more readable version of the
* array/hash/object that is given.
* Docs: http://www.openjs.com/scripts/others/dump_function_php_print_r.php
*/
function dump(arr,level) {
var dumped_text = "";
if(!level) level = 0;
//The padding given at the beginning of the line.
var level_padding = "";
for(var j=0;j<level+1;j++) level_padding += " ";
if(typeof(arr) == 'object') { //Array/Hashes/Objects
for(var item in arr) {
var value = arr[item];
if(typeof(value) == 'object') { //If it is an array,
dumped_text += level_padding + "'" + item + "' ...\n";
dumped_text += dump(value,level+1);
} else {
dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
}
}
} else { //Stings/Chars/Numbers etc.
dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
}
return dumped_text;
}
/*
Загрузить HTML в контейнер
*/
function ajaxLoad(url,iid,params){
xmlHttpp[iid]=GetXmlHttpObject1();
if (xmlHttpp[iid]==null){
alert ("Browser does not support HTTP Request");
return
}
//document.getElementById(iid).innerHTML="<img src='./i/loading2.gif' />";
//var url="./ajax/"+func+".php"
xmlHttpp[iid].open("POST",url,true);
xmlHttpp[iid].onreadystatechange=function() {
var container = null;
if (xmlHttpp[iid].readyState==4 || xmlHttpp[iid].readyState=="complete") {
if(xmlHttpp[iid].responseText.indexOf('<!--CONTAINER=') == 0){
var a = xmlHttpp[iid].responseText.indexOf('-->');
if(a >= 0){
var b = xmlHttpp[iid].responseText.substr(14,a-14);
if(document.getElementById(b) != undefined){
container = document.getElementById(b);
} else{
throw "Указаный в редиректе контейнер не найден";
}
}
}else{
container = document.getElementById(iid);
}
//container.innerHTML = xmlHttpp[iid].responseText;
$('#'+container.id).html(xmlHttpp[iid].responseText);
scripts = container.getElementsByTagName('script');
var loadJS = null;
for(var i = 0; i < scripts.length; i++){
if(scripts[i].id == ''){ // нет ID просто EVAL
eval(scripts[i].text);
}else{ // пробуем встраивать
scriptId = scripts[i].id;
scripts[i].id = '';
if(!document.getElementById(scriptId)){ // не загружен - встраиваем!
loadJS = document.createElement("script");
loadJS.setAttribute("type","text/javascript");
loadJS.setAttribute("id",scriptId);
loadJS.text = scripts[i].text;
document.getElementsByTagName('head')[0].appendChild(loadJS);
}
scripts[i].parentNode.removeChild(scripts[i]);
i--;
} // попытка встраивания
} // for по коллекции скриптов
// Вызываем своё событие
$(window).trigger('ajaxLoadComplete');
}
};
xmlHttpp[iid].setRequestHeader("Accept-Charset", "windows-1251");
xmlHttpp[iid].setRequestHeader("Accept-Language","ru, en");
xmlHttpp[iid].setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttpp[iid].setRequestHeader("Connection", "close");
var tmp = '';
for(var i in params){
tmp+='&'+i+'='+encodeURIComponent(params[i]);
}
tmp = 'ajax_mode=load&ajax_target='+iid+tmp;
xmlHttpp[iid].send(tmp);
}
function GetXmlHttpObject1(){
var xmlHttp1=null;
try {
// Firefox, Opera 8.0+, Safari
xmlHttp1=new XMLHttpRequest();
}catch(e){
//Internet Explorer
try {
xmlHttp1=new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
xmlHttp1=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp1;
}
appearance = {
info: function(){
$('div#appearance_out').text('info');
},
drop: function(){
$('div#appearance_out').text('drop');
},
use: function(){
$('div#appearance_out').text('use');
},
error: function(){
$('div#appearance_out').text('error');
}
};
core = {
grabLogin: null,
_findGrabLogin: function(input) {
var tmp = null;
if('string' == typeof input) {
tmp = $('#'+input);
} else if(input instanceof $) {
tmp = input;
} else if(input.tagName == 'INPUT' && input.type == 'text') {
tmp = $(input);
}
if(!(tmp instanceof $) || tmp.length < 1) {
alert('ОШИБКА! Неизвестный параметр core._findGrabLogin ['+input+']');
return null;
}
return tmp.get(0);
},
setGrabLogin: function(input){
var tmp = this._findGrabLogin(input);
this.clearGrabLogin();
this.grabLogin = tmp;
return $(tmp).addClass('grabLogin').select();
},
clearGrabLogin: function(){
$('input.grabLogin').removeClass('grabLogin');
this.grabLogin = null;
},
toggleGrabLogin: function(input){
var tmp = this._findGrabLogin(input);
if($(tmp).hasClass('grabLogin')){
this.clearGrabLogin();
}else{
this.setGrabLogin(tmp);
}
},
refresh: function(){
document.location = document.location;
}
};
function str_replace ( search, replace, subject ) {
if(!(replace instanceof Array)){
replace=new Array(replace);
if(search instanceof Array){
while(search.length>replace.length){
replace[replace.length]=replace[0];
}
}
}
if(!(search instanceof Array))search=new Array(search);
while(search.length>replace.length){
replace[replace.length]='';
}
if(subject instanceof Array){
for(k in subject){
subject[k]=str_replace(search,replace,subject[k]);
}
return subject;
}
for(var k=0; k<search.length; k++){
var i = subject.indexOf(search[k]);
while(i>-1){
subject = subject.replace(search[k], replace[k]);
i = subject.indexOf(search[k],i);
}
}
return subject;
}
(function ($) {
$.fn.vAlign = function() {
return this.each(function(i){
var ah = $(this).height();
var ph = $(this).parent().height();
var mh = (ph - ah) / 2;
$(this).css('margin-top', mh);
});
};
})(jQuery);
// GENERATE UNIQUE ID DOM-ELEMENTS
(function($) {
$.fn.genId = function(prefix,params){
return this.each(function(){
var counter = 0;
var id;
do{
id = (prefix ? prefix + '-' : '_') + (counter++);
}while(document.getElementById(id));
$(this).attr('id', id);
return this;
});
};
})(jQuery);
-369
View File
@@ -1,369 +0,0 @@
var Hint3Name = '';
step=0;
top.is_qlaunch = 0;
function errmess(s)
{
messid.innerHTML='<B>'+s+'</B>';
highlight();
}
function highlight()
{
if (step) return(0);
step=10;
setTimeout(dohi,50);
}
function dohi()
{
var hx=new Array(0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F");
step--;
messid.style.color="#"+hx[Math.floor(15-step/2)]+((step&1)?"F":"8")+"0000";
if (step>0) setTimeout(dohi,50);
}
function fixspaces(s)
{
while (s.substr(s.length-1,s.length)==" ") s=s.substr(0,s.length-1);
while (s.substr(0,1)==" ") s=s.substr(1,s.length);
return(s);
}
// Заголовок, название скрипта, имя поля с логином
function findlogin(title, script, name, defaultlogin, mtype, addon, need_defend) {
var s;
if (need_defend && defend==false) {
defend = -1;
// errmess("Блок не выбран."); return false;
}
if (need_defend) {
addon+="<INPUT type=hidden name='mdefend' value='"+defend+"'>";
addon+="<INPUT type=hidden name='enemy' value='"+enemy+"'>";
addon+="<INPUT type=hidden name='myid' value='"+myid+"'>";
}
s='<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="'+script+'" method=POST name=slform><td colspan=2>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right style="padding-left:5"><INPUT style="width: 100%" TYPE="text" NAME="'+name+'" value="'+defaultlogin+'"></TD><TD width=50%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" onclick="slform.'+name+'.value=fixspaces(slform.'+name+'.value);">'+(addon?addon:'')+'</TD></TR></FORM></TABLE>';
s = crtmagic(mtype, title, s);
document.all("hint4").innerHTML = s;
document.all("hint4").style.visibility = "visible";
document.all("hint4").style.left = 100;
document.all("hint4").style.zIndex = 200;
document.all("hint4").style.top = document.body.scrollTop+50;
document.all(name).focus();
Hint3Name = name;
}
// Заголовок, название скрипта, имя поля с логином
function bank_open(ac_list, ac_def, skipz, name) {
var ac = ac_list.split(',');
var s;
var addon = '<INPUT type=hidden name="ac_open" value="' + Math.random() +'">';
var hint = 'Выберите счёт и введите пароль';
var title = 'Счёт в банке';
var opt = '<select name="num" size=0 style="width: 100px">';
for (var i=0; i<ac.length; i++){
opt += '<option value="' + ac[i] + '"' +((ac_def && (ac_def == ac[i]))?' selected':'')+ '>'+ ac[i] + '</option>';
}
opt += '</select>';
//alert (opt);
s='<table border=0 width=100% cellspacing="0" cellpadding="2" ><tr>'+
'<form action="?" method="POST" name=slform>'+
'<input type=hidden name=edit value=2>'+
'<td colspan=2 align=center>'+ hint + '</TD></TR>' +
'<TR><TD width=84% align=right style="padding-left:5">' + opt+ '&nbsp;<input style="width: 100px" type="password" name="psw" size="12" maxlength="30"></TD>' +
'<TD width=16%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" >'+(addon?addon:'')+'</TD></TR></FORM></TABLE>';
s = crtmagic('', title, s,"",skipz);
if (!name) {name = "hint4"};
document.all(name).innerHTML = s;
document.all(name).style.visibility = "visible";
if (!skipz) {
document.all(name).style.left = 100;
document.all(name).style.zIndex = 200;
document.all(name).style.top = document.body.scrollTop+50;
}
document.all('num').focus();
Hint3Name = 'num';
for (var i=0; i<ac.length; i++){
opt += '<option value="' + ac[i] + '"' +((ac_def && ac_def == ac[i])?' selected':'')+ '>'+ ac[i] + '</option>';
}
opt += '</select>';
}
function bank_info() {
alert('У Вас нет активных счетов. \n\n На правах рекламы: Вы можете открыть счёт в Банке БК,'+
' на Страшилкиной улице*\n\n* Мелким шрифтом: услуга платная.');
}
function bank_blocked(tm) {
var s = 'Ваши счета заблокированы (ещё '+ tm + ').';
alert(s);
}
function get_bank_pwd(){
}
function b_confirm(script, txt, mtype, addon, need_defend) {
if (need_defend && defend==false) {
defend=-1
// errmess("Блок не выбран."); return false;
}
if (need_defend) {
addon+="<INPUT type=hidden name='mdefend' value='"+defend+"'>";
addon+="<INPUT type=hidden name='enemy' value='"+enemy+"'>";
addon+="<INPUT type=hidden name='myid' value='"+myid+"'>";
}
dialogconfirm('Подтверждение', '/battle.pl', '<TABLE width=100%><TD><B>'+txt+'</B><BR>Использовать сейчас?</TABLE>'+addon, mtype);
}
function dialogconfirm(title, script, text, mtype) {
var s;
s='<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="'+script+'" method=POST name=slform><td colspan=2>'+
text+'</TD></TR><TR><TD width=50% align=left><INPUT TYPE="button" name="tmpname423" value="Да" style="width:70%" onclick="if (!top.is_qlaunch) { slform.submit(); } else { top.QLaunchQuery(slform.use.value); closehint3(); } "></TD><TD width=50% align=right><INPUT type=button style="width:70%" value="Нет" onclick="closehint3();"></TD></TR></FORM></TABLE>';
s = crtmagic(mtype, title, s);
document.all("hint4").innerHTML = s;
document.all("hint4").style.visibility = "visible";
document.all("hint4").style.left = 100;
document.all("hint4").style.zIndex = 200;
document.all("hint4").style.top = document.body.scrollTop+50;
document.all("tmpname423").focus();
Hint3Name = name;
}
function dialogOK(title, text, mtype) {
var s;
s='<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><td colspan=2>'+
text+'</TD></TR><TR><TD width=100% align=right><INPUT type=button style="width:70%" value="Закрыть" onclick="closehint3();"></TD></TR></FORM></TABLE>';
s = crtmagic(mtype, title, s);
document.all("hint4").innerHTML = s;
document.all("hint4").style.visibility = "visible";
document.all("hint4").style.left = 100;
document.all("hint4").style.zIndex = 200;
document.all("hint4").style.top = document.body.scrollTop+50;
Hint3Name = name;
}
function foundmagictype (mtypes) {
if (mtypes) {
mtypes=mtypes+"";
if (mtypes.indexOf(',') == -1) return parseInt(mtypes);
var s=mtypes.split(',');
var found=0;
var doubl=0;
var maxfound=0;
for (i=0; i < s.length; i++) {
var k=parseInt(s[i]);
if (k > maxfound) {
found=i + 1;
maxfound=k;
doubl=0;
} else {
if (k == maxfound) {doubl=1;}
}
}
if (doubl) {return 0};
return found;
}
return 0;
}
// Для магии. Заголовок, название скрипта, название магии, номер вещицы в рюкзаке, логин по умолчанию, описание доп. поля
function magicklogin(title, script, magickname, n, defaultlogin, extparam, mtype) {
var s = '<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="'+script+'" method=POST name=slform><input type=hidden name="use" value="'+magickname+'"><input type=hidden name="n" value="'+n+'"><td colspan=2>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD style="padding-left:5" width=50% align=right><INPUT TYPE="text" NAME="param" value="'+defaultlogin+'" style="width: 100%"></TD><TD width=50%><IMG SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" onclick="slform.param.value=fixspaces(slform.param.value); if (!top.is_qlaunch) { slform.submit(); } else { top.QLaunchQuery(\'' + magickname + '\', slform.param.value); closehint3(); } " onmouseover="this.style.cursor = \'hand\';" onmouseout="this.style.cursor = \'\';"></TD></TR>';
if (extparam != null && extparam != '') {
s = s + '<TR><td style="padding-left:5">'+extparam+'<BR><INPUT style="width: 100%" TYPE="text" NAME="param2"></TD><TD></TR>';
}
s = s + '</FORM></TABLE>';
s = crtmagic(mtype, title, s);
document.all("hint4").innerHTML = s;
document.all("hint4").style.visibility = "visible";
document.all("hint4").style.left = 100;
document.all("hint4").style.zIndex = 200;
document.all("hint4").style.top = document.body.scrollTop+50;
document.all("param").focus();
Hint3Name = 'param';
}
// Магия
function UseMagick(title, script, name, extparam, n, extparam2, mtype) {
if ((extparam != null)&&(extparam != '')) {
var t1='text',t2='text';
if (extparam.substr(0,1) == "!")
{
t1='password';
extparam=extparam.substr(1,extparam.length);
}
var s = '<table border=0 width=100% cellspacing="1" cellpadding="0"><TR><form action="'+script+'" method=POST name=slform><input type=hidden name="use" value="'+name+'"><input type=hidden name="n" value="'+n+'"><td colspan=2 align=left><NOBR><SMALL>'+
extparam + ':</NOBR></TD></TR><TR><TD width=100% align=left style="padding-left:5"><INPUT tabindex=1 style="width: 100%" TYPE="'+t1+'" id="param" NAME="param" value=""></TD><TD width=10%><IMG SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" tabindex=3 onclick="if (!top.is_qlaunch) { slform.submit(); } else { top.QLaunchQuery(\'' + name + '\', slform.param.value ' + ((extparam2 != null && extparam2 != '') ? ', slform.param2.value' : '') + ' ); closehint3(); } " onmouseover="this.style.cursor = \'hand\';" onmouseout="this.style.cursor = \'\';"></TD></TR>';
if (extparam2 != null && extparam2 != '') {
if (extparam2.substr(0,1) == "!")
{
t2='password';
extparam2=extparam2.substr(1,extparam2.length);
}
s = s + '<TR><td colspan=2><NOBR><SMALL>'+extparam2+':</NOBR><TR style="padding-left:5"><TD><INPUT tabindex=2 TYPE="'+t2+'" id="param2" NAME="param2" style="width: 50%"></TD><TD></TR>';
}
s += '</FORM></TABLE>';
s = crtmagic(mtype, title, s);
document.all("hint4").innerHTML = s;
document.all("hint4").style.visibility = "visible";
document.all("hint4").style.left = 100;
document.all("hint4").style.zIndex = 200;
document.all("hint4").style.top = document.body.scrollTop+50;
document.all("param").focus();
Hint3Name = 'param';
} else {
dialogconfirm('Подтверждение', script, '<TABLE width=100%><TD><IMG src="http://img.combats.com/i/items/'+name+'.gif"></TD><TD>Использовать сейчас?</TABLE>'+
'<input type=hidden name="use" id="use" value="'+name+'"><input type=hidden name="n" value="'+n+'">', mtype);
}
}
// Закрывает окно ввода логина
function closehint3()
{
top.is_qlaunch = 0;
document.all("hint4").style.visibility="hidden";
Hint3Name='';
}
// Для боевой магии. Заголовок, название магии, номер вещицы в рюкзаке
function Bmagicklogin (title, magickname, n, defaultlogin, extparam, mtype) {
if (defend==false) {
defend=-1;
// errmess("Блок не выбран."); return false;
}
var s = '<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="/battle.pl" method=POST name="bmagic" onsubmit="bmagic.mdefend.value=defend;"><input type=hidden name="use" value="'+magickname+'"><input type=hidden name="n" value="'+n+'"><input type=hidden name="mdefend" value="'+defend+'"><input type=hidden name="enemy" value="'+enemy+'"><input type=hidden name="myid" value="'+myid+'"><td colspan=2 align=left>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT style="width: 100%" TYPE="text" id="param" NAME="param" value="'+defaultlogin+'"></TD><TD width=50%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" onclick="bmagic.param.value=fixspaces(bmagic.param.value);"></TD></TR>';
if (extparam != null && extparam != '') {
s = s + '<TR><td colspan=2>'+extparam+'<TR><TD style="padding-left:5"><INPUT style="width: 100%" TYPE="text" NAME="param2"><TD></TD></TR>';
}
s = s + '</FORM></TABLE>';
s = crtmagic(mtype, title, s);
document.all("hint4").innerHTML= s;
document.all("hint4").style.visibility = "visible";
document.all("hint4").style.left = 100;
document.all("hint4").style.zIndex = 200;
document.all("hint4").style.top = 60;
document.all("param").focus();
Hint3Name = 'param';
}
// Магия
function BUseMagick(name, extparam, n, mtype) {
if (defend==false) {
defend=-1;
// errmess("Блок не выбран."); return false;
}
if ((extparam != null)&&(extparam != '')) {
var s = prompt(extparam+':', '');
if ((s != null)&&(s != '')) {
re = /\%/g; s=s.replace(re, "%25");
re = /\+/g; s=s.replace(re, "%2B");
re = /\#/g; s=s.replace(re, "%23");
re = /\?/g; s=s.replace(re, "%3F");
re = /\&/g; s=s.replace(re, "%26");
window.location.href='/battle.pl?use='+name+'&param='+s+'&n='+n+'&mdefend='+defend+'&enemy='+enemy+'&myid='+myid;
}
} else {
dialogconfirm('Подтверждение', '/battle.pl', '<TABLE width=100%><TD><IMG src="http://img.combats.com/i/items/'+name+'.gif"></TD><TD>Использовать сейчас?</TABLE>'+
'<input type=hidden name="use" value="'+name+'"><input type=hidden name="n" value="'+n+'"><input type=hidden name="mdefend" value="'+defend+'"><input type=hidden name="enemy" value="'+enemy+'"><input type=hidden name="myid" value="'+myid+'">', mtype);
}
}
function crtmagic(mtype, title, body, subm, noclose) {
return crtmagic_full(mtype, title, body, subm, noclose, 270, 0);
}
function crtmagic_full(mtype, title, body, subm, noclose, dx, dy) {
//name, XYX, X1-X2-Y2, pad.LRU
mtype=foundmagictype(mtype);
var names=new Array(
'neitral',17, 6, 14, 17, 14, 7,0,0, 3,
'fire', 57, 30, 33, 20, 21, 14, 11, 12, 0,
'water', 57, 30, 33, 20, 21, 14, 11, 12, 0,
'air', 57, 30, 33, 20, 21, 14, 11, 12, 0,
'earth', 57,30, 33, 20, 21, 14, 11, 12, 0,
'white', 51, 25, 46, 44, 44, 10, 5, 5, 0,
'gray', 51, 25, 46, 44, 44, 10, 5, 5, 0,
'black', 51, 25, 46, 44, 44, 10, 5, 5, 0);
var colors=new Array('B1A993','DDD5BF', 'ACA396','D3CEC8', '96B0C6', 'BDCDDB', 'AEC0C9', 'CFE1EA', 'AAA291', 'D5CDBC', 'BCBBB6', 'EFEEE9', '969592', 'DADADA', '72726B', 'A6A6A0');
while (body.indexOf('#IMGSRC#')>=0) body = body.replace('#IMGSRC#', 'http://img.combats.com/i/misc/dmagic/'+names[mtype*10]+'_30.gif');
var s='<table width="'+dx+(dy?'" height="'+dy:'')+'" border="0" align="center" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+1]+'" align="left"><img src="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_03.gif" width="'+names[mtype*10+1]+'" height="'+names[mtype*10+2]+'"></td>'+
'<td width="100%" align="right" background="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_05.gif"></td>'+
'<td width="'+names[mtype*10+3]+'" align="right"><img src="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_07.gif" width="'+names[mtype*10+3]+'" height="'+names[mtype*10+2]+'"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr>'+
(names[mtype*10+7]?'<td width="'+names[mtype*10+7]+'"><SPAN style="width:'+names[mtype*10+7]+'">&nbsp;</SPAN></td>':'')+
'<td width="5" background="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_17.gif">&nbsp;</td>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td bgcolor="#'+colors[mtype*2]+'"'+(names[mtype*10+9]?' style="padding-top: '+names[mtype*10+9]+'"':'')+' >'+
'<table border=0 width=100% cellspacing="0" cellpadding="0"><td style="padding-left: 20" align=center><B>'+title+
'</td><td width=20 align=right valign=top style="cursor: hand" '+(noclose?'':'onclick="closehint3();" ') + 'style=\'filter:Gray()\' onmouseover="this.filters.Gray.Enabled=false" onmouseout="this.filters.Gray.Enabled=true"><IMG src="http://img.combats.com/i/clear.gif" width=13 height=13>&nbsp;</td></table>'+
'</td></tr>'+
'<tr>'+
'<td align="center" bgcolor="#'+colors[mtype*2+1]+'">'+body+
'</tr>'+
'</table></td>'+
'<td width="5" background="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_19.gif">&nbsp;</td>'+
(names[mtype*10+8]?'<td width="'+names[mtype*10+8]+'"><SPAN style="width:'+names[mtype*10+8]+'">&nbsp;</SPAN></td></td>':'')+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+4]+'" align="left"><img src="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_27.gif" width="'+names[mtype*10+4]+'" height="'+names[mtype*10+6]+'"></td>'+
'<td width="100%" align="right" background="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_29.gif"></td>'+
'<td width="'+names[mtype*10+5]+'" align="right"><img src="http://img.combats.com/i/misc/dmagic/b'+names[mtype*10]+'_31.gif" width="'+names[mtype*10+5]+'" height="'+names[mtype*10+6]+'"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table>';
return s;
}
+8 -11
View File
@@ -131,7 +131,7 @@ function initBBEditors() {
});
}
ImageSizeDetector = new Object();
ImageSizeDetector = {};
ImageSizeDetector.src = null;
ImageSizeDetector.img = null;
ImageSizeDetector.height = null;
@@ -154,7 +154,7 @@ ImageSizeDetector.isEmpty = function () {
return !ImageSizeDetector.isNotEmpty();
};
SmileParser = new Object();
SmileParser = {};
SmileParser.map = null;
SmileParser.init = function (callback) {
var url = "/js/forum_smiles.json";
@@ -210,9 +210,6 @@ SmileParser.prepareSmileList = function () {
};
SmileParser.oldMap = {
":)":"/i/forum/icon7.gif",
":(":"/i/smile/grust.gif",
":D":"/i/smile/laugh.gif",
";)":"/i/smile/wink.gif"
};
function storeCaret(text) {
@@ -271,20 +268,20 @@ function cs(s1, s2, formname) {
return false;
}
var map_en = new Array('s`h', 'S`h', 'S`H', 's`Х', 'sh`', 'Sh`', 'SH`', "'o",
var map_en = ['s`h', 'S`h', 'S`H', 's`Х', 'sh`', 'Sh`', 'SH`', "'o",
'yo', "'O", 'Yo', 'YO', 'zh', 'w', 'Zh', 'ZH', 'W', 'ch', 'Ch', 'CH',
'sh', 'Sh', 'SH', 'e`', 'E`', "'u", 'yu', "'U", 'Yu', "YU", "'a", 'ya',
"'A", 'Ya', 'YA', 'a', 'A', 'b', 'B', 'v', 'V', 'g', 'G', 'd', 'D',
'e', 'E', 'z', 'Z', 'i', 'I', 'j', 'J', 'k', 'K', 'l', 'L', 'm', 'M',
'n', 'N', 'o', 'O', 'p', 'P', 'r', 'R', 's', 'S', 't', 'T', 'u', 'U',
'f', 'F', 'h', 'H', 'c', 'C', '`', 'y', 'Y', "'");
var map_ru = new Array('сх', 'Сх', 'СХ', 'сХ', 'щ', 'Щ', 'Щ', 'ё', 'ё', 'Ё',
'f', 'F', 'h', 'H', 'c', 'C', '`', 'y', 'Y', "'"];
var map_ru = ['сх', 'Сх', 'СХ', 'сХ', 'щ', 'Щ', 'Щ', 'ё', 'ё', 'Ё',
'Ё', 'Ё', 'ж', 'ж', 'Ж', 'Ж', 'Ж', 'ч', 'Ч', 'Ч', 'ш', 'Ш', 'Ш', 'э',
'Э', 'ю', 'ю', 'Ю', 'Ю', 'Ю', 'я', 'я', 'Я', 'Я', 'Я', 'а', 'А', 'б',
'Б', 'в', 'В', 'г', 'Г', 'д', 'Д', 'е', 'Е', 'з', 'З', 'и', 'И', 'й',
'Й', 'к', 'К', 'л', 'Л', 'м', 'М', 'н', 'Н', 'о', 'О', 'п', 'П', 'р',
'Р', 'с', 'С', 'т', 'Т', 'у', 'У', 'ф', 'Ф', 'х', 'Х', 'ц', 'Ц', 'ъ',
'ы', 'Ы', 'ь');
'ы', 'Ы', 'ь'];
function convert(st) {
for (var i = 0; i < map_en.length; ++i)
@@ -294,7 +291,7 @@ function convert(st) {
}
function translate2(str) {
var strarr = new Array();
var strarr = [];
strarr = str.split(' ');
for (var k = 0; k < strarr.length; k++) {
if (strarr[k].indexOf("http://") < 0 && strarr[k].indexOf('@') < 0
@@ -305,7 +302,7 @@ function translate2(str) {
}
function translate(str2) {
var s = new Array();
var s = [];
s = str2.split('\n');
for (var i = 0; i < s.length; i++)
s[i] = translate2(s[i])
-129
View File
@@ -1,133 +1,4 @@
{
":smile0:":"/i/forum/icon7.gif",
":baby:":"/i/smile/baby.gif",
":sniper:":"/i/smile/sniper.gif",
":trup:":"/i/smile/trup.gif",
":beggar:":"/i/smile/beggar.gif",
":rotate:":"/i/smile/rotate.gif",
":hello:":"/i/smile/hello.gif",
":sten:":"/i/smile/sten.gif",
":shuffle:":"/i/smile/shuffle.gif",
":elix:":"/i/smile/elix.gif",
":smil:":"/i/smile/smil.gif",
":mdr:":"/i/smile/mdr.gif",
":podz:":"/i/smile/podz.gif",
":dont:":"/i/smile/dont.gif",
":grust:":"/i/smile/grust.gif",
":boks:":"/i/smile/boks.gif",
":susel:":"/i/smile/susel.gif",
":dedmoroz:":"/i/smile/dedmoroz.gif",
":creator:":"/i/smile/creator.gif",
":no:":"/i/smile/no.gif",
":horse:":"/i/smile/horse.gif",
":vamp:":"/i/smile/vamp.gif",
":eek:":"/i/smile/eek.gif",
":sorry:":"/i/smile/sorry.gif",
":friday:":"/i/smile/friday.gif",
":obm:":"/i/smile/obm.gif",
":smile:":"/i/smile/smile.gif",
":nail:":"/i/smile/nail.gif",
":gent:":"/i/smile/gent.gif",
":beer:":"/i/smile/beer.gif",
":inv:":"/i/smile/inv.gif",
":fire:":"/i/smile/fire.gif",
":dance1:":"/i/smile/dance1.gif",
":maniac:":"/i/smile/maniac.gif",
":kiss4:":"/i/smile/kiss4.gif",
":confused:":"/i/smile/confused.gif",
":kiss2:":"/i/smile/kiss2.gif",
":snowfight:":"/i/smile/snowfight.gif",
":row:":"/i/smile/row.gif",
":naem:":"/i/smile/naem.gif",
":radio1:":"/i/smile/radio1.gif",
":fie:":"/i/smile/fie.gif",
":love:":"/i/smile/love.gif",
":sneeze:":"/i/smile/sneeze.gif",
":mol:":"/i/smile/mol.gif",
":showng:":"/i/smile/showng.gif",
":rocket:":"/i/smile/rocket.gif",
":dustman:":"/i/smile/dustman.gif",
":rupor:":"/i/smile/rupor.gif",
":nnn:":"/i/smile/nnn.gif",
":snegur:":"/i/smile/snegur.gif",
":dance2:":"/i/smile/dance2.gif",
":jeer:":"/i/smile/jeer.gif",
":kiss:":"/i/smile/kiss.gif",
":ponder:":"/i/smile/ponder.gif",
":drink:":"/i/smile/drink.gif",
":angel:":"/i/smile/angel.gif",
":idea:":"/i/smile/idea.gif",
":lady:":"/i/smile/lady.gif",
":gun:":"/i/smile/gun.gif",
":pif:":"/i/smile/pif.gif",
":help:":"/i/smile/help.gif",
":alch:":"/i/smile/alch.gif",
":kiss3:":"/i/smile/kiss3.gif",
":hug:":"/i/smile/hug.gif",
":lordhaos:":"/i/smile/lordhaos.gif",
":rose:":"/i/smile/rose.gif",
":radio2:":"/i/smile/radio2.gif",
":boks2:":"/i/smile/boks2.gif",
":str:":"/i/smile/str.gif",
":invis:":"/i/smile/invis.gif",
":rev:":"/i/smile/rev.gif",
":ok:":"/i/smile/ok.gif",
":alien:":"/i/smile/alien.gif",
":smash:":"/i/smile/smash.gif",
":super:":"/i/smile/super.gif",
":love2:":"/i/smile/love2.gif",
":victory:":"/i/smile/victory.gif",
":kruger:":"/i/smile/kruger.gif",
":agree:":"/i/smile/agree.gif",
":hi:":"/i/smile/hi.gif",
":privet:":"/i/smile/privet.gif",
":devil:":"/i/smile/devil.gif",
":naem2:":"/i/smile/naem2.gif",
":tongue:":"/i/smile/tongue.gif",
":red:":"/i/smile/red.gif",
":doc:":"/i/smile/doc.gif",
":icon7:":"/i/forum/icon7.gif",
":lightfly:":"/i/smile/lightfly.gif",
":owl:":"/i/smile/owl.gif",
":pirate:":"/i/smile/pirate.gif",
":sword:":"/i/smile/sword.gif",
":bye:":"/i/smile/bye.gif",
":mad:":"/i/smile/mad.gif",
":fingal:":"/i/smile/fingal.gif",
":nono:":"/i/smile/nono.gif",
":loveya:":"/i/smile/loveya.gif",
":cry:":"/i/smile/cry.gif",
":superng:":"/i/smile/superng.gif",
":yes:":"/i/smile/yes.gif",
":crying:":"/i/smile/crying.gif",
":'(":"/i/smile/crying.gif",
":flowers:":"/i/smile/flowers.gif",
":tease:":"/i/smile/tease.gif",
":wink:":"/i/smile/wink.gif",
":sharp:":"/i/smile/sharp.gif",
":nunu:":"/i/smile/nunu.gif",
":angel2:":"/i/smile/angel2.gif",
":naem3:":"/i/smile/naem3.gif",
":lick:":"/i/smile/lick.gif",
":ninja:":"/i/smile/ninja.gif",
":cat:":"/i/smile/cat.gif",
":smoke:":"/i/smile/smoke.gif",
":chtoza:":"/i/smile/chtoza.gif",
":grace:":"/i/smile/grace.gif",
":tongue2:":"/i/smile/tongue2.gif",
":sorry2:":"/i/smile/sorry2.gif",
":yar:":"/i/smile/yar.gif",
":king2:":"/i/smile/king2.gif",
":carreat:":"/i/smile/carreat.gif",
":hlw:":"/i/smile/hlw.gif",
":grenade:":"/i/smile/grenade.gif",
":bow:":"/i/smile/bow.gif",
":doc2:":"/i/smile/doc2.gif",
":duel:":"/i/smile/duel.gif",
":mag:":"/i/smile/mag.gif",
":king:":"/i/smile/king.gif",
":laugh:":"/i/smile/laugh.gif",
":pal:":"/i/smile/pal.gif",
":nun:":"/i/smile/nun.gif",
":ura:":"/i/smile/ura.gif"
}
-142
View File
@@ -1,142 +0,0 @@
function close_hint(id) {
document.getElementById('hint'+id+'').style.visibility = 'hidden';
Hint3Name = '';
}
function DrawBar(title, id, flags, link_text, link){
var s ='<table width="100%" border=0 cellspacing=0 cellpadding=1 background="http://img.combats.com/i/icon/back.gif">' +
'<tr><td valign=top>';
var sz = 11, num = 1;
var rnd = Math.random();
s += '<a name="bar__'+id+'" href="?edit='+rnd+'&bar='+id+'&a=explore&is_open='+(1-(flags & 1))+'#bar_'+id+'">';
if (flags & 1) {
s+= '<img width='+sz+' height=9 alt="Скрыть" border=0 src="http://img.combats.com/i/icon/'+num+'minus.gif">';
} else {
s+= '<img width='+sz+' height=9 alt="Показать" border=0 src="http://img.combats.com/i/icon/'+num+'plus.gif">';
}
s += '</a> </td>';
s += '<td>&nbsp;</td><td bgcolor="#e2e0e0"><small>&nbsp;<b>'+title+':<b>&nbsp;</small></td>';
if (link_text){
s += '<td>&nbsp;</td><td bgcolor="#e2e0e0"><small>&nbsp;<a href="'+link+'">'+link_text+'</a>&nbsp;</small></td>';
}
s += '<td align=right valign=top width="100%">';
s += ' </td>';
s += '</tr></table>';
document.writeln(s);
}
function splitstack(title, script, img, st) {
var s;
if (st==1) {
s='<form action="'+script+'" method=POST name=slform><table border=0 width=100% cellspacing="0" cellpadding="2"><tr><td colspan=2>'+
'<TABLE width=100%><TD><IMG src="/i/sh/'+img+'"></TD><TD>\u0420\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u044C \u043F\u0440\u0435\u0434\u043C\u0435\u0442 <b>'+title+'</b></TABLE> \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E: <input type="text" name="qty" value="1"> </TD></TR><TR><TD width=50% align=left><INPUT TYPE="button" name="tmpname423" value="\u0414\u0430" style="width:70%" onclick="if (!top.is_qlaunch) { slform.submit(); } else { top.QLaunchQuery(slform.use.value); closehint3(); } "></TD><TD width=50% align=right><INPUT type=button style="width:70%" value="\u041D\u0435\u0442" onclick="closehint3();"></TD></TR></TABLE></FORM>';
s = crtmagic(0, '\u0420\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u044C \u043F\u0440\u0435\u0434\u043C\u0435\u0442?', s);
} else {
s='<form action="'+script+'" method=POST name=slform><table border=0 width=100% cellspacing="0" cellpadding="2"><tr><td colspan=2>'+
'<TABLE width=100%><TD><IMG src="/i/sh/'+img+'"></TD><TD>\u0420\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u044C \u043D\u0430 \u0440\u0430\u0432\u043D\u044B\u0435 \u0447\u0430\u0441\u0442\u0438 <b>'+title+'</b></TABLE> \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0447\u0430\u0441\u0442\u0435\u0439: <input type="text" name="qty" value="2"> </TD></TR><TR><TD width=50% align=left><INPUT TYPE="button" name="tmpname423" value="\u0414\u0430" style="width:70%" onclick="if (!top.is_qlaunch) { slform.submit(); } else { top.QLaunchQuery(slform.use.value); closehint3(); } "></TD><TD width=50% align=right><INPUT type=button style="width:70%" value="\u041D\u0435\u0442" onclick="closehint3();"></TD></TR></TABLE></FORM>';
s = crtmagic(0, '\u0420\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u044C \u043D\u0430 \u0440\u0430\u0432\u043D\u044B\u0435?', s);
}
document.all("hint3").innerHTML = s;
document.all("hint3").style.visibility = "visible";
document.all("hint3").style.left = 200;
document.all("hint3").style.top = 100;
if (!("autofocus" in document.createElement("input"))) {document.all("tmpname423").focus();}
Hint3Name = name;
}
var sd4 = 0;
function foundmagictype (mtypes) {
if (mtypes) {
mtypes=mtypes+"";
if (mtypes.indexOf(',') == -1) return parseInt(mtypes);
var s=mtypes.split(',');
var found=0;
var doubl=0;
var maxfound=0;
for (i=0; i < s.length; i++) {
var k=parseInt(s[i]);
if (k > maxfound) {
found=i + 1;
maxfound=k;
doubl=0;
} else {
if (k == maxfound) {doubl=1;}
}
}
if (doubl) {return 0};
return found;
}
return 0;
}
function crtmagic(mtype, title, body, subm, noclose) {
return crtmagic_full(mtype, title, body, subm, noclose, 270, 0);
}
function crtmagic_full(mtype, title, body, subm, noclose, dx, dy) {
//name, XYX, X1-X2-Y2, pad.LRU
mtype=foundmagictype(mtype);
var names=new Array(
'neitral',17, 6, 14, 17, 14, 7,0,0, 3,
'fire', 57, 30, 33, 20, 21, 14, 11, 12, 0,
'water', 57, 30, 33, 20, 21, 14, 11, 12, 0,
'air', 57, 30, 33, 20, 21, 14, 11, 12, 0,
'earth', 57,30, 33, 20, 21, 14, 11, 12, 0,
'white', 51, 25, 46, 44, 44, 10, 5, 5, 0,
'gray', 51, 25, 46, 44, 44, 10, 5, 5, 0,
'black', 51, 25, 46, 44, 44, 10, 5, 5, 0);
var colors=new Array('B1A993','DDD5BF', 'ACA396','D3CEC8', '96B0C6', 'BDCDDB', 'AEC0C9', 'CFE1EA', 'AAA291', 'D5CDBC', 'BCBBB6', 'EFEEE9', '969592', 'DADADA', '72726B', 'A6A6A0');
while (body.indexOf('#IMGSRC#')>=0) body = body.replace('#IMGSRC#', '/i/misc/dmagic/'+names[mtype*10]+'_30.gif');
var s='<table width="'+dx+(dy?'" height="'+dy:'')+'" border="0" align="center" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+1]+'" align="left"><img src="/i/misc/dmagic/b'+names[mtype*10]+'_03.gif" width="'+names[mtype*10+1]+'" height="'+names[mtype*10+2]+'"></td>'+
'<td width="100%" align="right" background="/i/misc/dmagic/b'+names[mtype*10]+'_05.gif"></td>'+
'<td width="'+names[mtype*10+3]+'" align="right"><img src="/i/misc/dmagic/b'+names[mtype*10]+'_07.gif" width="'+names[mtype*10+3]+'" height="'+names[mtype*10+2]+'"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr>'+
(names[mtype*10+7]?'<td width="'+names[mtype*10+7]+'"><SPAN style="width:'+names[mtype*10+7]+'">&nbsp;</SPAN></td>':'')+
'<td width="5" background="/i/misc/dmagic/b'+names[mtype*10]+'_17.gif">&nbsp;</td>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td bgcolor="#'+colors[mtype*2]+'"'+(names[mtype*10+9]?' style="padding-top: '+names[mtype*10+9]+'"':'')+' >'+
'<table border=0 width=100% cellspacing="0" cellpadding="0"><td style="padding-left: 20" align=center><B>'+title+
'</td><td width=20 align=right valign=top style="cursor: hand" '+(noclose?'':'onclick="close_hint(4);" ') + ' /><IMG src="/i/clear.gif" width=13 height=13>&nbsp;</td></table>'+
'</td></tr>'+
'<tr>'+
'<td align="center" bgcolor="#'+colors[mtype*2+1]+'">'+body+
'</tr>'+
'</table></td>'+
'<td width="5" background="/i/misc/dmagic/b'+names[mtype*10]+'_19.gif">&nbsp;</td>'+
(names[mtype*10+8]?'<td width="'+names[mtype*10+8]+'"><SPAN style="width:'+names[mtype*10+8]+'">&nbsp;</SPAN></td></td>':'')+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+4]+'" align="left"><img src="/i/misc/dmagic/b'+names[mtype*10]+'_27.gif" width="'+names[mtype*10+4]+'" height="'+names[mtype*10+6]+'"></td>'+
'<td width="100%" align="right" background="/i/misc/dmagic/b'+names[mtype*10]+'_29.gif"></td>'+
'<td width="'+names[mtype*10+5]+'" align="right"><img src="/i/misc/dmagic/b'+names[mtype*10]+'_31.gif" width="'+names[mtype*10+5]+'" height="'+names[mtype*10+6]+'"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table>';
return s;
}
-131
View File
@@ -1,131 +0,0 @@
function findlogin2(title, script, name) {
var s = '<form action="'+script+'" method=POST><table width=270 cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>'+title+'</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>';
s +='<table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><td align=center>';
s +='<table width=90% cellspacing=0 cellpadding=2 align=center><tr><td align=left colspan="2">';
s +='Укажите логин персонажа:<br><small>(можно щелкнуть по логину в чате)</small></td></tr>';
s += '<tr><td align=right><small><b>Логин:</b></small></td><td><INPUT TYPE=text NAME="'+name+'" style="width:140px"></td></tr>';
s += '<INPUT type=image SRC=i/friend/b__ok.gif WIDTH=25 HEIGHT=18 ALT="Добавить контакт" style="border:0; vertical-align: middle"></TD></TR></TABLE><INPUT TYPE=hidden name=sd4 value="1"></TD></TR></TABLE></td></tr></table></FORM>';
document.all("hint3").innerHTML = s;
document.all("hint3").style.visibility = "visible";
document.all("hint3").style.left = 100;
document.all("hint3").style.top = document.body.scrollTop+50;
document.all(name).focus();
Hint3Name = name;
}
function findlogin(title, script, name) {
var s;
s = '<form action="'+script+'" method=POST name=slform><table border=0 width=100% cellspacing="0" cellpadding="2"><tr><td colspan=2>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043B\u043E\u0433\u0438\u043D \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u0436\u0430: <br><small>(\u041C\u043E\u0436\u043D\u043E \u043A\u043B\u0438\u043A\u043D\u0443\u0442\u044C \u043F\u043E \u043B\u043E\u0433\u0438\u043D\u0443 \u0432 \u0447\u0430\u0442\u0435)</small>'+
'</TD></TR><TR><TD width=50% align=right style="padding-left:5">'+
'<input style="width: 100%" type="text" name="'+name+'" id="'+name+'" /></TD><TD width=50%>'+
'<input type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 alt="" onclick="slform.submit();" /></TD></TR></TABLE></FORM>';
s = crtmagic(5, title, s);
document.getElementById("hint3").innerHTML = s;
document.getElementById("hint3").style.visibility = "visible";
document.getElementById("hint3").style.left = 200;
document.getElementById("hint3").style.top = 100;
Hint3Name = name;
document.getElementById(name).focus();
}
var sd4 = 0;
function foundmagictype(mtypes) {
if(mtypes) {
mtypes = mtypes+"";
if(mtypes.indexOf(',') == -1) {
return parseInt(mtypes);
}
var s = mtypes.split(',');
var found = 0;
var doubl = 0;
var maxfound = 0;
for(i = 0; i < s.length; i++) {
var k = parseInt(s[i]);
if(k > maxfound) {
found = i + 1;
maxfound = k;
doubl = 0;
} else {
if(k == maxfound) {
doubl = 1;
}
}
}
if(doubl) {
return 0
};
return found;
}
return 0;
}
function crtmagic(mtype, title, body, subm, noclose) {
return crtmagic_full(mtype, title, body, subm, noclose, 270, 0);
}
function closehint3() {
document.getElementById("hint3").style.visibility = "hidden";
Hint3Name = '';
}
function crtmagic_full(mtype, title, body, subm, noclose, dx, dy) {
mtype = foundmagictype(mtype);
var names = new Array('neitral',17, 6, 14, 17, 14, 7,0,0, 3, 'fire', 57, 30, 33, 20, 21, 14, 11, 12, 0, 'water', 57, 30, 33, 20, 21, 14, 11, 12, 0, 'air', 57, 30, 33, 20, 21, 14, 11, 12, 0, 'earth', 57,30, 33, 20, 21, 14, 11, 12, 0, 'white', 51, 25, 46, 44, 44, 10, 5, 5, 0, 'gray', 51, 25, 46, 44, 44, 10, 5, 5, 0, 'black', 51, 25, 46, 44, 44, 10, 5, 5, 0);
var colors = new Array('B1A993','DDD5BF', 'ACA396','D3CEC8', '96B0C6', 'BDCDDB', 'AEC0C9', 'CFE1EA', 'AAA291', 'D5CDBC', 'BCBBB6', 'EFEEE9', '969592', 'DADADA', '72726B', 'A6A6A0');
while(body.indexOf('#IMGSRC#') >= 0) {
body = body.replace('#IMGSRC#', '/i/misc/dmagic/'+names[mtype*10]+'_30.gif');
}
var s = '<table width="'+dx+(dy?'" height="'+dy:'')+'" border="0" align="center" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+1]+'" align="left"><img src="/i/misc/dmagic/b'+names[mtype*10]+'_03.gif" width="'+names[mtype*10+1]+'" height="'+names[mtype*10+2]+'"></td>'+
'<td width="100%" align="right" background="/i/misc/dmagic/b'+names[mtype*10]+'_05.gif"></td>'+
'<td width="'+names[mtype*10+3]+'" align="right"><img src="/i/misc/dmagic/b'+names[mtype*10]+'_07.gif" width="'+names[mtype*10+3]+'" height="'+names[mtype*10+2]+'"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr>'+
(names[mtype*10+7]?'<td width="'+names[mtype*10+7]+'"><SPAN style="width:'+names[mtype*10+7]+'">&nbsp;</SPAN></td>':'')+
'<td width="5" background="/i/misc/dmagic/b'+names[mtype*10]+'_17.gif">&nbsp;</td>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td bgcolor="#'+colors[mtype*2]+'"'+(names[mtype*10+9]?' style="padding-top: '+names[mtype*10+9]+'"':'')+' >'+
'<table border=0 width=100% cellspacing="0" cellpadding="0"><td style="padding-left: 20" align=center><B>'+title+
'</td><td width=20 align=right valign=top style="cursor: hand" '+(noclose?'':'onclick="closehint3();" ') + '><IMG src="/i/clear.gif" width=13 height=13>&nbsp;</td></table>'+
'</td></tr>'+
'<tr>'+
'<td align="center" bgcolor="#'+colors[mtype*2+1]+'">'+body+
'</tr>'+
'</table></td>'+
'<td width="5" background="/i/misc/dmagic/b'+names[mtype*10]+'_19.gif">&nbsp;</td>'+
(names[mtype*10+8]?'<td width="'+names[mtype*10+8]+'"><SPAN style="width:'+names[mtype*10+8]+'">&nbsp;</SPAN></td></td>':'')+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+4]+'" align="left"><img src="/i/misc/dmagic/b'+names[mtype*10]+'_27.gif" width="'+names[mtype*10+4]+'" height="'+names[mtype*10+6]+'"></td>'+
'<td width="100%" align="right" background="/i/misc/dmagic/b'+names[mtype*10]+'_29.gif"></td>'+
'<td width="'+names[mtype*10+5]+'" align="right"><img src="/i/misc/dmagic/b'+names[mtype*10]+'_31.gif" width="'+names[mtype*10+5]+'" height="'+names[mtype*10+6]+'"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table>';
return s;
}
-60
View File
@@ -1,60 +0,0 @@
// selectlogin.js
var Hint3Name = '';
function fixspaces(s)
{
while (s.substr(s.length-1,s.length)==" ") s=s.substr(0,s.length-1);
while (s.substr(0,1)==" ") s=s.substr(1,s.length);
return(s);
}
// Заголовок, название скрипта, имя поля с логином
function findlogin(title, script, name)
{
document.all("hint3").innerHTML = '<table border=0 width=100% cellspacing="1" cellpadding="0" bgcolor="#CCC3AA"><tr><td align=center><B>'+title+'</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>'+
'<table border=0 width=100% cellspacing="0" cellpadding="2" bgcolor="#FFF6DD"><tr><form action="'+script+'" method=POST name=slform><td colspan=2>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT TYPE="text" NAME="'+name+'"></TD><TD width=50%><INPUT type=image SRC="/i/b__ok.gif" WIDTH="25" HEIGHT="18" BORDER=0 ALT="" onclick="slform.'+name+'.value=fixspaces(slform.'+name+'.value);"></TD></TR></FORM></TABLE></td></tr></table>';
document.all("hint3").style.visibility = "visible";
document.all("hint3").style.left = 100;
document.all("hint3").style.top = 60;
document.all(name).focus();
Hint3Name = name;
}
// Для магии. Заголовок, название скрипта, название магии, номер вещицы в рюкзаке
function magicklogin(title, script, magickname, n)
{
document.all("hint3").innerHTML = '<table border=0 width=100% cellspacing="1" cellpadding="0" bgcolor="#CCC3AA"><tr><td align=center><B>'+title+'</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>'+
'<table border=0 width=100% cellspacing="0" cellpadding="2" bgcolor="#FFF6DD"><tr><form action="'+script+'" method=POST name=slform><input type=hidden name="use" value="'+magickname+'"><input type=hidden name="n" value="'+n+'"><td colspan=2>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT TYPE="text" NAME="param"></TD><TD width=50%><INPUT type=image SRC="/i/b__ok.gif" WIDTH="25" HEIGHT="18" BORDER=0 ALT="" onclick="slform.param.value=fixspaces(slform.param.value);"></TD></TR></FORM></TABLE></td></tr></table>';
document.all("hint3").style.visibility = "visible";
document.all("hint3").style.left = 100;
document.all("hint3").style.top = 60;
document.all("param").focus();
Hint3Name = 'param';
}
// Закрывает окно ввода логина
function closehint3()
{
document.all("hint3").style.visibility="hidden";
Hint3Name='';
}
// Магия
function UseMagick(script, name, extparam, n) {
if ((extparam != null)&&(extparam != '')) {
var s = prompt(extparam+':', '');
if ((s != null)&&(s != '')) {
re = /\%/g; s=s.replace(re, "%25");
re = /\+/g; s=s.replace(re, "%2B");
re = /\#/g; s=s.replace(re, "%23");
re = /\?/g; s=s.replace(re, "%3F");
re = /\&/g; s=s.replace(re, "%26");
window.location.href=script+'?use='+name+'&param='+s+'&n='+n;
}
} else {
if (confirm('Использовать сейчас?')) { location=script+'?use='+name+'&n='+n; }
}
}
-76
View File
@@ -1,76 +0,0 @@
function absPosition(obj) {
var x = y = 0;
while(obj) {
x += obj.offsetLeft;
y += obj.offsetTop;
obj = obj.offsetParent;
}
return {x : x, y : y};
}
function ShowThing(obj, xshift, yshift, txt, left) {
if(left == 1) {
var xxx = 1;
} else {
var xxx = 0;
}
DDD = setTimeout(function() {
ShowThingMain(obj, txt, xshift, yshift, xxx);
}, 300);
}
function ShowThingMain(obj, txt, xshift, yshift, xxx) {
var img_x = absPosition(obj).x;
var img_y = absPosition(obj).y;
if(xxx == 1) {
img_y = img_y+yshift;
img_x = img_x-60-xshift;
} else {
img_y = img_y+yshift;
img_x = img_x+xshift;
}
if(document.getElementById("thing_")) {
document.getElementById("thing_").style.display = 'block';
} else {
var divTag = document.createElement("div");
divTag.id = "thing_";
divTag.style.position = "absolute";
divTag.style.zIndex = 9;
divTag.style.border = "1px solid black";
divTag.style.top = img_y + "px";
divTag.style.left = img_x + "px";
divTag.style.backgroundColor = "#ffffe1";
divTag.style.minWidth = "100px"
divTag.style.maxWidth = "400px";
divTag.style.paddingLeft = "5px";
divTag.style.paddingRight = "5px";
divTag.style.paddingTop = "2px";
divTag.style.paddingBottom = "2px";
divTag.style.boxShadow = "5px 5px 5px black";
divTag.style.boxShadow = "5px 5px 10px rgba(0,0,0,0.5)";
divTag.style.MozBoxShadow = "5px 5px 10px rgba(0,0,0,0.5)";
divTag.style.WebkitBoxShadow = "5px 5px 10px rgba(0,0,0,0.5)";
if(xxx == 1) {
divTag.style.borderRadius = "5px 0px 5px 5px";
divTag.style.MozBorderRadius = "5px 0px 5px 5px";
divTag.style.WebkitBorderRadius = "5px 0px 5px 5px";
} else {
divTag.style.borderRadius = "0px 5px 5px 5px";
divTag.style.MozBorderRadius = "0px 5ipx 5px 5px";
divTag.style.WebkitBorderRadius = "0px 5px 5px 5px";
}
divTag.style.lineHeight = "10px";
divTag.style.fontSize = "9px";
divTag.className ="dynamicDiv";
divTag.innerHTML = txt;
document.body.appendChild(divTag);
}
}
function HideThing(obj) {
try {
document.body.removeChild(document.getElementById("thing_"));
} catch(err) {
clearTimeout(DDD);
}
}
-263
View File
@@ -1,263 +0,0 @@
var Hint3Name = '';
step=0;
function errmess(s)
{
messid.innerHTML='<B>'+s+'</B>';
highlight();
}
function highlight()
{
if (step) return(0);
step=10;
setTimeout(dohi,50);
}
function dohi()
{
var hx=new Array(0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F");
step--;
messid.style.color="#"+hx[Math.floor(15-step/2)]+((step&1)?"F":"8")+"0000";
if (step>0) setTimeout(dohi,50);
}
function fixspaces(s)
{
while (s.substr(s.length-1,s.length)==" ") s=s.substr(0,s.length-1);
while (s.substr(0,1)==" ") s=s.substr(1,s.length);
return(s);
}
// Заголовок, название скрипта, имя поля с логином
function findlogin(title, script, name, defaultlogin, mtype) {
var s;
s='<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="'+script+'" method=POST name=slform><td colspan=2>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right style="padding-left:5"><INPUT style="width: 100%" TYPE="text" NAME="'+name+'" value="'+defaultlogin+'"></TD><TD width=50%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" onclick="slform.'+name+'.value=fixspaces(slform.'+name+'.value);"></TD></TR></FORM></TABLE>';
s = crtmagic(mtype, title, s);
document.all("hint4").innerHTML = s;
document.all("hint4").style.visibility = "visible";
document.all("hint4").style.left = 100;
document.all("hint4").style.top = document.body.scrollTop+50;
document.all(name).focus();
Hint3Name = name;
}
function dialogconfirm(title, script, text, mtype)
{
var s;
s='<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="'+script+'" method=POST name=slform><td colspan=2>'+
text+'</TD></TR><TR><TD width=50% align=left><INPUT TYPE="submit" name="tmpname423" value="Да" style="width:70%"></TD><TD width=50% align=right><INPUT type=button style="width:70%" value="Нет" onclick="closehint3();"></TD></TR></FORM></TABLE>';
s = crtmagic(mtype, title, s);
document.all("hint4").innerHTML = s;
document.all("hint4").style.visibility = "visible";
document.all("hint4").style.left = 100;
document.all("hint4").style.top = document.body.scrollTop+50;
document.all("tmpname423").focus();
Hint3Name = name;
}
function foundmagictype (mtypes) {
if (mtypes) {
mtypes=mtypes+"";
if (mtypes.indexOf(',') == -1) return parseInt(mtypes);
var s=mtypes.split(',');
var found=0;
var doubl=0;
var maxfound=0;
for (i=0; i < s.length; i++) {
var k=parseInt(s[i]);
if (k > maxfound) {
found=i + 1;
maxfound=k;
doubl=0;
} else {
if (k == maxfound) {doubl=1;}
}
}
if (doubl) {return 0};
return found;
}
return 0;
}
// Для магии. Заголовок, название скрипта, название магии, номер вещицы в рюкзаке, логин по умолчанию, описание доп. поля
function magicklogin(title, script, magickname, n, defaultlogin, extparam, mtype) {
var s = '<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="'+script+'" method=POST name=slform><input type=hidden name="use" value="'+magickname+'"><input type=hidden name="n" value="'+n+'"><td colspan=2>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD style="padding-left:5" width=50% align=right><INPUT TYPE="text" NAME="param" value="'+defaultlogin+'" style="width: 100%"></TD><TD width=50%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" onclick="slform.param.value=fixspaces(slform.param.value);"></TD></TR>';
if (extparam != null && extparam != '') {
s = s + '<TR><td style="padding-left:5">'+extparam+'<BR><INPUT style="width: 100%" TYPE="text" NAME="param2"></TD><TD></TR>';
}
s = s + '</FORM></TABLE>';
s = crtmagic(mtype, title, s);
document.all("hint4").innerHTML = s;
document.all("hint4").style.visibility = "visible";
document.all("hint4").style.left = 100;
document.all("hint4").style.top = document.body.scrollTop+50;
document.all("param").focus();
Hint3Name = 'param';
}
// Магия
function UseMagick(title, script, name, extparam, n, extparam2, mtype) {
if ((extparam != null)&&(extparam != '')) {
var t1='text',t2='text';
if (extparam.substr(0,1) == "!")
{
t1='password';
extparam=extparam.substr(1,extparam.length);
}
var s = '<table border=0 width=100% cellspacing="1" cellpadding="0"><TR><form action="'+script+'" method=POST name=slform><input type=hidden name="use" value="'+name+'"><input type=hidden name="n" value="'+n+'"><td colspan=2 align=left><NOBR><SMALL>'+
extparam + ':</NOBR></TD></TR><TR><TD width=100% align=left style="padding-left:5"><INPUT tabindex=1 style="width: 100%" TYPE="'+t1+'" id="param" NAME="param" value=""></TD><TD width=10%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" tabindex=3></TD></TR>';
if (extparam2 != null && extparam2 != '') {
if (extparam2.substr(0,1) == "!")
{
t2='password';
extparam2=extparam2.substr(1,extparam2.length);
}
s = s + '<TR><td colspan=2><NOBR><SMALL>'+extparam2+':</NOBR><TR style="padding-left:5"><TD><INPUT tabindex=2 TYPE="'+t2+'" NAME="param2" style="width: 50%"></TD><TD></TR>';
}
s += '</FORM></TABLE>';
s = crtmagic(mtype, title, s);
document.all("hint4").innerHTML = s;
document.all("hint4").style.visibility = "visible";
document.all("hint4").style.left = 100;
document.all("hint4").style.top = document.body.scrollTop+50;
document.all("param").focus();
Hint3Name = 'param';
} else {
dialogconfirm('Подтверждение', script, '<TABLE width=100%><TD><IMG src="i/items/'+name+'.gif"></TD><TD>Использовать сейчас?</TABLE>'+
'<input type=hidden name="use" value="'+name+'"><input type=hidden name="n" value="'+n+'">', mtype);
}
}
// Закрывает окно ввода логина
function closehint3()
{
document.all("hint4").style.visibility="hidden";
Hint3Name='';
}
// Для боевой магии. Заголовок, название магии, номер вещицы в рюкзаке
function Bmagicklogin (title, magickname, n, defaultlogin, extparam, mtype) {
if (defend==false) {
errmess("Блок не выбран.");
return false;
}
var s = '<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><form action="/battle.pl" method=POST name="bmagic" onsubmit="bmagic.mdefend.value=defend;"><input type=hidden name="use" value="'+magickname+'"><input type=hidden name="n" value="'+n+'"><input type=hidden name="mdefend" value="'+defend+'"><input type=hidden name="enemy" value="'+enemy+'"><input type=hidden name="myid" value="'+myid+'"><td colspan=2 align=left>'+
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT style="width: 100%" TYPE="text" id="param" NAME="param" value="'+defaultlogin+'"></TD><TD width=50%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" onclick="bmagic.param.value=fixspaces(bmagic.param.value);"></TD></TR>';
if (extparam != null && extparam != '') {
s = s + '<TR><td colspan=2>'+extparam+'<TR><TD style="padding-left:5"><INPUT style="width: 100%" TYPE="text" NAME="param2"><TD></TD></TR>';
}
s = s + '</FORM></TABLE>';
s = crtmagic(mtype, title, s);
document.all("hint4").innerHTML= s;
document.all("hint4").style.visibility = "visible";
document.all("hint4").style.left = 100;
document.all("hint4").style.top = 60;
document.all("param").focus();
Hint3Name = 'param';
}
// Магия
function BUseMagick(name, extparam, n, mtype) {
if (defend==false) {
errmess("Блок не выбран.");
return false;
}
if ((extparam != null)&&(extparam != '')) {
var s = prompt(extparam+':', '');
if ((s != null)&&(s != '')) {
re = /\%/g; s=s.replace(re, "%25");
re = /\+/g; s=s.replace(re, "%2B");
re = /\#/g; s=s.replace(re, "%23");
re = /\?/g; s=s.replace(re, "%3F");
re = /\&/g; s=s.replace(re, "%26");
window.location.href='/battle.pl?use='+name+'&param='+s+'&n='+n+'&mdefend='+defend+'&enemy='+enemy+'&myid='+myid;
}
} else {
dialogconfirm('Подтверждение', '/battle.pl', '<TABLE width=100%><TD><IMG src="i/items/'+name+'.gif"></TD><TD>Использовать сейчас?</TABLE>'+
'<input type=hidden name="use" value="'+name+'"><input type=hidden name="n" value="'+n+'"><input type=hidden name="mdefend" value="'+defend+'"><input type=hidden name="enemy" value="'+enemy+'"><input type=hidden name="myid" value="'+myid+'">', mtype);
}
}
function crtmagic(mtype, title, body, subm) {
//name, XYX, X1-X2-Y2, pad.LRU
mtype=foundmagictype(mtype);
var names=new Array(
'neitral',17, 6, 14, 17, 14, 7,0,0, 3,
'fire', 57, 30, 33, 20, 21, 14, 11, 12, 0,
'water', 57, 30, 33, 20, 21, 14, 11, 12, 0,
'air', 57, 30, 33, 20, 21, 14, 11, 12, 0,
'earth', 57,30, 33, 20, 21, 14, 11, 12, 0,
'white', 51, 25, 46, 44, 44, 10, 5, 5, 0,
'gray', 51, 25, 46, 44, 44, 10, 5, 5, 0,
'black', 51, 25, 46, 44, 44, 10, 5, 5, 0);
var colors=new Array('B1A993','DDD5BF', 'ACA396','D3CEC8', '96B0C6', 'BDCDDB', 'AEC0C9', 'CFE1EA', 'AAA291', 'D5CDBC', 'BCBBB6', 'EFEEE9', '969592', 'DADADA', '72726B', 'A6A6A0');
while (body.indexOf('#IMGSRC#')>=0) body = body.replace('#IMGSRC#', 'http://img.combats.com/i/misc/dmagic/'+names[mtype*10]+'_30.gif');
var s='<table width="270" border="0" align="center" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+1]+'" align="left"></td>'+
'<td width="100%" align="right" background="i/misc/dmagic/b'+names[mtype*10]+'_05.gif"></td>'+
'<td width="'+names[mtype*10+3]+'" align="right"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr>'+
(names[mtype*10+7]?'<td width="'+names[mtype*10+7]+'"><SPAN style="width:'+names[mtype*10+7]+'">&nbsp;</SPAN></td>':'')+
'<td width="5" background="i/misc/dmagic/b'+names[mtype*10]+'_17.gif">&nbsp;</td>'+
'<td width="100%">'+
'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
'<tr><td bgcolor="#'+colors[mtype*2]+'"'+(names[mtype*10+9]?' style="padding-top: '+names[mtype*10+9]+'"':'')+' >'+
'<table border=0 width=100% cellspacing="0" cellpadding="0"><td style="padding-left: 20" align=center><B>'+title+
'</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();" style=\'filter:Gray()\' onmouseover="this.filters.Gray.Enabled=false" onmouseout="this.filters.Gray.Enabled=true"><IMG src="i/clear.gif" width=13 height=13>&nbsp;</td></table>'+
'</td></tr>'+
'<tr>'+
'<td align="center" bgcolor="#'+colors[mtype*2+1]+'">'+body+
'</tr>'+
'</table></td>'+
'<td width="5" background="i/misc/dmagic/b'+names[mtype*10]+'_19.gif">&nbsp;</td>'+
(names[mtype*10+8]?'<td width="'+names[mtype*10+8]+'"><SPAN style="width:'+names[mtype*10+8]+'">&nbsp;</SPAN></td></td>':'')+
'</tr>'+
'</table></td>'+
'</tr>'+
'<tr><td>'+
'<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
'<tr>'+
'<td width="'+names[mtype*10+4]+'" align="left"></td>'+
'<td width="100%" align="right" background="i/misc/dmagic/b'+names[mtype*10]+'_29.gif"></td>'+
'<td width="'+names[mtype*10+5]+'" align="right"></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table></td>'+
'</tr>'+
'</table>';
return s;
}
-26
View File
@@ -1,26 +0,0 @@
function ShowTime(fname,lefttime,type)
{
lefttime--;
if (lefttime<=0) { document.all(''+fname).innerText=''; window.location.reload(); }
sec=lefttime%60;
min=Math.floor(lefttime/60);
day=Math.floor(lefttime/86400);
hour=Math.floor((lefttime/3600)-(day*86400/3600));
if (sec<10) sec="0"+sec;
if (min>60) min-=(Math.floor(min/60)*60);
if (min==60) min=0;
if (type!=1) { if (min<10) min="0"+min; }
if (type==1) { document.all(''+fname).innerText=min+" мин. "+sec+" сек."; }
else {
if (day>0) document.all(''+fname).innerText=day+" д. "+hour+" ч. "+min+" мин.";
else document.all(''+fname).innerText=hour+" ч. "+min+" мин.";
}
setTimeout("ShowTime('"+fname+"',"+lefttime+","+type+")",1000);
}
-200
View File
@@ -1,200 +0,0 @@
/*
* TipTip
* Copyright 2010 Drew Wilson
* www.drewwilson.com
* code.drewwilson.com/entry/tiptip-jquery-plugin
*
* Version 1.3 - Updated: Mar. 23, 2010
*
* This Plug-In will create a custom tooltip to replace the default
* browser tooltip. It is extremely lightweight and very smart in
* that it detects the edges of the browser window and will make sure
* the tooltip stays within the current window size. As a result the
* tooltip will adjust itself to be displayed above, below, to the left
* or to the right depending on what is necessary to stay within the
* browser window. It is completely customizable as well via CSS.
*
* This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
(function($){
$.fn.tipTip = function(options) {
const defaults = {
activation: "hover",
keepAlive: false,
maxWidth: "150px",
edgeOffset: 0,
defaultPosition: "right",
delay: 0,
fadeIn: 200,
fadeOut: 200,
attribute: "title",
content: false, // HTML or String to fill TipTIp with
enter: function () {
},
exit: function () {
}
};
const opts = $.extend(defaults, options);
// Setup tip tip elements and render them to the DOM
if($("#tiptip_holder").length <= 0){
var tiptip_holder = $('<div id="tiptip_holder" style="max-width:'+ opts.maxWidth +';"></div>');
var tiptip_content = $('<div id="tiptip_content"></div>');
var tiptip_arrow = $('<div id="tiptip_arrow"></div>');
$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')));
} else {
var tiptip_holder = $("#tiptip_holder");
var tiptip_content = $("#tiptip_content");
var tiptip_arrow = $("#tiptip_arrow");
}
return this.each(function(){
const org_elem = $(this);
if(opts.content){
var org_title = opts.content;
} else {
var org_title = org_elem.attr(opts.attribute);
}
if(org_title != ""){
if(!opts.content){
org_elem.removeAttr(opts.attribute); //remove original Attribute
}
let timeout = false;
if(opts.activation == "hover"){
org_elem.hover(function(){
active_tiptip();
}, function(){
if(!opts.keepAlive){
deactive_tiptip();
}
});
if(opts.keepAlive){
tiptip_holder.hover(function(){}, function(){
deactive_tiptip();
});
}
} else if(opts.activation == "focus"){
org_elem.focus(function(){
active_tiptip();
}).blur(function(){
deactive_tiptip();
});
} else if(opts.activation == "click"){
org_elem.click(function(){
active_tiptip();
return false;
}).hover(function(){},function(){
if(!opts.keepAlive){
deactive_tiptip();
}
});
if(opts.keepAlive){
tiptip_holder.hover(function(){}, function(){
deactive_tiptip();
});
}
}
function active_tiptip(){
opts.enter.call(this);
tiptip_content.html(org_title);
tiptip_holder.hide().removeAttr("class").css("margin","0");
tiptip_arrow.removeAttr("style");
const top = parseInt(org_elem.offset()['top']);
const left = parseInt(org_elem.offset()['left']);
const org_width = parseInt(org_elem.outerWidth());
const org_height = parseInt(org_elem.outerHeight());
const tip_w = tiptip_holder.outerWidth();
const tip_h = tiptip_holder.outerHeight();
const w_compare = Math.round((org_width - tip_w) / 2);
const h_compare = Math.round((org_height - tip_h) / 2);
let marg_left = Math.round(left + w_compare);
let marg_top = Math.round(top + org_height + opts.edgeOffset);
let t_class = "";
let arrow_top = "";
let arrow_left = Math.round(tip_w - 12) / 2;
if(opts.defaultPosition == "bottom"){
t_class = "_bottom";
} else if(opts.defaultPosition == "top"){
t_class = "_top";
} else if(opts.defaultPosition == "left"){
t_class = "_left";
} else if(opts.defaultPosition == "right"){
t_class = "_right";
}
let right_compare = (w_compare + left) < parseInt($(window).scrollLeft());
let left_compare = (tip_w + left) > parseInt($(window).width());
if((right_compare && w_compare < 0) || (t_class == "_right" && !left_compare) || (t_class == "_left" && left < (tip_w + opts.edgeOffset + 5))){
t_class = "_right";
arrow_top = Math.round(tip_h - 13) / 2;
arrow_left = -12;
marg_left = Math.round(left + org_width + opts.edgeOffset);
if (org_width == 120){
marg_left = marg_left - 100;
}
marg_top = Math.round(top + h_compare);
} else if((left_compare && w_compare < 0) || (t_class == "_left" && !right_compare)){
t_class = "_left";
arrow_top = Math.round(tip_h - 13) / 2;
arrow_left = Math.round(tip_w);
marg_left = Math.round(left - (tip_w + opts.edgeOffset + 5));
marg_top = Math.round(top + h_compare);
}
let top_compare = (top + org_height + opts.edgeOffset + tip_h + 8) > parseInt($(window).height() + $(window).scrollTop());
let bottom_compare = ((top + org_height) - (opts.edgeOffset + tip_h + 8)) < 0;
if(top_compare || (t_class == "_bottom" && top_compare) || (t_class == "_top" && !bottom_compare)){
if(t_class == "_top" || t_class == "_bottom"){
t_class = "_top";
} else {
t_class = t_class+"_top";
}
arrow_top = tip_h;
marg_top = Math.round(top - (tip_h + 5 + opts.edgeOffset));
} else if(bottom_compare | (t_class == "_top" && bottom_compare) || (t_class == "_bottom" && !top_compare)){
if(t_class == "_top" || t_class == "_bottom"){
t_class = "_bottom";
} else {
t_class = t_class+"_bottom";
}
arrow_top = -12;
marg_top = Math.round(top + org_height + opts.edgeOffset);
}
if(t_class == "_right_top" || t_class == "_left_top"){
marg_top = marg_top + 5;
} else if(t_class == "_right_bottom" || t_class == "_left_bottom"){
marg_top = marg_top - 5;
}
if(t_class == "_left_top" || t_class == "_left_bottom"){
marg_left = marg_left + 5;
}
tiptip_arrow.css({"margin-left": arrow_left+"px", "margin-top": 200+arrow_top+"px"});
let art_top = top + org_height - tip_h / 2;
if(art_top < 0){art_top=10;}
// old one - marg_top
tiptip_holder.css({"margin-left": marg_left+10+"px", "margin-top": art_top+"px"}).attr("class","tip");
if (timeout){ clearTimeout(timeout); }
timeout = setTimeout(function(){ tiptip_holder.stop(true,true).fadeIn(opts.fadeIn); }, opts.delay);
}
function deactive_tiptip(){
opts.exit.call(this);
if (timeout){ clearTimeout(timeout); }
tiptip_holder.fadeOut(opts.fadeOut);
}
}
});
}
})(jQuery);