]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
a lot of enhancements related to tags: tags list is now sorted, shows number of artic... 544/head
authorMaryana Rozhankivska <mariroz@mr.lviv.ua>
Mon, 10 Mar 2014 14:28:47 +0000 (16:28 +0200)
committerMaryana Rozhankivska <mariroz@mr.lviv.ua>
Mon, 10 Mar 2014 14:28:47 +0000 (16:28 +0200)
27 files changed:
inc/poche/Database.class.php
inc/poche/Poche.class.php
inc/poche/Tools.class.php [changed mode: 0644->0755]
themes/baggy/edit-tags.twig [changed mode: 0644->0755]
themes/baggy/tags.twig [changed mode: 0644->0755]
themes/default/css/images/animated-overlay.gif [new file with mode: 0644]
themes/default/css/images/ui-bg_flat_0_aaaaaa_40x100.png [new file with mode: 0644]
themes/default/css/images/ui-bg_flat_75_ffffff_40x100.png [new file with mode: 0644]
themes/default/css/images/ui-bg_glass_55_fbf9ee_1x400.png [new file with mode: 0644]
themes/default/css/images/ui-bg_glass_65_ffffff_1x400.png [new file with mode: 0644]
themes/default/css/images/ui-bg_glass_75_dadada_1x400.png [new file with mode: 0644]
themes/default/css/images/ui-bg_glass_75_e6e6e6_1x400.png [new file with mode: 0644]
themes/default/css/images/ui-bg_glass_95_fef1ec_1x400.png [new file with mode: 0644]
themes/default/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png [new file with mode: 0644]
themes/default/css/images/ui-icons_222222_256x240.png [new file with mode: 0644]
themes/default/css/images/ui-icons_2e83ff_256x240.png [new file with mode: 0644]
themes/default/css/images/ui-icons_454545_256x240.png [new file with mode: 0644]
themes/default/css/images/ui-icons_888888_256x240.png [new file with mode: 0644]
themes/default/css/images/ui-icons_cd0a0a_256x240.png [new file with mode: 0644]
themes/default/css/jquery-ui-1.10.4.custom.css [new file with mode: 0644]
themes/default/css/jquery-ui-1.10.4.custom.min.css [new file with mode: 0644]
themes/default/css/style.css [changed mode: 0644->0755]
themes/default/edit-tags.twig [changed mode: 0644->0755]
themes/default/js/autoCompleteTags.js [new file with mode: 0755]
themes/default/js/jquery-ui-1.10.4.custom.js [new file with mode: 0644]
themes/default/js/jquery-ui-1.10.4.custom.min.js [new file with mode: 0644]
themes/default/tags.twig [changed mode: 0644->0755]

index edc775f594d778ffc70a0d8b3a941b63470862ba..5b51b507abb62348fb2f8cfc92e5d528e22a233a 100755 (executable)
@@ -389,12 +389,15 @@ class Database {
         return $this->getHandle()->lastInsertId($column);
     }
 
-    public function retrieveAllTags($user_id) {
-        $sql = "SELECT DISTINCT tags.* FROM tags
+    public function retrieveAllTags($user_id, $term = null) {
+        $sql = "SELECT DISTINCT tags.*, count(entries.id) AS entriescount FROM tags
           LEFT JOIN tags_entries ON tags_entries.tag_id=tags.id
           LEFT JOIN entries ON tags_entries.entry_id=entries.id
-          WHERE entries.content <> '' AND entries.user_id=?";
-        $query = $this->executeQuery($sql, array($user_id));
+          WHERE entries.content <> '' AND entries.user_id=?
+            ". (($term) ? "AND lower(tags.value) LIKE ?" : '') ."
+          GROUP BY tags.id, tags.value
+          ORDER BY tags.value";
+        $query = $this->executeQuery($sql, (($term)? array($user_id, strtolower('%'.$term.'%')) : array($user_id) ));
         $tags = $query->fetchAll();
 
         return $tags;
index 0c8e798c06907705bad7235cab8d91f9c1a5cb42..480f6d45569ac56e52fcdf67975a89fda503bac6 100755 (executable)
@@ -488,25 +488,33 @@ class Poche
                     Tools::logm('error : article not found');
                     Tools::redirect();
                 }
+                //get all already set tags to preven duplicates
+                $already_set_tags = array();
+                $entry_tags = $this->store->retrieveTagsByEntry($entry_id);
+                foreach ($entry_tags as $tag) {
+                  $already_set_tags[] = $tag['value'];
+                }
                 foreach($tags as $key => $tag_value) {
                     $value = trim($tag_value);
-                    $tag = $this->store->retrieveTagByValue($value);
-
-                    if (is_null($tag)) {
-                        # we create the tag
-                        $tag = $this->store->createTag($value);
-                        $sequence = '';
-                        if (STORAGE == 'postgres') {
-                            $sequence = 'tags_id_seq';
-                        }
-                        $tag_id = $this->store->getLastId($sequence);
-                    }
-                    else {
-                        $tag_id = $tag['id'];
+                    if ($value && !in_array($value, $already_set_tags)) {
+                      $tag = $this->store->retrieveTagByValue($value);
+
+                      if (is_null($tag)) {
+                          # we create the tag
+                          $tag = $this->store->createTag($value);
+                          $sequence = '';
+                          if (STORAGE == 'postgres') {
+                              $sequence = 'tags_id_seq';
+                          }
+                          $tag_id = $this->store->getLastId($sequence);
+                      }
+                      else {
+                          $tag_id = $tag['id'];
+                      }
+
+                      # we assign the tag to the article
+                      $this->store->setTagToEntry($tag_id, $entry_id);
                     }
-
-                    # we assign the tag to the article
-                    $this->store->setTagToEntry($tag_id, $entry_id);
                 }
                 if(!$import) {
                     Tools::redirect();
@@ -579,7 +587,17 @@ class Poche
                 break;
             case 'tags':
                 $token = $this->user->getConfigValue('token');
-                $tags = $this->store->retrieveAllTags($this->user->getId());
+                //if term is set - search tags for this term
+                $term = Tools::checkVar('term');
+                $tags = $this->store->retrieveAllTags($this->user->getId(), $term);
+                if (Tools::isAjaxRequest()) {
+                  $result = array();
+                  foreach ($tags as $tag) {
+                    $result[] = $tag['value'];
+                  }
+                  echo json_encode($result);
+                  exit;
+                }
                 $tpl_vars = array(
                     'token' => $token,
                     'user_id' => $this->user->getId(),
old mode 100644 (file)
new mode 100755 (executable)
index eeb101b..ad451fc
@@ -311,4 +311,14 @@ class Tools
 
         return json_decode($json, true);
     }
+
+    /**
+     * Returns whether we handle an AJAX (XMLHttpRequest) request.
+     * @return boolean whether we handle an AJAX (XMLHttpRequest) request.
+     */
+    public static function isAjaxRequest()
+    {
+      return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH']==='XMLHttpRequest';
+    }
+
 }
old mode 100644 (file)
new mode 100755 (executable)
index 9e9012e..65ac996
@@ -4,6 +4,11 @@
 {% include '_menu.twig' %}
 {% endblock %}
 {% block content %}
+
+<script src="{{ poche_url }}/themes/default/js/jquery-ui-1.10.4.custom.min.js"></script>
+<script src="{{ poche_url }}/themes/default/js/autoCompleteTags.js"></script>
+<link rel="stylesheet" href="{{ poche_url }}/themes/default/css/jquery-ui-1.10.4.custom.min.css" media="all">
+
 <div id="article">
   <h2>{{ entry.title|raw }}</21>
 </div>
@@ -17,7 +22,8 @@
     <input type="hidden" name="entry_id" value="{{ entry_id }}" />
     <label for="value">Add tags: </label><input type="text" placeholder="interview, editorial, video" id="value" name="value" required="required" />
     <input type="submit" value="Tag" />
-    <p>{% trans "You can enter multiple tags, separated by commas." %}</p>
+    <p>{% trans "Start typing for auto complete." %}<br>
+    {% trans "You can enter multiple tags, separated by commas." %}</p>
 </form>
 <a class="icon icon-reply return" href="./?view=view&id={{ entry_id }}">{% trans "return to article" %}</a>
 {% endblock %}
old mode 100644 (file)
new mode 100755 (executable)
index 9df44bb..9bb93a4
@@ -6,7 +6,7 @@
 {% block content %}
 <h2>{% trans "Tags" %}</h2>
 <ul class="list-tags">
-{% for tag in tags %}<li>{% if token != '' %}<a class="icon icon-rss" href="?feed&amp;type=tag&amp;user_id={{ user_id }}&amp;tag_id={{ tag.id }}&amp;token={{ token }}" target="_blank"><span>rss</span></a>{% endif %} <a href="./?view=tag&amp;id={{ tag.id }}">{{ tag.value }}</a> 
+{% for tag in tags %}<li>{% if token != '' %}<a class="icon icon-rss" href="?feed&amp;type=tag&amp;user_id={{ user_id }}&amp;tag_id={{ tag.id }}&amp;token={{ token }}" target="_blank"><span>rss</span></a>{% endif %} <a href="./?view=tag&amp;id={{ tag.id }}">{{ tag.value }}</a> ({{ tag.entriescount }})
 </li>
 {% endfor %}
 </ul>
diff --git a/themes/default/css/images/animated-overlay.gif b/themes/default/css/images/animated-overlay.gif
new file mode 100644 (file)
index 0000000..d441f75
Binary files /dev/null and b/themes/default/css/images/animated-overlay.gif differ
diff --git a/themes/default/css/images/ui-bg_flat_0_aaaaaa_40x100.png b/themes/default/css/images/ui-bg_flat_0_aaaaaa_40x100.png
new file mode 100644 (file)
index 0000000..9f10cb6
Binary files /dev/null and b/themes/default/css/images/ui-bg_flat_0_aaaaaa_40x100.png differ
diff --git a/themes/default/css/images/ui-bg_flat_75_ffffff_40x100.png b/themes/default/css/images/ui-bg_flat_75_ffffff_40x100.png
new file mode 100644 (file)
index 0000000..b89b914
Binary files /dev/null and b/themes/default/css/images/ui-bg_flat_75_ffffff_40x100.png differ
diff --git a/themes/default/css/images/ui-bg_glass_55_fbf9ee_1x400.png b/themes/default/css/images/ui-bg_glass_55_fbf9ee_1x400.png
new file mode 100644 (file)
index 0000000..780d3ff
Binary files /dev/null and b/themes/default/css/images/ui-bg_glass_55_fbf9ee_1x400.png differ
diff --git a/themes/default/css/images/ui-bg_glass_65_ffffff_1x400.png b/themes/default/css/images/ui-bg_glass_65_ffffff_1x400.png
new file mode 100644 (file)
index 0000000..da53255
Binary files /dev/null and b/themes/default/css/images/ui-bg_glass_65_ffffff_1x400.png differ
diff --git a/themes/default/css/images/ui-bg_glass_75_dadada_1x400.png b/themes/default/css/images/ui-bg_glass_75_dadada_1x400.png
new file mode 100644 (file)
index 0000000..f630660
Binary files /dev/null and b/themes/default/css/images/ui-bg_glass_75_dadada_1x400.png differ
diff --git a/themes/default/css/images/ui-bg_glass_75_e6e6e6_1x400.png b/themes/default/css/images/ui-bg_glass_75_e6e6e6_1x400.png
new file mode 100644 (file)
index 0000000..7d34706
Binary files /dev/null and b/themes/default/css/images/ui-bg_glass_75_e6e6e6_1x400.png differ
diff --git a/themes/default/css/images/ui-bg_glass_95_fef1ec_1x400.png b/themes/default/css/images/ui-bg_glass_95_fef1ec_1x400.png
new file mode 100644 (file)
index 0000000..533c490
Binary files /dev/null and b/themes/default/css/images/ui-bg_glass_95_fef1ec_1x400.png differ
diff --git a/themes/default/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/themes/default/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png
new file mode 100644 (file)
index 0000000..bf3a948
Binary files /dev/null and b/themes/default/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ
diff --git a/themes/default/css/images/ui-icons_222222_256x240.png b/themes/default/css/images/ui-icons_222222_256x240.png
new file mode 100644 (file)
index 0000000..c1cb117
Binary files /dev/null and b/themes/default/css/images/ui-icons_222222_256x240.png differ
diff --git a/themes/default/css/images/ui-icons_2e83ff_256x240.png b/themes/default/css/images/ui-icons_2e83ff_256x240.png
new file mode 100644 (file)
index 0000000..84b601b
Binary files /dev/null and b/themes/default/css/images/ui-icons_2e83ff_256x240.png differ
diff --git a/themes/default/css/images/ui-icons_454545_256x240.png b/themes/default/css/images/ui-icons_454545_256x240.png
new file mode 100644 (file)
index 0000000..b6db1ac
Binary files /dev/null and b/themes/default/css/images/ui-icons_454545_256x240.png differ
diff --git a/themes/default/css/images/ui-icons_888888_256x240.png b/themes/default/css/images/ui-icons_888888_256x240.png
new file mode 100644 (file)
index 0000000..feea0e2
Binary files /dev/null and b/themes/default/css/images/ui-icons_888888_256x240.png differ
diff --git a/themes/default/css/images/ui-icons_cd0a0a_256x240.png b/themes/default/css/images/ui-icons_cd0a0a_256x240.png
new file mode 100644 (file)
index 0000000..ed5b6b0
Binary files /dev/null and b/themes/default/css/images/ui-icons_cd0a0a_256x240.png differ
diff --git a/themes/default/css/jquery-ui-1.10.4.custom.css b/themes/default/css/jquery-ui-1.10.4.custom.css
new file mode 100644 (file)
index 0000000..5690172
--- /dev/null
@@ -0,0 +1,560 @@
+/*! jQuery UI - v1.10.4 - 2014-03-09
+* http://jqueryui.com
+* Includes: jquery.ui.core.css, jquery.ui.autocomplete.css, jquery.ui.menu.css, jquery.ui.theme.css
+* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+/* Layout helpers
+----------------------------------*/
+.ui-helper-hidden {
+       display: none;
+}
+.ui-helper-hidden-accessible {
+       border: 0;
+       clip: rect(0 0 0 0);
+       height: 1px;
+       margin: -1px;
+       overflow: hidden;
+       padding: 0;
+       position: absolute;
+       width: 1px;
+}
+.ui-helper-reset {
+       margin: 0;
+       padding: 0;
+       border: 0;
+       outline: 0;
+       line-height: 1.3;
+       text-decoration: none;
+       font-size: 100%;
+       list-style: none;
+}
+.ui-helper-clearfix:before,
+.ui-helper-clearfix:after {
+       content: "";
+       display: table;
+       border-collapse: collapse;
+}
+.ui-helper-clearfix:after {
+       clear: both;
+}
+.ui-helper-clearfix {
+       min-height: 0; /* support: IE7 */
+}
+.ui-helper-zfix {
+       width: 100%;
+       height: 100%;
+       top: 0;
+       left: 0;
+       position: absolute;
+       opacity: 0;
+       filter:Alpha(Opacity=0);
+}
+
+.ui-front {
+       z-index: 100;
+}
+
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled {
+       cursor: default !important;
+}
+
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon {
+       display: block;
+       text-indent: -99999px;
+       overflow: hidden;
+       background-repeat: no-repeat;
+}
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay {
+       position: fixed;
+       top: 0;
+       left: 0;
+       width: 100%;
+       height: 100%;
+}
+.ui-autocomplete {
+       position: absolute;
+       top: 0;
+       left: 0;
+       cursor: default;
+}
+.ui-menu {
+       list-style: none;
+       padding: 2px;
+       margin: 0;
+       display: block;
+       outline: none;
+}
+.ui-menu .ui-menu {
+       margin-top: -3px;
+       position: absolute;
+}
+.ui-menu .ui-menu-item {
+       margin: 0;
+       padding: 0;
+       width: 100%;
+       /* support: IE10, see #8844 */
+       list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);
+}
+.ui-menu .ui-menu-divider {
+       margin: 5px -2px 5px -2px;
+       height: 0;
+       font-size: 0;
+       line-height: 0;
+       border-width: 1px 0 0 0;
+}
+.ui-menu .ui-menu-item a {
+       text-decoration: none;
+       display: block;
+       padding: 2px .4em;
+       line-height: 1.5;
+       min-height: 0; /* support: IE7 */
+       font-weight: normal;
+}
+.ui-menu .ui-menu-item a.ui-state-focus,
+.ui-menu .ui-menu-item a.ui-state-active {
+       font-weight: normal;
+       margin: -1px;
+}
+
+.ui-menu .ui-state-disabled {
+       font-weight: normal;
+       margin: .4em 0 .2em;
+       line-height: 1.5;
+}
+.ui-menu .ui-state-disabled a {
+       cursor: default;
+}
+
+/* icon support */
+.ui-menu-icons {
+       position: relative;
+}
+.ui-menu-icons .ui-menu-item a {
+       position: relative;
+       padding-left: 2em;
+}
+
+/* left-aligned */
+.ui-menu .ui-icon {
+       position: absolute;
+       top: .2em;
+       left: .2em;
+}
+
+/* right-aligned */
+.ui-menu .ui-menu-icon {
+       position: static;
+       float: right;
+}
+
+/* Component containers
+----------------------------------*/
+.ui-widget {
+       font-family: Verdana,Arial,sans-serif;
+       font-size: 1.1em;
+}
+.ui-widget .ui-widget {
+       font-size: 1em;
+}
+.ui-widget input,
+.ui-widget select,
+.ui-widget textarea,
+.ui-widget button {
+       font-family: Verdana,Arial,sans-serif;
+       font-size: 1em;
+}
+.ui-widget-content {
+       border: 1px solid #aaaaaa;
+       background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
+       color: #222222;
+}
+.ui-widget-content a {
+       color: #222222;
+}
+.ui-widget-header {
+       border: 1px solid #aaaaaa;
+       background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;
+       color: #222222;
+       font-weight: bold;
+}
+.ui-widget-header a {
+       color: #222222;
+}
+
+/* Interaction states
+----------------------------------*/
+.ui-state-default,
+.ui-widget-content .ui-state-default,
+.ui-widget-header .ui-state-default {
+       border: 1px solid #d3d3d3;
+       background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;
+       font-weight: normal;
+       color: #555555;
+}
+.ui-state-default a,
+.ui-state-default a:link,
+.ui-state-default a:visited {
+       color: #555555;
+       text-decoration: none;
+}
+.ui-state-hover,
+.ui-widget-content .ui-state-hover,
+.ui-widget-header .ui-state-hover,
+.ui-state-focus,
+.ui-widget-content .ui-state-focus,
+.ui-widget-header .ui-state-focus {
+       border: 1px solid #999999;
+       background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;
+       font-weight: normal;
+       color: #212121;
+}
+.ui-state-hover a,
+.ui-state-hover a:hover,
+.ui-state-hover a:link,
+.ui-state-hover a:visited,
+.ui-state-focus a,
+.ui-state-focus a:hover,
+.ui-state-focus a:link,
+.ui-state-focus a:visited {
+       color: #212121;
+       text-decoration: none;
+}
+.ui-state-active,
+.ui-widget-content .ui-state-active,
+.ui-widget-header .ui-state-active {
+       border: 1px solid #aaaaaa;
+       background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;
+       font-weight: normal;
+       color: #212121;
+}
+.ui-state-active a,
+.ui-state-active a:link,
+.ui-state-active a:visited {
+       color: #212121;
+       text-decoration: none;
+}
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-highlight,
+.ui-widget-content .ui-state-highlight,
+.ui-widget-header .ui-state-highlight {
+       border: 1px solid #fcefa1;
+       background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;
+       color: #363636;
+}
+.ui-state-highlight a,
+.ui-widget-content .ui-state-highlight a,
+.ui-widget-header .ui-state-highlight a {
+       color: #363636;
+}
+.ui-state-error,
+.ui-widget-content .ui-state-error,
+.ui-widget-header .ui-state-error {
+       border: 1px solid #cd0a0a;
+       background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;
+       color: #cd0a0a;
+}
+.ui-state-error a,
+.ui-widget-content .ui-state-error a,
+.ui-widget-header .ui-state-error a {
+       color: #cd0a0a;
+}
+.ui-state-error-text,
+.ui-widget-content .ui-state-error-text,
+.ui-widget-header .ui-state-error-text {
+       color: #cd0a0a;
+}
+.ui-priority-primary,
+.ui-widget-content .ui-priority-primary,
+.ui-widget-header .ui-priority-primary {
+       font-weight: bold;
+}
+.ui-priority-secondary,
+.ui-widget-content .ui-priority-secondary,
+.ui-widget-header .ui-priority-secondary {
+       opacity: .7;
+       filter:Alpha(Opacity=70);
+       font-weight: normal;
+}
+.ui-state-disabled,
+.ui-widget-content .ui-state-disabled,
+.ui-widget-header .ui-state-disabled {
+       opacity: .35;
+       filter:Alpha(Opacity=35);
+       background-image: none;
+}
+.ui-state-disabled .ui-icon {
+       filter:Alpha(Opacity=35); /* For IE8 - See #6059 */
+}
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon {
+       width: 16px;
+       height: 16px;
+}
+.ui-icon,
+.ui-widget-content .ui-icon {
+       background-image: url(images/ui-icons_222222_256x240.png);
+}
+.ui-widget-header .ui-icon {
+       background-image: url(images/ui-icons_222222_256x240.png);
+}
+.ui-state-default .ui-icon {
+       background-image: url(images/ui-icons_888888_256x240.png);
+}
+.ui-state-hover .ui-icon,
+.ui-state-focus .ui-icon {
+       background-image: url(images/ui-icons_454545_256x240.png);
+}
+.ui-state-active .ui-icon {
+       background-image: url(images/ui-icons_454545_256x240.png);
+}
+.ui-state-highlight .ui-icon {
+       background-image: url(images/ui-icons_2e83ff_256x240.png);
+}
+.ui-state-error .ui-icon,
+.ui-state-error-text .ui-icon {
+       background-image: url(images/ui-icons_cd0a0a_256x240.png);
+}
+
+/* positioning */
+.ui-icon-blank { background-position: 16px 16px; }
+.ui-icon-carat-1-n { background-position: 0 0; }
+.ui-icon-carat-1-ne { background-position: -16px 0; }
+.ui-icon-carat-1-e { background-position: -32px 0; }
+.ui-icon-carat-1-se { background-position: -48px 0; }
+.ui-icon-carat-1-s { background-position: -64px 0; }
+.ui-icon-carat-1-sw { background-position: -80px 0; }
+.ui-icon-carat-1-w { background-position: -96px 0; }
+.ui-icon-carat-1-nw { background-position: -112px 0; }
+.ui-icon-carat-2-n-s { background-position: -128px 0; }
+.ui-icon-carat-2-e-w { background-position: -144px 0; }
+.ui-icon-triangle-1-n { background-position: 0 -16px; }
+.ui-icon-triangle-1-ne { background-position: -16px -16px; }
+.ui-icon-triangle-1-e { background-position: -32px -16px; }
+.ui-icon-triangle-1-se { background-position: -48px -16px; }
+.ui-icon-triangle-1-s { background-position: -64px -16px; }
+.ui-icon-triangle-1-sw { background-position: -80px -16px; }
+.ui-icon-triangle-1-w { background-position: -96px -16px; }
+.ui-icon-triangle-1-nw { background-position: -112px -16px; }
+.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
+.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
+.ui-icon-arrow-1-n { background-position: 0 -32px; }
+.ui-icon-arrow-1-ne { background-position: -16px -32px; }
+.ui-icon-arrow-1-e { background-position: -32px -32px; }
+.ui-icon-arrow-1-se { background-position: -48px -32px; }
+.ui-icon-arrow-1-s { background-position: -64px -32px; }
+.ui-icon-arrow-1-sw { background-position: -80px -32px; }
+.ui-icon-arrow-1-w { background-position: -96px -32px; }
+.ui-icon-arrow-1-nw { background-position: -112px -32px; }
+.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
+.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
+.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
+.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
+.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
+.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
+.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
+.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
+.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
+.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
+.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
+.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
+.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
+.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
+.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
+.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
+.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
+.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
+.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
+.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
+.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
+.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
+.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
+.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
+.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
+.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
+.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
+.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
+.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
+.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
+.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
+.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
+.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
+.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
+.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
+.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
+.ui-icon-arrow-4 { background-position: 0 -80px; }
+.ui-icon-arrow-4-diag { background-position: -16px -80px; }
+.ui-icon-extlink { background-position: -32px -80px; }
+.ui-icon-newwin { background-position: -48px -80px; }
+.ui-icon-refresh { background-position: -64px -80px; }
+.ui-icon-shuffle { background-position: -80px -80px; }
+.ui-icon-transfer-e-w { background-position: -96px -80px; }
+.ui-icon-transferthick-e-w { background-position: -112px -80px; }
+.ui-icon-folder-collapsed { background-position: 0 -96px; }
+.ui-icon-folder-open { background-position: -16px -96px; }
+.ui-icon-document { background-position: -32px -96px; }
+.ui-icon-document-b { background-position: -48px -96px; }
+.ui-icon-note { background-position: -64px -96px; }
+.ui-icon-mail-closed { background-position: -80px -96px; }
+.ui-icon-mail-open { background-position: -96px -96px; }
+.ui-icon-suitcase { background-position: -112px -96px; }
+.ui-icon-comment { background-position: -128px -96px; }
+.ui-icon-person { background-position: -144px -96px; }
+.ui-icon-print { background-position: -160px -96px; }
+.ui-icon-trash { background-position: -176px -96px; }
+.ui-icon-locked { background-position: -192px -96px; }
+.ui-icon-unlocked { background-position: -208px -96px; }
+.ui-icon-bookmark { background-position: -224px -96px; }
+.ui-icon-tag { background-position: -240px -96px; }
+.ui-icon-home { background-position: 0 -112px; }
+.ui-icon-flag { background-position: -16px -112px; }
+.ui-icon-calendar { background-position: -32px -112px; }
+.ui-icon-cart { background-position: -48px -112px; }
+.ui-icon-pencil { background-position: -64px -112px; }
+.ui-icon-clock { background-position: -80px -112px; }
+.ui-icon-disk { background-position: -96px -112px; }
+.ui-icon-calculator { background-position: -112px -112px; }
+.ui-icon-zoomin { background-position: -128px -112px; }
+.ui-icon-zoomout { background-position: -144px -112px; }
+.ui-icon-search { background-position: -160px -112px; }
+.ui-icon-wrench { background-position: -176px -112px; }
+.ui-icon-gear { background-position: -192px -112px; }
+.ui-icon-heart { background-position: -208px -112px; }
+.ui-icon-star { background-position: -224px -112px; }
+.ui-icon-link { background-position: -240px -112px; }
+.ui-icon-cancel { background-position: 0 -128px; }
+.ui-icon-plus { background-position: -16px -128px; }
+.ui-icon-plusthick { background-position: -32px -128px; }
+.ui-icon-minus { background-position: -48px -128px; }
+.ui-icon-minusthick { background-position: -64px -128px; }
+.ui-icon-close { background-position: -80px -128px; }
+.ui-icon-closethick { background-position: -96px -128px; }
+.ui-icon-key { background-position: -112px -128px; }
+.ui-icon-lightbulb { background-position: -128px -128px; }
+.ui-icon-scissors { background-position: -144px -128px; }
+.ui-icon-clipboard { background-position: -160px -128px; }
+.ui-icon-copy { background-position: -176px -128px; }
+.ui-icon-contact { background-position: -192px -128px; }
+.ui-icon-image { background-position: -208px -128px; }
+.ui-icon-video { background-position: -224px -128px; }
+.ui-icon-script { background-position: -240px -128px; }
+.ui-icon-alert { background-position: 0 -144px; }
+.ui-icon-info { background-position: -16px -144px; }
+.ui-icon-notice { background-position: -32px -144px; }
+.ui-icon-help { background-position: -48px -144px; }
+.ui-icon-check { background-position: -64px -144px; }
+.ui-icon-bullet { background-position: -80px -144px; }
+.ui-icon-radio-on { background-position: -96px -144px; }
+.ui-icon-radio-off { background-position: -112px -144px; }
+.ui-icon-pin-w { background-position: -128px -144px; }
+.ui-icon-pin-s { background-position: -144px -144px; }
+.ui-icon-play { background-position: 0 -160px; }
+.ui-icon-pause { background-position: -16px -160px; }
+.ui-icon-seek-next { background-position: -32px -160px; }
+.ui-icon-seek-prev { background-position: -48px -160px; }
+.ui-icon-seek-end { background-position: -64px -160px; }
+.ui-icon-seek-start { background-position: -80px -160px; }
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first { background-position: -80px -160px; }
+.ui-icon-stop { background-position: -96px -160px; }
+.ui-icon-eject { background-position: -112px -160px; }
+.ui-icon-volume-off { background-position: -128px -160px; }
+.ui-icon-volume-on { background-position: -144px -160px; }
+.ui-icon-power { background-position: 0 -176px; }
+.ui-icon-signal-diag { background-position: -16px -176px; }
+.ui-icon-signal { background-position: -32px -176px; }
+.ui-icon-battery-0 { background-position: -48px -176px; }
+.ui-icon-battery-1 { background-position: -64px -176px; }
+.ui-icon-battery-2 { background-position: -80px -176px; }
+.ui-icon-battery-3 { background-position: -96px -176px; }
+.ui-icon-circle-plus { background-position: 0 -192px; }
+.ui-icon-circle-minus { background-position: -16px -192px; }
+.ui-icon-circle-close { background-position: -32px -192px; }
+.ui-icon-circle-triangle-e { background-position: -48px -192px; }
+.ui-icon-circle-triangle-s { background-position: -64px -192px; }
+.ui-icon-circle-triangle-w { background-position: -80px -192px; }
+.ui-icon-circle-triangle-n { background-position: -96px -192px; }
+.ui-icon-circle-arrow-e { background-position: -112px -192px; }
+.ui-icon-circle-arrow-s { background-position: -128px -192px; }
+.ui-icon-circle-arrow-w { background-position: -144px -192px; }
+.ui-icon-circle-arrow-n { background-position: -160px -192px; }
+.ui-icon-circle-zoomin { background-position: -176px -192px; }
+.ui-icon-circle-zoomout { background-position: -192px -192px; }
+.ui-icon-circle-check { background-position: -208px -192px; }
+.ui-icon-circlesmall-plus { background-position: 0 -208px; }
+.ui-icon-circlesmall-minus { background-position: -16px -208px; }
+.ui-icon-circlesmall-close { background-position: -32px -208px; }
+.ui-icon-squaresmall-plus { background-position: -48px -208px; }
+.ui-icon-squaresmall-minus { background-position: -64px -208px; }
+.ui-icon-squaresmall-close { background-position: -80px -208px; }
+.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
+.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
+.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
+.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
+.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
+.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Corner radius */
+.ui-corner-all,
+.ui-corner-top,
+.ui-corner-left,
+.ui-corner-tl {
+       border-top-left-radius: 4px;
+}
+.ui-corner-all,
+.ui-corner-top,
+.ui-corner-right,
+.ui-corner-tr {
+       border-top-right-radius: 4px;
+}
+.ui-corner-all,
+.ui-corner-bottom,
+.ui-corner-left,
+.ui-corner-bl {
+       border-bottom-left-radius: 4px;
+}
+.ui-corner-all,
+.ui-corner-bottom,
+.ui-corner-right,
+.ui-corner-br {
+       border-bottom-right-radius: 4px;
+}
+
+/* Overlays */
+.ui-widget-overlay {
+       background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
+       opacity: .3;
+       filter: Alpha(Opacity=30);
+}
+.ui-widget-shadow {
+       margin: -8px 0 0 -8px;
+       padding: 8px;
+       background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
+       opacity: .3;
+       filter: Alpha(Opacity=30);
+       border-radius: 8px;
+}
diff --git a/themes/default/css/jquery-ui-1.10.4.custom.min.css b/themes/default/css/jquery-ui-1.10.4.custom.min.css
new file mode 100644 (file)
index 0000000..4dba92a
--- /dev/null
@@ -0,0 +1,7 @@
+/*! jQuery UI - v1.10.4 - 2014-03-09
+* http://jqueryui.com
+* Includes: jquery.ui.core.css, jquery.ui.autocomplete.css, jquery.ui.menu.css, jquery.ui.theme.css
+* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:none}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:normal;margin:-1px}.ui-menu .ui-state-disabled{font-weight:normal;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
index 2867590..b3d300e
@@ -347,3 +347,11 @@ a.reading-time span {
     margin-left: -30px;
 }
 
+.two-column {
+  display: block;
+  width: 50%;
+  paddig-right: 20px;
+  float: left;
+  vertical-align: top;
+}
+
old mode 100644 (file)
new mode 100755 (executable)
index 83f04aa..cd6bc66
@@ -5,6 +5,10 @@
 {% endblock %}
 {% block content %}
 
+<script src="{{ poche_url }}/themes/default/js/jquery-ui-1.10.4.custom.min.js"></script>
+<script src="{{ poche_url }}/themes/default/js/autoCompleteTags.js"></script>
+<link rel="stylesheet" href="{{ poche_url }}/themes/default/css/jquery-ui-1.10.4.custom.min.css" media="all">
+
 <div id="article">
   <header class="mbm">
       <h1>{{ entry.title|raw }}</h1>
@@ -17,13 +21,15 @@ no tags
 <ul>
 {% for tag in tags %}<li>{{ tag.value }} <a href="./?action=remove_tag&amp;tag_id={{ tag.id }}&amp;id={{ entry_id }}">✘</a></li>{% endfor %}
 </ul>
-<form method="post" action="./?action=add_tag">
+<form method="post" action="./?action=add_tag" id="editTags">
     <input type="hidden" name="entry_id" value="{{ entry_id }}" />
     <label for="value">Add tags: </label>
     <input type="text" placeholder="interview, editorial, video" id="value" name="value" required="required" />
     <input type="submit" value="Tag" />
-    <p>{% trans "You can enter multiple tags, separated by commas." %}</p>
+    <p>{% trans "Start typing for auto complete." %}<br>
+    {% trans "You can enter multiple tags, separated by commas." %}</p>
 
 </form>
+<br>
 <a href="./?view=view&id={{ entry_id }}">&laquo; {% trans "return to article" %}</a>
 {% endblock %}
diff --git a/themes/default/js/autoCompleteTags.js b/themes/default/js/autoCompleteTags.js
new file mode 100755 (executable)
index 0000000..90bc982
--- /dev/null
@@ -0,0 +1,47 @@
+jQuery(function($) {
+
+  function split( val ) {
+    return val.split( /,\s*/ );
+  }
+  function extractLast( term ) {
+    return split( term ).pop();
+  }
+
+
+  $("#value").bind("keydown", function(event) {
+    if (event.keyCode === $.ui.keyCode.TAB && $(this).data("ui-autocomplete").menu.active) {
+      event.preventDefault();
+    }
+  }).autocomplete({
+    source : function(request, response) {
+      $.getJSON("./?view=tags", {
+        term : extractLast(request.term),
+        //id: $(':hidden#entry_id').val()
+      }, response);
+    },
+    search : function() {
+      // custom minLength
+      var term = extractLast(this.value);
+      if (term.length < 1) {
+        return false;
+      }
+    },
+    focus : function() {
+      // prevent value inserted on focus
+      return false;
+    },
+    select : function(event, ui) {
+      var terms = split(this.value);
+      // remove the current input
+      terms.pop();
+      // add the selected item
+      terms.push(ui.item.value);
+      // add placeholder to get the comma-and-space at the end
+      terms.push("");
+      this.value = terms.join(", ");
+      return false;
+    }
+  });
+
+
+});
diff --git a/themes/default/js/jquery-ui-1.10.4.custom.js b/themes/default/js/jquery-ui-1.10.4.custom.js
new file mode 100644 (file)
index 0000000..6f599fc
--- /dev/null
@@ -0,0 +1,2519 @@
+/*! jQuery UI - v1.10.4 - 2014-03-08
+* http://jqueryui.com
+* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.position.js, jquery.ui.autocomplete.js, jquery.ui.menu.js
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+(function( $, undefined ) {
+
+var uuid = 0,
+       runiqueId = /^ui-id-\d+$/;
+
+// $.ui might exist from components with no dependencies, e.g., $.ui.position
+$.ui = $.ui || {};
+
+$.extend( $.ui, {
+       version: "1.10.4",
+
+       keyCode: {
+               BACKSPACE: 8,
+               COMMA: 188,
+               DELETE: 46,
+               DOWN: 40,
+               END: 35,
+               ENTER: 13,
+               ESCAPE: 27,
+               HOME: 36,
+               LEFT: 37,
+               NUMPAD_ADD: 107,
+               NUMPAD_DECIMAL: 110,
+               NUMPAD_DIVIDE: 111,
+               NUMPAD_ENTER: 108,
+               NUMPAD_MULTIPLY: 106,
+               NUMPAD_SUBTRACT: 109,
+               PAGE_DOWN: 34,
+               PAGE_UP: 33,
+               PERIOD: 190,
+               RIGHT: 39,
+               SPACE: 32,
+               TAB: 9,
+               UP: 38
+       }
+});
+
+// plugins
+$.fn.extend({
+       focus: (function( orig ) {
+               return function( delay, fn ) {
+                       return typeof delay === "number" ?
+                               this.each(function() {
+                                       var elem = this;
+                                       setTimeout(function() {
+                                               $( elem ).focus();
+                                               if ( fn ) {
+                                                       fn.call( elem );
+                                               }
+                                       }, delay );
+                               }) :
+                               orig.apply( this, arguments );
+               };
+       })( $.fn.focus ),
+
+       scrollParent: function() {
+               var scrollParent;
+               if (($.ui.ie && (/(static|relative)/).test(this.css("position"))) || (/absolute/).test(this.css("position"))) {
+                       scrollParent = this.parents().filter(function() {
+                               return (/(relative|absolute|fixed)/).test($.css(this,"position")) && (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"));
+                       }).eq(0);
+               } else {
+                       scrollParent = this.parents().filter(function() {
+                               return (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"));
+                       }).eq(0);
+               }
+
+               return (/fixed/).test(this.css("position")) || !scrollParent.length ? $(document) : scrollParent;
+       },
+
+       zIndex: function( zIndex ) {
+               if ( zIndex !== undefined ) {
+                       return this.css( "zIndex", zIndex );
+               }
+
+               if ( this.length ) {
+                       var elem = $( this[ 0 ] ), position, value;
+                       while ( elem.length && elem[ 0 ] !== document ) {
+                               // Ignore z-index if position is set to a value where z-index is ignored by the browser
+                               // This makes behavior of this function consistent across browsers
+                               // WebKit always returns auto if the element is positioned
+                               position = elem.css( "position" );
+                               if ( position === "absolute" || position === "relative" || position === "fixed" ) {
+                                       // IE returns 0 when zIndex is not specified
+                                       // other browsers return a string
+                                       // we ignore the case of nested elements with an explicit value of 0
+                                       // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
+                                       value = parseInt( elem.css( "zIndex" ), 10 );
+                                       if ( !isNaN( value ) && value !== 0 ) {
+                                               return value;
+                                       }
+                               }
+                               elem = elem.parent();
+                       }
+               }
+
+               return 0;
+       },
+
+       uniqueId: function() {
+               return this.each(function() {
+                       if ( !this.id ) {
+                               this.id = "ui-id-" + (++uuid);
+                       }
+               });
+       },
+
+       removeUniqueId: function() {
+               return this.each(function() {
+                       if ( runiqueId.test( this.id ) ) {
+                               $( this ).removeAttr( "id" );
+                       }
+               });
+       }
+});
+
+// selectors
+function focusable( element, isTabIndexNotNaN ) {
+       var map, mapName, img,
+               nodeName = element.nodeName.toLowerCase();
+       if ( "area" === nodeName ) {
+               map = element.parentNode;
+               mapName = map.name;
+               if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
+                       return false;
+               }
+               img = $( "img[usemap=#" + mapName + "]" )[0];
+               return !!img && visible( img );
+       }
+       return ( /input|select|textarea|button|object/.test( nodeName ) ?
+               !element.disabled :
+               "a" === nodeName ?
+                       element.href || isTabIndexNotNaN :
+                       isTabIndexNotNaN) &&
+               // the element and all of its ancestors must be visible
+               visible( element );
+}
+
+function visible( element ) {
+       return $.expr.filters.visible( element ) &&
+               !$( element ).parents().addBack().filter(function() {
+                       return $.css( this, "visibility" ) === "hidden";
+               }).length;
+}
+
+$.extend( $.expr[ ":" ], {
+       data: $.expr.createPseudo ?
+               $.expr.createPseudo(function( dataName ) {
+                       return function( elem ) {
+                               return !!$.data( elem, dataName );
+                       };
+               }) :
+               // support: jQuery <1.8
+               function( elem, i, match ) {
+                       return !!$.data( elem, match[ 3 ] );
+               },
+
+       focusable: function( element ) {
+               return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
+       },
+
+       tabbable: function( element ) {
+               var tabIndex = $.attr( element, "tabindex" ),
+                       isTabIndexNaN = isNaN( tabIndex );
+               return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
+       }
+});
+
+// support: jQuery <1.8
+if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
+       $.each( [ "Width", "Height" ], function( i, name ) {
+               var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
+                       type = name.toLowerCase(),
+                       orig = {
+                               innerWidth: $.fn.innerWidth,
+                               innerHeight: $.fn.innerHeight,
+                               outerWidth: $.fn.outerWidth,
+                               outerHeight: $.fn.outerHeight
+                       };
+
+               function reduce( elem, size, border, margin ) {
+                       $.each( side, function() {
+                               size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
+                               if ( border ) {
+                                       size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
+                               }
+                               if ( margin ) {
+                                       size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
+                               }
+                       });
+                       return size;
+               }
+
+               $.fn[ "inner" + name ] = function( size ) {
+                       if ( size === undefined ) {
+                               return orig[ "inner" + name ].call( this );
+                       }
+
+                       return this.each(function() {
+                               $( this ).css( type, reduce( this, size ) + "px" );
+                       });
+               };
+
+               $.fn[ "outer" + name] = function( size, margin ) {
+                       if ( typeof size !== "number" ) {
+                               return orig[ "outer" + name ].call( this, size );
+                       }
+
+                       return this.each(function() {
+                               $( this).css( type, reduce( this, size, true, margin ) + "px" );
+                       });
+               };
+       });
+}
+
+// support: jQuery <1.8
+if ( !$.fn.addBack ) {
+       $.fn.addBack = function( selector ) {
+               return this.add( selector == null ?
+                       this.prevObject : this.prevObject.filter( selector )
+               );
+       };
+}
+
+// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
+if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
+       $.fn.removeData = (function( removeData ) {
+               return function( key ) {
+                       if ( arguments.length ) {
+                               return removeData.call( this, $.camelCase( key ) );
+                       } else {
+                               return removeData.call( this );
+                       }
+               };
+       })( $.fn.removeData );
+}
+
+
+
+
+
+// deprecated
+$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
+
+$.support.selectstart = "onselectstart" in document.createElement( "div" );
+$.fn.extend({
+       disableSelection: function() {
+               return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
+                       ".ui-disableSelection", function( event ) {
+                               event.preventDefault();
+                       });
+       },
+
+       enableSelection: function() {
+               return this.unbind( ".ui-disableSelection" );
+       }
+});
+
+$.extend( $.ui, {
+       // $.ui.plugin is deprecated. Use $.widget() extensions instead.
+       plugin: {
+               add: function( module, option, set ) {
+                       var i,
+                               proto = $.ui[ module ].prototype;
+                       for ( i in set ) {
+                               proto.plugins[ i ] = proto.plugins[ i ] || [];
+                               proto.plugins[ i ].push( [ option, set[ i ] ] );
+                       }
+               },
+               call: function( instance, name, args ) {
+                       var i,
+                               set = instance.plugins[ name ];
+                       if ( !set || !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) {
+                               return;
+                       }
+
+                       for ( i = 0; i < set.length; i++ ) {
+                               if ( instance.options[ set[ i ][ 0 ] ] ) {
+                                       set[ i ][ 1 ].apply( instance.element, args );
+                               }
+                       }
+               }
+       },
+
+       // only used by resizable
+       hasScroll: function( el, a ) {
+
+               //If overflow is hidden, the element might have extra content, but the user wants to hide it
+               if ( $( el ).css( "overflow" ) === "hidden") {
+                       return false;
+               }
+
+               var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
+                       has = false;
+
+               if ( el[ scroll ] > 0 ) {
+                       return true;
+               }
+
+               // TODO: determine which cases actually cause this to happen
+               // if the element doesn't have the scroll set, see if it's possible to
+               // set the scroll
+               el[ scroll ] = 1;
+               has = ( el[ scroll ] > 0 );
+               el[ scroll ] = 0;
+               return has;
+       }
+});
+
+})( jQuery );
+(function( $, undefined ) {
+
+var uuid = 0,
+       slice = Array.prototype.slice,
+       _cleanData = $.cleanData;
+$.cleanData = function( elems ) {
+       for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+               try {
+                       $( elem ).triggerHandler( "remove" );
+               // http://bugs.jquery.com/ticket/8235
+               } catch( e ) {}
+       }
+       _cleanData( elems );
+};
+
+$.widget = function( name, base, prototype ) {
+       var fullName, existingConstructor, constructor, basePrototype,
+               // proxiedPrototype allows the provided prototype to remain unmodified
+               // so that it can be used as a mixin for multiple widgets (#8876)
+               proxiedPrototype = {},
+               namespace = name.split( "." )[ 0 ];
+
+       name = name.split( "." )[ 1 ];
+       fullName = namespace + "-" + name;
+
+       if ( !prototype ) {
+               prototype = base;
+               base = $.Widget;
+       }
+
+       // create selector for plugin
+       $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
+               return !!$.data( elem, fullName );
+       };
+
+       $[ namespace ] = $[ namespace ] || {};
+       existingConstructor = $[ namespace ][ name ];
+       constructor = $[ namespace ][ name ] = function( options, element ) {
+               // allow instantiation without "new" keyword
+               if ( !this._createWidget ) {
+                       return new constructor( options, element );
+               }
+
+               // allow instantiation without initializing for simple inheritance
+               // must use "new" keyword (the code above always passes args)
+               if ( arguments.length ) {
+                       this._createWidget( options, element );
+               }
+       };
+       // extend with the existing constructor to carry over any static properties
+       $.extend( constructor, existingConstructor, {
+               version: prototype.version,
+               // copy the object used to create the prototype in case we need to
+               // redefine the widget later
+               _proto: $.extend( {}, prototype ),
+               // track widgets that inherit from this widget in case this widget is
+               // redefined after a widget inherits from it
+               _childConstructors: []
+       });
+
+       basePrototype = new base();
+       // we need to make the options hash a property directly on the new instance
+       // otherwise we'll modify the options hash on the prototype that we're
+       // inheriting from
+       basePrototype.options = $.widget.extend( {}, basePrototype.options );
+       $.each( prototype, function( prop, value ) {
+               if ( !$.isFunction( value ) ) {
+                       proxiedPrototype[ prop ] = value;
+                       return;
+               }
+               proxiedPrototype[ prop ] = (function() {
+                       var _super = function() {
+                                       return base.prototype[ prop ].apply( this, arguments );
+                               },
+                               _superApply = function( args ) {
+                                       return base.prototype[ prop ].apply( this, args );
+                               };
+                       return function() {
+                               var __super = this._super,
+                                       __superApply = this._superApply,
+                                       returnValue;
+
+                               this._super = _super;
+                               this._superApply = _superApply;
+
+                               returnValue = value.apply( this, arguments );
+
+                               this._super = __super;
+                               this._superApply = __superApply;
+
+                               return returnValue;
+                       };
+               })();
+       });
+       constructor.prototype = $.widget.extend( basePrototype, {
+               // TODO: remove support for widgetEventPrefix
+               // always use the name + a colon as the prefix, e.g., draggable:start
+               // don't prefix for widgets that aren't DOM-based
+               widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
+       }, proxiedPrototype, {
+               constructor: constructor,
+               namespace: namespace,
+               widgetName: name,
+               widgetFullName: fullName
+       });
+
+       // If this widget is being redefined then we need to find all widgets that
+       // are inheriting from it and redefine all of them so that they inherit from
+       // the new version of this widget. We're essentially trying to replace one
+       // level in the prototype chain.
+       if ( existingConstructor ) {
+               $.each( existingConstructor._childConstructors, function( i, child ) {
+                       var childPrototype = child.prototype;
+
+                       // redefine the child widget using the same prototype that was
+                       // originally used, but inherit from the new version of the base
+                       $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
+               });
+               // remove the list of existing child constructors from the old constructor
+               // so the old child constructors can be garbage collected
+               delete existingConstructor._childConstructors;
+       } else {
+               base._childConstructors.push( constructor );
+       }
+
+       $.widget.bridge( name, constructor );
+};
+
+$.widget.extend = function( target ) {
+       var input = slice.call( arguments, 1 ),
+               inputIndex = 0,
+               inputLength = input.length,
+               key,
+               value;
+       for ( ; inputIndex < inputLength; inputIndex++ ) {
+               for ( key in input[ inputIndex ] ) {
+                       value = input[ inputIndex ][ key ];
+                       if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
+                               // Clone objects
+                               if ( $.isPlainObject( value ) ) {
+                                       target[ key ] = $.isPlainObject( target[ key ] ) ?
+                                               $.widget.extend( {}, target[ key ], value ) :
+                                               // Don't extend strings, arrays, etc. with objects
+                                               $.widget.extend( {}, value );
+                               // Copy everything else by reference
+                               } else {
+                                       target[ key ] = value;
+                               }
+                       }
+               }
+       }
+       return target;
+};
+
+$.widget.bridge = function( name, object ) {
+       var fullName = object.prototype.widgetFullName || name;
+       $.fn[ name ] = function( options ) {
+               var isMethodCall = typeof options === "string",
+                       args = slice.call( arguments, 1 ),
+                       returnValue = this;
+
+               // allow multiple hashes to be passed on init
+               options = !isMethodCall && args.length ?
+                       $.widget.extend.apply( null, [ options ].concat(args) ) :
+                       options;
+
+               if ( isMethodCall ) {
+                       this.each(function() {
+                               var methodValue,
+                                       instance = $.data( this, fullName );
+                               if ( !instance ) {
+                                       return $.error( "cannot call methods on " + name + " prior to initialization; " +
+                                               "attempted to call method '" + options + "'" );
+                               }
+                               if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
+                                       return $.error( "no such method '" + options + "' for " + name + " widget instance" );
+                               }
+                               methodValue = instance[ options ].apply( instance, args );
+                               if ( methodValue !== instance && methodValue !== undefined ) {
+                                       returnValue = methodValue && methodValue.jquery ?
+                                               returnValue.pushStack( methodValue.get() ) :
+                                               methodValue;
+                                       return false;
+                               }
+                       });
+               } else {
+                       this.each(function() {
+                               var instance = $.data( this, fullName );
+                               if ( instance ) {
+                                       instance.option( options || {} )._init();
+                               } else {
+                                       $.data( this, fullName, new object( options, this ) );
+                               }
+                       });
+               }
+
+               return returnValue;
+       };
+};
+
+$.Widget = function( /* options, element */ ) {};
+$.Widget._childConstructors = [];
+
+$.Widget.prototype = {
+       widgetName: "widget",
+       widgetEventPrefix: "",
+       defaultElement: "<div>",
+       options: {
+               disabled: false,
+
+               // callbacks
+               create: null
+       },
+       _createWidget: function( options, element ) {
+               element = $( element || this.defaultElement || this )[ 0 ];
+               this.element = $( element );
+               this.uuid = uuid++;
+               this.eventNamespace = "." + this.widgetName + this.uuid;
+               this.options = $.widget.extend( {},
+                       this.options,
+                       this._getCreateOptions(),
+                       options );
+
+               this.bindings = $();
+               this.hoverable = $();
+               this.focusable = $();
+
+               if ( element !== this ) {
+                       $.data( element, this.widgetFullName, this );
+                       this._on( true, this.element, {
+                               remove: function( event ) {
+                                       if ( event.target === element ) {
+                                               this.destroy();
+                                       }
+                               }
+                       });
+                       this.document = $( element.style ?
+                               // element within the document
+                               element.ownerDocument :
+                               // element is window or document
+                               element.document || element );
+                       this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
+               }
+
+               this._create();
+               this._trigger( "create", null, this._getCreateEventData() );
+               this._init();
+       },
+       _getCreateOptions: $.noop,
+       _getCreateEventData: $.noop,
+       _create: $.noop,
+       _init: $.noop,
+
+       destroy: function() {
+               this._destroy();
+               // we can probably remove the unbind calls in 2.0
+               // all event bindings should go through this._on()
+               this.element
+                       .unbind( this.eventNamespace )
+                       // 1.9 BC for #7810
+                       // TODO remove dual storage
+                       .removeData( this.widgetName )
+                       .removeData( this.widgetFullName )
+                       // support: jquery <1.6.3
+                       // http://bugs.jquery.com/ticket/9413
+                       .removeData( $.camelCase( this.widgetFullName ) );
+               this.widget()
+                       .unbind( this.eventNamespace )
+                       .removeAttr( "aria-disabled" )
+                       .removeClass(
+                               this.widgetFullName + "-disabled " +
+                               "ui-state-disabled" );
+
+               // clean up events and states
+               this.bindings.unbind( this.eventNamespace );
+               this.hoverable.removeClass( "ui-state-hover" );
+               this.focusable.removeClass( "ui-state-focus" );
+       },
+       _destroy: $.noop,
+
+       widget: function() {
+               return this.element;
+       },
+
+       option: function( key, value ) {
+               var options = key,
+                       parts,
+                       curOption,
+                       i;
+
+               if ( arguments.length === 0 ) {
+                       // don't return a reference to the internal hash
+                       return $.widget.extend( {}, this.options );
+               }
+
+               if ( typeof key === "string" ) {
+                       // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
+                       options = {};
+                       parts = key.split( "." );
+                       key = parts.shift();
+                       if ( parts.length ) {
+                               curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
+                               for ( i = 0; i < parts.length - 1; i++ ) {
+                                       curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
+                                       curOption = curOption[ parts[ i ] ];
+                               }
+                               key = parts.pop();
+                               if ( arguments.length === 1 ) {
+                                       return curOption[ key ] === undefined ? null : curOption[ key ];
+                               }
+                               curOption[ key ] = value;
+                       } else {
+                               if ( arguments.length === 1 ) {
+                                       return this.options[ key ] === undefined ? null : this.options[ key ];
+                               }
+                               options[ key ] = value;
+                       }
+               }
+
+               this._setOptions( options );
+
+               return this;
+       },
+       _setOptions: function( options ) {
+               var key;
+
+               for ( key in options ) {
+                       this._setOption( key, options[ key ] );
+               }
+
+               return this;
+       },
+       _setOption: function( key, value ) {
+               this.options[ key ] = value;
+
+               if ( key === "disabled" ) {
+                       this.widget()
+                               .toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value )
+                               .attr( "aria-disabled", value );
+                       this.hoverable.removeClass( "ui-state-hover" );
+                       this.focusable.removeClass( "ui-state-focus" );
+               }
+
+               return this;
+       },
+
+       enable: function() {
+               return this._setOption( "disabled", false );
+       },
+       disable: function() {
+               return this._setOption( "disabled", true );
+       },
+
+       _on: function( suppressDisabledCheck, element, handlers ) {
+               var delegateElement,
+                       instance = this;
+
+               // no suppressDisabledCheck flag, shuffle arguments
+               if ( typeof suppressDisabledCheck !== "boolean" ) {
+                       handlers = element;
+                       element = suppressDisabledCheck;
+                       suppressDisabledCheck = false;
+               }
+
+               // no element argument, shuffle and use this.element
+               if ( !handlers ) {
+                       handlers = element;
+                       element = this.element;
+                       delegateElement = this.widget();
+               } else {
+                       // accept selectors, DOM elements
+                       element = delegateElement = $( element );
+                       this.bindings = this.bindings.add( element );
+               }
+
+               $.each( handlers, function( event, handler ) {
+                       function handlerProxy() {
+                               // allow widgets to customize the disabled handling
+                               // - disabled as an array instead of boolean
+                               // - disabled class as method for disabling individual parts
+                               if ( !suppressDisabledCheck &&
+                                               ( instance.options.disabled === true ||
+                                                       $( this ).hasClass( "ui-state-disabled" ) ) ) {
+                                       return;
+                               }
+                               return ( typeof handler === "string" ? instance[ handler ] : handler )
+                                       .apply( instance, arguments );
+                       }
+
+                       // copy the guid so direct unbinding works
+                       if ( typeof handler !== "string" ) {
+                               handlerProxy.guid = handler.guid =
+                                       handler.guid || handlerProxy.guid || $.guid++;
+                       }
+
+                       var match = event.match( /^(\w+)\s*(.*)$/ ),
+                               eventName = match[1] + instance.eventNamespace,
+                               selector = match[2];
+                       if ( selector ) {
+                               delegateElement.delegate( selector, eventName, handlerProxy );
+                       } else {
+                               element.bind( eventName, handlerProxy );
+                       }
+               });
+       },
+
+       _off: function( element, eventName ) {
+               eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;
+               element.unbind( eventName ).undelegate( eventName );
+       },
+
+       _delay: function( handler, delay ) {
+               function handlerProxy() {
+                       return ( typeof handler === "string" ? instance[ handler ] : handler )
+                               .apply( instance, arguments );
+               }
+               var instance = this;
+               return setTimeout( handlerProxy, delay || 0 );
+       },
+
+       _hoverable: function( element ) {
+               this.hoverable = this.hoverable.add( element );
+               this._on( element, {
+                       mouseenter: function( event ) {
+                               $( event.currentTarget ).addClass( "ui-state-hover" );
+                       },
+                       mouseleave: function( event ) {
+                               $( event.currentTarget ).removeClass( "ui-state-hover" );
+                       }
+               });
+       },
+
+       _focusable: function( element ) {
+               this.focusable = this.focusable.add( element );
+               this._on( element, {
+                       focusin: function( event ) {
+                               $( event.currentTarget ).addClass( "ui-state-focus" );
+                       },
+                       focusout: function( event ) {
+                               $( event.currentTarget ).removeClass( "ui-state-focus" );
+                       }
+               });
+       },
+
+       _trigger: function( type, event, data ) {
+               var prop, orig,
+                       callback = this.options[ type ];
+
+               data = data || {};
+               event = $.Event( event );
+               event.type = ( type === this.widgetEventPrefix ?
+                       type :
+                       this.widgetEventPrefix + type ).toLowerCase();
+               // the original event may come from any element
+               // so we need to reset the target on the new event
+               event.target = this.element[ 0 ];
+
+               // copy original event properties over to the new event
+               orig = event.originalEvent;
+               if ( orig ) {
+                       for ( prop in orig ) {
+                               if ( !( prop in event ) ) {
+                                       event[ prop ] = orig[ prop ];
+                               }
+                       }
+               }
+
+               this.element.trigger( event, data );
+               return !( $.isFunction( callback ) &&
+                       callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
+                       event.isDefaultPrevented() );
+       }
+};
+
+$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
+       $.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
+               if ( typeof options === "string" ) {
+                       options = { effect: options };
+               }
+               var hasOptions,
+                       effectName = !options ?
+                               method :
+                               options === true || typeof options === "number" ?
+                                       defaultEffect :
+                                       options.effect || defaultEffect;
+               options = options || {};
+               if ( typeof options === "number" ) {
+                       options = { duration: options };
+               }
+               hasOptions = !$.isEmptyObject( options );
+               options.complete = callback;
+               if ( options.delay ) {
+                       element.delay( options.delay );
+               }
+               if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
+                       element[ method ]( options );
+               } else if ( effectName !== method && element[ effectName ] ) {
+                       element[ effectName ]( options.duration, options.easing, callback );
+               } else {
+                       element.queue(function( next ) {
+                               $( this )[ method ]();
+                               if ( callback ) {
+                                       callback.call( element[ 0 ] );
+                               }
+                               next();
+                       });
+               }
+       };
+});
+
+})( jQuery );
+(function( $, undefined ) {
+
+$.ui = $.ui || {};
+
+var cachedScrollbarWidth,
+       max = Math.max,
+       abs = Math.abs,
+       round = Math.round,
+       rhorizontal = /left|center|right/,
+       rvertical = /top|center|bottom/,
+       roffset = /[\+\-]\d+(\.[\d]+)?%?/,
+       rposition = /^\w+/,
+       rpercent = /%$/,
+       _position = $.fn.position;
+
+function getOffsets( offsets, width, height ) {
+       return [
+               parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
+               parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
+       ];
+}
+
+function parseCss( element, property ) {
+       return parseInt( $.css( element, property ), 10 ) || 0;
+}
+
+function getDimensions( elem ) {
+       var raw = elem[0];
+       if ( raw.nodeType === 9 ) {
+               return {
+                       width: elem.width(),
+                       height: elem.height(),
+                       offset: { top: 0, left: 0 }
+               };
+       }
+       if ( $.isWindow( raw ) ) {
+               return {
+                       width: elem.width(),
+                       height: elem.height(),
+                       offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
+               };
+       }
+       if ( raw.preventDefault ) {
+               return {
+                       width: 0,
+                       height: 0,
+                       offset: { top: raw.pageY, left: raw.pageX }
+               };
+       }
+       return {
+               width: elem.outerWidth(),
+               height: elem.outerHeight(),
+               offset: elem.offset()
+       };
+}
+
+$.position = {
+       scrollbarWidth: function() {
+               if ( cachedScrollbarWidth !== undefined ) {
+                       return cachedScrollbarWidth;
+               }
+               var w1, w2,
+                       div = $( "<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
+                       innerDiv = div.children()[0];
+
+               $( "body" ).append( div );
+               w1 = innerDiv.offsetWidth;
+               div.css( "overflow", "scroll" );
+
+               w2 = innerDiv.offsetWidth;
+
+               if ( w1 === w2 ) {
+                       w2 = div[0].clientWidth;
+               }
+
+               div.remove();
+
+               return (cachedScrollbarWidth = w1 - w2);
+       },
+       getScrollInfo: function( within ) {
+               var overflowX = within.isWindow || within.isDocument ? "" :
+                               within.element.css( "overflow-x" ),
+                       overflowY = within.isWindow || within.isDocument ? "" :
+                               within.element.css( "overflow-y" ),
+                       hasOverflowX = overflowX === "scroll" ||
+                               ( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
+                       hasOverflowY = overflowY === "scroll" ||
+                               ( overflowY === "auto" && within.height < within.element[0].scrollHeight );
+               return {
+                       width: hasOverflowY ? $.position.scrollbarWidth() : 0,
+                       height: hasOverflowX ? $.position.scrollbarWidth() : 0
+               };
+       },
+       getWithinInfo: function( element ) {
+               var withinElement = $( element || window ),
+                       isWindow = $.isWindow( withinElement[0] ),
+                       isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9;
+               return {
+                       element: withinElement,
+                       isWindow: isWindow,
+                       isDocument: isDocument,
+                       offset: withinElement.offset() || { left: 0, top: 0 },
+                       scrollLeft: withinElement.scrollLeft(),
+                       scrollTop: withinElement.scrollTop(),
+                       width: isWindow ? withinElement.width() : withinElement.outerWidth(),
+                       height: isWindow ? withinElement.height() : withinElement.outerHeight()
+               };
+       }
+};
+
+$.fn.position = function( options ) {
+       if ( !options || !options.of ) {
+               return _position.apply( this, arguments );
+       }
+
+       // make a copy, we don't want to modify arguments
+       options = $.extend( {}, options );
+
+       var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
+               target = $( options.of ),
+               within = $.position.getWithinInfo( options.within ),
+               scrollInfo = $.position.getScrollInfo( within ),
+               collision = ( options.collision || "flip" ).split( " " ),
+               offsets = {};
+
+       dimensions = getDimensions( target );
+       if ( target[0].preventDefault ) {
+               // force left top to allow flipping
+               options.at = "left top";
+       }
+       targetWidth = dimensions.width;
+       targetHeight = dimensions.height;
+       targetOffset = dimensions.offset;
+       // clone to reuse original targetOffset later
+       basePosition = $.extend( {}, targetOffset );
+
+       // force my and at to have valid horizontal and vertical positions
+       // if a value is missing or invalid, it will be converted to center
+       $.each( [ "my", "at" ], function() {
+               var pos = ( options[ this ] || "" ).split( " " ),
+                       horizontalOffset,
+                       verticalOffset;
+
+               if ( pos.length === 1) {
+                       pos = rhorizontal.test( pos[ 0 ] ) ?
+                               pos.concat( [ "center" ] ) :
+                               rvertical.test( pos[ 0 ] ) ?
+                                       [ "center" ].concat( pos ) :
+                                       [ "center", "center" ];
+               }
+               pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
+               pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
+
+               // calculate offsets
+               horizontalOffset = roffset.exec( pos[ 0 ] );
+               verticalOffset = roffset.exec( pos[ 1 ] );
+               offsets[ this ] = [
+                       horizontalOffset ? horizontalOffset[ 0 ] : 0,
+                       verticalOffset ? verticalOffset[ 0 ] : 0
+               ];
+
+               // reduce to just the positions without the offsets
+               options[ this ] = [
+                       rposition.exec( pos[ 0 ] )[ 0 ],
+                       rposition.exec( pos[ 1 ] )[ 0 ]
+               ];
+       });
+
+       // normalize collision option
+       if ( collision.length === 1 ) {
+               collision[ 1 ] = collision[ 0 ];
+       }
+
+       if ( options.at[ 0 ] === "right" ) {
+               basePosition.left += targetWidth;
+       } else if ( options.at[ 0 ] === "center" ) {
+               basePosition.left += targetWidth / 2;
+       }
+
+       if ( options.at[ 1 ] === "bottom" ) {
+               basePosition.top += targetHeight;
+       } else if ( options.at[ 1 ] === "center" ) {
+               basePosition.top += targetHeight / 2;
+       }
+
+       atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
+       basePosition.left += atOffset[ 0 ];
+       basePosition.top += atOffset[ 1 ];
+
+       return this.each(function() {
+               var collisionPosition, using,
+                       elem = $( this ),
+                       elemWidth = elem.outerWidth(),
+                       elemHeight = elem.outerHeight(),
+                       marginLeft = parseCss( this, "marginLeft" ),
+                       marginTop = parseCss( this, "marginTop" ),
+                       collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
+                       collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
+                       position = $.extend( {}, basePosition ),
+                       myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
+
+               if ( options.my[ 0 ] === "right" ) {
+                       position.left -= elemWidth;
+               } else if ( options.my[ 0 ] === "center" ) {
+                       position.left -= elemWidth / 2;
+               }
+
+               if ( options.my[ 1 ] === "bottom" ) {
+                       position.top -= elemHeight;
+               } else if ( options.my[ 1 ] === "center" ) {
+                       position.top -= elemHeight / 2;
+               }
+
+               position.left += myOffset[ 0 ];
+               position.top += myOffset[ 1 ];
+
+               // if the browser doesn't support fractions, then round for consistent results
+               if ( !$.support.offsetFractions ) {
+                       position.left = round( position.left );
+                       position.top = round( position.top );
+               }
+
+               collisionPosition = {
+                       marginLeft: marginLeft,
+                       marginTop: marginTop
+               };
+
+               $.each( [ "left", "top" ], function( i, dir ) {
+                       if ( $.ui.position[ collision[ i ] ] ) {
+                               $.ui.position[ collision[ i ] ][ dir ]( position, {
+                                       targetWidth: targetWidth,
+                                       targetHeight: targetHeight,
+                                       elemWidth: elemWidth,
+                                       elemHeight: elemHeight,
+                                       collisionPosition: collisionPosition,
+                                       collisionWidth: collisionWidth,
+                                       collisionHeight: collisionHeight,
+                                       offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
+                                       my: options.my,
+                                       at: options.at,
+                                       within: within,
+                                       elem : elem
+                               });
+                       }
+               });
+
+               if ( options.using ) {
+                       // adds feedback as second argument to using callback, if present
+                       using = function( props ) {
+                               var left = targetOffset.left - position.left,
+                                       right = left + targetWidth - elemWidth,
+                                       top = targetOffset.top - position.top,
+                                       bottom = top + targetHeight - elemHeight,
+                                       feedback = {
+                                               target: {
+                                                       element: target,
+                                                       left: targetOffset.left,
+                                                       top: targetOffset.top,
+                                                       width: targetWidth,
+                                                       height: targetHeight
+                                               },
+                                               element: {
+                                                       element: elem,
+                                                       left: position.left,
+                                                       top: position.top,
+                                                       width: elemWidth,
+                                                       height: elemHeight
+                                               },
+                                               horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
+                                               vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
+                                       };
+                               if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
+                                       feedback.horizontal = "center";
+                               }
+                               if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
+                                       feedback.vertical = "middle";
+                               }
+                               if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
+                                       feedback.important = "horizontal";
+                               } else {
+                                       feedback.important = "vertical";
+                               }
+                               options.using.call( this, props, feedback );
+                       };
+               }
+
+               elem.offset( $.extend( position, { using: using } ) );
+       });
+};
+
+$.ui.position = {
+       fit: {
+               left: function( position, data ) {
+                       var within = data.within,
+                               withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
+                               outerWidth = within.width,
+                               collisionPosLeft = position.left - data.collisionPosition.marginLeft,
+                               overLeft = withinOffset - collisionPosLeft,
+                               overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
+                               newOverRight;
+
+                       // element is wider than within
+                       if ( data.collisionWidth > outerWidth ) {
+                               // element is initially over the left side of within
+                               if ( overLeft > 0 && overRight <= 0 ) {
+                                       newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
+                                       position.left += overLeft - newOverRight;
+                               // element is initially over right side of within
+                               } else if ( overRight > 0 && overLeft <= 0 ) {
+                                       position.left = withinOffset;
+                               // element is initially over both left and right sides of within
+                               } else {
+                                       if ( overLeft > overRight ) {
+                                               position.left = withinOffset + outerWidth - data.collisionWidth;
+                                       } else {
+                                               position.left = withinOffset;
+                                       }
+                               }
+                       // too far left -> align with left edge
+                       } else if ( overLeft > 0 ) {
+                               position.left += overLeft;
+                       // too far right -> align with right edge
+                       } else if ( overRight > 0 ) {
+                               position.left -= overRight;
+                       // adjust based on position and margin
+                       } else {
+                               position.left = max( position.left - collisionPosLeft, position.left );
+                       }
+               },
+               top: function( position, data ) {
+                       var within = data.within,
+                               withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
+                               outerHeight = data.within.height,
+                               collisionPosTop = position.top - data.collisionPosition.marginTop,
+                               overTop = withinOffset - collisionPosTop,
+                               overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
+                               newOverBottom;
+
+                       // element is taller than within
+                       if ( data.collisionHeight > outerHeight ) {
+                               // element is initially over the top of within
+                               if ( overTop > 0 && overBottom <= 0 ) {
+                                       newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
+                                       position.top += overTop - newOverBottom;
+                               // element is initially over bottom of within
+                               } else if ( overBottom > 0 && overTop <= 0 ) {
+                                       position.top = withinOffset;
+                               // element is initially over both top and bottom of within
+                               } else {
+                                       if ( overTop > overBottom ) {
+                                               position.top = withinOffset + outerHeight - data.collisionHeight;
+                                       } else {
+                                               position.top = withinOffset;
+                                       }
+                               }
+                       // too far up -> align with top
+                       } else if ( overTop > 0 ) {
+                               position.top += overTop;
+                       // too far down -> align with bottom edge
+                       } else if ( overBottom > 0 ) {
+                               position.top -= overBottom;
+                       // adjust based on position and margin
+                       } else {
+                               position.top = max( position.top - collisionPosTop, position.top );
+                       }
+               }
+       },
+       flip: {
+               left: function( position, data ) {
+                       var within = data.within,
+                               withinOffset = within.offset.left + within.scrollLeft,
+                               outerWidth = within.width,
+                               offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
+                               collisionPosLeft = position.left - data.collisionPosition.marginLeft,
+                               overLeft = collisionPosLeft - offsetLeft,
+                               overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
+                               myOffset = data.my[ 0 ] === "left" ?
+                                       -data.elemWidth :
+                                       data.my[ 0 ] === "right" ?
+                                               data.elemWidth :
+                                               0,
+                               atOffset = data.at[ 0 ] === "left" ?
+                                       data.targetWidth :
+                                       data.at[ 0 ] === "right" ?
+                                               -data.targetWidth :
+                                               0,
+                               offset = -2 * data.offset[ 0 ],
+                               newOverRight,
+                               newOverLeft;
+
+                       if ( overLeft < 0 ) {
+                               newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
+                               if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
+                                       position.left += myOffset + atOffset + offset;
+                               }
+                       }
+                       else if ( overRight > 0 ) {
+                               newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
+                               if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
+                                       position.left += myOffset + atOffset + offset;
+                               }
+                       }
+               },
+               top: function( position, data ) {
+                       var within = data.within,
+                               withinOffset = within.offset.top + within.scrollTop,
+                               outerHeight = within.height,
+                               offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
+                               collisionPosTop = position.top - data.collisionPosition.marginTop,
+                               overTop = collisionPosTop - offsetTop,
+                               overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
+                               top = data.my[ 1 ] === "top",
+                               myOffset = top ?
+                                       -data.elemHeight :
+                                       data.my[ 1 ] === "bottom" ?
+                                               data.elemHeight :
+                                               0,
+                               atOffset = data.at[ 1 ] === "top" ?
+                                       data.targetHeight :
+                                       data.at[ 1 ] === "bottom" ?
+                                               -data.targetHeight :
+                                               0,
+                               offset = -2 * data.offset[ 1 ],
+                               newOverTop,
+                               newOverBottom;
+                       if ( overTop < 0 ) {
+                               newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
+                               if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) {
+                                       position.top += myOffset + atOffset + offset;
+                               }
+                       }
+                       else if ( overBottom > 0 ) {
+                               newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
+                               if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) {
+                                       position.top += myOffset + atOffset + offset;
+                               }
+                       }
+               }
+       },
+       flipfit: {
+               left: function() {
+                       $.ui.position.flip.left.apply( this, arguments );
+                       $.ui.position.fit.left.apply( this, arguments );
+               },
+               top: function() {
+                       $.ui.position.flip.top.apply( this, arguments );
+                       $.ui.position.fit.top.apply( this, arguments );
+               }
+       }
+};
+
+// fraction support test
+(function () {
+       var testElement, testElementParent, testElementStyle, offsetLeft, i,
+               body = document.getElementsByTagName( "body" )[ 0 ],
+               div = document.createElement( "div" );
+
+       //Create a "fake body" for testing based on method used in jQuery.support
+       testElement = document.createElement( body ? "div" : "body" );
+       testElementStyle = {
+               visibility: "hidden",
+               width: 0,
+               height: 0,
+               border: 0,
+               margin: 0,
+               background: "none"
+       };
+       if ( body ) {
+               $.extend( testElementStyle, {
+                       position: "absolute",
+                       left: "-1000px",
+                       top: "-1000px"
+               });
+       }
+       for ( i in testElementStyle ) {
+               testElement.style[ i ] = testElementStyle[ i ];
+       }
+       testElement.appendChild( div );
+       testElementParent = body || document.documentElement;
+       testElementParent.insertBefore( testElement, testElementParent.firstChild );
+
+       div.style.cssText = "position: absolute; left: 10.7432222px;";
+
+       offsetLeft = $( div ).offset().left;
+       $.support.offsetFractions = offsetLeft > 10 && offsetLeft < 11;
+
+       testElement.innerHTML = "";
+       testElementParent.removeChild( testElement );
+})();
+
+}( jQuery ) );
+(function( $, undefined ) {
+
+$.widget( "ui.autocomplete", {
+       version: "1.10.4",
+       defaultElement: "<input>",
+       options: {
+               appendTo: null,
+               autoFocus: false,
+               delay: 300,
+               minLength: 1,
+               position: {
+                       my: "left top",
+                       at: "left bottom",
+                       collision: "none"
+               },
+               source: null,
+
+               // callbacks
+               change: null,
+               close: null,
+               focus: null,
+               open: null,
+               response: null,
+               search: null,
+               select: null
+       },
+
+       requestIndex: 0,
+       pending: 0,
+
+       _create: function() {
+               // Some browsers only repeat keydown events, not keypress events,
+               // so we use the suppressKeyPress flag to determine if we've already
+               // handled the keydown event. #7269
+               // Unfortunately the code for & in keypress is the same as the up arrow,
+               // so we use the suppressKeyPressRepeat flag to avoid handling keypress
+               // events when we know the keydown event was used to modify the
+               // search term. #7799
+               var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
+                       nodeName = this.element[0].nodeName.toLowerCase(),
+                       isTextarea = nodeName === "textarea",
+                       isInput = nodeName === "input";
+
+               this.isMultiLine =
+                       // Textareas are always multi-line
+                       isTextarea ? true :
+                       // Inputs are always single-line, even if inside a contentEditable element
+                       // IE also treats inputs as contentEditable
+                       isInput ? false :
+                       // All other element types are determined by whether or not they're contentEditable
+                       this.element.prop( "isContentEditable" );
+
+               this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
+               this.isNewMenu = true;
+
+               this.element
+                       .addClass( "ui-autocomplete-input" )
+                       .attr( "autocomplete", "off" );
+
+               this._on( this.element, {
+                       keydown: function( event ) {
+                               if ( this.element.prop( "readOnly" ) ) {
+                                       suppressKeyPress = true;
+                                       suppressInput = true;
+                                       suppressKeyPressRepeat = true;
+                                       return;
+                               }
+
+                               suppressKeyPress = false;
+                               suppressInput = false;
+                               suppressKeyPressRepeat = false;
+                               var keyCode = $.ui.keyCode;
+                               switch( event.keyCode ) {
+                               case keyCode.PAGE_UP:
+                                       suppressKeyPress = true;
+                                       this._move( "previousPage", event );
+                                       break;
+                               case keyCode.PAGE_DOWN:
+                                       suppressKeyPress = true;
+                                       this._move( "nextPage", event );
+                                       break;
+                               case keyCode.UP:
+                                       suppressKeyPress = true;
+                                       this._keyEvent( "previous", event );
+                                       break;
+                               case keyCode.DOWN:
+                                       suppressKeyPress = true;
+                                       this._keyEvent( "next", event );
+                                       break;
+                               case keyCode.ENTER:
+                               case keyCode.NUMPAD_ENTER:
+                                       // when menu is open and has focus
+                                       if ( this.menu.active ) {
+                                               // #6055 - Opera still allows the keypress to occur
+                                               // which causes forms to submit
+                                               suppressKeyPress = true;
+                                               event.preventDefault();
+                                               this.menu.select( event );
+                                       }
+                                       break;
+                               case keyCode.TAB:
+                                       if ( this.menu.active ) {
+                                               this.menu.select( event );
+                                       }
+                                       break;
+                               case keyCode.ESCAPE:
+                                       if ( this.menu.element.is( ":visible" ) ) {
+                                               this._value( this.term );
+                                               this.close( event );
+                                               // Different browsers have different default behavior for escape
+                                               // Single press can mean undo or clear
+                                               // Double press in IE means clear the whole form
+                                               event.preventDefault();
+                                       }
+                                       break;
+                               default:
+                                       suppressKeyPressRepeat = true;
+                                       // search timeout should be triggered before the input value is changed
+                                       this._searchTimeout( event );
+                                       break;
+                               }
+                       },
+                       keypress: function( event ) {
+                               if ( suppressKeyPress ) {
+                                       suppressKeyPress = false;
+                                       if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
+                                               event.preventDefault();
+                                       }
+                                       return;
+                               }
+                               if ( suppressKeyPressRepeat ) {
+                                       return;
+                               }
+
+                               // replicate some key handlers to allow them to repeat in Firefox and Opera
+                               var keyCode = $.ui.keyCode;
+                               switch( event.keyCode ) {
+                               case keyCode.PAGE_UP:
+                                       this._move( "previousPage", event );
+                                       break;
+                               case keyCode.PAGE_DOWN:
+                                       this._move( "nextPage", event );
+                                       break;
+                               case keyCode.UP:
+                                       this._keyEvent( "previous", event );
+                                       break;
+                               case keyCode.DOWN:
+                                       this._keyEvent( "next", event );
+                                       break;
+                               }
+                       },
+                       input: function( event ) {
+                               if ( suppressInput ) {
+                                       suppressInput = false;
+                                       event.preventDefault();
+                                       return;
+                               }
+                               this._searchTimeout( event );
+                       },
+                       focus: function() {
+                               this.selectedItem = null;
+                               this.previous = this._value();
+                       },
+                       blur: function( event ) {
+                               if ( this.cancelBlur ) {
+                                       delete this.cancelBlur;
+                                       return;
+                               }
+
+                               clearTimeout( this.searching );
+                               this.close( event );
+                               this._change( event );
+                       }
+               });
+
+               this._initSource();
+               this.menu = $( "<ul>" )
+                       .addClass( "ui-autocomplete ui-front" )
+                       .appendTo( this._appendTo() )
+                       .menu({
+                               // disable ARIA support, the live region takes care of that
+                               role: null
+                       })
+                       .hide()
+                       .data( "ui-menu" );
+
+               this._on( this.menu.element, {
+                       mousedown: function( event ) {
+                               // prevent moving focus out of the text field
+                               event.preventDefault();
+
+                               // IE doesn't prevent moving focus even with event.preventDefault()
+                               // so we set a flag to know when we should ignore the blur event
+                               this.cancelBlur = true;
+                               this._delay(function() {
+                                       delete this.cancelBlur;
+                               });
+
+                               // clicking on the scrollbar causes focus to shift to the body
+                               // but we can't detect a mouseup or a click immediately afterward
+                               // so we have to track the next mousedown and close the menu if
+                               // the user clicks somewhere outside of the autocomplete
+                               var menuElement = this.menu.element[ 0 ];
+                               if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
+                                       this._delay(function() {
+                                               var that = this;
+                                               this.document.one( "mousedown", function( event ) {
+                                                       if ( event.target !== that.element[ 0 ] &&
+                                                                       event.target !== menuElement &&
+                                                                       !$.contains( menuElement, event.target ) ) {
+                                                               that.close();
+                                                       }
+                                               });
+                                       });
+                               }
+                       },
+                       menufocus: function( event, ui ) {
+                               // support: Firefox
+                               // Prevent accidental activation of menu items in Firefox (#7024 #9118)
+                               if ( this.isNewMenu ) {
+                                       this.isNewMenu = false;
+                                       if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
+                                               this.menu.blur();
+
+                                               this.document.one( "mousemove", function() {
+                                                       $( event.target ).trigger( event.originalEvent );
+                                               });
+
+                                               return;
+                                       }
+                               }
+
+                               var item = ui.item.data( "ui-autocomplete-item" );
+                               if ( false !== this._trigger( "focus", event, { item: item } ) ) {
+                                       // use value to match what will end up in the input, if it was a key event
+                                       if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
+                                               this._value( item.value );
+                                       }
+                               } else {
+                                       // Normally the input is populated with the item's value as the
+                                       // menu is navigated, causing screen readers to notice a change and
+                                       // announce the item. Since the focus event was canceled, this doesn't
+                                       // happen, so we update the live region so that screen readers can
+                                       // still notice the change and announce it.
+                                       this.liveRegion.text( item.value );
+                               }
+                       },
+                       menuselect: function( event, ui ) {
+                               var item = ui.item.data( "ui-autocomplete-item" ),
+                                       previous = this.previous;
+
+                               // only trigger when focus was lost (click on menu)
+                               if ( this.element[0] !== this.document[0].activeElement ) {
+                                       this.element.focus();
+                                       this.previous = previous;
+                                       // #6109 - IE triggers two focus events and the second
+                                       // is asynchronous, so we need to reset the previous
+                                       // term synchronously and asynchronously :-(
+                                       this._delay(function() {
+                                               this.previous = previous;
+                                               this.selectedItem = item;
+                                       });
+                               }
+
+                               if ( false !== this._trigger( "select", event, { item: item } ) ) {
+                                       this._value( item.value );
+                               }
+                               // reset the term after the select event
+                               // this allows custom select handling to work properly
+                               this.term = this._value();
+
+                               this.close( event );
+                               this.selectedItem = item;
+                       }
+               });
+
+               this.liveRegion = $( "<span>", {
+                               role: "status",
+                               "aria-live": "polite"
+                       })
+                       .addClass( "ui-helper-hidden-accessible" )
+                       .insertBefore( this.element );
+
+               // turning off autocomplete prevents the browser from remembering the
+               // value when navigating through history, so we re-enable autocomplete
+               // if the page is unloaded before the widget is destroyed. #7790
+               this._on( this.window, {
+                       beforeunload: function() {
+                               this.element.removeAttr( "autocomplete" );
+                       }
+               });
+       },
+
+       _destroy: function() {
+               clearTimeout( this.searching );
+               this.element
+                       .removeClass( "ui-autocomplete-input" )
+                       .removeAttr( "autocomplete" );
+               this.menu.element.remove();
+               this.liveRegion.remove();
+       },
+
+       _setOption: function( key, value ) {
+               this._super( key, value );
+               if ( key === "source" ) {
+                       this._initSource();
+               }
+               if ( key === "appendTo" ) {
+                       this.menu.element.appendTo( this._appendTo() );
+               }
+               if ( key === "disabled" && value && this.xhr ) {
+                       this.xhr.abort();
+               }
+       },
+
+       _appendTo: function() {
+               var element = this.options.appendTo;
+
+               if ( element ) {
+                       element = element.jquery || element.nodeType ?
+                               $( element ) :
+                               this.document.find( element ).eq( 0 );
+               }
+
+               if ( !element ) {
+                       element = this.element.closest( ".ui-front" );
+               }
+
+               if ( !element.length ) {
+                       element = this.document[0].body;
+               }
+
+               return element;
+       },
+
+       _initSource: function() {
+               var array, url,
+                       that = this;
+               if ( $.isArray(this.options.source) ) {
+                       array = this.options.source;
+                       this.source = function( request, response ) {
+                               response( $.ui.autocomplete.filter( array, request.term ) );
+                       };
+               } else if ( typeof this.options.source === "string" ) {
+                       url = this.options.source;
+                       this.source = function( request, response ) {
+                               if ( that.xhr ) {
+                                       that.xhr.abort();
+                               }
+                               that.xhr = $.ajax({
+                                       url: url,
+                                       data: request,
+                                       dataType: "json",
+                                       success: function( data ) {
+                                               response( data );
+                                       },
+                                       error: function() {
+                                               response( [] );
+                                       }
+                               });
+                       };
+               } else {
+                       this.source = this.options.source;
+               }
+       },
+
+       _searchTimeout: function( event ) {
+               clearTimeout( this.searching );
+               this.searching = this._delay(function() {
+                       // only search if the value has changed
+                       if ( this.term !== this._value() ) {
+                               this.selectedItem = null;
+                               this.search( null, event );
+                       }
+               }, this.options.delay );
+       },
+
+       search: function( value, event ) {
+               value = value != null ? value : this._value();
+
+               // always save the actual value, not the one passed as an argument
+               this.term = this._value();
+
+               if ( value.length < this.options.minLength ) {
+                       return this.close( event );
+               }
+
+               if ( this._trigger( "search", event ) === false ) {
+                       return;
+               }
+
+               return this._search( value );
+       },
+
+       _search: function( value ) {
+               this.pending++;
+               this.element.addClass( "ui-autocomplete-loading" );
+               this.cancelSearch = false;
+
+               this.source( { term: value }, this._response() );
+       },
+
+       _response: function() {
+               var index = ++this.requestIndex;
+
+               return $.proxy(function( content ) {
+                       if ( index === this.requestIndex ) {
+                               this.__response( content );
+                       }
+
+                       this.pending--;
+                       if ( !this.pending ) {
+                               this.element.removeClass( "ui-autocomplete-loading" );
+                       }
+               }, this );
+       },
+
+       __response: function( content ) {
+               if ( content ) {
+                       content = this._normalize( content );
+               }
+               this._trigger( "response", null, { content: content } );
+               if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
+                       this._suggest( content );
+                       this._trigger( "open" );
+               } else {
+                       // use ._close() instead of .close() so we don't cancel future searches
+                       this._close();
+               }
+       },
+
+       close: function( event ) {
+               this.cancelSearch = true;
+               this._close( event );
+       },
+
+       _close: function( event ) {
+               if ( this.menu.element.is( ":visible" ) ) {
+                       this.menu.element.hide();
+                       this.menu.blur();
+                       this.isNewMenu = true;
+                       this._trigger( "close", event );
+               }
+       },
+
+       _change: function( event ) {
+               if ( this.previous !== this._value() ) {
+                       this._trigger( "change", event, { item: this.selectedItem } );
+               }
+       },
+
+       _normalize: function( items ) {
+               // assume all items have the right format when the first item is complete
+               if ( items.length && items[0].label && items[0].value ) {
+                       return items;
+               }
+               return $.map( items, function( item ) {
+                       if ( typeof item === "string" ) {
+                               return {
+                                       label: item,
+                                       value: item
+                               };
+                       }
+                       return $.extend({
+                               label: item.label || item.value,
+                               value: item.value || item.label
+                       }, item );
+               });
+       },
+
+       _suggest: function( items ) {
+               var ul = this.menu.element.empty();
+               this._renderMenu( ul, items );
+               this.isNewMenu = true;
+               this.menu.refresh();
+
+               // size and position menu
+               ul.show();
+               this._resizeMenu();
+               ul.position( $.extend({
+                       of: this.element
+               }, this.options.position ));
+
+               if ( this.options.autoFocus ) {
+                       this.menu.next();
+               }
+       },
+
+       _resizeMenu: function() {
+               var ul = this.menu.element;
+               ul.outerWidth( Math.max(
+                       // Firefox wraps long text (possibly a rounding bug)
+                       // so we add 1px to avoid the wrapping (#7513)
+                       ul.width( "" ).outerWidth() + 1,
+                       this.element.outerWidth()
+               ) );
+       },
+
+       _renderMenu: function( ul, items ) {
+               var that = this;
+               $.each( items, function( index, item ) {
+                       that._renderItemData( ul, item );
+               });
+       },
+
+       _renderItemData: function( ul, item ) {
+               return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
+       },
+
+       _renderItem: function( ul, item ) {
+               return $( "<li>" )
+                       .append( $( "<a>" ).text( item.label ) )
+                       .appendTo( ul );
+       },
+
+       _move: function( direction, event ) {
+               if ( !this.menu.element.is( ":visible" ) ) {
+                       this.search( null, event );
+                       return;
+               }
+               if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
+                               this.menu.isLastItem() && /^next/.test( direction ) ) {
+                       this._value( this.term );
+                       this.menu.blur();
+                       return;
+               }
+               this.menu[ direction ]( event );
+       },
+
+       widget: function() {
+               return this.menu.element;
+       },
+
+       _value: function() {
+               return this.valueMethod.apply( this.element, arguments );
+       },
+
+       _keyEvent: function( keyEvent, event ) {
+               if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
+                       this._move( keyEvent, event );
+
+                       // prevents moving cursor to beginning/end of the text field in some browsers
+                       event.preventDefault();
+               }
+       }
+});
+
+$.extend( $.ui.autocomplete, {
+       escapeRegex: function( value ) {
+               return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
+       },
+       filter: function(array, term) {
+               var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );
+               return $.grep( array, function(value) {
+                       return matcher.test( value.label || value.value || value );
+               });
+       }
+});
+
+
+// live region extension, adding a `messages` option
+// NOTE: This is an experimental API. We are still investigating
+// a full solution for string manipulation and internationalization.
+$.widget( "ui.autocomplete", $.ui.autocomplete, {
+       options: {
+               messages: {
+                       noResults: "No search results.",
+                       results: function( amount ) {
+                               return amount + ( amount > 1 ? " results are" : " result is" ) +
+                                       " available, use up and down arrow keys to navigate.";
+                       }
+               }
+       },
+
+       __response: function( content ) {
+               var message;
+               this._superApply( arguments );
+               if ( this.options.disabled || this.cancelSearch ) {
+                       return;
+               }
+               if ( content && content.length ) {
+                       message = this.options.messages.results( content.length );
+               } else {
+                       message = this.options.messages.noResults;
+               }
+               this.liveRegion.text( message );
+       }
+});
+
+}( jQuery ));
+(function( $, undefined ) {
+
+$.widget( "ui.menu", {
+       version: "1.10.4",
+       defaultElement: "<ul>",
+       delay: 300,
+       options: {
+               icons: {
+                       submenu: "ui-icon-carat-1-e"
+               },
+               menus: "ul",
+               position: {
+                       my: "left top",
+                       at: "right top"
+               },
+               role: "menu",
+
+               // callbacks
+               blur: null,
+               focus: null,
+               select: null
+       },
+
+       _create: function() {
+               this.activeMenu = this.element;
+               // flag used to prevent firing of the click handler
+               // as the event bubbles up through nested menus
+               this.mouseHandled = false;
+               this.element
+                       .uniqueId()
+                       .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
+                       .toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length )
+                       .attr({
+                               role: this.options.role,
+                               tabIndex: 0
+                       })
+                       // need to catch all clicks on disabled menu
+                       // not possible through _on
+                       .bind( "click" + this.eventNamespace, $.proxy(function( event ) {
+                               if ( this.options.disabled ) {
+                                       event.preventDefault();
+                               }
+                       }, this ));
+
+               if ( this.options.disabled ) {
+                       this.element
+                               .addClass( "ui-state-disabled" )
+                               .attr( "aria-disabled", "true" );
+               }
+
+               this._on({
+                       // Prevent focus from sticking to links inside menu after clicking
+                       // them (focus should always stay on UL during navigation).
+                       "mousedown .ui-menu-item > a": function( event ) {
+                               event.preventDefault();
+                       },
+                       "click .ui-state-disabled > a": function( event ) {
+                               event.preventDefault();
+                       },
+                       "click .ui-menu-item:has(a)": function( event ) {
+                               var target = $( event.target ).closest( ".ui-menu-item" );
+                               if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
+                                       this.select( event );
+
+                                       // Only set the mouseHandled flag if the event will bubble, see #9469.
+                                       if ( !event.isPropagationStopped() ) {
+                                               this.mouseHandled = true;
+                                       }
+
+                                       // Open submenu on click
+                                       if ( target.has( ".ui-menu" ).length ) {
+                                               this.expand( event );
+                                       } else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) {
+
+                                               // Redirect focus to the menu
+                                               this.element.trigger( "focus", [ true ] );
+
+                                               // If the active item is on the top level, let it stay active.
+                                               // Otherwise, blur the active item since it is no longer visible.
+                                               if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
+                                                       clearTimeout( this.timer );
+                                               }
+                                       }
+                               }
+                       },
+                       "mouseenter .ui-menu-item": function( event ) {
+                               var target = $( event.currentTarget );
+                               // Remove ui-state-active class from siblings of the newly focused menu item
+                               // to avoid a jump caused by adjacent elements both having a class with a border
+                               target.siblings().children( ".ui-state-active" ).removeClass( "ui-state-active" );
+                               this.focus( event, target );
+                       },
+                       mouseleave: "collapseAll",
+                       "mouseleave .ui-menu": "collapseAll",
+                       focus: function( event, keepActiveItem ) {
+                               // If there's already an active item, keep it active
+                               // If not, activate the first item
+                               var item = this.active || this.element.children( ".ui-menu-item" ).eq( 0 );
+
+                               if ( !keepActiveItem ) {
+                                       this.focus( event, item );
+                               }
+                       },
+                       blur: function( event ) {
+                               this._delay(function() {
+                                       if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {
+                                               this.collapseAll( event );
+                                       }
+                               });
+                       },
+                       keydown: "_keydown"
+               });
+
+               this.refresh();
+
+               // Clicks outside of a menu collapse any open menus
+               this._on( this.document, {
+                       click: function( event ) {
+                               if ( !$( event.target ).closest( ".ui-menu" ).length ) {
+                                       this.collapseAll( event );
+                               }
+
+                               // Reset the mouseHandled flag
+                               this.mouseHandled = false;
+                       }
+               });
+       },
+
+       _destroy: function() {
+               // Destroy (sub)menus
+               this.element
+                       .removeAttr( "aria-activedescendant" )
+                       .find( ".ui-menu" ).addBack()
+                               .removeClass( "ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons" )
+                               .removeAttr( "role" )
+                               .removeAttr( "tabIndex" )
+                               .removeAttr( "aria-labelledby" )
+                               .removeAttr( "aria-expanded" )
+                               .removeAttr( "aria-hidden" )
+                               .removeAttr( "aria-disabled" )
+                               .removeUniqueId()
+                               .show();
+
+               // Destroy menu items
+               this.element.find( ".ui-menu-item" )
+                       .removeClass( "ui-menu-item" )
+                       .removeAttr( "role" )
+                       .removeAttr( "aria-disabled" )
+                       .children( "a" )
+                               .removeUniqueId()
+                               .removeClass( "ui-corner-all ui-state-hover" )
+                               .removeAttr( "tabIndex" )
+                               .removeAttr( "role" )
+                               .removeAttr( "aria-haspopup" )
+                               .children().each( function() {
+                                       var elem = $( this );
+                                       if ( elem.data( "ui-menu-submenu-carat" ) ) {
+                                               elem.remove();
+                                       }
+                               });
+
+               // Destroy menu dividers
+               this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
+       },
+
+       _keydown: function( event ) {
+               var match, prev, character, skip, regex,
+                       preventDefault = true;
+
+               function escape( value ) {
+                       return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
+               }
+
+               switch ( event.keyCode ) {
+               case $.ui.keyCode.PAGE_UP:
+                       this.previousPage( event );
+                       break;
+               case $.ui.keyCode.PAGE_DOWN:
+                       this.nextPage( event );
+                       break;
+               case $.ui.keyCode.HOME:
+                       this._move( "first", "first", event );
+                       break;
+               case $.ui.keyCode.END:
+                       this._move( "last", "last", event );
+                       break;
+               case $.ui.keyCode.UP:
+                       this.previous( event );
+                       break;
+               case $.ui.keyCode.DOWN:
+                       this.next( event );
+                       break;
+               case $.ui.keyCode.LEFT:
+                       this.collapse( event );
+                       break;
+               case $.ui.keyCode.RIGHT:
+                       if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
+                               this.expand( event );
+                       }
+                       break;
+               case $.ui.keyCode.ENTER:
+               case $.ui.keyCode.SPACE:
+                       this._activate( event );
+                       break;
+               case $.ui.keyCode.ESCAPE:
+                       this.collapse( event );
+                       break;
+               default:
+                       preventDefault = false;
+                       prev = this.previousFilter || "";
+                       character = String.fromCharCode( event.keyCode );
+                       skip = false;
+
+                       clearTimeout( this.filterTimer );
+
+                       if ( character === prev ) {
+                               skip = true;
+                       } else {
+                               character = prev + character;
+                       }
+
+                       regex = new RegExp( "^" + escape( character ), "i" );
+                       match = this.activeMenu.children( ".ui-menu-item" ).filter(function() {
+                               return regex.test( $( this ).children( "a" ).text() );
+                       });
+                       match = skip && match.index( this.active.next() ) !== -1 ?
+                               this.active.nextAll( ".ui-menu-item" ) :
+                               match;
+
+                       // If no matches on the current filter, reset to the last character pressed
+                       // to move down the menu to the first item that starts with that character
+                       if ( !match.length ) {
+                               character = String.fromCharCode( event.keyCode );
+                               regex = new RegExp( "^" + escape( character ), "i" );
+                               match = this.activeMenu.children( ".ui-menu-item" ).filter(function() {
+                                       return regex.test( $( this ).children( "a" ).text() );
+                               });
+                       }
+
+                       if ( match.length ) {
+                               this.focus( event, match );
+                               if ( match.length > 1 ) {
+                                       this.previousFilter = character;
+                                       this.filterTimer = this._delay(function() {
+                                               delete this.previousFilter;
+                                       }, 1000 );
+                               } else {
+                                       delete this.previousFilter;
+                               }
+                       } else {
+                               delete this.previousFilter;
+                       }
+               }
+
+               if ( preventDefault ) {
+                       event.preventDefault();
+               }
+       },
+
+       _activate: function( event ) {
+               if ( !this.active.is( ".ui-state-disabled" ) ) {
+                       if ( this.active.children( "a[aria-haspopup='true']" ).length ) {
+                               this.expand( event );
+                       } else {
+                               this.select( event );
+                       }
+               }
+       },
+
+       refresh: function() {
+               var menus,
+                       icon = this.options.icons.submenu,
+                       submenus = this.element.find( this.options.menus );
+
+               this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
+
+               // Initialize nested menus
+               submenus.filter( ":not(.ui-menu)" )
+                       .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
+                       .hide()
+                       .attr({
+                               role: this.options.role,
+                               "aria-hidden": "true",
+                               "aria-expanded": "false"
+                       })
+                       .each(function() {
+                               var menu = $( this ),
+                                       item = menu.prev( "a" ),
+                                       submenuCarat = $( "<span>" )
+                                               .addClass( "ui-menu-icon ui-icon " + icon )
+                                               .data( "ui-menu-submenu-carat", true );
+
+                               item
+                                       .attr( "aria-haspopup", "true" )
+                                       .prepend( submenuCarat );
+                               menu.attr( "aria-labelledby", item.attr( "id" ) );
+                       });
+
+               menus = submenus.add( this.element );
+
+               // Don't refresh list items that are already adapted
+               menus.children( ":not(.ui-menu-item):has(a)" )
+                       .addClass( "ui-menu-item" )
+                       .attr( "role", "presentation" )
+                       .children( "a" )
+                               .uniqueId()
+                               .addClass( "ui-corner-all" )
+                               .attr({
+                                       tabIndex: -1,
+                                       role: this._itemRole()
+                               });
+
+               // Initialize unlinked menu-items containing spaces and/or dashes only as dividers
+               menus.children( ":not(.ui-menu-item)" ).each(function() {
+                       var item = $( this );
+                       // hyphen, em dash, en dash
+                       if ( !/[^\-\u2014\u2013\s]/.test( item.text() ) ) {
+                               item.addClass( "ui-widget-content ui-menu-divider" );
+                       }
+               });
+
+               // Add aria-disabled attribute to any disabled menu item
+               menus.children( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
+
+               // If the active item has been removed, blur the menu
+               if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
+                       this.blur();
+               }
+       },
+
+       _itemRole: function() {
+               return {
+                       menu: "menuitem",
+                       listbox: "option"
+               }[ this.options.role ];
+       },
+
+       _setOption: function( key, value ) {
+               if ( key === "icons" ) {
+                       this.element.find( ".ui-menu-icon" )
+                               .removeClass( this.options.icons.submenu )
+                               .addClass( value.submenu );
+               }
+               this._super( key, value );
+       },
+
+       focus: function( event, item ) {
+               var nested, focused;
+               this.blur( event, event && event.type === "focus" );
+
+               this._scrollIntoView( item );
+
+               this.active = item.first();
+               focused = this.active.children( "a" ).addClass( "ui-state-focus" );
+               // Only update aria-activedescendant if there's a role
+               // otherwise we assume focus is managed elsewhere
+               if ( this.options.role ) {
+                       this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
+               }
+
+               // Highlight active parent menu item, if any
+               this.active
+                       .parent()
+                       .closest( ".ui-menu-item" )
+                       .children( "a:first" )
+                       .addClass( "ui-state-active" );
+
+               if ( event && event.type === "keydown" ) {
+                       this._close();
+               } else {
+                       this.timer = this._delay(function() {
+                               this._close();
+                       }, this.delay );
+               }
+
+               nested = item.children( ".ui-menu" );
+               if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
+                       this._startOpening(nested);
+               }
+               this.activeMenu = item.parent();
+
+               this._trigger( "focus", event, { item: item } );
+       },
+
+       _scrollIntoView: function( item ) {
+               var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
+               if ( this._hasScroll() ) {
+                       borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
+                       paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
+                       offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
+                       scroll = this.activeMenu.scrollTop();
+                       elementHeight = this.activeMenu.height();
+                       itemHeight = item.height();
+
+                       if ( offset < 0 ) {
+                               this.activeMenu.scrollTop( scroll + offset );
+                       } else if ( offset + itemHeight > elementHeight ) {
+                               this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
+                       }
+               }
+       },
+
+       blur: function( event, fromFocus ) {
+               if ( !fromFocus ) {
+                       clearTimeout( this.timer );
+               }
+
+               if ( !this.active ) {
+                       return;
+               }
+
+               this.active.children( "a" ).removeClass( "ui-state-focus" );
+               this.active = null;
+
+               this._trigger( "blur", event, { item: this.active } );
+       },
+
+       _startOpening: function( submenu ) {
+               clearTimeout( this.timer );
+
+               // Don't open if already open fixes a Firefox bug that caused a .5 pixel
+               // shift in the submenu position when mousing over the carat icon
+               if ( submenu.attr( "aria-hidden" ) !== "true" ) {
+                       return;
+               }
+
+               this.timer = this._delay(function() {
+                       this._close();
+                       this._open( submenu );
+               }, this.delay );
+       },
+
+       _open: function( submenu ) {
+               var position = $.extend({
+                       of: this.active
+               }, this.options.position );
+
+               clearTimeout( this.timer );
+               this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
+                       .hide()
+                       .attr( "aria-hidden", "true" );
+
+               submenu
+                       .show()
+                       .removeAttr( "aria-hidden" )
+                       .attr( "aria-expanded", "true" )
+                       .position( position );
+       },
+
+       collapseAll: function( event, all ) {
+               clearTimeout( this.timer );
+               this.timer = this._delay(function() {
+                       // If we were passed an event, look for the submenu that contains the event
+                       var currentMenu = all ? this.element :
+                               $( event && event.target ).closest( this.element.find( ".ui-menu" ) );
+
+                       // If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
+                       if ( !currentMenu.length ) {
+                               currentMenu = this.element;
+                       }
+
+                       this._close( currentMenu );
+
+                       this.blur( event );
+                       this.activeMenu = currentMenu;
+               }, this.delay );
+       },
+
+       // With no arguments, closes the currently active menu - if nothing is active
+       // it closes all menus.  If passed an argument, it will search for menus BELOW
+       _close: function( startMenu ) {
+               if ( !startMenu ) {
+                       startMenu = this.active ? this.active.parent() : this.element;
+               }
+
+               startMenu
+                       .find( ".ui-menu" )
+                               .hide()
+                               .attr( "aria-hidden", "true" )
+                               .attr( "aria-expanded", "false" )
+                       .end()
+                       .find( "a.ui-state-active" )
+                               .removeClass( "ui-state-active" );
+       },
+
+       collapse: function( event ) {
+               var newItem = this.active &&
+                       this.active.parent().closest( ".ui-menu-item", this.element );
+               if ( newItem && newItem.length ) {
+                       this._close();
+                       this.focus( event, newItem );
+               }
+       },
+
+       expand: function( event ) {
+               var newItem = this.active &&
+                       this.active
+                               .children( ".ui-menu " )
+                               .children( ".ui-menu-item" )
+                               .first();
+
+               if ( newItem && newItem.length ) {
+                       this._open( newItem.parent() );
+
+                       // Delay so Firefox will not hide activedescendant change in expanding submenu from AT
+                       this._delay(function() {
+                               this.focus( event, newItem );
+                       });
+               }
+       },
+
+       next: function( event ) {
+               this._move( "next", "first", event );
+       },
+
+       previous: function( event ) {
+               this._move( "prev", "last", event );
+       },
+
+       isFirstItem: function() {
+               return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
+       },
+
+       isLastItem: function() {
+               return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
+       },
+
+       _move: function( direction, filter, event ) {
+               var next;
+               if ( this.active ) {
+                       if ( direction === "first" || direction === "last" ) {
+                               next = this.active
+                                       [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
+                                       .eq( -1 );
+                       } else {
+                               next = this.active
+                                       [ direction + "All" ]( ".ui-menu-item" )
+                                       .eq( 0 );
+                       }
+               }
+               if ( !next || !next.length || !this.active ) {
+                       next = this.activeMenu.children( ".ui-menu-item" )[ filter ]();
+               }
+
+               this.focus( event, next );
+       },
+
+       nextPage: function( event ) {
+               var item, base, height;
+
+               if ( !this.active ) {
+                       this.next( event );
+                       return;
+               }
+               if ( this.isLastItem() ) {
+                       return;
+               }
+               if ( this._hasScroll() ) {
+                       base = this.active.offset().top;
+                       height = this.element.height();
+                       this.active.nextAll( ".ui-menu-item" ).each(function() {
+                               item = $( this );
+                               return item.offset().top - base - height < 0;
+                       });
+
+                       this.focus( event, item );
+               } else {
+                       this.focus( event, this.activeMenu.children( ".ui-menu-item" )
+                               [ !this.active ? "first" : "last" ]() );
+               }
+       },
+
+       previousPage: function( event ) {
+               var item, base, height;
+               if ( !this.active ) {
+                       this.next( event );
+                       return;
+               }
+               if ( this.isFirstItem() ) {
+                       return;
+               }
+               if ( this._hasScroll() ) {
+                       base = this.active.offset().top;
+                       height = this.element.height();
+                       this.active.prevAll( ".ui-menu-item" ).each(function() {
+                               item = $( this );
+                               return item.offset().top - base + height > 0;
+                       });
+
+                       this.focus( event, item );
+               } else {
+                       this.focus( event, this.activeMenu.children( ".ui-menu-item" ).first() );
+               }
+       },
+
+       _hasScroll: function() {
+               return this.element.outerHeight() < this.element.prop( "scrollHeight" );
+       },
+
+       select: function( event ) {
+               // TODO: It should never be possible to not have an active item at this
+               // point, but the tests don't trigger mouseenter before click.
+               this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
+               var ui = { item: this.active };
+               if ( !this.active.has( ".ui-menu" ).length ) {
+                       this.collapseAll( event, true );
+               }
+               this._trigger( "select", event, ui );
+       }
+});
+
+}( jQuery ));
diff --git a/themes/default/js/jquery-ui-1.10.4.custom.min.js b/themes/default/js/jquery-ui-1.10.4.custom.min.js
new file mode 100644 (file)
index 0000000..3163502
--- /dev/null
@@ -0,0 +1,6 @@
+/*! jQuery UI - v1.10.4 - 2014-03-08
+* http://jqueryui.com
+* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.position.js, jquery.ui.autocomplete.js, jquery.ui.menu.js
+* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
+
+(function(e,t){function i(t,i){var s,a,o,r=t.nodeName.toLowerCase();return"area"===r?(s=t.parentNode,a=s.name,t.href&&a&&"map"===s.nodeName.toLowerCase()?(o=e("img[usemap=#"+a+"]")[0],!!o&&n(o)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||i:i)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var s=0,a=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,n){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),n&&n.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var n,s,a=e(this[0]);a.length&&a[0]!==document;){if(n=a.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(s=parseInt(a.css("zIndex"),10),!isNaN(s)&&0!==s))return s;a=a.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})},removeUniqueId:function(){return this.each(function(){a.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,n){return!!e.data(t,n[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),s=isNaN(n);return(s||n>=0)&&i(t,!s)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,n){function s(t,i,n,s){return e.each(a,function(){i-=parseFloat(e.css(t,"padding"+this))||0,n&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var a="Width"===n?["Left","Right"]:["Top","Bottom"],o=n.toLowerCase(),r={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(i){return i===t?r["inner"+n].call(this):this.each(function(){e(this).css(o,s(this,i)+"px")})},e.fn["outer"+n]=function(t,i){return"number"!=typeof t?r["outer"+n].call(this,t):this.each(function(){e(this).css(o,s(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,n){var s,a=e.ui[t].prototype;for(s in n)a.plugins[s]=a.plugins[s]||[],a.plugins[s].push([i,n[s]])},call:function(e,t,i){var n,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(n=0;s.length>n;n++)e.options[s[n][0]]&&s[n][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return t[n]>0?!0:(t[n]=1,s=t[n]>0,t[n]=0,s)}})})(jQuery);(function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(o){}n(e)},t.widget=function(i,s,n){var o,a,r,h,l={},c=i.split(".")[0];i=i.split(".")[1],o=c+"-"+i,n||(n=s,s=t.Widget),t.expr[":"][o.toLowerCase()]=function(e){return!!t.data(e,o)},t[c]=t[c]||{},a=t[c][i],r=t[c][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new r(t,i)},t.extend(r,a,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),h=new s,h.options=t.widget.extend({},h.options),t.each(n,function(i,n){return t.isFunction(n)?(l[i]=function(){var t=function(){return s.prototype[i].apply(this,arguments)},e=function(t){return s.prototype[i].apply(this,t)};return function(){var i,s=this._super,o=this._superApply;return this._super=t,this._superApply=e,i=n.apply(this,arguments),this._super=s,this._superApply=o,i}}(),e):(l[i]=n,e)}),r.prototype=t.widget.extend(h,{widgetEventPrefix:a?h.widgetEventPrefix||i:i},l,{constructor:r,namespace:c,widgetName:i,widgetFullName:o}),a?(t.each(a._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,r,i._proto)}),delete a._childConstructors):s._childConstructors.push(r),t.widget.bridge(i,r)},t.widget.extend=function(i){for(var n,o,a=s.call(arguments,1),r=0,h=a.length;h>r;r++)for(n in a[r])o=a[r][n],a[r].hasOwnProperty(n)&&o!==e&&(i[n]=t.isPlainObject(o)?t.isPlainObject(i[n])?t.widget.extend({},i[n],o):t.widget.extend({},o):o);return i},t.widget.bridge=function(i,n){var o=n.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,h=s.call(arguments,1),l=this;return a=!r&&h.length?t.widget.extend.apply(null,[a].concat(h)):a,r?this.each(function(){var s,n=t.data(this,o);return n?t.isFunction(n[a])&&"_"!==a.charAt(0)?(s=n[a].apply(n,h),s!==n&&s!==e?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):e):t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new n(a,this))}),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,s){var n,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},n=i.split("."),i=n.shift(),n.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;n.length-1>a;a++)o[n[a]]=o[n[a]]||{},o=o[n[a]];if(i=n.pop(),1===arguments.length)return o[i]===e?null:o[i];o[i]=s}else{if(1===arguments.length)return this.options[i]===e?null:this.options[i];r[i]=s}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var o,a=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=o=t(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,o=this.widget()),t.each(n,function(n,r){function h(){return i||a.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof r?a[r]:r).apply(a,arguments):e}"string"!=typeof r&&(h.guid=r.guid=r.guid||h.guid||t.guid++);var l=n.match(/^(\w+)\s*(.*)$/),c=l[1]+a.eventNamespace,u=l[2];u?o.delegate(u,c,h):s.bind(c,h)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}})})(jQuery);(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var a,o=Math.max,r=Math.abs,l=Math.round,h=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(a!==e)return a;var i,s,n=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return t("body").append(n),i=o.offsetWidth,n.css("overflow","scroll"),s=o.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),a=i-s},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,a="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:a?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var a,p,g,m,v,_,b=t(e.of),y=t.position.getWithinInfo(e.within),k=t.position.getScrollInfo(y),w=(e.collision||"flip").split(" "),D={};return _=n(b),b[0].preventDefault&&(e.at="left top"),p=_.width,g=_.height,m=_.offset,v=t.extend({},m),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=h.test(s[0])?s.concat(["center"]):c.test(s[0])?["center"].concat(s):["center","center"]),s[0]=h.test(s[0])?s[0]:"center",s[1]=c.test(s[1])?s[1]:"center",t=u.exec(s[0]),i=u.exec(s[1]),D[this]=[t?t[0]:0,i?i[0]:0],e[this]=[d.exec(s[0])[0],d.exec(s[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===e.at[0]?v.left+=p:"center"===e.at[0]&&(v.left+=p/2),"bottom"===e.at[1]?v.top+=g:"center"===e.at[1]&&(v.top+=g/2),a=i(D.at,p,g),v.left+=a[0],v.top+=a[1],this.each(function(){var n,h,c=t(this),u=c.outerWidth(),d=c.outerHeight(),f=s(this,"marginLeft"),_=s(this,"marginTop"),x=u+f+s(this,"marginRight")+k.width,C=d+_+s(this,"marginBottom")+k.height,M=t.extend({},v),T=i(D.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?M.left-=u:"center"===e.my[0]&&(M.left-=u/2),"bottom"===e.my[1]?M.top-=d:"center"===e.my[1]&&(M.top-=d/2),M.left+=T[0],M.top+=T[1],t.support.offsetFractions||(M.left=l(M.left),M.top=l(M.top)),n={marginLeft:f,marginTop:_},t.each(["left","top"],function(i,s){t.ui.position[w[i]]&&t.ui.position[w[i]][s](M,{targetWidth:p,targetHeight:g,elemWidth:u,elemHeight:d,collisionPosition:n,collisionWidth:x,collisionHeight:C,offset:[a[0]+T[0],a[1]+T[1]],my:e.my,at:e.at,within:y,elem:c})}),e.using&&(h=function(t){var i=m.left-M.left,s=i+p-u,n=m.top-M.top,a=n+g-d,l={target:{element:b,left:m.left,top:m.top,width:p,height:g},element:{element:c,left:M.left,top:M.top,width:u,height:d},horizontal:0>s?"left":i>0?"right":"center",vertical:0>a?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(l.horizontal="center"),d>g&&g>r(n+a)&&(l.vertical="middle"),l.important=o(r(i),r(s))>o(r(n),r(a))?"horizontal":"vertical",e.using.call(this,t,l)}),c.offset(t.extend(M,{using:h}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,l=n-r,h=r+e.collisionWidth-a-n;e.collisionWidth>a?l>0&&0>=h?(i=t.left+l+e.collisionWidth-a-n,t.left+=l-i):t.left=h>0&&0>=l?n:l>h?n+a-e.collisionWidth:n:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,l=n-r,h=r+e.collisionHeight-a-n;e.collisionHeight>a?l>0&&0>=h?(i=t.top+l+e.collisionHeight-a-n,t.top+=l-i):t.top=h>0&&0>=l?n:l>h?n+a-e.collisionHeight:n:l>0?t.top+=l:h>0?t.top-=h:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,o=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-o-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-o-a,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-l,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,o=n.height,l=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-o-l,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-o-a,t.top+p+f+g>c&&(0>s||r(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-l,t.top+p+f+g>u&&(i>0||u>r(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in s)e.style[a]=s[a];e.appendChild(r),i=o||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()})(jQuery);(function(e){e.widget("ui.autocomplete",{version:"1.10.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,undefined;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:case a.NUMPAD_ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),undefined;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),undefined):(this._searchTimeout(e),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(e),this._change(e),undefined)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),undefined;var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",t,{item:s})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):undefined},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").append(e("<a>").text(i.label)).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this._value(this.term),this.menu.blur(),undefined):(this.menu[e](t),undefined):(this.search(null,t),undefined)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.text(t))}})})(jQuery);(function(t){t.widget("ui.menu",{version:"1.10.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&t(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,l=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:l=!1,n=this.previousFilter||"",a=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(e.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}l&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})})(jQuery);
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
index cff6b1d..cc19601
@@ -4,5 +4,15 @@
 {% include '_menu.twig' %}
 {% endblock %}
 {% block content %}
-{% for tag in tags %}<a href="./?view=tag&amp;id={{ tag.id }}">{{ tag.value }}</a> {% if token != '' %}<a href="?feed&amp;type=tag&amp;user_id={{ user_id }}&amp;tag_id={{ tag.id }}&amp;token={{ token }}" target="_blank"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/rss.png" /></a>{% endif %} {% endfor %}
+  <div class="two-column">
+    {% for tag in tags %}
+      <a href="./?view=tag&amp;id={{ tag.id }}">{{ tag.value }}</a>  ({{ tag.entriescount }}) {% if token != '' %}<a href="?feed&amp;type=tag&amp;user_id={{ user_id }}&amp;tag_id={{ tag.id }}&amp;token={{ token }}" target="_blank"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/rss.png" /></a>{% endif %}
+      <br>
+
+      {% if loop.index  == '%d'|format(loop.length/2 + 0.5)  %}
+        </div><div class="two-column">
+      {% endif %}
+
+    {% endfor %}
+  </div>
 {% endblock %}
\ No newline at end of file