-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BXC-4061 updating facet constants and adding handling for events
- Loading branch information
Sharon Luong
committed
Oct 12, 2023
1 parent
0216755
commit 08060d3
Showing
6 changed files
with
111 additions
and
6 deletions.
There are no files selected for viewing
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
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,43 @@ | ||
define('AssignAsThumbnailAction', [ 'jquery', 'AjaxCallbackAction'], function($, AjaxCallbackAction) { | ||
|
||
function AssignAsThumbnailAction(context) { | ||
this._create(context); | ||
}; | ||
|
||
AssignAsThumbnailAction.prototype.constructor = AssignAsThumbnailAction; | ||
AssignAsThumbnailAction.prototype = Object.create( AjaxCallbackAction.prototype ); | ||
|
||
AssignAsThumbnailAction.prototype._create = function(context) { | ||
this.context = context; | ||
|
||
var options = { | ||
workMethod: "PUT", | ||
workPath: "/services/api/edit/assignThumbnail/{idPath}", | ||
workLabel: "Setting as assigned thumbnail...", | ||
followupLabel: "Setting as assigned thumbnail...", | ||
followupPath: "/services/api/status/item/{idPath}/solrRecord/version" | ||
} | ||
|
||
if ('confirm' in this.context && !this.context.confirm) { | ||
options.confirm = false; | ||
} else { | ||
options.confirm = { | ||
promptText : "Use this as the assigned thumbnail for its parent?", | ||
confirmAnchor : this.context.confirmAnchor | ||
}; | ||
} | ||
|
||
AjaxCallbackAction.prototype._create.call(this, options); | ||
}; | ||
|
||
AssignAsThumbnailAction.prototype.completeState = function() { | ||
this.context.actionHandler.addEvent({ | ||
action : 'RefreshResult', | ||
target : this.context.target | ||
}); | ||
this.alertHandler.alertHandler("success", "Assignment of object \"" + this.context.target.metadata.title + "\" as the assigned thumbnail has completed."); | ||
this.context.target.enable(); | ||
}; | ||
|
||
return AssignAsThumbnailAction; | ||
}); |
43 changes: 43 additions & 0 deletions
43
static/js/admin/src/action/ClearAssignedThumbnailAction.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,43 @@ | ||
define('ClearAssignedThumbnailAction', [ 'jquery', 'AjaxCallbackAction'], function($, AjaxCallbackAction) { | ||
|
||
function ClearAssignedThumbnailAction(context) { | ||
this._create(context); | ||
}; | ||
|
||
ClearAssignedThumbnailAction.prototype.constructor = ClearAssignedThumbnailAction; | ||
ClearAssignedThumbnailAction.prototype = Object.create( AjaxCallbackAction.prototype ); | ||
|
||
ClearAssignedThumbnailAction.prototype._create = function(context) { | ||
this.context = context; | ||
|
||
var options = { | ||
workMethod: "PUT", | ||
workPath: "/services/api/edit/deleteThumbnail/{idPath}", | ||
workLabel: "Clearing assigned thumbnail...", | ||
followupLabel: "Clearing assigned thumbnail...", | ||
followupPath: "/services/api/status/item/{idPath}/solrRecord/version" | ||
} | ||
|
||
if ('confirm' in this.context && !this.context.confirm) { | ||
options.confirm = false; | ||
} else { | ||
options.confirm = { | ||
promptText : "Clear the assigned thumbnail?", | ||
confirmAnchor : this.context.confirmAnchor | ||
}; | ||
} | ||
|
||
AjaxCallbackAction.prototype._create.call(this, options); | ||
}; | ||
|
||
ClearAssignedThumbnailAction.prototype.completeState = function() { | ||
this.context.actionHandler.addEvent({ | ||
action : 'RefreshResult', | ||
target : this.context.target | ||
}); | ||
this.alertHandler.alertHandler("success", "Cleared the assigned thumbnail."); | ||
this.context.target.enable(); | ||
}; | ||
|
||
return ClearAssignedThumbnailAction; | ||
}); |