Commit e4cc8f0c38f29c00ba431b1ab1a6aaef6867f352
1 parent
5163b8e6
Use the requireJS* and requireCSS* API to add JS and CSS.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4304 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
3 changed files
with
26 additions
and
28 deletions
templates/ktcore/manage_help_item.smarty
| 1 | -<script language="javascript" type="text/javascript" src="{$config->get("KnowledgeTree/rootUrl")}/thirdpartyjs/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> | |
| 2 | -<script language="javascript" type="text/javascript"> | |
| 1 | +{$context->oPage->requireJSResource("thirdpartyjs/tinymce/jscripts/tiny_mce/tiny_mce.js")} | |
| 2 | +{capture assign=sJS} | |
| 3 | 3 | {literal} |
| 4 | 4 | tinyMCE.init({ |
| 5 | 5 | mode : "textareas", |
| 6 | 6 | theme : "simple", |
| 7 | 7 | }); |
| 8 | 8 | {/literal} |
| 9 | -</script> | |
| 9 | +{/capture} | |
| 10 | +{$context->oPage->requireJSStandalone($sJS)} | |
| 10 | 11 | |
| 11 | 12 | <form method="POST" action="{$smarty.server.PHP_SELF}"> |
| 12 | 13 | <input type="hidden" name="id" value="{$help->iId}"> | ... | ... |
templates/ktcore/metadata/conditional/editcomplex.smarty
| 1 | +{capture assign=sCSS} | |
| 1 | 2 | {literal} |
| 2 | -<style type="text/css"> | |
| 3 | 3 | /* inactivity */ |
| 4 | 4 | .active .inactivity_message { display: none; } |
| 5 | 5 | |
| ... | ... | @@ -16,24 +16,24 @@ |
| 16 | 16 | { display: none; } |
| 17 | 17 | |
| 18 | 18 | .helpText { color: #666; } |
| 19 | - | |
| 20 | -</style> | |
| 19 | +{/literal} | |
| 20 | +{/capture} | |
| 21 | +{$context->oPage->requireCSSStandalone($sCSS)} | |
| 21 | 22 | |
| 22 | 23 | <!-- include the mochikit js --> |
| 23 | -<script language="javascript" src="/thirdpartyjs/MochiKit/Base.js"> </script> | |
| 24 | -<script language="javascript" src="/thirdpartyjs/MochiKit/Iter.js"> </script> | |
| 25 | -<script language="javascript" src="/thirdpartyjs/MochiKit/DateTime.js"> </script> | |
| 26 | -<script language="javascript" src="/thirdpartyjs/MochiKit/Async.js"> </script> | |
| 27 | -<script language="javascript" src="/thirdpartyjs/MochiKit/DOM.js"> </script> | |
| 24 | +{$context->oPage->requireJSResource("thirdpartyjs/MochiKit/Base.js")} | |
| 25 | +{$context->oPage->requireJSResource("thirdpartyjs/MochiKit/Iter.js")} | |
| 26 | +{$context->oPage->requireJSResource("thirdpartyjs/MochiKit/DateTime.js")} | |
| 27 | +{$context->oPage->requireJSResource("thirdpartyjs/MochiKit/Async.js")} | |
| 28 | +{$context->oPage->requireJSResource("thirdpartyjs/MochiKit/DOM.js")} | |
| 28 | 29 | |
| 29 | -<script language="javascript" src="/presentation/lookAndFeel/knowledgeTree/js/taillog.js"> </script> | |
| 30 | -<script language="javascript" src="/presentation/lookAndFeel/knowledgeTree/js/conditional_complex_edit.js"> </script> | |
| 30 | +{$context->oPage->requireJSResource("presentation/lookAndFeel/knowledgeTree/js/taillog.js")} | |
| 31 | +{$context->oPage->requireJSResource("presentation/lookAndFeel/knowledgeTree/js/conditional_complex_edit.js")} | |
| 31 | 32 | |
| 32 | -<script language="javascript"> | |
| 33 | +{capture assign=sJS} | |
| 33 | 34 | addLoadEvent(updateActiveFields); |
| 34 | -</script> | |
| 35 | - | |
| 36 | -{/literal} | |
| 35 | +{/capture} | |
| 36 | +{$context->oPage->requireJSStandalone($sJS)} | |
| 37 | 37 | |
| 38 | 38 | <h2>Edit Complex Conditional Metadata</h2> |
| 39 | 39 | <form> | ... | ... |
templates/ktcore/widget_fieldset_conditional.smarty
| 1 | -<!-- we REALLY NEED that new ui component. --> | |
| 1 | +{$context->oPage->requireJSResource("thirdpartyjs/MochiKit/Base.js")} | |
| 2 | +{$context->oPage->requireJSResource("thirdpartyjs/MochiKit/Iter.js")} | |
| 3 | +{$context->oPage->requireJSResource("thirdpartyjs/MochiKit/DOM.js")} | |
| 4 | +{$context->oPage->requireJSResource("thirdpartyjs/MochiKit/Async.js")} | |
| 2 | 5 | |
| 3 | -<script language="javascript" src="/thirdpartyjs/MochiKit/Base.js"> </script> | |
| 4 | -<script language="javascript" src="/thirdpartyjs/MochiKit/Iter.js"> </script> | |
| 5 | -<script language="javascript" src="/thirdpartyjs/MochiKit/DOM.js"> </script> | |
| 6 | -<script language="javascript" src="/thirdpartyjs/MochiKit/Async.js"> </script> | |
| 6 | +{capture assign=sJS} | |
| 7 | 7 | {literal} |
| 8 | -<script language="javascript"> | |
| 9 | - | |
| 10 | 8 | var baseUrl = "/presentation/lookAndFeel/knowledgeTree/ajaxConditional.php"; |
| 11 | 9 | var undoStack = Array(); |
| 12 | 10 | |
| ... | ... | @@ -116,11 +114,10 @@ function triggerUpdate(formname) { |
| 116 | 114 | req.addCallback(formHandler); |
| 117 | 115 | req.addErrback(errorForm); |
| 118 | 116 | } |
| 119 | - | |
| 120 | - | |
| 121 | - | |
| 122 | -</script> | |
| 123 | 117 | {/literal} |
| 118 | +{/capture} | |
| 119 | +{$context->oPage->requireJSStandalone($sJS)} | |
| 120 | + | |
| 124 | 121 | <!-- do we need to have more than one set of these on a page? --> |
| 125 | 122 | <form > |
| 126 | 123 | <input type="hidden" name="action" value="submitConditionalSet" /> | ... | ... |