diff --git a/.actionScriptProperties b/.actionScriptProperties index 29554353..17808eb1 100644 --- a/.actionScriptProperties +++ b/.actionScriptProperties @@ -1,15 +1,32 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - + + + diff --git a/.gems b/.gems new file mode 100644 index 00000000..baf508aa --- /dev/null +++ b/.gems @@ -0,0 +1 @@ +captproton-restfulx --version=1.2.3 --source=gems.github.com diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index f53dcdb1..aff05aae 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -7,6 +7,12 @@ class UsersController < ApplicationController def index @users = User.paginate(:page => params[:page], :order => 'profile_updated_at desc') @users_count = User.count + + respond_to do |format| + format.html # index.html.erb + format.xml { render :xml => @users } + format.fxml { render :fxml => @users } + end end def show diff --git a/app/flex/Scratch.mxml b/app/flex/Scratch.mxml new file mode 100644 index 00000000..bb101fdd --- /dev/null +++ b/app/flex/Scratch.mxml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/app/flex/a.mxml b/app/flex/a.mxml new file mode 100755 index 00000000..5c8c42cf --- /dev/null +++ b/app/flex/a.mxml @@ -0,0 +1,45 @@ + + + + + + diff --git a/app/flex/air.png b/app/flex/air.png new file mode 100755 index 00000000..51bea1a4 Binary files /dev/null and b/app/flex/air.png differ diff --git a/app/flex/assets/add.png b/app/flex/assets/add.png new file mode 100644 index 00000000..36e8a08b Binary files /dev/null and b/app/flex/assets/add.png differ diff --git a/app/flex/assets/background.png b/app/flex/assets/background.png new file mode 100644 index 00000000..37ea39a6 Binary files /dev/null and b/app/flex/assets/background.png differ diff --git a/app/flex/assets/fonts/MyriadWebPro-Bold.ttf b/app/flex/assets/fonts/MyriadWebPro-Bold.ttf new file mode 100644 index 00000000..3b54f90d Binary files /dev/null and b/app/flex/assets/fonts/MyriadWebPro-Bold.ttf differ diff --git a/app/flex/assets/fonts/MyriadWebPro-Condensed.ttf b/app/flex/assets/fonts/MyriadWebPro-Condensed.ttf new file mode 100644 index 00000000..03f73614 Binary files /dev/null and b/app/flex/assets/fonts/MyriadWebPro-Condensed.ttf differ diff --git a/app/flex/assets/fonts/MyriadWebPro-CondensedIt.ttf b/app/flex/assets/fonts/MyriadWebPro-CondensedIt.ttf new file mode 100644 index 00000000..920cd92e Binary files /dev/null and b/app/flex/assets/fonts/MyriadWebPro-CondensedIt.ttf differ diff --git a/app/flex/assets/fonts/MyriadWebPro-Italic.ttf b/app/flex/assets/fonts/MyriadWebPro-Italic.ttf new file mode 100644 index 00000000..2dc49bc3 Binary files /dev/null and b/app/flex/assets/fonts/MyriadWebPro-Italic.ttf differ diff --git a/app/flex/assets/fonts/MyriadWebPro.ttf b/app/flex/assets/fonts/MyriadWebPro.ttf new file mode 100644 index 00000000..4bddde53 Binary files /dev/null and b/app/flex/assets/fonts/MyriadWebPro.ttf differ diff --git a/app/flex/assets/pause.png b/app/flex/assets/pause.png new file mode 100644 index 00000000..76ba4226 Binary files /dev/null and b/app/flex/assets/pause.png differ diff --git a/app/flex/assets/play_green.png b/app/flex/assets/play_green.png new file mode 100644 index 00000000..8d36e63f Binary files /dev/null and b/app/flex/assets/play_green.png differ diff --git a/app/flex/assets/remove.png b/app/flex/assets/remove.png new file mode 100644 index 00000000..3819d7a0 Binary files /dev/null and b/app/flex/assets/remove.png differ diff --git a/app/flex/assets/sync_light.swf b/app/flex/assets/sync_light.swf new file mode 100644 index 00000000..20043ba8 Binary files /dev/null and b/app/flex/assets/sync_light.swf differ diff --git a/app/flex/assets/task_complete.png b/app/flex/assets/task_complete.png new file mode 100644 index 00000000..dc507c25 Binary files /dev/null and b/app/flex/assets/task_complete.png differ diff --git a/app/flex/assets/trash.png b/app/flex/assets/trash.png new file mode 100644 index 00000000..1f80ab74 Binary files /dev/null and b/app/flex/assets/trash.png differ diff --git a/app/flex/assets/valid_blue.png b/app/flex/assets/valid_blue.png new file mode 100644 index 00000000..4fe7bf2d Binary files /dev/null and b/app/flex/assets/valid_blue.png differ diff --git a/app/flex/assets/valid_green.png b/app/flex/assets/valid_green.png new file mode 100644 index 00000000..743ef89c Binary files /dev/null and b/app/flex/assets/valid_green.png differ diff --git a/app/flex/eldorado/components/extras/DataSetOption.as b/app/flex/eldorado/components/extras/DataSetOption.as new file mode 100644 index 00000000..08a4e608 --- /dev/null +++ b/app/flex/eldorado/components/extras/DataSetOption.as @@ -0,0 +1,14 @@ +package pomodo.components.extras { + [Bindable] + public class DataSetOption { + + public var label:String; + + public var clazz:Class; + + public function DataSetOption(label:String, clazz:Class) { + this.label = label; + this.clazz = clazz; + } + } +} \ No newline at end of file diff --git a/app/flex/eldorado/components/extras/DoubleClickDataGrid.as b/app/flex/eldorado/components/extras/DoubleClickDataGrid.as new file mode 100644 index 00000000..1958a595 --- /dev/null +++ b/app/flex/eldorado/components/extras/DoubleClickDataGrid.as @@ -0,0 +1,59 @@ +package pomodo.components.extras { + import flash.events.MouseEvent; + + import mx.controls.DataGrid; + import mx.controls.dataGridClasses.DataGridColumn; + import mx.controls.listClasses.IDropInListItemRenderer; + import mx.controls.listClasses.IListItemRenderer; + import mx.events.DataGridEvent; + + public class DoubleClickDataGrid extends DataGrid { + private var triggeredEditable:Boolean = false; + + public function DoubleClickDataGrid() { + super(); + doubleClickEnabled = true; + } + + override protected function mouseDoubleClickHandler(event:MouseEvent):void { + var currentRenderer:IListItemRenderer = mouseEventToItemRenderer(event); + + if (itemRenderer && itemRenderer != itemEditorInstance) { + var dropInItemRenderer:IDropInListItemRenderer = IDropInListItemRenderer(currentRenderer); + if (columns[dropInItemRenderer.listData.columnIndex].editable) { + var currentColumn:DataGridColumn = columns[dropInItemRenderer.listData.columnIndex]; + var dataGridEvent:DataGridEvent = new DataGridEvent(DataGridEvent.ITEM_EDIT_BEGINNING, false, true); + dataGridEvent.columnIndex = dropInItemRenderer.listData.columnIndex; + dataGridEvent.dataField = currentColumn.dataField; + dataGridEvent.rowIndex = dropInItemRenderer.listData.rowIndex + verticalScrollPosition; + dataGridEvent.itemRenderer = currentRenderer; + dispatchEvent(dataGridEvent); + } + } + + super.mouseDoubleClickHandler(event); + } + + override protected function mouseUpHandler(event:MouseEvent):void { + var currentRenderer:IListItemRenderer = mouseEventToItemRenderer(event); + var currentColumn:DataGridColumn; + if (currentRenderer) { + try { + var dropInItemRenderer:IDropInListItemRenderer = IDropInListItemRenderer(currentRenderer); + if (columns[dropInItemRenderer.listData.columnIndex].editable) { + currentColumn = DataGridColumn(columns[dropInItemRenderer.listData.columnIndex]); + currentColumn.editable = false; + } + } catch (e:Error) { + // nothing to do here + } + + } + + super.mouseUpHandler(event); + if (currentColumn) { + currentColumn.editable = true; + } + } + } +} \ No newline at end of file diff --git a/app/flex/eldorado/components/login/LoginScreen.mxml b/app/flex/eldorado/components/login/LoginScreen.mxml new file mode 100644 index 00000000..c422681f --- /dev/null +++ b/app/flex/eldorado/components/login/LoginScreen.mxml @@ -0,0 +1,168 @@ + + + + [Event(name="login", type="flash.events.Event")] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/flex/eldorado/components/main/App.mxml b/app/flex/eldorado/components/main/App.mxml new file mode 100644 index 00000000..fa252526 --- /dev/null +++ b/app/flex/eldorado/components/main/App.mxml @@ -0,0 +1,110 @@ + + + + [Event(name="logout", type="flash.events.Event")] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/flex/eldorado/components/main/CrudNavigator.mxml b/app/flex/eldorado/components/main/CrudNavigator.mxml new file mode 100644 index 00000000..f671ee64 --- /dev/null +++ b/app/flex/eldorado/components/main/CrudNavigator.mxml @@ -0,0 +1,44 @@ + + + + + + + + + + + + diff --git a/app/flex/eldorado/components/main/Footer.mxml b/app/flex/eldorado/components/main/Footer.mxml new file mode 100644 index 00000000..d0533add --- /dev/null +++ b/app/flex/eldorado/components/main/Footer.mxml @@ -0,0 +1,43 @@ + + + + + + + + + diff --git a/app/flex/eldorado/components/main/Header.mxml b/app/flex/eldorado/components/main/Header.mxml new file mode 100644 index 00000000..2e2c10b5 --- /dev/null +++ b/app/flex/eldorado/components/main/Header.mxml @@ -0,0 +1,47 @@ + + + + + + + + + + + diff --git a/app/flex/eldorado/components/main/TextualWorkSummary.mxml b/app/flex/eldorado/components/main/TextualWorkSummary.mxml new file mode 100644 index 00000000..a435abde --- /dev/null +++ b/app/flex/eldorado/components/main/TextualWorkSummary.mxml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/flex/eldorado/components/main/VisualWorkSummary.mxml b/app/flex/eldorado/components/main/VisualWorkSummary.mxml new file mode 100644 index 00000000..70f21364 --- /dev/null +++ b/app/flex/eldorado/components/main/VisualWorkSummary.mxml @@ -0,0 +1,70 @@ + + + + " + ps.item.name + "
" + PomodoUtils.getFormattedTime(ps.item[selectedTimeOption]) + + "[" + PomodoUtils.getCostFormatter().format(ps.item[selectedCostOption]) + + "] (" + ps.percentValue.toFixed(2) + "%)"; + } + + private function selectOption(event:ListEvent):void { + selectedTimeOption = ComboBox(event.currentTarget).selectedItem.timeField; + selectedCostOption = ComboBox(event.currentTarget).selectedItem.costField; + } + + private function selectDataSet(event:ListEvent):void { + selectedDataSet = ComboBox(event.currentTarget).selectedItem as DataSetOption; + } + ]]> +
+ + + + + + + + + +
diff --git a/app/flex/eldorado/components/main/crud/Info.mxml b/app/flex/eldorado/components/main/crud/Info.mxml new file mode 100644 index 00000000..981c7ffe --- /dev/null +++ b/app/flex/eldorado/components/main/crud/Info.mxml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/flex/eldorado/components/main/crud/Projects.mxml b/app/flex/eldorado/components/main/crud/Projects.mxml new file mode 100644 index 00000000..ff7bba07 --- /dev/null +++ b/app/flex/eldorado/components/main/crud/Projects.mxml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/flex/eldorado/components/main/crud/Sprints.mxml b/app/flex/eldorado/components/main/crud/Sprints.mxml new file mode 100644 index 00000000..f2d0bb62 --- /dev/null +++ b/app/flex/eldorado/components/main/crud/Sprints.mxml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/flex/eldorado/components/main/crud/Tasks.mxml b/app/flex/eldorado/components/main/crud/Tasks.mxml new file mode 100644 index 00000000..a396c634 --- /dev/null +++ b/app/flex/eldorado/components/main/crud/Tasks.mxml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/flex/eldorado/components/main/renderers/CalculatedTimeRenderer.mxml b/app/flex/eldorado/components/main/renderers/CalculatedTimeRenderer.mxml new file mode 100644 index 00000000..49a0c4d5 --- /dev/null +++ b/app/flex/eldorado/components/main/renderers/CalculatedTimeRenderer.mxml @@ -0,0 +1,36 @@ + + + + + + + diff --git a/app/flex/eldorado/components/main/renderers/SummaryCostRenderer.mxml b/app/flex/eldorado/components/main/renderers/SummaryCostRenderer.mxml new file mode 100644 index 00000000..58adcde2 --- /dev/null +++ b/app/flex/eldorado/components/main/renderers/SummaryCostRenderer.mxml @@ -0,0 +1,56 @@ + + + + 0) { + var ref:Object = dataProvider.getItemAt(dataValue.rowIndex); + if (ref.hasOwnProperty(dataValue.dataField)) { + var milliseconds:Number = ref[dataValue.dataField]; + totalCost = milliseconds; + } + } + } + } + ]]> + + + \ No newline at end of file diff --git a/app/flex/eldorado/components/main/renderers/SummaryTimeRenderer.mxml b/app/flex/eldorado/components/main/renderers/SummaryTimeRenderer.mxml new file mode 100644 index 00000000..9bcb3500 --- /dev/null +++ b/app/flex/eldorado/components/main/renderers/SummaryTimeRenderer.mxml @@ -0,0 +1,59 @@ + + + + 0) { + var ref:Object = dataProvider.getItemAt(dataValue.rowIndex); + if (ref.hasOwnProperty(dataValue.dataField)) { + var milliseconds:Number = ref[dataValue.dataField]; + totalTime = milliseconds; + } + } + } + } + ]]> + + + \ No newline at end of file diff --git a/app/flex/eldorado/utils/DateUtilities.as b/app/flex/eldorado/utils/DateUtilities.as new file mode 100644 index 00000000..b9fadcdf --- /dev/null +++ b/app/flex/eldorado/utils/DateUtilities.as @@ -0,0 +1,94 @@ +package pomodo.utils { + public class DateUtilities { + public static const MILLISECOND:Number = 1; + public static const SECOND:Number = MILLISECOND * 1000; + public static const MINUTE:Number = SECOND * 60; + public static const HOUR:Number = MINUTE * 60; + public static const DAY:Number = HOUR * 24; + public static const WEEK:Number = DAY * 7; + + public static function addTo(dOriginal:Date, nYears:Number = 0, nMonths:Number = 0, nDays:Number = 0, + nHours:Number = 0, nMinutes:Number = 0, nSeconds:Number = 0, nMilliseconds:Number = 0):Date { + var dNew:Date = new Date(dOriginal.getTime()); + dNew.setFullYear(dNew.getFullYear() + nYears); + dNew.setMonth(dNew.getMonth() + nMonths); + dNew.setDate(dNew.getDate() + nDays); + dNew.setHours(dNew.getHours() + nHours); + dNew.setMinutes(dNew.getMinutes() + nMinutes); + dNew.setSeconds(dNew.getSeconds() + nSeconds); + dNew.setMilliseconds(dNew.getMilliseconds() + nMilliseconds); + return dNew; + } + + public static function elapsedDate(dOne:Date, dTwo:Date = null):Date { + if(dTwo == null) { + dTwo = new Date(); + } + return new Date(dOne.getTime() - dTwo.getTime()); + } + + public static function elapsedMilliseconds(dOne:Date, dTwo:Date = null, bDisregard:Boolean = false):Number { + if(bDisregard) { + return elapsedDate(dOne, dTwo).getUTCMilliseconds(); + } else { + return (dOne.getTime() - dTwo.getTime()); + } + } + + public static function elapsedSeconds(dOne:Date, dTwo:Date = null, bDisregard:Boolean = false):Number { + if(bDisregard) { + return (elapsedDate(dOne, dTwo).getUTCSeconds()); + } else { + return Math.floor(elapsedMilliseconds(dOne, dTwo) / SECOND); + } + } + + public static function elapsedMinutes(dOne:Date, dTwo:Date = null, bDisregard:Boolean = false):Number { + if(bDisregard) { + return (elapsedDate(dOne, dTwo).getUTCMinutes()); + } else { + return Math.floor(elapsedMilliseconds(dOne, dTwo) / MINUTE); + } + } + + public static function elapsedHours(dOne:Date, dTwo:Date = null, bDisregard:Boolean = false):Number { + if(bDisregard) { + return (elapsedDate(dOne, dTwo).getUTCHours()); + } else { + return Math.floor(elapsedMilliseconds(dOne, dTwo) / HOUR); + } + } + + public static function elapsedDays(dOne:Date, dTwo:Date = null, bDisregard:Boolean = false):Number { + if(bDisregard) { + return (elapsedDate(dOne, dTwo).getUTCDate()); + } else { + return Math.floor(elapsedMilliseconds(dOne, dTwo) / DAY); + } + } + + public static function elapsedMonths(dOne:Date, dTwo:Date = null, bDisregard:Boolean = false):Number { + if(bDisregard) { + return (elapsedDate(dOne, dTwo).getUTCMonth()); + } else { + return (elapsedDate(dOne, dTwo).getUTCMonth() + elapsedYears(dOne, dTwo) * 12); + } + } + + public static function elapsedYears(dOne:Date, dTwo:Date = null):Number { + return (elapsedDate(dOne, dTwo).getUTCFullYear() - 1970); + } + + public static function elapsed(dOne:Date, dTwo:Date = null):Object { + var oElapsed:Object = new Object(); + oElapsed.years = elapsedYears(dOne, dTwo); + oElapsed.months = elapsedMonths(dOne, dTwo, true); + oElapsed.days = elapsedDays(dOne, dTwo, true); + oElapsed.hours = elapsedHours(dOne, dTwo, true); + oElapsed.minutes = elapsedMinutes(dOne, dTwo, true); + oElapsed.seconds = elapsedSeconds(dOne, dTwo, true); + oElapsed.milliseconds = elapsedMilliseconds(dOne, dTwo, true); + return oElapsed; + } + } +} \ No newline at end of file diff --git a/app/flex/eldorado/utils/PomodoUtils.as b/app/flex/eldorado/utils/PomodoUtils.as new file mode 100644 index 00000000..a0d7dc4c --- /dev/null +++ b/app/flex/eldorado/utils/PomodoUtils.as @@ -0,0 +1,59 @@ +package pomodo.utils { + import mx.formatters.CurrencyFormatter; + import mx.formatters.DateFormatter; + + public class PomodoUtils { + private static var dateFormatter:DateFormatter; + private static var costFormatter:CurrencyFormatter; + + public static function getTimeFormatter():DateFormatter { + if (!dateFormatter) { + var dateFormatter:DateFormatter = new DateFormatter; + dateFormatter.formatString = "JJ hours NN minutes SS seconds"; + } + return dateFormatter; + } + + public static function getCostFormatter():CurrencyFormatter { + if (!costFormatter) { + var costFormatter:CurrencyFormatter = new CurrencyFormatter; + costFormatter.currencySymbol = "$"; + costFormatter.precision = 2; + costFormatter.rounding = "up"; + costFormatter.decimalSeparatorTo = "."; + costFormatter.thousandsSeparatorTo = ","; + costFormatter.useThousandsSeparator = true; + } + return costFormatter; + } + + [Bindable(event="propertyChange")] + public static function getFormattedTime(milliseconds:Number):String { + if (isNaN(milliseconds)) return ""; + + var hours:int = Math.floor(milliseconds/3600000); + var minutes:int = Math.floor((milliseconds - hours*3600000)/60000); + var seconds:int = Math.floor((milliseconds - hours*3600000 - minutes*60000)/1000); + return formatTime(hours) + ":" + formatTime(minutes) + ":" + formatTime(seconds); + } + + [Bindable(event="propertyChange")] + public static function getWordFormattedTime(milliseconds:Number):String { + var timeParts:Array = getFormattedTime(milliseconds).split(":"); + return wordFormatTime(timeParts[0], "hours") + wordFormatTime(timeParts[1], "minutes") + + wordFormatTime(timeParts[2], "seconds"); + } + + private static function wordFormatTime(time:String, suffix:String):String { + if (time != "00") { + return parseInt(time) + " " + suffix; + } else { + return ""; + } + } + + private static function formatTime(time:int):String { + return (time < 10) ? "0" + time : String(time); + } + } +} \ No newline at end of file diff --git a/app/flex/eldorado/views/crafted/ArticleBox.mxml b/app/flex/eldorado/views/crafted/ArticleBox.mxml new file mode 100644 index 00000000..9ee1ff42 --- /dev/null +++ b/app/flex/eldorado/views/crafted/ArticleBox.mxml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/flex/eldorado/views/crafted/AvatarBox.mxml b/app/flex/eldorado/views/crafted/AvatarBox.mxml new file mode 100644 index 00000000..826ef3ab --- /dev/null +++ b/app/flex/eldorado/views/crafted/AvatarBox.mxml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/flex/eldorado/views/crafted/CategoryBox.mxml b/app/flex/eldorado/views/crafted/CategoryBox.mxml new file mode 100644 index 00000000..4f12a58e --- /dev/null +++ b/app/flex/eldorado/views/crafted/CategoryBox.mxml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/flex/eldorado/views/crafted/CommentBox.mxml b/app/flex/eldorado/views/crafted/CommentBox.mxml new file mode 100644 index 00000000..12ac4423 --- /dev/null +++ b/app/flex/eldorado/views/crafted/CommentBox.mxml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/flex/eldorado/views/crafted/ConfigBox.mxml b/app/flex/eldorado/views/crafted/ConfigBox.mxml new file mode 100644 index 00000000..c53af202 --- /dev/null +++ b/app/flex/eldorado/views/crafted/ConfigBox.mxml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/flex/eldorado/views/crafted/ForumBox.mxml b/app/flex/eldorado/views/crafted/ForumBox.mxml new file mode 100644 index 00000000..4df25c03 --- /dev/null +++ b/app/flex/eldorado/views/crafted/ForumBox.mxml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/flex/eldorado/views/crafted/HappeningBox.mxml b/app/flex/eldorado/views/crafted/HappeningBox.mxml new file mode 100644 index 00000000..81313068 --- /dev/null +++ b/app/flex/eldorado/views/crafted/HappeningBox.mxml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/flex/eldorado/views/crafted/HeaderBox.mxml b/app/flex/eldorado/views/crafted/HeaderBox.mxml new file mode 100644 index 00000000..2da34442 --- /dev/null +++ b/app/flex/eldorado/views/crafted/HeaderBox.mxml @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/flex/eldorado/views/crafted/Home.mxml b/app/flex/eldorado/views/crafted/Home.mxml new file mode 100644 index 00000000..a64642b9 --- /dev/null +++ b/app/flex/eldorado/views/crafted/Home.mxml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/flex/eldorado/views/crafted/MessageBox.mxml b/app/flex/eldorado/views/crafted/MessageBox.mxml new file mode 100644 index 00000000..d837347d --- /dev/null +++ b/app/flex/eldorado/views/crafted/MessageBox.mxml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/flex/eldorado/views/crafted/PostBox.mxml b/app/flex/eldorado/views/crafted/PostBox.mxml new file mode 100644 index 00000000..5b379842 --- /dev/null +++ b/app/flex/eldorado/views/crafted/PostBox.mxml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/flex/eldorado/views/crafted/TopicBox.mxml b/app/flex/eldorado/views/crafted/TopicBox.mxml new file mode 100644 index 00000000..564eea8b --- /dev/null +++ b/app/flex/eldorado/views/crafted/TopicBox.mxml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/flex/example_text_layout_famework.mxml b/app/flex/example_text_layout_famework.mxml new file mode 100755 index 00000000..bb4efd61 --- /dev/null +++ b/app/flex/example_text_layout_famework.mxml @@ -0,0 +1,128 @@ + + + + +
+

+ + Flex is a highly productive, free open source framework for building and maintaining expressive web applications that deploy consistently on all major browsers, desktops, and operating systems. While Flex applications can be built using only the free Flex SDK, developers can use Adobe® Flex® Builder™ 3 software to dramatically accelerate development. Try Flex Builder 3 free for 60 days. Try ILOG Elixir to enhance data display in your Flex applications. +
+

+

+ Adobe® Flex® 3 是用于构建和维护在所有主要浏览器、桌面和操作系统一致地部署的极具表现力的 Web 应用程序的高效率的开放源码框架。 可以使用免费的 Flex SDK 构建 Flex 应用程序, 开发人员可以使用 Adobe Flex Builder™ 3 软件来显著促进开发。 60 天内免费试用 Flex Builder 3 +
+

+
+

+ المستندات المطلوبة: +- نموذج طلب مستوفى الرسوم +
- صورة عن جواز الكفيل +- صورة عن جواز المكفول +- صورة شخصية ملونة للشخص المكفول +- عقد الزواج مصدقاً من وزارة الخارجية أو إحدى سفارات دولة الإمارات - إذا كان المكفول الزوجة / الزوج +- شهادة الميلاد مصدقة من وزارة الخارجية أو إحدى سفارات دولة الإمارات - إذا كان المكفول أحد الأبناء +- وثيقة إثبات صلة القرابة مصدقة من سفارة دولة الإمارات – إذا لم يكن اسم المكفول مدرجاً في جواز سفر الكفيل +- عقد عمل الكفيل مصدقاً إذا كان يعمل في شركة خاصة أو شهادة بالراتب إذا كان يعمل في دائرة حكومية +- التأمين الصحي
+
+

+

+ השרה ציפי לבני נולדה בישראל בשנת 1958, היא נשואה ואם לשני בנים. +השרה שירתה כקצינה בצה"ל ומאוחר יותר עבדה ב"מוסד". +השרה לבני למדה משפטים באוניברסיטת בר אילן והינה עורכת דין במקצועה. במשך עשר שנים עסקה השרה בעריכת דין במשרדה והתמחתה בין השאר, במשפט מסחרי, ציבורי ונדל"ן. +מבין פעילותיה הציבוריות בין השנים 1996 – 1999, כיהנה השרה בתפקיד מנכ"לית רשות החברות הממשלתיות ובתפקיד זה הייתה אחראית על הפרטת החברות והמונופולים הממשלתיים. +השרה לבני נבחרה לכנסת בשנת 1999, מטעם סיעת הליכוד. בכנסת ה-15 הייתה השרה חברה בוועדת חוקה, חוק ומשפט, במסגרת זו, הייתה אחראית על חקיקת החוק למניעת הלבנת הון. כמו כן הייתה השרה חברה בוועדה לקידום מעמד האישה. +בשנת 2001 מונתה לשרה בממשלה ה- 29 וכיהנה בתפקידים הבאים: השרה לשיתוף פעולה אזורי, שרה ללא תיק ושרת החקלאות. +בשנת 2003 מונתה לשרה בממשלה ה-30, וכיהנה בתפקידים הבאים: השרה לקליטת העלייה, שרת הבינוי והשיכון, שרת המשפטים ושרת החוץ. +בממשלה הנוכחית מכהנת השרה לבני כממלאת מקום ראש הממשלה ושרת החוץ. +השרה לבני היא יו"ר מפלגת "קדימה" ונמנית עם מקימי, הוגי ומיישמי מטרותיה ומדיניותה. +

+
+
+; + + private var _textFlow:TextFlow; + + private function init():void { + _textContainer = new Sprite(); + canvas.rawChildren.addChild(_textContainer); + + _textFlow = TextFilter.importToFlow(textInput, TextFilter.TEXT_LAYOUT_FORMAT); + _textFlow.flowComposer.addController(new DisplayObjectContainerController(_textContainer, canvas.width-40, canvas.height)); + _textFlow.addEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGED, picLoaded); + //adding Select/Edit/Copy/Paste/Undo features + _textFlow.interactionManager = new EditManager(new UndoManager()); + // initialize with a selection before the first character + _textFlow.interactionManager.setSelection(0,0); + + _textFlow.flowComposer.updateAllContainers(); + } + + private function picLoaded(event:StatusChangeEvent):void { + var image:InlineGraphicElement = event.element as InlineGraphicElement; + _textFlow.flowComposer.updateAllContainers(); + } + + private function changeFontSize(event:SliderEvent):void { + var cf:CharacterFormat = new CharacterFormat(_textFlow.characterFormat); + cf.fontSize = event.value; + _textFlow.characterFormat = cf; + _textFlow.flowComposer.updateAllContainers(); + } + + private function changeNoColumns(event:SliderEvent):void { + var cf:ContainerFormat = new ContainerFormat(_textFlow.containerFormat); + cf.columnCount = event.value; + cf.columnGap = 15; + _textFlow.containerFormat = cf; + _textFlow.flowComposer.updateAllContainers(); + } + + private function changeTextDirection(event:Event):void { + _textFlow.direction = (event.target as ComboBox).selectedItem.data; + _textFlow.flowComposer.updateAllContainers(); + } + + ]]> +
+ + + + + + + + + + +
diff --git a/html-template/AC_OETags.js b/html-template/AC_OETags.js index e77e6fd8..6366467e 100644 --- a/html-template/AC_OETags.js +++ b/html-template/AC_OETags.js @@ -101,6 +101,8 @@ function GetSwfVer(){ if (versionRevision.indexOf("d") > 0) { versionRevision = versionRevision.substring(0, versionRevision.indexOf("d")); } + } else if (versionRevision[0] == "b") { + versionRevision = versionRevision.substring(1); } var flashVer = versionMajor + "." + versionMinor + "." + versionRevision; } @@ -113,7 +115,7 @@ function GetSwfVer(){ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2; else if ( isIE && isWin && !isOpera ) { flashVer = ControlVersion(); - } + } return flashVer; } @@ -153,10 +155,24 @@ function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) function AC_AddExtension(src, ext) { - if (src.indexOf('?') != -1) - return src.replace(/\?/, ext+'?'); + var qIndex = src.indexOf('?'); + if ( qIndex != -1) + { + // Add the extention (if needed) before the query params + var path = src.substring(0, qIndex); + if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length)) + return src; + else + return src.replace(/\?/, ext+'?'); + } else - return src + ext; + { + // Add the extension (if needed) to the end of the URL + if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length)) + return src; // Already have extension + else + return src + ext; + } } function AC_Generateobj(objAttrs, params, embedAttrs) diff --git a/html-template/history/history.js b/html-template/history/history.js index c86514a9..3279a532 100644 --- a/html-template/history/history.js +++ b/html-template/history/history.js @@ -99,23 +99,40 @@ BrowserHistory = (function() { return document.getElementById("safari_remember_field"); } - /* Get the Flash player object for performing ExternalInterface callbacks. */ - function getPlayer(objectId) { - var objectId = objectId || null; - var player = null; /* AJH, needed? = document.getElementById(getPlayerId()); */ - if (browser.ie && objectId != null) { - player = document.getElementById(objectId); - } - if (player == null) { - player = document.getElementsByTagName('object')[0]; - } - - if (player == null || player.object == null) { - player = document.getElementsByTagName('embed')[0]; - } - - return player; - } + // Get the Flash player object for performing ExternalInterface callbacks. + // Updated for changes to SWFObject2. + function getPlayer(id) { + if (id && document.getElementById(id)) { + var r = document.getElementById(id); + if (typeof r.SetVariable != "undefined") { + return r; + } + else { + var o = r.getElementsByTagName("object"); + var e = r.getElementsByTagName("embed"); + if (o.length > 0 && typeof o[0].SetVariable != "undefined") { + return o[0]; + } + else if (e.length > 0 && typeof e[0].SetVariable != "undefined") { + return e[0]; + } + } + } + else { + var o = document.getElementsByTagName("object"); + var e = document.getElementsByTagName("embed"); + if (e.length > 0 && typeof e[0].SetVariable != "undefined") { + return e[0]; + } + else if (o.length > 0 && typeof o[0].SetVariable != "undefined") { + return o[0]; + } + else if (o.length > 1 && typeof o[1].SetVariable != "undefined") { + return o[1]; + } + } + return undefined; + } function getPlayers() { var players = []; diff --git a/html-template/history/historyFrame.html b/html-template/history/historyFrame.html index e83255f1..07e3806f 100644 --- a/html-template/history/historyFrame.html +++ b/html-template/history/historyFrame.html @@ -22,7 +22,7 @@ var url = document.location.href; processUrl(); - document.write(url); + document.write(encodeURIComponent(url)); Hidden frame for Browser History support. diff --git a/lib/textLayout_conversion.swc b/lib/textLayout_conversion.swc new file mode 100755 index 00000000..0d6301c8 Binary files /dev/null and b/lib/textLayout_conversion.swc differ diff --git a/lib/textLayout_core.swc b/lib/textLayout_core.swc new file mode 100755 index 00000000..14dbc028 Binary files /dev/null and b/lib/textLayout_core.swc differ diff --git a/lib/textLayout_edit.swc b/lib/textLayout_edit.swc new file mode 100755 index 00000000..0f0688b1 Binary files /dev/null and b/lib/textLayout_edit.swc differ diff --git a/public/bin/AC_OETags.js b/public/bin/AC_OETags.js new file mode 100644 index 00000000..6366467e --- /dev/null +++ b/public/bin/AC_OETags.js @@ -0,0 +1,292 @@ +// Flash Player Version Detection - Rev 1.6 +// Detect Client Browser type +// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved. +var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; +var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; +var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false; + +function ControlVersion() +{ + var version; + var axo; + var e; + + // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry + + try { + // version will be set for 7.X or greater players + axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); + version = axo.GetVariable("$version"); + } catch (e) { + } + + if (!version) + { + try { + // version will be set for 6.X players only + axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); + + // installed player is some revision of 6.0 + // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29, + // so we have to be careful. + + // default to the first public version + version = "WIN 6,0,21,0"; + + // throws if AllowScripAccess does not exist (introduced in 6.0r47) + axo.AllowScriptAccess = "always"; + + // safe to call for 6.0r47 or greater + version = axo.GetVariable("$version"); + + } catch (e) { + } + } + + if (!version) + { + try { + // version will be set for 4.X or 5.X player + axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"); + version = axo.GetVariable("$version"); + } catch (e) { + } + } + + if (!version) + { + try { + // version will be set for 3.X player + axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"); + version = "WIN 3,0,18,0"; + } catch (e) { + } + } + + if (!version) + { + try { + // version will be set for 2.X player + axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); + version = "WIN 2,0,0,11"; + } catch (e) { + version = -1; + } + } + + return version; +} + +// JavaScript helper required to detect Flash Player PlugIn version information +function GetSwfVer(){ + // NS/Opera version >= 3 check for Flash plugin in plugin array + var flashVer = -1; + + if (navigator.plugins != null && navigator.plugins.length > 0) { + if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) { + var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : ""; + var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description; + var descArray = flashDescription.split(" "); + var tempArrayMajor = descArray[2].split("."); + var versionMajor = tempArrayMajor[0]; + var versionMinor = tempArrayMajor[1]; + var versionRevision = descArray[3]; + if (versionRevision == "") { + versionRevision = descArray[4]; + } + if (versionRevision[0] == "d") { + versionRevision = versionRevision.substring(1); + } else if (versionRevision[0] == "r") { + versionRevision = versionRevision.substring(1); + if (versionRevision.indexOf("d") > 0) { + versionRevision = versionRevision.substring(0, versionRevision.indexOf("d")); + } + } else if (versionRevision[0] == "b") { + versionRevision = versionRevision.substring(1); + } + var flashVer = versionMajor + "." + versionMinor + "." + versionRevision; + } + } + // MSN/WebTV 2.6 supports Flash 4 + else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4; + // WebTV 2.5 supports Flash 3 + else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3; + // older WebTV supports Flash 2 + else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2; + else if ( isIE && isWin && !isOpera ) { + flashVer = ControlVersion(); + } + return flashVer; +} + +// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available +function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) +{ + versionStr = GetSwfVer(); + if (versionStr == -1 ) { + return false; + } else if (versionStr != 0) { + if(isIE && isWin && !isOpera) { + // Given "WIN 2,0,0,11" + tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"] + tempString = tempArray[1]; // "2,0,0,11" + versionArray = tempString.split(","); // ['2', '0', '0', '11'] + } else { + versionArray = versionStr.split("."); + } + var versionMajor = versionArray[0]; + var versionMinor = versionArray[1]; + var versionRevision = versionArray[2]; + + // is the major.revision >= requested major.revision AND the minor version >= requested minor + if (versionMajor > parseFloat(reqMajorVer)) { + return true; + } else if (versionMajor == parseFloat(reqMajorVer)) { + if (versionMinor > parseFloat(reqMinorVer)) + return true; + else if (versionMinor == parseFloat(reqMinorVer)) { + if (versionRevision >= parseFloat(reqRevision)) + return true; + } + } + return false; + } +} + +function AC_AddExtension(src, ext) +{ + var qIndex = src.indexOf('?'); + if ( qIndex != -1) + { + // Add the extention (if needed) before the query params + var path = src.substring(0, qIndex); + if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length)) + return src; + else + return src.replace(/\?/, ext+'?'); + } + else + { + // Add the extension (if needed) to the end of the URL + if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length)) + return src; // Already have extension + else + return src + ext; + } +} + +function AC_Generateobj(objAttrs, params, embedAttrs) +{ + var str = ''; + if (isIE && isWin && !isOpera) + { + str += ' '; + str += ''; + } else { + str += ' + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/bin/Eldorado.swf b/public/bin/Eldorado.swf index 49f601fa..2f92eee8 100644 Binary files a/public/bin/Eldorado.swf and b/public/bin/Eldorado.swf differ diff --git a/public/bin/Scratch.html b/public/bin/Scratch.html new file mode 100644 index 00000000..fe8ce14e --- /dev/null +++ b/public/bin/Scratch.html @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/bin/Scratch.swf b/public/bin/Scratch.swf new file mode 100644 index 00000000..5a178b9f Binary files /dev/null and b/public/bin/Scratch.swf differ diff --git a/public/bin/air.png b/public/bin/air.png new file mode 100755 index 00000000..51bea1a4 Binary files /dev/null and b/public/bin/air.png differ diff --git a/public/bin/assets/add.png b/public/bin/assets/add.png new file mode 100644 index 00000000..36e8a08b Binary files /dev/null and b/public/bin/assets/add.png differ diff --git a/public/bin/assets/background.png b/public/bin/assets/background.png new file mode 100644 index 00000000..37ea39a6 Binary files /dev/null and b/public/bin/assets/background.png differ diff --git a/public/bin/assets/fonts/MyriadWebPro-Bold.ttf b/public/bin/assets/fonts/MyriadWebPro-Bold.ttf new file mode 100644 index 00000000..3b54f90d Binary files /dev/null and b/public/bin/assets/fonts/MyriadWebPro-Bold.ttf differ diff --git a/public/bin/assets/fonts/MyriadWebPro-Condensed.ttf b/public/bin/assets/fonts/MyriadWebPro-Condensed.ttf new file mode 100644 index 00000000..03f73614 Binary files /dev/null and b/public/bin/assets/fonts/MyriadWebPro-Condensed.ttf differ diff --git a/public/bin/assets/fonts/MyriadWebPro-CondensedIt.ttf b/public/bin/assets/fonts/MyriadWebPro-CondensedIt.ttf new file mode 100644 index 00000000..920cd92e Binary files /dev/null and b/public/bin/assets/fonts/MyriadWebPro-CondensedIt.ttf differ diff --git a/public/bin/assets/fonts/MyriadWebPro-Italic.ttf b/public/bin/assets/fonts/MyriadWebPro-Italic.ttf new file mode 100644 index 00000000..2dc49bc3 Binary files /dev/null and b/public/bin/assets/fonts/MyriadWebPro-Italic.ttf differ diff --git a/public/bin/assets/fonts/MyriadWebPro.ttf b/public/bin/assets/fonts/MyriadWebPro.ttf new file mode 100644 index 00000000..4bddde53 Binary files /dev/null and b/public/bin/assets/fonts/MyriadWebPro.ttf differ diff --git a/public/bin/assets/pause.png b/public/bin/assets/pause.png new file mode 100644 index 00000000..76ba4226 Binary files /dev/null and b/public/bin/assets/pause.png differ diff --git a/public/bin/assets/play_green.png b/public/bin/assets/play_green.png new file mode 100644 index 00000000..8d36e63f Binary files /dev/null and b/public/bin/assets/play_green.png differ diff --git a/public/bin/assets/remove.png b/public/bin/assets/remove.png new file mode 100644 index 00000000..3819d7a0 Binary files /dev/null and b/public/bin/assets/remove.png differ diff --git a/public/bin/assets/sync_light.swf b/public/bin/assets/sync_light.swf new file mode 100644 index 00000000..20043ba8 Binary files /dev/null and b/public/bin/assets/sync_light.swf differ diff --git a/public/bin/assets/task_complete.png b/public/bin/assets/task_complete.png new file mode 100644 index 00000000..dc507c25 Binary files /dev/null and b/public/bin/assets/task_complete.png differ diff --git a/public/bin/assets/trash.png b/public/bin/assets/trash.png new file mode 100644 index 00000000..1f80ab74 Binary files /dev/null and b/public/bin/assets/trash.png differ diff --git a/public/bin/assets/valid_blue.png b/public/bin/assets/valid_blue.png new file mode 100644 index 00000000..4fe7bf2d Binary files /dev/null and b/public/bin/assets/valid_blue.png differ diff --git a/public/bin/assets/valid_green.png b/public/bin/assets/valid_green.png new file mode 100644 index 00000000..743ef89c Binary files /dev/null and b/public/bin/assets/valid_green.png differ diff --git a/public/bin/eldorado/views/crafted/TopicBox.mxml copy b/public/bin/eldorado/views/crafted/TopicBox.mxml copy new file mode 100644 index 00000000..564eea8b --- /dev/null +++ b/public/bin/eldorado/views/crafted/TopicBox.mxml copy @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/bin/history/history.css b/public/bin/history/history.css new file mode 100644 index 00000000..dbc47c61 --- /dev/null +++ b/public/bin/history/history.css @@ -0,0 +1,6 @@ +/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */ + +#ie_historyFrame { width: 0px; height: 0px; display:none } +#firefox_anchorDiv { width: 0px; height: 0px; display:none } +#safari_formDiv { width: 0px; height: 0px; display:none } +#safari_rememberDiv { width: 0px; height: 0px; display:none } diff --git a/public/bin/history/history.js b/public/bin/history/history.js new file mode 100644 index 00000000..3279a532 --- /dev/null +++ b/public/bin/history/history.js @@ -0,0 +1,662 @@ +BrowserHistoryUtils = { + addEvent: function(elm, evType, fn, useCapture) { + useCapture = useCapture || false; + if (elm.addEventListener) { + elm.addEventListener(evType, fn, useCapture); + return true; + } + else if (elm.attachEvent) { + var r = elm.attachEvent('on' + evType, fn); + return r; + } + else { + elm['on' + evType] = fn; + } + } +} + +BrowserHistory = (function() { + // type of browser + var browser = { + ie: false, + firefox: false, + safari: false, + opera: false, + version: -1 + }; + + // if setDefaultURL has been called, our first clue + // that the SWF is ready and listening + //var swfReady = false; + + // the URL we'll send to the SWF once it is ready + //var pendingURL = ''; + + // Default app state URL to use when no fragment ID present + var defaultHash = ''; + + // Last-known app state URL + var currentHref = document.location.href; + + // Initial URL (used only by IE) + var initialHref = document.location.href; + + // Initial URL (used only by IE) + var initialHash = document.location.hash; + + // History frame source URL prefix (used only by IE) + var historyFrameSourcePrefix = 'history/historyFrame.html?'; + + // History maintenance (used only by Safari) + var currentHistoryLength = -1; + + var historyHash = []; + + var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash); + + var backStack = []; + var forwardStack = []; + + var currentObjectId = null; + + //UserAgent detection + var useragent = navigator.userAgent.toLowerCase(); + + if (useragent.indexOf("opera") != -1) { + browser.opera = true; + } else if (useragent.indexOf("msie") != -1) { + browser.ie = true; + browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4)); + } else if (useragent.indexOf("safari") != -1) { + browser.safari = true; + browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7)); + } else if (useragent.indexOf("gecko") != -1) { + browser.firefox = true; + } + + if (browser.ie == true && browser.version == 7) { + window["_ie_firstload"] = false; + } + + // Accessor functions for obtaining specific elements of the page. + function getHistoryFrame() + { + return document.getElementById('ie_historyFrame'); + } + + function getAnchorElement() + { + return document.getElementById('firefox_anchorDiv'); + } + + function getFormElement() + { + return document.getElementById('safari_formDiv'); + } + + function getRememberElement() + { + return document.getElementById("safari_remember_field"); + } + + // Get the Flash player object for performing ExternalInterface callbacks. + // Updated for changes to SWFObject2. + function getPlayer(id) { + if (id && document.getElementById(id)) { + var r = document.getElementById(id); + if (typeof r.SetVariable != "undefined") { + return r; + } + else { + var o = r.getElementsByTagName("object"); + var e = r.getElementsByTagName("embed"); + if (o.length > 0 && typeof o[0].SetVariable != "undefined") { + return o[0]; + } + else if (e.length > 0 && typeof e[0].SetVariable != "undefined") { + return e[0]; + } + } + } + else { + var o = document.getElementsByTagName("object"); + var e = document.getElementsByTagName("embed"); + if (e.length > 0 && typeof e[0].SetVariable != "undefined") { + return e[0]; + } + else if (o.length > 0 && typeof o[0].SetVariable != "undefined") { + return o[0]; + } + else if (o.length > 1 && typeof o[1].SetVariable != "undefined") { + return o[1]; + } + } + return undefined; + } + + function getPlayers() { + var players = []; + if (players.length == 0) { + var tmp = document.getElementsByTagName('object'); + players = tmp; + } + + if (players.length == 0 || players[0].object == null) { + var tmp = document.getElementsByTagName('embed'); + players = tmp; + } + return players; + } + + function getIframeHash() { + var doc = getHistoryFrame().contentWindow.document; + var hash = String(doc.location.search); + if (hash.length == 1 && hash.charAt(0) == "?") { + hash = ""; + } + else if (hash.length >= 2 && hash.charAt(0) == "?") { + hash = hash.substring(1); + } + return hash; + } + + /* Get the current location hash excluding the '#' symbol. */ + function getHash() { + // It would be nice if we could use document.location.hash here, + // but it's faulty sometimes. + var idx = document.location.href.indexOf('#'); + return (idx >= 0) ? document.location.href.substr(idx+1) : ''; + } + + /* Get the current location hash excluding the '#' symbol. */ + function setHash(hash) { + // It would be nice if we could use document.location.hash here, + // but it's faulty sometimes. + if (hash == '') hash = '#' + document.location.hash = hash; + } + + function createState(baseUrl, newUrl, flexAppUrl) { + return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null }; + } + + /* Add a history entry to the browser. + * baseUrl: the portion of the location prior to the '#' + * newUrl: the entire new URL, including '#' and following fragment + * flexAppUrl: the portion of the location following the '#' only + */ + function addHistoryEntry(baseUrl, newUrl, flexAppUrl) { + + //delete all the history entries + forwardStack = []; + + if (browser.ie) { + //Check to see if we are being asked to do a navigate for the first + //history entry, and if so ignore, because it's coming from the creation + //of the history iframe + if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) { + currentHref = initialHref; + return; + } + if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) { + newUrl = baseUrl + '#' + defaultHash; + flexAppUrl = defaultHash; + } else { + // for IE, tell the history frame to go somewhere without a '#' + // in order to get this entry into the browser history. + getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl; + } + setHash(flexAppUrl); + } else { + + //ADR + if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) { + initialState = createState(baseUrl, newUrl, flexAppUrl); + } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) { + backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl); + } + + if (browser.safari) { + // for Safari, submit a form whose action points to the desired URL + if (browser.version <= 419.3) { + var file = window.location.pathname.toString(); + file = file.substring(file.lastIndexOf("/")+1); + getFormElement().innerHTML = '
'; + //get the current elements and add them to the form + var qs = window.location.search.substring(1); + var qs_arr = qs.split("&"); + for (var i = 0; i < qs_arr.length; i++) { + var tmp = qs_arr[i].split("="); + var elem = document.createElement("input"); + elem.type = "hidden"; + elem.name = tmp[0]; + elem.value = tmp[1]; + document.forms.historyForm.appendChild(elem); + } + document.forms.historyForm.submit(); + } else { + top.location.hash = flexAppUrl; + } + // We also have to maintain the history by hand for Safari + historyHash[history.length] = flexAppUrl; + _storeStates(); + } else { + // Otherwise, write an anchor into the page and tell the browser to go there + addAnchor(flexAppUrl); + setHash(flexAppUrl); + } + } + backStack.push(createState(baseUrl, newUrl, flexAppUrl)); + } + + function _storeStates() { + if (browser.safari) { + getRememberElement().value = historyHash.join(","); + } + } + + function handleBackButton() { + //The "current" page is always at the top of the history stack. + var current = backStack.pop(); + if (!current) { return; } + var last = backStack[backStack.length - 1]; + if (!last && backStack.length == 0){ + last = initialState; + } + forwardStack.push(current); + } + + function handleForwardButton() { + //summary: private method. Do not call this directly. + + var last = forwardStack.pop(); + if (!last) { return; } + backStack.push(last); + } + + function handleArbitraryUrl() { + //delete all the history entries + forwardStack = []; + } + + /* Called periodically to poll to see if we need to detect navigation that has occurred */ + function checkForUrlChange() { + + if (browser.ie) { + if (currentHref != document.location.href && currentHref + '#' != document.location.href) { + //This occurs when the user has navigated to a specific URL + //within the app, and didn't use browser back/forward + //IE seems to have a bug where it stops updating the URL it + //shows the end-user at this point, but programatically it + //appears to be correct. Do a full app reload to get around + //this issue. + if (browser.version < 7) { + currentHref = document.location.href; + document.location.reload(); + } else { + if (getHash() != getIframeHash()) { + // this.iframe.src = this.blankURL + hash; + var sourceToSet = historyFrameSourcePrefix + getHash(); + getHistoryFrame().src = sourceToSet; + } + } + } + } + + if (browser.safari) { + // For Safari, we have to check to see if history.length changed. + if (currentHistoryLength >= 0 && history.length != currentHistoryLength) { + //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|")); + // If it did change, then we have to look the old state up + // in our hand-maintained array since document.location.hash + // won't have changed, then call back into BrowserManager. + currentHistoryLength = history.length; + var flexAppUrl = historyHash[currentHistoryLength]; + if (flexAppUrl == '') { + //flexAppUrl = defaultHash; + } + //ADR: to fix multiple + if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) { + var pl = getPlayers(); + for (var i = 0; i < pl.length; i++) { + pl[i].browserURLChange(flexAppUrl); + } + } else { + getPlayer().browserURLChange(flexAppUrl); + } + _storeStates(); + } + } + if (browser.firefox) { + if (currentHref != document.location.href) { + var bsl = backStack.length; + + var urlActions = { + back: false, + forward: false, + set: false + } + + if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) { + urlActions.back = true; + // FIXME: could this ever be a forward button? + // we can't clear it because we still need to check for forwards. Ugg. + // clearInterval(this.locationTimer); + handleBackButton(); + } + + // first check to see if we could have gone forward. We always halt on + // a no-hash item. + if (forwardStack.length > 0) { + if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) { + urlActions.forward = true; + handleForwardButton(); + } + } + + // ok, that didn't work, try someplace back in the history stack + if ((bsl >= 2) && (backStack[bsl - 2])) { + if (backStack[bsl - 2].flexAppUrl == getHash()) { + urlActions.back = true; + handleBackButton(); + } + } + + if (!urlActions.back && !urlActions.forward) { + var foundInStacks = { + back: -1, + forward: -1 + } + + for (var i = 0; i < backStack.length; i++) { + if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) { + arbitraryUrl = true; + foundInStacks.back = i; + } + } + for (var i = 0; i < forwardStack.length; i++) { + if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) { + arbitraryUrl = true; + foundInStacks.forward = i; + } + } + handleArbitraryUrl(); + } + + // Firefox changed; do a callback into BrowserManager to tell it. + currentHref = document.location.href; + var flexAppUrl = getHash(); + if (flexAppUrl == '') { + //flexAppUrl = defaultHash; + } + //ADR: to fix multiple + if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) { + var pl = getPlayers(); + for (var i = 0; i < pl.length; i++) { + pl[i].browserURLChange(flexAppUrl); + } + } else { + getPlayer().browserURLChange(flexAppUrl); + } + } + } + //setTimeout(checkForUrlChange, 50); + } + + /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */ + function addAnchor(flexAppUrl) + { + if (document.getElementsByName(flexAppUrl).length == 0) { + getAnchorElement().innerHTML += "" + flexAppUrl + ""; + } + } + + var _initialize = function () { + if (browser.ie) + { + var scripts = document.getElementsByTagName('script'); + for (var i = 0, s; s = scripts[i]; i++) { + if (s.src.indexOf("history.js") > -1) { + var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html"); + } + } + historyFrameSourcePrefix = iframe_location + "?"; + var src = historyFrameSourcePrefix; + + var iframe = document.createElement("iframe"); + iframe.id = 'ie_historyFrame'; + iframe.name = 'ie_historyFrame'; + //iframe.src = historyFrameSourcePrefix; + try { + document.body.appendChild(iframe); + } catch(e) { + setTimeout(function() { + document.body.appendChild(iframe); + }, 0); + } + } + + if (browser.safari) + { + var rememberDiv = document.createElement("div"); + rememberDiv.id = 'safari_rememberDiv'; + document.body.appendChild(rememberDiv); + rememberDiv.innerHTML = ''; + + var formDiv = document.createElement("div"); + formDiv.id = 'safari_formDiv'; + document.body.appendChild(formDiv); + + var reloader_content = document.createElement('div'); + reloader_content.id = 'safarireloader'; + var scripts = document.getElementsByTagName('script'); + for (var i = 0, s; s = scripts[i]; i++) { + if (s.src.indexOf("history.js") > -1) { + html = (new String(s.src)).replace(".js", ".html"); + } + } + reloader_content.innerHTML = ''; + document.body.appendChild(reloader_content); + reloader_content.style.position = 'absolute'; + reloader_content.style.left = reloader_content.style.top = '-9999px'; + iframe = reloader_content.getElementsByTagName('iframe')[0]; + + if (document.getElementById("safari_remember_field").value != "" ) { + historyHash = document.getElementById("safari_remember_field").value.split(","); + } + + } + + if (browser.firefox) + { + var anchorDiv = document.createElement("div"); + anchorDiv.id = 'firefox_anchorDiv'; + document.body.appendChild(anchorDiv); + } + + //setTimeout(checkForUrlChange, 50); + } + + return { + historyHash: historyHash, + backStack: function() { return backStack; }, + forwardStack: function() { return forwardStack }, + getPlayer: getPlayer, + initialize: function(src) { + _initialize(src); + }, + setURL: function(url) { + document.location.href = url; + }, + getURL: function() { + return document.location.href; + }, + getTitle: function() { + return document.title; + }, + setTitle: function(title) { + try { + backStack[backStack.length - 1].title = title; + } catch(e) { } + //if on safari, set the title to be the empty string. + if (browser.safari) { + if (title == "") { + try { + var tmp = window.location.href.toString(); + title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#")); + } catch(e) { + title = ""; + } + } + } + document.title = title; + }, + setDefaultURL: function(def) + { + defaultHash = def; + def = getHash(); + //trailing ? is important else an extra frame gets added to the history + //when navigating back to the first page. Alternatively could check + //in history frame navigation to compare # and ?. + if (browser.ie) + { + window['_ie_firstload'] = true; + var sourceToSet = historyFrameSourcePrefix + def; + var func = function() { + getHistoryFrame().src = sourceToSet; + window.location.replace("#" + def); + setInterval(checkForUrlChange, 50); + } + try { + func(); + } catch(e) { + window.setTimeout(function() { func(); }, 0); + } + } + + if (browser.safari) + { + currentHistoryLength = history.length; + if (historyHash.length == 0) { + historyHash[currentHistoryLength] = def; + var newloc = "#" + def; + window.location.replace(newloc); + } else { + //alert(historyHash[historyHash.length-1]); + } + //setHash(def); + setInterval(checkForUrlChange, 50); + } + + + if (browser.firefox || browser.opera) + { + var reg = new RegExp("#" + def + "$"); + if (window.location.toString().match(reg)) { + } else { + var newloc ="#" + def; + window.location.replace(newloc); + } + setInterval(checkForUrlChange, 50); + //setHash(def); + } + + }, + + /* Set the current browser URL; called from inside BrowserManager to propagate + * the application state out to the container. + */ + setBrowserURL: function(flexAppUrl, objectId) { + if (browser.ie && typeof objectId != "undefined") { + currentObjectId = objectId; + } + //fromIframe = fromIframe || false; + //fromFlex = fromFlex || false; + //alert("setBrowserURL: " + flexAppUrl); + //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ; + + var pos = document.location.href.indexOf('#'); + var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href; + var newUrl = baseUrl + '#' + flexAppUrl; + + if (document.location.href != newUrl && document.location.href + '#' != newUrl) { + currentHref = newUrl; + addHistoryEntry(baseUrl, newUrl, flexAppUrl); + currentHistoryLength = history.length; + } + + return false; + }, + + browserURLChange: function(flexAppUrl) { + var objectId = null; + if (browser.ie && currentObjectId != null) { + objectId = currentObjectId; + } + pendingURL = ''; + + if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) { + var pl = getPlayers(); + for (var i = 0; i < pl.length; i++) { + try { + pl[i].browserURLChange(flexAppUrl); + } catch(e) { } + } + } else { + try { + getPlayer(objectId).browserURLChange(flexAppUrl); + } catch(e) { } + } + + currentObjectId = null; + } + + } + +})(); + +// Initialization + +// Automated unit testing and other diagnostics + +function setURL(url) +{ + document.location.href = url; +} + +function backButton() +{ + history.back(); +} + +function forwardButton() +{ + history.forward(); +} + +function goForwardOrBackInHistory(step) +{ + history.go(step); +} + +//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); }); +(function(i) { + var u =navigator.userAgent;var e=/*@cc_on!@*/false; + var st = setTimeout; + if(/webkit/i.test(u)){ + st(function(){ + var dr=document.readyState; + if(dr=="loaded"||dr=="complete"){i()} + else{st(arguments.callee,10);}},10); + } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){ + document.addEventListener("DOMContentLoaded",i,false); + } else if(e){ + (function(){ + var t=document.createElement('doc:rdy'); + try{t.doScroll('left'); + i();t=null; + }catch(e){st(arguments.callee,0);}})(); + } else{ + window.onload=i; + } +})( function() {BrowserHistory.initialize();} ); diff --git a/public/bin/history/historyFrame.html b/public/bin/history/historyFrame.html new file mode 100644 index 00000000..07e3806f --- /dev/null +++ b/public/bin/history/historyFrame.html @@ -0,0 +1,29 @@ + + + + + + + + Hidden frame for Browser History support. + + diff --git a/public/bin/playerProductInstall.swf b/public/bin/playerProductInstall.swf new file mode 100644 index 00000000..bdc34378 Binary files /dev/null and b/public/bin/playerProductInstall.swf differ