Strange Message when Pasting Text - javascript

I have no idea why this happened, but I am no longer able to copy text on my website (in Wordpress), kinda. I can paste text, but not copy text. And I can go to any other website and copy and paste text, but just not on my own. Both methods of copying (right click copy or control + C on windows) does not work on my website. But anyways, this problem applies only within text fields, like the style editor, header editor, the "quickpress" text field on the dashboard and even on the search field of my website. So I tried the following to fix this issue:
1) Disable my keyboard driver and restart my computer
2) Uninstall and reinstall my internet browser - Google Chrome
None of the above worked. But just recently, I I was able to copy and paste <script> text bit in my header.php file. I couldn't copy any other text but this and a few other snippets of code... which is very weird. But anyways, here is a code/text I copied and also what I get once I paste the code:
Original text that I copied:
<script src="http://code.jquery.com/jquery-1.9.0-min.js" type="text/javascript"></script>
Text I get when I paste original above text:
See more at: http://www.mywebsite.com/wp-admin/theme-editor.php?file=header.php&theme=mytheme2%2Fthemez2#sthash.WVvNmB7H.dpuf
Could this be a potential hacker or intruder into my website? I can't see any other explanation for this very strange error at this point. If anyone could help fix the copy and paste abilities for my website or come up with an explanation to this odd problem, it would really mean a lot.
Update:
This problem only persists in Google Chrome and Safari... not Mozilla or IE. And I stripped all of my java code and the problem still remains Hope that helps.

I work on thehollywoodreporter.com. Our editors could no longer use the Drupal 6 CMS because of this sharethis change. When they tried to copy from one field to another in the cms, it would take the string and turn it into:
See more at: <text pasted>&action=edit#sthash.mOyzIP9P.dpuf
I seriously thought our site had been hacked for like 10 minutes. Luckily, the dev community started posting about it, and pointed out it was the new CopyNShare feature sharethis added. I commented out the sharethis code, so our editors could resume publishing, and we got on the phone with our sharethis contact, and they had us change this:
<script type="text/javascript">var __st_loadLate=true;</script><script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
to
<script type="text/javascript">var __st_loadLate=true;</script><script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">stLight.options({publisher: "<your publisher key>", doNotHash:false, doNotCopy:true,hashAddressBar:false});</script>
Apparently, they made a change to their code so that you MUST add 'doNotCopy: true' in order for it NOT to add this hash when you cut and paste within your site! This is their new "product" CopyNShare.
I told them "I don’t think it was popular move to roll out this feature as a new default like this. I seriously thought our site had been hacked for 10-15 minutes. Not fun."
They replied: "I definitely understand your concern, as we share the same concerns on the pub services team. We will be doing a "postmortem" of sorts to ensure we change this process in the future when new product features are rolled out."

As #Punit Pandey suggested, the ShareThis plugin started doing this today (February 27th 2013) without warning. You can disable this new functionality by adding the following JavaScript after the ShareThis-code has initialized:
stLight.options({doNotCopy:true});
The description for this new functionality can be found here: ShareThis CopyNShare Settings

This is happening on my website due to ShareThis plugin. ShareThis adds this tag sthash and an identification ending with dpuf, I guess, to identify website.

The problem stemmed from a plugin within Wordpress called "Digg Digg". I simply deactivated this plugin and there was no copy and pasting issues. :)

I fixed this issue in Drupal 7 by changing modules/sharethis/sharethis.module
around line 467
// Provide the publisher ID.
$stlight = drupal_json_encode(array(
'publisher' => $data_options['publisherID'],
**'doNotCopy' => "true",**
));
there doesnt appear to be any option to turn this off in the module config page. Very annoying!

Related

Error when using Emoticons as Wordpress Post-Tags

I´ve created a Wordpress-Post-Tag with a Emoji-Code: 😄
This works fine, even as slug in the Url. (Some Browsers convert the 😄 to bytes.)
The problem ist now, that I can´t add this Tag from the "Choose from the most used tags" Tagcloud. The input is focused, but no Emoji occurs - it stays empty.
WP Tags
My question: how can I fix that behaviour without touching wordpress core?
Or should I post a bug report at Wordpress?
Thanks for any advice!
(This is my first post, so be polite please 🤓 )
It looks to me like your database’s collation setting doesn’t support these types of characters.But as you say emoji is not available after select it once.
For This issue,You have to report in WordPress support.

TinyMCE - How can I turn off Visual Aids for printing?

I recently added TinyMCE 4.0b2 to a web application I've been developing.
I needed to have visual aids turned on for editing, however turned off when printing and spent a fair amount of time looking for a solution through their forums, StackOverflow and google to no avail!
So... I decided to investigate the issue myself!
To get this to work I had to manually 'adjust' the print command of the print plugin.
The following fix applies to TinyMCE v.4.0b2, the version available at time of writing; it may or may not work with previous and future versions of TinyMCE.
The print plugin file can be found in the js/tinymce/plugin/print/ directory.
Open the plugin.min.js file in your favourite editor and you'll see something like this:
tinymce.PluginManager.add("print",function(e){e.addCommand("mcePrint",function(){e.getWin().print();}),e.addButton("print",{title:"Print",cmd:"mcePrint"}),e.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print",shortcut:"Ctrl+P",context:"file"})});
After poking around the tinymce source code I found the hasVisual editor property and mceToggleVisualAid command. I then added these two to the printing plugin as
if(e.hasVisual){e.execCommand("mceToggleVisualAid");}
just prior to the code calling
e.getWin().print();
The finished product looks like so:
tinymce.PluginManager.add("print",function(e){e.addCommand("mcePrint",function(){if(e.hasVisual){e.execCommand("mceToggleVisualAid");} e.getWin().print();}),e.addButton("print",{title:"Print",cmd:"mcePrint"}),e.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print",shortcut:"Ctrl+P",context:"file"})});
I hope this helps someone struggling with this issue in future.

Pinterest "Pin it" button breaking 'back' in Internet Explorer

I recently found out that in Internet Explorer (v9 at least), the "Pin it" button for Pinterest is breaking 'back' functionality in the browser. Right-clicking on it shows an entry like 'http://assets.pinterest.com/pidget.html' as the previous page.
Looks like Pinterest is adding an iFrame and IE is adding its address to the history. Clicking 'back' doesn't do anything. Is this a known issue and is there a fix for this?
well, as a temporary solution (other than removing the 'pin it' button), from reading their code, I believe (not tested) that you could add a part to the <script> call to disable logging, like this ...
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js" data-pin-do-not-log="true"></script>
This works but doesn't apply for me because I load the script asynchronously and I use a load command, so what I did was I copied the pinit.js file locally to the server, and changed the part that says
if(a.v.config["do-not-log"]||a.a.doNotLog===true)
to
if(a.v.config["do-not-log"]||a.a.doNotLog===true||true)
looks like it's doing some sort of log in an iframe.
I was having the same problem. I added the website to my list of restricted sites by going to "Tools", then "Internet options", then "Security". It seems to have solved the problem.
I've raised it with PInterest here https://help.pinterest.com/requests/884162
Thier response. Pretty much a brush off.
Hi ,
Information on how to add the Pin It button to your website or product pages is available here:
http://pinterest.com/about/goodies/
More advanced documentation is available here:
https://help.pinterest.com/entries/21101982
We regret that we're unable to provide coding support. Because issues with adding the Pin It button can be caused by conflicts with different parts of your setup it is usually best when someone that is familiar with your setup troubleshoots it. You may also want to try searching the web to see if others have had similar issues especially people that are using a similar site platform or language.
We request that you use our help articles to get the information you need as quickly as possible. If there’s additional information you’d like our team to know, you can reply to this message.
Thanks for writing and happy pinning!
The Pinterest Team
This was a temporary bug when we first pushed the new Pin It button and should no longer be an issue, since we removed the logging frame shortly after it was reported. Sorry for the trouble!

Tumblr JS Embed CSS/HTML Tags for Styling?

I used tumblr's javascript embed code to embed my posts into an external website. Now I want to style the posts. Where can I find the full list of tags, classes, and all of that in order to do this? I see people posting some of the tags, for exampe ol.tumblr_posts, but no one has said how or where they actually found out that's the tag tumblr is using for that particular element.
Someone mentioned using the web developer extension in Firefox to pull out the HTML associated with the javascript file but I can't use Firefox so I need another suggestion? I did go to tumblr's docs but the tags and everything used for customizing themes WITHIN tumblr seem to be different from the ones used to display posts outside of tumblr.
I also looked around in the api section and didn't see anything that lists all of the tags. Thanks!
UPDATE: Here's a post that discusses what I'm talking about but none of the people giving answers that show what tags to use to format the script's output say how or where they got the tags.
tumblr javascript embed with css skin
This website is the one that said to use the FF add on but again, the person who figures out how to find the tags using it doesn't say HOW, they just say it worked. I'm finally in a place where I can use Firefox so I installed this web developer thing and I still don't see where I would go to see the info that shows the actual html with all the styles instead of just showing the link to the js code.
http://forums.macrumors.com/showthread.php?t=745299
Chrome and Opera's developer console is CTRL + SHIFT + I... try looking in the source there
IE's dev tools is f12 if you can't use Chrome
Also: I'm not sure if this is what you're talking about but I'll throw in this link for good measure:
http://www.tumblr.com/docs/en/custom_themes
I figured it out! Unfortunately, the only way I could do this was to use the Firefox Web Developer Toolbar Add-On. Once you have that installed, you go to the webpage where you've embedded your blog's javascript code.
Then, in the Firefox toolbar, there should be a tab that says "Miscellaneous". Click on that, then click on "Edit HTML". A new pane opens up towards the bottom of the browser. Inside, it will show the source of the webpage INCLUDING the information that the javascript code generates, which shows the classes, html, and all of that.
It's still not a ton that you can customize compared to using the api (which I don't know how to do) but it's a start. Thanks everyone!

Using multiple CodeMirror editors on a single page?

I'm writing a page with examples that demonstrate the use of my js library. I'd like these examples to be editable and runnable, so I thought I have these options :
Use prettify to display code on the tutorial page, have a button that opens a new window with the editor where you can run the code (currently implemented solution). Alternatively, I can make the editor a modal dialog of some sort.
Use multiple CodeMirror editors for each example on the page (could be up to 30 on a single page). I'm not sure how "heavy" those editors are, so I'm not sure if that's a good idea.
Have an edit button that "swaps" prettyfied code with a CodeMirror editor when editing is needed, so that the user can edit and run the examples without bothering with new windows. I'm not sure if I can make prettify and CodeMIrror's syntax highlighting to look the same.
Any ideas on how I should do this and why? I'm also open to suggestions about different code editors or syntax highlighters too, so if anybody has experience with this kind of thing, please tell me how you did it.
You could use the same technique that Marijn Haverbeke (the creator of CodeMirror) uses for the online version of his javascript book. It shows code snippets, and provides an edit-button that opens a javascript console at the bottom of the screen.
Look at this chapter for an example.

Categories

Resources