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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <div class="container-fluid">
  <h1>Search Wiki</h1>

  <div class="row">
    <div class="col-sm-6">
      <p>User Story: I can search Wikipedia entries in a search box and see the resulting Wikipedia entries.</p>
      
        
          <input id="query" type="text" placeholder="Search">
          <button id="search" type="button" class="btn btn-default">Submit <span class="glyphicon glyphicon-search" aria-hidden="true"></span></button>
          <button id="randomWiki" class="btn btn-primary">See Random Wiki Entry</button>
      


    </div>
  </div>

  <div class="row">
    <div class="col-md-12" id="result">
      <!--example
       <div class="bs-callout bs-callout-info">
         <div><h4>Title</h4></div>
         <div>Description</div>
         Visit Page <a href=""
       </div>-->
     
    </div>
  </div>
</div>
            
          
!

CSS

            
              /*this is fromhttp://cpratt.co/twitter-bootstrap-callout-css-styles*/
.bs-callout {
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #eee;
    border-left-width: 5px;
    border-radius: 3px;
}
.bs-callout h4 {
    margin-top: 0;
    margin-bottom: 5px;
}
.bs-callout p:last-child {
    margin-bottom: 0;
}
.bs-callout code {
    border-radius: 3px;
}
.bs-callout+.bs-callout {
    margin-top: -5px;
}
.bs-callout-default {
    border-left-color: #777;
}
.bs-callout-default h4 {
    color: #777;
}
.bs-callout-primary {
    border-left-color: #428bca;
}
.bs-callout-primary h4 {
    color: #428bca;
}
.bs-callout-success {
    border-left-color: #5cb85c;
}
.bs-callout-success h4 {
    color: #5cb85c;
}
.bs-callout-danger {
    border-left-color: #d9534f;
}
.bs-callout-danger h4 {
    color: #d9534f;
}
.bs-callout-warning {
    border-left-color: #f0ad4e;
}
.bs-callout-warning h4 {
    color: #f0ad4e;
}
.bs-callout-info {
    border-left-color: #5bc0de;
}
.bs-callout-info h4 {
    color: #5bc0de;
}
            
          
!

JS

            
              $(document).ready(function(){
  $("#randomWiki").on('click',function(e){  //console.log(e);
                                        window.open("https://en.wikipedia.org/wiki/Special:Random");
      });
  //within the doc
  $("#search").on('click',function(){
    $("#result").empty();
    var urlBase = "https://en.wikipedia.org/w/api.php?";
    var actionValue = 'query';
    var searchLimitValue = '15';
    var formatValue = 'json';
    var generatorValue = 'search';
    var orginValue ='*';
    var propValue = 'extracts';
    var query = $("#query").val();
      //console.log(query);
    var action = 'action='+actionValue+'&';
    var format = 'format='+formatValue+'&';
    var gsrlimit = 'gsrlimit='+searchLimitValue+'&';
    var generator = 'generator='+generatorValue+'&';
    var origin = 'origin='+orginValue+'&';
    var prop = 'prop='+propValue+'&';
    var gsrsearch = 'gsrsearch='+query; 
    var otherFixedValue =
  'pilimit=max&exintro&explaintext&exsentences=1&exlimit=max&';
    
    
    var pageArray = [];
    //console.log(urlBase+action+format+gsrlimit+generator+prop+origin+gsrsearch);
    $.get(urlBase+action+format+otherFixedValue+gsrlimit+generator+prop+origin+gsrsearch,function(data){
      //console.log(data.query.pages);
      for (var prop in data.query.pages){
        //console.log("obj[\'" + prop + "\'] = " + data.query.pages[prop]);
        pageArray.push(data.query.pages[prop]);
      }
      
    }).done(function(){
      //console.log(pageArray);
      for (var i=0; i<pageArray.length; i++){
      
 var headerDiv = "<div class='bs-callout bs-callout-info'>";
 var titleDiv = "<div><h4>"+pageArray[i].title+"</h4></div>";  
 var descriptionDiv = "<div>"+pageArray[i].extract+"</div>";
 var link = "<a href='https://en.wikipedia.org/?curid="+pageArray[i].pageid+"'>";
 var linkDiv = "<div>"+link+"Visit Page</a></div>";
        console.log(linkDiv);
 var closingDiv = "</div>";       
        
 $("#result").append(headerDiv+titleDiv+descriptionDiv+linkDiv+closingDiv); 
        
      }
    });
      
    
    
  });
})
            
          
!
999px

Console