Browse Source

Migrating to jQuery the feed feature.

ravenlp 17 years ago
parent
commit
27ef090425
2 changed files with 7 additions and 8 deletions
  1. 2 1
      admin/feeds.php
  2. 5 7
      admin/scripts/tools.js

+ 2 - 1
admin/feeds.php View File

51
 			$("#divMessages").fadeOut(5000,function(){
51
 			$("#divMessages").fadeOut(5000,function(){
52
 				$("#divMessages").css({display:"none"});
52
 				$("#divMessages").css({display:"none"});
53
 			});
53
 			});
54
+			$("#source").change(function (){selectFeedType('<?php echo __("Feed Url:")?>','<?php echo __(" username:")?>')})
54
 		});
55
 		});
55
 		</script>
56
 		</script>
56
 		<style type="text/css" media="screen">	
57
 		<style type="text/css" media="screen">	
84
 						<ul>
85
 						<ul>
85
 							<li>
86
 							<li>
86
 								<label for="source"><?php echo __("Import data from:")?></label>
87
 								<label for="source"><?php echo __("Import data from:")?></label>
87
-								<select name="source" id="source" onchange="selectFeedType('<?php echo __("Feed Url:")?>','<?php echo __(" username:")?>' )">
88
+								<select name="source" id="source">
88
                                 	<option value="Rss" selected="selected">Rss/atom Feed</option>
89
                                 	<option value="Rss" selected="selected">Rss/atom Feed</option>
89
                                     <option value="Twitter">Twitter</option>
90
                                     <option value="Twitter">Twitter</option>
90
                                     <option value="Youtube">Youtube</option>
91
                                     <option value="Youtube">Youtube</option>

+ 5 - 7
admin/scripts/tools.js View File

48
 }
48
 }
49
 
49
 
50
 function selectFeedType(feed_url,username){
50
 function selectFeedType(feed_url,username){
51
-		var source = $('source');
52
-		if(source.selectedIndex != 0){
53
-			$('import_as').style.display="none";
54
-			$('url_label').firstChild.nodeValue = source[source.selectedIndex].firstChild.nodeValue + username;
51
+		if( $('#source').val() != 'Rss'){
52
+			$('#import_as').hide();
53
+			$('#url_label').text($('#source').val() + username) ;
55
 		}else{
54
 		}else{
56
-			$('import_as').style.display="block";
57
-			$('url_label').firstChild.nodeValue = feed_url;
55
+			$('#import_as').show();
56
+			$('#url_label').text(feed_url);
58
 		}
57
 		}
59
 }
58
 }
60
-