Hello Brian,

Perhaps the file treeview.js is missing from your code and this is what you
are referring to. This is the script:

<script type="text/javascript">
(function ($) {
    $("#tree").treeview({
        collapsed:true,
        animated:"medium",
        control:"#sidetreecontrol",
        persist:"cookie"
    });
})(jQuery);
</script>

You can copy/paste this inside the <xsl:template name="addJavascript">
template in page-structure.xsl OR you can copy the whole <xsl:template
name="addJavascript"> template into Mirage.xsl to keep the original
page-structure.xsl intact OR you can just create an external javascript
file (e.g. treeview.js) and update your sitemap.xmap to import your newly
created javascript file.

Hope this answers your query about the Expand All, Collapse All button not
working. ;-)

Cheers!


On Tue, Jul 30, 2013 at 5:50 PM, Nemiz, Elvi <[email protected]> wrote:

> Hello Brian,
>
> I suspect that you have conflicts in your javascript, that's why I
> suggested that you look for javascript errors in the console of google
> chrome if you clicked the "Expand All, Collapse All" button. What is the
> output of the console if you clicked the "Expand All.." button? I have
> updated my treeview functionality code and I don't have the jquery.js file.
> I removed that since dspace 3.x code is importing jquery.min.js (1.6.2).
> AFAIK, jquery is needed for the treeview functionality to work (
> http://jquery.bassistance.de/treeview/demo/) but since dspace have jquery
> already, importing another jquery would likely cause conflicts in your
> javascript code. Here is the link of my commit in my github account about
> the treeview functionality and compare the files that I have changed to
> your code: (Note: I have made a new theme named sair under the [
> dspace-src]/dspace/modules/xmlui/src/main/webapp/themes/ directory)
> https://github.com/eulereadgbe/DSpace/commit/097db46d4d52e4099bb418e5d940d4d769bd0b04#dspace/modules/xmlui/src/main/webapp/themes/sair/lib/treeview
>
> Hope this helps.
>
> Regards,
> Elvi
>
>
> On Tue, Jul 30, 2013 at 4:49 PM, Brian Aljer B. Coballes <
> [email protected]> wrote:
>
>> Hi Elvi, thanks for the input. The treeview for community is working now.
>> I tried to copy the code:
>>
>>   <xsl:template match="dri:referenceSet[@type = 'summaryList' and
>> @n='community-browser']" priority="3">
>>         <div id="sidetree">
>>             <div class="treeheader">&#160;</div>
>>             <div id="sidetreecontrol"><a href="?#">Collapse All</a>&#160;
>>                 <a href="?#">Expand All</a>
>>             </div>
>>             <ul id="tree">
>>                 <xsl:apply-templates select="*[not(name()='head')]"
>> mode="summaryList"/>
>>             </ul>
>>         </div>
>>     </xsl:template>
>>
>> to  [dspace-src]\dspace-xmlui\src\main\webapp\themes\dri2xhtml\structural.xsl
>> before and I noticed that it was not imported in the Mirage.xsl so that is
>> why nothing is happening.
>>
>> Just one more thing, I can't make the Expand All and Collapse All button
>> to work. I guess I'm missing javascript code to target div id="sidetree",
>> "treeheader", and "sidecontrol"? I already looked into the javascript codes
>> in  *"lib/treeview/jquery.treeview.js", "**lib/jquery/jquery.js", 
>> **lib/treeview/treeview-handlers.js"
>> *but I can't find anything. Did you use a separate javascript? Thanks a
>> lot. (^_^)
>>
>>
>> On Tue, Jul 30, 2013 at 11:16 AM, Nemiz, Elvi <[email protected]>wrote:
>>
>>> Hello Brian,
>>>
>>> On Mon, Jul 29, 2013 at 1:29 PM, Brian Aljer B. Coballes <
>>> [email protected]> wrote:
>>>
>>>> Hi Elvi, sorry to disturb you. I'm implementing the expand/collapse
>>>> button in communities/collection. I'e seen you're post in dspace nabble.
>>>> I'm trying to patch the code (err manually) so that I'm sure where the
>>>> changes will go. But apparently, I cannot have it work. All the js and css
>>>> are in their respective folders in Mirage template. Any advise? Thanks.
>>>>
>>>
>>> To display the full list of your communities and collections in the
>>> front page, edit line 48:
>>>
>>> "<map:parameter name="depth" value="1"/>"
>>>
>>>  change the value from 1 to 999 in
>>> [dspace-src]\dspace-xmlui\src\main\resources\aspects\BrowseArtifacts\sitemap.xmap.
>>>
>>> If you are using mirage, copy this line and paste it in the mirage.xsl
>>> file before the closing tag "</xsl:stylesheet>:
>>>
>>>     <xsl:template match="dri:referenceSet[@type = 'summaryList' and
>>> @n='community-browser']" priority="3">
>>>         <div id="sidetree">
>>>             <div class="treeheader">&#160;</div>
>>>             <div id="sidetreecontrol"><a href="?#">Collapse All</a>&#160;
>>>                 <a href="?#">Expand All</a>
>>>             </div>
>>>             <ul id="tree">
>>>                 <xsl:apply-templates select="*[not(name()='head')]"
>>> mode="summaryList"/>
>>>             </ul>
>>>         </div>
>>>     </xsl:template>
>>>
>>> Also, you must edit
>>> [dspace-src]\dspace-xmlui\src\main\webapp\themes\Mirage\sitemap.xmap to
>>> make sure all the necessary css and javascripts were imported. E.g.:
>>>
>>>                 <map:transform type="IncludePageMeta">
>>>                     *<map:parameter name="stylesheet#1"
>>> value="lib/treeview/jquery.treeview.css"/>*
>>>                     <map:parameter name="javascript#1"
>>> value="lib/js/jquery-ui-1.8.15.custom.min.js"/>
>>>                     <map:parameter name="javascript#2"
>>> value="lib/jquery/jquery.cookie.js"/>
>>>                     *<map:parameter name="javascript#3"
>>> value="lib/treeview/jquery.treeview.js"/>*
>>>                     *<map:parameter name="javascript#4"
>>> value="lib/treeview/treeview.js"/>*
>>>                     <map:parameter name="stylesheet.all"
>>> value="lib/css/media.css"/>
>>>                     <map:parameter name="theme.path"
>>> value="{global:theme-path}"/>
>>>                     <map:parameter name="theme.name"
>>> value="{global:theme-name}"/>
>>>                 </map:transform>
>>>
>>> Note that the number sequence (e.g. javascript#3, etc.) are crucial, I
>>> always made the mistake of not updating these numbers which in turn failed
>>> to import or link these files.
>>>
>>> Rebuild DSpace.
>>>
>>> If you're using chrome, always try to use the 'inspect element' feature
>>> and view the console, this well help you monitor and fix any errors that
>>> you might encounter. You can also add firebug if you are using firefox and
>>> view the console tab for any errors. Look for javascript errors (e.g.
>>> 'treeview is not a function') in the console, these could be one of the
>>> reasons that you can't get to work. I'm not a javascript expert but based
>>> from my experience, these errors were caused by jQuery conflicts (see my
>>> post about these, answered by helix:
>>> http://www.mail-archive.com/[email protected]/msg22855.html
>>> ).
>>>
>>> As suggested by dspace experts, it is highly recommended to create a new
>>> theme if you want to try theme customizations to avoid overwriting your
>>> customizations the next time you update/build your dspace. Please see this
>>> link: https://wiki.duraspace.org/pages/viewpage.action?pageId=19006130.
>>>
>>> Please cc dspace-tech in asking questions about technical details in
>>> dspace, I might not answer your query satisfactorily and someone from the
>>> list could advise or have a better solution. I can also be wrong and
>>> someone can correct that or point it out, an added advantage to all of us
>>> dspace users. ;-) And this will also help other users who may encounter the
>>> same problems.
>>>
>>> Cheers and Regards,
>>>
>>> --
>>> Elvi S. Nemiz
>>> Information Assistant
>>> Library and Data Bank Services Section
>>> Training and Information Division
>>> SEAFDEC Aquaculture Department
>>> Tigbauan, Iloilo
>>> Philippines
>>>
>>
>>
>>
>> --
>> *Brian Aljer B. Coballes
>> Instructional Technology Center
>> Ateneo de Manila High School
>> Loyola Heights, Quezon City*
>> *Philippines*
>> *
>> *
>> *(063) 426-6001 loc. 6203
>> *
>> *
>> *
>>
>> *"En todo amar y servir."*
>>
>
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Reply via email to