قم بتضمين هذه الشيفرة في ملف config.php أو في ترويسة صفحة HTML ونحو ذلك:
كود HTML:
<!-- =================[ HTMLArea 3.0 بداية المحرر ]================= -->
<script type="text/javascript">
_editor_url = "editor/";
_editor_lang = "ar";
</script>
<script type="text/javascript" language="JavaScript" src="editor/htmlarea.js"></script>
<script type="text/javascript" defer="1">
//HTMLArea.replaceAll();
</script>
<script type="text/javascript" language="JavaScript">
HTMLArea.loadPlugin("ContextMenu");
HTMLArea.loadPlugin("TableOperations");
function initDocument()
{
var editor = new HTMLArea("editor");
editor.registerPlugin(ContextMenu);
editor.registerPlugin(TableOperations);
editor.generate();
// إنشاء كائن إعدادات لتجاوز الإعدادات الافتراضية
var config = new HTMLArea.Config();
// جعل المحرر اتجاهه من اليمين إلى اليسار افتراضا
config.pageStyle = 'p { direction: rtl; } ' + 'div { direction: rtl; } ' + 'font { direction: rtl; } ' + 'table, tr, td { direction: rtl; } ' ;
}
</script>
<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about customizing the editor. It's the easiest way! :) -->
<!-- =================[ HTMLArea 3.0 نهاية المحرر ]================= -->
الآن يمكنك استدعاء المحرر من ملف آخر هكذا:
كود HTML:
<textarea id="editor" name="text" dir="ltr" rows="12" cols="71"
style="height: 300px; width: 100%;">
</textarea>
- بيت القصيد يكمن في إضافتك id="editor" إلى وسم <textarea> المطلوب تضمين المحرر فيه كما في شيفرة HTML السابقة.