This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', 0); | |
session_start(); | |
//トークンを生成 | |
$token = sha1(uniqid(mt_rand(), true)); | |
$_SESSION['token'] = $token; | |
//エスケープ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* [namespace] | |
*/ | |
var App = App || {}; | |
/** | |
* [Model] | |
*/ | |
App.Model = function(text){ | |
this.text = text; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function TextCount(){ | |
this.textArea = document.getElementById('textArea'); | |
this.textCount = document.getElementById('textCount'); | |
this.init(); | |
} | |
TextCount.prototype = { | |
init: function(){ | |
var that = this; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 特定の位置で対象を表示する | |
* @param {String} el 対象のセレクター ※必須 | |
* @param {Number} position 特定の位置 ※必須 | |
*/ | |
function ShowElementOnScroll(el,position){ | |
this.$el = $(el); | |
this.position = position; | |
this.$window = $(window); | |
this.event(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//inherits | |
function inherits(ctor, superCtor) { | |
ctor.super_ = superCtor; | |
ctor.prototype = Object.create(superCtor.prototype, { | |
constructor: { | |
value: ctor, | |
enumerable: false, | |
writable: true, | |
configurable: true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setEvent(selector,event,func){ | |
var ary = document.querySelectorAll(selector); | |
var len = ary.length; | |
for (var i = 0; i < len; i++){ | |
ary[i].addEventListener(event, func); | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hasClass(selector,str){ | |
var el = document.querySelector(selector); | |
var className = el.className(); | |
var classArray = className.split(' ') | |
if(classArray.indexOf(str) !== -1){ | |
return true; | |
} | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {String} el 対象のセレクター ※必須 | |
* @param {Number} sub スクロール位置を調整 [初期値=0] | |
* @param {Number} time スクロールするスピード [初期値=200] | |
* @param {String} easing イージング [初期値='swing'] | |
*/ | |
function PageScroll(el, sub, time, easing){ | |
this.$el = $(el); | |
this.sub = sub || 0; | |
this.time = time || 200; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function DecideUA(){ | |
this.name = window.navigator.userAgent.toLowerCase(); | |
} | |
DecideUA.prototype = { | |
/** | |
* @param {Strihg} str 判定するデバイスのユニークな文字列 | |
* @return {Boolean} | |
*/ |
NewerOlder