-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
p_window.js
1 lines (1 loc) · 10.1 KB
/
p_window.js
1
var presentWindowOpen=false;var pWindowX="100";var pWindowY="100";var stageViewWindowX="100";var stageViewWindowY="100";var dualScreen=true;var screenList=null;var stageView=false;var stageViewScreenIndex=2;var newWindow=null;var newStageWindow=null;var presentationContentObj=null;var index_for_presentationContent=0;function getCurrentScreen(){var b;var a=air.Screen.getScreensForRectangle(window.nativeWindow.bounds);(a.length>0)?b=a[0]:b=air.Screen.mainScreen;return b}function getScreenList(){screenList=air.Screen.screens}function fillScreenList(){var f=screenList.length;var c="";var b,e;var a,g;clearSelectList("selectScreenID");clearSelectList("selectStageScreenID");for(var d=0;d<f;d++){b=screenList[d].bounds.width;e=screenList[d].bounds.height;a=screenList[d].bounds.x;g=screenList[d].bounds.y;c="Screen "+(d+1)+" "+b+"x"+e+" @ "+a+","+g;document.getElementById("selectScreenID").options[d]=new Option(c,d);document.getElementById("selectStageScreenID").options[d]=new Option(c,d)}setScreenIndex(vvConfigObj.get_selectedScreenIndex(),f);setStageScreenIndex(vvConfigObj.get_selectedStageScreenIndex(),f)}function getSelectedScreenIndex(){var a=document.getElementById("selectScreenID").selectedIndex;vvConfigObj.set_selectedScreenIndex(a)}function getSelectedStageScreenIndex(){var a=document.getElementById("selectStageScreenID").selectedIndex;vvConfigObj.set_selectedStageScreenIndex(a)}function setScreenIndex(a,b){if(a<b){document.getElementById("selectScreenID").selectedIndex=a}else{document.getElementById("selectScreenID").selectedIndex=0}}function setStageScreenIndex(a,b){if(a<b){document.getElementById("selectStageScreenID").selectedIndex=a}else{document.getElementById("selectStageScreenID").selectedIndex=0}}function addScreenSelectionEvent(){document.getElementById("selectScreenID").addEventListener("change",processScreenSelChange,false);document.getElementById("selectStageScreenID").addEventListener("change",processStageScreenSelChange,false)}function processScreenSelChange(){getSelectedScreenIndex();vvConfigObj.save()}function processStageScreenSelChange(){getSelectedStageScreenIndex();vvConfigObj.save()}function presentation(){stageView=$("#stageConfigEnable").is(":checked");var k=new air.NativeWindowInitOptions();k.systemChrome="none";k.type="lightweight";k.transparent=true;var g=getCurrentScreen();var j=air.Screen.screens;var c;var i;stageViewScreenIndex=vvConfigObj.get_selectedStageScreenIndex();if(j[stageViewScreenIndex]==null){stageViewScreenIndex=0;vvConfigObj.set_selectedStageScreenIndex(stageViewScreenIndex)}stageView=stageView&&(j[stageViewScreenIndex]!=null);var e=vvConfigObj.get_selectedScreenIndex();if(j[e]==null){e=0;vvConfigObj.set_selectedScreenIndex(e)}if(dualScreen&&(j[e]!=null)){c=j[e].bounds;pWindowX=j[e].bounds.width;pWindowY=j[e].bounds.height}else{c=j[0].bounds;pWindowX=j[0].bounds.width;pWindowY=j[0].bounds.height;air.trace("p window singl "+pWindowX+" "+pWindowY)}if(!presentWindowOpen){newWindow=air.HTMLLoader.createRootWindow(true,k,true,c);var b=($("#mainConfigEnable").is(":checked"));newWindow.visible=b;newWindow.addEventListener("htmlDOMInitialize",DOMIntializeCallback);newWindow.window.nativeWindow.addEventListener(air.Event.CLOSE,presentWindowClosed);newWindow.window.nativeWindow.alwaysInFront=vvConfigObj.get_presentationOnTop();newWindow.window.nativeWindow.stage.frameRate=10;newWindow.load(new air.URLRequest("presentation3.htm"));newWindow.window.iamclosingStage=function(){if(stageView&&(newStageWindow!=null)){newStageWindow.window.nativeWindow.close()}};newWindow.window.goToNextSlide=function(){if(stageView&&(newStageWindow!=null)){newStageWindow.window.nextSlide()}updatePresentationContent(true)};newWindow.window.goToPrevSlide=function(){if(stageView&&(newStageWindow!=null)){newStageWindow.window.prevSlide()}updatePresentationContent(false)};if(stageView){var h=new air.NativeWindowInitOptions();var a=vvConfigObj.get_svWindow();i=j[stageViewScreenIndex].bounds;if(a){h.resizable=false;h.maximizable=false;h.minimizable=false;var f=$("#stageviewMiniWindow").is(":checked");if(j[stageViewScreenIndex].bounds.width<1900){i.width=1280/2;i.height=720/2}else{i.width=1280;i.height=720}if(f){i.width/=1.5;i.height/=1.5}}else{h.systemChrome="none";h.type="lightweight";h.transparent=true;h.renderMode="direct"}stageViewWindowX=j[stageViewScreenIndex].bounds.width;stageViewWindowY=j[stageViewScreenIndex].bounds.height;newStageWindow=air.HTMLLoader.createRootWindow(true,h,true,i);newStageWindow.addEventListener("htmlDOMInitialize",DOMIntializeStageViewCallback);newStageWindow.window.nativeWindow.addEventListener(air.Event.CLOSING,closePresentWindowMain);newStageWindow.window.nativeWindow.alwaysInFront=false;newStageWindow.window.nativeWindow.stage.frameRate=10;newStageWindow.load(new air.URLRequest("stageview.htm"));newStageWindow.window.iamclosingPresentation=function(){if(newWindow!=null){newWindow.window.nativeWindow.close()}}}else{newStageWindow=null}presentWindowOpen=true}else{try{newWindow.window.passVariable(0);newWindow.window.updatePresentation();newWindow.window.updateContent()}catch(d){air.trace("Possible double click... NewWindow is still getting ready..")}if(stageView&&(newStageWindow!=null)){try{newStageWindow.window.passVariable(1);newStageWindow.window.updatePresentation();newStageWindow.window.updateContent()}catch(d){air.trace("Possible double click... NewStageWindow is still getting ready..")}}}}function closePresentWindowMain(){if(presentWindowOpen){newWindow.window.nativeWindow.close();newWindow=null;if(!vvConfigObj.get_mainConfigEnable()){presentWindowOpen=false}}if(stageView&&(newStageWindow!=null)){newStageWindow.window.nativeWindow.close();newStageWindow=null}presentationContent=""}function presentWindowClosed(){presentWindowOpen=false;newWindow=null;disableNavButtons(true)}function DOMIntializeCallback(a){newWindow.window.passVariable=passVariable}function DOMIntializeStageViewCallback(a){newStageWindow.window.passVariable=passVariable}function passVariable(o){presentationContent=presentationContentString(p_title,p_text1_font,p_text2_font,p_text1_arr[p_current_index],p_text2_arr[p_current_index]);index_for_presentationContent=p_current_index;this.p_text1_arr=p_text1_arr;this.p_text2_arr=p_text2_arr;this.p_text1_font=p_text1_font;this.p_text2_font=p_text2_font;this.p_title=p_title;this.p_footnote=p_footnote;this.p_current_index=p_current_index;this.p_last_index=p_last_index;this.p_bkgnd_filename=p_bkgnd_filename;this.p_bkgnd_motion=p_bkgnd_motion;this.p_bkgnd_color=vvConfigObj.get_p_solidBkgndColor();this.p_font_color=p_font_color;this.p_font_color2=p_font_color2;this.p_format.mutipleLines=vvConfigObj.get_pformat_multiplelines();if(o==1){var f=$("#thirdview_fcolor").val();this.p_font_color=colorChart[f];this.p_font_color2=colorChart[f]}this.p_bkgnd_color1=vvConfigObj.get_p_bkgnd_color1();this.p_bkgnd_color2=vvConfigObj.get_p_bkgnd_color2();this.p_bkgnd_grad_orient=vvConfigObj.get_p_bkgnd_grad_orient();this.p_motion_bkgnd_index=vvConfigObj.get_p_motion_bkgnd_index();this.p_bkgnd_type=vvConfigObj.get_p_bkgnd_type();if(o==1){var v=vvConfigObj.get_stageStyleVal();if(v!="3"){if(p_text_orientation=="2"){v="2"}}var j=$("#thirdview_opacity").val();var r=$("#thirdview_height").val();var s=$("#thirdview_primary").prop("checked");var l=$("#thirdview_secondary").prop("checked");var g=vvConfigObj.get_svBcolor();var p=vvConfigObj.get_svPosition();var i=vvConfigObj.get_svMaxFontSize();var d=vvConfigObj.get_svTextOutline();var e=vvConfigObj.get_svTextShadow();var c=vvConfigObj.get_svGreenWindow();var n=vvConfigObj.get_svAlignLeft();var k=vvConfigObj.get_svAlignCenter();var q=vvConfigObj.get_svAddTexture();var h=vvConfigObj.get_svShowHorizontal();var m=v+"|"+j+"|"+r+"|"+s+"|"+colorChart[g]+"|"+p+"|"+i+"|"+d+"|"+e+"|"+c;m=m+"|"+n+"|"+k+"|"+q+"|"+h+"|"+l;this.p_text_orientation=m}else{this.p_text_orientation=p_text_orientation}this.p_window_X=pWindowX;this.p_window_Y=pWindowY;if(o==1){this.p_window_X=stageViewWindowX;this.p_window_Y=stageViewWindowY}this.p_topMargin=vvConfigObj.get_p_topMargin();this.p_bottomMargin=vvConfigObj.get_p_bottomMargin();this.p_leftMargin=vvConfigObj.get_p_leftMargin();this.p_rightMargin=vvConfigObj.get_p_rightMargin();this.p_maxFontSize=vvConfigObj.get_p_maxFontSize();this.p_enableTransition=vvConfigObj.get_p_enableTransition();this.p_showTitle=vvConfigObj.get_p_showTitle();this.p_enableShadow=vvConfigObj.get_p_enableShadow();this.p_align=vvConfigObj.get_p_align();if(vvConfigObj.get_showVVLogo()){this.p_logo="VerseVIEW<br>www.verseview.info"}else{this.p_logo=vvConfigObj.get_logoText1()+"<br>"+vvConfigObj.get_logoText2()}if(o==1){this.p_showDate=vvConfigObj.get_svShowDate()}else{this.p_showDate=vvConfigObj.get_showDateTime()}this.p_showLogo=vvConfigObj.get_showVVLogo()||vvConfigObj.get_showCustomLogo();this.p_shadeBackground=graphicsObj.getShadeFlag();this.p_transparentBackground=graphicsObj.getTransparentFlag();this.p_ver1ScaleFactor=p_ver1ScaleFactor;this.p_ver2ScaleFactor=p_ver2ScaleFactor;this.p_isArabic1=false;this.p_isArabic2=false;var t=bibleVersionArray[vvConfigObj.get_version1()][0];var u=t.indexOf("Arabic");if(u!=-1){this.p_isArabic1=true}var t=bibleVersionArray[vvConfigObj.get_version2()][0];var u=t.indexOf("Arabic");if(u!=-1){this.p_isArabic2=true}}function updatePresentationContent(b){var a=p_text1_arr.length;if(b){index_for_presentationContent++;if(index_for_presentationContent>=a){index_for_presentationContent=0}}else{index_for_presentationContent--;if(index_for_presentationContent<0){index_for_presentationContent=a-1}}presentationContent=presentationContentString(p_title,p_text1_font,p_text2_font,p_text1_arr[index_for_presentationContent],p_text2_arr[index_for_presentationContent])}function call_nextSlide(){if(presentWindowOpen){newWindow.window.nextSlide();if(stageView){newStageWindow.window.nextSlide()}}updatePresentationContent(true)}function call_prevSlide(){if(presentWindowOpen){newWindow.window.prevSlide();if(stageView){newStageWindow.window.prevSlide()}}updatePresentationContent(false)}function call_showTheme(){if(newWindow!=null){newWindow.window.showThemeProcess()}}function call_closePresentation(){if(presentWindowOpen){newWindow.window.clearPresenter();if(stageView){newStageWindow.window.nativeWindow.close()}}presentationContent=""};