1. Nachrichten
  2. Forum
    1. Unerledigte Themen
    2. Forenregeln
  3. Spenden
  • Anmelden
  • Registrieren
  • Suche
Dieses Thema
  1. camp-firefox.de
  2. Forum
  3. Firefox für den Desktop (Windows, Apple macOS, Linux)
  4. Individuelle Anpassungen

Uhr Script

  • omar1979
  • 5. November 2021 um 19:22
  • Erledigt
  • 1
  • 2
  • Online
    omar1979
    Reaktionen
    7
    Beiträge
    1.571
    • 5. November 2021 um 21:16
    • #21

    :thumbup: :thumbup: :thumbup:

    Danke vielmals 2002Andreas

    "Klug sein hat noch nie einen Menschen an Dummheiten gehindert." Stefan Zweig
    Firefox-Version: 138.0.3
    Edition: Windows 11 Home (64-Bit-Betriebssystem)
    Version: 24H2

  • 2002Andreas
    Moderator
    Reaktionen
    470
    Beiträge
    64.383
    • 5. November 2021 um 21:52
    • #22
    Zitat von omar1979

    Danke vielmals

    Passt doch perfekt alles :thumbup:

    Mit freundlichem Gruß
    Andreas
    Mein Laptop  Meine Add-ons

  • seipe
    Beiträge
    1.002
    • 6. November 2021 um 05:45
    • #23

    Ich möchte die Datums- und Versionsanzeige weiter nach links schieben. Wo muss ich das ändern?

    Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0.3, Windows 11 Pro Version 24H2 (Build 26100.4061)

  • universum123
    Beiträge
    545
    • 6. November 2021 um 09:37
    • #24

    moin

    bei mir in der uhr.uc.js heist die zeile

    Code
        ClockLabel.setAttribute("style", "padding-top: 5px; padding-left: 5px;color:yellow;font:bold 12pt verdana, arial, helvetica, sans-serif;text-shadow:none");

    padding-top: (hoch runter) padding-left: (rechts links verschieben 5 10 15 20 ...)

    gruß uni

  • Dharkness
    Reaktionen
    19
    Beiträge
    2.064
    • 6. November 2021 um 12:08
    • #25
    Zitat von seipe

    Ich möchte die Datums- und Versionsanzeige weiter nach links schieben.

    Dafür solltest Du uns das mal per Screenshot zeigen, den bitte per Klick auf Dateianhänge hinzufügen und eventuell auch Dein Uhr-Schript per Klick auf </> hinzufügen.

    Es grüßt,

    Ralf

  • 2002Andreas
    Moderator
    Reaktionen
    470
    Beiträge
    64.383
    • 6. November 2021 um 12:10
    • #26

    Und auch, ob ein eigener Text genutzt wird.

    Wenn nicht:

    JavaScript
    (function() {
        function doDatClock() {
            var timestr = new Date().toLocaleDateString( locale , options );
            const blanks = '     Es ist: ';
            let i = timestr.lastIndexOf(',');
            timestr = timestr.substring(0,i) + blanks + timestr.substring(i+1);
            
            if( count == 1 ) {
                var counter = new Date( 1000 * sec ).toISOString().substr( 11 , 8 ); // .replace(/^[0:]+/, '') // if you want to replace zeroes and colons
                timestr = timestr + ' (' + counter + ')';
                sec++;
            }
            ClockLabel.setAttribute( 'value', timestr );
        }
        
        var count = 0; // if you don't want a counter set this to zero
        var agent = 1; // if you just want the clock set this to zero
        var language = 'de-DE'; // locale, e.g. 'de-DE' , 'en-US' , 'fr-FR'
        var personalText = ''; // your personal text here
        var cssColor = 'black'; // Font Color
    
        var css = 'padding-top: 3px !important; padding-left: 0px; color: ' + cssColor + '; font-weight: 600; text-shadow: none; width: 295px; margin-right:20px;';
        var cssA = 'margin-left:7px; width: auto;';
    
        var options = { 
            weekday: 'long', 
            year: 'numeric', 
            month: 'long', 
            day: 'numeric', 
            hour: '2-digit', 
            minute: '2-digit', 
            second: '2-digit' 
        };
        
        var sec = 0;
    
        var locale = language || window.navigator.languages[0];
    
        var position = document.getElementById('helpMenu');
    
        var ClockLabel = document.createXULElement('label');
        ClockLabel.setAttribute('id', 'statusbar-clock-display');
        ClockLabel.setAttribute('class', 'statusbarpanel-text');
        ClockLabel.setAttribute('style', css);    
        position.parentNode.insertBefore(ClockLabel, position.nextSibling);
    
        if( agent == 1 ) {
            var AgentLabel = document.createXULElement('label');
            AgentLabel.setAttribute('id', 'statusbar-agent-display');
            AgentLabel.setAttribute('class', 'statusbarpanel-text');
            AgentLabel.setAttribute('style', css + cssA);
            var FFstr = window.navigator.userAgent.split(' ');
            var FF = FFstr[FFstr.length-1].replace( '/' , ' ' );
            var gAppInfo = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo).QueryInterface(Ci.nsIXULRuntime);
            var text = "Firefox > " + gAppInfo.version + personalText;
            
    
            AgentLabel.setAttribute( 'value', text );
            position.parentNode.insertBefore(AgentLabel, position.nextSibling);
        }
        
        if( count == 1 ) {
            ClockLabel.addEventListener('dblclick', function() { sec = 0; });
        }
        
        window.setInterval( doDatClock , 1000 );
    })();
    Alles anzeigen

    Mit freundlichem Gruß
    Andreas
    Mein Laptop  Meine Add-ons

  • seipe
    Beiträge
    1.002
    • 6. November 2021 um 15:13
    • #27
    CSS
    function doDatClockCallback() { try{ doDatClock(); } catch(ex){} }
    
    function doDatClock() {
        var options = { 
            weekday: 'long', 
            year: 'numeric', 
            month: 'long', 
            day: 'numeric', 
            hour: '2-digit', 
            minute: '2-digit', 
            second: '2-digit' 
        };
        
        var locale = language || window.navigator.languages[0];
        var timestr = new Date().toLocaleDateString( locale , options );
        if( count == 1 ) {
            var counter = new Date( 1000 * sec ).toISOString().substr( 11 , 8 ); // .replace(/^[0:]+/, '') // if you want to replace zeroes and :
            timestr = timestr + ' (' + counter + ')';
            sec++;
        }
        
        var ua = window.navigator.userAgent;
        var FFstr = ua.split(' ');
        var FF = FFstr[FFstr.length-1].replace( '/' , ' ' );
        
        var text = "Firefox " + AppConstants.MOZ_APP_VERSION_DISPLAY;
    
        var agent = document.getElementById('statusbar-agent-display');
        agent.setAttribute( 'value', text );
        
        var status = document.getElementById('statusbar-clock-display');
        status.setAttribute( 'value', timestr );
        
        window.setTimeout( doDatClockCallback , 1000 );    
    }
    
    var sec = 0;
    var count = 0; // if you don't want a counter set this to zero
    var language = 'de-DE'; // locale, e.g. 'de-DE' , 'en-US' , 'fr-FR'
    
    var css = 'padding-top: 9px !important; padding-left: 5px !important; color: black; font-weight: 700; text-shadow: none;';
    
    var ClockStatus = document.getElementById("tabbrowser-tabs");
    
    var AgentLabel = document.createXULElement('label');
    AgentLabel.setAttribute('id', 'statusbar-agent-display');
    AgentLabel.setAttribute('class', 'statusbarpanel-text');
    AgentLabel.setAttribute('style', css);
    
    var ClockLabel = document.createXULElement('label');
    ClockLabel.setAttribute('id', 'statusbar-clock-display');
    ClockLabel.setAttribute('class', 'statusbarpanel-text');
    ClockLabel.setAttribute('style', css);
    
    ClockStatus.parentNode.insertBefore(ClockLabel, ClockStatus.nextSibling);
    ClockStatus.parentNode.insertBefore(AgentLabel, ClockStatus.nextSibling);
    
    doDatClock();
    Alles anzeigen

    Eigener Text wird nicht benutzt.

    Bilder

    • Zwischenablage01.jpg
      • 127,07 kB
      • 1.920 × 1.080

    Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0.3, Windows 11 Pro Version 24H2 (Build 26100.4061)

  • Dharkness
    Reaktionen
    19
    Beiträge
    2.064
    • 6. November 2021 um 16:23
    • #28
    Zitat von seipe

    var ClockStatus = document.getElementById("tabbrowser-tabs");

    tabbrowser-tabs geht nun mal über die ganze Breite des Fensters und Du willst die Anzeige des Scripts neben tabbrowser-tabs haben, also wird es rechts davon eingefügt.

    P.S.:

    Ein einfügen rechts vom Button Neuer Tab macht keinen Sinn, denn dann wird die Anzeige sicherlich aus dem Fenster quasi raus laufen, musst Du halt mal testen, ersetze tabbrowser-tabs durch new-tab-button.

    Es grüßt,

    Ralf

    Einmal editiert, zuletzt von Dharkness (6. November 2021 um 16:29)

  • seipe
    Beiträge
    1.002
    • 6. November 2021 um 16:39
    • #29

    Dharkness, danke für die Erläuterung. Werde es dann so wie gehabt belassen.

    Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0.3, Windows 11 Pro Version 24H2 (Build 26100.4061)

    • 1
    • 2
  1. Kontakt
  2. Datenschutz
  3. Impressum
Community-Software: WoltLab Suite™
  • Alles
  • Dieses Thema
  • Dieses Forum
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
Mastodon
Zitat speichern