Broadband Photonic Spin Hall Meta-Lens

“; comboListBuilder.cenNewsArray.push(tag); // console.log(tag); } }); //Get contents for Axial £(‘.axial_rss’).find(‘.listOfPublications li a’).each(function() { if (£(this).next().html() === undefined || £(this).attr(‘href’) === undefined || £(this).html() === undefined) { return true; } else { console.log(this); var description = £(this).next().html(); description = description.replace(/]+(>|£)/g, “”); //there is a p tag in the axial feed that does not exist in the c&en feed. var link = £(this).attr(‘href’) + ‘?utm_source=Widget&utm_medium=Pubs&utm_campaign=Axial’; //console.log(link); var tag = “”; comboListBuilder.axialListArray.push(tag); // console.log(tag); } });//Get contents of CEN Current issuevar feed = “/iapps/rss/cgeabj.xml”; //console.log(“Running Ajax”); £.ajax(feed, { accepts:{ xml:”application/rss+xml” }, dataType:”xml”, success: handleCenData, error: function(){ £(‘.combo-bi-container’).hide(); } }); function handleCenData (data) { if (!data) { console.log(“Something is wrong with the data ?? “); } else { var cenAjaxHolder = []; var coverStory = {}, science = {}, business = {}, policy ={}; var csIndex, sciIndex, bizIndex, poliIndex; var fullTextPath = “/doi/full/”; //http://pubs.acs.org/doi/full/ var coverart = “/action/showCoverImage?journalCode=cgeabj”; £(data).find(“item”).each(function (index) { var el = £(this); var title = el.find(“title”).text(); var link = el.find(“link”).text(); link = link.split(“http://dx.doi.org/”); link = fullTextPath + link[1] + “?ref=PubsWidget”; var description = el.find(“description”).text(); //image var regexp = /]+src=”(http://[^”>]+)”/g; var image = description.match(regexp); description = description.replace(/]+(>|£)/g, “”); description = description.replace(/^(.{100}[^s]*).*/, “£1”); description += “…”;if (image != null) {image = image[0];image = image.split(“src=”);image = image[1].replace(/^”(.*)”£/, ‘£1’);} if (title == “COVER STORY”) { csIndex = index; coverStory.section = title; } if (index == (csIndex+ 1)) { coverStory.title = title; coverStory.description = description; coverStory.link = link; coverStory.image = coverart; coverStory.clborderline = “cl-borderline-first”; coverStory.index = index; } if (title == “SCIENCE CONCENTRATES”) { sciIndex = index; science.section = title; } if (index == (sciIndex+ 1) ) { science.title = title; science.description = description; science.link = link; if (image) { //This should not be on production – the images are too blurry image = image.toLowerCase(); image = image.replace(“medium”, “small”); science.image = image.replace(“jpeg”, “gif”); //console.log(science.image); } science.clborderline= “cl-borderline”; science.index = index; } if (title == “CONCENTRATES”) { return true; } if (title == “BUSINESS CONCENTRATES”) { bizIndex = index; business.section = title; } if (index == (bizIndex+ 1) ) { business.title = title; business.description = description; business.link = link; if (image) { image = image.toLowerCase(); image = image.replace(“medium”, “small”); business.image = image.replace(“jpeg”, “gif”); //console.log(business.image); } business.clborderline= “cl-borderline”; business.index = index; } if (title == “POLICY CONCENTRATES”) { poliIndex = index; policy.section = title; } if (index == (poliIndex+ 1) ) { policy.title = title; policy.description = description; policy.link = link; if (image) { image = image.toLowerCase(); image = image.replace(“medium”, “small”); policy.image = image.replace(“jpeg”, “gif”); //console.log(policy.image); } policy.clborderline = “cl-borderline”; policy.index = index; } });//create ui elements from the datacreateUI_Element_Cover(coverStory);createUI_Element(science);createUI_Element(business);createUI_Element(policy);//self.cenCurrentIssueArray//Build this list if (cenAjaxHolder) {comboListBuilder.buildList(cenAjaxHolder, “cencurrent”);}//Handle bad images£(“[id^=climage-]”).error(function () { £(this).unbind(“error”).attr(“src”, “/pb-assets/images/default.jpg”); ///pb-assets/images/default.jpg});}//cl-section is the namefunction createUI_Element_Cover(dataObject) {//console.log(“Creating UI Elem: cover story ” );var tag = “” + dataObject.section + “


“; cenAjaxHolder.push(tag); }function createUI_Element(dataObject) {//console.log(“Creating UI Elem: sections ” );var tag = “” +dataObject.section + “


“; cenAjaxHolder.push(tag);} } if ( comboListBuilder.axialListArray.length != 0 && comboListBuilder.cenNewsArray.length != 0) { //self.numberOfArticles(self.cenCurrentIssueArray, 10); self.numberOfArticles(self.axialListArray, 6); self.numberOfArticles(self.cenNewsArray, 6); this.journalChoice = comboListBuilder.randomChoice(); //self.buildList(self.cenCurrentIssueArray, “cencurrent”); self.buildList(self.cenNewsArray, “cenlatest”); self.buildList(self.axialListArray, “axlist”); self.init(); } else { // Hide if no data £(‘.combo-bi-container’).addClass(“journal-in-active”); } }, switchItnow: function(elem){ var £inter_wrapper = £(“#rss-combolist-wrap”); var value = 320; if (elem === “current-issue”) { £(“.indicator-line”).removeClass(“change-line”); if (£inter_wrapper.hasClass(“mov-right”)) { £inter_wrapper.css(“transform”, “translateX(” + value + “px)”); } if (£inter_wrapper.hasClass(“mov-left”)) { value = 0; £inter_wrapper.css(“transform”, “translateX(” + value + “px)”); } } else if (elem === “latest-news”) { £(“.indicator-line”).addClass(“change-line”);if (£inter_wrapper.hasClass(“mov-right”)) {value = 0;£inter_wrapper.css(“transform”, “translateX(” + value + “px)”);} if (£inter_wrapper.hasClass(“mov-left”)) { value = -320; £inter_wrapper.css(“transform”, “translateX(” + value + “px)”); } } }, randomChoice: function() { var min = Math.ceil(1); var max = Math.floor(10); var value = Math.floor(Math.random() * (max – min)) + min; if (value > 7) { value = “axial”;£(“#axiallist”).removeClass(“j-hidden”); //journal-active£(“.combo-bi-container-slider”).addClass(“show-right”);£(“#rss-combolist-wrap”).addClass(“mov-left”);£(“.indicator-line”).removeClass(“change-line”); } else { value = “cenge”; //£(“#cen_list”).show(); //£(“#cen_list”).removeClass(“journal-in-active”); //journal-in-active £(“#cen_list”).removeClass(“j-hidden”); //journal-active } //console.log(“Value ” + value); return value;},buildList: function (journ, jname) { console.log(“Building the List …”);var £thelist = £(”);var holder =”; for (var i = 0; i ‘ + journ[i] + ”; if (i == journ.length – 1) { li = ‘

  • ‘ + journ[i] + ‘
  • ‘; // console.log(displayArray[i]); } if (jname != “cencurrent”) { if (i == journ.length – 1) { li = ‘

  • ‘ + journ[i] + ‘
  • ‘; } else { li = ‘

  • ‘ + journ[i] + ‘
  • ‘; } } £thelist.append(li); }; £(“#”+ jname +””).append(£thelist); //console.log(£thelist); }, numberOfArticles: function(arrayToTrim, numberOfArticles) { if (arrayToTrim.length != 0) { //console.log(“arrayToTrim.length ” + arrayToTrim.length)var limit = numberOfArticles;if (limit === arrayToTrim.length) {return false;} else {limit = arrayToTrim.length – limit;//console.log(“limit ” + limit)// for (var i = 0; i

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    *