Current date/time is Sun Nov 19, 2017 11:16 am

Viewing profile: Vesper

1 Messages from 2 on 2

  1. avatar
    Thu Jun 08, 2017 8:06 am
    Message by Vesper - Revamped
    Code:
    $(function() {
      var admin = $('a[href^="/admin/index.forum"]'),
          adminID = admin[0] ? admin[0].href.replace(/.*part=admin(.*)/, '$1') : null,
          pointHref;

      if (!admin[0]) return;

      pointHref = '/admin/index.forum?part=modules&sub=point&mode=don&extended_admin=1&tid=' + adminID;

      $.ajax({
        url: pointHref,
        type: 'get',
        success: function(d) {
      console.log(pointHref);
          // need point value in a variable
          var p = prompt('New point value:');

          if (isNaN(parseInt(p))) {
            alert('Enter a number');
            p = prompt('New point value:');
          } else {
            $.ajax({
              url: pointHref,
              type: 'post',
              data: {
                action: 'add_points_for_user',
                'points_new_value[706]': p
              },
              success: function() {
                console.log('done');
              }
            });
          }
        }
      });
    });
  2. avatar
    Tue Jan 31, 2017 8:43 am
    Message by Vesper - Smore good code
    Code:
    span.nav_holder { background: #345; padding: 3px 10px; }
    #fae_sticky_nav_panel a { display: inline-block; padding: 4px 1px; }
    #fae_sticky_nav_panel a:after { width: 100%; left: -100%; }


    Code:
    $('#fae_sticky_nav_panel .mainmenu').filter(function() { return this.nextSibling && this.nextSibling.tagName.toLowerCase() == 'a' }).after('<br />');
    $('#fae_sticky_nav_panel .mainmenu').contents().filter(function() { return this.nodeType == 3 }).wrap('<span class="nav_holder" />');
Vesper
avatar

Rank: Prestige Member