Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

HTML
<div id="keyWordContainerDiv"></div>


<style>
	.Keyword-Container-Wrapper{
		width: 100%;
		height: auto;
		min-height: 30px;
	}
</style>


<script>


TOTVS_Keywords = {
	Id: 'KeyWord1',
	Container: null,
	Init: function(id, nameOfContainer){
		this.Id = id;
		this.Container = nameOfContainer;
	},
	Build: function(id, nameOfContainer){
			this.Init(id, nameOfContainer);


			this.Container = (typeof this.Container === "string") ? document.getElementById(this.Container) : this.Container; 


			var _keyWordContainerWrapper = document.createElement('div');		
			_keyWordContainerWrapper.id = this.Id + "_ContainerWrapper";
			_keyWordContainerWrapper.className = "Keyword-Container-Wrapper";
			_keyWordContainerWrapper.contentEditable = true;
			_keyWordContainerWrapper.onkeypress = function(e){
				var _evt = e || window.event;
				
				var keywords = this.innerHTML.split(' ');


				if(keywords.length > 0)
					alert(keywords);
			}


			this.Container.appendChild(_keyWordContainerWrapper);
	}
}


TOTVS_Keywords.Build('TOTVS_KeyWord', 'keyWordContainerDiv')


</script>