Item10382: simplemodal can't load content from a different topic
Priority: Normal
Current State: No Action Required
Released In: n/a
Target Release: n/a
I am trying to use the second
JQuerySimpleModal example - to load content asynchronously from a
different topic. I created a new topic in the Sandbox but it doesn't open a modal dialog.
%JQREQUIRE{"simplemodal, debug"}%
%JQICON{"email"}% <a href="#" class="jqSimpleModal {url:'%SCRIPTURLPATH{"view"}%/System/JQuerySimpleModal?skin=text;section=helpText', onSubmit:function() {alert('you clicked submit in the async example')}, onCancel:function() {alert('you cancelled the async example')}}">Contact (async)</a>: opens a modal dialog with content loaded asynchronously from a named section of a topic
I observed this behavior in Foswiki 1.1.1 using Firefox 3.6.13 and IE 8, and in Foswiki 1.1.2 using IE 7.
--
KipLubliner - 21 Feb 2011
Behavior also observed on trunk.foswiki.org
--
KipLubliner - 21 Feb 2011
Kip, please check
$Foswiki::cfg{AuthScripts}
in your configuration: if
rest
is included there, remove it and try again.
--
MichaelDaum - 21 Feb 2011
Hi Michael - I removed rest from
$Foswiki::cfg{AuthScripts}
, but it didn't make a difference. Here is the javascript error from IE.
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Mon, 21 Feb 2011 12:05:31 UTC
Message: Object doesn't support this property or method
Line: 47
Char: 9
Code: 0
URI: http://localhost/foswiki/pub/System/JQueryPlugin/plugins/simplemodal/jquery.simplemodal.init.uncompressed.js?version=1.2.3
$(function() {
// opener
$(".jqSimpleModal:not(.jqInitedSimpleModal)").livequery(function() {
var $this = $(this);
$this.addClass("jqInitedSimpleModal").click(function(e) {
--> var opts = $.extend({}, defaults, $this.metadata());
--
KipLubliner - 21 Feb 2011
I tried
var opts = $.extend({}, defaults);//, $this.metadata());
And then I got past that line (still didn't work though). So the problem must be that $this.metadata() is null.
--
KipLubliner - 21 Feb 2011
OK, now I tried
%JQREQUIRE{"simplemodal, debug, metadata"}%
It looks like it creates a tiny modal dialog square, just a few pixels wide.
--
KipLubliner - 22 Feb 2011
I think the problem is that simplemodal depends on metadata, which wasn't specified. That has since been fixed.
Can you try the latest version of the
JQueryPlugin and see if you are still having problems?
--
AndrewJones - 20 Oct 2011
I put the code fragment in
KipLubliner, and it
almost works perfectly. The popup shows, but the buttons are not rendered correctly.
--
KipLubliner - 17 Nov 2011
Closing due to inactivity. Simplemodal isn't aging well. A better alternative is the jquery-ui-dialog component also shipped with foswiki.
--
MichaelDaum - 12 Oct 2013