<commit_before><!DOCTYPE html>
<!--
 Copyright (c) 2011, salesforce.com, inc.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without modification, are permitted provided
 that the following conditions are met:
 
 Redistributions of source code must retain the above copyright notice, this list of conditions and the
 following disclaimer.
 
 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
 the following disclaimer in the documentation and/or other materials provided with the distribution.
 
 Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or
 promote products derived from this software without specific prior written permission.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.
 -->
<!--
 Sample HTML page showing use of Force.com JavaScript REST Toolkit from
 a PhoneGap app using jQuery Mobile
 -->
<html>
    <head>
        <title>Accounts</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
        <!--
         We use local copies of jQuery and jQuery Mobile. You could load it
         from the CDN, but then the device needs to be online for the app to
         be functional.
         -->
        <link rel="stylesheet" href="static/jquery.mobile-1.0a4.1.min.css" />
        <script type="text/javascript" src="static/jquery-1.5.2.min.js"></script>
        <script type="text/javascript" src="static/jquery.mobile-1.0a4.1.min.js"></script>
        <script type="text/javascript" src="forcetk.js"></script>
        <script type="text/javascript" src="mobileapp.js"></script>
        <script type="text/javascript" src="phonegap.0.9.5.min.js"></script>
        <script type="text/javascript" src="ChildBrowser.js"></script>
        <script type="text/javascript">
	        // OAuth Configuration
	        var loginUrl    = 'https://login.salesforce.com/';
	        var clientId    = '<KEY>';
	        var redirectUri = 'https://login.salesforce.com/services/oauth2/success';
        
	        // We'll get an instance of the REST API client in a callback after we do 
	        // OAuth
	        var client = null;
        
            // Make our own startsWith utility fn
            String.prototype.startsWith = function(str){
                return (this.substr(0, str.length) === str);
            }
            
            function getAuthorizeUrl(loginUrl, clientId, redirectUri){
                return loginUrl+'services/oauth2/authorize?display=touch'
                +'&response_type=token&client_id='+escape(clientId)
                +'&redirect_uri='+escape(redirectUri);
            }
            
            function sessionCallback(loc) {
                var oauthResponse = {};
                
                var fragment = loc.split("#")[1];
                
                if (fragment) {
                    var nvps = fragment.split('&');
                    for (var nvp in nvps) {
                        var parts = nvps[nvp].split('=');
                        oauthResponse[parts[0]] = unescape(parts[1]);
                    }
                }
                
                if (typeof oauthResponse === 'undefined'
                    || typeof oauthResponse['access_token'] === 'undefined') {
                    errorCallback({
                                  status: 0, 
                                  statusText: 'Unauthorized', 
                                  responseText: 'No OAuth response'
                                  });
                } else {
                    client = new forcetk.Client(oauthResponse.access_token, null,
                                                oauthResponse.instance_url);
                    
                    addClickListeners();
                    
                    $j.mobile.changePage('#mainpage',"slide",false,true);
                    $j.mobile.pageLoading();
                    getAccounts(function(){
                                $j.mobile.pageLoading(true);
                                });
                }
            }

            // We use $j rather than $ for jQuery
            if (window.$j === undefined) {
                $j = $;
            }

            $j(document).ready(function() {
               var cb = ChildBrowser.install();
               $j('#login').click(function(e) {
                  e.preventDefault();
                  cb.onLocationChange = function(loc){   
                      if (loc.startsWith(redirectUri)) {
                          cb.close();
                          sessionCallback(unescape(loc));
                      }
                  };
                  cb.showWebPage(getAuthorizeUrl(loginUrl, clientId, redirectUri));
               });
            });
        </script>
    </head>
    <body>
        <div data-role="page" data-theme="b" id="loginpage">
            <div data-role="header">
                <h1>Login</h1>
            </div>
            <div data-role="content">
                <form>
                    <button data-role="button" id="login">Login</button>
                </form>
            </div>
            <div data-role="footer">
                <h4>Force.com</h4>
            </div>
        </div>
        <div data-role="page" data-theme="b" id="mainpage">
            <div data-role="header">
                <h1>Account List</h1>
            </div>
            <div data-role="content">
                <form>
                    <button data-role="button" id="newbtn">New</button>
                </form>
                <ul id="accountlist" data-inset="true" data-role="listview" 
                    data-theme="c" data-dividertheme="b">
                </ul>
            </div>
            <div data-role="footer">
                <h4>Force.com</h4>
            </div>
        </div>
        <div data-role="page" data-theme="b" id="detailpage">
            <div data-role="header">
                <h1>Account Detail</h1><commit_msg>Remove back button from account list<commit_after><!DOCTYPE html>
<!--
 Copyright (c) 2011, salesforce.com, inc.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without modification, are permitted provided
 that the following conditions are met:
 
 Redistributions of source code must retain the above copyright notice, this list of conditions and the
 following disclaimer.
 
 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
 the following disclaimer in the documentation and/or other materials provided with the distribution.
 
 Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or
 promote products derived from this software without specific prior written permission.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.
 -->
<!--
 Sample HTML page showing use of Force.com JavaScript REST Toolkit from
 a PhoneGap app using jQuery Mobile
 -->
<html>
    <head>
        <title>Accounts</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
        <!--
         We use local copies of jQuery and jQuery Mobile. You could load it
         from the CDN, but then the device needs to be online for the app to
         be functional.
         -->
        <link rel="stylesheet" href="static/jquery.mobile-1.0a4.1.min.css" />
        <script type="text/javascript" src="static/jquery-1.5.2.min.js"></script>
        <script type="text/javascript" src="static/jquery.mobile-1.0a4.1.min.js"></script>
        <script type="text/javascript" src="forcetk.js"></script>
        <script type="text/javascript" src="mobileapp.js"></script>
        <script type="text/javascript" src="phonegap.0.9.5.min.js"></script>
        <script type="text/javascript" src="ChildBrowser.js"></script>
        <script type="text/javascript">
            // OAuth Configuration
            var loginUrl    = 'https://login.salesforce.com/';
            var clientId    = '<KEY>';
            var redirectUri = 'https://login.salesforce.com/services/oauth2/success';
            
            // We'll get an instance of the REST API client in a callback after we do 
            // OAuth
            var client = null;
            
            // Make our own startsWith utility fn
            String.prototype.startsWith = function(str){
                return (this.substr(0, str.length) === str);
            }
            
            function getAuthorizeUrl(loginUrl, clientId, redirectUri){
                return loginUrl+'services/oauth2/authorize?display=touch'
                +'&response_type=token&client_id='+escape(clientId)
                +'&redirect_uri='+escape(redirectUri);
            }
            
            function sessionCallback(loc) {
                var oauthResponse = {};
                
                var fragment = loc.split("#")[1];
                
                if (fragment) {
                    var nvps = fragment.split('&');
                    for (var nvp in nvps) {
                        var parts = nvps[nvp].split('=');
                        oauthResponse[parts[0]] = unescape(parts[1]);
                    }
                }
                
                if (typeof oauthResponse === 'undefined'
                    || typeof oauthResponse['access_token'] === 'undefined') {
                    errorCallback({
                                  status: 0, 
                                  statusText: 'Unauthorized', 
                                  responseText: 'No OAuth response'
                                  });
                } else {
                    client = new forcetk.Client(oauthResponse.access_token, null,
                                                oauthResponse.instance_url);
                    
                    addClickListeners();
                    
                    $j.mobile.changePage('#mainpage',"slide",false,true);
                    $j.mobile.pageLoading();
                    getAccounts(function(){
                                $j.mobile.pageLoading(true);
                                });
                }
            }

            // We use $j rather than $ for jQuery
            if (window.$j === undefined) {
                $j = $;
            }

            $j(document).ready(function() {
               var cb = ChildBrowser.install();
               $j('#login').click(function(e) {
                  e.preventDefault();
                  cb.onLocationChange = function(loc){   
                      if (loc.startsWith(redirectUri)) {
                          cb.close();
                          sessionCallback(unescape(loc));
                      }
                  };
                  cb.showWebPage(getAuthorizeUrl(loginUrl, clientId, redirectUri));
               });
            });
        </script>
    </head>
    <body>
        <div data-role="page" data-theme="b" id="loginpage">
            <div data-role="header">
                <h1>Login</h1>
            </div>
            <div data-role="content">
                <form>
                    <button data-role="button" id="login">Login</button>
                </form>
            </div>
            <div data-role="footer">
                <h4>Force.com</h4>
            </div>
        </div>
        <div data-role="page" data-theme="b" id="mainpage">
            <div data-role="header" data-backbtn="false">
                <h1>Account List</h1>
            </div>
            <div data-role="content">
                <form>
                    <button data-role="button" id="newbtn">New</button>
                </form>
                <ul id="accountlist" data-inset="true" data-role="listview" 
                    data-theme="c" data-dividertheme="b">
                </ul>
            </div>
            <div data-role="footer">
                <h4>Force.com</h4>
            </div>
        </div>
        <div data-role="page" data-theme="b" id="detailpage">
            <div data-role="header">
                <h1>Account Detail</h1>
{'fraction_non_alphanumeric': 0.10783390100731938, 'fraction_numerical': 0.0057975215595333, 'mean_word_length': 1.6391279403327597, 'pattern_counts': {'":': 0, '<': 135, '<?xml version=': 0, '>': 135, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4350372', 'n_tokens_mistral': 3605, 'n_tokens_neox': 3343, 'n_words': 987}