mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-05 16:35:10 +00:00
(js,html) View raw source of components
This commit is contained in:
@@ -43,6 +43,19 @@
|
||||
</md-menu-item>
|
||||
</md-menu-content>
|
||||
</md-menu>
|
||||
<md-menu>
|
||||
<md-button label:aria-label="More options" class="sg-icon-button" ng-click="$mdOpenMenu($event)">
|
||||
<md-icon>more_vert</md-icon>
|
||||
</md-button>
|
||||
<md-menu-content>
|
||||
<md-menu-item>
|
||||
<md-button label:aria-label="View Raw Source"
|
||||
ng-click="editor.viewRawSource($event)">
|
||||
<var:string label:value="View Raw Source"/>
|
||||
</md-button>
|
||||
</md-menu-item>
|
||||
</md-menu-content>
|
||||
</md-menu>
|
||||
<md-button class="md-icon-button" ng-click="editor.close()">
|
||||
<md-icon label:aria-label="Close">close</md-icon>
|
||||
</md-button>
|
||||
|
||||
@@ -43,6 +43,19 @@
|
||||
</md-menu-item>
|
||||
</md-menu-content>
|
||||
</md-menu>
|
||||
<md-menu>
|
||||
<md-button label:aria-label="More options" class="sg-icon-button" ng-click="$mdOpenMenu($event)">
|
||||
<md-icon>more_vert</md-icon>
|
||||
</md-button>
|
||||
<md-menu-content>
|
||||
<md-menu-item>
|
||||
<md-button label:aria-label="View Raw Source"
|
||||
ng-click="editor.viewRawSource($event)">
|
||||
<var:string label:value="View Raw Source"/>
|
||||
</md-button>
|
||||
</md-menu-item>
|
||||
</md-menu-content>
|
||||
</md-menu>
|
||||
<md-button class="md-icon-button" ng-click="editor.close()">
|
||||
<md-icon label:aria-label="Close">close</md-icon>
|
||||
</md-button>
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
vm.replyAllOccurrences = replyAllOccurrences;
|
||||
vm.deleteOccurrence = deleteOccurrence;
|
||||
vm.deleteAllOccurrences = deleteAllOccurrences;
|
||||
vm.viewRawSource = viewRawSource;
|
||||
|
||||
// Load all attributes of component
|
||||
if (angular.isUndefined(vm.component.$futureComponentData)) {
|
||||
@@ -104,7 +105,41 @@
|
||||
$mdDialog.hide();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function viewRawSource($event) {
|
||||
Calendar.$$resource.post(vm.component.pid + '/' + vm.component.id, "raw").then(function(data) {
|
||||
$mdDialog.show({
|
||||
parent: angular.element(document.body),
|
||||
targetEvent: $event,
|
||||
clickOutsideToClose: true,
|
||||
escapeToClose: true,
|
||||
template: [
|
||||
'<md-dialog flex="80" flex-sm="100" aria-label="' + l('View Raw Source') + '">',
|
||||
' <md-dialog-content>',
|
||||
' <pre>',
|
||||
data,
|
||||
' </pre>',
|
||||
' </md-dialog-content>',
|
||||
' <div class="md-actions">',
|
||||
' <md-button ng-click="close()">' + l('Close') + '</md-button>',
|
||||
' </div>',
|
||||
'</md-dialog>'
|
||||
].join(''),
|
||||
controller: ComponentRawSourceDialogController
|
||||
});
|
||||
|
||||
/**
|
||||
* @ngInject
|
||||
*/
|
||||
ComponentRawSourceDialogController.$inject = ['scope', '$mdDialog'];
|
||||
function ComponentRawSourceDialogController(scope, $mdDialog) {
|
||||
scope.close = function() {
|
||||
$mdDialog.hide();
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @ngInject
|
||||
@@ -120,6 +155,7 @@
|
||||
vm.toggleRecurrenceEditor = toggleRecurrenceEditor;
|
||||
vm.showAttendeesEditor = angular.isDefined(vm.component.attendees);
|
||||
vm.toggleAttendeesEditor = toggleAttendeesEditor;
|
||||
//vm.searchText = null;
|
||||
vm.cardFilter = cardFilter;
|
||||
vm.addAttendee = addAttendee;
|
||||
vm.addAttachUrl = addAttachUrl;
|
||||
|
||||
Reference in New Issue
Block a user