Skip to content

Commit

Permalink
#88 loading client.js with require, automatically setting require.config
Browse files Browse the repository at this point in the history
  • Loading branch information
tracend committed Jun 26, 2013
1 parent 738d66e commit 9796ffd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions app/helpers/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ function createClient( $dom ){
}
// render the global client vars
$client .= 'Object.extend(KISSCMS, '. json_encode_escaped( $GLOBALS['client'] ) .');';
//$client .= 'var require = KISSCMS["require"];';
$client .= 'require.config( KISSCMS.require );';

$client = $this->trimWhitespace($client);
// #87 not caching client vars as a file
Expand All @@ -265,6 +265,7 @@ function createClient( $dom ){
self::setCache( $client_file , $client);
}
*/
/*
$client_file = "client";
$client_src= WEB_FOLDER. $client_file;
Expand All @@ -276,7 +277,7 @@ function createClient( $dom ){
//$script->setAttribute("defer", "defer");
// include the script
$dom = $this->updateDom($script, $dom);

*/
// set the client as a session var
$_SESSION["_client"] = $client;
}
Expand Down
6 changes: 3 additions & 3 deletions app/views/main/foot.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<script>window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})</script>
<![endif]-->

<script type="text/javascript" data-type="require">
Object.extend(KISSCMS, {"require":{"callback": function(){ init();} }});
<script type="text/javascript">
//Object.extend(KISSCMS, {"require":{"callback": function(){ init();} }});
</script>

<script id="require-main" type="text/javascript" data-main="<?=url("/assets/js/main.js")?>" src="<?=url("/js/libs/require.js")?>" defer="defer"></script>
<script id="require-main" type="text/javascript" data-main="<?=url("/client")?>" src="<?=url("/js/libs/require.js")?>" defer="defer"></script>

0 comments on commit 9796ffd

Please sign in to comment.