| | |
| | | $scope.fn = { |
| | | formSubmit : formSubmit, // 폼 전송 |
| | | formCheck : formCheck, // 폼 체크 |
| | | onFileSelect : onFileSelect, // 프로필 업로드 |
| | | autoHyphenPhone : autoHyphenPhone // 연락처 입력시 하이픈 자동 입력 |
| | | onFileSelect : onFileSelect // 프로필 업로드 |
| | | }; |
| | | |
| | | $scope.vm = { |
| | |
| | | else { |
| | | $scope.vm.form.profileImageName = ""; |
| | | } |
| | | } |
| | | |
| | | // 연락처 입력시 하이픈 자동 입력 |
| | | function autoHyphenPhone() { |
| | | // 핸드폰 번호 조건 |
| | | var str = $scope.vm.form.phone |
| | | str.replace(/^[0-9]/g, ''); |
| | | var tmp = ''; |
| | | |
| | | if (str.length < 4) { |
| | | return str; |
| | | } else if (str.length < 7) { |
| | | tmp += str.substr(0, 3); |
| | | tmp += '-'; |
| | | tmp += str.substr(3); |
| | | $scope.vm.form.phone = tmp; |
| | | } else if (str.length < 11) { |
| | | tmp += str.substr(0, 3); |
| | | tmp += '-'; |
| | | tmp += str.substr(3, 3); |
| | | tmp += '-'; |
| | | tmp += str.substr(6); |
| | | $scope.vm.form.phone = tmp; |
| | | } else { |
| | | tmp += str.substr(0, 3); |
| | | tmp += '-'; |
| | | tmp += str.substr(3, 4); |
| | | tmp += '-'; |
| | | tmp += str.substr(7); |
| | | $scope.vm.form.phone = tmp; |
| | | } |
| | | return str |
| | | } |
| | | |
| | | // 폼 체크 |
| | |
| | | content.workspaceName = $rootScope.preventXss(content.workspaceName); |
| | | content.password = CryptoJS.SHA512(content.password).toString(); |
| | | content.language = $rootScope.language; // 기본 언어 |
| | | content.phone = content.phone.replace(/\-/g,''); // 전화번호를 보낼땐 하이픈을 제거해서 DB에 저장 |
| | | |
| | | User.add({ |
| | | method : "POST", |