Sha256: 4db93ed7483d249691fc5bf94983627bfd59cc79dcd6de6b6f09964baa15775d

Contents?: true

Size: 1.38 KB

Versions: 18

Compression:

Stored size: 1.38 KB

Contents

var WhowishWordElementCreator = WhowishWordCreator.extend({
  
	makeEditIcon: function(){
		
		this.attrs = WhowishWordElementGuard.getRelevantAttributes(this.element);
		var attrs = this.attrs;
		
		for (var i=0;i<attrs.length;i++) {
			
			var editIcon = document.createElement('span');
			$w(editIcon).addClass('whowishWordEditIcon');
			$w(editIcon).attr('id', whowishWordHelper.makeEditIconId(this.element, attrs[i]));
			$w(editIcon).attr('title', attrs[i]);
			
			var whowishWordIdPackage = whowishWordHelper.extractWhowishWordIdFromText($w(this.element).attr(attrs[i]));
			var idPackage = whowishWordHelper.parseWhowishWordIdPackage(whowishWordIdPackage);
			
					
			customData = {};
			customData.contentHandler = new WhowishWordAttributeHandler(this.element, attrs[i]);
			
			customData.id = idPackage.id;
			customData.variables = idPackage.variables;
			customData.attributeName = attrs[i];
			
			whowishWordStorage[editIcon.id] = customData;
			
			this.addEditIcon(editIcon);
		}
		
	},
  
  
	sanitize: function(){
		
		var attrs = this.attrs;
		
		for (var i=0;i<attrs.length;i++) {
			
			var newValue = whowishWordHelper.sanitize($w(this.element).attr(attrs[i]));
			
			try {
				this.element[attrs[i]] = newValue;
			} catch(e) {}
			
			try {
				this.element.attributes[attrs[i]].value = newValue;
			} catch (e) {}
			
			$w(this.element).attr(attrs[i], newValue);
			
		}
	
	},


  
});

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
whowish_word-0.5.2 lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js
whowish_word-0.5.1 lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js
whowish_word-0.5.0 lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js
whowish_word-0.4.0 lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js
whowish_word-0.3.3 lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js
whowish_word-0.3.2 lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js
whowish_word-0.3.1 lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js
whowish_word-0.3.0 lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js
whowish_word-0.2.7 lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js
whowish_word-0.2.6 lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js
whowish_word-0.2.5 lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js
whowish_word-0.2.3 lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js
whowish_word-0.2.2 lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js
whowish_word-0.2.1 lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js
whowish_word-0.2.0 lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js
whowish_word-0.1.9 lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js
whowish_word-0.1.8 lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js
whowish_word-0.1.7 lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js