JQueryPluin installation is not functional. - BUTTON does not work

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

JQueryPluin installation is not functional. - BUTTON does not work

BramVanOosterhout
Hi all,
I have installed JQueryPlugin 6.10 in Foswiki-1.1.5, Tue, 10 Apr 2012, build
14595, Plugin API version 2.2.
On:

SERVER_SIGNATURE
Apache/2.2.14 (Ubuntu) Server at 192.168.1.165 Port 80
 
SERVER_SOFTWARE
Apache/2.2.14 (Ubuntu)

Operating system
Linux 2.6.42-37-generic (i486-linux-gnu-thread-multi)

Perl version
5.010.001 (linux)
 
I used manual install (untar the tarball).


There were no error messages on installation startup, in the log or in the
Apache logs.
There are 6 warnings for about Jquery (sub?)plugins being deprecated
There is 1 warning about Chili highlighter plugin related to Firefox/Safari.

However, I find that the Submit button on the System Web>JQueryPlugin page  
is not functional.

When I click the button, the page is refreshed and positioned at the top.

The same action on http://foswiki.org/Extensions/JQueryPlugin#BUTTON does
present the expected popup in the same web browser on the same client machine.

I have no experience with javascript at all. I have no idea how to debug
this.

====
I also noticed the dependency of JSON listed on the JQUERY page. I have no
idea what JSON is. Reading the JSON entries on google I cannot find anything
that points me to a download required.

===
The following is a comparison of the html/javascript rendered from my
installation and from the foswiki site.

COMPARING the two I notice:
  <a  class='jqButton  {onclick:                VERSUS
  <a  class='jqButton jqButtonDefault {onclick:

But I have NO IDEA about the meaning, significance or source of
jqButtonDefault

>From my installation:
<li> Expands as:
 <div>
  <a  class='jqButton  {onclick:function(){confirm(&#39;Are your sure?
&#39;);return false;}}'       href='#'>
   <span> Submit
   </span>
  </a>  
  <a  class='jqButton '
href='http://192.168.1.165/foswiki/bin/view/System/VarBUTTON'>
   <span>
    <span class='jqButtonIcon' style='background-image:url              
(/foswiki/pub/System/FamFamFamSilkIcons/cross.png)'>Cancel
    </span>
   </span>
  </a>
  <span class='foswikiClear'></span>
 </div>
</li>


>From foswiki source
<li> Expands as:
 <div>
  <a  class='jqButton jqButtonDefault {onclick:function(){confirm(&#39;Are
your sure?&#39;);return       false;}}' href='#'>
   <span> Submit
   </span>
  </a>  
  <a  class='jqButton jqButtonDefault {onclick:function()
{;window.location.href&#61;&#34;http://foswiki.org/Extensions/VarBUTTON&#34;;r
eturn false;}}' href='#'>
   <span>
    <span class='jqButtonIcon' style='background-image:url            
(/pub/System/FamFamFamSilkIcons/cross.png)'>Cancel
    </span>
   </span>
  </a>
  <span class='foswikiClear'> </span>
 </div>
</li>

Any assistance gratefully accepted.
--
Bram van Oosterhout


------------------------------------------------------------------------------
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
Reply | Threaded
Open this post in threaded view
|

Re: JQueryPluin installation is not functional. - BUTTON does not work

Jan Krüger
Hi Bram,

> I have no experience with javascript at all. I have no idea how to debug
> this.

The first step is to press F12 before navigating to the page that is giving you trouble. In all reasonably modern browsers this will open the developer tools bar which contains a "console" tab (in IE11 the tabs are the icons to the left). Error messages from running JavaScript code are collected there (in Firefox you get extra information about network requests that is irrelevant for our situation; you can disable that by toggling the "Net" button).

Please check to see if any error messages come up while/after loading the page but BEFORE you click the button. Errors that happen at this point can prevent the button click from being handled correctly. If you see any error messages (often marked red), please share them with us so we have some more information to work from.

> I also noticed the dependency of JSON listed on the JQUERY page. I have no
> idea what JSON is. Reading the JSON entries on google I cannot find anything
> that points me to a download required.

This is a Perl module that needs to be installed on the server (JSON is an encoding for structured data, and the module is for working with this encoding). If you have console access to the server, you can use this to check whether the module is installed:

    perl -MJSON

If you don't get any error message, that means the module is installed and you can cancel the test using Ctrl-C. If it turns out the module isn't there, you'll need to install it. If you're running Foswiki on Linux, chances are that your system has a package manager that has this package in its database and can download and install it for you. For now I'm going to assume that if you have console access to the server you know how this works. If there is no package manager available, Perl comes with its own system for installing modules:

    cpan JSON

IMO this shouldn't be your first choice, though, because package managers make maintenance much, much easier.

> COMPARING the two I notice:
>  <a  class='jqButton  {onclick:                VERSUS
>  <a  class='jqButton jqButtonDefault {onclick:

This difference isn't important for the result -- at least it doesn't make any difference on the JavaScript side. That you're getting this kind of output at all means that JQueryPlugin loaded properly and the problem is probably on the browser side, maybe due to other scripts that are breaking things.

-Jan

--
Jan Krüger
Softwareentwickler
Modell Aachen GmbH - Interaktive Managementsysteme
Dennewartstr. 25-27, 52068 Aachen
Tel. +49 (0)241 5380 8720
Fax +49 (0)241 9148 8653
http://modell-aachen.de/ 
http://www.q-wiki.com/ 

Geschäftsführung: Dr.-Ing. Carsten Behrens
Amtsgericht Aachen, HRB 15622

------------------------------------------------------------------------------
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
Reply | Threaded
Open this post in threaded view
|

Re: JQueryPluin installation is not functional.

BramVanOosterhout
Hi Jan,
Thanks for the prompt response. Below are some more observations:

Re: Please check to see if any error messages come up while/after loading the
page

I pressed F12 and got the following results on pageload. Nothing more
happened when I pressed the Submit button.:
===
On pageload the debugger breaks twice in the code below with the message
shown at X.
Tab jquery.b..essed.js
---
1 jQuery(function($) {
2  $(".jqButton:not(.jqInitedButton)").livequery(function() {
3   var $this = 2   $(this),
4     opts = $.extend({}, $this.metadata()),
5      form;
6
7    $this.addClass("jqInitedButton")            <<<<<<<<<<< HERE (first time)
8      .on("mouseenter", function() {
9        $this.addClass("jqButtonHover");
10     }).on("mouseleave", function() {
11       $this.removeClass("jqButtonHover");     <<<<<<<<<<< HERE (secon time)
12     });
X Object doesn't support property or method 'on'  <<< ERROR info
13
14   // submit button
15   if ($this.is(".jqSubmitButton")) {
16     $this.on("click", function() {
17       $this.closest("form").submit();
18       return false;
19     });
20   }
---

The console shows 4 messages:
HTML1300: Navigation occurred.
File: JQueryPlugin
HTML1524: Invalid HTML5 DOCTYPE. Consider using the interoperable form "<!
DOCTYPE html>".
File: JQueryPlugin, Line: 1, Column: 1
SCRIPT438: Object doesn't support property or method 'on'
File: jquery.button.init.uncompressed.js, Line: 7, Column: 5
SCRIPT438: Object doesn't support property or method 'on'
File: jquery.button.init.uncompressed.js, Line: 7, Column: 5
===
As I said above. No more action when pressing the Submit button on the
rendered page.

Re: [JSON]is a Perl module that needs to be installed on the server
Thanks for the pointer. JSON was not there
I have installed it from CPAN, before I conducted the experiments above

Re: This difference isn't important for the result
Thanks for the reassurance. I will ignore this for the time being.

Re: the problem is probably on the browser side
Well, yes in that "it" does not work.
But no, because "it" is the code that arrives on the browser side from the
server. The exact same page does operate correctly when displayed from the
foswiki.org server. The page from foswiki.org loads without errors. So
something is not working in generating the correct page content.

Thanks for your suggestions. regards..
--
Bram van Oosterhout


------------------------------------------------------------------------------
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
Reply | Threaded
Open this post in threaded view
|

Re: JQueryPluin installation is not functional.

Chris Hoefler
Go to /bin/configure, select JQueryPlugin, and click "use default" for both JQueryVersion and JQueryVersionForOldIEs. The problem is that you are either using an old pre v1.7 jQuery (unlikely), or you are using IE <v9 with jQuery v2.x.

FYI, unless you know exactly what you are doing, it is probably best to install plugins via /bin/configure rather than manually. If you don't handle dependencies, permissions, or configuration properly, you will break things. And since you are using Ubuntu, all of the perl modules you will need (with the exception a a very small few) are in the package repository. It is ok to use CPAN, but the repository packages are better supported by the distribution maintainers.



On Wed, Jun 3, 2015 at 8:35 AM, Bram van Oosterhout <[hidden email]> wrote:
Hi Jan,
Thanks for the prompt response. Below are some more observations:

Re: Please check to see if any error messages come up while/after loading the
page

I pressed F12 and got the following results on pageload. Nothing more
happened when I pressed the Submit button.:
===
On pageload the debugger breaks twice in the code below with the message
shown at X.
Tab jquery.b..essed.js
---
1 jQuery(function($) {
2  $(".jqButton:not(.jqInitedButton)").livequery(function() {
3   var $this = 2   $(this),
4     opts = $.extend({}, $this.metadata()),
5      form;
6
7    $this.addClass("jqInitedButton")            <<<<<<<<<<< HERE (first time)
8      .on("mouseenter", function() {
9        $this.addClass("jqButtonHover");
10     }).on("mouseleave", function() {
11       $this.removeClass("jqButtonHover");     <<<<<<<<<<< HERE (secon time)
12     });
X Object doesn't support property or method 'on'  <<< ERROR info
13
14   // submit button
15   if ($this.is(".jqSubmitButton")) {
16     $this.on("click", function() {
17       $this.closest("form").submit();
18       return false;
19     });
20   }
---

The console shows 4 messages:
HTML1300: Navigation occurred.
File: JQueryPlugin
HTML1524: Invalid HTML5 DOCTYPE. Consider using the interoperable form "<!
DOCTYPE html>".
File: JQueryPlugin, Line: 1, Column: 1
SCRIPT438: Object doesn't support property or method 'on'
File: jquery.button.init.uncompressed.js, Line: 7, Column: 5
SCRIPT438: Object doesn't support property or method 'on'
File: jquery.button.init.uncompressed.js, Line: 7, Column: 5
===
As I said above. No more action when pressing the Submit button on the
rendered page.

Re: [JSON]is a Perl module that needs to be installed on the server
Thanks for the pointer. JSON was not there
I have installed it from CPAN, before I conducted the experiments above

Re: This difference isn't important for the result
Thanks for the reassurance. I will ignore this for the time being.

Re: the problem is probably on the browser side
Well, yes in that "it" does not work.
But no, because "it" is the code that arrives on the browser side from the
server. The exact same page does operate correctly when displayed from the
foswiki.org server. The page from foswiki.org loads without errors. So
something is not working in generating the correct page content.

Thanks for your suggestions. regards..
--
Bram van Oosterhout


------------------------------------------------------------------------------
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss

------------------------------------------------------------------------------

_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
Reply | Threaded
Open this post in threaded view
|

Re: JQueryPluin installation is not functional.

BramVanOosterhout

Hi Chris,

Thanks for your response. I reset the versions and the problem is resolved! :-)

For reference:

My browser is IE 11.0.19

JQueryVersion  was: 1.4.3. Set to default: 2.1.3

JQueryVersionForOldIEs was 1.11.2. Default is: 1.11.2

I have summarised the issue and resolution in the support web: http://foswiki.org/Support/Question1610

In response to your suggestions:

Re: best to install plugins via /bin/configure rather than manually.

I agree, but it did not work. It timed out in the browser.

I tried the ..._installer from the command line. That failed with:

### ERROR ### This installer must be run from the root directory of a Foswiki installation

Using the debugger I found this was because: the installer cannot find: lib/LocalSite.cfg . I have not investigated why LocalSite.cfg does not exist.

So I chose to install through untarring the tarbal and setting the protection and ownership by hand. Configure does indicate errors, for which I am grateful!

Re:  Ubuntu, all of the perl modules you will need (with the exception a a very small few) are in the package repository

This installation was originally installed using the package repository... 3 years ago. I will attempt an upgrade. That may prevent some other problems in the future. Thanks for the suggestion.

Thanks again for the prompt advice.

--
Bram van Oosterhout


------------------------------------------------------------------------------

_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss

Reply | Threaded
Open this post in threaded view
|

Re: JQueryPluin installation is not functional.

Chris Hoefler
Hmm, that is surprising. I didn't think JQueryPlugin would bundle such an old version of jQuery. Anywho, glad it is resolved.

This installation was originally installed using the package repository... 3 years ago. I will attempt an upgrade. That may prevent some other problems in the future. Thanks for the suggestion.

Ah, I think I know the problem. You installed Foswiki itself from the repository. This means that everything you do has to be from the repository. The plugins and contribs (not all and not the most recent versions, unfortunately) have to be installed from the repository. The usual plugin installers clash with the managed packages in some way that breaks things. I did it this way once, but it wasn't very flexible because new updates to the plugins would come out and they wouldn't get packaged, or something similar.

I do it a bit differently now. I install all of the normal system-level packages via the repository (web server, perl, libperl modules, occasional extra dependencies like graphviz and imagemagick needed by some plugins). Foswiki I download and install directly into DocumentRoot and use as a third-party source. It requires some manual effort to make sure the perms and configs are right, but it is well-documented in the InstallationGuide. Then you can use Foswiki's built-in tools to manage plugin installation, updates, and configuration. I think this provides the maximum flexibility without being too painful, but YMMV.


On Jun 3, 2015, at 9:41 PM, "Bram van Oosterhout" <[hidden email]> wrote:

Hi Chris,

Thanks for your response. I reset the versions and the problem is resolved! :-)

For reference:

My browser is IE 11.0.19

JQueryVersion  was: 1.4.3. Set to default: 2.1.3

JQueryVersionForOldIEs was 1.11.2. Default is: 1.11.2

I have summarised the issue and resolution in the support web: http://foswiki.org/Support/Question1610

In response to your suggestions:

Re: best to install plugins via /bin/configure rather than manually.

I agree, but it did not work. It timed out in the browser.

I tried the ..._installer from the command line. That failed with:

### ERROR ### This installer must be run from the root directory of a Foswiki installation

Using the debugger I found this was because: the installer cannot find: lib/LocalSite.cfg . I have not investigated why LocalSite.cfg does not exist.

So I chose to install through untarring the tarbal and setting the protection and ownership by hand. Configure does indicate errors, for which I am grateful!

Re:  Ubuntu, all of the perl modules you will need (with the exception a a very small few) are in the package repository

This installation was originally installed using the package repository... 3 years ago. I will attempt an upgrade. That may prevent some other problems in the future. Thanks for the suggestion.

Thanks again for the prompt advice.

--
Bram van Oosterhout

------------------------------------------------------------------------------
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss

------------------------------------------------------------------------------

_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss