This commit is contained in:
Bernhard Posselt 2014-05-23 17:55:30 +02:00
Родитель 4fa9c6d6cf
Коммит 6208debf04
11 изменённых файлов: 87 добавлений и 131 удалений

Просмотреть файл

@ -21,10 +21,6 @@ install:
- export CHROME_BIN=/usr/bin/chromium-browser
- sudo easy_install3 pip # ubuntu 12.04 only
- sudo pip3 install ocdev
# get a newer phantomjs version
- wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2 # ubuntu 12.04 only
- tar xjf phantomjs-1.9.7-linux-x86_64.tar.bz2 # ubuntu 12.04 only
- sudo ln -s $(pwd)/phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/bin/phantomjs # ubuntu 12.04 only
# clone core
- ocdev setup core --dir owncloud
- mv news owncloud/apps/

Просмотреть файл

@ -7,12 +7,6 @@
* @author Bernhard Posselt <dev@bernhard-posselt.com>
* @copyright Bernhard Posselt 2014
*/
.loading-icon {
background-image: url('../img/loading.gif');
background-position: center;
background-repeat: no-repeat;
}
#global-loading {
width: 100%;
height: 100%;
@ -35,20 +29,16 @@
display:none;
position: relative;
top:0;
-moz-border-radius-bottomleft:1em;
-webkit-border-bottom-left-radius:1em;
border-bottom-left-radius:1em;
-moz-border-radius-bottomright:1em;
-webkit-border-bottom-right-radius:1em;
border-bottom-right-radius:1em;
}
#undo a {
font-weight: bold;
}
#undo a {
font-weight: bold;
}
#undo a:hover {
text-decoration: underline;
}
#undo a:hover {
text-decoration: underline;
}

Просмотреть файл

@ -31,24 +31,8 @@
padding-left: 10px;
}
.upload-icon,
.download-icon {
padding-left: 25px;
background-repeat: no-repeat;
background-position: 5px center;
}
.upload-icon {
background-image: url('../img/upload.svg');
}
.download-icon {
background-image: url('../img/download.svg');
}
#app-settings .importing {
background-image: url('../img/loading.gif');
background-repeat: no-repeat;
.button-icon-label {
background-position: 5px center;
background-size: 16px;
padding-left: 25px;
}

Просмотреть файл

@ -150,16 +150,11 @@ module.exports = function (grunt) {
}
},
protractor: {
phantomjs: {
firefox: {
options: {
configFile: 'protractor.phantomjs.conf.js'
configFile: 'protractor.conf.js'
}
},
chrome: {
options: {
configFile: 'protractor.chrome.conf.js'
}
}
},
connect: {
server: {
@ -175,7 +170,7 @@ module.exports = function (grunt) {
grunt.registerTask('dev', ['watch:concat']);
grunt.registerTask('test', ['karma:unit']);
grunt.registerTask('php', ['watch:phpunit']);
grunt.registerTask('e2e', ['protractor_webdriver', 'connect', 'protractor:chrome']);
grunt.registerTask('e2e', ['protractor_webdriver', 'connect', 'protractor']);
grunt.registerTask('ci-unit', ['default', 'karma:continuous']);
grunt.registerTask('ci-e2e', ['protractor_webdriver', 'connect', 'protractor:phantomjs']);
grunt.registerTask('ci-e2e', ['protractor_webdriver', 'connect', 'protractor']);
};

Просмотреть файл

@ -882,6 +882,22 @@ var $__build_47_app__ = function () {
}
});
}(window, document, jQuery));
(function (window, document, $) {
'use strict';
$(document).ready(function () {
var buttons = $(':not([data-app-slide-toggle-area=""])');
$(document).click(function (event) {
buttons.each(function (index, button) {
console.log(button);
var area = $(button).data('app-slide-toggle-area');
if (button === event.target) {
console.log(area);
event.stopPropagation();
}
});
});
});
}(window, document, jQuery));
var call = Function.prototype.call.bind(Function.prototype.call);
var hasOwn = Object.prototype.hasOwnProperty;
window.items = function (obj) {

36
js/gui/app.js Normal file
Просмотреть файл

@ -0,0 +1,36 @@
/**
* ownCloud - core
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Bernhard Posselt <dev@bernhard-posselt.com>
* @copyright Bernhard Posselt 2014
*/
(function (window, document, $) {
'use strict';
$(document).ready(function () {
var buttons = $('[data-app-slide-toggle-area]:not([data-app-slide-toggle-area=""])');
$(document).click(function (event) {
buttons.each(function (index, button) {
console.log(button);
var area = $(button).data('app-slide-toggle-area');
// if the
if (button === event.target) {
console.log(area);
event.stopPropagation();
}
});
});
});
}(window, document, jQuery));

Просмотреть файл

@ -1,41 +0,0 @@
/**
* ownCloud - News
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Bernhard Posselt <dev@bernhard-posselt.com>
* @copyright Bernhard Posselt 2014
*/
var baseUrl = 'http://localhost';
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['tests/e2e/**/*.js'],
onPrepare: function () {
'use strict';
browser.ignoreSynchronization = true;
browser.get(baseUrl + '/owncloud/index.php');
browser.findElement(By.id('user')).sendKeys('admin');
browser.findElement(By.id('password')).sendKeys('admin');
browser.findElement(By.id('submit')).click();
browser.driver.wait(function () {
return browser.driver.getCurrentUrl().then(function (url) {
var regex = /apps/;
return regex.test(url);
});
});
browser.get(baseUrl + '/owncloud/index.php/apps/news/');
browser.driver.wait(function () {
return browser.driver.getCurrentUrl().then(function (url) {
var regex = /apps\/news/;
return regex.test(url);
});
});
},
baseUrl: baseUrl
};

Просмотреть файл

@ -38,7 +38,7 @@ exports.config = {
});
},
capabilities: {
browserName: 'phantomjs',
browserName: 'firefox',
version: '',
platform: 'ANY'
},

Просмотреть файл

@ -10,28 +10,21 @@
\OCP\Util::addScript('news', 'build/app');
\OCP\Util::addStyle('news', 'bootstrap/tooltip');
\OCP\Util::addStyle('news', 'navigation');
\OCP\Util::addStyle('news', 'app');
\OCP\Util::addStyle('news', 'content');
//\OCP\Util::addStyle('news', 'navigation');
//\OCP\Util::addStyle('news', 'content');
\OCP\Util::addStyle('news', 'settings');
?>
<div id="app" ng-app="News" ng-cloak ng-controller="AppController as App">
<div id="global-loading" class="loading-icon" ng-show="App.loading.isLoading('global')"></div>
<!--
<div id="undo-container">
<div undo-notification id="undo">
<a href="#"><?php p($l->t('Undo deletion of %s', '{{ getCaption() }}')); ?></a>
</div>
</div>
<news-translate key="appName"><?php p($l->t('News')); ?></news-translate>
-->
<div id="global-loading" class="icon-loading" ng-show="App.loading.isLoading('global')"></div>
<!-- navigation -->
<div id="app-navigation" ng-controller="NavigationController" ng-hide="App.loading.isLoading('global')">
<ul class="with-icon" data-id="0" droppable>
<ul class="with-icon" data-folder-id="0" news-droppable>
<?php //print_unescaped($this->inc('part.addnew')) ?>
<?php //print_unescaped($this->inc('part.feed.unread')) ?>
<?php //print_unescaped($this->inc('part.feed.starred')) ?>
@ -45,25 +38,9 @@
</div>
<!-- content -->
<script type="text/ng-template" id="content.html"><?php print_unescaped($this->inc('part.content')) ?></script>
<div id="app-content" ng-hide="App.loading.isLoading('global')" ng-view></div>
<!--
<div id="app-content" ng-class="{
loading: isLoading(),
autopaging: isAutoPaging()
}"
ng-controller="ItemController"
ng-show="initialized && !feedBusinessLayer.noFeeds()"
news-item-scroll="true"
item-shortcuts
news-pull-to-refresh="loadNew()"
tabindex="-1"
news-auto-focus>
<?php print_unescaped($this->inc("part.items")); ?>
</div>
-->
<div id="app-content" ng-class="{'icon-loading': App.loading.isLoading('content')}" ng-hide="App.loading.isLoading('global')" ng-view></div>
</div>

Просмотреть файл

@ -1,11 +1,7 @@
<div id="app-settings-header">
<button name="app settings"
class="settings-button"
news-slide-up="{
selector: '#app-settings-content',
hideOnFocusLost: true,
cssClass: 'opened'
}"></button>
data-apps-slide-up-area="#app-settings-content"></button>
</div>
<div id="app-settings-content">
@ -41,14 +37,14 @@
news-read-file="Settings.importOpml($fileContent)"/>
<button title="<?php p($l->t('Import')); ?>"
class="upload-icon svg"
class="icon-upload svg button-icon-label"
news-trigger-click="#opml-upload">
<?php p($l->t('Import')); ?>
</button>
<a title="<?php p($l->t('Export')); ?>"
class="button download-icon svg"
class="button icon-download svg button-icon-label"
href="<?php p(\OCP\Util::linkToRoute('news.export.opml')); ?>"
target="_blank"
ng-show="feedSize() > 0">
@ -56,7 +52,7 @@
</a>
<button
class="download-icon svg"
class="icon-download svg button-icon-label"
title="<?php p($l->t('Export')); ?>"
ng-hide="feedSize() > 0"
disabled>
@ -78,21 +74,21 @@
news-read-file="Settings.importArticles($fileContent)"/>
<button title="<?php p($l->t('Import')); ?>"
class="upload-icon svg"
ng-class="{loading: Settings.importing}"
class="icon-upload svg button-icon-label"
ng-class="{'icon-loading-small': Settings.importing}"
ng-disabled="importing"
news-trigger-click="#article-upload">
<?php p($l->t('Import')); ?>
</button>
<a title="<?php p($l->t('Export')); ?>" class="button download-icon svg"
<a title="<?php p($l->t('Export')); ?>" class="button icon-download svg button-icon-label"
href="<?php p(\OCP\Util::linkToRoute('news.export.articles')); ?>"
target="_blank"
ng-show="feedSize() > 0">
<?php p($l->t('Export')); ?>
</a>
<button
class="download-icon svg"
class="icon-download svg button-icon-label"
title="<?php p($l->t('Export')); ?>"
ng-hide="feedSize() > 0"
disabled>

7
templates/part.undo.php Normal file
Просмотреть файл

@ -0,0 +1,7 @@
<div id="undo-container">
<div undo-notification id="undo">
<a href="#"><?php p($l->t('Undo deletion of %s', '{{ getCaption() }}')); ?></a>
</div>
</div>
<news-translate key="appName"><?php p($l->t('News')); ?></news-translate>