Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove deprecation warnings from Rails 3 for javascript_include

  • Loading branch information...
commit 826a6351819ffa83e678c8aa6f1f475f0f439c3c 1 parent 0f177e5
@nesquena nesquena authored
View
267 lib/query_reviewer/views/_box_includes.html.erb
@@ -3,7 +3,7 @@ div#query_review_parent {
position: absolute;
top: 1px;
left: 1px;
- z-index: 100000;
+ z-index: 100000;
}
div.query_review_container {
@@ -11,69 +11,69 @@ div.query_review_container {
}
div.query_review {
- height: 18px;
- margin: 1px;
- opacity: 0.75;
- padding-left: 3px;
- padding-right: 3px;
- border: 1px solid black;
- font-size: 12px;
- font-weight: bold;
+ height: 18px;
+ margin: 1px;
+ opacity: 0.75;
+ padding-left: 3px;
+ padding-right: 3px;
+ border: 1px solid black;
+ font-size: 12px;
+ font-weight: bold;
text-align: left;
}
div.query_review.sql_ok {
- background-color: #090;
- color: #020;
+ background-color: #090;
+ color: #020;
}
div.query_review.sql_warning {
- background-color: #FAE100;
- color: #F05000;
+ background-color: #FAE100;
+ color: #F05000;
}
div.query_review.sql_critical {
- background-color: #F99;
- color: #A00;
+ background-color: #F99;
+ color: #A00;
}
div.query_review.sql_disabled {
- background-color: #BBB;
- color: #555;
+ background-color: #BBB;
+ color: #555;
}
div.query_review a {
- color: inherit;
- text-decoration: none;
+ color: inherit;
+ text-decoration: none;
}
div.query_review_details {
- width: 900px;
- height: 600px;
- opacity: 0.9;
- margin: 1px;
- padding: 2px;
- border: 1px solid black;
- font-size: 12px;
- overflow: auto;
- background-color: #DDD;
+ width: 900px;
+ height: 600px;
+ opacity: 0.9;
+ margin: 1px;
+ padding: 2px;
+ border: 1px solid black;
+ font-size: 12px;
+ overflow: auto;
+ background-color: #DDD;
text-align: left;
text-indent: 0px;
color: black;
}
div.query_review_details p {
- margin: 2px 0 2px 0;
- padding: 0px;
+ margin: 2px 0 2px 0;
+ padding: 0px;
}
div.query_review_details a {
- color: #29ABE2;
+ color: #29ABE2;
}
div.query_review_details ul {
- list-style-type: circle;
- padding-left: 15px;
+ list-style-type: circle;
+ padding-left: 15px;
}
div.query_review_details li {
@@ -81,145 +81,145 @@ div.query_review_details li {
}
div.query_review_details code {
- white-space: normal;
- line-height: 120%;
+ white-space: normal;
+ line-height: 120%;
}
div.query_review_details table.explain th {
- cell-padding: 5px;
+ cell-padding: 5px;
}
div.query_review_details .title {
- font-weight: bold;
+ font-weight: bold;
}
div.query_review_details .indent {
- padding-left: 10px;
+ padding-left: 10px;
}
div.query_review_details .number {
- font-weight: bold;
+ font-weight: bold;
}
div.query_review_details .bad {
- color: #900;
+ color: #900;
}
div.query_review_details .good {
- color: #090;
+ color: #090;
}
div.query_review_details div.divider {
- width: 504px;
- position: relative;
- left: -2px;
- height: 1px;
- border-top: 1px dashed black;
- margin: 2px 0 2px 0;
+ width: 504px;
+ position: relative;
+ left: -2px;
+ height: 1px;
+ border-top: 1px dashed black;
+ margin: 2px 0 2px 0;
}
div.query_review_details .small {
- font-size: 10px;
+ font-size: 10px;
}
div.query_review_details .tbpadded {
- padding-top: 3px;
- padding-bottom: 3px;
+ padding-top: 3px;
+ padding-bottom: 3px;
}
div.query_review_details .trace {
- background-color: #0C1021;
- color: #7F908A;
- padding: 5px;
- margin-right: 30px;
+ background-color: #0C1021;
+ color: #7F908A;
+ padding: 5px;
+ margin-right: 30px;
}
div.query_review_details .trace .bold {
- color: white;
+ color: white;
}
div.query_review_details div.spectrum_container {
- margin-top: 4px;
- width: 35px;
- display: block;
- float: left;
- position: relative;
- height: 14px;
- margin-right: 5px;
+ margin-top: 4px;
+ width: 35px;
+ display: block;
+ float: left;
+ position: relative;
+ height: 14px;
+ margin-right: 5px;
}
div.query_review_details div.spectrum_elem {
- width: 1px;
- display: block;
- float: left;
- height: 10px;
+ width: 1px;
+ display: block;
+ float: left;
+ height: 10px;
}
div.query_review_details div.spectrum_pointer {
- width: 2px;
- display: block;
- float: left;
- position: absolute;
- height: 14px;
- background-color: black;
- top: -2px;
+ width: 2px;
+ display: block;
+ float: left;
+ position: absolute;
+ height: 14px;
+ background-color: black;
+ top: -2px;
}
div.query_review_details table {
- background-color: white;
- border: 1px solid gray;
- padding: 0px;
- margin: 0px;
+ background-color: white;
+ border: 1px solid gray;
+ padding: 0px;
+ margin: 0px;
}
div.query_review_details tbody {
- border: 0px;
- padding: 0px;
- margin: 0px;
+ border: 0px;
+ padding: 0px;
+ margin: 0px;
}
div.query_review_details thead {
- border-bottom: 1px solid gray;
- padding: 0px;
- margin: 0px;
+ border-bottom: 1px solid gray;
+ padding: 0px;
+ margin: 0px;
}
div.query_review_details tr {
- border: 0px;
- padding: 0px;
- margin: 0px;
+ border: 0px;
+ padding: 0px;
+ margin: 0px;
}
div.query_review_details td {
- border: 1px solid gray;
- padding: 3px;
- margin: 0px;
+ border: 1px solid gray;
+ padding: 3px;
+ margin: 0px;
overflow: hidden;
}
div.query_review_details th {
- border: 1px solid gray;
- padding: 3px;
- margin: 0px;
+ border: 1px solid gray;
+ padding: 3px;
+ margin: 0px;
}
</style>
<style>
.sql {
- color: black;
+ color: black;
}
.sql .String {
- color: #009933;
+ color: #009933;
}
.sql .Keyword {
- color: #0000FF;
+ color: #0000FF;
}
.sql .Constant {
- color: #6782D3;
+ color: #6782D3;
}
.sql .Number {
- color: #0066FF;
+ color: #0066FF;
}
.sql .Comment {
color: #0066FF;
@@ -227,71 +227,8 @@ div.query_review_details th {
}
</style>
-<% javascript_tag do %>
-//Super lame show/hide functions so we don't need any 3rd party JS libs
-function query_review_show(id) {
- document.getElementById(id).style.display = "block";
-}
-
-function query_review_hide(id) {
- document.getElementById(id).style.display = "none";
-}
-function query_review_toggle(id) {
- if(document.getElementById(id).style.display == "none") {
- document.getElementById(id).style.display = "block";
- } else {
- document.getElementById(id).style.display = "none";
- }
-}
-function createCookie(name,value,days) {
- if (days) {
- var date = new Date();
- date.setTime(date.getTime()+(days*24*60*60*1000));
- var expires = "; expires="+date.toGMTString();
- }
- else var expires = "";
- document.cookie = name+"="+value+expires+"; path=/";
-}
-
-function readCookie(name) {
- var nameEQ = name + "=";
- var ca = document.cookie.split(';');
- for(var i=0;i < ca.length;i++) {
- var c = ca[i];
- while (c.charAt(0)==' ') c = c.substring(1,c.length);
- if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
- }
- return null;
-}
-
-function eraseCookie(name) {
- createCookie(name,"",-1);
-}
-
-function ignore_list() {
- var ignore_list = readCookie("query_review_ignore_list")
- if (!ignore_list)
- ignore_list = []
- else
- ignore_list = ignore_list.split(",")
- return ignore_list
-}
-
-function add_ignore_hash(h){
- var list = ignore_list();
- list[list.length] = h
- createCookie("query_review_ignore_list", list.join(","))
-}
-
-function remove_ignore_hash(h) {
- var list = ignore_list();
- var new_list = []
- for(var i=0; i<list.length; i++)
- {
- if(list[i].toString() != h.toString()) {
- new_list[new_list.length] = list[i]
- }
- }
- createCookie("query_review_ignore_list", new_list.join(","))
-}
-<% end %>
+<% if defined?(Rails::Railtie) %>
+ <%= render :partial => "/js_includes_new" %>
+<% else %>
+ <%= render :partial => "/js_includes" %>
+<% end %>
View
68 lib/query_reviewer/views/_js_includes.html.erb
@@ -0,0 +1,68 @@
+<% javascript_tag do %>
+//Super lame show/hide functions so we don't need any 3rd party JS libs
+function query_review_show(id) {
+ document.getElementById(id).style.display = "block";
+}
+
+function query_review_hide(id) {
+ document.getElementById(id).style.display = "none";
+}
+function query_review_toggle(id) {
+ if(document.getElementById(id).style.display == "none") {
+ document.getElementById(id).style.display = "block";
+ } else {
+ document.getElementById(id).style.display = "none";
+ }
+}
+function createCookie(name,value,days) {
+ if (days) {
+ var date = new Date();
+ date.setTime(date.getTime()+(days*24*60*60*1000));
+ var expires = "; expires="+date.toGMTString();
+ }
+ else var expires = "";
+ document.cookie = name+"="+value+expires+"; path=/";
+}
+
+function readCookie(name) {
+ var nameEQ = name + "=";
+ var ca = document.cookie.split(';');
+ for(var i=0;i < ca.length;i++) {
+ var c = ca[i];
+ while (c.charAt(0)==' ') c = c.substring(1,c.length);
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
+ }
+ return null;
+}
+
+function eraseCookie(name) {
+ createCookie(name,"",-1);
+}
+
+function ignore_list() {
+ var ignore_list = readCookie("query_review_ignore_list")
+ if (!ignore_list)
+ ignore_list = []
+ else
+ ignore_list = ignore_list.split(",")
+ return ignore_list
+}
+
+function add_ignore_hash(h){
+ var list = ignore_list();
+ list[list.length] = h
+ createCookie("query_review_ignore_list", list.join(","))
+}
+
+function remove_ignore_hash(h) {
+ var list = ignore_list();
+ var new_list = []
+ for(var i=0; i<list.length; i++)
+ {
+ if(list[i].toString() != h.toString()) {
+ new_list[new_list.length] = list[i]
+ }
+ }
+ createCookie("query_review_ignore_list", new_list.join(","))
+}
+<% end %>
View
68 lib/query_reviewer/views/_js_includes_new.html.erb
@@ -0,0 +1,68 @@
+<%= javascript_tag do %>
+//Super lame show/hide functions so we don't need any 3rd party JS libs
+function query_review_show(id) {
+ document.getElementById(id).style.display = "block";
+}
+
+function query_review_hide(id) {
+ document.getElementById(id).style.display = "none";
+}
+function query_review_toggle(id) {
+ if(document.getElementById(id).style.display == "none") {
+ document.getElementById(id).style.display = "block";
+ } else {
+ document.getElementById(id).style.display = "none";
+ }
+}
+function createCookie(name,value,days) {
+ if (days) {
+ var date = new Date();
+ date.setTime(date.getTime()+(days*24*60*60*1000));
+ var expires = "; expires="+date.toGMTString();
+ }
+ else var expires = "";
+ document.cookie = name+"="+value+expires+"; path=/";
+}
+
+function readCookie(name) {
+ var nameEQ = name + "=";
+ var ca = document.cookie.split(';');
+ for(var i=0;i < ca.length;i++) {
+ var c = ca[i];
+ while (c.charAt(0)==' ') c = c.substring(1,c.length);
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
+ }
+ return null;
+}
+
+function eraseCookie(name) {
+ createCookie(name,"",-1);
+}
+
+function ignore_list() {
+ var ignore_list = readCookie("query_review_ignore_list")
+ if (!ignore_list)
+ ignore_list = []
+ else
+ ignore_list = ignore_list.split(",")
+ return ignore_list
+}
+
+function add_ignore_hash(h){
+ var list = ignore_list();
+ list[list.length] = h
+ createCookie("query_review_ignore_list", list.join(","))
+}
+
+function remove_ignore_hash(h) {
+ var list = ignore_list();
+ var new_list = []
+ for(var i=0; i<list.length; i++)
+ {
+ if(list[i].toString() != h.toString()) {
+ new_list[new_list.length] = list[i]
+ }
+ }
+ createCookie("query_review_ignore_list", new_list.join(","))
+}
+<% end %>

0 comments on commit 826a635

Please sign in to comment.
Something went wrong with that request. Please try again.