diff options
author | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-06-24 02:52:01 +0000 |
---|---|---|
committer | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-06-24 02:52:01 +0000 |
commit | 62774923211c2e391534d83e6c7d97acae086766 (patch) | |
tree | a43d0ce9345df18b0f67b61e044636114ce56aba /templates | |
parent | 7549180515107d924610a22c5acf1a0e44b4b9f5 (diff) | |
download | ampache-62774923211c2e391534d83e6c7d97acae086766.tar.gz ampache-62774923211c2e391534d83e6c7d97acae086766.tar.bz2 ampache-62774923211c2e391534d83e6c7d97acae086766.zip |
JavaScript cleanup. Consistently use camelCase for naming JS functions. Use
Prototype functionality where possible (particularly for Ajax). Move our JS
into lib/javascript (I dropped kajax as an external module since the new
ajax.js is completely different apart from function headers.) Remove unused
JS functions from base.js.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/browse_filters.inc.php | 2 | ||||
-rw-r--r-- | templates/header.inc.php | 4 | ||||
-rw-r--r-- | templates/javascript_refresh.inc.php | 18 | ||||
-rw-r--r-- | templates/show_album.inc.php | 2 | ||||
-rw-r--r-- | templates/show_install.inc.php | 2 | ||||
-rw-r--r-- | templates/show_install_lang.inc.php | 2 | ||||
-rw-r--r-- | templates/show_lyrics_song.inc.php | 2 | ||||
-rw-r--r-- | templates/show_now_playing_row.inc.php | 2 | ||||
-rw-r--r-- | templates/show_registration_confirmation.inc.php | 4 | ||||
-rw-r--r-- | templates/show_user_activate.inc.php | 4 | ||||
-rw-r--r-- | templates/show_user_registration.inc.php | 4 |
11 files changed, 16 insertions, 30 deletions
diff --git a/templates/browse_filters.inc.php b/templates/browse_filters.inc.php index c8c65a14..c902cd1b 100644 --- a/templates/browse_filters.inc.php +++ b/templates/browse_filters.inc.php @@ -27,7 +27,7 @@ $ajax_info = Config::get('ajax_url'); $web_path = Config::get('web_path'); <?php if (in_array('starts_with',$allowed_filters)) { ?> <form id="multi_alpha_filter_form" method="post" action="javascript:void(0);"> <label id="multi_alpha_filterLabel" for="multi_alpha_filter"><?php echo _('Starts With'); ?></label> - <input type="text" id="multi_alpha_filter" name="multi_alpha_filter" value="<?php echo scrub_out($browse->get_filter('starts_with')); ?>" onKeyUp="DelayRun(this, '400', 'ajaxState', '<?php echo $ajax_info; ?>?page=browse&action=browse&browse_id=<?php echo $browse->id; ?>&key=starts_with', 'multi_alpha_filter');"> + <input type="text" id="multi_alpha_filter" name="multi_alpha_filter" value="<?php echo scrub_out($browse->get_filter('starts_with')); ?>" onKeyUp="delayRun(this, '400', 'ajaxState', '<?php echo $ajax_info; ?>?page=browse&action=browse&browse_id=<?php echo $browse->id; ?>&key=starts_with', 'multi_alpha_filter');"> </form> <?php } // end if alpha_match ?> <?php if (in_array('minimum_count',$allowed_filters)) { ?> diff --git a/templates/header.inc.php b/templates/header.inc.php index fc5ff91e..7493cf9c 100644 --- a/templates/header.inc.php +++ b/templates/header.inc.php @@ -51,9 +51,9 @@ if (Config::get('use_rss')) { ?> <link rel="stylesheet" href="<?php echo $web_path; ?>/templates/print.css" type="text/css" media="print" /> </head> <body> -<script src="<?php echo $web_path; ?>/lib/javascript-base.js" language="javascript" type="text/javascript"></script> -<script src="<?php echo $web_path; ?>/modules/kajax/ajax.js" language="javascript" type="text/javascript"></script> <script src="<?php echo $web_path; ?>/modules/prototype/prototype.js" language="javascript" type="text/javascript"></script> +<script src="<?php echo $web_path; ?>/lib/javascript/base.js" language="javascript" type="text/javascript"></script> +<script src="<?php echo $web_path; ?>/lib/javascript/ajax.js" language="javascript" type="text/javascript"></script> <!-- rfc3514 implementation --> <div id="rfc3514" style="display:none;">0x0</div> <div id="maincontainer"> diff --git a/templates/javascript_refresh.inc.php b/templates/javascript_refresh.inc.php index 5f0a07ed..b0c8d9f5 100644 --- a/templates/javascript_refresh.inc.php +++ b/templates/javascript_refresh.inc.php @@ -22,27 +22,13 @@ ?> <script type="text/javascript" language="javascript"> -<!-- Begin // Set refresh interval (in seconds) -var refreshinterval=<?php echo $refresh_limit ?>; - -function doLoad() -{ - // the timeout value should be the same as in the "refresh" meta-tag - setTimeout( "refresh()", refreshinterval*1000 ); -} +var refreshInterval=<?php echo $refresh_limit ?>; function refresh() { - // This version of the refresh function will cause a new - // entry in the visitor's history. It is provided for - // those browsers that only support JavaScript 1.0. - // ajaxPut('<?php echo $ajax_url; ?>'); - doLoad(); } -// start with page-load -doLoad(); -// End --> +new PeriodicalExecuter(refresh, refreshInterval); </script> diff --git a/templates/show_album.inc.php b/templates/show_album.inc.php index 3c49a3d1..9f7ac06a 100644 --- a/templates/show_album.inc.php +++ b/templates/show_album.inc.php @@ -37,7 +37,7 @@ $title .= ' - ' . $album->f_artist_link; $name = '[' . $album->f_artist . '] ' . scrub_out($album->full_name); $aa_url = $web_path . "/image.php?id=" . $album->id . "&type=popup&sid=" . session_id(); - echo "<a target=\"_blank\" href=\"$aa_url\" onclick=\"popup_art('$aa_url'); return false;\">"; + echo "<a target=\"_blank\" href=\"$aa_url\" onclick=\"popupWindow('$aa_url'); return false;\">"; echo "<img src=\"" . $web_path . "/image.php?id=" . $album->id . "&thumb=2\" alt=\"".$name."\" title=\"".$name."\" height=\"128\" width=\"128\" />"; echo "</a>\n"; } diff --git a/templates/show_install.inc.php b/templates/show_install.inc.php index 963267cc..bf7caaad 100644 --- a/templates/show_install.inc.php +++ b/templates/show_install.inc.php @@ -31,7 +31,7 @@ $dir = is_rtl($htmllang) ? 'rtl' : 'ltr'; <meta http-equiv="Content-Type" content="text/html; Charset=<?php echo $charset; ?>" /> </head> <body> -<script src="lib/javascript-base.js" language="javascript" type="text/javascript"></script> +<script src="lib/javascript/base.js" language="javascript" type="text/javascript"></script> <div id="header"> <h1><?php echo _("Ampache Installation"); ?></h1> <p>Pour l'Amour de la Musique</p> diff --git a/templates/show_install_lang.inc.php b/templates/show_install_lang.inc.php index 803c41ac..779cdee1 100644 --- a/templates/show_install_lang.inc.php +++ b/templates/show_install_lang.inc.php @@ -31,7 +31,7 @@ $prefix = realpath(dirname(__FILE__). "/../"); <meta http-equiv="Content-Type" content="text/html; Charset=<?php echo $charset; ?>" /> </head> <body> -<script src="lib/javascript-base.js" language="javascript" type="text/javascript"></script> +<script src="lib/javascript/base.js" language="javascript" type="text/javascript"></script> <div id="header"> <h1><?php echo _('Ampache Installation'); ?></h1> <p>For the love of Music</p> diff --git a/templates/show_lyrics_song.inc.php b/templates/show_lyrics_song.inc.php index e32b4776..c4a59ace 100644 --- a/templates/show_lyrics_song.inc.php +++ b/templates/show_lyrics_song.inc.php @@ -30,7 +30,7 @@ $artist = scrub_out(truncate_with_ellipsis($song->f_artist_full)); <div class="np_group"> <?php if (Config::get('show_album_art')) { ?> <div class="np_cell cel_albumart"> - <a target="_blank" href="<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&type=popup&sid=<?php echo session_id(); ?>" onclick="popup_art('<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&type=popup&sid=<?php echo session_id(); ?>'); return false;"> + <a target="_blank" href="<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&type=popup&sid=<?php echo session_id(); ?>" onclick="popupWindow('<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&type=popup&sid=<?php echo session_id(); ?>'); return false;"> <img align="middle" src="<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&thumb=1&sid=<?php echo session_id(); ?>" alt="<?php echo scrub_out($song->f_album_full); ?>" title="<?php echo scrub_out($song->f_album_full); ?>" height="75" width="75" /> </a> </div> diff --git a/templates/show_now_playing_row.inc.php b/templates/show_now_playing_row.inc.php index a5f291e8..ad33429f 100644 --- a/templates/show_now_playing_row.inc.php +++ b/templates/show_now_playing_row.inc.php @@ -76,7 +76,7 @@ $artist = scrub_out(truncate_with_ellipsis($media->f_artist_full)); <?php if (Art::is_enabled()) { ?> <div class="np_group"> <div class="np_cell cel_albumart"> - <a target="_blank" href="<?php echo $web_path; ?>/image.php?id=<?php echo $media->album; ?>&type=popup" onclick="popup_art('<?php echo $web_path; ?>/image.php?id=<?php echo $media->album; ?>&type=popup'); return false;"> + <a target="_blank" href="<?php echo $web_path; ?>/image.php?id=<?php echo $media->album; ?>&type=popup" onclick="popupWindow('<?php echo $web_path; ?>/image.php?id=<?php echo $media->album; ?>&type=popup'); return false;"> <img align="middle" src="<?php echo $web_path; ?>/image.php?id=<?php echo $media->album; ?>&thumb=1&sid=<?php echo session_id(); ?>" alt="<?php echo scrub_out($media->f_album_full); ?>" title="<?php echo scrub_out($media->f_album_full); ?>" height="75" width="75" /> </a> </div> diff --git a/templates/show_registration_confirmation.inc.php b/templates/show_registration_confirmation.inc.php index a0f826b7..3a2dc1a6 100644 --- a/templates/show_registration_confirmation.inc.php +++ b/templates/show_registration_confirmation.inc.php @@ -36,9 +36,9 @@ $web_path = Config::get('web_path'); <h1><?php echo scrub_out(Config::get('site_title')); ?></h1> <?php echo _('Registration Complete'); ?>... </div> -<script src="<?php echo $web_path; ?>/lib/javascript-base.js" language="javascript" type="text/javascript"></script> -<script src="<?php echo $web_path; ?>/modules/kajax/ajax.js" language="javascript" type="text/javascript"></script> <script src="<?php echo $web_path; ?>/modules/prototype/prototype.js" language="javascript" type="text/javascript"></script> +<script src="<?php echo $web_path; ?>/lib/javascript/base.js" language="javascript" type="text/javascript"></script> +<script src="<?php echo $web_path; ?>/lib/javascript/ajax.js" language="javascript" type="text/javascript"></script> <div id="maincontainer"> <?php echo _('Your account has been created. An activation key has been sent to the e-mail address you provided. Please check your e-mail for further information'); ?> <br /><br /> diff --git a/templates/show_user_activate.inc.php b/templates/show_user_activate.inc.php index d9e9c356..5b1a5fb9 100644 --- a/templates/show_user_activate.inc.php +++ b/templates/show_user_activate.inc.php @@ -37,9 +37,9 @@ $web_path = Config::get('web_path'); <?php echo _('Registration'); ?>... </div> -<script src="<?php echo $web_path; ?>/lib/javascript-base.js" language="javascript" type="text/javascript"></script> -<script src="<?php echo $web_path; ?>/modules/kajax/ajax.js" language="javascript" type="text/javascript"></script> <script src="<?php echo $web_path; ?>/modules/prototype/prototype.js" language="javascript" type="text/javascript"></script> +<script src="<?php echo $web_path; ?>/lib/javascript/base.js" language="javascript" type="text/javascript"></script> +<script src="<?php echo $web_path; ?>/lib/javascript/ajax.js" language="javascript" type="text/javascript"></script> <div id="maincontainer"> <?php diff --git a/templates/show_user_registration.inc.php b/templates/show_user_registration.inc.php index 5cf20676..d80e5019 100644 --- a/templates/show_user_registration.inc.php +++ b/templates/show_user_registration.inc.php @@ -36,9 +36,9 @@ $web_path = Config::get('web_path'); <h1><?php echo scrub_out(Config::get('site_title')); ?></h1> <?php echo _('Registration'); ?>... </div> -<script src="<?php echo $web_path; ?>/lib/javascript-base.js" language="javascript" type="text/javascript"></script> -<script src="<?php echo $web_path; ?>/modules/kajax/ajax.js" language="javascript" type="text/javascript"></script> <script src="<?php echo $web_path; ?>/modules/prototype/prototype.js" language="javascript" type="text/javascript"></script> +<script src="<?php echo $web_path; ?>/lib/javascript/base.js" language="javascript" type="text/javascript"></script> +<script src="<?php echo $web_path; ?>/lib/javascript/ajax.js" language="javascript" type="text/javascript"></script> <div id="maincontainer"> <?php |