A Pen by Rijesh Kunniyur

Thumbnail
This awesome code was written by rijeshkunniyur, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright rijeshkunniyur ©
  • HTML
  • CSS
  • JavaScript
    <div class="col-xs-6 padding-left-desktop-0 docs-and-links" id="documents-links-div-left">asdas</div>
<div class="col-xs-6 padding-left-desktop-0 docs-and-links" id="documents-links-div-right">asdasdas</div>
  

/*Downloaded from https://www.codeseek.co/rijeshkunniyur/a-pen-by-rijesh-kunniyur-XaOgJY */
    


/*Downloaded from https://www.codeseek.co/rijeshkunniyur/a-pen-by-rijesh-kunniyur-XaOgJY */
    var data = [{
        name: "AZ&Me Application",
        link: "http://www.azandmeapp.com/resources/download_application",
        type: "html"
    },
    { name: "BENRALIZUMAB Access & Reimbursement Guide", link: "#", type: "pdf" },
    { name: "BENRALIZUMAB Affordability Brochure", link: "#", type: "pdf" },
    { name: "BENRALIZUMAB Appeal Template", link: "#", type: "pdf" },
    { name: "BENRALIZUMAB Distribution Sheet", link: "#", type: "pdf" },
    { name: "BENRALIZUMAB Enrollment Form", link: "#", type: "html" },
    { name: "BENRALIZUMAB Patient Savings Program", link: "#", type: "html" },
    {
        name: "BENRALIZUMAB Payer Grid",
        link: "068Q0000000UrgEIAS",
        type: "Payer_Grid"
    },
    {
        name: "Denial Management Guide",
        link: "https://www.myaccess360.com/content/WebsiteService…myaccess360/en/us/pdf/Denial_Management_Guide.pdf",
        type: "pdf"
    },
    {
        name: "Patient Authorization Form (ePAF Link)",
        link: "https://www.myaccess360paf.com/",
        type: "html"
    }
];
var medicationName = "Rijesh";

function render(parsedData) {
    var numberOfLinks = data.length;
    var leftDiv = $("#documents-links-div-left");
    var rightDiv = $("#documents-links-div-right");
    leftDiv.empty();
    rightDiv.empty();

    var ul_left = $("<ul></ul>", { class: "fa-ul reduce-left-margin" });
    var ul_right = $("<ul></ul>", { class: "fa-ul reduce-left-margin" });

    //var ul = $("<ul></ul>", { class: "fa-ul" });
    //rightDiv.append(ul);

    for (var index = 0; index < numberOfLinks; index++) {
        var li = $("<li></li>");
        var icon = "";
        var a = "";
        if (parsedData[index].type === "pdf") {
            icon = $("<i></i>", {
                class: "fa-li fa fa-file-pdf-o dashboard-footer-icon"
            });
            a = $("<a></a>", {
                href: parsedData[index].link,
                text: parsedData[index].name
            });
            li.append(icon);
            li.append(a);
            ul_left.append(li);
        } else if (parsedData[index].type === "html") {
            icon = $("<i></i>", {
                class: "fa-li fa fa-external-link dashboard-footer-icon"
            });
            a = $("<a></a>", {
                href: parsedData[index].link,
                text: parsedData[index].name
            });
            li.append(icon);
            li.append(a);
            ul_right.append(li);
        } else if (parsedData[index].type === "Payer_Grid") {
            var payerGridLink =
                "/hcp/services/download/document/?documentId=" +
                parsedData[index].link +
                "&libraryName=" +
                medicationName;
            var cloudIcon = $("<i></i>", {
                class: "fa-li fa fa-cloud-download dashboard-footer-icon"
            });
            icon = $("<i></i>", {
                class: "fa-li fa fa-file-excel-o dashboard-footer-icon"
            });
            a = $("<a></a>", { href: payerGridLink, text: parsedData[index].name });
            a.append(cloudIcon);
            li.append(icon);
            li.append(a);
            ul_left.append(li);
        }
    }// for
    leftDiv.append(ul_left);
    rightDiv.append(ul_right);
}

$("document").ready(function() {
    render(data);
});

Comments