Tag Archives: Ajax

Enable cross-origin resource sharing for AJAX

A common problem when dealing with AJAX scripts is that the server script (or API) which javascript is calling is required to be on exactly the same domain (subdomain included).  To open up your server script / API to all domains the following headers are required to be sent before any content:

Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: X-Requested-With

In PHP the code would be:

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: X-Requested-With');

If you are using a single script that contains both the API and the regular page (even with includes), the headers must be sent before it is determined whether it is an API call or not.  This is due to a ‘pre-flight request‘ the browser does to test that the impending AJAX call is all approved and above board.  Once it receives the a-ok it will do a second call with the full AJAX credentials.

Social Network

This was a complex social network platform which was heavily based on nested reusable functions.  After 5 months of development it was discovered it was no longer what the client was after, and the project was ended.

  • API hooks with flickr, youtube/google
  • Advanced templating engine allowing on-the-fly modification of CSS rules
  • Real-time efficient multiple thumbnail engine from uploaded & linked media
  • Highly recursive branched functions
  • Customised tools were also developed for the staff.

Some of the technologies used were:

  • google / youtube api
  • flickr api
  • dojo
  • ajax
  • javascript
  • css
  • html5
  • php / codeigniter / MVC
  • mysql
  • ubuntu server
  • bash scripting
  • rsync backups

Due to the policies of the project manager, no screenshots are available.

FlexiFi v2

This was a huge product, designed to replace the FlexiFi Digital Media System.  There were a few key points considered when developing this software:

  • It must allow for almost limitless client configurations (display orientation & placement, showing menus and slideshows on one display, etc)
  • The client must be presented with a logical interface to easily modify and create content for their displays
  • Reduce the amount of network traffic needed for the editing interface to increase the speed of which remote support could be achieved, along with remote (off-site) editing for the client.
  • Keep the structure modular in order to easily add new objects in as clients requested them.
  • It must use the existing support systems (VPN) as close as possible to reduce complications of having to learn new systems for support staff.

It ended up being a commercially successful system replacing most FlexiFi systems while utilising the existing nationwide support VPN, and is still in use at many sites nationwide.

If you are using FlexiFi2 (or any digital signage system) please visit signagebank.com for pre-made stock slides and animations for your displays.

GiST Linux

Custom linux distribution that started out as a heavily customised Slackware build, which transitioned over to a completely new Linux based on the Linux From Scratch project. Designed to run from CD and provide a number of different interfaces depending on the intended use:

  • an instant useable desktop with common applications
  • web-based touchscreen interface for car & multimedia use
  • server with web-based configuration area for firewall/proxy/file storage use

The system was able to be run “live” direct from a CD or usb key, or installed from the “live” environment to the systems harddrive.  Each instance could be pre-configured by way of a global config file to match the systems intended use (eg. Car PC installs would run the multimedia touchscreen interface by default).

GiST contained automatic build scripts (Bash) which built the entire system for a chosen architecture (i386 for compatibility with VIA Eden boards) automatically, resulting in a bootable ISO over a period of around 8 hours (circa 2006).  This built all facets of the system from the sources of the applications, including all libraries, chroot bootstrap environment, & highly optimised SMP kernel.

Features include:

  • Desktop Interface (Gnome)
    • Evolution
    • OpenOffice
    • Gimp
    • Inkscape
    • Firefox
    • VideoLan
    • Etc
  • Multimedia Interface
    • Internet connectivity via bluetooth enabled mobile phone
    • Digital TV
    • Media playback of all common formats
    • Weather & Clock display
    • Web browsing
    • TV guide
    • WIFI connectivity
    • On-screen volume controls
  • Server
    • iptables firewall
    • squid proxy
    • ppp / isdn / adsl internet connection manager with auto-redial
    • dns forwarding with cache
    • dyndns
    • samba / smbd fileshares
    • ftp server
    • printer sharing
    • DHCP/BootP/tftp server (allowing for instant diskless computer labs)

Development stalled once a shift to i686 architecture became increasingly necessary & other ‘easy’ distributions such as Smoothwall & SME Server became more mainstream.

Signchro

Cloud connected digital content distribution platform for digital signage, digital menu boards, & custom developed information panels (apps).  All developed with a few primary goals:

  • Bring amazing features to the client that previously required custom development for each scenario.
  • Synchronise real-time content across multiple players & sites automatically – with no technical knowledge needed.
  • Make it easier for everyone by reducing complexity that plagues other systems, resulting in much lower costs to the client & the business

Signchro consists of 3 primary components – Media Player, Cloud CMS (signchro.net), Remote Control – which are detailed below:

Media Player
Compact yet powerful embedded system based around the Intel NUC, running a highly customised version of Slackware Linux 64bit.  The player is completely autonomous and is configured via the signchro.net cloud CMS.  It is an object oriented digital media system meaning components can be placed anywhere on the screen – not restricted like zone or template based systems.  Multiple channels can be loaded so it can act just like a regular tv service.  The primary technologies used are Dojo, JSON, Javascript, AJAX, & PHP.

Remote Control
Mobile & Tablet optimised application allowing the client to control various aspects of their associated Media Players.  Some of these activities are editing menu items, drawing members badge draws across multiple sites simultaneously, & switching the currently running channels.  Primary technologies used are Dojo, JSON, Javascript, AJAX.

Cloud CMS (signchro.net)
Content creation & player management interface for the client to create their own shows.  Based around the WYSIWYG idea, clients can drag components to where they require within their displays.  A built in content library allows for rapid content creation with very little training or graphic knowledge.  Hosted on a server cluster powered by MariaDB Galera & GlusterFS.

If you are using Signchro (or any digital signage system) please visit signagebank.com for pre-made stock slides and animations for your displays.

For more information please visit www.signchro.com