Code: Alles auswählen
// ==UserScript==
// @name Fritzbox
// @namespace URI
// @include http://fritz.box/*
// @include http://www.fritz.box/*
// @grant GM_addStyle
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
// @version 1
// ==/UserScript==
GM_addStyle('#uiSipping {display: block !important;}');
jQuery.noConflict();
jQuery(document) .ready(function () {
var javascriptLink = 0;
// Liste Hauptmenüpunkte
menuElements = jQuery('#menucontent > div > ul > li');
// Unterscheidung zwischen http-Link und javascript-Link
if (jQuery('#menucontent > div > ul') .hasClass('LMenu')) {
javascriptLink = 1;
}
menuElementsSubmenu = jQuery('#menucontent > div > ul > .selected > ul > li');
var sid = jQuery.getUrlVar('sid');
var url = window.location.href.substring(0, window.location.href.indexOf('?'));
if (menuElements[1].className.match('selected')) {
// Internet
// DNS-Server
jQuery('#menucontent > div > ul > .selected.submenu ul') .append('<li class="LSubitem"><a href="http://fritz.box/internet/dns_server_enh.lua?sid=' + sid + '">DNS-Server</a></li>');
// jQuery('#menucontent > div > ul > .selected.submenu ul').append('<li class="LSubitem"><a href="javascript:jslGoTo(\'internet\',\'dns_server_enh\')">DNS-Server</a></li>');
// LAN-Bridge
jQuery('#menucontent > div > ul > .selected.submenu ul') .append('<li class="LSubitem"><a href="http://fritz.box/internet/lanbridges.lua?sid=' + sid + '">LAN-Bridge</a></li>');
// jQuery('#menucontent > div > ul > .selected.submenu ul').append('<li class="LSubitem"><a href="javascript:jslGoTo(\'internet\',\'cable_bridge\')">LAN-Bridge</a></li>');
}
if (menuElements[2].className.match('selected')) {
// Telefonie
// Neue Rufnummer
jQuery('#menucontent > div > ul > .selected ul') .append('<li><a href="http://fritz.box/assis/assi_fon_nums.lua?sid=' + sid + '">Neue Rufnummer</a></li>');
// Wahlregeln anzeigen
if (javascriptLink == 0) {
jQuery('#menucontent > div > ul > .selected ul') .append('<li><a href="http://fritz.box/fon_num/dialrul_list.lua?sid=' + sid + '">Wahlregeln</a></li>');
}
else {
jQuery('#menucontent > div > ul > .selected ul') .append('<li class="LSubitem"><a href="javascript:jslGoTo(\'fon\',\'routing\')">Wahlregeln</a></li>');
}
// Wahlregeln aktiv?
if (url == 'http://fritz.box/fon_num/dialrul_list.lua' && (jQuery.getUrlVar('var%3Apagename') == 'routing' || jQuery.getUrlVar('var:pagename') == 'routing')) {
jQuery('#menucontent > div > ul > .selected > ul > li') .last() .attr('class', 'selected');
}
// Eigene Rufnummern - "Neue Rufnummer" und "Anschlusseinstellungen" nach Reboot automatisch freischalten
if (menuElementsSubmenu[6].className.match('selected')) {
if (!jQuery('#btnNewNum') .length > 0) {
jQuery('#main_form') .append('<button style="display: none" id="gui_readonly" class="icon" title="Bearbeiten" value="0" name="sipextra:settings/gui_readonly" type="submit"><img alt="Bearbeiten" src="/css/default/images/bearbeiten.gif"></button>');
jQuery('#gui_readonly') .click();
}
//jQuery('#main_form').append('<button id="gui_readonly1" class="icon" title="Bearbeiten" value="1" name="sipextra:settings/gui_readonly" type="submit"><img alt="Bearbeiten" src="/css/default/images/bearbeiten.gif"></button>');
// Delete-Buttons freischalten
deleteButtons = jQuery('#uiViewFonNumTable button');
var i;
for (i = 1; i < deleteButtons.length; i += 2) {
deleteButtons[i].disabled = false;
}
}
}
if (menuElements[4].className.match('selected')) {
// WLAN
// Repeater
jQuery('#menucontent > div > ul > .selected.submenu ul') .append('<li class="LSubitem"><a href="http://fritz.box/wlan/wds2.lua?sid=' + sid + '">WLAN Repeater</a></li>');
}
if (menuElements[5].className.match('selected')) {
// DECT
// Repeater
jQuery('#menucontent > div > ul > .selected.submenu ul') .append('<li class="LSubitem"><a href="http://fritz.box/dect/dect_repeater.lua?sid=' + sid + '">DECT Repeater</a></li>');
}
});
jQuery.extend({
getUrlVars: function () {
var vars = [
],
hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1) .split('&');
for (var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
},
getUrlVar: function (name) {
return jQuery.getUrlVars() [name];
}
});
Das Hinzufügen einer neuen Rufnummer geht damit aber leider nicht (wie schon vorher bemerkt wurde). Zumindest ist es ein Schritt in die richtige Richtung.