{"version":3,"sources":["https:\/\/students.technion.ac.il\/local\/technionsearch\/amd\/src\/object_enrichment.js"],"names":["define","$","jui","ajax","notification","popper","ModalFactory","Templates","m_gtag","person_enrichment","silent","window","person_ids","get_objects","each","person_id","parseInt","attr","indexOf","push","get_person_data","useLocalStorage","Storage","forEach","hasInCache","fromLocalStorage","localStorage","getItem","timestamp","JSON","parse","cacheTimestamp","Date","now","call","methodname","args","query","done","data","result","id","i","e","setItem","stringify","code","clear","addClass","fail","exception","person_popup","create","title","lecturer","full_name","body","render","footer","large","modal","rateit","show","then","catch","document","ready","off","on","key","type","preventDefault","stopPropagation","course_enrichment","course_ids","course_id","get_course_data","courses_to_get_from_service","toString","length","course_tooltip","courses","course","item","tooltip","html","placement","container","vacancies_enrichment","vacancies_tooltip","v","tooltip_title","tooltips","prop","books","books_popup","popup_name"],"mappings":"AACAA,MAAM,CACF,CAAC,QAAD,CAAW,UAAX,CAAuB,WAAvB,CAAoC,mBAApC,CAAyD,aAAzD,CACI,oBADJ,CAC0B,gBAD1B,CAC4C,kCAD5C,CACgF,6BADhF,CADE,CAGF,SAASC,CAAT,CAAWC,CAAX,CAAgBC,CAAhB,CAAsBC,CAAtB,CAAoCC,CAApC,CAA4CC,CAA5C,CAA0DC,CAA1D,CAAqEC,CAArE,CAA6E,CAC7E,MAAO,CAMHC,iBAAiB,CAAE,2BAAUC,CAAV,CAAkB,CACjCA,CAAM,CAAsB,WAAlB,QAAOA,CAAAA,CAAR,IAAsCA,CAA\/C,CACA,GAA0C,WAAvC,QAAOC,CAAAA,MAAM,kBAAhB,CAAsD,CAKlDA,MAAM,kBAAN,CAA8B,EAA9B,CACAA,MAAM,aAAN,CAAyB,EAC5B,CAKD,GAAIC,CAAAA,CAAU,CAAG,EAAjB,CAKA,QAASC,CAAAA,CAAT,EAAuB,CACnBZ,CAAC,CAAC,6CAAD,CAAD,CAAiDa,IAAjD,CAAsD,UAAW,CAC7D,GAAIC,CAAAA,CAAS,CAAGC,QAAQ,CAACf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CAAe,CACjB,GAAIC,CAAAA,CAAM,CAAGD,CAAI,CAACC,MAAlB,CACAlC,CAAY,CAAC8C,MAAb,CAAoB,CAChBC,KAAK,CAAE,gEAA8Db,CAAM,CAACwD,UAD5D,CAEhBxC,IAAI,CAAEjD,CAAS,CAACkD,MAAV,CAAiB,uCAAjB,CAA0D,CAAClB,IAAI,CAAEC,CAAP,CAA1D,CAFU,CAGhBkB,MAAM,CAAE,EAHQ,CAIhBC,KAAK,GAJW,CAApB,EAMGrB,IANH,CAMQ,SAASsB,CAAT,CAAgB,CAClBA,CAAK,CAACE,IAAN,EAEH,CATH,EASKC,IATL,CASU,UAAW,CACjB,MAAO,EACV,CAXD,EAWGC,KAXH,EAYH,CAjBM,CAkBPf,IAAI,CAAE7C,CAAY,CAAC8C,SAlBZ,CAAD,CAAV,CAoBH,CAEDjD,CAAC,CAAC,UAAY,CAEVA,CAAC,CAACgE,QAAD,CAAD,CAAYE,GAAZ,CAAgB,gBAAhB,CAAkC,qBAAlC,EAAyDC,EAAzD,CAA4D,gBAA5D,CAA8E,qBAA9E,CAAqG,SAAUzB,CAAV,CAAa,CAC9G,GAAc,OAAV,GAAAA,CAAC,CAAC0B,GAAF,EAAgC,OAAX,GAAA1B,CAAC,CAAC2B,IAA3B,CAA6C,CACzC3B,CAAC,CAAC4B,cAAF,GACA5B,CAAC,CAAC6B,eAAF,GACAuB,CAAW,CAAC9F,CAAC,CAAC,IAAD,CAAD,CAAQgB,IAAR,CAAa,mBAAb,CAAD,CAAoC0B,CAApC,CACd,CACJ,CAND,CAOH,CATA,CAUJ,CAtYC,CAwYV,CA5YK,CAAN","sourcesContent":["\/\/'local_technionsearch\/bootstrap_bundle'\r\ndefine(\r\n ['jquery', 'jqueryui', 'core\/ajax', 'core\/notification', 'core\/popper',\r\n 'core\/modal_factory', 'core\/templates' ,'local_technionsearch\/gtag_source', 'local_technionsearch\/rateit'],\r\n function($,jui, ajax, notification, popper, ModalFactory, Templates, m_gtag) {\r\n return {\r\n\r\n \/**\r\n * @description This module search for data-person elements in current page\r\n * and retrieve additional information for that person\r\n *\/\r\n person_enrichment: function (silent) {\r\n silent = (typeof silent === 'undefined')?false:silent;\r\n if(typeof window['person_repository'] === 'undefined'){\r\n \/**\r\n *\r\n * @type {[]}\r\n *\/\r\n window['person_repository'] = [];\r\n window['person_calls'] = [];\r\n }\r\n \/**\r\n *\r\n * @type {[int]}\r\n *\/\r\n var person_ids = [];\r\n \/**\r\n * @description Find all unique instances of person objects and returns Person IDs\r\n * @returns {[int]}\r\n *\/\r\n function get_objects() {\r\n $('[data-person]:not([data-person_enrichment])').each(function() {\r\n var person_id = parseInt($(this).attr('data-person'));\r\n if(person_id && (person_ids.indexOf(person_id) === -1)){\r\n person_ids.push(person_id);\r\n }\r\n });\r\n return person_ids;\r\n }\r\n\r\n \/**\r\n * @description Requesting data for each unique person Id\r\n * @param {[int]} person_ids\r\n *\/\r\n function get_person_data(person_ids) {\r\n var useLocalStorage = (typeof(Storage) !== 'undefined');\r\n person_ids.forEach(function(person_id) {\r\n var hasInCache = false;\r\n if(useLocalStorage){\r\n var fromLocalStorage = window.localStorage.getItem('person_'+person_id);\r\n if(fromLocalStorage !== null){\r\n var timestamp = JSON.parse(fromLocalStorage).cacheTimestamp;\r\n hasInCache = (parseInt(timestamp) > (Date.now() - (1000*60*60*24)));\r\n }\r\n }\r\n else{\r\n if(typeof window['person_repository'][person_id] !== 'undefined'){\r\n hasInCache = true;\r\n }\r\n }\r\n if(!hasInCache){\r\n if(window['person_calls'].indexOf(person_id) === -1){\r\n window['person_calls'].push(person_id);\r\n ajax.call([{\r\n methodname: 'local_technionsearch_lecturer_score',\r\n args: {query: person_id},\r\n done: function(data) {\r\n var result = data.result;\r\n if (typeof (result['lecturer']) !== 'undefined' && result['lecturer'].id !== -1) {\r\n \/* eslint-disable no-script-url *\/\r\n $('[data-person=\"' + person_id + '\"]')\r\n .each(function (i, e) {\r\n if(useLocalStorage){\r\n result.cacheTimestamp = Date.now();\r\n try {\r\n window.localStorage.setItem('person_' + person_id, JSON.stringify(result));\r\n }\r\n catch (e) {\r\n if (e.code === \"22\" || e.code === \"1024\") {\r\n window.localStorage.clear();\r\n }\r\n }\r\n }\r\n else{\r\n window['person_repository'][person_id] = result;\r\n }\r\n $(e).addClass('data-enriched text-info');\r\n });\r\n }\r\n },\r\n fail: notification.exception\r\n }]);\r\n }\r\n\r\n }\r\n else{\r\n $('[data-person=\"' + person_id + '\"]')\r\n .each(function (i, e) {\r\n $(e).addClass('data-enriched text-info');\r\n });\r\n }\r\n\r\n });\r\n }\r\n\r\n \/**\r\n * @description Open lecturer popup when lecturer name is clicked\r\n * @param person_id\r\n *\/\r\n function person_popup(person_id){\r\n m_gtag('event','Open Lecturer Scores',{\r\n 'event_id' : person_id,\r\n 'event_label' : 'lecturer_' + person_id,\r\n 'event_brand' : 'Technion',\r\n 'event_category' : 'Lecturer',\r\n 'value' : 1\r\n });\r\n var useLocalStorage = (typeof(Storage) !== 'undefined');\r\n try {\r\n \/**\r\n *\r\n * @type {{lecturer: Lecturer}} Data\r\n *\/\r\n var data = [];\r\n if(useLocalStorage){\r\n var fromLocalStorage = window.localStorage.getItem('person_'+person_id);\r\n if(fromLocalStorage !== null){\r\n data = JSON.parse(fromLocalStorage);\r\n }\r\n }\r\n else{\r\n data = window['person_repository'][person_id];\r\n }\r\n ModalFactory.create({\r\n title: '<\/i> ' + data.lecturer.full_name,\r\n body: Templates.render('local_technionsearch\/person_popup_card', {data: data}),\r\n footer: '',\r\n large: true\r\n })\r\n .done(function(modal) {\r\n $('.rateit').rateit();\r\n modal.show();\r\n \/\/ Do what you want with your new modal.\r\n }).then(function() {\r\n $('.rateit').rateit();\r\n return \"\";\r\n }).catch();\r\n } catch(e) {\r\n \/\/ Do nothing\r\n }\r\n }\r\n\r\n if(typeof window['person_popup'] === 'undefined'){\r\n window['person_popup'] = person_popup;\r\n }\r\n\r\n $(document).ready(function () {\r\n get_person_data(get_objects());\r\n if(!silent){\r\n $(document).off('keypress click', '[data-person]').on('keypress click', '[data-person]', function (e) {\r\n if (e.key === \"Enter\" || e.type === 'click') {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n person_popup($(this).attr('data-person'), e);\r\n }\r\n });\r\n }\r\n });\r\n\r\n },\r\n \/**\r\n * @description This module search for data-course elements in current page\r\n * and retrieve additional information for that course\r\n *\/\r\n course_enrichment: function () {\r\n if(typeof window['course_repository'] === 'undefined'){\r\n \/**\r\n *\r\n * @type {[]}\r\n *\/\r\n window['course_repository'] = [];\r\n }\r\n \/**\r\n * @description Find all unique instances of course objects and returns Course IDs\r\n * @returns {[int]}\r\n *\/\r\n function get_objects() {\r\n var course_ids = [];\r\n $('[data-course]').each(function() {\r\n var course_id = parseInt($(this).attr('data-course'));\r\n if(course_id && (course_ids.indexOf(course_id) === -1)){\r\n course_ids.push(course_id);\r\n }\r\n });\r\n return course_ids;\r\n }\r\n\r\n \/**\r\n * @description Requesting data for each unique course Id\r\n * @param {[int]} course_ids\r\n *\/\r\n function get_course_data(course_ids) {\r\n var useLocalStorage = (typeof(Storage) !== 'undefined');\r\n var courses_to_get_from_service = [];\r\n course_ids.forEach(function(course_id) {\r\n if(course_id.toString().length < 6){\r\n while (course_id.toString().length < 6) {\r\n course_id = '0' + course_id;\r\n }\r\n }\r\n var hasInCache = false;\r\n if(useLocalStorage){\r\n var fromLocalStorage = window.localStorage.getItem('course_'+course_id);\r\n if(fromLocalStorage !== null){\r\n if(JSON.parse(fromLocalStorage)[0] !== undefined){\r\n var timestamp = JSON.parse(fromLocalStorage)[0].cacheTimestamp;\r\n hasInCache = (parseInt(timestamp) > (Date.now() - (1000*60*60*24*30)));\r\n }\r\n else{\r\n hasInCache = false;\r\n }\r\n }\r\n }\r\n else{\r\n if(typeof window['course_repository'][course_id] !== 'undefined'){\r\n hasInCache = true;\r\n }\r\n }\r\n if(!hasInCache){\r\n courses_to_get_from_service.push(course_id);\r\n }\r\n else{\r\n course_tooltip(course_id);\r\n }\r\n\r\n });\r\n if (courses_to_get_from_service.length > 0){\r\n ajax.call([{\r\n methodname: 'local_technionsearch_courses',\r\n args: {course_ids: course_ids},\r\n done: function(data) {\r\n var courses = data.result;\r\n if(courses.length > 0){\r\n if(useLocalStorage){\r\n for(let i = 0; i < courses.length; i++){\r\n courses[i].cacheTimestamp = Date.now();\r\n try {\r\n window.localStorage.setItem(\r\n 'course_' + courses[i]['course_id'],\r\n JSON.stringify(courses[i])\r\n );\r\n course_tooltip(courses[i]['course_id']);\r\n }\r\n catch (e) {\r\n if (e.code === \"22\" || e.code === \"1024\") {\r\n window.localStorage.clear();\r\n }\r\n }\r\n }\r\n\r\n }\r\n else{\r\n for(let i = 0; i < courses.length; i++) {\r\n window['course_repository'][courses[i]['course_id']] = courses[i];\r\n course_tooltip(courses[i]['course_id']);\r\n }\r\n }\r\n }\r\n },\r\n fail: notification.exception\r\n }]);\r\n }\r\n }\r\n\r\n function course_tooltip(course_id){\r\n var useLocalStorage = (typeof(Storage) !== 'undefined');\r\n var course = [];\r\n if(useLocalStorage){\r\n var fromLocalStorage = window.localStorage.getItem('course_'+course_id);\r\n if(fromLocalStorage !== null){\r\n course = JSON.parse(fromLocalStorage);\r\n }\r\n }\r\n else{\r\n course = window['course_repository'][course_id];\r\n }\r\n if (typeof (course) !== 'undefined') {\r\n var item = $('[data-course$=\"' + parseInt(course_id) + '\"]');\r\n \/* eslint-disable no-script-url *\/\r\n item.each(function (i, e) {\r\n $(e).attr('data-course_enrichment', JSON.stringify([course]));\r\n $(e).addClass('data-enriched text-info');\r\n });\r\n Templates.render('local_technionsearch\/course_popup_information', [course])\r\n .then(function(data) {\r\n item.tooltip({\r\n title: data,\r\n html: true,\r\n placement: 'auto',\r\n container: 'body'\r\n });\r\n return \"\";\r\n })\r\n .fail(notification.exception);\r\n }\r\n }\r\n\r\n $(document).ready(function () {\r\n get_course_data(get_objects());\r\n });\r\n },\r\n\r\n vacancies_enrichment: function() {\r\n function vacancies_tooltip() {\r\n $('[data-vacancies]').each(function (i, v) {\r\n var tooltip_title = $(v).data('vacancies');\r\n if (tooltip_title !== null && tooltip_title.length) {\r\n $(v).tooltip({\r\n title: tooltip_title,\r\n html: true,\r\n placement: 'auto',\r\n container: 'body'\r\n });\r\n }\r\n });\r\n }\r\n\r\n $(function () {\r\n vacancies_tooltip();\r\n });\r\n },\r\n\r\n tooltips: function(){\r\n $(function () {\r\n \/\/ console.log([$('[data-toggle=\"tooltip\"]'), $('[data-toggle=\"tooltip\"]').tooltip()]);\r\n $('[data-toggle=\"data-to_toggle\"]').each(function (i, v) {\r\n var tooltip_title = $(v).prop('title');\r\n if (tooltip_title !== null && tooltip_title.length) {\r\n $(v).tooltip({\r\n title: tooltip_title,\r\n html: true,\r\n placement: 'auto',\r\n container: 'body'\r\n });\r\n }\r\n });\r\n });\r\n },\r\n\r\n books: function() {\r\n\r\n \/**\r\n * @description Open books popup is clicked\r\n * @param course_id\r\n *\/\r\n function books_popup(course_id){\r\n m_gtag('event','Open Course Books List',{\r\n 'event_id' : 'books_for_' + course_id,\r\n 'event_label' : 'books_for_' + course_id,\r\n 'event_brand' : 'Technion',\r\n 'event_category' : 'Books',\r\n 'value' : 1\r\n });\r\n ajax.call([{\r\n methodname: 'local_technionsearch_books',\r\n args: {course_id: course_id},\r\n done: function(data) {\r\n var result = data.result;\r\n ModalFactory.create({\r\n title: '<\/i> ' + result.popup_name,\r\n body: Templates.render('local_technionsearch\/books_popup_card', {data: result}),\r\n footer: '',\r\n large: true\r\n })\r\n .done(function(modal) {\r\n modal.show();\r\n \/\/ Do what you want with your new modal.\r\n }).then(function() {\r\n return \"\";\r\n }).catch();\r\n },\r\n fail: notification.exception\r\n }]);\r\n }\r\n\r\n $(function () {\r\n \/\/ console.log([$('[data-toggle=\"tooltip\"]'), $('[data-toggle=\"tooltip\"]').tooltip()]);\r\n $(document).off('keypress click', '[data-course_books]').on('keypress click', '[data-course_books]', function (e) {\r\n if (e.key === \"Enter\" || e.type === 'click') {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n books_popup($(this).attr('data-course_books'), e);\r\n }\r\n });\r\n });\r\n }\r\n };\r\n});\r\n\r\n"],"file":"object_enrichment.min.js"}