EN · DE · RU · FR · ES

#3503: history.js

projectforge-wicket/src/main/webapp/imagecropper/history/history.js JavaScript module, projectforge-wicket/src/main/webapp/imagecropper/history/history.js 662 lines · 498 code · 86 comments · 78 blank
Purpose: Wicket webapp resource: history.js. history.js is part of the ProjectForge open-source project management application.

Source (first 100 lines)

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 of browser
    var browser = {
        ie: false, 
        firefox: false, 
        safari: false, 
        opera: false, 
        version: -1
    };

    // if setDefaultURL has been called, our first clue
    // that the SWF is ready and listening
    //var swfReady = false;

    // the URL we'll send to the SWF once it is ready
    //var pendingURL = '';

    // Default app state URL to use when no fragment ID present
    var defaultHash = '';

    // Last-known app state URL
    var currentHref = document.location.href;

    // Initial URL (used only by IE)
    var initialHref = document.location.href;

    // Initial URL (used only by IE)
    var initialHash = document.location.hash;

    // History frame source URL prefix (used only by IE)
    var historyFrameSourcePrefix = 'history/historyFrame.html?';

    // History maintenance (used only by Safari)
    var currentHistoryLength = -1;

    var historyHash = [];

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

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

    var currentObjectId = null;

    //UserAgent detection
    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;
    }

    // Accessor functions for obtaining specific elements of the 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");
    }

Git History

a73905c14 Fix typos in projectforge*/ directories Found via codespell See c3b0602a893
9ebb88522 Initial commit

a73905c14

Fix typos in projectforge*/ directories Found via codespell See 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() {
                 //This occurs when the user has navigated to a specific URL
                 //within the app, and didn't use browser back/forward
                 //IE seems to have a bug where it stops updating the URL it
-                //shows the end-user at this point, but programatically it
+                //shows the end-user at this point, but programmatically it
                 //appears to be correct.  Do a full app reload to get around
                 //this issue.
                 if (browser.version < 7) {

9ebb88522

Initial commit