More than six million customers lost power Monday as Hurricane Sandy felled trees, downed power lines and flooded substations. The storm led to power failures in at least 17 states, including more than a million customers in Pennsylvania and New Jersey and about 660,000 in New York City. Roughly a quarter million customers lost power in Manhattan after water surging up from the East River submerged some electrical equipment in metal sheds, darkening most of the island south of 34th Street. Con Edison officials called the power failures “the largest storm related outage in our history.” In an update Tuesday morning, New York Gov. Andrew M. Cuomo said that about 2 million families in the region were still without power, nearly half of them on Long Island
n n'”);
this.handle = this.node.find(‘.nytg-handle’);
this.handleKnob = this.handle.find(‘.nytg-knob’);
this.track = this.node.find(‘.nytg-track’);
this.insetContainer = this.node.find(‘.nytg-insetContainer’);
this.tickContainer = this.node.find(‘.nytg-tickContainer’);
this.containerNode.append(this.node);
this.renderHTML();
//events
var that = this;
this.node.bind(‘mousedown’,function(evt){
// console.log(‘mousedown’);
evt.preventDefault();
that.updateMeasurements();
that.startDrag(evt);
$j(document).bind(‘mouseup’,function(evt){
$j(document).unbind(‘mouseup’);
that.stopDrag();
});
});
this.setIndex(this.startIndex);
};
/* Private Methods ===========================================================================*/
nytg.Slider.prototype.renderHTML = function() {
var ticks = “”;
this.handle.css({top:-this.handleTopOffset-this.trackHeight/2,width:this.handleWidth,height:this.handleHeight});
this.handleKnob.css({position:”absolute”,left:-(this.handleWidth/2),width:this.handleWidth,height:this.handleHeight});
this.track.css({height:this.trackHeight});
this.insetContainer.css({position:”absolute”, left:this.handleSideOffset, right:this.handleSideOffset, top:this.trackHeight});
for (var i=0; i “;
} else {
ticks += “
“+String(this.labels[i])+”
“;
}
} else {
ticks += “”;
}
};
this.tickContainer.html(ticks);
this.tickContainer.find(‘.nytg-sliderTick’).css({top:this.trackHeight+this.trackMargin});
this.tickContainer.find(‘.nytg-tickNoLabel’).css({height:this.tickHeightNoLabel});
this.tickContainer.find(‘.nytg-tickHasLabel’).css({height:this.tickHeightWithLabel});
this.tickContainer.find(‘.nytg-tickLabel’).css({left:-Math.round(this.tickLabelWidth/2),top:this.tickHeightWithLabel+this.tickMargin,width:this.tickLabelWidth});
};
/* Public Methods ===========================================================================*/
// move the slide to a specific index
nytg.Slider.prototype.setIndex = function(index) {
if (index === this.currentIndex ) {
return;
};
if (index (this.values.length – 1) ) {
index = this.values.length – 1
};
this.currentIndex = index;
this.currentValue = this.values[this.currentIndex];
this.positionHandle();
this.changeCallback(this);
};
//alternative to setIndex
nytg.Slider.prototype.setValue = function(value) {
this.setIndex(this.indexFromValue[value]);
};
// alternative to setIndex
nytg.Slider.prototype.setPct = function(pct) {
this.setIndex( Math.round( ( this.values.length – 1 ) * pct ) )
};
// advance slider one index
nytg.Slider.prototype.nextIndex = function() {
if (this.isSliderPlaying) this.stop();
if (this.currentIndex === this.values.length – 1) return;
this.setIndex(this.currentIndex + 1);
};
// reverse slider one index
nytg.Slider.prototype.backIndex = function() {
if (this.isSliderPlaying) this.stop();
if(this.currentIndex === 0) return;
this.setIndex(this.currentIndex – 1);
};
// play controller
nytg.Slider.prototype.playController = function(index) {
if (this.isSliderPlaying) {
this.stop();
} else {
if (this.currentIndex === this.values.length – 1) {
this.setIndex(0);
};
this.play();
};
};
// next for playing
nytg.Slider.prototype.nextPlay = function() {
if (this.currentIndex === this.values.length – 1) this.stop();
this.setIndex(this.currentIndex + 1);
};
// play slider
nytg.Slider.prototype.play = function(index) {
// you always want to clear out the existing timer, just to ensure you dont trigger it twice
nytg.timerId = null;
nytg.timerId = window.setInterval($j.proxy(this.nextPlay, this), this.sliderSpeed);
this.isSliderPlaying = true;
};
// stop slider
nytg.Slider.prototype.stop = function(index) {
clearInterval ( nytg.timerId );
this.isSliderPlaying = false;
nytg.timerId = null;
this.changeCallback(this);
};
/* Handle positioning ===========================================================================*/
nytg.Slider.prototype.positionHandle = function() {
var ratio = this.currentIndex / ( this.values.length – 1 );
this.handle.css({‘left’:ratio*100+’%’});
this.currentHandlePosition = ratio;
};
nytg.Slider.prototype.updateMeasurements = function() {
this.trackWidth = this.node.width() – 2 * this.handleSideOffset;
this.nodeOffset = this.node.offset();
};
/* Dragging ===========================================================================*/
nytg.Slider.prototype.startDrag = function(evt) {
var that = this;
if (this.isSliderPlaying) that.stop();
this.startDragOffsetX = evt.pageX;
this.startDragHandlePosition = this.currentHandlePosition * this.trackWidth;
// acm – added for grabbing cursor
$j(document.body).addClass(‘nytg-isDragging’);
this.onDrag(evt);
$j(document).bind(‘mousemove’, function(evt){
that.onDrag(evt);
});
};
nytg.Slider.prototype.onDrag = function(evt) {
var x = evt.pageX – this.nodeOffset.left – 2 * this.handleSideOffset;
this.setPct(x / this.trackWidth);
};
nytg.Slider.prototype.stopDrag = function(evt) {
// acm – added for grabbing cursor
$j(document.body).removeClass(‘nytg-isDragging’);
$j(document).unbind(‘mousemove’);
};