edge_framework 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +8 -8
  2. data/README.md +13 -12
  3. data/assets/js/sh/clipboard.swf +0 -0
  4. data/assets/js/sh/shBrushCss.js +91 -0
  5. data/assets/js/sh/shBrushJScript.js +52 -0
  6. data/assets/js/sh/shBrushPhp.js +88 -0
  7. data/assets/js/sh/shBrushRuby.js +55 -0
  8. data/assets/js/sh/shBrushSass.js +94 -0
  9. data/assets/js/sh/shBrushXml.js +71 -0
  10. data/assets/js/sh/shCore.js +17 -0
  11. data/assets/sass/edge/_base.scss +21 -55
  12. data/assets/sass/edge/components/_block-grid-margin.scss +1 -1
  13. data/assets/sass/edge/components/_block-grid.scss +14 -13
  14. data/assets/sass/edge/components/_button.scss +16 -16
  15. data/assets/sass/edge/components/_form.scss +32 -22
  16. data/assets/sass/edge/components/_grid-margin.scss +1 -1
  17. data/assets/sass/edge/components/_grid.scss +56 -42
  18. data/assets/sass/edge/components/_normalize.scss +39 -42
  19. data/assets/sass/edge/components/_typography.scss +160 -36
  20. data/assets/sass/edge/components/_visibility.scss +8 -11
  21. data/assets/sass/edge/helpers/_sticky-footer.scss +4 -0
  22. data/assets/sass/edge.scss +1 -1
  23. data/assets/sass/for-test.scss +87 -8
  24. data/assets/test2.html +62 -0
  25. data/lib/edge/version.rb +1 -1
  26. data/template/base/assets/sass/_setting.scss +51 -55
  27. data/template/base/config.rb +1 -1
  28. data/template/html/index.html +22 -22
  29. data/template/php/index.php +6 -6
  30. data/template/php/partials/footer.php +15 -0
  31. data/template/php/partials/functions.php +87 -0
  32. data/template/php/partials/header.php +22 -0
  33. data/template/php/sample-page/index.php +6 -6
  34. data/template/wordpress/404.php +10 -0
  35. data/template/wordpress/category.php +29 -0
  36. data/template/wordpress/footer.php +15 -0
  37. data/template/wordpress/functions.php +63 -0
  38. data/template/wordpress/header.php +22 -0
  39. data/template/wordpress/index.php +10 -0
  40. data/template/wordpress/single.php +7 -0
  41. metadata +21 -5
  42. data/assets/js/edge/layout.js +0 -10
  43. data/template/php/partials/_footer.php +0 -15
  44. data/template/php/partials/_header.php +0 -33
@@ -1,11 +1,11 @@
1
- <?php include 'partials/_header.php'; ?>
1
+ <?php include "partials/_functions.php"; get("header"); ?>
2
2
 
3
3
  <!-- Sample content to show how the $root works -->
4
4
  <div class="row">
5
- <div class="large-6 large-centered columns">
6
- <h1>Home page</h1>
7
- <a href="<?php echo $root; ?>sample-page" class="button">Go</a>
8
- </div>
5
+ <div class="large-6 large-centered columns">
6
+ <h1>Home page</h1>
7
+ <a href="<?php echo root(); ?>sample-page" class="button">Go to next page</a>
8
+ </div>
9
9
  </div>
10
10
 
11
- <?php include $root.'partials/_footer.php'; ?>
11
+ <?php get("footer"); ?>
@@ -0,0 +1,15 @@
1
+ <div id="footer-push"></div>
2
+ </div>
3
+ <footer id="footer"></footer>
4
+
5
+ <!-- Google's Hosted JQuery -->
6
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
7
+ <script type="text/javascript">
8
+ // Use local jquery, if Google's fails to load
9
+ if (typeof jQuery == 'undefined') {
10
+ document.write(unescape("%3Cscript src='<?php echo js(); ?>vendor/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));
11
+ }
12
+ </script>
13
+ <script type="text/javascript" src="<?php echo js(); ?>app.js"></script>
14
+ </body>
15
+ </html>
@@ -0,0 +1,87 @@
1
+ <?php
2
+ /* ------------------------------------------------
3
+ -- You must change the server_url to fit your server
4
+ --
5
+ -- This file is exclusive to your machine,
6
+ -- DON'T push your changes to Git
7
+ -------------------------------------------------- */
8
+
9
+ $server_url = array(
10
+ "live" => array("mysite.com", "www.mysite.com"),
11
+ "staging" => array("beta.mysite.com"),
12
+ "local" => array("localhost/mysite/"),
13
+ );
14
+
15
+ /*
16
+ Get the static path to root (home) directory
17
+ @return = static path to root
18
+ */
19
+ function home_url() {
20
+ global $server_url;
21
+ foreach ($server_url as $server => $urls) {
22
+ foreach($urls as $url) {
23
+ if($_SERVER["SERVER_NAME"] == parse_url("http://".$url, PHP_URL_HOST) ) {
24
+ return $url;
25
+ }
26
+ }
27
+ }
28
+ return $server_url["local"][0];
29
+ }
30
+
31
+ /*
32
+ Get relative path to root directory
33
+ @return = relative path to root
34
+ */
35
+ function get_root() {
36
+ $folder_depth = substr_count($_SERVER["PHP_SELF"] , "/");
37
+
38
+ // Check the amount of nested URL
39
+ preg_match_all("/\w\/\w/", home_url(), $matches );
40
+ $home_depth = count($matches[0]) + 1;
41
+
42
+ return str_repeat("../", $folder_depth - $home_depth);
43
+ }
44
+ $root = get_root();
45
+ // Global root
46
+ function root() {
47
+ global $root;
48
+ return $root;
49
+ }
50
+
51
+ /*
52
+ Echo path to assets directory
53
+ @return = relative path to specified assets directory
54
+ */
55
+ function img() { echo root().'assets/img/'; }
56
+ function css() { echo root().'assets/css/'; }
57
+ function js() { echo root().'assets/js/'; }
58
+ function files() { echo root().'assets/files/'; }
59
+
60
+ /*
61
+ Get partials
62
+ @param
63
+ file = partial file name, without extension
64
+ @return = content of the partial file
65
+ */
66
+ function get($file, $params = array()) {
67
+ // If first letter is not underscore, add it
68
+ if(substr($file, 0, 1) !== '_') {
69
+ $file = '_'.$file;
70
+ }
71
+ return (include root().'partials/'.$file.'.php');
72
+ }
73
+
74
+ /*
75
+ Get the last word from the URL, useful for Header-menu's active state
76
+ @return = the last word from the current page
77
+ */
78
+ function get_current_page() {
79
+ $pageURL = 'http';
80
+ if ($_SERVER["SERVER_PORT"] != "80") {
81
+ $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
82
+ } else {
83
+ $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
84
+ }
85
+ $url_break = explode('/', $pageURL);
86
+ return $url_break[count($url_break)-2];
87
+ }
@@ -0,0 +1,22 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width" />
6
+ <title>My Website</title>
7
+ <meta name="description" content="This is a description of your website" />
8
+ <meta name="keywords" content="search, key, word," /> <!-- Comma-separated list for Search keyword -->
9
+
10
+ <!-- FAVICON -->
11
+ <link rel="icon" type="image/png" href="<?php echo img(); ?>favicon.ico">
12
+ <link rel="apple-touch-icon-precomposed" href="<?php echo img(); ?>favicon-big.png" />
13
+
14
+ <!-- VENDOR -->
15
+ <script type="text/javascript" src="<?php echo js(); ?>vendor/custom.modernizr.js"></script>
16
+ <link rel="stylesheet" href="<?php echo css(); ?>edge-framework.css">
17
+
18
+ <!-- APP Specific -->
19
+ <link rel="stylesheet" href="<?php echo css(); ?>app.css">
20
+ </head>
21
+ <body>
22
+ <div id="main-wrapper">
@@ -1,11 +1,11 @@
1
- <?php include '../partials/_header.php'; ?>
1
+ <?php include "../partials/functions.php"; get("header"); ?>
2
2
 
3
3
  <!-- Sample content to show how the $root works -->
4
4
  <div class="row">
5
- <div class="large-6 large-centered columns">
6
- <h1>Sample page</h1>
7
- <a href="<?php echo $root ?>" class="button">Go back</a>
8
- </div>
5
+ <div class="large-6 large-centered columns">
6
+ <h1>Sample page</h1>
7
+ <a href="<?php echo root(); ?>" class="button">Go back</a>
8
+ </div>
9
9
  </div>
10
10
 
11
- <?php include $root.'partials/_footer.php'; ?>
11
+ <?php get("footer"); ?>
@@ -0,0 +1,10 @@
1
+ <?php
2
+ /**
3
+ * The template for displaying Error 404 (Page not found)
4
+ */
5
+ get_header(); ?>
6
+
7
+ <h1>404 Not Found</h1>
8
+ <p>To customize this message, edit "404.php"</p>
9
+
10
+ <?php get_footer(); ?>
@@ -0,0 +1,29 @@
1
+ <?php
2
+ /**
3
+ * The template for displaying post list under a single category
4
+ */
5
+ get_header();
6
+ // Get all posts under this category
7
+ $args = array (
8
+ "category" => ID
9
+ "orderby" => "post_date",
10
+ "order" => "ASC", );
11
+ $myposts = get_posts($args);
12
+ ?>
13
+
14
+ <h1><?php single_cat_title(); ?></h1>
15
+ <p>To customize this message, edit "category.php"</p>
16
+
17
+ <?php // If the category has description
18
+ if(category_description() ): ?>
19
+ <p><?php category_description(); ?></p>
20
+ <?php endif; ?>
21
+
22
+ <?php foreach($posts as $post): setup_postdata($post);
23
+ $permalink = get_permalink($post->ID);
24
+
25
+ ?>
26
+
27
+ <?php endforeach; ?>
28
+
29
+ <?php get_footer(); ?>
@@ -0,0 +1,15 @@
1
+ <div id="footer-push"></div>
2
+ </div>
3
+ <footer id="footer"></footer>
4
+
5
+ <!-- Google's Hosted JQuery -->
6
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
7
+ <script type="text/javascript">
8
+ // Use local jquery, if Google's one fails to load
9
+ if (typeof jQuery == 'undefined') {
10
+ document.write(unescape("%3Cscript src='<?php echo js(); ?>/vendor/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));
11
+ }
12
+ </script>
13
+ <script type="text/javascript" src="<?php echo js(); ?>/app.js"></script>
14
+ </body>
15
+ </html>
@@ -0,0 +1,63 @@
1
+ <?php
2
+ /* ------------------------------------
3
+ EDGE Press v0.1
4
+ - Extend functionality to Word Press
5
+ --------------------------------------- */
6
+
7
+ add_theme_support( 'post-thumbnails' );
8
+
9
+ function root() {
10
+ return get_template_directory_uri().'/';
11
+ }
12
+
13
+ /*
14
+ Get path to assets directory
15
+ @return = relative path to specified assets directory
16
+ */
17
+ function img() { return root().'assets/img/'; }
18
+ function css() { return root().'assets/css/'; }
19
+ function js() { return root().'assets/js/'; }
20
+ function files() { return root().'assets/files/'; }
21
+
22
+ /*
23
+ Get the last word from the URL, useful for Header-menu's active state
24
+ @return = the last word from the current page
25
+ */
26
+ function get_current_page() {
27
+ $pageURL = 'http';
28
+ if ($_SERVER["SERVER_PORT"] != "80") {
29
+ $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
30
+ } else {
31
+ $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
32
+ }
33
+ $url_break = explode('/', $pageURL);
34
+ return $url_break[count($url_break) - 2];
35
+ }
36
+
37
+ /*
38
+ Ellipsize the text (Adding "..." at the end of the word)
39
+ Always stop at the end of a word.
40
+ @param text = The statement to be ellipsized
41
+ char_number = Number of characters before adding the ellipse
42
+ etc = The ellipse text to be added, default to "..."
43
+ @return = the ellipsed text
44
+ */
45
+ function ellipsize($text, $char_number, $etc = "...") {
46
+ $text = html_entity_decode($text, ENT_QUOTES);
47
+ if (strlen($text) > $char_number) {
48
+ $text = substr($text, 0, $char_number);
49
+ $text = substr($text,0,strrpos($text," "));
50
+
51
+ $punctuation = ".!?:;,-"; //punctuation you want removed
52
+
53
+ $text = (strspn(strrev($text), $punctuation) != 0)
54
+ ?
55
+ substr($text, 0, -strspn(strrev($text), $punctuation))
56
+ :
57
+ $text;
58
+
59
+ $text = $text.$etc;
60
+ }
61
+ $text = htmlentities($text, ENT_QUOTES);
62
+ return $text;
63
+ }
@@ -0,0 +1,22 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width" />
6
+ <title><?php wp_title( '|', true, 'right' ); ?></title>
7
+ <meta name="description" content="This is a description of your website" />
8
+ <meta name="keywords" content="search, key, word," /> <!-- Comma-separated list for Search keyword -->
9
+
10
+ <!-- FAVICON -->
11
+ <link rel="icon" type="image/png" href="<?php echo img(); ?>/favicon.ico">
12
+ <link rel="apple-touch-icon-precomposed" href="<?php echo img(); ?>/favicon-big.png" />
13
+
14
+ <!-- VENDOR -->
15
+ <script type="text/javascript" src="<?php echo js(); ?>/vendor/custom.modernizr.js"></script>
16
+ <link rel="stylesheet" href="<?php echo css(); ?>/edge-framework.css">
17
+
18
+ <!-- APP Specific -->
19
+ <link rel="stylesheet" href="<?php echo css(); ?>/app.css">
20
+ </head>
21
+ <body>
22
+ <div id="main-wrapper">
@@ -0,0 +1,10 @@
1
+ <?php
2
+ /**
3
+ * Home / Landing page
4
+ */
5
+ get_header(); ?>
6
+
7
+ <h1>Welcome</h1>
8
+ <p>To customize this message, edit "index.php"</p>
9
+
10
+ <?php get_footer(); ?>
@@ -0,0 +1,7 @@
1
+ <?php
2
+ /**
3
+ * The template for displaying post the content of a single post
4
+ */
5
+ get_header(); ?>
6
+
7
+ <?php get_footer(); ?>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edge_framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henner Setyono
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-27 00:00:00.000000000 Z
11
+ date: 2013-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass
@@ -114,8 +114,15 @@ files:
114
114
  - assets/js/edge/edge.handlebars.js
115
115
  - assets/js/edge/edge.ie8.js
116
116
  - assets/js/edge/edge.notification.js
117
- - assets/js/edge/layout.js
118
117
  - assets/js/edge/prototype.js
118
+ - assets/js/sh/clipboard.swf
119
+ - assets/js/sh/shBrushCss.js
120
+ - assets/js/sh/shBrushJScript.js
121
+ - assets/js/sh/shBrushPhp.js
122
+ - assets/js/sh/shBrushRuby.js
123
+ - assets/js/sh/shBrushSass.js
124
+ - assets/js/sh/shBrushXml.js
125
+ - assets/js/sh/shCore.js
119
126
  - assets/sass/edge.scss
120
127
  - assets/sass/edge/_base.scss
121
128
  - assets/sass/edge/_components.scss
@@ -133,6 +140,7 @@ files:
133
140
  - assets/sass/edge/helpers/_sprites.scss
134
141
  - assets/sass/edge/helpers/_sticky-footer.scss
135
142
  - assets/sass/for-test.scss
143
+ - assets/test2.html
136
144
  - edge.gemspec
137
145
  - lib/edge/console.rb
138
146
  - lib/edge/message.rb
@@ -154,9 +162,17 @@ files:
154
162
  - template/base/robots.txt
155
163
  - template/html/index.html
156
164
  - template/php/index.php
157
- - template/php/partials/_footer.php
158
- - template/php/partials/_header.php
165
+ - template/php/partials/footer.php
166
+ - template/php/partials/functions.php
167
+ - template/php/partials/header.php
159
168
  - template/php/sample-page/index.php
169
+ - template/wordpress/404.php
170
+ - template/wordpress/category.php
171
+ - template/wordpress/footer.php
172
+ - template/wordpress/functions.php
173
+ - template/wordpress/header.php
174
+ - template/wordpress/index.php
175
+ - template/wordpress/single.php
160
176
  - bin/edge
161
177
  homepage: http://edge.setyono.net
162
178
  licenses:
@@ -1,10 +0,0 @@
1
- $(document).ready(function(){
2
- /* Responsive Sticky Footer Fix */
3
- /* Credit: https://gist.github.com/spilliams/2697774*/
4
- $("#footer, #footer-push").height($("#footer .row").height()+"px");
5
- $("#main-wrapper").css({'margin-bottom':(-1*$("#footer .row").height())+"px"});
6
- window.onresize = function(){
7
- $(".footer-filler, #footer-push").height($("#footer .row").height()+"px");
8
- $("#main-wrapper").css({'margin-bottom':(-1*$("#footer .row").height())+"px"});
9
- }
10
- });
@@ -1,15 +0,0 @@
1
- <div id="footer-push"></div>
2
- </div>
3
- <footer id="footer"></footer>
4
-
5
- <!-- Google's Hosted JQuery -->
6
- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
7
- <script type="text/javascript">
8
- // Use local jquery, if Google's fails to load
9
- if (typeof jQuery == 'undefined') {
10
- document.write(unescape("%3Cscript src='assets/js/vendor/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));
11
- }
12
- </script>
13
- <script type="text/javascript" src="<?php echo $js; ?>app.js"></script>
14
- </body>
15
- </html>
@@ -1,33 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <?php
4
- // Set relative path to Root directory
5
- function to_root() {
6
- $folder_depth = substr_count($_SERVER["PHP_SELF"] , "/");
7
-
8
- if($folder_depth == false)
9
- $folder_depth = 1;
10
-
11
- return str_repeat("../", $folder_depth - 2);
12
- }
13
- $root = to_root();
14
- $img = to_root().'assets/img/';
15
- $css = to_root().'assets/css/';
16
- $js = to_root().'assets/js/';
17
- ?>
18
- <head>
19
- <meta charset="UTF-8">
20
- <meta name="viewport" content="width=device-width" />
21
- <title>My Website</title>
22
- <link rel="icon" type="image/png" href="<?php echo $img; ?>favicon.ico">
23
- <link rel="apple-touch-icon-precomposed" href="<?php echo $img; ?>favicon-big.png" />
24
-
25
- <!-- VENDOR -->
26
- <script type="text/javascript" src="<?php echo $js; ?>vendor/custom.modernizr.js"></script>
27
- <link rel="stylesheet" href="<?php echo $css; ?>edge-framework.css">
28
-
29
- <!-- APP Specific -->
30
- <link rel="stylesheet" href="<?php echo $css; ?>app.css">
31
- </head>
32
- <body>
33
- <div id="main-wrapper">