mirror of https://github.com/JohnHammond/CTFd.git
Add ezpg and jquery PATCH wrapper (#609)
parent
96a3d2c9bd
commit
995cf6a920
|
@ -16,6 +16,11 @@ var modal = '<div class="modal fade" tabindex="-1" role="dialog">' +
|
|||
' </div>' +
|
||||
'</div>';
|
||||
|
||||
var progress = '<div class="progress">' +
|
||||
' <div class="progress-bar progress-bar-success progress-bar-striped progress-bar-animated" role="progressbar" style="width: \{0\}%">' +
|
||||
' </div>' +
|
||||
'</div>';
|
||||
|
||||
function ezal(args){
|
||||
var res = modal.format(args.title, args.body);
|
||||
var obj = $(res);
|
||||
|
@ -28,7 +33,9 @@ function ezal(args){
|
|||
|
||||
$(obj).on('hidden.bs.modal', function (e) {
|
||||
$(this).modal('dispose');
|
||||
})
|
||||
});
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function ezq(args){
|
||||
|
@ -51,4 +58,16 @@ function ezq(args){
|
|||
});
|
||||
|
||||
obj.modal('show');
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function ezpg(args){
|
||||
var bar = progress.format(args.width);
|
||||
var res = modal.format(args.title, bar);
|
||||
|
||||
var obj = $(res);
|
||||
$('main').append(obj);
|
||||
|
||||
return obj.modal('show');
|
||||
}
|
|
@ -58,7 +58,7 @@ function htmlentities(string) {
|
|||
}
|
||||
|
||||
// http://stepansuvorov.com/blog/2014/04/jquery-put-and-delete/
|
||||
jQuery.each(["put", "delete"], function(i, method) {
|
||||
jQuery.each(["patch", "put", "delete"], function(i, method) {
|
||||
jQuery[method] = function(url, data, callback, type) {
|
||||
if (jQuery.isFunction(data)) {
|
||||
type = type || callback;
|
||||
|
|
|
@ -16,6 +16,11 @@ var modal = '<div class="modal fade" tabindex="-1" role="dialog">' +
|
|||
' </div>' +
|
||||
'</div>';
|
||||
|
||||
var progress = '<div class="progress">' +
|
||||
' <div class="progress-bar progress-bar-success progress-bar-striped progress-bar-animated" role="progressbar" style="width: \{0\}%">' +
|
||||
' </div>' +
|
||||
'</div>';
|
||||
|
||||
function ezal(args){
|
||||
var res = modal.format(args.title, args.body);
|
||||
var obj = $(res);
|
||||
|
@ -28,7 +33,9 @@ function ezal(args){
|
|||
|
||||
$(obj).on('hidden.bs.modal', function (e) {
|
||||
$(this).modal('dispose');
|
||||
})
|
||||
});
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function ezq(args){
|
||||
|
@ -51,4 +58,16 @@ function ezq(args){
|
|||
});
|
||||
|
||||
obj.modal('show');
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function ezpg(args){
|
||||
var bar = progress.format(args.width);
|
||||
var res = modal.format(args.title, bar);
|
||||
|
||||
var obj = $(res);
|
||||
$('main').append(obj);
|
||||
|
||||
return obj.modal('show');
|
||||
}
|
|
@ -58,7 +58,7 @@ function htmlentities(string) {
|
|||
}
|
||||
|
||||
// http://stepansuvorov.com/blog/2014/04/jquery-put-and-delete/
|
||||
jQuery.each(["put", "delete"], function(i, method) {
|
||||
jQuery.each(["patch", "put", "delete"], function(i, method) {
|
||||
jQuery[method] = function(url, data, callback, type) {
|
||||
if (jQuery.isFunction(data)) {
|
||||
type = type || callback;
|
||||
|
|
Loading…
Reference in New Issue