' +
37 | '',
38 |
39 | // main container class
40 | elClass: 'smart_input-container',
41 | wrapperClass: 'smart_input-wrap',
42 | cursorClass: 'smart_input-cursor',
43 | textClass: 'smart_input-text'
44 | },
45 |
46 | // using native keyboard without virtual
47 | directKeyboardInput: true,
48 |
49 | // max symbols in input (0 if unlimited)
50 | max: 0,
51 |
52 | // next input element
53 | next: null
54 | }
55 |
56 | # Plugin's methods
57 |
58 | Method can be called after plugin initialisation
59 |
60 |
61 | - startBlink the start of a cursor blinking
62 |
63 | $(el).SBInput('startBlink');
64 |
65 | - stopBlink to stop a cursor blinking
66 |
67 | $(el).SBInput('stopBlink');
68 |
69 | - showKeyboard to display a keyboard
70 |
71 | $(el).SBInput('showKeyboard');
72 |
73 | - hideKeyboard to hide a keyboard
74 |
75 | $(el).SBInput('hideKeyboard');
76 |
77 | - changeKeyboard change current keyboard on input
78 |
79 | var keyboardOpt = {
80 | type: 'fulltext_ru',
81 | firstLayout: 'ru'
82 | },
83 | $(el).SBInput('changeKeyboard', keyboardOpt);
84 |
85 | - setText set text in input
86 |
87 | $(el).SBInput('setText', 'text in input');
88 |
89 | # Cursor blinking
90 |
91 | The cursor blinking implies the class adding up/deletion to the element cursor
92 |
93 | The class name is defined as: cursorClass + '_hidden'
94 |
95 | # Text formatting in an input
96 |
97 | If the function formatText is assigned in the options then it will be called after every printed symbol.
98 | The function should return a text for the input.
99 |
100 |
101 | # Input events
102 |
103 | - 'keyboard_show'
104 | - 'keyboard_hide'
105 | - 'keyboard_cancel'
106 | - 'keyboard_complete'
107 |
108 | # How to get to know the input's value?
109 |
110 | After the input's initialisation on the element
111 |
112 | $(el).SBInput(options);
113 |
114 | The value can be got to know for the element
115 |
116 | el.value;
117 | $(el).val();
118 |
119 |
--------------------------------------------------------------------------------
/docs/en_keyboard.md:
--------------------------------------------------------------------------------
1 | # Overview
2 |
3 | The plugin allows to show a virtual keyboard on the screen.
4 |
5 | # Initialisation
6 |
7 | SBKeyboard - jQuery plugin which can be called on any jQuery element.
8 | The first plugin initialisation occurs in the following way:
9 |
10 | $(el).SBKeyboard(options);
11 |
12 | options = {
13 | // keyboard preset
14 | type: 'en',
15 |
16 | // first layout to show
17 | firstLayout: 'en'
18 | }
19 |
20 | # Plugin's methods
21 |
22 | The method can be called after plugin has been initialisated.
23 |
24 | - Adding another keyboard to the current element
25 |
26 | $(el).SBKeyboard('addKeyboard', options);
27 | options = {
28 | type: 'en',
29 | firstLayout: 'en'
30 | }
31 |
32 | - Switching active keyboard (if some exists) on the element
33 |
34 | $(el).SBKeyboard('changeKeyboard', type); // type from the options
35 |
36 | # Plugin layouts
37 |
38 | The plugin contains some layouts by default:
39 |
40 | - en - english layout
41 | - ru - russian layout
42 | - email - layout to enter email-address
43 | - num - numeric (0-9) layout
44 | - fulltext_ru - english and russian keyboard layout
45 |
46 | # Custom layout adding
47 |
48 | To add multilang layout the array should be defined in the object window.SB.keyboardPresets
49 |
50 | window.SB.keyboardPresets[multiKeyboardLayout] = ['en', 'ru'];
51 |
52 | To add a common layout the function returning the array should be defined in the object window.SB.keyboardPresets
53 |
54 | window.SB.keyboardPresets[keyboardLayout] = function(){
55 | return [
56 | // first keyboard row
57 | ['q','w','e','r','t','y','u','i','o','p'],
58 | // second keyboard row
59 | ['a','s','d','f','g','h','j','k','l'],
60 | ]
61 | };
62 |
63 | Next keys should be defined in the layout:
64 |
65 | - lang{{}} - the key of layout changing
66 | - nums{{}} - the key for swithing to the numeric keyboard (if fullnun exists in the layout list)
67 | - space{{}} - the space key
68 | - complete{{}} - entering finish
69 |
70 | Keys that can be defined by request
71 |
72 | - shift{{}} - Capitalise letters
73 | - backspace{{}} - event generating 'backspace'(ex. for one symbol deleting)
74 | - delall{{}} - event generating 'delall'(ex. for a string erase)
75 |
76 | All keys are defined in the following way:
77 |
78 | keyName{{keyText}}, keyText - html or a text inside the key's container
79 |
80 | Usage example:
81 |
82 | backspace{{}}
83 | lang{{ru}}
84 | nums{{123}}
85 |
86 | Full layout example
87 |
88 | window.SB.keyboardPresets.en = function () {
89 | return [
90 | 'qwertyuiop'.split(''),
91 | 'asdfghjkl'.split('').concat(['backspace{{}}']),
92 | ['shift{{Shift}}'].concat('zxcvbnm'.split('')).concat(
93 | ['delall{{Del all}}']),
94 | ['lang{{en}}', 'nums{{123}}', 'space{{}}', 'complete{{Complete}}']
95 | ];
96 | };
97 |
98 | # Keyboard events
99 |
100 | - 'type' key entering event, the key is defined in the attribute: letter event
101 |
102 | var typeLetter = function(event) {
103 | console.log(event.letter);
104 | }
105 |
106 | - 'backspace'
107 | - 'delall'
108 | - 'complete'
109 |
110 | # CSS classes
111 |
112 | .kb-multilang - Some language layouts exist
113 | .kb-havenums - Numeric keyboard exists
114 |
115 |
--------------------------------------------------------------------------------
/docs/en_log.md:
--------------------------------------------------------------------------------
1 | # Overview
2 |
3 | A log allows to display messages from the code on a screen.
4 |
5 | # Initialisation
6 |
7 | The log is initialisated after the log plugin is on.
8 | The element is created in the DOM
9 |
10 | # Message displaying
11 |
12 | The key tools is a button by default to display messages.
13 | When you press the button the next events happen:
14 | - log displaying
15 | - boards changing
16 | - log hiding
17 |
18 | # Plugin's methods
19 |
20 | The log's object is situated in the object SB.utils.log
21 |
22 | 1) SB.utils.log.log(msg, logName)
23 | window.$$log(msg, logName)
24 |
25 | Вывод сообщения msg в панели лога logName.
26 | msg message displaying in the log's board logName
27 | 2) show(logName)
28 |
29 | The displaying of the log's board logName
30 | 3) hide()
31 |
32 | Log hiding.
33 |
34 | 4) state( msg, state, logName )
35 |
36 | The displaying of the message in the state log's board logName
37 | State is displayed belowe the log's board by default
38 |
39 | Example of the usage: The displaying of the current playing time
40 | 5) startProfile( profileName );
41 | stopProfile: function ( profileName )
42 |
43 | Profiling functions. Display a result on the profiler board.
44 |
45 |
--------------------------------------------------------------------------------
/docs/en_nav_alg.md:
--------------------------------------------------------------------------------
1 | # Element seaching alghorithm
2 |
3 | The alghorithm is reasonable for any direction. "Upper edge" means an edge coincident with the movement direction. For the movement up - upper edge, down - bottom edge, right - right edge, left - left edge.
4 |
5 | Example: There are navigation elements, focused element is marked in red.
6 |
7 | 
8 |
9 | User presses the button "Up". The first occuring thing is eliminating of elements that have upper edge lower then upper edge of the focused element.
10 |
11 | 
12 |
13 | The elements that have edges that intersect along the axis perpendicular to the direction are found. If there is any of such element exists then their priority become higher and other elements are eliminated.
14 |
15 | 
16 |
17 | The element that has upper edge closer to the upper edge of the focused element is searched for from the last elements.
18 |
19 | 
20 |
21 | If on the second step intersected elements haven't been found the closest element is found.
22 |
23 | 
24 |
25 | # It's not a bug, it's a feature!
26 |
27 | 
28 |
29 | In this example moving vertically from the element **B** to the element **A** it's possible to transit the focus but not vise versa.
30 | It happens because of the bottom edge pf the element **A** is lower then the bottom edge of the element **B**.
31 | So **A** is higher and lower **B** at the same time.
32 |
33 |
--------------------------------------------------------------------------------
/docs/en_nav_extended.md:
--------------------------------------------------------------------------------
1 | The element searching algorithm can be changed if different behaviour is needed.
2 |
3 |
4 |
5 | # Attribute "user defined"
6 |
7 | ```
8 |
9 | ```
10 |
11 | If the attribute is defined then the navigation stops to use the intelligent element search in some cases. In the above example when the key "DOWN" has been pressed the focus transits to the element #pfl_film_watch.
12 | Edges are defined separated by commas: up, right, down, left
13 |
14 |
15 | ```
16 |
17 | ```
18 |
19 | In this example the key "DOWN" pressing is ignored.
20 |
21 | You can also set each side separately
22 |
23 | ```
24 |
25 | ```
26 |
27 | In this example the key "UP" pressing is ignored.
28 |
29 | If you set attribute by .data(), it will work too.
30 |
31 |
32 |
33 |
34 |
35 | # Attribute entry point
36 |
37 | The attribute forbidden to enter in the element with specified direction.
38 |
39 | The enter points are defined in the attribute with commas separated 0 and 1.
40 |
41 | 0 - forbiddens to enter
42 |
43 | 1 - allows to enter
44 |
45 | The edges are defined in the CSS order - top, right, bottom, left
46 |
47 | ```
48 |
49 | ```
50 | In this example it's impossible to enter in the element from the bottom.
51 |
52 |
53 |
54 |
55 |
56 | # Phantoms
57 |
58 | A phantom is a `nav-item` which transits the focus on the another element as soon as the focus has come to this `nav-item`. It works only for a keyboard. It's ignored when gestures managing realize.
59 | ```
60 |
61 | ```
62 |
63 | In this example when the focus comes to the element it's transited to the element #card_owner.
64 |
65 | 
66 |
--------------------------------------------------------------------------------
/docs/en_platform.md:
--------------------------------------------------------------------------------
1 | # Platform
2 |
3 | Device native methods are called through the base `SB` object. You can extend it and add your own new platform.
4 | After `SB.ready` a current platform has been already defined and is kept in `SB`.
5 |
6 | # Properties and methods
7 |
8 | * `SB.platformName`
9 | * `SB.keys`
10 | * `SB.platformUserAgent`
11 | * `SB.getDUID`
12 | * `SB.getNativeDUID`
13 | * `SB.getSDI`
14 | * `SB.getRandomDUID`
15 | * `SB.getMac`
16 | * `SB.setPlugins`
17 | * `SB.setData(name, value)`
18 | * `SB.getData(name)`
19 | * `SB.removeData(name)`
20 | * `New platform adding`
21 |
22 |
23 |
24 | ### `SB.platformName`
25 |
26 | *String*: platform name (samsung, lg, philips, etc...)
27 |
28 |
29 | ### `SB.keys`
30 |
31 | *Plain object*: hash containing keys codes and them names.
32 |
33 | #### Default key names
34 |
35 | BLUE
36 | CH_DOWN
37 | CH_UP
38 | DOWN
39 | ENTER
40 | EXIT
41 | FF
42 | GREEN
43 | INFO
44 | LEFT
45 | N0
46 | N1
47 | N2
48 | N3
49 | N4
50 | N5
51 | N6
52 | N7
53 | N8
54 | N9
55 | NEXT
56 | PAUSE
57 | PLAY
58 | PRECH
59 | PREV
60 | REC
61 | RED
62 | RETURN
63 | RIGHT
64 | RW
65 | SMART
66 | STOP
67 | SUBT
68 | TOOLS
69 | UP
70 | YELLOW
71 |
72 |
73 |
74 | ### `SB.platformUserAgent`
75 |
76 | *String* unique string for platform. It's compare with environment userAgent in `SB.detect` method
77 |
78 | #### Example
79 |
80 | SB.platformUserAgent === 'netcast'; // for philips
81 | SB.platformUserAgent === 'maple'; // for samsung
82 |
83 |
84 |
85 | ### `SB.getDUID`
86 |
87 | *Function* return platform DUID in case of SB.config.DUID
88 |
89 | #### Returns
90 |
91 | *String* DUID
92 |
93 |
94 |
95 | ### `SB.getNativeDUID`
96 |
97 | *Function* return native DUID if exist
98 |
99 | #### Returns
100 |
101 | *String* DUID or empty string
102 |
103 |
104 |
105 | ### `SB.getSDI`
106 |
107 | *Function* return platform SDI if exist
108 |
109 | #### Returns
110 |
111 | *String* SDI or empty string
112 |
113 |
114 |
115 | ### `SB.getRandomDUID`
116 |
117 | *Function* return random DUID
118 |
119 | #### Returns
120 |
121 | *String* generated DUID, for example: "1446dcfb2ca1091"
122 |
123 |
124 |
125 | ### `SB.getMac`
126 |
127 | *Function* return platform MAC if exist
128 |
129 | #### Returns
130 |
131 | *String* MAC or empty string
132 |
133 |
134 |
135 | ### `SB.setPlugins`
136 |
137 | *Function* initialize & start plugins specific for platform
138 | function calls automatically with smartbox initialization
139 |
140 |
141 |
142 | ### `SB.setData(name, value)`
143 |
144 | *Function* save data in platform storage
145 |
146 | #### Arguments
147 |
148 | 1. `name` *String* data name
149 | 2. `value` *(*)* data value
150 |
151 |
152 |
153 | ### `SB.getData(name)`
154 |
155 | *Function* return value from platform storage
156 |
157 | #### Arguments
158 |
159 | 1. `name` *String* data name
160 |
161 | #### Returns
162 |
163 | *(*)* data value
164 |
165 |
166 |
167 | ### `SB.removeData(name)`
168 |
169 | *Function* remove data from platform storage
170 |
171 | #### Arguments
172 |
173 | 1. `name` *String* data name
174 |
175 |
176 |
177 | ## `New platform adding`
178 |
179 | You can add a new plaform using function SB.createPlatform(platformName, cb)
180 |
181 | ```
182 | var platformName = 'myPlatform';
183 | SB.createPlatform(platformName, {
184 | //platform methods
185 | });
186 | ```
187 |
188 |
189 |
--------------------------------------------------------------------------------
/docs/en_player.md:
--------------------------------------------------------------------------------
1 | # Player
2 |
3 | ###Contents
4 |
5 | `Public events`
6 | * `ready`
7 | * `bufferingBegin, bufferingEnd`
8 | * `stop`
9 | * `complete`
10 |
11 | `Public properties`
12 | * `Player.state`
13 | * `Player.videoInfo.duration`
14 | * `Player.videoInfo.currentTime`
15 | * `Player.videoInfo.width`
16 | * `Player.videoInfo.height`
17 | * `Player.usePlayerObject`
18 |
19 | `Public methods`
20 | * `Player.play(options)`
21 | * `Player.stop([silent])`
22 | * `Player.pause()`
23 | * `Player.resume()`
24 | * `Player.togglePause()`
25 | * `Player.formatTime(seconds)`
26 | * `Player.seek(seconds)`
27 | * `Player.audio.get()`
28 | * `Player.audio.set(index)`
29 | * `Player.audio.cur()`
30 |
31 |
32 | ##Public events
33 |
34 | ###`ready`
35 |
36 | 'ready' is sent when player has recieved a steam info (duration, resolution, etc) and playing starts.
37 |
38 | #### Examples
39 |
40 | ```js
41 | Player.on('ready', function(){
42 | $('#duration').html(Player.formatTime(Player.videoInfo.duration));
43 | });
44 | ```
45 |
46 | * * *
47 |
48 |
49 | ###`bufferingBegin, bufferingEnd`
50 |
51 | Events are sent when a video buffering starts and ends, weak Internet connection or after rewinding.
52 |
53 | #### Examples
54 |
55 | ```js
56 | var $loadingIndicator=$('#loading_indicator');
57 | Player.on('bufferingBegin', function(){
58 | $loadingIndicator.show();
59 | });
60 |
61 | Player.on('bufferingEnd', function(){
62 | $loadingIndicator.hide();
63 | });
64 | ```
65 |
66 | * * *
67 |
68 |
69 | ###`stop`
70 |
71 | Sends when the playback has been stopped.
72 |
73 | #### Examples
74 |
75 | ```js
76 | Player.on('stop', function(){
77 | $videoScene.hide();
78 | });
79 | ```
80 |
81 | * * *
82 |
83 | ###`complete`
84 |
85 | is sent when the end of video file is reached and playing is stopped.
86 |
87 | #### Examples
88 |
89 | ```js
90 | Player.on('complete', function(){
91 | playNextVideo();
92 | });
93 | ```
94 |
95 | * * *
96 |
97 |
98 | ##Public properties
99 |
100 | ###`Player.state`
101 |
102 | *String*: Current player condition:
103 |
104 | 1. `play`: video is playing
105 | 2. `pause`: video is paused
106 | 3. `stop`: video is stopped
107 |
108 | * * *
109 |
110 |
111 | ###`Player.videoInfo.duration`
112 |
113 | *Number*: video file duration in seconds
114 |
115 | * * *
116 |
117 | ###`Player.videoInfo.currentTime`
118 |
119 | *Number*: current playing time in seconds
120 |
121 | * * *
122 |
123 | ###`Player.videoInfo.width`
124 |
125 | *Number*: video stream width in pixels
126 |
127 | * * *
128 |
129 | ###`Player.videoInfo.height`
130 |
131 | *Number*: video stream height in pixels
132 |
133 | * * *
134 |
135 | ###`Player.usePlayerObject`
136 |
137 | *Boolean*: defines: will or won't the