Jump to content
[MUST READ] Forum Rules ×

How to remove VistaPanel Icons?


TinkerMan

Recommended Posts

  • 7 months later...
On 9/17/2021 at 3:10 PM, TinkerMan said:

How would I go abut doing that? (Sorry, but I am more HTML, CSS, PHP. I don't really know JS)

Hi @TinkerMan, i created a script for you: i can remove softacolous and email section but the sitebuilder i can't remove it.

Just add in advert control this advert:

<script>
  function changeStyle(){
    var element = document.getElementById("soft_div-group");
    element.style.display = "none";
}
function changeStyle1(){
    var element = document.getElementById("email-group");
    element.style.display = "none";
}
  changeStyle1()
  changeStyle()
</script>

 

Edited by Wnew
Link to comment
Share on other sites

22 minutes ago, Wnew said:

Hi @TinkerMan, i created a script for you: i can remove softacolous and email section but the sitebuilder i can't remove it.

Just add in advert control this advert:

<script>
  function changeStyle(){
    var element = document.getElementById("soft_div-group");
    element.style.display = "none";
}
function changeStyle(){
    var element = document.getElementById("email-group");
    element.style.display = "none";
}
</script>

 

Hi, can't help but wonder won't the second function overrides the first and is this automatically called?

Link to comment
Share on other sites

<script>
const r = [
    'item_sitereptile',
    'icon-sitereptile',
    'email-group',
    'soft_div-group',
    'email-drop-area'
];

window.addEventListener("load", function() {
    r.forEach(remove);
});

function remove(item) {
    document.getElementById(item).style.display = "none";
}
</script>  

This should take care of webmail and the website builder, you can add any further elements to the array that you'd like to remove.

 

EDIT: Added an event listener to wait until page is complete before running.

Edited by Wizacr
Link to comment
Share on other sites

1 minute ago, Bleep Bloop said:

Awesome, is this tested? I would love to, but for gods sake, the advert section of mofh panel takes yrs to update on vPanel.

It works, I recommend using the "bottom advert" box for these things.

Link to comment
Share on other sites

10 hours ago, BastelPichi said:

This is just css. No need for an event listener or js at all.

https://www.w3schools.com/jsref/prop_style_display.asp

CSS would be the preferred method, not sure why a JS solution was being sought after.

 

I'll leave a CSS solution here for whomever wants it.

 

<style>
#item_sitereptile, #icon-sitereptile, #email-group, #soft_div-group, #email-drop-area {
	display: none;
}
</style>

 

Link to comment
Share on other sites

 

<script>
remove = ["sitereptile"];

function find(k, a) {
	for (var i=0; i < a.length; i++) {
		for (var x=0; x < a[i].items.length; x++) {
			if (a[i].items[x].feature === k) {
				a[i].items[x] = undefined;
                if (a[i].items[x] === undefined) {
                    a[i].items.splice(x, 1);
                }
			}
		}
	}
}
function remail(l) {
    for (var e=0; e < l.length; e++) {
        if (l[e].desc === 'Email') {
            l[e] = undefined;
            if (l[e] === undefined) {
                l.splice(e, 1);
            }
        }
    }
}

remove.forEach(item => find(item, PAGE.appGroups));
remail(PAGE.appGroups);
</script>

I think I understand what's needed here, this code should provide the desired functions.


You can add the feature name in the "remove" array to remove any other individual icons.

The second function "remail()" removes the entire email portion.

 

This is tested to work.

Link to comment
Share on other sites

  • 4 months later...

Removing elements can also be covered by Element Changer now.

A slight modification in @Wizacr's code to remove groups:

<script>
remove = ["Email"];

function find(k, a) {
	for (var i=0; i < a.length; i++) {
		if (a[i].desc === k) {
		    a[i] = undefined;
		    if (a[i] === undefined) {
		        a.splice(i, 1);
		    }
		}
	}
}
remove.forEach(item => find(item, PAGE.appGroups));
</script>
Edited by Anyx
Add remove groups code, and fix formatting.
Link to comment
Share on other sites

9 minutes ago, TinkerMan said:

Your about 4 months to late 😂 

 

Hopefully that will help other though. 

I'm aware, xD. I wanted to edit the post with another addition, but posted it early. 

EDIT: It's there now.

Edited by Anyx
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...