Example #1
0
<?php

PerchSystem::register_feather('StartBlock');
class PerchFeather_StartBlock extends PerchFeather
{
    public function get_css($opts, $index, $count)
    {
        $out = array();
        if (!$this->component_registered('normalize')) {
            $out[] = $this->_single_tag('link', array('rel' => 'stylesheet', 'href' => $this->path . '/css/normalize.css', 'type' => 'text/css'));
            $this->register_component('normalize');
        }
        return implode("\n\t", $out) . "\n";
    }
    public function get_javascript($opts, $index, $count)
    {
        $out = array();
        if (!$this->component_registered('jquery')) {
            $out[] = $this->_script_tag(array('src' => $this->path . '/js/jquery-1.8.2.min.js'));
            $this->register_component('jquery');
        }
        return implode("\n\t", $out) . "\n";
    }
}
Example #2
0
<?php

PerchSystem::register_feather('Quill');
class PerchFeather_Quill extends PerchFeather
{
    public function get_css($opts, $index, $count)
    {
        $out = array();
        $out[] = $this->_single_tag('link', array('rel' => 'stylesheet', 'href' => '//fonts.googleapis.com/css?family=Droid+Sans:400,700', 'type' => 'text/css'));
        $out[] = $this->_single_tag('link', array('rel' => 'stylesheet', 'href' => $this->path . '/css/styles.css', 'type' => 'text/css'));
        if (!$this->component_registered('html5shiv')) {
            $out[] = $this->_conditional_comment('lt IE 9', $this->_script_tag(array('src' => $this->path . '/js/html5shiv.js')));
            $this->register_component('html5shiv');
        }
        return implode("\n\t", $out) . "\n";
    }
    public function get_javascript($opts, $index, $count)
    {
        $out = array();
        if (!$this->component_registered('jquery')) {
            $out[] = $this->_script_tag(array('src' => $this->path . '/js/jquery-1.8.2.min.js'));
            $this->register_component('jquery');
        }
        if (!$this->component_registered('respond.js')) {
            $out[] = $this->_conditional_comment('lt IE 9', $this->_script_tag(array('src' => $this->path . '/js/respond.min.js')));
            $this->register_component('respond.js');
        }
        return implode("\n\t", $out) . "\n";
    }
}
Example #3
0
<?php

PerchSystem::register_feather('MyFeather');
class PerchFeather_MyFeather extends PerchFeather
{
    public function get_css($opts, $index, $count)
    {
        return $this->_single_tag('link', array('rel' => 'stylesheet', 'href' => $this->path . '/css/app.css', 'type' => 'text/css'));
    }
    public function get_javascript($opts, $index, $count)
    {
        return $this->_script_tag(array('src' => $this->path . '/scripts/main.js'));
    }
}
Example #4
0
<?php

PerchSystem::register_feather('TheCross');
class PerchFeather_TheCross extends PerchFeather
{
    public function get_css($opts, $index, $count)
    {
        $out = array();
        if (!$this->component_registered('raleway')) {
            $out[] = $this->_single_tag('link', array('rel' => 'stylesheet', 'href' => '//fonts.googleapis.com/css?family=Raleway:400,300,600', 'type' => 'text/css'));
        }
        if (!$this->component_registered('normalize')) {
            $out[] = $this->_single_tag('link', array('rel' => 'stylesheet', 'href' => $this->path . '/css/normalize.css', 'type' => 'text/css'));
        }
        if (!$this->component_registered('skeleton')) {
            $out[] = $this->_single_tag('link', array('rel' => 'stylesheet', 'href' => $this->path . '/css/skeleton.css', 'type' => 'text/css'));
        }
        return implode("\n\t", $out) . "\n";
    }
    public function get_javascript($opts, $index, $count)
    {
        $out = array();
        if (!$this->component_registered('jquery')) {
            $out[] = $this->_script_tag(array('src' => '//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'));
            $this->register_component('jquery');
        }
        if (!$this->component_registered('jquery.easing')) {
            $out[] = $this->_script_tag(array('src' => '//cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js'));
            $this->register_component('jquery.easing');
        }
        if (!$this->component_registered('functions')) {
Example #5
0
<?php

PerchSystem::register_feather('Twitter');
class PerchFeather_Twitter extends PerchFeather
{
    public function get_css($opts, $index, $count)
    {
        $out = array();
        $out[] = $this->_single_tag('link', array('rel' => 'stylesheet', 'href' => $this->path . '/css/twitter.css', 'type' => 'text/css'));
        return implode("\n\t", $out) . "\n";
    }
    public function get_javascript($opts, $index, $count)
    {
        $out = array();
        if (!$this->component_registered('twitter')) {
            $out[] = $this->_script_tag(array('src' => '//platform.twitter.com/widgets.js'));
            $this->register_component('twitter');
        }
        return implode("\n\t", $out) . "\n";
    }
}
Example #6
0
<?php

PerchSystem::register_feather('Sass');
class PerchFeather_Sass extends PerchFeather
{
    private $_site_path = false;
    public function get_css($opts, $index, $count)
    {
        if (!isset($opts['sass'])) {
            return;
        }
        $stylesheets = $opts['sass'];
        $out = '';
        // compile files
        if (PERCH_PRODUCTION_MODE < PERCH_PRODUCTION) {
            foreach ($stylesheets as $stylesheet) {
                $this->_compile_stylesheet($stylesheet);
            }
        }
        // link files
        foreach ($stylesheets as $stylesheet) {
            $out .= $this->_single_tag('link', array('rel' => 'stylesheet', 'href' => $this->_get_compiled_name($stylesheet, true), 'type' => 'text/css'));
        }
        return $out;
    }
    private function _get_compiled_name($file, $include_path = false)
    {
        $parts = explode('/', $file);
        $file = array_pop($parts);
        $parts = explode('.', $file);
        array_pop($parts);
Example #7
0
<?php

PerchSystem::register_feather('Ketterus_Foundation');
class PerchFeather_Ketterus_Foundation extends PerchFeather
{
    public function get_css($opts, $index, $count)
    {
        $out = array();
        $out[] = $this->_single_tag('link', array('rel' => 'stylesheet', 'href' => $this->path . '/css/foundation.min.css', 'type' => 'text/css'));
        return implode("\n\t", $out) . "\n";
    }
    public function get_javascript($opts, $index, $count)
    {
        $out = array();
        if (!$this->component_registered('jquery')) {
            $out[] = $this->_script_tag(array('src' => $this->path . '/js/vendor/jquery.min.js'));
            $this->register_component('jquery');
        }
        $out[] = $this->_script_tag(array('src' => $this->path . '/js/foundation.min.js'));
        return implode("\n\t", $out) . "\n";
    }
}