Giter Site home page Giter Site logo

Comments (4)

julianlam avatar julianlam commented on September 22, 2024 1

Haven't had time to look into this but should be easy to determine from the rtl property on the html tag. Can you share your changes?

from nodebb-plugin-composer-redactor.

tuxado avatar tuxado commented on September 22, 2024

resolved by hacking in redactor.core.js and plugins.json file by adding the translation and text direction

from nodebb-plugin-composer-redactor.

tuxado avatar tuxado commented on September 22, 2024

hi,

These are the sources codes for the changes you can review thems

https://drive.google.com/file/d/0B4WEXAuiLIrVRUdrM3J0SGVkNWM/view?usp=sharing

composer.js

var data = { title: title, mobile: composer.bsEnvironment === 'xs' || composer.bsEnvironment === 'sm', resizable: true, allowTopicsThumbnail: allowTopicsThumbnail, isTopicOrMain: isTopic || isMain, minimumTagLength: config.minimumTagLength, maximumTagLength: config.maximumTagLength, isTopic: isTopic, isEditing: isEditing, showHandleInput: config.allowGuestHandles && (app.user.uid === 0 || (isEditing && isGuestPost && app.user.isAdmin)), handle: postData ? postData.handle || '' : undefined, formatting: composer.formatting, language: config.defaultLang.split("-")[0], tagWhitelist: ajaxify.data.tagWhitelist };

redactor.core.js
`$(window).off('action:redactor.load');

	var options = {
	  lang: config.defaultLang.split("-")[0],
      imageUploadFields: {
        'cid': '#cmp-cid-' + data.post_uuid,
        '_csrf': config.csrf_token
      },
      fileUploadFields: {
        'cid': '#cmp-cid-' + data.post_uuid,
        '_csrf': config.csrf_token
      },
	  plugins: ['source', 'fontcolor', 'alignment', 'fontsize', 'textdirection']
    };
	
	options = $.extend({}, options, textarea.data());
	
    textarea.redactor(options);`

composer.tpl

<textarea data-lang="{language}" data-direction="[[language:dir]]"></textarea>

library.js

`
plugin.addScripts = function(scripts, callback) {

scripts.push('/plugins/nodebb-plugin-composer-redactor/js/composer/languages/' + (meta.config.defaultLang || 'en-GB').split("-")[0] + '/composer-redactor.js');
callback(null, scripts);

};`

preview

preview

from nodebb-plugin-composer-redactor.

julianlam avatar julianlam commented on September 22, 2024

v3.0.1

from nodebb-plugin-composer-redactor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.