Changeset 373 for trunk/web-app/js
- Timestamp:
- Apr 22, 2010, 5:07:09 PM (11 years ago)
- Location:
- trunk/web-app/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web-app/js/SelectAddMore.js
r372 r373 48 48 class : 'addmore', 49 49 width : 800, 50 height : 500, 50 height : 400, 51 position: 'center', 51 52 onClose : function(scope) { 52 53 // onClose handler does nothing by default … … 86 87 var height = that.options.height; 87 88 var onClose = that.options.onClose; 89 var position= that.options.position; 88 90 89 91 // add a magic option to the end of the select element … … 104 106 height : height, 105 107 modal : true, 108 position: position, 106 109 buttons : { 107 110 Ok : function() { $(this).dialog('close'); } -
trunk/web-app/js/SelectAddMore.min.js
r359 r373 1 function SelectAddMore(){}SelectAddMore.prototype={ rel:"myRel",url:"http://www.youtube.com/watch?v=2WNrx2jq184",vars:"myVar",width:800,height:500,onClose:function(a){alert("the dialog was closed! --> "+a)},init:function(a,c,e,b){var d=this;d.rel=a;d.url=c;d.vars=e;d.onClose=b;$("select[rel*='"+d.rel+"']").each(function(){d.addTermEditorOption(this)})},addTermEditorOption:function(a){var c=this;var d=$(a);var b=d.children().size();d.append('<option value="" class="addTerm">add more...</option>');d.bind("change",function(){if(this.selectedIndex==b){$('<iframe src="'+c.url+"?"+c.vars+"="+d.attr(c.vars)+'" sanbox="allow-same-origin" seamless />').dialog({title:"Add more...",autoOpen:true,width:c.width,height:c.height,modal:true,close:function(){c.onClose(this)}}).width(c.width-10).height(c.height)}})}};1 function SelectAddMore(){}SelectAddMore.prototype={options:{rel:'addmore',url:'http://www.youtube.com/watch?v=2WNrx2jq184',vars:'vars',label:'add more...',class:'addmore',width:800,height:400,position:'center',onClose:function(scope){}},init:function(options){var that=this;$.each(options,function(key,value){that.options[key]=value});$("select[rel*='"+that.options.rel+"']").each(function(){that.addOpenDialogOption(this)})},addOpenDialogOption:function(element){var that=this;var e=$(element);var s=e.children().size();var class=that.options.class;var label=that.options.label;var vars=that.options.vars;var url=that.options.url;var width=that.options.width;var height=that.options.height;var onClose=that.options.onClose;var position=that.options.position;e.append('<option value="" class="'+class+'">'+label+'</option>');e.bind('change',function(){if(this.selectedIndex==s){$('<iframe src="'+url+'?'+vars+'='+e.attr(vars)+'" sanbox="allow-same-origin" seamless />').dialog({title:label,autoOpen:true,width:width,height:height,modal:true,position:position,buttons:{Ok:function(){$(this).dialog('close')}},close:function(){onClose(this)}}).width(width-10).height(height)}})}}
Note: See TracChangeset
for help on using the changeset viewer.