Quantcast

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

JIRA noreply@jenkins-ci.org
Issue Type: Bug Bug
Assignee: Jesse Glick
Components: core
Created: 24/Oct/12 10:52 PM
Description:

The contents of the bind expression, and any further contents of your <script>, are dumped outside of any script block and appear as plain text in the web page.

Adding <st:adjunct includes="org.kohsuke.stapler.bind"/> first solves that problem, but now your <script> block is not run at all.

Environment: 1.424
Project: Jenkins
Labels: javascript
Priority: Major Major
Reporter: Jesse Glick
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

JIRA noreply@jenkins-ci.org
Jesse Glick commented on Bug JENKINS-15617

…since as per http://stackoverflow.com/questions/4619668/executing-script-inside-div-retrieved-by-ajax scripts included in dynamically inserted content are not executed. You can work around this in general by using a st:adjunct of your own JavaScript, but this cannot work when st:bind has to produce part of that JavaScript since an adjunct is static.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

Demo: hpi:run; create job; add demo builder; click Test; nothing happens. Save job (with builder), Configure again; now Test works.

Change By: Jesse Glick (25/Oct/12 12:05 AM)
Attachment: JENKINS-15617.zip
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Jesse Glick commented on Bug JENKINS-15617

The latter problem is not quite true: <script> is run but in a nonglobal context so any definitions must be prefixed with window. in order to be accessible later.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

Code changed in jenkins
User: Kohsuke Kawaguchi
Path:
war/src/main/webapp/scripts/hudson-behavior.js
http://jenkins-ci.org/commit/jenkins/51f508ba371ee222dced304c4a77a9b1b4ca37db
Log:
[FIXED JENKINS-15617]

Evaluate script in global context.
See http://perfectionkills.com/global-eval-what-are-the-options/ for how
to evaluate JavaScript in global context.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Change By: SCM/JIRA link daemon (25/Oct/12 12:42 AM)
Status: Open Resolved
Resolution: Fixed
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Jesse Glick commented on Bug JENKINS-15617

<st:adjunct assumes="org.kohsuke.stapler.framework.prototype.prototype" includes="org.kohsuke.stapler.bind"/> is actually necessary as the workaround for the first part; otherwise you sometimes get errors in the page like Cannot call method 'select' of undefined since Prototype exists but has no member Selector.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Jesse Glick commented on Bug JENKINS-15617

Simpler still: <st:adjunct assumes="org.kohsuke.stapler.bind"/>

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Change By: Jesse Glick (25/Oct/12 1:04 AM)
Assignee: Jesse Glick Kohsuke Kawaguchi
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

Code changed in jenkins
User: Kohsuke Kawaguchi
Path:
war/src/main/webapp/scripts/hudson-behavior.js
http://jenkins-ci.org/commit/jenkins/5aca73f1831f7895220e7c869cfb13e6c2db131a
Log:
JENKINS-15617

This needs to be eval, not geval.
Plus I forgot to return the value.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
dogfood commented on Bug JENKINS-15617

Integrated in jenkins_main_trunk #2029
[FIXED JENKINS-15617] (Revision 51f508ba371ee222dced304c4a77a9b1b4ca37db)

Result = UNSTABLE
kohsuke : 51f508ba371ee222dced304c4a77a9b1b4ca37db
Files :

  • war/src/main/webapp/scripts/hudson-behavior.js
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
dogfood commented on Bug JENKINS-15617

Integrated in jenkins_main_trunk #2030
JENKINS-15617 (Revision 5aca73f1831f7895220e7c869cfb13e6c2db131a)

Result = UNSTABLE
kohsuke : 5aca73f1831f7895220e7c869cfb13e6c2db131a
Files :

  • war/src/main/webapp/scripts/hudson-behavior.js
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

51f508b breaks config page loading in IE 8 on XP.

Change By: Jesse Glick (27/Oct/12 12:13 AM)
Resolution: Fixed
Status: Resolved Reopened
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Jesse Glick commented on Bug JENKINS-15617
diff --git a/war/src/main/webapp/scripts/hudson-behavior.js b/war/src/main/webapp/scripts/hudson-behavior.js
index c88fc9f..4eb41b7 100644
--- a/war/src/main/webapp/scripts/hudson-behavior.js
+++ b/war/src/main/webapp/scripts/hudson-behavior.js
@@ -500,7 +500,7 @@ function isInsideRemovable(e) {
  */
 function renderOnDemand(e,callback,noBehaviour) {
     if (!e || !Element.hasClassName(e,"render-on-demand")) return;
-    var proxy = geval(e.getAttribute("proxy"));
+    var proxy = eval(e.getAttribute("proxy"));
     proxy.render(function (t) {
         var contextTagName = e.parentNode.tagName;
         var c;

seems to fix it. Why is geval being used so widely?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

The idea behind geval is not to let evaluated script to access local in-scope variables as well as letting them put stuff into global scope, so I think it's sound to prefer geval as much as possible.

Now, it turns out execScript always return null which means it can't be used at all where we need the return value.

The next step is, who said eval on IE is broken? On my IE8 in the standards mode, "window.eval" seems to work as expected. MSDN backs me up and claims it has been there since IE6.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

Code changed in jenkins
User: Kohsuke Kawaguchi
Path:
war/src/main/webapp/scripts/hudson-behavior.js
http://jenkins-ci.org/commit/jenkins/1c578ab5542bd20904c4a5e4ebcc80b42af31bbb
Log:
[FIXED JENKINS-15617]

execScript cannot return value [1], so I'm restricting its use to where
we don't care about the return value. See ticket for more discussions

[1] http://msdn.microsoft.com/en-us/library/ie/ms536420(v=vs.85).aspx

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Change By: SCM/JIRA link daemon (27/Oct/12 2:21 AM)
Status: Reopened Resolved
Resolution: Fixed
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15617) <st:bind> does not work inside <l:ajax>

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
dogfood commented on Bug JENKINS-15617

Integrated in jenkins_main_trunk #2037
[FIXED JENKINS-15617] (Revision 1c578ab5542bd20904c4a5e4ebcc80b42af31bbb)

Result = UNSTABLE
kohsuke : 1c578ab5542bd20904c4a5e4ebcc80b42af31bbb
Files :

  • war/src/main/webapp/scripts/hudson-behavior.js
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Loading...