forked from Joao-S-Martins/streamhub-permalink
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f762760
commit 00d4781
Showing
17 changed files
with
508 additions
and
520 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
"build": "npm run-script clean-build && mkdir -p dist && ./node_modules/requirejs/bin/r.js -o ./tools/build.conf.js", | ||
"build-css": "npm run build-sdk && npm run copy-dists", | ||
"clean-build": "rm -rf dist", | ||
"hint": "./node_modules/jshint/bin/jshint src/ tests/spec; echo", | ||
"hint": "./node_modules/.bin/lfeslint", | ||
"test": "./node_modules/karma/bin/karma start tests/karma.conf.js --singleRun", | ||
"test-ci": "./node_modules/karma/bin/karma start tools/karma.conf.js --singleRun --reporters dots,junit,coverage && npm run send-to-coveralls", | ||
"karma": "./node_modules/karma/bin/karma start tools/karma.conf.js", | ||
|
@@ -34,18 +34,29 @@ | |
"devDependencies": { | ||
"coveralls": "~2.3.0", | ||
"jsdoc": "git://github.com/jsdoc3/jsdoc.git", | ||
"jshint": "~2.1.0", | ||
"karma": "0.10.5", | ||
"karma-cajon": "*", | ||
"karma-chrome-launcher": "0.1.0", | ||
"karma-coffee-preprocessor": "0.1.0", | ||
"karma-coverage": "0.1.2", | ||
"karma-jasmine": "0.1.3", | ||
"karma-phantomjs-launcher": "0.1.0", | ||
"karma-requirejs": "0.2.0", | ||
"karma-script-launcher": "0.1.0", | ||
"karma": "~0.10.5", | ||
"karma-cajon": "0.0.1", | ||
"karma-chrome-launcher": "~0.1.0", | ||
"karma-coverage": "~0.1.2", | ||
"karma-jasmine": "~0.1.3", | ||
"karma-phantomjs-launcher": "~0.1.0", | ||
"karma-requirejs": "~0.2.0", | ||
"karma-script-launcher": "~0.1.0", | ||
"lfcdn": "git+ssh://[email protected]:Livefyre/lfcdn.git", | ||
"lfeslint": "git+ssh://[email protected]/Livefyre/lfeslint.git", | ||
"phantomjs": "~1.9.2-2", | ||
"requirejs": "2.1.9", | ||
"rework": "git://github.com/gobengo/rework.git" | ||
}, | ||
"lfeslint": { | ||
"ignore": [ | ||
"lib/*" | ||
], | ||
"global": [ | ||
"define", | ||
"expect", | ||
"jasmine", | ||
"requirejs" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
'use strict' | ||
'use strict'; | ||
|
||
var Modal = require('streamhub-sdk/modal'); | ||
var permalinkViewFactory = require('streamhub-permalink/permalink-view-factory'); | ||
var styles = require('css!./css/styles.css'); | ||
var sdkStyles = require('css!streamhub-sdk/css/style.css'); | ||
require('css!./css/styles.css'); | ||
require('css!streamhub-sdk/css/style.css'); | ||
var packageAttribute = require('./package-attribute'); | ||
|
||
var defaultPermalinkContentHandler = function (content) { | ||
//Get the view for the content | ||
var cvf = permalinkViewFactory(); | ||
var contentView = cvf.createContentView(content, { | ||
sharer: { canShare: function() {} } | ||
}); | ||
|
||
//Show the contentView in a modal | ||
var contentModalView = new Modal(); | ||
|
||
packageAttribute.decorateModal(contentModalView); | ||
contentModalView.show(contentView, true); | ||
|
||
|
||
var closeBtn = contentView.el.parentElement.parentElement.querySelector('.hub-modal-close'); | ||
closeBtn.className += ' permalink-modal-close fycon-x'; | ||
closeBtn.innerHTML = ''; | ||
contentView.$el.css('max-width', '640px');//Necessary evil, until CSS things are sorted | ||
contentView.$el.addClass(defaultPermalinkContentHandler.CLASSES.PERMALINK); | ||
contentView.$el.find('.content-footer').append('\ | ||
<div class="hub-modal-content-permalink">\ | ||
<button class="permalink-button" type="button">View Context</button>\ | ||
</div>\ | ||
'); | ||
|
||
this.modalView = contentModalView; | ||
// Get the view for the content | ||
var cvf = permalinkViewFactory(); | ||
var contentView = cvf.createContentView(content, { | ||
sharer: {canShare: function () {}} | ||
}); | ||
|
||
// Show the contentView in a modal | ||
var contentModalView = new Modal(); | ||
|
||
packageAttribute.decorateModal(contentModalView); | ||
contentModalView.show(contentView, true); | ||
|
||
|
||
var closeBtn = contentView.el.parentElement.parentElement.querySelector('.hub-modal-close'); | ||
closeBtn.className += ' permalink-modal-close fycon-x'; | ||
closeBtn.innerHTML = ''; | ||
contentView.$el.css('max-width', '640px'); // Necessary evil, until CSS things are sorted | ||
contentView.$el.addClass(defaultPermalinkContentHandler.CLASSES.PERMALINK); | ||
contentView.$el.find('.content-footer').append('\ | ||
<div class="hub-modal-content-permalink">\ | ||
<button class="permalink-button" type="button">View Context</button>\ | ||
</div>\ | ||
'); | ||
|
||
this.modalView = contentModalView; | ||
}; | ||
|
||
defaultPermalinkContentHandler.CLASSES = { | ||
PERMALINK: 'permalink-content' | ||
PERMALINK: 'permalink-content' | ||
}; | ||
|
||
module.exports = defaultPermalinkContentHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
var permalink = {} | ||
var permalink = {}; | ||
|
||
/** | ||
* Keys for the different types of permalinkable Livefyre items. | ||
* @type {Object.<string, string>} | ||
*/ | ||
permalink.KEYS = { | ||
CONTENT: 'content', | ||
CONTENT_OPTIONS: 'content-options' | ||
CONTENT: 'content', | ||
CONTENT_OPTIONS: 'content-options' | ||
}; | ||
|
||
module.exports = permalink; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.