Deviant Login Shop  Join deviantART for FREE Take the Tour
×



Details

Submitted on
October 27, 2013
Image Size
51.0 KB
Resolution
1146×743
Link
Thumb
Embed

Stats

Views
1,029 (1 today)
Favourites
11 (who?)
Comments
21
Downloads
0

License

Creative Commons License
Some rights reserved. This work is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.
×
Easy Plain Text Button by electricjonny Easy Plain Text Button by electricjonny
As some people have found out, there is a little-known secret that lets you easily unparse the rich text formatting that dA does whenever you "Add Media" and use those buttons to style your text in the description of your submissions.

That's nice, but sometimes you'll be writing and formatting, and things just get messed up and it's hard to get it to format the way you want. It'll keep things bold even when you don't want it bold, or maybe you'll have edited something with a strikethrough and you want to undo it without having to delete it all and then type it again. Or maybe you're just more comfortable managing all your HTML manually, like me =P



Well you can focus this text area and hit Control+E to unparse it, but if you don't have it in focus, I find I wind up at google (I think it defaults to your browser's search). At least in Firefox. Plus, hitting Control+E just to toggle things is a bit of a pain. With this script, as you can see in the preview, you'll get a button above the submission area to quickly jump between rich text and plain text.

But there's a few oddities:

1. If you use normal emotes from the sidebar and drag them in, you'll get something like <da:emoticon id="391"> when you unparse it, not the simple :) like you'd expect. But that would have happened anyway if you hit Control+E. I would just type out :) and while that won't parse when you go back to rich text mode, it will preview fine.

2. If you only have one submission tab open, and you have click the X on the tab, the page will go back to normal but the button won't be there. For those instances, I would say just to refresh the page to start fresh.


Anyway, this should work in Firefox (with Greasemonkey) and Chrome. But in Chrome, you'll have to download the script to your computer, then open the extensions page, and manually drag it there. But I assume you Chrome users know how to get around that pain in the ass limitation ;P

You can get the script here: userscripts.org/scripts/show/1…



Let me know how you guys like it :)
Add a Comment:
 

The Artist has requested Critique on this Artwork

Please sign up or login to post a critique.

:icondediggefedde:
Dediggefedde Featured By Owner Oct 28, 2013
Nice idea! On my last description, Rich-text inserted a lot of paragraph's ending, but not where I wanted them^^ And where I wanted, it would'nt...
By the way: works also nicely with chrome + Tampermonkey and Opera + violentmonkey. I also suspect it will work in opera natively... although native opera-scripts usually like it to be enveloped by (function(){...})();...
It also works on Safari with ninjakit by the way...
Reply
:iconelectricjonny:
electricjonny Featured By Owner Oct 28, 2013  Hobbyist Photographer
Yeah, I found that when using the Add Media richtext buttons, and then press the button to see how it made the HTML, it was pretty messed up.  Mostly in that it put the closing tag a line below the text, which causes problems if you want to remove the formatting or type words after it... it's just a headache all around, and as someone who knows how to format in straight HTML,  I just prefer it that way.  I actually thought about adding in a way for it to remember the last mode you had it in, so the next time you went to submit something, it would go straight to plain text.  Might add that in the future.

And I know this works in Chrome without tampermonkey, but as I don't use Opera very much, I didn't test there.  And I don't even have Safari =P
Reply
:icondediggefedde:
Dediggefedde Featured By Owner Oct 28, 2013
Just wanted to mention it works on other configurations, too^^
for script-testing and webcoding I have chrome, ie, firefox, opera and an ie-emulator for older versions installed...
Personally I like a script manager in chrome better than mixing userscripts with extensions...
But I thought it may be better, to not only limit the minimal requirements to the two configurations mentioned in your description^^
Reply
:iconelectricjonny:
electricjonny Featured By Owner Oct 28, 2013  Hobbyist Photographer
Originally I liked how Firefox was one of the only main browsers that could use *.user.js scripts.  And with that extension's GM_ additions (like GM_XMLHttpRequest to go outside the site) since that expands the script's power.  Yeah you can run into security issues, but if you trust the user/reviews, then I feel fine installing those.

Now that Chrome has the ability to use those scripts (although it's lame that you can only install them from the play store, unless you drag it onto the extension page), but not the additions of GM_ things (unless you use Tampermonkey right?), I try to make "generic" js scripts that can work in any browser.

I typically write the script and then insert it into the head of the page so that I have easy access to the pages js already there.  For example, I do that here to interact with the native js and jQuery without having to write additional code or put a minified jQuery into the script.

I may start testing with Opera, but I'd have to learn how to do that :lol:

And I may just be used to Greasemonkey, but I find it nice to separate the scripts (that have a limited scope, being just js) and extensions, which can have access to the whole browser.



I'm in no way a js master-I only really learned it through looking at the scripts people have made here and a ton of googling.  But personally, if a site doesn't act the way I want, I'd rather fix it with scripts/Stylish than bitch and complain =P
Reply
:icondediggefedde:
Dediggefedde Featured By Owner Oct 28, 2013
Yeah, I agree with you on that^^
Opera was actually first supporting user.js without GM-functions... the feature is still there, just a bit hidden. in the settings under content and the javascript-settings you can choose a folder where all scripts are automatically injected in sites that matches the Greasmonkey-Header. Now with violentMonkey it got a lot easier, though^^

However, with deviantart, stealing the jquery-object is actually easy^^
var $=unsafeWindow.jQuery,holder,query,offset,fPage,pPage,lPage;
Will make the jQuery-object available for the script. Ok, unsafeWindow is, as far as I know, not supported by native Chrome, but all the script-handlers are doing their work with that^^

Still, for writing scripts that work without a handler, I still have problems with cross-site-requests and storing data. Within deviantart, localstorage oder indexedDB can be used, but that can only be accessed by the same site, right? And often the subdomain's change is enough to through it of^^

I personally began because I wanted to learn javascript. wrote a few test scripts during summer vacation.
then there were sites and ideas to improve them etc.^^ meanwhile I also heard some lectures about webporograming and informatics^^
Reply
:iconelectricjonny:
electricjonny Featured By Owner Oct 28, 2013  Hobbyist Photographer
I've used unsafeWindow before :nod:  But since I didn't think it would work in Chrome/other browsers (without extensions) I've learned to stay away from it.  But it sounds like Tamper/Violentmonkey are growing pretty popular, so I might fall back to it, since I have like 10+ scripts that are stuck into the head now :lol:

Before localStorage it used to be done all with cookies (duh), but I've made at least one that I know of that uses it.  It's pretty nice, although it's a bit of a bitch to see all the localStorage settings in Firefox without special extensions.  That's really the only worry with using it.  And yeah, I believe localStorage is only seen on pages with the same subdomain (pretty sure).
Reply
:icondediggefedde:
Dediggefedde Featured By Owner Oct 28, 2013
I once broke the dA-login for me when using too much info in cookies^^
GM_setValue is actually still the best way to store informations for multiple sites, as long as it isn't too much.

There is also a Tampermonkey-Beta release for Opera by the way...
Reply
:iconelectricjonny:
electricjonny Featured By Owner Oct 28, 2013  Hobbyist Photographer
Heh yeah, I love GM_setValue.  Mostly in that I can about:config and search for and change the values.  Not sure if it's the same in other browsers, but it's much easier than trying to change cookies/localStorage =P
Reply
(1 Reply)
:iconginkgografix:
ginkgografix Featured By Owner Oct 28, 2013
Ha, just experienced the new description writer yesterday and my first thought was "damn i need a button to get to the HTML version" :lol:

:#1:
Reply
:iconelectricjonny:
electricjonny Featured By Owner Oct 28, 2013  Hobbyist Photographer
Haha glad you like it :D

But all this really does is make it easier to convert to straight HTML-you can simply Control+E and it does exactly the same thing.  But who knows that trick? ;P
Reply
Add a Comment: