Out of my own experimentation Kernal module.php = 64 kb to begin with, after Wizanda compression = 47kb
As for all files and online compressors, I don’t like them and not my plan for Xoops.
See if I can find some before and after shots:
Newbb_menu_click CSS 436 bytes
div.dropdown .menu, div.dropdown .userbar {
position: absolute;
left: 0px;
top: 2px;
visibility: hidden;
}
div.dropdown .userbar .item{
padding: 2px 5px;
}
div.dropdown .menubar{
float: left;
padding: 5px 10px;
margin: 0px 1px;
font-weight: bold;
}
div.dropdown a.item {
display: block;
}
Newbb_menu_click CSS 328 bytes
div.dropdown ul {display:block;margin:0px;padding:0px;border:0px;list-style:none;}
div.dropdown li {display:block;margin:0px;border:0px;position:relative;padding: 1px 0px;z-index:9;list-style:none;cursor: pointer;}
div.dropdown li:hover {z-index:10;}
div.dropdown li ul {position: absolute;display: none;left: -30px;top: 16px;}
div.dropdown li>ul { left: -1px;}
div.dropdown ul {z-index:1}
div.dropdown li:hover ul{display:block;}
For me 1 that is easier to see the whole content in an editor, and 2 reduces read speed, without making scrabbled eggs!
Ok now JS files:
newbb_menu_click js 1.39 Kb
function openMenu(event, id) {
var el, x, y;
el = document.getElementById(id);
if (window.event) {
x = window.event.clientX + document.documentElement.scrollLeft
+ document.body.scrollLeft;
y = window.event.clientY + document.documentElement.scrollTop +
+ document.body.scrollTop;
}
else {
x = event.clientX + window.scrollX;
y = event.clientY + window.scrollY;
}
x -= 2; y -= 2;
el.style.left = x + "px";
el.style.top = y + "px";
el.style.visibility = "visible";
}
function closeMenu(event) {
var current, related;
if (window.event) {
current = this;
related = window.event.toElement;
}
else {
current = event.currentTarget;
related = event.relatedTarget;
}
if (current != related && !contains(current, related))
current.style.visibility = "hidden";
}
function contains(a, b) {
// Return true if node a contains node b.
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
newbb_menu_click JS 1.21 Kb
function openMenu(event, id) {var el, x, y;
el = document.getElementById(id);
if (window.event) {
x = window.event.clientX + document.documentElement.scrollLeft
+ document.body.scrollLeft;
y = window.event.clientY + document.documentElement.scrollTop +
+ document.body.scrollTop;}
else {x = event.clientX + window.scrollX;
y = event.clientY + window.scrollY;}
x -= 2; y -= 2;
el.style.left = x + "px";
el.style.top = y + "px";
el.style.visibility = "visible";}
function closeMenu(event) {
var current, related;
if (window.event) {current = this;
related = window.event.toElement;}
else {current = event.currentTarget;
related = event.relatedTarget;}
if (current != related && !contains(current, related))
current.style.visibility = "hidden";}
function contains(a, b) {
// Return true if node a contains node b.
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;}
Again making for easier reading by us and the browser and servers, without making scrabbled egg.
Oh by the way this is also about the whole of the web not just Xoops, may do Smarty next
For PHP files I was going to include some examples, yet they take up loads more room and basically the same things need doing as has with JavaScript.
Spaces need removing{}
Brackets don’t need to be on another line
{
For something contained here
}
{it can contain like that, so it is next to that item
}
{or Closing items around them self’s like we do in PHP normally to read}
When we include messages for others to follow, this is code and so space is needed not free.
So shortening all of these reduces our file size and so read speed.
/**** This title for item
* This parram
* This array */
Unsure if when escaped any part of a document, it still pause as reading, like on disclaimers in all files, I would imagine there is processing to say ignore it.
So maybe a full Documentation would be better included with the package, as anyone can still copy it regardless if we have a big heavy open source license in each file, that makes the overall file size larger.
Not that I have removed the XOOPS information, its just an idea for small faster Xoops.