[Tts-dev-commits] r64 - / zen-tts zen-tts/img
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Tue May 31 21:03:58 CEST 2011
Author: vjrj_
Date: 2011-05-31 21:03:58 +0200 (Tue, 31 May 2011)
New Revision: 64
Added:
zen-tts/img/
zen-tts/img/bocadillo-0.png
zen-tts/img/bocadillo-1.png
zen-tts/img/bocadillo-10.png
zen-tts/img/bocadillo-11.png
zen-tts/img/bocadillo-2.png
zen-tts/img/bocadillo-3.png
zen-tts/img/bocadillo-4.png
zen-tts/img/bocadillo-5.png
zen-tts/img/bocadillo-6.png
zen-tts/img/bocadillo-7.png
zen-tts/img/bocadillo-8.png
zen-tts/img/bocadillo-9.png
zen-tts/node-voice_map.tpl.php
zen-tts/node.tpl.php
zen-tts/voicemap.css
zen-tts/voicemap.js
Modified:
fabfile.py
zen-tts/template.php
Log:
voicemap into svn
Modified: fabfile.py
===================================================================
--- fabfile.py 2011-05-29 23:10:23 UTC (rev 63)
+++ fabfile.py 2011-05-31 19:03:58 UTC (rev 64)
@@ -1,11 +1,14 @@
from fabric.api import *
env.hosts = ['scm.ourproject.org']
-theme_path = '/home/groups/tts-dev/htdocs/sites/default/themes/zen-tts'
-res_path = '/home/groups/tts-dev/htdocs/res'
-images_path = '/home/groups/tts-dev/htdocs/images'
-home_path = '/home/groups/tts-dev/htdocs/home-photo'
+dev_prefix= '/home/groups/tts-dev/htdocs/'
+prod_prefix= '/var/www/takethesquare.net/htdocs/'
+theme_path = 'sites/default/themes/zen-tts'
+res_path = 'res'
+images_path = 'images'
+home_path = 'home-photo'
+
def commit():
"Similar to prepare_deploy"
prepare_deploy()
@@ -22,19 +25,26 @@
def change_log():
local("svn2cl -i -o ChangeLog")
-def svn_update():
+def svn_update_dev(prefix):
"Updates Tts-Dev website with the repository files."
- run("cd %s; svn up" % home_path)
- run("cd %s; svn up" % res_path)
- run("cd %s; svn up" % images_path)
- run("cd %s; svn up" % theme_path)
- run("chgrp -R tts-dev %s" % res_path)
- run("chgrp -R tts-dev %s" % home_path)
- run("chgrp -R tts-dev %s" % images_path)
- run("chgrp -R tts-dev %s" % theme_path)
+ run("cd %s%s; svn up" % (prefix, home_path))
+ run("cd %s%s; svn up" % (prefix, res_path))
+ run("cd %s%s; svn up" % (prefix, images_path))
+ run("cd %s%s; svn up" % (prefix, theme_path))
+ run("chgrp -R tts-dev %s%s" % (prefix, res_path))
+ run("chgrp -R tts-dev %s%s" % (prefix, home_path))
+ run("chgrp -R tts-dev %s%s" % (prefix, images_path))
+ run("chgrp -R tts-dev %s%s" % (prefix, theme_path))
def deploy():
run('echo Deploying with user: "%(user)s"' % env)
change_log()
+ prepare_deploy(prefix_dev)
+ svn_update_dev()
+
+def deployprod():
+ run('echo Deploying with user: "%(user)s"' % env)
+ change_log()
prepare_deploy()
- svn_update()
+ svn_update_dev(prefix_prod)
+
Added: zen-tts/img/bocadillo-0.png
===================================================================
(Binary files differ)
Property changes on: zen-tts/img/bocadillo-0.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: zen-tts/img/bocadillo-1.png
===================================================================
(Binary files differ)
Property changes on: zen-tts/img/bocadillo-1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: zen-tts/img/bocadillo-10.png
===================================================================
(Binary files differ)
Property changes on: zen-tts/img/bocadillo-10.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: zen-tts/img/bocadillo-11.png
===================================================================
(Binary files differ)
Property changes on: zen-tts/img/bocadillo-11.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: zen-tts/img/bocadillo-2.png
===================================================================
(Binary files differ)
Property changes on: zen-tts/img/bocadillo-2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: zen-tts/img/bocadillo-3.png
===================================================================
(Binary files differ)
Property changes on: zen-tts/img/bocadillo-3.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: zen-tts/img/bocadillo-4.png
===================================================================
(Binary files differ)
Property changes on: zen-tts/img/bocadillo-4.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: zen-tts/img/bocadillo-5.png
===================================================================
(Binary files differ)
Property changes on: zen-tts/img/bocadillo-5.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: zen-tts/img/bocadillo-6.png
===================================================================
(Binary files differ)
Property changes on: zen-tts/img/bocadillo-6.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: zen-tts/img/bocadillo-7.png
===================================================================
(Binary files differ)
Property changes on: zen-tts/img/bocadillo-7.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: zen-tts/img/bocadillo-8.png
===================================================================
(Binary files differ)
Property changes on: zen-tts/img/bocadillo-8.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: zen-tts/img/bocadillo-9.png
===================================================================
(Binary files differ)
Property changes on: zen-tts/img/bocadillo-9.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: zen-tts/node-voice_map.tpl.php
===================================================================
--- zen-tts/node-voice_map.tpl.php (rev 0)
+++ zen-tts/node-voice_map.tpl.php 2011-05-31 19:03:58 UTC (rev 64)
@@ -0,0 +1,110 @@
+<?php
+/**
+ * @file
+ * Theme implementation to display a node.
+ *
+ * Available variables:
+ * - $title: the (sanitized) title of the node.
+ * - $content: Node body or teaser depending on $teaser flag.
+ * - $user_picture: The node author's picture from user-picture.tpl.php.
+ * - $date: Formatted creation date. Preprocess functions can reformat it by
+ * calling format_date() with the desired parameters on the $created variable.
+ * - $name: Themed username of node author output from theme_username().
+ * - $node_url: Direct url of the current node.
+ * - $terms: the themed list of taxonomy term links output from theme_links().
+ * - $display_submitted: whether submission information should be displayed.
+ * - $submitted: Themed submission information output from
+ * theme_node_submitted().
+ * - $links: Themed links like "Read more", "Add new comment", etc. output
+ * from theme_links().
+ * - $classes: String of classes that can be used to style contextually through
+ * CSS. It can be manipulated through the variable $classes_array from
+ * preprocess functions. The default values can be one or more of the
+ * following:
+ * - node: The current template type, i.e., "theming hook".
+ * - node-[type]: The current node type. For example, if the node is a
+ * "Blog entry" it would result in "node-blog". Note that the machine
+ * name will often be in a short form of the human readable label.
+ * - node-teaser: Nodes in teaser form.
+ * - node-preview: Nodes in preview mode.
+ * The following are controlled through the node publishing options.
+ * - node-promoted: Nodes promoted to the front page.
+ * - node-sticky: Nodes ordered above other non-sticky nodes in teaser
+ * listings.
+ * - node-unpublished: Unpublished nodes visible only to administrators.
+ * The following applies only to viewers who are registered users:
+ * - node-by-viewer: Node is authored by the user currently viewing the page.
+ *
+ * Other variables:
+ * - $node: Full node object. Contains data that may not be safe.
+ * - $type: Node type, i.e. story, page, blog, etc.
+ * - $comment_count: Number of comments attached to the node.
+ * - $uid: User ID of the node author.
+ * - $created: Time the node was published formatted in Unix timestamp.
+ * - $classes_array: Array of html class attribute values. It is flattened
+ * into a string within the variable $classes.
+ * - $zebra: Outputs either "even" or "odd". Useful for zebra striping in
+ * teaser listings.
+ * - $id: Position of the node. Increments each time it's output.
+ *
+ * Node status variables:
+ * - $build_mode: Build mode, e.g. 'full', 'teaser'...
+ * - $teaser: Flag for the teaser state (shortcut for $build_mode == 'teaser').
+ * - $page: Flag for the full page state.
+ * - $promote: Flag for front page promotion state.
+ * - $sticky: Flags for sticky post setting.
+ * - $status: Flag for published status.
+ * - $comment: State of comment settings for the node.
+ * - $readmore: Flags true if the teaser content of the node cannot hold the
+ * main body content.
+ * - $is_front: Flags true when presented in the front page.
+ * - $logged_in: Flags true when the current user is a logged-in member.
+ * - $is_admin: Flags true when the current user is an administrator.
+ *
+ * The following variable is deprecated and will be removed in Drupal 7:
+ * - $picture: This variable has been renamed $user_picture in Drupal 7.
+ *
+ * @see template_preprocess()
+ * @see template_preprocess_node()
+ * @see zen_preprocess()
+ * @see zen_preprocess_node()
+ * @see zen_process()
+ */
+// dpm(get_defined_vars());
+?>
+<div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix">
+ <?php if (!$page && $title): ?>
+ <h2 class="title"><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
+ <?php endif; ?>
+
+ <?php if ($unpublished): ?>
+ <div class="unpublished"><?php print t('Unpublished'); ?></div>
+ <?php endif; ?>
+
+ <?php if ($display_submitted || $terms): ?>
+ <div class="meta">
+ <?php if ($terms): ?>
+ <div class="terms terms-inline"><?php print $terms; ?></div>
+ <?php endif; ?>
+ </div>
+ <?php endif; ?>
+
+ <div class="content voicemap">
+ <div style="background-image: url(/<?php print $field_background_img[0]['filepath'];?>);" id="imagen" />
+ <div class="voice-wrapper">
+ <?php foreach ($voicemap as $order_id => $data):?>
+ <div id="text<?php print $order_id;?>" class="novisible">
+ <?php print $data ['text'];?>
+ </div>
+ <?php endforeach;?>
+ </div> <!-- voice-wrapper-->
+ <?php foreach ($voicemap as $order_id => $data):?>
+ <div class="bubble <?php if ($order_id == 0) { print 'first';}?>" id="button<?php print $order_id;?>" style="top: <?php print $data['posx'];?>px;left:<?php print $data['posy'];?>px">
+ <img class="buble-img" id="pin<?php print $order_id;?>" src="/sites/default/themes/zen-tts/img/bocadillo-<?php print $order_id;?>.png"/>
+ </div>
+ <?php endforeach;?>
+ </div> <!-- imagen -->
+ </div><!-- voicemap -->
+
+ <?php print $links; ?>
+</div><!-- /.node -->
Added: zen-tts/node.tpl.php
===================================================================
--- zen-tts/node.tpl.php (rev 0)
+++ zen-tts/node.tpl.php 2011-05-31 19:03:58 UTC (rev 64)
@@ -0,0 +1,104 @@
+<?php
+/**
+ * @file
+ * Theme implementation to display a node.
+ *
+ * Available variables:
+ * - $title: the (sanitized) title of the node.
+ * - $content: Node body or teaser depending on $teaser flag.
+ * - $user_picture: The node author's picture from user-picture.tpl.php.
+ * - $date: Formatted creation date. Preprocess functions can reformat it by
+ * calling format_date() with the desired parameters on the $created variable.
+ * - $name: Themed username of node author output from theme_username().
+ * - $node_url: Direct url of the current node.
+ * - $terms: the themed list of taxonomy term links output from theme_links().
+ * - $display_submitted: whether submission information should be displayed.
+ * - $submitted: Themed submission information output from
+ * theme_node_submitted().
+ * - $links: Themed links like "Read more", "Add new comment", etc. output
+ * from theme_links().
+ * - $classes: String of classes that can be used to style contextually through
+ * CSS. It can be manipulated through the variable $classes_array from
+ * preprocess functions. The default values can be one or more of the
+ * following:
+ * - node: The current template type, i.e., "theming hook".
+ * - node-[type]: The current node type. For example, if the node is a
+ * "Blog entry" it would result in "node-blog". Note that the machine
+ * name will often be in a short form of the human readable label.
+ * - node-teaser: Nodes in teaser form.
+ * - node-preview: Nodes in preview mode.
+ * The following are controlled through the node publishing options.
+ * - node-promoted: Nodes promoted to the front page.
+ * - node-sticky: Nodes ordered above other non-sticky nodes in teaser
+ * listings.
+ * - node-unpublished: Unpublished nodes visible only to administrators.
+ * The following applies only to viewers who are registered users:
+ * - node-by-viewer: Node is authored by the user currently viewing the page.
+ *
+ * Other variables:
+ * - $node: Full node object. Contains data that may not be safe.
+ * - $type: Node type, i.e. story, page, blog, etc.
+ * - $comment_count: Number of comments attached to the node.
+ * - $uid: User ID of the node author.
+ * - $created: Time the node was published formatted in Unix timestamp.
+ * - $classes_array: Array of html class attribute values. It is flattened
+ * into a string within the variable $classes.
+ * - $zebra: Outputs either "even" or "odd". Useful for zebra striping in
+ * teaser listings.
+ * - $id: Position of the node. Increments each time it's output.
+ *
+ * Node status variables:
+ * - $build_mode: Build mode, e.g. 'full', 'teaser'...
+ * - $teaser: Flag for the teaser state (shortcut for $build_mode == 'teaser').
+ * - $page: Flag for the full page state.
+ * - $promote: Flag for front page promotion state.
+ * - $sticky: Flags for sticky post setting.
+ * - $status: Flag for published status.
+ * - $comment: State of comment settings for the node.
+ * - $readmore: Flags true if the teaser content of the node cannot hold the
+ * main body content.
+ * - $is_front: Flags true when presented in the front page.
+ * - $logged_in: Flags true when the current user is a logged-in member.
+ * - $is_admin: Flags true when the current user is an administrator.
+ *
+ * The following variable is deprecated and will be removed in Drupal 7:
+ * - $picture: This variable has been renamed $user_picture in Drupal 7.
+ *
+ * @see template_preprocess()
+ * @see template_preprocess_node()
+ * @see zen_preprocess()
+ * @see zen_preprocess_node()
+ * @see zen_process()
+ */
+?>
+<div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix">
+ <?php print $user_picture; ?>
+
+ <?php if (!$page && $title): ?>
+ <h2 class="title"><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
+ <?php endif; ?>
+
+ <?php if ($unpublished): ?>
+ <div class="unpublished"><?php print t('Unpublished'); ?></div>
+ <?php endif; ?>
+
+ <?php if ($display_submitted || $terms): ?>
+ <div class="meta">
+ <?php if ($display_submitted): ?>
+ <span class="submitted">
+ <?php print $submitted; ?>
+ </span>
+ <?php endif; ?>
+
+ <?php if ($terms): ?>
+ <div class="terms terms-inline"><?php print $terms; ?></div>
+ <?php endif; ?>
+ </div>
+ <?php endif; ?>
+
+ <div class="content">
+ <?php print $content; ?>
+ </div>
+
+ <?php print $links; ?>
+</div><!-- /.node -->
Modified: zen-tts/template.php
===================================================================
--- zen-tts/template.php 2011-05-29 23:10:23 UTC (rev 63)
+++ zen-tts/template.php 2011-05-31 19:03:58 UTC (rev 64)
@@ -113,9 +113,7 @@
* @param $hook
* The name of the template being rendered ("node" in this case.)
*/
-/* -- Delete this line if you want to use this function
function tts_preprocess_node(&$vars, $hook) {
- $vars['sample_variable'] = t('Lorem ipsum.');
// Optionally, run node-type-specific preprocess functions, like
// tts_preprocess_node_page() or tts_preprocess_node_story().
@@ -124,8 +122,80 @@
$function($vars, $hook);
}
}
-// */
+
+
+function tts_preprocess_node_voice_map(&$vars, $hook) {
+
+ drupal_add_css(drupal_get_path('theme', 'tts') .'/voicemap.css');
+ drupal_add_js(drupal_get_path('theme', 'tts') .'/voicemap.js');
+
+
+ $voicemap_constants = array(
+ 0 => array(
+ 'posx' => 275,
+ 'posy' => 388,
+ ),
+ 1 => array(
+ 'posx' => 240,
+ 'posy' => 336,
+ ),
+ 2 => array(
+ 'posx' => 200,
+ 'posy' => 401,
+ ),
+ 3 => array(
+ 'posx' => 185,
+ 'posy' => 287,
+ ),
+ 4 => array(
+ 'posx' => 226,
+ 'posy' => 166,
+ ),
+ 5 => array(
+ 'posx' => 302,
+ 'posy' => 131,
+ ),
+ 6 => array(
+ 'posx' => 340,
+ 'posy' => 231,
+ ),
+ 7 => array(
+ 'posx' => 333,
+ 'posy' => 342,
+ ),
+ 8 => array(
+ 'posx' => 413,
+ 'posy' => 170,
+ ),
+ 9 => array(
+ 'posx' => 408,
+ 'posy' => 335,
+ ),
+ 10 => array(
+ 'posx' => 321,
+ 'posy' => 449,
+ ),
+ 11 => array(
+ 'posx' => 389,
+ 'posy' => 505,
+ ),
+
+ );
+
+// dpm($voicemap_constants);
+
+ $vars['voicemap'] = array();
+ foreach ($vars['field_voice_text'] as $order_id => $text) {
+ $vars['voicemap'][$order_id] = array();
+ $vars['voicemap'][$order_id]['posx'] = $voicemap_constants[$order_id]['posx'];
+ $vars['voicemap'][$order_id]['posy'] = $voicemap_constants[$order_id]['posy'];
+ $vars['voicemap'][$order_id]['text'] = $text['view'];
+
+ }
+
+}
+
/**
* Override or insert variables into the comment templates.
*
Added: zen-tts/voicemap.css
===================================================================
--- zen-tts/voicemap.css (rev 0)
+++ zen-tts/voicemap.css 2011-05-31 19:03:58 UTC (rev 64)
@@ -0,0 +1,62 @@
+.voicemap {
+ position:relative;
+}
+
+
+.voicemap .bubble {
+ cursor: pointer;
+ position:absolute;
+ width: 50px;
+ display: none;
+}
+
+.voicemap .bubble.first {
+ display: block;
+}
+
+.voicemap .bubble-img {
+ cursor: pointer;
+ position:absolute
+}
+
+.voicemap .voice-wrapper {
+ cursor: pointer;
+ position:relative;
+ top:0px;
+ left:0px;
+ z-index: 10;
+ color: #fff;
+}
+
+.voicemap .voice-wrapper p {
+ margin: 0;
+ color: #fff;
+}
+
+
+#imagen {
+ margin: 0px auto 0px -10px;
+ padding: 0;
+ border: none;
+ width: 711px;
+ height: 476px;
+ max-height: 476px;
+}
+.novisible {
+ display:none;
+ background:#99478a;
+ position:absolute;
+ color: white;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 14px;
+ top:0px;
+ border: none;
+ /* font-weight: bold; */
+ margin: 0px auto;
+ color: #FFF;
+ padding: 10px;
+ filter:alpha(opacity=70);
+ -moz-opcity: 0.7;
+ opacity: 0.7;
+ text-align: justify;
+}
\ No newline at end of file
Added: zen-tts/voicemap.js
===================================================================
--- zen-tts/voicemap.js (rev 0)
+++ zen-tts/voicemap.js 2011-05-31 19:03:58 UTC (rev 64)
@@ -0,0 +1,36 @@
+Drupal.behaviors.voicemap = function(context) {
+
+ // JS Code for the voice map, from calamar original idea.
+
+ function show_button(id) {
+ $('#button' + id).fadeIn('slow');
+ }
+
+ function show_text(id) {
+ $('.voice-text').stop(true, true).slideUp('normal');
+ $('#text' + id).slideDown('slow');
+ }
+
+
+ function hide_text(id) {
+ $('#text' + id).slideUp('slow');
+ }
+
+
+
+ $('.buble-img').mouseover(function(e) {
+ var elem = $(this);
+ var id = parseInt(elem.attr('id').substr(3));
+ var next_id = id + 1;
+ show_button(next_id);
+ show_text(id);
+ });
+
+ $('.buble-img').mouseout(function(e) {
+ var elem = $(this);
+ var id = parseInt(elem.attr('id').substr(3));
+ hide_text(id);
+ elem.fadeTo('normal',0.6);
+ });
+
+}
\ No newline at end of file
More information about the Tts-dev-commits
mailing list