From souliane at mailoo.org Sat Jan 4 11:59:21 2014 From: souliane at mailoo.org (Adrien) Date: Sat, 04 Jan 2014 11:59:21 +0100 Subject: [dev] [PATCH] unibox as an option (part 1) Message-ID: <52C7E989.60600@mailoo.org> Hi all, happy new year, I hope you enjoyed the holidays and family dinners ;) Thank you Goffi for the last updates, I especially enjoy the better internationalization system! I divided my patches into three parts/emails, because last time it was too much at the same time and a bit confusing. According to the feedback that we got about the unibox, we decided to make the unibox optional. This first batch of patch goes to that direction. When unibox is enabled, I did not systematically disabled the alternate sending stuff. For example, I think it's OK to be able to reply to a microblog from the unibox and by clicking a small icon to insert an editbox directly in the panel, because the icon is not using any extra space (it doesn't disturb). But the new button "New message" which can be inserted at the top of a MicroblogPanel will be hidden when unibox is enabled. Let me know what you think about that (also you can give your opinion later when libervia.org is running online, it's not a big deal to do change this kind of thing). I started to do these changes with a Param added directly in the backend and defining its key/name in sat_frontends.constants.Const. Later I implemented a proper way to add frontend's specific parameters (with the advices of Goffi). With the patches attached to this email, we will get some errors (JS AttributeError for Const.XXX and "the requested parameter doesn't exist" in the backend) because I didn't comit the first dirty way, so it's better to test everything together with the next batch of patch. So for the main changes the attached file brings: - when unibox is disabled, raw text input at the bottom of ChatPanel, "New message" button at the top of MicroblogPanel - "comment" icon side the the Microblog main entries et the status can be edited by clicking it directly. Regards, Adrien -------------- section suivante -------------- Une pièce jointe autre que texte a été nettoyée... Nom: lib_unibox_option_1.diff Type: text/x-diff Taille: 1434 octets Desc: non disponible URL: From souliane at mailoo.org Sat Jan 4 12:03:58 2014 From: souliane at mailoo.org (Adrien) Date: Sat, 04 Jan 2014 12:03:58 +0100 Subject: [dev] [PATCH][EN] Unibox as an option (part 2) Message-ID: <52C7EA9E.8090804@mailoo.org> Changes in the attached files: sat: - core, bridge : new method paramsRegisterApp to register frontend's specific parameters libervia: - new file constants.py containing a Const class heritating from sat_frontends.constants.Const, as it is done for the other frontends - added support for paramsRegisterApp and use it for the param "Enable unibox" Now you can test the changes of the part 1. -------------- section suivante -------------- Une pièce jointe autre que texte a été nettoyée... Nom: lib_unibox_option_2.diff Type: text/x-diff Taille: 3295 octets Desc: non disponible URL: -------------- section suivante -------------- Une pièce jointe autre que texte a été nettoyée... Nom: sat_frontends_params.diff Type: text/x-diff Taille: 24376 octets Desc: non disponible URL: From souliane at mailoo.org Sat Jan 4 13:05:27 2014 From: souliane at mailoo.org (Adrien) Date: Sat, 04 Jan 2014 13:05:27 +0100 Subject: [dev] [EN] Storing title in microblogs Message-ID: <52C7F907.5080700@mailoo.org> Hi, yesterday Goffi told me that we will need the possibility to store microblogs title, I had a quick look and it appears that the microblog contents are currently stored by sat_pubsub in the "title" element. This is necessary to be Atom-compliant (title is a mandatory element). But when we will handle blog title, we will have to change this, won't we? To stay close to Atom (this is a suggestion - feel free to share your ideas!): - title: used for the actual title. The default value when no title is entered by the user can be empty. - content: full message body This is what we need at least and it avoids to store duplicate info in the database. When retrieving the entries we could process them before sending them to the client (they are already processed, the text is parsed to convert the XML data to a dict - I think it won't cost to much to add these two steps): - title: if empty, copy the X first characters of the content (50 chars?) - summary: copy the 2 or 3 first "lines" of the content (140 or 210 chars?) With this we could have a compact mode for viewing microblogs, clicking on an entry would display the full content in a side panel. Similar to how clicking on a message in an email client would display it in a "Message Pane" (to re-use Thunderbird terminology). Atom specification: http://tools.ietf.org/html/rfc4287#section-4.1 Regards, Adrien From souliane at mailoo.org Sat Jan 4 13:10:32 2014 From: souliane at mailoo.org (Adrien) Date: Sat, 04 Jan 2014 13:10:32 +0100 Subject: [dev] [PATCH][EN] 3rd part for libervia In-Reply-To: <52C7F563.3040104@mailoo.org> References: <52C7F563.3040104@mailoo.org> Message-ID: <52C7FA38.60406@mailoo.org> Main changes in the attached file (concern Libervia only): - scroll to the clicked microblog post and blink it (previous behavior is also conserved when the unibox is enabled = toggle main entries selection) - reorganization of the file panels.py + clean the modules import: I add some strange import issues with errors at JS runtime because this or that could not be found... I suspect that panels.py was too large for pyjamas/JS, this sounds strange but after having moved some classes to another file, it worked well. So the *Panel classes of panels.py that do not reference "host" have been moved to base_panels.py - cleaned the import in various files - the UI part for adding a title to microblog post has been added, for now disabled. -------------- section suivante -------------- Une pièce jointe autre que texte a été nettoyée... Nom: lib_misc.diff Type: text/x-diff Taille: 2152 octets Desc: non disponible URL: From souliane at mailoo.org Sat Jan 4 21:27:40 2014 From: souliane at mailoo.org (Adrien) Date: Sat, 04 Jan 2014 21:27:40 +0100 Subject: [dev] [PATCH][EN] Added some tests Message-ID: <52C86EBC.1050407@mailoo.org> Hi, in the attached file a small bugfix for the recently added method paramsRegisterApp (the fix is actually located in updateParams) and some tests for updateParams / getParams + the XEP-0085. I call directly the methods of the Params class when it's possible, the database accesses are of course simulated (with a dict...). Regards, Adrien -------------- section suivante -------------- Une pièce jointe autre que texte a été nettoyée... Nom: sat_tests.diff Type: text/x-diff Taille: 34237 octets Desc: non disponible URL: