Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <script src="https://tag.demandbase.com/e542b280.min.js">
</script>


<script src="https://tag.demandbase.com/e542b280.min.js"></script>
<h1 class="ct">Demandbase API Priority</h1>
<ul id="directions">
  <li>1. Fill out and submit the form with an email address and company</li>
  <li>2. Update the API priorty below the form to see how it affects the Company Profile</li>
</ul>
<div class="multiple_elements" ng-app="dragndropdemo" ng-controller="ExampleController">

  <h2>Example Form</h2>
  <div id="form-main">
    <div id="form-div" class="inner-form">
      <form class="form" id="form1">
        <p class="email">
          <input name="Email" type="text" class="feedback-input" placeholder="Email" id="Email" data-toggle="tooltip" data-placement="left" data-original-title="The Email field is attached to the Demandbase Domain API. This field has the highest default priority, which means its response will override repsonses from the IP and Company Autocomplete APIs." ng-blur="updatePriority()"/>
        </p>
        <p class="url">
          <input name="Company" type="text" class="feedback-input" id="Company" data-toggle="tooltip" data-placement="right" data-original-title="The Company field is attached to the Demandbase Company Autocompete API. Users can select their company from the dropdown." ng-blur="updatePriority()"/>
        </p>

        
        <div class="submit">
          <input type="submit" value="Submit" class="open" id="button-blue"/>
        </div>

      </form>
    </div>

    <div id="company-profile" class="inner-form">
      <h4>Company Profile</h4>
      <p> Company Name: <span id="company-name" /></p>
      <p> Industry: <span id="company-industry" /></p>
      <p> Country: <span id="company-country" /></p>
      <p> Audience: <span id="company-audience" /></p>
   </div>

    <div class="container inner-form" id="drag-drop" >
  		<div class="row">
  			<div class="span-12"><h4>Click and drag the <i class="fa fa-bars"></i> to reorder the API priority.</h4></div>
  		</div>
  		<div class="row">
  			<div class="span-12" id="information"><h5>The API priority is ordered from highest to lowest</h5></div>
  		</div>
  		<div class="row">
  			<div id="names" class="span-3 form-inline" role="form">
  				<div class="form-group has-feedback transition" ng-repeat-reorder='name in names' ng-repeat-reorder-handle="i.fa.fa-bars" >
  					<input class="form-control form-inline player" type='text' tabindex='{{$index + 1}}' ng-change='updateIndex()' ng-model='name.val' ng-class="{'last-player': $index == names.length-1}" disabled>
  					<i class="fa fa-bars form-control-feedback"></i>
  				</div>
        </div>

		  </div>
		</div>

  </div>
</div>
              
            
!

CSS

              
                .span-3 {
  width: 277px;
}

.form-group.btn {
  border: 1px solid #cccccc;
  border-top-radius: 4px;
  border-bottom-radius: 0;
  width: 208px !important;
}

.form-group, {
  float: left;
  clear: left;
  width: 240px;
}

input.form-control {
  margin-bottom: 0;
  border-radius: 0;
  border: 1px solid #cccccc;
  border-top: none;
  padding-right: 20px;
}
.row .form-group:first-child input.form-control {
  border-top: 1px solid #cccccc;
  border-top-radius: 4px;
}
.row .form-group:last-child input.form-control {
  border-bottom-radius: 4px;
}
.ng-repeat-reorder-parent, [ng-repeat-reorder]{
	z-index: 10;
	position: relative;
}
[ng-repeat-reorder].dragging{
	z-index: 11;
	position: absolute;
}
.form-group.dragging input {
  border: 1px solid #cccccc;
}
.form-group.dragging-after input {
  background-color: green;
  border-top: 1px solid #cccccc;
}
.form-group.dragging-before input {
  background-color: green;
}

#names > div:first-child{
	border-bottom-left-radius: none;
	border-bottom-right-radius: none;
}

.active-drag-below {
  -moz-user-select: none;
  -khtml-user-select: none;
  -webkit-user-select: none;
  user-select: none;
}

body {
  background: #eee;
  min-height: 520px;
}

body,
h1,
h2,
h3,
h4,
div,
button {
  font-family: helvetica;
}

.ole,
.elo {
  background: rgb(200,240,255);
  padding: 6px 36px;
  display: inline-block;
  font-size: 1.2em;
  border-radius: 4px;
  border:0;
  cursor: pointer;
  color: #000;
}

.ct {
  text-align: center
}

.ole:hover,
.elo:hover {
  background: dodgerblue;
  color: #fff;
  box-shadow: 0 0 0 #555;
}

.multiple_elements {
  padding: 30px 0 10px 0;
  text-align: center;
}

/*customizing tooltip color*/
/*right tooltip*/
.tooltip.right > .tooltip-arrow {
  border-right-color: dodgerblue;
}

/*bottom tooltip*/
.tooltip.bottom > .tooltip-arrow {
  border-bottom-color: dodgerblue;
}

/*top tooltip*/
.tooltip.top > .tooltip-arrow {
  border-top-color: dodgerblue;
}

/*left tooltip*/
.tooltip.left > .tooltip-arrow {
  border-left-color: dodgerblue;
}

/*tooltip inner*/
.tooltip > .tooltip-inner {
  background-color: dodgerblue;
}

code {
  color: royalblue;
  background-color: azure;
}

@media (max-width:640px) {
  .ole,
  .elo {
    padding: 6px 12px;
    font-size: 20px;
  }
}

#form-main{
  position: relative;
  height: 1000px;
  width: 60%;
  margin: 0 auto;
  padding: 20px;
  resize: both;

}

#form-div {
  width: 400px;
  height: 300px;
  margin: -70px 0 0 -120px;
  position: absolute;
  top: 10%;
  left: 50%;
  padding: 20px;
	background-color:rgba(72,72,72,0.4);
	padding-left:35px;
	padding-right:35px;
	padding-top:35px;
	padding-bottom:50px;
  -moz-border-radius: 7px;
  -webkit-border-radius: 7px;
}

#company-profile{
  width: 400px;
  height: 300px;
  margin: -70px 0 0 -120px;
  position: absolute;
  top: 90%;
  left: 50%;
  padding: 20px;
  background-color:rgba(72,72,72,0.4);
  padding-left:35px;
  padding-right:35px;
  padding-top:35px;
  padding-bottom:50px;
  -moz-border-radius: 7px;
  -webkit-border-radius: 7px;
}

#drag-drop{
  width: 400px;
  height: 300px;
  margin: -70px 0 0 -120px;
  position: absolute;
  top: 50%;
  left: 50%;
  padding: 20px;
  background-color:rgba(72,72,72,0.4);
  padding-left:35px;
  padding-right:35px;
  padding-top:35px;
  padding-bottom:50px;
  /*width: 450px;
  float: left;
  left: 22%;
  position: absolute;
  margin-top:30px;
  margin-left: -260px;*/
  -moz-border-radius: 7px;
  -webkit-border-radius: 7px;
}




input:hover, textarea:hover,
input:focus, textarea:focus {
	background-color:white;
}

#button-blue{
	font-family: 'Montserrat', Arial, Helvetica, sans-serif;
	float:left;
	width: 100%;
	border: #fbfbfb solid 4px;
	cursor:pointer;
	background-color: #3498db;
	color:white;
	font-size:24px;
	padding-top:22px;
	padding-bottom:22px;
	-webkit-transition: all 0.3s;
	-moz-transition: all 0.3s;
	transition: all 0.3s;
  margin-top:-4px;
  font-weight:700;
}

.feedback-input {
	color:#3c3c3c;
	font-family: Helvetica, Arial, sans-serif;
  font-weight:500;
	font-size: 18px;
	border-radius: 0;
	line-height: 22px;
	background-color: #fbfbfb;
	padding: 13px 13px 13px 54px;
	margin-bottom: 10px;
	width:100%;
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	-ms-box-sizing: border-box;
	box-sizing: border-box;
  border: 3px solid rgba(0,0,0,0);
}

.feedback-input:focus{
	background: #fff;
	box-shadow: 0;
	border: 3px solid #3498db;
	color: #3498db;
	outline: none;
  padding: 13px 13px 13px 54px;
}

.focused{
	color:#30aed6;
	border:#30aed6 solid 3px;
}

#directions{
  text-align:center;
}

ul {
  list-style-type: none;
}
              
            
!

JS

              
                angular.module("dragndropdemo", ['ngRepeatReorder'])
.controller('ExampleController', ['$scope', '$window', function($scope, $window) {
      $scope.names = [{val:'domain'},{val:'ip'},{val:'company'}];
      $scope.order = {1: $scope.names[0].val, 2: $scope.names[1].val, 3: $scope.names[2].val}
			$scope.tempplayer = '';
      
        
  
      $scope.updatePriority = function(){
        if($window.Demandbase && $window.Demandbase.IP){
          $scope.demandbase = $window.Demandbase || {};
          $scope.ip = $window.Demandbase.IP.CompanyProfile || {};
          $scope.webform =  $window.Demandbase.Connectors.WebForm || {};
          $scope.domain = $scope.webform.last_email || {};
          $scope.autocomplete = $window.Demandbase.CompanyAutocomplete || {"latest_result": {}};
          $scope.selected = $scope.autocomplete.latest_result || {"last_selected": {}}
          $scope.company = $scope.selected.last_selected || {};
          $scope.order = {3: $scope.names[0].val, 2: $scope.names[1].val, 1: $scope.names[2].val}

          if($scope[$scope.order[3]].company_name !== undefined ){
             $scope.currentPriority = $scope[$scope.order[3]]
          } else if ($scope[$scope.order[2]].company_name !== undefined ) {
             $scope.currentPriority = $scope[$scope.order[2]]
          } else if ($scope[$scope.order[1]].company_name !== undefined) {
             $scope.currentPriority = $scope[$scope.order[1]]
          } 
          $window.Demandbase.Config.updateCompanyProfile($scope.currentPriority);
        } 
      }
      
      $scope.$watchCollection('names', function() { 
        $scope.updatePriority();
      });
  
      angular.element(document).ready(function () {
          setInterval($scope.updatePriority(), 100)
      });


  
}]);

              
            
!
999px

Console