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
/** | |
* [searchAddr 다음주소검색 API] | |
* @return {[JsonArray]} [주소데이터] | |
* <script src="http://dmaps.daum.net/map_js_init/postcode.v2.js">가 선행되어야함 | |
*/ | |
var searchAddr = function(){ | |
new daum.Postcode({ | |
oncomplete: function(data){ | |
var fullAddr = ''; // 최종 주소 변수 | |
var extraAddr = ''; // 조합형 주소 변수 |
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
<script src="/bower_components/clipboard/dist/clipboard.min.js"></script> | |
<!-- 1. URL copy --> | |
<a href="#" id="btnCopyUrl" data-clipboard-action="copy" >url 복사</a> | |
<script> | |
$(function({ | |
// 복사 버튼을 만들시 data-clipboard-text 안에 복사할 문구를 넣어준다 | |
$('#btnCopyUrl').attr('data-clipboard-text', document.location.href); | |
// callback 설정 | |
var clipboard = new Clipboard('#btnCopyUrl'); |
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
<link rel="stylesheet" type="text/css" href="/bower_components/datetimepicker/build/jquery.datetimepicker.min.css"> | |
<!-- php.date.formatter.js 와 jquery.mousewheeel.js 를 포함하는 full.js--> | |
<!-- moment는 이미 선언되어있다고 가정합니다 --> | |
<script src="/bower_components/datetimepicker/build/jquery.datetimepicker.full.min.js"></script> | |
<script> | |
// dateTimePicker localization | |
$.datetimepicker.setLocale('ko'); | |
// dateTimePicker moment.js와 연동 | |
$.datetimepicker.setDateFormatter({ |
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
<script type="text/javascript"> | |
var imageModule = (function () { | |
'use strict'; | |
var possible = window.File && window.FileReader && window.FormData; // html5 업로드를 지원하는지의 여부 | |
var apiPath = '/api/test.php'; // 업로드 서버 처리 경로 | |
var folder = '/upload/review/'; // 기본 이미지 업로드 폴더 | |
var $input; | |
var maxWidth = 600; | |
var maxHeight = 480; |
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
<script> | |
$.validator.setDefaults({ | |
onfocusout: false, | |
invalidHandler: function(form, validator) { // 커스텀 포커스 핸들링 | |
if (validator.numberOfInvalids()) { | |
validator.errorList[0].element.focus(); | |
//alert(validator.errorList[0].message); // 경고창 | |
} | |
}, | |
errorClass:'text-danger', // 에러 스타일을 입힐 클래스 지정 |
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
// p 태그를 이용하는 방법 | |
$.validator.setDefaults({ | |
errorClass: "invalid form-error red-text", | |
errorElement : 'p', | |
errorPlacement: function(error, element) { | |
var e = element.get(0); | |
if(e.type==='radio' || e.type==='checkbox'){ | |
var $a = error.appendTo(element.parent()); | |
$a.css({'margin-top':'10px'}); | |
}else{ |
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($) { | |
$.validator.addMethod('biznum', function(bizID, element) { | |
var checkID = [1, 3, 7, 1, 3, 7, 1, 3, 5, 1]; | |
var tmpBizID, i, chkSum=0, c2, remander; | |
bizID = bizID.replace(/-/gi, ''); | |
for (i=0; i<=7; i++) { | |
chkSum += checkID[i] * bizID.charAt(i); | |
} | |
c2 = "0" + (checkID[8] * bizID.charAt(8)); |
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
/** | |
* [num2han 숫자를 한글로 변환] | |
* @param {[integer]} num [숫자] | |
* @return {[string]} [한글 숫자] | |
* @author http://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=tipntech&wr_id=14981 | |
*/ | |
function num2han(num){ | |
var i, j=0, k=0; | |
var han1 = ["","일","이","삼","사","오","육","칠","팔","구"]; | |
var han2 = ["","만","억","조","경","해","시","양","구","간"]; |
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 | |
function comma(num){ | |
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); | |
} | |
// prototype | |
Number.prototype.format = function(){ | |
return this.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); | |
}; |
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 time(); | |
var timestamp = Math.round(new Date().getTime() / 1000); |
OlderNewer