Giter VIP home page Giter VIP logo

improvedcode's People

Contributors

aguvillalba avatar vundicind avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

improvedcode's Issues

Uncaught TypeError: Cannot read property 'add' of undefined

On initialization on line 68

ed.onNodeChange.add(function(ed, cm, n) {
    cm.setActive('improvedcode', n.nodeName == 'IMG');
});

Uncaught TypeError: Cannot read property 'add' of undefined plugin.js:68
tinymce.create.init plugin.js:68
e tinymce.min.js:8
o tinymce.min.js:3
_.init tinymce.min.js:8
(anonymous function) tinymce.min.js:8
(anonymous function) tinymce.min.js:4
o tinymce.min.js:3
h tinymce.min.js:4
(anonymous function) tinymce.min.js:4
n

TinyMCE: 4.0.25
Browser: Chrome 34.0.1847.131
OS: Mac OS X - Mavricks 10.9.2

<!DOCTYPE html>
<html>
<head>
    <meta charset=utf-8 />
    <title>Test</title>
</head>
<body>
    <script type="text/javascript" src="tinymce_4.0.25.dev/tinymce.min.js"></script>
    <script type="text/javascript">
    tinymce.init({
        selector: "textarea",
        theme: "modern",
        plugins: [
            "advlist autolink lists link image charmap print preview hr anchor pagebreak",
            "searchreplace wordcount visualblocks visualchars code fullscreen",
            "insertdatetime media nonbreaking save table contextmenu directionality",
            "emoticons template paste textcolor"
        ],
        external_plugins: {
            "improvedcode": "../plugins/improvedcode/plugin.js"
      },

        toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
        toolbar2: "print preview media | forecolor backcolor emoticons",
        image_advtab: true
    });
    </script>

    <form method="post" action="somepage">
        <textarea name="content" style="width:100%"></textarea>
    </form>
</body>
</html>

No Issue, a suggestion. Adding width

Adding a width option.
With my current version. 1.3.1 plugin.js file (using 1.2.1 of others) as the rest of 1.3.1 files seems broken.

Line 30

t.settings = extend({
     width: 720
    ,height: 580
    ,indentUnit: 4
    ,tabSize: 4
    ,lineWrapping: true
    ,lineNumbers: true
    ,autoIndent: true
    ,optionsBar: true
    ,theme: 'default'
 },ed.getParam('improvedcode_options'));

After, starting at Line 48

var height = t.settings.height;
var viewPortHeight = ed.dom.getViewPort(window).h;
if(viewPortHeight < height) {
    height = viewPortHeight * 0.9;
}

Add

var width = t.settings.width;
var viewPortWidth = ed.dom.getViewPort(window).w;
if(viewPortWidth < width) {
    width = viewPortWidth * 0.9;
}

Then, right below above.

ed.windowManager.open({
        title: "Improved HTML Source Editor",
        url : url + '/improvedcode.htm',
        width : width,
        height: height,
        inline : true,
        resizable : true,
        maximizable : true
    },
    {
        plugin_url : url, // Plugin absolute URL
        settings: t.settings
    });

Very useful when you make the editor a full page editor.
A wider window helps when you want to look at code.

Master demo not working

@aguvillalba @vundicind I've just tried the demo at \improvedcode-master\demo\index_tinymce4.html the console is throwing errors:

Uncaught ReferenceError: tinyMCEPopup is not defined

improvedcode.htm:59 Uncaught TypeError: Cannot read property 'init' of undefined

Any ideas how I can get around this?

Thanks

TinyMCE 3.5.11 support?

Hi!

Does your plugin support TinyMCE version 3.5.11? I always geht this error in Firefox ESR 38.2.0:

HierarchyRequestError: Node cannot be inserted at the specified point in the hierarchy
rng.insertNode(rng.createContextualFragment(content));

in tiny_mce_jquery_src.js line 8270

Version 1.3.1 Issues

I just downloaded 1.3.1 and added my changes (adding width) to the main plugin files, uploaded them and everything was fine. Until I uploaded the rest of 1.3.1's files. Then I was no longer seeing HTML code in the viewer. Going to gather it is somewhere in one of the files in the JS folder.

So as of right now, using 1.3.1 main plugins (which may not have been changed). All the rest are 1.2.1 as I know that version is working.

Also using TinyMCE 4.

Preformatted text

Hi, Agustín.

CodeMirror changes the preformatted text (what's inside PRE tags). Example:

<div class="pre-code">
<div>
<pre><code>function testing(){
    alert("Hi!");
}</code></pre>
</div>
</div>

And a request: Search/Replace options.

Nice plugin!

Thanks a lot,

Ignacio

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.