diff --git a/docs/ui-guide/index.html b/docs/ui-guide/index.html deleted file mode 100644 index ba2daca312..0000000000 --- a/docs/ui-guide/index.html +++ /dev/null @@ -1,1638 +0,0 @@ - - - - - Superdesk Docs - - - - - -
- - - - - - diff --git a/docs/ui-guide/index.js b/docs/ui-guide/index.js deleted file mode 100644 index 6dac0b2397..0000000000 --- a/docs/ui-guide/index.js +++ /dev/null @@ -1,165 +0,0 @@ -/** - * This file is part of Superdesk. - * - * Copyright 2013, 2014 Sourcefabric z.u. and contributors. - * - * For the full copyright and license information, please see the - * AUTHORS and LICENSE files distributed with this source code, or - * at https://www.sourcefabric.org/superdesk/license - */ - -import './index.scss'; - -import 'jquery-ui/jquery-ui'; -import 'jquery-jcrop'; -import 'jquery-gridster'; -import 'moment-timezone'; -import 'lodash'; -import 'bootstrap'; -import 'angular'; -import 'angular-bootstrap-npm'; -import 'angular-resource'; -import 'angular-route'; -import 'angular-gettext'; -import 'angular-mocks'; -import 'angular-animate'; -import 'angular-embedly'; -import 'angular-embed'; -import 'angular-contenteditable'; -import 'angular-vs-repeat'; -import 'ng-file-upload'; -import 'exif-js'; -import 'raven-js'; -import 'rangy'; -import 'rangy-saverestore'; -import 'ment.io'; - -import 'core/keyboard'; -import 'core/auth'; -import 'core/datetime'; -import 'core/directives'; -import 'core/ui'; -import 'core/services'; -import 'core/superdesk'; - -import './dist/templates-cache-docs.generated'; - -var app = angular.module('superdesk.docs', [ - 'ngRoute', - 'ngResource', - 'ui.bootstrap', - - 'superdesk.core.datetime', - 'superdesk.core.ui', - 'superdesk.core.services.modal', - - 'superdesk.core.keyboard', - 'superdesk.core.directives.autofocus', - 'superdesk.core.directives.throttle', - 'superdesk.core.directives.sort', - 'superdesk.core.links', - 'superdesk.core.directives.check', - 'superdesk.core.directives.confirm', - 'superdesk.core.directives.select', - 'superdesk.core.directives.permissions', - 'superdesk.core.avatar', - 'superdesk.core.directives.dragdrop', - 'superdesk.core.directives.typeahead', - 'superdesk.core.directives.slider', - 'superdesk.core.directives.searchList' -]); - -MainDocsView.$inject = ['$location', '$anchorScroll', 'asset']; -function MainDocsView($location, $anchorScroll) { - return { - templateUrl: 'main.html', - link: function(scope, elem, attrs) { - scope.scrollTo = function(id) { - $location.hash(id); - $anchorScroll(); - }; - - //Modals - scope.modalActive = false; - - scope.openModal = function() { - scope.modalActive = true; - }; - - scope.closeModal = function() { - scope.modalActive = false; - }; - - //Select boxes - scope.opts = ['Serbia', 'Czech Republic', 'Germany', 'Australia']; - - //Typeahead - scope.taTerms = ['Serbia', 'Czech Republic', 'Germany', 'Australia', 'Canada', 'Russia', 'Italy', 'Egypt', 'China']; - scope.taSelected = null; - scope.taItems = []; - - scope.taSearch = function(term) { - scope.taItems = _.filter(scope.taTerms, function(t) { - return t.toLowerCase().indexOf(term.toLowerCase()) !== -1; - }); - return scope.taItems; - }; - - scope.taSelect = function(term) { - scope.taSelected = term; - }; - - //datepicker - scope.dateNow = moment().utc().format(); - - //timepicker - scope.timeNow = moment().utc().format('HH:mm:ss'); - } - }; -} - -app.directive('sdDocs', MainDocsView); -app.directive('prettyprint', function() { - return { - restrict: 'C', - link: function postLink(scope, element, attrs) { - - //remove leading whitespaces - var str = element[0].innerHTML; - var pos = 0; var sum = 0; - while (str.charCodeAt(pos) === 32) { - sum = sum + 1; - pos = pos + 1; - } - var pattern = '\\s{' + sum + '}'; - var spaces = new RegExp(pattern, 'g'); - element[0].innerHTML = str.replace(spaces, '\n'); - - //remove ng-non-bindable from code - element.find('[ng-non-bindable=""]').each(function(i, val) { - $(val).removeAttr('ng-non-bindable'); - }); - - var langExtension = attrs['class'].match(/\blang(?:uage)?-([\w.]+)(?!\S)/); - if (langExtension) { - langExtension = langExtension[1]; - } - element.html(window.prettyPrintOne(_.escape(element.html()), langExtension, true)); - } - - }; -}); - -/* globals __SUPERDESK_CONFIG__: true */ -angular.module('superdesk.config').constant('config', __SUPERDESK_CONFIG__); - -var body = angular.element('body'); -body.ready(function () { - angular.bootstrap(body, [ - 'superdesk.docs', - 'superdesk.templates-cache', - 'superdesk.config' - ]); -}); - -export default app; diff --git a/docs/ui-guide/index.scss b/docs/ui-guide/index.scss deleted file mode 100644 index f0d45429f8..0000000000 --- a/docs/ui-guide/index.scss +++ /dev/null @@ -1,311 +0,0 @@ -@import '~app.scss'; -@import '~mixins.scss'; -@import '~variables.scss'; - -.com { color: #93a1a1; } -.lit { color: #195f91; } -.pun, .opn, .clo { color: #93a1a1; } -.fun { color: #dc322f; } -.str, .atv { color: #D14; } -.kwd, .linenums .tag { color: #1e347b; } -.typ, .atn, .dec, .var { color: teal; } -.pln { color: #48484c; } - -.prettyprint { - padding: 8px; - background-color: #f7f7f9; - border: 1px solid #e1e1e8; -} -.prettyprint.linenums { - -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; - -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; - box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; -} - -/* Specify class=linenums on a pre to get line numbering */ -ol.linenums { - margin: 0 0 0 33px; /* IE indents via margin-left */ -} -ol.linenums li { - padding-left: 12px; - color: #bebec5; - line-height: 18px; - text-shadow: 0 1px 0 #fff; -} -ol.linenums li .pln:first-child { - // width: 0; - display: inline-block; -} -ol.linenums li:last-child { - display: none; -} - -#documentation { - code { - padding: 0px 4px; - margin: 0 2px; - white-space: nowrap; - border: 1px solid #e7dab2; - background: #f3eedf; - color: #2b230b; - border-radius: 2px; - } - .badge { - padding: 3px 7px; - border-radius: 2px; - background: #4285f4; - color: #fff; - font-weight: bold; - } - .docs-header { - text-shadow: 0 1px 0 #fff; - border-bottom: 1px solid #e0e0e0; - background-color: #f3f3f3; - background-image: -moz-linear-gradient(#f9f9f9, #f3f3f3); - background-image: -webkit-linear-gradient(#f9f9f9, #f3f3f3); - background-image: linear-gradient(#f9f9f9, #f3f3f3); - background-repeat: repeat-x; - height: 45px; - position: fixed; - left: 0; right: 0; top: 0; - z-index: 10; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - box-shadow: 0 0 4px 0 #d0d0d0; - h1 { - font-size: 16px; - font-weight: 400; - color: #787878; - float:left; - line-height: 30px; - margin: 8px 0 0 10px; - span{ - color:#009360; - font-weight: 600; - } - } - nav { - margin-left: 100px; - height: 45px; - line-height: 45px; - float: left; - a { - margin-right: 20px; - font-size: 13px; - font-weight: 600; - color: #444; - text-decoration: none; - text-shadow: 1px 1px 1px #fff; - &.active { - font-weight: 700; - } - &:hover { - color: #888; - } - } - } - } - .docs-content-left { - position: fixed; - left: 0; bottom: 0; top: 45px; - width: 250px; - border-right: 1px solid #e5e5e5; - z-index: 9; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - background: #fff; - h1 { - padding: 5px 15px; - border-bottom: 1px solid #e5e5e5; - font-size: 13px; - color:#989898; - text-transform: uppercase; - } - } - .docs-content-main { - position: fixed; - bottom: 0; right: 0; top: 45px; left:250px; - z-index: 8; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - background: #fff; - &.classic-page { - bottom: 0; right: 0; top: 45px; left:0; - } - } - .classic-page .docs-content-scroller { - max-width: 900px; - margin: 20px auto; - } - .docs-topic-list { - li { - a { - padding: 10px 15px; - border-bottom: 1px solid #e5e5e5; - color : #666; - font-size: 13px; - display: block; - cursor: pointer; - &:hover { - background: #fcf8e9; - text-decoration: none; - } - } - } - } - .docs-content-scroller { - position: absolute; - bottom: 0; right: 0; top: 0; left:0; - padding: 20px; - z-index: 8; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - overflow-y: auto; - } - pre { - margin: 5px 0; - } - .docs-main-list { - > li { - margin-bottom: 30px; - p { - font-size: 14px; - code { - font-size: 13px; - } - } - } - .link-holder { - margin-bottom: 20px; - display: block; - height: 1px; - } - .docs-title { - font-weight: 700; - padding-bottom: 10px; - margin-bottom: 20px; - border-bottom: 1px solid #d0d0d0; - font-size: 24px; - line-height: 30px; - color:#444; - } - .docs-subtitle { - font-weight: 600; - padding-bottom: 8px; - margin-bottom: 15px; - margin-top: 30px; - border-bottom: 1px solid #d0d0d0; - font-size: 18px; - line-height: 25px; - color:#333; - } - } - .docs-preview { - margin: 15px 0; - .preview-area{ - border: 1px solid #ccc; - border-bottom: 0; - border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - -webkit-border-radius: 5px 5px 0 0; - background: #fff; - padding: 10px; - } - pre { - margin-top: 0; - border-radius: 5px 5px 5px 5px; - -moz-border-radius: 5px 5px 5px 5px ; - -webkit-border-radius: 5px 5px 5px 5px ; - border: 1px solid #d0d0d0; - padding: 10px 0; - background: #f8f8f8; - } - .preview-area + pre { - border-radius: 0 0 5px 5px; - -moz-border-radius: 0 0 5px 5px ; - -webkit-border-radius: 0 0 5px 5px ; - } - } - .description-list { - display: flex; - flex-wrap: wrap; - li { - width: 300px; - max-width: 25%; - flex: 0 0 auto; - padding: 0 15px 15px 0; - @include border-box(); - img { - margin-bottom: 10px; - @include border-radius(3px); - max-width: 100%; - } - p { - padding: 0 2px 7px 2px; - line-height: 22px; - } - } - } - .simple-list { - li { - line-height: 22px; - } - } - .docs-navbar { - padding: 10px 20px !important; - min-height: 28px; - } - .avatar-docs { - .avatar-types { - .preview-area { - > div { - margin-bottom: 12px; - @include clearfix(); - > figure { - margin-right: 10px; - } - > span { - vertical-align: sub; - } - } - } - } - } - .iconFont-list { - display: flex; - flex-wrap: wrap; - li { - width: 240px; - max-width: 25%; - flex: 0 0 auto; - padding: 10px 0; - margin: 0 40px 30px 20px; - @include border-box(); - @include box-shadow(inset 0 -1px #e7e7e7); - span { - font-size: 16px; - } - i { - vertical-align: text-bottom; - margin-right: 12px; - } - } - } - form { - fieldset { - .field { - > .inline-label { - &:first-child { - margin-left: 0px; - } - } - } - } - } -} diff --git a/docs/ui-guide/superdesk.md b/docs/ui-guide/superdesk.md deleted file mode 100644 index c81528e349..0000000000 --- a/docs/ui-guide/superdesk.md +++ /dev/null @@ -1,84 +0,0 @@ -# Superdesk lib -This documentation is targeted at superdesk developers and developers in general who want to use superdesk as part of their project. It describes steps how to write your own superdesk app plus the key concepts. -Term `superdesk` here will refer to the core lib of the framework, located in `app/scripts/superdesk`, which will be released as a standalone library in the future. - -### How to write an app using superdesk -Every app is an angular module, with some config blocks that register app components and thus make them available to other apps and the framework. -```js -var app = angular.module('myApp', ['superdesk']); -``` - -There are 2 components an app can provide at the moment: -- dashboard `widgets` -- `activities` - -#### Widgets -Widget is a component that can be rendered on user dashboard. - -```js -app.config(['superdeskProvider', function(superdeskProvider) { - superdeskProvider.widget('myWidget', { - label: 'MyWidget', // string - multiple: true, // boolean - can user have more such widgets at a time (with different config) - icon: 'info', // string - `icon-` class - thumbnail: 'scripts/my-app/images/thumbnail.png', // url for thumbnail image - template: 'scripts/my-app/views/widget.html', // url for widget template - description: 'My Widget long description', // string - configuration: {max: 5}, // Object - default config for widget - configurationTemplate: 'scripts/my-app/views/config.html', // url for config template - max_sizex: 2, // integer - max horizontal size (2 of 4x4 dashboard), - max_sizey: 2, // integer - max vertical size - sizex: 1, // integer - default horizontal size - sizey: 1, // integer - default vertical size - }); -}]); -``` - -#### Activity -Activity can be displayed in a main menu, or be triggered from other apps when needed. You can also override existing activities for given action. - -##### Register Main menu activity -```js -app.config(['superdeskProvider', function(superdeskProvider) { - superdeskProvider.activity('myActivity', { - label: gettext('My App Dashboard'), - category: superdeskProvider.MENU_MAIN - }); -}]); -``` - -##### Register activity for certain action -To specify what your activity can do, you can define intent filters: - -```js -app.config(['superdeskProvider', function(superdeskProvider) { - superdeskProvider.activity('mySendActivity', { - label: gettext('Send'), - filters: [ - {action: 'send', type: 'picture'} - ] - }); -}]); -``` - -Each filter has `action` and data `type` which is used to pick the appropriate activity. - -#### Intent -When you want to start an `activity` out of your app, you have to create an `intent` for it. There you specify `action` you want to perform with data and superdesk will resolve it to an `activity` which can handle it. In case there are multiple `activities` for the task user will be presented with a dialog where he can choose one. - -```js -app.controller(function($scope, superdesk) { - $scope.send = function(item) { - superdesk.intent('send', item); - }; -}); -``` - -## Superdesk API -@ todo generate docs for: -- `superdesk` component registry -- `data` rest api adapter -- `keyboard` keyboard bindings manager -- `notify` notification service -- `storage` local storage adapter -- `translate` gettext adapter diff --git a/package.json b/package.json index 7990814473..d53e3c4215 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "dependencies": { "angular": "1.6.3", "angular-animate": "1.6.3", - "angular-bootstrap-npm": "jusopi/angular-bootstrap-npm#0.13.1", "angular-contenteditable": "0.0.2", "angular-dynamic-locale": "0.1.32", "angular-embed": "superdesk/angular-embed#b2b4a69", @@ -106,7 +105,8 @@ "sass-loader": "4.1.1", "style-loader": "0.13.2", "webpack": "1.14.0", - "webpack-dev-server": "1.14.1" + "webpack-dev-server": "1.14.1", + "superdesk-ui-framework": "superdesk/superdesk-ui-framework" }, "devDependencies": { "dgeni-alive": "gbbr/dgeni-alive#superdesk", diff --git a/scripts/apps/archive/index.js b/scripts/apps/archive/index.js index 5bd539de10..fd797f1a6e 100644 --- a/scripts/apps/archive/index.js +++ b/scripts/apps/archive/index.js @@ -84,7 +84,7 @@ angular.module('superdesk.apps.archive', [ .activity('upload.media', { label: gettext('Upload media'), modal: true, - cssClass: 'upload-media modal-responsive', + cssClass: 'upload-media modal--z-index-fix modal--fill', controller: ctrl.UploadController, templateUrl: 'scripts/apps/archive/views/upload.html', filters: [ diff --git a/scripts/apps/archive/views/archived-kill.html b/scripts/apps/archive/views/archived-kill.html index d7cf149550..71e839fa40 100644 --- a/scripts/apps/archive/views/archived-kill.html +++ b/scripts/apps/archive/views/archived-kill.html @@ -1,7 +1,7 @@ -