Created
December 21, 2014 11:09
-
-
Save zhang-ning/3fe6348e11f475971df9 to your computer and use it in GitHub Desktop.
filebak
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
'use strict'; | |
angular.module('agroupApp') | |
.controller('FileCtrl', ['$scope', 'fileIcon', 'Modal', 'messageAPI', 'folderAPI', | |
function($scope, fileIcon, Modal, messageAPI, folderAPI) { | |
$scope.$on('groupChanged',function(event,group) { | |
list(group) | |
}); | |
$scope.$on('moduleChanged',function(event,group) { | |
list(group) | |
}); | |
function list(group){ | |
folderAPI | |
.getFiles(group) | |
.success(function(res){ | |
$scope.nodeList = res.data; | |
console.log(res.data); | |
}); | |
} | |
} | |
]); |
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
'use strict'; | |
describe('Controller: FileCtrl', function () { | |
// load the controller's module | |
beforeEach(module('agroupApp')); | |
var FileCtrl, scope; | |
// Initialize the controller and a mock scope | |
beforeEach(inject(function ($controller, $rootScope) { | |
scope = $rootScope.$new(); | |
FileCtrl = $controller('FileCtrl', { | |
$scope: scope | |
}); | |
})); | |
it('should ...', function () { | |
expect(1).toEqual(1); | |
}); | |
}); |
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
<ul class="breadcrumb bg-white b-a bread-nav"> | |
<li ng-click="home()"><a href=""><i class="fa fa-home"></i> {{ module.group.name }}</a></li> | |
<li ng-repeat="folder in level" ng-class="{'active':$last}" ng-click="selectItem(folder,folder.selectedItem)"> | |
<span ng-show="folder.selectedItem"> | |
<span ng-class="getIcon(folder.selectedItem)"></span> | |
<!--<span class="fa fa-"></span>--> | |
<a href="" ng-bind-html="getName(folder.selectedItem)"></a> | |
</span> | |
</li> | |
</ul> | |
<div class="col-md-12"> | |
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
<span class="label bg-danger pull-right m-t-xs">4 left</span> | |
Tasks | |
</div> | |
<table class="table table-striped m-b-none file-list"> | |
<tbody> | |
<tr ng-repeat="item in nodeList" ng-if="item.folder"> | |
<td ng-if="item.folder"> | |
<fileicon mimetype="Folder" class="file-icon"></fileicon> | |
<a> | |
{{item.folder.name}} | |
</a> | |
</td> | |
<td></td> | |
<td class="text-right">{{ fromNow(item.folder.updatedAt) }}</td> | |
</tr> | |
<tr ng-repeat="item in nodeList" ng-if="item.file"> | |
<td ng-if="item.folder"> | |
{{item.file.name}} | |
</td> | |
<td></td> | |
<td class="text-right">{{ fromNow(item.file.updatedAt) }}</td> | |
</tr> | |
</tbody> | |
</table> | |
</div> | |
</div> | |
<!--preview-panel class='col file-sys-preview'></preview-panel --> | |
<uploadpanel control="uploadpanel" style="display: none;"></uploadpanel> |
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
'use strict'; | |
function select(node) { | |
var range = rangy.createRange(); | |
range.selectNodeContents(node); | |
//range.collapse(true); | |
var sel = rangy.getSelection(); | |
//sel.setStart(0, 0); | |
//sel.setEnd(10, 10); | |
sel.setSingleRange(range); | |
} | |
angular.module('agroupApp') | |
.config(function($stateProvider) { | |
$stateProvider | |
.state('app.file', { | |
url: '/{name}/files/{{pid}}', | |
templateUrl: 'app/file/file.html', | |
controller: 'FileCtrl' | |
}) | |
}) |
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
.file-list{ | |
a:hover,a:focus{ | |
text-decoration:underline; | |
} | |
a,.fa-folder{ | |
color:#4183c4; | |
} | |
.file-icon{ | |
margin-right: 5px; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment