mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
DEV: Upgrades to Ember 3.10 (#7871)
Co-Authored-By: majakomel <maja.komel@gmail.com>
This commit is contained in:
parent
e2fa5704e9
commit
b3eb67976d
78 changed files with 332 additions and 263 deletions
|
@ -13,6 +13,7 @@ class ThemeJavascriptCompiler
|
|||
|
||||
// Helper to replace old themeSetting syntax
|
||||
function generateHelper(settingParts) {
|
||||
console.log(settingParts)
|
||||
const settingName = settingParts.join('.');
|
||||
return {
|
||||
"path": {
|
||||
|
@ -64,7 +65,7 @@ class ThemeJavascriptCompiler
|
|||
}
|
||||
|
||||
function manipulateNode(node) {
|
||||
// Magically add theme id as the first param for each of these helpers
|
||||
// Magically add theme id as the first param for each of these helpers)
|
||||
if (node.path.parts && ["theme-i18n", "theme-prefix", "theme-setting"].includes(node.path.parts[0])) {
|
||||
if(node.params.length === 1){
|
||||
node.params.unshift({
|
||||
|
@ -134,10 +135,16 @@ class ThemeJavascriptCompiler
|
|||
|
||||
def discourse_extension
|
||||
<<~JS
|
||||
Ember.HTMLBars.registerPlugin('ast', function(){
|
||||
return { name: 'theme-template-manipulator',
|
||||
visitor: { SubExpression: manipulateNode, MustacheStatement: manipulateNode, PathExpression: manipulatePath}
|
||||
}});
|
||||
Ember.HTMLBars.registerPlugin('ast', function() {
|
||||
return {
|
||||
name: 'theme-template-manipulator',
|
||||
visitor: {
|
||||
SubExpression: manipulateNode,
|
||||
MustacheStatement: manipulateNode,
|
||||
PathExpression: manipulatePath
|
||||
}
|
||||
}
|
||||
});
|
||||
JS
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue