define(['scripts/knockout-3.3.0','scripts/ACTComponent.js'], function(ko, ACTComponent) {

    function HelpContentComponentViewModel(params, element) {
		var self = this;

		self.base = new ACTComponent($(element), params);
		self.content = ko.observable("");
		self.filename = ko.observable("");
		self.hasFilename = ko.observable(false);
		self.element = element;

		self.transTextTitle        = ko.observable(params.Model.TranslatedTexts["Title"]);
		self.transTextEmptyContent = ko.observable(params.Model.TranslatedTexts["EmptyContent"]);

		self.base.onRefresh = function(obj) {
			self.content(obj.Content);
			self.filename(obj.FileName);
			self.hasFilename(false);
			if (self.filename()!="") {
				self.hasFilename(true);
			}
			if ((self.content()!="") || (self.filename()!="")) {
				self.transTextEmptyContent(self.content());
			}
		}

		self.base.initialize();
		params.ready(true);
    }

	return {
		createViewModel: function(params, componentInfo) {
            return new HelpContentComponentViewModel(params, componentInfo.element);
        }
	};

});

