Emistry Posted November 10, 2011 Posted November 10, 2011 (edited) erm..i got some little suggestion for the CODE / Quote Wrap features... hope you can consider this also in the future after you have done the rest important stuffs in Forum ^^ since from the past eA ( eAthena.ws ) there are alot users ( Include me ) alway posting the Script in CODE / CODEBOX Wrapping So, i was wondering could the Forum install a "Select All" Features ? which work to Copy all the Content inside a CODE / CODEBOX ? Here is a Picture so that i hope you all can understand what i am saying since my language is kinda poor..>.< The Select Button is used for Users to click on it and then all the Content in the CODEBOX will be copied just like what we do usually ( Highligh All and Copy ) but now it come to a more easier way... Edited November 10, 2011 by Emistry
Z3R0 Posted November 10, 2011 Posted November 10, 2011 agreed, Brian and I can look into it, if it doesn't exist as an add-on feature, we can probably code one ourselves... chances are, it's just a bit of javascript
Mercurial Posted November 10, 2011 Posted November 10, 2011 (edited) yep seems to be easy but how about copy all instead of select all since your gonna copy it all anyway just my opinion Edited November 10, 2011 by Mercurial
Z3R0 Posted November 10, 2011 Posted November 10, 2011 I would call it "Auto Copy" or "Copy to Clipboard" since that's what it's obviously going to do when you click it
Ziu Posted November 10, 2011 Posted November 10, 2011 (edited) I like the idea ..... Edited November 10, 2011 by Ziu
Emistry Posted November 10, 2011 Author Posted November 10, 2011 Yes..this features work just like what Z3R0 has mentioned.... all the content inside the CODEBOX / CODE will be Copied upon we click on the "Select" *and sorry for those other who didnt fully get my idea due to my poor explaination*
Mystery Posted November 11, 2011 Posted November 11, 2011 I don't believe a feature like that is already encoded into IPB's java script. I believe you're gonna have to manually add it =/
Z3R0 Posted November 11, 2011 Posted November 11, 2011 Thats an easy javascript code hell i could write that tonight
Z3R0 Posted November 14, 2011 Posted November 14, 2011 I'm currently in the process of attempting to create the code... apparently it does not like javascript very much but I am almost there I think
Yuki Posted November 14, 2011 Posted November 14, 2011 Awesome. This is a great and necessary suggestion to implement <3.
Z3R0 Posted November 14, 2011 Posted November 14, 2011 I have given the code to Brian for "Select All" the reason being is that "copy" apparently is a lot harder than it looks... Many people resort to using "Flash" which I do not want to do... I'll have to look into a library feature that may enable this... the ckeditor has it, but I have no earthly idea how to depict it's clipboard usage... I've tried
KeyWorld Posted November 14, 2011 Posted November 14, 2011 Yeah there is no clipboard stuff in javascript yet, you can select the text, but can't copy it. I know you can do it on IE and maybe on firefox/netscape with some privileges but that's all. There is a new HTML5 feature in progress to work with but it seems to be oncopy/onpaste/oncut event, nothing to setting data. The only cross-browser way as far I know is to use a plugin : flash or java or silverlight...
Mercurial Posted November 14, 2011 Posted November 14, 2011 (edited) yep, mostly use a flash / silverlight addon to do this , if anyone is interested start here : http://code.google.c.../zeroclipboard/ Edited November 14, 2011 by Mercurial
Z3R0 Posted November 14, 2011 Posted November 14, 2011 ya, I'm looking into integrating zeroclipboard into my own local version... apparently Brian attempted to install the information in the files and failed... lol
Mercurial Posted November 14, 2011 Posted November 14, 2011 I was wondering what javascript framework that IPB uses? jQuery , Prototype , Dojo?
Z3R0 Posted November 14, 2011 Posted November 14, 2011 a little bit of both, jquery and pure js I'm talking with JGuy right now, about getting ftp access to fix the files that brian accidently messed up lol
KeyWorld Posted November 14, 2011 Posted November 14, 2011 selectCode function isn't defined (missing included javascript file ?) You can try with this for moment: function selectCode(btn) { //Don't know why btn send (this) in arg ? var code = btn.parentNode.lastChild, range, selection; if (document.body.createTextRange) { range = document.body.createTextRange(); range.moveToElementText(code); range.select(); } else if (window.getSelection) { selection = window.getSelection(); if (selection.setBaseAndExtent) { selection.setBaseAndExtent(code, 0, code, 1); } else { range = document.createRange(); range.selectNodeContents(code); selection.removeAllRanges(); selection.addRange(range); } } }
simplynice Posted November 14, 2011 Posted November 14, 2011 (edited) I'd like to add this up if ever this has been made via javascript or w.e. not .swf. Darn, cant paste the html. Just CSS. Just to be suitable for this forum's theme. Preview: .button{ cursor: pointer; text-decoration: none; box-shadow:inset 0 1px 0 #528cbc; font: normal 11px/16px "lucida grande",tahoma,verdana,arial,sans-serif; color: #ffffff; font-weight: bold; border: 1px solid #316897; text-align: center; background: #416d9b; width: 120px; height: 28px; -moz-border-radius: 10px;-webkit-border-radius: 2px;border-radius: 2px;-khtml-border-radius: 2px;} .button:active { background:#2d5885;} Edited November 14, 2011 by simplynice
GodLesZ Posted November 14, 2011 Posted November 14, 2011 [...] You can try with this for moment[...] Confirmed, worked for me also in some private projects long time ago.It's a nice cross-browser solution for selecting the text in the node.
Toshiro Posted November 14, 2011 Posted November 14, 2011 (edited) There's still one problem (that has also been on the other forums) once the select-all button works. The forum automatically converts tabs to spaces, so if you'd post an eA script (or anything else that relies on tabs), you still had to adjust the file to make it valid. This is (at least in the new forum versions) caused by the PrettyPrint javascript function the board uses. To remove the functionality that tabs are converted, the following piece needs to be removed from the http://eathena.sourc...ify/prettify.js file. http://toshiro.skylinero.net/eatab.txt (code piece linked, because.. well the tab would have been removed) Also right now there's a piece (lines 83, 92, 4251, 4260) of javascript that breaks the complete functionality of the javascript components of the board.http://eathena.sourc...ublic/js/ipb.js: s.addRange®; That's probably also the reason why the select-all-button is not working yet. Edited November 14, 2011 by Toshiro
Z3R0 Posted November 14, 2011 Posted November 14, 2011 I will take a look at preserving tabs... didn't realize it did that... (select text) works though
Brian Posted November 14, 2011 Posted November 14, 2011 Thanks Toshiro, I removed the line so tabs aren't converted to spaces. Should be updated in about 5 mins (because that's how long Varnish caches for).
Z3R0 Posted November 14, 2011 Posted November 14, 2011 Awesome! If anyone can make a nice button bg image or something for the button, I can get that modified current
Recommended Posts