Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 17:30:29 +01:00
FE linting
Dieser Commit ist enthalten in:
Ursprung
39b947d003
Commit
2df920895d
3 geänderte Dateien mit 46 neuen und 67 gelöschten Zeilen
|
@ -14,7 +14,8 @@ import { uploadIcon } from "discourse/lib/uploads";
|
||||||
import { dasherize } from "@ember/string";
|
import { dasherize } from "@ember/string";
|
||||||
import showModal from "discourse/lib/show-modal";
|
import showModal from "discourse/lib/show-modal";
|
||||||
|
|
||||||
const IMAGE_MARKDOWN_REGEX = /!\[(.*?)\|(\d{1,4}x\d{1,4})(,\s*\d{1,3}%)?(.*?)\]\((upload:\/\/.*?)\)(?!(.*`))/g;
|
const IMAGE_MARKDOWN_REGEX =
|
||||||
|
/!\[(.*?)\|(\d{1,4}x\d{1,4})(,\s*\d{1,3}%)?(.*?)\]\((upload:\/\/.*?)\)(?!(.*`))/g;
|
||||||
|
|
||||||
export default ComposerEditor.extend({
|
export default ComposerEditor.extend({
|
||||||
classNameBindings: ["fieldClass"],
|
classNameBindings: ["fieldClass"],
|
||||||
|
@ -116,9 +117,8 @@ export default ComposerEditor.extend({
|
||||||
event.target.closest(".button-wrapper").dataset.imageIndex,
|
event.target.closest(".button-wrapper").dataset.imageIndex,
|
||||||
10
|
10
|
||||||
);
|
);
|
||||||
const matchingPlaceholder = this.get("composer.reply").match(
|
const matchingPlaceholder =
|
||||||
IMAGE_MARKDOWN_REGEX
|
this.get("composer.reply").match(IMAGE_MARKDOWN_REGEX);
|
||||||
);
|
|
||||||
|
|
||||||
this.session.set("wizardEventFieldId", this.field.id);
|
this.session.set("wizardEventFieldId", this.field.id);
|
||||||
this.appEvents.trigger(
|
this.appEvents.trigger(
|
||||||
|
|
|
@ -21,29 +21,8 @@ export default Controller.extend({
|
||||||
"application/x-www-form-urlencoded",
|
"application/x-www-form-urlencoded",
|
||||||
]),
|
]),
|
||||||
successCodes: selectKitContent([
|
successCodes: selectKitContent([
|
||||||
100,
|
100, 101, 102, 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301,
|
||||||
101,
|
302, 303, 303, 304, 305, 306, 307, 308,
|
||||||
102,
|
|
||||||
200,
|
|
||||||
201,
|
|
||||||
202,
|
|
||||||
203,
|
|
||||||
204,
|
|
||||||
205,
|
|
||||||
206,
|
|
||||||
207,
|
|
||||||
208,
|
|
||||||
226,
|
|
||||||
300,
|
|
||||||
301,
|
|
||||||
302,
|
|
||||||
303,
|
|
||||||
303,
|
|
||||||
304,
|
|
||||||
305,
|
|
||||||
306,
|
|
||||||
307,
|
|
||||||
308,
|
|
||||||
]),
|
]),
|
||||||
|
|
||||||
@discourseComputed(
|
@discourseComputed(
|
||||||
|
|
|
@ -21,7 +21,7 @@ export default {
|
||||||
};
|
};
|
||||||
|
|
||||||
withPluginApi("0.8.36", (api) => {
|
withPluginApi("0.8.36", (api) => {
|
||||||
api.onAppEvent('page:changed', (data) => {
|
api.onAppEvent("page:changed", (data) => {
|
||||||
const currentUser = container.lookup("service:current-user");
|
const currentUser = container.lookup("service:current-user");
|
||||||
const settings = container.lookup("service:site-settings");
|
const settings = container.lookup("service:site-settings");
|
||||||
const redirectToWizard = currentUser.redirect_to_wizard;
|
const redirectToWizard = currentUser.redirect_to_wizard;
|
||||||
|
@ -30,10 +30,10 @@ export default {
|
||||||
.concat(["loading"]);
|
.concat(["loading"]);
|
||||||
if (
|
if (
|
||||||
redirectToWizard &&
|
redirectToWizard &&
|
||||||
(data.currentRouteName !== "customWizardStep") &&
|
data.currentRouteName !== "customWizardStep" &&
|
||||||
!(excludedPaths.find((p) => {
|
!excludedPaths.find((p) => {
|
||||||
return data.currentRouteName.indexOf(p) > -1;
|
return data.currentRouteName.indexOf(p) > -1;
|
||||||
}))
|
})
|
||||||
) {
|
) {
|
||||||
window.location = "/w/" + redirectToWizard.dasherize();
|
window.location = "/w/" + redirectToWizard.dasherize();
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ export default {
|
||||||
// Needed to ensure appEvents get registered when navigating between steps
|
// Needed to ensure appEvents get registered when navigating between steps
|
||||||
@observes("id")
|
@observes("id")
|
||||||
initOnStepChange() {
|
initOnStepChange() {
|
||||||
if(/ wizard - field | wizard - step /.test(this.id)) {
|
if (/ wizard - field | wizard - step /.test(this.id)) {
|
||||||
this._initialize();
|
this._initialize();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -101,6 +101,6 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Laden …
In neuem Issue referenzieren