.prototype in html panel JSX
Hello all,
I'm used to add new methods to photoshop DOM in jsx scripts with .prototype, i.e.
var Document = function(){};
Document.prototype.activate = function()
app.activeDocument = this;
but when I add this to Photoshop.jsx in html panel, these methods are not added/defined. Is there correct way to do it? I'm currently converting prototypes to functions for workaround, i.e.
function activateDoc(docRef)
app.activeDocument = docRef;
but it's a pain. and it worked fine for flex extensions..
I looked through some samples, but seems like no one is using this technique.
Please advise. Thanks a lot!
What u could do is add an observer to your html panel that
monitors the onPostUpdate. On each update loop through your
<a> tags (could be done with
document.getElementsByTagName('a') ) check if they start with
/wiki/ if it does, just replace or change the href.
Similar Messages
-
Pass an argument from external jsx to html panel?
Hi everyone,
Can you please tell me if it's possible somehow to listen to event from the external jsx in html panel? What I'm trying to do is to pass an argument from JSX to HTML Panel and to update
the panel with it.
Many thanks,
SergeyHi Sergey!
What I was suggesting privately to you (I report this here for the others' sake) is to use soon-to-be-released CEP5 technology: http://blogs.adobe.com/cssdk/2014/04/introducing-cep-5.html
Chiefly, the part that says:
Call from ExtendScript into HTML DOM: Most of the currently supported Adobe apps (including but not only Photoshop CC and Illustrator CC) will include a new ExternalObject which provides an API that allows developers to dispatch events from ExtendScript to the JavaScript/HTML5
But we have to wait for the next update of CC apps to support it!
Regards
Davide Barranca
www.davidebarranca.com
www.cs-extensions.com -
Photoshop HTML Panels Tips - tutorial series
Hello,
I've been putting together a series of tips on HTML Panels creation - both from personal experiments and collecting information around. Each tip focuses on a particular topic, it's quite short and provides the code for a demo panel.
You can find the whole series here, so far I've covered:
Tip #1 - Debugging
Tip #2 - Including multiple JSX
Tip #3 - Get data from JSX and send it to HTML
Tip #4 - Passing Objects from HTML to JSX
Tip #5 - Passing Objects from JSX to HTML
Tip #6 - Integrating Topcoat CSS library
Tip #7 - Photoshop Events, Take 1
Tip #8 - Photoshop Events, Take 2
Tip #9 - Panel Persistence (to be published asap)
Tips are about Photoshop panels, but general principles apply to other apps too.
I'll share more as soon as... I have new finding to share!
Best,
Davide Barranca
www.davidebarranca.comUpdate (December 5, 2014)
Two new tips, #15 and #16 have been added, enjoy :-)
Recently added/updated Tips in bold - You can find the whole series here, so far the topic list is:
Tip #16 - AngularJS Binding bug patch
Tip #15 - Asynchronous vs. Synchronous
Tip #14 - Flyout Menu
Tip #13 - Automate ZXP Packaging with Gulp.js
Tip #12 - CEP Application Events
Tip #11 - CEP Events (ExternalObject)
Tip #10 - Packaging / ZXP Installers
Tip #9 - Panel Persistence
Tip #8 - Photoshop Events, Take 2
Tip #7 - Photoshop Events, Take 1
Tip #6 - Integrating Topcoat CSS library
Tip #5 - Passing Objects from JSX to HTML
Tip #4 - Passing Objects from HTML to JSX
Tip #3 - Get data from JSX and send it to HTML
Tip #2 - Including multiple JSX
Tip #1 - Debugging -
Images not loading in Spry HTML Panel
Hallo everyone
I am using links to load html fragments in a Spry HTML Panel, just like in the example page
http://labs.adobe.com/technologies/spry/widgets/htmlpanel/SpryHTMLPanel.html
The whole structure is inside a Spry Tabbed Panel.
All works ok if the target html pages are in the same directory as the mother page.
Images are standard in the "images" folder
The problem starts when I try to organise all the html fragments in a separate directory.
Updating links in all the html files is of course done correctly, images included.
Then the problem starts.
The html fragments load but with no images.
When I open the html fragments directly by the browser all is ok.
Any ideas would be appreciated
Thanks!Can you upload your pages to a server and give us a link?
If your images are in your site folder (no matter which directory), but they are not showing up in your fragments, it is likely that the paths are wrong. The images (it seems to me) should exist on the fragment and be linked from there.
I won't have a chance to fiddle around with this right now, but if your images are linked to the fragment locations and that does NOT work, try linking them as if they were on the page that is showing the fragments. I'm not familiar (yet) with this widget.
Beth -
Hello,
I know this topic has been seen a lot, but I still can't find
the answer for me...
Well, it's easy, I use html panels to load content into my
website (I have a SPRYMenu wich loads content into the
"main" div)
But, when I load content including another HTML Panel, it
doesn't work...
I've set the evalscripts to true, but it doesn't work...
here is a small portion of code coming from the exaples, wich
looks like what i want to do, even if in this code, it loads a
slidingPanel, not a HTLMPanel, but I think if I can make it work,
I'll be able to do what I want then !
here is the main file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
hr, .clearAll {
clear: both;
.SlidingPanels {
width: 300px;
height: 300px;
.SlidingPanelsContent {
width: 300px;
height: 300px;
.p1 {
background-color: #CCCC66;
.p2 {
background-color: #FFFFCC;
.p3 {
background-color: #6699FF;
.p4 {
background-color: #99CCCC;
.p5 {
background-color: #FF99CC;
.p6 {
background-color: #339933;
.p7 {
background-color: #9933FF;
.p8 {
background-color: #669966;
.p9 {
background-color: #00FFCC;
#example2.SlidingPanels {
float: left;
#example2 .SlidingPanelsContentGroup {
float: left;
width: 10000px;
#example2 .SlidingPanelsContent {
float: left;
</style>
<script src="inc/SpryHTMLPanel.js"
language="javascript"
type="text/javascript">
Spry.Widget.HTMLPanel.evalScripts =
true;</script>
<link href="inc/SpryHTMLPanel.css"
rel="stylesheet"
type="text/css" />
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1" />
<title>Document sans nom</title>
</head>
<body>
<div id="panelSpry"
style="">text de base</div>
<div><a
href="essai1.html"
onclick="panelWidget.loadContent(this.href);return
false;">changement</a></div>
<script>
var panelWidget = new
Spry.Widget.HTMLPanel("panelSpry", { evalScripts:
true });
</script>
</body>
</html>
and here is the loaded file (essai1.html) :
<link
href="inc/SprySlidingPanels.css"
rel="stylesheet"
type="text/css" />
<script type="text/javascript"
src="inc/SprySlidingPanels.js"></script>
<p>
Navigate by index:
<a href="#"
onclick="sp2.showPanel(0); return
false;">1</a> |
<a href="#"
onclick="sp2.showPanel(1); return
false;">2</a> |
<a href="#"
onclick="sp2.showPanel(2); return
false;">3</a> |
<a href="#"
onclick="sp2.showPanel(3); return
false;">4</a> |
<a href="#"
onclick="sp2.showPanel(4); return
false;">5</a> |
<a href="#"
onclick="sp2.showPanel(5); return
false;">6</a> |
<a href="#"
onclick="sp2.showPanel(6); return
false;">7</a> |
<a href="#"
onclick="sp2.showPanel(7); return
false;">8</a> |
<a href="#"
onclick="sp2.showPanel(8); return
false;">9</a>
</p>
<p>
Navigate by id:
<a href="#"
onclick="sp2.showPanel('ex2_p1'); return
false;">p1</a> |
<a href="#"
onclick="sp2.showPanel('ex2_p2'); return
false;">p2</a> |
<a href="#"
onclick="sp2.showPanel('ex2_p3'); return
false;">p3</a> |
<a href="#"
onclick="sp2.showPanel('ex2_p4'); return
false;">p4</a> |
<a href="#"
onclick="sp2.showPanel('ex2_p5'); return
false;">p5</a> |
<a href="#"
onclick="sp2.showPanel('ex2_p6'); return
false;">p6</a> |
<a href="#"
onclick="sp2.showPanel('ex2_p7'); return
false;">p7</a> |
<a href="#"
onclick="sp2.showPanel('ex2_p8'); return
false;">p8</a> |
<a href="#"
onclick="sp2.showPanel('ex2_p9'); return
false;">p9</a>
</p>
<p>
Other navigation methods:
<a href="#"
onclick="sp2.showFirstPanel(); return
false;">First</a> |
<a href="#"
onclick="sp2.showPreviousPanel(); return
false;">Previous</a> |
<a href="#"
onclick="sp2.showNextPanel(); return
false;">Next</a> |
<a href="#"
onclick="sp2.showLastPanel(); return
false;">Last</a>
</p>
<p>&nbsp;</p>
<div id="example2"
class="SlidingPanels"
tabindex="0">
<div
class="SlidingPanelsContentGroup">
<div id="ex2_p1"
class="SlidingPanelsContent p1">Panel
1</div>
<div id="ex2_p2"
class="SlidingPanelsContent p2">Panel
2</div>
<div id="ex2_p3"
class="SlidingPanelsContent p3">Panel
3</div>
<div id="ex2_p4"
class="SlidingPanelsContent p4">Panel
4</div>
<div id="ex2_p5"
class="SlidingPanelsContent p5">Panel
5</div>
<div id="ex2_p6"
class="SlidingPanelsContent p6">Panel
6</div>
<div id="ex2_p7"
class="SlidingPanelsContent p7">Panel
7</div>
<div id="ex2_p8"
class="SlidingPanelsContent p8">Panel
8</div>
<div id="ex2_p9"
class="SlidingPanelsContent p9">Panel
9</div>
</div>
</div>
<script
type="text/javascript">
var sp2 = new Spry.Widget.SlidingPanels('example2');
</script>
I hope somebody can help....
Thanks !Thank you for your quick reply.
I still have a problem here.
Would you please see my 3 files for my problems.
Thank you very much for your time.
1. index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Test for Spry HTML Panel</title>
<script src="../spry/SpryHTMLPanel.js" language="javascript" type="text/javascript"></script>
<link href="../spry/SpryHTMLPanel.css" rel="stylesheet" type="text/css">
</head>
<body>
<input type="button" value="Click Here to Load Document Level 2" onclick="body_content_area.loadContent('doc_level_2.php');" />
<div id="body_content_area" style="clear:both; width:100%;">
<!-- Put Content Here -->
<div class="HTMLPanelLoadingContent">Loading ...</div>
</div>
<script type="text/javascript" language="javascript1.2">
<!--
var body_content_area = new Spry.Widget.HTMLPanel("body_content_area");
//-->
</script>
</body>
</html>
2. doc_level_2.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script src="../spry/SpryHTMLPanel.js" language="javascript" type="text/javascript"></script>
<link href="../spry/SpryHTMLPanel.css" rel="stylesheet" type="text/css">
</head>
<body>
<H1>Here is a content of document level 2</h1>
<br /><br />
<input type="button" value="Click Here to Load Document Level 3" onclick="body_content_area_2.loadContent('doc_level_3.php');" />
<div id="body_content_area_2" style="float:left; width:100%;">
<!-- Put Content Here -->
<div class="HTMLPanelLoadingContent">Loading ...</div>
</div>
<script type="text/javascript" language="javascript1.2">
<!--
var body_content_area_2 = new Spry.Widget.HTMLPanel("body_content_area_2");
//-->
</script>
</body>
</html>
3. doc_level_3.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<div style="float:left;">
<h2>Here is the content of document level 3</h2>
</div>
</body>
</html> -
Evaluate Script in HTML panel in Tooltip
I have tried this question in another thread and got some help from Ben but still can't quite get it to work.
I am trying to embed an HTML panel, which comtains spry xml data, into a tooltip but cannot get the scripts in the panel to run once they are in the tool tip. The example is the middle of the three line on this page: http://www.edwardshephard.net/caravanclub/tooltiptest.html which should call data in from this page: http://www.edwardshephard.net/caravanclub/clubtooltippanel.html.
I have added a {evalScripts:true} line as suggested by Ben, which looks like a good solution, but still no joy. Having looked at other threads I wonder if it needs some sort of post-loading observer thing to run the scripts, but I'm not sure and not experienced enought to work out the syntax. Would welcome any further help please. thanks, EdwardBecause you are also importing a spry:region and not only Spry Data, you need to manally call:
Spry.Data.initRegions();
Once the tooltip has loaded its HTML panel contents. -
Getting a sliding panel loaded into an html panel to work.
Hi. This is my first post on the forum.
I've been using Spry a little here and there. Today I ran
into a situation where I want to load an external page, that has a
sliding panel in it, into an html panel. So far I have not had luck
and I suppose it has to do with loading the js file. At the moment
I have a right column that already has a sliding panel (working).
But it would appear that the loaded external html file (in the left
"main" column) is not picking that up. Any suggestions for a noob
as to what to do next? Viewing the external page by itself allows
the sliding panel to work (that is when I add the js file import to
the head of the external html file... but that head section does no
good when loaded into an html panel)
Anyway, any help at all is greatly appreciated.
Thanks,
EricThank you very much! I found the topic
here.
It will require a bit of a small learning curve for me as html
panel and sliding panels are my first interaction with js... even
my rollovers are css driven. Thanks! -
I'd like to load a page w/ dynamic data content through an
HTML Panel. Can it be done?Hi,
There is some problem in Spry where in if the loaded content
has any spry:regions or dataset objects, those are not executed as
expected. You need to replace the Spry.Utils.setInnerHTML function
with the following code
Spry.Utils.setInnerHTML = function(ele, str, preventScripts)
if(!ele)
return;
ele = Spry.$(ele);
var scriptExpr =
"<script[^>]*>(.|\s|\n|\r)*?</script>";
ele.innerHTML = str.replace(new RegExp(scriptExpr, "img"),
if (preventScripts)
return;
var matches = str.match(new RegExp(scriptExpr, "img"));
if (matches)
var numMatches = matches.length;
for (var i = 0; i < numMatches; i++)
var s = matches
.replace(/<script[^>]*>[\s\r\n]*(<\!--)?|(-->)?[\s\r\n]*<\/script>/img,
var oScript = document.createElement("script");
oScript.text = s;
ele.appendChild(oScript);
Spry.Data.initRegions(Spry.$(ele));
It should work fine.
-JV -
Controlling a Spry HTML panel with a Jump Menu
Hi, I wonder if anyone can help.
I've implemented a HTML panel within a page to display different page elements and have it working no problem with a simple href and an onClick event but I would like to control what is displayed by using a jump menu (drop down list) - any idea how I can control that to populate the necessary DIV?
eg: <select name="site" size=1 onChange="hpanel.loadContent(this.href); return false;"> (obviously this doesn't work!)
Thanks in advance
NeilIt works fine, but your pages arent found;
http://www.thedesignforge.co.uk/clients/elsevier/laure/v2/dollar_rates.html
See its missing.
But
http://www.thedesignforge.co.uk/clients/elsevier/laure/v2/dollar_rate.html
Exists. So it seems to me you are linking to a incorrect file. -
Html panel - inside html panel?
hi everyone
i have a page with a main content div which is an html panel theat will load different content
one of the (fragment) pages it loads has xml data etc on it.
i now need on this dynamic page a little html in a div too, but that means an html panel within an html panel!
i declared var infolpanel; on the main page, and the maincontent htmlpanel div has evalscripts set true
on the dynamic fragment page, the xml datasets are working etc, but i need another html panel
infopanel = new Spry.Widget.HTMLPanel("info");
infopanel.loadContent('products/'+ product + '/info.html');}};
now when i load the page, none of the xml data populates either, instead showing {dataset::variable} instead :-s
removing the above javascript again fixes it.
so, is there any (other?) way for this fragmented page to load a smaller fragment into the div?
thanks
delboyHow do I open another collapsible panel, on a different page
through a link? I have tried many different ways, including trying
to use SpryURLUtils.js and am not having any luck? I really wanted
to jump to a different pages' collapsible panel, open it, and then
populate the SpryHTMLPanel, located inside that targeted
collapsible panel. My collapsible panels and HTML panels all work
fine on the target page, when just interacting on the page itself,
with mouseclicks. Inside the collapsible panels I have unordered
list of links, that populate HTMLpanels, with the appropriate HTML
fragments. My problems lies in crosslinking from other webpages to
the exact collapsible panel, and then populating the exact HTML
fragment, just as if I had clicked on the link in the list, if I
had been on the target page in the first place.
<a href="../OA_qi_docreq.html?panel=0#cp1">
<a href="../OA_qi_docreq.html#cp1">
<a href="../OA_qi_docreq.html#cp1.open();"> -
Spry HTML Panel Widget breaks ICE
I'm using the spry html panel widget to load a side bar
across my site. It has Ice tags as do the main pages its loaded
into. When editing a main page, it will not save saying. "the html
sent to save was not in the page". (referring to my spry sidebar).
Taking ICE out of the side bar page allows it to work.
Is there a work around to use this adobe spry widget with in
context editing? It would be a shame is the sidebar can't be
edited, or has to be done for every page it loads into not using
the spry widget.Hello Addis,
I'm not entirely clear on your workflow, but InContext
Editing does not support editable or repeating region groups inside
Spry Dynamic Regions.
You can create editable regions on the html page that loads
into the spry html panel widget, but you cannot have editable
regions on the
dynamic widget region itself.
Essentially, you can apply InContext Editing editable regions
to the content in the external HTML page (e.g.,
panelWidget.loadContent('
widget_contents.html'). Then, when you want to edit the
content that loads into the widget on the main pages, you would
edit the
widget_contents.html page with InContext Editing. You can
also apply InContext Editing editable regions to any
static content regions on your main pages.
Please let me know if this needs clarification.
Best regards,
Corey -
I have a working rating widget but when I use it in an HTML panel (part of the HTML file) it does not show up. I tried including all of the rating widget functions in both files but to avail. DO I need to use an observer since the rating widget is in another HTML being populated by the HTML panles widget?
Thanx!Jus to clarify for me:
I should include the <script src="path/to/rating.js"></script> in my main file. The page that displays all of my galleries.(for me it is galleries.html)
I will change it all around and see what happens
EDIT*****************************************************
It still looks as it did before, not sure what I did. heres the link again wioth all updated info
http://directory-sexy.com/categories/gallery/galleries.html
I may just consider using jquery for the rating as I am under a bit of a time crunch - I have school starting in two weeks and really need to get this up and running soon. I will also be adding comments to each image but that may require a bit more research.
Thanx again. -
No Script are working in SPRY HTML panel
I'm getting trouble with this website :
http://dubezy-faure.com.linkfirst-preprod.linkeo.org/
I've have 2 HTML fragments with lightbox and a spry contact
form in them but no one is working. When I bypassed the HTML panel,
my scripts work fine.
I've use the evalScripts:true but still nothing.
Below is the code :
<div id="menuhaut">
<ul>
<li><a href="index1.htm"
onclick="hpanel.loadContent(this.href); return
false;">Accueil</a></li>
<li><a href="real1.htm"
onclick="hpanel.loadContent(this.href); return
false;">Réalisations</a></li>
<li><a href="contact1.htm"
onclick="hpanel.loadContent(this.href); return
false;">Contact</a></li>
</ul>
</div>
<script language="JavaScript" type="text/javascript">
var hpanel = new
Spry.Widget.HTMLPanel("main",{evalScripts:true});
</script>
I've added the scripts in the HTML fragments as followed :
FOR LIGHTBOX
<link href="css/lx.css" rel="stylesheet" type="text/css"
/>
<script type="text/JavaScript"
src="script/lx.js"></script>
FOR the SPRY VALIDATION SCRIPT
<link href="css/validate.css" rel="stylesheet"
type="text/css" />
<script type="text/JavaScript"
src="script/validate.js"></script>
Could someone help me...Thanks Diana !
My contact form is now working fine, but what about the
lightbox for the page Realisation? It has a lightbox effect on
clicking an image inside the HTML fragment. This lightbox do not
work. No error message is reported in firebug. I find this odd.
The lightbox effect works fine for the button plan, because
it's found outside the HTML fragment. Anything in the HTML panel
fails.
Thanks in advance for the support -
Return focus from html panel?
Hey everyone,
can you please tell me if there's a way to return focus from the html panel back to Photoshop? I've tried app.activate() but no luck
Many thanks!Hi,
let's take this
sample.
On the main file: html_panel_sample.html go and change the
first panel to support java script code adding the preventScript
option on false: var mine = new Spry.Widget.HTMLPanel("me",
{preventScripts:false});
On the file that is loaded, frag-0.html make a link to load a
new panel like this:
<a href="#"
onclick="mine.loadContent('frag-1.html');return false;">load
frag-1.html file</a>
Please let us know if you have other questions,
Diana -
Tabbed Panel menu + HTML Panel submenu?
I'm using spy tabbed panels for my top level menu and HTML
panels for the sublevels, and it works great...for one tab. The
other tabs display their submenus but don't respond with panel
content.
Looking at my site, you can see that the tabs work and that
the submenus are displayed, but only the panels under "Our Public
Responsibility" function. I guess each tab needs a separate panel
widget instance, but I don't know how to accomplish that.
Any input very much appreciated!
UPDATE: Just needed to sleep on it, I guess. I figured it
out.I'm sure you will get more answers in this forum: "Spry Framework for Ajax":http://forums.adobe.com/community/labs/spry
Good point. I'll post it there.
I do not see a problem with what you want to do. Keep in mind though, that, unlike the tabbed panel widget, you will be taken to a new page when clicking a link.
Also, do you know if it's possible to have an entire web page (separate html file), display in a panel?
Have a look here http://labs.adobe.com/technologies/spry/samples/htmlpanel/html_panel_s ample.html
Yup, link to another page (e.g., my forum), would be right.
I'm trying to wrap my brain around the html panel link you provided. Thanks.
Maybe you are looking for
-
ITunes wont recognize my iPhone 4 after update
I updated my iPhone to the latest version (7 point something) but my iTunes no longer recognizes the phone when I connect it via USB. The iPhone permanently shows the connect to iTunes logo but does nothing when I do connect it. I'm using a Windows P
-
Got new iMac, can no longer run Aperture on MacBook
I recently upgraded to Aperture 2. It was running fine on my Mac Book Pro. Then I got an iMac. I've been running Aperture on that, no problem. Now when I go to launch Aperture on my MacBook, it tells me to enter the serial #. I enter my upgrade #, an
-
Call screen in Function Module
Hi all, I want to call a Screen in function module.Is it possible? If possible.How can I do that? I tried calling a screen from a function module but the PAI module is not getting accessed. I am able to see the screen but when I click on the push but
-
HT5473 Java Runtime error on Mountain Lion
I have been reading the forum on the Java problems with Mountain Lion, but none of the proposed fixes are taking care of my issues. I have the latest version of Java installed from Oracle and have the fix posted on the Apple website installed for th
-
Literature about Master Data Management
Hi, I am currently writing my diploma thesis about Master Data Management. Therefore I am looking for literature (Books, Papers, Conference-reviews) about this topic: SAP specific and more general. Any ideas? Thanks, Stefan