Skip to content

Commit

Permalink
Merge pull request #843 from superdesk/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
nistormihai committed Aug 26, 2014
2 parents dc0f694 + 17e4b4a commit cb8ac90
Show file tree
Hide file tree
Showing 33 changed files with 225 additions and 48 deletions.
1 change: 1 addition & 0 deletions plugins/embed/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ docs/docco/scripts/**
!docs/docco/scripts/index.html
docs/docco-husky/**
screenshots/
coverage/
3 changes: 3 additions & 0 deletions plugins/embed/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ before_script:
cache:
- node_modules
- gui-resources/scripts/js/bower_components

after_success:
- grunt coveralls
2 changes: 2 additions & 0 deletions plugins/embed/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ module.exports = function(grunt) {
}
});

grunt.loadNpmTasks('grunt-karma-coveralls');

grunt.registerTask('hint', ['jshint:all', 'jscs:all']);
grunt.registerTask('test', ['karma:once', 'mochaTest:all']);
grunt.registerTask('build', ['hint', 'less:all', 'requirejs']);
Expand Down
1 change: 1 addition & 0 deletions plugins/embed/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Plugin for Superdesk Live Blog embed
[![Build Status](https://travis-ci.org/liveblog/plugin-liveblog-embed-server.png?branch=master)](https://travis-ci.org/liveblog/plugin-liveblog-embed-server)
[![Coverage Status](https://coveralls.io/repos/liveblog/plugin-liveblog-embed-server/badge.png?branch=master)](https://coveralls.io/r/liveblog/plugin-liveblog-embed-server?branch=master)

This plugin for Sourcefabric’s Superdesk, first released as part of Live Blog 2.0 beta, provides a solution for ensuring that blog content is indexable by search engines. A static HTML version of each blog is now generated on the server. As a publisher, you can set your CMS to request this HTML and insert it into an article page before that page is delivered to the browser. When search engine crawlers visit the page, they will see the latest posts from the embedded blog and index them. New posts are automatically added to the page via Javascript.

Expand Down
2 changes: 0 additions & 2 deletions plugins/embed/__plugin__/embed/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ def publishJS():
def updateDemoEmbedFile():
if not publish_gui_resources(): return # No publishing is allowed
moduleName, modulePath = __name__, __file__
print('-------------------------------------1:', moduleName, modulePath)
for _k in range(0, moduleName.count('.') + 1):
modulePath = os.path.dirname(modulePath)
print('-------------------------------------2:', modulePath)
path = os.path.join(modulePath, 'node_modules')

cdmGUI().publishFromDir('lib/embed/scripts/js/node_modules', path)
Expand Down
10 changes: 8 additions & 2 deletions plugins/embed/gui-resources/scripts/js/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,14 @@ server.get('/', function(req, res) {
res.redirect(config.paths.docco);
}
} else {
cp.exec('nodejs ' + path.join(__dirname, 'app.js'), {env: {NODE_ENV: 'production', liveblog: JSON.stringify(liveblog)}}, function(error, stdout, stderr) {
var out = JSON.parse(stdout);
cp.exec('"' + process.execPath + '" ' + path.join(__dirname, 'app.js'), {env: {NODE_ENV: 'production', liveblog: JSON.stringify(liveblog)}}, function(error, stdout, stderr) {
var out = {};
try {
out = JSON.parse(stdout);
} catch (jsonerror) {
out.code = 400;
out.body = jsonerror.message;
}
res.send(out.code, out.body);
});
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/embed/gui-themes/themes/base/container.dust
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
{/status}

{<statusNewPost}
<p data-gimme="posts.pending-message-placeholder"></p>
<p data-gimme="posts.pending-message-placeholder" class="new-posts-label"></p>
{/statusNewPost}

{<actionTotop}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a data-gimme="posts.pending-message" class="new-posts-label"></a>
<a data-gimme="posts.pending-message"></a>
12 changes: 7 additions & 5 deletions plugins/embed/gui-themes/themes/default/base-theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,16 @@ background: #f0f0f0;
left: 50%;
margin-left: -30px;
background: #3676be;
color: #fff;
padding: 0 5px;
height: @postlist-header-height - 8;
line-height: @postlist-header-height - 8 ;
text-decoration: none;
font-size: 10px;
font-weight: bold;
display: none;
a {
color: #fff;
padding: 0 5px;
height: @postlist-header-height - 8;
line-height: @postlist-header-height - 8;
display: none;
}
&:hover {
cursor: default;
background: #225c9c;
Expand Down
2 changes: 1 addition & 1 deletion plugins/embed/gui-themes/themes/default/liveblog.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/embed/gui-themes/themes/generic/liveblog.css

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions plugins/embed/gui-themes/themes/generic/liveblog.less
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,16 @@
left: 50%;
margin-left: -30px;
background: #3676be;
color: #fff;
padding: 0 5px;
height: @postlist-header-height - 8;
line-height: @postlist-header-height - 8 ;
text-decoration: none;
font-size: 10px;
font-weight: bold;
display: none;
a {
color: #fff;
padding: 0 5px;
height: @postlist-header-height - 8;
line-height: @postlist-header-height - 8;
display: none;
}
&:hover {
cursor: default;
background: #225c9c;
Expand Down
21 changes: 21 additions & 0 deletions plugins/embed/gui-themes/themes/ksml-light/desktop/base-theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,27 @@ background: #fff;
left: 0;
}
}
.new-posts-label {
position: absolute;
top: 4px;
left: 50%;
margin-left: -30px;
background: @lb-color;
text-decoration: none;
font-size: 10px;
font-weight: bold;
a {
color: #fff;
padding: 0 5px;
height: @postlist-header-height - 8;
line-height: @postlist-header-height - 8;
display: none;
}
&:hover {
cursor: default;
background: darken(@lb-color,10%);
}
}
}
.liveblog-content-top {
.button {
Expand Down

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions plugins/embed/gui-themes/themes/ksml/desktop/base-theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,27 @@ background: #fff;
left: 0;
}
}
.new-posts-label {
position: absolute;
top: 4px;
left: 50%;
margin-left: -30px;
background: @lb-color;
text-decoration: none;
font-size: 10px;
font-weight: bold;
a {
color: #fff;
padding: 0 5px;
height: @postlist-header-height - 8;
line-height: @postlist-header-height - 8;
display: none;
}
&:hover {
cursor: default;
background: darken(@lb-color,10%);
}
}
}
.liveblog-content-top {
.button {
Expand Down
2 changes: 1 addition & 1 deletion plugins/embed/gui-themes/themes/ksml/desktop/liveblog.css

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions plugins/embed/gui-themes/themes/rp/desktop/liveblog.css
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@
margin-bottom:20px;
display: none;
}

.refresh-block-container:hover {
cursor: pointer;
}

.refresh-block {
background: #fff5e2;
border: 1px solid #ffb200;
Expand Down
21 changes: 21 additions & 0 deletions plugins/embed/gui-themes/themes/sasa-light/desktop/base-theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,27 @@ background: #fff;
left: 0;
}
}
.new-posts-label {
position: absolute;
top: 4px;
left: 50%;
margin-left: -30px;
background: @lb-color;
text-decoration: none;
font-size: 10px;
font-weight: bold;
a {
color: #fff;
padding: 0 5px;
height: @postlist-header-height - 8;
line-height: @postlist-header-height - 8;
display: none;
}
&:hover {
cursor: default;
background: darken(@lb-color,10%);
}
}
}
.liveblog-content-top {
.button {
Expand Down

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions plugins/embed/gui-themes/themes/sasa/desktop/base-theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,27 @@ background: #fff;
left: 0;
}
}
.new-posts-label {
position: absolute;
top: 4px;
left: 50%;
margin-left: -30px;
background: @lb-color;
text-decoration: none;
font-size: 10px;
font-weight: bold;
a {
color: #fff;
padding: 0 5px;
height: @postlist-header-height - 8;
line-height: @postlist-header-height - 8;
display: none;
}
&:hover {
cursor: default;
background: darken(@lb-color,10%);
}
}
}
.liveblog-content-top {
.button {
Expand Down
2 changes: 1 addition & 1 deletion plugins/embed/gui-themes/themes/sasa/desktop/liveblog.css

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions plugins/embed/gui-themes/themes/satakansa/desktop/base-theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,27 @@ background: #fff;
left: 0;
}
}
.new-posts-label {
position: absolute;
top: 4px;
left: 50%;
margin-left: -30px;
background: @lb-color;
text-decoration: none;
font-size: 10px;
font-weight: bold;
a {
color: #fff;
padding: 0 5px;
height: @postlist-header-height - 8;
line-height: @postlist-header-height - 8;
display: none;
}
&:hover {
cursor: default;
background: darken(@lb-color,10%);
}
}
}
.liveblog-content-top {
.button {
Expand Down

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions plugins/embed/gui-themes/themes/stt-fnb/desktop/base-theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,27 @@
left: 0;
}
}
.new-posts-label {
position: absolute;
top: 4px;
left: 50%;
margin-left: -30px;
background: @lb-color;
text-decoration: none;
font-size: 10px;
font-weight: bold;
a {
color: #fff;
padding: 0 5px;
height: @postlist-header-height - 8;
line-height: @postlist-header-height - 8;
display: none;
}
&:hover {
cursor: default;
background: darken(@lb-color,10%);
}
}
}
.liveblog-content-top {
.button {
Expand Down

Large diffs are not rendered by default.

26 changes: 16 additions & 10 deletions plugins/embed/gui-themes/themes/stt/desktop/base-theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,24 @@
}
}
.new-posts-label {
margin-left: 50px;
font-size: 11px;
color: #fff;
position: absolute;
top: 4px;
left: 50%;
margin-left: -30px;
background: @lb-color;
text-decoration: none;
font-size: 10px;
font-weight: bold;
padding: 0;
height: 30px;
line-height: 30px;
display: inline-block;
float: left;
a {
color: #fff;
padding: 0 5px;
height: @postlist-header-height - 8;
line-height: @postlist-header-height - 8;
display: none;
}
&:hover {
cursor: pointer;
background: #464646;
cursor: default;
background: darken(@lb-color,10%);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/embed/gui-themes/themes/stt/desktop/liveblog.css

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions plugins/embed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"devDependencies": {
"chai": "^1.9.1",
"docco": "^0.6.2",
"grunt": "^0.4.5",
"grunt-contrib-jshint": "^0.8.0",
"grunt-contrib-less": "^0.10.0",
"grunt-contrib-requirejs": "^0.4.1",
Expand All @@ -62,11 +63,13 @@
"grunt-githooks": "^0.3.1",
"grunt-jscs": "^0.6.2",
"grunt-karma": "^0.8.2",
"grunt-karma-coveralls": "^2.5.1",
"grunt-mocha-test": "^0.10.2",
"grunt-open": "^0.2.3",
"jssha": "^1.5.0",
"karma": "^0.12.9",
"karma-chrome-launcher": "^0.1.3",
"karma-coverage": "^0.2.6",
"karma-jasmine": "~0.1.0",
"karma-junit-reporter": "^0.2.2",
"karma-mocha": "^0.1.3",
Expand Down
9 changes: 9 additions & 0 deletions plugins/embed/tasks/options/coveralls.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
options: {
debug: true,
coverage_dir: 'coverage/',
dryRun: true,
force: true,
recursive: true
}
};
17 changes: 12 additions & 5 deletions plugins/embed/test/client/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,20 @@ module.exports = function(config) {
'gui-resources/scripts/js/main.js'
],

// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {},

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
reporters: ['progress', 'coverage'],

// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'gui-resources/scripts/js/!(build|bower_components)/*.js': 'coverage'
},
coverageReporter: {
type: 'lcov',
dir: 'coverage/'
},

// options for junit reporter, used by Bamboo
junitReporter: {
Expand All @@ -67,5 +73,6 @@ module.exports = function(config) {
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false

});
};
Loading

0 comments on commit cb8ac90

Please sign in to comment.