Thanks for cool module, Konstantin! :)
Another way to place vacancy for developer is JS console (https://cmd.fm/ or https://mail.yandex.ru/ as an example). It may be useful feature for Source Ad.

Comments

Konstantin Komelin’s picture

Thanks Kate for the suggestion!

I can only imagine displaying some message through JS console.log() method. But I'm not sure that I totally understand your approach.

Could you please provide more details?

Thanks,
Konstantin

kalabro’s picture

Sure!
It can be done with console.log() and simple wrapper to check if this method is supported by client browser.

Konstantin Komelin’s picture

Nice, thanks! Will do it. or maybe you wanna help? ;)

Konstantin Komelin’s picture

Issue tags: +CodeSprintDSPB4
nikita petrov’s picture

Status: Active » Needs review
StatusFileSize
new6.2 KB

Check this patch please. I have used Consolelog script to show the ad in all browsers. It has GPL license, so i think it is ok for use it in our project, isn't it?

nikita petrov’s picture

p.s. is there a way to run dreditor BEFORE uploading a patch on drupal.org? "Code review" doesn't show me warnings on that patch, but dreditor does.

Konstantin Komelin’s picture

Hi Nikita,

Thank you for the patch.

Code Standards
First of all please configure your IDE properly to comply Drupal Coding Standards https://drupal.org/node/147789
Then please install the latest dev snapshot of Coder module and CodeSniffer library. Need assistance? Just ask for help.

Third-party code
When we include third-party code into our project we should keep in mind that we are responsible for the security of this code as well as our own code of this project.

So the right (but not always most convenient way for user) is to place third-party code outside of the project, i.e in sites/all/libraries.

Discuss with others before make meaningful changes
I suggest you discussing any strategic decisions before creating the patch in future.
"When we are unsure, we ask for help" https://drupal.org/dcoc

My suggestion
My opinion is that we shouldn't make installation procedure of such simple module more complex and additionally ask users to install third-party library.
However, I don't prefer third-party code inside the project due to security considerations.

What do you think about using original console.log function without third-party library. We could check for existence of this function instead and do nothing if it doesn't exist? I'm not a big fun of old browsers, especially IE.

Thanks,
Konstantin

Konstantin Komelin’s picture

Status: Needs review » Needs work
nikita petrov’s picture

Status: Needs work » Needs review
StatusFileSize
new3.37 KB

Here is the new patch.
I checked it by dev version of Coder module, there is one warning i don't know how to solve it:

source_ad_js_console.js
File: @file block missing (Drupal Docs) [comment_docblock_file]

Bu this file already contains:

/**
 * @file 
 * Adds ad to a javascript console.
 */
 

at the beginning of the file.
I find no examples for documenting @file docblock of javascript files. Furthermore - the module Coder review itself has a .js file and it isn't @file comment in it! It is very weird.
Please, check this patch again, feel free to post more admonitions if they are.

Konstantin Komelin’s picture

Status: Needs review » Fixed

Commited 2e6da26.
Thanks.

Konstantin Komelin’s picture

Status: Fixed » Closed (fixed)