[pkg-nagios-changes] [Git][nagios-team/pkg-nagvis][master] 3 commits: New upstream version 1.9.18

Markus Frosch gitlab at salsa.debian.org
Tue Mar 24 15:48:14 GMT 2020



Markus Frosch pushed to branch master at Debian Nagios Maintainer Group / pkg-nagvis


Commits:
23754f8a by Markus Frosch at 2020-03-24T16:43:16+01:00
New upstream version 1.9.18
- - - - -
933359d4 by Markus Frosch at 2020-03-24T16:43:27+01:00
Update upstream source from tag 'upstream/1.9.18'

Update to upstream version '1.9.18'
with Debian dir 657223c4bda91964fd9a42ca92fe48546fc62e50
- - - - -
2cd7620b by Markus Frosch at 2020-03-24T16:46:04+01:00
Update changelog

- - - - -


20 changed files:

- ChangeLog
- debian/changelog
- docs/en_US/map_config_format_description.html
- + share/frontend/nagvis-js/images/nicedit/nicEditIcons-latest.gif
- share/frontend/nagvis-js/js/ElementLine.js
- + share/frontend/nagvis-js/js/ExtNicEdit.js
- share/frontend/nagvis-js/js/ViewWorldmap.js
- share/frontend/nagvis-js/js/ajax.js
- share/frontend/nagvis-js/js/frontend.js
- share/frontend/nagvis-js/js/nagvis.js
- share/server/core/classes/CoreModMap.php
- share/server/core/classes/ViewMapAddModify.php
- share/server/core/classes/objects/NagVisStatefulObject.php
- share/server/core/defines/global.php
- share/server/core/defines/matches.php
- share/server/core/functions/html.php
- share/server/core/mapcfg/default.php
- share/server/core/sources/worldmap.php
- share/userfiles/templates/default.css
- share/userfiles/templates/default.header.js


Changes:

=====================================
ChangeLog
=====================================
@@ -1,4 +1,18 @@
+1.9.18
+Core:
+  * Add new map global option "ignore_linked_maps_summary_state" (issue #223)
+  * FIX: Worldmap max_zoom is now 20 (issue #228)
+
+Frontend:
+  * Weathermap lines: New options line_label_in/line_label_out to configure
+    the name of the perfdata values to use for in/out traffic (#244)
+  * Weathermap lines: Use "CRITICAL" color when no perfdata is available (#243)
+  * Sidebar map states now indicate acknowledgement and downtime states (issue #221)
+  * Textboxes can now be edited using a simple WYSIWIG editor (issue #216)
+  * Worldmap: render middle sections of long lines
+
 1.9.17
+Core:
   * FIX: Fix PHP 5.3 incompatibility introduced with 1.9.16
   * FIX: Fix IE 11 incompatibility on worldmaps in relation to lines
 	 which was introduced with 1.9.13


=====================================
debian/changelog
=====================================
@@ -1,4 +1,4 @@
-nagvis (1:1.9.17-1) unstable; urgency=medium
+nagvis (1:1.9.18-1) UNRELEASED; urgency=medium
 
   [ Debian Janitor ]
   * Trim trailing whitespace.
@@ -20,7 +20,10 @@ nagvis (1:1.9.17-1) unstable; urgency=medium
   * New upstream release (Closes: #949387).
   * Add myself to uploaders.
 
- -- Adam Cecile <acecile at le-vert.net>  Mon, 20 Jan 2020 16:02:56 +0100
+  [ Markus Frosch ]
+  * [23754f8] New upstream version 1.9.18
+
+ -- Markus Frosch <lazyfrosch at debian.org>  Tue, 24 Mar 2020 16:45:04 +0100
 
 nagvis (1:1.9.11-1) unstable; urgency=medium
 


=====================================
docs/en_US/map_config_format_description.html
=====================================
@@ -259,6 +259,12 @@
         <td> show_in_lists </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Show the maps in lists (dropdowns, index page, ...) </td>
         </tr>
         <tr>
+        <td>ignore_linked_maps_summary_state</td>
+	<td>0</td>
+	<td>Ignore child map summary state in parent's summary state</td>
+        </tr>
+        <tr>
+	
         <td> show_in_multisite</td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td>Show the maps in multisite snapin</td>
         </tr>
         <tr>
@@ -656,6 +662,16 @@
         </td>
         </tr>
         <tr>
+        <td>line_label_in</td>
+        <td>in</td>
+        <td>Specify which performance data name you want to use for the "inbound" weathermap line.</td>
+        </tr>
+        <tr>
+        <td>line_label_out</td>
+        <td>out</td>
+        <td>Specify which performance data name you want to use for the "outbound" weathermap line.</td>
+        </tr>
+        <tr>
         <td>line_label_y_offset</td>
         <td>2</td>
         <td>This option defines the offset of the labels to the line when rendering weathermap lines which show percentage


=====================================
share/frontend/nagvis-js/images/nicedit/nicEditIcons-latest.gif
=====================================
Binary files /dev/null and b/share/frontend/nagvis-js/images/nicedit/nicEditIcons-latest.gif differ


=====================================
share/frontend/nagvis-js/js/ElementLine.js
=====================================
@@ -291,7 +291,7 @@ var ElementLine = Element.extend({
         // are added later. But this container gets all event handlers assigned. Because
         // the line is using erase(), render(), draw() within place() which is called while
         // the user moves the object, this dom node must not be re-created, because this
-        // would remove all event handlers 
+        // would remove all event handlers
         if (!this.obj.trigger_obj) {
             var oLink = document.createElement('a');
             oLink.setAttribute('id', this.obj.conf.object_id+'-linelink');
@@ -655,6 +655,11 @@ var ElementLine = Element.extend({
     },
 
     renderLabel: function(id) {
+	if (this.parts.length === 0)
+	    return;
+	if (this.perfdata === null)
+            return;
+
         var x1 = this.parts[id][0][0],
             y1 = this.parts[id][0][1],
             x2 = this.parts[id][1][0],
@@ -666,9 +671,6 @@ var ElementLine = Element.extend({
         var x = middle(x1, x2, cut),
             y = middle(y1, y2, cut);
 
-        if (this.perfdata === null)
-            return;
-
         var txt;
         if (this.obj.conf.line_type == 13 || this.obj.conf.line_type == 14) {
             // Show percentage label
@@ -777,7 +779,7 @@ var ElementLine = Element.extend({
             return oStates["ERROR"].color;
 
         if (!this.perfdata)
-            return '#FFCC66';
+            return oStates["CRITICAL"].color;
 
         if (this.perfdata[id][2] == '%' && this.perfdata[id][1] !== null) {
             return this.getColorFill(this.perfdata[id][1]);
@@ -814,6 +816,8 @@ var ElementLine = Element.extend({
     calculateUsage: function(oldPerfdata) {
         var newPerfdata = [];
         var foundNew = false;
+        var line_label_in = 'in';
+        var line_label_out = 'out';
 
         // Check_MK if/if64 checks support switching between bytes/bits. The detection
         // can be made by some curios hack. The most hackish hack I've ever seen. From hell.
@@ -824,8 +828,14 @@ var ElementLine = Element.extend({
 
         // This loop takes perfdata with the labels "in" and "out" and uses the current value
         // and maximum values to parse the percentage usage of the line
+        if (typeof this.obj.conf.line_label_in !== 'undefined') {
+            line_label_in = this.obj.conf.line_label_in;
+        }
+        if (typeof this.obj.conf.line_label_out !== 'undefined') {
+            line_label_out = this.obj.conf.line_label_out;
+        }
         for(var i = 0; i < oldPerfdata.length; i++) {
-            if(oldPerfdata[i][0] == 'in' && (oldPerfdata[i][2] === null || oldPerfdata[i][2] === '')) {
+            if(oldPerfdata[i][0] == line_label_in && (oldPerfdata[i][2] === null || oldPerfdata[i][2] === '')) {
                 newPerfdata[0] = this.perfdataCalcPerc(oldPerfdata[i]);
                 if(!display_bits) {
                     newPerfdata[2] = this.perfdataCalcBytesReadable(oldPerfdata[i]);
@@ -835,7 +845,7 @@ var ElementLine = Element.extend({
                 }
                 foundNew = true;
             }
-            if(oldPerfdata[i][0] == 'out' && (oldPerfdata[i][2] === null || oldPerfdata[i][2] === '')) {
+            if(oldPerfdata[i][0] == line_label_out && (oldPerfdata[i][2] === null || oldPerfdata[i][2] === '')) {
                 newPerfdata[1] = this.perfdataCalcPerc(oldPerfdata[i]);
                 if(!display_bits) {
                     newPerfdata[3] = this.perfdataCalcBytesReadable(oldPerfdata[i]);
@@ -945,7 +955,7 @@ var ElementLine = Element.extend({
         // Break perfdata parts into array
         for (var i = 0; i < perfdataMatches.length; i++) {
             // Get parts of perfdata from string
-            var tmpSetMatches = perfdataMatches[i].match(/(‘)?([\w\s\=\']*)(‘)?\=([\d\.\-\+]*)([\w%]*)[\;|\s]?([\d\.\-:~@]+)*[\;|\s]?([\d\.\-:~@]+)*[\;|\s]?([\d\.\-\+]*)[\;|\s]?([\d\.\-\+]*)/);
+            var tmpSetMatches = perfdataMatches[i].match(/(‘)?([\w\s\=\'\-]*)(‘)?\=([\d\.\-\+]*)([\w%]*)[\;|\s]?([\d\.\-:~@]+)*[\;|\s]?([\d\.\-:~@]+)*[\;|\s]?([\d\.\-\+]*)[\;|\s]?([\d\.\-\+]*)/);
 
             // Check if we got any perfdata
             if (tmpSetMatches === null)
@@ -967,32 +977,32 @@ var ElementLine = Element.extend({
     /*
      * There is a rectangle: viewport (current Leaflet map shown) + 10% on each side.
      * This function cuts the lines protruding beyond the rectangle.
-     * Shortened lines prevent renderLine() from generating many vast <canvas> (10000-ish pixels) which eventually lead 
-     * to memory exhaustion or crash the browser 
-     * 
+     * Shortened lines prevent renderLine() from generating many vast <canvas> (10000-ish pixels) which eventually lead
+     * to memory exhaustion or crash the browser
+     *
      * Returns:
      *  either: [xA, yA, xB, yB] - original or adjusted line A/B coordinates,
      *  or: null - line out of a rectangle, don't render
      */
-     
+
     cutLineBeyondViewport: function(xA, yA, xB, yB) {
         if (!g_map)
             return([xA, yA, xB, yB]); // no viewport - no clipping
 
         let viewport_size = g_map.getSize();
-        const xMax = viewport_size.x; // 1920
-        const yMax = viewport_size.y; // 1080
-        const xTolerance = xMax * 0.1; // 192 (10%)
-        const yTolerance = yMax * 0.1; // 108 (10%)
-        
-        // Cohen-Sutherland algorithm 
-        
-        // region codes 
-        const INSIDE = 0; // 0000 
-        const LEFT = 1;   // 0001 
-        const RIGHT = 2;  // 0010 
-        const BOTTOM = 4; // 0100 
-        const TOP = 8;    // 1000 
+        const xMax = viewport_size.x;  // 1920
+        const yMax = viewport_size.y;  // 1080
+        const xTolerance = xMax * 0.95; // 1824 (95%)
+        const yTolerance = yMax * 0.95; // 1026 (95%)
+
+        // Cohen-Sutherland algorithm
+
+        // region codes
+        const INSIDE = 0; // 0000
+        const LEFT = 1;   // 0001
+        const RIGHT = 2;  // 0010
+        const BOTTOM = 4; // 0100
+        const TOP = 8;    // 1000
 
         // boundaries
         const x_min = -xTolerance;
@@ -1001,102 +1011,102 @@ var ElementLine = Element.extend({
         const y_max = yMax + yTolerance;
 
         // Function to compute region code
-        let regionCode = function (x, y) 
-        { 
-            let code = INSIDE; 
-        
-            if (x < x_min)       // to the left of rectangle 
-                code |= LEFT; 
-            else if (x > x_max)  // to the right of rectangle 
-                code |= RIGHT; 
-            if (y < y_min)       // below the rectangle 
-                code |= BOTTOM; 
-            else if (y > y_max)  // above the rectangle 
-                code |= TOP; 
-        
-            return code; 
-        } 
+        let regionCode = function (x, y)
+        {
+            let code = INSIDE;
+
+            if (x < x_min)       // to the left of rectangle
+                code |= LEFT;
+            else if (x > x_max)  // to the right of rectangle
+                code |= RIGHT;
+            if (y < y_min)       // below the rectangle
+                code |= BOTTOM;
+            else if (y > y_max)  // above the rectangle
+                code |= TOP;
+
+            return code;
+        }
 
         let cohenSutherlandClip = function (x1, y1, x2, y2) {
-            let code1 = regionCode(x1, y1); 
-            let code2 = regionCode(x2, y2); 
-
-            let accept = false; 
-
-            while (true) 
-            { 
-                if ((code1 == 0) && (code2 == 0)) 
-                { 
-                    // If both endpoints lie within rectangle 
-                    accept = true; 
-                    break; 
-                } 
-                else if (code1 & code2) 
-                { 
-                    // If both endpoints are outside rectangle, 
-                    // in same region 
-                    break; 
-                } 
+            let code1 = regionCode(x1, y1);
+            let code2 = regionCode(x2, y2);
+
+            let accept = false;
+
+            while (true)
+            {
+                if ((code1 == 0) && (code2 == 0))
+                {
+                    // If both endpoints lie within rectangle
+                    accept = true;
+                    break;
+                }
+                else if (code1 & code2)
+                {
+                    // If both endpoints are outside rectangle,
+                    // in same region
+                    break;
+                }
                 else
-                { 
-                    // Some segment of line lies within the 
-                    // rectangle 
-                    let code_out; 
-                    let x, y; 
-
-                    // At least one endpoint is outside the  
-                    // rectangle, pick it. 
-                    if (code1 != 0) 
-                        code_out = code1; 
+                {
+                    // Some segment of line lies within the
+                    // rectangle
+                    let code_out;
+                    let x, y;
+
+                    // At least one endpoint is outside the
+                    // rectangle, pick it.
+                    if (code1 != 0)
+                        code_out = code1;
                     else
-                        code_out = code2; 
-
-                    // Find intersection point; 
-                    // using formulas y = y1 + slope * (x - x1), 
-                    // x = x1 + (1 / slope) * (y - y1) 
-                    if (code_out & TOP) 
-                    { 
-                        // point is above the clip rectangle 
-                        x = x1 + (x2 - x1) * (y_max - y1) / (y2 - y1); 
-                        y = y_max; 
-                    } 
-                    else if (code_out & BOTTOM) 
-                    { 
-                        // point is below the rectangle 
-                        x = x1 + (x2 - x1) * (y_min - y1) / (y2 - y1); 
-                        y = y_min; 
-                    } 
-                    else if (code_out & RIGHT) 
-                    { 
-                        // point is to the right of rectangle 
-                        y = y1 + (y2 - y1) * (x_max - x1) / (x2 - x1); 
-                        x = x_max; 
-                    } 
-                    else if (code_out & LEFT) 
-                    { 
-                        // point is to the left of rectangle 
-                        y = y1 + (y2 - y1) * (x_min - x1) / (x2 - x1); 
-                        x = x_min; 
-                    } 
-
-                    // Now intersection point x,y is found 
-                    // We replace point outside rectangle 
-                    // by intersection point 
-                    if (code_out == code1) 
-                    { 
-                        x1 = x; 
-                        y1 = y; 
-                        code1 = regionCode(x1, y1); 
-                    } 
+                        code_out = code2;
+
+                    // Find intersection point;
+                    // using formulas y = y1 + slope * (x - x1),
+                    // x = x1 + (1 / slope) * (y - y1)
+                    if (code_out & TOP)
+                    {
+                        // point is above the clip rectangle
+                        x = x1 + (x2 - x1) * (y_max - y1) / (y2 - y1);
+                        y = y_max;
+                    }
+                    else if (code_out & BOTTOM)
+                    {
+                        // point is below the rectangle
+                        x = x1 + (x2 - x1) * (y_min - y1) / (y2 - y1);
+                        y = y_min;
+                    }
+                    else if (code_out & RIGHT)
+                    {
+                        // point is to the right of rectangle
+                        y = y1 + (y2 - y1) * (x_max - x1) / (x2 - x1);
+                        x = x_max;
+                    }
+                    else if (code_out & LEFT)
+                    {
+                        // point is to the left of rectangle
+                        y = y1 + (y2 - y1) * (x_min - x1) / (x2 - x1);
+                        x = x_min;
+                    }
+
+                    // Now intersection point x,y is found
+                    // We replace point outside rectangle
+                    // by intersection point
+                    if (code_out == code1)
+                    {
+                        x1 = x;
+                        y1 = y;
+                        code1 = regionCode(x1, y1);
+                    }
                     else
-                    { 
-                        x2 = x; 
-                        y2 = y; 
-                        code2 = regionCode(x2, y2); 
-                    } 
-                } 
-            } 
-            if (accept) 
+                    {
+                        x2 = x;
+                        y2 = y;
+                        code2 = regionCode(x2, y2);
+                    }
+                }
+            }
+            if (accept)
                 return([x1, y1, x2, y2]);
             else
                 return null;


=====================================
share/frontend/nagvis-js/js/ExtNicEdit.js
=====================================
@@ -0,0 +1,125 @@
+/* NicEdit - Micro Inline WYSIWYG
+ * Copyright 2007-2008 Brian Kirchoff
+ *
+ * NicEdit is distributed under the terms of the MIT license
+ * For more information visit http://nicedit.com/
+ * Do not remove this copyright message
+ */
+var bkExtend=function(){var A=arguments;if(A.length==1){A=[this,A[0]]}for(var B in A[1]){A[0][B]=A[1][B]}return A[0]};function bkClass(){}bkClass.prototype.construct=function(){};bkClass.extend=function(C){var A=function(){if(arguments[0]!==bkClass){return this.construct.apply(this,arguments)}};var B=new this(bkClass);bkExtend(B,C);A.prototype=B;A.extend=this.extend;return A};var bkElement=bkClass.extend({construct:function(B,A){if(typeof (B)=="string"){B=(A||document).createElement(B)}B=$BK(B);return B},appendTo:function(A){A.appendChild(this);return this},appendBefore:function(A){A.parentNode.insertBefore(this,A);return this},addEvent:function(B,A){bkLib.addEvent(this,B,A);return this},setContent:function(A){this.innerHTML=A;return this},pos:function(){var C=curtop=0;var B=obj=this;if(obj.offsetParent){do{C+=obj.offsetLeft;curtop+=obj.offsetTop}while(obj=obj.offsetParent)}var A=(!window.opera)?parseInt(this.getStyle("border-width")||this.style.border)||0:0;return[C+A,curtop+A+this.offsetHeight]},noSelect:function(){bkLib.noSelect(this);return this},parentTag:function(A){var B=this;do{if(B&&B.nodeName&&B.nodeName.toUpperCase()==A){return B}B=B.parentNode}while(B);return false},hasClass:function(A){return this.className.match(new RegExp("(\\s|^)nicEdit-"+A+"(\\s|$)"))},addClass:function(A){if(!this.hasClass(A)){this.className+=" nicEdit-"+A}return this},removeClass:function(A){if(this.hasClass(A)){this.className=this.className.replace(new RegExp("(\\s|^)nicEdit-"+A+"(\\s|$)")," ")}return this},setStyle:function(A){var B=this.style;for(var C in A){switch(C){case"float":B.cssFloat=B.styleFloat=A[C];break;case"opacity":B.opacity=A[C];B.filter="alpha(opacity="+Math.round(A[C]*100)+")";break;case"className":this.className=A[C];break;default:B[C]=A[C]}}return this},getStyle:function(A,C){var B=(!C)?document.defaultView:C;if(this.nodeType==1){return(B&&B.getComputedStyle)?B.getComputedStyle(this,null).getPropertyValue(A):this.currentStyle[bkLib.camelize(A)]}},remove:function(){this.parentNode.removeChild(this);return this},setAttributes:function(A){for(var B in A){this[B]=A[B]}return this}});var bkLib={isMSIE:(navigator.appVersion.indexOf("MSIE")!=-1),addEvent:function(C,B,A){(C.addEventListener)?C.addEventListener(B,A,false):C.attachEvent("on"+B,A)},toArray:function(C){var B=C.length,A=new Array(B);while(B--){A[B]=C[B]}return A},noSelect:function(B){if(B.setAttribute&&B.nodeName.toLowerCase()!="input"&&B.nodeName.toLowerCase()!="textarea"){B.setAttribute("unselectable","on")}for(var A=0;A<B.childNodes.length;A++){bkLib.noSelect(B.childNodes[A])}},camelize:function(A){return A.replace(/\-(.)/g,function(B,C){return C.toUpperCase()})},inArray:function(A,B){return(bkLib.search(A,B)!=null)},search:function(A,C){for(var B=0;B<A.length;B++){if(A[B]==C){return B}}return null},cancelEvent:function(A){A=A||window.event;if(A.preventDefault&&A.stopPropagation){A.preventDefault();A.stopPropagation()}return false},domLoad:[],domLoaded:function(){if(arguments.callee.done){return }arguments.callee.done=true;for(i=0;i<bkLib.domLoad.length;i++){bkLib.domLoad[i]()}},onDomLoaded:function(A){this.domLoad.push(A);if(document.addEventListener){document.addEventListener("DOMContentLoaded",bkLib.domLoaded,null)}else{if(bkLib.isMSIE){document.write("<style>.nicEdit-main p { margin: 0; }</style><script id=__ie_onload defer "+((location.protocol=="https:")?"src='javascript:void(0)'":"src=//0")+"><\/script>");$BK("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){bkLib.domLoaded()}}}}window.onload=bkLib.domLoaded}};function $BK(A){if(typeof (A)=="string"){A=document.getElementById(A)}return(A&&!A.appendTo)?bkExtend(A,bkElement.prototype):A}var bkEvent={addEvent:function(A,B){if(B){this.eventList=this.eventList||{};this.eventList[A]=this.eventList[A]||[];this.eventList[A].push(B)}return this},fireEvent:function(){var A=bkLib.toArray(arguments),C=A.shift();if(this.eventList&&this.eventList[C]){for(var B=0;B<this.eventList[C].length;B++){this.eventList[C][B].apply(this,A)}}}};function __(A){return A}Function.prototype.closure=function(){var A=this,B=bkLib.toArray(arguments),C=B.shift();return function(){if(typeof (bkLib)!="undefined"){return A.apply(C,B.concat(bkLib.toArray(arguments)))}}};Function.prototype.closureListener=function(){var A=this,C=bkLib.toArray(arguments),B=C.shift();return function(E){E=E||window.event;if(E.target){var D=E.target}else{var D=E.srcElement}return A.apply(B,[E,D].concat(C))}};
+
+
+
+var nicEditorConfig = bkClass.extend({
+	buttons : {
+		'bold' : {name : __('Click to Bold'), command : 'Bold', tags : ['B','STRONG'], css : {'font-weight' : 'bold'}, key : 'b'},
+		'italic' : {name : __('Click to Italic'), command : 'Italic', tags : ['EM','I'], css : {'font-style' : 'italic'}, key : 'i'},
+		'underline' : {name : __('Click to Underline'), command : 'Underline', tags : ['U'], css : {'text-decoration' : 'underline'}, key : 'u'},
+		'left' : {name : __('Left Align'), command : 'justifyleft', noActive : true},
+		'center' : {name : __('Center Align'), command : 'justifycenter', noActive : true},
+		'right' : {name : __('Right Align'), command : 'justifyright', noActive : true},
+		'justify' : {name : __('Justify Align'), command : 'justifyfull', noActive : true},
+		'ol' : {name : __('Insert Ordered List'), command : 'insertorderedlist', tags : ['OL']},
+		'ul' : 	{name : __('Insert Unordered List'), command : 'insertunorderedlist', tags : ['UL']},
+		'subscript' : {name : __('Click to Subscript'), command : 'subscript', tags : ['SUB']},
+		'superscript' : {name : __('Click to Superscript'), command : 'superscript', tags : ['SUP']},
+		'strikethrough' : {name : __('Click to Strike Through'), command : 'strikeThrough', css : {'text-decoration' : 'line-through'}},
+		'removeformat' : {name : __('Remove Formatting'), command : 'removeformat', noActive : true},
+		'indent' : {name : __('Indent Text'), command : 'indent', noActive : true},
+		'outdent' : {name : __('Remove Indent'), command : 'outdent', noActive : true},
+		'hr' : {name : __('Horizontal Rule'), command : 'insertHorizontalRule', noActive : true}
+	},
+	iconsPath : 'images/nicedit/nicEditIcons-latest.gif',
+	buttonList : ['save','bold','italic','underline','left','center','right','justify','ol','ul','fontSize','fontFamily','fontFormat','indent','outdent','image','upload','link','unlink','forecolor','bgcolor'],
+	iconList : {"xhtml":1,"bgcolor":2,"forecolor":3,"bold":4,"center":5,"hr":6,"indent":7,"italic":8,"justify":9,"left":10,"ol":11,"outdent":12,"removeformat":13,"right":14,"save":25,"strikethrough":16,"subscript":17,"superscript":18,"ul":19,"underline":20,"image":21,"link":22,"unlink":23,"close":24,"arrow":26,"upload":27}
+
+});
+;
+var nicEditors={nicPlugins:[],editors:[],registerPlugin:function(B,A){this.nicPlugins.push({p:B,o:A})},allTextAreas:function(C){var A=document.getElementsByTagName("textarea");for(var B=0;B<A.length;B++){nicEditors.editors.push(new nicEditor(C).panelInstance(A[B]))}return nicEditors.editors},findEditor:function(C){var B=nicEditors.editors;for(var A=0;A<B.length;A++){if(B[A].instanceById(C)){return B[A].instanceById(C)}}}};var nicEditor=bkClass.extend({construct:function(C){this.options=new nicEditorConfig();bkExtend(this.options,C);this.nicInstances=new Array();this.loadedPlugins=new Array();var A=nicEditors.nicPlugins;for(var B=0;B<A.length;B++){this.loadedPlugins.push(new A[B].p(this,A[B].o))}nicEditors.editors.push(this);bkLib.addEvent(document.body,"mousedown",this.selectCheck.closureListener(this))},panelInstance:function(B,C){B=this.checkReplace($BK(B));var A=new bkElement("DIV").setStyle({width:(parseInt(B.getStyle("width"))||B.clientWidth)+"px"}).appendBefore(B);this.setPanel(A);return this.addInstance(B,C)},checkReplace:function(B){var A=nicEditors.findEditor(B);if(A){A.removeInstance(B);A.removePanel()}return B},addInstance:function(B,C){B=this.checkReplace($BK(B));if(B.contentEditable||!!window.opera){var A=new nicEditorInstance(B,C,this)}else{var A=new nicEditorIFrameInstance(B,C,this)}this.nicInstances.push(A);return this},removeInstance:function(C){C=$BK(C);var B=this.nicInstances;for(var A=0;A<B.length;A++){if(B[A].e==C){B[A].remove();this.nicInstances.splice(A,1)}}},removePanel:function(A){if(this.nicPanel){this.nicPanel.remove();this.nicPanel=null}},instanceById:function(C){C=$BK(C);var B=this.nicInstances;for(var A=0;A<B.length;A++){if(B[A].e==C){return B[A]}}},setPanel:function(A){this.nicPanel=new nicEditorPanel($BK(A),this.options,this);this.fireEvent("panel",this.nicPanel);return this},nicCommand:function(B,A){if(this.selectedInstance){this.selectedInstance.nicCommand(B,A)}},getIcon:function(D,A){var C=this.options.iconList[D];var B=(A.iconFiles)?A.iconFiles[D]:"";return{backgroundImage:"url('"+((C)?this.options.iconsPath:B)+"')",backgroundPosition:((C)?((C-1)*-18):0)+"px 0px"}},selectCheck:function(C,A){var B=false;do{if(A.className&&A.className.indexOf("nicEdit")!=-1){return false}}while(A=A.parentNode);this.fireEvent("blur",this.selectedInstance,A);this.lastSelectedInstance=this.selectedInstance;this.selectedInstance=null;return false}});nicEditor=nicEditor.extend(bkEvent);
+var nicEditorInstance=bkClass.extend({isSelected:false,construct:function(G,D,C){this.ne=C;this.elm=this.e=G;this.options=D||{};let newX=parseInt(G.getStyle("width"))||G.clientWidth;let newY=parseInt(G.getStyle("height"))||G.clientHeight;this.initialHeight=newY-8;var H=(G.nodeName.toLowerCase()=="textarea");if(H||this.options.hasPanel){var B=(bkLib.isMSIE&&!((typeof document.body.style.maxHeight!="undefined")&&document.compatMode=="CSS1Compat"));var E={width:newX+"px",border:"1px solid #ccc",borderTop:0,overflowY:"auto",overflowX:"hidden"};E[(B)?"height":"maxHeight"]=(this.ne.options.maxHeight)?this.ne.options.maxHeight+"px":null;this.editorContain=new bkElement("DIV").setStyle(E).appendBefore(G);var A=new bkElement("DIV").setStyle({width:(newX-8)+"px",margin:"4px",minHeight:newY+"px"}).addClass("main").appendTo(this.editorContain);G.setStyle({display:"none"});A.innerHTML=G.innerHTML;if(H){A.setContent(G.value);this.copyElm=G;var F=G.parentTag("FORM");if(F){bkLib.addEvent(F,"submit",this.saveContent.closure(this))}}A.setStyle((B)?{height:newY+"px"}:{overflow:"hidden"});this.elm=A}this.ne.addEvent("blur",this.blur.closure(this));this.init();this.blur()},init:function(){this.elm.setAttribute("contentEditable","true");if(this.getContent()==""){this.setContent("<br />")}this.instanceDoc=document.defaultView;this.elm.addEvent("mousedown",this.selected.closureListener(this)).addEvent("keypress",this.keyDown.closureListener(this)).addEvent("focus",this.selected.closure(this)).addEvent("blur",this.blur.closure(this)).addEvent("keyup",this.selected.closure(this));this.ne.fireEvent("add",this)},remove:function(){this.saveContent();if(this.copyElm||this.options.hasPanel){this.editorContain.remove();this.e.setStyle({display:"block"});this.ne.removePanel()}this.disable();this.ne.fireEvent("remove",this)},disable:function(){this.elm.setAttribute("contentEditable","false")},getSel:function(){return(window.getSelection)?window.getSelection():document.selection},getRng:function(){var A=this.getSel();if(!A||A.rangeCount===0){return }return(A.rangeCount>0)?A.getRangeAt(0):A.createRange()},selRng:function(A,B){if(window.getSelection){B.removeAllRanges();B.addRange(A)}else{A.select()}},selElm:function(){var C=this.getRng();if(!C){return }if(C.startContainer){var D=C.startContainer;if(C.cloneContents().childNodes.length==1){for(var B=0;B<D.childNodes.length;B++){var A=D.childNodes[B].ownerDocument.createRange();A.selectNode(D.childNodes[B]);if(C.compareBoundaryPoints(Range.START_TO_START,A)!=1&&C.compareBoundaryPoints(Range.END_TO_END,A)!=-1){return $BK(D.childNodes[B])}}}return $BK(D)}else{return $BK((this.getSel().type=="Control")?C.item(0):C.parentElement())}},saveRng:function(){this.savedRange=this.getRng();this.savedSel=this.getSel()},restoreRng:function(){if(this.savedRange){this.selRng(this.savedRange,this.savedSel)}},keyDown:function(B,A){if(B.ctrlKey){this.ne.fireEvent("key",this,B)}},selected:function(C,A){if(!A&&!(A=this.selElm)){A=this.selElm()}if(!C.ctrlKey){var B=this.ne.selectedInstance;if(B!=this){if(B){this.ne.fireEvent("blur",B,A)}this.ne.selectedInstance=this;this.ne.fireEvent("focus",B,A)}this.ne.fireEvent("selected",B,A);this.isFocused=true;this.elm.addClass("selected")}return false},blur:function(){this.isFocused=false;this.elm.removeClass("selected")},saveContent:function(){if(this.copyElm||this.options.hasPanel){this.ne.fireEvent("save",this);(this.copyElm)?this.copyElm.value=this.getContent():this.e.innerHTML=this.getContent()}},getElm:function(){return this.elm},getContent:function(){this.content=this.getElm().innerHTML;this.ne.fireEvent("get",this);return this.content},setContent:function(A){this.content=A;this.ne.fireEvent("set",this);this.elm.innerHTML=this.content},nicCommand:function(B,A){document.execCommand(B,false,A)}});
+var nicEditorIFrameInstance=nicEditorInstance.extend({savedStyles:[],init:function(){var B=this.elm.innerHTML.replace(/^\s+|\s+$/g,"");this.elm.innerHTML="";(!B)?B="<br />":B;this.initialContent=B;this.elmFrame=new bkElement("iframe").setAttributes({src:"javascript:;",frameBorder:0,allowTransparency:"true",scrolling:"no"}).setStyle({height:"100px",width:"100%"}).addClass("frame").appendTo(this.elm);if(this.copyElm){this.elmFrame.setStyle({width:(this.elm.offsetWidth-4)+"px"})}var A=["font-size","font-family","font-weight","color"];for(itm in A){this.savedStyles[bkLib.camelize(itm)]=this.elm.getStyle(itm)}setTimeout(this.initFrame.closure(this),50)},disable:function(){this.elm.innerHTML=this.getContent()},initFrame:function(){var B=$BK(this.elmFrame.contentWindow.document);B.designMode="on";B.open();var A=this.ne.options.externalCSS;B.write("<html><head>"+((A)?'<link href="'+A+'" rel="stylesheet" type="text/css" />':"")+'</head><body id="nicEditContent" style="margin: 0 !important; background-color: transparent !important;">'+this.initialContent+"</body></html>");B.close();this.frameDoc=B;this.frameWin=$BK(this.elmFrame.contentWindow);this.frameContent=$BK(this.frameWin.document.body).setStyle(this.savedStyles);this.instanceDoc=this.frameWin.document.defaultView;this.heightUpdate();this.frameDoc.addEvent("mousedown",this.selected.closureListener(this)).addEvent("keyup",this.heightUpdate.closureListener(this)).addEvent("keydown",this.keyDown.closureListener(this)).addEvent("keyup",this.selected.closure(this));this.ne.fireEvent("add",this)},getElm:function(){return this.frameContent},setContent:function(A){this.content=A;this.ne.fireEvent("set",this);this.frameContent.innerHTML=this.content;this.heightUpdate()},getSel:function(){return(this.frameWin)?this.frameWin.getSelection():this.frameDoc.selection},heightUpdate:function(){this.elmFrame.style.height=Math.max(this.frameContent.offsetHeight,this.initialHeight)+"px"},nicCommand:function(B,A){this.frameDoc.execCommand(B,false,A);setTimeout(this.heightUpdate.closure(this),100)}});
+var nicEditorPanel=bkClass.extend({construct:function(E,B,A){this.elm=E;this.options=B;this.ne=A;this.panelButtons=new Array();this.buttonList=bkExtend([],this.ne.options.buttonList);this.panelContain=new bkElement("DIV").setStyle({overflow:"hidden",width:"100%",border:"1px solid #cccccc",backgroundColor:"#efefef"}).addClass("panelContain");this.panelElm=new bkElement("DIV").setStyle({margin:"2px",marginTop:"0px",zoom:1,overflow:"hidden"}).addClass("panel").appendTo(this.panelContain);this.panelContain.appendTo(E);var C=this.ne.options;var D=C.buttons;for(button in D){this.addButton(button,C,true)}this.reorder();E.noSelect()},addButton:function(buttonName,options,noOrder){var button=options.buttons[buttonName];var type=(button.type)?eval("(typeof("+button.type+') == "undefined") ? null : '+button.type+";"):nicEditorButton;var hasButton=bkLib.inArray(this.buttonList,buttonName);if(type&&(hasButton||this.ne.options.fullPanel)){this.panelButtons.push(new type(this.panelElm,buttonName,options,this.ne));if(!hasButton){this.buttonList.push(buttonName)}}},findButton:function(B){for(var A=0;A<this.panelButtons.length;A++){if(this.panelButtons[A].name==B){return this.panelButtons[A]}}},reorder:function(){var C=this.buttonList;for(var B=0;B<C.length;B++){var A=this.findButton(C[B]);if(A){this.panelElm.appendChild(A.margin)}}},remove:function(){this.elm.remove()}});
+var nicEditorButton=bkClass.extend({construct:function(D,A,C,B){this.options=C.buttons[A];this.name=A;this.ne=B;this.elm=D;this.margin=new bkElement("DIV").setStyle({"float":"left",marginTop:"2px"}).appendTo(D);this.contain=new bkElement("DIV").setStyle({width:"20px",height:"20px"}).addClass("buttonContain").appendTo(this.margin);this.border=new bkElement("DIV").setStyle({backgroundColor:"#efefef",border:"1px solid #efefef"}).appendTo(this.contain);this.button=new bkElement("DIV").setStyle({width:"18px",height:"18px",overflow:"hidden",zoom:1,cursor:"pointer"}).addClass("button").setStyle(this.ne.getIcon(A,C)).appendTo(this.border);this.button.addEvent("mouseover",this.hoverOn.closure(this)).addEvent("mouseout",this.hoverOff.closure(this)).addEvent("mousedown",this.mouseClick.closure(this)).noSelect();if(!window.opera){this.button.onmousedown=this.button.onclick=bkLib.cancelEvent}B.addEvent("selected",this.enable.closure(this)).addEvent("blur",this.disable.closure(this)).addEvent("key",this.key.closure(this));this.disable();this.init()},init:function(){},hide:function(){this.contain.setStyle({display:"none"})},updateState:function(){if(this.isDisabled){this.setBg()}else{if(this.isHover){this.setBg("hover")}else{if(this.isActive){this.setBg("active")}else{this.setBg()}}}},setBg:function(A){switch(A){case"hover":var B={border:"1px solid #666",backgroundColor:"#ddd"};break;case"active":var B={border:"1px solid #666",backgroundColor:"#ccc"};break;default:var B={border:"1px solid #efefef",backgroundColor:"#efefef"}}this.border.setStyle(B).addClass("button-"+A)},checkNodes:function(A){var B=A;do{if(this.options.tags&&bkLib.inArray(this.options.tags,B.nodeName)){this.activate();return true}}while(B=B.parentNode&&B.className!="nicEdit");B=$BK(A);while(B.nodeType==3){B=$BK(B.parentNode)}if(this.options.css){for(itm in this.options.css){if(B.getStyle(itm,this.ne.selectedInstance.instanceDoc)==this.options.css[itm]){this.activate();return true}}}this.deactivate();return false},activate:function(){if(!this.isDisabled){this.isActive=true;this.updateState();this.ne.fireEvent("buttonActivate",this)}},deactivate:function(){this.isActive=false;this.updateState();if(!this.isDisabled){this.ne.fireEvent("buttonDeactivate",this)}},enable:function(A,B){this.isDisabled=false;this.contain.setStyle({opacity:1}).addClass("buttonEnabled");this.updateState();this.checkNodes(B)},disable:function(A,B){this.isDisabled=true;this.contain.setStyle({opacity:0.6}).removeClass("buttonEnabled");this.updateState()},toggleActive:function(){(this.isActive)?this.deactivate():this.activate()},hoverOn:function(){if(!this.isDisabled){this.isHover=true;this.updateState();this.ne.fireEvent("buttonOver",this)}},hoverOff:function(){this.isHover=false;this.updateState();this.ne.fireEvent("buttonOut",this)},mouseClick:function(){if(this.options.command){this.ne.nicCommand(this.options.command,this.options.commandArgs);if(!this.options.noActive){this.toggleActive()}}this.ne.fireEvent("buttonClick",this)},key:function(A,B){if(this.options.key&&B.ctrlKey&&String.fromCharCode(B.keyCode||B.charCode).toLowerCase()==this.options.key){this.mouseClick();if(B.preventDefault){B.preventDefault()}}}});
+var nicPlugin=bkClass.extend({construct:function(B,A){this.options=A;this.ne=B;this.ne.addEvent("panel",this.loadPanel.closure(this));this.init()},loadPanel:function(C){var B=this.options.buttons;for(var A in B){C.addButton(A,this.options)}C.reorder()},init:function(){}});
+
+
+var nicPaneOptions = { };
+
+var nicEditorPane=bkClass.extend({construct:function(D,C,B,A){this.ne=C;this.elm=D;this.pos=D.pos();this.contain=new bkElement("div").setStyle({zIndex:"99999",overflow:"hidden",position:"absolute",left:this.pos[0]+"px",top:this.pos[1]+"px"});this.pane=new bkElement("div").setStyle({fontSize:"12px",border:"1px solid #ccc",overflow:"hidden",padding:"4px",textAlign:"left",backgroundColor:"#ffffc9"}).addClass("pane").setStyle(B).appendTo(this.contain);if(A&&!A.options.noClose){this.close=new bkElement("div").setStyle({"float":"right",height:"16px",width:"16px",cursor:"pointer"}).setStyle(this.ne.getIcon("close",nicPaneOptions)).addEvent("mousedown",A.removePane.closure(this)).appendTo(this.pane)}this.contain.noSelect().appendTo(document.body);this.position();this.init()},init:function(){},position:function(){if(this.ne.nicPanel){var B=this.ne.nicPanel.elm;var A=B.pos();var C=A[0]+parseInt(B.getStyle("width"))-(parseInt(this.pane.getStyle("width"))+8);if(C<this.pos[0]){this.contain.setStyle({left:C+"px"})}}},toggle:function(){this.isVisible=!this.isVisible;this.contain.setStyle({display:((this.isVisible)?"block":"none")})},remove:function(){if(this.contain){this.contain.remove();this.contain=null}},append:function(A){A.appendTo(this.pane)},setContent:function(A){this.pane.setContent(A)}});
+
+
+var nicSelectOptions = {
+	buttons : {
+		'fontSize' : {name : __('Select Font Size'), type : 'nicEditorFontSizeSelect', command : 'fontsize'},
+		'fontFamily' : {name : __('Select Font Family'), type : 'nicEditorFontFamilySelect', command : 'fontname'},
+		'fontFormat' : {name : __('Select Font Format'), type : 'nicEditorFontFormatSelect', command : 'formatBlock'}
+	}
+};
+
+var nicEditorSelect=bkClass.extend({construct:function(D,A,C,B){this.options=C.buttons[A];this.elm=D;this.ne=B;this.name=A;this.selOptions=new Array();this.margin=new bkElement("div").setStyle({"float":"left",margin:"2px 1px 0 1px"}).appendTo(this.elm);this.contain=new bkElement("div").setStyle({width:"90px",height:"20px",cursor:"pointer",overflow:"hidden"}).addClass("selectContain").addEvent("click",this.toggle.closure(this)).appendTo(this.margin);this.items=new bkElement("div").setStyle({overflow:"hidden",zoom:1,border:"1px solid #ccc",paddingLeft:"3px",backgroundColor:"#fff"}).appendTo(this.contain);this.control=new bkElement("div").setStyle({overflow:"hidden","float":"right",height:"18px",width:"16px"}).addClass("selectControl").setStyle(this.ne.getIcon("arrow",C)).appendTo(this.items);this.txt=new bkElement("div").setStyle({overflow:"hidden","float":"left",width:"66px",height:"14px",marginTop:"1px",fontFamily:"sans-serif",textAlign:"center",fontSize:"12px"}).addClass("selectTxt").appendTo(this.items);if(!window.opera){this.contain.onmousedown=this.control.onmousedown=this.txt.onmousedown=bkLib.cancelEvent}this.margin.noSelect();this.ne.addEvent("selected",this.enable.closure(this)).addEvent("blur",this.disable.closure(this));this.disable();this.init()},disable:function(){this.isDisabled=true;this.close();this.contain.setStyle({opacity:0.6})},enable:function(A){this.isDisabled=false;this.close();this.contain.setStyle({opacity:1})},setDisplay:function(A){this.txt.setContent(A)},toggle:function(){if(!this.isDisabled){(this.pane)?this.close():this.open()}},open:function(){this.pane=new nicEditorPane(this.items,this.ne,{width:"88px",padding:"0px",borderTop:0,borderLeft:"1px solid #ccc",borderRight:"1px solid #ccc",borderBottom:"0px",backgroundColor:"#fff"});for(var C=0;C<this.selOptions.length;C++){var B=this.selOptions[C];var A=new bkElement("div").setStyle({overflow:"hidden",borderBottom:"1px solid #ccc",width:"88px",textAlign:"left",overflow:"hidden",cursor:"pointer"});var D=new bkElement("div").setStyle({padding:"0px 4px"}).setContent(B[1]).appendTo(A).noSelect();D.addEvent("click",this.update.closure(this,B[0])).addEvent("mouseover",this.over.closure(this,D)).addEvent("mouseout",this.out.closure(this,D)).setAttributes("id",B[0]);this.pane.append(A);if(!window.opera){D.onmousedown=bkLib.cancelEvent}}},close:function(){if(this.pane){this.pane=this.pane.remove()}},over:function(A){A.setStyle({backgroundColor:"#ccc"})},out:function(A){A.setStyle({backgroundColor:"#fff"})},add:function(B,A){this.selOptions.push(new Array(B,A))},update:function(A){this.ne.nicCommand(this.options.command,A);this.close()}});var nicEditorFontSizeSelect=nicEditorSelect.extend({sel:{1:"1 (8pt)",2:"2 (10pt)",3:"3 (12pt)",4:"4 (14pt)",5:"5 (18pt)",6:"6 (24pt)"},init:function(){this.setDisplay("Font Size...");for(itm in this.sel){this.add(itm,'<font size="'+itm+'">'+this.sel[itm]+"</font>")}}});var nicEditorFontFamilySelect=nicEditorSelect.extend({sel:{arial:"Arial","comic sans ms":"Comic Sans","courier new":"Courier New",georgia:"Georgia",helvetica:"Helvetica",impact:"Impact","times new roman":"Times","trebuchet ms":"Trebuchet",verdana:"Verdana"},init:function(){this.setDisplay("Font Family...");for(itm in this.sel){this.add(itm,'<font face="'+itm+'">'+this.sel[itm]+"</font>")}}});var nicEditorFontFormatSelect=nicEditorSelect.extend({sel:{p:"Paragraph",pre:"Pre",h6:"Heading 6",h5:"Heading 5",h4:"Heading 4",h3:"Heading 3",h2:"Heading 2",h1:"Heading 1"},init:function(){this.setDisplay("Font Format...");for(itm in this.sel){var A=itm.toUpperCase();this.add("<"+A+">","<"+itm+' style="padding: 0px; margin: 0px;">'+this.sel[itm]+"</"+A+">")}}});nicEditors.registerPlugin(nicPlugin,nicSelectOptions);
+
+var nicButtonTips=bkClass.extend({construct:function(A){this.ne=A;A.addEvent("buttonOver",this.show.closure(this)).addEvent("buttonOut",this.hide.closure(this))},show:function(A){this.timer=setTimeout(this.create.closure(this,A),400)},create:function(A){this.timer=null;if(!this.pane){this.pane=new nicEditorPane(A.button,this.ne,{fontSize:"12px",marginTop:"5px"});this.pane.setContent(A.options.name)}},hide:function(A){if(this.timer){clearTimeout(this.timer)}if(this.pane){this.pane=this.pane.remove()}}});nicEditors.registerPlugin(nicButtonTips);
+
+var nicEditorAdvancedButton=nicEditorButton.extend({init:function(){this.ne.addEvent("selected",this.removePane.closure(this)).addEvent("blur",this.removePane.closure(this))},mouseClick:function(){if(!this.isDisabled){if(this.pane&&this.pane.pane){this.removePane()}else{this.pane=new nicEditorPane(this.contain,this.ne,{width:(this.width||"270px"),backgroundColor:"#fff"},this);this.addPane();this.ne.selectedInstance.saveRng()}}},addForm:function(C,G){this.form=new bkElement("form").addEvent("submit",this.submit.closureListener(this));this.pane.append(this.form);this.inputs={};for(itm in C){var D=C[itm];var F="";if(G){F=G.getAttribute(itm)}if(!F){F=D.value||""}var A=C[itm].type;if(A=="title"){new bkElement("div").setContent(D.txt).setStyle({fontSize:"14px",fontWeight:"bold",padding:"0px",margin:"2px 0"}).appendTo(this.form)}else{var B=new bkElement("div").setStyle({overflow:"hidden",clear:"both"}).appendTo(this.form);if(D.txt){new bkElement("label").setAttributes({"for":itm}).setContent(D.txt).setStyle({margin:"2px 4px",fontSize:"13px",width:"50px",lineHeight:"20px",textAlign:"right","float":"left"}).appendTo(B)}switch(A){case"text":this.inputs[itm]=new bkElement("input").setAttributes({id:itm,value:F,type:"text"}).setStyle({margin:"2px 0",fontSize:"13px","float":"left",height:"20px",border:"1px solid #ccc",overflow:"hidden"}).setStyle(D.style).appendTo(B);break;case"select":this.inputs[itm]=new bkElement("select").setAttributes({id:itm}).setStyle({border:"1px solid #ccc","float":"left",margin:"2px 0"}).appendTo(B);for(opt in D.options){var E=new bkElement("option").setAttributes({value:opt,selected:(opt==F)?"selected":""}).setContent(D.options[opt]).appendTo(this.inputs[itm])}break;case"content":this.inputs[itm]=new bkElement("textarea").setAttributes({id:itm}).setStyle({border:"1px solid #ccc","float":"left"}).setStyle(D.style).appendTo(B);this.inputs[itm].value=F}}}new bkElement("input").setAttributes({type:"submit"}).setStyle({backgroundColor:"#efefef",border:"1px solid #ccc",margin:"3px 0","float":"left",clear:"both"}).appendTo(this.form);this.form.onsubmit=bkLib.cancelEvent},submit:function(){},findElm:function(B,A,E){var D=this.ne.selectedInstance.getElm().getElementsByTagName(B);for(var C=0;C<D.length;C++){if(D[C].getAttribute(A)==E){return $BK(D[C])}}},removePane:function(){if(this.pane){this.pane.remove();this.pane=null;this.ne.selectedInstance.restoreRng()}}});
+
+
+var nicLinkOptions = {
+	buttons : {
+		'link' : {name : 'Add Link', type : 'nicLinkButton', tags : ['A']},
+		'unlink' : {name : 'Remove Link',  command : 'unlink', noActive : true}
+	}
+};
+
+var nicLinkButton=nicEditorAdvancedButton.extend({addPane:function(){this.ln=this.ne.selectedInstance.selElm().parentTag("A");this.addForm({"":{type:"title",txt:"Add/Edit Link"},href:{type:"text",txt:"URL",value:"http://",style:{width:"150px"}},title:{type:"text",txt:"Title"},target:{type:"select",txt:"Open In",options:{"":"Current Window",_blank:"New Window"},style:{width:"100px"}}},this.ln)},submit:function(C){var A=this.inputs.href.value;if(A=="http://"||A==""){alert("You must enter a URL to Create a Link");return false}this.removePane();if(!this.ln){var B="javascript:nicTemp();";this.ne.nicCommand("createlink",B);this.ln=this.findElm("A","href",B)}if(this.ln){this.ln.setAttributes({href:this.inputs.href.value,title:this.inputs.title.value,target:this.inputs.target.options[this.inputs.target.selectedIndex].value})}}});nicEditors.registerPlugin(nicPlugin,nicLinkOptions);
+
+
+var nicColorOptions = {
+	buttons : {
+		'forecolor' : {name : __('Change Text Color'), type : 'nicEditorColorButton', noClose : true},
+		'bgcolor' : {name : __('Change Background Color'), type : 'nicEditorBgColorButton', noClose : true}
+	}
+};
+
+var nicEditorColorButton=nicEditorAdvancedButton.extend({addPane:function(){var D={0:"00",1:"33",2:"66",3:"99",4:"CC",5:"FF"};var H=new bkElement("DIV").setStyle({width:"270px"});for(var A in D){for(var F in D){for(var E in D){var I="#"+D[A]+D[E]+D[F];var C=new bkElement("DIV").setStyle({cursor:"pointer",height:"15px","float":"left"}).appendTo(H);var G=new bkElement("DIV").setStyle({border:"2px solid "+I}).appendTo(C);var B=new bkElement("DIV").setStyle({backgroundColor:I,overflow:"hidden",width:"11px",height:"11px"}).addEvent("click",this.colorSelect.closure(this,I)).addEvent("mouseover",this.on.closure(this,G)).addEvent("mouseout",this.off.closure(this,G,I)).appendTo(G);if(!window.opera){C.onmousedown=B.onmousedown=bkLib.cancelEvent}}}}this.pane.append(H.noSelect())},colorSelect:function(A){this.ne.nicCommand("foreColor",A);this.removePane()},on:function(A){A.setStyle({border:"2px solid #000"})},off:function(A,B){A.setStyle({border:"2px solid "+B})}});var nicEditorBgColorButton=nicEditorColorButton.extend({colorSelect:function(A){this.ne.nicCommand("hiliteColor",A);this.removePane()}});nicEditors.registerPlugin(nicPlugin,nicColorOptions);
+
+
+var nicImageOptions = {
+	buttons : {
+		'image' : {name : 'Add Image', type : 'nicImageButton', tags : ['IMG']}
+	}
+
+};
+
+var nicImageButton=nicEditorAdvancedButton.extend({addPane:function(){this.im=this.ne.selectedInstance.selElm().parentTag("IMG");this.addForm({"":{type:"title",txt:"Add/Edit Image"},src:{type:"text",txt:"URL",value:"http://",style:{width:"150px"}},alt:{type:"text",txt:"Alt Text",style:{width:"100px"}},align:{type:"select",txt:"Align",options:{none:"Default",left:"Left",right:"Right"}}},this.im)},submit:function(B){var C=this.inputs.src.value;if(C==""||C=="http://"){alert("You must enter a Image URL to insert");return false}this.removePane();if(!this.im){var A="javascript:nicImTemp();";this.ne.nicCommand("insertImage",A);this.im=this.findElm("IMG","src",A)}if(this.im){this.im.setAttributes({src:this.inputs.src.value,alt:this.inputs.alt.value,align:this.inputs.align.value})}}});nicEditors.registerPlugin(nicPlugin,nicImageOptions);
+
+
+var nicSaveOptions = {
+	buttons : {
+		'save' : {name : __('Save this content'), type : 'nicEditorSaveButton'}
+	}
+};
+
+var nicEditorSaveButton=nicEditorButton.extend({init:function(){if(!this.ne.options.onSave){this.margin.setStyle({display:"none"})}},mouseClick:function(){var B=this.ne.options.onSave;var A=this.ne.selectedInstance;B(A.getContent(),A.elm.id,A)}});nicEditors.registerPlugin(nicPlugin,nicSaveOptions);
+
+var nicXHTML=bkClass.extend({stripAttributes:["_moz_dirty","_moz_resizing","_extended"],noShort:["style","title","script","textarea","a"],cssReplace:{"font-weight:bold;":"strong","font-style:italic;":"em"},sizes:{1:"xx-small",2:"x-small",3:"small",4:"medium",5:"large",6:"x-large"},construct:function(A){this.ne=A;if(this.ne.options.xhtml){A.addEvent("get",this.cleanup.closure(this))}},cleanup:function(A){var B=A.getElm();var C=this.toXHTML(B);A.content=C},toXHTML:function(C,A,L){var G="";var O="";var P="";var I=C.nodeType;var Q=C.nodeName.toLowerCase();var N=C.hasChildNodes&&C.hasChildNodes();var B=new Array();switch(I){case 1:var H=C.attributes;switch(Q){case"b":Q="strong";break;case"i":Q="em";break;case"font":Q="span";break}if(A){for(var F=0;F<H.length;F++){var K=H[F];var M=K.nodeName.toLowerCase();var D=K.nodeValue;if(!K.specified||!D||bkLib.inArray(this.stripAttributes,M)||typeof (D)=="function"){continue}switch(M){case"style":var J=D.replace(/ /g,"");for(itm in this.cssReplace){if(J.indexOf(itm)!=-1){B.push(this.cssReplace[itm]);J=J.replace(itm,"")}}P+=J;D="";break;case"class":D=D.replace("Apple-style-span","");break;case"size":P+="font-size:"+this.sizes[D]+";";D="";break}if(D){O+=" "+M+'="'+D+'"'}}if(P){O+=' style="'+P+'"'}for(var F=0;F<B.length;F++){G+="<"+B[F]+">"}if(O==""&&Q=="span"){A=false}if(A){G+="<"+Q;if(Q!="br"){G+=O}}}if(!N&&!bkLib.inArray(this.noShort,M)){if(A){G+=" />"}}else{if(A){G+=">"}for(var F=0;F<C.childNodes.length;F++){var E=this.toXHTML(C.childNodes[F],true,true);if(E){G+=E}}}if(A&&N){G+="</"+Q+">"}for(var F=0;F<B.length;F++){G+="</"+B[F]+">"}break;case 3:G+=C.nodeValue;break}return G}});nicEditors.registerPlugin(nicXHTML);
+
+
+var nicCodeOptions = {
+	buttons : {
+		'xhtml' : {name : 'Edit HTML', type : 'nicCodeButton'}
+	}
+
+};
+
+var nicCodeButton=nicEditorAdvancedButton.extend({width:"350px",addPane:function(){this.addForm({"":{type:"title",txt:"Edit HTML"},code:{type:"content",value:this.ne.selectedInstance.getContent(),style:{width:"340px",height:"200px"}}})},submit:function(B){var A=this.inputs.code.value;this.ne.selectedInstance.setContent(A);this.removePane()}});nicEditors.registerPlugin(nicPlugin,nicCodeOptions);
+
+var nicBBCode=bkClass.extend({construct:function(A){this.ne=A;if(this.ne.options.bbCode){A.addEvent("get",this.bbGet.closure(this));A.addEvent("set",this.bbSet.closure(this));var B=this.ne.loadedPlugins;for(itm in B){if(B[itm].toXHTML){this.xhtml=B[itm]}}}},bbGet:function(A){var B=this.xhtml.toXHTML(A.getElm());A.content=this.toBBCode(B)},bbSet:function(A){A.content=this.fromBBCode(A.content)},toBBCode:function(B){function A(D,C){B=B.replace(D,C)}A(/\n/gi,"");A(/<strong>(.*?)<\/strong>/gi,"[b]$1[/b]");A(/<em>(.*?)<\/em>/gi,"[i]$1[/i]");A(/<span.*?style="text-decoration:underline;">(.*?)<\/span>/gi,"[u]$1[/u]");A(/<ul>(.*?)<\/ul>/gi,"[list]$1[/list]");A(/<li>(.*?)<\/li>/gi,"[*]$1[]");A(/<ol>(.*?)<\/ol>/gi,"[list=1]$1[/list]");A(/<img.*?src="(.*?)".*?>/gi,"[img]$1[/img]");A(/<a.*?href="(.*?)".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");A(/<br.*?>/gi,"\n");A(/<.*?>.*?<\/.*?>/gi,"");return B},fromBBCode:function(A){function B(D,C){A=A.replace(D,C)}B(/\[b\](.*?)\[\/b\]/gi,"<strong>$1</strong>");B(/\[i\](.*?)\[\/i\]/gi,"<em>$1</em>");B(/\[u\](.*?)\[\/u\]/gi,'<span style="text-decoration:underline;">$1</span>');B(/\[list\](.*?)\[\/list\]/gi,"<ul>$1</ul>");B(/\[list=1\](.*?)\[\/list\]/gi,"<ol>$1</ol>");B(/\[\*\](.*?)\[\/\*\]/gi,"<li>$1</li>");B(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />');B(/\[url=(.*?)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>');B(/\n/gi,"<br />");return A}});nicEditors.registerPlugin(nicBBCode);
+
+
+var nicUploadOptions = {
+	buttons : {
+		'upload' : {name : 'Upload Image', type : 'nicUploadButton'}
+	}
+
+};
+
+var nicUploadButton=nicEditorAdvancedButton.extend({nicURI:"https://api.imgur.com/3/image",errorText:"Failed to upload image",addPane:function(){if(typeof window.FormData==="undefined"){return this.onError("Image uploads are not supported in this browser, use Chrome, Firefox, or Safari instead.")}this.im=this.ne.selectedInstance.selElm().parentTag("IMG");var A=new bkElement("div").setStyle({padding:"10px"}).appendTo(this.pane.pane);new bkElement("div").setStyle({fontSize:"14px",fontWeight:"bold",paddingBottom:"5px"}).setContent("Insert an Image").appendTo(A);this.fileInput=new bkElement("input").setAttributes({type:"file"}).appendTo(A);this.progress=new bkElement("progress").setStyle({width:"100%",display:"none"}).setAttributes("max",100).appendTo(A);this.fileInput.onchange=this.uploadFile.closure(this)},onError:function(A){this.removePane();alert(A||"Failed to upload image")},uploadFile:function(){var B=this.fileInput.files[0];if(!B||!B.type.match(/image.*/)){this.onError("Only image files can be uploaded");return }this.fileInput.setStyle({display:"none"});this.setProgress(0);var A=new FormData();A.append("image",B);var C=new XMLHttpRequest();C.open("POST",this.ne.options.uploadURI||this.nicURI);C.onload=function(){try{var D=JSON.parse(C.responseText).data}catch(E){return this.onError()}if(D.error){return this.onError(D.error)}this.onUploaded(D)}.closure(this);C.onerror=this.onError.closure(this);C.upload.onprogress=function(D){this.setProgress(D.loaded/D.total)}.closure(this);C.setRequestHeader("Authorization","Client-ID c37fc05199a05b7");C.send(A)},setProgress:function(A){this.progress.setStyle({display:"block"});if(A<0.98){this.progress.value=A}else{this.progress.removeAttribute("value")}},onUploaded:function(B){this.removePane();var D=B.link;if(!this.im){this.ne.selectedInstance.restoreRng();var C="javascript:nicImTemp();";this.ne.nicCommand("insertImage",D);this.im=this.findElm("IMG","src",D)}var A=parseInt(this.ne.selectedInstance.elm.getStyle("width"));if(this.im){this.im.setAttributes({src:D,width:(A&&B.width)?Math.min(A,B.width):""})}}});nicEditors.registerPlugin(nicPlugin,nicUploadOptions);


=====================================
share/frontend/nagvis-js/js/ViewWorldmap.js
=====================================
@@ -59,7 +59,7 @@ var ViewWorldmap = ViewMap.extend({
             "map": L.tileLayer(oGeneralProperties.worldmap_tiles_url, {
                 attribution: oGeneralProperties.worldmap_tiles_attribution,
                 noWrap: true, // don't repeat the world on horizontal axis
-                detectRetina: true, // look nice on high resolution screens
+                detectRetina: false, // this causes trouble with maximum zoom level (19 vs. 20), don't use
                 maxZoom: 20,
             }),
         }
@@ -67,7 +67,7 @@ var ViewWorldmap = ViewMap.extend({
             layers.satellite = L.tileLayer(oGeneralProperties.worldmap_satellite_tiles_url, {
                 attribution: oGeneralProperties.worldmap_satellite_tiles_attribution,
                 noWrap: true, // don't repeat the world on horizontal axis
-                detectRetina: true, // look nice on high resolution screens
+                detectRetina: false,
                 maxZoom: 20,
             })
         }


=====================================
share/frontend/nagvis-js/js/ajax.js
=====================================
@@ -155,7 +155,8 @@ function getFormParams(formId, skipHelperFields) {
         return data;
 
     // Get relevant input elements
-    var aFields = oForm.getElementsByTagName('input');
+    var aFields = oForm.querySelectorAll('input,textarea');
+
     for (var i = 0, len = aFields.length; i < len; i++) {
         // Filter helper fields (if told to do so)
         if (skipHelperFields && aFields[i].name.charAt(0) === '_')
@@ -173,6 +174,7 @@ function getFormParams(formId, skipHelperFields) {
 
         if (aFields[i].type == "hidden"
             || aFields[i].type == "text"
+            || aFields[i].type == "textarea"
             || aFields[i].type == "password"
             || aFields[i].type == "submit") {
             add_data(aFields[i].name, aFields[i].value);


=====================================
share/frontend/nagvis-js/js/frontend.js
=====================================
@@ -117,9 +117,6 @@ function clearFormValue(id) {
 }
 
 function showFrontendDialog(sUrl, sTitle, sWidth) {
-    if (typeof sWidth === 'undefined' || sWidth === null)
-        sWidth = 450;
-
     call_ajax(sUrl, {
         response_handler: function(response, data) {
             if (isset(response)) {
@@ -127,7 +124,9 @@ function showFrontendDialog(sUrl, sTitle, sWidth) {
                 response.url = sUrl;
 
                 if(typeof response !== 'undefined' && typeof response.code !== 'undefined') {
-                    popupWindow(data.title, response, data.width);
+                    let width = data.sWidth || 450;
+                    if (response.object_type === 'textbox') width = 800
+                    popupWindow(data.title, response, width);
                 }
             }
         },
@@ -432,7 +431,7 @@ function set_zoom(val) {
 
 function zoom(how) {
     var cur_zoom = getZoomFactor();
-    // This is not really correct. Assume 
+    // This is not really correct. Assume
     if (cur_zoom == 'fill')
         cur_zoom = 100;
     var new_zoom = 100;
@@ -666,8 +665,11 @@ function getViewParams(update, userParams) {
     if(!isset(params))
         return '';
 
-    if (g_map && usesSource('worldmap'))
-        params['bbox'] = g_map.getBounds().toBBoxString();
+    if (g_map && usesSource('worldmap')) {
+        let bounds = g_map.getBounds();
+        bounds = bounds.pad(0.95); // also load objects within 95% beyond actual viewport (better dragging experience)
+        params['bbox'] = bounds.toBBoxString();
+    }
 
     var sParams = '';
     for(var param in params) {


=====================================
share/frontend/nagvis-js/js/nagvis.js
=====================================
@@ -1237,7 +1237,7 @@ function getEffectiveStyle(e, attr) {
         // Object local
         return e.style[attr];
     } else if(document.defaultView && document.defaultView.getComputedStyle) {
-        // DOM 
+        // DOM
         return document.defaultView.getComputedStyle(e, null).getPropertyValue(attr);
     } else if(e.currentStyle){
         // IE
@@ -1263,7 +1263,7 @@ function getZoomFactor() {
     if (zoom === null || zoom == 'fill')
         g_zoom_factor = 100;
     else
-        g_zoom_factor = parseInt(zoom); 
+        g_zoom_factor = parseInt(zoom);
 
     return g_zoom_factor;
 }
@@ -1397,14 +1397,8 @@ function _(s, replace) {
 }
 
 function has_class(o, cn) {
-    if (typeof o.className === 'undefined')
-        return false;
-    var parts = o.className.split(' ');
-    for (var x = 0; x < parts.length; x++) {
-        if (parts[x] == cn)
-            return true;
-    }
-    return false;
+    if (!o.classList) return false;
+    return o.classList.contains(cn);
 }
 
 function remove_class(o, cn) {


=====================================
share/server/core/classes/CoreModMap.php
=====================================
@@ -130,7 +130,10 @@ class CoreModMap extends CoreModule {
                 break;
                 case 'addModify':
                     $VIEW = new ViewMapAddModify();
-                    $sReturn = json_encode(Array('code' => $VIEW->parse()));
+                    $sReturn = json_encode(Array(
+                        'code' => $VIEW->parse(),
+                        'object_type' => $VIEW->object_type()
+                    ));
                 break;
                 case 'manageTmpl':
                     $VIEW = new ViewMapManageTmpl();


=====================================
share/server/core/classes/ViewMapAddModify.php
=====================================
@@ -155,7 +155,7 @@ class ViewMapAddModify {
 
                 $this->validateAttributes();
 
-                // Update the map configuration   
+                // Update the map configuration
                 if($this->mode == 'view_params') {
                     // Only modify/add the given attributes. Don't remove any
                     // set options in the array
@@ -441,6 +441,9 @@ class ViewMapAddModify {
             case 'text':
                 input($propname, $value, '', $hideField);
             break;
+            case 'textarea':
+                textarea($propname, $value, '', $hideField);
+            break;
         }
 
         // Try to split too long values in chunks
@@ -621,5 +624,10 @@ class ViewMapAddModify {
 
         return ob_get_clean();
     }
+
+    public function object_type()
+    {
+        return $this->object_type;
+    }
 }
 ?>


=====================================
share/server/core/classes/objects/NagVisStatefulObject.php
=====================================
@@ -766,6 +766,11 @@ class NagVisStatefulObject extends NagVisObject {
         // Loop all object to gather the worst state and set it as summary
         // state of the current object
         foreach($objects AS $OBJ) {
+            if ($this->getType()=='map' && $OBJ->getType()=='map') {
+                if ($this->MAPCFG->getValue(0, 'ignore_linked_maps_summary_state') != 0)
+                    continue;
+            }
+
             $objSummaryState = $OBJ->sum[STATE];
             $objAck          = $OBJ->sum[ACK];
             $objDowntime     = $OBJ->sum[DOWNTIME];


=====================================
share/server/core/defines/global.php
=====================================
@@ -23,7 +23,7 @@
  *****************************************************************************/
  
 // NagVis Version
-define('CONST_VERSION', '1.9.17');
+define('CONST_VERSION', '1.9.18');
 
 // Set PHP error handling to standard level
 // Different levels for php versions below 5.1 because PHP 5.1 reports


=====================================
share/server/core/defines/matches.php
=====================================
@@ -25,7 +25,7 @@
 /**
  * @author	Lars Michelsen <lm at larsmichelsen.com>
  */
-define('MATCH_ALL', '/^.*$/i');
+define('MATCH_ALL', '/^.*$/mi');
 define('MATCH_NOT_EMPTY', '/^.+$/');
 define('MATCH_REGEX', '/^.*$/i');
 


=====================================
share/server/core/functions/html.php
=====================================
@@ -271,7 +271,21 @@ function textarea($name, $default = '', $class = '', $style = '') {
     if (submitted($form_name))
         $default = post($name, $default);
 
-    echo '<textarea name="'.$name.'"'.$class.$style.'>'.escape_html($default).'</textarea>'.N;
+    // plain <textarea>
+    echo '<textarea id="textarea_'.$name.'" name="'.$name.'"'.$class.$style.'>'.escape_html($default).'</textarea>'.N;
+
+    // better <textarea>
+    echo '
+    <script>
+        let script = document.createElement("script");
+        script.src = "js/ExtNicEdit.js"
+        document.head.appendChild(script);
+        script.onload = function() {
+            new nicEditor({fullPanel : true}).panelInstance("textarea_'.$name.'")
+        };
+    </script>
+    ';
+
 }
 
 function select($name, $options, $default = '', $onchange = '', $style = '', $size = null) {


=====================================
share/server/core/mapcfg/default.php
=====================================
@@ -543,6 +543,20 @@ $mapConfigVars = Array(
         'depends_on'    => 'view_type',
         'depends_value' => 'line'
     ),
+    'line_label_in' => Array(
+        'must'          => 0,
+        'default'       => 'in',
+        'match'         => MATCH_STRING,
+        'depends_on'    => 'view_type',
+        'depends_value' => 'line',
+    ),
+    'line_label_out' => Array(
+        'must'          => 0,
+        'default'       => 'out',
+        'match'         => MATCH_STRING,
+        'depends_on'    => 'view_type',
+        'depends_value' => 'line',
+    ),
     'line_label_y_offset' => Array(
         'must'          => 0,
         'default'       => 2,
@@ -652,6 +666,11 @@ $mapConfigVars = Array(
         'default'    => cfg('defaults', 'showinmultisite'),
         'match'      => MATCH_BOOLEAN,
         'field_type' => 'boolean'),
+    'ignore_linked_maps_summary_state' => Array(
+        'must'       => 0,
+        'default'    => '0',
+        'match'      => MATCH_BOOLEAN,
+        'field_type' => 'boolean'),
     'stylesheet' => Array(
         'must' => 0,
         'default' => cfg('defaults', 'stylesheet'),
@@ -834,6 +853,7 @@ $mapConfigVars = Array(
     'text' => Array(
         'must' => 1,
         'match' => MATCH_ALL,
+        'field_type'    => 'textarea',
     ),
     'border_color' => Array(
         'must'       => 0,
@@ -890,9 +910,9 @@ $mapConfigVars = Array(
         'match' => MATCH_STRING_NO_SPACE,
         'list'  => 'listTemplateNames',
     ),
-    
+
     // STATELESS LINE SPECIFIC OPTIONS
-    
+
     'view_type_line' => Array(
         'must'          => 1,
         'default'       => 'line',
@@ -932,7 +952,7 @@ $mapConfigVars = Array(
         'default'    => '',
         'field_type' => 'dropdown',
         'match'      => MATCH_DYN_GROUP_TYPES,
-        'list'       => 'listDynGroupTypes', 
+        'list'       => 'listDynGroupTypes',
     ),
     'object_filter' => Array(
         'must'       => 0,
@@ -976,6 +996,7 @@ $mapConfigVarMap['global'] = Array(
         'in_maintenance' => null,
         'show_in_lists' => null,
         'show_in_multisite' => null,
+        'ignore_linked_maps_summary_state' => null,
     ),
     'appearance' => array(
         'map_image' => null,
@@ -1188,6 +1209,8 @@ $mapConfigVarMap['service'] = Array(
         'line_type' => null,
         'line_cut' => null,
         'line_label_show' => null,
+        'line_label_in' => null,
+        'line_label_out' => null,
         'line_label_pos_in' => null,
         'line_label_pos_out' => null,
         'line_label_y_offset' => null,
@@ -1580,7 +1603,7 @@ $mapConfigVarMap['aggr'] = Array(
         'label_border'          => null,
         'label_style'           => null,
         'label_maxlen'          => null,
-    
+
     ),
     'hidden' => array(
         'type'                  => null,


=====================================
share/server/core/sources/worldmap.php
=====================================
@@ -2,7 +2,7 @@
 
 class WorldmapError extends MapSourceError {}
 
-define('MATCH_WORLDMAP_ZOOM', '/^1?[0-9]$/');
+define('MATCH_WORLDMAP_ZOOM', '/^1?[0-9]|20$/');
 
 // Register this source as being selectable by the user
 global $selectable;
@@ -46,7 +46,7 @@ $configVars = array(
     ),
     'max_zoom' => array(
         'must'      => false,
-        'default'   => 18,
+        'default'   => 20,
         'match'     => MATCH_WORLDMAP_ZOOM,
     ),
 );
@@ -155,24 +155,92 @@ function worldmap_init_db() {
     worldmap_init_schema();
 }
 
+// compuetes 2D line constants from a segment (2 points)
+// returns parameters r,s,t of the common 2D "rx + sy + t = 0" equation
+function line_parameters($ax, $ay, $bx, $by) {
+    // segment vector
+    $ux = $bx - $ax;
+    $uy = $by - $ay;
+
+    // perpendicular vector
+    $nx = $uy;
+    $ny = -$ux;
+
+    // r, s, t constants
+    $r = $nx;
+    $s = $ny;
+    $t = -($r*$ax + $s*$ay);
+
+    if ($s == -0) $s = 0;
+
+    return [$r, $s, $t];
+}
 function worldmap_get_objects_by_bounds($sw_lng, $sw_lat, $ne_lng, $ne_lat) {
     global $DB;
     worldmap_init_db();
 
     if ($sw_lat > $ne_lat) swap($sw_lat, $ne_lat);
     if ($sw_lng > $ne_lng) swap($sw_lng, $ne_lng);
-        
+
+    // The 4 bounding lines expressed as common 2D "rx + sy + t = 0" equations
+    list($rWest, $sWest, $tWest) = line_parameters($sw_lng, $sw_lat, $sw_lng, $ne_lat);
+    list($rNorth, $sNorth, $tNorth) = line_parameters($sw_lng, $ne_lat, $ne_lng, $ne_lat);
+    list($rEast, $sEast, $tEast) = line_parameters($ne_lng, $sw_lat, $ne_lng, $ne_lat);
+    list($rSouth, $sSouth, $tSouth) = line_parameters($sw_lng, $sw_lat, $ne_lng, $sw_lat);
+
+    /* SQLite 2D line equations */
+    $ux = '(lng2-lng)';
+    $uy = '(lat2-lat)';
+    $nx = $uy;
+    $ny = "(-($ux))";
+    $r = "($nx)";
+    $s = "($ny)";
+    $t = "(-$r*lng-$s*lat)";
+
+    // y-coordinate of line-vs-west-edge intersection
+    $intyWest = "($rWest*$t - ($tWest)*$r)/($sWest*$r - ($rWest)*$s)";
+    $intWithinWestBound = "($intyWest between :sw_lat and :ne_lat AND min(lng,lng2) <= :sw_lng AND max(lng,lng2) >= :sw_lng)";
+
+    // x-coordinate of line-vs-south-edge intersection
+    $intxSouth = "($s*$tSouth-($sSouth)*$t)/($sSouth*$r-$s*$rSouth)";
+    $intWithinSouthBound = "($intxSouth between :sw_lng and :ne_lng AND min(lat,lat2) <= :sw_lat AND max(lat,lat2) >= :sw_lat)";
+
+    // y-coordinate of line-vs-east-edge intersection
+    $intyEast = "($rEast*$t - ($tEast)*$r)/($sEast*$r - ($rEast)*$s)";
+    $intWithinEastBound = "($intyEast between :sw_lat and :ne_lat AND min(lng,lng2) <= :ne_lng AND max(lng,lng2) >= :ne_lng)";
+
+    // x-coordinate of line-vs-north-edge intersection
+    $intxNorth = "($s*$tNorth-($sNorth)*$t)/($sNorth*$r-$s*$rNorth)";
+    $intWithinNorthBound = "($intxNorth between :sw_lng and :ne_lng AND min(lat,lat2) <= :ne_lat AND max(lat,lat2) >= :ne_lat)";
+
     $q = 'SELECT lat, lng, lat2, lng2, object FROM objects WHERE'
+        // object lays, or line starts within bbox
         .'(lat BETWEEN :sw_lat AND :ne_lat AND lng BETWEEN :sw_lng AND :ne_lng)'
-        .'OR (lat2 BETWEEN :sw_lat AND :ne_lat AND lng2 BETWEEN :sw_lng AND :ne_lng)';
+        // line ends within bbox
+        .'OR (lat2 BETWEEN :sw_lat AND :ne_lat AND lng2 BETWEEN :sw_lng AND :ne_lng)'
+        // line intersects one of 4 bbox borders
+        ."OR (lat2>0 AND lng2>0 AND ($intWithinWestBound OR $intWithinSouthBound OR $intWithinEastBound OR $intWithinNorthBound))"
+        ;
+
+    $q = str_replace(':sw_lng', $sw_lng, $q);
+    $q = str_replace(':sw_lat', $sw_lat, $q);
+    $q = str_replace(':ne_lng', $ne_lng, $q);
+    $q = str_replace(':ne_lat', $ne_lat, $q);
+    // error_log("Query objects: $q");
+
+    $RES = $DB->query($q);
+
+    if ($RES == false) {
+        error_log(implode($DB->error(),','));
+        throw new WorldmapError(l('Failed to fetch objects: [E]; Query was [Q]', array(
+            'E' => json_encode($DB->error()), 'Q' => $q)));
+    }
 
-    $RES = $DB->query($q, array('sw_lng' => $sw_lng, 'sw_lat' => $sw_lat, 'ne_lng' => $ne_lng, 'ne_lat' => $ne_lat));
     $objects = array();
     $referenced = array();
     while ($data = $RES->fetch()) {
         $obj = json_decode($data['object'], true);
         $objects[$obj['object_id']] = $obj;
-
         // check all coordinates for relative coords
         $coords = array($data['lat'], $data['lng'], $data['lat2'], $data['lng2']);
         foreach ($coords as $coord) {


=====================================
share/userfiles/templates/default.css
=====================================
@@ -404,8 +404,6 @@ div#popupWindow h1 {
     overflow: hidden;
     text-overflow: ellipsis;
     white-space: nowrap;
-    max-width: 167px;
-    width: 165px;
 }
 #popupWindowContent input[type="radio"] {
     vertical-align: middle;
@@ -414,8 +412,12 @@ div#popupWindow h1 {
     width: 140x;
 }
 #popupWindowContent table.mytable tr td.tdfield input,
+#popupWindowContent table.mytable tr td.tdfield textarea,
 #popupWindowContent table.mytable tr td.tdfield select {
-    width: 163px;
+    width: 99%;
+}
+#popupWindowContent table.mytable tr td.tdfield textarea {
+    height: 250px;
 }
 #popupWindowContent table.mytable tr td.tdfield input[type="checkbox"] {
     width: auto;
@@ -765,6 +767,19 @@ div.statediv.sPENDING, div.statediv.sUNCHECKED {
     background-color: #C0C0C0;
 }
 
+div.statediv.sACK:not(.sDOWNTIME) {
+    border-style: dotted;
+    clip-path: polygon(100% 0, 100% 100%, 50% 50%, 0 100%, 0 0);
+}
+div.statediv.sDOWNTIME:not(.sACK) {
+    border-style: dotted;
+    clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 0, 50% 50%);
+}
+div.statediv.sACK.sDOWNTIME {
+    border-style: dotted;
+    clip-path: polygon(50% 50%, 100% 0, 100% 100%, 50% 50%, 0 100%, 0 0);
+}
+
 /*
  * Frontend eventlog styling
  */
@@ -774,17 +789,17 @@ div.statediv.sPENDING, div.statediv.sUNCHECKED {
 	bottom: 0px;
 	right: 20px;
 	z-index: 1000;
-	
+
 	width: 400px;
 	height: 70px;
-	
+
 	background-color: #d0d0d0;
 	border: 1px solid #000000;
 	border-bottom: 0;
-	
+
 	opacity:0.4;
 	/*filter:alpha(opacity=40);*/
-	
+
 	padding: 2px;
 	font-size: 0.8em;
 }
@@ -794,19 +809,19 @@ div.statediv.sPENDING, div.statediv.sUNCHECKED {
 	bottom: 75px;
 	right: 20px;
 	z-index: 1001;
-	
+
 	width: 10px;
 	height: 10px;
-	
+
 	background-color: #d0d0d0;
 	border: 1px solid #000000;
 	border-bottom: 0;
-	
+
 	opacity:0.4;
 	/*filter:alpha(opacity=40);*/
-	
+
 	padding: 2px;
-	
+
 	font-size: 0.8em;
 }
 


=====================================
share/userfiles/templates/default.header.js
=====================================
@@ -103,6 +103,12 @@ function headerUpdateState(map_conf) {
     var side = document.getElementById('side-state-' + map['name']);
     if (side) {
         side.className = 'statediv s' + map['summary_state'];
+        if (map['summary_problem_has_been_acknowledged'] == 1) {
+            side.className += ' sACK';
+        }
+        if (map['summary_in_downtime'] == 1) {
+            side.className += ' sDOWNTIME';
+        }
         side = null;
     }
 



View it on GitLab: https://salsa.debian.org/nagios-team/pkg-nagvis/-/compare/1f5b4d453e236c8daa3ebc2caba60b7fd0bd782a...2cd7620b92fd0b2c09aca491b2e90e77b7d2dc15

-- 
View it on GitLab: https://salsa.debian.org/nagios-team/pkg-nagvis/-/compare/1f5b4d453e236c8daa3ebc2caba60b7fd0bd782a...2cd7620b92fd0b2c09aca491b2e90e77b7d2dc15
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-nagios-changes/attachments/20200324/403e6d77/attachment-0001.html>


More information about the pkg-nagios-changes mailing list