Ignore:
Timestamp:
2012-04-12T14:59:55+12:00 (12 years ago)
Author:
sjm84
Message:

made hasClass a global function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/oran/js/documentmaker_scripts.js

    r25296 r25363  
    2020    for(var i = 0; i < allLinks.length; i++)
    2121    {
    22         if(allLinks[i].getAttribute("class") && (hasClass(allLinks[i], "dbdoc")))
     22        if(allLinks[i].getAttribute("class") && (gs.functions.hasClass(allLinks[i], "dbdoc")))
    2323        {
    2424            docLinks.push(allLinks[i]);
     
    6060    for(var i = 0; i < docLinks.length; i++)
    6161    {
    62         var callback = {
     62        var callback =
     63        {
    6364            success: addDocumentStructureToPage,
    6465            failure: function(data){/*alert("FAILED");*/}
     
    240241    topLevelUL.appendChild(textDiv);
    241242   
     243    //Create a blank metadata table
     244    //TODO: INSERT THIS!
     245   
    242246    //Add a title to the top-level item
    243247    var title = createSectionTitle(gs.text.dse.untitled);
     
    413417    {
    414418        current = children[i];
    415         if(current.nodeName.toLowerCase() == "li" && !hasClass(current, "placeHolder"))
     419        if(current.nodeName.toLowerCase() == "li" && !gs.functions.hasClass(current, "placeHolder"))
    416420        {
    417421            var newSection = duplicateSection(current);
     
    619623            updateRecursive(current, currentDocument, pos, level);
    620624        }
    621         else if (current.nodeName.toLowerCase() == "li" && hasClass(current, "dragItem") && !hasClass(current, "placeHolder"))
     625        else if (current.nodeName.toLowerCase() == "li" && gs.functions.hasClass(current, "dragItem") && !gs.functions.hasClass(current, "placeHolder"))
    622626        {
    623627            if(currentDocument == null && current.nodeID)
     
    636640            }
    637641           
    638             if(!hasClass(current, "topLevel"))
     642            if(!gs.functions.hasClass(current, "topLevel"))
    639643            {
    640644                current.nodeID = currentDocument + "." + pos;
     
    646650            current.index = _indexCounter++;
    647651        }
    648         else if (hasClass(current, "placeHolder") && !current.isEmptyList)
     652        else if (gs.functions.hasClass(current, "placeHolder") && !current.isEmptyList)
    649653        {
    650654            var pos;
     
    679683
    680684        //If this list is empty or has 1 placeholder child
    681         if(liCount == 0 || (liCount == 1 && hasClass(lastItem, "placeHolder")))
     685        if(liCount == 0 || (liCount == 1 && gs.functions.hasClass(lastItem, "placeHolder")))
    682686        {
    683687            //Give it the emptyList css class (if it does not already have it)
     
    696700        }
    697701        //Remove the empty list class if the list is no longer empty
    698         else if(hasClass(parent, "emptyList"))
     702        else if(gs.functions.hasClass(parent, "emptyList"))
    699703        {
    700704            parent.setAttribute("class", parent.getAttribute("class").replace(/emptyList/g, ""));
Note: See TracChangeset for help on using the changeset viewer.