CVS edit link for atrasatti

I have created a new theme for mobile devices based on official Nokia templates that will work for basic devices and high-end devices with different styles and enhancement.

The theme has been designed to integrate with an existing module called Mobile Plugin, already hosted on drupal.org ( http://drupal.org/node/458912 ). While it was designed specifically for that plugin with minor changes will work with any simple Drupal install.

The plan is of course to continue working on it and making it more and more powerful.

The theme will work with Drupal 6 including integrations with color module and other simple tweaks for site owners to customise the appearance of their site.

Comments

atrasatti’s picture

StatusFileSize
new82.62 KB

See attached a preview version of the theme that I am working on.

avpaderno’s picture

I don't know what you mean by preview, but Apply for contributions CVS access reports that

Many people write good motivation messages and then mess it up right at the end with "here's a link to my contribution, it's about 75% done". Please, when applying for a CVS account supply a link to your contribution that you believe is complete. Attempting to review uncompleted work is difficult and time consuming (yes, remove all those dpr() and self reminder comments ;) Reviewing completed work is much simpler as there is already a level of expectation in the reviewer. Try to make our job of reviewing your work a joy.

atrasatti’s picture

By preview I mean that this is 99% done. Call it beta, if you want. It's feature complete, it works and there are no print_r or stuff like that.

What I want to do is put it up on CVS, link it to people, show it, seek for feedback and fix any issues that are found. That's what I mean by "preview".

atrasatti’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new83.27 KB

One minor fix to the load of a CSS file and filled in the README.txt for install instructions.

avpaderno’s picture

Status: Needs review » Needs work
  1. 		<script type="text/javascript" src="../resources/scripts/templates.js" />
    		<script type="text/javascript">
    			function init() {
    				var myStyleTweaks = new StyleTweaker();
    				myStyleTweaks.add("Series60/5.0", "../resources/styles/tweaks/S605th.css");
    				myStyleTweaks.add("Series60/3.2", "../resources/styles/tweaks/S603rdFP2.css");
    				myStyleTweaks.add("AppleWebKit/420+", "../resources/styles/tweaks/S406th.css");
    				myStyleTweaks.add("N900", "../resources/styles/tweaks/maemo.css");
    				myStyleTweaks.add("Firefox/3.0a1 Tablet browser 0.3.7", "../resources/styles/tweaks/maemo.css");
    				myStyleTweaks.add("Opera Mini/4", "../resources/styles/tweaks/operamini.css");
    				myStyleTweaks.tweak();
    			}
    			addEvent("onload",init);
    		</script>
    

    There is the function drupal_add_js(), but in this case you can declare the JavaScript files used by the theme into its .info file.
    It is better to always include JavaScript code from a file, when the code is more than 1 line of code.

  2. The file LICENSE.txt needs to be removed; Drupal.org CVS doesn't allow to commit that file.
  3. Files available from third-party sites should not be included in Drupal.org CVS.
  4. 	<title><?php print $head_title ?></title>
    

    Always use the line terminator; the line should be written as <?php print $head_title; ?>.

atrasatti’s picture

Status: Needs work » Needs review
StatusFileSize
new75.77 KB

The reason for 1 is that the javascript actually checks the User-Agent string and loads ONLY the js that is appropriate for the requesting client.
I fixed 2 and 4.
I don't understand what you refer to in point 3.

See the new file attached, I should have covered all points except for 3, of course.

avpaderno’s picture

Status: Needs review » Needs work
  1. /*!
     * Nokia Mobile Web Templates v0.5
     * http://forumnokia.com
     *
     * Copyright (c) 2009 Forum Nokia
     *
     */
    

    I think that file can be downloaded from http://forumnokia.com; the file then doesn't report the license, which could be not compatible with the license applied to all the files committed in CVS.

  2. 				<?php
    				$logo = file_create_path($_SERVER['DOCUMENT_ROOT'].$logo);
    				if ($logo && !is_null($logo) && is_file($logo)) {
    					print '<a id="sitelogo" title="' . $site_slogan . '" href="' . check_url($front_page) . '"><img src="'. check_url($logo) .'" /></a>';
    				}
    

    The code is not respecting the settings for the logo set for the theme.

  3. 		<script type="text/javascript">
    			function init() {
    				var myAccordionList = new AccordionList("accordion");
    				var myStyleTweaks = new StyleTweaker();
    				myStyleTweaks.add("Series60/5.0", "'.$tweaks_path.'S605th.css");
    				myStyleTweaks.add("Series60/3.2", "'.$tweaks_path.'S603rdFP2.css");
    				myStyleTweaks.add("AppleWebKit/420+", "'.$tweaks_path.'S406th.css");
    				myStyleTweaks.add("N900", "'.$tweaks_path.'maemo.css");
    				myStyleTweaks.add("Firefox/3.0a1 Tablet browser 0.3.7", "'.$tweaks_path.'maemo.css");
    				myStyleTweaks.add("Opera Mini/4", "'.$tweaks_path.'operamini.css");
    				myStyleTweaks.tweak();
    			}
    			addEvent("onload",init);
    		</script>
    

    What is the difference between executing the code inline as it is, and including the JavaScript code with

    ? I guess it would do the same thing in both the cases. Drupal output is XHTML, which means a script cannot be added using the HTML tag you used. If you notice how Drupal includes inline JavaScript, you will notice that the XHTML code is a little different.
  4. 		$vars['styles'] = _mobileplugin_filter_css($vars['css']);
    		$vars['scripts'] = _mobileplugin_filter_js();
    		$vars['bodyclasses'] = 'mobile' . _mobileplugin_add_class();
    		$scaled_logo = _mobileplugin_image_scaled($vars['logo'], 30, 30);
    		if (!is_array($scaled_logo)) {
    			$vars['logo'] = $scaled_logo;
    		}
    
    As themes cannot report their dependency from a module, the code should first verify if that module is enabled, before to call those functions.
  5. 	if ($device_class === false) {
    		$nokia_detection = theme_get_setting('nokia_mobile_native');
    		if ($nokia_detection) {
    			$device_class = _nokia_mobile_device_detection();
    		} else {
    			// Use the global variable set by mobileplugin_init()
    			global $mobileplugin_group;
    			$device_class = $mobileplugin_group;
    		}
    	}
    
    See the Drupal coding standards to understand how a module code should be written. In particular see how the code should be formatted, and how constant names are written.
atrasatti’s picture

Status: Needs work » Needs review
StatusFileSize
new77.62 KB

1. The project is sponsored by Nokia and one of their requirements is that the final product would be open source. They are more than happy with GPL if that is what is required to be available on drupal.org. In any case, if you check the templates ( http://www.forum.nokia.com/Technology_Topics/Web_Technologies/Browsing/W... ) you will see that the licence file says:

·  Use, copy, modify and/or merge copies of this software and
   associated documentation files (the Software)

·  Publish, distribute, sub-license and/or sell new software
   derived from or incorporating the Software.

The reason why I have to include the file is that on Forum Nokia they are provided as a zip file that contains many sample files. My javascript will be changed over time and eventually might not be the same thing as the original template provided.

2. changed the checks on the logo and verified that the preferences are respected.

3. changed the inline script to use drupal_add_js().

4. at line 37, WAY before your code snippet there is a check if the module is installed:

if (module_exists('mobileplugin')) {

5. My theme only has 4 constants, defined at the top of template.php and they seem to respect the coding standard, i.e. NOKIAMOBILE_THEME_HIGHEND_GROUP. I changed all tabs to two spaces.

avpaderno’s picture

Status: Needs review » Needs work

What I reported about files available from third-party sites is still valid.
On the coding standards, TRUE, FALSE, and NULL are considered constants, and they should be written in upper case letter, independently from the fact PHP is not case sensitive.

atrasatti’s picture

Status: Needs work » Needs review

Fair enough, I thought you meant the constants that I defined in my module.

So your requirement about the javascript is that I completely remove it from the package and provide a link to the Forum Nokia site for download. Users will have to download the package, extract the javascript and place it in the right directory.
I can try and do this, but in my opinion, 95% of the users if not more will not be able to complete the process, not even with a step-by-step guide. This means killing any possibility of success of this theme. Or, make it available on a different site from Drupal which means diminishing the visibility. It seems to be counterproductive in either case.

Should I re-write the javascript in order to be able to provide it as part of the package? This doesn't seem to be the most productive way, but if it's the only way, I will consider it.

avpaderno’s picture

Status: Needs review » Needs work

Considering that there are projects in CVS as jQuery UI, which doesn't commit in CVS files taken from another project, I would think that avoiding to commit in CVS files available from third-party site is possible.

atrasatti’s picture

Status: Needs work » Needs review
StatusFileSize
new78.95 KB

Here comes a new version. All true and false strings are now uppercase, I removed the incriminated javascript and added instructions on how to download it and put it in the right place.

Is it now OK to go on CVS?

atrasatti’s picture

Priority: Normal » Critical

A live example is also visible here: http://dtest.dreamhosters.com

atrasatti’s picture

Status: Needs review » Active

What do I have to do to get this approved?

avpaderno’s picture

Status: Active » Needs review
avpaderno’s picture

Priority: Critical » Normal
Status: Needs review » Fixed

Remember that the default values for the theme settings are written in the .info file.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

avpaderno’s picture

Component: Miscellaneous » new project application
Assigned: Unassigned » avpaderno
Issue summary: View changes
Status: Closed (fixed) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.