Video Preview + class="btn btn-primary btn-block">Video Preview
+Please enter a name for your playlist:
') - .append($('')); + .append($('')); showPopup('Create Playlist', $message.prop('outerHTML'), 'Create', 'Cancel', function(dialog) { - // call the API here. - // now reload the view - Load(getAllPlaylistsURL()); + // do something here }, function(dialog) { // do nothing here @@ -139,6 +136,10 @@ $(function () { $(event.target).parents('li').remove(); }) + $('.pml-dialog_content').on('click', '.label-listing li a', function(event) { + $(event.target).parents('li').remove(); + }) + $('#tbData').on('click', '.playlist-actions a', function(event) { event.preventDefault(); var playlist = { @@ -165,6 +166,7 @@ $(function () { // do something here? } }); + dialog.hide(); Load(getAllPlaylistsURL()); }, function(dialog) { @@ -197,6 +199,31 @@ $(function () { }; }); + $('.pml-dialog').on('keyup', '.label-add-input input', function(event) { + var query = $(event.target).val(); + var $parent = $(event.target).parents('.label-add-input'); + if (query) { + // perform an AJAX video search + var data = { + a: 'list_labels', + query: query, + start: 0, + limit: 3, + callback: 'suggestLabelsForVideo' + }; + $.ajax({ + type: 'GET', + url: '/bin/brightcove/api.js', + data: data, + async: true, + success: function (data) + { + // do something here? + } + }); + }; + }); + $('.folder-selector .menu-options').on('click', 'li', function(event) { var folderId = $(event.target).data('folder-id'); $.each(paging.selectedVideos, function (i, n) { @@ -255,6 +282,42 @@ $(function () { $('.butDiv').toggle(paging.selectedVideos.length > 0); }); + $('body').on('click', '.variant', function(event) { + event.preventDefault(); + var variantId = $(event.target).attr('data-variant-id'); + var videoId = $(event.target).attr('data-video-idx'); + var variant = oCurrentVideoList[videoId].variants[variantId]; + + var content = "Video Name:
" + variant.language + "
Description:
" + variant.description + "
Long Description:
" + variant.long_description + "
Custom Fields:
"; + for (const prop in variant.custom_fields) { + content += "" + variant.custom_fields[prop] + "
"; + content += "Label Name:
') + .append($('')); + showPopup('Create New Label', + $message.prop('outerHTML'), + 'Create', + 'Cancel', + function(dialog) { + + // do some basic validationĂ¥ + var labelName = $('.input-label-name').val(); + if (labelName == '' || !labelName.startsWith('/')) { + $('.input-label-name').addClass('error'); + } else { + $('.input-label-name').removeClass('error'); + // call the API here. + var data = { + a: 'create_label', + label: labelName + }; + $.ajax({ + type: 'GET', + url: '/bin/brightcove/api.js', + data: data, + async: true, + success: function (data) + { + // do something here? + } + }); + dialog.hide(); + location.reload(); + } + }, + function(dialog) { + // do nothing here + triggerLabelClick('all'); + }) } else { console.log('search videos by label=' + selected); Load(getLabelListingUrl(selected)); @@ -419,13 +559,62 @@ function loadLabels() { }); } +function editLabels(event) { + var data = { + videoId: document.getElementById('divMeta.previewDiv').value, + items: $(document.getElementById('divMeta.labels')).find('a').map(function() { + return $(this).text() + }) + .get() + }; + console.log(data.items); + var $search = $('').prop('outerHTML'); + var $message = $('