This commit is contained in:
root
2025-11-07 11:31:06 +00:00
commit 2859f93882
407 changed files with 99769 additions and 0 deletions

View File

@@ -0,0 +1,185 @@
.imgCrop_wrap {
/* width: 500px; @done_in_js */
/* height: 375px; @done_in_js */
position: relative;
cursor: crosshair;
}
/* an extra classname is applied for Opera < 9.0 to fix it's lack of opacity support */
.imgCrop_wrap.opera8 .imgCrop_overlay,
.imgCrop_wrap.opera8 .imgCrop_clickArea {
background-color: transparent;
}
/* fix for IE displaying all boxes at line-height by default, although they are still 1 pixel high until we combine them with the pointless span */
.imgCrop_wrap,
.imgCrop_wrap * {
font-size: 0;
line-height: 0;
opacity: 1;
filter:alpha(opacity=100);
}
.imgCrop_overlay {
background-color: #000;
opacity: 0.5;
filter:alpha(opacity=50);
position: absolute;
width: 100%;
height: 100%;
}
.imgCrop_selArea {
position: absolute;
/* @done_in_js
top: 20px;
left: 20px;
width: 200px;
height: 200px;
background: transparent url(castle.jpg) no-repeat -210px -110px;
*/
cursor: move;
z-index: 2;
}
/* clickArea is all a fix for IE 5.5 & 6 to allow the user to click on the given area */
.imgCrop_clickArea {
width: 100%;
height: 100%;
background-color: #FFF;
opacity: 0.01;
filter:alpha(opacity=01);
}
.imgCrop_marqueeHoriz {
position: absolute;
width: 100%;
height: 1px;
background: transparent url(marqueeHoriz.gif) repeat-x 0 0;
z-index: 3;
}
.imgCrop_marqueeVert {
position: absolute;
height: 100%;
width: 1px;
background: transparent url(marqueeVert.gif) repeat-y 0 0;
z-index: 3;
}
/*
* FIX MARCHING ANTS IN IE
* As IE <6 tries to load background images we can uncomment the follwoing hack
* to remove that issue, not as pretty - but is anything in IE?
* And yes I do know that 'filter' is evil, but it will make it look semi decent in IE
*
* html .imgCrop_marqueeHoriz,
* html .imgCrop_marqueeVert {
background: transparent;
filter: Invert;
}
* html .imgCrop_marqueeNorth { border-top: 1px dashed #000; }
* html .imgCrop_marqueeEast { border-right: 1px dashed #000; }
* html .imgCrop_marqueeSouth { border-bottom: 1px dashed #000; }
* html .imgCrop_marqueeWest { border-left: 1px dashed #000; }
*/
.imgCrop_marqueeNorth { top: 0; left: 0; }
.imgCrop_marqueeEast { top: 0; right: 0; }
.imgCrop_marqueeSouth { bottom: 0px; left: 0; }
.imgCrop_marqueeWest { top: 0; left: 0; }
.imgCrop_handle {
position: absolute;
border: 1px solid #333;
width: 6px;
height: 6px;
background: #FFF;
opacity: 0.5;
filter:alpha(opacity=50);
z-index: 4;
}
/* fix IE 5 box model */
* html .imgCrop_handle {
width: 8px;
height: 8px;
wid\th: 6px;
hei\ght: 6px;
}
.imgCrop_handleN {
top: -3px;
left: 0;
/* margin-left: 49%; @done_in_js */
cursor: n-resize;
}
.imgCrop_handleNE {
top: -3px;
right: -3px;
cursor: ne-resize;
}
.imgCrop_handleE {
top: 0;
right: -3px;
/* margin-top: 49%; @done_in_js */
cursor: e-resize;
}
.imgCrop_handleSE {
right: -3px;
bottom: -3px;
cursor: se-resize;
}
.imgCrop_handleS {
right: 0;
bottom: -3px;
/* margin-right: 49%; @done_in_js */
cursor: s-resize;
}
.imgCrop_handleSW {
left: -3px;
bottom: -3px;
cursor: sw-resize;
}
.imgCrop_handleW {
top: 0;
left: -3px;
/* margin-top: 49%; @done_in_js */
cursor: w-resize;
}
.imgCrop_handleNW {
top: -3px;
left: -3px;
cursor: nw-resize;
}
/**
* Create an area to click & drag around on as the default browser behaviour is to let you drag the image
*/
.imgCrop_dragArea {
width: 100%;
height: 100%;
z-index: 200;
position: absolute;
top: 0;
left: 0;
}
.imgCrop_previewWrap {
/* width: 200px; @done_in_js */
/* height: 200px; @done_in_js */
overflow: hidden;
position: relative;
}
.imgCrop_previewWrap img {
position: absolute;
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
Copyright (c) 2006-2011, David Spurr (www.defusion.org.uk)
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the David Spurr nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
http://www.opensource.org/licenses/bsd-license.php

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

12
htdocs/js/prototype.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
var Builder={NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},node:function(e){e=e.toUpperCase();var t=this.NODEMAP[e]||"div",i=document.createElement(t);try{i.innerHTML="<"+e+"></"+e+">"}catch(n){}var r=i.firstChild||null;if(r&&r.tagName.toUpperCase()!=e&&(r=r.getElementsByTagName(e)[0]),r||(r=document.createElement(e)),r){if(arguments[1])if(this._isStringOrNumber(arguments[1])||arguments[1]instanceof Array||arguments[1].tagName)this._children(r,arguments[1]);else{var s=this._attributes(arguments[1]);if(s.length){try{i.innerHTML="<"+e+" "+s+"></"+e+">"}catch(n){}if(r=i.firstChild||null,!r){r=document.createElement(e);for(attr in arguments[1])r["class"==attr?"className":attr]=arguments[1][attr]}r.tagName.toUpperCase()!=e&&(r=i.getElementsByTagName(e)[0])}}return arguments[2]&&this._children(r,arguments[2]),$(r)}},_text:function(e){return document.createTextNode(e)},ATTR_MAP:{className:"class",htmlFor:"for"},_attributes:function(e){var t=[];for(attribute in e)t.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+(""+e[attribute]).escapeHTML().gsub(/"/,"&quot;")+'"');return t.join(" ")},_children:function(e,t){return t.tagName?(e.appendChild(t),void 0):("object"==typeof t?t.flatten().each(function(t){"object"==typeof t?e.appendChild(t):Builder._isStringOrNumber(t)&&e.appendChild(Builder._text(t))}):Builder._isStringOrNumber(t)&&e.appendChild(Builder._text(t)),void 0)},_isStringOrNumber:function(e){return"string"==typeof e||"number"==typeof e},build:function(e){var t=this.node("div");return $(t).update(e.strip()),t.down()},dump:function(e){"object"!=typeof e&&"function"!=typeof e&&(e=window);var t="A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR".split(/\s+/);t.each(function(t){e[t]=function(){return Builder.node.apply(Builder,[t].concat($A(arguments)))}})}};

1
htdocs/js/scriptaculous/controls.js vendored Normal file

File diff suppressed because one or more lines are too long

1
htdocs/js/scriptaculous/dragdrop.js vendored Normal file

File diff suppressed because one or more lines are too long

1
htdocs/js/scriptaculous/effects.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
var Scriptaculous={Version:"1.9.0",require:function(e){try{document.write('<script type="text/javascript" src="'+e+'"></script>')}catch(t){var i=document.createElement("script");i.type="text/javascript",i.src=e,document.getElementsByTagName("head")[0].appendChild(i)}},REQUIRED_PROTOTYPE:"1.6.0.3",load:function(){function e(e){var t=e.replace(/_.*|\./g,"");return t=parseInt(t+"0".times(4-t.length)),e.indexOf("_")>-1?t-1:t}if("undefined"==typeof Prototype||"undefined"==typeof Element||Element.Methods===void 0||e(Prototype.Version)<e(Scriptaculous.REQUIRED_PROTOTYPE))throw"script.aculo.us requires the Prototype JavaScript framework >= "+Scriptaculous.REQUIRED_PROTOTYPE;var t=/scriptaculous\.js(\?.*)?$/;$$("script[src]").findAll(function(e){return e.src.match(t)}).each(function(e){var i=e.src.replace(t,""),n=e.src.match(/\?.*load=([a-z,]*)/);(n?n[1]:"builder,effects,dragdrop,controls,slider,sound").split(",").each(function(e){Scriptaculous.require(i+e+".js")})})}};Scriptaculous.load();

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
Sound={tracks:{},_enabled:!0,template:new Template('<embed style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="false" autostart="true" hidden="true"/>'),enable:function(){Sound._enabled=!0},disable:function(){Sound._enabled=!1},play:function(e){if(Sound._enabled){var t=Object.extend({track:"global",url:e,replace:!1},arguments[1]||{});t.replace&&this.tracks[t.track]&&($R(0,this.tracks[t.track].id).each(function(e){var i=$("sound_"+t.track+"_"+e);i.Stop&&i.Stop(),i.remove()}),this.tracks[t.track]=null),this.tracks[t.track]?this.tracks[t.track].id++:this.tracks[t.track]={id:0},t.id=this.tracks[t.track].id,$$("body")[0].insert(Prototype.Browser.IE?new Element("bgsound",{id:"sound_"+t.track+"_"+t.id,src:t.url,loop:1,autostart:!0}):Sound.template.evaluate(t))}}},Prototype.Browser.Gecko&&navigator.userAgent.indexOf("Win")>0&&(navigator.plugins&&$A(navigator.plugins).detect(function(e){return-1!=e.name.indexOf("QuickTime")})?Sound.template=new Template('<object id="sound_#{track}_#{id}" width="0" height="0" type="audio/mpeg" data="#{url}"/>'):navigator.plugins&&$A(navigator.plugins).detect(function(e){return-1!=e.name.indexOf("Windows Media")})?Sound.template=new Template('<object id="sound_#{track}_#{id}" type="application/x-mplayer2" data="#{url}"></object>'):navigator.plugins&&$A(navigator.plugins).detect(function(e){return-1!=e.name.indexOf("RealPlayer")})?Sound.template=new Template('<embed type="audio/x-pn-realaudio-plugin" style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="false" autostart="true" hidden="true"/>'):Sound.play=function(){});

File diff suppressed because one or more lines are too long

171
htdocs/js/smokeping.js Normal file
View File

@@ -0,0 +1,171 @@
/*++ from bonsai.js ++ urlObj +++++++++++++++++++++++++++++++++++++++++*/
function urlObj(url) {
var urlBaseAndParameters;
urlBaseAndParameters = url.split("?");
this.urlBase = urlBaseAndParameters[0];
this.urlParameters = urlBaseAndParameters[1].split(/[;&]/);
this.getUrlBase = urlObjGetUrlBase;
}
/*++ from bonsai.js ++ urlObjGetUrlBase +++++++++++++++++++++++++++++++*/
function urlObjGetUrlBase() {
return this.urlBase;
}
function parseRelativeTime(currTime) {
var unit = '';
var offset = 0;
var sign = -1;
var table = {
s : 1, // 1
m : 60, // s * 60
h : 3600, // m * 60
d : 86400, // h * 24
w : 604800, // d * 7
mo : 2592000, // d * 30
y : 31536000, // d * 365
};
var regexStr = currTime.match(/[+\-]|[^a-z]+|[a-zA-Z]+/gi);
if (regexStr[0] == '+')
sign = 1;
for (i=1; i< regexStr.length; i=i+2) {
unit = regexStr[i+1].slice(0,1);
if (regexStr[i+1].slice(0,2) == 'mo' || (regexStr[i+1] == 'm' && Math.abs(regexStr[i]) <= 5))
unit = 'mo';
offset += regexStr[i]*table[unit];
}
offset = offset*sign;
return Math.floor(Date.now()/1000) + offset;
}
// example with minimum dimensions
var myCropper;
var StartEpoch = 0;
var EndEpoch = 0;
function changeRRDImage(coords,dimensions){
// disable reloading the RRD image while zoomed in
try {
window.stop();
} catch (exception) {
// fallback for IE
document.execCommand('Stop');
}
var SelectLeft = Math.min(coords.x1,coords.x2);
var SelectRight = Math.max(coords.x1,coords.x2);
if (SelectLeft == SelectRight)
return; // abort if nothing is selected.
var RRDLeft = 67; // difference between left border of RRD image and content
var RRDRight = 26; // difference between right border of RRD image and content
var RRDImgWidth = $('zoom').getDimensions().width; // Width of the Smokeping RRD Graphik
var RRDImgUsable = RRDImgWidth - RRDRight - RRDLeft;
var form = $('range_form');
if (StartEpoch == 0) {
StartEpoch = +$F('epoch_start');
if (isNaN(StartEpoch))
StartEpoch = parseRelativeTime($F('epoch_start'));
}
if (EndEpoch == 0) {
EndEpoch = +$F('epoch_end');
if (isNaN(EndEpoch))
EndEpoch = parseRelativeTime($F('epoch_end'));
}
var DivEpoch = EndEpoch - StartEpoch;
var Target = $F('target');
var Hierarchy = $F('hierarchy');
// construct Image URL
var myURLObj = new urlObj(document.URL);
var myURL = myURLObj.getUrlBase();
// Generate Selected Range in Unix Timestamps
var LeftFactor = 1;
var RightFactor = 1;
if (SelectLeft < RRDLeft)
LeftFactor = 10;
StartEpoch = Math.floor(StartEpoch + (SelectLeft - RRDLeft) * DivEpoch / RRDImgUsable * LeftFactor );
if (SelectRight > RRDImgWidth - RRDRight)
RightFactor = 10;
EndEpoch = Math.ceil(EndEpoch + (SelectRight - (RRDImgWidth - RRDRight) ) * DivEpoch / RRDImgUsable * RightFactor);
$('zoom').src = myURL + '?displaymode=a;start=' + StartEpoch + ';end=' + EndEpoch + ';target=' + Target + ';hierarchy=' + Hierarchy;
myCropper.setParams();
};
if($('range_form') != null && $('range_form').length){
$('range_form').on('submit', (function() {
$form = $(this);
var cgiurl = $form.action.split("?");
var action = $form.serialize().split("&");
action = action.map(i=> i + ';');
$form.action = cgiurl[0] + "?" + action[4] + action[5] + action[6] + action[3];
}));
}
Event.observe(
window,
'load',
function() {
let refresh = setTimeout(function () {
location.reload();
}, window.options.step * 1000);
$('menu-button').observe('click', function (e) {
if ($('sidebar').getStyle('left') == '0px') {
$('body').addClassName('sidebar-hidden');
$('body').removeClassName('sidebar-visible');
} else {
$('body').removeClassName('sidebar-hidden');
$('body').addClassName('sidebar-visible');
}
Event.stop(e);
});
$('refresh-button').observe('click', function (e) {
if (localStorage.getItem("noRefresh")) {
localStorage.removeItem("noRefresh");
refresh = setTimeout(function () {
location.reload();
}, window.options.step * 1000);
$('refresh-button').style.textDecoration = "line-through";
} else {
clearTimeout(refresh);
localStorage.setItem("noRefresh", true);
$('refresh-button').style.textDecoration = "none";
}
Event.stop(e);
});
if ($('zoom') != null) {
myCropper = new Cropper.Img(
'zoom',
{
minHeight: $('zoom').getDimensions().height,
maxHeight: $('zoom').getDimensions().height,
onEndCrop: changeRRDImage
}
)
}
}
);