From 8aa3adeb74d3aba8f7cd9498870cd63d87aefd75 Mon Sep 17 00:00:00 2001 From: "Johan \"Papa\" Cwiklinski" Date: Sat, 29 May 2010 17:22:42 +0200 Subject: Use of ajax to load additionnal informations from pkgdb ; closes #45 --- scripts/rpmphp.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 scripts/rpmphp.js (limited to 'scripts/rpmphp.js') diff --git a/scripts/rpmphp.js b/scripts/rpmphp.js new file mode 100644 index 0000000..7898986 --- /dev/null +++ b/scripts/rpmphp.js @@ -0,0 +1,38 @@ +function initZoomJS(name) +{ + $('#pkgdb-link').remove(); + $.ajax({ + url: 'pkgdb-ajax.php?name=' + name, + success: function(data) { + if ( data.error ) { + alert(data.error); + } else { + $('#' + name + '_desc').empty().text(data.devel.package.description); + $.each( + data, + function(k, v){ + _data = data[k]; + if ( k === 'devel' ) { + k = 'rawhide'; + } + _owner_cell = $('#pkgdb_' + k + '_owner'); + if ( _owner_cell ) { + _owner_cell.empty().text(_data.owner); + _maintainers_cell = $('#pkgdb_' + k + '_maintainers'); + _maintainers = ''; + if ( _data.people != null ) { + $.each( + _data.people, + function(){ + _maintainers += this.username + ', '; + } + ) + } + _maintainers_cell.empty().text(_maintainers.slice(0, -2)); + } + } + ); + } + } + }); +} \ No newline at end of file -- cgit