GithubHelp home page GithubHelp logo

Comments (12)

buzzedword avatar buzzedword commented on May 22, 2024

:( boo. Confirmed this is an issue. Just tried using onPaste/onAfterPaste events with designmode activation-- usually works for me with contentEditable blobs, but not this time.

Looks like @jhollingworth has to suss this one out alone. Sorry bud.

from bootstrap-wysihtml5.

codef0rmer avatar codef0rmer commented on May 22, 2024

I've found the code that causing this issue but not sure why we need the skipped code so decided to paste the changes here.

You can see below is the fire() method which gets called every-time you type or press any key being in an editor.

           this.events = this.events || {};
                   var handlers = this.events[eventName] || [],
             i        = 0;  
            for (; i<handlers.length; i++) {
              // I've put .call() in if-else condition for paste:composer to skip first 2 calls in order to suppress the bug
                  if (eventName === 'paste:composer' && (i === 0 || i === 1)) {
                  console.log(eventName + " " + handlers[i]);
              } else { 
                handlers[i].call(this, payload);
              }
            }
            return this;
    },

2 calls I skipped : (which are causing a problem)
this.observe("paste:composer"); // This clears the formatting of existing content in an editor.
this.parent.observe("paste:composer"); // This clears the formatting of the content being pasted.

Hope this will help.

from bootstrap-wysihtml5.

mpelzsherman avatar mpelzsherman commented on May 22, 2024

Reproduced in Firefox 11.0. Fix on the horizon?

from bootstrap-wysihtml5.

buzzedword avatar buzzedword commented on May 22, 2024

Keep posted to the main xing/wysihtml5 branch-- once it gets sussed out there, it should be merged down here. That's definitely an issue with their editor.

from bootstrap-wysihtml5.

codef0rmer avatar codef0rmer commented on May 22, 2024

I checked xing/wysihtml5 editor which does not have that bug. Need to look into bootstrap-wysihtml5.js

from bootstrap-wysihtml5.

buzzedword avatar buzzedword commented on May 22, 2024

Funny you just commented on it, they added more documentation for the events they publish which clears up some of the issues here. Looking into the composer events to monitor copy/paste actions.

edit or I'm an idiot and didn't see the needle in the haystack there-- composer docs have just been chilling in the middle. My bad. Looking into it either way.

from bootstrap-wysihtml5.

sblatnik8 avatar sblatnik8 commented on May 22, 2024

Oh thank goodness!!! I do document development work and have been having this problem for quite some time now. It is absolutely maddening (not to mention a huge time waster), and I've been unable to find a solution online despite extensive efforts to do so. I'm not a coding person so I'm afraid I can't contribute to the solution, but I am so grateful that you are looking into it and only hope I can figure out how to apply the solution when you find it (the tech language is well over my head).

from bootstrap-wysihtml5.

vinaykumard avatar vinaykumard commented on May 22, 2024

Thanks @codef0rmer it's working just fine..

from bootstrap-wysihtml5.

jhollingworth avatar jhollingworth commented on May 22, 2024

Should be fixed now :)

from bootstrap-wysihtml5.

sblatnik8 avatar sblatnik8 commented on May 22, 2024

Hi--This is such wonderful news!

But I don't know what it means in terms of actual application. Do I have to do anything on my end? Download an update or something or is it just going to miraculously be working in both new AND old documents.

Thanks for help!

Cheers,

Susan

Susan Blatnik
Cook International, LLC
Document Development Services
2041 Weber Avenue
Chesapeake, VA 23320
757-366-5901 (office phone & fax)
757-348-1193 (mobile)

-----Original Message-----
From: James Hollingworth [mailto:[email protected]]
Sent: Sunday, June 17, 2012 3:43 PM
To: sblatnik8
Subject: Re: [bootstrap-wysihtml5] Ctrl+V removes all formatting (#7)

Should be fixed now :)


Reply to this email directly or view it on GitHub:
#7 (comment)

from bootstrap-wysihtml5.

vinaykumard avatar vinaykumard commented on May 22, 2024

Search for

fire: function(eventName, payload) {
this.events = this.events || {};
var handlers = this.events[eventName] || [],
i = 0;
for (; i<handlers.length; i++) {
handlers[i].call(this, payload);
}
return this;
},

IN wysihtml5-0.3.0.js

and replace it with

fire: function(eventName, payload) {
this.events = this.events || {};
var handlers = this.events[eventName] || [],
i = 0;

for (; i<handlers.length; i++) {
// I've put .call() in if-else condition for paste:composer to skip first 2 calls in order to suppress the bug
if (eventName === 'paste:composer' && (i === 0 || i === 1)) {
console.log(eventName + " " + handlers[i]);
} else {
handlers[i].call(this, payload);
}
}
return this;
},

from bootstrap-wysihtml5.

sblatnik8 avatar sblatnik8 commented on May 22, 2024

Dear Lord! LOL. I will find a program-competent friend to help me. I can write a dissertation like no one's business, but this stuff stymies me.

Thank you so very much for the info. I can't express how grateful I am. (No one believed this was a problem. Thought I was crazy or an idiot or perhaps both.)

Thanks again.

Cheers,

Susan

Susan Blatnik
Cook International, LLC
Document Development Services
2041 Weber Avenue
Chesapeake, VA 23320
757-366-5901 (office phone & fax)
757-348-1193 (mobile)

-----Original Message-----
From: Vinay Kumar D [mailto:[email protected]]
Sent: Thursday, June 28, 2012 2:34 PM
To: sblatnik8
Subject: Re: [bootstrap-wysihtml5] Ctrl+V removes all formatting (#7)

Search for

fire: function(eventName, payload) {
this.events = this.events || {};
var handlers = this.events[eventName] || [],
i = 0;
for (; i<handlers.length; i++) {
handlers[i].call(this, payload);
}
return this;
},

IN wysihtml5-0.3.0.js

and replace it with

fire: function(eventName, payload) {
this.events = this.events || {};
var handlers = this.events[eventName] || [], i = 0;

for (; i<handlers.length; i++) {
// I've put .call() in if-else condition for paste:composer to skip first 2 calls in order to suppress the bug if (eventName === 'paste:composer' && (i === 0 || i === 1)) { console.log(eventName + " " + handlers[i]); } else { handlers[i].call(this, payload); } } return this;
},


Reply to this email directly or view it on GitHub:
#7 (comment)

from bootstrap-wysihtml5.

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.