(function () { 'use strict'; //items service var serviceId = 'itemService'; angular.module('app').factory(serviceId, ['datacontext', itemService]); function itemService() { var service = { getItemIcon: getItemIcon }; return service; //get an icon css class based on the item type function getItemIcon(item) { if (!item) return 'item-icon-status'; if (item.addInType === 'heading') return 'item-icon-heading'; if (item.addInType === 'richtext') return 'item-icon-text'; if (item.displayType === 'status') return 'item-icon-status'; if (item.displayType === 'image') return 'item-icon-image'; if (item.displayType === 'video') return 'item-icon-video'; if (item.displayType === 'form') return 'item-icon-form'; if (item.displayType === 'embed-item') return 'item-icon-embed'; if (item.itemType === 'File') { if(item.displayType==='application/msword' || item.displayType==='application/vnd.openxmlformats-officedocument.wordprocessingml.document') return 'item-icon-file-doc'; if (item.displayType === 'application/vnd.ms-excel' || item.displayType === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') return 'item-icon-file-spreadsheet'; if (item.displayType === 'application/mspowerpoint' || item.displayType==='application/powerpoint' || item.displayType==='application/vnd.ms-powerpoint' || item.displayType==='application/x-mspowerpoint' || item.displayType==='application/vnd.openxmlformats-officedocument.presentationml.presentation') return 'item-icon-file-presentation'; if(item.displayType ==='application/pdf') return 'item-icon-pdf'; return 'item-icon-file'; } if (item.displayType === 'evernote') return 'item-icon-evernote'; if (item.displayType === 'youtube') return 'item-icon-youtube'; if (item.displayType === 'vimeo') return 'item-icon-vimeo'; if (item.displayType === 'dailymotion') return 'item-icon-dailymotion'; if (item.displayType === 'slideshare') return 'item-icon-slideshare'; if (item.displayType === 'google-maps') return 'item-icon-google-maps'; if (item.displayType === 'prezi') return 'item-icon-prezi'; if (item.displayType === 'flickr') return 'item-icon-flickr'; if (item.displayType === 'sketchfab') return 'item-icon-sketchfab'; if (item.displayType === 'weblink') return 'item-icon-weblink'; if (item.displayType === 'badge') return 'item-icon-badge'; if(item.displayType === 'badge collection') return 'item-icon-badge-collection'; if (item.displayType === 'embed-item') return 'item-icon-embed'; if (item.displayType === 'Myprogress assessment') return 'item-icon-myprogress'; return 'item-icon-status'; } } })();