If you have a selection view for the autocomplete widget, when you start typing drupal offers you a list of different options to choose for the autocomplete field.

If you are using FF3 then you select from the list an item (with the mouse or keyboard) then the preview displays fine the selected option. (the same with the nodereference explorer jQuery UI, once you have selected an item this is shown fine in the nodereference field and the preview)

But with IE7, Safari and Chrome this change event on this field doesn't execute the Drupal.nodereference_explorer.preview.getPreview function in explorer.preview.js.
Sometimes the 'Preview loading, please wait...' message is shown but there is not preview load.

What is weird as well is that if you edit the obtained result from the view, i.e Name of my node [nid:222], and change something from the text (not the [nid:xxx]) and press tab to force a field change, then the change event is fired and the getPreview works fine.

I am using jQuery_UI module with no jquery_update.

Comments

gnindl’s picture

I only tested IE 8, it's working fine (for me). Do you have any error messages or it just doesn't execute? Maybe this is a Jquery bug. Do you use jQuery UI 1.6?

jcmarco’s picture

I am working with IE7, Safari 4 and Chrome 3.

Let me start again all the tests and I will try to get all the most possible information.

I am doing the tests with JQuery 1.2.6 from the default installation with JQuery UI 1.6,

With FF 3.5: The previews display works fine selecting from the autocomplete form , and the JQuery UI starts fine, the same with the preview image from a selected image

With Safari 4: The preview doesnt' work and the JQ UI starts fine, previewing the selected image works fine.

With Chrome 3: The Preview doesn't work and JQ UI Dialog starts fine, previewing the selected image works fine.

With IE 7: Previews doesn't work and dialog ui neither:

Using IE debugger: there is an execution time error about a bug in line 102 saying that was waiting for a identifier, string or number
running the Microsoft Script Editor there is an error about a compilation error from Microsoft JScript, same than before about the identifier, string or number:
for (var i in scripts) {
var src = scripts[i];
if (!$('script[src='+ src + ']').length && !Drupal.nodereference_explorer.addedJS[src]) {
// Get the script from the server and execute it.
$.ajax({
type: 'GET',
url: src,
dataType: 'script',
async : false,
success: function(script) {
eval(script); >>>>>>>>>>>>>>>>>>>>>>>>> Here is the error
}
});
The script is explorer.dialog.js

With IE8: Previews doesn't work and dialog UI works fine

I will try to test again later with JQuery Update running jQuery 1.3.2 and JQ UI 1.7.

jcmarco’s picture

Status: Active » Needs review
StatusFileSize
new578 bytes

Well,
we have two issues here:
1. about showing the preview from the autocomplete field
2. launching the jQuery UI Dialog with IE7

For first one I found this fix:
in explorer.preview.js: line 30
//attach change action to core widget, triggered when dialog returns a value
//as well as using autocomplete functionality
$(widget).blur(function() { <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
var val = $(this).val(); //current value
if (val != '') //placeholder while preview loads
$(preview).text(Drupal.t('Preview loading, please wait...'));
Drupal.nodereference_explorer.preview.getPreview(preview, path, $(this).val());
});

Changing change event for blur event works great in all browsers.

jcmarco’s picture

StatusFileSize
new984 bytes

Wrong patch, before I forgot to change the event function.

But I found now some problems when returning a value from the Dialog UI.

With Blur:
- FF 3.5, Chrome 3 and IE 7: when loading a node edit form it updated the preview, and when you select a value coming from an autocomplete view selection (with the autocomplete view selection you can show in de popup a description text from the node found in the autocomplete)

But with blur the dialog UI doesn't update the preview.

jcmarco’s picture

I changed the jquery change events in:
nodereference_explorer_plugin_cck_nodereference.js
nodereference_explorer_plugin_cck_link.js

for the blur ones, and together last patch, now I am able to:
- when editing a node with existing nodereference_explorer fields it loads the previews
- when updating the field from the autocomplete selection view options, the preview is updated
- when selecting a node from the Dialog UI the previews is updated in the edit form

This works fine with FF3.5, Chrome 3, Safari 4, with IE7 (I couldn't test las action because I have problems to start the Dialog UI because a problem already reported before)

I only tested the nodeference ones, I guess the link plugins should perform in the same way as it is about how browser manage events. Please test it to confirm.

jcmarco’s picture

I solved the second error regarding Dialog UI in IE7 in #534400: Dialog UI not working in IE7

gnindl’s picture

Assigned: Unassigned » gnindl
Status: Needs review » Fixed

Patches committed to repository and included in 1.1-beta5

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.