-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '4.6' into IBX-3456-attribute-groups
- Loading branch information
Showing
101 changed files
with
1,638 additions
and
273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ active_domains: | |
- 'ibexa_content_type' | ||
- 'ibexa_dropdown' | ||
- 'ibexa_collapse' | ||
- 'ibexa_popup_menu' | ||
- 'messages' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 48 additions & 1 deletion
49
src/bundle/Resources/public/js/scripts/admin.distraction.free.mode.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 26 additions & 8 deletions
34
src/bundle/Resources/public/js/scripts/autogenerate.identifier.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,32 @@ | ||
(function (doc, ibexa) { | ||
const sourceInputs = doc.querySelectorAll('[data-autogenerate-identifier-target-selector]'); | ||
|
||
sourceInputs.forEach((sourceInput) => { | ||
const { autogenerateIdentifierTargetSelector } = sourceInput.dataset; | ||
const targetInput = doc.querySelector(autogenerateIdentifierTargetSelector); | ||
const identifierAutogenerator = new ibexa.core.SlugValueInputAutogenerator({ | ||
sourceInput, | ||
targetInput, | ||
const initAutogenerator = (elements, shouldAutogenerateValue) => { | ||
elements.forEach((sourceInput) => { | ||
const { autogenerateIdentifierTargetSelector } = sourceInput.dataset; | ||
const targetInput = doc.querySelector(autogenerateIdentifierTargetSelector); | ||
const identifierAutogenerator = new ibexa.core.SlugValueInputAutogenerator({ | ||
sourceInput, | ||
targetInput, | ||
shouldAutogenerateValue: shouldAutogenerateValue || !targetInput.value, | ||
}); | ||
|
||
identifierAutogenerator.init(); | ||
}); | ||
}; | ||
const attachListeners = () => { | ||
doc.body.addEventListener( | ||
'ibexa-autogenerate-identifier:init', | ||
(event) => { | ||
const { fieldNode, shouldAutogenerateValue } = event.detail; | ||
const sourceFields = fieldNode.querySelectorAll('[data-autogenerate-identifier-target-selector]'); | ||
|
||
initAutogenerator(sourceFields, shouldAutogenerateValue); | ||
}, | ||
false, | ||
); | ||
}; | ||
|
||
identifierAutogenerator.init(); | ||
}); | ||
initAutogenerator(sourceInputs); | ||
attachListeners(); | ||
})(document, window.ibexa); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
(function (global, doc, ibexa) { | ||
class IbexaStorage { | ||
constructor(config) { | ||
const keySuffix = config.isUserAware ? `:${ibexa.helpers.user.getId()}` : ''; | ||
|
||
this.key = `${config.key}${keySuffix}`; | ||
this.eventName = config.eventName; | ||
} | ||
|
||
setItem(data) { | ||
const stringifiedData = JSON.stringify(data); | ||
|
||
global.localStorage.setItem(this.key, stringifiedData); | ||
|
||
this.fireStorageChangeEvent(stringifiedData); | ||
} | ||
|
||
getItem() { | ||
return JSON.parse(global.localStorage.getItem(this.key)); | ||
} | ||
|
||
fireStorageChangeEvent(data) { | ||
if (this.eventName) { | ||
const storageChangeEvent = new CustomEvent(this.eventName, { | ||
cancelable: true, | ||
detail: { content: JSON.parse(data) }, | ||
}); | ||
|
||
doc.body.dispatchEvent(storageChangeEvent); | ||
} | ||
} | ||
|
||
init() { | ||
if (this.eventName) { | ||
global.addEventListener('storage', (event) => { | ||
if (event.key === this.key) { | ||
this.fireStorageChangeEvent(event.newValue); | ||
} | ||
}); | ||
} | ||
} | ||
} | ||
|
||
ibexa.addConfig('core.Storage', IbexaStorage); | ||
})(window, window.document, window.ibexa); |
Oops, something went wrong.