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

Cleanup code for stf components.

This commit is contained in:
Gunther Brunner 2015-08-31 15:58:32 +09:00
parent 7ddd464ac3
commit bd493b210b
29 changed files with 3 additions and 189 deletions

View file

@ -40,10 +40,3 @@ div[angular-packery]:after {
width: 100%;
}
}
.packery-item.is-dragging,
.packery-item.is-positioning-post-drag {
/*border-color: red;*/
/*background: #09F;*/
/*z-index: 2;*/
}

View file

@ -2,7 +2,7 @@ module.exports = function basicModeDirective($rootScope, BrowserInfo) {
return {
restrict: 'AE',
link: function (scope, element) {
$rootScope.basicMode = !!BrowserInfo.mobile // CHECK: use .mobile instead of .small
$rootScope.basicMode = !!BrowserInfo.mobile
if ($rootScope.basicMode) {
element.addClass('basic-mode')
}

View file

@ -1,7 +1,3 @@
.basic-mode {
/*background: red;*/
}
.basic-mode .devices-icon-view {
padding: 0;
}
@ -10,11 +6,6 @@
margin: 3px;
}
.basic-mode .stf-vnc-bottom .btn-lg {
/*padding: 5px;*/
/*font-size: 12px;*/
}
.basic-mode .stf-vnc-bottom .btn-primary:hover,
.basic-mode .stf-vnc-bottom .btn-primary.active {
background: #007aff;
@ -27,8 +18,6 @@
.basic-mode .basic-remote-control {
width: 100%;
/*width: 320px;*/
/*height: 485px;*/
}
.basic-mode .stf-device-list .device-search {

View file

@ -29,8 +29,6 @@ module.exports = function BrowserInfoServiceFactory() {
var windowWidth = window.screen.width < window.outerWidth ?
window.screen.width : window.outerWidth
return windowWidth < 800
// return !!(window.matchMedia &&
// window.matchMedia('only screen and (max-width: 760px)').matches)
})
addTest('mobile', function () {
@ -59,38 +57,6 @@ module.exports = function BrowserInfoServiceFactory() {
addTest('ua', navigator.userAgent)
//function hasEvent() {
// return (function (undefined) {
// function isEventSupportedInner(eventName, element) {
// var isSupported
// if (!eventName) {
// return false
// }
// if (!element || typeof element === 'string') {
// element = createElement(element || 'div')
// }
// eventName = 'on' + eventName
// isSupported = eventName in element
// return isSupported
// }
//
// return isEventSupportedInner
// })()
//}
// var domPrefixes = 'Webkit Moz O ms'.toLowerCase().split(' ')
// addTest('pointerevents', function () {
// var bool = false
// var i = domPrefixes.length
// bool = hasEvent('pointerdown')
// while (i-- && !bool) {
// if (hasEvent(domPrefixes[i] + 'pointerdown')) {
// bool = true
// }
// }
// return bool
// })
addTest('devicemotion', 'DeviceMotionEvent' in window)
addTest('deviceorientation', 'DeviceOrientationEvent' in window)

View file

@ -1,3 +1,2 @@
div.stf-badge-icon
//i.fa.fa-warning.stf-badge-icon-warning(popover='I appeared on mouse enter!', popover-placement='bottom', popover-trigger='mouseenter')
i.fa.fa-warning.stf-badge-icon-warning(tooltip-placement='bottom', tooltip='An error has ocurred')

View file

@ -3,8 +3,6 @@ module.exports = function counterDirective($timeout) {
replace: false,
scope: true,
link: function (scope, element, attrs) {
// TODO: use $$rAF later
var el = element[0]
var num, refreshInterval, duration, steps, step, countTo, increment

View file

@ -1,5 +1,3 @@
require('./help-icon.css')
module.exports = function clearButtonDirective() {
return {
restrict: 'EA',

View file

@ -8,7 +8,6 @@ module.exports = angular.module('stf/common-ui', [
require('./notifications').name,
require('./ng-enter').name,
require('./tooltips').name,
//require('./tree').name,
require('./modals').name,
require('./include-cached').name,
require('./text-focus-select').name,

View file

@ -1,5 +1,4 @@
module.exports = angular.module('stf.add-adb-key-modal', [
require('stf/common-ui/modals/common').name,
//require('stf/keys/add-adb-key').name
require('stf/common-ui/modals/common').name
])
.factory('AddAdbKeyModalService', require('./add-adb-key-modal-service'))

View file

@ -1,5 +1,3 @@
//require('angular-dialog-service/dialogs')
//require('angular-dialog-service/dialogs.css')
require('./modals.css')
module.exports = angular.module('stf.modals.common', [

View file

@ -50,7 +50,6 @@
.modal-size-80p .modal-dialog {
width: 80%;
height: 100%;
/*max-height: 800px;*/
}
.modal-size-80p .modal-body {

View file

@ -19,7 +19,6 @@ module.exports = function ServiceFactory($modal, $sce) {
var modalInstance = $modal.open({
template: require('./external-url-modal.jade'),
controller: ModalInstanceCtrl,
// size: 'lg',
windowClass: 'modal-size-80p',
resolve: {
title: function() {

View file

@ -10,7 +10,6 @@ module.exports =
$scope.ok = function () {
$modalInstance.close(true)
$route.reload()
//$location.path('/control/' + device.serial)
}
function update() {

View file

@ -18,7 +18,7 @@ module.exports = function ServiceFactory($modal) {
var modalInstance = $modal.open({
template: require('./lightbox-image.jade'),
controller: ModalInstanceCtrl,
windowClass: 'modal-size-xl', // TODO: Make width dynamic adjusting
windowClass: 'modal-size-xl',
resolve: {
title: function() {
return title

View file

@ -7,4 +7,3 @@
.modal-body
img(ng-if='imageUrl', ng-src='{{imageUrl}}')
nothing-to-show(message='{{"No photo available"|translate}}', icon='fa-picture-o', ng-if='!imageUrl')
// TODO: replace !imageUrl here with a image-not-available='imageIsNotPresent = true' directive

View file

@ -1,6 +0,0 @@
require('./native-autocomplete.css')
module.exports = angular.module('stf.native-autocomplete', [
])
.directive('nativeAutocomplete', require('./native-autocomplete-directive'))

View file

@ -1,13 +0,0 @@
module.exports = function nativeAutocompleteDirective() {
return {
restrict: 'E',
replace: true,
scope: {
},
template: require('./native-autocomplete.jade'),
link: function (scope, element, attrs) {
}
}
}

View file

@ -1,23 +0,0 @@
describe('nativeAutocomplete', function () {
beforeEach(angular.mock.module(require('./').name));
var scope, compile;
beforeEach(inject(function ($rootScope, $compile) {
scope = $rootScope.$new();
compile = $compile;
}));
it('should ...', function () {
/*
To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results.
var element = compile('<div native-autocomplete name="name">hi</div>')(scope);
expect(element.text()).toBe('hello, world');
*/
});
});

View file

@ -1,3 +0,0 @@
.stf-native-autocomplete {
}

View file

@ -1 +0,0 @@
div.stf-native-autocomplete

View file

@ -1,7 +0,0 @@
input(
type='text',
native-autocomplete,
ng-model='text',
typeahead='["text1", "text2"]',
history='20'
)

View file

@ -3,7 +3,6 @@
top: 60px;
right: 15px;
float: right;
/*width: 320px;*/
z-index: 9999;
}

View file

@ -9,8 +9,6 @@ module.exports = function refreshPageDirective($window) {
scope.reloadWindow = function () {
$window.location.reload()
}
// TODO: reload with $route.reload()
}
}
}

View file

@ -1,6 +1,5 @@
require('./table.css')
require('script!ng-table/dist/ng-table')
//require('ng-table/ng-table.css')
module.exports = angular.module('stf/common-ui/table', [
'ngTable'

View file

@ -1,5 +1,4 @@
.ng-table th {
/*text-align: center;*/
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;

View file

@ -1,8 +0,0 @@
//require('angular-tree-control/css/tree-control.css')
//require('./tree.css')
//require('angular-tree-control')
module.exports = angular.module('stf.tree', [
// 'treeControl'
])
.factory('TreeService', require('./tree-service'))

View file

@ -1,52 +0,0 @@
module.exports = function () {
var treeService = {}
var tree = [
{name: 'glossary', children: [
{name: 'title'}
]}
]
function createTreeFromJSON(tree, json) {
(function updateRecursive(item) {
if (item.iconSrc) {
item.iconSrcFullpath = 'some value..';
}
_.each(item.items, updateRecursive);
})(json);
}
$scope.treeOptions = {
nodeChildren: 'children',
dirSelectable: true,
injectClasses: {
ul: "a1",
li: "a2",
liSelected: "a7",
iExpanded: "a3",
iCollapsed: "a4",
iLeaf: "a5",
label: "a6",
labelSelected: "a8"
}
}
$scope.treeData = [
{ "name": "Joe", "age": "21", "children": [
{ "name": "Smith", "age": "42", "children": [] },
{ "name": "Gary", "age": "21", "children": [
{ "name": "Jenifer", "age": "23", "children": [
{ "name": "Dani", "age": "32", "children": [] },
{ "name": "Max", "age": "34", "children": [] }
]}
]}
]},
{ "name": "Albert", "age": "33", "children": [] },
{ "name": "Ron", "age": "29", "children": [] }
];
return treeService
}

View file

@ -1,3 +0,0 @@
.stf-tree {
}