New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpha sequence classname replacer utility #9

Merged
merged 5 commits into from Jun 4, 2013

Conversation

Projects
None yet
2 participants
@renoirb
Contributor

renoirb commented Mar 9, 2013

Replace occurences of *alfa in classNames following the NATO phonetic alphabet sequence

Sometimes we need to use a sequence of class names to customize styling

A recommendation is to abstract class names from their color or objective and use them in a sequential order, this helper does just that.

What is the phonetic alphabet?: http://en.wikipedia.org/wiki/NATO_phonetic_alphabet

for example:

 <div data-draft-repeat="3" class="myclass-alfa">
 <h1>Example node</h1>
 </div>

would give:

 <div class="myclass-alfa">
   <h1>Example node</h1>
 </div>
 <div class="myclass-bravo">
   <h1>Example node</h1>
 </div>
 <div class="myclass-charlie">
   <h1>Example node</h1>
 </div>
Show outdated Hide outdated jquery.roughdraft.0.1.3.js
alfa = {};
if(opt.alfaSequenceClassNamesReplacer === true){
alfa.words = ['alfa','bravo','charlie','delta','echo','foxtrot','golf','hotel','india','juliet','kilo','lima','mike','november','oscar','papa','quebec','romeo','sierra','tango','uniform','victor','xray','zulu'];

This comment has been minimized.

@ndreckshage

ndreckshage Mar 9, 2013

Owner

this should be added to the faker api and called via jsonp. i also think it needs to be more generic, and allow people to set an option of which class style they want to follow. atleast this + standard numbering of divs.

(disregard jsonp comment actually. but other numbering options would be great)

@ndreckshage

ndreckshage Mar 9, 2013

Owner

this should be added to the faker api and called via jsonp. i also think it needs to be more generic, and allow people to set an option of which class style they want to follow. atleast this + standard numbering of divs.

(disregard jsonp comment actually. but other numbering options would be great)

This comment has been minimized.

@renoirb

renoirb Mar 13, 2013

Contributor

Indeed. I was thinking to add it to the dictionary.

@renoirb

renoirb Mar 13, 2013

Contributor

Indeed. I was thinking to add it to the dictionary.

This comment has been minimized.

@ndreckshage

ndreckshage Mar 13, 2013

Owner

well this can probably stay in js, would be unnecessary to do additional json request for it

@ndreckshage

ndreckshage Mar 13, 2013

Owner

well this can probably stay in js, would be unnecessary to do additional json request for it

Show outdated Hide outdated jquery.roughdraft.0.1.3.js
var newClassNames = s.replace('alfa', w);
jQ(this).attr('class', newClassNames);
});
})(jQuery);

This comment has been minimized.

@ndreckshage

ndreckshage Mar 9, 2013

Owner

this is a drastically different style than the rest of the document and should be rewritten to match coding conventions

@ndreckshage

ndreckshage Mar 9, 2013

Owner

this is a drastically different style than the rest of the document and should be rewritten to match coding conventions

Show outdated Hide outdated jquery.roughdraft.0.1.3.js
});
})(jQuery);
setTimeout(alfa.init, 200);

This comment has been minimized.

@ndreckshage

ndreckshage Mar 9, 2013

Owner

why are we calling this with a timeout

@ndreckshage

ndreckshage Mar 9, 2013

Owner

why are we calling this with a timeout

This comment has been minimized.

@renoirb

renoirb Mar 13, 2013

Contributor

I agree, I removed it. Will be in my upcoming edit to the pull request

@renoirb

renoirb Mar 13, 2013

Contributor

I agree, I removed it. Will be in my upcoming edit to the pull request

@ndreckshage

This comment has been minimized.

Show comment
Hide comment
@ndreckshage

ndreckshage Mar 9, 2013

Owner

i like the idea but i think it needs some work. it does not follow the conventions of the rest of the plugin. i think it could be expanded upon to allow for more options (with generic numbering/lettering). and there needs to be comments throughout so other users can understand what is happening

Owner

ndreckshage commented Mar 9, 2013

i like the idea but i think it needs some work. it does not follow the conventions of the rest of the plugin. i think it could be expanded upon to allow for more options (with generic numbering/lettering). and there needs to be comments throughout so other users can understand what is happening

@renoirb

This comment has been minimized.

Show comment
Hide comment
@renoirb

renoirb Mar 13, 2013

Contributor

Ok.

I agree, I will re-work to follow the conventions, thank you for the review.

As for the other known issues:
The intended use-case is to seek all instances of .whatever-alfa and rename following the sequence but only contained within it's parent.

The current (faulty) behavior is to read ALL alfa, and it should also be fixed.

Contributor

renoirb commented Mar 13, 2013

Ok.

I agree, I will re-work to follow the conventions, thank you for the review.

As for the other known issues:
The intended use-case is to seek all instances of .whatever-alfa and rename following the sequence but only contained within it's parent.

The current (faulty) behavior is to read ALL alfa, and it should also be fixed.

@renoirb

This comment has been minimized.

Show comment
Hide comment
@renoirb

renoirb Mar 16, 2013

Owner

Sorry for that.

That's why it was complaining. I'll fix that by next push :(

Owner

renoirb commented on jquery.roughdraft.0.1.3.js in 4fc9e50 Mar 16, 2013

Sorry for that.

That's why it was complaining. I'll fix that by next push :(

Merge remote-tracking branch 'upstream/master'
* upstream/master:
  Update README.md
  couple lorempixel adjustments
  missing semicolon
  Basic lorempixel support
  Ignoring VIM configuration and swap files.
@renoirb

This comment has been minimized.

Show comment
Hide comment
@renoirb

renoirb Jun 3, 2013

Contributor

Hello @ndreckshage. Could you give me some feedback whether you want me to go deeper with this pull request code?

Contributor

renoirb commented Jun 3, 2013

Hello @ndreckshage. Could you give me some feedback whether you want me to go deeper with this pull request code?

ndreckshage added a commit that referenced this pull request Jun 4, 2013

Merge pull request #9 from renoirb/master
Alpha sequence classname replacer utility

@ndreckshage ndreckshage merged commit d77b011 into ndreckshage:master Jun 4, 2013

@ndreckshage

This comment has been minimized.

Show comment
Hide comment
@ndreckshage

ndreckshage Jun 4, 2013

Owner

nope, this is cool, nice work. thanks for the mention, forgot about it. and thanks for contribution

Owner

ndreckshage commented Jun 4, 2013

nope, this is cool, nice work. thanks for the mention, forgot about it. and thanks for contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment