Explorar el Código

Migrating to jQuery the feed feature.

ravenlp hace 17 años
padre
commit
27ef090425
Se han modificado 2 ficheros con 7 adiciones y 8 borrados
  1. 2 1
      admin/feeds.php
  2. 5 7
      admin/scripts/tools.js

+ 2 - 1
admin/feeds.php Ver fichero

@@ -51,6 +51,7 @@ if ($user->isAdmin()) {
51 51
 			$("#divMessages").fadeOut(5000,function(){
52 52
 				$("#divMessages").css({display:"none"});
53 53
 			});
54
+			$("#source").change(function (){selectFeedType('<?php echo __("Feed Url:")?>','<?php echo __(" username:")?>')})
54 55
 		});
55 56
 		</script>
56 57
 		<style type="text/css" media="screen">	
@@ -84,7 +85,7 @@ if ($user->isAdmin()) {
84 85
 						<ul>
85 86
 							<li>
86 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 89
                                 	<option value="Rss" selected="selected">Rss/atom Feed</option>
89 90
                                     <option value="Twitter">Twitter</option>
90 91
                                     <option value="Youtube">Youtube</option>

+ 5 - 7
admin/scripts/tools.js Ver fichero

@@ -48,13 +48,11 @@ function exit(el, path) {
48 48
 }
49 49
 
50 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 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
-