-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
1,358 additions
and
266 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
width: 48px; | ||
height: 48px; | ||
|
||
&.clickable { | ||
&.clickable:not(.avatar--error) { | ||
cursor: pointer; | ||
} | ||
} | ||
|
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
65 changes: 65 additions & 0 deletions
65
src/client/modules/main/addons/playerEvent/playerEventImageWipe/PlayerEventImageWipe.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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { Elem, Txt, Html } from 'modapp-base-component'; | ||
import l10n from 'modapp-l10n'; | ||
|
||
const imageTxt = { | ||
title: l10n.l('playerEventImageWipe.imageRemoved', "Image removed"), | ||
default: l10n.l('playerEventImageWipe.imageRemovedInfo', "An image has been removed:"), | ||
target: { | ||
char: l10n.l('playerEventImageWipe.charImageRemovedInfo', "An image has been removed from your character:"), | ||
room: l10n.l('playerEventImageWipe.roomImageRemovedInfo', "An image has been removed from your room:"), | ||
area: l10n.l('playerEventImageWipe.areaImageRemovedInfo', "An image has been removed from your area:"), | ||
}, | ||
}; | ||
const avatarTxt = { | ||
title: l10n.l('playerEventImageWipe.avatarRemoved', "Avatar removed"), | ||
default: l10n.l('playerEventImageWipe.avatarRemovedInfo', "An avatar has been removed:"), | ||
target: { | ||
char: l10n.l('playerEventImageWipe.charAvatarRemovedInfo', "An avatar has been removed from your character:"), | ||
// room: l10n.l('playerEventImageWipe.roomAvatarRemovedInfo', "An avatar has been removed from your room:"), | ||
// area: l10n.l('playerEventImageWipe.areaAvatarRemovedInfo', "An avatar has been removed from your area:"), | ||
}, | ||
}; | ||
|
||
const moreInfoTxt = l10n.l('playerEventImageWipe.moreInfo', `<div class="pad-bottom-m">If you have questions or objections, get in contact with the moderator team. Type:</div>` + | ||
`<div class="charlog--code"><code>help helpme</code></div>`); | ||
|
||
/** | ||
* PlayerEventImageWipe registers the imageWipe playerEvent handler. | ||
*/ | ||
class PlayerEventImageWipe { | ||
constructor(app, params) { | ||
this.app = app; | ||
|
||
// Bind callbacks | ||
this._handleEvent = this._handleEvent.bind(this); | ||
|
||
this.app.require([ 'playerEvent', 'toaster' ], this._init.bind(this)); | ||
} | ||
|
||
_init(module) { | ||
this.module = module; | ||
|
||
this.module.playerEvent.addHandler('imageWipe', this._handleEvent); | ||
} | ||
|
||
_handleEvent(ev, onClose) { | ||
let txt = ev.avatar ? avatarTxt : imageTxt; | ||
let info = txt.target[ev.target] || txt.default; | ||
return this.module.toaster.open({ | ||
title: txt.title, | ||
content: close => new Elem(n => n.elem('div', [ | ||
n.component(new Txt(info, { tagName: 'p' })), | ||
n.component(new Txt(ev.name, { tagName: 'p', className: 'dialog--strong dialog--large' })), | ||
n.component(new Html(moreInfoTxt, { tagName: 'div', className: 'common--sectionpadding' })), | ||
])), | ||
closeOn: 'click', | ||
onClose, | ||
}); | ||
} | ||
|
||
dispose() { | ||
this.module.playerEvent.removeHandler('imageWipe'); | ||
} | ||
} | ||
|
||
export default PlayerEventImageWipe; |
Oops, something went wrong.