Jump to content

Graham Quince

Administrators
  • Posts

    2,046
  • Joined

  • Last visited

Everything posted by Graham Quince

  1. Nice one @ADT To use, add the Assignment Calendar widget to a page, and then either right-click on it and choose Inspect Element, then in the developer console look for the parent UUID: Or follow these instructions to create a bookmarklet to make it easy to get a Widget's UUID: Copy Adrian's code into an HTML widget and replace the widget-content-uuid with your widget's UUID. Save the changes and leave the editor (you may want to comment out Adrian's code first). Then right-click on the subject list in the widget and in the developer console expand the line: <select class="filter" name="subject_name"> which contains all the subject choices. The value of the option is the subject's UUID. Copy this and add it as the subject-uuid in Adrian's code. Alternatively, if you don't really want a calendar, and would prefer just a list, this discussion from a few years ago can help:
  2. Had to do some fiddling with CSS, but I think I've got there. This code will let you embed Google Drive using an HTML widget: <style> .embeddedGoogleDrive .content { width: calc(100% - 220px) !important; background: #ffffff; } .embeddedGoogleDrive { font-family: "Helvetica Neue",Helvetica,Arial,sans-serif !mportant; font-size: .9em !important; } .embeddedGoogleDriveembed { width: 100%; height: 510px; background: #ffffff; } .embeddedGoogleDrive a { color: #222; } </style> <div class="embeddedGoogleDrive"> <div class="column link-info embeddedGoogleDriveembed"> <h2 class="widget-title os-ellipsis">Google Drive</h2> </div> </div> <script> var embedded = arguments[0].find('.embeddedGoogleDrive'); function renderEmbedWidget() { var app_data = { data: { name: 'resources', view: 'googledrive', selected: 'googledrive' } }; var app_width = parseInt(embedded.css('width')); embedded.addClass('embedded').trigger('os.internal.launchEmbeddedApp', { app_name: 'resources', role_name: 'googledrive', app_container: embedded, app_width: app_width, app_height: 600, app_data: app_data, user: FrogOS ? FrogOS.getUser() : this.getUser() }); } renderEmbedWidget(); </script>
  3. Hi George, I've stumbled across a way to trigger Google Drive in FrogDrive to open directly from a link (not quite embedding it though) <div class="GoogleDrive">Google Drive</div> <script> $(".GoogleDrive").click(function(){ $('.GoogleDrive').trigger('os.internal.launchapp', { data: { name: 'resources', view: 'googledrive', selected: 'googledrive' } }); }); </script> To open FrogDrive to My Documents, you can use this option: <div class="FrogDriveButton">Open FrogDrive</div> <script> $(".FrogDriveButton").click(function(){ $('.FrogDriveButton').trigger('os.internal.launchapp', { data: { name: 'resources' } }); }); </script> And most other sections can open with just a 'view' value being passed: <div class="AppsButton">Open FrogDrive > Applications</div> <script> $(".AppsButton").click(function(){ $('.AppsButton').trigger('os.internal.launchapp', { data: { name: 'resources', view: 'apps' } }); }); </script>
  4. I had a little time on Friday and have updated the widget quite a bit. It now has a view which lists page links horizontally, but it can also be used to display a list of any set of subpages. It's not limited to subpages from a top tier. It allows you to add a submenu for a whole section to each page in that area and it will list the same info. And you don't have to keep using the page navigation, as it displays the Page UUID in the editor:
  5. Years ago, Chris Smith made a couple of bookmarklets to easily grab a site's UUID and another one for its Alias. From Wikipedia: Whenever I need to get a widget's content-uuid, I have to right-click on the widget, choose "inspect" or "inspect element" then scroll through the developer tools to spot the content uuid. Which is the unique ID for that particular widget. So I thought I'd take a look at Chris' code and see if I can adapt it: javascript:$(".os_core:first").one("click", function(ev) { var i = jQuery(ev.originalEvent.target), p = document.createElement('p'), l, r, s; i.is(".sites_core") || (i = i.closest(".sites_core")); l = i.data('controllers').sites_core.site.uuid; var widget = jQuery(ev.originalEvent.target); widget.is(".sites_widget") || (widget= widget.closest(".sites_widget")); p.innerText = widget[0].dataset.contentUuid; document.body.appendChild(p); if (document.body.createTextRange) { r = document.body.createTextRange(); r.moveToElementText(p); r.select(); } else if (window.getSelection) { s = window.getSelection(); r = document.createRange(); r.selectNodeContents(p); s.removeAllRanges(); s.addRange(r); } if (document.execCommand('copy')) { Frog.Controller.prototype.growl('UUID copied to clipboard', 'FrogOS Developer Tools', 'configmanager'); } else { window.prompt("Copy to Clipboard: Ctrl+C, Enter", l); } if ('remove' in Element.prototype) { p.remove(); } else { document.body.removeChild(p); } }); I've left large parts as it was, but the "var widget" bits are the adaptation. To make: Make a bookmark to a random page Edit the bookmark Replace the link with the code above To use: Click on the bookmarklet Click on the widget - the content-uuid will be copied to your clipboard.
  6. Hi @clangstaff I've no idea why FrogDrive doesn't appear in that list. How strange? In the meantime, this code will add a DIV which you can style, then on clicking will open FrogDrive: <div class="FrogDriveButton">FrogDrive</div> <script> $(".FrogDriveButton").click(function(){ $('.FrogDriveButton').trigger('os.internal.launchapp', { data: { name: 'resources' } }); }); </script>
  7. Looks great Chris. That's such a warm red you've got on the hover state.
  8. I've just had a thought about this. Could you consider using the Noticeboard widget? When set to hide messages, clicking on the title of the message (set as the question) will reveal the notice (answer). I keep asking the developers about adding the rich-text editor to FrogCode and keep seeing them turn pale. I think we could easily add plain text for the question and answer - would that be good enough?
  9. Not sure what you mean about all users. Looking at the API calls I can see (not directly at the codebase) it looks like you do need a user UUID for this. The Categories returned with fields based on the user (probably a bit of forward planning so that different categories are return on different set ups).
  10. Hi UPN is available via a simple call: var user = FrogOS ? FrogOS.getUser() : this.getUser(), upn = user.pupil_number; And email and username are also included in getUser(); I take it you're after the MIS ID instead? users.getOne is returns a lot of information about the user, including the category UUIDs when you first look at a user in the Users app.
  11. Hi Marcus, I asked a developer to check the error logs and there's nothing apparent. Can you try again please and note the exact time and how long before anything happens. We can then check the logs again and try to narrow down the issue. Graham
  12. Hi everyone, Here's a bit of CSS you can add to an HTML widget to hide the first three columns in the Data Viewer widget should you want to: <style> /* Hide first three columns in Data Viewer */ div[data-content-uuid="WIDGET_UUID"] .dataviewer-list th:nth-child(2), div[data-content-uuid="WIDGET_UUID"] .dataviewer-list th:nth-child(3), div[data-content-uuid="WIDGET_UUID"] .dataviewer-list th:nth-child(4), div[data-content-uuid="WIDGET_UUID"] .dataviewer-list td:nth-child(2), div[data-content-uuid="WIDGET_UUID"] .dataviewer-list td:nth-child(3), div[data-content-uuid="WIDGET_UUID"] .dataviewer-list td:nth-child(4){ display: none !important; } </style>
  13. Yes please. The more clues you can provide the better
  14. Are you including the header with this API call: X-AuthType: oauth_1_0_a
  15. Some schools use different aspects in SIMS for target grades and predicted grades and it can end up with the Attainment Table widget having to have both columns visible with no information in for the wrong key stages. I've just sorted this code which I thought I'd share: <div class="attainCSS"></div> <script> var user = FrogOS ? FrogOS.getUser() : this.getUser(); var year1011 = false, year789 = false; user.groups.each(function(index,group) { if (group.name == 'Year 10' || group.name == 'Year 11') { year1011 = true; } if (group.name == 'Year 7' || group.name == 'Year 8' || group.name == 'Year 9') { year789 = true; } }) if (year1011 == true) { $('.attainCSS').html( '<style>'+ '.attainmenttable th:nth-child(2),'+ '.attainmenttable th:nth-child(3),'+ '.attainmenttable td:nth-child(2),'+ '.attainmenttable td:nth-child(3) {'+ 'display: none !important;'+ '}'+ '</style>' ); } if (year789 == true) { $('.attainCSS').html( '<style>'+ '.attainmenttable th:nth-child(5),'+ '.attainmenttable th:nth-child(6),'+ '.attainmenttable td:nth-child(5),'+ '.attainmenttable td:nth-child(6) {'+ 'display: none !important;'+ '}'+ '</style>' ); } </script> Truth be told, I could probably write this neater, but when placed in an HTML widget on the student dashboard will set a variable based on the year group name and then write CSS onto the page to hide any instances of the empty columns in the widget. And because My Learning loads into MyFrog by loading in FrogLearn's dashboard first, the HTML should also hide the columns in the app.
  16. Hi @Marcus Goluch - I'm sorry, I was snowed under yesterday. I know you were stuck trawling the code. I've never used this before. I'll try to get a developer to take a look.
  17. Confirmed - the credits api refers to FrogPlay And When we say "External APIs", it is referring to APIs that we as a company do not change. these are APIs external users can use. Internal APIs might be adapted by our developers and while ideally you wouldn't use these, there is nothing stopping an outside of the platform, authenticated call from using them. Just be aware that Internal APIs are subject to change.
  18. Ah right. I'll ask, but the only thing with Credits that I know of is the FrogPlay credits. So it's either that or some never released functionality. I don't believe there is an external version of the category API. If you can't call the existing one after authenticating in, then I think you'll need to put it on the Ideas Portal.
  19. Hi @Marcus Goluch, Sorry, I've not heard of balances. Can you post a screenshot or let me know where they are referenced? To get user info, I tend to use the API: users.getDataInCategory with the params: user_uuid uuid (where the category uuid is the section of the Users app - annoyingly this uuid is different per school)
  20. Oh right - I can imagine that would take up way to much time - i was thinking more like a single question and answer.
  21. Hi @Chay I did make a Hide and Reveal widget, but got reports that it didn't always work correctly, so I've removed it from the community. Page Links in a text widgets are probably the best option to get you a similar result to hide and reveal. You can use the copy page option in the editor to speed up the process. Graham
  22. Hi Marcus, We're aware of an issue with the documentation, but adding X-AuthType: oauth_1_0_a to the header will let Frog know which of the multiple authentication types to use.
  23. Accessibility Extensions I thought I'd make this a separate post and collate over time: Read Aloud - I've only recently found this one, but it reads highlighted text on a web page. Google Translate - Not really accessibility, but it adds Google Translations to any web page, so the user is not reliant on the website for translation.
×
×
  • Create New...