$but = $(this);\r
\r
if ($but.is('.add')) {\r
- $new = $("<div style=\"display: none\">" +\r
- "<input type=\"text\" name=\"" + $but.attr('name') + "\" value=\"\" />" +\r
+ $new = $("<div style=\"display: none;\">" +\r
+ "<input style=\"width: 600px;\" type=\"text\" name=\"" + $but.attr('name') + "\" value=\"\" />" +\r
"<button class=\"string_list_widget_button\">-</button>" +\r
"</div>");\r
\r
\r
return false;\r
})\r
+\r
+ $('.fieldtool').each(function() {\r
+ var $link = $(this);\r
+ var $input = $link.parent().parent().find('input, textarea');\r
+ var name = $input.attr('name')\r
+\r
+ if ($link.is('.context')) {\r
+ $link.click(function() {\r
+ var $contextbox = $('<input type="text" value="' + name + '" />');\r
+ $link.replaceWith($contextbox);\r
+ });\r
+ } else if ($link.is('.default')) {\r
+ if ($input.length == 1 && ($input.is('[type=text]') || $input.is('textarea'))) {\r
+ $link.click(function() {\r
+ $.post(name + '/', function(data) {\r
+ $input.val(data);\r
+ });\r
+ });\r
+ } else {\r
+ $link.attr('href', name + '/');\r
+ }\r
+ }\r
+ });\r
});
\ No newline at end of file