Git Product home page Git Product logo

google-form-octopress's Introduction

Google-Form-Octopress

A Liquid tag to embed Google Forms in Octopress.

Installation

The plugin requires the Nokigiri gem, so let's install that first.

  • Edit your Gemfile and add gem 'nokogiri' to it

Octopress does not have a plugin manager yet, so we'll have to do this manually. Download the files in the repo, and place them as follows:

  • google_form.rb goes in the plugins directory
  • google_form.js goes in source/javascripts

Next, add the following code to source/_includes/custom/head.html:

<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
    // Avoid conflict with ender.js.
    jQuery.noConflict();
</script>
<!-- jQuery Form Plugin -->
<script src="http://malsup.github.com/jquery.form.js"></script>
<!-- jQuery Form Validation Plugin -->
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script> 
<script src="{{ root_url }}/javascripts/google_form.js"></script>

Finally, add some custom CSS to make our forms look shiny. This goes in sass/custom/_styles.scss.

.google-form-wrapper {
  .error {
    color: red;
    font-size: 12px;
  }
  .errorbox-good {
    margin-bottom: 20px;
  }
  .success-msg {
    display: none;
  }
  .ss-form-entry {
    label {
      display:block;
    }
    input {
      display: block;
      padding: 5px;
      width: 250px;
      font: inherit;
    }
    textarea {
      width: 450px;
      padding: 5px;
      font: inherit;
    }
  }
  .ss-navigate input {
    width: auto;
    cursor: pointer;
  }
}

Usage

{% google_form formkey [message] %}

Example :

{% google_form dGVfY3MwcklDcjVrZERGYlRoZWdJQnc6MQ Thank you. I'll get back to you shortly %}

google-form-octopress's People

Contributors

shadcn avatar chsh avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.