Skip to content

Instantly share code, notes, and snippets.

@stuartf
Created February 11, 2015 21:19
Show Gist options
  • Save stuartf/b4586a44a178f1d4fe62 to your computer and use it in GitHub Desktop.
Save stuartf/b4586a44a178f1d4fe62 to your computer and use it in GitHub Desktop.
Export/Import OAE Skin
var _ = require('underscore');
// get the existing skin from /api/ui/skin/variables and change the wrapping object to module.exports
// this could be done cleaner in code but isn't worth the time right now
var skin = require('./saved.skin.json').results;
var ported = {};
_.each(_.flatten(_.pluck(_.flatten(_.pluck(skin, 'subsections')), 'variables')), function(obj) {
if (obj.value !== undefined) {
ported['oae-ui/skin/variables/' + obj.name] = obj.value;
}
});
// paste the output in the browser console and replace the TENANTALIAS
console.log('$.ajax({url:"https://" + document.URL.split('/')[2] + "/api/config/TENANTALIAS", method: "POST", data: ' + JSON.stringify(ported) + '});');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment