1function ptsElementBase(jqueryHtml, block) { 2 this._iterNum = 0; 3 this._id = 'el_'+ mtRand(1, 999999); 4 this._animationSpeed = g_ptsAnimationSpeed; 5 this._$ = jqueryHtml; 6 this._block = block; 7 if(typeof(this._menuOriginalId) === 'undefined') { 8 this._menuOriginalId = ''; 9 } 10 this._innerImgsCount = 0; 11 this._innerImgsLoaded = 0; 12 //this._$menu = null; 13 this._menu = null; 14 this._menuClbs = {}; 15 if(typeof(this._menuClass) === 'undefined') { 16 this._menuClass = 'ptsElementMenu'; 17 } 18 this._menuOnBottom = false; 19 this._code = 'base'; 20 21 this._initedComplete = false; 22 this._editArea = null; 23 if(typeof(this._isMovable) === 'undefined') { 24 this._isMovable = false; 25 } 26 this._moveHandler = null; 27 this._sortInProgress = false; 28 if(typeof(this._showMenuEvent) === 'undefined') { 29 this._showMenuEvent = 'click'; 30 } 31 if(typeof(this._changeable) === 'undefined') { 32 this._changeable = false; 33 } 34 if(g_ptsEdit) { 35 this._init(); 36 this._initMenuClbs(); 37 this._initMenu(); 38 39 var images = this._$.find('img'); 40 if(images && (this._innerImgsCount = images.size())) { 41 this._innerImgsLoaded = 0; 42 var self = this; 43 images.load(function(){ 44 self._innerImgsLoaded++; 45 if(self._$.find('img').size() == self._innerImgsLoaded) { 46 self._afterFullContentLoad(); 47 } 48 }); 49 } 50 } 51 this._onlyFirstHtmlInit(); 52 this._initedComplete = true; 53} 54ptsElementBase.prototype.getId = function() { 55 return this._id; 56}; 57ptsElementBase.prototype.getBlock = function() { 58 return this._block; 59}; 60ptsElementBase.prototype._onlyFirstHtmlInit = function() { 61 if(this._$ && !this._$.data('first-inited')) { 62 this._$.data('first-inited', 1); 63 return true; 64 } 65 return false; 66}; 67ptsElementBase.prototype.setIterNum = function(num) { 68 this._iterNum = num; 69 this._$.data('iter-num', num); 70}; 71ptsElementBase.prototype.getIterNum = function() { 72 return this._iterNum; 73}; 74ptsElementBase.prototype.$ = function() { 75 return this._$; 76}; 77ptsElementBase.prototype.getCode = function() { 78 return this._code; 79}; 80ptsElementBase.prototype._setCode = function(code) { 81 this._code = code; 82}; 83ptsElementBase.prototype._init = function() { 84 this._beforeInit(); 85}; 86ptsElementBase.prototype._beforeInit = function() { 87 88}; 89ptsElementBase.prototype.destroy = function() { 90 91}; 92ptsElementBase.prototype.get = function(opt) { 93 return jQuery('<div/>').html(this._$.attr( 'data-'+ opt )).text(); // not .data() - as it should be saved even after page reload, .data() will not create element attribute 94}; 95ptsElementBase.prototype.set = function(opt, val) { 96 this._$.attr( 'data-'+ opt, jQuery('<div/>').text(val).html() ); // not .data() - as it should be saved even after page reload, .data() will not create element attribute 97}; 98ptsElementBase.prototype._getEditArea = function() { 99 if(!this._editArea || this._$.attr('data-reset') == '1') { 100 this._editArea = this._$.children('.ptsElArea'); 101 if(!this._editArea.size()) { 102 this._editArea = this._$.find('.ptsInputShell'); 103 this._$.removeAttr('data-reset'); 104 } 105 } 106 return this._editArea; 107}; 108ptsElementBase.prototype._getOverlay = function() { 109 return this._$.find('.ptsElOverlay'); 110}; 111/** 112 * Standart button item 113 */ 114function ptsElement_btn(jqueryHtml, block) { 115 if(typeof(this._menuOriginalId) === 'undefined') { 116 this._menuOriginalId = 'ptsElMenuBtnExl'; 117 } 118 this._menuClass = 'ptsElementMenu_btn'; 119 this._haveAdditionBgEl = null; 120 this._changeable = true; 121 this.includePostLinks = true; 122 ptsElement_btn.superclass.constructor.apply(this, arguments); 123} 124extendPts(ptsElement_btn, ptsElementBase); 125ptsElement_btn.prototype._onlyFirstHtmlInit = function() { 126 if(ptsElement_btn.superclass._onlyFirstHtmlInit.apply(this, arguments)) { 127 if(this.get('customhover-clb')) { 128 var clbName = this.get('customhover-clb'); 129 if(typeof(this[clbName]) === 'function') { 130 var self = this; 131 this._getEditArea().hover(function(){ 132 self[clbName](true, this); 133 }, function(){ 134 self[clbName](false, this); 135 }); 136 } 137 } 138 } 139}; 140ptsElement_btn.prototype._hoverChangeFontColor = function( hover, element ) { 141 if(hover) { 142 jQuery(element) 143 .data('original-color', this._getEditArea().css('color')) 144 .css('color', jQuery(element).parents('.ptsEl:first').attr('data-bgcolor')); // Ugly, but only one way to get this value in dynamic way for now 145 } else { 146 jQuery(element) 147 .css('color', jQuery(element).data('original-color')); 148 } 149}; 150ptsElement_btn.prototype._hoverChangeBgColor = function( hover, element ) { 151 var parentElement = jQuery(element).parents('.ptsEl:first'); // Actual element html 152 if(hover) { 153 parentElement 154 .data('original-color', parentElement.css('background-color')) 155 .css('background-color', parentElement.attr('data-bgcolor')); // Ugly, but only one way to get this value in dynamic way for now 156 } else { 157 parentElement 158 .css('background-color', parentElement.data('original-color')); 159 } 160}; 161ptsElement_btn.prototype._hoverBorderColor = function( hover, element ) { 162 //var parentElement = jQuery(element).parents('.ptsEl:first'); // Actual element html 163 if(hover) { 164 jQuery(element) 165 .data('original-color', jQuery(element).css('border-color')) 166 .css('border-color', jQuery(element).parents('.ptsEl:first').attr('data-bgcolor')); // Ugly, but only one way to get this value in dynamic way for now 167 } else { 168 jQuery(element) 169 .css('border-color', jQuery(element).data('original-color')); 170 } 171};
172/** 173 * Table column element 174 */ 175function ptsElement_table_col(jqueryHtml, block) { 176 if(typeof(this._menuOriginalId) === 'undefined') { 177 this._menuOriginalId = 'ptsElMenuTableColExl'; 178 } 179 if(typeof(this._menuClass) === 'undefined') { 180 this._menuClass = 'ptsElementMenu_table_col'; 181 } 182 if(typeof(this._isMovable) === 'undefined') { 183 this._isMovable = true; 184 } 185 this._showMenuEvent = 'hover'; 186 this._colNum = 0; 187 ptsElement_table_col.superclass.constructor.apply(this, arguments); 188 /*if(parseInt(this.get('enb-schedule'))) { 189 console.log(this.getIterNum()); 190 }*/ 191} 192extendPts(ptsElement_table_col, ptsElementBase); 193ptsElement_table_col.prototype.setIterNum = function() { 194 ptsElement_table_col.superclass.setIterNum.apply(this, arguments); 195 if(!g_ptsEdit && typeof(ptsScheduleCheck) !== 'undefined') { 196 ptsScheduleCheck(this); 197 } 198}; 199/** 200 * Table description column element 201 */ 202function ptsElement_table_col_desc(jqueryHtml, block) { 203 this._isMovable = false; 204 ptsElement_table_col_desc.superclass.constructor.apply(this, arguments); 205 //this.refreshHeight(); 206 //var self = this; 207 /*this.getBlock().$().bind('ptsBlockContentChanged', function(){ 208 self.refreshHeight(); 209 });*/ 210} 211extendPts(ptsElement_table_col_desc, ptsElement_table_col); 212/*ptsElement_table_col_desc.prototype.refreshHeight = function() { 213 var sizes = this.getBlock().getMaxColsSizes(); 214 for(var key in sizes) { 215 var $entity = this._$.find(sizes[ key ].sel); 216 if($entity && $entity.size()) { 217 if(key == 'cells' && sizes[ key ].height) { 218 var cellNum = 0; 219 $entity.each(function(){ 220 if(typeof(sizes[ key ].height[ cellNum ]) !== 'undefined') { 221 jQuery(this).css('height', sizes[ key ].height[ cellNum ]); 222 } 223 cellNum++; 224 }); 225 } else { 226 $entity.css('height', sizes[ key ].height); 227 } 228 } 229 } 230};*/ 231 232/** 233 * Text element 234 */ 235function ptsElement_table_cell_txt(jqueryHtml, block) { 236 if (block.getParam('responsive_text')) { 237 jqueryHtml.find('span, p').responsiveText({ minFontSize: 14 }); 238 } 239 this.includePostLinks = true; 240 ptsElement_table_cell_txt.superclass.constructor.apply(this, arguments); 241} 242extendPts(ptsElement_table_cell_txt, ptsElementBase);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.