Sha256: 7e3a61ef677974ff1e77b063daa51dbcd709ccf521c79b898795ecc16b8562e7

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 KB

Contents

App.Views.SetAdapter = Backbone.View.extend({
	
	events: {
		"submit form" : "set_adapter"
	},
	
    initialize: function() {
		this.render("",domain);
		this.model.get_adapter();
    },

	set_adapter: function(e){
		e.preventDefault();
		var adapter_url = $('#input_adapter').val();
		var domain = $('input#domain').val();
		this.render(adapter_url,domain);
		$(".setadapter-status")[0].firstChild.className = "label label-warning";
		$(".setadapter-status")[0].firstChild.innerHTML = "loading...";
		$(".setadapter-status").css("visibility","visible");
		this.delegateEvents();
		this.model.set_adapter(adapter_url, self);
	},
	
    render: function(adapter_url,domain) {
        $('#secondary-nav').css('display','block');
		out  = "<h3>Backend App URL</h3>";
	    out += "<form style='margin:0'>";
	    out += "<input id='input_adapter' type='text' name='adapter_url' value='"+adapter_url+"' class='input-xlarge' placeholder='Enter Adapter URL' style='margin:0'/>";
	    out += "<input type='submit' value='Submit' class='btn btn-primary' style='margin-left:10px'/><div class='setadapter-status' style='display:inline;margin-left:10px;visibility:hidden'><span class=''></span></div>";
	    out += "</form>";
	
        $(this.el).html(out);
        $('#settings_main').html(this.el);
    }
});



Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rhoconnect-3.2.0.beta1 lib/rhoconnect/web-console/views/set_adapter.js