[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Front End/JacaScript



This don't works on Documents because the logic of collapsing is 
embeded. Box does this:

 ??????? my $a = "true";
 ??????? my $b = "false";
 ??????? if( $options{collapsed} )
 ??????? {
 ??????????????? $b = "true";
 ??????????????? $a = "false";
 ??????? }
 ??????? my $uncollapse_bar = $session->make_element( "div", 
class=>"ep_only_js", id=>$barid );
 ??????? my $uncollapse_link = $session->make_element( "a", 
class=>"ep_box_collapse_link", onclick => "EPJS_blur(event); 
EPJS_toggleSlideScroll('${contentid}',false,'${id}');EPJS_toggle('${colbarid}',$a);EPJS_toggle('${barid}',$b);return 
false", href=>"#" );

while Documents does this:

 ??????? my $opts_toggle = $session->make_element( "a", onclick => 
"EPJS_blur(event); 
EPJS_toggleSlideScroll('${doc_prefix}_opts',".($hide?"false":"true").",'${doc_prefix}_block');EPJS_toggle('${doc_prefix}_opts_hide',".($hide?"false":"true").",'block');EPJS_toggle('${doc_prefix}_opts_show',".($hide?"true":"false").",'block');return 
false" );
 ??????? $doc_expansion_bar->appendChild( $opts_toggle );

(I'm talking about the + options below, where you can edit valued. The 
upper rolling is regulated in a static manner by this:

$processor->{notes}->{upload_plugin}->{to_unroll}->{$document->get_id} = 1;

in EPrints/Plugin/Screen/EPrint/UploadMethod/URL.pm


Il 07/09/2018 09:40, Alan.Stiles via Eprints-tech ha scritto:
>
> I still revisit them on occasion when I?m banging my head against a 
> metaphorical brick wall.
>
> If you just want bits of the workflow collapsed by default, then take 
> a look at 
> https://wiki.eprints.org/w/API:EPrints/Plugin/InputForm/Component
>
> And also in your 
> /opt/eprints3/archives/[ARCHIVEID]/cfg/workflows/eprint/default.xml - 
> look for a? <component collapse=?yes?> tag/parameter combination.
>
> Alan
>
> *From:*eprints-tech-bounces at ecs.soton.ac.uk 
> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] *On Behalf Of *James 
> Kerwin via Eprints-tech
> *Sent:* 07 September 2018 08:11
> *To:* Alan.Stiles <alan.stiles at open.ac.uk>
> *Cc:* eprints-tech at ecs.soton.ac.uk
> *Subject:* Re: [EP-tech] Front End/JacaScript
>
> Morning Alan,
>
> Thanks for that. I watched all of those videos in the weeks before I 
> started this job back in July. I think it's time I revisited them now 
> that they'll probably make some more sense.
>
> The thing I'm aiming to do with them is just make them collapsed when 
> the page loads. Fortunately I was asked to make the boxes expanded by 
> default for my recent tasks, but it's only a matter of time before I 
> have to make one that defaults the non-default way so I'm trying to 
> get ahead of the curve.
>
> Thanks,
>
> James
>
> On Thu, Sep 6, 2018 at 4:11 PM Alan.Stiles <alan.stiles at open.ac.uk 
> <mailto:alan.stiles at open.ac.uk>> wrote:
>
>     Hi James,
>
>     Certainly don?t change things under /opt/eprints3/perl_lib/? -
>     that?s just making a rod for future you?s back!
>
>     Have you seen the training bits on the wiki?? e.g.
>     https://wiki.eprints.org/w/Training_Video:Technical_Orientation
>
>     It kind of depends on what you want to change, but essentially you
>     can override existing functions within local archive directory, or
>     even create your own functionality to extend the basic options and
>     that would make your life a lot simpler for future upgrades!
>
>     Alan
>
>     *From:*eprints-tech-bounces at ecs.soton.ac.uk
>     <mailto:eprints-tech-bounces at ecs.soton.ac.uk>
>     [mailto:eprints-tech-bounces at ecs.soton.ac.uk
>     <mailto:eprints-tech-bounces at ecs.soton.ac.uk>] *On Behalf Of
>     *James Kerwin via Eprints-tech
>     *Sent:* 06 September 2018 15:55
>     *To:* eprints-tech at ecs.soton.ac.uk
>     <mailto:eprints-tech at ecs.soton.ac.uk>
>     *Subject:* [EP-tech] Front End/JacaScript
>
>     Hello,
>
>     It's me again (sorry). I'm trying to get to grips with the EPrints
>     front end this week.
>
>     I've managed to find (hopefully) all of the autoloading JavaScript
>     and CSS files and managed to make a couple of my own in my
>     repository directories.
>
>     I was looking today at how these boxes work (any collapse/expand
>     box in EPrints):
>
>     image.png
>
>     When I inspect the "+" symbol in chrome it takes me to an element
>     with this:
>
>     <a class="ep_box_collapse_link" onclick="EPJS_blur(event);
>     EPJS_toggleSlideScroll('ep_summary_box_5254_content',false,'ep_summary_box_5254');EPJS_toggle('ep_summary_box_5254_colbar',true);EPJS_toggle('ep_summary_box_5254_bar',false);return
>     false" href="#"><img alt="+" src="/style/images/plus.png"
>     border="0"> CORE (COnnecting REpositories)</a>
>
>     A quick google points me to this file in Eprints:
>
>     /opt/eprints3/perl_lib/EPrints/Box.pm
>
>     Can anybody advise me, or point me to some guidance, on how I
>     would alter the behaviour of this piece of JavaScript? I'm not
>     certain, but I'm about 99% sure that I don't edit Box.pm at this
>     location.
>
>     This isn't particularly urgent, I'm just trying to learn how it works.
>
>     Thanks,
>
>     James
>
>     -- The Open University is incorporated by Royal Charter (RC
>     000391), an exempt charity in England & Wales and a charity
>     registered in Scotland (SC 038302). The Open University is
>     authorised and regulated by the Financial Conduct Authority in
>     relation to its secondary activity of credit broking.
>
>
>
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/