Skip to content

Instantly share code, notes, and snippets.

@ben1one
ben1one / gist:1641b98c3b3acbc33b43
Last active August 29, 2015 14:03
getInternetExplorerVersion()
function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
var rv = -1; // Return value assumes failure.
if (navigator.appName == 'Microsoft Internet Explorer')
{
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null)
@ben1one
ben1one / gist:3508ab04f3da52564f99
Created July 12, 2014 18:26
ddGetValue() Unicode
function gup(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.href);
if (results == null)
return "";
else
return decodeURI(results[1]);
}
public function buildAcl() {
$log = array();
$aco =& $this->Acl->Aco;
$root = $aco->node('controllers');
if (!$root) {
$aco->create(array('parent_id' => null, 'model' => null, 'alias' => 'controllers'));
$root = $aco->save();
$root['Aco']['id'] = $aco->id;
$log[] = 'Created Aco node for controllers';
this._menu[f].label.on("click", this._bind(function(event){
//If filter is opened
if($(event.target).hasClass('ft-opened')){
//Fix multiple dropdowns at a time
$('.ft-panel').addClass("ft-hidden");$('.ft-label').removeClass("ft-opened");
}else{
$('.ft-panel').addClass("ft-hidden");$('.ft-label').removeClass("ft-opened");
this.openPanel( f );
this.bringToFront( f );
<li><a target="_blank" href="http://twitter.com/share?text={msg}"><span class="ef-twitter"></span></a></li>
<li><a target="_blank" href="http://efcampaigns.cn/share/talk2.php?desc={msg}"><span class="ef-kakaotalk"></span></a></li>
<li><a target="_blank" href="storylink://posting?post={msg}&appid=ef.com&appver=1&apiver=1.0&appname=&urlinfo="><span class="ef-kakaostory"></span></a></li>
<li><a target="_blank" href="line://msg/text/{msg}"><span class="ef-LINE"></span></a></li>
<li><a target="_blank" href="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url={url}&title={msg}"><span class="ef-qzone"></span></a></li>
<li><a target="_blank" href="http://service.weibo.com/share/share.php?type=button&language=zh_cn&title={msg}&url={url}&style=simple&content=utf-8"><span class="ef-weibo"></span></a></li>
{
"object":"page",
"entry":[
{
"id":"51044240199134611",
"time":1447342027,
"changes":[
{
"field":"leadgen",
"value":{
String.prototype.hashCode = function() {
var hash = 0, i, chr, len;
if (this.length === 0) return hash;
for (i = 0, len = this.length; i < len; i++) {
chr = this.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0; // Convert to 32bit integer
}
return hash;
};
var articlee = {
issueId:"May 2015",
articleeId:"2",
url:"/article-2.html",
title:"The Moral of Caesar",
author:"by Roger Kimball",
desc:"Caesar's death was more than the end of an extraordinary life; it was the end of an era.",
fullIssue:"Vol 33, No. 9 / May 2015",
prvArticle:"/article-1.html",
nextArticle:"/article-3.html",
var article = {
issueId:"May 2015",
articleeId:"2",
url:"/article-2.html",
title:"The Moral of Caesar",
author:"by Roger Kimball",
desc:"Caesar's death was more than the end of an extraordinary life; it was the end of an era.",
fullIssue:"Vol 33, No. 9 / May 2015",
prvArticle:"/article-1.html",
nextArticle:"/article-3.html",
var article = {
issueId:"May 2015",
articleeId:"2",
url:"/article-2.html",
title:"The Moral of Caesar",
author:"by Roger Kimball",
desc:"Caesar's death was more than the end of an extraordinary life; it was the end of an era.",
fullIssue:"Vol 33, No. 9 / May 2015",
prvArticle:"/article-1.html",
nextArticle:"/article-3.html",