String#escapeHTML #truncate ???
-
MadRabbit
- Tag set to feature
-
MadRabbit
[project:ID#31989 bulk edit command]
-
Douwe M.
Bump. A String#truncate method would be really nice
-
MadRabbit
Hey Douwe,
There is a plugin called
langin thegoodsrepository which meant to keep all the additional language methods and features. I honestly don't have much time to get on it yet, because currently busy with the core and plugins, but if you're interested you could help by implementing those methods by yourself. Say add the string methods over herehttp://github.com/rightjs/rightjs-goods/blob/master/src/lang/string.js
There is also some spikes for
HashandNumRangeunits, but I'm not sure about their implementation yet, think it requires to have theEnumerablemodule first and then implement them properly using it.If you will work on them, plz, write tests ;)
-
Douwe M.
Okay, will do :)
-
Douwe M.
Okay, I added the String#truncate method and pushed it to GitHub (haven't pulled a request to get it to you yet).
I'm not sure what to do with the rest of the things I suggested, though. I could make most of those changes / add methods myself, but I'm not sure what should be in therightjs-corerepo, and what in therightjs-goodsrepo, and I don't know if you even want me messing with stuff in therightjs-corerepo... Anyways, I'd be happy to help you. -
MadRabbit
That's simple, all of them should be in goods.
The idea is following: the core contains only the strictly necessary methods, the ones that needed by 99% of cases, things like 'trim', 'startsWith', 'includes', and so one.
Case specific features like 'truncate', 'escapeHTML' and so one, will go in the
langplugin.I know it depends on a point of view and needs of every developer, but I think a good practice will be to add fancy methods to the plugin, and later, if there will be people asking, we always can easily move them to the core.
In any case having them in a plugin IMHO a good approach, coz it will be easy to switch them on and off during the custom build process, and then if you need just one method in your app, you always can simply copy it manually from the plugin.
Kinda like that.
-
Douwe M.
Well, I was actually talking about these:

(Nearly) All of which already are in
rightjs-core... -
MadRabbit
I see, haven't seen them yet. But think we can deal them one by one.
I'll go through them tonight
-
Douwe M.
K :) Hope I don't steal all your time by posting so many tickets ;)
-
MadRabbit
no problem at all. the more ideas the better
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.