Author: sevein
Date: Tue Sep 13 12:35:43 2011
New Revision: 9703
Log:
Trillium, secondary search bar, js behavior
Modified:
trunk/plugins/qtTrilliumPlugin/css/less/_header.less
trunk/plugins/qtTrilliumPlugin/css/less/_misc.less
trunk/plugins/qtTrilliumPlugin/js/trillium.js
Modified: trunk/plugins/qtTrilliumPlugin/css/less/_header.less
==============================================================================
--- trunk/plugins/qtTrilliumPlugin/css/less/_header.less Tue Sep 13
12:21:31 2011 (r9702)
+++ trunk/plugins/qtTrilliumPlugin/css/less/_header.less Tue Sep 13
12:35:43 2011 (r9703)
@@ -28,7 +28,7 @@
border-bottom: 1px solid #666;
> div {
-
+
.clearfix();
#logo-and-name {
@@ -55,6 +55,7 @@
img {
+ margin-right: 12px;
height: 50px;
-webkit-transition: -webkit-transform 0.5s;
-moz-transition: -moz-transform 0.5s;
Modified: trunk/plugins/qtTrilliumPlugin/css/less/_misc.less
==============================================================================
--- trunk/plugins/qtTrilliumPlugin/css/less/_misc.less Tue Sep 13 12:21:31
2011 (r9702)
+++ trunk/plugins/qtTrilliumPlugin/css/less/_misc.less Tue Sep 13 12:35:43
2011 (r9703)
@@ -776,3 +776,94 @@
}
}
+
+/*
+ * Search bar
+ */
+
+#content {
+
+ .search {
+
+ border: 1px solid #ddd;
+ .border-radius(4px);
+ background-color: whiteSmoke;
+ margin-top: @baseline;
+ padding-top: @baseline;
+ padding-left: @baseline;
+
+ input[name="query"],
+ input[name="subquery"] {
+
+ background-color: #fff;
+ #font > .sans-serif(normal, 14px, 1);
+ width: 480px;
+ padding: 6px 9px;
+ color: @gray;
+ border: 1px solid @grayLight;
+ .border-radius(4px);
+ @shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0px rgba(255,255,255,.25);
+ .box-shadow(@shadow);
+ .transition(none);
+
+ display: block;
+ float: left;
+
+ &:-moz-placeholder {
+
+ color: @grayLighter;
+
+ }
+
+ &::-webkit-input-placeholder {
+
+ color: @grayLighter;
+
+ }
+
+
+ &:hover {
+
+ background-color: #f0f0f0;
+
+ }
+
+ &:focus,
+ &.focused {
+
+ outline: none;
+ background-color: #f0f0f0;
+ color: @grayDark;
+
+ }
+
+ }
+
+ input[type=submit] {
+
+ margin: 0 0 0 10px;
+ padding: 0 20px;
+ border: 1px solid #444;
+ #gradient > .horizontal(#333, #444);
+ background-image: url(../../../sfCaribouPlugin/images/search.png);
+ background-repeat: no-repeat;
+ background-position: 50% 50%;
+ .border-radius(4px);
+ font-size: 0px;
+ height: 30px;
+ width: 26px;
+
+ &:hover {
+
+ #gradient > .horizontal(darken(#4d90fe, 5%), darken(#4787ed, 5%));
+ background-image: url(../../../sfCaribouPlugin/images/search.png);
+ background-repeat: no-repeat;
+ background-position: 50% 50%;
+
+ }
+
+ }
+
+ }
+
+}
Modified: trunk/plugins/qtTrilliumPlugin/js/trillium.js
==============================================================================
--- trunk/plugins/qtTrilliumPlugin/js/trillium.js Tue Sep 13 12:21:31
2011 (r9702)
+++ trunk/plugins/qtTrilliumPlugin/js/trillium.js Tue Sep 13 12:35:43
2011 (r9703)
@@ -35,28 +35,38 @@
.prependTo('.messages');
// Search box behavior
- var searchText = $('#header .search h2').text();
- var $searchInput = $('#header .search input[name=query]');
- if (!$searchInput
- .focus(function()
- {
- if($(this).val() == searchText)
+ $('.search').each(function()
+ {
+ var $sender = $(this);
+ var $input = $sender.find('input[name=query],
input[name=subquery]');
+
+ var text = $sender.find('h2, h3').text();
+ if (!text)
+ {
+ text = $sender.find(':submit').val();
+ }
+
+ if (!$input
+ .focus(function()
{
- $(this).attr("value", "");
- }
- })
- .blur(function()
- {
- if (!$(this).val())
+ if($(this).val() == text)
+ {
+ $(this).attr("value", "");
+ }
+ })
+ .blur(function()
{
- $(this).val(searchText);
- }
- })
- .val())
- {
- $searchInput.val(searchText);
- }
+ if (!$(this).val())
+ {
+ $(this).val(text);
+ }
+ })
+ .val())
+ {
+ $input.val(text);
+ }
+ });
- });
+ });
})(jQuery);
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/qubit-commits?hl=en.