Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

init commit for Sencha Workshop

  • Loading branch information...
commit 5ec604c00fa37dac5be91c0d759bc5278bf45824 1 parent 8b814e8
@SidneyAllen SidneyAllen authored
View
17 Sencha-Workshop-March2011/OlympicsDonation/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>Olympic Donation</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.aptana.ide.core.unifiedBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.aptana.ide.project.nature.web</nature>
+ </natures>
+</projectDescription>
View
101 Sencha-Workshop-March2011/OlympicsDonation/.tmp_index.html.60107~
@@ -0,0 +1,101 @@
+<!DOCTYPE HTML>
+<html >
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>New Web Project</title>
+ <!-- Sencha Touch CSS -->
+ <link rel="stylesheet" href="../sencha-touch-1.0.1a/resources/css/sencha-touch.css" type="text/css">
+
+ <!-- Custom CSS -->
+ <link rel="stylesheet" href="style.css" type="text/css">
+
+ <!-- Google Maps JS -->
+ <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
+
+ <!-- Sencha Touch JS -->
+ <script type="text/javascript" src="../sencha-touch-1.0.1a/sencha-touch-debug.js"></script>
+
+ <!-- Application JS -->
+ <!--
+ <script type="text/javascript" src="main.js"></script>
+ -->
+
+ <script type="text/javascript">
+
+ new Ext.Application({
+ launch: function() {
+
+ var makeAjaxRequest = function() {
+ Ext.getBody().mask('Loading...', 'x-mask-loading', false);
+ Ext.Ajax.request({
+ url: '../jquery.mobile-1.0a3/ReviewOrder2.cfm',
+ success: function(response, opts) {
+ // Ext.getCmp('content').update(response.responseText);
+ window.location.href = response.responseText;
+ // Ext.getCmp('status').setTitle('Static test.json file loaded');
+ // Ext.getBody().unmask();
+ }
+ });
+ };
+
+ var middle = {
+ dock:"top",
+ style:"background-color:#e2e2e2",
+ title:"Yellow",
+ html:"Hello Sencha"
+ }
+
+ var resetButton = new Ext.Button({
+ text:"Shout",
+ ui:"round",
+ handler: makeAjaxRequest,
+ width:100
+ })
+
+ var bottom = {
+ dock:"bottom",
+ style:"background-color:#333333",
+ title:"bottom",
+ html:"",
+ items:[resetButton]
+ }
+
+ var settings = {
+ text:"Settings",
+ ui:"round",
+ xtype:"button"
+ }
+
+
+
+ var header = new Ext.Toolbar({
+ dock:"top",
+ style:"background-color:#E2e2e2",
+ title:"Welcome",
+ items:[settings]
+ })
+
+
+ new Ext.Panel({
+ fullscreen: true,
+ id: 'content',
+ layout:{type:"vbox",
+ align:"stretch",
+ pack:"end"},
+ defaults:{flex:1},
+ cardSwitchAnimation:{type:"slide",duration:500},
+ items:[middle],
+ dockedItems: [header,bottom]
+ });
+
+
+ }
+ });
+
+ </script>
+
+ </head>
+ <body>
+
+ </body>
+</html>
View
26 Sencha-Workshop-March2011/OlympicsDonation/.tmp_index.html.92354~
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML>
+<html >
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>New Web Project</title>
+ <!-- Sencha Touch CSS -->
+ <link rel="stylesheet" href="../sencha-touch-1.0.1a/resources/css/sencha-touch.css" type="text/css">
+
+ <!-- Custom CSS -->
+ <link rel="stylesheet" href="style.css" type="text/css">
+
+ <!-- Google Maps JS -->
+ <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
+
+ <!-- Sencha Touch JS -->
+ <script type="text/javascript" src="../sencha-touch-1.0.1a/sencha-touch-debug.js"></script>
+
+ <!-- Application JS -->
+
+ <script type="text/javascript" src="main.js"></script>
+
+ </head>
+ <body>
+hello
+ </body>
+</html>
View
83 Sencha-Workshop-March2011/OlympicsDonation/.tmp_index.html.97372~
@@ -0,0 +1,83 @@
+<!DOCTYPE HTML>
+<html >
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Olympics</title>
+ <!-- Sencha Touch CSS -->
+ <link rel="stylesheet" href="../sencha-touch-1.0.1a/resources/css/sencha-touch.css" type="text/css">
+
+ <!-- Custom CSS -->
+ <link rel="stylesheet" href="style.css" type="text/css">
+
+
+
+ <!-- Sencha Touch JS -->
+ <script type="text/javascript" src="../sencha-touch-1.0.1a/sencha-touch-debug.js"></script>
+
+ <!-- Application JS -->
+
+ <script >
+
+ new Ext.Application({
+ launch: function() {
+
+ var makeAjaxRequest = function() {
+ Ext.getBody().mask('Loading...', 'x-mask-loading', true);
+ Ext.Ajax.request({
+ url: 'Order.cfm',
+ success: function(response, opts) {
+ // redirect to PayPal with Token
+ window.location.href = response.responseText;
+ }
+ });
+ };
+
+ var buyButton = new Ext.Button({
+ text:"Donate $10",
+ ui:"round",
+ handler: makeAjaxRequest,
+ width:150,
+ })
+
+
+ var middle = {
+ dock:" middle",
+ style:"background-color:#e2e2e2",
+ html:"<img src='images/1329_Olympics_40.jpg'>",
+ items: [buyButton]
+
+ }
+
+
+ var header = new Ext.Toolbar({
+ dock:"top",
+ style:"background-color:#E2e2e2",
+ title:"Olympics 2012"
+ })
+
+
+ new Ext.Panel({
+ fullscreen: true,
+ id: 'content',
+ layout:{type:"vbox",
+ align:"stretch",
+ pack:"end"},
+ defaults:{flex:1},
+ cardSwitchAnimation:{type:"slide",duration:500},
+ items:[middle],
+ dockedItems: [header]
+ });
+
+
+ }
+});
+
+
+
+
+ </script>
+
+ </head>
+ <body>
+ </body>
+</html>
View
53 Sencha-Workshop-March2011/OlympicsDonation/APIError.cfm
@@ -0,0 +1,53 @@
+<!--
+*************************************************
+APIError.cfm
+
+Displays error parameters.
+
+Called by DoDirectPaymentReceipt.cfm, TransactionDetails.cfm,
+GetExpressCheckoutDetails.cfm and DoExpressCheckoutPayment.cfm.
+
+*************************************************
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+ <title>PayPal SDK - DoAuthorization</title>
+ <link href="sdk.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<cfset responseStruct = #Session.resStruct#>
+<cfif #URL.error# is "fromClient">
+<center>
+ <table class="api">
+ <tr>
+ <td class="field">
+ Error Type :</td>
+ <td><CFOUTPUT>#responseStruct.errorType#</CFOUTPUT></td>
+ </tr>
+ <tr>
+ <td class="field">
+ Error Message :</td>
+ <td><CFOUTPUT>#responseStruct.errorMessage#</CFOUTPUT></td>
+ </tr>
+ </table>
+</center>
+</cfif>
+
+<cfif #URL.error# is "fromServer">
+<center>
+<table class="api">
+<b>The PayPal API has returned an error!</b>
+ <cfloop collection=#responseStruct# item="key">
+ <tr>
+ <td><CFOUTPUT>#key#:</CFOUTPUT></td>
+ <td><CFOUTPUT>#responseStruct[key]#</CFOUTPUT></td>
+ </tr>
+ </cfloop>
+</table>
+</center>
+</cfif>
+</body>
+<a class="home" id="CallsLink" href="index.html">Home</a>
+
+</html>
View
69 Sencha-Workshop-March2011/OlympicsDonation/Application.cfm
@@ -0,0 +1,69 @@
+<!--- This Page contains all necessary application level variables --->
+<cfapplication name="coldfusion_nvp_samples"
+ sessionmanagement="Yes">
+<CFFUNCTION name="displayText" returntype="void" output="Yes">
+<cfargument name="requestData" type="struct" required="yes">
+<cfloop collection=#responseStruct# item ="key">
+
+ <tr>
+ <td >#key#:</td>
+ <td >#responseStruct[key]#</td>
+
+ </tr>
+</cfloop>
+</CFFUNCTION>
+<!---
+This file defines the parameters needed to make an API call.
+PayPal includes the following API Signature for making API
+calls to the PayPal sandbox:
+
+API Username sdk-three_api1.sdk.com
+API Password QFZCWN5HZM8VBG7Q
+API Signature A.d9eRKfd1yVkRrtmMfCFLTqa6M9AyodL0SJkhYztxUi8W9pCXF6.4NI
+ --->
+<cfset serverURL = "https://api-3t.sandbox.paypal.com/nvp">
+
+ <!--- SUBJECT to be uncommented for UNIPAY all the other credentials like API username,
+ password,signature can be commented for UNIPAY
+ To enable Payments for Third Party Email whcih will be passed along with Partner's 3token credentials
+ uncomment both subject and 3 token credentials.
+ --->
+ <!--- <cfset SUBJECT="sdk-three@sdk.com"> --->
+ <cfset APIuserName = "sdk-three_api1.sdk.com">
+ <cfset APIPassword = "QFZCWN5HZM8VBG7Q">
+ <cfset APISignature = "A.d9eRKfd1yVkRrtmMfCFLTqa6M9AyodL0SJkhYztxUi8W9pCXF6.4NI">
+<!--- condition to check if it is UNIPAY --->
+<cfif isdefined("SUBJECT") && (isdefined("APIuserName") eq "false" &&isdefined("APIPassword") eq "false" &&isdefined("APISignature") eq "false")>
+ <cfset UNIPAYSUBJECT="#SUBJECT#">
+ <cfset USERNAME = "">
+ <cfset PASSWORD = "">
+ <cfset SIGNATURE = "">
+</cfif>
+<!--- condition to check if it is Payments for Third Party Email--->
+<cfif isdefined("SUBJECT") && isdefined("APIuserName") &&isdefined("APIPassword") &&isdefined("APISignature")>
+ <cfset UNIPAYSUBJECT="#SUBJECT#">
+ <cfset USERNAME = "#APIuserName#">
+ <cfset PASSWORD = "#APIPassword#">
+ <cfset SIGNATURE = "#APISignature#">
+</cfif>
+<!--- condition to check if it is 3 token credentials --->
+<cfif isdefined("SUBJECT") eq "false" && isdefined("APIuserName") &&isdefined("APIPassword") &&isdefined("APISignature")>
+ <cfset UNIPAYSUBJECT="">
+ <cfset USERNAME = "#APIuserName#">
+ <cfset PASSWORD = "#APIPassword#">
+ <cfset SIGNATURE = "#APISignature#">
+</cfif>
+<cfset PayPalURL = "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=">
+<cfset version = "65.1">
+
+<!--- By default the API requests doesn't go through proxy. To route the requests through a proxy server set "useProxy" value as "true" and set values for proxyName and proxyPort. Set proxyName with
+ the Host Name or the IP address of the proxy server. proxyPort should be a valid port number.
+ eg:
+ <cfset useProxy = "true">
+ <cfset proxyName = "127.0.0.1">
+ <cfset proxyPort = "8081">--->
+
+
+<cfset useProxy = "false">
+<cfset proxyName = "">
+<cfset proxyPort = "">
View
133 Sencha-Workshop-March2011/OlympicsDonation/CallerService.cfc
@@ -0,0 +1,133 @@
+<!--
+*************************************************
+CallerService.cfc
+
+This coldufion component reused by all sample page to get credential information and
+it has getNVPResponse method which takes nvpString as parameter and return Nvpresponse
+as CF Struct object. using this object we can pring the response values in Display.cfm page
+
+*************************************************
+--->
+<CFCOMPONENT>
+
+ <!---
+ This method will take response from the server and display accordingly in the browser
+ --->
+ <cffunction name="getNVPResponse" access="public" returntype="struct">
+ <cfargument name="nvpString" type="string" required="yes" >
+ <cfset var responseStruct = StructNew()>
+ <cfset var keyValStruct = StructNew()>
+ <cfset var keys = "">
+ <cfset var Values = "">
+ <cfset nvpArray = ArrayNew(1) >
+ <cfset keyArray = ArrayNew(1) >
+ <cfset valueArray = ArrayNew(1) >
+ <cfset key = "">
+ <cfset value = "">
+ <cfset currentValue = "">
+ <cfset tempVal = "">
+ <cfset count = 1 >
+ <cfset tempvalue = "">
+ <cfset lennvp = 0>
+
+ <cfloop from="1" to="#len(nvpString)#" index="i">
+ <cfset lennvp = lennvp + 1>
+ <cfset index = 1>
+ <cfif #Mid(nvpString, i, 1)# is not "&">
+ <cfset tempVal = tempVal & #Mid(nvpString, i, 1)#>
+ </cfif>
+
+ <cfif #Mid(nvpString, i, 1)# is "&" OR "#lennvp#" is "#len(nvpString)#">
+ <cfset nvpArray[count] = #trim(tempVal)#>
+ <cfset count = count + 1>
+
+ <cfset tempVal = "">
+
+ </cfif>
+ </cfloop>
+ <cfloop from="1" to="#ArrayLen(nvpArray)#" index="i">
+ <cfset currentValue = #nvpArray[i]#>
+
+ <cfloop from="1" to= "#len(currentValue)#" index="i">
+ <cfif #Mid(currentValue, i, 1)# is "=">
+ <cfbreak>
+ <cfelse>
+ <cfset tempValue = tempValue & #Mid(currentValue, i, 1)#>
+
+ </cfif>
+ </cfloop>
+ <cfset keyArray[index] = #trim(tempValue)#>
+ <cfset index = #index# + 1>
+ <cfset tempValue = "">
+ </cfloop>
+
+ <cfset vals = "">
+ <cfset key = "">
+ <cfloop from="1" to="#ArrayLen(nvpArray)#" index="i">
+ <cfset vals = #nvpArray[i]# >
+ <cfset key = #keyArray[i]#>
+ <cfset value = #RemoveChars(vals ,1, (len(key) +1))#>
+ <cfset valueArray[i] = value>
+ <cfset x = StructInsert(responseStruct,#trim(key)#,#trim(value)#)>
+
+ </cfloop>
+ <cfreturn responseStruct>
+ </cffunction>
+
+ <!---
+ This method has following parameters
+ Request Data - Hold the NVP request String
+ ServerURL - End Point
+ useProxy - If Merchant wants to use proxy need to setuseProxyas true in Application.cfm.
+ By defaultuseProxyset to false
+ proxyName - need to pass proxy hostName
+ proxyPort - need to pass proxy port name
+ --->
+
+ <cffunction name="doHttppost" access="public" returntype="string">
+ <cfargument name="requestData" type="struct" required="yes" >
+ <cfargument name="serverURL" type="string" required="yes" >
+ <cfargument name="useProxy" type="boolean" required="yes" >
+ <cfargument name="proxyName" type="string" required="no" >
+ <cfargument name="proxyPort" type="string" required="no" >
+
+ <cfif useProxy is "true">
+ <CFHTTP URL="#serverURL#" METHOD="POST" proxyserver=#proxyName# proxyport="#proxyPort#">
+ <cfloop collection=#requestData# item="key">
+ <CFHTTPPARAM NAME="#key#" VALUE="#requestData[key]#" TYPE="FormField" ENCODED="YES">
+ </cfloop>
+ </CFHTTP>
+ <cfelse>
+ <CFHTTP URL="#serverURL#" METHOD="POST">
+ <cfloop collection=#requestData# item="key">
+ <CFHTTPPARAM NAME="#key#" VALUE="#requestData[key]#" TYPE="FormField" ENCODED="YES">
+ </cfloop>
+ </CFHTTP>
+ </cfif>
+ <cfreturn #cfhttp.FileContent#>
+ </cffunction>
+
+ <!---
+ This is method check whether note and uniqueid is null or not
+ if it is null, it will create empty object
+ --->
+ <cffunction name="populateEmptyValue" returntype="array" output="no">
+ <cfargument name="noteORuid" type="any" required="true">
+ <cfargument name="size" type="any" required="true">
+ <cfif ArrayIsEmpty(noteORuid)>
+ <cfloop index = "i" from = "1" to = #size#>
+ <cfset noteORuid[i] = "">
+ </cfloop>
+ <cfelse>
+ <cfloop index = "i" from = "1" to = #size#>
+ <cfif ArrayLen(noteORuid) not equal size>
+ <cfscript>
+ ArrayAppend(noteORuid, "");
+ </cfscript>
+ </cfif>
+ </cfloop>
+ </cfif>
+ <cfreturn #noteORuid#>
+ </cffunction>
+
+</CFCOMPONENT>
View
72 Sencha-Workshop-March2011/OlympicsDonation/Checkout.cfm
@@ -0,0 +1,72 @@
+<cfsilent>
+<CFTRY>
+ <cfset PayPalURL = "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout-mobile&useraction=commit&token=">
+
+ <cfset StructClear(Session)>
+ <cfset serverName = #SERVER_NAME#>
+ <cfset serverPort = #CGI.SERVER_PORT#>
+ <cfset contextPath = GetDirectoryFromPath(#SCRIPT_NAME#)>
+ <cfset protocol = #CGI.SERVER_PROTOCOL#>
+ <cfset cancelUrlPath = "http://" & serverName & ":" & serverPort & contextPath & "index.html">
+ <CFOBJECT COMPONENT="CallerService" name="caller">
+
+ <!---
+ Passing necessary parameter to perform Setexpresscheckout transaction in the CFHTTP Tag
+ --->
+
+ <CFSET requestData = StructNew()>
+ <CFSET requestData.METHOD = "DoExpressCheckoutPayment">
+ <CFSET requestData.PAYMENTACTION = "Sale">
+ <CFSET requestData.USER = "sidney_1300905880_biz_api1.designovermatter.com">
+ <CFSET requestData.PWD = "1300905887">
+ <CFSET requestData.SIGNATURE = "AW-FVgPul9bWu29OhQHbSoMS0KjiA4WshXplWg9c1DDISeYDYNfNi0dr">
+ <CFSET requestData.VERSION = "69.0">
+ <CFSET requestData.DESC = "Donation">
+ <CFSET requestData.AMT = "10.00">
+
+ <cfset requestData.TOKEN = URL.TOKEN>
+ <cfset requestData.PAYERID = URL.PAYERID>
+
+
+ <!---
+ Calling "DoExpressCheckoutPayment" doHttppost for API call
+ --->
+
+ <cfinvoke component="CallerService" method="doHttppost" returnvariable="response">
+ <cfinvokeargument name="requestData" value=#requestData#>
+ <cfinvokeargument name="serverURL" value=#serverURL#>
+ <cfinvokeargument name="proxyName" value=#proxyName#>
+ <cfinvokeargument name="proxyPort" value=#proxyPort#>
+ <cfinvokeargument name="useProxy" value=#useProxy#>
+ </cfinvoke>
+
+ <cfset responseStruct = caller.getNVPResponse(#URLDecode(response)#)>
+
+ <cfset Session.resStruct = #responseStruct#>
+
+ <cfif responseStruct.Ack is not "Success">
+ <cfthrow>
+ <cfelse>
+ <cfset returnUrlPath = "http://" & serverName & ":" & serverPort & contextPath & "index.html?TOKEN=" & responseStruct.TOKEN>
+ </cfif>
+
+ <!--- redirect back to Sencha App --->
+ <cflocation url="#returnUrlPath#" addtoken="yes">
+
+
+<CFCATCH>
+
+ <cfset responseStruct = StructNew() >
+ <cfset responseStruct.errorType = "#cfcatch.type#">
+ <cfset responseStruct.errorMessage = "#cfcatch.message#">
+ <cfset Session.resStruct = "#responseStruct#">
+ <cfset urlPath = "APIError.cfm?error=formServer&&errorType=Server&errorMessage=">
+
+
+ <CFLOCATION URL="#urlPath#">
+
+</CFCATCH>
+</CFTRY>
+
+</cfsilent>
+
View
67 Sencha-Workshop-March2011/OlympicsDonation/Order.cfm
@@ -0,0 +1,67 @@
+<cfsilent>
+<CFTRY>
+ <cfset PayPalURL = "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout-mobile&useraction=commit&token=">
+
+ <cfset StructClear(Session)>
+ <cfset serverName = #SERVER_NAME#>
+ <cfset serverPort = #CGI.SERVER_PORT#>
+ <cfset contextPath = GetDirectoryFromPath(#SCRIPT_NAME#)>
+ <cfset protocol = #CGI.SERVER_PROTOCOL#>
+ <cfset cancelUrlPath = "http://" & serverName & ":" & serverPort & contextPath & "index.html">
+
+ <CFOBJECT COMPONENT="CallerService" name="caller">
+
+ <!---
+ Passing necessary parameter to perform Setexpresscheckout transaction in the CFHTTP Tag
+ --->
+
+ <CFSET requestData = StructNew()>
+ <CFSET requestData.METHOD = "SetExpressCheckout">
+ <CFSET requestData.PAYMENTACTION = "Sale">
+ <CFSET requestData.USER = "sidney_1300905880_biz_api1.designovermatter.com">
+ <CFSET requestData.PWD = "1300905887">
+ <CFSET requestData.SIGNATURE = "AW-FVgPul9bWu29OhQHbSoMS0KjiA4WshXplWg9c1DDISeYDYNfNi0dr">
+ <CFSET requestData.VERSION = "69.0">
+ <CFSET requestData.DESC = "Donation">
+ <CFSET requestData.AMT = "10.00">
+
+
+ <CFSET requestData.CancelURL = "#cancelUrlPath#">
+ <cfset returnUrlPath = "http://" & serverName & contextPath & "Checkout.cfm" >
+ <CFSET requestData.ReturnURL = "#returnUrlPath#">
+
+ <!---
+ Calling "SetExpressCheckout" doHttppost for API call
+ --->
+
+ <cfinvoke component="CallerService" method="doHttppost" returnvariable="response">
+ <cfinvokeargument name="requestData" value=#requestData#>
+ <cfinvokeargument name="serverURL" value=#serverURL#>
+ <cfinvokeargument name="proxyName" value=#proxyName#>
+ <cfinvokeargument name="proxyPort" value=#proxyPort#>
+ <cfinvokeargument name="useProxy" value=#useProxy#>
+ </cfinvoke>
+
+ <cfset responseStruct = caller.getNVPResponse(#URLDecode(response)#)>
+
+ <cfset Session.resStruct = #responseStruct#>
+
+ <cfif responseStruct.Ack is not "Success">
+ <cfthrow>
+ <cfelse>
+ <CFSET TOKEN = #responseStruct.TOKEN#>
+ </cfif>
+
+ <!--- set the URL for the JavaScript Redirect from the Sencha App --->
+ <CFSET redirecturl = #PayPalURL# & #TOKEN#>
+
+
+<CFCATCH>
+ <!--- catch the error here --->
+
+</CFCATCH>
+</CFTRY>
+
+</cfsilent>
+<cfif responseStruct.Ack is not "Success">APIError.cfm?error=fromServer<cfabort></cfif>
+<cfoutput>#redirecturl#</cfoutput>
View
BIN  Sencha-Workshop-March2011/OlympicsDonation/images/1329_Olympics_40.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
17 Sencha-Workshop-March2011/OlympicsDonation/index.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<html >
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Olympics</title>
+ <!-- Sencha Touch CSS -->
+ <link rel="stylesheet" href="../sencha-touch-1.0.1a/resources/css/sencha-touch.css" type="text/css">
+
+ <!-- Sencha Touch JS -->
+ <script type="text/javascript" src="../sencha-touch-1.0.1a/sencha-touch-debug.js"></script>
+
+ <!-- Application JS -->
+ <script type="text/javascript" src="js/main.js"></script>
+ </head>
+ <body>
+ </body>
+</html>
View
54 Sencha-Workshop-March2011/OlympicsDonation/js/main.js
@@ -0,0 +1,54 @@
+
+ new Ext.Application({
+ launch: function() {
+
+ var makeAjaxRequest = function() {
+ Ext.getBody().mask('Loading...', 'x-mask-loading', true);
+ Ext.Ajax.request({
+ url: 'Order.cfm',
+ success: function(response, opts) {
+ // redirect to PayPal with Token
+ window.location.href = response.responseText;
+ }
+ });
+ };
+
+ var donateButton = new Ext.Button({
+ text:"Donate $10",
+ ui:"round",
+ handler: makeAjaxRequest,
+ width:150,
+ })
+
+
+ var middle = {
+ dock:" middle",
+ style:"background-color:#e2e2e2",
+ html:"<img src='images/1329_Olympics_40.jpg'>",
+ items: [donateButton]
+
+ }
+
+
+ var header = new Ext.Toolbar({
+ dock:"top",
+ style:"background-color:#E2e2e2",
+ title:"Olympics 2012"
+ })
+
+
+ new Ext.Panel({
+ fullscreen: true,
+ id: 'content',
+ layout:{type:"vbox",
+ align:"stretch",
+ pack:"end"},
+ defaults:{flex:1},
+ cardSwitchAnimation:{type:"slide",duration:500},
+ items:[middle],
+ dockedItems: [header]
+ });
+
+
+ }
+});
View
BIN  Sencha-Workshop-March2011/SenchaBYOL-PayPal.pptx
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.