All pastes #178693 Raw Edit

Miscellany

public text v1 · immutable
#178693 ·published 2006-09-21 14:25 UTC
rendered paste body
function addBookmark(){	
			
			var v=document.videoclipstream;
			if(v){		
			
			// build marker description
			var	i=document.getElementById('marker_name');
			var txt=i.value;
			if(txt==''){
			alert('Please enter bookmark/episode description in My Clip Video Editor !');
			}
			else{
				var data_container={feuser_id:$posterid,videoassets_id:$videoUid,bookmark_id:c,bookmark_description:txt}
				window['khazData']='aa';

				function processResponse(type, mydata, evt){
					if (type == 'error'){ alert('Error when retrieving data from the server!');}
						   else{ 
							   alert(mydata);
							   window['khazData']=mydata;
						   }
				
					//return mydata;
				}// end func
			
				
			dojo.io.bind({
                       url: '/fileadmin/assets/ws/videopreview_addBookmark.php',
                       handler: processResponse,
					   content: data_container
                    });	
					   
					   alert('mydata:'+window['khazData']);


				var t = document.createTextNode(txt);

			// get current time in the applet			
			var c = document.videoclipstream.get_pos();				
			//c=84772;

			// build marker body
			var at = document.createElement(\"a\");
			at.appendChild(document.createTextNode(txt));
			at.href = \"javascript:void(0);\";	
			at.id=c;
			at.onclick=function(){document.videoclipstream.seek_video(c);};
			at.className=\"m\";

			var atr = document.createElement(\"a\");
			atr.appendChild(document.createTextNode('[delete]'));
			atr.href = \"javascript:void(0);\";	
				var ttt='l_'+c;
			atr.id=ttt;
			
			// ks pass ins_id and ttt into a function, and have that functino return a new functino that uses those arguments
			atr.onclick=function(){return removeBookmark(mydata,ttt);};
			//atr.onclick=function(){return removeBookmark(1,2);};
			atr.className=\"m\";
			
			
			var n=document.createElement(\"li\");
			n.appendChild(at);
			n.appendChild(atr);

			// render marker
			var m=document.getElementById('markers2');				
			m.appendChild(n);	


			// save it to persistence layer
			
				
			}
			}
			else{
			alert('This is Clipstream only functionality. Please switch to Clipstream, if you need to use bookmarks.');
			
			}
		}// end func