Sha256: 14944f761d8f9e4215ba732f3e7ba00f2e2d025379c84fb25c8400f114543d90
Contents?: true
Size: 1.56 KB
Versions: 11
Compression:
Stored size: 1.56 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); if (attrs[i] == "placeholder") { $w(editIcon).addClass('whowishWordPlaceHolderIcon'); } else if (attrs[i] == "title") { $w(editIcon).addClass('whowishWordTitleIcon'); } 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
11 entries across 11 versions & 1 rubygems