Plugin Directory

Changeset 2141952


Ignore:
Timestamp:
08/19/2019 01:47:30 PM (7 years ago)
Author:
nikmelnik
Message:

правки и фиксы.

Location:
realbig-media/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • realbig-media/trunk/asyncBlockInserting.js

    r2138846 r2141952  
    3030if (typeof endedCc === 'undefined') {
    3131    var endedCc = false;
     32}
     33if (typeof usedAdBlocksArray==='undefined') {
     34    var usedAdBlocksArray = [];
     35}
     36if (typeof usedBlockSettingArrayIds==='undefined') {
     37    var usedBlockSettingArrayIds = [];
    3238}
    3339
     
    213219    if (excIdClass&&excIdClass.length > 0) {
    214220        for (i = 0; i < excIdClass.length; i++) {
    215             blocksRepositionUse(excIdClass[i], '', markingString);
    216         }
    217     }
    218 
     221            if (excIdClass[i].length > 0) {
     222                blocksRepositionUse(excIdClass[i], '', markingString);
     223            }
     224        }
     225    }
    219226}
    220227
    221228function asyncBlocksInsertingFunction(blockSettingArray, contentLength) {
    222229    try {
    223         var content_pointer = document.querySelector("#content_pointer_id");
     230        var content_pointer = document.querySelector("#content_pointer_id"); //orig
     231        // var content_pointer = document.querySelectorAll("#content_pointer_id");
     232        // content_pointer = content_pointer[content_pointer.length - 1];
    224233        var parent_with_content = content_pointer.parentElement;
    225234        var lordOfElements = parent_with_content;
     
    239248        let containerFor7th = [];
    240249        let posCurrentElement;
     250        // var checkIfBlockUsed = 0;
    241251
    242252        function getFromConstructions(currentElement) {
     
    306316        }
    307317
     318        // if (usedBlockSettingArray&&usedBlockSettingArray.length > 0) {
     319        //     for (let j = 0; j < usedBlockSettingArray.length; j++) {
     320        //         if (usedBlockSettingArrayIds.length > 0) {
     321        //             if (usedBlockSettingArrayIds.includes(usedBlockSettingArray[j]['id'])) {
     322        //                 continue;
     323        //             }
     324        //         }
     325        //         usedBlockSettingArrayIds.push(usedBlockSettingArray[j]['id']);
     326        //     }
     327        // }
     328
    308329        for (var i = 0; i < blockSettingArray.length; i++) {
    309330            currentElement = null;
     
    314335                    continue;
    315336                }
     337                // checkIfBlockUsed = elementToAdd.querySelector('.content_rb');
     338                // checkIfBlockUsed = checkIfBlockUsed.getAttribute('data-id');
     339                // if (usedAdBlocksArray&&usedAdBlocksArray.length > 0) {
     340                //     if (checkIfBlockUsed&&checkIfBlockUsed > 0&&usedAdBlocksArray.includes(checkIfBlockUsed)) {
     341                //         blockSettingArray.splice(i, 1);
     342                //         continue;
     343                //     }
     344                // }
     345                // if (usedBlockSettingArrayIds&&usedBlockSettingArrayIds.length > 0) {
     346                //     if (checkIfBlockUsed&&checkIfBlockUsed > 0&&usedBlockSettingArrayIds.includes(checkIfBlockUsed)) {
     347                //         blockSettingArray.splice(i, 1);
     348                //         continue;
     349                //     }
     350                // }
    316351
    317352                if (blockSettingArray[i]["minHeaders"] > 0) {
     
    359394                            if (excIdClass&&excIdClass.length > 0) {
    360395                                for (let i2 = 0; i2 < excIdClass.length; i2++) {
    361                                     currentElement = blocksRepositionUse(excIdClass[i2], currentElement, 'marked');
     396                                    if (excIdClass[i2].length > 0) {
     397                                        currentElement = blocksRepositionUse(excIdClass[i2], currentElement, 'marked');
     398                                    }
    362399                                }
    363400                            }
     
    373410                            if (excIdClass&&excIdClass.length > 0) {
    374411                                for (let i2 = 0; i2 < excIdClass.length; i2++) {
    375                                     currentElement = blocksRepositionUse(excIdClass[i2], currentElement, 'marked');
     412                                    if (excIdClass[i2].length > 0) {
     413                                        currentElement = blocksRepositionUse(excIdClass[i2], currentElement, 'marked');
     414                                    }
    376415                                }
    377416                            }
     
    385424                        currentElement.parentNode.insertBefore(elementToAdd, posCurrentElement);
    386425                        elementToAdd.classList.remove('coveredAd');
     426                        // usedAdBlocksArray.push(checkIfBlockUsed);
    387427                        blockSettingArray.splice(i, 1);
    388428                        poolbackI = 1;
     
    457497                        currentElement.parentNode.insertBefore(elementToAdd, posCurrentElement);
    458498                        elementToAdd.classList.remove('coveredAd');
    459 
     499                        // usedAdBlocksArray.push(checkIfBlockUsed);
    460500                        blockSettingArray.splice(i, 1);
    461501                        poolbackI = 1;
     
    466506                } else if (blockSettingArray[i]["setting_type"] == 4) {
    467507                    parent_with_content.append(elementToAdd);
     508                    // usedAdBlocksArray.push(checkIfBlockUsed);
    468509                    blockSettingArray.splice(i, 1);
    469510                    poolbackI = 1;
     
    471512                } else if (blockSettingArray[i]["setting_type"] == 5) {
    472513                    let currentElement = document.getElementById("content_pointer_id").parentElement;
     514                    // let currentElement = document.querySelectorAll("content_pointer_id");
     515                    // currentElement = currentElement[currentElement.length - 1];
     516                    // currentElement = currentElement.parentElement;
    473517                    if (currentElement.getElementsByTagName("p").length > 0) {
    474518                        let pCount = currentElement.getElementsByTagName("p").length;
     
    480524                        if (excIdClass&&excIdClass.length > 0) {
    481525                            for (let i2 = 0; i2 < excIdClass.length; i2++) {
    482                                 currentElement = blocksRepositionUse(excIdClass[i2], currentElement, 'marked');
     526                                if (excIdClass[i2].length > 0) {
     527                                    currentElement = blocksRepositionUse(excIdClass[i2], currentElement, 'marked');
     528                                }
    483529                            }
    484530                        }
     
    491537                                elementToAdd.classList.remove('coveredAd');
    492538                            }
     539                            // usedAdBlocksArray.push(checkIfBlockUsed);
    493540                            blockSettingArray.splice(i, 1);
    494541                            poolbackI = 1;
     
    507554                                if (j == containerFor6th.length-1) {
    508555                                    containerFor6th.push(blockSettingArray[i]);
     556                                    // usedAdBlocksArray.push(checkIfBlockUsed);
    509557                                    blockSettingArray.splice(i, 1);
    510558                                    poolbackI = 1;
     
    517565                                }
    518566                                containerFor6th[j] = blockSettingArray[i];
     567                                // usedAdBlocksArray.push(checkIfBlockUsed);
    519568                                blockSettingArray.splice(i, 1);
    520569                                poolbackI = 1;
     
    525574                    } else {
    526575                        containerFor6th.push(blockSettingArray[i]);
     576                        // usedAdBlocksArray.push(checkIfBlockUsed);
    527577                        blockSettingArray.splice(i, 1);
    528578                        poolbackI = 1;
     
    537587                                if (j == containerFor7th.length-1) {
    538588                                    containerFor7th.push(blockSettingArray[i]);
     589                                    // usedAdBlocksArray.push(checkIfBlockUsed);
    539590                                    blockSettingArray.splice(i, 1);
    540591                                    poolbackI = 1;
     
    547598                                }
    548599                                containerFor7th[j] = blockSettingArray[i];
     600                                // usedAdBlocksArray.push(checkIfBlockUsed);
    549601                                blockSettingArray.splice(i, 1);
    550602                                poolbackI = 1;
     
    555607                    } else {
    556608                        containerFor7th.push(blockSettingArray[i]);
     609                        // usedAdBlocksArray.push(checkIfBlockUsed);
    557610                        blockSettingArray.splice(i, 1);
    558611                        poolbackI = 1;
     
    561614                //    vidpravutu v vidstiinuk dlya 7ho tipa
    562615                }
     616                // checkIfBlockUsed = 0;
    563617            } catch (e) { }
    564618        }
     
    909963                            if (excIdClass&&excIdClass.length > 0) {
    910964                                for (let i2 = 0; i2 < excIdClass.length; i2++) {
    911                                     elementToBind = blocksRepositionUse(excIdClass[i2], elementToBind, 'marked');
     965                                    if (excIdClass[i2].length > 0) {
     966                                        elementToBind = blocksRepositionUse(excIdClass[i2], elementToBind, 'marked');
     967                                    }
    912968                                }
    913969                            }
     
    927983                    if (excIdClass&&excIdClass.length > 0) {
    928984                        for (let i2 = 0; i2 < excIdClass.length; i2++) {
    929                             elementToBind = blocksRepositionUse(excIdClass[i2], elementToBind, 'marked');
     985                            if (excIdClass[i2].length > 0) {
     986                                elementToBind = blocksRepositionUse(excIdClass[i2], elementToBind, 'marked');
     987                            }
    930988                        }
    931989                    }
     
    939997                            if (excIdClass&&excIdClass.length > 0) {
    940998                                for (let i2 = 0; i2 < excIdClass.length; i2++) {
    941                                     elementToBind = blocksRepositionUse(excIdClass[i2], elementToBind, 'marked');
     999                                    if (excIdClass[i2].length > 0) {
     1000                                        elementToBind = blocksRepositionUse(excIdClass[i2], elementToBind, 'marked');
     1001                                    }
    9421002                                }
    9431003                            }
     
    9501010                                if (excIdClass&&excIdClass.length > 0) {
    9511011                                    for (let i2 = 0; i2 < excIdClass.length; i2++) {
    952                                         elementToBind = blocksRepositionUse(excIdClass[i2], elementToBind, 'marked');
     1012                                        if (excIdClass[i2].length > 0) {
     1013                                            elementToBind = blocksRepositionUse(excIdClass[i2], elementToBind, 'marked');
     1014                                        }
    9531015                                    }
    9541016                                }
     
    10041066        var lastLceCou = 0;
    10051067        var elementToBind;
     1068        // var checkIfBlockUsed = 0;
    10061069
    10071070        function textLengthMeter(i, usedElement, deepLvl) {
     
    11631226                    for (let i = 0; i < perfectPlace.length; i++) {
    11641227                        if (perfectPlace[i].getAttribute('data-id') > textNeedyLength) {
     1228                            elementToAdd = document.querySelector('.percentPointerClass[data-id="'+containerFor6th[j]['id']+'"]');
     1229                            if (!elementToAdd) {
     1230                                return false;
     1231                            }
     1232
    11651233                            if (i > 0) {
    11661234                                localMiddleValue = perfectPlace[i].getAttribute('data-id') - perfectPlace[i-1].getAttribute('data-id');
     
    11701238                            }
    11711239
    1172                             elementToAdd = document.querySelector('.percentPointerClass[data-id="'+containerFor6th[j]['id']+'"]');
    11731240                            elementToBind = perfectPlace[i];
    11741241                            if (excIdClass&&excIdClass.length > 0) {
    11751242                                for (let i2 = 0; i2 < excIdClass.length; i2++) {
    1176                                     elementToBind = blocksRepositionUse(excIdClass[i2], elementToBind, 'marked');
     1243                                    if (excIdClass[i2].length > 0) {
     1244                                        elementToBind = blocksRepositionUse(excIdClass[i2], elementToBind, 'marked');
     1245                                    }
    11771246                                }
    11781247                            }
     
    11831252                                elementToBind.parentNode.insertBefore(elementToAdd, elementToBind);
    11841253                            }
     1254                            // usedAdBlocksArray.push(checkIfBlockUsed);
    11851255                            elementToAdd.classList.remove('coveredAd');
    11861256                            return false;
  • realbig-media/trunk/realbigForWP.php

    r2138846 r2141952  
    1111Plugin name:  Realbig Media
    1212Description:  Плагин для монетизации от RealBig.media
    13 Version:      0.1.26.74
     13Version:      0.1.26.75
    1414Author:       Realbig Team
    1515License:      GPLv2 or later
     
    138138        $GLOBALS['realbigForWP_version'] = $pluginData['Version'];
    139139    } else {
    140         $GLOBALS['realbigForWP_version'] = '0.1.26.74';
     140        $GLOBALS['realbigForWP_version'] = '0.1.26.75';
    141141    }
    142142    $lastSuccessVersionGatherer = get_option('realbig_status_gatherer_version');
Note: See TracChangeset for help on using the changeset viewer.