|
11 | 11 | $tl=$_REQUEST["tl"]; |
12 | 12 | setcookie("googtrans", '/'.$sl.'/'.$tl, time() + 60, "/"); |
13 | 13 | } |
14 | | -if(isset ($_REQUEST["offset"])) { $pos = $_REQUEST["offset"]; |
| 14 | +if(isset($_REQUEST["offset"])) { $pos = $_REQUEST["offset"]; |
15 | 15 | } |
16 | 16 | if (isset($_REQUEST['term'])) { |
17 | 17 | $cnt=0; |
|
88 | 88 | $('h3,h4,title').addClass('notranslate'); |
89 | 89 | $(window).load(function() { |
90 | 90 | $('[name="form1"]').submit(function() { |
91 | | - $('[name="WoTranslation"]').attr('name',$('[name="WoTranslation"]').attr('data_name')); |
92 | | - window.parent.frames['ru'].location.href = 'empty.htm'; |
93 | | - return true; |
| 91 | + $('[name="WoTranslation"]').attr('name',$('[name="WoTranslation"]').attr('data_name')); |
| 92 | + window.parent.frames['ru'].location.href = 'empty.htm'; |
| 93 | + return true; |
94 | 94 | }); |
95 | 95 | $('td').hoverIntent({over: function() {$( this ).addClass('hover');}, out: function() {$( this ).removeClass('hover');}, interval: 150,selector:"span.dict1, span.dict2, span.dict3"}); |
96 | 96 |
|
97 | 97 | $('td').on('click','span.dict1, span.dict2, span.dict3',function(){ |
98 | | - if($(this).hasClass( "dict1" ))WBLINK=WBLINK1; |
99 | | - if($(this).hasClass( "dict2" ))WBLINK=WBLINK2; |
100 | | - if($(this).hasClass( "dict3" ))WBLINK=WBLINK3; |
101 | | - if((WBLINK.substr(0,8) == '*http://') || (WBLINK.substr(0,9) == '*https://')) { |
102 | | - owin(createTheDictUrl(WBLINK.replace('*',''),$(this).parent().prev().text())); |
103 | | - } |
104 | | - else{ |
105 | | - window.parent.frames['ru'].location.href = createTheDictUrl(WBLINK,$(this).parent().prev().text()); |
106 | | - } |
107 | | - $('[name="WoTranslation"]').attr('name',$('[name="WoTranslation"]').attr('data_name')); |
108 | | - el=$(this).parent().parent().next().children(); |
109 | | - el.attr('data_name',el.attr('name')); |
110 | | - el.attr('name','WoTranslation'); |
| 98 | + if($(this).hasClass( "dict1" ))WBLINK=WBLINK1; |
| 99 | + if($(this).hasClass( "dict2" ))WBLINK=WBLINK2; |
| 100 | + if($(this).hasClass( "dict3" ))WBLINK=WBLINK3; |
| 101 | + if((WBLINK.substr(0,8) == '*http://') || (WBLINK.substr(0,9) == '*https://')) { |
| 102 | + owin(createTheDictUrl(WBLINK.replace('*',''),$(this).parent().prev().text())); |
| 103 | + } |
| 104 | + else{ |
| 105 | + window.parent.frames['ru'].location.href = createTheDictUrl(WBLINK,$(this).parent().prev().text()); |
| 106 | + } |
| 107 | + $('[name="WoTranslation"]').attr('name',$('[name="WoTranslation"]').attr('data_name')); |
| 108 | + el=$(this).parent().parent().next().children(); |
| 109 | + el.attr('data_name',el.attr('name')); |
| 110 | + el.attr('name','WoTranslation'); |
111 | 111 | }) |
112 | 112 | .on('click','.del_trans',function(){$(this).prev().val('').focus();}); |
113 | | - var myVar = setInterval(function(){ |
114 | | - if( $( ".trans>font" ).length == $( ".trans" ).length){ |
115 | | - $('.trans').each(function() { |
116 | | - var txt=$(this).text(); |
117 | | - var cnt= $(this).attr('id').replace('Trans_', ''); |
118 | | - $(this).addClass('notranslate').html('<input type="text" name="term[' + cnt + '][trans]" value="' + txt + '" maxlength="100" size="35"></input><div class="del_trans"></div>'); |
119 | | - }); |
120 | | - $('.term').each(function(){ |
121 | | - txt=$(this).text(); |
122 | | - $(this).parent().css('position','relative'); |
123 | | - $(this).after('<div class="dict"><?php if(!empty($wb1)) { echo '<span class="dict1">D1</span>'; |
| 113 | + var myVar = setInterval(function(){ |
| 114 | + if( $( ".trans>font" ).length == $( ".trans" ).length){ |
| 115 | + $('.trans').each(function() { |
| 116 | + var txt=$(this).text(); |
| 117 | + var cnt= $(this).attr('id').replace('Trans_', ''); |
| 118 | + $(this).addClass('notranslate').html('<input type="text" name="term[' + cnt + '][trans]" value="' + txt + '" maxlength="100" size="35"></input><div class="del_trans"></div>'); |
| 119 | + }); |
| 120 | + $('.term').each(function(){ |
| 121 | + txt=$(this).text(); |
| 122 | + $(this).parent().css('position','relative'); |
| 123 | + $(this).after('<div class="dict"><?php if(!empty($wb1)) { echo '<span class="dict1">D1</span>'; |
124 | 124 | } |
125 | 125 | if(!empty($wb2)) { echo '<span class="dict2">D2</span>'; |
126 | 126 | } |
127 | 127 | if(!empty($wb1)) { echo '<span class="dict3">GTr</span>'; |
128 | 128 | } ?></div>'); |
129 | | - }); |
130 | | - $('iframe,#google_translate_element').remove(); |
131 | | - selectToggle(true,'form1'); |
132 | | - $('[name^=term]').prop('disabled', false); |
133 | | - clearInterval(myVar); |
134 | | - } |
135 | | - }, 300); |
| 129 | + }); |
| 130 | + $('iframe,#google_translate_element').remove(); |
| 131 | + selectToggle(true,'form1'); |
| 132 | + $('[name^=term]').prop('disabled', false); |
| 133 | + clearInterval(myVar); |
| 134 | + } |
| 135 | + }, 300); |
136 | 136 | }); |
137 | 137 | $(document).ready( function() { |
138 | | - window.parent.frames['ru'].location.href = 'empty.htm'; |
139 | | - $('input[type="checkbox"]').change(function(){ |
140 | | - var v = parseInt($(this).val()); |
141 | | - var e = '[name=term\\[' + v + '\\]\\[text\\]],[name=term\\[' + v + '\\]\\[lg\\]],[name=term\\[' + v + '\\]\\[status\\]]'; |
142 | | - if(this.checked){ |
143 | | - $(e).prop('disabled', false); |
144 | | - $('#Trans_'+v+' input').prop('disabled', false); |
145 | | - if($('input[type="checkbox"]:checked').length){$('input[type="submit"]').val('Save');} |
146 | | - } |
147 | | - else{ |
148 | | - $(e).prop('disabled', true);$('#Trans_'+v+' input').prop('disabled', true); |
149 | | - if(!$('input[type="checkbox"]:checked').length){if(!$('input[name="offset"]').length)v='End';else v='Next';$('input[type="submit"]').val(v);} |
150 | | - } |
151 | | - }); |
| 138 | + window.parent.frames['ru'].location.href = 'empty.htm'; |
| 139 | + $('input[type="checkbox"]').change(function(){ |
| 140 | + var v = parseInt($(this).val()); |
| 141 | + var e = '[name=term\\[' + v + '\\]\\[text\\]],[name=term\\[' + v + '\\]\\[lg\\]],[name=term\\[' + v + '\\]\\[status\\]]'; |
| 142 | + if(this.checked){ |
| 143 | + $(e).prop('disabled', false); |
| 144 | + $('#Trans_'+v+' input').prop('disabled', false); |
| 145 | + if($('input[type="checkbox"]:checked').length){$('input[type="submit"]').val('Save');} |
| 146 | + } |
| 147 | + else{ |
| 148 | + $(e).prop('disabled', true);$('#Trans_'+v+' input').prop('disabled', true); |
| 149 | + if(!$('input[type="checkbox"]:checked').length){if(!$('input[name="offset"]').length)v='End';else v='Next';$('input[type="submit"]').val(v);} |
| 150 | + } |
| 151 | + }); |
152 | 152 | }); |
153 | 153 | function googleTranslateElementInit() { |
154 | 154 | new google.translate.TranslateElement({pageLanguage: '<?php echo $sl; ?>', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, includedLanguages: '<?php echo $tl; ?>', autoDisplay: false}, 'google_translate_element'); |
|
0 commit comments