Last active
June 22, 2021 14:38
-
-
Save mohamedali-s-4725/8943e2f757e259b0c19aecf94bb19b34 to your computer and use it in GitHub Desktop.
Menu
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
resource_permission: function(){ | |
return Ember.Object.create({ | |
can_access_comment: true, | |
can_read_files: true, | |
can_edit_files: true, | |
can_update_files: true, | |
can_remove_share: true, | |
can_share: true, | |
can_trash: true, | |
can_delete_files: true, | |
can_move: true, | |
can_download: true | |
}); | |
}.property(), | |
files: function(){ | |
return []; | |
}.property(), | |
files_count: function(){ | |
return 0; | |
}.property(), | |
file_permissions: function(){ | |
return []; | |
}.property(), | |
mouseMove(){ | |
this.$('.capabilities').show(); | |
}, | |
mouseLeave(){ | |
this.$('.capabilities').hide(); | |
}, | |
actions:{ | |
changePermission( permission ){ | |
this.toggleProperty( permission ); | |
}, | |
fileClicked( permission, id ){ | |
let files = this.get( 'files' ), | |
file_permissions = this.get( 'file_permissions' ); | |
if ( files.includes( id ) ){ | |
files.removeObject( id ); | |
file_permissions.removeObject( permission ); | |
this.decrementProperty( 'files_count' ); | |
} else { | |
files.pushObject( id ); | |
file_permissions.pushObject( permission ); | |
this.incrementProperty( 'files_count' ); | |
} | |
} | |
} | |
}); |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Controller.extend({}); |
This file contains hidden or 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
import Ember from 'ember'; | |
const { Object:object } = Ember; | |
export default Ember.Controller.extend({ | |
selected_files: 0, | |
file_permissions: [], | |
menu_object: [ | |
object.create({ 'label_name': 'Open', | |
'triggerAction': '', | |
'key': 'can_read_files' , | |
'show_on': 'single_select', | |
'action_based': false, | |
'enabled': false }), | |
object.create({ 'label_name': 'Preview', | |
'triggerAction': '', | |
'key': 'can_read_files', | |
'show_on': 'single_select', | |
'action_based': false, | |
'enabled': false }), | |
object.create({ 'label_name': 'Properties', | |
'triggerAction': '', | |
'key': 'can_read_files', | |
'show_on': 'single_select', | |
'action_based': false, | |
'enabled': false }), | |
object.create({ 'label_name': 'Share', | |
'triggerAction': '', | |
'key': 'can_share', | |
'show_on': 'multi_select', | |
'action_based': true, | |
'enabled': false }), | |
object.create({ 'label_name': 'Comment', | |
'triggerAction': '', | |
'key': 'can_access_comment', | |
'show_on': 'single_select', | |
'action_based': false, | |
'enabled': false }), | |
object.create({ 'label_name': 'Upload New Version', | |
'triggerAction': '', | |
'key': 'can_update_files', | |
'show_on': 'single_select', | |
'action_based': true, | |
'enabled': false }), | |
object.create({ 'label_name': 'Set As Favorite', | |
'triggerAction': '', | |
'key': 'set_as_favorite', | |
'show_on': 'multi_select', | |
'action_based': true, | |
'enabled': true }), | |
object.create({ 'label_name': 'Remove from Favorites', | |
'triggerAction': '', | |
'key': 'remove_favorite', | |
'show_on': 'multi_select', | |
'action_based': true, | |
'enabled': true }), | |
object.create({ 'label_name': 'Check-In', | |
'triggerAction': '', | |
'key': 'can_update_files', | |
'show_on': 'single_select', | |
'action_based': true, | |
'enabled': false }), | |
object.create({ 'label_name': 'Check-Out', | |
'triggerAction': '', | |
'key': 'can_update_files', | |
'show_on': 'single_select', | |
'action_based': true, | |
'enabled': false }), | |
object.create({ 'label_name': 'Rename', | |
'triggerAction': '', | |
'key': 'can_edit_files', | |
'show_on': 'single_select', | |
'action_based': false, | |
'enabled': false }), | |
object.create({ 'label_name': 'Copy', | |
'triggerAction': '', | |
'key': 'can_read_files', | |
'show_on': 'multi_select', | |
'action_based': false, | |
'enabled': false }), | |
object.create({ 'label_name': 'Move', | |
'triggerAction': '', | |
'key': 'can_move', | |
'show_on': 'multi_select', | |
'action_based': false, | |
'enabled': false }), | |
object.create({ 'label_name': 'Download', | |
'triggerAction': '', | |
'key': 'can_download', | |
'show_on': 'multi_select', | |
'action_based': false, | |
'enabled': false }), | |
object.create({ 'label_name': 'Zip', | |
'triggerAction': '', | |
'key': 'zip', | |
'show_on': 'multi_select_only', | |
'action_based': false, | |
'enabled': true }), | |
object.create({ 'label_name': 'Move to Trash', | |
'triggerAction': '', | |
'key': 'can_trash', | |
'show_on': 'multi_select', | |
'action_based': false, | |
'enabled': false }), | |
object.create({ 'label_name': 'Remove Share', | |
'triggerAction': '', | |
'key': 'can_remove_share', | |
'show_on': 'multi_select', | |
'action_based': true, | |
'enabled': false }) | |
] | |
}); |
This file contains hidden or 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
import Ember from 'ember'; | |
const { Object:object, Controller } = Ember; | |
export default Controller.extend({ | |
selected_files: 0, | |
file_permissions: [], | |
menu_object: [ | |
object.create({ 'label_name': 'Open', | |
'triggerAction': '', | |
'key': 'can_read_files' , | |
'show_on': 'single_select', | |
'action_based': false, | |
'enabled': false }), | |
object.create({ 'label_name': 'Preview', | |
'triggerAction': '', | |
'key': 'can_read_files', | |
'show_on': 'single_select', | |
'action_based': false, | |
'enabled': false }), | |
object.create({ 'label_name': 'Properties', | |
'triggerAction': '', | |
'key': 'can_read_files', | |
'show_on': 'single_select', | |
'action_based': false, | |
'enabled': false }), | |
object.create({ 'is_divider': true }), | |
object.create({ 'label_name': 'Share', | |
'triggerAction': '', | |
'key': 'can_share', | |
'show_on': 'multi_select', | |
'action_based': true, | |
'enabled': false }), | |
object.create({ 'label_name': 'Comment', | |
'triggerAction': '', | |
'key': 'can_access_comment', | |
'show_on': 'single_select', | |
'action_based': false, | |
'enabled': false }), | |
object.create({ 'label_name': 'Upload New Version', | |
'triggerAction': '', | |
'key': 'can_update_files', | |
'show_on': 'single_select', | |
'action_based': true, | |
'enabled': false }), | |
object.create({ 'label_name': 'Set As Favorite', | |
'triggerAction': '', | |
'key': 'set_as_favorite', | |
'show_on': 'multi_select', | |
'action_based': true, | |
'enabled': true }), | |
object.create({ 'label_name': 'Remove from Favorites', | |
'triggerAction': '', | |
'key': 'remove_favorite', | |
'show_on': 'multi_select', | |
'action_based': true, | |
'enabled': true }), | |
object.create({ 'label_name': 'Check-In', | |
'triggerAction': '', | |
'key': 'can_update_files', | |
'show_on': 'single_select', | |
'action_based': true, | |
'enabled': false }), | |
object.create({ 'label_name': 'Check-Out', | |
'triggerAction': '', | |
'key': 'can_update_files', | |
'show_on': 'single_select', | |
'action_based': true, | |
'enabled': false }), | |
object.create({ 'label_name': 'Rename', | |
'triggerAction': '', | |
'key': 'can_edit_files', | |
'show_on': 'single_select', | |
'action_based': false, | |
'enabled': false }), | |
object.create({ 'label_name': 'Copy', | |
'triggerAction': '', | |
'key': 'can_read_files', | |
'show_on': 'multi_select', | |
'action_based': false, | |
'enabled': false }), | |
object.create({ 'label_name': 'Move', | |
'triggerAction': '', | |
'key': 'can_move', | |
'show_on': 'multi_select', | |
'action_based': false, | |
'enabled': false }), | |
object.create({ 'label_name': 'Download', | |
'triggerAction': '', | |
'key': 'can_download', | |
'show_on': 'multi_select', | |
'action_based': false, | |
'enabled': false }), | |
object.create({ 'label_name': 'Zip', | |
'triggerAction': '', | |
'key': 'zip', | |
'show_on': 'multi_select_only', | |
'action_based': false, | |
'enabled': true }), | |
object.create({ 'label_name': 'Move to Trash', | |
'triggerAction': '', | |
'key': 'can_trash', | |
'show_on': 'multi_select', | |
'action_based': false, | |
'enabled': false }), | |
object.create({ 'label_name': 'Remove Share', | |
'triggerAction': '', | |
'key': 'can_remove_share', | |
'show_on': 'multi_select', | |
'action_based': true, | |
'enabled': false }) | |
] | |
}); |
This file contains hidden or 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
import Ember from 'ember'; | |
const { Object:object } = Ember; | |
export default Ember.Controller.extend({ | |
selected_files: 0, | |
file_permissions: [], | |
menu_object: [ | |
object.create({ 'label_name': 'Put back', | |
'triggerAction': '', | |
'key': 'can_delete_files', | |
'show_on': 'multi_select', | |
'action_based': false, | |
'enabled': true | |
}), | |
object.create({ 'label_name': 'Delete Forever', | |
'triggerAction': '', | |
'key': 'can_delete_files' , | |
'show_on': 'multi_select', | |
'action_based': false, | |
'enabled': true | |
}) | |
] | |
}); |
This file contains hidden or 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
import Ember from 'ember'; | |
import config from './config/environment'; | |
const Router = Ember.Router.extend({ | |
location: 'none', | |
rootURL: config.rootURL | |
}); | |
Router.map(function() { | |
this.route( 'folders' ); | |
this.route( 'favorites' ); | |
this.route( 'trash' ); | |
}); | |
export default Router; |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
afterModel(){ | |
this.transitionTo( 'folders' ); | |
} | |
}); |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
actions:{ | |
willTransition(){ | |
this.controller.set( 'selected_files', 0 ); | |
this.controller.set( 'file_permissions', [] ); | |
} | |
} | |
}); |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
actions:{ | |
willTransition(){ | |
this.controller.set( 'selected_files', 0 ); | |
this.controller.set( 'file_permissions', [] ); | |
} | |
} | |
}); |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
actions:{ | |
willTransition(){ | |
this.controller.set( 'selected_files', 0 ); | |
this.controller.set( 'file_permissions', [] ); | |
} | |
} | |
}); |
This file contains hidden or 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
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
.menu-container{ | |
width: 40%; | |
float: left; | |
} | |
.menu{ | |
border: solid 1px; | |
padding: 10px 10px 10px 10px; | |
float: left; | |
margin-left: 5px; | |
} | |
.menu .item{ | |
padding: 3px; | |
} | |
.options{ | |
float: left; | |
margin: 5px 25px; | |
} | |
.options .file{ | |
width: 120px; | |
border: solid 1px; | |
padding: 2px 15px; | |
font-size: 12px; | |
margin: 8px; | |
} | |
.options .selection { | |
float: left; | |
margin: 5px 0px 0px -10px; | |
} | |
.options .capabilities{ | |
position: absolute; | |
display: none; | |
margin: -28px 0px 0px 166px; | |
width: 130px; | |
overflow: scroll; | |
max-height: 120px; | |
border: solid 1px; | |
font-size: 13px; | |
} | |
.capabilities .arrow{ | |
position: fixed; | |
border-top: 6px solid transparent; | |
border-right: 7px solid black; | |
border-bottom: 6px solid transparent; | |
margin-left: -7px; | |
float:left; | |
} | |
.capabilities .permission{ | |
margin: 7px 10px 7px 10px; | |
} | |
.capabilities .permission:hover{ | |
color: blue; | |
} | |
.capabilities .per-ch{ | |
float: left; | |
margin: 0px 8px 0px 10px; | |
} | |
.route{ | |
display: inline-block; | |
margin-right: 25px; | |
} | |
a{ | |
color: black; | |
text-decoration: none; | |
font-style: italic; | |
} | |
.route .active{ | |
background: lightgray; | |
padding: 3px 25px; | |
font-weight: bold; | |
font-style: normal; | |
} |
This file contains hidden or 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
{ | |
"version": "0.10.6", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.9.0", | |
"ember-data": "2.9.0", | |
"ember-template-compiler": "2.9.0", | |
"ember-testing": "2.9.0" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment