Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
$.getJSON("/api/plugins/" + this.props.params.slug, function(data) {
this.setState(data);
// Save in localStorage that this plugin has been visited.
if (store.enabled) {
var pluginStore = store.get("plugin-" + data.slug) || {};
pluginStore.hasVisited = true;
store.set("plugin-" + data.slug, pluginStore);
}
}.bind(this));
},
debug.elems.submit.addEventListener("click", () => {
store.set('outerShape', debug.elems.outerShape.value);
store.set('holes', debug.elems.holes.value);
store.set('doNotBuild', debug.elems.doNotBuild.value);
debug.refresh();
window.location.href = "#page";
});
async _initKeyringByName (name) {
if (this._has3idProv) throw new Error('Can not initKeyringByName of IdentityWallet')
if (!this._keyrings[name]) {
const sig = await utils.openSpaceConsent(this.managementAddress, this._provider, name)
const entropy = '0x' + utils.sha256(sig.slice(2))
const seed = mnemonicToSeed(entropyToMnemonic(entropy))
this._keyrings[name] = new Keyring(seed)
this._subDIDs[name] = await this._init3ID(name)
localstorage.set(STORAGE_KEY + this.managementAddress, this.serializeState())
return true
} else {
return false
}
}
function getUserId () {
if (store.enabled) {
return store.get('userId') || store.set('userId', generateRandomId());
} else {
return generateRandomId();
}
}
debug.elems.submit.addEventListener("click", () => {
store.set('outerShape', debug.elems.outerShape.value);
store.set('holes', debug.elems.holes.value);
store.set('doNotBuild', debug.elems.doNotBuild.value);
debug.refresh();
window.location.href = "#page";
});
constructor(props) {
super(props);
if (store.enabled) {
this.messagesKey = 'messages' + '.' + props.chatId + '.' + props.host;
this.state.messages = store.get(this.messagesKey) || store.set(this.messagesKey, []);
} else {
this.state.messages = [];
}
}
function getNextPartyId() {
let partyId = localStorage.get('partyId');
partyId = partyId === []._ ? 1 : ++partyId;
localStorage.set('partyId', partyId);
return partyId;
}
private static save(namespace: string) {
for (let key in Settings.cache[namespace]) {
StoreJS.set(namespace + '_' + key, Settings.cache[namespace][key]);
}
}
initGuestId: function(){
var id = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for( var i=0; i < 21; i++ ){
id += possible.charAt(Math.floor(Math.random() * possible.length));
}
id = "tmb_" + id;
store.set(TMB_UID_KEY, id);
return id;
},
getOrCreateGuest: function(){
enableAnalytics(config = {}) {
baseAdapter.enableAnalytics.call(this, config);
counter = store.get('prebid-counter');
if (typeof counter === 'undefined') {
counter = 1;
store.set('prebid-counter', counter);
} else {
counter = Number(counter) + 1;
store.set('prebid-counter', counter);
}
},
disableAnalytics() {