From 80ad1fe372391923f270dc90cfb65c1bf2b39a47 Mon Sep 17 00:00:00 2001 From: "Johan \"Papa\" Cwiklinski" Date: Sun, 30 May 2010 23:23:53 +0200 Subject: Apply PEAR coding standards, refs #48 ; Add licence tag, closes #46 --- scripts/rpmphp.js | 93 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 58 insertions(+), 35 deletions(-) (limited to 'scripts') diff --git a/scripts/rpmphp.js b/scripts/rpmphp.js index 7dfe0b5..864b9c6 100644 --- a/scripts/rpmphp.js +++ b/scripts/rpmphp.js @@ -1,38 +1,61 @@ +/** + * This file is part of rpmphp. + * + * rpmphp is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * rpmphp is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with rpmphp. If not, see . + */ + +/** +* Initialize Zoom page using ajax: +* - loads description from pkgdb +* - loads packages informations from pkgdb +* @param String name Name of the package +*/ 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().html(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)); - } - } - ); - } - } - }); + $('#pkgdb-link').remove(); + $.ajax({ + url: 'pkgdb-ajax.php?name=' + name, + success: function(data) { + if ( data.error ) { + alert(data.error); + } else { + $('#' + name + '_desc').empty().html(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