summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJohan "Papa" Cwiklinski <trasher@odysseus.(none)>2010-05-30 23:23:53 +0200
committerJohan "Papa" Cwiklinski <trasher@odysseus.(none)>2010-05-30 23:23:53 +0200
commit80ad1fe372391923f270dc90cfb65c1bf2b39a47 (patch)
treeeedaa090a415bbd2bae4c7917c3d1616252c70e4 /scripts
parenteca7d464fd98c8542e3e54552bdc1fc77823c3bd (diff)
Apply PEAR coding standards, refs #48 ; Add licence tag, closes #46
Diffstat (limited to 'scripts')
-rw-r--r--scripts/rpmphp.js93
1 files changed, 58 insertions, 35 deletions
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 <http://www.gnu.org/licenses/>.
+ */
+
+/**
+* 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