Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
143 lines (121 sloc) 5.11 KB

µ.Flow

Pluggable Websites and API

API-Reference

http://frdl.webfan.de/,flow.280.html#API-Reference

Quick Start

To start, in the HTML header section of your page include the following one-liner and your done so far:

<script type="text/javascript" src="http://api.webfan.de/api-d/4/js-api/library.js"></script>

Now you are able to acces and use the µ.Flow Modules and Plugins by your own WebApplication, for example by providing some HTML recognized by the library.

New Version...

...is work in progress. Default main-entry-point will be https://webfan.de/cdn/application/webfan/node_modules/webfan/homepagesystem.app To start with the new Version, in the HTML header section of your page include the following code and your done so far:

<script type="text/javascript">
(function() {
    'use strict';

    function exec(c, libUrl, libMetaUrl) {
        try {
            var execute = window.eval;
            execute(c);
        } catch (err) {
            if (!!console) {
                console.warn(err);
                console.trace(err);
                localStorage.removeItem(libUrl);
                localStorage.removeItem(libMetaUrl);
            }
        }
    }
    var libUrl = 'https://webfan.de/cdn/application/webfan/node_modules/webfan/homepagesystem.app';
    var libMetaUrl = libUrl + '#meta';
    var libCoreSource = localStorage.getItem(libUrl);
    var libMeta = localStorage.getItem(libMetaUrl);

    function LOAD() {
        if (window.XMLHttpRequest) {
            var request = new XMLHttpRequest();
        } else if (window.ActiveXObject) {
            var request = new ActiveXObject('Microsoft.XMLHTTP');
        }
        var loadLib = function() {
            if (request.readyState !== 4)
                return;
            libCoreSource = request.responseText;
            localStorage.setItem(libUrl, libCoreSource);
            localStorage.setItem(libMetaUrl, new Date().getTime());
            exec(libCoreSource, libUrl, libMetaUrl);
        };
        request.onreadystatechange = loadLib;
        try {
            request.open('GET', libUrl, true);
            request.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
            request.send();
        } catch (err) {
            if (!!console) {
                console.warn(err);
                (function() {
                    var h = document.getElementsByTagName("head", document)[0];
                    var s = document.createElement('script');
                    s.setAttribute('src', libUrl);
                    h.insertBefore(s, h.firstChild);
                }());
            }
        }
    }
    if ((null === libCoreSource || parseInt(libMeta) < new Date().getTime() - 24 * 60 * 60 * 1000 || parseInt(libMeta) < 1478981535857) && !!navigator.onLine) {
        LOAD();
    } else if (null === libCoreSource && !navigator.onLine) {
        window.addEventListener('online', function() {
            LOAD();
        }, true);
        return alert('The library was not installed, please go online to install it!');
    } else if (null !== libCoreSource) {
        exec(libCoreSource, libUrl, libMetaUrl);
    } else {
        alert('Error loading javascript library [unexpected exception]!');
    }
}());
</script>

Use or build websites and applications with...

Components

Once loaded the library by the code above, you can now add apps/widgets/components to your HTML. Read the following link to learn more about using components: https://github.com/frdl/-Flow/blob/master/components/README.md

Plugins

The API provides several plugins (also 3rd. party scripts) and functionalities, some of them can be lazy-loaded or may be jQuery Plugins. A list of available plugins will follow, but plugins should just be used by developers, please refer to the section "Components" of this readme if you just want to use "finalized widgets to go"!

Used by... (Examples and Demos)

License

(C) Till Wehowski - Alle Rechte vorbehalten

@license webdof http://look-up.webfan.de/webdof-license

@license BSD https://github.com/frdl/-Flow/blob/master/LICENSE.md

(C) The Copyright Holders [ MIT, BSD ]