[PP-dev] Proposal for core changes

1 view
Skip to first unread message

Dean Sofer

unread,
Nov 16, 2008, 10:20:33 PM11/16/08
to projectpier...@lists.sourceforge.net
Hello, my name's DJ and I just got PP last week, and as I'm slightly ocd about organization I think it's gonna be a decent part of my life. This is my first time working os and contributing and hope that I don't come off as a brash young pup who doesn't know what he's talking about. Anywho the changes I think should be implemented that I feel if I do some of the heavy work it'll make it easier for you guys to accept and implement the symptoms.

- Conversion to JQuery
- Removal of Inline Images & Javascript
- Naming Conventions
- Some Dom Heirarchy changes (might just be relevent for a few features).=

I think an example of the change would explain it the fastest:
(someone wanted a droplist in the userbox to appear on hover, requiring hacking patches that break other themes)


    5 <?php if (isset($_userbox_projects) && is_array($_userbox_projects) && count($_userbox_projects)) { ?>
    6     <li><a href="<?php echo get_url('dashboard', 'my_projects') ?>"><?php echo lang('projects') ?></a> <?php echo render_icon('bullet_drop_down.gif', '', array('id' => 'projects_more_icon', 'class' => 'PopupMenuWidgetAttachTo', 'title' => lang('enable javascript'))) ?></li>
    7 <?php } // if ?>

   31 <?php if (isset($_userbox_projects) && is_array($_userbox_projects) && count($_userbox_projects)) { ?>
   32   <div class="PopupMenuWidgetDiv" id="projects_more_menu">
   33     <p><?php echo lang('projects') ?>:</p>
   34     <ul>
   35 <?php foreach ($_userbox_projects as $_userbox_project) { ?>
   36       <li><a href="<?php echo $_userbox_project->getOverviewUrl() ?>"><?php echo clean($_userbox_project->getName()) ?></a></li>
   37 <?php } // if ?>
   38     </ul>
   39   </div>
   40   <script type="text/javascript">
   41     var projects_drop_down = new App.widgets.UserBoxMenu('projects_more_icon', 'projects_more_menu');
   42     projects_drop_down.build();
   43   </script>
   44 <?php } // if ?>

Should become:
<ul class="dropmenu">
<?php if (isset($_userbox_projects) && is_array($_userbox_projects) && count($_userbox_projects)) { ?>
   <li><a href="<?php echo get_url('dashboard', 'my_projects') ?>"><?php echo lang('projects') ?></a><ul>
      <?php foreach ($_userbox_projects as $_userbox_project) { ?>
         <li><a href="<?php echo $_userbox_project->getOverviewUrl() ?>"><?php echo clean($_userbox_project->getName()) ?></a></li>
      <?php } // if ?>
   </ul></li>
<?php } // if ?>
</ul>

Add in the 1 simple line of jquery:

$('ul.dropmenu li:hover ul').show();

and the css selector for themers:
ul.dropmenu li {position:relative;background:src('bullet_drop_down.gi') right no-repeat;}
ul.dropmenu li ul {display:none;position:absolute;top:100%;}

And I have now done this special effect not only here, but to ANYTHING you feel you want a droplist for. Need the js feature? just apply the class. In addition the new heirarchy allows selection of the related droplist via css to be much easier. People don't have to grab the id of EVERY droplist and parent item for js and css, they just know what conventions are used. Pictures are no longer hardcoded allowing skinners to simply change the path to an image in their own theme. JS effects can be applied to anything for themers using css selection, of course all those using jquery know this, but by sticking to the standardized naming conventions we can build a core js library that allows people developing plugins/patches to utilize easily. Want a droplist effect? class="js-droplist". We can create .js-hidetoggle .js-calendar .js-wysiwyg (or just apply it to textareas allover!). If we locate layout of images to a css file and let people add their own js files you have a massive amount of control, a great reduction hard-coded styling/features and future brilliant ease of application.

I haven't checked much source code and am thinking this may be treated as 2 transitions (applying all effects to current elements in jquery, then adding the classes/dom changes to utilize our premade conventions) but hopefully if the code is already like this let me down easy, lol.

Oh ya, so to make a transition I volunteer with any help welcome to convert to js there are just some things I'd need:
- help figuring out all current used js functions/features so we know what needs to be built
- a new theme utilizing the new naming convention (to help relay new changes)
and possibly other tidbits. I can do both but any little or massive assistance I can recieve would be appreciative. I'm hoping some of the theme/plugin designers who see this update as a means to acheive what they've vied for more rapidly would be inclined to work with me so I don't have to spend forever debugging browser inconsistencies in css or figuring out what js functions are most common or even the possibility of adding the naming conventions now.

I think it's way easier than it sounds, once we support all current js functionality since the new content would be in seperate js or css files and would only involve cleaning/updating the core files.

Ryan McCue

unread,
Nov 17, 2008, 3:18:54 AM11/17/08
to projectpier...@lists.sourceforge.net
I'm also working on converting PP to jQuery, just need to get some time
and find my patches which I never uploaded.
I'll see if I can find them this week.

--
Ryan McCue
<http://cubegames.net/>


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Projectpier-development mailing list
Projectpier...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/projectpier-development

Reply all
Reply to author
Forward
0 new messages