new design, but not sure
This commit is contained in:
parent
b425be39d4
commit
27ee78b409
|
@ -33,6 +33,9 @@
|
||||||
<script src="/js/lib/angular/angular-local-storage.js" charset="utf-8"></script>
|
<script src="/js/lib/angular/angular-local-storage.js" charset="utf-8"></script>
|
||||||
<script src="/js/lib/angular/angular-ui-router.min.js" charset="utf-8"></script>
|
<script src="/js/lib/angular/angular-ui-router.min.js" charset="utf-8"></script>
|
||||||
<script src="/js/lib/angular/angucomplete-alt.min.js" charset="utf-8"></script>
|
<script src="/js/lib/angular/angucomplete-alt.min.js" charset="utf-8"></script>
|
||||||
|
<script src="/js/lib/ez-file-tree/ez-file-tree.min.js" charset="utf-8"></script>
|
||||||
|
<script src="/js/lib/ez-file-tree/ez-object2array.min.js" charset="utf-8"></script>
|
||||||
|
|
||||||
<!-- Core Files -->
|
<!-- Core Files -->
|
||||||
<script src="/js/app.js" charset="utf-8"></script>
|
<script src="/js/app.js" charset="utf-8"></script>
|
||||||
<!-- Services -->
|
<!-- Services -->
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
var app = angular.module('launchpad', ['oauth3.org', 'ui.router', 'LocalStorageModule', 'angucomplete-alt']);
|
var app = angular.module('launchpad', ['oauth3.org', 'ui.router', 'LocalStorageModule', 'angucomplete-alt', 'ez.fileTree']);
|
||||||
|
|
||||||
app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider',
|
app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider',
|
||||||
function ($stateProvider, $urlRouterProvider, localStorageServiceProvider) {
|
function ($stateProvider, $urlRouterProvider, localStorageServiceProvider) {
|
||||||
|
|
|
@ -339,6 +339,7 @@ app.controller('websiteCtrl', [
|
||||||
vm.Sites.contents = function (r) {
|
vm.Sites.contents = function (r) {
|
||||||
vm.showListFiles = true;
|
vm.showListFiles = true;
|
||||||
var pkg = Auth.oauth3.pkg('www@daplie.com');
|
var pkg = Auth.oauth3.pkg('www@daplie.com');
|
||||||
|
|
||||||
return pkg.contents({
|
return pkg.contents({
|
||||||
hostname: r.domain
|
hostname: r.domain
|
||||||
, domain: r.domain
|
, domain: r.domain
|
||||||
|
@ -347,17 +348,8 @@ app.controller('websiteCtrl', [
|
||||||
//, sub: r.sub
|
//, sub: r.sub
|
||||||
, path: r.newPath
|
, path: r.newPath
|
||||||
}).then(function (result) {
|
}).then(function (result) {
|
||||||
vm.directories = [];
|
// window.alert(JSON.stringify(result.data));
|
||||||
vm.files = [];
|
vm.folderStructure = result;
|
||||||
window.alert(JSON.stringify(result.data));
|
|
||||||
result.data.forEach(function(dir) {
|
|
||||||
if (dir.directory) {
|
|
||||||
debugger;
|
|
||||||
console.log('asdfasdfasdf');
|
|
||||||
vm.things = [];
|
|
||||||
vm.things.push(dir.name);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
vm.Shares = {};
|
vm.Shares = {};
|
||||||
|
@ -494,5 +486,43 @@ app.controller('websiteCtrl', [
|
||||||
return matches;
|
return matches;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}])
|
||||||
}]);
|
.filter('stringify', function() {
|
||||||
|
function getSerialize (fn, decycle) {
|
||||||
|
var seen = [], keys = [];
|
||||||
|
decycle = decycle || function(key, value) {
|
||||||
|
return '[Parent REFERENCE]: ' + value.id;
|
||||||
|
};
|
||||||
|
return function(key, value) {
|
||||||
|
var ret = value;
|
||||||
|
if (typeof value === 'object' && value) {
|
||||||
|
if (seen.indexOf(value) !== -1)
|
||||||
|
ret = decycle(key, value);
|
||||||
|
else {
|
||||||
|
seen.push(value);
|
||||||
|
keys.push(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fn) ret = fn(key, ret);
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function getPath (value, seen, keys) {
|
||||||
|
var index = seen.indexOf(value);
|
||||||
|
var path = [ keys[index] ];
|
||||||
|
for (index--; index >= 0; index--) {
|
||||||
|
if (seen[index][ path[0] ] === value) {
|
||||||
|
value = seen[index];
|
||||||
|
path.unshift(keys[index]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '~' + path.join('.');
|
||||||
|
}
|
||||||
|
function stringify(obj, fn, spaces, decycle) {
|
||||||
|
return JSON.stringify(obj, getSerialize(fn, decycle), spaces);
|
||||||
|
}
|
||||||
|
stringify.getSerialize = getSerialize;
|
||||||
|
return function(ob) {
|
||||||
|
return stringify(ob, undefined, 2);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
||||||
|
angular.module("ez.object2array",[]).filter("object2array",[function(){return function(a){if("[object Array]"===Object.prototype.toString.call(a))return a;var b=[];for(var c in a)b.push(a[c]);return b}}]);
|
|
@ -180,22 +180,12 @@
|
||||||
<div class="white-well" ng-show="vm.showListFiles">
|
<div class="white-well" ng-show="vm.showListFiles">
|
||||||
<button type="button" class="close" ng-click="vm.showListFiles = false" ng-show="vm.showListFiles"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
<button type="button" class="close" ng-click="vm.showListFiles = false" ng-show="vm.showListFiles"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||||
<div class="text-left">
|
<div class="text-left">
|
||||||
<h4>Directories</h4>
|
<div class="row">
|
||||||
<ul class="ls-none" ng-repeat="directory in vm.directories track by $index">
|
<div class="col-lg-12">
|
||||||
<li>{{ directory }}</li>
|
<pre style="font-size: 10px;">{{ vm.folderStructure | stringify }}</pre>
|
||||||
</ul>
|
</div>
|
||||||
<h4>Files</h4>
|
</div>
|
||||||
<ul class="ls-none" ng-repeat="file in vm.files track by $index">
|
|
||||||
<li>{{ file }}</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div class="">
|
<div class="">
|
||||||
|
|
Loading…
Reference in New Issue