• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

xenForo Urdu Editor Integration

simunaqv

Well-known member
urdueditor_wysiwyg.webp
Hello,
Urdu editor is a JavaScript component that provides a phonetic Urdu key mapping for easily typing Urdu without the need of installing Urdu language support or Urdu keyboard on your computer. I am providing Urdu editor support both for the wysiwyg mode as well as for the simple textarea mode. This mod consist of a series of template edits.

Installation:
1- Unzip the zip file attached and upload the contents of the upload folder the root of your forum.
2. Perform the following template edits:

Open template page_container_js_head
At the end add:

HTML:
<script src="{$javaScriptSource}/jquery/jquery.UrduEditor.js"></script> 
<script type="text/javascript">
$.fn.UrduEditor.defaults.EditorFont = 'Jameel Noori Nastaleeq';
$.fn.UrduEditor.defaults.EnglishColor = '#fff';
$.fn.UrduEditor.defaults.UrduColor = '#fff';
$.fn.UrduEditor.defaults.LineBreak = false;
$(document).ready(function () {
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Forum' AND {$controllerAction} == 'CreateThread'">
$('#ctrl_title_thread_create').UrduEditor();
$('#ctrl_message').UrduEditor({PointSize:"18px"});
$('#ctrl_poll_question').UrduEditor();
$('#ctrl_title_thread_create').focus();
</xen:if>
 
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Thread' AND {$controllerAction} == 'Index'">
$('#ctrl_message').UrduEditor({PointSize:"18px"});
</xen:if>
 
 
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Member' AND {$controllerAction} == 'Member'">
$("textarea[name='message']").UrduEditor();
</xen:if>
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Conversation' AND {$controllerAction} == 'Add'">
$("#ctrl_recipients").UrduEditor();
$("#ctrl_title").UrduEditor();
$('#ctrl_message').UrduEditor({PointSize:"18px"});
</xen:if>
 
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Conversation' AND {$controllerAction} == 'View'">
$("#ctrl_recipients").UrduEditor();
$("#ctrl_title").UrduEditor();
$('#ctrl_message').UrduEditor({PointSize:"18px"});
</xen:if>
 
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Account' AND {$controllerAction} == 'PersonalDetails'">
$("#ctrl_status").UrduEditor();
$("#ctrl_status").focus();
$("#ctrl_custom_title").UrduEditor();
$("#ctrl_location").UrduEditor();
$("#ctrl_occupation").UrduEditor();
$("#ctrl_homepage").UrduEditor();
</xen:if>
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Search' AND {$controllerAction} == 'Index'">
    $('#ctrl_keywords').UrduEditor({PointSie:"13px", ToggleControls:false, VirtualKeyboard:false});
    $('#ctrl_users').UrduEditor({PointSie:"13px", ToggleControls:false, VirtualKeyboard:false});
        $('#ctrl_keywords').focus();
</xen:if>
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Register' AND {$controllerAction} == 'Index'">
$('#ctrl_username').UrduEditor({ToggleControls:false, VirtualKeyboard:false,EnglishColor:'#fff', UrduColor:'#fff'});
$('#ctrl_username').focus()
</xen:if>
 
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Login' AND {$controllerAction} == 'Login'">
$('#ctrl_pageLogin_login').UrduEditor({EnglishColor:'#fff', UrduColor:'#fff'});
$('#ctrl_pageLogin_login').focus()
</xen:if>
 
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Login' AND {$controllerAction} == 'Index'">
$('#ctrl_pageLogin_login').UrduEditor({EnglishColor:'#fff', UrduColor:'#fff'});
$('#ctrl_pageLogin_login').focus()
</xen:if>
 
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Account' AND {$controllerAction} == 'Following'">
$('#ctrl_users').UrduEditor({EnglishColor:'#ffffff', UrduColor:'#ffffff'});
$('#ctrl_users').focus()
</xen:if>
 
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Account' AND {$controllerAction} == 'Ignore'">
$('#ctrl_users').UrduEditor({EnglishColor:'#ffffff', UrduColor:'#ffffff'});
$('#ctrl_users').focus()
</xen:if>
 
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Post' AND {$controllerAction} == 'Report'">
$('#ctrl_message').UrduEditor({EnglishColor:'#ffffff', UrduColor:'#ffffff'});
$('#ctrl_message').focus()
</xen:if>
 
$('#QuickSearchQuery').UrduEditor({ToggleControls:false, VirtualKeyboard:false,PointSize:"14px"});
$('#searchBar_users').UrduEditor({ToggleControls:false, VirtualKeyboard:false});
$('#LoginControl').UrduEditor({ToggleControls:true,EnglishColor:'#fff', UrduColor:'#fff'});
$('#ctrl_username').UrduEditor({ToggleControls:false, VirtualKeyboard:false});
$('.StatusEditor').UrduEditor({ToggleControls:false, VirtualKeyboard:false,EnglishColor:'#fff', UrduColor:'#fff'});
});
</script>

Open template editor_js_setup
Find:

HTML:
tabfocus,-xenforo_inline_popups,

Replace with:

HTML:
urdueditor,tabfocus,-xenforo_inline_popups,

Open template thread_edit
At the end add:

HTML:
<script language="JavaScript" type="text/javascript">
$(document).ready(function () {
$('input[name="title"]').UrduEditor({PointSize:"13px", ToggleControls:false, VirtualKeyboard:false});
});
</script>

Open template report_view
At the end add:

HTML:
<script language="JavaScript" type="text/javascript">
$(document).ready(function () {
$('textarea[name="comment"]').UrduEditor({PointSize:"13pt", ToggleControls:true, VirtualKeyboard:true});
$('textarea[name="comment"]').focus();
});
</script>

Open template post_report
Ath the end add:

HTML:
<script language="JavaScript" type="text/javascript">
$(document).ready(function () {
$('#ctrl_message').UrduEditor({PointSize:"13px", ToggleControls:false, VirtualKeyboard:false});
$('#ctrl_message').focus();
});
</script>

Open template post_edit_inline
At the end add:

HTML:
<script language="JavaScript" type="text/javascript">
$(document).ready(function () {
$('.textCtrl').UrduEditor({PointSize:"13px", ToggleControls:false, VirtualKeyboard:false});
});
</script>

Open template member_list
At the end add:

HTML:
<script language="JavaScript" type="text/javascript">
$(document).ready(function () {
$('input[name="username"]').UrduEditor({PointSize:"13px", ToggleControls:false, VirtualKeyboard:false});
//$('#ctrl_message').focus();
});
</script>

Open template conversation_message_report
At the end add:

HTML:
<script language="JavaScript" type="text/javascript">
$(document).ready(function () {
$('textarea[name="message"]').UrduEditor({PointSize:"13pt", ToggleControls:true, VirtualKeyboard:true});
$('textarea[name="message"]').focus();
});
</script>

Open template conversation_invite
At the end add:

HTML:
<script language="JavaScript" type="text/javascript">
$(document).ready(function () {
$('#ctrl_recipients').UrduEditor({PointSize:"13px", ToggleControls:false, VirtualKeyboard:false});
});
</script>

Open template EXTRA.css
At the end add:

HTML:
.btnRaised,.btnFlat:hover{background:#D3D3D3;border:1px outset;cursor:hand;text-align:center;font-family:Urdu Naskh Asiatype, Tahoma;font-size:14px;font-weight:700}
.btnLowered,.btnFlat:active{background:#D3D3D3;border:1px inset;cursor:hand;text-align:center;font-family:Urdu Naskh Asiatype, Tahoma;font-size:14px}
.btnSysFlat{background:gray;border:1px solid #888;cursor:hand;text-align:center;font-family:Urdu Naskh Asiatype, Tahoma;font-size:14px}
.btnSysRaised,.btnSysFlat:hover{background:#333;border:1px outset;cursor:hand;text-align:center;font-family:Urdu Naskh Asiatype, Tahoma;font-size:14px;font-weight:700}
.btnSysLowered,.btnSysFlat:active{background:#333;border:1px inset;cursor:hand;text-align:center;font-family:Urdu Naskh Asiatype, Tahoma;font-size:14px}
.btnHelp,.btnFlat{background:#ECECEC;border:1px solid #888;cursor:hand;text-align:center;font-family:Urdu Naskh Asiatype, Tahoma;font-size:14px}
.keyboardHeader{background:#415888;color:#FFF;text-align:center;border:1px outset;border-color:#000;margin:0 0 5px;padding:2px;cursor:move}
.keyboardContainer{background:repeat scroll 0 0 #F7F7F7;direction:ltr; border:1px;border-style:solid;padding:5px;z-index:100}
.keyboardContainerDragged{background:repeat scroll 0 0 #F7F7F7;direction:ltr; medium dotted #000066;padding:5px;z-index:100;filter:alpha(opacity=40);-moz-opacity:.40;opacity:0.40}
.keyboardPanel{background:none repeat scroll 0 0 #EFEFEF;border:1px outset;color:#000;direction:ltr;border-style:solid;padding:4px}
.hiddentext {display:none}
.outline {cursor:hand; text-decoration:underline}
 

Attachments

Top Bottom