Changeset 373 for trunk/web-app


Ignore:
Timestamp:
Apr 22, 2010, 5:07:09 PM (11 years ago)
Author:
duh
Message:
  • template editor dynamically instantiates entities
  • dialog changes
Location:
trunk/web-app
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/web-app/css/dialog.css

    r372 r373  
    22        margin: 0; padding: 0;
    33        font: 10px normal Arial, Helvetica, sans-serif;
    4         background-color: #fff;
    54}
  • trunk/web-app/js/SelectAddMore.js

    r372 r373  
    4848        class   : 'addmore',
    4949        width   : 800,
    50         height  : 500,
     50        height  : 400,
     51        position: 'center',
    5152        onClose : function(scope) {
    5253            // onClose handler does nothing by default
     
    8687        var height  = that.options.height;
    8788        var onClose = that.options.onClose;
     89        var position= that.options.position;
    8890
    8991        // add a magic option to the end of the select element
     
    104106                    height  : height,
    105107                    modal   : true,
     108                    position: position,
    106109                    buttons : {
    107110                                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)}})}};
     1function 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.