SHARE
TWEET

Untitled

pgerman Aug 28th, 2015 136 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <apex:page sidebar="true" standardStylesheets="false"  controller="TestController" docType="html-5.0">
  2. <head>
  3.     <link href="{!URLFOR($Resource.AngularMP, 'css/bootstrap.min.css')}" rel="stylesheet" />
  4.     <link href="{!URLFOR($Resource.AngularMP, 'css/bootstrap-responsive.min.css')}" rel="stylesheet" />
  5.    
  6.         <script src="{!URLFOR($Resource.AngularMP, 'js/vendor/jquery-2.0.0.min.js')}"></script>
  7.     <script src="{!URLFOR($Resource.AngularMP, 'js/vendor/underscore-1.4.4.min.js')}"></script>
  8.     <script src="{!URLFOR($Resource.AngularMP, 'js/vendor/angular.1.0.6.min.js')}"></script>
  9.     <script src="{!URLFOR($Resource.AngularMP, 'js/vendor/dropdownToggle.js')}"></script>
  10.    
  11.     <script src="{!URLFOR($Resource.AngularMP, 'js/sdk/forcetk.mobilesdk.js')}"></script>
  12.     <script src="{!URLFOR($Resource.AngularMP, 'js/sdk/smartsync.js')}"></script>
  13.     <script src="{!URLFOR($Resource.AngularMP, 'js/sdk/angular-force.js')}"></script>
  14.     <script src="{!URLFOR($Resource.AngularMP, 'js/sdk/forcetk.ui.js')}"></script>
  15.    
  16.     <script>
  17.         var app = angular.module('myApp', []);
  18.         app.controller('MainController', function($scope) {
  19.             $scope.nickname = 'paul';
  20.             $scope.lat = 0;
  21.             $scope.lon = 0;
  22.         });
  23.     </script>
  24.    
  25.     <script>
  26.         function setNickname(nickname){
  27.             alert('setting variable');
  28.             var lat = 0;
  29.             var long = 0;
  30.             if (navigator.geolocation) {
  31.                 alert('we are golden');
  32.                 navigator.geolocation.getCurrentPosition(function(position){
  33.                         alert('alert 0');
  34.                         lat = position.coords.latitude;
  35.                         long = position.coords.longitude;
  36.                         alert('alert 1: ' + lat + ', ' + long);
  37.                 });
  38.             }else{
  39.                 alert('geolocation is unsupported?');
  40.             }
  41.             alert('alert 2: ' + lat + ', ' + long);
  42.             jQuery('[id$=myHiddenField]').val(nickname);
  43.             jQuery('[id$=latField]').val(lat);
  44.             jQuery('[id$=longField]').val(long);
  45.             passStringToController();
  46.         }
  47.     </script>
  48.    
  49.     <style media="screen" type="text/css">
  50.         body{
  51.             background-image: url('http://iphonewalls.net/wp-content/uploads/2013/04/Grassy%20Field%20iPhone%20Wallpaper.jpg');
  52.             background-repeat: no-repeat;
  53.             background-position: center;
  54.             background-attachment: fixed;
  55.         }              
  56.        
  57.         .singleField{
  58.             width: 84%;
  59.             margin-left: 8%;
  60.         }
  61.        
  62.         .doubleField{
  63.             width: 35%;
  64.             margin-left: 10%;
  65.         }
  66.        
  67.         .whiteText{
  68.             color: white;
  69.         }
  70.        
  71.         .leftText{
  72.             margin-left: 10%;
  73.         }
  74.        
  75.         .rightText{
  76.             margin-right: 10%;
  77.             margin-left: 30%;
  78.         }
  79.        
  80.         .iosButton{
  81.             background-color: #EEEEEE;
  82.             -moz-border-radius: 5px;
  83.             -webkit-border-radius: 5px;
  84.             border: 0px solid;
  85.             width: 20%;
  86.             height: 6%;
  87.         }
  88.        
  89.         .greenButton{
  90.             background-color: #20be2f;
  91.             color: #FFFFFF;
  92.         }
  93.     </style>
  94. </head>
  95.  
  96. <body>
  97.     <div ng-app="myApp" ng-controller="MainController">
  98.         <h1 style='color:white; margin-left: 8%;'><b>Add Location</b></h1>
  99.         <span class='singleField whiteText'>Location Nickname</span><span style='color:red'>*</span><br/>
  100.         <input type="text" ng-model="nickname" class='singleField' /><br/>
  101.         <span class='leftText whiteText'>Rating</span><span class='rightText whiteText'>Planned Visit Date</span><br/>
  102.         <select class='doubleField' name="thelist" onChange="combo(this, 'theinput')" ng-model='rating'>
  103.           <option>&#9733;</option>
  104.           <option>&#9733;&#9733;</option>
  105.           <option>&#9733;&#9733;&#9733;</option>
  106.           <option>&#9733;&#9733;&#9733;&#9733;</option>
  107.           <option>&#9733;&#9733;&#9733;&#9733;&#9733;</option>
  108.         </select><input class='doubleField' type='date' ng-model='futureDate'/><br/>
  109.         <span class='singleField whiteText' ng-model='description'>Description</span><br/>
  110.         <textarea rows="8" cols="50" class='singleField'></textarea><br/>
  111.         <span class='singleField'>Add a Picture</span><br/>
  112.         <input class='singleField' style='width:60%' type="file" capture="camera" accept="image/*" id="cameraInput" name="cameraInput" ng-model='file'/><br/>
  113.         <span ng-bind='file'></span><br/>
  114.         <apex:form >
  115.             <apex:inputHidden value="{!nickname}" id="myHiddenField"/>
  116.             <apex:inputHidden value="{!latitude}" id="latField"/>
  117.             <apex:inputHidden value="{!longitude}" id="longField"/>
  118.             <apex:actionFunction name="passStringToController" action="{!myMethod}" rerender="myHiddenField, latField, longField"/>
  119.             <button class='iosButton' style='position: absolute; top: 85%; left: 5%;'>Cancel</button><button class='iosButton greenButton' onclick="setNickname('{{nickname}}'); return false;" style='position: absolute; top: 85%; right: 5%;'>Add</button>
  120.         </apex:form>
  121.     </div>a
  122.    
  123.  
  124. </body>
  125. </apex:page>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top