Index: trunk/extensions/DonationInterface/payflowpro_gateway/validate_input.js |
— | — | @@ -1,4 +1,3 @@ |
2 | | -//<![CDATA[ |
3 | 2 | function addEvent(obj, evType, fn){ |
4 | 3 | if (obj.addEventListener){ |
5 | 4 | obj.addEventListener(evType, fn, false); |
— | — | @@ -206,4 +205,3 @@ |
207 | 206 | } |
208 | 207 | |
209 | 208 | window.onfocus = CloseCVV; |
210 | | -//]]> |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/Form.php |
— | — | @@ -65,6 +65,7 @@ |
66 | 66 | $this->setStylePath(); |
67 | 67 | } |
68 | 68 | $wgOut->addExtensionStyle( $this->getStylePath() ); |
| 69 | + |
69 | 70 | /** |
70 | 71 | * if OWA is enabled, load the JS. |
71 | 72 | * |
— | — | @@ -74,9 +75,20 @@ |
75 | 76 | if(defined('OWA')){ |
76 | 77 | $this->loadOwaJs(); |
77 | 78 | } |
| 79 | + |
| 80 | + $this->loadLogoLinkOverride(); |
78 | 81 | } |
79 | 82 | |
80 | 83 | /** |
| 84 | + * Override the link in the logo to redirec to a particular form |
| 85 | + * rather than the main page |
| 86 | + */ |
| 87 | + public function loadLogoLinkOverride() { |
| 88 | + global $wgOut; |
| 89 | + $wgOut->addModules( 'pfp.core.logolink_override' ); |
| 90 | + } |
| 91 | + |
| 92 | + /** |
81 | 93 | * Set the path to the CSS file for the form |
82 | 94 | * |
83 | 95 | * This should be a full path, perhaps taking advantage of $wgScriptPath. |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumn.php |
— | — | @@ -5,15 +5,17 @@ |
6 | 6 | public function __construct( &$form_data, &$form_errors ) { |
7 | 7 | global $wgOut; |
8 | 8 | |
| 9 | + // load validation and placeholder JS |
| 10 | + $this->loadPlaceholders(); |
| 11 | + |
9 | 12 | parent::__construct( $form_data, $form_errors ); |
10 | | - |
11 | | - // load validation and placeholder JS |
12 | | - $this->loadPlaceholders(); |
13 | 13 | } |
14 | 14 | |
15 | 15 | public function loadPlaceholders() { |
16 | 16 | global $wgOut; |
17 | 17 | $wgOut->addModules( 'pfp.form.core.placeholders' ); |
| 18 | + //$placeholder_resources = '<script type="text/javascript">mw.loader.load("pfp.form.core.placeholders");</script>'; |
| 19 | + //$wgOut->addHtml( $placeholder_resources ); |
18 | 20 | } |
19 | 21 | |
20 | 22 | /** |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/logolink_override.js |
— | — | @@ -0,0 +1,3 @@ |
| 2 | +$(document).ready(function() { |
| 3 | + $("div#p-logo a").attr("href","#"); |
| 4 | +}); |
Property changes on: trunk/extensions/DonationInterface/payflowpro_gateway/logolink_override.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 5 | + native |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php |
— | — | @@ -74,17 +74,6 @@ |
75 | 75 | |
76 | 76 | $wgOut->addScript( Skin::makeVariablesScript( $scriptVars ) ); |
77 | 77 | |
78 | | - // @fixme can this be moved into the form generators? |
79 | | - // @fixme this is broken on MW 1.16, executes before jQuery load |
80 | | - $js = <<<EOT |
81 | | -<script type="text/javascript"> |
82 | | -jQuery(document).ready(function() { |
83 | | - jQuery("div#p-logo a").attr("href","#"); |
84 | | -}); |
85 | | -</script> |
86 | | -EOT; |
87 | | - $wgOut->addHeadItem( 'logolinkoverride', $js ); |
88 | | - |
89 | 78 | // find out if amount was a radio button or textbox, set amount |
90 | 79 | if ( isset( $_REQUEST['amount'] ) && preg_match( '/^\d+(\.(\d+)?)?$/', $wgRequest->getText( 'amount' ) ) ) { |
91 | 80 | $amount = $wgRequest->getText( 'amount' ); |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php |
— | — | @@ -180,6 +180,7 @@ |
181 | 181 | |
182 | 182 | // form placeholders |
183 | 183 | $wgResourceModules[ 'pfp.form.core.placeholders' ] = array( |
| 184 | + 'position' => 'top', |
184 | 185 | 'scripts' => 'form_placeholders.js', |
185 | 186 | 'dependencies' => 'pfp.form.core.validate', |
186 | 187 | 'messages' => array( |
— | — | @@ -214,6 +215,14 @@ |
215 | 216 | 'remoteExtPath' => 'DonationInterface/payflowpro_gateway' |
216 | 217 | ); |
217 | 218 | |
| 219 | +// Logo link override |
| 220 | +$wgResourceModules[ 'pfp.core.logolink_override' ] = array( |
| 221 | + 'scripts' => 'logolink_override.js', |
| 222 | + 'localBasePath' => dirname( __FILE__ ), |
| 223 | + 'remoteExtPath' => 'DonationInterface/payflowpro_gateway' |
| 224 | + |
| 225 | +); |
| 226 | + |
218 | 227 | function payflowGatewayConnection() { |
219 | 228 | global $wgPayflowGatewayDBserver, $wgPayflowGatewayDBname; |
220 | 229 | global $wgPayflowGatewayDBuser, $wgPayflowGatewayDBpassword; |