prisskreative
4/20/2016 - 2:34 PM

Javascript

Javascript

Outcome
How we do it to be the best in XXX

Ask good questions

Change the question? change the outcome?
specific - clear outcome

Why - purpose

My map not to do list

1 - What I really want? outcome
2 - Why you want to do that?
3 - How we do it?

I - Want to feed 1000000 kids in the world
2 - Why because I’m going to feel fulfillment

Think about - planning as creating something

We have some healthy food instead we have a delicious food 
phrase it that create people to want something

Power languages produce passion
You rock!!

passion - love - make a difference - make an impact - have fun
words that move you

transform my life
transform the marketing department move it to a new level

Mapping

this are the outcome of my marketing

Chunking

categories business 
marketing
team
content
sales
community
financiam

categories live
health
love

Personal
Professional 

wheel
0 to 10%

Most important in that area to keep moving

What I going to do to improve my skills
What I going to do to 

consecuencias of not achieving that goal
// or use getRandomUserInfo( $('.panel:first') )
function getRandomUserInfo( panelElement ) {
	return $.ajax({
		url: 'http://api.randomuser.me/?nat=us',
		type: 'GET',
		dataType: "json",
		//jsonp: "callback",
		error: function(xhr, ajaxOptions, thrownError) {
			console.log( xhr, ajaxOptions, thrownError );
		},
		success: function(data){
			console.log("Random Data", data);
			var $person = data.results[0].user || data.results[0];

			$(panelElement).find('input[data-id="first_name"]').val( $person.name.first );
			$(panelElement).find('input[data-id="last_name"]').val( $person.name.last );

			$(panelElement).find('input[data-id="email"]').val(  $person.email);
			$(panelElement).find('input[data-id="line1"]').val( $person.location.street );
			//$(panelElement).find('input[data-id="line2"]').val();
			$(panelElement).find('input[data-id="city"]').val( $person.location.city );

			$(panelElement).find('select[data-id="country_code"]').val(  );
			$(panelElement).find('select[data-id="state_code"]').val(  );

			$(panelElement).find('input[data-id="zip"]').val( $person.location.zip );
			$(panelElement).find('input[data-id="phone_number"]').val( $person.phone );
			$(panelElement).find('select[data-id="gender_code"]').selectpicker( 'val', $person.gender == "male" ? "M" : "F");

			$(panelElement).find('select[data-id="birth_month"]').val( Math.floor(Math.random() * 12) + 1 );
			$(panelElement).find('select[data-id="birth_day"]').val( Math.floor(Math.random() * 25) + 1 );
			$(panelElement).find('select[data-id="birth_year"]').selectpicker( 'val', Math.floor(Math.random() * 63) + 1932 );


			$(panelElement).find('input[data-id="emergency_contact_name"]').val( $person.username );
			$(panelElement).find('input[data-id="emergency_contact_phone_number"]').val( $person.cell );

			setTimeout(function(){
				if( $(panelElement).find('select[data-id="shirt_size_code"]').find('option').length > 1 ) {
					var randomShirt = $(panelElement).find('select[data-id="shirt_size_code"]').find('option').not(':first').get().sample(),
						randomState = $(panelElement).find('select[data-id="state_code"]').find('option').not(':first').get().sample(),
						randomCard = [4242424242424242,4012888888881881,4000056655665556,5555555555554444,5200828282828210,5105105105105100,378282246310005,371449635398431,6011111111111117,6011000990139424].sample();
						randomState.attr('selected',true);
						randomShirt.attr('selected',true);

					$(panelElement).find('select.selectpicker').selectpicker('refresh');					
					$('#credit_card_number').val(randomCard)
					$('#credit_card_name').val( $person.name.first + " " + $person.name.last );
					$('#credit_card_cvc').val(123);
				}	
			}, 200);

		}
	});
}
// put value angular binding

$(document).on("click", ".btn-save-event-master", function(event){
			
		var $this = $(this),
			$parent = $this.closest('#settings'),
			url = $this.attr('data-url'),
			options = {
				type: 'PUT',
				dataType: "json",
				data: { event_master : {
						name : $parent.find('input#event_master_name').val(),
						public_domain : $parent.find('#event_master_public_domain').val()
					}
				},
				loader: function(){ loader() },
				submitBtn: function(){ $this.toggleClass('disabled') },
			};

		loaderPosition(event);
		_ajax(url, options)
		.done(function(data){
			if( data.success ) {
				smart_notice({message: "Successfully updated the event master settings.", type: "success"});
			}
		});
			
	});

	$(document).on("keyup", "#event_master_name", function(event){
			$('#event_master_public_domain').val( $(this).val() );
	});


});


<div class="container">
	<div class="row event-masters-settings">
		<div class="col-md-8">
			<div class="title"> Event Group Settings</div>
			<div class="sub-title"> What's do you want your event group settings to be?</div>

			<%= form_for @event_master do |event_master| %>
				<div class="form-container row form-adjust">
					<div class="form-group col-xs-12" data-method="type-update">
						<%= event_master.label(:name, "Event Group Name", :class => "alt-label") %>
						<%= event_master.text_field :name, class: "form-control initial-focus", :required => ''  %>
					</div>
				</div>
			

			<label class="alt-label">Event group url</label><br>
				<%= link_to "#{EVT_URL}/#{@event_master.public_domain}", "#{EVT_URL}/#{@event_master.public_domain}", :target=>'_blank' %>
				<%= event_master.text_field :public_domain, class: "form-control", :required => ''  %>
			<button type="button" class="preview-btn btn btn-primary bold-btn" data-clipboard-text="">Copy Link</button>
			<% end %>
		</div>
	</div>
</div>

<footer class="footer">
	<div class="info col-md-12">
		<span class="pull-right">
			<%= button_tag @button_name, class: "btn btn-save btn-footer btn-save-event-master", :'data-url' => event_master_path(@event_master) %>
		</span>
	</div>
</footer>