mxit-rails 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +62 -19
- data/app/assets/images/mxit_rails/emoticons.png +0 -0
- data/app/assets/javascripts/mxit_rails/emulator.js +22 -15
- data/app/assets/stylesheets/mxit_rails/emulator.css.scss +13 -2
- data/app/assets/stylesheets/mxit_rails/included.css.scss +53 -0
- data/app/helpers/mxit_rails_helper.rb +1 -1
- data/app/views/emulator/index.html.erb +39 -25
- data/app/views/layouts/mxit.html.erb +5 -4
- data/lib/mxit_rails/engine.rb +3 -0
- data/lib/mxit_rails/page.rb +66 -3
- data/lib/mxit_rails/styles.rb +54 -4
- data/lib/mxit_rails/version.rb +1 -1
- data/test/dummy/app/views/form/index/age.html.erb +1 -1
- data/test/dummy/app/views/form/index/done.html.erb +1 -1
- data/test/dummy/app/views/form/index/gender.html.erb +1 -1
- data/test/dummy/app/views/form/index/name.html.erb +1 -1
- data/test/dummy/app/views/form/index/start.html.erb +1 -1
- data/test/dummy/app/views/form/index/surname.html.erb +1 -1
- data/test/dummy/app/views/index/index.html.erb +2 -7
- data/test/dummy/app/views/welcome/easter_egg.html.erb +1 -1
- data/test/dummy/app/views/welcome/index.html.erb +1 -1
- data/test/dummy/log/development.log +3085 -0
- data/test/dummy/tmp/cache/assets/CE2/D30/sprockets%2Fd3a004deb91b48186689a96981c6b02b +0 -0
- data/test/dummy/tmp/cache/assets/CEA/D60/sprockets%2Fdf3c6b2c7584552f8929860e75cb0a51 +0 -0
- data/test/dummy/tmp/cache/assets/D03/D30/sprockets%2F039aef99b893884717dd47cbd5a47788 +0 -0
- data/test/dummy/tmp/cache/assets/D54/750/sprockets%2Fc16371b1a234c7c56cb01cb28a8bc5c3 +0 -0
- data/test/dummy/tmp/cache/assets/D5B/540/sprockets%2Fe0e490354c54e5a850a6e3c3aa1ecb15 +0 -0
- data/test/dummy/tmp/cache/assets/D6F/560/sprockets%2Fa572b066d908bae0d01dbc85f86a57d9 +0 -0
- data/test/dummy/tmp/cache/assets/DAA/B80/sprockets%2Ff8082150f8c8beafcd445cc79a9a6a85 +0 -0
- data/test/dummy/tmp/cache/assets/DFB/940/sprockets%2F2faff4be90929be6a1b1de49ea25e33b +0 -0
- data/test/dummy/tmp/cache/assets/E15/260/sprockets%2Fea9c788716af4ccb19ff8e1d7ea47b8e +0 -0
- data/test/dummy/tmp/cache/assets/E26/4F0/sprockets%2F1cd8dafcb93f36aea8c2cf9d04c322d3 +0 -0
- data/test/dummy/tmp/cache/assets/E4F/E70/sprockets%2Fd9fffd76ac7c8ee08bedf3e257c81f99 +0 -0
- metadata +7 -4
- data/test/dummy/tmp/pids/server.pid +0 -1
data/README.md
CHANGED
@@ -2,32 +2,43 @@ Mxit Rails
|
|
2
2
|
==========
|
3
3
|
|
4
4
|
A gem that includes a simple and opinionated templating framework for Rails-based Mxit apps.
|
5
|
-
This includes a
|
5
|
+
This includes a layout framework, support for styles (similar to CSS classes), abstraction of inputs and multi-step forms, and
|
6
6
|
an elegant way to support Mxit's conversation-based interface.
|
7
7
|
|
8
|
+
It also includes a browser-based *emulator* with a lot of functionality to simplify and streamline the development process.
|
9
|
+
|
8
10
|
Later versions will also include wrappers for important Mxit APIs.
|
9
11
|
|
12
|
+
|
10
13
|
Sample App
|
11
14
|
----------
|
12
15
|
A basic to-do app has been set up as an example of the gem in use. It can be seen at [mxit-to-do](https://github.com/linsen/mxit-to-do).
|
13
16
|
|
17
|
+
|
14
18
|
Installation
|
15
19
|
------------
|
16
20
|
To use the gem, just include the gem your rails projects' gemfile:
|
17
21
|
|
18
|
-
gem 'mxit-rails', '~> 0.2
|
22
|
+
gem 'mxit-rails', '~> 0.3.2'
|
23
|
+
|
24
|
+
[Heroku](https://devcenter.heroku.com/articles/rails3) provides the simplest way to get a rails app running on the web.
|
25
|
+
|
26
|
+
[Showoff.io](https://showoff.io) is a great tool for development, allowing you to access localhost from Mxit.
|
27
|
+
|
28
|
+
Look at [Mxit Apps](wiki/Mxit-Apps) on the wiki for more information.
|
19
29
|
|
20
|
-
The newest version is 0.2.7 - it is not recommended to use any earlier versions.
|
21
30
|
|
22
31
|
Basic usage
|
23
32
|
-----------
|
24
|
-
To set up a controller to use the gem, you need to include the `MxitRails::Page` module:
|
33
|
+
To set up a specific controller to use the gem, you need to include the `MxitRails::Page` module:
|
25
34
|
|
26
35
|
include MxitRails::Page
|
27
36
|
|
28
37
|
This creates a few helper methods that can be used within that controller
|
29
38
|
|
30
39
|
- `input input_name, input_label` - Define the page's input field with a name (symbol) and text label
|
40
|
+
- `select select_name, select_label, select_options, options` - Create a single-select input with a name (symbol) and text label
|
41
|
+
- `multi_select select_name, select_label, select_options, options` - Create a multi-select input with a name (symbol) and text label
|
31
42
|
- `validate type, [parameter], message` - Set up validations on the input field.
|
32
43
|
- `validate message, &block` - A custom message with a block providing a `true` (valid) or `false` (invalid) value.
|
33
44
|
Note that the block must not use a `return` statement
|
@@ -40,6 +51,10 @@ Currently the following validations are available:
|
|
40
51
|
- `:length, exact_length`
|
41
52
|
- `:min_length, min`
|
42
53
|
- `:max_length, max`
|
54
|
+
- `:min_value, min`
|
55
|
+
- `:max_value, max`
|
56
|
+
- `:cellphone_number`
|
57
|
+
- `:sa_id_number`
|
43
58
|
|
44
59
|
|
45
60
|
Multi-step forms
|
@@ -57,14 +72,19 @@ The gem allows the easy set up of multi-step forms within a single controller ac
|
|
57
72
|
|
58
73
|
The order in which steps are defined will be the order they are presented to users in. Each step should have its own view file, in
|
59
74
|
`app/views/controller/action/step`. Each step has access to the same helper methods as the controller itself. For steps that don't
|
60
|
-
have an input field, a `proceed` helper method is provided
|
75
|
+
have an input field (either `input`, `select` or `multi_select`), a `proceed` helper method is provided
|
61
76
|
|
62
77
|
- `proceed message` - Show a proceed link rather than a form input
|
63
78
|
|
64
79
|
Users will only proceed to the next step in the form if all validations of the previous step pass.
|
65
|
-
|
66
80
|
If the action has a `submit` block (defined outside of the `form`), it will only be executed after the last step is completed.
|
67
81
|
|
82
|
+
There are three methods to change flow within a form. All will create a redirect, but a `return` statement should accompany them in the action
|
83
|
+
to avoid double rendering.
|
84
|
+
- `skip_to step_name` - Skip to the specified step
|
85
|
+
- `reset!` - Reset the whole form
|
86
|
+
- `submit!` - Submit the form with whatever values have been filled in so far
|
87
|
+
|
68
88
|
|
69
89
|
Styles
|
70
90
|
------
|
@@ -75,25 +95,28 @@ and can be declared in any controller with the `mxit_style` macro. It is recomm
|
|
75
95
|
|
76
96
|
To include a style in a template, use the `mxit_style` helper method. Any number of styles can be given as parameters to this method.
|
77
97
|
|
78
|
-
<
|
98
|
+
<span style="<%= mxit_style :author %>">Lewis Carroll</span>
|
79
99
|
|
80
100
|
The following special styles are used in the overall layout, and it is thus recommended that they be defined. Note that links can only be styled per-page, not per link.
|
81
101
|
|
82
102
|
- `:body` - The page body (`body` element in html)
|
83
|
-
- `:title` - The page title
|
84
103
|
- `:link` - The colour of links in the page
|
85
104
|
- `:link_hover` - The colour and background colour of highlighted links.
|
86
105
|
|
87
106
|
|
88
107
|
Layout
|
89
108
|
------
|
90
|
-
The gem currently includes a default layout that
|
91
|
-
|
109
|
+
The gem currently includes a default layout that creates the necessary html headers, and includes the form at the bottom of the page.
|
110
|
+
|
111
|
+
There is a `mxit_table_row` helper method (which takes a list of styles) that will create a new table cell.
|
112
|
+
All cells will be 100% width, and are intended to be used only to create blocks of colour in the app (e.g. title bars).
|
113
|
+
|
114
|
+
Calling `mxit_table_row` with no parameters will create a row with the `body` style applied
|
92
115
|
|
93
116
|
|
94
117
|
Emulator
|
95
118
|
--------
|
96
|
-
The mxit-rails gem is provided with
|
119
|
+
The mxit-rails gem is provided with a feature-rich emulator to aid development. It can be accessed at `/emulator`. The url will dynamically update to show
|
97
120
|
the current URL of the page shown as a suffix, e.g. `emulator/path_to/page`. Certain parts of the app can similarly be loaded directly by
|
98
121
|
navigating to their corresponding URL.
|
99
122
|
|
@@ -104,12 +127,32 @@ To set the root URL of the emulator, add the following line to `config/applicati
|
|
104
127
|
|
105
128
|
Mxit Headers
|
106
129
|
------------
|
107
|
-
The gem automatically parses (some) Mxit headers and makes them available in the `mxit_params` hash. When using the emulator these values are spoofed with cookies, but in a way transparent to the app itself. Currently the following are available:
|
108
|
-
|
109
|
-
- `:mxit_id` - The user's Mxit ID (m-ID). From
|
110
|
-
- `:mxit_login` - The user's Mxit Login name. From
|
111
|
-
- `:display_name` - The user's current nickname. From
|
112
|
-
- `:
|
113
|
-
|
114
|
-
- `:
|
130
|
+
The gem automatically parses (some) Mxit headers and makes them available in the `mxit_params` hash. When using the emulator these values are spoofed with cookies, but in a way transparent to the app itself. Look at Mxit's [Documentation](http://dev.mxit.com/docs/mobi-portal-api#headers) for more details. Currently the following are available:
|
131
|
+
|
132
|
+
- `:mxit_id` - The user's Mxit ID (m-ID). From `X-Mxit-UserId-R`
|
133
|
+
- `:mxit_login` - The user's Mxit Login name. From `X-Mxit-Login` or `X-Mxit-ID-R`
|
134
|
+
- `:display_name`, `:nick` - The user's current nickname. From `X-Mxit-Nick`
|
135
|
+
- `:screen_width` - From 'UA-Pixels'
|
136
|
+
- `:screen_height` - From 'UA-Pixels'
|
137
|
+
- `:device_user_agent` - The agent string of the requesting device, e.g. "SonyEricsson?/K800i". From `X-Device-User-Agent`
|
138
|
+
- `:contact` - The Mxit service name, e.g. "books@mxit.com". From `X-Mxit-Contact`
|
139
|
+
- `:location` - The user's current location. From `X-Mxit-Location`. Automatically split into components (in `mxit_params`) as well:
|
140
|
+
- `:country_code` - ISO 3166-1 alpha-2 Country Code
|
141
|
+
- `:country_name`
|
142
|
+
- `:principal_subdivision_code`
|
143
|
+
- `:principal_subdivision_name`
|
144
|
+
- `:city_code`
|
145
|
+
- `:city_name`
|
146
|
+
- `:network_operator_id`
|
147
|
+
- `:client_features_bitset`
|
148
|
+
- `:cell_id`
|
149
|
+
- `:profile` - The user's profile details. From `X-Mxit-Profile`. Automatically split into components (in `mxit_params`) as well:
|
150
|
+
- `:language_code` - ISO_639-1 or ISO_639-2 language code
|
151
|
+
- `:registered_country_code` - Registered ISO 3166-1 alpha-2 Country Code
|
152
|
+
- `:date_of_birth` - A ruby Date object where it can be parsed to a Date, otherwise just the string from the header
|
153
|
+
- `:gender` - a symbol (`:male`, `:female` or `:unknown`)
|
154
|
+
- `:tariff_plan` - a symbol (`:free`, `:freestyler` or `:unknown`)
|
155
|
+
- `:user_input` - Any input typed in not matching a link on the page. HTML escaping is undone. From `X-Mxit-User-Input`.
|
156
|
+
- Note that spaces are converted to `+` characters, and `+` characters are not escaped, so if the user enters a `+` it will appear as a space in rails.
|
157
|
+
- This field wil *only* be set if the user enters text that is not a link on the page (case sensitive match to the link text), and if there isn't a form input on the page.
|
115
158
|
|
Binary file
|
@@ -35,23 +35,17 @@ Emulator = (function() {
|
|
35
35
|
|
36
36
|
setCookie: function() {
|
37
37
|
// Create cookies. Use only lowercase cookie names - the server expects this (case insensitivity seems dodgy)
|
38
|
-
$.cookie('x-mxit-login', localStorage.getItem('mxit-login'), {path: '/'});
|
39
38
|
$.cookie('x-mxit-userid-r', localStorage.getItem('mxit-id'), {path: '/'});
|
39
|
+
$.cookie('x-mxit-login', localStorage.getItem('mxit-login'), {path: '/'});
|
40
40
|
$.cookie('x-mxit-nick', localStorage.getItem('mxit-nick'), {path: '/'});
|
41
|
+
$.cookie('x-mxit-contact', localStorage.getItem('mxit-contact'), {path: '/'});
|
42
|
+
$.cookie('x-mxit-location', localStorage.getItem('mxit-location'), {path: '/'});
|
43
|
+
$.cookie('x-mxit-profile', localStorage.getItem('mxit-profile'), {path: '/'});
|
41
44
|
$.cookie('x-mxit-device-info', localStorage.getItem('mxit-distribution-code') + ',' + localStorage.getItem('mxit-msisdn'), {path: '/'});
|
42
45
|
|
43
|
-
|
44
|
-
|
45
|
-
else
|
46
|
-
Emulator.home();
|
47
|
-
},
|
46
|
+
$.cookie('ua-pixels', '240x320', {path: '/'});
|
47
|
+
$.cookie('x-device-user-agent', 'EMULATOR', {path: '/'});
|
48
48
|
|
49
|
-
clearCookie: function() {
|
50
|
-
// Create cookies. Use only lowercase cookie names - the server expects this (case insensitivity seems dodgy)
|
51
|
-
$.cookie('x-mxit-login', null, {path: '/'});
|
52
|
-
$.cookie('x-mxit-userid-r', null, {path: '/'});
|
53
|
-
$.cookie('x-mxit-nick', null, {path: '/'});
|
54
|
-
$.cookie('x-mxit-device-info', null, {path: '/'});
|
55
49
|
|
56
50
|
if (MXIT_PATH && (MXIT_PATH != ''))
|
57
51
|
Emulator.setUrl(MXIT_PATH);
|
@@ -86,8 +80,9 @@ Emulator = (function() {
|
|
86
80
|
editCredentials: function() {
|
87
81
|
$('#center').hide();
|
88
82
|
$('#inputs').show();
|
83
|
+
$('#link').hide();
|
89
84
|
|
90
|
-
values = ['id', 'login', 'nick', 'distribution-code', 'msisdn'];
|
85
|
+
values = ['id', 'login', 'nick', 'contact', 'location', 'profile', 'distribution-code', 'msisdn'];
|
91
86
|
for (var i in values) {
|
92
87
|
var str = values[i];
|
93
88
|
var value = localStorage.getItem('mxit-' + str);
|
@@ -95,15 +90,27 @@ Emulator = (function() {
|
|
95
90
|
}
|
96
91
|
},
|
97
92
|
|
93
|
+
clearCredentials: function() {
|
94
|
+
values = ['id', 'login', 'nick', 'contact', 'location', 'profile', 'distribution-code', 'msisdn'];
|
95
|
+
for (var i in values) {
|
96
|
+
var str = values[i];
|
97
|
+
$('#mxit-' + str + '-input').val('');
|
98
|
+
}
|
99
|
+
},
|
100
|
+
|
98
101
|
saveCredentials: function() {
|
99
|
-
values = ['id', 'login', 'nick', 'distribution-code', 'msisdn'];
|
102
|
+
values = ['id', 'login', 'nick', 'contact', 'location', 'profile',, 'distribution-code', 'msisdn'];
|
100
103
|
for (var i in values) {
|
101
104
|
var str = values[i];
|
102
|
-
|
105
|
+
var val = $('#mxit-' + str + '-input').val();
|
106
|
+
if (val == '')
|
107
|
+
val = $('#mxit-' + str + '-input').attr('placeholder');
|
108
|
+
localStorage.setItem('mxit-' + str, val);
|
103
109
|
}
|
104
110
|
|
105
111
|
$('#inputs').hide();
|
106
112
|
$('#center').show();
|
113
|
+
$('#link').show();
|
107
114
|
Emulator.setCredentials();
|
108
115
|
},
|
109
116
|
|
@@ -87,7 +87,13 @@ iframe {
|
|
87
87
|
}
|
88
88
|
#inputs {
|
89
89
|
display: none;
|
90
|
-
padding: 10px;
|
90
|
+
padding: 20px 10px 10px 10px;
|
91
|
+
position: absolute;
|
92
|
+
top: 37px;
|
93
|
+
bottom: 0;
|
94
|
+
left: 0;
|
95
|
+
right: 0;
|
96
|
+
background-color: #fff;
|
91
97
|
}
|
92
98
|
#inputs label {
|
93
99
|
font-size: 12px;
|
@@ -100,7 +106,7 @@ iframe {
|
|
100
106
|
font-size: 16px;
|
101
107
|
border: 1px solid #bbb;
|
102
108
|
border-radius: 5px;
|
103
|
-
width:
|
109
|
+
width: 95%;
|
104
110
|
height: 22px;
|
105
111
|
}
|
106
112
|
#save {
|
@@ -108,6 +114,11 @@ iframe {
|
|
108
114
|
display: block;
|
109
115
|
text-align: center;
|
110
116
|
}
|
117
|
+
#clear {
|
118
|
+
position: absolute;
|
119
|
+
right: 20px;
|
120
|
+
top: 3px;
|
121
|
+
}
|
111
122
|
|
112
123
|
|
113
124
|
.link .icon {
|
@@ -5,6 +5,59 @@ html, body {
|
|
5
5
|
font-weight: normal;
|
6
6
|
}
|
7
7
|
|
8
|
+
.emulator td {
|
9
|
+
padding: 2px;
|
10
|
+
}
|
11
|
+
|
8
12
|
.emulator form {
|
9
13
|
display: none;
|
10
14
|
}
|
15
|
+
|
16
|
+
.emulator .emoticon {
|
17
|
+
height: 32px;
|
18
|
+
line-height: 32px;
|
19
|
+
width: 32px;
|
20
|
+
display: inline-block;
|
21
|
+
background-repeat: no-repeat;
|
22
|
+
text-indent: 100px;
|
23
|
+
overflow: hidden;
|
24
|
+
|
25
|
+
&.happy {background-position: 0px 0px;}
|
26
|
+
&.sad {background-position: -32px 0px;}
|
27
|
+
&.winking {background-position: -64px 0px;}
|
28
|
+
&.excited {background-position: -96px 0px;}
|
29
|
+
&.shocked {background-position: -128px 0px;}
|
30
|
+
&.surprised {background-position: -160px 0px;}
|
31
|
+
&.tongue_out {background-position: -192px 0px;}
|
32
|
+
&.embarrassed {background-position: -224px 0px;}
|
33
|
+
&.cool {background-position: -256px 0px;}
|
34
|
+
&.heart {background-position: -288px 0px;}
|
35
|
+
&.flower {background-position: -320px 0px;}
|
36
|
+
&.male {background-position: -352px 0px;}
|
37
|
+
&.female {background-position: -384px 0px;}
|
38
|
+
&.star {background-position: -416px 0px;}
|
39
|
+
&.chilli {background-position: -448px 0px;}
|
40
|
+
&.kiss {background-position: -480px 0px;}
|
41
|
+
&.idea {background-position: -512px 0px;}
|
42
|
+
&.extremely_angry {background-position: -544px 0px;}
|
43
|
+
&.censored {background-position: -576px 0px;}
|
44
|
+
&.grumpy {background-position: -608px 0px;}
|
45
|
+
&.coffee {background-position: -640px 0px;}
|
46
|
+
&.mr_green {background-position: -672px 0px;}
|
47
|
+
&.sick {background-position: -704px 0px;}
|
48
|
+
&.wtf {background-position: -736px 0px;}
|
49
|
+
&.in_love {background-position: -768px 0px;}
|
50
|
+
&.rolling_eyes {background-position: -800px 0px;}
|
51
|
+
&.crying {background-position: -832px 0px;}
|
52
|
+
&.thinking {background-position: -864px 0px;}
|
53
|
+
&.drooling {background-position: -896px 0px;}
|
54
|
+
&.sleepy {background-position: -928px 0px;}
|
55
|
+
&.liar {background-position: -960px 0px;}
|
56
|
+
&.nerdy {background-position: -992px 0px;}
|
57
|
+
&.pirate {background-position: -1024px 0px;}
|
58
|
+
&.bored {background-position: -1056px 0px;}
|
59
|
+
&.cold {background-position: -1088px 0px;}
|
60
|
+
&.confused {background-position: -1120px 0px;}
|
61
|
+
&.hungry {background-position: -1152px 0px;}
|
62
|
+
&.stressed {background-position: -1184px 0px;}
|
63
|
+
}
|
@@ -50,7 +50,7 @@ module MxitRailsHelper
|
|
50
50
|
|
51
51
|
output = "<a href=\"#{target}\">"
|
52
52
|
if @_mxit.numbered_list
|
53
|
-
output += "#{@_mxit_select_index}</a>
|
53
|
+
output += "#{@_mxit_select_index})</a> #{content}"
|
54
54
|
else
|
55
55
|
output += "#{label}</a>"
|
56
56
|
output = (selected ? '+ ' : '- ') + output
|
@@ -45,35 +45,49 @@
|
|
45
45
|
<div id="phone">
|
46
46
|
<div id="screen">
|
47
47
|
<iframe id="center" class="content" onLoad="Emulator.updateIframe()"></iframe>
|
48
|
-
|
49
|
-
<div id="inputs">
|
50
|
-
<div>
|
51
|
-
<label for="mxit-id-input">Mxit ID</label>
|
52
|
-
<input type="text" placeholder="Mxit ID" id="mxit-id-input" value="m987654321" />
|
53
|
-
</div>
|
54
|
-
<div>
|
55
|
-
<label for="mxit-login-input">Mxit Login</label>
|
56
|
-
<input type="text" placeholder="Mxit Login" id="mxit-login-input"/>
|
57
|
-
</div>
|
58
|
-
<div>
|
59
|
-
<label for="mxit-nick-input">Display Name (Nick)</label>
|
60
|
-
<input type="text" placeholder="Nickname" id="mxit-nick-input"/>
|
61
|
-
</div>
|
62
|
-
<div>
|
63
|
-
<label for="mxit-distribution-code-input">Distribution Code</label>
|
64
|
-
<input type="text" placeholder="Distribution Code" id="mxit-distribution-code-input" value="DISTRO_CODE"/>
|
65
|
-
</div>
|
66
|
-
<div>
|
67
|
-
<label for="mxit-msisdn-input">MSISDN (Cell No)</label>
|
68
|
-
<input type="text" placeholder="MSISDN" id="mxit-msisdn-input" />
|
69
|
-
</div>
|
70
|
-
|
71
|
-
<a id="save" class="go link" onclick="Emulator.saveCredentials()">Save <span class="icon"><span class="image"></span></span></a>
|
72
|
-
</div>
|
73
48
|
</div>
|
74
49
|
<input id="phone-input" type="text" autocomplete="off" />
|
75
50
|
</div>
|
76
51
|
|
52
|
+
<div id="inputs">
|
53
|
+
<a id="clear" class="go link" onclick="Emulator.clearCredentials()">Clear All <span class="icon"><span class="image"></span></span></a>
|
54
|
+
<div>
|
55
|
+
<label for="mxit-id-input">Mxit ID</label>
|
56
|
+
<input type="text" placeholder="m987654321" id="mxit-id-input" />
|
57
|
+
</div>
|
58
|
+
<div>
|
59
|
+
<label for="mxit-login-input">Mxit Login</label>
|
60
|
+
<input type="text" placeholder="MxitLogin" id="mxit-login-input"/>
|
61
|
+
</div>
|
62
|
+
<div>
|
63
|
+
<label for="mxit-nick-input">Display Name (Nick)</label>
|
64
|
+
<input type="text" placeholder="Nickname" id="mxit-nick-input"/>
|
65
|
+
</div>
|
66
|
+
<div>
|
67
|
+
<label for="mxit-contact-input">Contact</label>
|
68
|
+
<input type="text" placeholder="ContactName" id="mxit-contact-input" />
|
69
|
+
</div>
|
70
|
+
<div>
|
71
|
+
<label for="mxit-location-input">Location</label>
|
72
|
+
<input type="text" placeholder="ZA,South Africa,11,Western Cape,23,Kraaifontein,88,13072382,8fbe253" id="mxit-location-input" />
|
73
|
+
</div>
|
74
|
+
<div>
|
75
|
+
<label for="mxit-profile-input">Profile</label>
|
76
|
+
<input type="text" placeholder="en,ZA,1984-01-01,male,1" id="mxit-profile-input" />
|
77
|
+
</div>
|
78
|
+
<div>
|
79
|
+
<label for="mxit-distribution-code-input">Distribution Code - Only available to authorised apps</label>
|
80
|
+
<input type="text" placeholder="DISTRO_CODE" id="mxit-distribution-code-input" />
|
81
|
+
</div>
|
82
|
+
<div>
|
83
|
+
<label for="mxit-msisdn-input">MSISDN (Cell No) - Only available to authorised apps</label>
|
84
|
+
<input type="text" placeholder="27820123456" id="mxit-msisdn-input" />
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<p>Leave fields blank to set them to the default value</p>
|
88
|
+
<a id="save" class="go link" onclick="Emulator.saveCredentials()">Save <span class="icon"><span class="image"></span></span></a>
|
89
|
+
</div>
|
90
|
+
|
77
91
|
<div id="fadeout"></div>
|
78
92
|
|
79
93
|
</body>
|
@@ -7,10 +7,11 @@
|
|
7
7
|
|
8
8
|
<meta name="mxit" content="no_prefix,show_progress,clear_on_new,no_heading" />
|
9
9
|
|
10
|
-
<% if
|
10
|
+
<% if @_mxit_emulator %>
|
11
11
|
<!-- Include a CSS file, but only in a browser/emulator, not on mxit -->
|
12
12
|
<%= stylesheet_link_tag "mxit_rails/included" %>
|
13
13
|
<style type="text/css">
|
14
|
+
.emulator .emoticon { background-image: url(<%= image_path("mxit_rails/emoticons.png"); %>) }
|
14
15
|
a:focus { outline: none; <%= mxit_style :link_hover %> }
|
15
16
|
</style>
|
16
17
|
<% end %>
|
@@ -33,13 +34,13 @@
|
|
33
34
|
|
34
35
|
<br />
|
35
36
|
<% if @_mxit.input %>
|
36
|
-
<%
|
37
|
+
<% unless @_mxit.input_label.blank? %>
|
37
38
|
<%= mxit_proceed @_mxit.input_label %>
|
38
39
|
<% end %>
|
39
40
|
|
40
41
|
<% elsif @_mxit.select %>
|
41
42
|
<% if @_mxit.multi_select %>
|
42
|
-
<%
|
43
|
+
<% unless @_mxit.select_label.blank? %>
|
43
44
|
<%= @_mxit.select_label %><br />
|
44
45
|
<% end %>
|
45
46
|
|
@@ -50,7 +51,7 @@
|
|
50
51
|
<%= mxit_proceed link_to(@_mxit.multi_select_next, "#{request.path}?_mxit_rails_submit=true&_mxit_rails_multi_select=#{@_mxit.select}") %>
|
51
52
|
|
52
53
|
<% else %>
|
53
|
-
<%
|
54
|
+
<% unless @_mxit.select_label.blank? %>
|
54
55
|
<%= mxit_proceed @_mxit.select_label %>
|
55
56
|
<% end %>
|
56
57
|
<% @_mxit.select_options.each do |value, label| %>
|
data/lib/mxit_rails/engine.rb
CHANGED