Skip to content

Commit

Permalink
Remove some remaining v11 cruft.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fyorl committed Nov 27, 2024
1 parent 124194d commit 527b296
Showing 1 changed file with 0 additions and 108 deletions.
108 changes: 0 additions & 108 deletions module/documents/mixins/document.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,112 +11,4 @@ export default Base => class extends SystemFlagsMixin(Base) {
get _systemFlagsDataModel() {
return this.system?.metadata?.systemFlagsModel ?? null;
}

/* -------------------------------------------- */
/* Socket Event Handlers */
/* -------------------------------------------- */

/**
* Perform preliminary operations before a Document of this type is created.
* Pre-creation operations only occur for the client which requested the operation.
* @param {object} data The initial data object provided to the document creation request.
* @param {object} options Additional options which modify the creation request.
* @param {User} user The User requesting the document creation.
* @returns {Promise<boolean|void>} A return value of false indicates the creation operation should be cancelled.
* @see {Document#_preCreate}
* @protected
*/
async _preCreate(data, options, user) {
let allowed = await super._preCreate(data, options, user);
if ( foundry.utils.isNewerVersion(game.version, 12) ) return allowed;
if ( allowed !== false ) allowed = await this.system._preCreate?.(data, options, user);
return allowed;
}

/* -------------------------------------------- */

/**
* Perform preliminary operations before a Document of this type is updated.
* Pre-update operations only occur for the client which requested the operation.
* @param {object} changed The differential data that is changed relative to the document's prior values.
* @param {object} options Additional options which modify the update request
* @param {documents.BaseUser} user The User requesting the document update
* @returns {Promise<boolean|void>} A return value of false indicates the update operation should be cancelled.
* @see {Document#_preUpdate}
* @protected
*/
async _preUpdate(changed, options, user) {
let allowed = await super._preUpdate(changed, options, user);
if ( foundry.utils.isNewerVersion(game.version, 12) ) return allowed;
if ( allowed !== false ) allowed = await this.system._preUpdate?.(changed, options, user);
return allowed;
}

/* -------------------------------------------- */

/**
* Perform preliminary operations before a Document of this type is deleted.
* Pre-delete operations only occur for the client which requested the operation.
* @param {object} options Additional options which modify the deletion request
* @param {documents.BaseUser} user The User requesting the document deletion
* @returns {Promise<boolean|void>} A return value of false indicates the deletion operation should be cancelled.
* @see {Document#_preDelete}
* @protected
*/
async _preDelete(options, user) {
let allowed = await super._preDelete(options, user);
if ( foundry.utils.isNewerVersion(game.version, 12) ) return allowed;
if ( allowed !== false ) allowed = await this.system._preDelete?.(options, user);
return allowed;
}

/* -------------------------------------------- */

/**
* Perform follow-up operations after a Document of this type is created.
* Post-creation operations occur for all clients after the creation is broadcast.
* @param {object} data The initial data object provided to the document creation request
* @param {object} options Additional options which modify the creation request
* @param {string} userId The id of the User requesting the document update
* @see {Document#_onCreate}
* @protected
*/
_onCreate(data, options, userId) {
super._onCreate(data, options, userId);
if ( foundry.utils.isNewerVersion(game.version, 12) ) return;
this.system._onCreate?.(data, options, userId);
}

/* -------------------------------------------- */

/**
* Perform follow-up operations after a Document of this type is updated.
* Post-update operations occur for all clients after the update is broadcast.
* @param {object} changed The differential data that was changed relative to the documents prior values
* @param {object} options Additional options which modify the update request
* @param {string} userId The id of the User requesting the document update
* @see {Document#_onUpdate}
* @protected
*/
_onUpdate(changed, options, userId) {
super._onUpdate(changed, options, userId);
if ( foundry.utils.isNewerVersion(game.version, 12) ) return;
this.system._onUpdate?.(changed, options, userId);
}

/* -------------------------------------------- */

/**
* Perform follow-up operations after a Document of this type is deleted.
* Post-deletion operations occur for all clients after the deletion is broadcast.
* @param {object} options Additional options which modify the deletion request
* @param {string} userId The id of the User requesting the document update
* @see {Document#_onDelete}
* @protected
*/
_onDelete(options, userId) {
super._onDelete(options, userId);
if ( foundry.utils.isNewerVersion(game.version, 12) ) return;
this.system._onDelete?.(options, userId);
}
};

0 comments on commit 527b296

Please sign in to comment.