REFACTOR: Move bootbox to an import instead of global variable (#10533)

This commit is contained in:
Robin Ward 2020-08-26 12:57:13 -04:00 committed by GitHub
parent 354014099d
commit ff4de97dfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
91 changed files with 104 additions and 1 deletions

View File

@ -3,5 +3,8 @@
"plugins": ["discourse-ember"],
"rules": {
"discourse-ember/global-ember": 2
},
"globals": {
"bootbox": "off"
}
}

View File

@ -1,6 +1,7 @@
import I18n from "I18n";
import Component from "@ember/component";
import { iconHTML } from "discourse-common/lib/icon-library";
import bootbox from "bootbox";
export default Component.extend({
classNames: ["watched-word"],

View File

@ -4,6 +4,7 @@ import Component from "@ember/component";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { ensureJSON, plainJSON, prettyJSON } from "discourse/lib/formatter";
import bootbox from "bootbox";
export default Component.extend({
tagName: "li",

View File

@ -2,6 +2,7 @@ import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { reads } from "@ember/object/computed";
import Component from "@ember/component";
import bootbox from "bootbox";
export default Component.extend({
editorId: reads("fieldName"),

View File

@ -8,6 +8,7 @@ import { bufferedProperty } from "discourse/mixins/buffered-content";
import { on, observes } from "discourse-common/utils/decorators";
import { popupAjaxError } from "discourse/lib/ajax-error";
import Category from "discourse/models/category";
import bootbox from "bootbox";
export default Component.extend(bufferedProperty("host"), {
editToggled: false,

View File

@ -6,6 +6,7 @@ import discourseComputed from "discourse-common/utils/decorators";
import { ajax } from "discourse/lib/ajax";
import AdminUser from "admin/models/admin-user";
import copyText from "discourse/lib/copy-text";
import bootbox from "bootbox";
export default Component.extend({
classNames: ["ip-lookup"],

View File

@ -4,6 +4,7 @@ import Component from "@ember/component";
import discourseComputed from "discourse-common/utils/decorators";
import { fmt } from "discourse/lib/computed";
import Permalink from "admin/models/permalink";
import bootbox from "bootbox";
export default Component.extend({
classNames: ["permalink-form"],

View File

@ -2,6 +2,8 @@ import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { schedule } from "@ember/runloop";
import Component from "@ember/component";
import bootbox from "bootbox";
/**
A form to create an IP address that will be blocked or allowed.
Example usage:

View File

@ -2,6 +2,7 @@ import I18n from "I18n";
import { alias } from "@ember/object/computed";
import Component from "@ember/component";
import UploadMixin from "discourse/mixins/upload";
import bootbox from "bootbox";
export default Component.extend(UploadMixin, {
type: "csv",

View File

@ -3,6 +3,7 @@ import { isEmpty } from "@ember/utils";
import { schedule } from "@ember/runloop";
import Component from "@ember/component";
import WatchedWord from "admin/models/watched-word";
import bootbox from "bootbox";
import discourseComputed, {
on,
observes

View File

@ -3,6 +3,7 @@ import discourseComputed from "discourse-common/utils/decorators";
import { alias } from "@ember/object/computed";
import Component from "@ember/component";
import UploadMixin from "discourse/mixins/upload";
import bootbox from "bootbox";
export default Component.extend(UploadMixin, {
type: "txt",

View File

@ -4,6 +4,7 @@ import Controller, { inject as controller } from "@ember/controller";
import { ajax } from "discourse/lib/ajax";
import discourseComputed from "discourse-common/utils/decorators";
import { setting, i18n } from "discourse/lib/computed";
import bootbox from "bootbox";
export default Controller.extend({
adminBackups: controller(),

View File

@ -2,6 +2,7 @@ import I18n from "I18n";
import Controller from "@ember/controller";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import bootbox from "bootbox";
export default Controller.extend({
saving: false,

View File

@ -6,6 +6,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
import { bufferedProperty } from "discourse/mixins/buffered-content";
import { propertyNotEqual } from "discourse/lib/computed";
import { run } from "@ember/runloop";
import bootbox from "bootbox";
export default Controller.extend(bufferedProperty("model"), {
adminBadges: controller(),

View File

@ -2,6 +2,7 @@ import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { later } from "@ember/runloop";
import Controller from "@ember/controller";
import bootbox from "bootbox";
export default Controller.extend({
@discourseComputed("model.colors", "onlyOverridden")

View File

@ -1,6 +1,7 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import Controller from "@ember/controller";
import bootbox from "bootbox";
export default Controller.extend({
@discourseComputed("model.isSaving")

View File

@ -5,6 +5,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
import { bufferedProperty } from "discourse/mixins/buffered-content";
import { action } from "@ember/object";
import { inject as controller } from "@ember/controller";
import bootbox from "bootbox";
export default Controller.extend(bufferedProperty("emailTemplate"), {
adminCustomizeEmailTemplates: controller(),

View File

@ -15,6 +15,7 @@ import showModal from "discourse/lib/show-modal";
import ThemeSettings from "admin/models/theme-settings";
import { THEMES, COMPONENTS } from "admin/models/theme";
import EmberObject from "@ember/object";
import bootbox from "bootbox";
const THEME_UPLOAD_VAR = 2;

View File

@ -3,6 +3,7 @@ import { empty } from "@ember/object/computed";
import Controller from "@ember/controller";
import { ajax } from "discourse/lib/ajax";
import { observes } from "discourse-common/utils/decorators";
import bootbox from "bootbox";
export default Controller.extend({
/**

View File

@ -2,6 +2,7 @@ import { empty, or, notEmpty } from "@ember/object/computed";
import Controller from "@ember/controller";
import EmailPreview from "admin/models/email-preview";
import { popupAjaxError } from "discourse/lib/ajax-error";
import bootbox from "bootbox";
export default Controller.extend({
username: null,

View File

@ -3,6 +3,7 @@ import { sort } from "@ember/object/computed";
import EmberObject, { action, computed } from "@ember/object";
import Controller from "@ember/controller";
import { ajax } from "discourse/lib/ajax";
import bootbox from "bootbox";
const ALL_FILTER = "all";

View File

@ -6,6 +6,7 @@ import { exportEntity } from "discourse/lib/export-csv";
import ScreenedIpAddress from "admin/models/screened-ip-address";
import { observes } from "discourse-common/utils/decorators";
import { INPUT_DELAY } from "discourse-common/config/environment";
import bootbox from "bootbox";
export default Controller.extend({
loading: false,

View File

@ -4,6 +4,7 @@ import discourseDebounce from "discourse/lib/debounce";
import Permalink from "admin/models/permalink";
import { observes } from "discourse-common/utils/decorators";
import { INPUT_DELAY } from "discourse-common/config/environment";
import bootbox from "bootbox";
export default Controller.extend({
loading: false,

View File

@ -3,6 +3,7 @@ import discourseComputed from "discourse-common/utils/decorators";
import Controller from "@ember/controller";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { bufferedProperty } from "discourse/mixins/buffered-content";
import bootbox from "bootbox";
export default Controller.extend(bufferedProperty("siteText"), {
saved: false,

View File

@ -5,6 +5,7 @@ import { next } from "@ember/runloop";
import Controller, { inject as controller } from "@ember/controller";
import GrantBadgeController from "discourse/mixins/grant-badge-controller";
import { popupAjaxError } from "discourse/lib/ajax-error";
import bootbox from "bootbox";
export default Controller.extend(GrantBadgeController, {
adminUser: controller(),

View File

@ -2,6 +2,7 @@ import I18n from "I18n";
import { gte, sort } from "@ember/object/computed";
import Controller from "@ember/controller";
import { popupAjaxError } from "discourse/lib/ajax-error";
import bootbox from "bootbox";
const MAX_FIELDS = 20;

View File

@ -11,6 +11,7 @@ import discourseComputed from "discourse-common/utils/decorators";
import { fmt } from "discourse/lib/computed";
import { htmlSafe } from "@ember/template";
import showModal from "discourse/lib/show-modal";
import bootbox from "bootbox";
export default Controller.extend(CanCheckEmails, {
adminTools: service(),

View File

@ -7,6 +7,7 @@ import WatchedWord from "admin/models/watched-word";
import { ajax } from "discourse/lib/ajax";
import { fmt } from "discourse/lib/computed";
import showModal from "discourse/lib/show-modal";
import bootbox from "bootbox";
export default Controller.extend({
adminWatchedWords: controller(),

View File

@ -7,6 +7,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
import { extractDomainFromUrl } from "discourse/lib/utilities";
import EmberObject from "@ember/object";
import { isAbsoluteURL } from "discourse-common/lib/get-url";
import bootbox from "bootbox";
export default Controller.extend({
adminWebHooks: controller(),

View File

@ -1,6 +1,7 @@
import I18n from "I18n";
import Controller from "@ember/controller";
import { popupAjaxError } from "discourse/lib/ajax-error";
import bootbox from "bootbox";
export default Controller.extend({
actions: {

View File

@ -4,6 +4,7 @@ import { A } from "@ember/array";
import { ajax } from "discourse/lib/ajax";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import { observes } from "discourse-common/utils/decorators";
import bootbox from "bootbox";
export default Controller.extend(ModalFunctionality, {
@observes("model")

View File

@ -2,6 +2,7 @@ import I18n from "I18n";
import Controller from "@ember/controller";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import { ajax } from "discourse/lib/ajax";
import bootbox from "bootbox";
export default Controller.extend(ModalFunctionality, {
loading: true,

View File

@ -4,6 +4,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
import Mixin from "@ember/object/mixin";
import { next } from "@ember/runloop";
import { Promise } from "rsvp";
import bootbox from "bootbox";
export default Mixin.create(ModalFunctionality, {
reason: null,

View File

@ -10,6 +10,7 @@ import Group from "discourse/models/group";
import DiscourseURL, { userPath } from "discourse/lib/url";
import { Promise } from "rsvp";
import User from "discourse/models/user";
import bootbox from "bootbox";
const wrapAdmin = user => (user ? AdminUser.create(user) : null);

View File

@ -4,6 +4,7 @@ import { ajax } from "discourse/lib/ajax";
import { extractError } from "discourse/lib/ajax-error";
import EmberObject from "@ember/object";
import MessageBus from "message-bus-client";
import bootbox from "bootbox";
const Backup = EmberObject.extend({
destroy() {

View File

@ -9,6 +9,7 @@ import { ajax } from "discourse/lib/ajax";
import { escapeExpression } from "discourse/lib/utilities";
import highlightSyntax from "discourse/lib/highlight-syntax";
import { url } from "discourse/lib/computed";
import bootbox from "bootbox";
const THEME_UPLOAD_VAR = 2;
const FIELDS_IDS = [0, 1, 5];

View File

@ -8,6 +8,7 @@ import BackupStatus from "admin/models/backup-status";
import Backup from "admin/models/backup";
import PreloadStore from "discourse/lib/preload-store";
import User from "discourse/models/user";
import bootbox from "bootbox";
const LOG_CHANNEL = "/admin/backups/logs";

View File

@ -4,6 +4,7 @@ import Route from "@ember/routing/route";
import { ajax } from "discourse/lib/ajax";
import Badge from "discourse/models/badge";
import showModal from "discourse/lib/show-modal";
import bootbox from "bootbox";
export default Route.extend({
serialize(m) {

View File

@ -1,5 +1,7 @@
import I18n from "I18n";
import Route from "@ember/routing/route";
import bootbox from "bootbox";
export default Route.extend({
model(params) {
return {

View File

@ -1,5 +1,7 @@
import I18n from "I18n";
import Route from "@ember/routing/route";
import bootbox from "bootbox";
export default Route.extend({
model(params) {
const all = this.modelFor("adminCustomizeThemes");

View File

@ -10,6 +10,7 @@ import showModal from "discourse/lib/show-modal";
import { getOwner } from "discourse-common/lib/get-owner";
import Service from "@ember/service";
import { Promise } from "rsvp";
import bootbox from "bootbox";
export default Service.extend({
init() {

View File

@ -21,6 +21,10 @@ define("ember-buffered-proxy/proxy", ["exports"], function(__exports__) {
__exports__.default = window.BufferedProxy;
});
define("bootbox", ["exports"], function(__exports__) {
__exports__.default = window.bootbox;
});
define("@popperjs/core", ["exports"], function(__exports__) {
__exports__.default = window.Popper;
__exports__.createPopper = window.Popper.createPopper;

View File

@ -1,6 +1,7 @@
import I18n from "I18n";
import Component from "@ember/component";
import { ajax } from "discourse/lib/ajax";
import bootbox from "bootbox";
export default Component.extend({
classNames: ["badge-title"],

View File

@ -6,6 +6,7 @@ import {
shouldOpenInNewTab,
openLinkInNewTab
} from "discourse/lib/click-track";
import bootbox from "bootbox";
export default Component.extend({
classNames: ["bookmark-list-wrapper"],

View File

@ -36,6 +36,7 @@ import {
getUploadMarkdown,
displayErrorForUpload
} from "discourse/lib/uploads";
import bootbox from "bootbox";
import {
cacheShortUploadUrl,

View File

@ -3,6 +3,7 @@ import discourseComputed from "discourse-common/utils/decorators";
import Component from "@ember/component";
import UploadMixin from "discourse/mixins/upload";
import { on } from "@ember/object/evented";
import bootbox from "bootbox";
export default Component.extend(UploadMixin, {
type: "csv",

View File

@ -4,6 +4,7 @@ import { bind } from "discourse-common/utils/decorators";
import logout from "discourse/lib/logout";
import I18n from "I18n";
import { setLogoffCallback } from "discourse/lib/ajax";
import bootbox from "bootbox";
export default Component.extend({
tagName: "",

View File

@ -3,6 +3,7 @@ import NavItem from "discourse/models/nav-item";
import { inject as service } from "@ember/service";
import Component from "@ember/component";
import FilterModeMixin from "discourse/mixins/filter-mode";
import bootbox from "bootbox";
export default Component.extend(FilterModeMixin, {
router: service(),

View File

@ -3,6 +3,7 @@ import Component from "@ember/component";
import discourseComputed from "discourse-common/utils/decorators";
import { popupAjaxError } from "discourse/lib/ajax-error";
import showModal from "discourse/lib/show-modal";
import bootbox from "bootbox";
export default Component.extend({
classNames: ["group-membership-button"],

View File

@ -8,6 +8,7 @@ import optionalService from "discourse/lib/optional-service";
import showModal from "discourse/lib/show-modal";
import { dasherize } from "@ember/string";
import { set } from "@ember/object";
import bootbox from "bootbox";
let _components = {};

View File

@ -1,6 +1,7 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import Component from "@ember/component";
import bootbox from "bootbox";
export default Component.extend({
tagName: "",

View File

@ -4,6 +4,7 @@ import { isEmpty } from "@ember/utils";
import Component from "@ember/component";
import { bufferedProperty } from "discourse/mixins/buffered-content";
import PermissionType from "discourse/models/permission-type";
import bootbox from "bootbox";
export default Component.extend(bufferedProperty("model"), {
tagName: "",

View File

@ -6,6 +6,7 @@ import discourseComputed from "discourse-common/utils/decorators";
import Component from "@ember/component";
import { reads, and } from "@ember/object/computed";
import { isEmpty } from "@ember/utils";
import bootbox from "bootbox";
export default Component.extend({
tagName: "",

View File

@ -13,6 +13,7 @@ import { ajax } from "discourse/lib/ajax";
import KeyboardShortcuts from "discourse/lib/keyboard-shortcuts";
import { formattedReminderTime, REMINDER_TYPES } from "discourse/lib/bookmark";
import { AUTO_DELETE_PREFERENCES } from "discourse/models/bookmark";
import bootbox from "bootbox";
// global shortcuts that interfere with these modal shortcuts, they are rebound when the
// modal is closed

View File

@ -27,6 +27,7 @@ import { Promise } from "rsvp";
import { isTesting } from "discourse-common/config/environment";
import EmberObject, { computed, action } from "@ember/object";
import deprecated from "discourse-common/lib/deprecated";
import bootbox from "bootbox";
function loadDraft(store, opts) {
let promise = Promise.resolve();

View File

@ -9,6 +9,7 @@ import discourseComputed, {
observes
} from "discourse-common/utils/decorators";
import Category from "discourse/models/category";
import bootbox from "bootbox";
export default Controller.extend(ModalFunctionality, {
selectedTab: null,

View File

@ -6,6 +6,7 @@ import { ajax } from "discourse/lib/ajax";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import { categoryLinkHTML } from "discourse/helpers/category-link";
import EmberObject from "@ember/object";
import bootbox from "bootbox";
export default Controller.extend(ModalFunctionality, {
topicController: inject("topic"),

View File

@ -5,6 +5,7 @@ import discourseComputed from "discourse-common/utils/decorators";
import { inject as service } from "@ember/service";
import { readOnly } from "@ember/object/computed";
import deprecated from "discourse-common/lib/deprecated";
import bootbox from "bootbox";
const Tab = EmberObject.extend({
init() {

View File

@ -3,6 +3,7 @@ import { action } from "@ember/object";
import Controller from "@ember/controller";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import bootbox from "bootbox";
export function popupAutomaticMembershipAlert(group_id, email_domains) {
if (!email_domains) {

View File

@ -11,6 +11,7 @@ import { iconHTML } from "discourse-common/lib/icon-library";
import Post from "discourse/models/post";
import Category from "discourse/models/category";
import { computed } from "@ember/object";
import bootbox from "bootbox";
function customTagArray(fieldName) {
return computed(fieldName, function() {

View File

@ -16,6 +16,7 @@ import { escapeExpression, areCookiesEnabled } from "discourse/lib/utilities";
import { extractError } from "discourse/lib/ajax-error";
import { SECOND_FACTOR_METHODS } from "discourse/models/user";
import { getWebauthnCredential } from "discourse/lib/webauthn";
import bootbox from "bootbox";
// This is happening outside of the app via popup
const AuthErrors = [

View File

@ -13,6 +13,7 @@ import { ajax } from "discourse/lib/ajax";
import { userPath } from "discourse/lib/url";
import logout from "discourse/lib/logout";
import EmberObject from "@ember/object";
import bootbox from "bootbox";
// Number of tokens shown by default.
const DEFAULT_AUTH_TOKENS_COUNT = 2;

View File

@ -8,6 +8,7 @@ import { cookAsync } from "discourse/lib/text";
import { ajax } from "discourse/lib/ajax";
import showModal from "discourse/lib/show-modal";
import { readOnly } from "@ember/object/computed";
import bootbox from "bootbox";
export default Controller.extend({
init() {

View File

@ -8,6 +8,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
import { findAll } from "discourse/models/login-method";
import { SECOND_FACTOR_METHODS } from "discourse/models/user";
import showModal from "discourse/lib/show-modal";
import bootbox from "bootbox";
export default Controller.extend(CanCheckEmails, {
loading: false,

View File

@ -8,6 +8,7 @@ import DiscourseURL from "discourse/lib/url";
import { userPath } from "discourse/lib/url";
import { popupAjaxError } from "discourse/lib/ajax-error";
import User from "discourse/models/user";
import bootbox from "bootbox";
export default Controller.extend({
taken: false,

View File

@ -5,6 +5,7 @@ import Controller from "@ember/controller";
import showModal from "discourse/lib/show-modal";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import bootbox from "bootbox";
export default Controller.extend({
sortedByCount: true,

View File

@ -6,6 +6,7 @@ import BulkTopicSelection from "discourse/mixins/bulk-topic-selection";
import NavItem from "discourse/models/nav-item";
import FilterModeMixin from "discourse/mixins/filter-mode";
import { queryParams } from "discourse/controllers/discovery-sortable";
import bootbox from "bootbox";
export default Controller.extend(BulkTopicSelection, FilterModeMixin, {
application: controller(),

View File

@ -4,6 +4,7 @@ import Controller from "@ember/controller";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import Topic from "discourse/models/topic";
import Category from "discourse/models/category";
import bootbox from "bootbox";
const _buttons = [];

View File

@ -25,6 +25,7 @@ import { Promise } from "rsvp";
import { escapeExpression } from "discourse/lib/utilities";
import { AUTO_DELETE_PREFERENCES } from "discourse/models/bookmark";
import { inject as service } from "@ember/service";
import bootbox from "bootbox";
let customPostMessageCallbacks = {};

View File

@ -4,6 +4,7 @@ import { inject as service } from "@ember/service";
import Controller, { inject as controller } from "@ember/controller";
import { exportUserArchive } from "discourse/lib/export-csv";
import { observes } from "discourse-common/utils/decorators";
import bootbox from "bootbox";
export default Controller.extend({
application: controller(),

View File

@ -6,6 +6,7 @@ import discourseDebounce from "discourse/lib/debounce";
import { popupAjaxError } from "discourse/lib/ajax-error";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import { INPUT_DELAY } from "discourse-common/config/environment";
import bootbox from "bootbox";
export default Controller.extend({
user: null,

View File

@ -4,6 +4,7 @@ import { alias, equal, and } from "@ember/object/computed";
import { inject as service } from "@ember/service";
import Controller, { inject as controller } from "@ember/controller";
import Topic from "discourse/models/topic";
import bootbox from "bootbox";
export default Controller.extend({
userTopicsList: controller("user-topics-list"),

View File

@ -1,5 +1,7 @@
import I18n from "I18n";
import { later } from "@ember/runloop";
import bootbox from "bootbox";
// Subscribe to "asset-version" change events via the Message Bus
export default {
name: "asset-version",

View File

@ -1,4 +1,5 @@
import autocomplete from "discourse/lib/autocomplete";
import bootbox from "bootbox";
export default {
name: "jquery-plugins",

View File

@ -1,4 +1,6 @@
import I18n from "I18n";
import bootbox from "bootbox";
export default {
name: "localization",
after: "inject-objects",

View File

@ -1,5 +1,6 @@
import I18n from "I18n";
import logout from "discourse/lib/logout";
import bootbox from "bootbox";
let _showingLogout = false;

View File

@ -1,4 +1,6 @@
import I18n from "I18n";
import bootbox from "bootbox";
export function extractError(error, defaultMessage) {
if (error instanceof Error) {
// eslint-disable-next-line no-console

View File

@ -8,6 +8,7 @@ import { selectedText } from "discourse/lib/utilities";
import { Promise } from "rsvp";
import { isTesting } from "discourse-common/config/environment";
import User from "discourse/models/user";
import bootbox from "bootbox";
export function isValidLink($link) {
// .hashtag == category/tag link

View File

@ -1,6 +1,7 @@
import I18n from "I18n";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import bootbox from "bootbox";
function exportEntityByType(type, entity, args) {
return ajax("/export_csv/export_entity.json", {

View File

@ -1,4 +1,6 @@
import I18n from "I18n";
import bootbox from "bootbox";
export function outputExportResult(result) {
if (result.success) {
bootbox.alert(I18n.t("admin.export_csv.success"));

View File

@ -1,5 +1,6 @@
import I18n from "I18n";
import { isAppleDevice } from "discourse/lib/utilities";
import bootbox from "bootbox";
function isGUID(value) {
return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(

View File

@ -7,6 +7,7 @@ import {
import getUrl from "discourse-common/lib/get-url";
import { on } from "@ember/object/evented";
import Mixin from "@ember/object/mixin";
import bootbox from "bootbox";
export default Mixin.create({
uploading: false,

View File

@ -22,6 +22,7 @@ import { Promise } from "rsvp";
import Site from "discourse/models/site";
import User from "discourse/models/user";
import deprecated from "discourse-common/lib/deprecated";
import bootbox from "bootbox";
// The actions the composer can take
export const CREATE_TOPIC = "createTopic",

View File

@ -22,6 +22,7 @@ import Session from "discourse/models/session";
import { Promise } from "rsvp";
import Site from "discourse/models/site";
import User from "discourse/models/user";
import bootbox from "bootbox";
export function loadTopicView(topic, args) {
const data = _.merge({}, args);

View File

@ -13,6 +13,7 @@ import { getOwner } from "discourse-common/lib/get-owner";
import { userPath } from "discourse/lib/url";
import Composer from "discourse/models/composer";
import { inject as service } from "@ember/service";
import bootbox from "bootbox";
function unlessReadOnly(method, message) {
return function() {

View File

@ -3,6 +3,7 @@ import { next } from "@ember/runloop";
import DiscourseRoute from "discourse/routes/discourse";
import User from "discourse/models/user";
import Group from "discourse/models/group";
import bootbox from "bootbox";
export default DiscourseRoute.extend({
beforeModel(transition) {

View File

@ -19,6 +19,7 @@ import hbs from "discourse/widgets/hbs-compiler";
import { relativeAgeMediumSpan } from "discourse/lib/formatter";
import { prioritizeNameInUx } from "discourse/lib/settings";
import { Promise } from "rsvp";
import bootbox from "bootbox";
function transformWithCallbacks(post) {
let transformed = transformBasicPost(post);

View File

@ -5,6 +5,7 @@ import { createWidget } from "discourse/widgets/widget";
import { h } from "virtual-dom";
import { avatarFor, avatarImg } from "discourse/widgets/post";
import hbs from "discourse/widgets/hbs-compiler";
import bootbox from "bootbox";
createWidget("pm-remove-group-link", {
tagName: "a.remove-invited.no-text.btn-icon.btn",

View File

@ -12,6 +12,7 @@ import { computed } from "@ember/object";
import { equal } from "@ember/object/computed";
import { camelize } from "@ember/string";
import { isEmpty } from "@ember/utils";
import bootbox from "bootbox";
// Component can get destroyed and lose state
let _topicSnapshot = null;

View File

@ -30,6 +30,7 @@ import { getOwner } from "discourse-common/lib/get-owner";
import { setTopicList } from "discourse/lib/topic-list-tracker";
import { setURLContainer } from "discourse/lib/url";
import { setDefaultOwner } from "discourse-common/lib/get-owner";
import bootbox from "bootbox";
export function currentUser() {
return User.create(sessionFixtures["/session/current.json"].current_user);
@ -97,7 +98,7 @@ function AcceptanceModal(option, _relatedTarget) {
});
}
window.bootbox.$body = $("#ember-testing");
bootbox.$body = $("#ember-testing");
$.fn.modal = AcceptanceModal;
let _pretenderCallbacks = {};

View File

@ -10,6 +10,7 @@ import {
import * as Utilities from "discourse/lib/utilities";
import User from "discourse/models/user";
import { discourseModule } from "helpers/qunit-helpers";
import bootbox from "bootbox";
discourseModule("lib:uploads");