`;r.children.item(n.order)?r.children.item(n.order).insertAdjacentHTML("beforebegin",m):r.insertAdjacentHTML("beforeend",m)}#c(o,s){let l=this.#b.findIndex(e=>e===o.name);if(-1===l)throw"Invalid name specified";this.#b.splice(l,1),s.children.item(l).remove()}}
--------------------------------------------------------------------------------
/responsive-domain-search/README.md:
--------------------------------------------------------------------------------
1 | # Responsive Domain Search
2 |
3 | ## What does it do?
4 | It makes the VistaPanel search form responsive, so that it does not break the vP theme(s).
5 |
6 | ## Where should I put it?
7 | Put it in the Header Advert Area (IMPORTANT).
8 | Due to [this issue](https://github.com/VPTOfficial/VistaPanel-Customizations/issues/4) reported by [AA22Dev](https://github.com/aa22dev), the code doesn't seem to run properly if you put it elsewhere. Thanks for reporting it.
9 |
10 | ## How can I install it?
11 | Create a script tag with `src` pointing to `responsive-domain-search.js` or `responsive-domain-search.min.js` for the minified version.
12 |
13 | In case you do not know how to do that or are too lazy to do it, we have provided a ready code below.
14 |
15 | ### How to initialize an affiliate code into the search form?
16 | A variable "affiliate code" can be defined to put your own affiliate code on the domain search, but, according to iFastNet, this will not give you any money.
17 |
18 | Variable:
19 | * affCode -> 5 digit affiliate code.
20 |
21 | **If the variable is not declared, an affiliate code for my account (PlanetCloud) will be used.**
22 | **In case this method does actually pay money, the money will go into my account and I will appreciate it as a donation :)**
23 |
24 | ### Content-Type Header Errors
25 | The RAW option on GitHub can return an incorrect Content-Type header which makes the code not load at all.
26 | To solve this, we need an external service which adds the correct type, like jsDelivr, or our CDN.
27 |
28 | The full code, using jsDelivr:
29 | ```html
30 |
35 |
36 | ```
37 | Alternatively, you can use our CDN:
38 | ```html
39 |
44 |
45 | ```
46 | Do not forget to remove the comment lines symbols (``/* OPTIONAL``and ``*/``) if you want your affiliate code to work.
47 | ## Changelog
48 | * Created on 10 July 2018 by [PlanetCloud](https://github.com/PlanetTheCloud)
49 | * Modified on 27 July 2018 by Christine (Cyrl)
50 | * Modified on 25 August 2018 by [Anyx](https://github.com/4yx)
51 | * Modified on 28 September 2018 by [AA22Dev](https://github.com/aa22dev) and [Anyx](https://github.com/4yx)
52 | * Modified on 30 September 2018 by [PlanetCloud](https://github.com/PlanetTheCloud)
53 | * Modified on 22 November 2018 by [Anyx](https://github.com/4yx)
54 | * Last modified on 06 August 2022 by [Anyx](https://github.com/4yx)
--------------------------------------------------------------------------------
/responsive-domain-search/responsive-domain-search.js:
--------------------------------------------------------------------------------
1 | /*! @preserve
2 | * Created at 10 July and modified at 02 November 2018 by PlanetCloud.
3 | * Modified at 16 March 2019 by Dog2puppy.
4 | * Last modified at 06 August 2022 by Anyx.
5 | * DO NOT REMOVE CREDITS!
6 | * Created for: Wybe Network.
7 | */
8 | document.addEventListener("DOMContentLoaded", function() {
9 | if ("undefined" == typeof affCode) affCode = "25147";
10 | (function(b, a) {
11 | for (var c = 0; c < b.length; c++) a(b[c])
12 | })(document.querySelectorAll('form[action^="https://ifastnet.com/portal/domainchecker.php"]'), function(b) {
13 | widget = b.parentElement;
14 | form = document.createElement("form");
15 | form.setAttribute("class", "form-inline");
16 | form.setAttribute("target", "_blank");
17 | form.setAttribute("action", "https://ifastnet.com/portal/domainchecker.php?aff=" + affCode);
18 | form.setAttribute("method", "post");
19 | form.innerHTML = '';
20 | col = document.createElement("div");
21 | col.setAttribute("class", "col-sm-12");
22 | col.appendChild(form);
23 | row = document.createElement("div");
24 | row.setAttribute("class", "row");
25 | row.appendChild(col);
26 | widget.innerHTML = "";
27 | widget.appendChild(row)
28 | })
29 | });
--------------------------------------------------------------------------------
/responsive-domain-search/responsive-domain-search.min.js:
--------------------------------------------------------------------------------
1 | /*! @preserve
2 | * Created at 10 July and modified at 02 November 2018 by PlanetCloud.
3 | * Modified at 16 March 2019 by Dog2puppy.
4 | * Last modified at 06 August 2022 by Anyx.
5 | * DO NOT REMOVE CREDITS!
6 | * Created for: Wybe Network.
7 | */
8 | document.addEventListener("DOMContentLoaded",function(){"undefined"==typeof affCode&&(affCode="25147"),function(o,t){for(var e=0;e',col=document.createElement("div"),col.setAttribute("class","col-sm-12"),col.appendChild(form),row=document.createElement("div"),row.setAttribute("class","row"),row.appendChild(col),widget.innerHTML="",widget.appendChild(row)})});
--------------------------------------------------------------------------------
/sidebar-bug-fix/README.md:
--------------------------------------------------------------------------------
1 | # Sidebar Bug Fix
2 |
3 | ## What does it do?
4 | It makes the sidebar work in all pages!
5 | The sidebar wasn't being loaded correctly in other pages on mobile, which this script now fixes.
6 |
7 | ## Where should I put it?
8 | Put it in the Footer Advert Area (Bottom advert).
9 | The code will not run if you put it elsewhere. It may run in the left advert area, but it will break the sidebar.
10 |
11 | ## How can I install it?
12 | Create a script tag with `src` pointing to `sidebar-bug-fix.js` or `sidebar-bug-fix.min.js` for the minified version.
13 |
14 | In case you do not know how to do that or prefer to use a ready code, we have provided it below.
15 |
16 | ### Content-Type Header Errors
17 | The RAW option on GitHub can return an incorrect Content-Type header which makes the code not load at all.
18 | To solve this, we need an external service which adds the correct type, like jsDelivr, or our CDN.
19 |
20 | The full code, using jsDelivr:
21 | ```html
22 |
23 | ```
24 | Alternatively, you can use our CDN:
25 | ```html
26 |
27 | ```
28 | ## Changelog
29 | * Created on 15 August 2022 by [Anyx](https://github.com/4yx)
--------------------------------------------------------------------------------
/sidebar-bug-fix/sidebar-bug-fix.js:
--------------------------------------------------------------------------------
1 | /*! @preserve
2 | * Created at 15 August 2022 by Anyx.
3 | * DO NOT REMOVE CREDITS!
4 | * Created for: Wybe Network.
5 | */
6 | check = document.getElementById("main");
7 | if (check == null) {
8 | sidebar = document.getElementById("sidebar");
9 | sidebar.classList.add("ng-scope");
10 | button = document.getElementById("btnSideBarToggle")
11 | button.onclick = function() {
12 | if (sidebar.classList.contains("active")) {
13 | sidebar.classList.remove("active");
14 | } else {
15 | sidebar.classList.add("active");
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/sidebar-bug-fix/sidebar-bug-fix.min.js:
--------------------------------------------------------------------------------
1 | /*! @preserve
2 | * Created at 15 August 2022 by Anyx.
3 | * DO NOT REMOVE CREDITS!
4 | * Created for: Wybe Network.
5 | */
6 | check=document.getElementById("main"),null==check&&(sidebar=document.getElementById("sidebar"),sidebar.classList.add("ng-scope"),button=document.getElementById("btnSideBarToggle"),button.onclick=function(){sidebar.classList.contains("active")?sidebar.classList.remove("active"):sidebar.classList.add("active")});
--------------------------------------------------------------------------------
/theme-switcher/readme.md:
--------------------------------------------------------------------------------
1 | # Theme Switcher
2 |
3 | ## What does it do?
4 | As the name suggests, it allows you to add vPanel themes, with an option for your user to switch between different ones.
5 |
6 | ## Features
7 | - Set a default theme
8 | - Use custom domain or our CDN for themes (Supports Normal, Special & Lite Themes)
9 | - Display in one of the two places (Footer OR User navbar)
10 | - Uses cookies to keep the user choice saved
11 |
12 | ## What Normal, Special & Lite Types Mean?
13 | **Normal themes** in our themes repository have two stylesheets `styles.css` & `icon_spritemap.css`
14 |
15 | **Lite & Special themes** have only one file. For **lite themes** the name of file is `styles.css` and for **Special themes** the name of file is `panel.css`
16 |
17 | ## How to install?
18 | First load the script in the footer advert area.
19 |
20 | You can use one of the two options for installing this script on your vPanel.
21 |
22 | ### Our CDN
23 | ```javascript
24 |
25 | ```
26 |
27 | ### Manual
28 | Download the latest available version of this script and put it on your website.
29 | E.g., I place `theme-switcher.min.js` file in my root folder, then I'll add it like this:
30 | ```javascript
31 |
32 | ```
33 |
34 | After that we must setup the script.
35 |
36 | Now, we will need to make an object named `wnThemeSwitcher`.
37 |
38 | Let's say I want `dark-discord` theme as default theme and allow users to switch between themes which are `gradient-blue (Normal Theme), light-lite (Lite Theme), lightspace-blue (Special Theme)`. You can check the type of any theme in our documentation at https://docs.wybenetwork.com/vistapanel-themes/#/themes-name
39 |
40 | Example Configuration:
41 | ```javascript
42 |
73 | ```
74 |
75 | ## Options
76 | | Properties | Priority | Values |
77 | |---------------|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
78 | | themeList | required | [ { dir: 'theme-dirname', title: 'Theme Name', type: 'theme type' } ] |
79 | | options | optional | { baseURL: 'https://example.tld/' position: 'bottom' default: { dir: 'theme-dirname' type: 'theme type' } } |
80 |
81 | ## Properties
82 | ### themeList `(array), Required`
83 |
84 | check https://docs.wybenetwork.com/vistapanel-themes/#/themes-name for theme directory names and their types.
85 |
86 | #### dir `(Object)`
87 | Directory name of theme you want to add in theme selector options.
88 |
89 | #### title `(string)`
90 | Title can be any name you want to show to user on frontend.
91 |
92 | #### type `(string)`
93 | Type must be the type of the theme you are allowing user to choose.
94 | List of themes categorized into different types can be found at https://docs.wybenetwork.com/vistapanel-themes/#/themes-name
95 |
96 | ### options `(Object), Optional`
97 | These options are optional, if you don't set them then default one will be used.
98 |
99 | #### baseURL `(String)`
100 | By default it is pointing towards our CDN. You can use this option to serve themes from your custom domain.
101 |
102 | #### position `(String)`
103 | By default it is set to `bottom`. You can use this option to change the location of theme switcher. Only two values are supported
104 | `usernav` & `bottom`.
105 |
106 | - `usernav`, if position option is set to this value then theme switcher will be shown in user nav menu.
107 | - `bottom`, if position option is set to this value then theme switcher will be shown in footer area.
108 |
109 | #### default `(Object)`
110 | Only two properties should be provided for this object to set the default theme.
111 |
112 | ##### dir `(String)`
113 | Directory name of the theme you want to set as default.
114 |
115 | ##### type `(String)`
116 | The value set for this option should be the type of the theme.
117 |
118 | ## Changelog
119 | ```html
120 | Version 2.0.3 | October 16th, 2022
121 | - Bugs Fixes
122 | - Code Improved
123 | - Switched from Cookies to Local Storage
124 | - Added option for switching back to default theme
125 | ```
126 | ```html
127 | Version 2.0.2 | October 15th, 2022
128 | - Code Optimization (Thanks to PlanetCloud for Suggestions)
129 | - Bugs Fixes
130 | ```
131 | ```html
132 | Version 2.0.1 | October 15th, 2022
133 | - Code Optimization (Thanks to PlanetCloud for Suggestions)
134 | ```
135 | ```html
136 | Version 2.0.0 | October 14th, 2022
137 | - Complete Re-write by AA22Dev
138 | - Added support for multiple positions
139 | - Improved support for themes
140 | - Added support for default theme.
141 | ```
142 |
143 | ```html
144 | Version 1.0.1 | June 23rd, 2021
145 | - Bugs fixes by AA22Dev
146 | ```
147 |
148 | ```html
149 | Version 1.0.0 | December 29th, 2018
150 | - Initial release by RanaKHAS
151 | ```
--------------------------------------------------------------------------------
/theme-switcher/theme-switcher.js:
--------------------------------------------------------------------------------
1 | /*! @preserve
2 | * Project: Theme Switcher
3 | * Version: 2.0.3
4 | * Description: Allows you to add an option in your MyOwnFreeHost vPanel to allow users to switch to any theme that they want
5 | * Author: Wybe Network (https://wybenetwork.com/)
6 | * Created: AA22Dev (October 14th, 2022)
7 | * Updated: AA22Dev (October 16th, 2022)
8 | * Thanks to PlanetCloud for Code Optimization tips
9 | * Docs: https://docs.wybenetwork.com/
10 | *
11 | * DO NOT REMOVE CREDITS
12 | * */
13 |
14 | class ThemeSwitcher {
15 | #position;
16 | #baseURL;
17 | #themeList;
18 | #defaultThemeName;
19 | curTheme = '';
20 |
21 | constructor(themeList, args={}) {
22 | this.#themeList = themeList;
23 | this.#defaultThemeName = (args.default) ? `${args.default.dir}___${args.default.type}` : null;
24 | this.#position = args.position ?? 'bottom';
25 | this.#baseURL = args.baseURL ?? 'https://vpt.cdn.wybenetwork.com/';
26 |
27 | const cookie = localStorage.getItem("wnCurTheme");
28 |
29 | this.curTheme = cookie ?? 'Default';
30 | if (cookie || args.default) this.setActiveStyle((args.default && !cookie) ? this.#defaultThemeName : this.curTheme);
31 |
32 | document.addEventListener('readystatechange', event => {
33 | if (event.target.readyState === "complete") this.insertElement();
34 | });
35 | }
36 |
37 | #insertBottom() {
38 | let el = ``;
47 | document.getElementById("content").insertAdjacentHTML('beforeend', el);
48 | }
49 |
50 | #insertUserNav() {
51 | const style = document.createElement('style');
52 | style.innerHTML = `#wnThemeSwitcher #lnkUserPrefChangePwd:before {
53 | content: "\\f1fc"!important;
54 | }`;
55 | document.head.appendChild(style);
56 | const el = document.getElementById('lnkUserPrefChangeLang').parentElement;
57 | const newEl = document.createElement('li');
58 | newEl.setAttribute('id', 'wnThemeSwitcher')
59 | const newSub = document.createElement('a');
60 | newSub.setAttribute('id', 'lnkUserPrefChangePwd');
61 | newSub.setAttribute('href', '#');
62 | newSub.setAttribute('onclick', `wnThemeSwitcher.themeOptions();`);
63 | newSub.innerHTML = 'Change Theme';
64 | newEl.appendChild(newSub);
65 | el.parentNode.insertBefore(newEl, el.nextSibling);
66 | }
67 |
68 | themeOptions() {
69 | const el = document.getElementById('lnkUserPrefChangeLang').parentElement.parentElement;
70 | const newEl = document.createElement('ul');
71 | newEl.setAttribute('id', 'wnThemeSwitcherOptions');
72 | newEl.setAttribute('class', 'dropdown-menu dropdown-menu-right');
73 | newEl.setAttribute('style', 'display: block;');
74 | let html = '';
75 | html += `