Skip to content

Instantly share code, notes, and snippets.

@dorukcan
Last active September 7, 2016 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dorukcan/ef5ad31886b5960463170132432b64d7 to your computer and use it in GitHub Desktop.
Save dorukcan/ef5ad31886b5960463170132432b64d7 to your computer and use it in GitHub Desktop.
//MODULE TRANSFER
var result = [];
jQuery("#system-modules fieldset").each(function() {
jQuery(this).find(".form-checkbox").each(function() {
result.push([jQuery(this).attr("id"), jQuery(this).attr("checked")]);
});
});
console.log(JSON.stringify(result))
values = [];
for (i = 0; i < values.length; i++) {
jQuery("#" + values[i][0]).attr("checked", values[i][1]);
}
//-------------------------------------------------------------------------------------------
//CK EDITOR BUTTONS TRANSFER
var result = [];
jQuery("#edit-buttons .form-checkbox").each(function(){
result.push([jQuery(this).attr("id"), jQuery(this).attr("checked")]);
});
console.log( JSON.stringify(result) );
var values = [];
for (i = 0; i < values.length; i++) {
jQuery("#" + values[i][0]).attr("checked", values[i][1]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment