├── .gitattributes
├── .github
└── workflows
│ └── checkmarxone.yml
├── .gitignore
├── README.md
├── examples
├── README.md
├── bootstrap
│ ├── README.md
│ ├── action-center.html
│ ├── donate.html
│ ├── index.html
│ ├── js
│ │ ├── luminateExtend-examples.js
│ │ ├── luminateExtend.js
│ │ ├── respond.proxy.gif
│ │ └── respond.proxy.js
│ ├── sign-up.html
│ └── walk-for-health.html
└── foundation
│ ├── README.md
│ ├── action-center.html
│ ├── donate.html
│ ├── index.html
│ ├── js
│ ├── luminateExtend-examples.js
│ └── luminateExtend.js
│ ├── sign-up.html
│ └── walk-for-health.html
├── luminateExtend.js
├── luminateExtend.min.js
├── luminateExtend_server.html
├── src
├── luminateExtend.js
└── luminateExtend_server.html
└── test
├── README.md
├── api.html
├── global.html
├── init.html
├── js
├── api.js
├── global.js
├── init.js
├── luminateExtend.js
├── setup.js
└── utils.js
└── utils.html
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/.github/workflows/checkmarxone.yml:
--------------------------------------------------------------------------------
1 | name: Checkmarx AST Github Action
2 | on:
3 | push:
4 | branches:
5 | - main
6 | - master
7 |
8 |
9 | jobs:
10 | build:
11 | runs-on: ubuntu-latest
12 | steps:
13 | - name: Checkout
14 | uses: actions/checkout@v4
15 | - name: Checkmarx AST Github Action
16 | uses: Checkmarx/ast-github-action@2.0.36
17 | with:
18 | base_uri: https://us.ast.checkmarx.net
19 | cx_tenant: blackbaud
20 | cx_client_id: ${{ secrets.CX_CLIENT_ID }}
21 | cx_client_secret: ${{ secrets.CX_CLIENT_SECRET }}
22 | project_name: luminateExtend
23 | branch: ${{ github.head_ref || github.ref }}
24 | #github_token: # optional, default is ${{ github.token }}
25 | additional_params: --async --project-groups CustomerSuccess --sast-preset-name "BlackbaudSAST" --sast-filter !cvs,!.svn,!.hg,!.git,!.bzr,!bin,!obj,!backup,!.idea,!node_modules,!**/*.test/**,!**/tests/**,!**/*.Test/**,!**/Tests/**,!**/*.ITests/**,!**/*.UnitTests/**,!**/UnitTests/**,!**/*.Steps/**,!**/*.TestTools/**,!**/SpecFlow.*/**,!**/SpecFlow.*.nupkg,!**/SpecRun.Runner.*/**,!**/SpecRun.Runner,!.UnitTests,!**/*.DS_Store,!**/*.ipr,!**/*.iws,!**/*.bak,!**/*.tmp,!**/*.aac,!**/*.aif,!**/*.iff,!**/*.m3u,!**/*.mid,!**/*.mp3,!**/*.mpa,!**/*.ra,!**/*.wav,!**/*.wma,!**/*.3g2,!**/*.3gp,!**/*.asf,!**/*.asx,!**/*.avi,!**/*.flv,!**/*.mov,!**/*.mp4,!**/*.mpg,!**/*.rm,!**/*.swf,!**/*.vob,!**/*.wmv,!**/*.bmp,!**/*.gif,!**/*.jpg,!**/*.png,!**/*.psd,!**/*.tif,!**/*.swf,!**/*.jar,!**/*.zip,!**/*.rar,!**/*.exe,!**/*.dll,!**/*.pdb,!**/*.7z,!**/*.gz,!**/*.tar.gz,!**/*.tar,!**/*.gz,!**/*.ahtm,!**/*.ahtml,!**/*.fhtml,!**/*.hdm,!**/*.hdml,!**/*.hsql,!**/*.ht,!**/*.hta,!**/*.htc,!**/*.htd,!**/*.war,!**/*.ear,!**/*.htmls,!**/*.ihtml,!**/*.mht,!**/*.mhtm,!**/*.mhtml,!**/*.ssi,!**/*.stm,!**/*.stml,!**/*.ttml,!**/*.txn,!**/*.xhtm,!**/*.xhtml,!**/*.class,!**/*.iml
26 | repo_name: ${{ github.event.repository.name }}
27 | #namespace: # optional, default is ${{ github.repository_owner }}
28 | #pr_number: # optional, default is ${{ github.event.number }}
29 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #################
2 | ## Eclipse
3 | #################
4 |
5 | *.pydevproject
6 | .project
7 | .metadata
8 | bin/
9 | tmp/
10 | *.tmp
11 | *.bak
12 | *.swp
13 | *~.nib
14 | local.properties
15 | .classpath
16 | .settings/
17 | .loadpath
18 |
19 | # External tool builders
20 | .externalToolBuilders/
21 |
22 | # Locally stored "Eclipse launch configurations"
23 | *.launch
24 |
25 | # CDT-specific
26 | .cproject
27 |
28 | # PDT-specific
29 | .buildpath
30 |
31 |
32 | #################
33 | ## Visual Studio
34 | #################
35 |
36 | ## Ignore Visual Studio temporary files, build results, and
37 | ## files generated by popular Visual Studio add-ons.
38 |
39 | # User-specific files
40 | *.suo
41 | *.user
42 | *.sln.docstates
43 |
44 | # Build results
45 | [Dd]ebug/
46 | [Rr]elease/
47 | *_i.c
48 | *_p.c
49 | *.ilk
50 | *.meta
51 | *.obj
52 | *.pch
53 | *.pdb
54 | *.pgc
55 | *.pgd
56 | *.rsp
57 | *.sbr
58 | *.tlb
59 | *.tli
60 | *.tlh
61 | *.tmp
62 | *.vspscc
63 | .builds
64 | *.dotCover
65 |
66 | ## TODO: If you have NuGet Package Restore enabled, uncomment this
67 | #packages/
68 |
69 | # Visual C++ cache files
70 | ipch/
71 | *.aps
72 | *.ncb
73 | *.opensdf
74 | *.sdf
75 |
76 | # Visual Studio profiler
77 | *.psess
78 | *.vsp
79 |
80 | # ReSharper is a .NET coding add-in
81 | _ReSharper*
82 |
83 | # Installshield output folder
84 | [Ee]xpress
85 |
86 | # DocProject is a documentation generator add-in
87 | DocProject/buildhelp/
88 | DocProject/Help/*.HxT
89 | DocProject/Help/*.HxC
90 | DocProject/Help/*.hhc
91 | DocProject/Help/*.hhk
92 | DocProject/Help/*.hhp
93 | DocProject/Help/Html2
94 | DocProject/Help/html
95 |
96 | # Click-Once directory
97 | publish
98 |
99 | # Others
100 | [Bb]in
101 | [Oo]bj
102 | sql
103 | TestResults
104 | *.Cache
105 | ClientBin
106 | stylecop.*
107 | ~$*
108 | *.dbmdl
109 | Generated_Code #added for RIA/Silverlight projects
110 |
111 | # Backup & report files from converting an old project file to a newer
112 | # Visual Studio version. Backup files are not needed, because we have git ;-)
113 | _UpgradeReport_Files/
114 | Backup*/
115 | UpgradeLog*.XML
116 |
117 |
118 |
119 | ############
120 | ## Windows
121 | ############
122 |
123 | # Windows image file caches
124 | Thumbs.db
125 |
126 | # Folder config file
127 | Desktop.ini
128 |
129 |
130 | #############
131 | ## Python
132 | #############
133 |
134 | *.py[co]
135 |
136 | # Packages
137 | *.egg
138 | *.egg-info
139 | dist
140 | build
141 | eggs
142 | parts
143 | bin
144 | var
145 | sdist
146 | develop-eggs
147 | .installed.cfg
148 |
149 | # Installer logs
150 | pip-log.txt
151 |
152 | # Unit test / coverage reports
153 | .coverage
154 | .tox
155 |
156 | #Translations
157 | *.mo
158 |
159 | #Mr Developer
160 | .mr.developer.cfg
161 |
162 | # Mac crap
163 | .DS_Store
164 |
--------------------------------------------------------------------------------
/examples/README.md:
--------------------------------------------------------------------------------
1 | luminateExtend.js - Examples
2 | ============================
3 |
4 | Together, the examples provided here represent a very basic sample website for the fictitious organization American Health Society.
5 | Two versions of the examples are available for your perusal — one built with
6 | [Bootstrap 3](https://github.com/convio/luminateExtend/tree/master/examples/bootstrap/), and one with
7 | [Foundation 4](https://github.com/convio/luminateExtend/tree/master/examples/foundation/).
--------------------------------------------------------------------------------
/examples/bootstrap/action-center.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | American Health Society Action Center
6 |
7 |
8 |
9 |
15 |
16 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
65 |
66 |
67 |
70 |
Become an advocate for health!
71 |
72 | Loading ...
73 |
74 |
75 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
89 |
90 |
--------------------------------------------------------------------------------
/examples/bootstrap/donate.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Donate to American Health Society
6 |
7 |
8 |
9 |
23 |
24 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
73 |
74 |
75 |
78 |
You can be a part of the solution – make a donation to help fund important research. We can't do it without you.
79 |
315 |
316 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
--------------------------------------------------------------------------------
/examples/bootstrap/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | American Health Society
6 |
7 |
8 |
9 |
15 |
16 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
65 |
66 |
67 |
68 |
Your Donation Today Can Save Countless Lives
69 |
You can be a part of the solution – make a donation to help fund important research. We can't do it without you.
70 |
Donate Now »
71 |
72 |
73 |
74 |
75 |
76 |
Get AHS News
77 |
Sign up today to receive the American Health Society's weekly e-newsletter.
78 |
Sign Up »
79 |
80 |
81 |
Action Center
82 |
Become an advocate for health! View the list of our latest action alerts.
83 |
Take Action »
84 |
85 |
86 |
Walk for Health
87 |
Form a team in the Walk for Health and help raise money for our important mission.
88 |
Find an Event »
89 |
90 |
91 |
92 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/examples/bootstrap/js/luminateExtend-examples.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 | /* define init variables for your organization */
3 | luminateExtend({
4 | apiKey: '123456789',
5 | path: {
6 | nonsecure: 'http://shortname.convio.net/site/',
7 | secure: 'https://secure2.convio.net/shortname/site/'
8 | }
9 | });
10 |
11 | $(function() {
12 | /* example: get information on the currently logged in user, and display a "welcome back" message in the site's header */
13 | window.getUser = function() {
14 | var getUserCallback = function(data) {
15 | if(data.getConsResponse && data.getConsResponse.name) {
16 | $('#login-form').replaceWith('' +
17 | 'Welcome back' + ((data.getConsResponse.name.first) ? (', ' + data.getConsResponse.name.first) : '') + '! ' +
18 | 'Logout ' +
19 | '
');
20 | }
21 | };
22 | luminateExtend.api({
23 | api: 'cons',
24 | callback: getUserCallback,
25 | data: 'method=getUser',
26 | requiresAuth: true
27 | });
28 | };
29 |
30 | /* example: check if the user is logged in onload */
31 | /* if they are logged in, call the getUser function above to display the "welcome back" message */
32 | /* if they are not logged in, show the login form */
33 | var loginTestCallback = {
34 | success: function() {
35 | getUser();
36 | },
37 | error: function() {
38 | $('#login-form').removeClass('hide');
39 | }
40 | };
41 | luminateExtend.api({
42 | api: 'cons',
43 | callback: loginTestCallback,
44 | data: 'method=loginTest'
45 | });
46 |
47 | /* example: handle the login form in the site's header */
48 | /* if the user is logged in successfully, call the getUser function above to display the "welcome back" message */
49 | /* if the user is not logged in, display the error message returned by the API in a modal */
50 | window.loginCallback = {
51 | error: function(data) {
52 | if($('#login-error-modal').length == 0) {
53 | $('body').append('' +
54 | '
' +
55 | '
' +
56 | '' +
60 | '
' +
61 | '
' + data.errorResponse.message + '
' +
62 | '
' +
63 | '' +
66 | '
' +
67 | '
' +
68 | '
');
69 | }
70 | else {
71 | $('#login-error-modal .modal-body p').html(data.errorResponse.message);
72 | }
73 | $('#login-error-modal').modal('show');
74 | },
75 | success: function(data) {
76 | getUser();
77 | }
78 | };
79 |
80 | /* UI handlers for the donation form example */
81 | if($('.donation-form').length > 0) {
82 | $('input[name="level_id"]').click(function() {
83 | if($(this).is('#level-other')) {
84 | $('#other-amount').removeAttr('disabled');
85 | $('#other-amount').attr('name', 'other_amount');
86 | $('#other-amount').focus();
87 | }
88 | else {
89 | $('#other-amount').attr('disabled', 'disabled');
90 | $('#other-amount').removeAttr('name');
91 | }
92 | });
93 |
94 | $('.donation-form').submit(function() {
95 | window.scrollTo(0, 0);
96 | $(this).hide();
97 | $(this).before('' +
98 | 'Loading ...' +
99 | '
');
100 | });
101 | }
102 |
103 | /* example: handle the donation form submission */
104 | /* if the donation is successful, display a thank you message */
105 | /* if there is an error with the donation, display it inline */
106 | window.donateCallback = {
107 | error: function(data) {
108 | $('#donation-errors').remove();
109 |
110 | $('.donation-form').prepend('' +
111 | '
' +
112 | data.errorResponse.message +
113 | '
' +
114 | '
');
115 |
116 | $('.donation-loading').remove();
117 | $('.donation-form').show();
118 | },
119 | success: function(data) {
120 | $('#donation-errors').remove();
121 |
122 | if(data.donationResponse.errors) {
123 | $('.donation-form').prepend('' +
124 | ((data.donationResponse.errors.message) ? ('
' +
125 | data.donationResponse.errors.message +
126 | '
') : '') +
127 | '
');
128 |
129 | if(data.donationResponse.errors.fieldError) {
130 | var fieldErrors = luminateExtend.utils.ensureArray(data.donationResponse.errors.fieldError);
131 | $.each(fieldErrors, function() {
132 | $('#donation-errors').append('' +
133 | this +
134 | '
');
135 | });
136 | }
137 |
138 | $('.donation-loading').remove();
139 | $('.donation-form').show();
140 | }
141 | else {
142 | $('.donation-loading').remove();
143 | $('.donation-form').before('' +
144 | 'Your donation has been processed!' +
145 | '
' +
146 | '' +
147 | '
Thank you for your donation of $' + data.donationResponse.donation.amount.decimal + '.
' +
148 | '
Your confirmation code is ' + data.donationResponse.donation.confirmation_code + '.
' +
149 | '
');
150 | }
151 | }
152 | };
153 |
154 | /* UI handlers for the Survey example */
155 | if($('.survey-form').length > 0) {
156 | $('.survey-form').submit(function() {
157 | window.scrollTo(0, 0);
158 | $(this).hide();
159 | $(this).before('' +
160 | 'Loading ...' +
161 | '
');
162 | });
163 | }
164 |
165 | /* example: handle the Survey form submission */
166 | /* if the Survey is submitted succesfully, display a thank you message */
167 | /* if there is an error, display it inline */
168 | window.submitSurveyCallback = {
169 | error: function(data) {
170 | $('#survey-errors').remove();
171 | $('.survey-form .form-group .alert').remove();
172 |
173 | $('.survey-form').prepend('' +
174 | '
' +
175 | data.errorResponse.message +
176 | '
' +
177 | '
');
178 |
179 | $('.survey-loading').remove();
180 | $('.survey-form').show();
181 | },
182 | success: function(data) {
183 | $('#survey-errors').remove();
184 | $('.survey-form .form-group .survey-alert-wrap').remove();
185 |
186 | if(data.submitSurveyResponse.success == 'false') {
187 | $('.survey-form').prepend('' +
188 | '
' +
189 | 'There was an error with your submission. Please try again.' +
190 | '
' +
191 | '
');
192 |
193 | var surveyErrors = luminateExtend.utils.ensureArray(data.submitSurveyResponse.errors);
194 | $.each(surveyErrors, function() {
195 | if(this.errorField) {
196 | $('input[name="' + this.errorField + '"]').closest('.form-group')
197 | .prepend('' +
198 | '
' +
199 | this.errorMessage +
200 | '
' +
201 | '
');
202 | }
203 | });
204 |
205 | $('.survey-loading').remove();
206 | $('.survey-form').show();
207 | }
208 | else {
209 | $('.survey-loading').remove();
210 | $('.survey-form').before('' +
211 | 'You\'ve been signed up!' +
212 | '
' +
213 | '' +
214 | '
Thanks for joining. You should receive your first issue of the e-newsletter shortly.
' +
215 | '
');
216 | }
217 | }
218 | };
219 |
220 | /* example: display a list of action alerts for the organization in the specified container */
221 | window.getAdvocacyAlerts = function(selector) {
222 | var getAdvocacyAlertsCallback = function(data) {
223 | $(selector).html('');
224 |
225 | var alertList = luminateExtend.utils.ensureArray(data.getAdvocacyAlertsResponse.alert);
226 | $.each(alertList, function() {
227 | $(selector).append('' +
228 | '
' + this.title + ' ' +
229 | this.description + ' ' +
230 | ((this.interactionCount == '0') ? 'No actions taken so far. Be the first to respond!' : ('' + this.interactionCount + ' actions taken so far.')) +
231 | '
' +
232 | '
Take Action
' +
233 | '
');
234 | });
235 | };
236 |
237 | luminateExtend.api({
238 | api: 'advocacy',
239 | callback: getAdvocacyAlertsCallback,
240 | data: 'method=getAdvocacyAlerts&alert_status=active&alert_type=action'
241 | });
242 | };
243 |
244 | /* example: handle the TeamRaiser ZIP Code radius form */
245 | /* if one or more TeamRaisers are returned, display them */
246 | /* if an error is returned, display it above the form */
247 | window.getTeamraisersByDistanceCallback = {
248 | error: function(data) {
249 | $('#teamraiser-event-search-errors').remove();
250 | $('#teamraiser-event-search-results').html('');
251 |
252 | $('.teamraiser-event-search-form').prepend('' +
253 | '
' +
254 | data.errorResponse.message +
255 | '
' +
256 | '
');
257 | },
258 | success: function(data) {
259 | $('#teamraiser-event-search-errors').remove();
260 | $('#teamraiser-event-search-results').html('');
261 |
262 | if(data.getTeamraisersResponse.totalNumberResults == 0) {
263 | $('.teamraiser-event-search-form').prepend('' +
264 | '
' +
265 | 'No events found. Please try another search.' +
266 | '
' +
267 | '
');
268 | }
269 | else {
270 | $('#teamraiser-event-search-results').html('
');
271 | var teamraiserList = luminateExtend.utils.ensureArray(data.getTeamraisersResponse.teamraiser);
272 | $.each(teamraiserList, function() {
273 | $('#teamraiser-event-search-results .well').append('');
279 | });
280 | }
281 | }
282 | };
283 |
284 | /* bind any forms with the "luminateApi" class */
285 | luminateExtend.api.bind();
286 | });
287 | })(jQuery);
--------------------------------------------------------------------------------
/examples/bootstrap/js/luminateExtend.js:
--------------------------------------------------------------------------------
1 | /* luminateExtend.js | Version: 1.9.0 (07-AUG-2021) */
2 | !function(e){var t=function(t){return t&&e.inArray(t,["es_US","en_CA","fr_CA","en_GB","en_AU"])<0&&(t="en_US"),t},a=function(e){return e&&(e=t(e),luminateExtend.sessionVars.set("locale",e)),e},n=function(e,t){return(e?luminateExtend.global.path.secure+"S":luminateExtend.global.path.nonsecure)+"PageServer"+(luminateExtend.global.routingId&&""!==luminateExtend.global.routingId?";"+luminateExtend.global.routingId:"")+"?pagename=luminateExtend_server&pgwrap=n"+(t?"&"+t:"")},i=function(t,a){if(t.responseFilter&&t.responseFilter.array&&t.responseFilter.filter&&luminateExtend.utils.stringToObj(t.responseFilter.array,a)){var n,i,l=t.responseFilter.filter.split("==")[0].split("!=")[0].replace(/^\s+|\s+$/g,"");if(-1!==t.responseFilter.filter.indexOf("!=")?(n="nequal",i=t.responseFilter.filter.split("!=")[1]):-1!==t.responseFilter.filter.indexOf("==")&&(n="equal",i=t.responseFilter.filter.split("==")[1]),n&&i){i=i.replace(/^\s+|\s+$/g,"");var o=[],r=!1;if(e.each(luminateExtend.utils.ensureArray(luminateExtend.utils.stringToObj(t.responseFilter.array,a)),function(){"nequal"===n&&this[l]===i||"equal"===n&&this[l]!==i?r=!0:o.push(this)}),r){var s=t.responseFilter.array.split(".");e.each(a,function(t,n){t===s[0]&&e.each(n,function(n,i){n===s[1]&&(2===s.length?a[t][n]=o:e.each(i,function(i,l){i===s[2]&&(3===s.length?a[t][n][i]=o:e.each(l,function(e,l){e===s[3]&&4===s.length&&(a[t][n][i][e]=o)}))}))})})}}}var u=e.noop;t.callback&&("function"==typeof t.callback?u=t.callback:t.callback.error&&a.errorResponse?u=t.callback.error:t.callback.success&&!a.errorResponse&&(u=t.callback.success));var d=-1!==t.data.indexOf("&method=login")&&-1===t.data.indexOf("&method=loginTest"),c=-1!==t.data.indexOf("&method=logout");if(d||c){var p={callback:function(){u(a)},useCache:!1,useHTTPS:t.useHTTPS};d&&a.loginResponse&&a.loginResponse.nonce&&(p.nonce="NONCE_TOKEN="+a.loginResponse.nonce),luminateExtend.api.getAuth(p)}else u(a)};window.luminateExtend=function(e){luminateExtend.init(e||{})},luminateExtend.library={version:"1.9.0"},luminateExtend.global={update:function(t,n){t&&(t.length?n&&("locale"===t&&(n=a(n)),luminateExtend.global[t]=n):(t.locale&&(t.locale=a(t.locale)),luminateExtend.global=e.extend(luminateExtend.global,t)))}},luminateExtend.init=function(a){var n=e.extend({apiCommon:{},auth:{type:"auth"},path:{}},a||{});(n.locale&&(n.locale=t(n.locale)),n.supportsCORS=!1,window.XMLHttpRequest)&&("withCredentials"in new XMLHttpRequest&&(n.supportsCORS=!0));return luminateExtend.global=e.extend(luminateExtend.global,n),luminateExtend},luminateExtend.api=function(e){luminateExtend.api.request(e||{})},luminateExtend.api.bind=function(t){return e(t=t||"form.luminateApi").length>0&&e(t).each(function(){"form"===this.nodeName.toLowerCase()&&e(this).bind("submit",function(t){t.cancelBubble=!0,t.returnValue=!1,t.stopPropagation&&(t.stopPropagation(),t.preventDefault()),e(this).attr("id")||e(this).attr("id","luminateApi-"+(new Date).getTime());var a,n=e(this).attr("action"),i=n.split("?"),l=e(this).data("luminateapi"),o=-1!==i[0].indexOf("/site/")?i[0].split("/site/")[1]:i[0],r=e(this).attr("enctype"),s=i.length>1?i[1]:"",u="#"+e(this).attr("id"),d=!1,c=!1;l&&(l.callback&&(a=luminateExtend.utils.stringToObj(l.callback)),l.requiresAuth&&"true"===l.requiresAuth&&(d=!0),(0===n.indexOf("https:")||"https:"===window.location.protocol&&-1===n.indexOf("http"))&&(c=!0)),luminateExtend.api.request({api:o,callback:a,contentType:r,data:s,form:u,requiresAuth:d,useHTTPS:c})})}),luminateExtend},luminateExtend.api.getAuth=function(t){var a=e.extend({useCache:!0,useHTTPS:!1},t||{});if(luminateExtend.api.getAuthLoad)if(luminateExtend.api.getAuthLoad=!1,a.useCache&&luminateExtend.global.auth.type&&luminateExtend.global.auth.token)luminateExtend.api.getAuthLoad=!0,a.callback&&a.callback();else{var i=function(e){luminateExtend.global.update(e),luminateExtend.api.getAuthLoad=!0,a.callback&&a.callback()};luminateExtend.global.supportsCORS?e.ajax({url:(a.useHTTPS?luminateExtend.global.path.secure:luminateExtend.global.path.nonsecure)+"CRConsAPI",data:"luminateExtend="+luminateExtend.library.version+(a.nonce&&""!==a.nonce?"&"+a.nonce:"")+"&api_key="+luminateExtend.global.apiKey+"&method=getLoginUrl&response_format=json&v=1.0",xhrFields:{withCredentials:!0},dataType:"json",success:function(e){var t=e.getLoginUrlResponse,a=t.url,n=t.routing_id,l=t.JSESSIONID;n||-1===a.indexOf("CRConsAPI;jsessionid=")||(n=a.split("CRConsAPI;jsessionid=")[1].split("?")[0]),i({auth:{type:"auth",token:t.token},routingId:n?"jsessionid="+n:"",sessionCookie:l?"JSESSIONID="+l:""})}}):e.ajax({url:n(a.useHTTPS,"action=getAuth&callback=?"),dataType:"jsonp",success:i})}else setTimeout(function(){luminateExtend.api.getAuth(a)},1e3)},luminateExtend.api.getAuthLoad=!0;var l=function(t){var a=e.extend({contentType:"application/x-www-form-urlencoded",data:"",requiresAuth:!1,useHTTPS:null},t||{});if(e.inArray(a.api.toLowerCase(),["addressbook","advocacy","connect","cons","content","datasync","donation","email","group","orgevent","recurring","survey","teamraiser"])>=0&&(a.api="CR"+a.api.charAt(0).toUpperCase()+a.api.slice(1).toLowerCase()+"API",a.api=a.api.replace("Addressbook","AddressBook").replace("Datasync","DataSync").replace("Orgevent","OrgEvent")),luminateExtend.global.path.nonsecure&&luminateExtend.global.path.secure&&luminateExtend.global.apiKey&&a.api){if("multipart/form-data"===a.contentType.split(";")[0]?a.contentType="multipart/form-data":a.contentType="application/x-www-form-urlencoded",a.contentType+="; charset=UTF-8",a.data="luminateExtend="+luminateExtend.library.version+(""===a.data?"":"&"+a.data),a.form&&e(a.form).length>0&&(a.data+="&"+e(a.form).eq(0).serialize()),-1===a.data.indexOf("&api_key=")&&(a.data+="&api_key="+luminateExtend.global.apiKey),luminateExtend.global.apiCommon.centerId&&-1===a.data.indexOf("¢er_id=")&&(a.data+="¢er_id="+luminateExtend.global.apiCommon.centerId),luminateExtend.global.apiCommon.categoryId&&-1===a.data.indexOf("&list_category_id=")&&(a.data+="&list_category_id="+luminateExtend.global.apiCommon.categoryId),-1!==a.data.indexOf("&response_format=xml")?a.data=a.data.replace(/&response_format=xml/g,"&response_format=json"):-1===a.data.indexOf("&response_format=")&&(a.data+="&response_format=json"),luminateExtend.global.apiCommon.source&&-1===a.data.indexOf("&source=")){var l=luminateExtend.global.apiCommon.source;l.length>255&&(l=l.substring(0,255)),a.data+="&source="+l}if(luminateExtend.global.apiCommon.subSource&&-1===a.data.indexOf("&sub_source=")){var o=luminateExtend.global.apiCommon.subSource;o.length>255&&(o=o.substring(0,255)),a.data+="&sub_source="+o}-1===a.data.indexOf("&suppress_response_codes=")&&(a.data+="&suppress_response_codes=true"),luminateExtend.global.locale&&-1===a.data.indexOf("&s_locale=")&&(a.data+="&s_locale="+luminateExtend.global.locale),-1===a.data.indexOf("&v=")&&(a.data+="&v=1.0");var r="http://",s=luminateExtend.global.path.nonsecure.split("http://")[1];"CRDonationAPI"===a.api||"CRTeamraiserAPI"===a.api||"CRConnectAPI"!==a.api&&("https:"===window.location.protocol&&null==a.useHTTPS||1==a.useHTTPS)?a.useHTTPS=!0:a.useHTTPS=!1,a.useHTTPS&&(r="https://",s=luminateExtend.global.path.secure.split("https://")[1]),r+=s+a.api;var u,d=!1,c=!1,p=!1;window.location.protocol===r.split("//")[0]&&document.domain===s.split("/")[0]?(d=!0,c=!0):luminateExtend.global.supportsCORS?c=!0:"postMessage"in window&&(p=!0),c?u=function(){luminateExtend.global.routingId&&""!==luminateExtend.global.routingId&&(r+=";"+luminateExtend.global.routingId),a.requiresAuth&&-1===a.data.indexOf("&"+luminateExtend.global.auth.type+"=")&&(a.data+="&"+luminateExtend.global.auth.type+"="+luminateExtend.global.auth.token),luminateExtend.global.sessionCookie&&""!==luminateExtend.global.sessionCookie&&(a.data+="&"+luminateExtend.global.sessionCookie),a.data+="&ts="+(new Date).getTime(),e.ajax({url:r,data:a.data,xhrFields:{withCredentials:!0},contentType:a.contentType,dataType:"json",type:"POST",success:function(e){i(a,e)}})}:p&&(u=function(){var t=(new Date).getTime(),l="luminateApiPostMessage"+t,o=n(a.useHTTPS,"action=postMessage");luminateExtend.global.routingId&&""!==luminateExtend.global.routingId&&(r+=";"+luminateExtend.global.routingId),a.requiresAuth&&-1===a.data.indexOf("&"+luminateExtend.global.auth.type+"=")&&(a.data+="&"+luminateExtend.global.auth.type+"="+luminateExtend.global.auth.token),luminateExtend.global.sessionCookie&&""!==luminateExtend.global.sessionCookie&&(a.data+="&"+luminateExtend.global.sessionCookie),a.data+="&ts="+t,luminateExtend.api.request.postMessageEventHandler||(luminateExtend.api.request.postMessageEventHandler={},luminateExtend.api.request.postMessageEventHandler.handler=function(t){if(-1!==luminateExtend.global.path.nonsecure.indexOf(t.origin)||-1!==luminateExtend.global.path.secure.indexOf(t.origin)){var a=e.parseJSON(t.data),n=a.postMessageFrameId,i=e.parseJSON(decodeURIComponent(a.response));luminateExtend.api.request.postMessageEventHandler[n]&&luminateExtend.api.request.postMessageEventHandler[n](n,i)}},void 0!==window.addEventListener?window.addEventListener("message",luminateExtend.api.request.postMessageEventHandler.handler,!1):void 0!==window.attachEvent&&window.attachEvent("onmessage",luminateExtend.api.request.postMessageEventHandler.handler)),luminateExtend.api.request.postMessageEventHandler[l]=function(t,n){i(a,n),e("#"+t).remove(),delete luminateExtend.api.request.postMessageEventHandler[t]},e("body").append(''),e("#"+l).bind("load",function(){var t='{"postMessageFrameId": "'+e(this).attr("id")+'", "requestUrl": "'+r+'", "requestContentType": "'+a.contentType+'", "requestData": "'+a.data+'"}',n=r.split("/site/")[0].split("/admin/")[0];document.getElementById(e(this).attr("id")).contentWindow.postMessage(t,n)}),e("#"+l).attr("src",o)}),a.requiresAuth||!c&&!d&&!luminateExtend.global.sessionCookie?luminateExtend.api.getAuth({callback:u,useHTTPS:a.useHTTPS}):u()}};luminateExtend.api.request=function(t){if(e.isArray(t)){t.reverse();var a=[];e.each(t,function(n){var i=e.extend({async:!0},this);if(i.async||n===t.length-1)a.push(i);else if((r=t[n+1]).callback&&"function"!=typeof r.callback){var o=r.callback.success||e.noop;r.callback.success=function(e){o(e),l(i)}}else{var r,s=(r=t[n+1]).callback||e.noop;r.callback={success:function(e){s(e),l(i)},error:function(e){s(e)}}}}),a.reverse(),e.each(a,function(){l(this)})}else l(t)},luminateExtend.sessionVars={set:function(e,t,a){var n={};a&&(n.callback=a),e&&(n.data="s_"+e+"="+(t||""),luminateExtend.utils.ping(n))}},luminateExtend.tags=function(e,t){luminateExtend.tags.parse(e,t)},luminateExtend.tags.parse=function(t,a){luminateExtend.widgets?luminateExtend.widgets(t,a):(t=t&&"all"!==t?luminateExtend.utils.ensureArray(t):["cons"],a=a||"body",e.each(t,function(t,n){if("cons"===n){var i=e(a).find(document.getElementsByTagName("luminate:cons"));if(i.length>0){luminateExtend.api.request({api:"cons",callback:function(t){i.each(function(){t.getConsResponse?e(this).replaceWith(luminateExtend.utils.stringToObj(e(this).attr("field"),t.getConsResponse)):e(this).remove()})},data:"method=getUser",requiresAuth:!0})}}}))},luminateExtend.utils={ensureArray:function(t){return e.isArray(t)?t:t?[t]:[]},stringToObj:function(e,t){var a=t||window;if(e)for(var n=e.split("."),i=0;i'),e("#"+n).bind("load",function(){e(this).remove(),a.callback&&a.callback()}),e("#"+n).attr("src",("https:"===window.location.protocol?luminateExtend.global.path.secure:luminateExtend.global.path.nonsecure)+"EstablishSession"+(luminateExtend.global.routingId&&""!==luminateExtend.global.routingId?";"+luminateExtend.global.routingId:"")+"?"+(null==a.data?"":a.data+"&")+"NEXTURL="+encodeURIComponent(("https:"===window.location.protocol?luminateExtend.global.path.secure:luminateExtend.global.path.nonsecure)+"PixelServer"))},simpleDateFormat:function(a,n,i){if(i=i||luminateExtend.global.locale,i=t(i),n=n||(e.inArray(i,["en_CA","fr_CA","en_GB","en_AU"])>=0?"d/M/yy":"M/d/yy"),!((a=a||new Date)instanceof Date)){var l=a.split("T")[0].split("-"),o=a.split("T").length>1?a.split("T")[1].split(".")[0].split("Z")[0].split("-")[0].split(":"):["00","00","00"];a=new Date(l[0],l[1]-1,l[2],o[0],o[1],o[2])}var r=function(e){return 0===(e=""+e).indexOf("0")&&"0"!==e?e.substring(1):e},s=function(e){return e=Number(e),isNaN(e)?"00":(e<10?"0":"")+e},u={month:s(a.getMonth()+1),date:s(a.getDate()),year:s(a.getFullYear()),day:a.getDay(),hour24:a.getHours(),hour12:a.getHours(),minutes:s(a.getMinutes()),ampm:"AM"};u.hour24>11&&(u.ampm="PM"),u.hour24=s(u.hour24),0===u.hour12&&(u.hour12=12),u.hour12>12&&(u.hour12=u.hour12-12),u.hour12=s(u.hour12);var d=function(e){var t=e.replace(/yy+(?=y)/g,"yy").replace(/MMM+(?=M)/g,"MMM").replace(/d+(?=d)/g,"d").replace(/EEE+(?=E)/g,"EEE").replace(/a+(?=a)/g,"").replace(/k+(?=k)/g,"k").replace(/h+(?=h)/g,"h").replace(/m+(?=m)/g,"m").replace(/yyy/g,u.year).replace(/yy/g,u.year.substring(2)).replace(/y/g,u.year).replace(/dd/g,u.date).replace(/d/g,r(u.date)),a=function(e,t,a){for(var n=1;n23&&(i=23);var l="+"===a?i:0-i;"kk"===t||"k"===t?(l=Number(u.hour24)+l)>24?l-=24:l<0&&(l+=24):((l=Number(u.hour12)+l)>24?l-=24:l<0&&(l+=24),l>12&&(l-=12)),l=""+l,"kk"!==t&&"hh"!==t||(l=s(l)),("h"===t&&0===l||"hh"===t&&"00"===l)&&(l="12"),e[n]=l+e[n]}return e.join("")};-1!==t.indexOf("k+")&&(t=a((t=a(t.split("kk+"),"kk","+")).split("k+"),"k","+")),-1!==t.indexOf("k-")&&(t=a((t=a(t.split("kk-"),"kk","-")).split("k-"),"k","-")),-1!==(t=t.replace(/kk/g,u.hour24).replace(/k/g,r(u.hour24))).indexOf("h+")&&(t=a((t=a(t.split("hh+"),"hh","+")).split("h+"),"h","+")),-1!==t.indexOf("h-")&&(t=a((t=a(t.split("hh-"),"hh","-")).split("h-"),"h","-")),t=(t=(t=t.replace(/hh/g,u.hour12<12&&u.hour12.indexOf&&0!==u.hour12.indexOf("0")?"0"+u.hour12:u.hour12).replace(/h/g,r(u.hour12))).replace(/mm/g,u.minutes).replace(/m/g,r(u.minutes))).replace(/a/g,"A");var n=["January","February","march","april","may","June","July","august","September","October","November","December"];"es_US"===i&&(n=["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]),"fr_CA"===i&&(n=["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]);var l=n[Number(u.month)-1].substring(0,3);"fr_CA"===i&&("f"===l?l="fév":"ao&"===l?l="aoû":"d"===l&&(l="déc")),t=t.replace(/MMMM/g,n[Number(u.month)-1]).replace(/MMM/g,l).replace(/MM/g,u.month).replace(/M/g,r(u.month));var o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];"es_US"===i&&(o=["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]),"fr_CA"===i&&(o=["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]);var d=o[u.day].substring(0,3);return"es_US"===i&&("mi&"===d?d="mié":"s&a"===d&&(d="sáb")),t=(t=t.replace(/EEEE/g,o[u.day]).replace(/EEE/g,d).replace(/EE/g,d).replace(/E/g,d)).replace(/A/g,u.ampm).replace(/apr/g,"Apr").replace(/aug/g,"Aug"),"es_US"!==i&&"fr_CA"!==i&&(t=t.replace(/mar/g,"Mar").replace(/may/g,"May")),t};if(-1!==n.indexOf("'")){var c=n.replace(/\'+(?=\')/g,"''").split("''");if(1===c.length){c=n.split("'");for(var p=0;p');a.close();u=a.getElementById("x")}else{u=t.createElement("iframe");u.style.cssText="position:absolute;top:-99em";r.insertBefore(u,r.firstElementChild||r.firstChild)}u.src=c(i)+"?url="+f(s)+"&css="+f(c(n));e.setTimeout(l,500)}function c(e){var t=document.createElement("div"),n=e.split("&").join("&").split("<").join("<").split('"').join(""");t.innerHTML='x ';return t.firstChild.href}function h(){if(~!s.indexOf(location.host)){var e=t.createElement("div");e.innerHTML=' ';r.insertBefore(e,r.firstElementChild||r.firstChild);s=e.firstChild.href;e.parentNode.removeChild(e);e=null}}function p(){var e=t.getElementsByTagName("link");for(var n=0,r=e.length;n=0&&a){(function(e){l(s,function(t){e.styleSheet.rawCssText=t;respond.update()})})(i)}}}var r=t.documentElement,i=t.getElementById("respond-proxy").href,s=(t.getElementById("respond-redirect")||location).href,o=t.getElementsByTagName("base")[0],u=[],a;if(!respond.mediaQueriesSupported){h();p()}})(window,document)
--------------------------------------------------------------------------------
/examples/bootstrap/sign-up.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Sign Up for News from American Health Society
6 |
7 |
8 |
9 |
15 |
16 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
65 |
66 |
67 |
70 |
Sign up today to receive the American Health Society's weekly e-newsletter.
71 |
106 |
107 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
--------------------------------------------------------------------------------
/examples/bootstrap/walk-for-health.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Walk for Health - American Health Society
6 |
7 |
8 |
9 |
18 |
19 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
68 |
69 |
70 |
73 |
Form a team in the Walk for Health and help raise money for our important mission. To get started, use the form below to search for an event in your area.
74 |
90 |
91 |
92 |
93 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/examples/foundation/README.md:
--------------------------------------------------------------------------------
1 | luminateExtend.js - Foundation Examples
2 | =======================================
3 |
4 | These examples show how luminateExtend.js can be used to build a website with [Foundation 4](http://foundation.zurb.com/docs/v/4.3.2/).
5 |
6 | Getting started with the example website
7 | ----------------------------------------
8 |
9 | If you haven't already done so, you'll need to follow the [basic setup instructions](https://github.com/convio/luminateExtend#libSetup)
10 | for using luminateExtend.js.
11 |
12 | Once you've completed setup, download the HTML and JavaScript files found here to your desktop. You'll need to make a few small tweaks to these files, and then you can upload them to a server of your choosing.
13 |
14 | [luminateExtend-examples.js](https://raw.github.com/convio/luminateExtend/master/examples/foundation/js/luminateExtend-examples.js) is where all the magic happens. At the very top of this file, you'll need to change the API Key and the non-secure and secure paths for your organization:
15 |
16 | ```js
17 | /* define init variables for your organization */
18 | luminateExtend({
19 | apiKey: '123456789',
20 | path: {
21 | nonsecure: 'http://shortname.convio.net/site/',
22 | secure: 'https://secure2.convio.net/shortname/site/'
23 | }
24 | });
25 | ```
26 |
27 | This is the only change you should need to make to this file. Each of the HTML files detailed below will require additional changes.
28 |
29 | Login / Welcome back
30 | --------------------
31 |
32 | At the top right of each page on the example site, users are either presented with a login form, or if they are already logged in, a "Welcome back" message and the option to log out.
33 |
34 | You'll need to edit the login form within each HTML file to change the login form's action to use your organization's domain:
35 |
36 | ```html
37 |
51 | ```
52 |
53 | On each page load, the [loginTest](http://open.convio.com/api/#single_sign_on_api.loginTest_method.html) API method is used to check if the user is currently logged in. If this API method does not return an error, then the user is logged in.
54 |
55 | ```js
56 | /* example: check if the user is logged in onload */
57 | /* if they are logged in, call the getUser function above to display the "welcome back" message */
58 | /* if they are not logged in, show the login form */
59 | var loginTestCallback = {
60 | success: function() {
61 | getUser();
62 | },
63 | error: function() {
64 | $('#login-form').removeClass('hide');
65 | }
66 | };
67 | luminateExtend.api({
68 | api: 'cons',
69 | callback: loginTestCallback,
70 | data: 'method=loginTest'
71 | });
72 | ```
73 |
74 | If the user is logged in, the getUser function is called to display a message like "Welcome back, Jane!" in place of the login form.
75 |
76 | ```js
77 | /* example: get information on the currently logged in user, and display a "welcome back" message in the site's header */
78 | window.getUser = function() {
79 | var getUserCallback = function(data) {
80 | if(data.getConsResponse && data.getConsResponse.name) {
81 | $('#login-form').replaceWith('' +
82 | 'Welcome back' + ((data.getConsResponse.name.first) ? (', ' + data.getConsResponse.name.first) : '') + '! ' +
83 | 'Logout ' +
84 | '
');
85 | }
86 | };
87 | luminateExtend.api({
88 | api: 'cons',
89 | callback: getUserCallback,
90 | data: 'method=getUser',
91 | requiresAuth: true
92 | });
93 | };
94 | ```
95 |
96 | If the user is not logged in, they will be presented with the login form. Reading the HTML for the login form above, you'll note that the form tag has a callback defined for handling the API response, loginCallback. If the username and password provided by the user are correct, the getUser function is called to display the "Welcome back" message. If the credentials are not correct, a modal is displayed with the specific error message that was returned.
97 |
98 | ```js
99 | /* example: handle the login form in the site's header */
100 | /* if the user is logged in successfully, call the getUser function above to display the "welcome back" message */
101 | /* if the user is not logged in, display the error message returned by the API in a modal */
102 | window.loginCallback = {
103 | error: function(data) {
104 | if($('#login-error-modal').length == 0) {
105 | $('body').append('' +
106 | '
Error ' +
107 | '
' + data.errorResponse.message + '
' +
108 | '
× ' +
109 | '
');
110 | }
111 | else {
112 | $('#login-error-modal p').html(data.errorResponse.message);
113 | }
114 | $('#login-error-modal').foundation('reveal', 'open');
115 | },
116 | success: function(data) {
117 | getUser();
118 | }
119 | };
120 | ```
121 |
122 | Donation form
123 | -------------
124 |
125 | [donate.html](https://raw.github.com/convio/luminateExtend/master/examples/foundation/donate.html) contains a minimalistic donation form which uses the [donate](http://open.convio.com/api/#donation_api.donate_method.html) API method to process gifts. In this example, the form's donation levels and fields are hardcoded in the page's HTML. A more robust version of this form would use the [getDonationFormInfo](http://open.convio.com/api/#donation_api.getDonationFormInfo_method.html) API method to dynamically build these fields onload.
126 |
127 | To use the donation form, you'll first need to edit the donation form's action to use your organization's domain:
128 |
129 | ```html
130 |