This repository has been archived by the owner on Jan 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from daeks/sqlite
sqlite
- Loading branch information
Showing
71 changed files
with
8,853 additions
and
637 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
data/ | ||
data/* | ||
!data/README | ||
!data/index.php | ||
!data/cache/README |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
(function ($) { | ||
|
||
var core = (function () { | ||
|
||
var init = function () { | ||
$.get('/modules/setup/controller.php?action=init', function (data) { | ||
try { | ||
var obj = $.parseJSON(data); | ||
if (obj.status == 200) { | ||
if (obj.data > 0) { | ||
$('.modal-content').load('/modules/setup/dialog.php?action=sync',function (result) { | ||
$('.modal').modal({ | ||
show:true, | ||
backdrop: 'static', | ||
keyboard: false | ||
}); | ||
$('.modal').css('display', 'block'); | ||
var $dialog = $('.modal').find('.modal-dialog'); | ||
var offset = ($(window).height() - $dialog.height()) / 2; | ||
var bottomMargin = $dialog.css('marginBottom'); | ||
bottomMargin = parseInt(bottomMargin); | ||
if (offset < bottomMargin) { | ||
offset = bottomMargin; | ||
} | ||
$dialog.css("margin-top", offset); | ||
$('button[data-query="modal-install"]').on('click', function (event) { | ||
event.preventDefault(); | ||
$(this).html('<i class="fa fa-spinner fa-spin"></i> ' + $(this).html()); | ||
$(this).prop('disabled', true); | ||
core.sync(); | ||
return false; | ||
}); | ||
}); | ||
} | ||
} else if (obj.status == 500) { | ||
core.toast('danger', false, obj.data); | ||
} else { | ||
core.toast('danger', true, obj.data); | ||
} | ||
} catch (e) { | ||
core.infobox('danger', 0, e.message + data); | ||
} | ||
}); | ||
}; | ||
|
||
var sync = function () { | ||
if ($('#modal-data').length > 0) { | ||
var $form = $('#modal-data'); | ||
var $target = $($form.attr('data-target')); | ||
|
||
$.ajax({ | ||
type: $form.attr('method'), | ||
url: $form.attr('action'), | ||
data: $form.serialize(), | ||
|
||
success: function (data, status) { | ||
try { | ||
var obj = $.parseJSON(data); | ||
if (obj.status == 200) { | ||
$('.modal').modal('hide'); | ||
if (obj.data.length > 0) { | ||
core.toast('success', false, obj.data); | ||
} | ||
eval(obj.event); | ||
} else if (obj.status == 301) { | ||
var data = $('<textarea/>').html(obj.data).val(); | ||
$target.html(data); | ||
$(".progress-bar").addClass('active'); | ||
eval(obj.event); | ||
} | ||
} catch (e) { | ||
$('.modal').modal('hide'); | ||
core.infobox('danger', 0, e.message + data); | ||
} | ||
} | ||
}); | ||
} | ||
}; | ||
|
||
var infobox = function (type, time, value) { | ||
$('#infobox').html('<div class="alert alert-' + type + '" tabindex="-1"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><span>' + value.replace('Unexpected token <', '').trim() + '</span></div>'); | ||
$('#infobox').show(); | ||
if (time > 0) { | ||
setTimeout(function () { | ||
$("#infobox").hide(); | ||
}, time); | ||
} | ||
}; | ||
|
||
var toast = function (type, sticky, value) { | ||
$().toastmessage('showToast', { | ||
text: value, | ||
sticky: sticky, | ||
position: 'bottom-right', | ||
type: type | ||
}); | ||
}; | ||
|
||
return { | ||
init: init, | ||
infobox: infobox, | ||
toast: toast, | ||
sync: sync | ||
}; | ||
})(); | ||
|
||
$.extend(true, window, { | ||
core: core | ||
}); | ||
|
||
$(function () { | ||
core.init(); | ||
}); | ||
|
||
}(jQuery)); |
This file contains 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
Oops, something went wrong.