aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/views/comment/_single_comment.rhtml2
-rw-r--r--app/views/layouts/default.rhtml5
-rw-r--r--app/views/request/_correspondence.rhtml4
-rw-r--r--public/images/link-icon.pngbin0 -> 304 bytes
-rw-r--r--public/javascripts/general.js19
-rw-r--r--public/javascripts/jquery-ui.min.js16
-rw-r--r--public/stylesheets/theme.css57
7 files changed, 88 insertions, 15 deletions
diff --git a/app/views/comment/_single_comment.rhtml b/app/views/comment/_single_comment.rhtml
index e6a1728a8..013e5e107 100644
--- a/app/views/comment/_single_comment.rhtml
+++ b/app/views/comment/_single_comment.rhtml
@@ -17,7 +17,7 @@
</div>
<p class="event_actions">
<% if !comment.id.nil? %>
- <%= link_to "Link to this", comment_url(comment) %>
+ <%= link_to "Link to this", comment_url(comment), :class => "link_to_this" %>
<% if !@user.nil? && @user.admin_page_links? %>
| <%= link_to "Admin", admin_url("request/edit_comment/" + comment.id.to_s) %>
<% end %>
diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml
index bd96f1528..3e96a8b6e 100644
--- a/app/views/layouts/default.rhtml
+++ b/app/views/layouts/default.rhtml
@@ -157,6 +157,11 @@
<%= render :partial => 'general/before_body_end' %>
</div>
<div id="other-country-notice"></div>
+<div id="link_box"><span class="close-button">X</span>
+<%= _("Paste this link into emails, tweets, and anywhere else:") %>
+<br />
+<input type="text">
+</div>
</body>
</html>
diff --git a/app/views/request/_correspondence.rhtml b/app/views/request/_correspondence.rhtml
index 9500591ea..f1e77de8a 100644
--- a/app/views/request/_correspondence.rhtml
+++ b/app/views/request/_correspondence.rhtml
@@ -24,7 +24,7 @@ if not incoming_message.nil?
<% if !@user.nil? && @user.admin_page_links? %>
<%= link_to "Admin", admin_url("request/show_raw_email/" + incoming_message.raw_email_id.to_s) %> |
<% end %>
- <%= link_to _("Link to this"), incoming_message_url(incoming_message) %> |
+ <%= link_to _("Link to this"), incoming_message_url(incoming_message), :class => "link_to_this" %> |
<% if incoming_message.valid_to_reply_to? %>
<%= link_to _("Reply to this message"), show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id) + "#followup" %>
<% else %>
@@ -57,7 +57,7 @@ elsif [ 'sent', 'followup_sent' ].include?(info_request_event.event_type)
<% end %>
-->
- <%= link_to _("Link to this"), outgoing_message_url(outgoing_message) %> |
+ <%= link_to _("Link to this"), outgoing_message_url(outgoing_message), :class => "link_to_this" %> |
<%= link_to _("Send follow up to the main FOI contact"), show_response_no_followup_url(:id => outgoing_message.info_request.id, :incoming_message_id => nil) + "#followup" %>
</p>
</div>
diff --git a/public/images/link-icon.png b/public/images/link-icon.png
new file mode 100644
index 000000000..7d9237fcd
--- /dev/null
+++ b/public/images/link-icon.png
Binary files differ
diff --git a/public/javascripts/general.js b/public/javascripts/general.js
index ed5095f82..3d6aae0d8 100644
--- a/public/javascripts/general.js
+++ b/public/javascripts/general.js
@@ -1,4 +1,5 @@
$(document).ready(function() {
+ // flash message for people coming from other countries
if(window.location.search.substring(1).search("country_name") == -1) {
if (!$.cookie('has_seen_country_message')) {
$.ajax({
@@ -18,5 +19,21 @@ $(document).ready(function() {
$('#other-country-notice').click(function() {
$('#other-country-notice').hide();
$.cookie('has_seen_country_message', 1, {expires: 365, path: '/'});
- })
+ });
+ // "link to this" widget
+ $('a.link_to_this').click(function() {
+ var box = $('div#link_box');
+ var location = window.location.protocol + "//" + window.location.hostname + $(this).attr('href');
+ box.width(location.length + " em");
+ box.find('input').val(location).attr('size', location.length + " em");
+ box.show();
+ box.find('input').select();
+ box.position({
+ my: "left top",
+ at: "left bottom",
+ of: this,
+ collision: "fit" });
+
+ });
+ $('.close-button').click(function() { $(this).parent().hide() });
}) \ No newline at end of file
diff --git a/public/javascripts/jquery-ui.min.js b/public/javascripts/jquery-ui.min.js
index 35d983f43..fb641f675 100644
--- a/public/javascripts/jquery-ui.min.js
+++ b/public/javascripts/jquery-ui.min.js
@@ -32,6 +32,22 @@ b.extend(true,{},this.options,this._getCreateOptions(),a);var d=this;this.elemen
"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",
c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
;/*
+ * jQuery UI Position 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Position
+ */
+(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY,
+left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+=
+k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-=
+m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left=
+d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+=
+a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b),
+g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery);
+;/*
* jQuery UI Tabs 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
diff --git a/public/stylesheets/theme.css b/public/stylesheets/theme.css
index 21708d77c..ad1f7dfe6 100644
--- a/public/stylesheets/theme.css
+++ b/public/stylesheets/theme.css
@@ -1,3 +1,4 @@
+
h1 {
color: #93278F;
font-size: 42px;
@@ -377,6 +378,7 @@ p.subtitle {
#search_form input[type=submit] {
border-radius: 0px 2px 2px 0px;
+ -moz-border-radius: 0px 2px 2px 0px;
}
#header_left {
@@ -609,13 +611,13 @@ form input.use-datepicker[type=text] {
background: url(/images/calendar.png) no-repeat 115px 3px;
margin: 0px !important;
border-radius:3px !important;
+ -moz-border-radius:3px !important;
font-size: 14px !important;
}
form input[type=submit],
a.link_button_green,
-a.link_button_green_large,
-span.close-button {
+a.link_button_green_large {
background: url(/images/button-gradient.png);
color: white;
text-decoration: none;
@@ -624,6 +626,7 @@ span.close-button {
line-height: 18px;
border: solid 1px #69952F;
border-radius: 2px;
+ -moz-border-radius: 2px;
text-shadow: 1px 1px 0px #5B841D;
font-family: 'DeliciousRoman', Arial, sans-serif;
font-size: 18px;
@@ -763,6 +766,7 @@ div.correspondence {
border-width: 0px;
font-size: 13px;
border-radius: 6px;
+ -moz-border-radius: 6px;
padding: 4px 20px 0px 9px;
}
@@ -869,6 +873,7 @@ body.front h3 {
background: #F2F2F2;
border: solid 0px #FFF;
border-radius: 2px;
+ -moz-border-radius: 2px;
}
#ui-datepicker-div .ui-state-default:hover {
@@ -918,13 +923,6 @@ body.front h3 {
position: absolute;
}
-span.close-button {
- cursor: pointer;
- font-size: 1em;
- padding: 0 1px 0 1px;
- line-height: 1.1em;
- font-family: Arial;
-}
body.front #other-country-notice,
#other-country-notice {
display: none;
@@ -966,15 +964,50 @@ p.subtitle {
color: #FFF;
}
-#other-country-notice .close-button {
+.close-button {
+ color: white;
+ text-decoration: none;
+ display: inline-block;
+ border-radius: 2px;
+ -moz-border-radius: 2px;
+ cursor: pointer;
+ cursor: hand;
background: url(/images/small-white-cross.png) no-repeat;
- padding: 10px 0px;
+ padding: 10px 0;
width: 15px;
height: 15px;
border: solid 0px #FFF;
text-indent: -999px;
overflow:hidden;
float:right;
+
+}
+/*------------- Link box ---------------*/
+#link_box {
+ position: absolute;
+ padding: 5px;
+ text-align: left;
+ background-color: white;
+ z-index: 999;
+ opacity: 0.9;
+ border-radius: 6px;
+ -moz-border-radius: 6px;
+ border: 1px solid #93278F;
+ display: none;
+}
+
+#link_box .close-button {
+ background-color: #93278F;
+ padding: 0;
+ margin-left: 15px;
+}
+
+a.link_to_this {
+ display: inline-block;
+ width: 20px;
+ letter-spacing: -1000em;
+ overflow: hidden;
+ background: url(/images/link-icon.png) no-repeat;
}
/*---------- From tweaks ----------*/
@@ -995,6 +1028,7 @@ p.subtitle {
.errorExplanation {
border-radius: 6px;
+ -moz-border-radius: 6px;
font-size: 12px;
font-weight: normal;
width: 554px;
@@ -1009,6 +1043,7 @@ p.subtitle {
color: #5B7705;
border-color: #B6CB86;
border-radius: 6px;
+ -moz-border-radius: 6px;
margin: 15px 0px;
}