fix js
This commit is contained in:
parent
b09706b58c
commit
12f791bab4
3 changed files with 28 additions and 50 deletions
11
index.php
11
index.php
|
@ -287,12 +287,7 @@ if ($part == 'link') {
|
|||
}
|
||||
$breadcrumb[(empty($linkid) ? __('New link') : __('Edit link'))] = '';
|
||||
$headers .=
|
||||
"<script type=\"text/javascript\">\n//<![CDATA[
|
||||
\$(function(){if(!document.getElementById){return;}
|
||||
\$('#newlinksearch').openGoogle('" . $core->auth->getInfo('user_lang') . "','#linktitle');
|
||||
\$('#newimagesearch').openAmazon('" . $core->auth->getInfo('user_lang') . "','#linktitle');
|
||||
\$('#newimageselect').fillLink('#linkimage');
|
||||
});\n//]]>\n</script>\n" .
|
||||
dcPage::jsVars(['dotclear.c2_lang' => $core->auth->getInfo('user_lang')]) .
|
||||
dcPage::jsLoad(dcPage::getPF('cinecturlink2/js/c2link.js'));
|
||||
}
|
||||
|
||||
|
@ -544,12 +539,12 @@ if ($part == "link") {
|
|||
'</label></p>
|
||||
<p><label for="linkurl">' . __('Details URL:') . ' ' .
|
||||
form::field('linkurl', 60, 255, html::escapeHTML($linkurl), 'maximal') . '</label>' .
|
||||
'<a class="modal" href="http://google.com" id="newlinksearch">' .
|
||||
'<a class="modal hidden-if-no-js" href="http://google.com" id="newlinksearch">' .
|
||||
__('Search with Google') . '</a>' .
|
||||
'</p>
|
||||
<p><label for="linkimage">' . __('Image URL:') . ' ' .
|
||||
form::field('linkimage', 60, 255, html::escapeHTML($linkimage), 'maximal') . '</label>' .
|
||||
'<a class="modal" href="http://amazon.com" id="newimagesearch">' .
|
||||
'<a class="modal hidden-if-no-js"" href="http://amazon.com" id="newimagesearch">' .
|
||||
__('Search with Amazon') . '</a>' .
|
||||
'</p>';
|
||||
|
||||
|
|
56
js/c2link.js
56
js/c2link.js
|
@ -1,34 +1,22 @@
|
|||
;if(window.jQuery) (function($){
|
||||
$.fn.openGoogle = function(lang,target){
|
||||
return this.each(function(){
|
||||
$(this).click(function(){
|
||||
var val = $(target).attr('value');
|
||||
if (val!=''){
|
||||
searchwindow=window.open('http://www.google.com/search?hl='+lang+'&q='+val,'search','scrollbars=yes,width=800,height=600,resize=yes,toolbar=yes,menubar=yes');
|
||||
searchwindow.focus();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
}
|
||||
$.fn.openAmazon = function(lang,target){
|
||||
return this.each(function(){
|
||||
$(this).click(function(){
|
||||
var val = $(target).attr('value');
|
||||
if (val!=''){
|
||||
searchwindow=window.open('http://www.amazon.fr/exec/obidos/external-search?keyword='+val+'&mode=blended','search','scrollbars=yes,width=800,height=600,resize=yes,toolbar=yes,menubar=yes');
|
||||
searchwindow.focus();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
}
|
||||
$.fn.fillLink = function(target){
|
||||
return this.each(function(){
|
||||
$(this).change(function(){
|
||||
$(target).attr('value',$(this).attr('value'));
|
||||
return false;
|
||||
});
|
||||
});
|
||||
}
|
||||
})(jQuery);
|
||||
/*global $, dotclear */
|
||||
'use strict';
|
||||
|
||||
$(function () {
|
||||
$('#newlinksearch').on('click', function () {
|
||||
this.href = '';
|
||||
var val = $('#linktitle').val();
|
||||
searchwindow=window.open('http://www.google.com/search?hl='+dotclear.c2_lang+'&q='+val,'search','scrollbars=yes,width=800,height=600,resize=yes,toolbar=yes,menubar=yes');
|
||||
searchwindow.focus();
|
||||
return false;
|
||||
});
|
||||
$('#newimagesearch').on('click', function () {
|
||||
this.href = '';
|
||||
var val = $('#linktitle').val();
|
||||
searchwindow=window.open('http://www.amazon.fr/exec/obidos/external-search?keyword='+val+'&mode=blended','search','scrollbars=yes,width=800,height=600,resize=yes,toolbar=yes,menubar=yes');
|
||||
searchwindow.focus();
|
||||
return false;
|
||||
});
|
||||
$('#newimageselect').on('change', function() {
|
||||
$('#linkimage').attr('value', $(this).val());
|
||||
});
|
||||
});
|
|
@ -1,11 +1,6 @@
|
|||
/*
|
||||
$(function() {
|
||||
// checkboxes selection
|
||||
$('.checkboxes-helpers').each(function() {
|
||||
dotclear.checkboxesHelpers(this);
|
||||
});
|
||||
});
|
||||
*/
|
||||
/*global $, dotclear */
|
||||
'use strict';
|
||||
|
||||
$(function () {
|
||||
$('.checkboxes-helpers').each(function () {
|
||||
dotclear.checkboxesHelpers(this, undefined, '#form-entries td input[type=checkbox]', '#form-entries #do-action');
|
||||
|
|
Loading…
Reference in a new issue