
resources.gaelykconsole.js.jq-common.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gaelyk-console Show documentation
Show all versions of gaelyk-console Show documentation
Gaelyk Console Plugin adds simple console which can execute groovlet like code.
The newest version!
// from http://0061276.netsolhost.com/tony/javascript/urlEncode.js
function urlEncode(c) {
return encodeURIComponent(c);
}
function showMessage(title, type, msg, noPre) {
var j = jQuery;
var alert = '×';
alert += '' + title + '
';
if (msg) {
if (!noPre) {
alert += ''
}
alert += msg
if (!noPre) {
alert += '
'
}
}
alert += '';
j('#flash-holder').prepend(alert);
j('#clear').removeClass('disabled');
}
jQuery(function(){
var j = jQuery;
window.doLoad = function(val, readonly){
j('#myModal').hide();
j('#name').val(val.name).data('original-name', val.name);
window.location.hash = val.name;
if(val.tags){
j('#tags').val(val.tags.join(', '));
} else {
j('#tags').val('');
}
j('#progress').hide();
if(!readonly){
j('#delete').removeClass('disabled');
j('#save').addClass('disabled');
j('#load').removeClass('disabled');
j('#execute').removeClass('disabled');
}
}
j('.closeLoad').click(function(){
j('#myModal').hide();
j('#load').removeClass('disabled');
j('#execute').removeClass('disabled');
});
j('.closeDelete').click(function(){
j('#deleteModal').hide();
});
j('#clear').click(function(){
if(j(this).hasClass('disabled')){
return;
}
j('#flash-holder').text('');
j(this).addClass('disabled');
});
j('#delete').click(function(){
if(j(this).hasClass('disabled')){
return;
}
j('#deleteModal').show();
});
window.openBrowser = function(endpoint, headline, readonly) {
return function(){
if(j(this).hasClass('disabled')){
return;
}
j('#myModal').show();
j(this).addClass('disabled');
j.get('/_ah/gaelyk-console/' + endpoint, function(scripts){
j('.scriptBrowser').html('');
j('.scriptBrowser').append(''+ headline + ' ');
j.each(scripts, function(i, val){
var item = '';
item+= val.name;
if(val.tags){
j.each(val.tags, function(index, tag){
item+= ' ' + tag + '';
});
}
item+= '';
item+= ' ';
j('.scriptBrowser').append(item);
});
j('a.script').click(function(event){
j('#progress').show();
var name = j(this).data('script-name');
window.loadItem(name, readonly);
});
j('#loading-scripts').hide();
});
}
};
});
© 2015 - 2025 Weber Informatics LLC | Privacy Policy