Jump to content

Search the Community

Showing results for tags 'reference'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. I'm trying to build a simulator to let users train with. It's a good bit of code at the moment so hopefully this isn't too much for someone to look at right now. Basically, it's Windows in a web page. http://tomsfreelance.com/windows_virtual_security/ Current Behavior: When opening two "Outlook" windows, changing the folder in the first window changes the second windows outlook. Desired Behavior: The folders should be specific to the window. Steps to Reproduce: Double click on "Outlook", doubleclick the title bar to take it out of full screen, then open another Outlook window. Next, click on a folder in the first window. Note that the folder changes in the second window. I know the code below is a lot, so if anyone is willing to view the actual site posted above and try and debug what is happening instead I'd appreciate it very much. (Need a second set of eyes on this, because mine aren't finding it.) The entire code can be seen at http://tomsfreelance.com/windows_virtual_security/js/desktop.js The outlook object is created via a function call: function outlook() { var params = { ... menu : ..., messages : ..., panes : ..., functions : { selectFolder : function(that, folder) { //that.aliases['Folder->' + folder].block.css("background-color", "#EEEEEE"); //that.count = 0; //setInterval(function() { that.titleBarContainer.text(++that.count); }, 1000); console.log(that); var that = that; // Set title that.aliases['Current Folder'].block.text(folder); var subPanes = []; // Get messages if (that.options.params.messages[folder]) { for (var i in that.options.params.messages[folder]) { // Rebuild sub pane object. subPanes.push([{ css : { }, "class" : "outlook_preview", text : that.options.params.messages[folder][i].Subject, resizable : false, height : "22px" }]); } } that.aliases['Folder Messages'].block.empty(); var parentPane = $('<table class="child_pane"></table>').appendTo(that.aliases['Folder Messages'].block); that.buildPanes(parentPane, subPanes); } .......... } } }; return params; } And new windows are spawned via function create_window(parameters) { var param = parameters; var window = $('<div></div>').prependTo('body'); window.window({ params : param }); $('#start_menu').hide(); } The random variable reassignments is me trying to break the reference since I have no clue why / where it is happening... (var param = parameters) The "selectFolder" function is called from the Window jQuery widget I created: $(function( $, undefined ) { $.widget("ui.window", $.ui.mouse, { self : this, ..., _create : function() { console.log(this); this.createWindow(); var that = this; $('html').click(function() { $('.menu').hide(); }); }, createWindow : function() { ... // Content panes this.buildPanes(this.panesBlock, this.options.params.panes); this.scalePanes(); ... }, buildPanes : function(paneBlock, panes) { var pane = null; var that = this; for (var i in panes) { this.paneRows++; var rowPane = $('<tr></tr>').appendTo(paneBlock); for (var h in panes[i]) { panes[i][h].block = $('<td class="pane"></td>').appendTo(rowPane); ... if (pane.subPanes) { var parentPane = $('<table class="child_pane"></table>').appendTo(panes[i][h].block); that.buildPanes(parentPane, pane.subPanes); } if (pane.alias) { that.aliases[pane.alias] = pane; } ... if (pane.onClick) { that.onClick(that, pane); } if (pane.onLoad) { that.onLoad(that, pane); } } } }, onClick : function(that, pane) { pane.block.on("click", function() { pane.onClick(that, pane.id); }); }, onLoad : function(that, pane) { var pane = pane; var that = that; pane.onLoad(that, pane.id); }, scalePanes : function(addHeight) { var pane = null; var contentHeight = this.element.outerHeight() - (this.titleBar.outerHeight() + this.menuBar.outerHeight() + this.statusBar.outerHeight()); if (this.element.hasClass("windowed")) contentHeight -= 4; var contentWidth = this.contentBox.outerWidth(); if (addHeight) contentHeight += addHeight; console.log(contentHeight); this.panesBlock.outerHeight(contentHeight); /* for (var i in this.options.params.panes) { pane = this.options.params.panes[i]; if (pane.height) { pane.block.outerHeight(contentHeight * (pane.height / 100)); } if (pane.width) { pane.block.outerWidth(contentWidth * (pane.width / 100)); } } */ }, closeWindow : function() { this.element.remove(); } }); });
  2. i have a foreach statement which looks like this foreach(static::$_components as &$field){ ..some code } in "some code" i sometimes add more components to "static::$_components" member if the insertion happens not at the final iteration it works, and the foreach detect & use the last insertion. but if the insertion happens at the last iteration the foreach statement breaks(ends) without detecting & using the last insertion there is any workaround for this issue beside using for loops and count(array). i prefer using foreach due to performance demands for($iterator = 0, $field = ''; null != ($field = empty(static::$_components[$iterator]) ? null : static::$_components[$iterator]); $iterator++){ ...some code } consumes a lot of memory and proccessing time using for($iterator = 0; $iterator < count(static::$_components); $iterator++){ ...some code } is even worse Thanks in advance
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.