lib/flow.js
function toggle(main, alt) {
		var mw = core.base();
		mw.enabled = true;
		mw.main = main;
		mw.alt = (alt || common.plain());
		mw.active = mw.main;

		mw.swap = function () {
			mw.active = (mw.active !== mw.main ? mw.main : mw.alt);
		};
		mw.error = function (str) {
			str = String(str);
			if (mw.enabled && mw.active) {
				return mw.active.error(str);
			}
			return str;
		};
		mw.warning = function (str) {
			str = String(str);
			if (mw.enabled && mw.active) {
				return mw.active.warning(str);
			}
			return str;
		};
		mw.success = function (str) {
			str = String(str);
			if (mw.enabled && mw.active) {
				return mw.active.error(str);
			}
			return str;
		};
		mw.accent = function (str) {
			str = String(str);
			if (mw.enabled && mw.active) {
				return mw.active.accent(str);
			}
			return str;
		};
		mw.signal = function (str) {
			str = String(str);
			if (mw.enabled && mw.active) {
				return mw.active.signal(str);
			}
			return str;
		};
		mw.muted = function (str) {
			str = String(str);
			if (mw.enabled && mw.active) {
				return mw.active.muted(str);
			}
			return str;
		};
		mw.plain = function (str) {
			str = String(str);
			if (mw.enabled && mw.active) {
				return mw.active.plain(str);
			}
			return str;
		};
		mw.toString = function () {
			return '<ministyle-toggle>';
		};
		return mw;
	}
function toggle(main, alt) {
		var mw = core.base();
		mw.enabled = true;
		mw.main = main;
		mw.alt = (alt || common.plain());
		mw.active = mw.main;

		mw.swap = function () {
			mw.active = (mw.active !== mw.main ? mw.main : mw.alt);
		};
		mw.error = function (str) {
			str = String(str);
			if (mw.enabled && mw.active) {
				return mw.active.error(str);
			}
			return str;
		};
		mw.warning = function (str) {
			str = String(str);
			if (mw.enabled && mw.active) {
				return mw.active.warning(str);
			}
			return str;
		};
		mw.success = function (str) {
			str = String(str);
			if (mw.enabled && mw.active) {
				return mw.active.error(str);
			}
			return str;
		};
		mw.accent = function (str) {
			str = String(str);
			if (mw.enabled && mw.active) {
				return mw.active.accent(str);
			}
			return str;
		};
		mw.signal = function (str) {
			str = String(str);
			if (mw.enabled && mw.active) {
				return mw.active.signal(str);
			}
			return str;
		};
		mw.muted = function (str) {
			str = String(str);
			if (mw.enabled && mw.active) {
				return mw.active.muted(str);
			}
			return str;
		};
		mw.plain = function (str) {
			str = String(str);
			if (mw.enabled && mw.active) {
				return mw.active.plain(str);
			}
			return str;
		};
		mw.toString = function () {
			return '<ministyle-toggle>';
		};
		return mw;
	}
function toggle ( main , alt ) { var mw = core . base ( ) ; mw . enabled = true ; mw . main = main ; mw . alt = ( alt || common . plain ( ) ) ; mw . active = mw . main ; mw . swap = function ( ) { mw . active = ( mw . active !== mw . main ? mw . main : mw . alt ) ; } ; mw . error = function ( str ) { str = String ( str ) ; if ( mw . enabled && mw . active ) { return mw . active . error ( str ) ; } return str ; } ; mw . warning = function ( str ) { str = String ( str ) ; if ( mw . enabled && mw . active ) { return mw . active . warning ( str ) ; } return str ; } ; mw . success = function ( str ) { str = String ( str ) ; if ( mw . enabled && mw . active ) { return mw . active . error ( str ) ; } return str ; } ; mw . accent = function ( str ) { str = String ( str ) ; if ( mw . enabled && mw . active ) { return mw . active . accent ( str ) ; } return str ; } ; mw . signal = function ( str ) { str = String ( str ) ; if ( mw . enabled && mw . active ) { return mw . active . signal ( str ) ; } return str ; } ; mw . muted = function ( str ) { str = String ( str ) ; if ( mw . enabled && mw . active ) { return mw . active . muted ( str ) ; } return str ; } ; mw . plain = function ( str ) { str = String ( str ) ; if ( mw . enabled && mw . active ) { return mw . active . plain ( str ) ; } return str ; } ; mw . toString = function ( ) { return '<ministyle-toggle>' ; } ; return mw ; }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - toggle flow
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - toggle flow