mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-08-31 16:22:11 +00:00
move theme-specific JS to theme-related files
This commit is contained in:
parent
70e38192de
commit
b34bd7d027
@ -1229,7 +1229,9 @@ function changeStyle() {
|
||||
{
|
||||
style = 'css/style.css';
|
||||
profile = 'css/profile.css';
|
||||
$.getScript('theme_original/js/theme_option.js');
|
||||
}
|
||||
|
||||
$('#stylecss').attr('href', style);
|
||||
$('#profilecss').attr('href', profile);
|
||||
$("<style type='text/css'> .selectable_theme:not(.theme_" + theme + ")" +
|
||||
|
@ -13,8 +13,6 @@ var InterfaceFunctions = function()
|
||||
//faço os binds no init
|
||||
this.init = function()
|
||||
{
|
||||
var theme = $.Options.getTheme();
|
||||
|
||||
$( ".wrapper .postboard-news").click(function() {
|
||||
requestTimelineUpdate("latest",postsPerRefresh,followingUsers,promotedPostsOnly);});
|
||||
|
||||
@ -25,21 +23,6 @@ var InterfaceFunctions = function()
|
||||
$( ".promoted-posts-only").click(function() {
|
||||
promotedPostsOnly = !promotedPostsOnly;
|
||||
|
||||
if(theme == 'nin')
|
||||
{
|
||||
// modify the way promoted posts are shown
|
||||
//active promoted posts tab
|
||||
$(this).children('.promoted-posts').addClass(promotedPostsOnly ? "active" : "disabled");
|
||||
$(this).children('.normal-posts').addClass(promotedPostsOnly ? "disabled" : "active");
|
||||
$('#postboard-top').removeClass(promotedPostsOnly ? "show" : "hide");
|
||||
//active normal posts
|
||||
$(this).children('.promoted-posts').removeClass(promotedPostsOnly ? "disabled" : "active");
|
||||
$(this).children('.normal-posts').removeClass(promotedPostsOnly ? "active" : "disabled");
|
||||
$('#postboard-top').addClass(promotedPostsOnly ? "hide" : "show");
|
||||
} else {
|
||||
$(this).text( promotedPostsOnly ? polyglot.t('Switch to Normal posts') : polyglot.t('Switch to Promoted posts') );
|
||||
}
|
||||
|
||||
timelineChangedUser();
|
||||
$.MAL.getStreamPostsParent().empty();
|
||||
requestTimelineUpdate("latestFirstTime",postsPerRefresh,followingUsers,promotedPostsOnly);
|
||||
|
@ -16,6 +16,18 @@ $(function(){
|
||||
return false
|
||||
});
|
||||
|
||||
$( ".promoted-posts-only").click(function() {
|
||||
// modify the way promoted posts are shown
|
||||
//active promoted posts tab
|
||||
$(this).children('.promoted-posts').addClass(promotedPostsOnly ? "active" : "disabled");
|
||||
$(this).children('.normal-posts').addClass(promotedPostsOnly ? "disabled" : "active");
|
||||
$('#postboard-top').removeClass(promotedPostsOnly ? "show" : "hide");
|
||||
//active normal posts
|
||||
$(this).children('.promoted-posts').removeClass(promotedPostsOnly ? "disabled" : "active");
|
||||
$(this).children('.normal-posts').removeClass(promotedPostsOnly ? "active" : "disabled");
|
||||
$('#postboard-top').addClass(promotedPostsOnly ? "hide" : "show");
|
||||
});
|
||||
|
||||
$(window).scroll(function(){
|
||||
posScroll = $(document).scrollTop();
|
||||
if(posScroll >= 250)
|
||||
|
8
theme_original/js/theme_option.js
Executable file
8
theme_original/js/theme_option.js
Executable file
@ -0,0 +1,8 @@
|
||||
$(function(){
|
||||
|
||||
$( ".promoted-posts-only").click(function() {
|
||||
$(this).text( promotedPostsOnly ? polyglot.t('Switch to Normal posts') : polyglot.t('Switch to Promoted posts') );
|
||||
});
|
||||
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user