summaryrefslogtreecommitdiff
path: root/addons/web_unsplash/static/src/js
AgeCommit message (Collapse)Author
2019-05-06[MERGE] forward port branch saas-12.2 up to 78b3b650b0dChristophe Simonis
2019-05-03[MERGE] forward port branch saas-12.1 up to 2420492c264Christophe Simonis
2019-04-25[FIX] web_unsplash: correctly load images after credentialsRomain Derie
Since media dialog and unsplash refactoring (1f847a1e2e, 78a30d44c) there was a bug after adding credentials. Indeed, when doing a search for the first time and no credentials are set, it shows a form to add the missing credentials. When saving those, it should automatically perform the initial search now that the credentials are set. But it was not the case anymore, it would keep reloading the credential form. User would have to close and reopen media dialog. closes odoo/odoo#32943 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-06[REF] web_unsplash: adapt code after jQuery updateVincent Schippefilt
Part of task 1896658 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com> Co-authored-by: svs-odoo <svs@odoo.com> Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-02-26[REF] *: use 'frontend' system in non-website appsqsm-odoo
* account, auth_signup, payment, portal, project, sale, sale_management, web_unsplash, website, website_mail, website_rating, website_sale This commit does probably not do what is stated for all non-website apps but it is a first step. It also uses the system in apps which could have already used it but did not. Part of https://github.com/odoo/odoo/pull/29442 task-1932066
2018-12-04[REF] web_editor, web_unsplash: review load more featureqsm-odoo
* Simplify the code * Make the feature mork without unsplash * Handle corner cases task-1896705
2018-12-04[IMP] web_editor, *: improve media dialogAndrea Ulliana
* web_unsplash, website_sale - Visual improvements and cleaning in each tab: video, documents, pictogram, images. - Only one search input for both the local library and unsplash. - Replace the idea of multiple pages by adding a 'Load More' button. task-1896705
2019-01-22[FIX] *: review 'frontend' pages init (web_editor.base)Christophe Matthieu
* auth_password_policy_signup, auth_signup, website, portal, survey, web_unsplash, website Following the new editor's merge at https://github.com/odoo/odoo/pull/29775 web_editor.base has been moved to website while it was still used by frontend pages which do not depend on website (especially portal). This commit moves web_editor.base to portal while waiting for https://github.com/odoo/odoo/pull/29442. It also removes the unnecessary dependencies to it in non-portal pages (in survey for example).
2019-01-17[IMP] web_editor,*: Refactoring the wysiwyg editor and 'html' fieldChristophe Matthieu
* Creating a new structure by transforming all the plugins in the library using the odoo inheritance system. Plugins are easier to implement with the AbstractPlugin to add Odoo behaviors. * From now on, the methods of the library (in this case Summernote) can no longer be called by other modules or files. Only the wysiwyg widgets can access it, to simplify the updating process. The wysiwyg object serves as an interface. * Depending on the options the snippets will be loaded or not, the editor will be in an iframe or not... all of this is transparent from the outside. * Regarding iframes, all controllers related to editing have been removed: the new API no longer needs them. This speeds up loading, eases testing and removes complexity for the same features. PUBLIC FEATURES There are several public methods on the Wysiwyg class: * Wysiwyg.prepare (WidgetParent): returns a deferred resolved when the library (xml, lazy, assets...) is loaded. * Wysiwyg.getRange (DOM): returns the range (selection in the dom) * Wysiwyg.setRange (startNode, startOffset, endNode, endOffset): creates a range (selection in the dom) * Wysiwyg.setRangeFromNode (DOM, options) that creates a range from an element (option available to select all, start or end) A jQuery selector was added: :o_editable, which indicates whether the current element is editable. That is, if it is contained in a tag with the attribute 'contentEditable = "true"' or in a tag with the class o_editable. Several methods are also present: * focusIn: makes a focus and places the cursor at the beginning of the element * focusInEnd: makes a focus and places the cursor at the end of the element * selectContent: makes a focus and selects the content HTML FIELD The HTML field can receive different options: * style-inline: {boolean} transforms a class into an inline style when saving and vice versa when reading. * no-attachment: {boolean} prevents the use of attachments (in media dialog) * cssEdit: {xml_id} to use a template containing the css to loaded in an iframe when editing * cssReadonly: {xml_id} to use a template containing the css to load into an iframe when viewing in readonly * snippets: {xml_id} snippets template (can be used with or without cssEdit) * wrapper: {template} qweb static template (containing a tag: id = "wrapper") that will include the content during editing (removed on save) MASS MAILING A widget was created for mass mailing. There are now two fields: body_html and body_arch. body_arch contains the code with the class without conversion into inline style, useful when editing and one with the inline style that is visible in readonly mode and sent by email. Advantage: no spreading errors, able to update css/theme, able to do more changes when converting to inline style so that a maximum of mail clients have an impeccable rendering. Co-authored-by: Antoine Guenet <age@odoo.com>
2018-11-23[FIX] web_unsplash: add unsplash searched terms in attachement name/urlRomain Derie
Before this commit: An unsplash image would be saved as an attachement with: - A name like 'x54ze78z.JPEG' - An url like '/unsplash/x54ze78z.JPEG' - A filename like 'x54ze78z.JPGED' We would not store the searched terms in the name/url. Then, we would not be able to search on local attachement in the media dialog to retrieve the images based on what we searched. Now: We store the searched terms in the name/url so it can be used later in the media dialog search: - Name like 'big_lion.jpg' (duplicates may be possible) - Url like '/unsplash/x54ze78z/big_lion.jpg' - Filename like 'unsplash_x54ze78z_big_lion.jpg' Task-1911345
2018-11-23[FIX] web_unsplash: don't expose client_id in networkRomain Derie
Unsplash CEO asked us to stop exposing our key client side (even if it was only in the browser network and previously allowed by their API team leader). After multiple exchange, it has been negociated that: 1. Our non saas user won't be able to apply for a production key and should prefix they Unsplash application name by 'Odoo:'. Their key will remain in test mode. Indeed, Unsplash won't be able to review every Odoo application and ensure it respects the API terms and it is a real application. 2. Our saas user will query Unsplash with a dedicated enterprise key 3. The documentation should explain it all Task-1911345
2018-11-05[FIX] web_unsplash: do not fetch app_id if no Unsplash imagesRomain Derie
As empty arrays are considered truthy, the call to `/web_unsplash/get_app_id` would always be performed even if no Unsplash images. closes odoo/odoo#28421
2018-10-26[IMP] web_unsplash: Implement Beacon Alternative and credit UnsplashRomain Derie
Unsplash API requirements does not directly allow to store their images on our server (We should use hotlinking unless the image is edited (cropped etc)). Still, they have the `Image Beacon Alternative` to allow to store their images on our server if we really need it with our use case. With the Beacon Alternative, we should ping Unsplash server to notify an image view. To do so, we need to be able to recognize Unsplash imagesin the DOM, this is why we are now using /unsplash/ in the URL. The Unsplash image name should be the image ID as it will be the identifier needed to ping their server. This commit also adds credit to Unsplash in the media dialog next to the unsplash input search. It also add the `w-100` on the media dialog card as we lost that UI behavior from BS3 to BS4. opw-35060 closes odoo/odoo#27377
2018-08-13[ADD] web_unsplash: Find free high-resolution images from UnsplashRomain Derie
Move module from enterprise to community Work of @dep-odoo and @rdeodoo