-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMP.Sharing.component.js.html
305 lines (243 loc) · 9.53 KB
/
MP.Sharing.component.js.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>DocStrap Source: MP.Sharing.component.js</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.cosmo.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top navbar-inverse">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="index.html">DocStrap</a>
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse" id="topNavigation">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="MemoryPlayerAPI.html">MemoryPlayerAPI</a></li><li><a href="MemoryPlayerComponent.html">MemoryPlayerComponent</a></li><li><a href="MemoryPlayerConfig.html">MemoryPlayerConfig</a></li><li><a href="MemoryPlayerController.html">MemoryPlayerController</a></li><li><a href="MemoryPlayerControls.html">MemoryPlayerControls</a></li><li><a href="MemoryPlayerProvider.html">MemoryPlayerProvider</a></li><li><a href="MemoryPlayerRun.html">MemoryPlayerRun</a></li><li><a href="MemoryPlayerSharing.html">MemoryPlayerSharing</a></li><li><a href="MemoryPlayerState.html">MemoryPlayerState</a></li><li><a href="MPPlayerController.html">MPPlayerController</a></li><li><a href="MPSharingComponent.html">MPSharingComponent</a></li><li><a href="MPSharingController.html">MPSharingController</a></li>
</ul>
</li>
</ul>
<div class="col-sm-3 col-md-3">
<form class="navbar-form" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
<div class="input-group-btn">
<button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="container" id="toc-content">
<div class="row">
<div class="col-md-12">
<div id="main">
<h1 class="page-title">Source: MP.Sharing.component.js</h1>
<section>
<article>
<pre
class="sunlight-highlight-javascript linenums">var MPSharingController = /** @class */ (function () {
/**
* Implements IController
* @constructs MPSharingController
* @param {IRootScopeService} $rootScope - The core angular root scope service.
* @param {IJPlayerProvider} JPlayer - The provider service that manages jplayer.
* @param {IMemoryPlayerSharing} MemoryPlayerSharing - The service that manages memory player link sharing.
*/
function MPSharingController($rootScope, JPlayer, MemoryPlayerSharing) {
var _this = this;
this.$rootScope = $rootScope;
this.JPlayer = JPlayer;
this.MemoryPlayerSharing = MemoryPlayerSharing;
// Sets initial sharing values
this.sharelink = this.MemoryPlayerSharing.sharelink;
this.isTimeUsed = false;
this.sharelinkTime = '00:00';
// Watches sharing service for sharelink change
this.unbindSharelink = this.$rootScope.$watch(function () {
return _this.MemoryPlayerSharing.sharelink;
}, function (newSharelink, oldSharelink) {
// If sharelink changes then update
if (angular.isDefined(newSharelink) && newSharelink !== oldSharelink) {
// Updates sharelink
_this.sharelink = newSharelink;
}
});
// Watches sharing service for is time used change
this.unbindIsTimeUsed = this.$rootScope.$watch(function () {
return _this.MemoryPlayerSharing.isTimeUsed;
}, function (newValue, oldValue) {
// If is time used changes then update
if (angular.isDefined(newValue) && newValue !== oldValue) {
// Updates is time used
_this.isTimeUsed = newValue;
// If time is used then bind time update, else unbind and start at beginning
if (_this.isTimeUsed) {
/**
* Observes time updated.
*/
angular.element(_this.JPlayer.ids.jPlayer).bind($.jPlayer.event.timeupdate, function (event) {
_this.$rootScope.$evalAsync(function () {
// Updates share link time
_this.sharelinkTime = $.jPlayer.convertTime(event.jPlayer.status.currentTime);
_this.MemoryPlayerSharing.setShareVal('time', _this.sharelinkTime);
});
});
}
else {
// Unbinds time update
angular.element(_this.JPlayer.ids.jPlayer).unbind($.jPlayer.event.timeupdate);
// Starts at beginning
_this.sharelinkTime = '00:00';
_this.MemoryPlayerSharing.setShareVal('time', '0');
}
}
});
}
// Cleans up watches to prevent memory leaks
MPSharingController.prototype.$onDestroy = function () {
this.unbindSharelink();
this.unbindIsTimeUsed();
};
MPSharingController.instance = [
'$rootScope',
'JPlayer',
'MemoryPlayerSharing',
MPSharingController
];
return MPSharingController;
}());
var MPSharingComponent = /** @class */ (function () {
/**
* Implements IComponentOptions
* @constructs MPSharingComponent
*/
function MPSharingComponent() {
this.controller = MPSharingController.instance;
this.controllerAs = 'sharing';
this.bindings = {
currentTrack: '<',
cancelTimer: '&',
share: '&',
toggleDropdown: '&',
updateTime: '&',
useTime: '&'
};
this.templateUrl = '/memory-player/dist/html/mp-sharing.html';
}
return MPSharingComponent;
}());
(function () {
'use strict';
angular.module('MemoryPlayer')
.component('mpSharing', new MPSharingComponent());
})();
</pre>
</article>
</section>
</div>
</div>
<div class="clearfix"></div>
</div>
</div>
<div class="modal fade" id="searchResults">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Search results</h4>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<footer>
<span class="copyright">
DocStrap Copyright © 2012-2017 The contributors to the JSDoc3 and DocStrap projects.
</span>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
on Mon Sep 10th 2018
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
</footer>
<script src="scripts/docstrap.lib.js"></script>
<script src="scripts/toc.js"></script>
<script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
<script>
$( function () {
$( "[id*='$']" ).each( function () {
var $this = $( this );
$this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
} );
$( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
var $this = $( this );
var example = $this.find( "code" );
exampleText = example.html();
var lang = /{@lang (.*?)}/.exec( exampleText );
if ( lang && lang[1] ) {
exampleText = exampleText.replace( lang[0], "" );
example.html( exampleText );
lang = lang[1];
} else {
var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
lang = langClassMatch ? langClassMatch[1] : "javascript";
}
if ( lang ) {
$this
.addClass( "sunlight-highlight-" + lang )
.addClass( "linenums" )
.html( example.html() );
}
} );
Sunlight.highlightAll( {
lineNumbers : true,
showMenu : true,
enableDoclinks : true
} );
$.catchAnchorLinks( {
navbarOffset: 10
} );
$( "#toc" ).toc( {
anchorName : function ( i, heading, prefix ) {
return $( heading ).attr( "id" ) || ( prefix + i );
},
selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
showAndHide : false,
smoothScrolling: true
} );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
$( '.dropdown-toggle' ).dropdown();
$( "table" ).each( function () {
var $this = $( this );
$this.addClass('table');
} );
} );
</script>
<!--Navigation and Symbol Display-->
<!--Google Analytics-->
<script type="text/javascript">
$(document).ready(function() {
SearcherDisplay.init();
});
</script>
</body>
</html>