1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 10:39:25 +02:00

Added Chat (disabled for now).

This commit is contained in:
Gunther Brunner 2014-06-19 16:59:25 +09:00
parent c1adb9087a
commit af6fa9fe29
11 changed files with 135 additions and 4 deletions

View file

@ -31,3 +31,13 @@
width: 860px;
}
.modal-size-80p .modal-dialog {
width: 80%;
height: 100%;
/*max-height: 800px;*/
}
.modal-size-80p .modal-body {
height: 100%;
max-height: 800px;
}

View file

@ -0,0 +1,11 @@
describe('VersionUpdateService', function() {
beforeEach(module('stf.version-update'));
it('should ...', inject(function(VersionUpdateService) {
//expect(FatalMessageService.doSomething()).toEqual('something');
}));
})

View file

@ -0,0 +1,3 @@
.stf-external-url-modal {
}

View file

@ -0,0 +1,8 @@
.stf-external-url-modal.stf-modal
.modal-header
button(type='button', ng-click='cancel()').close ×
h4.modal-title(ng-show='title')
i.fa.fa-fw(ng-class='icon')
span(ng-bind='title')
.modal-body
iframe(ng-src='{{url}}', width='100%', height='100%', frameborder='0')

View file

@ -0,0 +1,43 @@
module.exports = function ServiceFactory($modal, $sce) {
var service = {}
var ModalInstanceCtrl = function ($scope, $modalInstance, url, title, icon) {
$scope.ok = function () {
$modalInstance.close(true)
}
$scope.url = $sce.trustAsResourceUrl(url)
$scope.title = title
$scope.icon = icon
$scope.cancel = function () {
$modalInstance.dismiss('cancel')
}
}
service.open = function (url, title, icon) {
var modalInstance = $modal.open({
template: require('./external-url-modal.jade'),
controller: ModalInstanceCtrl,
// size: 'lg',
windowClass: 'modal-size-80p',
resolve: {
title: function() {
return title
},
url: function () {
return url
},
icon: function () {
return icon
}
}
})
modalInstance.result.then(function () {
}, function () {
})
}
return service
}

View file

@ -0,0 +1,7 @@
require('./external-url-modal.css')
module.exports = angular.module('stf.external-url-modal', [
require('stf/common-ui/modals/common').name
])
.factory('ExternalUrlModalService', require('./external-url-modal'))
.directive('onLoadEvent', require('./on-load-event-directive'))

View file

@ -0,0 +1,10 @@
// TODO: Test this
module.exports = function () {
return function (scope, element, attrs) {
scope.$watch(attrs.pageVisible, function () {
element.bind('load', function () {
scope.$apply(attrs.pageLoad)
})
})
}
}

View file

@ -2,7 +2,8 @@ require('./menu.css')
module.exports = angular.module('stf.menu', [
require('stf/nav-menu').name,
require('stf/settings').name
require('stf/settings').name,
require('stf/common-ui/modals/external-url-modal').name
])
.controller('MenuCtrl', require('./menu-controller'))
.run(["$templateCache", function ($templateCache) {

View file

@ -1,4 +1,4 @@
module.exports = function MenuCtrl($scope, $rootScope, SettingsService, $location) {
module.exports = function MenuCtrl($scope, $rootScope, SettingsService, $location, ExternalUrlModalService) {
$rootScope.platform = 'native'
SettingsService.bind($rootScope, {
key: 'platform',
@ -8,4 +8,9 @@ module.exports = function MenuCtrl($scope, $rootScope, SettingsService, $locatio
$scope.$on('$routeChangeSuccess', function () {
$scope.isControlRoute = $location.path().search('/control') !== -1
})
$scope.openChat = function () {
var hipChatUrl = 'https://cyberagent.hipchat.com/chat?focus_jid=44808_stf@conf.hipchat.com&minimal=true'
ExternalUrlModalService.open(hipChatUrl, 'HipChat #STF', 'fa-comment')
}
}

View file

@ -1,7 +1,7 @@
.navbar.stf-menu(ng-controller='MenuCtrl')
.container-fluid.stf-top-bar
a.stf-logo(href="/") STF 2
ul.nav.stf-nav(nav-menu='current')
ul.nav.stf-nav(nav-menu='current').unselectable
li(ng-cloak)
a(ng-href='/#!/control', ng-click='$event.preventDefault()').cursor
span.fa.fa-mobile
@ -12,11 +12,15 @@
a(ng-href='/#!/settings')
span.fa.fa-gears
| {{ !$root.basicMode ? "Settings" : '' | translate }}
ul.nav.stf-nav.stf-feedback.pull-right(ng-cloak)
ul.nav.stf-nav.stf-feedback.pull-right(ng-cloak).unselectable
li.stf-nav-web-native-button(ng-if='!$root.basicMode && isControlRoute')
.btn-group
button(type='button', ng-model='$root.platform', btn-radio="'web'", translate).btn.btn-sm.btn-default-outline Web
button(type='button', ng-model='$root.platform', btn-radio="'native'", translate).btn.btn-sm.btn-default-outline Native
//li(ng-if='!$root.basicMode')
a(ng-click='openChat()').pointer
i.fa.fa-comment.fa-fw
| {{ "Chat" | translate }}
li(ng-if='!$root.basicMode')
a(ng-href='/#!/help')
i.fa.fa-question-circle.fa-fw

View file

@ -12,6 +12,10 @@ msgstr ""
msgid "-"
msgstr ""
#: /Users/a12907/STF/stf/tmp/html/app/components/stf/common-ui/modals/version-update/version-update.html
msgid "A new version of STF is available"
msgstr ""
#: /Users/a12907/STF/stf/tmp/html/app/device-list/device-list.html
#: /Users/a12907/STF/stf/tmp/html/app/control-panes/info/info.html
msgid "ABI"
@ -258,6 +262,10 @@ msgstr ""
msgid "Device cannot get kicked from the group"
msgstr ""
#: /Users/a12907/STF/stf/tmp/html/app/components/stf/common-ui/modals/fatal-message/fatal-message.html
msgid "Device was disconnected"
msgstr ""
#: /Users/a12907/STF/stf/tmp/html/app/device-list/device-list.html
msgid "Devices"
msgstr ""
@ -384,6 +392,10 @@ msgstr ""
msgid "Go Forward"
msgstr ""
#: /Users/a12907/STF/stf/tmp/html/app/components/stf/common-ui/modals/fatal-message/fatal-message.html
msgid "Go to Device List"
msgstr ""
#: /Users/a12907/STF/stf/res/build/bundle.js
#: /Users/a12907/STF/stf/res/app/components/stf/device/device-info-filter/index.js
msgid "Good"
@ -595,6 +607,10 @@ msgstr ""
msgid "No devices connected"
msgstr ""
#: /Users/a12907/STF/stf/tmp/html/app/components/stf/common-ui/modals/lightbox-image/lightbox-image.html
msgid "No photo available"
msgstr ""
#: /Users/a12907/STF/stf/tmp/html/app/control-panes/screenshots/screenshots.html
msgid "No screenshots taken"
msgstr ""
@ -782,6 +798,7 @@ msgid "Released"
msgstr ""
#: /Users/a12907/STF/stf/tmp/html/app/control-panes/dashboard/navigation/navigation.html
#: /Users/a12907/STF/stf/tmp/html/app/components/stf/common-ui/modals/version-update/version-update.html
msgid "Reload"
msgstr ""
@ -965,6 +982,10 @@ msgstr ""
msgid "Total devices"
msgstr ""
#: /Users/a12907/STF/stf/tmp/html/app/components/stf/common-ui/modals/fatal-message/fatal-message.html
msgid "Try to reconnect"
msgstr ""
#: /Users/a12907/STF/stf/tmp/html/app/control-panes/info/info.html
msgid "Type"
msgstr ""
@ -1046,6 +1067,10 @@ msgstr ""
msgid "Version"
msgstr ""
#: /Users/a12907/STF/stf/tmp/html/app/components/stf/common-ui/modals/version-update/version-update.html
msgid "Version Update"
msgstr ""
#: /Users/a12907/STF/stf/tmp/html/app/control-panes/info/info.html
msgid "Voltage"
msgstr ""
@ -1101,3 +1126,7 @@ msgstr ""
#: /Users/a12907/STF/stf/res/app/components/stf/device/device-info-filter/index.js
msgid "Yes"
msgstr ""
#: /Users/a12907/STF/stf/tmp/html/app/components/stf/common-ui/modals/fatal-message/fatal-message.html
msgid "You are no longer controlling the device."
msgstr ""