embed video wip
This commit is contained in:
Родитель
39116f5416
Коммит
0de68aa6ab
15
Default.aspx
15
Default.aspx
|
@ -36,8 +36,8 @@
|
|||
if (Request.QueryString["debug"] != null)
|
||||
{
|
||||
Random rnd = new Random();
|
||||
ResourcesVersion = rnd.Next(1, 999999).ToString();
|
||||
DebugQs = "?debug=true&v=" + ResourcesVersion;
|
||||
//ResourcesVersion = rnd.Next(1, 999999).ToString();
|
||||
//DebugQs = "?debug=true&v=" + ResourcesVersion;
|
||||
Debug = true;
|
||||
DotMin = ".js";
|
||||
if (Request.QueryString["debug"] == "chrome")
|
||||
|
@ -48,16 +48,9 @@
|
|||
}
|
||||
else if (Request.QueryString["debug"] == "local")
|
||||
{
|
||||
SDKLocation = "sdk/wwtsdk.js" + DebugQs;
|
||||
}
|
||||
else if (Request.QueryString["debug"] == "localmin")
|
||||
{
|
||||
SDKLocation = "wwtsdk.min.js" + DebugQs;
|
||||
}
|
||||
else
|
||||
{
|
||||
SDKLocation += "?debug=true";
|
||||
DotMin = ".min.js" + DebugQs;
|
||||
}
|
||||
|
||||
}
|
||||
if (Request.QueryString["ads"] != null)
|
||||
{
|
||||
|
|
|
@ -109,6 +109,7 @@
|
|||
});
|
||||
|
||||
var calcPageSize = function () {
|
||||
//console.log('excalccpage')
|
||||
thumbList.calcPageSize($scope, false);
|
||||
};
|
||||
$scope.clickThumb = function (item, folderCallback) {
|
||||
|
@ -128,10 +129,33 @@
|
|||
openCollection = newParams.openCollection;
|
||||
newCollectionUrl = newParams.newCollectionUrl;
|
||||
depth = newParams.depth;
|
||||
};
|
||||
checkAnnotations();
|
||||
};
|
||||
|
||||
$scope.expanded = false;
|
||||
|
||||
var annotations = null;
|
||||
var checkAnnotations = function(){
|
||||
if (annotations){
|
||||
annotations.forEach(function(a){
|
||||
console.log(a);
|
||||
})
|
||||
}
|
||||
var col = $scope.collection;
|
||||
var hasAnnotations = false;
|
||||
col.forEach(function(place){
|
||||
if (ss.canCast(place, wwtlib.Place)/*&&annotationn*/){
|
||||
hasAnnotations = true;
|
||||
|
||||
var a = wwt.wc.createCircle({r:255,g:255,b:255,a:127});
|
||||
a.set_id('?v=lBfCQt6TTms');
|
||||
a.setCenter(place.get_RA() * 15, place.get_dec());
|
||||
a.set_skyRelative(true);
|
||||
a.set_radius(.01);
|
||||
wwt.wc.addAnnotation(a);
|
||||
console.log(a);
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
$scope.breadCrumbClick = function (index) {
|
||||
$scope.collection = cache[index];
|
||||
|
|
|
@ -74,6 +74,7 @@ wwt.app.factory('Places', ['$http', '$q', '$timeout', 'Util',
|
|||
};
|
||||
|
||||
var transformData = function (items) {
|
||||
console.warn({items:items});
|
||||
$.each(items, function (i, item) {
|
||||
try {
|
||||
if (typeof item.get_type == 'function') {
|
||||
|
|
|
@ -131,6 +131,7 @@ wwt.app.factory('ThumbList', ['$rootScope', 'Util', 'Places', '$timeout', '$temp
|
|||
if ($.inArray(el, unique) === -1) unique.push(el);
|
||||
});
|
||||
scope.collection = unique;
|
||||
console.log({unique:unique});
|
||||
calcPageSize(scope, false);
|
||||
outParams.cache.push(result);
|
||||
if (outParams.openCollection) {
|
||||
|
|
|
@ -199,8 +199,30 @@
|
|||
});
|
||||
};
|
||||
|
||||
return {
|
||||
var embedVideo = function(url){
|
||||
|
||||
var modalScope = $rootScope.$new();
|
||||
modalScope.url = url;
|
||||
modalScope.customClass = 'wizard';
|
||||
$modal({
|
||||
scope: modalScope,
|
||||
templateUrl: 'views/modals/centered-modal-template.html?v='+util.resVersion,
|
||||
contentTemplate: 'views/modals/embed-video.html?v='+util.resVersion,
|
||||
show: true,
|
||||
placement: 'center',
|
||||
backdrop: false
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
return {
|
||||
addDialogHooks:function(){
|
||||
wwt.wc.add_annotationClicked(function(interface,event){
|
||||
var videoid = event.get_id().split('?v=')[1];
|
||||
if (videoid)
|
||||
console.log(videoid);{}
|
||||
embedVideo(videoid)
|
||||
});
|
||||
wwt.wc.add_voTableDisplay(wwt.loadVOTableModal);
|
||||
wwt.wc.add_colorPickerDisplay(showColorpicker);
|
||||
console.log({refFrameDialog:refFrameDialog,frameWizardDialog:frameWizardDialog});
|
||||
|
@ -210,7 +232,8 @@
|
|||
refFrameDialog.add_showDialogHook(showRefFrameProps);
|
||||
greatCircleDlg.add_showDialogHook(showGreatCircleDlg);
|
||||
dataVizWiz.add_showDialogHook(showDataVizWiz);
|
||||
}
|
||||
},
|
||||
embedVideo:embedVideo
|
||||
};
|
||||
}]);
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>$Title$</title>
|
||||
</head>
|
||||
<body>
|
||||
$END$
|
||||
</body>
|
||||
</html>
|
||||
<div class="modal-header" data-movable="1" data-movable-target=".modal-dialog">
|
||||
<h5>
|
||||
<i class="fa fa-close pull-right" ng-click="$hide()"></i>
|
||||
<span localize="Video"></span>
|
||||
</h5>
|
||||
</div>
|
||||
<div class="modal-body embed" style="height:500px">
|
||||
<iframe src="//www.youtube.com/embed/{{url}}?rel=0?wmode=transparent&fs=1&rel=0&enablejsapi=1&version=3" frameborder="0" />
|
||||
</div>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче