1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-15 17:46:55 +00:00

Fixed minor sorting bug in settings menu. Moved About tab to end of menu. Moved menu navigation to bottom of menu.

This commit is contained in:
SirStendec 2015-02-24 01:32:14 -05:00
parent fc21671b2c
commit 4c3b9217a8
6 changed files with 101 additions and 44 deletions

105
script.js
View file

@ -190,7 +190,7 @@ FFZ.prototype._legacy_parse_donors = function(data) {
this.log("Added donor badge to " + utils.number_commas(count) + " users."); this.log("Added donor badge to " + utils.number_commas(count) + " users.");
} }
},{"./constants":3,"./utils":26}],2:[function(require,module,exports){ },{"./constants":3,"./utils":27}],2:[function(require,module,exports){
var FFZ = window.FrankerFaceZ; var FFZ = window.FrankerFaceZ;
@ -1112,7 +1112,7 @@ FFZ.prototype._emoticonize = function(controller, tokens) {
return tokens; return tokens;
} }
},{"../utils":26}],7:[function(require,module,exports){ },{"../utils":27}],7:[function(require,module,exports){
var FFZ = window.FrankerFaceZ, var FFZ = window.FrankerFaceZ,
utils = require("../utils"), utils = require("../utils"),
@ -1364,7 +1364,7 @@ FFZ.chat_commands.u = function(room, args) {
} }
FFZ.chat_commands.u.enabled = function() { return this.settings.enhanced_moderation; } FFZ.chat_commands.u.enabled = function() { return this.settings.enhanced_moderation; }
},{"../utils":26}],8:[function(require,module,exports){ },{"../utils":27}],8:[function(require,module,exports){
var FFZ = window.FrankerFaceZ, var FFZ = window.FrankerFaceZ,
CSS = /\.([\w\-_]+)\s*?\{content:\s*?"([^"]+)";\s*?background-image:\s*?url\("([^"]+)"\);\s*?height:\s*?(\d+)px;\s*?width:\s*?(\d+)px;\s*?margin:([^;}]+);?([^}]*)\}/mg, CSS = /\.([\w\-_]+)\s*?\{content:\s*?"([^"]+)";\s*?background-image:\s*?url\("([^"]+)"\);\s*?height:\s*?(\d+)px;\s*?width:\s*?(\d+)px;\s*?margin:([^;}]+);?([^}]*)\}/mg,
MOD_CSS = /[^\n}]*\.badges\s+\.moderator\s*{\s*background-image:\s*url\(\s*['"]([^'"]+)['"][^}]+(?:}|$)/, MOD_CSS = /[^\n}]*\.badges\s+\.moderator\s*{\s*background-image:\s*url\(\s*['"]([^'"]+)['"][^}]+(?:}|$)/,
@ -1732,7 +1732,7 @@ FFZ.prototype._legacy_load_room_css = function(room_id, callback, data) {
output.css = data || null; output.css = data || null;
return this._load_room_json(room_id, callback, output); return this._load_room_json(room_id, callback, output);
} }
},{"../constants":3,"../utils":26}],9:[function(require,module,exports){ },{"../constants":3,"../utils":27}],9:[function(require,module,exports){
var FFZ = window.FrankerFaceZ; var FFZ = window.FrankerFaceZ;
@ -2028,7 +2028,7 @@ FFZ.prototype._legacy_load_css = function(set_id, callback, data) {
this._load_set_json(set_id, callback, output); this._load_set_json(set_id, callback, output);
} }
},{"./constants":3,"./utils":26}],11:[function(require,module,exports){ },{"./constants":3,"./utils":27}],11:[function(require,module,exports){
var FFZ = window.FrankerFaceZ, var FFZ = window.FrankerFaceZ,
SENDER_REGEX = /(\sdata-sender="[^"]*"(?=>))/; SENDER_REGEX = /(\sdata-sender="[^"]*"(?=>))/;
@ -2380,7 +2380,7 @@ require('./ext/emote_menu');
require('./featurefriday'); require('./featurefriday');
require('./ui/styles'); require('./ui/styles');
//require('./ui/dark'); require('./ui/dark');
require('./ui/notifications'); require('./ui/notifications');
require('./ui/viewer_count'); require('./ui/viewer_count');
@ -2430,7 +2430,7 @@ FFZ.prototype.setup_ember = function(delay) {
this.load_settings(); this.load_settings();
// Start this early, for quick loading. // Start this early, for quick loading.
//this.setup_dark(); this.setup_dark();
this.ws_create(); this.ws_create();
this.setup_emoticons(); this.setup_emoticons();
@ -2463,7 +2463,7 @@ FFZ.prototype.setup_ember = function(delay) {
this.log("Initialization complete in " + duration + "ms"); this.log("Initialization complete in " + duration + "ms");
} }
},{"./badges":1,"./commands":2,"./debug":4,"./ember/chatview":5,"./ember/line":6,"./ember/moderation-card":7,"./ember/room":8,"./ember/viewers":9,"./emoticons":10,"./ext/betterttv":11,"./ext/emote_menu":12,"./featurefriday":14,"./settings":15,"./shims":16,"./socket":17,"./ui/about_page":18,"./ui/menu":19,"./ui/menu_button":20,"./ui/my_emotes":21,"./ui/notifications":22,"./ui/races":23,"./ui/styles":24,"./ui/viewer_count":25}],14:[function(require,module,exports){ },{"./badges":1,"./commands":2,"./debug":4,"./ember/chatview":5,"./ember/line":6,"./ember/moderation-card":7,"./ember/room":8,"./ember/viewers":9,"./emoticons":10,"./ext/betterttv":11,"./ext/emote_menu":12,"./featurefriday":14,"./settings":15,"./shims":16,"./socket":17,"./ui/about_page":18,"./ui/dark":19,"./ui/menu":20,"./ui/menu_button":21,"./ui/my_emotes":22,"./ui/notifications":23,"./ui/races":24,"./ui/styles":25,"./ui/viewer_count":26}],14:[function(require,module,exports){
var FFZ = window.FrankerFaceZ, var FFZ = window.FrankerFaceZ,
constants = require('./constants'); constants = require('./constants');
@ -2704,10 +2704,10 @@ FFZ.menu_pages.settings = {
var a = a.toLowerCase(), var a = a.toLowerCase(),
b = b.toLowerCase(); b = b.toLowerCase();
if ( a === "Debugging" ) if ( a === "debugging" )
a = "zzz" + a; a = "zzz" + a;
if ( b === "Debugging" ) if ( b === "debugging" )
b = "zzz" + b; b = "zzz" + b;
if ( a < b ) return -1; if ( a < b ) return -1;
@ -3097,9 +3097,9 @@ var FFZ = window.FrankerFaceZ,
// ------------------- // -------------------
FFZ.menu_pages.about = { FFZ.menu_pages.about = {
name: "About FrankerFaceZ", name: "About",
icon: constants.HEART, icon: constants.HEART,
sort_order: 998, sort_order: 100000,
render: function(view, container) { render: function(view, container) {
var room = this.rooms[view.get("context.currentRoom.id")], var room = this.rooms[view.get("context.currentRoom.id")],
@ -3184,6 +3184,62 @@ FFZ.menu_pages.about = {
} }
} }
},{"../constants":3}],19:[function(require,module,exports){ },{"../constants":3}],19:[function(require,module,exports){
var FFZ = window.FrankerFaceZ,
constants = require("../constants");
// ---------------------
// Settings
// ---------------------
FFZ.settings_info.dark_twitch = {
type: "boolean",
value: false,
visible: function() { return ! this.has_bttv },
name: "Dark Twitch",
help: "View the entire site with a dark theme.",
on_update: function(val) {
if ( this.has_bttv )
return;
document.body.classList.toggle("ffz-dark", val);
if ( val )
this._load_dark_css();
}
};
// ---------------------
// Initialization
// ---------------------
FFZ.prototype.setup_dark = function() {
if ( this.has_bttv )
return;
document.body.classList.toggle("ffz-dark", this.settings.dark_twitch);
if ( this.settings.dark_twitch )
this._load_dark_css();
}
FFZ.prototype._load_dark_css = function() {
if ( this._dark_style )
return;
this.log("Injecting FrankerFaceZ Dark Twitch CSS.");
var s = this._dark_style = document.createElement('link');
s.id = "ffz-dark-css";
s.setAttribute('rel', 'stylesheet');
s.setAttribute('href', constants.SERVER + "script/dark.css");
document.head.appendChild(s);
}
},{"../constants":3}],20:[function(require,module,exports){
var FFZ = window.FrankerFaceZ, var FFZ = window.FrankerFaceZ,
constants = require('../constants'); constants = require('../constants');
@ -3242,7 +3298,12 @@ FFZ.prototype.build_ui_popup = function(view) {
container.classList.toggle('dark', dark); container.classList.toggle('dark', dark);
// Render Menu // Menu Container
var sub_container = document.createElement('div');
sub_container.className = 'ffz-ui-menu-page';
inner.appendChild(sub_container);
// Render Menu Tabs
menu.className = 'menu clearfix'; menu.className = 'menu clearfix';
inner.appendChild(menu); inner.appendChild(menu);
@ -3251,10 +3312,6 @@ FFZ.prototype.build_ui_popup = function(view) {
heading.innerHTML = "<span>" + (constants.DEBUG ? "[DEV] " : "") + "FrankerFaceZ</span>"; heading.innerHTML = "<span>" + (constants.DEBUG ? "[DEV] " : "") + "FrankerFaceZ</span>";
menu.appendChild(heading); menu.appendChild(heading);
var sub_container = document.createElement('div');
sub_container.className = 'ffz-ui-menu-page';
inner.appendChild(sub_container);
var menu_pages = []; var menu_pages = [];
for(var key in FFZ.menu_pages) { for(var key in FFZ.menu_pages) {
if ( ! FFZ.menu_pages.hasOwnProperty(key) ) if ( ! FFZ.menu_pages.hasOwnProperty(key) )
@ -3470,7 +3527,7 @@ FFZ.prototype._add_emote = function(view, emote) {
else else
room.set('messageToSend', text); room.set('messageToSend', text);
} }
},{"../constants":3}],20:[function(require,module,exports){ },{"../constants":3}],21:[function(require,module,exports){
var FFZ = window.FrankerFaceZ, var FFZ = window.FrankerFaceZ,
constants = require('../constants'); constants = require('../constants');
@ -3521,7 +3578,7 @@ FFZ.prototype.update_ui_link = function(link) {
link.classList.toggle('dark', dark); link.classList.toggle('dark', dark);
link.classList.toggle('blue', blue); link.classList.toggle('blue', blue);
} }
},{"../constants":3}],21:[function(require,module,exports){ },{"../constants":3}],22:[function(require,module,exports){
var FFZ = window.FrankerFaceZ, var FFZ = window.FrankerFaceZ,
constants = require("../constants"), constants = require("../constants"),
@ -3821,7 +3878,7 @@ FFZ.menu_pages.my_emotes = {
} }
}; };
},{"../constants":3}],22:[function(require,module,exports){ },{"../constants":3}],23:[function(require,module,exports){
var FFZ = window.FrankerFaceZ; var FFZ = window.FrankerFaceZ;
@ -3970,7 +4027,7 @@ FFZ.prototype.show_message = function(message) {
closeWith: ["button"] closeWith: ["button"]
}).show(); }).show();
} }
},{}],23:[function(require,module,exports){ },{}],24:[function(require,module,exports){
var FFZ = window.FrankerFaceZ, var FFZ = window.FrankerFaceZ,
utils = require('../utils'); utils = require('../utils');
@ -4275,7 +4332,7 @@ FFZ.prototype._update_race = function(not_timer) {
} }
} }
} }
},{"../utils":26}],24:[function(require,module,exports){ },{"../utils":27}],25:[function(require,module,exports){
var FFZ = window.FrankerFaceZ, var FFZ = window.FrankerFaceZ,
constants = require('../constants'); constants = require('../constants');
@ -4300,7 +4357,7 @@ FFZ.prototype.setup_css = function() {
} }
}; };
} }
},{"../constants":3}],25:[function(require,module,exports){ },{"../constants":3}],26:[function(require,module,exports){
var FFZ = window.FrankerFaceZ, var FFZ = window.FrankerFaceZ,
constants = require('../constants'), constants = require('../constants'),
utils = require('../utils'); utils = require('../utils');
@ -4337,7 +4394,7 @@ FFZ.ws_commands.viewers = function(data) {
jQuery(view_count).tipsy(); jQuery(view_count).tipsy();
} }
} }
},{"../constants":3,"../utils":26}],26:[function(require,module,exports){ },{"../constants":3,"../utils":27}],27:[function(require,module,exports){
var FFZ = window.FrankerFaceZ, var FFZ = window.FrankerFaceZ,
constants = require('./constants'); constants = require('./constants');

6
script.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -91,10 +91,10 @@ FFZ.menu_pages.settings = {
var a = a.toLowerCase(), var a = a.toLowerCase(),
b = b.toLowerCase(); b = b.toLowerCase();
if ( a === "Debugging" ) if ( a === "debugging" )
a = "zzz" + a; a = "zzz" + a;
if ( b === "Debugging" ) if ( b === "debugging" )
b = "zzz" + b; b = "zzz" + b;
if ( a < b ) return -1; if ( a < b ) return -1;

View file

@ -7,9 +7,9 @@ var FFZ = window.FrankerFaceZ,
// ------------------- // -------------------
FFZ.menu_pages.about = { FFZ.menu_pages.about = {
name: "About FrankerFaceZ", name: "About",
icon: constants.HEART, icon: constants.HEART,
sort_order: 998, sort_order: 100000,
render: function(view, container) { render: function(view, container) {
var room = this.rooms[view.get("context.currentRoom.id")], var room = this.rooms[view.get("context.currentRoom.id")],

View file

@ -56,7 +56,12 @@ FFZ.prototype.build_ui_popup = function(view) {
container.classList.toggle('dark', dark); container.classList.toggle('dark', dark);
// Render Menu // Menu Container
var sub_container = document.createElement('div');
sub_container.className = 'ffz-ui-menu-page';
inner.appendChild(sub_container);
// Render Menu Tabs
menu.className = 'menu clearfix'; menu.className = 'menu clearfix';
inner.appendChild(menu); inner.appendChild(menu);
@ -65,10 +70,6 @@ FFZ.prototype.build_ui_popup = function(view) {
heading.innerHTML = "<span>" + (constants.DEBUG ? "[DEV] " : "") + "FrankerFaceZ</span>"; heading.innerHTML = "<span>" + (constants.DEBUG ? "[DEV] " : "") + "FrankerFaceZ</span>";
menu.appendChild(heading); menu.appendChild(heading);
var sub_container = document.createElement('div');
sub_container.className = 'ffz-ui-menu-page';
inner.appendChild(sub_container);
var menu_pages = []; var menu_pages = [];
for(var key in FFZ.menu_pages) { for(var key in FFZ.menu_pages) {
if ( ! FFZ.menu_pages.hasOwnProperty(key) ) if ( ! FFZ.menu_pages.hasOwnProperty(key) )

View file

@ -346,7 +346,7 @@
.ffz-ui-menu-page { .ffz-ui-menu-page {
overflow-y: auto; overflow-y: auto;
padding: 0 20px; padding: 0 20px;
margin: 0 -20px; margin: -20px -20px 0;
} }
.chat-menu.ffz-ui-popup .ffz-ui-menu-page .chat-menu-content .heading, .chat-menu.ffz-ui-popup .ffz-ui-menu-page .chat-menu-content .heading,
@ -381,9 +381,8 @@
.ffz-ui-popup ul.menu { .ffz-ui-popup ul.menu {
list-style-type: none; list-style-type: none;
margin: -20px; margin: 0 -20px;
margin-bottom: 0; border-top: 1px solid rgba(0,0,0,0.2);
border-bottom: 1px solid rgba(0,0,0,0.2);
background-color: #eee; background-color: #eee;
} }
@ -410,10 +409,10 @@
display: block; display: block;
padding: 10px; padding: 10px;
height: 16px; height: 16px;
margin-bottom: -1px; margin-top: -1px;
cursor: pointer; cursor: pointer;
border-left: 1px solid rgba(0,0,0,0.2); border-left: 1px solid rgba(0,0,0,0.2);
border-bottom: 1px solid transparent; border-top: 1px solid transparent;
} }
.ffz-ui-popup ul.menu li.active { .ffz-ui-popup ul.menu li.active {
@ -421,7 +420,7 @@
} }
.ffz-ui-popup ul.menu li.active a { .ffz-ui-popup ul.menu li.active a {
border-bottom-color: #fff; border-top-color: #fff;
} }
.ffz-ui-popup.dark ul.menu li.active { .ffz-ui-popup.dark ul.menu li.active {
@ -429,7 +428,7 @@
} }
.ffz-ui-popup.dark ul.menu li.active a { .ffz-ui-popup.dark ul.menu li.active a {
border-bottom-color: #1e1e1e; border-top-color: #1e1e1e;
} }
.ffz-ui-popup.dark .ffz-ui-menu-page a { color: #fff; } .ffz-ui-popup.dark .ffz-ui-menu-page a { color: #fff; }