gbligh Posted November 29, 2017 Posted November 29, 2017 Hi all, We are using the MIS Linked Documents widget but parents are struggling to realise that they have to select a date first for the documents to appear in the widget. They are used to the Frog3 one where they just used to list all of them in one place without having to select a date. Does anyone know of a way around this? Thanks
pconkie Posted November 29, 2017 Posted November 29, 2017 Our parents have the same problem @gbligh . Made worse by the document extractor that appears to put incorrect dates on the pdf’s! (Yes ticket open). I am half way through writing my own version of the widget that doesn’t need a date - just shows all documents with tabs for each academic year Paul 1
gbligh Posted November 29, 2017 Author Posted November 29, 2017 Thanks Paul - would you be happy to share that widget once completed? I'm sure it would help our parents out loads.
pconkie Posted December 1, 2017 Posted December 1, 2017 On 11/29/2017 at 11:39, gbligh said: Thanks Paul - would you be happy to share that widget once completed? I'm sure it would help our parents out loads. Happy to. But Christie release seems to have broken the frogcode editor so can't finish it at the moment. Actually lots of things (both custom made and frog made) are currently broken Lots of tickets open and lots more still coming in from staff..... Biggest problem for us is the Parents Portal as the select a user widget seems to be broken. Not sure if that is a frog thing or a me thing?!
gbligh Posted December 1, 2017 Author Posted December 1, 2017 Our MIS Linked Docs widget is broken. The documents appear, but they can't actually be clicked on or opened.
ADT Posted December 1, 2017 Posted December 1, 2017 Lots of stuff is broken...... including the next release for FrogLabs schools!!
pconkie Posted December 21, 2017 Posted December 21, 2017 Finally got round to making life so much easier for our parents..... @gbligh if your still interested in this linked documents widget, i'm sure you can find a way to get a copy off our platform! Or i'll post all code here. Paul
gbligh Posted December 21, 2017 Author Posted December 21, 2017 @Graham Quince Can I get a copy of this on our platform? Thanks
Graham Quince Posted December 22, 2017 Posted December 22, 2017 I’m off now until the new year, so don’t have access to your platforms. I’ll try to remember to grab this from Paul and we’ll make it available. Graham
Matt Mason Posted January 25, 2018 Posted January 25, 2018 I've just started at a Frog Learn school and one of my responsibilities is to develop the VLE. At the moment we are having a push on parental engagement and part of this is using MIS linked documents. I am slowly getting my head round how the APIs work and am very interested in the linked documents widget and the coding behind it, @pconkie would it be possible for you to send me the code behind the widget to learn from and use on our platform. Thanks, Matt
pconkie Posted February 2, 2019 Posted February 2, 2019 @adamw @Graham Quince I've had a problem reported to be by a parent regarding the Linked Document widget (mine not yours). When using the MyFrog app, when a parent clicks to open a pdf, it opens, but can not be closed. You can not return to the dashboard either. Only choice is to close the app and re-open. The pdf either sits on top of the dashboard in a new transparent window or replaces the dashboard, but there in no back button or back gesture. The official widget opens the pdf in the frog document preview app. I was keen to see how other file downloads are handled by the app, so linked to an excel file using a text widget. This open the file in a new window AND has a back button! Please can you share how i could do one of the following: a) open the pdf in the frog document preview app; b) open the pdf the same way the cke editor does within the MyFrog app; c) send the pdf to open in the default browser e.g. safari for iOS. Just to reiterate all works fine on desktop and mobile platforms, this is just an issue for users of the app. I have tried variations of the target attribute with no effect. I've tried the new html5 download attribute again with no effect. For some reason the return key has stopped working for me on this forum, so sorry if this is hard to read! Thanks Paul
gbligh Posted February 4, 2019 Author Posted February 4, 2019 On 02/02/2019 at 20:36, pconkie said: @adamw @Graham Quince I've had a problem reported to be by a parent regarding the Linked Document widget (mine not yours). When using the MyFrog app, when a parent clicks to open a pdf, it opens, but can not be closed. You can not return to the dashboard either. Only choice is to close the app and re-open. The pdf either sits on top of the dashboard in a new transparent window or replaces the dashboard, but there in no back button or back gesture. The official widget opens the pdf in the frog document preview app. I was keen to see how other file downloads are handled by the app, so linked to an excel file using a text widget. This open the file in a new window AND has a back button! Please can you share how i could do one of the following: a) open the pdf in the frog document preview app; b) open the pdf the same way the cke editor does within the MyFrog app; c) send the pdf to open in the default browser e.g. safari for iOS. Just to reiterate all works fine on desktop and mobile platforms, this is just an issue for users of the app. I have tried variations of the target attribute with no effect. I've tried the new html5 download attribute again with no effect. For some reason the return key has stopped working for me on this forum, so sorry if this is hard to read! Thanks Paul I've also noticed this @pconkie - was meant to pick your brains about it!
adamw Posted February 4, 2019 Posted February 4, 2019 On 02/02/2019 at 20:36, pconkie said: @adamw @Graham Quince I've had a problem reported to be by a parent regarding the Linked Document widget (mine not yours). When using the MyFrog app, when a parent clicks to open a pdf, it opens, but can not be closed. You can not return to the dashboard either. Only choice is to close the app and re-open. The pdf either sits on top of the dashboard in a new transparent window or replaces the dashboard, but there in no back button or back gesture. The official widget opens the pdf in the frog document preview app. I was keen to see how other file downloads are handled by the app, so linked to an excel file using a text widget. This open the file in a new window AND has a back button! Please can you share how i could do one of the following: a) open the pdf in the frog document preview app; b) open the pdf the same way the cke editor does within the MyFrog app; c) send the pdf to open in the default browser e.g. safari for iOS. Just to reiterate all works fine on desktop and mobile platforms, this is just an issue for users of the app. I have tried variations of the target attribute with no effect. I've tried the new html5 download attribute again with no effect. For some reason the return key has stopped working for me on this forum, so sorry if this is hard to read! Thanks Paul Sounds like it needs a quick re-visit to see what's going on. @Matt
Matt Posted February 4, 2019 Posted February 4, 2019 @Graham Quince looks like it's one for you if our version is ok (launches PDF preview) but the FrogCode one is launching the old way which can't then be closed.......
pconkie Posted February 5, 2019 Posted February 5, 2019 @Matt @adamw @Graham Quince Let me simplify the question... this.trigger('os.internal.launchapp', { name: appID, pollid: this.prefs.livepolls.value, view: this.prefs.studentview.value, appModel: new Com.Frog.Model({ 'uuid' : appID, 'role_name': Object.values(_Roles.serialize()).filter(function(role) { return /app\.frogplay$/gim.test(role); })[0], 'extended_data' : { 'from_package' : true } }) This code successfully launches a frog app by appID and passes it 2 values for it to consume. How would I modify the code to open the document preview app and get it to display the pdf that I have the id/path for? Paul
pconkie Posted February 8, 2019 Posted February 8, 2019 On 05/02/2019 at 09:01, pconkie said: @Matt @adamw @Graham Quince Let me simplify the question... this.trigger('os.internal.launchapp', { name: appID, pollid: this.prefs.livepolls.value, view: this.prefs.studentview.value, appModel: new Com.Frog.Model({ 'uuid' : appID, 'role_name': Object.values(_Roles.serialize()).filter(function(role) { return /app\.frogplay$/gim.test(role); })[0], 'extended_data' : { 'from_package' : true } }) This code successfully launches a frog app by appID and passes it 2 values for it to consume. How would I modify the code to open the document preview app and get it to display the pdf that I have the id/path for? Paul @Graham Quince any thoughts?
Graham Quince Posted February 8, 2019 Posted February 8, 2019 Sorry Paul - this is a bit beyond me. I'll nudge @adamw
adamw Posted February 8, 2019 Posted February 8, 2019 1 hour ago, Graham Quince said: Sorry Paul - this is a bit beyond me. I'll nudge @adamw @pconkie Sorry, I seem to have missed this. Assuming you have the resource object from an api call you can use something like this: this.trigger('os.app.preview', { name: 'preview', resource: myResource, launchAboveModal: true, mode: 'fullscreen' }); 1
pconkie Posted February 8, 2019 Posted February 8, 2019 @adamw Got a slight problem - am I on the right tracks? This code is in the response form the linkeddocuments.search api: $.each(thisResponse.data, function(i,docs) { $mywrapper.find("[data-name=docstable] tbody").append("<tr class='clickable-row' data-resource='"+JSON.stringify(docs.resource)+"'><td><div class='os-icon-ext os-icon-ext-"+docs.resource.attachment.file.mime.ext+" small'></div> <div class='os-ellipsis title' title='"+docs.description+"'>"+docs.description+"</div></td><td>"+moment.unix(docs.date_created_external).format("DD/MM/YYYY")+"</td></tr>"); }); Here i append the resource object to the <tr> mark-up. This looks right in the inspector once the table has rendered. This is the code for the tr click event: $mywrapper.on("click tap", ".clickable-row", function(ev) { var myResource = $(ev.currentTarget).data("resource"); this.trigger('os.app.preview', { name: 'preview', resource: myResource, launchAboveModal: true, mode: 'fullscreen' }); }.bind(this)); This successfully opens the preview app. But.....
adamw Posted February 8, 2019 Posted February 8, 2019 I think the resource needs to be a resource object - my front end knowledge in this dept is a bit weak, but I think the passed resource needs to be an instance of a: Lib.Models.Resource Hopefully that helps, let me know how you get on - as I may have to grab someone who knows that part of the system better than I if needed
pconkie Posted February 8, 2019 Posted February 8, 2019 21 minutes ago, adamw said: I think the resource needs to be a resource object - my front end knowledge in this dept is a bit weak, but I think the passed resource needs to be an instance of a: Lib.Models.Resource Hopefully that helps, let me know how you get on - as I may have to grab someone who knows that part of the system better than I if needed Sorry @adamw this doesn't mean anything to me!
adamw Posted February 8, 2019 Posted February 8, 2019 Just now, pconkie said: Sorry @adamw this doesn't mean anything to me! Hehe, you and me both :p Okay, can you post the method that does the api call to get the resource data?
pconkie Posted February 8, 2019 Posted February 8, 2019 i'm using this to get the linked documents of a child //function to get linked documents of selected child var getDocs = function(anyuuid) { //wipe the table of docs $mywrapper.find("[data-name=docstable] tbody").empty(); $mywrapper.find("[data-name=docstable] thead").empty(); //call the api Frog.Model .api( 'linkeddocuments.search', { //any date in the dim dark past will do for now... date_created_external: "1200000000", //get todays moment date_created_external_before: today, is_active: "true", order_by: "date_created_external", user_uuid: anyuuid } ).done(function(thisResponse) { //rebuild the table if (thisResponse.data.length > 0) { $mywrapper.find("[data-name=docstable] thead").append("<tr><th>Title</th><th class='date'>Date</th></tr>"); $.each(thisResponse.data, function(i,docs) { $mywrapper.find("[data-name=docstable] tbody").append("<tr class='clickable-row' data-resource='"+JSON.stringify(docs.resource)+"' data-href='"+docs.resource.attachment.file.external_url+"'><td><div class='os-icon-ext os-icon-ext-"+docs.resource.attachment.file.mime.ext+" small'></div> <div class='os-ellipsis title' title='"+docs.description+"'>"+docs.description+"</div></td><td>"+moment.unix(docs.date_created_external).format("DD/MM/YYYY")+"</td></tr>"); }); } else { $mywrapper.find("[data-name=docstable] tbody").append("<div class='nodocs'>No documents exist</div>"); } }); };
adamw Posted February 8, 2019 Posted February 8, 2019 This is complete guess, without testing. but try this as the first line in your 'done' function: thisResponse = Lib.Models.Resource.model(thisResponse.data); That may give you an array of resource models, which you can then do stuff with. You might have to amend the rest of your code to cope with the new structure, but it should be fairly easy to do. That's if it works! Like I said, I usually leave the front-end stuff to those who are cleverer than me 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now