Advertisement
tanmoklepasha

typing_geo_javascript

Jan 2nd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
  4. <body ng-app="myApp">
  5. <div ng-controller="myCtrl" >
  6.   <p>Write something in the input field:</p>
  7.   <input type="text" ng-change="myFunc()" ng-model="myValue" >
  8.  
  9. </div>
  10.  
  11. <script>
  12.   angular.module('myApp', [])
  13.     .controller('myCtrl', ['$scope', function($scope) {
  14.       $scope.x='';
  15.       $scope.chars={'h': 'ჰ', 'S': 'შ', 'z': 'ზ',
  16.          'f': 'ფ', 'C': 'ჩ', 'W': 'ჭ',
  17.          'y': 'ყ', 'r': 'რ','c': 'ც',
  18.          's': 'ს', 'a': 'ა', 't': 'ტ',
  19.          'v': 'ვ', 'x': 'ხ','g': 'გ',
  20.          'T': 'თ','l': 'ლ', 'u': 'უ',
  21.          'm': 'მ','k': 'კ', 'i': 'ი',
  22.          'd': 'დ', 'J': 'ჟ', 'b': 'ბ',
  23.          'j': 'ჯ', 'o': 'ო', 'Z': 'ძ',
  24.          'w': 'წ', 'R': 'ღ', 'p': 'პ',
  25.          'n': 'ნ', 'q': 'ქ', 'e': 'ე',' ':' '};
  26.       $scope.myFunc = function() {
  27.       $scope.my='';
  28.       for ( $scope.x in $scope.myValue){
  29.             if ('ა'<= $scope.myValue[$scope.x]){
  30.             $scope.my+=$scope.myValue[$scope.x];
  31.             }
  32.             else {
  33.             $scope.my+=$scope.chars[$scope.myValue[$scope.x]];
  34.             }
  35.             }
  36.       $scope.myValue=$scope.my
  37.       };
  38.     }]);
  39. </script>
  40. </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement