Sixtest Wiki:API4/Edit

(function {	"use strict";	var extension = $API.create.extension("Edit"),		settings = {},		init;	extension.submit = function  {		var edits;		if ($API.user.right('edit')) {			edits = $API.ext.Array.clone($API.user.changed);			$API.user.changed = {};			$API.ext.Ajax.update(edits || {});		}	};	extension.set = function (setting, value) {		if (settings[setting] !== undefined) {			settings[setting] = value;			return true;		}		return false;	};	extension.get = function (setting) {		return settings[setting];	};	extension.setNew = function (setting, value) {		settings[setting] = value;	};	init = function  {		if ($API.user.right('edit') || $API.ext.Array.position('sysop', wgUserGroups) !== -1) {			$API.user.right('edit', true);		}	};	$API.require('Array', init) });