cedar 0.0.2.pre → 0.0.3.pre

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4a0c5adf5e2f07dee717a83cc3d4276628878d38
4
- data.tar.gz: 2bb4a59d7c2f52846d3aa915608551cc66f73b61
3
+ metadata.gz: 0621becc144ce370b0a74f201bf17e864ea24b70
4
+ data.tar.gz: 507918bacc51d7b0b18d21f0b755f2e9ba71834b
5
5
  SHA512:
6
- metadata.gz: 87a412b3141bc1d09d2208a14e95d2c888de89b00df8c4557a32556448b4626faa5a798a39344f13ef744d51e649783a6b5975d459a05f5312511c798f759698
7
- data.tar.gz: e2aff822c1c56cf62bd11fe509890344d032d6fad2a214aa527e2902e01e383e2365c6b00ca6d0cccc44ba951d48b65d7ba9e002dea6bb03f221d4219262d1d3
6
+ metadata.gz: 41d4dd702d0d792b122b94d9bd1a48f6c8d319b1608b03e55c379a1afb84482ed6508c094d7c6333bae9f8dab55ed4a4765a1072f13cc8d92e357f5c48691ff4
7
+ data.tar.gz: ff5756a48d0e6325b5df453a4941345375e2865febd889e0fb0c5300d00930970a3ced0bfdc34d17722af36ae774a323c42f1a8213f591e647a703752f7f4fa2
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cedar.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Jed Murdock
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,31 @@
1
+ # Cedar
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'cedar'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install cedar
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/cedar/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'cedar/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "cedar"
8
+ spec.version = Cedar::VERSION
9
+ spec.authors = ["Jed Murdock"]
10
+ spec.email = ["jedmurdock@gmail.com"]
11
+ spec.summary = "The Cedar/Ply Asset Gem"
12
+ spec.description = "Pre-Release Cedar/Ply CaaS Asset Gem"
13
+ spec.homepage = "http://plyinteractive.com"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_dependency "railties", "~> 3.1"
24
+ end
@@ -0,0 +1,7 @@
1
+ require "cedar/version"
2
+
3
+ module Cedar
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ module Cedar
2
+ VERSION = "0.0.3.pre"
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cedar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.pre
4
+ version: 0.0.3.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jed Murdock
@@ -9,18 +9,64 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2015-02-09 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: railties
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.1'
13
55
  description: Pre-Release Cedar/Ply CaaS Asset Gem
14
- email: jedmurdock@gmail.com
56
+ email:
57
+ - jedmurdock@gmail.com
15
58
  executables: []
16
59
  extensions: []
17
60
  extra_rdoc_files: []
18
61
  files:
19
- - lib/assets/images/cedar-display-tools-sprite.png
20
- - lib/assets/javascripts/cedar.js
21
- - lib/assets/javascripts/cedar.marionette.js
22
- - lib/assets/javascripts/cedarInit.js.erb
23
- - lib/assets/stylesheets/cedar.scss
62
+ - ".gitignore"
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - cedar.gemspec
68
+ - lib/cedar.rb
69
+ - lib/cedar/version.rb
24
70
  homepage: http://plyinteractive.com
25
71
  licenses:
26
72
  - MIT
@@ -1,222 +0,0 @@
1
- /**
2
- * Global object for settings and storage
3
- */
4
- var Cedar = {
5
- initialized: false,
6
- store: null,
7
- auth: null,
8
- config: {
9
- api: 'http://jed.cdr.core.plyinc.dev/api',
10
- server: 'http://jed.cdr.core.plyinc.dev/'
11
- }
12
- };
13
-
14
-
15
- /**
16
- * Cedar.Init
17
- *
18
- * take care of global initializations
19
- */
20
- Cedar.Init = function() {
21
- if ( Cedar.initialized ) {
22
- return;
23
- }
24
-
25
- if ( Cedar.store === null ) {
26
- Cedar.store = new Cedar.Store();
27
- }
28
-
29
- if ( Cedar.auth === null ) {
30
- Cedar.auth = new Cedar.Auth();
31
- }
32
-
33
- if (Cedar.auth.isEditMode()) {
34
- jQuery( document ).ready(function( $ ) {
35
- var logOff = '<a href="" onclick="location.reload(true)" style="position: absolute; bottom: 20px; right: 120px; ">[refresh]</a>';
36
- logOff += '<a href="' + Cedar.auth.getLogOffURL() + '" style="position: absolute; bottom: 20px; right: 60px; ">[logout]</a>';
37
- $(document.body).append(logOff);
38
- });
39
- }
40
-
41
- Cedar.initialized = true;
42
- }
43
-
44
-
45
- /**
46
- * Cedar.Auth
47
- *
48
- * responsible for determining if we're authorized for edit mode
49
- */
50
- Cedar.Auth = function() {
51
- }
52
- Cedar.Auth.prototype.isEditMode = function() {
53
- return this.isEditUrl();
54
- }
55
- Cedar.Auth.prototype.isEditUrl = function() {
56
- var sPageURL = window.location.search.substring(1);
57
- var sURLVariables = sPageURL.split('&');
58
- for (var i = 0; i < sURLVariables.length; i++) {
59
- if (sURLVariables[i] == 'cdrlogin') {
60
- return true;
61
- }
62
- }
63
- return false;
64
- }
65
- Cedar.Auth.prototype.getLogOffURL = function() {
66
- return this.removeURLParameter(window.location.href, 'cdrlogin');
67
- }
68
-
69
- // adapted from stackoverflow: http://stackoverflow.com/questions/1634748/how-can-i-delete-a-query-string-parameter-in-javascript
70
- Cedar.Auth.prototype.removeURLParameter = function(url, parameter) {
71
- //prefer to use l.search if you have a location/link object
72
- var urlparts= url.split('?');
73
- if (urlparts.length>=2) {
74
-
75
- var prefix= encodeURIComponent(parameter); //+'=';
76
- var pars= urlparts[1].split(/[&;]/g);
77
-
78
- //reverse iteration as may be destructive
79
- for (var i= pars.length; i-- > 0;) {
80
- //idiom for string.startsWith
81
- if (pars[i].lastIndexOf(prefix, 0) !== -1) {
82
- pars.splice(i, 1);
83
- }
84
- }
85
-
86
- url= urlparts[0];
87
- if (pars.length > 0) {
88
- url += '?'+pars.join('&');
89
- }
90
- return url;
91
- } else {
92
- return url;
93
- }
94
- }
95
-
96
-
97
- /**
98
- * Cedar.Store
99
- *
100
- * responsible for retrieving Cedar elements from server or local cache.
101
- */
102
- Cedar.Store = function() {
103
- this._cache = {};
104
- }
105
-
106
- Cedar.Store.prototype.put = function ( key, item ) {
107
- this._cache[key] = item;
108
- }
109
-
110
- // different cedar types may use different api paths
111
- Cedar.Store.prototype.find = function ( key, getPath ) {
112
- if ( getPath === null )
113
- console.log('Cedar Error: must provide api "get" path');
114
-
115
- if (typeof this._cache[key] === 'undefined'){
116
- return $.getJSON(Cedar.config.api + getPath + key, function(json) {
117
- this.put(key, json);
118
- console.log('retrieved from server');
119
- }.bind(this));
120
- }
121
- else {
122
- console.log('retrieved from cache');
123
- return $.Deferred().resolve(this._cache[key]);
124
- }
125
- return false;
126
- }
127
-
128
- Cedar.Store.prototype.clear = function(key) {
129
- delete this._cache[key];
130
- }
131
-
132
-
133
- /**
134
- * Cedar.ContentEntry
135
- *
136
- * basic content block class
137
- *
138
- *
139
- *
140
- * options:
141
- *
142
- * {
143
- * el (element or jQuery selector)
144
- * }
145
- */
146
- Cedar.ContentEntry = function(options) {
147
- Cedar.Init();
148
-
149
- var defaults = {
150
- el: 'div'
151
- };
152
-
153
- this.options = $.extend( {}, defaults, options );
154
-
155
- this.cedarId = this.options.cedarId;
156
- this.el = this.options.el;
157
- this.$el = $(this.el);
158
- this.apiGet = '/objects/contententries/';
159
- }
160
-
161
- // parse the json for the relevant content
162
- Cedar.ContentEntry.prototype.setContent = function(json) {
163
- if (json.code == "UNKNOWN_ID"){
164
- this.content = '&nbsp;'; // if an element is new, fill with blank space to allow edit box to display
165
- }
166
- else if (typeof json.settings.content !== 'undefined') {
167
- this.content = json.settings.content;
168
- }
169
- else {
170
- this.content = '';
171
- console.log('Cedar Error: Unable to parse json');
172
- }
173
- }
174
-
175
- // takes into account edit mode styling
176
- Cedar.ContentEntry.prototype.getContent = function(options){
177
- if (Cedar.auth.isEditMode()) {
178
- return this.getEditOpen(this.cedarId) + this.content + this.getEditClose();
179
- }
180
- else {
181
- return this.content;
182
- }
183
- }
184
-
185
- // element is optional parameter
186
- Cedar.ContentEntry.prototype.fill = function(element) {
187
- if (typeof element !== 'undefined') {
188
- $(element).html(this.getContent());
189
- }
190
- else if (typeof this.$el !== 'undefined') {
191
- this.$el.html(this.getContent());
192
- }
193
- }
194
-
195
- // check store for content
196
- Cedar.ContentEntry.prototype.retrieve = function() {
197
- return Cedar.store.find(this.cedarId, this.apiGet ).done( function(json) {
198
- this.setContent(json);
199
- this.json = json;
200
- }.bind(this));
201
- }
202
-
203
- // fill the asssociated element with the retrieved content
204
- Cedar.ContentEntry.prototype.render = function() {
205
- this.retrieve().done(function() {
206
- this.fill();
207
- }.bind(this));
208
- }
209
-
210
- // styling for edit box
211
- Cedar.ContentEntry.prototype.getEditOpen = function(id) {
212
- var block;
213
- block = '<span class="cedar-cms-editable clearfix">';
214
- block += '<span class="cedar-cms-edit-tools">';
215
- block += '<a target="cedarEdit" href="' + Cedar.config.server + 'cmsadmin/EditData?cdr=1&t=ContentEntry&o=' + encodeURIComponent(id) + '" class="cedar-cms-edit-icon" >';
216
- block += '<b class="cedar-cms-edit-label">content block</b><i class="cedar-cms-icon cedar-cms-icon-right cedar-cms-icon-edit"></i></a>';
217
- block += '</span>';
218
- return block;
219
- }
220
- Cedar.ContentEntry.prototype.getEditClose = function(){
221
- return '</span>';
222
- }
@@ -1,25 +0,0 @@
1
- // Marionette
2
- var CedarMarionetteHeader = Backbone.Marionette.ItemView.extend({
3
- template : function(serialized_model) {
4
- return _.template('<h1><%= content %></h1>')(serialized_model);
5
- }
6
- });
7
- var CedarMarionetteParagraph = Backbone.Marionette.ItemView.extend({
8
- template : function(serialized_model) {
9
- return _.template('<p><%= content %></p>')(serialized_model);
10
- }
11
- });
12
-
13
- var CedarMarionetteLayout = Backbone.Marionette.LayoutView.extend({
14
- template: '#layout-view-template',
15
-
16
- regions: {
17
- cedarHeading: '.js-cedar-heading',
18
- anotherParagraph: '.js-cedar-paragraph'
19
- },
20
-
21
- onRender: function() {
22
- this.cedarHeading.show(new CedarMarionetteHeader({model: this.options.heading}))
23
- this.anotherParagraph.show(new CedarMarionetteParagraph({model: this.options.introText}))
24
- }
25
- });
@@ -1,6 +0,0 @@
1
- // for intergration demonstration only - not currently used
2
-
3
- /*
4
- Cedar.config.api = '<%= Rails.application.routes.url_helpers.cedar_index_path %>';
5
- Cedar.config.server = '<%= Cedar::Application.config.cedar_server %>';
6
- */
@@ -1,86 +0,0 @@
1
- /**
2
- * Styles particular to the CMS when in "edit-mode" while viewing a front-end page.
3
- * @browsers ALL
4
- **/
5
-
6
-
7
-
8
-
9
- .cedar-cms-editable {
10
- display: block !important;
11
- border: 1px dotted #F65126 !important
12
- }
13
-
14
- .cedar-cms-edit-tools {
15
- font-family: Arial, sans-serif;
16
- position: relative;
17
- display: block !important;
18
- font-size: 10px !important;
19
- line-height: 1.2 !important;
20
- text-align: left !important;
21
- }
22
-
23
- .cedar-cms-edit-tools a {
24
- color: #F26521 !important;
25
- text-decoration: none !important;
26
- }
27
-
28
- .cedar-cms-edit-tools a:hover {
29
- color: #FA8A2D !important;
30
- text-decoration: none !important;
31
- }
32
-
33
- .cedar-cms-edit-label {
34
- color: #F26521 !important;
35
- text-transform: uppercase;
36
- font-size: 10px;
37
- padding: 0 6px;
38
- }
39
-
40
- .cedar-cms-edit-tools .cedar-cms-edit-icon,
41
- .cedar-cms-edit-tools .cedar-cms-edit-icon:hover {
42
- display: block;
43
- position: absolute;
44
- top: 0;
45
- right: 0;
46
- height: 18px;
47
- z-index: 1001;
48
- border: 1px solid #fff;
49
- background-color: #ffddd0 !important;
50
- padding: 0;
51
- }
52
-
53
- /* 4 classes to display icons */
54
-
55
- .cedar-cms-edit-tools.spacer {
56
- height: 20px;
57
- }
58
-
59
- .cedar-cms-edit-tools.left-align .cedar-cms-edit-icon {
60
- right: auto;
61
- left: 0;
62
- }
63
-
64
- /* Standalone icons */
65
- .cedar-cms-icon {
66
- min-height: 18px;
67
- width: 18px;
68
- height: 18px;
69
- display: -moz-inline-stack;
70
- display: inline-block;
71
- vertical-align: middle;
72
- zoom: 1;
73
- *display: inline;
74
- _height: 18px;
75
- background: transparent url(cedar-display-tools-sprite.png) scroll no-repeat 0 0;
76
- }
77
-
78
- .cedar-cms-icon-right {
79
- border-right: 0;
80
- border-left: 1px solid #fff;
81
- }
82
-
83
-
84
- .cedar-cms-icon-edit {
85
- background-position: -89px -20px;
86
- }