Skip to content

Instantly share code, notes, and snippets.

@vchub
Last active December 21, 2015 19:19
Show Gist options
  • Select an option

  • Save vchub/6353443 to your computer and use it in GitHub Desktop.

Select an option

Save vchub/6353443 to your computer and use it in GitHub Desktop.

Revisions

  1. vchub revised this gist Sep 4, 2013. 2 changed files with 13 additions and 1 deletion.
    13 changes: 13 additions & 0 deletions category_filter.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@

    _gravity.push({type : 'recommendation',
    callback: callback_fn,
    numberLimit: 4,
    scenarioId: "CATEGORY_PAGE",
    currentItemId: "xxx",
    itemOnPage: [], // [] of itemIds already displayed on the page
    resultNames: ["itemId"],

    // фильтр по категории
    // т.е. мы хотим получить реко на товары из категории 1
    categoryId: "1"
    });
    1 change: 0 additions & 1 deletion rec_click.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@

    // Example of adding REC_CLICK event handling to reco-box
    // Just an idea, not suggestion for implementation

  2. vchub revised this gist Aug 27, 2013. 1 changed file with 7 additions and 3 deletions.
    10 changes: 7 additions & 3 deletions rec_click.js
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,22 @@

    // Example of adding REC_CLICK event handling to reco-box
    // Just an idea, not suggestion for implementation

    var i = 0;

    $(".t20_goods_block").each(function(){
    $("t20_goods_block").each(function(){
    $(this).mousedown(function(){
    _gravity = _gravity || [];
    _gravity.push({
    type: 'event',
    eventType: 'REC_CLICK',
    // result is data received in recommendation request
    // for own reco-boxes that don't use gravity, a fixed value is used
    // i.e.:
    // recommendationId: "komus",
    // e.g. recommendationId: "OWN_ITEM_PAGE",
    recommendationId: result.recommendationId,
    itemId: result.items[i].itemid,
    });
    });
    i++;
    });

  3. vchub revised this gist Aug 27, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion rec_click.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    var i = 0;

    $("t20_goods_block").each(function(){
    $(".t20_goods_block").each(function(){
    $(this).mousedown(function(){
    _gravity = _gravity || [];
    _gravity.push({
  4. vchub revised this gist Aug 27, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion rec_click.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    var i = 0;

    $("t20_goods_block a").each(function(){
    $("t20_goods_block").each(function(){
    $(this).mousedown(function(){
    _gravity = _gravity || [];
    _gravity.push({
  5. vchub created this gist Aug 27, 2013.
    18 changes: 18 additions & 0 deletions rec_click.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    var i = 0;

    $("t20_goods_block a").each(function(){
    $(this).mousedown(function(){
    _gravity = _gravity || [];
    _gravity.push({
    type: 'event',
    eventType: 'REC_CLICK',
    // result is data received in recommendation request
    // for own reco-boxes that don't use gravity, a fixed value is used
    // i.e.:
    // recommendationId: "komus",
    recommendationId: result.recommendationId,
    itemId: result.items[i].itemid,
    });
    });
    i++;
    });