-
Notifications
You must be signed in to change notification settings - Fork 1
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
23 changed files
with
594 additions
and
19 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
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
61 changes: 53 additions & 8 deletions
61
...esome-4.2.0/fonts/fontawesome-webfont.svg → ...esome-4.3.0/fonts/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed
BIN
+110 KB
...esome-4.2.0/fonts/fontawesome-webfont.ttf → ...esome-4.3.0/fonts/fontawesome-webfont.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,46 @@ | ||
SkeletonApp.module 'Common', (Common, SkeletonApp, Backbone, Marionette, $, _) -> | ||
|
||
# Define the View for a Modal Dialog | ||
class Common.DialogView extends Backbone.Marionette.ItemView | ||
|
||
defaultOptions = | ||
title: 'Confirm' | ||
body: 'Click OK to confirm.' | ||
buttons: [ | ||
title: 'Cancel' | ||
triggerName: 'cancel' | ||
dismiss: true | ||
, | ||
title: 'OK' | ||
triggerName: 'ok' | ||
class: 'btn-primary' | ||
] | ||
|
||
template: 'dialog' | ||
|
||
className: 'modal fade' | ||
|
||
ui: | ||
dialogButton: '.js-dialog-button' | ||
|
||
events: | ||
'click @ui.dialogButton': 'onButtonClicked' | ||
|
||
initialize: (opts) -> | ||
logger.debug "DialogView.initialize" | ||
@options = _.defaults {}, opts, defaultOptions | ||
|
||
serializeData: -> | ||
@options | ||
|
||
onShow: -> | ||
@$el.modal 'show' | ||
|
||
onHide: -> | ||
@$el.modal 'hide' | ||
|
||
onButtonClicked: (e) -> | ||
logger.debug "DialogView.onButtonClicked" | ||
e.preventDefault() | ||
triggerName = $(e.target).attr 'data-trigger' | ||
@triggerMethod triggerName |
32 changes: 32 additions & 0 deletions
32
src/main/app/coffee/modules/features/FeatureController.coffee
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,32 @@ | ||
SkeletonApp.module 'Feature', (Feature, SkeletonApp, Backbone, Marionette, $, _) -> | ||
|
||
# Define the Router for the Feature module | ||
class FeatureRouter extends Marionette.AppRouter | ||
|
||
appRoutes: | ||
'features/dialog': 'showDialogFeature' | ||
|
||
# Define the Controller for the Feature module | ||
class FeatureController extends Marionette.Controller | ||
|
||
showDialogFeature: -> | ||
logger.debug "FeatureController.showDialogFeature" | ||
controller = new Feature.Dialog.Controller | ||
controller.show() | ||
|
||
|
||
# Create an instance | ||
controller = new FeatureController | ||
|
||
|
||
# When the module is initialized... | ||
Feature.addInitializer -> | ||
logger.debug "Content initializer" | ||
router = new FeatureRouter | ||
controller: controller | ||
|
||
|
||
# Handle Application Messaging | ||
SkeletonApp.commands.setHandler 'feature:dialog:show', -> | ||
SkeletonApp.navigate 'features/dialog' | ||
controller.showDialogFeature() |
51 changes: 51 additions & 0 deletions
51
src/main/app/coffee/modules/features/dialog/DialogFeatureController.coffee
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,51 @@ | ||
SkeletonApp.module 'Feature.Dialog', (Dialog, SkeletonApp, Backbone, Marionette, $, _) -> | ||
|
||
# Define the Controller for the Content module | ||
class Dialog.Controller extends Marionette.Controller | ||
|
||
show: -> | ||
logger.debug "Dialog.Controller.show" | ||
view = new Dialog.FeatureView | ||
|
||
view.on 'dialog:show', -> | ||
dialogView = new SkeletonApp.Common.DialogView | ||
|
||
dialogView.on 'ok', -> | ||
logger.debug "Handling 'ok' dialog event" | ||
dialogView.triggerMethod 'hide' | ||
# Execute 'OK' logic | ||
|
||
dialogView.on 'cancel', -> | ||
logger.debug "Handling 'cancel' dialog event" | ||
dialogView.triggerMethod 'hide' | ||
# Execute 'Cancel' logic, if any | ||
|
||
SkeletonApp.dialogRegion.show dialogView | ||
|
||
view.on 'dialog:custom:show', -> | ||
dialogView = new SkeletonApp.Common.DialogView | ||
title: 'Terms and Conditions' | ||
body: 'Click ACCEPT to accept the terms and conditions.' | ||
buttons: [ | ||
title: 'Cancel' | ||
triggerName: 'cancel' | ||
dismiss: true | ||
, | ||
title: 'Accept' | ||
triggerName: 'accept' | ||
class: 'btn-success' | ||
] | ||
|
||
dialogView.on 'accept', -> | ||
logger.debug "Handling 'accept' dialog event" | ||
dialogView.triggerMethod 'hide' | ||
# Execute 'Accept' logic | ||
|
||
dialogView.on 'cancel', -> | ||
logger.debug "Handling 'cancel' dialog event" | ||
dialogView.triggerMethod 'hide' | ||
# Execute 'Cancel' logic, if any | ||
|
||
SkeletonApp.dialogRegion.show dialogView | ||
|
||
SkeletonApp.contentRegion.show view |
15 changes: 15 additions & 0 deletions
15
src/main/app/coffee/modules/features/dialog/DialogFeatureViews.coffee
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,15 @@ | ||
SkeletonApp.module 'Feature.Dialog', (Dialog, SkeletonApp, Backbone, Marionette, $, _) -> | ||
|
||
class Dialog.FeatureView extends Backbone.Marionette.ItemView | ||
|
||
template: 'featuredialog' | ||
|
||
className: 'container' | ||
|
||
ui: | ||
dialogButton: '.js-dialog' | ||
customDialogButton: '.js-dialog-alt' | ||
|
||
triggers: | ||
'click @ui.dialogButton': 'dialog:show' | ||
'click @ui.customDialogButton': 'dialog:custom:show' |
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
Oops, something went wrong.