Skip to content

Instantly share code, notes, and snippets.

@baldwindavid
Forked from davidray/gist:113291
Created May 18, 2009 03:03
Show Gist options
  • Save baldwindavid/113293 to your computer and use it in GitHub Desktop.
Save baldwindavid/113293 to your computer and use it in GitHub Desktop.
var $j = jQuery.noConflict();
jQuery(document).ready(function($){
$("#id_of_my_textarea").markItUp(nameOfSettings);
});
jQuery.ajaxSetup({
'beforeSend': function(xhr) {xhr.setRequestHeader("Accept",
"text/javascript")}
});
jQuery(document).ajaxSend(function(event, request, settings) {
if (typeof(AUTH_TOKEN) == "undefined") return;
// settings.data is a serialized string like "foo=bar&baz=boink" (or null)
settings.data = settings.data || "";
settings.data += (settings.data ? "&" : "") + "authenticity_token=" + encodeURIComponent(AUTH_TOKEN);
});
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html class="noscript" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<%= Comatose.config.content_type %>"/>
<title>Comatose Admin</title>
<%= stylesheet_link_tag 'comatose_admin' %>
<%= javascript_include_tag :defaults %>
<%= javascript_include_tag 'comatose_admin' %>
<%= javascript_include_tag "jquery", :cache => false %>
<%= javascript_include_tag "/markitup/jquery.markitup.js", :cache => false %>
<!-- public/javascripts/application.js -->
<%= javascript_include_tag "application", :cache => false %>
<%= javascript_include_tag "/markitup/sets/default/set.js", :cache => false %>
<%= stylesheet_link_tag "/markitup/skins/markitup/style.css" %>
<%= stylesheet_link_tag "/markitup/sets/default/style.css" %>
</head>
<body>
<div id="page-container">
<div id="header">
<h1><%= link_to Comatose.config.admin_title, :controller=>controller.controller_name, :action=>'index' %></h1>
<div id="flash">
<span id="flash-content"><%= flash[:notice] %></span>
</div>
<h5><%= Comatose.config.admin_sub_title %></h5>
</div>
<div id="content">
<%= yield %>
</div>
<div id="footer">
Powered by <a href="http://comatose.rubyforge.org" target="_new_window">Comatose <%= Comatose::VERSION_STRING %></a>, created by <a href="http://www.mattmccray.com" target="_new_window">M@ McCray</a>.
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment