Skip to content

Instantly share code, notes, and snippets.

@rsanchez
Created September 6, 2011 18:46
Show Gist options
  • Save rsanchez/1198583 to your computer and use it in GitHub Desktop.
Save rsanchez/1198583 to your computer and use it in GitHub Desktop.
cp_js_end referer
<?php
class My_ext {
/* blah blah blah */
public function cp_js_end()
{
//be courteous to other users of this hook
$str = $this->EE->extensions->last_call;
$this->EE->load->helper('array');
//we need to look at the referring page, this script is loaded in it's own request
parse_str(parse_url(@$_SERVER['HTTP_REFERER'], PHP_URL_QUERY), $get);
$controller = element('C', $get);
$method = element('M', $get);
if ($controller === 'content_publish' && $method === 'entry_form')
{
//bingo! we're on the publish page
$str .= '
$(document).ready(function(){
//EMBIGGEN MY TITLE!
$("input[name=title]").css("font-size", "80px");
});
';
}
return $str;
}
}
@alexmglover
Copy link

Beautiful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment