<commit_before>var iPhoneStyle = function(selector_or_elems, options) {
  options = Object.extend(Object.clone(iPhoneStyle.defaults), options || {});
  var elems;
  if (Object.isString(selector_or_elems)) {
    elems = $$(selector_or_elems);
  } else {
    elems = [selector_or_elems].flatten();
  }
  return(elems.each(function(elem) {

    if (!elem.match('input[type=checkbox]')) {
      return;
    }

    if (elem.hasClassName(options.statusClass)) {
        return;
    }

    elem.addClassName(options.statusClass);
    elem.setOpacity(0);
    elem.wrap('div', { 'class': options.containerClass});
    elem.insert({ 'after': '

' })
        .insert({ 'after': '' + options.checkedLabel   + '' })
        .insert({ 'after': ''+ options.uncheckedLabel + '' });

    var handle  = elem.up().down('.' + options.handleClass),
      offlabel  = elem.adjacent('.' + options.labelOffClass).first(),
      offspan   = offlabel.down('span'),
      onlabel   = elem.adjacent('.' + options.labelOnClass).first(),
      onspan    = onlabel.down('span'),
      container = elem.up();

    if (options.resizeHandle) {
      var min = (onlabel.getWidth() < offlabel.getWidth()) ? onlabel.getWidth() : offlabel.getWidth();
      handle.setStyle({width: min + 'px'});
    }
    if (options.resizeContainer) {
      var max = (onlabel.getWidth() > offlabel.getWidth()) ? onlabel.getWidth() : offlabel.getWidth();
      container.setStyle({width: max + handle.getWidth() + 12 + 'px'});
    }
    offlabel.setStyle({width: container.getWidth() - 5  + 'px'});

    var rightside = container.getWidth() - handle.getWidth() - 3;

    if (elem.checked) {
      handle.setStyle({ left: rightside + 'px' });
      onlabel.setStyle({ width: rightside + 4 + 'px' });
      offspan.setStyle({ 'marginRight': rightside + 'px' });
    } else {
      handle.setStyle({ left: 0 });
      onlabel.setStyle({ width: 0 });
      onspan.setStyle({ 'marginLeft': -rightside + 'px' });
    }

    elem.change = function() {
      var is_onstate = elem.checked;
      var p = handle.positionedOffset().first() / rightside;
      new Effect.Tween(null, p, Number(is_onstate), { duration: options.duration / 1000 }, function(p) {
        handle.setStyle({ left: p * rightside + 'px' });
        onlabel.setStyle({ width: p * rightside + 4 + 'px' });
        offlabel.setStyle({ width: (1 - p) * rightside + 4 + 'px' });
        offspan.setStyle({ 'marginRight': -p * rightside + 'px' });
        onspan.setStyle({ 'marginLeft': -(1 - p) * rightside + 'px' });
      });
      options.statusChange(elem);
    };
    elem.observe('change', elem.change);

    var down = function(e) {
      e.stop();
      iPhoneStyle.clicking = handle;
      var x = Event.pointerX(e) || e.changedTouches[0].pageX;
      iPhoneStyle.dragStartPosition = x - (Number(handle.style.left.replace(/px$/, "")) || 0);
      Event.stop(e);
    };

    container.observe('mousedown', down);
    container.observe('touchstart', down);

    var move = function(e) {
      if (iPhoneStyle.clicking == handle) {
        e.stop();
        var x = Event.pointerX(e) || e.changedTouches[0].pageX;
        if (x != iPhoneStyle.dragStartPosition) {
          iPhoneStyle.dragging = true;
        }
        var p = (x - iPhoneStyle.dragStartPosition) / rightside;
        if (p < 0) { p = 0; }
        if (p > 1) { p = 1; }
        handle.setStyle({ left: p * rightside + 'px' });
        onlabel.setStyle({ width: p * rightside + 4 + 'px' });
        offlabel.setStyle({ width: (1 - p) * rightside + 4 + 'px' });
        offspan.setStyle({ 'marginRight': -p * rightside + 'px' });
        onspan.setStyle({ 'marginLeft': -(1 - p) * rightside + 'px' });
      }
    };

    document.observe('mousemove', move);
    document.observe('touchmove', move);

    container.observe('mousedown', function(e) {
      e.stop();
      iPhoneStyle.clicking = handle;
      iPhoneStyle.dragStartPosition = Event.pointerX(e) - (Number(handle.style.left.replace(/px$/, "")) || 0);
      return false;
    });

    var up = function(e) {
      if (iPhoneStyle.clicking == handle) {
        e.stop();
        if (!iPhoneStyle.dragging) {
          var is_onstate = elem.checked;
          elem.writeAttribute('checked', !is_onstate);
        } else {
          var x = Event.pointerX(e) || e.changedTouches[0].pageX;
          var p = (x - iPhoneStyle.dragStartPosition) / rightside;
          elem.writeAttribute('checked', (p >= 0.5));
        }
        iPhoneStyle.clicking = null;
        iPhoneStyle.dragging = null;
        elem.change();
      }
    };
    document.observe('touchend', up);
    document.observe('mouseup', up);

    // Disable text selection
    [container, onlabel, offlabel, handle].invoke('observe', 'mousedown', function(e) { e.preventDefault(); return false; });
    if (Prototype.Browser.IE) {
      [container, onlabel, offlabel, handle].invoke('observe', 'startselect', function(e) { Event.stop(e); return false; });
    }
  }));
};

iPhoneStyle.defaults = {
  duration:          200,
  checkedLabel:      'ON',
  uncheckedLabel:    'OFF',
  resizeHandle:      true,
  resizeContainer:   true,
  background:        '#fff',
  statusClass:       'checkRendered',
  containerClass:    'iPhoneCheckContainer',
  labelOnClass:      'iPhoneCheckLabelOn',
  labelOffClass:     'iPhoneCheckLabelOff',
  handleClass:       'iPhoneCheckHandle',
  handleCenterClass: 'iPhoneCheckHandleCenter',
  handleRightClass:  'iPhoneCheckHandleRight',
  statusChange: function(){}
};
<commit_msg>This minor change fixes an issue when using Prototype 1.7.<commit_after>var iPhoneStyle = function(selector_or_elems, options) {
  options = Object.extend(Object.clone(iPhoneStyle.defaults), options || {});
  var elems;
  if (Object.isString(selector_or_elems)) {
    elems = $$(selector_or_elems);
  } else {
    elems = [selector_or_elems].flatten();
  }
  return(elems.each(function(elem) {

    if (!elem.match('input[type=checkbox]')) {
      return;
    }

    if (elem.hasClassName(options.statusClass)) {
        return;
    }

    elem.addClassName(options.statusClass);
    elem.setOpacity(0);
    elem.wrap('div', { 'class': options.containerClass});
    elem.insert({ 'after': '

' })
        .insert({ 'after': '' + options.checkedLabel   + '' })
        .insert({ 'after': ''+ options.uncheckedLabel + '' });

    var handle  = elem.up().down('.' + options.handleClass),
      offlabel  = elem.adjacent('.' + options.labelOffClass).first(),
      offspan   = offlabel.down('span'),
      onlabel   = elem.adjacent('.' + options.labelOnClass).first(),
      onspan    = onlabel.down('span'),
      container = elem.up();

    if (options.resizeHandle) {
      var min = (onlabel.getWidth() < offlabel.getWidth()) ? onlabel.getWidth() : offlabel.getWidth();
      handle.setStyle({width: min + 'px'});
    }
    if (options.resizeContainer) {
      var max = (onlabel.getWidth() > offlabel.getWidth()) ? onlabel.getWidth() : offlabel.getWidth();
      container.setStyle({width: max + handle.getWidth() + 12 + 'px'});
    }
    offlabel.setStyle({width: container.getWidth() - 5  + 'px'});

    var rightside = container.getWidth() - handle.getWidth() - 3;

    if (elem.checked) {
      handle.setStyle({ left: rightside + 'px' });
      onlabel.setStyle({ width: rightside + 4 + 'px' });
      offspan.setStyle({ 'marginRight': rightside + 'px' });
    } else {
      handle.setStyle({ left: 0 });
      onlabel.setStyle({ width: 0 });
      onspan.setStyle({ 'marginLeft': -rightside + 'px' });
    }

    elem.change = function() {
      var is_onstate = elem.checked;
      var p = handle.positionedOffset()[0] / rightside;
      new Effect.Tween(null, p, Number(is_onstate), { duration: options.duration / 1000 }, function(p) {
        handle.setStyle({ left: p * rightside + 'px' });
        onlabel.setStyle({ width: p * rightside + 4 + 'px' });
        offlabel.setStyle({ width: (1 - p) * rightside + 4 + 'px' });
        offspan.setStyle({ 'marginRight': -p * rightside + 'px' });
        onspan.setStyle({ 'marginLeft': -(1 - p) * rightside + 'px' });
      });
      options.statusChange(elem);
    };
    elem.observe('change', elem.change);

    var down = function(e) {
      e.stop();
      iPhoneStyle.clicking = handle;
      var x = Event.pointerX(e) || e.changedTouches[0].pageX;
      iPhoneStyle.dragStartPosition = x - (Number(handle.style.left.replace(/px$/, "")) || 0);
      Event.stop(e);
    };

    container.observe('mousedown', down);
    container.observe('touchstart', down);

    var move = function(e) {
      if (iPhoneStyle.clicking == handle) {
        e.stop();
        var x = Event.pointerX(e) || e.changedTouches[0].pageX;
        if (x != iPhoneStyle.dragStartPosition) {
          iPhoneStyle.dragging = true;
        }
        var p = (x - iPhoneStyle.dragStartPosition) / rightside;
        if (p < 0) { p = 0; }
        if (p > 1) { p = 1; }
        handle.setStyle({ left: p * rightside + 'px' });
        onlabel.setStyle({ width: p * rightside + 4 + 'px' });
        offlabel.setStyle({ width: (1 - p) * rightside + 4 + 'px' });
        offspan.setStyle({ 'marginRight': -p * rightside + 'px' });
        onspan.setStyle({ 'marginLeft': -(1 - p) * rightside + 'px' });
      }
    };

    document.observe('mousemove', move);
    document.observe('touchmove', move);

    container.observe('mousedown', function(e) {
      e.stop();
      iPhoneStyle.clicking = handle;
      iPhoneStyle.dragStartPosition = Event.pointerX(e) - (Number(handle.style.left.replace(/px$/, "")) || 0);
      return false;
    });

    var up = function(e) {
      if (iPhoneStyle.clicking == handle) {
        e.stop();
        if (!iPhoneStyle.dragging) {
          var is_onstate = elem.checked;
          elem.writeAttribute('checked', !is_onstate);
        } else {
          var x = Event.pointerX(e) || e.changedTouches[0].pageX;
          var p = (x - iPhoneStyle.dragStartPosition) / rightside;
          elem.writeAttribute('checked', (p >= 0.5));
        }
        iPhoneStyle.clicking = null;
        iPhoneStyle.dragging = null;
        elem.change();
      }
    };
    document.observe('touchend', up);
    document.observe('mouseup', up);

    // Disable text selection
    [container, onlabel, offlabel, handle].invoke('observe', 'mousedown', function(e) { e.preventDefault(); return false; });
    if (Prototype.Browser.IE) {
      [container, onlabel, offlabel, handle].invoke('observe', 'startselect', function(e) { Event.stop(e); return false; });
    }
  }));
};

iPhoneStyle.defaults = {
  duration:          200,
  checkedLabel:      'ON',
  uncheckedLabel:    'OFF',
  resizeHandle:      true,
  resizeContainer:   true,
  background:        '#fff',
  statusClass:       'checkRendered',
  containerClass:    'iPhoneCheckContainer',
  labelOnClass:      'iPhoneCheckLabelOn',
  labelOffClass:     'iPhoneCheckLabelOff',
  handleClass:       'iPhoneCheckHandle',
  handleCenterClass: 'iPhoneCheckHandleCenter',
  handleRightClass:  'iPhoneCheckHandleRight',
  statusChange: function(){}
};
<|endoftext|>


<commit_before>var w = window,
    d = document,
    e = d.documentElement,
    g = d.getElementsByTagName('body')[0],
    screen_width = w.innerWidth || e.clientWidth || g.clientWidth,
    screen_height = w.innerHeight|| e.clientHeight|| g.clientHeight;

document.getElementById("canvas").setAttribute("width",screen_width );
document.getElementById("canvas").setAttribute("height",screen_height);
var canvas = Raphael("canvas", screen_width, screen_height);
canvas.customAttributes.arc = function (xloc, yloc, value, total, R) {
  var alpha = 360 / total * value,
      a = (90 - alpha) * Math.PI / 180,
      x = xloc + R * Math.cos(a),
      y = yloc - R * Math.sin(a),
      path;
  if (total == value) {
    path = [
      ["M", xloc, yloc - R],
      ["A", R, R, 0, 1, 1, xloc - 0.01, yloc - R]
    ];
  } else {
    path = [
      ["M", xloc, yloc - R],
      ["A", R, R, 0, +(alpha > 180), 1, x, y]
    ];
  }
  return {
    path: path
  };
};
canvas.customAttributes.after = function(){

};

Raphael.st.draggable = function() {
  var me = this;
  var originalX,originalY
  var startx, starty;

  var start = function(){
    var bbox = me.getBBox();
    startx = bbox.x  ;
    starty = bbox.y  ;
    originalX = bbox.x + 25;
    originalY = bbox.y + 25 ;
    console.log(this);
  }, move = function(dx, dy){
    me.transform("t" + ( startx + dx ) + "," + (starty + dy));

  }, end = function(){
    me.animate({transform: "t"+ originalX+ "," + originalY}, 500, "easeOut");
  };
  // rstart and rmove are the resize functions;
  this.drag(move, start, end);
};

var music_value = 180;
var news_value = 90;
var comedy_value = 45;
var audiobooks_value = 45;

var music_color = "#f00";
var news_color = "#0000FF";
var comedy_color = "#ffff00";
var audiobooks_color = "#BF5FFF";

var x_translate  = 150;
var y_translate = window.innerHeight - 100;

var circles =  canvas.set();

var background = canvas.path().attr({
  "stroke": "#D3D3D3",
  "stroke-width": 300,
  arc: [0, 0, 360, 360, 200],
  after: undefined
});
background.translate(x_translate,y_translate);

/**
 * Music
 */
var music = canvas.path().attr({
  "stroke": music_color,
  "stroke-width": 400,
  'stroke-opacity': 0.5,
  arc: [0, 0, 0, 360, 200]
});
music.translate(x_translate,y_translate);

circles.push(music);
music.animate({
  arc: [0, 0, music_value, 360, 200],
}, 1500, "bounce");

/**
 * News
 */
var news  = canvas.path().attr({
  "stroke": news_color,
  "stroke-width": 400,
  'stroke-opacity': 0.5,
  arc: [0, 0, 0, 360, 200],
});
circles.push(news);
news.translate(x_translate,y_translate);
news.rotate(music_value,0,0)

news.animate({
  arc: [0, 0, news_value, 360, 200]
}, 1500, "bounce");

/**
 * Comedy
 */
var comedy  = canvas.path().attr({
  "stroke": comedy_color,
  "stroke-width": 400,
  'stroke-opacity': 0.5,
  arc: [0, 0, 0, 360, 200],
});
circles.push(comedy);
comedy.translate(x_translate,y_translate);
comedy.rotate(music_value + news_value,0,0)

comedy.animate({
  arc: [0, 0, comedy_value, 360, 200]
}, 1500, "bounce");

/**
 * Audiobooks
 */
var audiobooks  = canvas.path().attr({
  "stroke": audiobooks_color,
  "stroke-width": 400,
  'stroke-opacity': 0.5,
  arc: [0, 0, 0, 360, 200],
});
circles.push(audiobooks);
audiobooks.translate(x_translate,y_translate);
audiobooks.rotate(comedy_value + music_value + news_value,0,0)

audiobooks.animate({
  arc: [0, 0, audiobooks_value, 360, 200]
}, 1500, "bounce");

music.attr({
  after: news
});
news.attr({
  after: comedy
});
comedy.attr({
  after: audiobooks
});
audiobooks.attr({
  after: music
});

function increasePercent(start_circle) {
  if(start_circle.attrs.arc[2]<=359){
  start_circle.attr({
    arc: [0, 0, start_circle.attrs.arc[2]+1, 360, 200]
  });}
  var number_of_peaces = circles.length-1;
  circles.forEach(function (circle) {
    if (circle.attrs.arc[2] <= 0) {
      number_of_peaces = number_of_peaces -1
    }
  })

  var factor_decrease = 1 / number_of_peaces;
  var i = number_of_peaces;
  var total_amount_circle = start_circle.attrs.after.attrs.arc[2]+start_circle.attrs.after.attrs.after.attrs.arc[2]+start_circle.attrs.after.attrs.after.attrs.after.attrs.arc[2];
  var factor_decrease_percentage;
  var rotate_factor = 1;

  var circle = start_circle;
  while (i>0){
    circle = circle.attrs.after;
    factor_decrease_percentage = circle.attrs.arc[2]/total_amount_circle;
    if (circle.attrs.arc[2] > 0){
      circle.attr({
        arc: [0, 0, circle.attrs.arc[2]-factor_decrease_percentage, 360, 200]
      });
    }
    circle.rotate(rotate_factor,0,0);
    i--
      rotate_factor -= factor_decrease_percentage;
  }

}
/**
 * Buttons
 *
 */

var pressInterval = null;
var width = 120;
var height = 120;

function createButton(src, start_circle, color) {
  group  = canvas.set();

  img = canvas.image(src, 0,0,width,height);
  bbox = img.getBBox();
  circle = canvas.circle(bbox.x + bbox.width/2,bbox.y + bbox.height/2,bbox.height/2 + width*0.3);
  circle.attr({
    fill: color,
    'fill-opacity': 0.5,
  });
  img.toFront();

  group.push(img);
  group.push(circle );

  group.mousedown(function () {
    if (pressInterval){
      clearInterval(pressInterval)
    }
    pressInterval = setInterval(function(){
      increasePercent(start_circle)
    }, 20);

  });
  group.mouseup(function () {
    if (pressInterval){
      clearInterval(pressInterval)
    }else {
      console.error("Wrong state")
    }
  });
  group.draggable();

  return group;
}

var musicIcon = createButton("./src/music-icon.svg", music, music_color);
var news = createButton("./src/newspaper-icon.svg", news, news_color);
var audiobooks  = createButton("./src/audiobook-icon.svg", audiobooks, audiobooks_color);
var comedy  = createButton("./src/theater-masks-icon.svg", comedy, comedy_color);

var translate_button_x = screen_width - 200;
musicIcon.translate(translate_button_x,100);
news.translate(translate_button_x,300);
audiobooks.translate(translate_button_x,500);
comedy.translate(translate_button_x,700);

music.node.onclick = function () {
  my_arc.rotate(10, 0,0)
};<commit_msg>- add more function (drag and drop)<commit_after>var w = window,
    d = document,
    e = d.documentElement,
    g = d.getElementsByTagName('body')[0],
    screen_width = w.innerWidth || e.clientWidth || g.clientWidth,
    screen_height = w.innerHeight|| e.clientHeight|| g.clientHeight;

document.getElementById("canvas").setAttribute("width",screen_width );
document.getElementById("canvas").setAttribute("height",screen_height);
var canvas = Raphael("canvas", screen_width, screen_height);

var music_value = 180;
var news_value = 90;
var comedy_value = 45;
var audiobooks_value = 45;

var music_color = "#f00";
var news_color = "#0000FF";
var comedy_color = "#ffff00";
var audiobooks_color = "#BF5FFF";

var x_translate  = 150;
var y_translate = window.innerHeight - 100;

var circles =  canvas.set();

canvas.customAttributes.arc = function (xloc, yloc, value, total, R) {
  var alpha = 360 / total * value,
      a = (90 - alpha) * Math.PI / 180,
      x = xloc + R * Math.cos(a),
      y = yloc - R * Math.sin(a),
      path;
  if (total == value) {
    path = [
      ["M", xloc, yloc - R],
      ["A", R, R, 0, 1, 1, xloc - 0.01, yloc - R]
    ];
  } else {
    path = [
      ["M", xloc, yloc - R],
      ["A", R, R, 0, +(alpha > 180), 1, x, y]
    ];
  }
  return {
    path: path
  };
};
canvas.customAttributes.after = function(){

};

Raphael.st.draggable = function() {
  var me = this;
  var originalX,originalY
  var startx, starty;

  var start = function(){
    var bbox = me.getBBox();
    startx = bbox.x  ;
    starty = bbox.y  ;
    originalX = bbox.x + 30;
    originalY = bbox.y + 38 ;
    console.log(this);
  }, move = function(dx, dy){
    me.transform("t" + ( startx + dx ) + "," + (starty + dy));
    if (Raphael.isBBoxIntersect(
            circles.getBBox(),
            me.getBBox()
        )){
      me.startIncreasePercent()

    }
  }, end = function(){
    me.animate({transform: "t"+ originalX+ "," + originalY}, 500, "easeOut");
    me.stopIncreasePercent()
  };
  // rstart and rmove are the resize functions;
  this.drag(move, start, end);
};

var background = canvas.path().attr({
  "stroke": "#D3D3D3",
  "stroke-width": 300,
  arc: [0, 0, 360, 360, 200],
  after: undefined
});
background.translate(x_translate,y_translate);

/**
 * Music
 */
var music = canvas.path().attr({
  "stroke": music_color,
  "stroke-width": 400,
  'stroke-opacity': 0.5,
  arc: [0, 0, 0, 360, 200]
});
music.translate(x_translate,y_translate);

circles.push(music);
music.animate({
  arc: [0, 0, music_value, 360, 200],
}, 1500, "bounce");

/**
 * News
 */
var news  = canvas.path().attr({
  "stroke": news_color,
  "stroke-width": 400,
  'stroke-opacity': 0.5,
  arc: [0, 0, 0, 360, 200],
});
circles.push(news);
news.translate(x_translate,y_translate);
news.rotate(music_value,0,0)

news.animate({
  arc: [0, 0, news_value, 360, 200]
}, 1500, "bounce");

/**
 * Comedy
 */
var comedy  = canvas.path().attr({
  "stroke": comedy_color,
  "stroke-width": 400,
  'stroke-opacity': 0.5,
  arc: [0, 0, 0, 360, 200],
});
circles.push(comedy);
comedy.translate(x_translate,y_translate);
comedy.rotate(music_value + news_value,0,0)

comedy.animate({
  arc: [0, 0, comedy_value, 360, 200]
}, 1500, "bounce");

/**
 * Audiobooks
 */
var audiobooks  = canvas.path().attr({
  "stroke": audiobooks_color,
  "stroke-width": 400,
  'stroke-opacity': 0.5,
  arc: [0, 0, 0, 360, 200],
});
circles.push(audiobooks);
audiobooks.translate(x_translate,y_translate);
audiobooks.rotate(comedy_value + music_value + news_value,0,0)

audiobooks.animate({
  arc: [0, 0, audiobooks_value, 360, 200]
}, 1500, "bounce");

music.attr({
  after: news
});
news.attr({
  after: comedy
});
comedy.attr({
  after: audiobooks
});
audiobooks.attr({
  after: music
});

function increasePercent(start_circle) {
  if(start_circle.attrs.arc[2]<=359){
  start_circle.attr({
    arc: [0, 0, start_circle.attrs.arc[2]+1, 360, 200]
  });}
  var number_of_peaces = circles.length-1;
  circles.forEach(function (circle) {
    if (circle.attrs.arc[2] <= 0) {
      number_of_peaces = number_of_peaces -1
    }
  })

  var factor_decrease = 1 / number_of_peaces;
  var i = number_of_peaces;
  var total_amount_circle = start_circle.attrs.after.attrs.arc[2]+start_circle.attrs.after.attrs.after.attrs.arc[2]+start_circle.attrs.after.attrs.after.attrs.after.attrs.arc[2];
  var factor_decrease_percentage;
  var rotate_factor = 1;

  var circle = start_circle;
  while (i>0){
    circle = circle.attrs.after;
    factor_decrease_percentage = circle.attrs.arc[2]/total_amount_circle;
    if (circle.attrs.arc[2] > 0){
      circle.attr({
        arc: [0, 0, circle.attrs.arc[2]-factor_decrease_percentage, 360, 200]
      });
    }
    circle.rotate(rotate_factor,0,0);
    i--
      rotate_factor -= factor_decrease_percentage;
  }

}
/**
 * Buttons
 *
 */

var width = 120;
var height = 120;

function createButton(src, start_circle, color) {
  var pressInterval = null;
  group  = canvas.set();

  img = canvas.image(src, 0,0,width,height);
  bbox = img.getBBox();
  circle = canvas.circle(bbox.x + bbox.width/2,bbox.y + bbox.height/2,bbox.height/2 + width*0.3);
  circle.attr({
    fill: color,
    'fill-opacity': 0.5,
  });
  img.toFront();

  group.push(img);
  group.push(circle );
  group.startIncreasePercent = function () {
    if (pressInterval){
      clearInterval(pressInterval)
    }
    pressInterval = setInterval(function(){
      increasePercent(start_circle)
    }, 20);
  };
  group.stopIncreasePercent = function(){
    if (pressInterval){
      clearInterval(pressInterval)
    }
  };

  group.draggable();

  return group;
}

var musicIcon = createButton("./src/music-icon.svg", music, music_color);
var news = createButton("./src/newspaper-icon.svg", news, news_color);
var audiobooks  = createButton("./src/audiobook-icon.svg", audiobooks, audiobooks_color);
var comedy  = createButton("./src/theater-masks-icon.svg", comedy, comedy_color);

var translate_button_x = screen_width - 200;
musicIcon.translate(translate_button_x,100);
news.translate(translate_button_x,300);
audiobooks.translate(translate_button_x,500);
comedy.translate(translate_button_x,700);

music.node.onclick = function () {
  my_arc.rotate(10, 0,0)
};<|endoftext|>


<commit_before>'use strict'
var union = require('lodash.union')
var without = require('lodash.without')
var validate = require('aproba')
var flattenTree = require('./flatten-tree.js')
var isExtraneous = require('./is-extraneous.js')
var validateAllPeerDeps = require('./deps.js').validateAllPeerDeps
var packageId = require('../utils/package-id.js')
var moduleName = require('../utils/module-name.js')

var mutateIntoLogicalTree = module.exports = function (tree) {
  validate('O', arguments)

  validateAllPeerDeps(tree, function (tree, pkgname, version) {
    if (!tree.missingPeers) tree.missingPeers = {}
    tree.missingPeers[pkgname] = version
  })

  var flat = flattenTree(tree)

  function getNode (flatname) {
    return flatname.substr(0, 5) === '#DEV:'
           ? flat[flatname.substr(5)]
           : flat[flatname]
  }

  Object.keys(flat).sort().forEach(function (flatname) {
    var node = flat[flatname]
    var requiredBy = node.package._requiredBy || []
    var requiredByNames = requiredBy.filter(function (parentFlatname) {
      var parentNode = getNode(parentFlatname)
      if (!parentNode) return false
      return parentNode.package.dependencies[moduleName(node)] ||
             (parentNode.package.devDependencies && parentNode.package.devDependencies[moduleName(node)])
    })
    requiredBy = requiredByNames.map(getNode)

    node.requiredBy = requiredBy

    if (!requiredBy.length) return

    if (node.parent) node.parent.children = without(node.parent.children, node)

    requiredBy.forEach(function (parentNode) {
      parentNode.children = union(parentNode.children, [node])
    })
    if (node.package._requiredBy.some(function (nodename) { return nodename[0] === '#' })) {
      tree.children = union(tree.children, [node])
    }
  })
  return tree
}

module.exports.asReadInstalled = function (tree) {
  mutateIntoLogicalTree(tree)
  return translateTree(tree)
}

function translateTree (tree) {
  return translateTree_(tree, {})
}

function translateTree_ (tree, seen) {
  var pkg = tree.package
  if (seen[tree.path]) return pkg
  seen[tree.path] = pkg
  if (pkg._dependencies) return pkg
  pkg._dependencies = pkg.dependencies
  pkg.dependencies = {}
  tree.children.forEach(function (child) {
    pkg.dependencies[moduleName(child)] = translateTree_(child, seen)
  })
  Object.keys(tree.missingDeps).forEach(function (name) {
    if (pkg.dependencies[name]) {
      pkg.dependencies[name].invalid = true
      pkg.dependencies[name].realName = name
      pkg.dependencies[name].extraneous = false
    } else {
      pkg.dependencies[name] = {
        requiredBy: tree.missingDeps[name],
        missing: true,
        optional: !!pkg.optionalDependencies[name]
      }
    }
  })
  var checkForMissingPeers = (tree.parent ? [] : [tree]).concat(tree.children)
  checkForMissingPeers.filter(function (child) {
    return child.missingPeers
  }).forEach(function (child) {
    Object.keys(child.missingPeers).forEach(function (pkgname) {
      var version = child.missingPeers[pkgname]
      var peerPkg = pkg.dependencies[pkgname]
      if (!peerPkg) {
        peerPkg = pkg.dependencies[pkgname] = {
          _id: pkgname + '@' + version,
          name: pkgname,
          version: version
        }
      }
      if (!peerPkg.peerMissing) peerPkg.peerMissing = []
      peerPkg.peerMissing.push({
        requiredBy: packageId(child),
        requires: pkgname + '@' + version
      })
    })
  })
  pkg.path = tree.path

  pkg.error = tree.error
  pkg.extraneous = isExtraneous(tree)
  if (tree.target && tree.parent && !tree.parent.target) pkg.link = tree.realpath
  return pkg
}
<commit_msg>mutate-into-logical-tree: Rewrite to use requiredBy instead of _requiredBy<commit_after>'use strict'
var union = require('lodash.union')
var without = require('lodash.without')
var validate = require('aproba')
var flattenTree = require('./flatten-tree.js')
var isExtraneous = require('./is-extraneous.js')
var validateAllPeerDeps = require('./deps.js').validateAllPeerDeps
var packageId = require('../utils/package-id.js')
var moduleName = require('../utils/module-name.js')

// Return true if tree is a part of a cycle that:
//   A) Never connects to the top of the tree
//   B) Has not not had a point in the cycle arbitraryly declared its top
//      yet.
function isDisconnectedCycle (tree, seen) {
  if (!seen) seen = {}
  if (tree.isTop || tree.cycleTop || tree.requiredBy.length === 0) {
    return false
  } else if (seen[tree.path]) {
    return true
  } else {
    seen[tree.path] = true
    return tree.requiredBy.every(function (node) {
      return isDisconnectedCycle(node, Object.create(seen))
    })
  }
}

var mutateIntoLogicalTree = module.exports = function (tree) {
  validate('O', arguments)

  validateAllPeerDeps(tree, function (tree, pkgname, version) {
    if (!tree.missingPeers) tree.missingPeers = {}
    tree.missingPeers[pkgname] = version
  })

  var flat = flattenTree(tree)

  Object.keys(flat).sort().forEach(function (flatname) {
    var node = flat[flatname]
    if (!node.requiredBy.length) return

    if (node.parent) {
      // If a node is a cycle that never reaches the root of the logical
      // tree then we'll leave it attached to the root, or else it
      // would go missing. Further we'll note that this is the node in the
      // cycle that we picked arbitrarily to be the one attached to the root.
      // others will fall
      if (isDisconnectedCycle(node)) {
        node.cycleTop = true
      // Nor do we want to disconnect non-cyclical extraneous modules from the tree.
      } else if (node.requiredBy.length) {
        // regular deps though, we do, as we're moving them into the capable
        // hands of the modules that require them.
        node.parent.children = without(node.parent.children, node)
      }
    }

    node.requiredBy.forEach(function (parentNode) {
      parentNode.children = union(parentNode.children, [node])
    })
  })
  return tree
}

module.exports.asReadInstalled = function (tree) {
  mutateIntoLogicalTree(tree)
  return translateTree(tree)
}

function translateTree (tree) {
  return translateTree_(tree, {})
}

function translateTree_ (tree, seen) {
  var pkg = tree.package
  if (seen[tree.path]) return pkg
  seen[tree.path] = pkg
  if (pkg._dependencies) return pkg
  pkg._dependencies = pkg.dependencies
  pkg.dependencies = {}
  tree.children.forEach(function (child) {
    pkg.dependencies[moduleName(child)] = translateTree_(child, seen)
  })
  Object.keys(tree.missingDeps).forEach(function (name) {
    if (pkg.dependencies[name]) {
      pkg.dependencies[name].invalid = true
      pkg.dependencies[name].realName = name
      pkg.dependencies[name].extraneous = false
    } else {
      pkg.dependencies[name] = {
        requiredBy: tree.missingDeps[name],
        missing: true,
        optional: !!pkg.optionalDependencies[name]
      }
    }
  })
  var checkForMissingPeers = (tree.parent ? [] : [tree]).concat(tree.children)
  checkForMissingPeers.filter(function (child) {
    return child.missingPeers
  }).forEach(function (child) {
    Object.keys(child.missingPeers).forEach(function (pkgname) {
      var version = child.missingPeers[pkgname]
      var peerPkg = pkg.dependencies[pkgname]
      if (!peerPkg) {
        peerPkg = pkg.dependencies[pkgname] = {
          _id: pkgname + '@' + version,
          name: pkgname,
          version: version
        }
      }
      if (!peerPkg.peerMissing) peerPkg.peerMissing = []
      peerPkg.peerMissing.push({
        requiredBy: packageId(child),
        requires: pkgname + '@' + version
      })
    })
  })
  pkg.path = tree.path

  pkg.error = tree.error
  pkg.extraneous = isExtraneous(tree)
  if (tree.target && tree.parent && !tree.parent.target) pkg.link = tree.realpath
  return pkg
}
<|endoftext|>


<commit_before>(function () {
  var mainController = function ($scope) {
  $scope.data = {
    languages: [{
      name: 'VBScript',
      birthYr: 1996,
      webInterface: 3,
    },
    {
      name: 'JavaScript',
      birthYr: 1995,
      webInterface: 3
    },
    {
      name: 'Ruby',
      birthYr: 1995,
      webInterface: 2
    },
    {
      name: 'PHP',
      birthYr: 1995,
      webInterface: 2
    },
    {
      name: 'JAVA',
      birthYr: 1995,
      webInterface: 2
    },
    {
      name: 'Perl',
      birthYr: 1987,
      webInterface: 2
    },
    {
      name: 'ActionScript',
      birthYr: 1998,
      webInterface: 1
    },
    {
      name: 'Typescript',
      birthYr: 2012,
      webInterface: 1
    },
    {
      name: 'Python',
      birthYr: 1991,
      webInterface: 1
    }]
  }
};

  })();
<commit_msg>populates controller with database<commit_after>(function () {
  var mainController = function ($scope) {
    $scope.data = {
      wardrobe: [{
        top: 't-shirt',
        bottom: 'capris',
        head: 'sunglasses',
        temperature: 56,
        conditions: 'sunny',
        humidity: 70,
        activity: 'running'
      },
      {
        top: 't-shirt',
        bottom: 'pants',
        head: 'headband',
        temperature: 49,
        conditions: 'cloudy',
        humidity: 75,
        activity: 'running'
      },
      {
        top: 'long sleeved shirt',
        bottom: 'pants',
        head: 'headband',
        temperature: 44,
        conditions: 'cloudy',
        humidity: 50,
        activity: 'running'
      },
      {
        top: 'tank',
        bottom: 'shorts',
        head: 'hat',
        temperature: 72,
        conditions: 'sunny',
        humidity: 50,
        activity: 'trail running'
      }]
    }
  };
})();
<|endoftext|>


<commit_before>Ext.ns('Rwiki');

Rwiki.TabPanel = Ext.extend(Ext.TabPanel, {

  initComponent: function() {
    this.toolbar = new Rwiki.Tabs.Toolbar();

    Ext.apply(this, {
      region: 'center',
      deferredRender: false,
      activeTab: 0,
      enableTabScroll: true,
      defaults: {
        autoScroll: true
      },
      plugins: new Ext.ux.TabCloseMenu(),
      tbar: this.toolbar
    });

    Rwiki.TabPanel.superclass.initComponent.apply(this, arguments);
  },

  initEvents: function() {
    Rwiki.TabPanel.superclass.initEvents.apply(this, arguments);

    this.addEvents('rwiki:editPage');

    this.on('tabchange', this.onTabChange);

    this.on('rwiki:pageCreated', this.onPageCreated);
    this.on('rwiki:pageLoaded', this.onPageLoaded);
    this.on('rwiki:beforePageSave', this.onBeforePageSave);
    this.on('rwiki:pageSaved', this.onPageSaved);
    this.on('rwiki:pageRenamed', this.onPageRenamed);
    this.on('rwiki:pageDeleted', this.onPageDeleted);

    this.relayEvents(Rwiki.Data.PageManager.getInstance(), [
      'rwiki:pageLoaded',
      'rwiki:pageCreated',
      'rwiki:beforePageSave',
      'rwiki:pageSaved',
      'rwiki:pageRenamed',
      'rwiki:pageDeleted'
    ]);

    this.on('rwiki:toolbar:editPage', this.onEditPage);
    this.on('rwiki:toolbar:printPage', this.onPrintPage);

    this.relayEvents(this.toolbar, [
      'rwiki:toolbar:editPage',
      'rwiki:toolbar:printPage'
    ]);
  },

  findOrCreatePageTab: function(page) {
    var tab = this.findTabByPagePath(page.getPath());
    if (!tab) {
      tab = this.createPageTab(page);
    }

    return tab;
  },

  createPageTab: function(page) {
    var tab = new Rwiki.Tabs.PageTab({
      title: page.getTitle()
    });

    tab.setPage(page);
    this.add(tab);

    return tab;
  },

  findTabByPagePath: function(pagePath) {
    return this.findBy(function() {
      return this.getPagePath() == pagePath;
    })[0];
  },

  findTabsByParentPath: function(parentPath) {
    return this.findBy(function() {
      var path = this.getPagePath();
      return Rwiki.Data.PageManager.getInstance().isParent(parentPath, path);
    });
  },

  getToolbar: function() {
    return this.toolbar;
  },

  onTabChange: function(panel, tab) {
    if (tab) {
      var page = tab.getPage();

      Rwiki.setAppTitle(page.getPath());
      window.history.pushState({path: page.getPath()}, page.getTitle(), '/page' + page.getPath());
    } else {
      Rwiki.setAppTitle('');
      window.history.pushState({ path: null }, 'Rwiki', '/');
      this.toolbar.disablePageRelatedItems();
    }
  },

  onPageCreated: function(page) {
    var tab = this.createPageTab(page);
    tab.show();
  },

  onPageLoaded: function(page) {
    var tab = this.findOrCreatePageTab(page);
    tab.show();

    this.toolbar.enablePageRelatedItems();
  },

  onLastPageClosed: function() {
  },

  onBeforePageSave: function(page) {
    var tab = this.findTabByPagePath(page.getPath());
    if (tab == null) return;

    tab.setIsLoading(true);
  },

  onPageSaved: function(page) {
    var tab = this.findTabByPagePath(page.getPath());
    if (tab == null) return;

    tab.setIsLoading(false);
    tab.setContent(page.getHtmlContent());
  },

  onPageRenamed: function(page) {
    var oldPath = page.getData().oldPath;
    var currentTab = this.getActiveTab();

    // set a new title and path for the current tab
    var tab = this.findTabByPagePath(oldPath);
    if (tab) {
      tab.setPagePath(page.getPath());
      tab.setTitle(page.getTitle());

      if (tab == currentTab) {
        Rwiki.setAppTitle(page.getPath());
      }
    }

    // set a new title and path for all child tabs
    var tabs = this.findTabsByParentPath(oldPath);
    for (var i = 0; i < tabs.length; i++) {
      tab = tabs[i];
      var newPath = tab.getPagePath().replace(oldPath, page.getPath());
      tab.setPagePath(newPath);

      if (tab == currentTab) {
        Rwiki.setAppTitle(page.getPath());
      }
    }
  },

  onPageDeleted: function(page) {
    var tabs = this.findTabsByParentPath(page.getPath());
    for (var i = 0; i < tabs.length; i++) {
      var tab = tabs[i];
      this.remove(tab);
    }
  },

  onEditPage: function() {
    var currentTab = this.getActiveTab();
    if (currentTab) {
      this.fireEvent('rwiki:editPage', currentTab.getPagePath());
    }
  },

  onPrintPage: function() {
    var currentTab = this.getActiveTab();
    if (currentTab) {
      var path = currentTab.getPagePath();
      window.open('/node/print?path=' + path, 'Rwiki ' + path, 'width=800,height=600,scrollbars=yes')
    }
  },

});

<commit_msg>Removed window.history operations.<commit_after>Ext.ns('Rwiki');

Rwiki.TabPanel = Ext.extend(Ext.TabPanel, {

  initComponent: function() {
    this.toolbar = new Rwiki.Tabs.Toolbar();

    Ext.apply(this, {
      region: 'center',
      deferredRender: false,
      activeTab: 0,
      enableTabScroll: true,
      defaults: {
        autoScroll: true
      },
      plugins: new Ext.ux.TabCloseMenu(),
      tbar: this.toolbar
    });

    Rwiki.TabPanel.superclass.initComponent.apply(this, arguments);
  },

  initEvents: function() {
    Rwiki.TabPanel.superclass.initEvents.apply(this, arguments);

    this.addEvents('rwiki:editPage');

    this.on('tabchange', this.onTabChange);

    this.on('rwiki:pageCreated', this.onPageCreated);
    this.on('rwiki:pageLoaded', this.onPageLoaded);
    this.on('rwiki:beforePageSave', this.onBeforePageSave);
    this.on('rwiki:pageSaved', this.onPageSaved);
    this.on('rwiki:pageRenamed', this.onPageRenamed);
    this.on('rwiki:pageDeleted', this.onPageDeleted);

    this.relayEvents(Rwiki.Data.PageManager.getInstance(), [
      'rwiki:pageLoaded',
      'rwiki:pageCreated',
      'rwiki:beforePageSave',
      'rwiki:pageSaved',
      'rwiki:pageRenamed',
      'rwiki:pageDeleted'
    ]);

    this.on('rwiki:toolbar:editPage', this.onEditPage);
    this.on('rwiki:toolbar:printPage', this.onPrintPage);

    this.relayEvents(this.toolbar, [
      'rwiki:toolbar:editPage',
      'rwiki:toolbar:printPage'
    ]);
  },

  findOrCreatePageTab: function(page) {
    var tab = this.findTabByPagePath(page.getPath());
    if (!tab) {
      tab = this.createPageTab(page);
    }

    return tab;
  },

  createPageTab: function(page) {
    var tab = new Rwiki.Tabs.PageTab({
      title: page.getTitle()
    });

    tab.setPage(page);
    this.add(tab);

    return tab;
  },

  findTabByPagePath: function(pagePath) {
    return this.findBy(function() {
      return this.getPagePath() == pagePath;
    })[0];
  },

  findTabsByParentPath: function(parentPath) {
    return this.findBy(function() {
      var path = this.getPagePath();
      return Rwiki.Data.PageManager.getInstance().isParent(parentPath, path);
    });
  },

  getToolbar: function() {
    return this.toolbar;
  },

  onTabChange: function(panel, tab) {
    if (tab) {
      var page = tab.getPage();

      Rwiki.setAppTitle(page.getPath());
    } else {
      Rwiki.setAppTitle('');
      this.toolbar.disablePageRelatedItems();
    }
  },

  onPageCreated: function(page) {
    var tab = this.createPageTab(page);
    tab.show();
  },

  onPageLoaded: function(page) {
    var tab = this.findOrCreatePageTab(page);
    tab.show();

    this.toolbar.enablePageRelatedItems();
  },

  onLastPageClosed: function() {
  },

  onBeforePageSave: function(page) {
    var tab = this.findTabByPagePath(page.getPath());
    if (tab == null) return;

    tab.setIsLoading(true);
  },

  onPageSaved: function(page) {
    var tab = this.findTabByPagePath(page.getPath());
    if (tab == null) return;

    tab.setIsLoading(false);
    tab.setContent(page.getHtmlContent());
  },

  onPageRenamed: function(page) {
    var oldPath = page.getData().oldPath;
    var currentTab = this.getActiveTab();

    // set a new title and path for the current tab
    var tab = this.findTabByPagePath(oldPath);
    if (tab) {
      tab.setPagePath(page.getPath());
      tab.setTitle(page.getTitle());

      if (tab == currentTab) {
        Rwiki.setAppTitle(page.getPath());
      }
    }

    // set a new title and path for all child tabs
    var tabs = this.findTabsByParentPath(oldPath);
    for (var i = 0; i < tabs.length; i++) {
      tab = tabs[i];
      var newPath = tab.getPagePath().replace(oldPath, page.getPath());
      tab.setPagePath(newPath);

      if (tab == currentTab) {
        Rwiki.setAppTitle(page.getPath());
      }
    }
  },

  onPageDeleted: function(page) {
    var tabs = this.findTabsByParentPath(page.getPath());
    for (var i = 0; i < tabs.length; i++) {
      var tab = tabs[i];
      this.remove(tab);
    }
  },

  onEditPage: function() {
    var currentTab = this.getActiveTab();
    if (currentTab) {
      this.fireEvent('rwiki:editPage', currentTab.getPagePath());
    }
  },

  onPrintPage: function() {
    var currentTab = this.getActiveTab();
    if (currentTab) {
      var path = currentTab.getPagePath();
      window.open('/node/print?path=' + path, 'Rwiki ' + path, 'width=800,height=600,scrollbars=yes')
    }
  },

});

<|endoftext|>


<commit_before>// View on GitHub: https://github.com/xPaw/CF-ABetterBrowser

CloudFlare.define( 'abetterbrowser', [ 'cloudflare/dom', 'cloudflare/user', 'abetterbrowser/config' ], function( version, user, config )
{	/**
	 * Did user close this message already?
	 */
	if( user.getCookie( 'cfapp_abetterbrowser' ) === 1 )
	{
		return;
	}

	/**
	 * Compare each version and if there is one that matches
	 */
	var matched, i = 0, versions =
	[
		[ version.internetExplorer, ( parseInt( config.ie, 10 ) || 8 ) ],
		[ version.firefox         , ( parseFloat( config.firefox ) || 0 ) ],
		[ version.chrome          , ( parseFloat( config.chrome ) || 0 ) ],
		[ version.opera           , ( parseFloat( config.opera ) || 0 ) ],
		[ version.safari          , ( parseFloat( config.safari ) || 0 ) ]
	], length = versions.length;

	for( ; i < length; i++ )
	{
		version = versions[ i ];

		if( version[ 0 ] && version[ 0 ] >= version[ 1 ] )
		{
			matched = true;

			break;
		}
	}

	if( !matched )
	{
		return;
	}

	var nav = window.navigator, doc = document,

	/**
	 * Detect user's browser language
	 *
	 * This is aimed at IE, so we don't try to get navigator.language
	 */
	language = ( nav.language || nav.browserLanguage || 'en' ).toLowerCase(),

	/**
	 * Whatbrowser link with user's language
	 */
	moreInformationLink = '',

	/**
	 * Translations
	 *
	 * moreInformationLink contains , and the element is closed before the message is inserted,
	 * this is done to save some bytes when it is minified.
	 */
	translations =
	{
		'en': 'You are using an outdated browser. ' + moreInformationLink + 'More information »',

		'af': 'Jy gebruik \'n verouderde webblaaier. ' + moreInformationLink + 'Meer inligting »',
		'ar': 'المتصفح الذي تستخدمه قديم وغير محدث. ' + moreInformationLink + ' المزيد من المعلومات » ',
		'cs': 'Používáte zastaralý prohlížeč. ' + moreInformationLink + 'Více informací »',
		'da': 'Du bruger en ældre browser. ' + moreInformationLink + 'Mere information »',
		'de': 'Sie benutzen einen veralteten Browser. ' + moreInformationLink + 'Mehr Informationen »',
		'el': 'Χρησιμοποιείτε ένα ξεπερασμένο πρόγραμμα περιήγησης. ' + moreInformationLink + 'Περισσότερες πληροφορίες »',
		'es': 'Su navegador está obsoleto. ' + moreInformationLink + 'Más información »',
		'fa': 'شما از مرورگری قدیمی استفاده می کنید. ' + moreInformationLink + '»اطلاعات بیشتر',
		'fi': 'Käytät vanhentunutta selainta. ' + moreInformationLink + 'Lisää tietoa »',
		'fr': 'Votre navigateur n\'est pas à jour. ' + moreInformationLink + 'Plus d\'information »',
		'he': 'דפדפן האינטרנט שלך אינו מעודכן. ' + moreInformationLink + 'למידע נוסף »',
		'hu': 'A böngészője elavult. ' + moreInformationLink + 'További információ »',
		'id': 'Anda menggunakan web browser versi lama. ' + moreInformationLink + 'Informasi selengkapnya »',
		'is': 'Þú ert að nota úreltan vafra. ' + moreInformationLink + 'Nánari upplýsingar »',
		'it': 'Stai usando un browser datato. ' + moreInformationLink + 'Ulteriori informazioni »',
		'ja': '旧式のブラウザーを利用されています。' + moreInformationLink + '詳細情報 »',
		'nl': 'U gebruikt op dit moment een verouderde webbrowser. ' + moreInformationLink + 'Meer informatie »',
		'pl': 'Używasz przestarzałej przeglądarki. ' + moreInformationLink + 'Więcej informacji »',
		'pt': 'Você está usando um navegador antigo. ' + moreInformationLink + 'Mais informações »',
		'ro': 'Browserul dumneavoastră este depăşit. ' + moreInformationLink + 'Mai multe informații »',
		'ru': 'Вы используете устаревший браузер. ' + moreInformationLink + 'Подробнее »',
		'sk': 'Používate zastaralý prehliadač. ' + moreInformationLink + 'Viac informácií »',
		'sr': 'Vi koristite zastarelu verziju browsera. ' + moreInformationLink + 'Više informacija »',
		'sv': 'Du använder en gammal webbläsare. ' + moreInformationLink + 'Mer information »',
		'tr': 'Çok eski bir tarayıcı kullanıyorsunuz. ' + moreInformationLink + 'Daha fazla bilgi »',
		'vi': 'Trình duyệt bạn dùng đã lỗi thời rồi. ' + moreInformationLink + 'Thêm thông tin »',
		'zh': '您的浏览器版本过旧。 ' + moreInformationLink + '更多信息 »',
		'zh-tw': '你正在使用過時的瀏覽器。 ' + moreInformationLink + '更多訊息 »'
	},

	/**
	 * Style rules
	 */
	rules =
		'#cloudflare-old-browser {' +
			'background:#45484d;' +
			'position:absolute;' +
			'z-index:100000;' +
			'width:100%;' +
			'height:26px;' +
			'top:0;' +
			'left:0;' +
			'overflow:hidden;' +
			'padding:8px 0;' +
			'font:18px/26px Arial,sans-serif;' +
			'text-align:center;' +
			'color:#FFF' +
		'}' +

		'#cloudflare-old-browser a {' +
			'text-decoration:underline;' +
			'color:#EBEBF4' +
		'}' +

		'#cloudflare-old-browser a:hover, #cloudflare-old-browser a:active {' +
			'text-decoration:none;' +
			'color:#DBDBEB' +
		'}' +

		'#cloudflare-old-browser-close {' +
			'background:#393b40;' +
			'display:block;' +
			'width:42px;' +
			'height:42px;' +
			'position:absolute;' +
			'text-decoration:none !important;' +
			'cursor:pointer;' +
			'top:0;' +
			'right:0;' +
			'font-size:30px;' +
			'line-height:42px' +
		'}' +

		'#cloudflare-old-browser-close:hover {' +
			'background:#E04343;' +
			'color:#FFF' +
		'}',

	/**
	 * Have a single var statement, so it compiles better
	 */
	body = doc.body,
	head = doc.getElementsByTagName( 'head' )[ 0 ],
	message = doc.createElement( 'div' ),
	closeButton = doc.createElement( 'a' ),

	/**
	 * Injects style rules into the document to handle formatting
	 */
	style = doc.createElement( 'style' );
	style.id = 'cloudflare-abetterbrowser';
	style.setAttribute( 'type', 'text/css' );

	if( style.styleSheet )
	{
		style.styleSheet.cssText = rules;
	}
	else
	{
		style.appendChild( doc.createTextNode( rules ) );
	}

	head.insertBefore( style, head.firstChild );

	/**
	 * Message container
	 */
	message.id = 'cloudflare-old-browser';
	message.innerHTML = ( translations[ language ] || translations[ language.substring( 0, 2 ) ] || translations.en ) + '';

	/**
	 * Close button
	 */
	closeButton.id = 'cloudflare-old-browser-close';
	closeButton.innerHTML = '×';

	message.appendChild( closeButton );

	closeButton.onclick = function( )
	{
		body.removeChild( message );
		body.className = body.className.replace( new RegExp( '(\\s|^)cloudflare-old-browser-body(\\s|$)' ), '' );

		/**
		 * Hide message for 7 days
		 */
		user.getCookie( 'cfapp_abetterbrowser', 1, 7 );

		return false;
	};

	/**
	 * Injects our message into the body
	 */
	body.appendChild( message );
	body.className += ' cloudflare-old-browser-body';
} );
<commit_msg>Fix version check<commit_after>// View on GitHub: https://github.com/xPaw/CF-ABetterBrowser

CloudFlare.define( 'abetterbrowser', [ 'cloudflare/dom', 'cloudflare/user', 'abetterbrowser/config' ], function( version, user, config )
{	/**
	 * Did user close this message already?
	 */
	if( user.getCookie( 'cfapp_abetterbrowser' ) === 1 )
	{
		return;
	}

	/**
	 * Compare each version and if there is one that matches
	 */
	var matched, i = 0, versions =
	[
		[ version.internetExplorer, ( parseInt( config.ie, 10 ) || 8 ) ],
		[ version.firefox         , ( parseFloat( config.firefox ) || 0 ) ],
		[ version.chrome          , ( parseFloat( config.chrome ) || 0 ) ],
		[ version.opera           , ( parseFloat( config.opera ) || 0 ) ],
		[ version.safari          , ( parseFloat( config.safari ) || 0 ) ]
	], length = versions.length;

	for( ; i < length; i++ )
	{
		version = versions[ i ];

		if( version[ 0 ] && version[ 1 ] >= version[ 0 ] )
		{
			matched = true;

			break;
		}
	}

	if( !matched )
	{
		return;
	}

	var nav = window.navigator, doc = document,

	/**
	 * Detect user's browser language
	 *
	 * This is aimed at IE, so we don't try to get navigator.language
	 */
	language = ( nav.language || nav.browserLanguage || 'en' ).toLowerCase(),

	/**
	 * Whatbrowser link with user's language
	 */
	moreInformationLink = '',

	/**
	 * Translations
	 *
	 * moreInformationLink contains , and the element is closed before the message is inserted,
	 * this is done to save some bytes when it is minified.
	 */
	translations =
	{
		'en': 'You are using an outdated browser. ' + moreInformationLink + 'More information »',

		'af': 'Jy gebruik \'n verouderde webblaaier. ' + moreInformationLink + 'Meer inligting »',
		'ar': 'المتصفح الذي تستخدمه قديم وغير محدث. ' + moreInformationLink + ' المزيد من المعلومات » ',
		'cs': 'Používáte zastaralý prohlížeč. ' + moreInformationLink + 'Více informací »',
		'da': 'Du bruger en ældre browser. ' + moreInformationLink + 'Mere information »',
		'de': 'Sie benutzen einen veralteten Browser. ' + moreInformationLink + 'Mehr Informationen »',
		'el': 'Χρησιμοποιείτε ένα ξεπερασμένο πρόγραμμα περιήγησης. ' + moreInformationLink + 'Περισσότερες πληροφορίες »',
		'es': 'Su navegador está obsoleto. ' + moreInformationLink + 'Más información »',
		'fa': 'شما از مرورگری قدیمی استفاده می کنید. ' + moreInformationLink + '»اطلاعات بیشتر',
		'fi': 'Käytät vanhentunutta selainta. ' + moreInformationLink + 'Lisää tietoa »',
		'fr': 'Votre navigateur n\'est pas à jour. ' + moreInformationLink + 'Plus d\'information »',
		'he': 'דפדפן האינטרנט שלך אינו מעודכן. ' + moreInformationLink + 'למידע נוסף »',
		'hu': 'A böngészője elavult. ' + moreInformationLink + 'További információ »',
		'id': 'Anda menggunakan web browser versi lama. ' + moreInformationLink + 'Informasi selengkapnya »',
		'is': 'Þú ert að nota úreltan vafra. ' + moreInformationLink + 'Nánari upplýsingar »',
		'it': 'Stai usando un browser datato. ' + moreInformationLink + 'Ulteriori informazioni »',
		'ja': '旧式のブラウザーを利用されています。' + moreInformationLink + '詳細情報 »',
		'nl': 'U gebruikt op dit moment een verouderde webbrowser. ' + moreInformationLink + 'Meer informatie »',
		'pl': 'Używasz przestarzałej przeglądarki. ' + moreInformationLink + 'Więcej informacji »',
		'pt': 'Você está usando um navegador antigo. ' + moreInformationLink + 'Mais informações »',
		'ro': 'Browserul dumneavoastră este depăşit. ' + moreInformationLink + 'Mai multe informații »',
		'ru': 'Вы используете устаревший браузер. ' + moreInformationLink + 'Подробнее »',
		'sk': 'Používate zastaralý prehliadač. ' + moreInformationLink + 'Viac informácií »',
		'sr': 'Vi koristite zastarelu verziju browsera. ' + moreInformationLink + 'Više informacija »',
		'sv': 'Du använder en gammal webbläsare. ' + moreInformationLink + 'Mer information »',
		'tr': 'Çok eski bir tarayıcı kullanıyorsunuz. ' + moreInformationLink + 'Daha fazla bilgi »',
		'vi': 'Trình duyệt bạn dùng đã lỗi thời rồi. ' + moreInformationLink + 'Thêm thông tin »',
		'zh': '您的浏览器版本过旧。 ' + moreInformationLink + '更多信息 »',
		'zh-tw': '你正在使用過時的瀏覽器。 ' + moreInformationLink + '更多訊息 »'
	},

	/**
	 * Style rules
	 */
	rules =
		'#cloudflare-old-browser {' +
			'background:#45484d;' +
			'position:absolute;' +
			'z-index:100000;' +
			'width:100%;' +
			'height:26px;' +
			'top:0;' +
			'left:0;' +
			'overflow:hidden;' +
			'padding:8px 0;' +
			'font:18px/26px Arial,sans-serif;' +
			'text-align:center;' +
			'color:#FFF' +
		'}' +

		'#cloudflare-old-browser a {' +
			'text-decoration:underline;' +
			'color:#EBEBF4' +
		'}' +

		'#cloudflare-old-browser a:hover, #cloudflare-old-browser a:active {' +
			'text-decoration:none;' +
			'color:#DBDBEB' +
		'}' +

		'#cloudflare-old-browser-close {' +
			'background:#393b40;' +
			'display:block;' +
			'width:42px;' +
			'height:42px;' +
			'position:absolute;' +
			'text-decoration:none !important;' +
			'cursor:pointer;' +
			'top:0;' +
			'right:0;' +
			'font-size:30px;' +
			'line-height:42px' +
		'}' +

		'#cloudflare-old-browser-close:hover {' +
			'background:#E04343;' +
			'color:#FFF' +
		'}',

	/**
	 * Have a single var statement, so it compiles better
	 */
	body = doc.body,
	head = doc.getElementsByTagName( 'head' )[ 0 ],
	message = doc.createElement( 'div' ),
	closeButton = doc.createElement( 'a' ),

	/**
	 * Injects style rules into the document to handle formatting
	 */
	style = doc.createElement( 'style' );
	style.id = 'cloudflare-abetterbrowser';
	style.setAttribute( 'type', 'text/css' );

	if( style.styleSheet )
	{
		style.styleSheet.cssText = rules;
	}
	else
	{
		style.appendChild( doc.createTextNode( rules ) );
	}

	head.insertBefore( style, head.firstChild );

	/**
	 * Message container
	 */
	message.id = 'cloudflare-old-browser';
	message.innerHTML = ( translations[ language ] || translations[ language.substring( 0, 2 ) ] || translations.en ) + '';

	/**
	 * Close button
	 */
	closeButton.id = 'cloudflare-old-browser-close';
	closeButton.innerHTML = '×';

	message.appendChild( closeButton );

	closeButton.onclick = function( )
	{
		body.removeChild( message );
		body.className = body.className.replace( new RegExp( '(\\s|^)cloudflare-old-browser-body(\\s|$)' ), '' );

		/**
		 * Hide message for 7 days
		 */
		user.getCookie( 'cfapp_abetterbrowser', 1, 7 );

		return false;
	};

	/**
	 * Injects our message into the body
	 */
	body.appendChild( message );
	body.className += ' cloudflare-old-browser-body';
} );
<|endoftext|>


<commit_before>// View on GitHub: https://github.com/xPaw/CF-ABetterBrowser

CloudFlare.define( 'abetterbrowser', [ 'cloudflare/dom', 'cloudflare/user', 'abetterbrowser/config' ], function( version, user, config )
{
	version = version.internetExplorer;

	/**
	 * Is user using IE? Is it old? Did user close this message already?
	 */
	if( version === undefined
	||  version > ( parseInt( config.ie, 10 ) || 8 )
	||  user.getCookie( 'cfapp_abetterbrowser' ) === 1 )
	{
		return true;
	}

	/**
	 * Let's collect some referral statistics with link shortener service
	 */
	var moreInformationLink = 'http://goo.gl/OVoHF',

	doc = document,

	/**
	 * Detect user's browser language
	 *
	 * This is aimed at IE, so we don't try to get navigator.language
	 */
	language = (window.navigator.browserLanguage || 'en').toLowerCase(),

	/**
	 * Translations
	 */
	translations =
	{
		'en': 'You are using an outdated browser. More information »',
		'is': 'Þú ert að nota úreltan vafra. Nánari upplýsingar »',
		'ru': 'Вы используете устаревший браузер. Подробнее »',
		'fr': 'Votre navigateur n\'est pas à jour. Plus d\'information »',
		'da': 'Du bruger en ældre browser. Mere information »',
		'hu': 'A böngészője elavult. További információ »',
		'de': 'Sie benutzen einen veralteten Browser. Mehr Informationen »',
		'ja': 'あなたは、時代遅れのブラウザを使用しています。詳細情報 »',
		'fa': 'شما از مرورگری قدیمی استفاده می کنید. »اطلاعات بیشتر',
		'tr': 'Çok eski bir tarayıcı kullanıyorsunuz. Daha fazla bilgi »',
		'pt': 'Você está usando um navegador antigo. Mais informações »',
		'pl': 'Używasz przestarzałej przeglądarki. Więcej informacji »',
		'fi': 'Käytät vanhentunutta selainta. Lisää tietoa »',
		'zh': '您的浏览器版本过旧。 更多信息 »',
		'es': 'Su navegador está obsoleto. Más información »',
		'nl': 'U gebruikt op dit moment een verouderde webbrowser. Meer informatie »',
		'vi': 'Trình duyệt bạn dùng đã lỗi thời rồi. Thêm thông tin »',
		'he': 'דפדפן האינטרנט שלך אינו מעודכן. למידע נוסף »',
		'it': 'Stai usando un browser datato. Ulteriori informazioni »',
		'el': 'Χρησιμοποιείτε ένα ξεπερασμένο πρόγραμμα περιήγησης. Περισσότερες πληροφορίες »',
		'id': 'Anda menggunakan web browser versi lama. Informasi selengkapnya »',
		'sr': 'Vi koristite zastarelu verziju browsera. Više informacija »',
		'zh-tw': '你正在使用過時的瀏覽器。 更多訊息 »'
	},

	/**
	 * Style rules
	 */
	rules =
		'#cloudflare-old-browser {' +
			'background:#45484d;' +
			'position:absolute;' +
			'z-index:100000;' +
			'width:100%;' +
			'height:26px;' +
			'top:0;' +
			'left:0;' +
			'overflow:hidden;' +
			'padding:8px 0;' +
			'font:18px/26px Arial,sans-serif;' +
			'text-align:center;' +
			'color:#FFF' +
		'}' +

		'#cloudflare-old-browser a {' +
			'text-decoration:underline;' +
			'color:#EBEBF4' +
		'}' +

		'#cloudflare-old-browser a:hover, #cloudflare-old-browser a:active {' +
			'text-decoration:none;' +
			'color:#DBDBEB' +
		'}' +

		'#cloudflare-old-browser-close {' +
			'background:#393b40;' +
			'display:block;' +
			'width:42px;' +
			'height:42px;' +
			'position:absolute;' +
			'text-decoration:none !important;' +
			'cursor:pointer;' +
			'top:0;' +
			'right:0;' +
			'font-size:30px;' +
			'line-height:42px' +
		'}' +

		'#cloudflare-old-browser-close:hover {' +
			'background:#E04343;' +
			'color:#FFF' +
		'}',

	/**
	 * Have a single var statement, so it compiles better
	 */
	body = doc.body,
	head = doc.getElementsByTagName( 'head' )[ 0 ],
	message = doc.createElement( 'div' ),
	closeButton = doc.createElement( 'a' ),

	/**
	 * Injects style rules into the document to handle formatting
	 */
	style = doc.createElement( 'style' );
	style.id = 'cloudflare-abetterbrowser';
	style.setAttribute( 'type', 'text/css' );

	if( style.styleSheet )
	{
		style.styleSheet.cssText = rules;
	}
	else
	{
		style.appendChild( doc.createTextNode( rules ) );
	}

	head.insertBefore( style, head.firstChild );

	/**
	 * Message container
	 */
	message.id = 'cloudflare-old-browser';
	message.innerHTML = translations[ language ] || translations[ language.substring( 0, 2 ) ] || translations.en;

	/**
	 * Close button
	 */
	closeButton.id = 'cloudflare-old-browser-close';
	closeButton.innerHTML = '×';

	message.appendChild( closeButton );

	closeButton.onclick = function( )
	{
		body.removeChild( message );
		body.className = body.className.replace( new RegExp( '(\\s|^)cloudflare-old-browser-body(\\s|$)' ), '' );

		/**
		 * Hide message for 7 days
		 */
		user.getCookie( 'cfapp_abetterbrowser', 1, 7 );

		return false;
	};

	/**
	 * Injects our message into the body
	 */
	body.appendChild( message );
	body.className += ' cloudflare-old-browser-body';
} );
<commit_msg>Addes Slovak translation (sk)<commit_after>// View on GitHub: https://github.com/xPaw/CF-ABetterBrowser

CloudFlare.define( 'abetterbrowser', [ 'cloudflare/dom', 'cloudflare/user', 'abetterbrowser/config' ], function( version, user, config )
{
	version = version.internetExplorer;

	/**
	 * Is user using IE? Is it old? Did user close this message already?
	 */
	if( version === undefined
	||  version > ( parseInt( config.ie, 10 ) || 8 )
	||  user.getCookie( 'cfapp_abetterbrowser' ) === 1 )
	{
		return true;
	}

	/**
	 * Let's collect some referral statistics with link shortener service
	 */
	var moreInformationLink = 'http://goo.gl/OVoHF',

	doc = document,

	/**
	 * Detect user's browser language
	 *
	 * This is aimed at IE, so we don't try to get navigator.language
	 */
	language = (window.navigator.browserLanguage || 'en').toLowerCase(),

	/**
	 * Translations
	 */
	translations =
	{
		'en': 'You are using an outdated browser. More information »',
		'sk': 'Používate zastaralý prehliadač. Viac informácií »',
		'is': 'Þú ert að nota úreltan vafra. Nánari upplýsingar »',
		'ru': 'Вы используете устаревший браузер. Подробнее »',
		'fr': 'Votre navigateur n\'est pas à jour. Plus d\'information »',
		'da': 'Du bruger en ældre browser. Mere information »',
		'hu': 'A böngészője elavult. További információ »',
		'de': 'Sie benutzen einen veralteten Browser. Mehr Informationen »',
		'ja': 'あなたは、時代遅れのブラウザを使用しています。詳細情報 »',
		'fa': 'شما از مرورگری قدیمی استفاده می کنید. »اطلاعات بیشتر',
		'tr': 'Çok eski bir tarayıcı kullanıyorsunuz. Daha fazla bilgi »',
		'pt': 'Você está usando um navegador antigo. Mais informações »',
		'pl': 'Używasz przestarzałej przeglądarki. Więcej informacji »',
		'fi': 'Käytät vanhentunutta selainta. Lisää tietoa »',
		'zh': '您的浏览器版本过旧。 更多信息 »',
		'es': 'Su navegador está obsoleto. Más información »',
		'nl': 'U gebruikt op dit moment een verouderde webbrowser. Meer informatie »',
		'vi': 'Trình duyệt bạn dùng đã lỗi thời rồi. Thêm thông tin »',
		'he': 'דפדפן האינטרנט שלך אינו מעודכן. למידע נוסף »',
		'it': 'Stai usando un browser datato. Ulteriori informazioni »',
		'el': 'Χρησιμοποιείτε ένα ξεπερασμένο πρόγραμμα περιήγησης. Περισσότερες πληροφορίες »',
		'id': 'Anda menggunakan web browser versi lama. Informasi selengkapnya »',
		'sr': 'Vi koristite zastarelu verziju browsera. Više informacija »',
		'zh-tw': '你正在使用過時的瀏覽器。 更多訊息 »'
	},

	/**
	 * Style rules
	 */
	rules =
		'#cloudflare-old-browser {' +
			'background:#45484d;' +
			'position:absolute;' +
			'z-index:100000;' +
			'width:100%;' +
			'height:26px;' +
			'top:0;' +
			'left:0;' +
			'overflow:hidden;' +
			'padding:8px 0;' +
			'font:18px/26px Arial,sans-serif;' +
			'text-align:center;' +
			'color:#FFF' +
		'}' +

		'#cloudflare-old-browser a {' +
			'text-decoration:underline;' +
			'color:#EBEBF4' +
		'}' +

		'#cloudflare-old-browser a:hover, #cloudflare-old-browser a:active {' +
			'text-decoration:none;' +
			'color:#DBDBEB' +
		'}' +

		'#cloudflare-old-browser-close {' +
			'background:#393b40;' +
			'display:block;' +
			'width:42px;' +
			'height:42px;' +
			'position:absolute;' +
			'text-decoration:none !important;' +
			'cursor:pointer;' +
			'top:0;' +
			'right:0;' +
			'font-size:30px;' +
			'line-height:42px' +
		'}' +

		'#cloudflare-old-browser-close:hover {' +
			'background:#E04343;' +
			'color:#FFF' +
		'}',

	/**
	 * Have a single var statement, so it compiles better
	 */
	body = doc.body,
	head = doc.getElementsByTagName( 'head' )[ 0 ],
	message = doc.createElement( 'div' ),
	closeButton = doc.createElement( 'a' ),

	/**
	 * Injects style rules into the document to handle formatting
	 */
	style = doc.createElement( 'style' );
	style.id = 'cloudflare-abetterbrowser';
	style.setAttribute( 'type', 'text/css' );

	if( style.styleSheet )
	{
		style.styleSheet.cssText = rules;
	}
	else
	{
		style.appendChild( doc.createTextNode( rules ) );
	}

	head.insertBefore( style, head.firstChild );

	/**
	 * Message container
	 */
	message.id = 'cloudflare-old-browser';
	message.innerHTML = translations[ language ] || translations[ language.substring( 0, 2 ) ] || translations.en;

	/**
	 * Close button
	 */
	closeButton.id = 'cloudflare-old-browser-close';
	closeButton.innerHTML = '×';

	message.appendChild( closeButton );

	closeButton.onclick = function( )
	{
		body.removeChild( message );
		body.className = body.className.replace( new RegExp( '(\\s|^)cloudflare-old-browser-body(\\s|$)' ), '' );

		/**
		 * Hide message for 7 days
		 */
		user.getCookie( 'cfapp_abetterbrowser', 1, 7 );

		return false;
	};

	/**
	 * Injects our message into the body
	 */
	body.appendChild( message );
	body.className += ' cloudflare-old-browser-body';
} );
<|endoftext|>


<commit_before>var appAccelaar = window.appAccelaar = angular.module('appAccelaar',['ngResource','ui.router','ui.bootstrap']);

appAccelaar.config(['$stateProvider','$urlRouterProvider',function($stateProvider,$urlRouterProvider){
  $urlRouterProvider.otherwise('/home');
  $stateProvider.state('home',{
    url:'/home',
    templateUrl:'/js/admin/templates/home.html',
    controller: 'homeController'
  })
    .state('internship_settings',{
      url:'/internship_settings',
      templateUrl:'/js/admin/templates/internship-settings.html',
      controller: 'homeInternshipController'
    })
}]);

/**
 * Created by sibin on 9/10/2016.
 */
var appAccelaar = window.appAccelaar || angular.module('appAccelaar',[]);

appAccelaar.controller('homeController',['$scope','InternshipService',
    function($scope,InternshipService){
    $scope.title = "Internship List";
    $scope.internship_list = [];
    InternshipService.getInternshipList().then(function(result){
        console.log(result)
        if(result.data.status == 200){
            $scope.internship_list = result.data.data
        }
        console.log($scope.internship_list)
    });

}]);

/* START HOME INTERNSHIP CONTROLLER */
/**
 * - List all internship fields and skills
 *
 */

appAccelaar.controller('homeInternshipController',['$scope', function($scope){
  $scope.intership_fileds = [
    {
      name:'Web Development',
      skills:[
        'Java','PHP','Rails', 'Javascript','HTML','CSS2'
      ]
    }
  ]
}]);

/* EOF HOME INTERNSHIP CONTROLLER */
var appAccelaar = window.appAccelaar || angular.module('appAccelaar',[]);
appAccelaar.factory('InternshipService',['$http','$q',
    function($http,$q){
    var getInternshipList = function(){
        return $q(function(resolve,reject){
            $http({
                url:'/api/get-internships-list',
                method:'GET'
            }).then(function(result){
                resolve(result)
            }, function(error){
                reject(error)
            })
        })
    };

    return {
        getInternshipList: getInternshipList
    }
}]);<commit_msg>Admin dash board routes file<commit_after>var appAccelaar = window.appAccelaar = angular.module('appAccelaar',['ngResource','ui.router','ui.bootstrap']);

appAccelaar.config(['$stateProvider','$urlRouterProvider',function($stateProvider,$urlRouterProvider){
  $urlRouterProvider.otherwise('/home');
  $stateProvider.state('home',{
    url:'/home',
    templateUrl:'/js/admin/templates/home.html',
    controller: 'homeController'
  })
    .state('internship_settings',{
      url:'/internship_settings',
      templateUrl:'/js/admin/templates/internship-settings.html',
      controller: 'homeInternshipController'
    })
}]);

/**
 * Created by sibin on 9/10/2016.
 */
var appAccelaar = window.appAccelaar || angular.module('appAccelaar',[]);

appAccelaar.controller('homeController',['$scope','InternshipService',
    function($scope,InternshipService){
    $scope.title = "Internship List";
    $scope.internship_list = [];
    InternshipService.getInternshipList().then(function(result){
        console.log(result)
        if(result.data.status == 200){
            $scope.internship_list = result.data.data
        }
        console.log($scope.internship_list)
    });

}]);

/* START HOME INTERNSHIP CONTROLLER */
/**
 * - List all internship fields and skills
 *
 */

appAccelaar.controller('homeInternshipController',['$scope', function($scope){
  $scope.intership_fileds = [
    {
      name:'Web Development',
      skills:[
        'Java','PHP','Rails', 'Javascript','HTML','CSS2'
      ]
    }
  ]
}]);

/* EOF HOME INTERNSHIP CONTROLLER */
window.appAccelaar = angular.module('appAccelaar',['ngResource','ui.router','ui.bootstrap']);

appAccelaar.config(['$stateProvider','$urlRouterProvider',function($stateProvider,$urlRouterProvider){
  $urlRouterProvider.otherwise('/');
  $stateProvider.state('home',{
    url:'/',
    templateUrl:'/js/admin/templates/home.html',
    controller: 'HomeController'
  })
    .state('internship_settings',{
      url:'/internship_settings',
      templateUrl:'/js/admin/templates/internship-settings.html',
      controller:'HomeInternshipController'
    })
}]);
var appAccelaar = window.appAccelaar || angular.module('appAccelaar',[]);
appAccelaar.factory('InternshipService',['$http','$q',
    function($http,$q){
    var getInternshipList = function(){
        return $q(function(resolve,reject){
            $http({
                url:'/api/get-internships-list',
                method:'GET'
            }).then(function(result){
                resolve(result)
            }, function(error){
                reject(error)
            })
        })
    };

    return {
        getInternshipList: getInternshipList
    }
}]);<|endoftext|>


<commit_before>const THREE = require('three');
const TrackballControls = require('three-trackballcontrols');

const snubDodecahedron = require('./snub-dodecahedron.js');

module.exports = (element) => {
	const renderer = new THREE.WebGLRenderer({alpha: true});
	const camera = new THREE.PerspectiveCamera(45, 1, 0.1, 1e4);
	const scene = new THREE.Scene();

	scene.add(camera);
	camera.position.set(0, 0, 300);
	camera.lookAt(scene.position);
	element.appendChild(renderer.domElement);

	const controls = new TrackballControls(camera, renderer.domElement);
	controls.noPan = true;
	controls.rotateSpeed = 3;

	const material = new THREE.MeshBasicMaterial({color: 0xFF0000});

	for (const triangle of snubDodecahedron.triangles) {
		const geometry = new THREE.Geometry();

		const vertices = [];

		for (const pointIndex of triangle) {
			const vertex = snubDodecahedron.points[pointIndex];
			const vector = new THREE.Vector3(...vertex.map((value) => value * 100));
			vertices.push(vector);
		}

		const median = vertices.reduce((a, b) => a.clone().add(b)).divideScalar(3);
		geometry.vertices = vertices.map((v) => v.clone().lerp(median, 0.1));

		geometry.faces.push(new THREE.Face3(0, 1, 2));
		geometry.computeFaceNormals();

		const mesh = new THREE.Mesh(geometry, material);
		scene.add(mesh);
	}

	renderer.render(scene, camera);

	const update = () => {
		renderer.render(scene, camera);
		controls.update();
		requestAnimationFrame(update);
	};
	requestAnimationFrame(update);

	const onResize = () => {
		const width = window.innerWidth;
		const height = window.innerHeight - 100;
		renderer.setSize(width, height);
		camera.aspect = width / height;
		camera.updateProjectionMatrix();
	};
	window.addEventListener('resize', onResize);
	onResize();
};
<commit_msg>Render octagons<commit_after>const THREE = require('three');
const TrackballControls = require('three-trackballcontrols');

const snubDodecahedron = require('./snub-dodecahedron.js');

module.exports = (element) => {
	const renderer = new THREE.WebGLRenderer({alpha: true});
	const camera = new THREE.PerspectiveCamera(45, 1, 0.1, 1e4);
	const scene = new THREE.Scene();

	scene.add(camera);
	camera.position.set(0, 0, 300);
	camera.lookAt(scene.position);
	element.appendChild(renderer.domElement);

	const controls = new TrackballControls(camera, renderer.domElement);
	controls.noPan = true;

	const material = new THREE.MeshBasicMaterial({color: 0x111111});

	for (const [index, polygons] of [snubDodecahedron.triangles, snubDodecahedron.pentagons].entries()) {
		for (const polygon of polygons) {
			const geometry = new THREE.Geometry();

			const vertices = [];

			for (const pointIndex of polygon) {
				const vertex = snubDodecahedron.points[pointIndex];
				const vector = new THREE.Vector3(...vertex.map((value) => value * 100));
				vertices.push(vector);
			}

			const median = vertices.reduce((a, b) => a.clone().add(b)).divideScalar(index === 0 ? 3 : 5);
			geometry.vertices = vertices.map((v) => v.clone().lerp(median, index === 0 ? 0.1 : 0.05));

			if (index === 0) {
				geometry.faces.push(new THREE.Face3(0, 1, 2));
			} else if (index === 1) {
				geometry.faces.push(new THREE.Face3(0, 1, 2));
				geometry.faces.push(new THREE.Face3(0, 2, 3));
				geometry.faces.push(new THREE.Face3(0, 3, 4));
			}
			geometry.computeFaceNormals();

			const mesh = new THREE.Mesh(geometry, material);
			scene.add(mesh);
		}
	}

	renderer.render(scene, camera);

	const update = () => {
		renderer.render(scene, camera);
		controls.update();
		requestAnimationFrame(update);
	};
	requestAnimationFrame(update);

	const onResize = () => {
		const width = window.innerWidth;
		const height = window.innerHeight - 100;
		renderer.setSize(width, height);
		camera.aspect = width / height;
		camera.updateProjectionMatrix();
	};
	window.addEventListener('resize', onResize);
	onResize();
};
<|endoftext|>


<commit_before>define([
	"dojo/_base/declare", "dojo/_base/lang",
	"dojo/dom-construct", "dojo/request",
	"./TabViewerBase",
	"../GenomeOverview", "../AMRPanelGridContainer", "../Phylogeny",
	"../GenomeBrowser", "../CircularViewerContainer", "../SequenceGridContainer",
	"../FeatureGridContainer", "../SpecialtyGeneGridContainer", "../ProteinFamiliesContainer",
	"../PathwaysContainer", "../TranscriptomicsContainer", "../InteractionContainer",
	"../../util/PathJoin"
], function(declare, lang,
			domConstruct, xhr,
			TabViewerBase,
			GenomeOverview, AMRPanelGridContainer, Phylogeny,
			GenomeBrowser, CircularViewerContainer, SequenceGridContainer,
			FeatureGridContainer, SpecialtyGeneGridContainer, ProteinFamiliesContainer,
			PathwaysContainer, TranscriptomicsContainer, InteractionsContainer,
			PathJoin){
	return declare([TabViewerBase], {
		"baseClass": "GenomeGroup",
		"disabled": false,
		containerType: "genome_group",
		genome_id: "",
		perspectiveLabel: "Genome View",
		perspectiveIconClass: "icon-selection-Genome",
		apiServiceUrl: window.App.dataAPI,

		_setGenome_idAttr: function(id){
			// console.log("_setGenome_IDAttr: ", id, this.genome_id);
			if(!id){
				return;
			}

			if(this.genome_id == id){
				// console.log("Genome ID Already Set");
				return;
			}

			this.genome_id = this.state.genome_id = id;
			this.state.genome_ids = [id];

			xhr.get(PathJoin(this.apiServiceUrl, "genome", id), {
				headers: {
					accept: "application/json",
					'X-Requested-With': null,
					'Authorization': (window.App.authorizationToken || "")
				},
				handleAs: "json"
			}).then(lang.hitch(this, function(genome){
				this.set("genome", genome)
			}));

		},

		setActivePanelState: function(){
			var activeQueryState;
			// console.log("Set ActivePanelState: ", JSON.stringify(this.state,null,4));
			if(this.state.genome_id){
				activeQueryState = lang.mixin({}, this.state, {search: "eq(genome_id," + this.state.genome_id + ")"});
			}
			var active = (this.state && this.state.hashParams && this.state.hashParams.view_tab) ? this.state.hashParams.view_tab : "overview";
			var activeTab = this[active];
			// console.log("Active Panel: ", active);

			switch(active){
				case "phylogeny":
				case "overview":
					if(this.state.genome){
						activeTab.set("state", lang.mixin({}, this.state));
					}
					break;
				case "features":
					// check whether genome is a host genome and set default filter condition
					if(this.state.genome){
						if(!this.state.hashParams.filter){
							var taxon_lineage_ids = this.state.genome.taxon_lineage_ids;
							if (taxon_lineage_ids.indexOf("2759") > -1){

								activeQueryState = lang.mixin({}, this.state, {
									search: "eq(genome_id," + this.state.genome.genome_id + ")",
									hashParams: lang.mixin({}, this.state.hashParams, {
										filter: 'eq(feature_type,%22CDS%22)'
									})
								});
							}
						}

						activeTab.set("state", activeQueryState);
					}
					break;

				case "transcriptomics":
					activeTab.set("state", lang.mixin({}, this.state, {search: "eq(genome_ids," + this.genome_id + ")"}));
					break;
				case "proteinFamilies":
					// do not set state, the container is built by setVisible already
					break;
				case "interactions":
					activeTab.set("state", lang.mixin({}, this.state, {
						search: "or(eq(genome_id_a," + this.genome_id + "),eq(genome_id_b," + this.genome_id + "))"
					}));
					break;
				default:
					if(activeQueryState){
						// console.log("Using Default ActiveQueryState: ", activeQueryState);
						activeTab.set("state", activeQueryState);
					}else{
						console.log("Missing Active Query State for: ", active)
					}
					break;
			}

			if(this.genome){
				var pageTitle = this.genome.genome_name + "::Genome " + activeTab.title;
				// console.log("Genome setActivePanelState: ", pageTitle);
				if(window.document.title !== pageTitle){
					window.document.title = pageTitle;
				}
			}
		},

		buildHeaderContent: function(genome){

			xhr.get(PathJoin(this.apiServiceUrl, "taxonomy", genome.taxon_id), {
				headers: {
					accept: "application/json"
				},
				handleAs: "json"
			}).then(lang.hitch(this, function(taxon){
				var taxon_lineage_names = taxon.lineage_names;
				var taxon_lineage_ids = taxon.lineage_ids;
				var taxon_lineage_ranks = taxon.lineage_ranks;

				var visibleRanks = ["superkingdom", "phylum", "class", "order", "family", "genus", "species"];
				var visibleIndexes = taxon_lineage_ranks.filter(function(rank){
					return visibleRanks.indexOf(rank) > -1;
				}).map(function(rank){
					return taxon_lineage_ranks.indexOf(rank);
				});

				var out = visibleIndexes.map(function(idx){
					return '' + taxon_lineage_names[idx] + '';
				});
				this.queryNode.innerHTML = out.join(" » ") + " » " + '' + genome.genome_name + '';
			}));
		},

		_setGenomeAttr: function(genome){
			this.state.genome = genome;

			this.buildHeaderContent(genome);
			domConstruct.empty(this.totalCountNode);

			this._set("genome", genome);

			// check host genomes. remove the circular viewer tab if it's a host genome
			if(genome && genome.taxon_lineage_ids){
				// console.log("this genome: ", genome);
				if (genome.taxon_lineage_ids.length>1 && genome.taxon_lineage_ids[1] == "2759"){
					this.viewer.removeChild(this.circular);
				}
			}

			this.setActivePanelState();
			this.resize();
		},

		onSetState: function(attr, oldState, state){

			if(!state){
				return;
			}

			var parts = state.pathname.split("/");
			this.set("genome_id", parts[parts.length - 1]);
			state.genome_id = parts[parts.length - 1];
			state.genome_ids = [state.genome_id];

			// console.log("Genome: ", state.genome, state.genome_id)

			if(state && state.genome_id && !state.genome){
				// console.log("No state.genome.  state.genome_id: ", state.genome_id);
				if(oldState && oldState.genome_id){
					// console.log("oldState.genome_id: ", oldState.genome_id)

					if((state.genome_id == oldState.genome_id)){
						if(oldState.genome || this.genome){
							// console.log("oldState Genome: ", oldState.genome || this.genome);
							state.genome = oldState.genome || this.genome;
						}else{
							console.log("oldState missing Genome");
						}
					}
				}
			}

			if(state.hashParams && state.hashParams.view_tab){

				if(this[state.hashParams.view_tab]){
					var vt = this[state.hashParams.view_tab];

					if(state.hashParams.view_tab === "proteinFamilies"){
						// state.hashParams = lang.mixin({}, state.hashParams, {
						// 	params: JSON.stringify({"family_type": "plfam"})
						// });

						this.proteinFamilies.state = lang.mixin({}, state, {
							hashParams: lang.mixin({}, state.hashParams, {
								params: encodeURIComponent(JSON.stringify({"family_type": "plfam"}))
							})
						});
					}

					vt.set("visible", true);
					this.viewer.selectChild(vt);
				}else{
					// console.log("No view-tab supplied in State Object");
				}
			}

			if(!oldState){
				return;
			} else {
				this.setActivePanelState();
			}

			// console.log("viewer/Genome onSetState() after set genome_id")
		},

		postCreate: function(){
			if(!this.state){
				this.state = {};
			}

			this.inherited(arguments);

			this.overview = new GenomeOverview({
				title: "Overview",
				id: this.viewer.id + "_" + "overview",
				state: this.state
			});

			this.phylogeny = new Phylogeny({
				title: "Phylogeny",
				id: this.viewer.id + "_" + "phylogeny"
			});

			this.sequences = new SequenceGridContainer({
				title: "Sequences",
				id: this.viewer.id + "_" + "sequences",
				state: lang.mixin({}, this.state, {search: "?eq(genome_id," + this.genome_id + ")"})
			});

			this.amr = new AMRPanelGridContainer({
				title: "AMR Phenotypes",
				id: this.viewer.id + "_" + "amr"
			});

			this.features = new FeatureGridContainer({
				title: "Features",
				id: this.viewer.id + "_" + "features"
			});

			this.browser = new GenomeBrowser({
				title: "Genome Browser",
				id: this.viewer.id + "_" + "browser",
				state: lang.mixin({}, this.state),
				tooltip: 'The "Browser" tab shows genome sequence and genomic features using linear genome browser'
			});

			this.circular = new CircularViewerContainer({
				title: "Circular Viewer",
				id: this.viewer.id + "_" + "circular",
				state: lang.mixin({}, this.state)
			});

			this.specialtyGenes = new SpecialtyGeneGridContainer({
				title: "Specialty Genes",
				id: this.viewer.id + "_" + "specialtyGenes",
				state: lang.mixin({}, this.state, {search: "?eq(genome_id," + this.genome_id + ")"})
			});

			this.pathways = new PathwaysContainer({
				apiServer: this.apiServiceUrl,
				title: "Pathways",
				id: this.viewer.id + "_" + "pathways"
			});

			this.subsystems = new SubSystemsContainer({
				title: "Subsystems",
				id: this.viewer.id + "_" + "subsystems"
			})

			this.proteinFamilies = new ProteinFamiliesContainer({
				title: "Protein Families",
				id: this.viewer.id + "_" + "proteinFamilies",
				state: this.state
			});

			this.transcriptomics = new TranscriptomicsContainer({
				title: "Transcriptomics",
				id: this.viewer.id + "_" + "transcriptomics",
				state: this.state
			});

			this.interactions = new InteractionsContainer({
				title: "Interactions",
				id: this.viewer.id + "_" + "interactions",
				state: this.state
			});

			this.viewer.addChild(this.overview);
			this.viewer.addChild(this.amr);
			this.viewer.addChild(this.phylogeny);
			this.viewer.addChild(this.browser);
			this.viewer.addChild(this.circular);
			this.viewer.addChild(this.sequences);
			this.viewer.addChild(this.features);
			this.viewer.addChild(this.specialtyGenes);
			this.viewer.addChild(this.proteinFamilies);
			this.viewer.addChild(this.pathways);
			this.viewer.addChild(this.subsystems);
			this.viewer.addChild(this.transcriptomics);
			this.viewer.addChild(this.interactions);
		}
	});
});
<commit_msg>resolve merge conflict.<commit_after>define([
	"dojo/_base/declare", "dojo/_base/lang",
	"dojo/dom-construct", "dojo/request",
	"./TabViewerBase",
	"../GenomeOverview", "../AMRPanelGridContainer", "../Phylogeny",
	"../GenomeBrowser", "../CircularViewerContainer", "../SequenceGridContainer",
	"../FeatureGridContainer", "../SpecialtyGeneGridContainer", "../ProteinFamiliesContainer",
	"../PathwaysContainer", "../TranscriptomicsContainer", "../InteractionContainer",
	"../../util/PathJoin"
], function(declare, lang,
			domConstruct, xhr,
			TabViewerBase,
			GenomeOverview, AMRPanelGridContainer, Phylogeny,
			GenomeBrowser, CircularViewerContainer, SequenceGridContainer,
			FeatureGridContainer, SpecialtyGeneGridContainer, ProteinFamiliesContainer,
			PathwaysContainer, TranscriptomicsContainer, InteractionsContainer,
			PathJoin){
	return declare([TabViewerBase], {
		"baseClass": "GenomeGroup",
		"disabled": false,
		containerType: "genome_group",
		genome_id: "",
		perspectiveLabel: "Genome View",
		perspectiveIconClass: "icon-selection-Genome",
		apiServiceUrl: window.App.dataAPI,

		_setGenome_idAttr: function(id){
			// console.log("_setGenome_IDAttr: ", id, this.genome_id);
			if(!id){
				return;
			}

			if(this.genome_id == id){
				// console.log("Genome ID Already Set");
				return;
			}

			this.genome_id = this.state.genome_id = id;
			this.state.genome_ids = [id];

			xhr.get(PathJoin(this.apiServiceUrl, "genome", id), {
				headers: {
					accept: "application/json",
					'X-Requested-With': null,
					'Authorization': (window.App.authorizationToken || "")
				},
				handleAs: "json"
			}).then(lang.hitch(this, function(genome){
				this.set("genome", genome)
			}));

		},

		setActivePanelState: function(){
			var activeQueryState;
			// console.log("Set ActivePanelState: ", JSON.stringify(this.state,null,4));
			if(this.state.genome_id){
				activeQueryState = lang.mixin({}, this.state, {search: "eq(genome_id," + this.state.genome_id + ")"});
			}
			var active = (this.state && this.state.hashParams && this.state.hashParams.view_tab) ? this.state.hashParams.view_tab : "overview";
			var activeTab = this[active];
			// console.log("Active Panel: ", active);

			switch(active){
				case "phylogeny":
				case "overview":
					if(this.state.genome){
						activeTab.set("state", lang.mixin({}, this.state));
					}
					break;
				case "features":
					// check whether genome is a host genome and set default filter condition
					if(this.state.genome){
						if(!this.state.hashParams.filter){
							var taxon_lineage_ids = this.state.genome.taxon_lineage_ids;
							if (taxon_lineage_ids.indexOf("2759") > -1){

								activeQueryState = lang.mixin({}, this.state, {
									search: "eq(genome_id," + this.state.genome.genome_id + ")",
									hashParams: lang.mixin({}, this.state.hashParams, {
										filter: 'eq(feature_type,%22CDS%22)'
									})
								});
							}
						}

						activeTab.set("state", activeQueryState);
					}
					break;

				case "transcriptomics":
					activeTab.set("state", lang.mixin({}, this.state, {search: "eq(genome_ids," + this.genome_id + ")"}));
					break;
				case "proteinFamilies":
					// do not set state, the container is built by setVisible already
					break;
				case "interactions":
					activeTab.set("state", lang.mixin({}, this.state, {
						search: "or(eq(genome_id_a," + this.genome_id + "),eq(genome_id_b," + this.genome_id + "))"
					}));
					break;
				default:
					if(activeQueryState){
						// console.log("Using Default ActiveQueryState: ", activeQueryState);
						activeTab.set("state", activeQueryState);
					}else{
						console.log("Missing Active Query State for: ", active)
					}
					break;
			}

			if(this.genome){
				var pageTitle = this.genome.genome_name + "::Genome " + activeTab.title;
				// console.log("Genome setActivePanelState: ", pageTitle);
				if(window.document.title !== pageTitle){
					window.document.title = pageTitle;
				}
			}
		},

		buildHeaderContent: function(genome){

			xhr.get(PathJoin(this.apiServiceUrl, "taxonomy", genome.taxon_id), {
				headers: {
					accept: "application/json"
				},
				handleAs: "json"
			}).then(lang.hitch(this, function(taxon){
				var taxon_lineage_names = taxon.lineage_names;
				var taxon_lineage_ids = taxon.lineage_ids;
				var taxon_lineage_ranks = taxon.lineage_ranks;

				var visibleRanks = ["superkingdom", "phylum", "class", "order", "family", "genus", "species"];
				var visibleIndexes = taxon_lineage_ranks.filter(function(rank){
					return visibleRanks.indexOf(rank) > -1;
				}).map(function(rank){
					return taxon_lineage_ranks.indexOf(rank);
				});

				var out = visibleIndexes.map(function(idx){
					return '' + taxon_lineage_names[idx] + '';
				});
				this.queryNode.innerHTML = out.join(" » ") + " » " + '' + genome.genome_name + '';
			}));
		},

		_setGenomeAttr: function(genome){
			this.state.genome = genome;

			this.buildHeaderContent(genome);
			domConstruct.empty(this.totalCountNode);

			this._set("genome", genome);

			// check host genomes. remove the circular viewer tab if it's a host genome
			if(genome && genome.taxon_lineage_ids){
				// console.log("this genome: ", genome);
				if (genome.taxon_lineage_ids.length>1 && genome.taxon_lineage_ids[1] == "2759"){
					this.viewer.removeChild(this.circular);
				}
			}

			this.setActivePanelState();
			this.resize();
		},

		onSetState: function(attr, oldState, state){

			if(!state){
				return;
			}

			var parts = state.pathname.split("/");
			this.set("genome_id", parts[parts.length - 1]);
			state.genome_id = parts[parts.length - 1];
			state.genome_ids = [state.genome_id];

			// console.log("Genome: ", state.genome, state.genome_id)

			if(state && state.genome_id && !state.genome){
				// console.log("No state.genome.  state.genome_id: ", state.genome_id);
				if(oldState && oldState.genome_id){
					// console.log("oldState.genome_id: ", oldState.genome_id)

					if((state.genome_id == oldState.genome_id)){
						if(oldState.genome || this.genome){
							// console.log("oldState Genome: ", oldState.genome || this.genome);
							state.genome = oldState.genome || this.genome;
						}else{
							console.log("oldState missing Genome");
						}
					}
				}
			}

			if(state.hashParams && state.hashParams.view_tab){

				if(this[state.hashParams.view_tab]){
					var vt = this[state.hashParams.view_tab];

					if(state.hashParams.view_tab === "proteinFamilies"){
						// state.hashParams = lang.mixin({}, state.hashParams, {
						// 	params: JSON.stringify({"family_type": "plfam"})
						// });

						this.proteinFamilies.state = lang.mixin({}, state, {
							hashParams: lang.mixin({}, state.hashParams, {
								params: encodeURIComponent(JSON.stringify({"family_type": "plfam"}))
							})
						});
					}

					vt.set("visible", true);
					this.viewer.selectChild(vt);
				}else{
					// console.log("No view-tab supplied in State Object");
				}
			}

			if(!oldState){
				return;
			} else {
				this.setActivePanelState();
			}

			// console.log("viewer/Genome onSetState() after set genome_id")
		},

		postCreate: function(){
			if(!this.state){
				this.state = {};
			}

			this.inherited(arguments);

			this.overview = new GenomeOverview({
				title: "Overview",
				id: this.viewer.id + "_" + "overview",
				state: this.state
			});

			this.phylogeny = new Phylogeny({
				title: "Phylogeny",
				id: this.viewer.id + "_" + "phylogeny"
			});

			this.sequences = new SequenceGridContainer({
				title: "Sequences",
				id: this.viewer.id + "_" + "sequences",
				state: lang.mixin({}, this.state, {search: "?eq(genome_id," + this.genome_id + ")"})
			});

			this.amr = new AMRPanelGridContainer({
				title: "AMR Phenotypes",
				id: this.viewer.id + "_" + "amr"
			});

			this.features = new FeatureGridContainer({
				title: "Features",
				id: this.viewer.id + "_" + "features"
			});

			this.browser = new GenomeBrowser({
				title: "Genome Browser",
				id: this.viewer.id + "_" + "browser",
				state: lang.mixin({}, this.state),
				tooltip: 'The "Browser" tab shows genome sequence and genomic features using linear genome browser'
			});

			this.circular = new CircularViewerContainer({
				title: "Circular Viewer",
				id: this.viewer.id + "_" + "circular",
				state: lang.mixin({}, this.state)
			});

			this.specialtyGenes = new SpecialtyGeneGridContainer({
				title: "Specialty Genes",
				id: this.viewer.id + "_" + "specialtyGenes",
				state: lang.mixin({}, this.state, {search: "?eq(genome_id," + this.genome_id + ")"})
			});

			this.pathways = new PathwaysContainer({
				apiServer: this.apiServiceUrl,
				title: "Pathways",
				id: this.viewer.id + "_" + "pathways"
			});

			// this.subsystems = new SubSystemsContainer({
			// 	title: "Subsystems",
			// 	id: this.viewer.id + "_" + "subsystems"
			// })

			this.proteinFamilies = new ProteinFamiliesContainer({
				title: "Protein Families",
				id: this.viewer.id + "_" + "proteinFamilies",
				state: this.state
			});

			this.transcriptomics = new TranscriptomicsContainer({
				title: "Transcriptomics",
				id: this.viewer.id + "_" + "transcriptomics",
				state: this.state
			});

			this.interactions = new InteractionsContainer({
				title: "Interactions",
				id: this.viewer.id + "_" + "interactions",
				state: this.state
			});

			this.viewer.addChild(this.overview);
			this.viewer.addChild(this.amr);
			this.viewer.addChild(this.phylogeny);
			this.viewer.addChild(this.browser);
			this.viewer.addChild(this.circular);
			this.viewer.addChild(this.sequences);
			this.viewer.addChild(this.features);
			this.viewer.addChild(this.specialtyGenes);
			this.viewer.addChild(this.proteinFamilies);
			this.viewer.addChild(this.pathways);
			// this.viewer.addChild(this.subsystems);
			this.viewer.addChild(this.transcriptomics);
			this.viewer.addChild(this.interactions);
		}
	});
});
<|endoftext|>


<commit_before>module.exports = options => {
    const gulp    = options.gulp;
    const paths   = options.paths;
    const plugins = options.plugins;
    const path    = require('path');
    const glob    = require('glob');
    const merge   = require('merge-stream');
    const autoprefixer   = require('autoprefixer');
    const mainBowerFiles = require('main-bower-files');
    const postcssProcessors = [
        autoprefixer({ browsers: ['last 2 versions'] })
    ];

    return {
        sass: () => {
            return gulp.src(gulp.data.get('paths.src.files.scss'))
                .pipe(plugins.sourcemaps.init())
                .pipe(plugins.sass())
                .pipe(plugins.postcss(postcssProcessors))
                .pipe(plugins.concat('global.css'))
                .pipe(plugins.sourcemaps.write(gulp.data.get('paths.base')))
                .pipe(gulp.dest(gulp.data.get('paths.dev.folder.assets.css')));
        },
        'js:own': () => {
            return gulp.src(gulp.util._.flatten(gulp.data.get('paths.src.files.js')))
                .pipe(plugins.sourcemaps.init())
                .pipe(plugins.babel({
                    presets: ['es2015']
                }))
                .pipe(plugins.concat('main.js'))
                .pipe(plugins.sourcemaps.write(gulp.data.get('paths.base')))
                .pipe(gulp.dest(gulp.data.get('paths.dev.folder.assets.js')));
        },
        'js:vendor': () => {
            let bowerFiles;

            // try to read bower files
            try {
                bowerFiles = mainBowerFiles();
            } catch (e) {
                bowerFiles = '';
            }

            return gulp.src(gulp.util._.flatten([
                    gulp.data.get('paths.src.files.couldBeVendor.js'),
                    gulp.data.get('paths.vendor.js'),
                    gulp.data.get('paths.src.ignore.min'),
                    bowerFiles
                ]))
                .pipe(plugins.sourcemaps.init())
                .pipe(plugins.concat('vendor.js'))
                .pipe(plugins.sourcemaps.write(gulp.data.get('paths.base')))
                .pipe(gulp.dest(gulp.data.get('paths.dev.folder.assets.js')));
        },
        'sass:browser': () => {
            let stream = merge();

            glob('./src/assets/scss/*', (err, paths) => {
                // delete if no indexOf browser.
                for (let dir of paths) {
                    // continue if the path is not the right dir
                    if (dir.indexOf('browser.') === -1) {
                        continue;
                    }

                    let dirName = path.basename(dir);
                    let fileName = dirName.slice(8, dirName.length);

                    stream.add(gulp.src([dir + '/**/*.scss', '!**/_*.scss'])
                        .pipe(plugins.sourcemaps.init())
                        .pipe(plugins.sass())
                        .pipe(plugins.postcss(postcssProcessors))
                        .pipe(plugins.concat(fileName + '.css'))
                        .pipe(plugins.sourcemaps.write(gulp.data.get('paths.base')))
                        .pipe(gulp.dest(gulp.data.get('paths.dev.folder.assets.css'))));
                }
            });

            return stream.isEmpty() ? gulp.util.noob : stream;
        }
    };
};
<commit_msg>added js filter into manage:js<commit_after>module.exports = options => {
    const gulp    = options.gulp;
    const paths   = options.paths;
    const plugins = options.plugins;
    const path    = require('path');
    const glob    = require('glob');
    const merge   = require('merge-stream');
    const autoprefixer   = require('autoprefixer');
    const mainBowerFiles = require('main-bower-files');
    const postcssProcessors = [
        autoprefixer({ browsers: ['last 2 versions'] })
    ];

    return {
        sass: () => {
            return gulp.src(gulp.data.get('paths.src.files.scss'))
                .pipe(plugins.sourcemaps.init())
                .pipe(plugins.sass())
                .pipe(plugins.postcss(postcssProcessors))
                .pipe(plugins.concat('global.css'))
                .pipe(plugins.sourcemaps.write(gulp.data.get('paths.base')))
                .pipe(gulp.dest(gulp.data.get('paths.dev.folder.assets.css')));
        },
        'js:own': () => {
            return gulp.src(gulp.util._.flatten(gulp.data.get('paths.src.files.js')))
                .pipe(plugins.sourcemaps.init())
                .pipe(plugins.babel({
                    presets: ['es2015']
                }))
                .pipe(plugins.concat('main.js'))
                .pipe(plugins.sourcemaps.write(gulp.data.get('paths.base')))
                .pipe(gulp.dest(gulp.data.get('paths.dev.folder.assets.js')));
        },
        'js:vendor': () => {
            let bowerFiles;

            // try to read bower files
            try {
                bowerFiles = mainBowerFiles();
            } catch (e) {
                bowerFiles = '';
            }

            return gulp.src(gulp.util._.flatten([
                    gulp.data.get('paths.src.files.couldBeVendor.js'),
                    gulp.data.get('paths.vendor.js'),
                    gulp.data.get('paths.src.ignore.min'),
                    bowerFiles
                ]))
                .pipe(plugins.filter('**/*.js'))
                .pipe(plugins.sourcemaps.init())
                .pipe(plugins.concat('vendor.js'))
                .pipe(plugins.sourcemaps.write(gulp.data.get('paths.base')))
                .pipe(gulp.dest(gulp.data.get('paths.dev.folder.assets.js')));
        },
        'sass:browser': () => {
            let stream = merge();

            glob('./src/assets/scss/*', (err, paths) => {
                // delete if no indexOf browser.
                for (let dir of paths) {
                    // continue if the path is not the right dir
                    if (dir.indexOf('browser.') === -1) {
                        continue;
                    }

                    let dirName = path.basename(dir);
                    let fileName = dirName.slice(8, dirName.length);

                    stream.add(gulp.src([dir + '/**/*.scss', '!**/_*.scss'])
                        .pipe(plugins.sourcemaps.init())
                        .pipe(plugins.sass())
                        .pipe(plugins.postcss(postcssProcessors))
                        .pipe(plugins.concat(fileName + '.css'))
                        .pipe(plugins.sourcemaps.write(gulp.data.get('paths.base')))
                        .pipe(gulp.dest(gulp.data.get('paths.dev.folder.assets.css'))));
                }
            });

            return stream.isEmpty() ? gulp.util.noob : stream;
        }
    };
};
<|endoftext|>