Sha256: b265d9714db1f45f8172d74a3847cdce4300ed5cc202fc749a1d7b656241242f

Contents?: true

Size: 1.51 KB

Versions: 17

Compression:

Stored size: 1.51 KB

Contents

var WhowishWordCreator = Class.extend({
	
  init: function(elem){
  	
    this.element = elem;
	
	if (this.element.id == "" || this.element.id == undefined) {
		this.element.id = "whowishWordId" + (whowishWordVariables.idRunner++);
	}
	
	if (this.element.tagName.toLowerCase() == "option") {
		this.editIconPanel = (new WhowishWordSelectCreator($w(this.element).parent()[0])).editIconPanel;
	} else {
		this.editIconPanel = this.createAndGetEditIconPanel();
	}
	
	
	this.makeEditIcon();
	this.sanitize();
	
  },
  
  makeEditIcon: function() {
  	throw 'makeEditIcon() is not implemented'
  },
  
  sanitize: function() {
  	throw 'sanitize() is not implemented'
  },
  
  addEditIcon: function(editIcon){
    this.editIconPanel.appendChild(editIcon);
  },
  
  createAndGetEditIconPanel: function() {

	if ($('#' + this.makeEditIconPanelId()).length > 0)
		return $('#' + this.makeEditIconPanelId())[0];
  	
	var editIconPanel = document.createElement('span');
	
	$w(editIconPanel).attr('id', this.makeEditIconPanelId())
					.addClass('whowishWordEditIconPanel');
	
	customData = {};
	customData.editIconPanelId = editIconPanel.id;
	customData.elementId = this.element.id;
	customData.reposition = whowishWordHelper.editIconPanelRepositioning;
	
	whowishWordStorage[editIconPanel.id] = customData;
	
	
					
	whowishWordStorage[editIconPanel.id].reposition();
					
					
	$w(this.element).after(editIconPanel);
	
	return editIconPanel;
  },
  
  
  makeEditIconPanelId: function() {
  	return this.element.id + "EditPanel";
  }
  
  
});

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
whowish_word-1.0.0 lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js
whowish_word-0.6.5 lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js
whowish_word-0.6.4 lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js
whowish_word-0.6.3 lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js
whowish_word-0.6.2 lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js
whowish_word-0.6.2gem lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js
whowish_word-0.6.1 lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js
whowish_word-0.6.0 lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js
whowish_word-0.5.5 lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js
whowish_word-0.5.4 lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js
whowish_word-0.5.3 lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js
whowish_word-0.5.2 lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js
whowish_word-0.5.1 lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js
whowish_word-0.5.0 lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js
whowish_word-0.4.0 lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js
whowish_word-0.3.3 lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js
whowish_word-0.3.2 lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js