{"version":3,"sources":["Honeywell.Clientmodel.VideosController.ts"],"names":["VideosController","prototype","populateFilterQuery","listname","model","query","queryCount","tplDiv","$","STSHtmlEncode","Strings","STS","L_CurrentUICulture_Name","spTemplate","data","btnclass","headerclass","showButton","obj","btnClass","headerClass","divid","this","attr","divctrl","Q","resolve","Honeywell_ClientModel_TemplateService_1","TemplateService","getTemplate","Honeywell_ClientModel_MainHelper_1","MainHelper","configSettings","ShowPaginationOnVideos","PaginationItemsPerPageOnVideos","parseInt","Honeywell_Clientmodel_PaginationController_1","PaginationController","getValueFromQueryString","renderVideosList","items","totalItemCount","length","show","each","index","Thumbnail","window","location","protocol","replace","Items","then","template","replaceWith","initializeVideosPop","pc","loadPagination","handleError","reason","console","log","exports"],"mappings":"kPAOA,IAEAA,GAAA,WAAA,QAAAA,MAiEA,MAhEIA,GAAAC,UAAAC,oBAAA,SAAoBC,EAAkBC,EAAeC,EAAeC,GAChE,GAAIC,GAASC,EAAE,6BAA6B,EAGnB,oBAAd,UACWC,cAAcC,QAAQC,IAAIC,wBAGhD,IAEIC,IAFaL,EAAED,GAAQO,KAAK,cACjBN,EAAED,GAAQO,KAAK,YACbN,EAAED,GAAQO,KAAK,iBAC5BC,EAAWP,EAAED,GAAQO,KAAK,YAC1BE,EAAcR,EAAED,GAAQO,KAAK,eAC7BG,EAAyB,IAAZF,EAEbG,GADUV,EAAED,GAAQO,KAAK,mBACjBK,SAAYJ,EAAUK,YAAeJ,EAAaK,MAASb,EAAEc,MAAMC,KAAK,MAAON,WAAcA,EAAYO,QAAWhB,EAAEc,OACjHG,GAAEC,QAAQR,GACL,GAAIS,GAAAC,gBAAgBf,GAAYgB,aAGG,UAArDC,EAAAC,WAAWC,eAAeC,wBACYH,EAAAC,WAAWC,eAAeE,8BAGhEC,UAASC,EAAAC,qBAAqBpC,UAAUqC,wBAAwB,WAAa,GACrEH,SAASC,EAAAC,qBAAqBpC,UAAUqC,wBAAwB,YAKhFtC,EAAAC,UAAAsC,iBAAA,SAAiBC,EAAcC,GAEvBD,EAAME,OAAS,IACflC,EAAE,oBAAoBmC,OACtBnC,EAAEgC,GAAOI,KAAK,SAAUC,GACpBL,EAAMK,GAAOC,UAAyC,WAA7BC,OAAOC,SAASC,SAAwBT,EAAMK,GAAOC,UAAUI,QAAQ,QAAS,UAAYV,EAAMK,GAAOC,YAI1I,IAAIhC,IACAqC,MAAOX,EAGX,IAAIb,GAAAC,gBAAgB,0BAA0BC,cAAcuB,KAAK,SAAUC,GAEvE7C,EAAE,mBAAmB8C,YAAYD,EAASvC,IAC1CgB,EAAAC,WAAWwB,qBAEX,IAAIC,EAKAA,GAAK,GAAIpB,GAAAC,qBAAqBI,MAElCe,EAAGC,eAAe,aAM1BzD,EAAAC,UAAAyD,YAAA,SAAYC,GACRC,QAAQC,IAAI,4BAEpB7D,IAjEa8D,GAAA9D,iBAAAA","file":"Honeywell.Clientmodel.VideosController.js","sourcesContent":["import {DataService} from \"./Honeywell.ClientModel.DataService\";\r\nimport {TemplateService} from \"./Honeywell.ClientModel.TemplateService\";\r\nimport {MainHelper} from \"./Honeywell.ClientModel.MainHelper\";\r\nimport {PaginationController} from \"./Honeywell.Clientmodel.PaginationController\";\r\nimport * as Q from \"q\";\r\ndeclare var Strings: any;\r\n\r\nvar currentCategory: string = \"\";\r\n\r\nexport class VideosController {\r\n populateFilterQuery(listname: string, model: string, query: string, queryCount: string) {\r\n var tplDiv = $('*[data-genericxsl=\"true\"]')[0];\r\n\r\n var defaultLanguage = 'en-GB';\r\n if (typeof (Strings) !== \"undefined\") {\r\n defaultLanguage = STSHtmlEncode(Strings.STS.L_CurrentUICulture_Name);\r\n }\r\n\r\n var splistname = $(tplDiv).data('splistname');\r\n var splistid = $(tplDiv).data('splistid');\r\n var spTemplate = $(tplDiv).data('templatename');\r\n var btnclass = $(tplDiv).data('btnclass');\r\n var headerclass = $(tplDiv).data('headerclass');\r\n var showButton = btnclass != '';\r\n var product = $(tplDiv).data('catalogproduct');\r\n var obj = { 'btnClass': btnclass, 'headerClass': headerclass, 'divid': $(this).attr('id'), 'showButton': showButton, 'divctrl': $(this) };\r\n var objPromise = Q.resolve(obj);\r\n var templatePromise = new TemplateService(spTemplate).getTemplate();\r\n\r\n var pageQry = '';\r\n if (MainHelper.configSettings.ShowPaginationOnVideos === 'True') {\r\n pageQry = '<RowLimit Paged=\"TRUE\">' + MainHelper.configSettings.PaginationItemsPerPageOnVideos + '</RowLimit>';\r\n }\r\n var index = null;\r\n if (parseInt(PaginationController.prototype.getValueFromQueryString('start1')) > 0) {\r\n index = parseInt(PaginationController.prototype.getValueFromQueryString('start1'));\r\n }\r\n\r\n }\r\n\r\n renderVideosList(items: any[], totalItemCount: number) {\r\n\r\n if (items.length > 0) {\r\n $('#js-load-info-li').show();\r\n $(items).each(function (index) {\r\n items[index].Thumbnail = window.location.protocol === \"https:\" ? items[index].Thumbnail.replace('http:', 'https:') : items[index].Thumbnail;\r\n });\r\n }\r\n\r\n var data = {\r\n Items: items // ,\r\n }\r\n\r\n new TemplateService(\"tpl_ListingVideos.html\").getTemplate().then(function (template: any) {\r\n\r\n $('#js-videos-list').replaceWith(template(data));\r\n MainHelper.initializeVideosPop();\r\n\r\n var pc;\r\n if (currentCategory) {\r\n pc = new PaginationController(totalItemCount, [\"category=\" + currentCategory]);\r\n }\r\n else {\r\n pc = new PaginationController(totalItemCount, []);\r\n }\r\n pc.loadPagination('Videos');\r\n });\r\n\r\n }\r\n\r\n\r\n handleError(reason: string) {\r\n console.log(\"Error on loading Videos\");\r\n }\r\n}"]}