Initial commit

This commit is contained in:
genuineparts 2025-06-02 10:01:12 +02:00
commit 43ad32700c
7085 changed files with 447606 additions and 0 deletions

View file

@ -0,0 +1,107 @@
/*
* RightClickMenu jQuery plugin
*
* Copyright (c) 2011 Evgeni Tsarovski
* http://www.etcoding.com
*
*
Generates a right-click menu.
Function takes a parameter, which is an array of objects with following properties:
name: text that will be displayed on menu
action: user-defined function, that will be executed when user clicks on the menu item. A jQuery's "$this" element will be passed as a function parameter.
Usage:
var menu = [
{ name: "make red", action: function (element) { $(element).css("color", "red"); } },
{ name: "make black", action: function (element) { $(element).css("color", "black"); } }
];
$("element").rightClickMenu(menu);
Generated menu is wrapped in div with css class 'rightClickMenu'.
*/
(function ($) {
$.fn.rightClickMenu = function (options) {
// function must receive options
if (!options || options.length == 0) {
alert("Options for rightClickMenu must be defined");
return;
}
// attach hideMenu function to a click anywhere in a document, if it wasn't attached before.
if (!$.fn.rightClickMenu.initPerformed) {
$(document).click(function () { hideMenu(); });
$.fn.rightClickMenu.initPerformed = true;
}
// stop context menu from appearing on a target element
this.bind("contextmenu", function (e) {
return false;
});
// now attach right-click to the target element
this.bind('mousedown', function (event) {
if (event.which != 3) // not right click ?
return;
// in case other menu is already opened..
hideMenu();
var menuDiv = retrieveCreateMenu(options, this);
menuDiv.css('left', event.pageX);
menuDiv.css('top', event.pageY);
menuDiv.show();
});
// Creates new menu markup, or retrieves existing one.
function retrieveCreateMenu(options, element) {
// upon creation, original element receives the menu Id. Retrieve the menu using this Id, if exists.
var menuId = $(element).attr("data-rightClickMenuId");
// if menu already created, return it
if (menuId) {
return $("div[data-rightClickMenuId='" + menuId + "']");
}
// Single page can have multiple elements with menus attached, so we need to link elements and menus.
// Lets create new menu, giving it a data-rightClickMenuId attribute with new ID.
if (!this.menuId)
this.menuId = 0;
menuId = ++this.menuId;
$(element).attr("data-rightClickMenuId", menuId);
var menuDiv = $("<div class='rightClickMenu' data-rightClickMenuId='" + menuId + "'></div>");
var menuUl = $("<ul></ul>");
menuDiv.append(menuUl);
for (var i = 0; i < options.length; i++) {
var li = $("<li>" + options[i].name + "</li>");
var func = function (uf) { return function () { uf(element); } } // change the scope
li.click(func(options[i].action));
menuUl.append(li);
};
menuDiv.hide();
menuDiv.css('position', 'absolute');
menuDiv.css('z-index', '1000');
// disable browser's context menu
menuDiv.bind("contextmenu", function (e) {
return false;
});
$('body').append(menuDiv);
return menuDiv;
}
// hides any open menu
function hideMenu() {
var menu = $('div.rightClickMenu');
if (menu.length == 0)
return;
menu.hide();
}
};
})(jQuery);

View file

@ -0,0 +1 @@
(function(e){jQuery.fn.extend({slimScroll:function(n){var r={width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:.4,alwaysVisible:false,disableFadeOut:false,railVisible:false,railColor:"#333",railOpacity:.2,railDraggable:true,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:false,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"};var i=e.extend(r,n);this.each(function(){function x(t){if(!r){return}var t=t||window.event;var n=0;if(t.wheelDelta){n=-t.wheelDelta/120}if(t.detail){n=t.detail/3}var s=t.target||t.srcTarget||t.srcElement;if(e(s).closest("."+i.wrapperClass).is(m.parent())){T(n,true)}if(t.preventDefault&&!v){t.preventDefault()}if(!v){t.returnValue=false}}function T(e,t,n){v=false;var r=e;var s=m.outerHeight()-E.outerHeight();if(t){r=parseInt(E.css("top"))+e*parseInt(i.wheelStep)/100*E.outerHeight();r=Math.min(Math.max(r,0),s);r=e>0?Math.ceil(r):Math.floor(r);E.css({top:r+"px"})}c=parseInt(E.css("top"))/(m.outerHeight()-E.outerHeight());r=c*(m[0].scrollHeight-m.outerHeight());if(n){r=e;var u=r/m[0].scrollHeight*m.outerHeight();u=Math.min(Math.max(u,0),s);E.css({top:u+"px"})}m.scrollTop(r);m.trigger("slimscrolling",~~r);k();L()}function N(){if(window.addEventListener){this.addEventListener("DOMMouseScroll",x,false);this.addEventListener("mousewheel",x,false)}else{document.attachEvent("onmousewheel",x)}}function C(){l=Math.max(m.outerHeight()/m[0].scrollHeight*m.outerHeight(),d);E.css({height:l+"px"});var e=l==m.outerHeight()?"none":"block";E.css({display:e})}function k(){C();clearTimeout(a);if(c==~~c){v=i.allowPageScroll;if(h!=c){var e=~~c==0?"top":"bottom";m.trigger("slimscroll",e)}}else{v=false}h=c;if(l>=m.outerHeight()){v=true;return}E.stop(true,true).fadeIn("fast");if(i.railVisible){w.stop(true,true).fadeIn("fast")}}function L(){if(!i.alwaysVisible){a=setTimeout(function(){if(!(i.disableFadeOut&&r)&&!s&&!u){E.fadeOut("slow");w.fadeOut("slow")}},1e3)}}var r,s,u,a,f,l,c,h,p="<div></div>",d=30,v=false;var m=e(this);if(m.parent().hasClass(i.wrapperClass)){var g=m.scrollTop();E=m.parent().find("."+i.barClass);w=m.parent().find("."+i.railClass);C();if(e.isPlainObject(n)){if("height"in n&&n.height=="auto"){m.parent().css("height","auto");m.css("height","auto");var y=m.parent().parent().height();m.parent().css("height",y);m.css("height",y)}if("scrollTo"in n){g=parseInt(i.scrollTo)}else if("scrollBy"in n){g+=parseInt(i.scrollBy)}else if("destroy"in n){E.remove();w.remove();m.unwrap();return}T(g,false,true)}return}i.height=i.height=="auto"?m.parent().height():i.height;var b=e(p).addClass(i.wrapperClass).css({position:"relative",overflow:"hidden",width:i.width,height:i.height});m.css({overflow:"hidden",width:i.width,height:i.height});var w=e(p).addClass(i.railClass).css({width:i.size,height:"100%",position:"absolute",top:0,display:i.alwaysVisible&&i.railVisible?"block":"none","border-radius":i.railBorderRadius,background:i.railColor,opacity:i.railOpacity,zIndex:90});var E=e(p).addClass(i.barClass).css({background:i.color,width:i.size,position:"absolute",top:0,opacity:i.opacity,display:i.alwaysVisible?"block":"none","border-radius":i.borderRadius,BorderRadius:i.borderRadius,MozBorderRadius:i.borderRadius,WebkitBorderRadius:i.borderRadius,zIndex:99});var S=i.position=="right"?{right:i.distance}:{left:i.distance};w.css(S);E.css(S);m.wrap(b);m.parent().append(E);m.parent().append(w);if(i.railDraggable){E.bind("mousedown",function(n){var r=e(document);u=true;t=parseFloat(E.css("top"));pageY=n.pageY;r.bind("mousemove.slimscroll",function(e){currTop=t+e.pageY-pageY;E.css("top",currTop);T(0,E.position().top,false)});r.bind("mouseup.slimscroll",function(e){u=false;L();r.unbind(".slimscroll")});return false}).bind("selectstart.slimscroll",function(e){e.stopPropagation();e.preventDefault();return false})}w.hover(function(){k()},function(){L()});E.hover(function(){s=true},function(){s=false});m.hover(function(){r=true;k();L()},function(){r=false;L()});m.bind("touchstart",function(e,t){if(e.originalEvent.touches.length){f=e.originalEvent.touches[0].pageY}});m.bind("touchmove",function(e){if(!v){e.originalEvent.preventDefault()}if(e.originalEvent.touches.length){var t=(f-e.originalEvent.touches[0].pageY)/i.touchScrollStep;T(t,true);f=e.originalEvent.touches[0].pageY}});C();if(i.start==="bottom"){E.css({top:m.outerHeight()-E.outerHeight()});T(0,true)}else if(i.start!=="top"){T(e(i.start).position().top,null,true);if(!i.alwaysVisible){E.hide()}}N()});return this}});jQuery.fn.extend({slimscroll:jQuery.fn.slimScroll})})(jQuery)

232
modules/chat/js/scroll.js Normal file
View file

@ -0,0 +1,232 @@
/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*
* Version: 0.2.5
*
*/
(function($) {
jQuery.fn.extend({
slimScroll: function(o) {
var ops = o;
//do it for every element that matches selector
this.each(function(){
var isOverPanel, isOverBar, isDragg, queueHide, barHeight,
divS = '<div></div>',
minBarHeight = 30,
wheelStep = 30,
o = ops || {},
cwidth = o.width || 'auto',
cheight = o.height || '250px',
size = o.size || '7px',
color = o.color || '#000',
position = o.position || 'right',
opacity = o.opacity || .4,
alwaysVisible = o.alwaysVisible === true;
//used in event handlers and for better minification
var me = $(this);
//wrap content
var wrapper = $(divS).css({
position: 'relative',
overflow: 'hidden',
width: cwidth,
height: cheight
}).attr({ 'class': 'slimScrollDiv' });
//update style for the div
me.css({
overflow: 'hidden',
width: cwidth,
height: cheight
});
//create scrollbar rail
var rail = $(divS).css({
width: '15px',
height: '100%',
position: 'absolute',
top: 0
});
//create scrollbar
var bar = $(divS).attr({
'class': 'slimScrollBar ',
style: 'border-radius: ' + size
}).css({
background: color,
width: size,
position: 'absolute',
top: 0,
opacity: opacity,
display: alwaysVisible ? 'block' : 'none',
BorderRadius: size,
MozBorderRadius: size,
WebkitBorderRadius: size,
zIndex: 99
});
//set position
var posCss = (position == 'right') ? { right: '1px' } : { left: '1px' };
rail.css(posCss);
bar.css(posCss);
//wrap it
me.wrap(wrapper);
//append to parent div
me.parent().append(bar);
me.parent().append(rail);
//make it draggable
bar.draggable({
axis: 'y',
containment: 'parent',
start: function() { isDragg = true; },
stop: function() { isDragg = false; hideBar(); },
drag: function(e)
{
//scroll content
scrollContent(0, $(this).position().top, false);
}
});
//on rail over
rail.hover(function(){
showBar();
}, function(){
hideBar();
});
//on bar over
bar.hover(function(){
isOverBar = true;
}, function(){
isOverBar = false;
});
//show on parent mouseover
me.hover(function(){
isOverPanel = true;
showBar();
hideBar();
}, function(){
isOverPanel = false;
hideBar();
});
var _onWheel = function(e)
{
//use mouse wheel only when mouse is over
if (!isOverPanel) { return; }
var e = e || window.event;
var delta = 0;
if (e.wheelDelta) { delta = -e.wheelDelta/120; }
if (e.detail) { delta = e.detail / 3; }
//scroll content
scrollContent(0, delta, true);
//stop window scroll
if (e.preventDefault) { e.preventDefault(); }
e.returnValue = false;
}
var scrollContent = function(x, y, isWheel)
{
var delta = y;
if (isWheel)
{
//move bar with mouse wheel
delta = bar.position().top + y * wheelStep;
//move bar, make sure it doesn't go out
delta = Math.max(delta, 0);
var maxTop = me.outerHeight() - bar.outerHeight();
delta = Math.min(delta, maxTop);
//scroll the scrollbar
bar.css({ top: delta + 'px' });
}
//calculate actual scroll amount
percentScroll = parseInt(bar.position().top) / (me.outerHeight() - bar.outerHeight());
delta = percentScroll * (me[0].scrollHeight - me.outerHeight());
//scroll content
me.scrollTop(delta);
//ensure bar is visible
showBar();
}
var attachWheel = function()
{
if (window.addEventListener)
{
this.addEventListener('DOMMouseScroll', _onWheel, false );
this.addEventListener('mousewheel', _onWheel, false );
}
else
{
document.attachEvent("onmousewheel", _onWheel)
}
}
//attach scroll events
attachWheel();
var getBarHeight = function()
{
//calculate scrollbar height and make sure it is not too small
barHeight = Math.max((me.outerHeight() / me[0].scrollHeight) * me.outerHeight(), minBarHeight);
bar.css({ height: barHeight + 'px' });
}
//set up initial height
getBarHeight();
var showBar = function()
{
//recalculate bar height
getBarHeight();
clearTimeout(queueHide);
//show only when required
if(barHeight >= me.outerHeight()) {
return;
}
bar.fadeIn('fast');
}
var hideBar = function()
{
//only hide when options allow it
if (!alwaysVisible)
{
queueHide = setTimeout(function(){
if (!isOverBar && !isDragg) { bar.fadeOut('slow'); }
}, 1000);
}
}
});
//maintain chainability
return this;
}
});
jQuery.fn.extend({
slimscroll: jQuery.fn.slimScroll
});
})(jQuery);

13
modules/chat/js/slimScroll.min.js vendored Normal file
View file

@ -0,0 +1,13 @@
/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*
* Version: 0.5.0
*
*/
(function(d){jQuery.fn.extend({slimScroll:function(o){var a=ops=d.extend({wheelStep:20,width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:0.4,alwaysVisible:!1,railVisible:!1,railColor:"#333",railOpacity:"0.2",railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,scroll:0},o);this.each(function(){function h(a,d,e){var f=a;d&&(f=parseInt(c.css("top"))+a*B/100*c.outerHeight(),d=b.outerHeight()-c.outerHeight(),
f=Math.min(Math.max(f,0),d),c.css({top:f+"px"}));k=parseInt(c.css("top"))/(b.outerHeight()-c.outerHeight());f=k*(b[0].scrollHeight-b.outerHeight());e&&(f=a,a=f/b[0].scrollHeight*b.outerHeight(),c.css({top:a+"px"}));b.scrollTop(f);p();i()}function w(){q=Math.max(b.outerHeight()/b[0].scrollHeight*b.outerHeight(),o);c.css({height:q+"px"})}function p(){w();clearTimeout(x);l=C&&k==~~k;q>=b.outerHeight()?l=!0:(c.stop(!0,!0).fadeIn("fast"),y&&g.stop(!0,!0).fadeIn("fast"))}function i(){m||(x=setTimeout(function(){!r&&
!s&&(c.fadeOut("slow"),g.fadeOut("slow"))},1E3))}var t,r,s,x,q,k,o=30,l=!1,B=parseInt(a.wheelStep),j=a.width,z=a.height,e=a.size,D=a.color,E=a.position,A=a.distance,u=a.start,F=a.opacity,m=a.alwaysVisible,y=a.railVisible,G=a.railColor,H=a.railOpacity,C=a.allowPageScroll,n=a.scroll,b=d(this);if(b.parent().hasClass("slimScrollDiv"))n&&(c=b.parent().find(".slimScrollBar"),g=b.parent().find(".slimScrollRail"),h(b.scrollTop()+parseInt(n),!1,!0));else{n=d("<div></div>").addClass(a.wrapperClass).css({position:"relative",
overflow:"hidden",width:j,height:z});b.css({overflow:"hidden",width:j,height:z});var g=d("<div></div>").addClass(a.railClass).css({width:e,height:"100%",position:"absolute",top:0,display:m&&y?"block":"none","border-radius":e,background:G,opacity:H,zIndex:90}),c=d("<div></div>").addClass(a.barClass).css({background:D,width:e,position:"absolute",top:0,opacity:F,display:m?"block":"none","border-radius":e,BorderRadius:e,MozBorderRadius:e,WebkitBorderRadius:e,zIndex:99}),j="right"==E?{right:A}:{left:A};
g.css(j);c.css(j);b.wrap(n);b.parent().append(c);b.parent().append(g);c.draggable({axis:"y",containment:"parent",start:function(){s=!0},stop:function(){s=!1;i()},drag:function(){h(0,d(this).position().top,!1)}});g.hover(function(){p()},function(){i()});c.hover(function(){r=!0},function(){r=!1});b.hover(function(){t=!0;p();i()},function(){t=!1;i()});var v=function(a){if(t){var a=a||window.event,b=0;a.wheelDelta&&(b=-a.wheelDelta/120);a.detail&&(b=a.detail/3);h(b,!0);a.preventDefault&&!l&&a.preventDefault();
l||(a.returnValue=!1)}};(function(){window.addEventListener?(this.addEventListener("DOMMouseScroll",v,!1),this.addEventListener("mousewheel",v,!1)):document.attachEvent("onmousewheel",v)})();w();"bottom"==u?(c.css({top:b.outerHeight()-c.outerHeight()}),h(0,!0)):"object"==typeof u&&(h(d(u).position().top,null,!0),m||c.hide())}});return this}});jQuery.fn.extend({slimscroll:jQuery.fn.slimScroll})})(jQuery);

1
modules/chat/js/tab.min.js vendored Normal file
View file

@ -0,0 +1 @@
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7 q=r(a){2.5=a};q.t={5:8,k:l,m:8,9:-1,4:-1,u:8,d:l,v:r(){2.k=l;2.m=8;2.u=8;2.9=-1;2.4=-1;2.d=l}};q.t.w=r w(){7 a=2.5.e;3(!(2.k)){7 b;2.4=a.z(" ");3(a.f<1){o}6 3(2.4<0){b=a}6 3(++(2.4)>=a.f){o}6{b=a.s(2.4)}3(b.x(0,1)=="/"){2.d=p;b=b.x(1)}2.m=b.y();2.k=p}7 c=$("a.A",B.C.D);3(2.9>=c.f){2.v();o}E(7 n=0;n<c.f;n++){i=(n+2.9+1)%c.f;3(c.g(i).h(\'j\').y().F(2.m)==0){3(2.4>=1){3(2.d==p){2.5.e="/"+a.s(0,2.4)+c.g(i).h(\'j\')}6{2.5.e=a.s(0,2.4)+c.g(i).h(\'j\')}}6{3(2.d==p){2.5.e="/"+c.g(i).h(\'j\')}6{2.5.e=c.g(i).h(\'j\')}}2.9=i;o}}};',42,42,'||this|if|lastSpace|input|else|var|null|lastHitIdx||||whisper|value|length|eq|attr||id|tabInProgress|false|tabBase||return|true|TabCompleter|function|substring|prototype|matches|reset|complete|substr|toLowerCase|lastIndexOf|notice|window|parent|document|for|indexOf'.split('|'),0,{}))

73
modules/chat/js/tab.src Normal file
View file

@ -0,0 +1,73 @@
var TabCompleter = function(element) {
this.input = element;
};
TabCompleter.prototype = {
input : null,
tabInProgress : false,
tabBase : null,
lastHitIdx : -1,
lastSpace : -1,
matches: null,
reset : function () {
this.tabInProgress = false;
this.tabBase = null;
this.matches = null;
this.lastHitIdx = -1;
this.lastSpace = -1;
}
};
TabCompleter.prototype.complete = function complete()
{
var text = this.input.value;
if (!(this.tabInProgress))
{
var lastWord;
this.lastSpace = text.lastIndexOf(" ");
if (text.length < 1) {
return;
}
else if (this.lastSpace < 0) {
lastWord = text;
}
else if (++(this.lastSpace) >= text.length) {
return;
}
else {
lastWord = text.substring(this.lastSpace);
}
if(lastWord.substr(0,1)=="/"){
lastWord=lastWord.substr(1);
}
this.tabBase = lastWord.toLowerCase();
this.tabInProgress = true;
}
var users = $("a.notice",window.parent.document);
if (this.lastHitIdx >= users.length) {
this.reset();
return;
}
for (var n = 0; n < users.length; n++)
{
i = (n + this.lastHitIdx + 1) % users.length;
if (users.eq(i).attr('id').toLowerCase().indexOf(this.tabBase) == 0)
{
if (this.lastSpace >= 1) {
this.input.value = text.substring(0, this.lastSpace) + users.eq(i).attr('id');
}
else {
this.input.value = users.eq(i).attr('id');
}
this.lastHitIdx = i;
return;
}
}
};