diff --git a/CHANGES.md b/CHANGES.md deleted file mode 100644 index 4e5d372..0000000 --- a/CHANGES.md +++ /dev/null @@ -1,9 +0,0 @@ -Changes -======= - -0.1 (20-04-2014) -------------------- - -- First release - - diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 78dfa85..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) [2014] [Andres Jorquera] - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 3d78ec8..0000000 --- a/README.md +++ /dev/null @@ -1,190 +0,0 @@ -EasyText Plugin for the jQuery Library -======================================= - - -![Image.png...](http://static.jortech.com.ve/jquery-easytext/image.png) - -EasyText is a plugin built on top of jQuery. It enhances the behaviour -of the HTML input element of type text. It's inspired by the input in Google -Contacts. It is still in beta. - -This plugin was built using the jQuery UI Widget Factory. For more information -[click here](http://learn.jquery.com/jquery-ui/widget-factory/) - -**Current Version:** 0.1 - -Features ------------------------------------------------------------------------------- -- Auto-resize input. - -- Overall look of the input for intuitive editing. - -- Store all the values the user has typed in for the session or permanently. - -- Ajax capabilities to send requests to a RESTful service, enabling the - possibility to store the value in a database as soon as the user has typed in - a value - -Requirements --------------------------------------------------------------------------------- -- [jQuery](http://jquery.com/) -- [jQuery UI](http://jqueryui.com/) - -Browser Compatibility --------------------------------------------------------------------------------- -Chrome: **```34+```** - -Firefox: **```28+```** - -Internet Explorer     **`Not yet tested`** - -Safari     **`Not yet tested`** - -Opera     **`Not yet tested`** - -Usage --------------------------------------------------------------------------------- - - -```javascript -$('input[type="text"]').EasyText(attributes); -``` - -```attributes``` is an optional javascript object with the parameters explained - below: - -Attributes --------------------------------------------------------------------------------- - -- **maxWidth** ```number``` *(Default: 200)* - - The maximum size in pixels for the input. - -- **minWidth** ```number``` *(Default: 80)* - - The minimum size for the input. - -- **values** ```array``` - - It is an array containing all the values of the input in the same order the - user has typed in. The plugin will store all the values, regardless the type - of storage used. To delete the values, use the public method - *deleteStorage()* - -- **maxChars** ```number``` *(Default 200)* - - The maximum amount of characters that are allowed in the input. - - -- **storage** ```string``` *(Default 'array')* - - It can have 3 different values: - - 1. **array**: it will store all values from the input in an array. - - 2. **localStorage**: it will store all the values in the browser local storage - so it can be accessed later - - 3. **ajax**: It uses ajax capabilities to send request to a RESTful service. - This way,the value can be store in a database behind the scenes. - For more information about RESTful philosophy see the wiki page - -> [RESTful](http://en.wikipedia.org/wiki/Representational_state_transfer) - - -- **ajaxConfig** - - Single level object that contains: - - - **url**:`string` the url where to send the RESTful requests; - e.g., ```domain/API/``` - - - **id**:`string` The identification string to form the uri; - e.g., ```domain/API/id``` - - - **GETCallback**:`function` it process the GET request response. - This function corresponds to the success parameter in the - $.ajax() method described - [here](https://api.jquery.com/jQuery.ajax/). If this - parameter is not set, the plugin will not send a GET - request when it is instantiated. The parameters are: - - * **data:** ```PlainObject```javaScript object containing zero or more - key-value pairs. - - * **status:** ```String``` a string describing the status of the - request. More [Info](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html). - * **jqXHR:** ```jqXHR``` a superset of the browser's native - XMLHttpRequest object. More [info](http://api.jquery.com/jQuery.ajax/#jqXHR). - - e.g. - ```javascript - function callback(data,status,jqXHR) { - //code... - } - ``` - - - - **UPDATETemplate**: `string` string using John's Resig javascript - [Micro-Templating](http://ejohn.org/blog/javascript-micro-templating/) - function. Using this templating system, allows to transfer - any information using any type of format like for example - JSON,XML,YAML,etc. For refering to the input's value, in the - string should be a value key that will be replace with actual - value. e.g. "<%= value %>" - - - **UPDATEData**: ```PlainObject``` javaScript object containing zero or - more key-value pairs. - It will contain all the parameters for the UPDATETemplate. - For each request, the object will contain the actual value - of the input in the form " value: 'string' " - -Methods --------------------------------------------------------------------------------- -- **getNextBackValue:** -gets the previous or the next value of all the values that have been store in -the values attribute. Has a direction parameter that acts like a flag. If it is -true it will get the next value otherwise the previous one. Return -1 if it gets -to the extreme of the array. - -- **deleteStorage** -It will delete all the saved values. It will have different behaviours depending -on the type of storage. - - **array**: it will delete the values store in the values attribute. - - **localStorage**: it will delete the information store in the browser's local storage - - **ajax**: it will send a delete request to the RESTful service. - -####Method Invocation - -Because the plugin uses the jQuery UI Widget Factory, there are two especific -ways of calling the public methods. More -[information](http://learn.jquery.com/jquery-ui/widget-factory/widget-method-invocation/). - -#####Plugin Invocation -To invoke a method using the widget's plugin, pass the name of the method as a -string. If the method requires arguments, pass them as additional parameters -to the plugin. - -```javascript -$('input[type="text"]').easyText('getNextBackValue','true') -``` - -#####Instance Invocation -Under the hoods, every instance of every widget is stored on the element using -[jQuery.data()](http://api.jquery.com/jQuery.data/). To retrieve the instance -object, call jQuery.data() using the -widget's full name "easyInputEasyText". - -```javascript -var jQueryObject = $('input[type="text"]').easyText(); - -var easyText = jQueryObject.data('easyInputEasyText'); - -easyText.deleteStorage(); - -``` - -Demo --------------------------------------------------------------------------------- -You can see an example in the following -[link](http://static.jortech.com.ve/jquery-easytext/). - diff --git a/easyText.jquery.json b/easyText.jquery.json deleted file mode 100644 index a23cb56..0000000 --- a/easyText.jquery.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name":"easyText", - "version":"0.1.2", - "title":"easyText", - "description":"Plugin that enhances the behaviour of the HTML input element of type text, offering some unique features. It provides ajax and localStorage capabilities for saving the input's value", - "author":{ - "name":"Andres Jorquera", - "email":"jorquerad@jortech.com.ve", - "url":"http://ajorquera.jortech.com.ve/" - }, - "keywords":[ - "input", - "text", - "ajax", - "autogrown", - "ui", - "form" - ], - - "licenses":[ - { - "type": "MIT", - "url": "https://github.com/ajorquera/jQuery-EasyText/LICENSE.md" - } - ], - "download": "https://github.com/ajorquera/jQuery-EasyText/releases", - "homepage": "http://ajorquera.jortech.com.ve/proyects/easytext/", - "bugs": "https://github.com/ajorquera/jQuery-EasyText/issues", - "dependencies": { - "jquery": ">=1.10.0", - "jquery-ui":">=1.10.0" - - } - -} diff --git a/images/body-bg.jpg b/images/body-bg.jpg new file mode 100644 index 0000000..0e0f861 Binary files /dev/null and b/images/body-bg.jpg differ diff --git a/images/download-button.png b/images/download-button.png new file mode 100644 index 0000000..df3f09a Binary files /dev/null and b/images/download-button.png differ diff --git a/images/github-button.png b/images/github-button.png new file mode 100644 index 0000000..efe07f9 Binary files /dev/null and b/images/github-button.png differ diff --git a/images/header-bg.jpg b/images/header-bg.jpg new file mode 100644 index 0000000..960bff7 Binary files /dev/null and b/images/header-bg.jpg differ diff --git a/images/highlight-bg.jpg b/images/highlight-bg.jpg new file mode 100644 index 0000000..4c4a78e Binary files /dev/null and b/images/highlight-bg.jpg differ diff --git a/images/sidebar-bg.jpg b/images/sidebar-bg.jpg new file mode 100644 index 0000000..42890fe Binary files /dev/null and b/images/sidebar-bg.jpg differ diff --git a/index.html b/index.html index ded95fa..443c4fa 100644 --- a/index.html +++ b/index.html @@ -1,75 +1,262 @@ - - - EasyText Plugin - - - - - - - -

EasyText Testing ...

- -

Default

- - -

Changing the default attributes..

- - - -

Storage Feature

- - - - - - - - + + + + + + + + + + + + EasyText For jQuery by ajorquera + + + +
+
+

EasyText For jQuery

+

+ View project onGitHub +
+
+ +
+
+
+

+EasyText Plugin for the jQuery Library

+ + + +

Image.png...

+ +

EasyText is a plugin built on top of jQuery. It enhances the behaviour +of the HTML input element of type text. It's inspired by the input in Google +Contacts. It is still in beta.

+ +

This plugin was built using the jQuery UI Widget Factory. For more information +click here

+ +

Current Version: 0.1

+ +

+Features

+ +
    +
  • Auto-resize input.

  • +
  • Overall look of the input for intuitive editing.

  • +
  • Store all the values the user has typed in for the session or permanently.

  • +
  • Ajax capabilities to send requests to a RESTful service, enabling the +possibility to store the value in a database as soon as the user has typed in +a value

  • +

+Requirements

+ +

+Browser Compatibility

+ +

Chrome: 34+

+ +

Firefox: 28+

+ +

Internet Explorer     Not yet tested

+ +

Safari     Not yet tested

+ +

Opera     Not yet tested

+ +

+Usage

+ + + +
$('input[type="text"]').EasyText(attributes);
+
+ +

attributes is an optional javascript object with the parameters explained + below:

+ +

+Attributes

+ +
    +
  • +

    maxWidth number (Default: 200)

    + +

    The maximum size in pixels for the input.

    +
  • +
  • +

    minWidth number (Default: 80)

    + +

    The minimum size for the input.

    +
  • +
  • +

    values array

    + +

    It is an array containing all the values of the input in the same order the +user has typed in. The plugin will store all the values, regardless the type +of storage used. To delete the values, use the public method +deleteStorage()

    +
  • +
  • +

    maxChars number (Default 200)

    + +

    The maximum amount of characters that are allowed in the input.

    +
  • +
  • +

    storage string (Default 'array')

    + +

    It can have 3 different values:

    + +
      +
    1. array: it will store all values from the input in an array.

    2. +
    3. localStorage: it will store all the values in the browser local storage + so it can be accessed later

    4. +
    5. ajax: It uses ajax capabilities to send request to a RESTful service. + This way,the value can be store in a database behind the scenes. + For more information about RESTful philosophy see the wiki page + -> RESTful

    6. +
    +
  • +
    +
  • +

    ajaxConfig

    + +

    Single level object that contains:

    + +
      +
    • url:string the url where to send the RESTful requests; + e.g., domain/API/

    • +
    • id:string The identification string to form the uri; + e.g., domain/API/id

    • +
    • +

      GETCallback:function it process the GET request response. + This function corresponds to the success parameter in the + $.ajax() method described + here. If this + parameter is not set, the plugin will not send a GET + request when it is instantiated. The parameters are:

      + +
        +
      • data: PlainObjectjavaScript object containing zero or more + key-value pairs.

      • +
      • status: String a string describing the status of the + request. More Info.

      • +
      • +jqXHR: jqXHR a superset of the browser's native + XMLHttpRequest object. More info.
      • +
      +

      e.g.

      + +
      function callback(data,status,jqXHR) {
      +    //code...
      +}
      +
      +
    • +
    • UPDATETemplate: string string using John's Resig javascript + Micro-Templating + function. Using this templating system, allows to transfer + any information using any type of format like for example + JSON,XML,YAML,etc. For refering to the input's value, in the + string should be a value key that will be replace with actual + value. e.g. "<%= value %>"

    • +
    • UPDATEData: PlainObject javaScript object containing zero or + more key-value pairs. + It will contain all the parameters for the UPDATETemplate. + For each request, the object will contain the actual value + of the input in the form " value: 'string' "

    • +
    +
  • +

+Methods

+ +
    +
  • getNextBackValue: +gets the previous or the next value of all the values that have been store in +the values attribute. Has a direction parameter that acts like a flag. If it is +true it will get the next value otherwise the previous one. Return -1 if it gets +to the extreme of the array.

  • +
  • +

    deleteStorage +It will delete all the saved values. It will have different behaviours depending +on the type of storage.

    + +
      +
    • +array: it will delete the values store in the values attribute.
    • +
    • +localStorage: it will delete the information store in the browser's local storage
    • +
    • +ajax: it will send a delete request to the RESTful service.
    • +
    +
  • +

+Method Invocation

+ +

Because the plugin uses the jQuery UI Widget Factory, there are two especific +ways of calling the public methods. More +information.

+ +
+Plugin Invocation
+ +

To invoke a method using the widget's plugin, pass the name of the method as a +string. If the method requires arguments, pass them as additional parameters +to the plugin.

+ +
$('input[type="text"]').easyText('getNextBackValue','true')
+
+ +
+Instance Invocation
+ +

Under the hoods, every instance of every widget is stored on the element using +jQuery.data(). To retrieve the instance +object, call jQuery.data() using the +widget's full name "easyInputEasyText".

+ +
var jQueryObject = $('input[type="text"]').easyText();
+
+var easyText = jQueryObject.data('easyInputEasyText');
+
+easyText.deleteStorage();
+
+
+ +

+Demo

+ +

You can see an example in the following +link.

+
+ + +
+
+ + + + \ No newline at end of file diff --git a/javascripts/main.js b/javascripts/main.js new file mode 100644 index 0000000..d8135d3 --- /dev/null +++ b/javascripts/main.js @@ -0,0 +1 @@ +console.log('This would be the main JS file.'); diff --git a/jquery.easyText.js b/jquery.easyText.js deleted file mode 100644 index af70b25..0000000 --- a/jquery.easyText.js +++ /dev/null @@ -1,550 +0,0 @@ -/*jslint nomen: true */ - -/** - * @fileOverview EasyEdit - A jQuery plugin for the input dom element of type text - * @author Andres Jorquera - * @version 0.2 - * @requires jQuery - * @namespace easyInput.easyText - * TODO Must set the new values if the storage option changes - */ - -;(function ($, window, document, undefined) { - 'use strict'; - - var NAMESPACE = 'easyInput', - PLUG_NAME = 'easyText', - // constant use for events handlers to get the plugin instance using - //$(this).data(NAME_SPAC_PLUG) - NAME_SPAC_PLUG = NAMESPACE + PLUG_NAME.charAt(0).toUpperCase() + - PLUG_NAME.slice(1); - - /** - * Description of the plugin - * - */ - - $.widget(NAMESPACE + '.' + PLUG_NAME, { - - options: { - /** - * The current value of the input element - * @type String - * @default '' - */ - currentValue: '', - - /** - * A custom array containing values for the input element - * @type Array - * @default [] - */ - values: [], - - /** - * Max width in pixels for the input element. - * @type Number - * @default 200 - */ - maxWidth: 200, - /** - * Min width for the input element in pixels fo the input element. - * @type number - * @default 80 - */ - minWidth: 80, - /** - * Maximum number of characters permitted in the input. - * @type number - * @default 200 - */ - maxChars: 200, - /** - * Type of storage use for the input element. - * @type string - * @default 'array' - */ - storage: 'array', - /** - * Configuration options for the ajax requests - * @type object - */ - ajaxConfig: { - url: '/', - id: '', - UPDATETemplate: '', - UPDATEData: {}, - GETCallback: null - } - }, - //--------------------------------------------------------------------- - // PRIVATE PROPERTIES - //--------------------------------------------------------------------- - - /** - * Holder for the name of the plugin. - * @type string - * @private - */ - _name: PLUG_NAME, - /** - * Holder for the input Jquery object. - * @type Jquery object - * @private - */ - _input:null, - /** - * Holder for the id of the input. - * @type string - * @private - */ - _id:null, - /** - * Holder for the current position of the current value in the - * values attribute. It's use by the getNextBackValue public function - * @type number - * @private - */ - _valuesIndex:null, - /** - * Holder for the class-name for the 'unChange'. Its the look of the - * input when it hasn't been modified - * @type String - * @private - */ - _classUnChanged:null, - /** - * Holder for the class-name for the 'empty'. The look of the input - * when it's empty - * @type String - * @private - */ - _classEmpty:null, - /** - * Holder for the class-name for the 'onEdit'.The look of the input - * when it's been edited - * @type String - * @private - */ - _classOnEdit: null, - /** - * Holder for the class-name for the "changed". The look of the input - * when it's has been changed - * @type String - * @private - */ - _classChanged:null, - /** - * Holder for the class-name of the input. It will be a class for the - * input that has the plugin. - * @type String - * @private - */ - _classEasyText:PLUG_NAME.toLowerCase(), - -//----------------------------------------------------------------------------- -// PRIVATE FUNCTIONS -//----------------------------------------------------------------------------- - /** - * Add listeners to the input - * @private - */ - _setListeners:function() { - this._input.bind({ - focus: this._focusBehaviour, - input: this._autoGrownBehaviour, - blur: this._blurBehaviour, - storageChange: this._storageChange - }); - }, - - /** - * Function that it's inspired in the getClassName function from the YUI - * widget library. - * reference: http://yuilibrary.com/yui/docs/api/files/widget_js_Widget.js.html#l309 - * FIXME re-think this function - * @private - */ - _getClassName: function(str) { - return this._name.toLowerCase() + '-' + str; - }, - /** - * Sets the name for all the classes - * @private - */ - _setClassNames: function() { - // set classes names - this._classOnHover = this._getClassName('onHover'); - this._classUnChanged = this._getClassName('unChanged'); - this._classOnEdit = this._getClassName('onEdit'); - this._classChanged = this._getClassName('changed'); - this._classEmpty = this._getClassName('empty'); - - }, - /** - * Sets initial values for private variables - * @private - */ - _setVars: function() { - var input = this.element; - - //save the host node to the private variable - this._input = input; - - //creates an unique id in the element - input.uniqueId(); - - //saves the current position for the values attribute - this._valuesIndex = 0; - - //sets the id - this._id = this._name + '-' + input.attr('id'); - - //set the maximum characters allow in the input - input.attr('maxLength',this.options.maxChars); - }, - /** - * Creates a span element with the purpose for measuring the length in - * pixels. - * @private - */ - _setRuler: function() { - var rulerID = '#' + this._name + '-ruler', - ruler = $(rulerID), - input = this._input; - - // check if a ruler already exist - if (!ruler.length) { - //NOTE maybe we shouldn't augment the string object - String.prototype.visualLength = function() { - var ruler = $(rulerID); - //we need to escaped spaces - ruler.html(this.replace(/&/g, '&').replace(/\s/g,' ') - .replace(//g, '>')); - - return ruler.width(); - }; - /* It will copy the same font family and size. Must be - * careful because if the font doesn't match it will not grown in the - * same way as the ruler - */ - ruler = $(''); - - ruler.css({ - fontSize:input.css('fontSize'), - fontFamily:input.css('font-family'), - fontWeight:input.css('fontWeight'), - position:'absolute', - visibility:'hidden', - //hides the ruler and breaks the text to avoid overflow - whiteSpace: 'nowrap' - }); - $('body').after(ruler); - } - }, - /** - * Prepares the configuration object for the ajax request. - * @private - */ - _initializeAjax: function() { - var ajaxConfig = this.options.ajaxConfig; - - //checks if there's a callback in the configuration object. - //Do not send request if not - if (!$.isFunction(ajaxConfig.GETCallback)) return; - - if (ajaxConfig.url.charAt(ajaxConfig.url.length - 1) !== '/') { - ajaxConfig.url += '/'; - } - - if (!ajaxConfig.id) { - ajaxConfig.id = this._id; - } - - $.ajax({ - url:ajaxConfig.url + ajaxConfig.id, - succes:ajaxConfig.GETCallback - }); - }, - /** - * Checks and sets the state for the input element - * @private - */ - _setState:function() { - var input = this._input, - text = input.val(), - visualLenText = text.visualLength(), - minWidth = this.options.minWidth, - maxWidth = this.options.maxWidth, - width; - - if (visualLenText < minWidth) { - width = minWidth; - } else if (maxWidth < visualLenText) { - width = maxWidth; - } else { - width = visualLenText; - } - - input.width(width); - - //set the appropriate classes - if (input.val().length === 0){ - //TODO do it in one call - input.removeClass(this._classChanged); - input.addClass(this._classEmpty); - } else { - input.addClass(this._classChanged); - } - }, - - /** - * Set the behaviour when the input gets clicked - * @private - */ - _focusBehaviour: function() { - var that = $(this).data(NAME_SPAC_PLUG), - input = that._input; - - input.removeClass(that._classChanged + ' ' + - that._classUnChanged + ' ' + - that._classEmpty) - .addClass(that._classOnEdit); - }, - - /** - * Function that controls the auto-grown behaviour of the input - * @private - */ - _autoGrownBehaviour: function() { - var that = $(this).data(NAME_SPAC_PLUG), - input = that._input, - text = input.val(), - minWidth = that.options.minWidth, - maxWidth = that.options.maxWidth, - width = text.visualLength(); - - if (width < minWidth) { - width = minWidth; - } else if (width > maxWidth) { - width = maxWidth; - } - - input.width(width); - }, - /** - * Function that is trigger when the input loses focus. - * @private - */ - _blurBehaviour: function(){ - var that = $(this).data(NAME_SPAC_PLUG), - input = that._input, - value = input.val(), - ajaxConfig = that.options.ajaxConfig, - UPDATETemplate; - - input.removeClass(that._classOnEdit); - - //check if the field if empty. Don't store values if it is - if (value.length === 0) { - input.addClass(that._classEmpty); - - } else { - - input.addClass(that._classChanged); - that.option('values',value); - - //TODO check this, not sure if it is the best way to do it - that._valuesIndex = that.option('values').length - 1; - - //ajax feature - if (that.options.storage === 'ajax') { - ajaxConfig.UPDATEData.value = input.val(); - - $.ajax({ - url: ajaxConfig.url + ajaxConfig.id, - data: that._tmpl(ajaxConfig.UPDATETemplate, - ajaxConfig.UPDATEData), - type: 'UPDATE' - }); - } - } - that._setState(); - }, - - /** - * Simple JavaScript Templating - * John Resig - http://ejohn.org/ - MIT Licensed - * ref:http://ejohn.org/blog/javascript-micro-templating/ - * @private - */ - _tmpl : function(str, data) { - // Figure out if we're getting a template, or if we need to - // load the template - and be sure to cache the result. - var fn = typeof(str) !== 'string' ? - (function(){throw { - name: 'Invalid Parameter', - message: 'You must insert a string into the function' - }}()): - - // Generate a reusable function that will serve as a template - // generator (and which will be cached). - new Function("obj", - "var p=[],print=function(){p.push.apply(p,arguments);};" + - - // Introduce the data as local variables using with(){} - "with(obj){p.push('" + - - // Convert the template into pure JavaScript - str - .replace(/[\r\t\n]/g, " ") - .split("<%").join("\t") - .replace(/((^|%>)[^\t]*)'/g, "$1\r") - .replace(/\t=(.*?)%>/g, "',$1,'") - .split("\t").join("');") - .split("%>").join("p.push('") - .split("\r").join("\\'") - + "');}return p.join('');"); - - // Provide some basic currying to the user - return data ? fn( data ) : fn; - }, - /** - * Setter function for the options of the plugin - * @param {string} key - key string for the option value - * @param {string} value - value for the option - * @private - */ - _setOption: function(key, value) { - var options = this.options; - - switch (key) { - - case 'values': - //adds a new value to the array - options.values.push(value); - - //saves the value on the local storage if it applies. - //Add instead of replace. - if (options.storage === 'localStorage') { - localStorage.setItem(this._id,JSON.stringify(options.values)); - } - - return; - case 'currentValue': - this.option('values',value); - this._input.val(value); - break; - } - this._super("_setOption", key, value); - - }, - /** - * Function that automatically runs the first time the plugin is - * instantiated. - * @private - */ - _create: function () { - var values, - input, - storage = this.options.storage; - - this._setClassNames(); - this._setVars(); - this._setListeners(); - - - input = this._input; - //TODO re-think this - input.addClass(this._classEasyText); - - //check the type of storage - if (storage === 'localStorage') { - - //Check if there's some initial value in the localStorage - if (localStorage[this._id]) { - values = JSON.parse(localStorage[this._id]); - this.options.values = values; - - input.val(values[values.length - 1]); - this._valuesIndex = values.length - 1; - } - - //ajax feature. Sends a GET request to the the web service. - //TODO Not sure of this. With server side scripting we can write the - // values on the input. - } else if (storage === 'ajax') { - this._initializeAjax(); - } - - //create a ruler to measure the text in pixels - this._setRuler(); - this._setState(); - }, - /** - * Destroy an instantiated plugin and clean up - * @private - */ - destroy: function () { - //removes any classes - this._input.attr('class',''); - $.Widget.prototype.destroy.call(this); - }, - - /** - * Deletes the storage for all the values. - * @public - */ - deleteStorage: function() { - var ajaxConfig = this.options.ajaxConfig, - typeStorage = this.options.storage; - - if (typeStorage === 'localStorage') { - localStorage.removeItem(this._id); - - } else if (typeStorage === 'ajax') { - $.ajax({ - url: ajaxConfig.url + ajaxConfig.id, - type: 'DELETE' - }); - } - - this.options.values = []; - this._input.val(''); - this._setState(); - }, - /** - * Get the value store before or after the current value. - * @param {boolean} direction - Flag use to set the direction of the - * searched value. True is next value - * and false is the previous value. - * @public - */ - getNextBackValue:function(direction) { - var values = this.option('values'), - index = this._valuesIndex; - - if (direction === undefined) { - direction = true; - } - - //check valid direction - if (typeof(direction) !== 'boolean') { - throw new Error('Invalid parameter'); - } - - //check if next or back - index += direction ? 1 : (-1); - - //check if we are in one extreme - if (values[index] === undefined) return -1; - - this._valuesIndex = index; - this._input.val(values[index]); - - this._setState(); - - return values[index]; - } - }); -})(jQuery, window, document ); \ No newline at end of file diff --git a/main.css b/main.css deleted file mode 100644 index ceb8956..0000000 --- a/main.css +++ /dev/null @@ -1,25 +0,0 @@ -/*Tips - - Having a border, move slightly the element, so we put a transparent border. - ref: http://stackoverflow.com/questions/8625812/css-hover-border-makes-inline-elements-adjust-slightly -*/ - -.easytext-empty { - border:1px solid #C7C5C5; -} - -.easytext-onEdit { - /*reference http://stackoverflow.com/questions/4750477/input-focus-outer-glow*/ - border:1px solid #C7C5C5; - -webkit-box-shadow:0 0 6px #007eff; - -moz-box-shadow:0 0 5px #007eff; - box-shadow:0 0 5px #007eff; - outline: none; -} - -.easytext:hover { - border:1px solid #C7C5C5; -} - -.easytext-changed { - border:1px solid transparent; -} diff --git a/params.json b/params.json new file mode 100644 index 0000000..1594c82 --- /dev/null +++ b/params.json @@ -0,0 +1 @@ +{"name":"EasyText For jQuery","tagline":"","body":"EasyText Plugin for the jQuery Library \r\n=======================================\r\n \r\n\r\n![Image.png...](http://static.jortech.com.ve/easyText/image.png)\r\n \r\nEasyText is a plugin built on top of jQuery. It enhances the behaviour \r\nof the HTML input element of type text. It's inspired by the input in Google \r\nContacts. It is still in beta. \r\n\r\nThis plugin was built using the jQuery UI Widget Factory. For more information\r\n[click here](http://learn.jquery.com/jquery-ui/widget-factory/)\r\n\r\n**Current Version:** 0.1\r\n\r\nFeatures\r\n------------------------------------------------------------------------------\r\n- Auto-resize input.\r\n\r\n- Overall look of the input for intuitive editing.\r\n\r\n- Store all the values the user has typed in for the session or permanently.\r\n\r\n- Ajax capabilities to send requests to a RESTful service, enabling the \r\n possibility to store the value in a database as soon as the user has typed in \r\n a value \r\n\r\nRequirements\r\n--------------------------------------------------------------------------------\r\n- [jQuery](http://jquery.com/) \r\n- [jQuery UI](http://jqueryui.com/) \r\n\r\nBrowser Compatibility\r\n--------------------------------------------------------------------------------\r\nChrome: **```34+```**\r\n\r\nFirefox: **```28+```**\r\n\r\nInternet Explorer     **`Not yet tested`**\r\n\r\nSafari     **`Not yet tested`**\r\n\r\nOpera     **`Not yet tested`**\r\n\r\nUsage \r\n--------------------------------------------------------------------------------\r\n\r\n\r\n```javascript\r\n$('input[type=\"text\"]').EasyText(attributes);\r\n```\r\n\r\n```attributes``` is an optional javascript object with the parameters explained \r\n below:\r\n\r\nAttributes\r\n--------------------------------------------------------------------------------\r\n\r\n- **maxWidth** ```number``` *(Default: 200)* \r\n\r\n The maximum size in pixels for the input.\r\n\r\n- **minWidth** ```number``` *(Default: 80)* \r\n\r\n The minimum size for the input.\r\n\r\n- **values** ```array```\r\n\r\n It is an array containing all the values of the input in the same order the \r\n user has typed in. The plugin will store all the values, regardless the type \r\n of storage used. To delete the values, use the public method \r\n *deleteStorage()*\r\n\r\n- **maxChars** ```number``` *(Default 200)*\r\n\r\n The maximum amount of characters that are allowed in the input. \r\n\r\n\r\n- **storage** ```string``` *(Default 'array')*\r\n\r\n It can have 3 different values: \r\n\r\n 1. **array**: it will store all values from the input in an array. \r\n\r\n 2. **localStorage**: it will store all the values in the browser local storage \r\n so it can be accessed later\r\n\r\n 3. **ajax**: It uses ajax capabilities to send request to a RESTful service. \r\n This way,the value can be store in a database behind the scenes.\r\n For more information about RESTful philosophy see the wiki page \r\n -> [RESTful](http://en.wikipedia.org/wiki/Representational_state_transfer)\r\n\r\n\r\n- **ajaxConfig** \r\n\r\n Single level object that contains:\r\n\r\n - **url**:`string` the url where to send the RESTful requests; \r\n e.g., ```domain/API/```\r\n\r\n - **id**:`string` The identification string to form the uri; \r\n e.g., ```domain/API/id```\r\n\r\n - **GETCallback**:`function` it process the GET request response. \r\n This function corresponds to the success parameter in the \r\n $.ajax() method described \r\n [here](https://api.jquery.com/jQuery.ajax/). If this \r\n parameter is not set, the plugin will not send a GET \r\n request when it is instantiated. The parameters are:\r\n \r\n * **data:** ```PlainObject```javaScript object containing zero or more \r\n key-value pairs. \r\n \r\n * **status:** ```String``` a string describing the status of the \r\n request. More [Info](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html).\r\n * **jqXHR:** ```jqXHR``` a superset of the browser's native \r\n XMLHttpRequest object. More [info](http://api.jquery.com/jQuery.ajax/#jqXHR).\r\n\r\n e.g.\r\n ```javascript\r\n function callback(data,status,jqXHR) {\r\n //code...\r\n }\r\n ```\r\n\r\n\r\n - **UPDATETemplate**: `string` string using John's Resig javascript \r\n [Micro-Templating](http://ejohn.org/blog/javascript-micro-templating/) \r\n function. Using this templating system, allows to transfer \r\n any information using any type of format like for example \r\n JSON,XML,YAML,etc. For refering to the input's value, in the \r\n string should be a value key that will be replace with actual\r\n value. e.g. \"<%= value %>\"\r\n\r\n - **UPDATEData**: ```PlainObject``` javaScript object containing zero or \r\n more key-value pairs. \r\n It will contain all the parameters for the UPDATETemplate. \r\n For each request, the object will contain the actual value\r\n of the input in the form \" value: 'string' \"\r\n \r\nMethods\r\n--------------------------------------------------------------------------------\r\n- **getNextBackValue:**\r\ngets the previous or the next value of all the values that have been store in \r\nthe values attribute. Has a direction parameter that acts like a flag. If it is \r\ntrue it will get the next value otherwise the previous one. Return -1 if it gets\r\nto the extreme of the array.\r\n\r\n- **deleteStorage**\r\nIt will delete all the saved values. It will have different behaviours depending \r\non the type of storage.\r\n - **array**: it will delete the values store in the values attribute.\r\n - **localStorage**: it will delete the information store in the browser's local storage\r\n - **ajax**: it will send a delete request to the RESTful service.\r\n\r\n####Method Invocation\r\n \r\nBecause the plugin uses the jQuery UI Widget Factory, there are two especific \r\nways of calling the public methods. More\r\n[information](http://learn.jquery.com/jquery-ui/widget-factory/widget-method-invocation/). \r\n\r\n#####Plugin Invocation\r\nTo invoke a method using the widget's plugin, pass the name of the method as a \r\nstring. If the method requires arguments, pass them as additional parameters \r\nto the plugin.\r\n\r\n```javascript\r\n$('input[type=\"text\"]').easyText('getNextBackValue','true')\r\n```\r\n\r\n#####Instance Invocation\r\nUnder the hoods, every instance of every widget is stored on the element using \r\n[jQuery.data()](http://api.jquery.com/jQuery.data/). To retrieve the instance \r\nobject, call jQuery.data() using the \r\nwidget's full name \"easyInputEasyText\".\r\n\r\n```javascript\r\nvar jQueryObject = $('input[type=\"text\"]').easyText();\r\n\r\nvar easyText = jQueryObject.data('easyInputEasyText');\r\n\r\neasyText.deleteStorage();\r\n\r\n```\r\n\r\nDemo\r\n--------------------------------------------------------------------------------\r\nYou can see an example in the following \r\n[link](http://static.jortech.com.ve/easyText/jQuery/demo/).\r\n\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."} \ No newline at end of file diff --git a/stylesheets/print.css b/stylesheets/print.css new file mode 100644 index 0000000..541695b --- /dev/null +++ b/stylesheets/print.css @@ -0,0 +1,226 @@ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +body { + font-size: 13px; + line-height: 1.5; + font-family: 'Helvetica Neue', Helvetica, Arial, serif; + color: #000; +} + +a { + color: #d5000d; + font-weight: bold; +} + +header { + padding-top: 35px; + padding-bottom: 10px; +} + +header h1 { + font-weight: bold; + letter-spacing: -1px; + font-size: 48px; + color: #303030; + line-height: 1.2; +} + +header h2 { + letter-spacing: -1px; + font-size: 24px; + color: #aaa; + font-weight: normal; + line-height: 1.3; +} +#downloads { + display: none; +} +#main_content { + padding-top: 20px; +} + +code, pre { + font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal; + color: #222; + margin-bottom: 30px; + font-size: 12px; +} + +code { + padding: 0 3px; +} + +pre { + border: solid 1px #ddd; + padding: 20px; + overflow: auto; +} +pre code { + padding: 0; +} + +ul, ol, dl { + margin-bottom: 20px; +} + + +/* COMMON STYLES */ + +table { + width: 100%; + border: 1px solid #ebebeb; +} + +th { + font-weight: 500; +} + +td { + border: 1px solid #ebebeb; + text-align: center; + font-weight: 300; +} + +form { + background: #f2f2f2; + padding: 20px; + +} + + +/* GENERAL ELEMENT TYPE STYLES */ + +h1 { + font-size: 2.8em; +} + +h2 { + font-size: 22px; + font-weight: bold; + color: #303030; + margin-bottom: 8px; +} + +h3 { + color: #d5000d; + font-size: 18px; + font-weight: bold; + margin-bottom: 8px; +} + +h4 { + font-size: 16px; + color: #303030; + font-weight: bold; +} + +h5 { + font-size: 1em; + color: #303030; +} + +h6 { + font-size: .8em; + color: #303030; +} + +p { + font-weight: 300; + margin-bottom: 20px; +} + +a { + text-decoration: none; +} + +p a { + font-weight: 400; +} + +blockquote { + font-size: 1.6em; + border-left: 10px solid #e9e9e9; + margin-bottom: 20px; + padding: 0 0 0 30px; +} + +ul li { + list-style: disc inside; + padding-left: 20px; +} + +ol li { + list-style: decimal inside; + padding-left: 3px; +} + +dl dd { + font-style: italic; + font-weight: 100; +} + +footer { + margin-top: 40px; + padding-top: 20px; + padding-bottom: 30px; + font-size: 13px; + color: #aaa; +} + +footer a { + color: #666; +} + +/* MISC */ +.clearfix:after { + clear: both; + content: '.'; + display: block; + visibility: hidden; + height: 0; +} + +.clearfix {display: inline-block;} +* html .clearfix {height: 1%;} +.clearfix {display: block;} \ No newline at end of file diff --git a/stylesheets/pygment_trac.css b/stylesheets/pygment_trac.css new file mode 100644 index 0000000..c6a6452 --- /dev/null +++ b/stylesheets/pygment_trac.css @@ -0,0 +1,69 @@ +.highlight { background: #ffffff; } +.highlight .c { color: #999988; font-style: italic } /* Comment */ +.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ +.highlight .k { font-weight: bold } /* Keyword */ +.highlight .o { font-weight: bold } /* Operator */ +.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */ +.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ +.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ +.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #aa0000 } /* Generic.Error */ +.highlight .gh { color: #999999 } /* Generic.Heading */ +.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ +.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */ +.highlight .go { color: #888888 } /* Generic.Output */ +.highlight .gp { color: #555555 } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold; } /* Generic.Subheading */ +.highlight .gt { color: #aa0000 } /* Generic.Traceback */ +.highlight .kc { font-weight: bold } /* Keyword.Constant */ +.highlight .kd { font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { font-weight: bold } /* Keyword.Pseudo */ +.highlight .kr { font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */ +.highlight .m { color: #009999 } /* Literal.Number */ +.highlight .s { color: #d14 } /* Literal.String */ +.highlight .na { color: #008080 } /* Name.Attribute */ +.highlight .nb { color: #0086B3 } /* Name.Builtin */ +.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */ +.highlight .no { color: #008080 } /* Name.Constant */ +.highlight .ni { color: #800080 } /* Name.Entity */ +.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */ +.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */ +.highlight .nn { color: #555555 } /* Name.Namespace */ +.highlight .nt { color: #000080 } /* Name.Tag */ +.highlight .nv { color: #008080 } /* Name.Variable */ +.highlight .ow { font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mf { color: #009999 } /* Literal.Number.Float */ +.highlight .mh { color: #009999 } /* Literal.Number.Hex */ +.highlight .mi { color: #009999 } /* Literal.Number.Integer */ +.highlight .mo { color: #009999 } /* Literal.Number.Oct */ +.highlight .sb { color: #d14 } /* Literal.String.Backtick */ +.highlight .sc { color: #d14 } /* Literal.String.Char */ +.highlight .sd { color: #d14 } /* Literal.String.Doc */ +.highlight .s2 { color: #d14 } /* Literal.String.Double */ +.highlight .se { color: #d14 } /* Literal.String.Escape */ +.highlight .sh { color: #d14 } /* Literal.String.Heredoc */ +.highlight .si { color: #d14 } /* Literal.String.Interpol */ +.highlight .sx { color: #d14 } /* Literal.String.Other */ +.highlight .sr { color: #009926 } /* Literal.String.Regex */ +.highlight .s1 { color: #d14 } /* Literal.String.Single */ +.highlight .ss { color: #990073 } /* Literal.String.Symbol */ +.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #008080 } /* Name.Variable.Class */ +.highlight .vg { color: #008080 } /* Name.Variable.Global */ +.highlight .vi { color: #008080 } /* Name.Variable.Instance */ +.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ + +.type-csharp .highlight .k { color: #0000FF } +.type-csharp .highlight .kt { color: #0000FF } +.type-csharp .highlight .nf { color: #000000; font-weight: normal } +.type-csharp .highlight .nc { color: #2B91AF } +.type-csharp .highlight .nn { color: #000000 } +.type-csharp .highlight .s { color: #A31515 } +.type-csharp .highlight .sc { color: #A31515 } diff --git a/stylesheets/stylesheet.css b/stylesheets/stylesheet.css new file mode 100644 index 0000000..b617509 --- /dev/null +++ b/stylesheets/stylesheet.css @@ -0,0 +1,479 @@ +/* http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) +*/ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} + +/* LAYOUT STYLES */ +body { + font-size: 15px; + line-height: 1.5; + background: #fafafa url(../images/body-bg.jpg) 0 0 repeat; + font-family: 'Helvetica Neue', Helvetica, Arial, serif; + font-weight: 400; + color: #666; +} + +a { + color: #2879d0; +} +a:hover { + color: #2268b2; +} + +header { + padding-top: 40px; + padding-bottom: 40px; + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + background: #2e7bcf url(../images/header-bg.jpg) 0 0 repeat-x; + border-bottom: solid 1px #275da1; +} + +header h1 { + letter-spacing: -1px; + font-size: 72px; + color: #fff; + line-height: 1; + margin-bottom: 0.2em; + width: 540px; +} + +header h2 { + font-size: 26px; + color: #9ddcff; + font-weight: normal; + line-height: 1.3; + width: 540px; + letter-spacing: 0; +} + +.inner { + position: relative; + width: 940px; + margin: 0 auto; +} + +#content-wrapper { + border-top: solid 1px #fff; + padding-top: 30px; +} + +#main-content { + width: 690px; + float: left; +} + +#main-content img { + max-width: 100%; +} + +aside#sidebar { + width: 200px; + padding-left: 20px; + min-height: 504px; + float: right; + background: transparent url(../images/sidebar-bg.jpg) 0 0 no-repeat; + font-size: 12px; + line-height: 1.3; +} + +aside#sidebar p.repo-owner, +aside#sidebar p.repo-owner a { + font-weight: bold; +} + +#downloads { + margin-bottom: 40px; +} + +a.button { + width: 134px; + height: 58px; + line-height: 1.2; + font-size: 23px; + color: #fff; + padding-left: 68px; + padding-top: 22px; + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; +} +a.button small { + display: block; + font-size: 11px; +} +header a.button { + position: absolute; + right: 0; + top: 0; + background: transparent url(../images/github-button.png) 0 0 no-repeat; +} +aside a.button { + width: 138px; + padding-left: 64px; + display: block; + background: transparent url(../images/download-button.png) 0 0 no-repeat; + margin-bottom: 20px; + font-size: 21px; +} + +code, pre { + font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace; + color: #222; + margin-bottom: 30px; + font-size: 13px; +} + +code { + background-color: #f2f8fc; + border: solid 1px #dbe7f3; + padding: 0 3px; +} + +pre { + padding: 20px; + background: #fff; + text-shadow: none; + overflow: auto; + border: solid 1px #f2f2f2; +} +pre code { + color: #2879d0; + background-color: #fff; + border: none; + padding: 0; +} + +ul, ol, dl { + margin-bottom: 20px; +} + + +/* COMMON STYLES */ + +hr { + height: 1px; + line-height: 1px; + margin-top: 1em; + padding-bottom: 1em; + border: none; + background: transparent url('../images/hr.png') 0 0 no-repeat; +} + +table { + width: 100%; + border: 1px solid #ebebeb; +} + +th { + font-weight: 500; +} + +td { + border: 1px solid #ebebeb; + text-align: center; + font-weight: 300; +} + +form { + background: #f2f2f2; + padding: 20px; + +} + + +/* GENERAL ELEMENT TYPE STYLES */ + +#main-content h1 { + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 2.8em; + letter-spacing: -1px; + color: #474747; +} + +#main-content h1:before { + content: "/"; + color: #9ddcff; + padding-right: 0.3em; + margin-left: -0.9em; +} + +#main-content h2 { + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 22px; + font-weight: bold; + margin-bottom: 8px; + color: #474747; +} +#main-content h2:before { + content: "//"; + color: #9ddcff; + padding-right: 0.3em; + margin-left: -1.5em; +} + +#main-content h3 { + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 18px; + font-weight: bold; + margin-top: 24px; + margin-bottom: 8px; + color: #474747; +} + +#main-content h3:before { + content: "///"; + color: #9ddcff; + padding-right: 0.3em; + margin-left: -2em; +} + +#main-content h4 { + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 15px; + font-weight: bold; + color: #474747; +} + +h4:before { + content: "////"; + color: #9ddcff; + padding-right: 0.3em; + margin-left: -2.8em; +} + +#main-content h5 { + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 14px; + color: #474747; +} +h5:before { + content: "/////"; + color: #9ddcff; + padding-right: 0.3em; + margin-left: -3.2em; +} + +#main-content h6 { + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: .8em; + color: #474747; +} +h6:before { + content: "//////"; + color: #9ddcff; + padding-right: 0.3em; + margin-left: -3.7em; +} + +p { + margin-bottom: 20px; +} + +a { + text-decoration: none; +} + +p a { + font-weight: 400; +} + +blockquote { + font-size: 1.6em; + border-left: 10px solid #e9e9e9; + margin-bottom: 20px; + padding: 0 0 0 30px; +} + +ul { + list-style: disc inside; + padding-left: 20px; +} + +ol { + list-style: decimal inside; + padding-left: 3px; +} + +dl dd { + font-style: italic; + font-weight: 100; +} + +footer { + background: transparent url('../images/hr.png') 0 0 no-repeat; + margin-top: 40px; + padding-top: 20px; + padding-bottom: 30px; + font-size: 13px; + color: #aaa; +} + +footer a { + color: #666; +} +footer a:hover { + color: #444; +} + +/* MISC */ +.clearfix:after { + clear: both; + content: '.'; + display: block; + visibility: hidden; + height: 0; +} + +.clearfix {display: inline-block;} +* html .clearfix {height: 1%;} +.clearfix {display: block;} + +/* #Media Queries +================================================== */ + +/* Smaller than standard 960 (devices and browsers) */ +@media only screen and (max-width: 959px) {} + +/* Tablet Portrait size to standard 960 (devices and browsers) */ +@media only screen and (min-width: 768px) and (max-width: 959px) { + .inner { + width: 740px; + } + header h1, header h2 { + width: 340px; + } + header h1 { + font-size: 60px; + } + header h2 { + font-size: 30px; + } + #main-content { + width: 490px; + } + #main-content h1:before, + #main-content h2:before, + #main-content h3:before, + #main-content h4:before, + #main-content h5:before, + #main-content h6:before { + content: none; + padding-right: 0; + margin-left: 0; + } +} + +/* All Mobile Sizes (devices and browser) */ +@media only screen and (max-width: 767px) { + .inner { + width: 93%; + } + header { + padding: 20px 0; + } + header .inner { + position: relative; + } + header h1, header h2 { + width: 100%; + } + header h1 { + font-size: 48px; + } + header h2 { + font-size: 24px; + } + header a.button { + background-image: none; + width: auto; + height: auto; + display: inline-block; + margin-top: 15px; + padding: 5px 10px; + position: relative; + text-align: center; + font-size: 13px; + line-height: 1; + background-color: #9ddcff; + color: #2879d0; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + } + header a.button small { + font-size: 13px; + display: inline; + } + #main-content, + aside#sidebar { + float: none; + width: 100% ! important; + } + aside#sidebar { + background-image: none; + margin-top: 20px; + border-top: solid 1px #ddd; + padding: 20px 0; + min-height: 0; + } + aside#sidebar a.button { + display: none; + } + #main-content h1:before, + #main-content h2:before, + #main-content h3:before, + #main-content h4:before, + #main-content h5:before, + #main-content h6:before { + content: none; + padding-right: 0; + margin-left: 0; + } +} + +/* Mobile Landscape Size to Tablet Portrait (devices and browsers) */ +@media only screen and (min-width: 480px) and (max-width: 767px) {} + +/* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */ +@media only screen and (max-width: 479px) {} diff --git a/testing.js b/testing.js deleted file mode 100644 index 99d2a04..0000000 --- a/testing.js +++ /dev/null @@ -1,50 +0,0 @@ -$(document).ready(function() { - var easyText1 = $('#easyText1').easyText(), - easyText2 = $('#easyText2').easyText({ - minWidth:40, - maxWidth:300, - maxChars:60}), - easyText3 = $('#easyText3').easyText(), - easyText4 = $('#easyText4').easyText({ - storage: 'localStorage' - }), - easyText5 = $('#easyText5').easyText({ - storage:'ajax', - ajaxConfig:{ - url:'api', - id:'1', - GETCallback:function(){}, - UPDATEData:{}, - UPDATETemplate:'{value:<%=value%>}' - } - }); - - - - $('.easyText3 button[id="next"]').on('click',function() { - easyText3.easyText('getNextBackValue'); - }); - $('.easyText3 button[id="back"]').on('click',function() { - easyText3.easyText('getNextBackValue',false); - }); - $('.easyText3 button[id="deleteStorage"]').on('click',function() { - easyText3.easyText('deleteStorage'); - }); - - $('.easyText4 button[id="next"]').on('click',function() { - easyText4.easyText('getNextBackValue'); - }); - $('.easyText4 button[id="back"]').on('click',function() { - easyText4.easyText('getNextBackValue',false); - }); - $('.easyText4 button[id="deleteStorage"]').on('click',function() { - easyText4.easyText('deleteStorage'); - }); - - $('.easyText5 button[id="deleteStorage"]').on('click',function() { - easyText5.easyText('deleteStorage'); - }); - - -}); - \ No newline at end of file