Jump to content

CodeBox Feature Suggestion


Emistry

Add Content Copy on Codebox  

12 members have voted

You do not have permission to vote in this poll, or see the poll results. Please sign in or register to vote in this poll.

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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 by Emistry
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

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 :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  241
  • Reputation:   46
  • Joined:  11/08/11
  • Last Seen:  

yep seems to be easy :)

but how about copy all instead of select all since your gonna copy it all anyway :D

just my opinion :D

Edited by Mercurial
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

I would call it "Auto Copy" or "Copy to Clipboard" since that's what it's obviously going to do when you click it

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  177
  • Topics Per Day:  0.04
  • Content Count:  909
  • Reputation:   247
  • Joined:  11/08/11
  • Last Seen:  

I like the idea .....

Edited by Ziu
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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*

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

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 =/

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

Thats an easy javascript code hell i could write that tonight

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  241
  • Reputation:   46
  • Joined:  11/08/11
  • Last Seen:  

test

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  318
  • Reputation:   68
  • Joined:  11/13/11
  • Last Seen:  

Awesome. This is a great and necessary suggestion to implement <3.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

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 :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

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...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  241
  • Reputation:   46
  • Joined:  11/08/11
  • Last Seen:  

yep, mostly use a flash / silverlight addon to do this :),

if anyone is interested start here : http://code.google.c.../zeroclipboard/

Edited by Mercurial
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  241
  • Reputation:   46
  • Joined:  11/08/11
  • Last Seen:  

I was wondering what javascript framework that IPB uses? jQuery , Prototype , Dojo?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

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);
       }
   }
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  128
  • Reputation:   4
  • Joined:  11/14/11
  • Last Seen:  

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:

35ivorq.png





.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 by simplynice
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  186
  • Reputation:   51
  • Joined:  11/14/11
  • Last Seen:  

[...]

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  106
  • Reputation:   28
  • Joined:  11/08/11
  • Last Seen:  

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 by Toshiro
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

I will take a look at preserving tabs... didn't realize it did that... (select text) works though

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

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).

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

Awesome! If anyone can make a nice button bg image or something for the button, I can get that modified :)

 current 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...