Coder Social home page Coder Social logo

jquery.environment.js's Introduction

jquery.environment.js

Environment JavaScript Injector

Installation

Include the script after the jQuery library

<script src="/path/to/jquery.environment.js"></script>

Usage

Initialize the plugin and put the code inside the jQuery document.ready callback like here:

$(function(){        
    $.environment({
        development:{
            flag: true,
            explicit: false,
            uri: 'dev.mysite.com',
            links: {
                'a.home-link':          'http://dev.mysite.com/',
                'a.sitemap-link':       'http://dev.mysite.com/sitemap.html'
            },
            hidden: [
                'a.faq-link',
                'a.newsletter-link'
            ]
        },
        productive:{
            flag: false,
            explicit: false,
            uri: 'mysite.com',
            links: {
                'a.home-link':          'http://mysite.com/',
                'a.sitemap-link':       'http://mysite.com/sitemap.html'
            }
        }         
    });
});

Supported Environments

The Plugin supports the three most common environments when developing web applications:

  • Development
  • Review
  • Productive

Each environment is already pre-configured and all you have to do is overwrite their settings.

Environment Configuration

To configure an environment for usage in your application, the following options can be used:

flag

Shows/Hides the status block in the upper right corner of the browser window. The flag also displays links to other configured environments which allows switching without reloading the page.

explicit

uri

Identificator for the environment. Compared to the current url of the window.

links

A collection of key-value pairs, where key describes an Selector for a Link Element and the value contains the Link value for the href attribute.

hidden

A simple array of selectors to DOM Elements which have to be hidden in the current Environment.

Authors

K. Feldmaier

jquery.environment.js's People

Watchers

Kai Feldmaier avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.