listing style changes
This commit is contained in:
parent
627daa2f46
commit
5ef1306faf
69
app/assets/agents/ecma5.js
Normal file
69
app/assets/agents/ecma5.js
Normal file
@ -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") {
|
if (typeof JSON.rmref !== "function") {
|
||||||
JSON.rmref = function rmref(o){
|
JSON.rmref = function rmref(o){
|
||||||
function eachRecursive(obj) {
|
function eachRecursive(obj, ci = 'root', ci2 = 'root') {
|
||||||
for (var k in obj)
|
for (var k in obj)
|
||||||
{
|
{
|
||||||
if (typeof obj[k] == "object" && obj[k] !== null)
|
if (typeof obj[k] == "object" && obj[k] !== null)
|
||||||
eachRecursive(obj[k]);
|
eachRecursive(obj[k], k, ci);
|
||||||
else {
|
else {
|
||||||
for ( var key in obj ){
|
for ( var key in obj ){
|
||||||
if ( key === "$ref" ){
|
if ( key === "$ref" ){
|
||||||
obj[k] = "cyclic structure removed";
|
console.log(obj[k])
|
||||||
|
obj[k] = "cyclic structure removed: "+ci2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,14 +24,14 @@ block content
|
|||||||
td
|
td
|
||||||
ul(style='list-style-type: none; margin: 0; padding: 0;')
|
ul(style='list-style-type: none; margin: 0; padding: 0;')
|
||||||
if !(user.uuid === project.user_id)
|
if !(user.uuid === project.user_id)
|
||||||
li
|
li.action-li
|
||||||
a.action(href='/dash/v1/project/share/'+project.id+'/revoke/'+user.uuid) Revoke
|
a.action(href='/dash/v1/project/share/'+project.id+'/revoke/'+user.uuid) Revoke
|
||||||
li
|
li
|
||||||
a.action(href='/dash/v1/project/share/'+project.id+'/transfer/'+user.uuid) Transfer Ownership
|
a.action(href='/dash/v1/project/share/'+project.id+'/transfer/'+user.uuid) Transfer Ownership
|
||||||
else
|
else
|
||||||
li
|
li.action-li
|
||||||
strike Revoke
|
strike Revoke
|
||||||
li
|
li.action-li
|
||||||
strike Transfer Ownership
|
strike Transfer Ownership
|
||||||
|
|
||||||
if sharing.edit.length > 0
|
if sharing.edit.length > 0
|
||||||
@ -49,14 +49,14 @@ block content
|
|||||||
td
|
td
|
||||||
ul(style='list-style-type: none; margin: 0; padding: 0;')
|
ul(style='list-style-type: none; margin: 0; padding: 0;')
|
||||||
if !(user.uuid === project.user_id)
|
if !(user.uuid === project.user_id)
|
||||||
li
|
li.action-li
|
||||||
a.action(href='/dash/v1/project/share/'+project.id+'/revoke/'+user.uuid+'/edit') Revoke
|
a.action(href='/dash/v1/project/share/'+project.id+'/revoke/'+user.uuid+'/edit') Revoke
|
||||||
li
|
li
|
||||||
a.action(href='/dash/v1/project/share/'+project.id+'/transfer/'+user.uuid) Transfer Ownership
|
a.action(href='/dash/v1/project/share/'+project.id+'/transfer/'+user.uuid) Transfer Ownership
|
||||||
else
|
else
|
||||||
li
|
li.action-li
|
||||||
strike Revoke
|
strike Revoke
|
||||||
li
|
li.action-li
|
||||||
strike Transfer Ownership
|
strike Transfer Ownership
|
||||||
br
|
br
|
||||||
h2 Share With New User
|
h2 Share With New User
|
||||||
@ -77,12 +77,12 @@ block content
|
|||||||
td
|
td
|
||||||
ul(style='list-style-type: none; margin: 0; padding: 0;')
|
ul(style='list-style-type: none; margin: 0; padding: 0;')
|
||||||
if !(user.uuid === project.user_id)
|
if !(user.uuid === project.user_id)
|
||||||
li
|
li.action-li
|
||||||
a.action(href='/dash/v1/project/share/' + project.id + '/share/'+user.uuid) Share (View)
|
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)
|
a.action(href='/dash/v1/project/share/' + project.id + '/share/'+user.uuid+'/edit') Share (Edit)
|
||||||
else
|
else
|
||||||
li
|
li.action-li
|
||||||
strike Share
|
strike Share
|
||||||
li
|
li.action-li
|
||||||
a.action(href='/dash/v1/project/share/' + project.id + '/transfer/' + user.uuid) Transfer Ownership
|
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 #{ out.created.toLocaleString({timeZone: 'America/Chicago'}) }
|
||||||
td
|
td
|
||||||
ul(style='list-style-type: none; margin: 0; padding: 0;')
|
ul(style='list-style-type: none; margin: 0; padding: 0;')
|
||||||
li
|
li.action-li
|
||||||
a.action(href='/dash/v1/out/view/'+out.id) View
|
a.action(href='/dash/v1/out/view/'+out.id) View
|
||||||
if ( devbug.permission.project.edit(project, user) )
|
if ( devbug.permission.project.edit(project, user) )
|
||||||
li
|
li.action-li
|
||||||
a.action(href='/dash/v1/out/delete/'+out.id+'/'+project.id) Delete
|
a.action(href='/dash/v1/out/delete/'+out.id+'/'+project.id) Delete
|
||||||
|
@ -30,4 +30,4 @@ html
|
|||||||
body
|
body
|
||||||
.flitter-container
|
.flitter-container
|
||||||
img.flitter-image(src="/assets/flitter.png")
|
img.flitter-image(src="/assets/flitter.png")
|
||||||
p.flitter-name 500: Internal Server Error
|
p.flitter-name 500: #{(reason ? reason : "Internal Server Error")}
|
Loading…
Reference in New Issue
Block a user