Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
Recent Tutorials
Top posting users this month
Top Achievers
Who is online?
In total there are 12 users online :: 0 Registered, 0 Hidden and 12 Guests :: 2 Bots
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
How to change the default Edge theme?
Page 1 of 1 • Share
- GuestGuest
We've got plenty of themes to chosse from, one of which is now a custom 'KLM Flying Blue' theme. Say, what if we want to have for instance the default theme switched with the KLM one? What do we need to do? If been looking for an answer in the all.js but I couldn't find it. It's probably in some of the Edge CSS somewhere. And when the KLM has been made the default theme, will it still be visible in the theme list?
@Ange Tuteur, please shed a light on this question for us, thank you.
@Ange Tuteur, please shed a light on this question for us, thank you.
Last edited by Samantha on Thu 29 Dec 2016, 03:51; edited 3 times in total
Here ya go @Samantha
Title: Default Theme Changer
Placement: All the pages
You can change
to your theme name (as long as it's already within the theme picker dropdown).
And if you want your theme to still be in the dropdown and show (as opposed to showing up as default theme), then don't change the
value.
Hope this works for ya
Title: Default Theme Changer
Placement: All the pages
- Code:
$(function() {
var default_theme = 'Mine Shaft',
visible_in_theme_list = true,
option;
(function changeDefaultTheme(theme) {
if (!$('#fa_theme_selector > option[value="' + theme + '"]')[0]) {
console.log('This is not a valid theme');
return;
}
option = $('#fa_theme_selector > option[value="' + theme + '"]');
$('#fa_theme_selector').val(theme).trigger('change');
visible_in_theme_list ? option.detach().insertAfter('#fa_theme_selector > option:eq(1)') : option.remove();
if (my_getcookie('fa_theme_color') != default_theme) my_setcookie('fa_theme_color', theme);
})(default_theme);
});
You can change
|
And if you want your theme to still be in the dropdown and show (as opposed to showing up as default theme), then don't change the
|
Hope this works for ya
- GuestGuest
Worked to near perfection, @Ace 1! TYVM! However, when another theme has been chosen and the site reloads in the browser it gives me the default theme again. The cookie with the user's choice either had not been dropped or it wouldn't read it and it falls back to the default theme (the one that had been forced to be default using the script). Same thing when browsing the forums...
Try replacing the script with this one:
- Code:
$(function() {
var default_theme = 'Mine Shaft',
visible_in_theme_list = true,
current_theme = my_getcookie('fa_theme_color'),
option;
(current_theme == 'Select a theme' || current_theme == default_theme) && (function changeDefaultTheme(theme) {
if (!$('#fa_theme_selector > option[value="' + theme + '"]')[0]) {
console.log('This is not a valid theme');
return;
}
option = $('#fa_theme_selector > option[value="' + theme + '"]');
$('#fa_theme_selector').val(theme).trigger('change');
visible_in_theme_list ? option.detach().insertAfter('#fa_theme_selector > option:eq(1)') : option.remove();
my_setcookie('fa_theme_color', theme);
})(default_theme);
});
- GuestGuest
Nope, that one falls back to the default color scheme, like on FMD ...
@Samantha This should work.
- Code:
$(function() {
var default_theme = 'Mine Shaft',
visible_in_theme_list = true,
current_theme = my_getcookie('fa_theme_color'),
option;
(current_theme == 'Select a theme' || current_theme == default_theme) && (function changeDefaultTheme(theme) {
if (!$('#fa_theme_selector > option[value="' + theme + '"]')[0]) {
console.log('This is not a valid theme');
return;
}
option = $('#fa_theme_selector > option[value="' + theme + '"]');
$('#fa_theme_selector').val(theme).trigger('change');
visible_in_theme_list ? option.detach().insertAfter('#fa_theme_selector > option:eq(1)') : option.css('display', 'none').parent().val('Default theme');
my_setcookie('fa_theme_color', theme);
!visible_in_theme_list && $('#fa_theme_selector').change(function() {
if (this.value == 'Select a theme' || this.value == 'Default theme') {
$('#fa_theme_selector').val(theme).trigger('change');
$('#fa_theme_selector').val(!visible_in_theme_list ? 'Default theme' : theme);
}
});
})(default_theme);
});
- GuestGuest
Nope, not working again, Ken. I'm using this in All the Pages:
You can see the result for yourself on the test site. Could it be the language? Perhaps you should add some language vars ...
EDIT: I've taken the script offline again as started to annoy me lol
- Code:
$(function() {
var default_theme = 'KLM Flying Blue',
visible_in_theme_list = true,
current_theme = my_getcookie('fa_theme_color'),
option;
(current_theme == 'Select a theme' || current_theme == default_theme) && (function changeDefaultTheme(theme) {
if (!$('#fa_theme_selector > option[value="' + theme + '"]')[0]) {
console.log('This is not a valid theme');
return;
}
option = $('#fa_theme_selector > option[value="' + theme + '"]');
$('#fa_theme_selector').val(theme).trigger('change');
visible_in_theme_list ? option.detach().insertAfter('#fa_theme_selector > option:eq(1)') : option.css('display', 'none').parent().val('Default theme');
my_setcookie('fa_theme_color', theme);
!visible_in_theme_list && $('#fa_theme_selector').change(function() {
if (this.value == 'Select a theme' || this.value == 'Default theme') {
$('#fa_theme_selector').val(theme).trigger('change');
$('#fa_theme_selector').val(!visible_in_theme_list ? 'Default theme' : theme);
}
});
})(default_theme);
});
You can see the result for yourself on the test site. Could it be the language? Perhaps you should add some language vars ...
EDIT: I've taken the script offline again as started to annoy me lol
lul it was the language haha
Now with this code I set up some variables.
default_theme - You know what this is.
default_text - This takes two values, the first being what you normally see and the second being what the first option of the theme picker is when you don't have the default one enabled.
show_name - When this is true, the forum will show the original name of the theme. Otherwise, it will appear as "Default theme".
Let me know how this works out.
- Code:
$(function() {
var default_theme = 'Mine Shaft',
default_text = ['Select a theme', 'Default theme'],
show_name = true,
current_theme = my_getcookie('fa_theme_color'),
option;
(function changeDefaultTheme(theme) {
if (!$('#fa_theme_selector > option[value="' + theme + '"]')[0]) {
console.error(theme + ': This is not a valid theme.');
return;
}
if ($('#fa_theme_selector').val() == default_text[0]) {
$('#fa_theme_selector').val(theme).trigger('change');
my_setcookie('fa_theme_color', theme);
}
option = $('#fa_theme_selector > option[value="' + theme + '"]');
option.detach().text(show_name ? theme : default_text[1]).insertBefore('#fa_theme_selector > option:eq(0)').next().remove();
$('#fa_theme_selector').change(function() {
this.firstChild.textContent = show_name ? theme : default_text[1];
if ($(this).find('option:selected').index() == 0) $('#fa_theme_selector').val(theme).val(default_text[1]);
});
})(default_theme);
});
Now with this code I set up some variables.
- Code:
var default_theme = 'Mine Shaft',
default_text = ['Select a theme', 'Default theme'],
show_name = true,
default_theme - You know what this is.
default_text - This takes two values, the first being what you normally see and the second being what the first option of the theme picker is when you don't have the default one enabled.
show_name - When this is true, the forum will show the original name of the theme. Otherwise, it will appear as "Default theme".
Let me know how this works out.
- GuestGuest
Yeah, now it's working alright! AND I noticed some EDGE language language update errors for the themes in ALL.JS, so I had to fix them first. It said 'Kies een thema ... ...' instead of 'Kies een thema ...' in several locations in that JS.
BIG THANKS to you, @Ace 1!
BIG THANKS to you, @Ace 1!
- Sponsored content
Similar topics
Create an account or log in to leave a reply
You need to be a member in order to leave a reply.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum