Code Monkey home page Code Monkey logo

angular-wysiwyg's Introduction

My home blog and website

Built with my static site generator called sia

angular-wysiwyg's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-wysiwyg's Issues

PLEASE FIX :::: IE Bold Issue

Chrome is fine. In IE as soon as you mouse click in the textarea of the WYSIWYG, BOLD is highlighted automatically without any typing or any current text in the textarea, and if you type something and highlight your text and then click BOLD it will not bold. All the other tools seem to work fine (although changing font color seems not to work either in IE). Please advise. Thanks

iebold1
iebold2

Setting Height not working

I have worked with the Plunker code and also downloaded the copy but I am unable to change the height of the actual WYSIWYG box. It is staying at the default height. Any thoughts?

Demo page?

This directive does not has a demo page....

I think it would help to have a way to see how it looks like without needing to "download & install" ... ;)

Thanks!

Problems with spacebar

Hi,
first of all congratulation for the great and lighweight module.
I had an issue when pressing spacebar. The editor doesn't print the space but it falls down with the default behaviour of scrolling the whole webpage.
I checked the code and fixed it by adding

event.stopPropagation();

at the end of the event handler on keydown

Following the piece of code

textarea.on('keydown', function (event) {
            if (event.keyCode == 9) {
              var TAB_SPACES = 4;
              var html = textarea.html();
              var selection = window.getSelection();
              var position = selection.anchorOffset;
              event.preventDefault();  // html = insertTab(html, position);
                                       // textarea.html(html);
                                       // selection.collapse(textarea[0].firstChild, position + TAB_SPACES);    
            }

            // THIS IS THE LINE I ADDED <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            event.stopPropagation();
          });

No image resizing

I really like what you've got going with this, but the one thing that I would really need is image resizing. I'm looking to implement an angular wysiwyg editor to create a cms. If you think there is an angular component that would be a better match, I would appreciate a recommendation!

When writing the cursor starts at position initial

When I'm writing and the clicked on any option (e.g. bold, font-size..) and I keep writing the cursor begins at the starting position of textarea. How can I fix this?

I would appreciate any help :) ๐Ÿ‘

disabled option does not work?

In readme is mentioned the **disabled Disable the buttons and wysiwig area option
I tried it in several ways but no success:

<wysiwyg 
          textarea-id="question" 
          textarea-class="form-control"  
          textarea-height="180px" 
          textarea-name="textareaQuestion" 
          textarea-required 
          ng-model="data.text" 
          enable-bootstrap-title="true"
          disabled="disabled">
</wysiwyg>

or

<wysiwyg 
          textarea-id="question" 
          textarea-class="form-control"  
          textarea-height="180px" 
          textarea-name="textareaQuestion" 
          textarea-required 
          ng-model="data.text" 
          enable-bootstrap-title="true"
          disabled="true">
</wysiwyg>

or

<wysiwyg 
          textarea-id="question" 
          textarea-class="form-control"  
          textarea-height="180px" 
          textarea-name="textareaQuestion" 
          textarea-required 
          ng-model="data.text" 
          enable-bootstrap-title="true"
          disabled>
</wysiwyg>

Am I doing something wrong? Thanks.

Doesn't work in bootstrap modal

It seems that the fragment of the menu isn't appended in its container "div.wysiwyg-menu", when the directive is called in a modal window.

TypeError: Cannot read property 'appendChild' of null at Object.createMenu (http://localhost:1337/lib/angular-wysiwyg.min.js:313:14) at Object.compile (http://localhost:1337/lib/angular-wysiwyg.min.js:54:17) at applyDirectivesToNode (http://localhost:1337/lib/angular.js:7459:32) at compileNodes (http://localhost:1337/lib/angular.js:7000:15) at compileNodes (http://localhost:1337/lib/angular.js:7012:15) at compileNodes (http://localhost:1337/lib/angular.js:7012:15) at compile (http://localhost:1337/lib/angular.js:6907:15) at applyDirectivesToNode (http://localhost:1337/lib/angular.js:7386:33) at compileNodes (http://localhost:1337/lib/angular.js:7000:15) at compile (http://localhost:1337/lib/angular.js:6907:15) <div textarea-id="inputText" textarea-class="form-control" textarea-height="120px" textarea-name="inputText" textarea-required="" ng-model="message.text" enable-bootstrap-title="false">

exception raised on FF38 (maybe more)

The following exception is raised (even on the demo) when loading the page

13:47:51.732 Exception { message: "", result: 2147500037, name: "NS_ERROR_FAILURE", filename: "http://localhost:4000/src/angular-wโ€ฆ", lineNumber: 322, columnNumber: 0, inner: null, data: null, stack: "link/scope.format@http://localhost:โ€ฆ" } "

"1 angular.js:9784:17
consoleLog/<() angular.js:9784
$ExceptionHandlerProvider/this.$get</<() angular.js:7219
nodeLinkFn() angular.js:6585
compositeLinkFn() angular.js:5985
nodeLinkFn() angular.js:6576
compositeLinkFn() angular.js:5989
nodeLinkFn() angular.js:6576
compositeLinkFn() angular.js:5989
compositeLinkFn() angular.js:5992
publicLinkFn() angular.js:5894
bootstrap/doBootstrap/</<() angular.js:1384
$RootScopeProvider/this.$get</Scope.prototype.$eval() angular.js:12418
$RootScopeProvider/this.$get</Scope.prototype.$apply() angular.js:12516
bootstrap/doBootstrap/<() angular.js:1382
invoke() angular.js:3873
bootstrap/doBootstrap() angular.js:1380
bootstrap() angular.js:1394
angularInit() angular.js:1307
angular.js:22040
x.Callbacks/l() jquery-2.0.3.min.js:4
x.Callbacks/c.fireWith() jquery-2.0.3.min.js:4
.ready() jquery-2.0.3.min.js:4
S() jquery-2.0.3.min.js:4

textareaPlaceholder does not work

In your code I found

...
textareaPlaceholder: '@textareaPlaceholder',
...

so I tried

<wysiwyg
        textarea-id="question"
        textarea-class="form-control"
        textarea-height="250px"
        textarea-name="textareaQuestion"
        textarea-required
        ng-model="reportItem.notes.text"
        enable-bootstrap-title="true"
        ng-if="editMode"
        textarea-menu="wysiwygMenu"
        textarea-placeholder="Add some notes to the chart.">

and it doesn't show the placeholder text in the wysiwyg "text area". Am I doing something wrong or this is just not functional?
Thx

Problem when using 2 times in the same page

My html

<div class="row">
    <div class="col-xs-12">
      <div class="form-group">
        <label class="control-label">My label 1</label>
        <wysiwyg ...></wysiwyg>
      </div>
    </div>
  </div>
  <div class="row">
    <div class="col-xs-12">
      <div class="form-group">
        <label class="control-label">My label 2</label>
        <wysiwyg ...></wysiwyg>
      </div>
    </div>
  </div>

Here is the result
capture d ecran 2015-04-01 a 09 45 19

I guess the problem comes from selections like var menuDiv = document.querySelector('div.wysiwyg-menu'); because your are not selecting from the element var given in the link function.

Any chances to get a quick fix ?

Bold and italics buttons do not toggle until you move focus back to textarea.

IMO: Seems like a confusing usability issue.

Open the Demo.
Put cursor after "hello" in the textarea.
Click Bold. (note: bold is now depressed)
Start typing some chars (note: chars are Bold)
Click Bold on the toolbar (issue: it does not toggle off).
If you click back to the textarea, now Bold toggles off.

Seems the Bold and Italics buttons are getting their state indicated by the cursor location in the textarea.

How to add more px sizes

How i can add more pixel sizes in editor. like i want to add pixel size as 72px etc. cant able to add more px. sizes. any one have solution? thanks.!

Minimal install issue

I am trying to install this without bower/bootstrap. Is this possible (I am to custom style it)?

Focus/Blur on element

Hello, I would like to know if there is any workaround or something where I can define blur and focus events and make edits based on that. Cheers!

Custom buttons and demo link

I am thinking of using your wysiwyg editor which looks nice and simple. I have used textAngular, but having some problems with it, but wondered if you editor can cope with custom buttons? One option i would like is too open a modal window when the insert image button us pressed and allow the user to pick an image url. Can this be done?

Also your demo link on the readme doesnt work, which you may want to change..

Clean code

Hi,

can you use angular array annotation like

someModule.controller('MyController', ['$scope', 'greeter', function($scope, greeter) {
  // ...
}]);

and use like jshint (easy with grunt task) to correct missing semicolon, double quotes etc ?

I just spent 30min to fix the script in a fork (I can't PR because there is code you don't want).

Thanks

Add jquery to the dependency list?

Jquery isn't listed as a dependency, but it doesn't seem to function properly without it. So to save confusion it may be best to add jquery as a dependency in the bower.json and in the readme :). Great little module!

Submission on button click?

My form keeps trying to submit every time I click one of the buttons. Not seeing anything special in my form that would cause this. Has anyone else seen this?

image picker

Great solution
Missing like in all is image insert/upload to server / browse server can you add this

Add a selectbox to apply custom css classes

Hi,

to avoid any complicated custom buttons, could we have a selectbox where we can supply some css classes to apply on a selected text ?

Would be an awesome feat to provide custom css easily.

Typo in customMenu in Readme

//This also happens to be the default menu options.
    $scope.yourModel.customMenu = [
            ['bold', 'italic', 'underline', 'strikethrough', 'subscript', 'superscript'],
            ['font'],
            ['font-size'],
            ['font-color', 'hilite-color'],
            ['remove-format'],
            ['ordered-list', 'unordered-list', 'outdent', 'indent'],
            ['left-justify', 'center-justify', 'right-justify'],
            ['code', 'quote', 'paragragh'],
            ['link', 'image']
        ];

You have the typo in word 'paragragh'. It should be 'paragraph'. This causes the paragraph button doesn't show and "cannot create this element." displayed in console.

Buttons not highlighted on select

Buttons are not being highlighted on selection. Bold button is not being assigned the expected '.active' class even when bold is selected.

using Angular 1.3.7

Works well if Jquery is included, but I was trying to avoid including jquery.

No tab escape?

It is important to have the tab button indent. Really not useable without this IMO.

Great library otherwise! very lightweight and easy to integrate.

Editor button/tools collapse/break in Internet Explorer 11 (IE11)

Hi,

Thanks for the Angular WYSIWYG plugin.

Angular WYSIWYG editor is working perfectly in all broswers like Google chrome, firefox etc except Internet explorer 11.

Please refer the screenshot of issues

Plunker page without any modification

step1

Step to reproduce the issue

  1. Enter some text in text editor
  2. Select the text and click any alignment button, like left justify, center justify & right justify
  3. Now the editor button / tools will collapse / break as shown below.

step2

Please suggest the solution for this. Your help is highly appreciated.

Formatting not applied until next keystroke or click

I'm using your directive with bootstrap 3 and Angular 1.3. I've found that when I highlight text and click "Bold" (or any other formatting change) and then immediately save, the formatting changes are not saved.

Digging a little deeper, I noticed that clicking toolbar buttons does not trigger the event listener that copies changes back to the ng-model variable:

            textarea.on('keyup mouseup', function() {
                scope.$apply(function readViewText() {
                    var html = textarea.html();
                    if (html == '<br>') {
                        html = '';
                    }
                    ngModelController.$setViewValue(html);
                });
            });

That's find for command buttons that only set mode, but can lead to unexpected behavior for command buttons that modify text.

Changes are captured correctly as long as you click or type at least once inside the textarea before saving.

I'll keep messing with it and let you know if I find a fix before you have a chance to look at it.

Special characters

Hello, Are you providing special characters button in your editor. can i customize this editor with special symbols?

color picker

the editor when place on top make the color picker tooltip hidden, why not make it appear at bottom of the icon rather than top of it,

I've try using this but it return a lot of error, while handling the textModel, become unresponsive to select the text in text area.

Form validation

Validation errors of the angular-wysiwyg are not showing as part of the errors of the parent form. Is that the expected behavior? How to get the validation errors from angular-wysiwyg ?

Is this component dependent on jQuery?

After adding it to my project, it I throws this error:

Error: [jqLite:nosel] Looking up elements via selectors is not supported by jqLite!

But the README.md Required dependancies doesn't have jQuery.

failing on start "element.find(...).tooltip is not a function"

Not sure what I've missed, but always getting this error:

element.find(...).tooltip is not a function
    at configureBootstrapTitle (http://app.northbrasil.com.br/bower_components/angular-wysiwyg/dist/angular-wysiwyg.js:203:43)
    at init (http://app.northbrasil.com.br/bower_components/angular-wysiwyg/dist/angular-wysiwyg.js:182:11)
    at link (http://app.northbrasil.com.br/bower_components/angular-wysiwyg/dist/angular-wysiwyg.js:178:9)

Manage link

Hi,

I need to use links to show a title instead of link. Today it's

<a href="http://www.google.fr">http://www.google.fr</a>

I would like to be able to do

<a href="http://www.google.fr">access google page</a>

To do so a simple way would be to add another alertbox to enter en title

multiple xss

Your wysiwyg editor is prone to multiple xss security vulnerabilities via 'on' events (onclick, onerror, etc.), and potentially others attributes that let's you inject javascript code.
PoC :
<img src='http://invalidimageurl.com/lakzelazkemlkazmlek' onerror='alert(document.cookie)'/>

Xss may let you steal sensitive session information, and thus, impersonate an authenticated user.
I can't use this module since i need 'bullet-proof' user-input sanitization of a text-editor.

Ref:
https://www.owasp.org/index.php/Cross-site_Scripting_(XSS)

Regards

jqLite Error

tooltip issue

I am using meanio https://github.com/linnovate/mean and the dynamic twitter bootstrap tooltip is erroring out. I can manually do tooltips.

Any insight on why. I am using ui-bootstrap as well as bootstrap.

element.find('button[title]').tooltip({container: 'body'})

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.