EN · DE · RU · FR · ES

#3503: history.js

projectforge-wicket/src/main/webapp/imagecropper/history/history.js Module JavaScript, projectforge-wicket/src/main/webapp/imagecropper/history/history.js 662 lignes · 498 code · 86 commentaires · 78 vides
Objectif : Ressource web Wicket : history.js. history.js fait partie de l'application open-source de gestion de projet ProjectForge.

Source (100 premières lignes)

BrowserHistoryUtils = {
    addEvent: function(elm, evType, fn, useCapture) {
        useCapture = useCapture || false;
        if (elm.addEventListener) {
            elm.addEventListener(evType, fn, useCapture);
            return true;
        }
        else if (elm.attachEvent) {
            var r = elm.attachEvent('on' + evType, fn);
            return r;
        }
        else {
            elm['on' + evType] = fn;
        }
    }
}

BrowserHistory = (function() {
    // type de navigateur
    var browser = {
        ie: false, 
        firefox: false, 
        safari: false, 
        opera: false, 
        version: -1
    };

    // si setDefaultURL a été appelé, notre premier indice
    // que le SWF est prêt et écoute
    //var swfReady = false;

    // l'URL que nous enverrons au SWF une fois prêt
    //var pendingURL = '';

    // URL d'état par défaut de l'application à utiliser lorsqu'aucun ID de fragment n'est présent
    var defaultHash = '';

    // URL d'état de l'application connue en dernier
    var currentHref = document.location.href;

    // URL initiale (utilisée uniquement par IE)
    var initialHref = document.location.href;

    // URL initiale (utilisée uniquement par IE)
    var initialHash = document.location.hash;

    // Préfixe de la source du cadre de l'historique (utilisé uniquement par IE)
    var historyFrameSourcePrefix = 'history/historyFrame.html?';

    // Maintenance de l'historique (utilisée uniquement par Safari)
    var currentHistoryLength = -1;

    var historyHash = [];

    var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);

    var backStack = [];
    var forwardStack = [];

    var currentObjectId = null;

    // Détection de l'agent utilisateur
    var useragent = navigator.userAgent.toLowerCase();

    if (useragent.indexOf("opera") != -1) {
        browser.opera = true;
    } else if (useragent.indexOf("msie") != -1) {
        browser.ie = true;
        browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
    } else if (useragent.indexOf("safari") != -1) {
        browser.safari = true;
        browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
    } else if (useragent.indexOf("gecko") != -1) {
        browser.firefox = true;
    }

    if (browser.ie == true && browser.version == 7) {
        window["_ie_firstload"] = false;
    }

    // Fonctions d'accès pour obtenir des éléments spécifiques de la page.
    function getHistoryFrame()
    {
        return document.getElementById('ie_historyFrame');
    }

    function getAnchorElement()
    {
        return document.getElementById('firefox_anchorDiv');
    }

    function getFormElement()
    {
        return document.getElementById('safari_formDiv');
    }

    function getRememberElement()
    {
        return document.getElementById("safari_remember_field");
    }

Historique Git

a73905c14 Correction de fautes dans les répertoires projectforge*/ Trouvé via codespell Voir c3b0602a893
9ebb88522 Commit initial

a73905c14

Correction de fautes dans les répertoires projectforge*/ Trouvé via codespell Voir c3b0602a893
a73905c1490c145f5212a29b752628e259cd2d58
diff --git a/projectforge-wicket/src/main/webapp/imagecropper/history/history.js b/projectforge-wicket/src/main/webapp/imagecropper/history/history.js
index 8ba2d519e..c85cede7b 100644
--- a/projectforge-wicket/src/main/webapp/imagecropper/history/history.js
+++ b/projectforge-wicket/src/main/webapp/imagecropper/history/history.js
@@ -287,7 +287,7 @@ BrowserHistory = (function() {
                 //Cela se produit lorsque l'utilisateur a navigué vers une URL spécifique
                 //dans l'application, et n'a pas utilisé le bouton retour/avant du navigateur
                 //IE semble avoir un bug où il arrête de mettre à jour l'URL qu'il
-                //affiche à l'utilisateur final à ce stade, mais programmatiquement elle
+                //affiche à l'utilisateur final à ce stade, mais programmatiquement elle
                 //semble correcte.  Effectuer un rechargement complet de l'application pour contourner
                 //ce problème.
                 if (browser.version < 7) {

9ebb88522

Commit initial