2015-10-18 20:05:30 +02:00
|
|
|
/// <reference path="../typings/tsd.d.ts" />
|
2015-10-17 14:12:04 +02:00
|
|
|
|
2015-11-14 20:14:10 +01:00
|
|
|
/// <reference path="index.appConfig.ts" />
|
2015-11-14 13:35:48 +01:00
|
|
|
/// <reference path="menu/menu.controller.ts" />
|
2015-11-14 13:41:51 +01:00
|
|
|
/// <reference path="services/backend.service.ts" />
|
2015-11-14 20:14:10 +01:00
|
|
|
/// <reference path="services/webpage.service.ts" />
|
|
|
|
/// <reference path="services/tag.service.ts" />
|
2015-10-17 14:12:04 +02:00
|
|
|
|
2015-11-14 13:35:48 +01:00
|
|
|
module tagIt {
|
2015-10-17 14:12:04 +02:00
|
|
|
|
2015-11-14 20:24:26 +01:00
|
|
|
angular.module('tagit', ['ngStorage'])
|
2015-11-14 20:14:10 +01:00
|
|
|
.config(AppConfigInitializer)
|
|
|
|
.service('AppConfigService', AppConfigService)
|
2015-11-14 13:41:51 +01:00
|
|
|
.service('BackendService', BackendService)
|
|
|
|
.service('WebPageService', WebPageService)
|
2015-11-14 20:14:10 +01:00
|
|
|
.service('TagService', TagService)
|
2015-10-21 22:05:49 +02:00
|
|
|
.controller('MenuCtrl', MenuCtrl);
|
|
|
|
|
2015-11-14 13:35:48 +01:00
|
|
|
export function init (callback: () => void) {
|
|
|
|
var $ = jQuery;
|
|
|
|
$.get(chromeUrlTranslator('menu.tpl.html'), function (htmlData) {
|
|
|
|
$('body').children().wrapAll('<div id="tagit-body" class="tagit-body" />');
|
|
|
|
$('.tagit-body').before(htmlData);
|
|
|
|
window.name = '';
|
2015-10-21 22:05:49 +02:00
|
|
|
angular.bootstrap(document.getElementById("tagit-menu"), ['tagit']);
|
|
|
|
console.log('TagIt menu loaded');
|
2015-11-14 13:35:48 +01:00
|
|
|
if(callback) callback();
|
2015-10-19 08:47:40 +02:00
|
|
|
});
|
2015-10-24 00:39:49 +02:00
|
|
|
|
2015-11-14 13:35:48 +01:00
|
|
|
function chromeUrlTranslator(relativeUrl : string) {
|
|
|
|
if(chrome && chrome.extension) {
|
|
|
|
return chrome.extension.getURL(relativeUrl);
|
|
|
|
} else {
|
2015-11-14 19:38:34 +01:00
|
|
|
return relativeUrl;
|
2015-11-14 13:35:48 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-10-17 14:12:04 +02:00
|
|
|
}
|
|
|
|
|