lib/core.js
function toggle(main, alt) {
		var mw = core.base();
		mw.main = main;
		mw.alt = (alt || function () {

		});
		mw.active = mw.main;
		mw.enabled = true;
		mw.swap = function () {
			mw.active = (mw.active !== mw.main ? mw.main : mw.alt);
		};
		mw.writeln = function (line) {
			if (!mw.enabled) {
				return;
			}
			if (mw.enabled) {
				mw.active.writeln(line);
			}
		};
		mw.toString = function () {
			return '<miniwrite-toggle>';
		};
		return mw;
	}
function toggle(main, alt) {
		var mw = core.base();
		mw.main = main;
		mw.alt = (alt || function () {

		});
		mw.active = mw.main;
		mw.enabled = true;
		mw.swap = function () {
			mw.active = (mw.active !== mw.main ? mw.main : mw.alt);
		};
		mw.writeln = function (line) {
			if (!mw.enabled) {
				return;
			}
			if (mw.enabled) {
				mw.active.writeln(line);
			}
		};
		mw.toString = function () {
			return '<miniwrite-toggle>';
		};
		return mw;
	}
function toggle ( main , alt ) { var mw = core . base ( ) ; mw . main = main ; mw . alt = ( alt || function ( ) { } ) ; mw . active = mw . main ; mw . enabled = true ; mw . swap = function ( ) { mw . active = ( mw . active !== mw . main ? mw . main : mw . alt ) ; } ; mw . writeln = function ( line ) { if ( ! mw . enabled ) { return ; } if ( mw . enabled ) { mw . active . writeln ( line ) ; } } ; mw . toString = function ( ) { return '<miniwrite-toggle>' ; } ; return mw ; }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - control output
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - control output