Author: sevein
Date: Wed Apr 4 16:18:02 2012
New Revision: 11376
Log:
Simplification of main templates, move Dominion images to arArchivesCanadaPlugin
Added:
branches/2.0/js/dominion.js
- copied unchanged from r11369,
branches/2.0/plugins/qtDominionPlugin/js/dominion.js
branches/2.0/plugins/arArchivesCanadaPlugin/
branches/2.0/plugins/arArchivesCanadaPlugin/config/
branches/2.0/plugins/arArchivesCanadaPlugin/config/arArchivesCanadaConfiguration.class.php
branches/2.0/plugins/arArchivesCanadaPlugin/config/view.yml
branches/2.0/plugins/arArchivesCanadaPlugin/images/
- copied from r11369, branches/2.0/plugins/qtDominionPlugin/images/
Deleted:
branches/2.0/apps/qubit/templates/_footer.php
branches/2.0/apps/qubit/templates/_sidebar.php
branches/2.0/plugins/qtDominionPlugin/images/
branches/2.0/plugins/qtDominionPlugin/js/dominion.js
Modified:
branches/2.0/apps/qubit/config/view.yml
branches/2.0/apps/qubit/templates/_header.php
branches/2.0/apps/qubit/templates/layout.php
branches/2.0/plugins/qtDominionPlugin/config/qtDominionPluginConfiguration.class.php
branches/2.0/plugins/qtDominionPlugin/config/view.yml
Modified: branches/2.0/apps/qubit/config/view.yml
==============================================================================
--- branches/2.0/apps/qubit/config/view.yml Wed Apr 4 15:52:27 2012
(r11375)
+++ branches/2.0/apps/qubit/config/view.yml Wed Apr 4 16:18:02 2012
(r11376)
@@ -5,41 +5,28 @@
http_metas:
content-type: text/html
+ http_metas:
+ X-UA-Compatible: IE=edge
+
metas:
title: Qubit
description: Open information management toolkit
- # keywords: symfony, project
- # language: en
- # robots: index, follow
-
- stylesheets:
- /plugins/sfDrupalPlugin/vendor/drupal/modules/system/system: { media: all,
position: first }
- /plugins/sfDrupalPlugin/vendor/drupal/modules/system/system-behavior: {
media: all, position: first }
- /plugins/sfDrupalPlugin/vendor/drupal/modules/system/system-menus: {
media: all, position: first }
- /plugins/sfDrupalPlugin/vendor/drupal/themes/garland/style: { media: all,
position: first }
- /plugins/sfDrupalPlugin/vendor/drupal/themes/garland/print: { media:
print, position: first }
- /vendor/yui/button/assets/skins/sam/button: { position: first }
- /vendor/yui/menu/assets/skins/sam/menu: { position: first }
- form:
- graphic:
- main:
- print: { media: print, position: last }
+
+ # stylesheets:
javascripts:
/vendor/jquery:
/vendor/jquery.expander.js:
- /plugins/sfDrupalPlugin/vendor/drupal/misc/drupal:
- qubit:
- /vendor/yui/yahoo-dom-event/yahoo-dom-event:
- /vendor/yui/element/element-min:
- /vendor/yui/button/button-min:
- /vendor/yui/container/container_core-min:
- /vendor/yui/menu/menu-min:
+ /vendor/html5.js:
+ /vendor/bootstrap.js:
+ /vendor/jquery.textfill.js:
+ /vendor/chosen/chosen/chosen.jquery.min.js:
+ qubit: { position: last }
+ dominion: { position: last }
has_layout: true
layout: layout
components:
- footer: []
header: []
sidebar: []
Modified: branches/2.0/apps/qubit/templates/_header.php
==============================================================================
--- branches/2.0/apps/qubit/templates/_header.php Wed Apr 4 15:52:27
2012 (r11375)
+++ branches/2.0/apps/qubit/templates/_header.php Wed Apr 4 16:18:02
2012 (r11376)
@@ -37,7 +37,7 @@
<div class="row">
- <?php // Restore old snippet (settings: app_toggleLogo, app_toggleTitle,
app_toggleDescription, app_sitleTitle, app_sitleDescription)
+ <?php // Restore old snippet (settings: app_toggleLogo, app_toggleTitle,
app_toggleDescription, app_sitleTitle, app_sitleDescription) ?>
<div id="logo-and-name" class="span6">
<h1><?php echo link_to(image_tag('logo'), '@homepage', array('rel' =>
'home', 'title' => __('Home'))) ?></h1>
</div>
Modified: branches/2.0/apps/qubit/templates/layout.php
==============================================================================
--- branches/2.0/apps/qubit/templates/layout.php Wed Apr 4 15:52:27
2012 (r11375)
+++ branches/2.0/apps/qubit/templates/layout.php Wed Apr 4 16:18:02
2012 (r11376)
@@ -11,24 +11,30 @@
<body class="<?php echo $sf_context->getModuleName() ?> <?php echo
$sf_context->getActionName() ?>">
- <div id="update-check">
- <?php echo get_component('default', 'updateCheck') ?>
- </div>
-
- <div id="print-date">
- <?php echo __('Printed: %d%', array('%d%' => date('Y-m-d'))) ?>
- </div>
-
<?php echo get_partial('header') ?>
<div id="wrapper" class="container">
+ <?php echo $sf_content ?>
+
<?php // echo get_partial('sidebar') ?>
- <?php echo $sf_content ?>
+ </div>
+
+ <div id="footer">
+
+ <?php if (QubitAcl::check('userInterface', 'translate')): ?>
+ <?php echo get_component('sfTranslatePlugin', 'translate') ?>
+ <?php endif; ?>
+
+ </div>
- <?php echo get_partial('footer') ?>
+ <div id="update-check">
+ <?php echo get_component('default', 'updateCheck') ?>
+ </div>
+ <div id="print-date">
+ <?php echo __('Printed: %d%', array('%d%' => date('Y-m-d'))) ?>
</div>
</body>
Copied: branches/2.0/js/dominion.js (from r11369,
branches/2.0/plugins/qtDominionPlugin/js/dominion.js)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/2.0/js/dominion.js Wed Apr 4 16:18:02 2012 (r11376, copy
of r11369, branches/2.0/plugins/qtDominionPlugin/js/dominion.js)
@@ -0,0 +1,219 @@
+!function ($) {
+
+ "use strict";
+
+ /****
+ ****
+ **** Autocomplete plugin
+ ****
+ ****/
+
+ var Autocomplete = function (element)
+ {
+ this.$element = element;
+ this.$menu = $('<div id="search-suggestions"></div>').appendTo('body');
+ this.shown = false;
+ this.source = element.closest('form').data('autocomplete');
+ this.timeout = 150;
+
+ this.listen();
+ };
+
+ Autocomplete.prototype = {
+
+ constructor: Autocomplete,
+
+ show: function()
+ {
+ var pos = $.extend({}, this.$element.offset(), {
+ height: this.$element[0].offsetHeight
+ });
+
+ this.$menu.css(
+ {
+ top: pos.top + pos.height,
+ left: pos.left
+ });
+
+ this.$menu.show();
+ this.shown = true;
+
+ return this;
+ },
+
+ hide: function()
+ {
+ this.$menu.hide();
+ this.shown = false;
+
+ return this;
+ },
+
+ lookup: function (e)
+ {
+ this.query = this.$element.val();
+
+ if (!this.query)
+ {
+ return this.shown ? this.hide() : this;
+ }
+
+ $.ajax(this.source,
+ {
+ context: this,
+ data: { query: this.query },
+ dataType: 'html'
+ })
+ .done(function(html)
+ {
+ if (html)
+ {
+ this.render(html).show();
+ }
+ else
+ {
+ this.hide();
+ }
+ });
+ },
+
+ render: function (html)
+ {
+ this.$menu.html(html);
+
+ return this;
+ },
+
+ next: function (e) { },
+ prev: function (e) { },
+ select: function(e) { },
+
+ listen: function()
+ {
+ this.$element
+ .on('blur', $.proxy(this.blur, this))
+ .on('keypress', $.proxy(this.keypress, this))
+ .on('keyup', $.proxy(this.keyup, this));
+
+ if ($.browser.webkit || $.browser.msie)
+ {
+ this.$element.on('keydown', $.proxy(this.keypress, this));
+ }
+
+ this.$menu.on('mouseenter', 'li', $.proxy(this.mouseenter, this));
+ },
+
+ keyup: function (e)
+ {
+ switch (e.keyCode)
+ {
+ case 40: // Down arrow
+ case 38: // Up arrow
+ break;
+
+ case 9: // Tab
+ if (!this.shown)
+ {
+ return;
+ }
+ this.select();
+ break;
+
+ case 27: // Escape
+ this.$element.val('');
+ if (!this.shown)
+ {
+ return;
+ }
+ this.hide();
+ break;
+
+ default:
+ if (this.timer)
+ {
+ clearTimeout(this.timer);
+ }
+ var self = this;
+ this.timer = setTimeout(function()
+ {
+ self.lookup();
+ }, this.timeout);
+ }
+
+ e.stopPropagation()
+ e.preventDefault()
+ },
+
+ keypress: function (e)
+ {
+ if (!this.shown)
+ {
+ return;
+ }
+
+ switch (e.keyCode)
+ {
+ case 9: // Tab
+ case 27: // Escape
+ e.preventDefault();
+ break;
+
+ case 38: // Up arrow
+ e.preventDefault();
+ this.prev();
+ break;
+
+ case 40: // Down arrow
+ e.preventDefault();
+ this.next();
+ break;
+ }
+
+ e.stopPropagation();
+ },
+
+ blur: function(e)
+ {
+ var self = this;
+ setTimeout(function ()
+ {
+ self.hide();
+ }, 150);
+ },
+
+ mouseenter: function(e)
+ {
+ this.$menu.find('active').removeClass('active');
+ $(e.currentTarget).addClass('active');
+ }
+ };
+
+ $.fn.autocomplete = function()
+ {
+ var $this = this;
+ var data = $this.data('autocomplete');
+ if (!data)
+ {
+ $this.data('autocomplete', (data = new Autocomplete(this)));
+ }
+ };
+
+ $.fn.autocomplete.Constructor = Autocomplete;
+
+ $(function ()
+ {
+ $('body').on('focus', '#header-search input[name="query"]', function(e)
+ {
+ var $this = $(this);
+
+ if ($this.data('autocomplete'))
+ {
+ return;
+ }
+
+ e.preventDefault();
+ $this.autocomplete();
+ });
+ });
+
+}(window.jQuery);
Added:
branches/2.0/plugins/arArchivesCanadaPlugin/config/arArchivesCanadaConfiguration.class.php
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++
branches/2.0/plugins/arArchivesCanadaPlugin/config/arArchivesCanadaConfiguration.class.php
Wed Apr 4 16:18:02 2012 (r11376)
@@ -0,0 +1,36 @@
+<?php
+
+/*
+ * This file is part of Qubit Toolkit.
+ *
+ * Qubit Toolkit is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Qubit Toolkit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Qubit Toolkit. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+class arDominionPluginConfiguration extends sfPluginConfiguration
+{
+ public static
+ $summary = 'Theme plugin for Archives Canada.',
+ $version = '0.0.1';
+
+ public function initialize()
+ {
+ $decoratorDirs = sfConfig::get('sf_decorator_dirs');
+ $decoratorDirs[] = $this->rootDir.'/templates';
+ sfConfig::set('sf_decorator_dirs', $decoratorDirs);
+
+ $moduleDirs = sfConfig::get('sf_module_dirs');
+ $moduleDirs[$this->rootDir.'/modules'] = false;
+ sfConfig::set('sf_module_dirs', $moduleDirs);
+ }
+}
Added: branches/2.0/plugins/arArchivesCanadaPlugin/config/view.yml
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/2.0/plugins/arArchivesCanadaPlugin/config/view.yml Wed Apr 4
16:18:02 2012 (r11376)
@@ -0,0 +1,5 @@
+all:
+
+ metas:
+ title: Archives Canada
+ description: Archives Canada
Modified:
branches/2.0/plugins/qtDominionPlugin/config/qtDominionPluginConfiguration.class.php
==============================================================================
---
branches/2.0/plugins/qtDominionPlugin/config/qtDominionPluginConfiguration.class.php
Wed Apr 4 15:52:27 2012 (r11375)
+++
branches/2.0/plugins/qtDominionPlugin/config/qtDominionPluginConfiguration.class.php
Wed Apr 4 16:18:02 2012 (r11376)
@@ -31,12 +31,12 @@
// Remember to avoid localStorage caching when dev machine is not localhost
if ($context->getConfiguration()->isDebug())
{
- $context->response->addJavaScript('/vendor/less/dist/less-1.3.0.js');
-
$context->response->addStylesheet('/plugins/qtDominionPlugin/css/main.less',
'last', array('rel' => 'stylesheet/less', 'type' => 'text/css'));
+ //$context->response->addJavaScript('/vendor/less/dist/less-1.3.0.js');
+ //
$context->response->addStylesheet('/plugins/qtDominionPlugin/css/main.less',
'last', array('rel' => 'stylesheet/less', 'type' => 'text/css'));
}
else
{
-
$context->response->addStylesheet('/plugins/qtDominionPlugin/css/less/main.css',
'last', array('media' => 'all'));
+
//$context->response->addStylesheet('/plugins/qtDominionPlugin/css/less/main.css',
'last', array('media' => 'all'));
}
}
Modified: branches/2.0/plugins/qtDominionPlugin/config/view.yml
==============================================================================
--- branches/2.0/plugins/qtDominionPlugin/config/view.yml Wed Apr 4
15:52:27 2012 (r11375)
+++ branches/2.0/plugins/qtDominionPlugin/config/view.yml Wed Apr 4
16:18:02 2012 (r11376)
@@ -1,26 +1,7 @@
all:
- http_metas:
- X-UA-Compatible: IE=edge
-
metas:
viewport: width=device-width, initial-scale=1.0, user-scalable=no
stylesheets:
- -*: # Discard any stylesheet included out of this plugin
- /plugins/qtDominionPlugin/vendor/chosen/chosen/chosen.css: { position:
last }
http://fonts.googleapis.com/css?family=Droid+Serif:400,400italic,700,700italic:
{ position: last }
-
- javascripts:
- #-*: # Discard any javascript included out of this plugin
-
- # Replace default jQuery version used in Qubit with latest release
- -/vendor/jquery:
- /vendor/jquery-1.7.1.js: { position: first }
-
- # Dominion specific javascripts
- /plugins/qtDominionPlugin/vendor/html5.js: { position: first, condition:
lt IE9 }
- /plugins/qtDominionPlugin/vendor/bootstrap.js: { position: last }
- /plugins/qtDominionPlugin/vendor/jquery.textfill.js: { position: last }
- /plugins/qtDominionPlugin/vendor/chosen/chosen/chosen.jquery.min.js: {
position: last }
- /plugins/qtDominionPlugin/js/dominion.js: { position: last }
\ No newline at end of file
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/qubit-commits?hl=en.