greenbot
Close
Thank you
Your message has been sent.
Close
Sorry
There was an error emailing this page.
By Blake Stimac
Greenbot
|
Jul 8, 2014 11:07 AM
“;
placementDiff = applyInsert($(this), adDivString);
if (debug)
console.log(“Just placed an ad and the placementDiff is: ” + placementDiff);
placementTarget = cumulativeHeight + placementDiff + interModuleHeight + adHeightBuffer;
}
else
var moduleDivString = “”;
var elementId = “drr-mod-”+moduleCounter;
moduleDivString = “”;
modules.push(elementId);
placementDiff = applyInsert($(this), moduleDivString);
if (debug)
console.log(“Just placed a module and the placementDiff is: ” + placementDiff);
placementTarget = cumulativeHeight + placementDiff + interModuleHeight + moduleHeightBuffer;
moduleCounter++;
loopCounter++;
}
// Avoid placing elements too soon due to non-large figures inflating the cumulative height
if ($(this).is(“figure”) !$(this).is(“figure.large”))
cumulativeHeight += grafHeight;
else
cumulativeHeight += $(this).height() + grafHeight;
}
});
// clone Related Stories module m-15 to come in after 2nd para in article body for mobile breakpoint display
var $relatedStories = $(‘.related-promo-wrapper’);
if ($relatedStories.length)
var $relatedStoriesClone = $relatedStories.clone();
$relatedStoriesClone.insertAfter( “#drr-container p:eq(1)”);
var $insiderPromo = $(‘.insider-promo-wrapper’);
if ($insiderPromo.length)
var $insiderPromoClone = $insiderPromo.clone();
$insiderPromoClone.insertAfter( “#drr-container p:eq(1)”);
//place left side element
cumulativeHeight = 0;
var leftPlacementTarget = tagHeight = leftPlacementTarget) document.referrer.indexOf(“yahoo”) = 0
/**
* @param jqo Original jquery object target
* @param divString The div to be inserted.
* @return Difference in height between original placement target and final target.
* Checks first 6 elements for an allowable placement (600 pixel window).
* If none, check nearby for elements that are not right avoids.
* If none, place element before current target.
*/
function applyInsert(jqo, divString)
if (debug)
console.log(“applyInsert at top and jqo index is: ” + jqo.index());
for (var i=0; i 0)
children = $(“#drr-container”).children().slice(jqo.index(), allowElement.index() );
else
children = $(“#drr-container”).children().slice(allowElement.index(), jqo.index());
if (children != null)
children.each(function(i)
if (debug)
console.log(“About to add this element’s height to heigh diff offset”);
console.log($(this));
height += $(this).height() + grafHeight;
);
if (offset 300)
if (debug)
console.log(“isRightAvoid: found pre. return true”);
return true;
if (jqo.is(“figure”) jqo.hasClass(‘large’))
if (debug)
console.log(“isRightAvoid: found figure.large return true”);
return true;
if (jqo.is(“figure”) jqo.hasClass(‘medium’) jqo.hasClass(‘inline’))
if (debug)
console.log(“isRightAvoid: found figure has class medium and inline.”);
return true;
if (jqo.hasClass(‘download-asset’))
if (debug)
console.log(“isRightAvoid: found class download-asset return true”);
return true;
if (jqo.is(“aside”) jqo.hasClass(‘tableLarge’))
if (debug)
console.log(“isRightAvoid: found class tableLarge return true”);
return true;
if (jqo.hasClass(‘reject’))
if (debug)
console.log(“isRightAvoid: found class reject. return true”);
return true;
return false;
}
// Return true if element has class ‘reject’: will not place drr modules/ads next to these elements
function isRightReject(jqo)
console.log(“in isRightReject”);
if (jqo != null)
if (jqo.hasClass(“reject”))
if (debug)
console.log(“isRightReject: found ‘reject’ class”);
return true;
return false;
return false;
// Returns true if height of all elements after this one is more than 500; false otherwise
function elementNotNearEnd(element, pixelWindow)
if (pixelWindow == null)
pixelWindow = 500;
if (element == null)
return false;
var remainingHeight = 0;
var children = $(“#drr-container”).children().slice(element.index());
if (children == null)
return false;
children.each(function(i)
remainingHeight += $(this).height();
);
if ( remainingHeight pixelWindow)
return true;
else
if (debug)
console.log(“Element too close to end. Remaining height is: ” + remainingHeight + ” and window is ” + pixelWindow);
return false;
/**
* Return true if need to avoid this element when placing left module.
*/
function isLeftAvoid(jqo)
if (jqo.is(“figure”))
if (debug)
console.log(“isLeftAvoid: found figure. return true”);
return true;
if (jqo.is(“aside.pullquote”))
if (debug)
console.log(“isLeftAvoid: found pullquote. return true”);
return true;
if (jqo.is(“pre”))
if (debug)
console.log(“isLeftAvoid: found pre. return true”);
return true;
if (jqo.is(“div.gist”))
if (debug)
console.log(“isLeftAvoid: found github code block. return true”);
return true;
if (jqo.hasClass(“statsTable”))
if (debug)
console.log(“isLeftAvoid: found class statsTable. return true”);
return true;
return false;
/**
* return true if there are no figures before the target placement that might bleed down into placement element
*/
function noPrevFigures($originalTarget) {
var targetIndex = $originalTarget.index();
var numElementsLookBack = 5;
var figureIndex = null;
var figureHeight = null;
var startIndex = targetIndex – numElementsLookBack
It looks like Sony is jumping on the selfie bandwagon, and has just introduced the Xperia C3, a new smartphone that puts an emphasis on its front-facing camera.Â
The Xperia C3 certainly isn’t the first phone to ship with a 5 megapixel front-facing camera, but that’s not how its differentiating itself from the competition. Sony has gone the extra mile and placed a LED flash on the face of the device, and that’s basically the C3.
Shipping with a 5.5-inch 720p display, 1.2GHz Snapdragon 400 processor, 1GB RAM, and 8GB internal storage, microSD card slot, and 8 megapixel rear camera, the Xperia C3 is not vying for the attention of enthusiasts. That said, this list of specs ensures that this smartphone won’t cost an arm and a leg when it becomes available.Â
Falling in line with expected “omnibalance” design found on its phones since the Xperia Z, the C3 looks like your standard Sony affair. Coming in at 7.6mm thick and weighing only 150 grams, the C3 is thinner and only a few grams heavier than a smartphone like the Samsung Galaxy S5.
Sony is known for making great cameras for its smartphones, but chasing this sort of market with a dedicated product seems a bit silly. While it’s hard to say that the company isn’t serious about the market, it would be nice to see a 5 megapixel front-facing camera and LED flash on all of its smartphone offerings.Â
Available in black, white, and mint green, the Sony Xperia C3 will launch in China next month, with a global rollout to follow.
A great phone gets even greater if you know all the ins and outs.
Get our Greenbot download newsletter
They’re both great phones, but you only need one phone. It’s time to declare a winner.
Go from newbie to expert in 10 minutes with this collection of tips.
Liven up the home screen with the easy-to-use Murtastic app. Create custom wallpapers from your own
Android L is full of tweaks and enhancements. Here are just a few!
When your phone gets an update to Android L, you may suddenly notice a large increase in battery life.
An enterprising developer ripped the keyboard out of the Android L Developer Preview and tossed it up
<!–
Sony introduces the Xperia C3, "The world"s best selfie phone"
No comments:
Post a Comment