Sha256: aa209abed2ade225515e73128657ae412d25ebc8e3f2d8f21d06a915e60c00fc

Contents?: true

Size: 1.27 KB

Versions: 3

Compression:

Stored size: 1.27 KB

Contents

var WhowishWordCommonCreator = WhowishWordCreator.extend({
	
	identity: function() {
		throw 'identity() is not implemented'
	},
	
	getContent: function() {
		throw 'getContent() is not implemented'
	},
	
	setContent: function() {
		throw 'setContent() is not implemented'
	},
	
	instantiateAndGetContentHandler: function() {
		throw 'instantiateAndGetContentHandler() is not implemented'
	},
	
	makeEditIcon: function(){
		
		var editIcon = document.createElement('span');
		$w(editIcon).addClass('whowishWordEditIcon');
		$w(editIcon).attr('id', this.element.id + 
								whowishWordVariables.separator + 
								this.identity());
		$w(editIcon).attr('title', this.identity());
		
		var whowishWordIdPackage = whowishWordHelper.extractWhowishWordIdFromText(this.getContent());
		var idPackage = whowishWordHelper.parseWhowishWordIdPackage(whowishWordIdPackage);
		
		editIcon.whowishWord = {};
		editIcon.whowishWord.contentHandler = this.instantiateAndGetContentHandler();
		
		editIcon.whowishWord.id = idPackage.id;
		editIcon.whowishWord.variables = idPackage.variables;
		
		this.addEditIcon(editIcon);

	},
  
  
	sanitize: function(){

		this.setContent(this.getContent().replace(whowishWordVariables.attributeValuePattern,"$2"));
	
	},

  
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
whowish_word-0.1.6 lib/whowish_word/rails/public/javascripts/5_whowish_word_common_creator.js
whowish_word-0.1.5 lib/whowish_word/rails/public/javascripts/5_whowish_word_common_creator.js
whowish_word-0.1.4 lib/whowish_word/rails/public/javascripts/5_whowish_word_common_creator.js