PageSourceSearch

https://www.sfatulmedicului.ro/external/js/new/pagina-analize.js

js sfatulmedicului.ro collected 2026-10-01 11:43:42 UTC 4,475 bytes, 120 lines download raw bytes

1$(window).load(function(){
2	
3	//click pe analiza
4	$('#wrapperListaAnalize').click(function(e){
5		e.preventDefault();
6		var target = e.target,
7			$target = $(target);
8        
9		if (target.nodeName === 'A') {
10			var parent = $target.parent(),
11				rel = $target.attr('rel'),
12				target = $('#tabelAnalize');
13            
14			cloned = $target.clone()
15				.appendTo(parent)
16				.css({
17					position: 'absolute',
18					top: $target.position().top+'px',
19					left: $target.position().left+'px',
20					background: 'none'
21				})
22				.animate({
23					top: target.height() + target.position().top+'px',
24					left: target.position().left+'px'
25				}, function(){
26                    var id = rel.replace('v','');
27					$('#tabelAnalize tr:last').after('<tr><td><label for="'+rel+'">'+$target.text()+'</label></td><td><input type="text" name="valoare'+id+'" id="'+rel+'" class="text" placeholder="0" /><input type="hidden" name="'+id+'" value="'+id+'" /></td><td id="select'+id+'"></td><td><a href="#" title="Sterge aceasta analiza" rel="'+rel+'" class="starge-analiza"></a></td></tr>');
28					parent.hide();
29					cloned.remove();                                          
30                    
31                    $.ajax({
32                        type: "POST",
33                        url:"index.php?module=AnalizePrezentare&action=addProduct&productId="+id,                        
34                        success: function(msg){
35                           $('#select'+id).append(msg); 
36                        }
37                    }); 
38				});
39		}
40	});
41	
42	//click pe sterge analiza
43	$('.starge-analiza').live('click', function(event){
44		event.preventDefault();
45		$(this).closest('tr').remove();
46		$('.lista-analize a[rel='+$(this).attr( 'rel' )+']').parent().show();
47    });
48    
49    
50    //autocomplete
51    if ($( "#autoinput" ).length)
52    $( "#autoinput" ).autocomplete({
53        source: "index.php?module=AnalizePrezentare&action=search",
54        minLength: 1,
55        focus: function( event, ui ) {
56            $( "#autoinput" ).val( ui.item.label );
57            return false;
58        },
59        select: function( event, ui ) {
60            $( "#autoinput" ).val( ui.item.label );
61            $( "#autoinput-id" ).val( ui.item.id ); 
62			adauga_analiza( ui.item.id );
63			return false;
64        }
65    }) 
66    .data( "autocomplete" )._renderItem = function( ul, item) {
67        return $( "<li id="+item.id+"></li>" )
68            .data( "item.autocomplete", item )
69            .append( $( "<a></a>" ).text( item.label ) )
70            .appendTo( ul );
71    };
72
73
74
75
76});
77
78function adauga_analiza(productId){
79
80    if (productId!=0)
81    {
82        $text = $('#autoinput').val();
83
84        //$target = $( "<li id="+productId+" style='list-style:none;'>"+$text+"</li>" );        
85        $target = $( "#autoinput" );
86        
87         
88        var parent = $target.parent(),
89            rel = productId,
90            target = $('#tabelAnalize');
91        
92        cloned = $target.clone()
93            .appendTo(target)
94            .css({
95                position: 'absolute',
96                top: $target.position().top+'px',
97                left: $target.position().left+'px',               
98                background: 'none'
99            })
100            .animate({
101                top: target.height() + target.position().top+'px',
102                left: target.position().left+'px'
103            }, function(){                
104                var id = rel;
105                $('#tabelAnalize tr:last').after('<tr><td><label for="'+rel+'">'+$target.val()+'</label></td><td><input type="text" name="valoare'+id+'" id="'+rel+'" class="text" value="0" /><input type="hidden" name="'+id+'" value="'+id+'" /></td><td id="select'+id+'"></td><td><a href="#" title="Sterge aceasta analiza" rel="'+rel+'" class="starge-analiza"></a></td></tr>');
106                //parent.hide();
107                cloned.remove();                                          
108                
109                $.ajax({
110                    type: "POST",
111                    url:"index.php?module=AnalizePrezentare&action=addProduct&productId="+id,                        
112                    success: function(msg){
113                       $('#select'+id).append(msg); 
114                    }
115                });
116                $('#autoinput').val('');
117                $('#autoinput-id').val('');  
118            });  
119    }
120}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.