var globalTitleCount = 0; function listTerritories(div) { url = 'http://www.paramountclips.com/json/security/login' var call = {method : 'login', params : { 'username' : readCookie('jsusername'), 'password' : readCookie('jspassword') } } ////////////////////////////////////////////// ///// BEGIN FUNCTION CODE ////// ////////////////////////////////////////////// /* * listTerritories() * This method lists all available territories within the system */ Ext.Ajax.request( { url : '../json/clip/ClipAPI', params : Ext.util.JSON.encode({method:'listTerritories',params:{}}), success : function(response, request){ var rawData = response.responseText var data = eval("(" + rawData + ")"); var newData = ""; Ext.DomQuery.selectNode(div).innerHTML = newData } } ) ////////////////////////////////////////////// //// END OF FUNCTION CODE ////// ////////////////////////////////////////////// } function listUserTerritories(div, territory_list) { var arrTerritory = territory_list.split(","); //alert(arrTerritory[2]); url = 'http://www.paramountclips.com/json/security/login' var call = {method : 'login', params : { 'username' : readCookie('jsusername'), 'password' : readCookie('jspassword') } } ////////////////////////////////////////////// ///// BEGIN FUNCTION CODE ////// ////////////////////////////////////////////// /* * listUserTerritories() * This method lists all available territories within the system */ Ext.Ajax.request( { url : '../json/clip/ClipAPI', params : Ext.util.JSON.encode({method:'listTerritories',params:{}}), success : function(response, request){ var rawData = response.responseText var data = eval("(" + rawData + ")"); var newData = "
All TerritoriesAccount Territories
"; var found = 0; for (i=0;i < data.result.length;i++){ found = 0; for (n=0;n" + data.result[i].name + ""; found = 1; } } if (found == 0){ newData = newData + ""; } } // newData = newData + "
"; newData = newData + "
"; newData2 = newData2 + "
"; var newData3 = newData + newData2; Ext.DomQuery.selectNode(div).innerHTML = newData3; //document.write(newData); } } ) ////////////////////////////////////////////// //// END OF FUNCTION CODE ////// ////////////////////////////////////////////// } function listTrialUserTerritories(div, territory_list) { var arrTerritory = territory_list.split(","); //alert(arrTerritory[2]); url = 'http://www.paramountclips.com/json/security/login' var call = {method : 'login', params : { 'username' : readCookie('jsusername'), 'password' : readCookie('jspassword') } } ////////////////////////////////////////////// ///// BEGIN FUNCTION CODE ////// ////////////////////////////////////////////// /* * listTrialUserTerritories() * This method lists all available territories within the system */ Ext.Ajax.request( { url : '../json/clip/ClipAPI', params : Ext.util.JSON.encode({method:'listTerritories',params:{}}), success : function(response, request){ var rawData = response.responseText var data = eval("(" + rawData + ")"); var newData = "
Looking to license clips in:
"; var found = 0; for (i=0;i < data.result.length;i++){ found = 0; for (n=0;n" + data.result[i].name + ""; found = 1; } } if (found == 0){ newData = newData + ""; } } // newData = newData + "
"; newData = newData + "
"; newData2 = newData2 + "
"; var newData3 = newData + newData2; Ext.DomQuery.selectNode(div).innerHTML = newData3; //document.write(newData); } } ) ////////////////////////////////////////////// //// END OF FUNCTION CODE ////// ////////////////////////////////////////////// } function listLanguages(div) { url = 'http://www.paramountclips.com/json/security/login' var call = {method : 'login', params : { 'username' : readCookie('jsusername'), 'password' : readCookie('jspassword') } } ////////////////////////////////////////////// ///// BEGIN FUNCTION CODE ////// ////////////////////////////////////////////// /* * listLanguages() * This method lists all languages within the system */ Ext.Ajax.request( { url : '../json/clip/ClipAPI', params : Ext.util.JSON.encode({method:'listLanguages', params:{}}), success : function(response, request){ var rawData = response.responseText var data = eval("(" + rawData + ")"); var newData = ""; Ext.DomQuery.selectNode(div).innerHTML = newData } } ) ////////////////////////////////////////////// //// END OF FUNCTION CODE ////// ////////////////////////////////////////////// } function getAssetDetails(div, asset_id) { url = 'http://www.paramountclips.com/json/security/login' var call = {method : 'login', params : { 'username' : readCookie('jsusername'), 'password' : readCookie('jspassword') } } ////////////////////////////////////////////// ///// BEGIN FUNCTION CODE ////// ////////////////////////////////////////////// /* * getAssetDetails(id) * This method is used by the digitalsmiths clipping player fetch the appropriate * streaming information and metadata. */ Ext.Ajax.request( { url : '../json/clip/ClipAPI', params : Ext.util.JSON.encode({method:'getAssetDetails', params:{'id':asset_id}}), success : function(response, request){ Ext.DomQuery.selectNode(div).innerHTML = response.responseText } } ) ////////////////////////////////////////////// //// END OF FUNCTION CODE ////// ////////////////////////////////////////////// } function splitTime(a) { var hours=Math.floor(a/3600); var minutes=Math.floor(a/60)-(hours*60); var seconds=a-(hours*3600)-(minutes*60); seconds = Math.floor(seconds); // var hs=' hour';var ms=' minute';var ss=' second'; var hs=':';var ms=':';var ss=' '; var lh='';var lm='';var ls=''; if (hours<10) {lh+='0'} if (minutes<10) {lm+='0'} if (seconds<10) {ls+='0'} return lh+hours+hs+lm+minutes+ms+ls+seconds+ss; } // Restrict Redband with promo users function getClipsForAsset(div, asset_id, this_title, restrictRedband, memorabilityRanking) { // alert(this_title); // if (!this_title){this_title = document.getElementById("hidden_video").value;} url = 'http://www.paramountclips.com/json/security/login' var call = {method : 'login', params : { 'username' : readCookie('jsusername'), 'password' : readCookie('jspassword') } } ////////////////////////////////////////////// ///// BEGIN FUNCTION CODE ////// ////////////////////////////////////////////// /* * getClipsForAsset(id) * This method returns a list of clips for a specified asset. */ Ext.Ajax.request( { url : '../json/clip/ClipAPI', params : Ext.util.JSON.encode({method:'getClipsForAsset', params:{'id':asset_id, 'restrictRedband': restrictRedband, 'excludeMediumMemorability': memorabilityRanking}}), success : function(response, request){ // // var rawData = response.responseText // var data = eval("(" + rawData + ")"); // var newData = ""; // for (i=0;i < data.result[0].segments.length;i++){ // newData = newData + "Title: " + data.result[0].segments[i].title + " - Clip ID: " + data.result[0].segments[i].clipId + "
"; // // // } // Ext.DomQuery.selectNode(div).innerHTML = newData var rawData = response.responseText var data = eval("(" + rawData + ")"); var newData = ""; var count = 0; for (i=0;i < data.result[0].segments.length;i++){ count = count + 1; newData = newData + "
" + count + ""; newData = newData + data.result[0].segments[i].title + "
"; // newData = newData + this_title + "
"; newData = newData + splitTime(data.result[0].segments[i].startTime) + " - " + splitTime(data.result[0].segments[i].endTime) + "
"; var totalTime = data.result[0].segments[i].endTime - data.result[0].segments[i].startTime; totalTIme = splitTime(totalTime); var restrictedClip = 'false'; newData = newData + "Length: " + totalTIme + "
"; // newData = newData + data.result[i].teaser + "
"; // newData = newData + data.result[i].id + "
"; // newData = newData + data.result[i].guid + "
"; // newData = newData + "" + data.result[i].start + " - " + data.result[i].end + "
"; newData = newData + "Add To My Clips"; } Ext.DomQuery.selectNode('div[id="recommended_heading"]').innerHTML = "Recommended(" + count + ")" Ext.DomQuery.selectNode(div).innerHTML = newData TabbedPanels1.showPanel(2); // Ext.DomQuery.selectNode('div[id="getClipsForAsset"]').innerHTML = response.responseText } } ) ////////////////////////////////////////////// //// END OF FUNCTION CODE ////// ////////////////////////////////////////////// } function getClearanceForAsset(div, asset_id, territory_name) { url = 'http://www.paramountclips.com/json/security/login' var call = {method : 'login', params : { 'username' : readCookie('jsusername'), 'password' : readCookie('jspassword') } } ////////////////////////////////////////////// ///// BEGIN FUNCTION CODE ////// ////////////////////////////////////////////// /* * getClearanceForAsset(id) * This method is called by the digitalsmiths clipping player to get the cleared * time slices from which to make the clips. */ Ext.Ajax.request( { url : '../json/clip/ClipAPI', params : Ext.util.JSON.encode({method:'getClearanceForAsset', params:{'id':asset_id, territory:territory_name}}), success : function(response, request){ var rawData = response.responseText var data = eval("(" + rawData + ")"); var newData = ""; for (i=0;i < data.result.length;i++){ newData = newData + "Start: " + data.result[i].start + " - End: " + data.result[i].end + "
"; } Ext.DomQuery.selectNode(div).innerHTML = newData } } ) ////////////////////////////////////////////// //// END OF FUNCTION CODE ////// ////////////////////////////////////////////// } function listTitles(div, this_limit, this_offset) { // getTitleCount(); // var total_count = 46; url = 'http://www.paramountclips.com/json/security/login' var call = {method : 'login', params : { 'username' : readCookie('jsusername'), 'password' : readCookie('jspassword') } } var newData = ""; ////////////////////////////////////////////// ///// BEGIN FUNCTION CODE ////// ////////////////////////////////////////////// /* * listTitles(territories, languages, limit, offset) * This method returns the asset titles for the specified criteria and range. Limit and offset can be * used to page through the available assets * * territories:[{'id' : 173, 'name' : 'Argentina'}], */ Ext.Ajax.request( { url : '../json/clip/ClipAPI', params : Ext.util.JSON.encode({method:'listTitles', params:{ territories:[], languages:[], filters: [], partner: {'id': 0 }, limit : 100000, offset : 0}}), success : function(response, request){ var rawData = response.responseText; var data = eval("(" + rawData + ")"); //var newData = ""; var count = 0; for (i=0;i < data.result.length;i++){ count = count + 1; // newData = newData + "
" + count + "
"; // newData = newData + data.result[i].title + "
"; // // newData = newData + data.result[i].teaser + "
"; // // newData = newData + data.result[i].id + "
"; // // newData = newData + data.result[i].guid + "
"; // // newData = newData + "" + data.result[i].start + " - " + data.result[i].end + "
"; // newData = newData + ""; } Ext.DomQuery.selectNode('div[id="title_heading"]').innerHTML = "Titles(" + count + ")"; //Ext.DomQuery.selectNode(div).innerHTML = newData total_count = count; } } ) failure: Ext.Ajax.request( { url : '../json/clip/ClipAPI', params : Ext.util.JSON.encode({method:'listTitles', params:{ territories:[], languages:[], filters: [], partner: {'id': 0 }, limit : this_limit, offset : this_offset}}), success : function(response, request){ //Ext.DomQuery.selectNode('div[id="listTitles"]').innerHTML = response.responseText var rawData = response.responseText; var data = eval("(" + rawData + ")"); //var newData = ""; var count = 0 + this_offset; for (i=0;i < data.result.length;i++){ count = count + 1; var novtitle = data.result[i].title.replace("'", ""); newData = newData + "
" + count + ""; newData = newData + data.result[i].title + "
"; // newData = newData + data.result[i].teaser + "
"; // newData = newData + data.result[i].id + "
"; // newData = newData + data.result[i].guid + "
"; // newData = newData + "" + data.result[i].start + " - " + data.result[i].end + "
"; newData = newData + ""; } count = count - this_offset; // Ext.DomQuery.selectNode('div[id="title_heading"]').innerHTML = "Titles(" + count + ")" // Ext.DomQuery.selectNode(div).innerHTML = ""; Ext.DomQuery.selectNode(div).innerHTML = newData; Ext.DomQuery.selectNode(div).scrollTop = 0; ///////////////////////////////////////////// ///// Pagination ///////// ///////////////////////////////////////////// // // calculate the total number of pages possible - round UP to the next whole number var total_pages1 = 0; total_pages1 = globalTitleCount / this_limit; total_pages = Math.round(total_pages1) if (total_pages1 > total_pages){ total_pages = total_pages + 1; } // var offset_label = 1; // if (this_offset > 0){ offset_label = (this_offset / this_offset) + 1;} // add the initial << to get you to the start - only the 'limit' or items per page may change here var paginationData = ""; paginationData = paginationData + ""; Ext.DomQuery.selectNode('div[id="pagination_div"]').innerHTML = paginationData; ///////////////////////////////////////////// ///// End Pagination ///////// ///////////////////////////////////////////// } } ) ////////////////////////////////////////////// //// END OF FUNCTION CODE ////// ////////////////////////////////////////////// // Ext.DomQuery.selectNode('div[id="listTitles"]').scrollTop = 0; } function getTitleCount() { url = 'http://www.paramountclips.com/json/security/login' var call = {method : 'login', params : { 'username' : readCookie('jsusername'), 'password' : readCookie('jspassword') } } Ext.Ajax.request( { url:url, params:Ext.util.JSON.encode(call), success:setGlobalCount(), failure:setGlobalCount() } ) } function setGlobalCount(){ Ext.Ajax.request( { url : '../json/clip/ClipAPI', params : Ext.util.JSON.encode({method:'listTitles', params:{ territories:[], languages:[], filters: [], partner: {'id':22}, limit : 100000, offset : 0}}), success : function(response, request){ var rawData = response.responseText var data = eval("(" + rawData + ")"); var titleCount = 0; for (i=0;i < data.result.length;i++){ titleCount = titleCount + 1; } globalTitleCount = titleCount; } } ) } function listFilters(div) { url = 'http://www.paramountclips.com/json/security/login' var call = {method : 'login', params : { 'username' : readCookie('jsusername'), 'password' : readCookie('jspassword') } } ////////////////////////////////////////////// ///// BEGIN FUNCTION CODE ////// ////////////////////////////////////////////// Ext.Ajax.request( { url : '../json/clip/ClipAPI', params : Ext.util.JSON.encode({method:'listFilters', params:{ }}), success : function(response, request){ // var rawData = response.responseText // var data = eval("(" + rawData + ")"); // var newData = " "; // Ext.DomQuery.selectNode(div).innerHTML = newData var rawData = response.responseText var data = eval("(" + rawData + ")"); var newData = ""; Ext.DomQuery.selectNode(div).innerHTML = newData //Ext.DomQuery.selectNode('div[id="listFilters"]').innerHTML = response.responseText } } ) ////////////////////////////////////////////// //// END OF FUNCTION CODE ////// ////////////////////////////////////////////// } function listGenre(div) { url = 'http://www.paramountclips.com/json/security/login' var call = {method : 'login', params : { 'username' : readCookie('jsusername'), 'password' : readCookie('jspassword') } } ////////////////////////////////////////////// ///// BEGIN FUNCTION CODE ////// ////////////////////////////////////////////// Ext.Ajax.request( { url : '../json/clip/ClipAPI', params : Ext.util.JSON.encode({method:'listFilters', params:{ }}), success : function(response, request){ var rawData = response.responseText var data = eval("(" + rawData + ")"); var newData = ""; Ext.DomQuery.selectNode(div).innerHTML = newData } } ) ////////////////////////////////////////////// //// END OF FUNCTION CODE ////// ////////////////////////////////////////////// } function listSceneCategories(div) { url = 'http://www.paramountclips.com/json/security/login' var call = {method : 'login', params : { 'username' : readCookie('jsusername'), 'password' : readCookie('jspassword') } } ////////////////////////////////////////////// ///// BEGIN FUNCTION CODE ////// ////////////////////////////////////////////// Ext.Ajax.request( { url : '../json/clip/ClipAPI', params : Ext.util.JSON.encode({method:'listFilters', params:{ }}), success : function(response, request){ var rawData = response.responseText var data = eval("(" + rawData + ")"); var newData = ""; Ext.DomQuery.selectNode(div).innerHTML = newData } } ) ////////////////////////////////////////////// //// END OF FUNCTION CODE ////// ////////////////////////////////////////////// } function listPartners() { url = 'http://www.paramountclips.com/json/security/login' var call = {method : 'login', params : { 'username' : readCookie('jsusername'), 'password' : readCookie('jspassword') } } Ext.Ajax.request( { url : '../json/clip/ClipAPI', params : Ext.util.JSON.encode({method:'listPartners', params:{ }}), success : function(response, request){ var rawData = response.responseText var data = eval("(" + rawData + ")"); var newData = ""; for (i=0;i < data.result.length;i++){ newData = newData + "Id: " + data.result[i].id + " - Name: " + data.result[i].name + "
"; } Ext.DomQuery.selectNode('div[id="listPartners"]').innerHTML = newData } } ) } function submitClip(asset_id, start_time, end_time, partner_name, language_code, clip_id) { url = 'http://www.paramountclips.com/json/security/login' var call = {method : 'login', params : { 'username' : readCookie('jsusername'), 'password' : readCookie('jspassword') } } ////////////////////////////////////////////// ///// BEGIN FUNCTION CODE ////// ////////////////////////////////////////////// // Ext.Ajax.request( // { // url : '/json/clip/ClipSubmission', // params : Ext.util.JSON.encode({method:'create',params:[{'assetId' : 5722,'startTime' : 55.0,'endTime' : 65.0,'partner' : {'name' : 'MSN'},'language': 'DEU','responseInfo': {'clipId':'d249ecfa-a5ba-4aa4-b598-1357bb4a0576','url': 'http://api.ds.com/json/response/Clip','method': 'jobResponseHandler','force': true}}]}), // success : function(response, request){ // Ext.DomQuery.selectNode('div[id="create"]').innerHTML = response.responseText // } // } // ) Ext.Ajax.request( { url : '../json/clip/ClipSubmission', // params : Ext.util.JSON.encode({method:'create',params:[{'assetId' : asset_id,'startTime' : 55.0,'endTime' : 65.0,'partner' : {'name' : 'MSN'},'language': 'DEU','responseInfo': {'clipId':'d249ecfa-a5ba-4aa4-b598-1357bb4a0576','url': 'http://api.ds.com../json/response/Clip','method': 'jobResponseHandler','force': true}}]}), params : Ext.util.JSON.encode({method:'create',params:[{'assetId' : asset_id,'startTime' : start_time,'endTime' : end_time,'partner' : {'name' : partner_name},'language': language_code,'responseInfo': {'clipId':clip_id,'url': 'http://hsb2b01.digitalsmiths.com/receive_clip.php','method': 'jobResponseHandler','force': true}}]}), success : function(response, request){ Ext.DomQuery.selectNode('div[id="cart_response"]').innerHTML = response.responseText } } ) ////////////////////////////////////////////// //// END OF FUNCTION CODE ////// ////////////////////////////////////////////// } function submitTestClip() { url = 'http://www.paramountclips.com/json/security/login' var call = {method : 'login', params : { 'username' : readCookie('jsusername'), 'password' : readCookie('jspassword') } } ////////////////////////////////////////////// ///// BEGIN FUNCTION CODE ////// ////////////////////////////////////////////// // Ext.Ajax.request( // { // url : '/json/clip/ClipSubmission', // params : Ext.util.JSON.encode({method:'create',params:[{'assetId' : 5722,'startTime' : 55.0,'endTime' : 65.0,'partner' : {'name' : 'MSN'},'language': 'DEU','responseInfo': {'clipId':'d249ecfa-a5ba-4aa4-b598-1357bb4a0576','url': 'http://api.ds.com/json/response/Clip','method': 'jobResponseHandler','force': true}}]}), // success : function(response, request){ // Ext.DomQuery.selectNode('div[id="create"]').innerHTML = response.responseText // } // } // ) Ext.Ajax.request( { url : '../json/clip/ClipSubmission', params : Ext.util.JSON.encode({method:'create',params:[{'assetId' : asset_id,'startTime' : 55.0,'endTime' : 65.0,'partner' : {'name' : 'MSN'},'language': 'DEU','responseInfo': {'clipId':'d249ecfa-a5ba-4aa4-b598-1357bb4a0576','url': 'http://api.ds.com../json/response/Clip','method': 'jobResponseHandler','force': true}}]}), // params : Ext.util.JSON.encode({method:'create',params:[{'assetId' : asset_id,'startTime' : start_time,'endTime' : end_time,'partner' : {'name' : partner_name},'language': language_code,'responseInfo': {'clipId':clip_id,'url': 'http://hsb2b01.digitalsmiths.com/receive_clip.php','method': 'jobResponseHandler','force': true}}]}), success : function(response, request){ Ext.DomQuery.selectNode('div[id="cart_response"]').innerHTML = response.responseText } } ) ////////////////////////////////////////////// //// END OF FUNCTION CODE ////// ////////////////////////////////////////////// } function showSideBar(div){ Ext.Ajax.request( { url : '../ajax/displaycart.php?query=1', success : function(response, request){Ext.DomQuery.selectNode(div).innerHTML = response.responseText} } ) } // //function playAltMedia(videoId) { // //var obj = swfobject.getObjectById("player"); // getClipsForAsset('div[id="listRecommended"]', videoId) // //swfobject.getObjectById("insceneplayer").playMedia(videoId); // //document.getElementById("player").playMedia(videoId); //} // //This function is to pull the title ofo the asset // function getAssetTitle(div, asset_id) { url = 'http://www.paramountclips.com/json/security/login' var call = {method : 'login', params : { 'username' : readCookie('jsusername'), 'password' : readCookie('jspassword') } } ////////////////////////////////////////////// ///// BEGIN FUNCTION CODE ////// ////////////////////////////////////////////// /* * getAssetDetails(id) * This method is used by the digitalsmiths clipping player fetch the appropriate * streaming information and metadata. */ Ext.Ajax.request( { url : '../json/clip/ClipAPI', params : Ext.util.JSON.encode({method:'getAssetDetails', params:{'id':asset_id}}), success : function(response, request){ var rawData = response.responseText var data = eval("(" + rawData + ")"); var newData = ""; //if (newData == ""){ newData = "Title Not Found";} //for (i=0;i < data.result.length;i++){ newData = newData + data.result.title; //} Ext.DomQuery.selectNode(div).innerHTML = newData }, failure : function(response, request){ Ext.DomQuery.selectNode(div).innerHTML = "Title Error" } } ) ////////////////////////////////////////////// //// END OF FUNCTION CODE ////// ////////////////////////////////////////////// } function getmyclipsonload() { Ext.Ajax.request( { url : '../ajax/cartdetails.php', success : function(response, request){ Ext.DomQuery.selectNode('div[id="myclips"]').innerHTML = response.responseText }, failure : function (err){ alert ("Page time out due to too many clips, Please delete or checkout clips"); Ext.Ajax.request( { url : '../ajax/cartdetails.php?rows=50', success : function(response, request){ Ext.DomQuery.selectNode('div[id="myclips"]').innerHTML = response.responseText }, failure : function(response, request){ Ext.DomQuery.selectNode('div[id="myclips"]').innerHTML = "Page Load Error" } } ) } } ) } function returnAssetTitle(asset_id) { url = 'http://www.paramountclips.com/json/security/login' var call = {method : 'login', params : { 'username' : readCookie('jsusername'), 'password' : readCookie('jspassword') } } ////////////////////////////////////////////// ///// BEGIN FUNCTION CODE ////// ////////////////////////////////////////////// /* * getAssetDetails(id) * This method is used by the digitalsmiths clipping player fetch the appropriate * streaming information and metadata. */ Ext.Ajax.request( { url : '../json/clip/ClipAPI', params : Ext.util.JSON.encode({method:'getAssetDetails', params:{'id':asset_id}}), success : function(response, request){ var rawData = response.responseText var data = eval("(" + rawData + ")"); data = data.result.title; return data; } } ) ////////////////////////////////////////////// //// END OF FUNCTION CODE ////// ////////////////////////////////////////////// }