listing style changes

master
Garrett Mills 5 years ago
parent 627daa2f46
commit 5ef1306faf

@ -0,0 +1,69 @@
const devbug = {
outs: {},
url: 'http://localhost:8000/',
api_key: false,
out(key, what, group=false){
console.log(this)
if ( group ){
if ( !Object.keys(this.outs).includes(group) ) this.outs[group] = {}
this.outs[group][key] = what
return this;
}
this.outs[key] = what
return this;
},
script(addr, then){
var sc = document.createElement('script');
sc.src = addr; sc.type = 'text/javascript';
sc.onload = then;
document.getElementsByTagName('head')[0].appendChild(sc);
return this;
},
load_dc: function(then){ this.script(this.url+'assets/cycle.js', then); return this; },
load_jq: function(then){
this.script('https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js', () => {
$ = window.jQuery;
$(then);
});
return this;
},
libs: function(then){
// need both
if ( typeof JSON.rmref !== 'function' && typeof window.jQuery !== 'function' ) this.load_dc(() => this.load_jq(then))
// need decycle
else if ( typeof JSON.rmref !== 'function' ) this.load_dc(then)
// need jquery
else if ( typeof window.jQuery !== 'function' ) this.load_jq(then)
else then()
return this;
},
json(data){
return JSON.stringify(JSON.rmref(JSON.decycle(data)));
},
breakpoint(name, exception = false){
var e = new Error();
this.libs(() => {
var s = e.stack.split('at'); var caller = '';
if ( s.length < 3 ) s = e.stack.split('@')
if ( s.length > 2 ) caller = s[2].trim()
else if ( s.length > 1 ) caller = s[1]
else caller = 'Unable to determine stacktrace'
var data = new FormData();
data.append('data', this.json({
brief: (name ? name : 'Breakpoint')+`: ${caller}`,
data: this.outs,
}))
$.ajax({
url: this.url+'api/v1/out/'+this.api_key,
data, cache: false, contentType: false, processData: false, method: 'POST', type: 'POST',
success: (res) => { console.log('DevBug POST Completed'); console.debug(res); }
})
})
if ( exception ) throw e
return this
}
}
window.devbug = devbug;
window.out = window.devbug.out.bind(window.devbug);
window.breakpoint = window.devbug.breakpoint.bind(window.devbug);

@ -1,14 +1,15 @@
if (typeof JSON.rmref !== "function") {
JSON.rmref = function rmref(o){
function eachRecursive(obj) {
function eachRecursive(obj, ci = 'root', ci2 = 'root') {
for (var k in obj)
{
if (typeof obj[k] == "object" && obj[k] !== null)
eachRecursive(obj[k]);
eachRecursive(obj[k], k, ci);
else {
for ( var key in obj ){
if ( key === "$ref" ){
obj[k] = "cyclic structure removed";
console.log(obj[k])
obj[k] = "cyclic structure removed: "+ci2;
break;
}
}

@ -24,14 +24,14 @@ block content
td
ul(style='list-style-type: none; margin: 0; padding: 0;')
if !(user.uuid === project.user_id)
li
li.action-li
a.action(href='/dash/v1/project/share/'+project.id+'/revoke/'+user.uuid) Revoke
li
a.action(href='/dash/v1/project/share/'+project.id+'/transfer/'+user.uuid) Transfer Ownership
else
li
li.action-li
strike Revoke
li
li.action-li
strike Transfer Ownership
if sharing.edit.length > 0
@ -49,14 +49,14 @@ block content
td
ul(style='list-style-type: none; margin: 0; padding: 0;')
if !(user.uuid === project.user_id)
li
li.action-li
a.action(href='/dash/v1/project/share/'+project.id+'/revoke/'+user.uuid+'/edit') Revoke
li
a.action(href='/dash/v1/project/share/'+project.id+'/transfer/'+user.uuid) Transfer Ownership
else
li
li.action-li
strike Revoke
li
li.action-li
strike Transfer Ownership
br
h2 Share With New User
@ -77,12 +77,12 @@ block content
td
ul(style='list-style-type: none; margin: 0; padding: 0;')
if !(user.uuid === project.user_id)
li
li.action-li
a.action(href='/dash/v1/project/share/' + project.id + '/share/'+user.uuid) Share (View)
li
li.action-li
a.action(href='/dash/v1/project/share/' + project.id + '/share/'+user.uuid+'/edit') Share (Edit)
else
li
li.action-li
strike Share
li
li.action-li
a.action(href='/dash/v1/project/share/' + project.id + '/transfer/' + user.uuid) Transfer Ownership

@ -14,8 +14,8 @@ block content
td #{ out.created.toLocaleString({timeZone: 'America/Chicago'}) }
td
ul(style='list-style-type: none; margin: 0; padding: 0;')
li
li.action-li
a.action(href='/dash/v1/out/view/'+out.id) View
if ( devbug.permission.project.edit(project, user) )
li
li.action-li
a.action(href='/dash/v1/out/delete/'+out.id+'/'+project.id) Delete

@ -30,4 +30,4 @@ html
body
.flitter-container
img.flitter-image(src="/assets/flitter.png")
p.flitter-name 500: Internal Server Error
p.flitter-name 500: #{(reason ? reason : "Internal Server Error")}
Loading…
Cancel
Save